[PATCH 2/2] Configure secondary channel offset

Eugene Krasnikov k.eugene.e at gmail.com
Tue Jul 9 10:58:25 EDT 2013


Keys exchange always fails on 5GHz with 40MHz channel
because extension channel was not set to secondary channel
offset.

Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
 hal.h |  6 ++++++
 smd.c | 18 +++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/hal.h b/hal.h
index 69b3702..ea3bd98 100644
--- a/hal.h
+++ b/hal.h
@@ -509,6 +509,12 @@ enum wcn36xx_hal_ht_operating_mode {
 	WCN36XX_HAL_HT_OP_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
 };
 
+enum wcn36xx_hal_ht_secondary_chan_off {
+	WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_NONE = 0,
+	WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_UP = 1,
+	WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_DOWN = 3,
+};
+
 /* Encryption type enum used with peer */
 enum ani_ed_type {
 	WCN36XX_HAL_ED_NONE,
diff --git a/smd.c b/smd.c
index 10de2eb..de1e1f2 100644
--- a/smd.c
+++ b/smd.c
@@ -412,6 +412,17 @@ int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch)
 	memcpy(&msg_body.bssid, bssid, ETH_ALEN);
 	memcpy(&msg_body.self_sta_mac_addr, vif, ETH_ALEN);
 	msg_body.channel = ch;
+
+	if (conf_is_ht40_minus(&wcn->hw->conf))
+		msg_body.secondary_channel_offset =
+			PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
+	else if (conf_is_ht40_plus(&wcn->hw->conf))
+		msg_body.secondary_channel_offset =
+			PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
+	else
+		msg_body.secondary_channel_offset =
+			PHY_SINGLE_CHANNEL_CENTERED;
+
 	msg_body.link_state = WCN36XX_HAL_LINK_PREASSOC_STATE;
 
 	msg_body.max_tx_power = 0xbf;
@@ -756,7 +767,12 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, enum nl80211_iftype type,
 	bss->dtim_period = wcn->dtim_period;
 	bss->tx_channel_width_set = conf_is_ht40(&wcn->hw->conf);
 	bss->oper_channel = wcn->ch;
-	bss->ext_channel = 0;
+	if (conf_is_ht40_minus(&wcn->hw->conf))
+		bss->ext_channel = WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_DOWN;
+	else if (conf_is_ht40_plus(&wcn->hw->conf))
+		bss->ext_channel = WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_UP;
+	else
+		bss->ext_channel = WCN36XX_HAL_HT_SECONDARY_CHAN_OFF_NONE;
 	bss->reserved = 0;
 
 	memcpy(&sta->bssid, bssid, ETH_ALEN);
-- 
1.7.11.3




More information about the wcn36xx mailing list