Skip to content

Commit

Permalink
core: add iwinfo.nl80211.phyname
Browse files Browse the repository at this point in the history
find_phy from iwinfo.nl80211.phyname at first
if it is nil, check by path or macaddr
  • Loading branch information
maurerle committed Dec 31, 2024
1 parent 1336251 commit 5b67512
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ local util = require 'gluon.util'
local unistd = require 'posix.unistd'
local dirent = require 'posix.dirent'

local iwinfo = require 'iwinfo'


local M = {}

Expand Down Expand Up @@ -50,8 +52,9 @@ local function find_phy_by_macaddr(macaddr)
end

function M.find_phy(config)
if not config or config.type ~= 'mac80211' then
return nil
phyname = iwinfo.nl80211.phyname(config['.name'])
if phyname then
return phyname
elseif config.path then
return find_phy_by_path(config.path)
elseif config.macaddr then
Expand Down

0 comments on commit 5b67512

Please sign in to comment.