diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-06-09 14:32:32 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-06-10 10:15:39 +0200 |
commit | e1d57d4d4349efaa0d0cb4246456d1433b71ce7e (patch) | |
tree | b207013c30412cdecf9ab20996716f1655708d19 /package/kernel/mac80211/files/lib/netifd | |
parent | 6e8475bbd0c841043c1187fb5a42d835071ad502 (diff) | |
download | upstream-e1d57d4d4349efaa0d0cb4246456d1433b71ce7e.tar.gz upstream-e1d57d4d4349efaa0d0cb4246456d1433b71ce7e.tar.bz2 upstream-e1d57d4d4349efaa0d0cb4246456d1433b71ce7e.zip |
mac80211: rely on iwinfo for phy->path and path->phy lookups
This avoids inconsistencies from having multiple implementations do the same thing
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/files/lib/netifd')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/mac80211.sh | 36 | ||||
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 3 |
2 files changed, 1 insertions, 38 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/mac80211.sh deleted file mode 100644 index 92e5c0e395..0000000000 --- a/package/kernel/mac80211/files/lib/netifd/mac80211.sh +++ /dev/null @@ -1,36 +0,0 @@ -mac80211_phy_to_path() { - local phy="$1" - - [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${phy} ] || return - - local path="$(readlink -f /sys/class/ieee80211/${phy}/device)" - [ -n "$path" ] || return - - path="${path##/sys/devices/}" - case "$path" in - platform*/pci*) path="${path##platform/}";; - esac - - local p - local seq="" - for p in $(ls /sys/class/ieee80211/$phy/device/ieee80211); do - [ "$p" = "$phy" ] && { - echo "$path${seq:++$seq}" - break - } - - seq=$((${seq:-0} + 1)) - done -} - -mac80211_path_to_phy() { - local path="$1" - - local p - for p in $(ls /sys/class/ieee80211); do - local cur="$(mac80211_phy_to_path "$p")" - case "$cur" in - *$path) echo "$p"; return;; - esac - done -} diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index f1ed47802a..c9a0fe542a 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1,7 +1,6 @@ #!/bin/sh . /lib/netifd/netifd-wireless.sh . /lib/netifd/hostapd.sh -. /lib/netifd/mac80211.sh init_wireless_driver "$@" @@ -546,7 +545,7 @@ mac80211_generate_mac() { find_phy() { [ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0 [ -n "$path" ] && { - phy="$(mac80211_path_to_phy "$path")" + phy="$(iwinfo nl80211 phyname "path=$path")" [ -n "$phy" ] && return 0 } [ -n "$macaddr" ] && { |