summaryrefslogtreecommitdiff
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-10-02 19:41:04 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-10-02 19:41:04 +0000
commiteb59d14aacc23d2401d91411eeb2cd55df4033fa (patch)
tree904f4f8fcde55a7c845a3767c3df24a7de5b776f /package/mac80211
parentd8aa4acfda04a2c2b3d0c116401f7585867ca61e (diff)
downloadmtk-20170518-eb59d14aacc23d2401d91411eeb2cd55df4033fa.zip
mtk-20170518-eb59d14aacc23d2401d91411eeb2cd55df4033fa.tar.gz
mtk-20170518-eb59d14aacc23d2401d91411eeb2cd55df4033fa.tar.bz2
mac80211: autodetect the default phy mode based on 11n and freq capabilities
SVN-Revision: 17825
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 3acb3dc..a7b3005 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -272,12 +272,17 @@ detect_mac80211() {
[ -n "$type" ] || break
devidx=$(($devidx + 1))
done
+ mode_11n=""
+ mode_band="g"
+ iw phy "$dev" info | grep -q 'HT cap' && mode_11n="n"
+ iw phy "$dev" info | grep -q '2412 MHz' || mode_band="a"
cat <<EOF
config wifi-device wifi$devidx
option type mac80211
option channel 5
option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)
+ option hwmode 11${mode_11n}${mode_band}
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1