mac80211: rely on iwinfo for phy->path and path->phy lookups
[openwrt/openwrt.git] / package / kernel / mac80211 / files / lib / wifi / mac80211.sh
index 5eb7cc4c610771a0b822201e9d86703b0cac9b8f..6aa46b0c747c023e5e02020e0f9212c00eda9cc8 100644 (file)
@@ -1,5 +1,4 @@
 #!/bin/sh
-. /lib/netifd/mac80211.sh
 
 append DRIVERS "mac80211"
 
@@ -11,7 +10,7 @@ lookup_phy() {
        local devpath
        config_get devpath "$device" path
        [ -n "$devpath" ] && {
-               phy="$(mac80211_path_to_phy "$devpath")"
+               phy="$(iwinfo nl80211 phyname "path=$devpath")"
                [ -n "$phy" ] && return
        }
 
@@ -161,7 +160,7 @@ detect_mac80211() {
 
                get_band_defaults "$dev"
 
-               path="$(mac80211_phy_to_path "$dev")"
+               path="$(iwinfo nl80211 path "$dev")"
                if [ -n "$path" ]; then
                        dev_id="set wireless.radio${devidx}.path='$path'"
                else