broadcom-wl: implement "hwmode" uci option, supports 11b (B only), 11g (G only),...
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Apr 2010 21:33:05 +0000 (21:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Apr 2010 21:33:05 +0000 (21:33 +0000)
SVN-Revision: 20740

package/broadcom-wl/files/lib/wifi/broadcom.sh
package/broadcom-wl/src/wlc/wlc.c

index c444ce8fd58fa4276ff6dfadae6936857b49905a..5350df44d4d48eb25dfe59759c18121324bfaf07 100644 (file)
@@ -128,6 +128,7 @@ enable_broadcom() {
        config_get txpower "$device" txpower
        config_get frag "$device" frag
        config_get rts "$device" rts
+       config_get hwmode "$device" hwmode
        local vif_pre_up vif_post_up vif_do_up vif_txpower
        local doth=0
        local wmm=0
@@ -159,6 +160,13 @@ enable_broadcom() {
                ;;
        esac
 
+       case "$hwmode" in
+               *b)   hwmode=0;;
+               *g)   hwmode=2;;
+               *gst) hwmode=4;;
+               *)    hwmode=1;;
+       esac
+
        for vif in $vifs; do
                config_get vif_txpower "$vif" txpower
 
@@ -290,6 +298,7 @@ enable_broadcom() {
        wlc ifname "$device" stdin <<EOF
 $ifdown
 
+gmode ${hwmode:-1}
 apsta $apsta
 ap $ap
 ${mssid:+mssid $mssid}
index 747b3d5bb978371df2c3473bafd428f9a153f753..5a512349f6abe8679c04a2f2dbb7ff904b3d2ad7 100644 (file)
@@ -919,6 +919,13 @@ static const struct wlc_call wlc_calls[] = {
                .handler = wlc_maclist,
                .desc = "MACs of associated stations"
        },
+       {
+               .name = "gmode",
+               .param = INT,
+               .data.num = ((WLC_GET_GMODE << 16) | WLC_SET_GMODE),
+               .handler = wlc_ioctl,
+               .desc = "G Mode"
+       },
 };
 #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call))