hostapd,madwifi: rename agmode option to hwmode. 11a and 11g aren't the only allowed values

SVN-Revision: 13790
lede-17.01
Andy Boyett 2008-12-31 19:09:26 +00:00
parent 359ce7f97e
commit 35078a6a52
3 changed files with 25 additions and 25 deletions

View File

@ -31,7 +31,7 @@ config wifi-iface
config wifi-device "wifi0" config wifi-device "wifi0"
option type "atheros" option type "atheros"
option channel "5" option channel "5"
option agmode "11g" option hwmode "11g"
config wifi-iface config wifi-iface
option device "wifi0" option device "wifi0"
@ -99,7 +99,7 @@ config wifi-device wifi device name
option channel 1-14 option channel 1-14
option maxassoc 1-128 (broadcom only) option maxassoc 1-128 (broadcom only)
option distance 1-n option distance 1-n
option agmode 11b, 11g, 11a, 11bg (atheros only) option hwmode 11b, 11g, 11a, 11bg (atheros, mac80211)
option rxantenna 0,1,2 (atheros, broadcom) option rxantenna 0,1,2 (atheros, broadcom)
option txantenna 0,1,2 (atheros, broadcom) option txantenna 0,1,2 (atheros, broadcom)

View File

@ -74,20 +74,20 @@ hostapd_setup_vif() {
config_get ssid "$vif" ssid config_get ssid "$vif" ssid
config_get device "$vif" device config_get device "$vif" device
config_get channel "$device" channel config_get channel "$device" channel
config_get agmode "$device" agmode config_get hwmode "$device" hwmode
case "$agmode" in case "$hwmode" in
11a) agmode=a;; 11a) hwmode=a;;
11b) agmode=b;; 11b) hwmode=b;;
11g) agmode=g;; 11g) hwmode=g;;
*) *)
agmode= hwmode=
[ "$channel" -gt 14 ] && agmode=a [ "$channel" -gt 14 ] && hwmode=a
;; ;;
esac esac
cat > /var/run/hostapd-$ifname.conf <<EOF cat > /var/run/hostapd-$ifname.conf <<EOF
driver=$driver driver=$driver
interface=$ifname interface=$ifname
hw_mode=${agmode:-g} hw_mode=${hwmode:-g}
channel=$channel channel=$channel
${bridge:+bridge=$bridge} ${bridge:+bridge=$bridge}
ssid=$ssid ssid=$ssid

View File

@ -95,22 +95,22 @@ enable_atheros() {
config_set "$vif" ifname "$ifname" config_set "$vif" ifname "$ifname"
# only need to change freq band and channel on the first vif # only need to change freq band and channel on the first vif
config_get agmode "$device" agmode config_get hwmode "$device" hwmode
[ -z "$agmode" ] && config_get agmode "$device" mode [ -z "$hwmode" ] && config_get hwmode "$device" mode
pureg=0 pureg=0
case "$agmode" in case "$hwmode" in
*b) agmode=11b;; *b) hwmode=11b;;
*bg) agmode=11g;; *bg) hwmode=11g;;
*g) agmode=11g; pureg=1;; *g) hwmode=11g; pureg=1;;
*gdt) agmode=11gdt;; *gdt) hwmode=11gdt;;
*a) agmode=11a;; *a) hwmode=11a;;
*adt) agmode=11adt;; *adt) hwmode=11adt;;
*ast) agmode=11ast;; *ast) hwmode=11ast;;
*fh) agmode=fh;; *fh) hwmode=fh;;
*) agmode=auto;; *) hwmode=auto;;
esac esac
iwpriv "$ifname" mode "$agmode" iwpriv "$ifname" mode "$hwmode"
iwpriv "$ifname" pureg "$pureg" iwpriv "$ifname" pureg "$pureg"
[ "$first" = 1 ] && { [ "$first" = 1 ] && {