[OpenWrt-Devel] mac80211: Add some missing 802.11n capabilities to hostapd configuration
diff mbox

Message ID 1422157550-5766-1-git-send-email-hancockrwd@gmail.com
State Changes Requested
Headers show

Commit Message

Robert Hancock Jan. 25, 2015, 3:45 a.m. UTC
Add some missing 802.11n capabilities to the hostapd ht_capab string when
supported by the hardware: Spatial Multiplexing Power-Save,
Delayed Block Ack, and 7935-byte AMSDUs.

Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
---
 .../kernel/mac80211/files/lib/netifd/wireless/mac80211.sh  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Felix Fietkau Jan. 25, 2015, 10:46 a.m. UTC | #1
On 2015-01-25 04:45, Robert Hancock wrote:
> Add some missing 802.11n capabilities to the hostapd ht_capab string when
> supported by the hardware: Spatial Multiplexing Power-Save,
> Delayed Block Ack, and 7935-byte AMSDUs.
> 
> Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
No driver actually does Delayed Block Ack, and I don't expect this to
change in the future - let's leave that out.

- Felix

Patch
diff mbox

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 1a85d15..93da360 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -42,6 +42,9 @@  drv_mac80211_init_device_config() {
 		greenfield \
 		short_gi_20 \
 		short_gi_40 \
+		smps \
+		delayed_ba \
+		max_amsdu \
 		dsss_cck_40
 }
 
@@ -130,8 +133,11 @@  mac80211_hostapd_setup_base() {
 			greenfield:0 \
 			short_gi_20:1 \
 			short_gi_40:1 \
+			smps:1 \
 			tx_stbc:1 \
 			rx_stbc:3 \
+			delayed_ba:1 \
+			max_amsdu:1 \
 			dsss_cck_40:1
 
 		ht_cap_mask=0
@@ -139,6 +145,8 @@  mac80211_hostapd_setup_base() {
 			ht_cap_mask="$(($ht_cap_mask | $cap))"
 		done
 
+		cap_smps=$((($ht_cap_mask >> 2) & 3))
+
 		cap_rx_stbc=$((($ht_cap_mask >> 8) & 3))
 		[ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
 		ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))"
@@ -152,8 +160,14 @@  mac80211_hostapd_setup_base() {
 			RX-STBC1:0x300:0x100:1 \
 			RX-STBC12:0x300:0x200:1 \
 			RX-STBC123:0x300:0x300:1 \
+			DELAYED-BA:0x400::$delayed_ba \
+			MAX-AMSDU-7935:0x800::$max_amsdu \
 			DSSS_CCK-40:0x1000::$dsss_cck_40
 
+		# SM Power Save: 0=static, 1=dynamic, 3=disabled
+		[ "$smps" = 1 -a "$cap_smps" = 0 ] && ht_capab_flags="$ht_capab_flags[SMPS-STATIC]"
+		[ "$smps" = 1 -a "$cap_smps" = 1 ] && ht_capab_flags="$ht_capab_flags[SMPS-DYNAMIC]"
+
 		ht_capab="$ht_capab$ht_capab_flags"
 		[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
 	}