diff mbox

hostapd: Fix VHT MCS settings when chainmask is configured.

Message ID 1451587737-823-1-git-send-email-greearb@candelatech.com
State Deferred
Headers show

Commit Message

Ben Greear Dec. 31, 2015, 6:48 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

The previous patch had some math issues...this appears to
fix it.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 src/ap/ieee802_11_vht.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index ce7cbcf..7795f5b 100644
--- a/src/ap/ieee802_11_vht.c
+++ b/src/ap/ieee802_11_vht.c
@@ -56,19 +56,27 @@  u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid)
 	 * range.
 	 */
 	if (mode->conf_tx_ant) {
+		wpa_printf(MSG_DEBUG, "configured tx-antenna: 0x%x, vht tx_map before: 0x%x",
+			   mode->conf_tx_ant, cap->vht_supported_mcs_set.tx_map);
 		for (i = 7; i > 0; i--) {
 			if (mode->conf_tx_ant & BIT(i - 1))
 				break;
-			cap->vht_supported_mcs_set.tx_map |= (0x3 << i);
+			cap->vht_supported_mcs_set.tx_map |= (0x3 << ((i - 1) * 2));
 		}
+		wpa_printf(MSG_DEBUG, "configured tx-antenna: 0x%x, vht tx_map after: 0x%x",
+			   mode->conf_tx_ant, cap->vht_supported_mcs_set.tx_map);
 	}
 
 	if (mode->conf_rx_ant) {
+		wpa_printf(MSG_DEBUG, "configured rx-antenna: 0x%x, vht rx_map before: 0x%x",
+			   mode->conf_rx_ant, cap->vht_supported_mcs_set.rx_map);
 		for (i = 7; i > 0; i--) {
 			if (mode->conf_rx_ant & BIT(i - 1))
 				break;
-			cap->vht_supported_mcs_set.rx_map |= (0x3 << i);
+			cap->vht_supported_mcs_set.rx_map |= (0x3 << ((i - 1) * 2));
 		}
+		wpa_printf(MSG_DEBUG, "configured rx-antenna: 0x%x, vht rx_map after: 0x%x",
+			   mode->conf_rx_ant, cap->vht_supported_mcs_set.rx_map);
 	}
 
 	pos += sizeof(*cap);