[PATCH 2/4] Change network type dynamically

Eugene Krasnikov k.eugene.e at gmail.com
Wed Jul 17 13:47:31 EDT 2013


Implement wcn36xx_smd_set_bss_nw_type that will set
nw_type depends on supported rates and capabilities.

Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
 smd.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/smd.c b/smd.c
index 7d8787f..cd19bde 100644
--- a/smd.c
+++ b/smd.c
@@ -19,6 +19,21 @@
 #include <linux/bitops.h>
 #include "smd.h"
 
+static void wcn36xx_smd_set_bss_nw_type(struct wcn36xx *wcn,
+		struct ieee80211_sta *sta,
+		struct wcn36xx_hal_config_bss_params *bss_params)
+{
+
+	if (IEEE80211_BAND_5GHZ == WCN36XX_BAND(wcn))
+		bss_params->nw_type = WCN36XX_HAL_11A_NW_TYPE;
+	else if (sta && sta->ht_cap.ht_supported)
+		bss_params->nw_type = WCN36XX_HAL_11N_NW_TYPE;
+	else if (sta && (sta->supp_rates[IEEE80211_BAND_2GHZ] & 0x7f))
+		bss_params->nw_type = WCN36XX_HAL_11G_NW_TYPE;
+	else
+		bss_params->nw_type = WCN36XX_HAL_11B_NW_TYPE;
+}
+
 static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta,
 		struct wcn36xx_hal_config_sta_params *sta_params)
 {
@@ -801,8 +816,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	} else {
 		wcn36xx_warn("Unknown type for bss config: %d", vif->type);
 	}
-
-	bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
+	if (vif->type == NL80211_IFTYPE_STATION)
+		wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
+	else
+		bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
 	bss->short_slot_time_supported = 0;
 	bss->lla_coexist = 0;
 	bss->llb_coexist = 0;
-- 
1.8.2.2




More information about the wcn36xx mailing list