mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-31 16:35:44 +00:00
mac80211: autodetect the default phy mode based on 11n and freq capabilities
SVN-Revision: 17825
This commit is contained in:
parent
d8aa4acfda
commit
eb59d14aac
@ -272,12 +272,17 @@ detect_mac80211() {
|
|||||||
[ -n "$type" ] || break
|
[ -n "$type" ] || break
|
||||||
devidx=$(($devidx + 1))
|
devidx=$(($devidx + 1))
|
||||||
done
|
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
|
cat <<EOF
|
||||||
config wifi-device wifi$devidx
|
config wifi-device wifi$devidx
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option channel 5
|
option channel 5
|
||||||
option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)
|
option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)
|
||||||
|
option hwmode 11${mode_11n}${mode_band}
|
||||||
# REMOVE THIS LINE TO ENABLE WIFI:
|
# REMOVE THIS LINE TO ENABLE WIFI:
|
||||||
option disabled 1
|
option disabled 1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user