mac80211: fill some important capabilities into ht_capab in the hostapd config
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 4 Nov 2009 21:53:49 +0000 (21:53 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 4 Nov 2009 21:53:49 +0000 (21:53 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18293 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/hostapd/files/hostapd.sh
package/mac80211/files/lib/wifi/mac80211.sh

index 0db5e06..2210a46 100644 (file)
@@ -89,6 +89,9 @@ hostapd_setup_vif() {
                [ -n "$hwmode_11n" ] && {
                        hwmode="$hwmode_11n"
                        config_get ht_capab "$device" ht_capab
                [ -n "$hwmode_11n" ] && {
                        hwmode="$hwmode_11n"
                        config_get ht_capab "$device" ht_capab
+                       [ -n "$ht_capab" -a -n "${ht_capab%%\[*}" ] && {
+                               ht_capab=`echo "[$ht_capab]" | sed -e 's, ,][,g'`
+                       }
                }
        }
        cat > /var/run/hostapd-$ifname.conf <<EOF
                }
        }
        cat > /var/run/hostapd-$ifname.conf <<EOF
index 6c5359a..bae9fb6 100644 (file)
@@ -293,7 +293,17 @@ detect_mac80211() {
                done
                mode_11n=""
                mode_band="g"
                done
                mode_11n=""
                mode_band="g"
-               iw phy "$dev" info | grep -q 'HT cap' && mode_11n="n"
+               ht_cap="$(iw phy "$dev" info | grep 'HT capabilities' | cut -d: -f2)"
+               ht_capab="";
+               [ -n "$ht_cap" ] && {
+                       mode_11n="n"
+                       list="  list ht_capab"
+                       [ "$(($ht_cap & 2))" -eq 1 ] && append ht_capab "$list  LDPC" "$N"
+                       [ "$(($ht_cap & 2))" -eq 2 ] && append ht_capab "$list  HT40-" "$N"
+                       [ "$(($ht_cap & 32))" -eq 32 ] && append ht_capab "$list        SHORT-GI-20" "$N"
+                       [ "$(($ht_cap & 64))" -eq 64 ] && append ht_capab "$list        SHORT-GI-40" "$N"
+                       [ "$(($ht_cap & 4096))" -eq 4096 ] && append ht_capab "$list    DSSS_CCK-40" "$N"
+               }
                iw phy "$dev" info | grep -q '2412 MHz' || mode_band="a"
 
                cat <<EOF
                iw phy "$dev" info | grep -q '2412 MHz' || mode_band="a"
 
                cat <<EOF
@@ -304,6 +314,7 @@ config wifi-device  wifi$devidx
        option hwmode   11${mode_11n}${mode_band}
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 1
        option hwmode   11${mode_11n}${mode_band}
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 1
+$ht_capab
 
 config wifi-iface
        option device   wifi$devidx
 
 config wifi-iface
        option device   wifi$devidx
This page took 0.041244 seconds and 4 git commands to generate.