Просмотр исходного кода

qcacld-3.0: Check FW capabilities for VHT160 support

Check the FW capabilities to enable VHT160MHz support.
Disable 160MHz by default in the configuration.

Change-Id: Ia6985d9f7c55a070dbb47faf95cd409201037e0c
CRs-Fixed: 2004245
Kiran Kumar Lokere 8 лет назад
Родитель
Сommit
4bbbd0d8c2

+ 1 - 1
core/hdd/inc/wlan_hdd_cfg.h

@@ -3698,7 +3698,7 @@ typedef enum {
 #define CFG_VHT_CHANNEL_WIDTH                "gVhtChannelWidth"
 #define CFG_VHT_CHANNEL_WIDTH_MIN            (0)
 #define CFG_VHT_CHANNEL_WIDTH_MAX            (4)
-#define CFG_VHT_CHANNEL_WIDTH_DEFAULT        (3)
+#define CFG_VHT_CHANNEL_WIDTH_DEFAULT        (2)
 
 /*
 * <ini>

+ 47 - 14
core/hdd/src/wlan_hdd_main.c

@@ -483,6 +483,8 @@ static int curr_con_mode;
  */
 enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width)
 {
+	uint8_t fw_ch_bw;
+	fw_ch_bw = wma_get_vht_ch_width();
 	switch (ch_width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 	case NL80211_CHAN_WIDTH_20:
@@ -493,9 +495,17 @@ enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width)
 	case NL80211_CHAN_WIDTH_80:
 		return CH_WIDTH_80MHZ;
 	case NL80211_CHAN_WIDTH_80P80:
-		return CH_WIDTH_80P80MHZ;
+		if (fw_ch_bw == WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ)
+			return CH_WIDTH_80P80MHZ;
+		else if (fw_ch_bw == WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
+			return CH_WIDTH_160MHZ;
+		else
+			return CH_WIDTH_80MHZ;
 	case NL80211_CHAN_WIDTH_160:
-		return CH_WIDTH_160MHZ;
+		if (fw_ch_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
+			return CH_WIDTH_160MHZ;
+		else
+			return CH_WIDTH_80MHZ;
 	case NL80211_CHAN_WIDTH_5:
 		return CH_WIDTH_5MHZ;
 	case NL80211_CHAN_WIDTH_10:
@@ -945,6 +955,7 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
 	struct ieee80211_supported_band *band_5g =
 		wiphy->bands[NL80211_BAND_5GHZ];
 	uint32_t temp = 0;
+	uint32_t ch_width = eHT_CHANNEL_WIDTH_80MHZ;
 
 	if (!band_5g) {
 		hdd_info("5GHz band disabled, skipping capability population");
@@ -976,16 +987,6 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
 		}
 	}
 
-	/* Get the current supported chan width */
-	status = sme_cfg_get_int(hdd_ctx->hHal,
-				WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
-				&value);
-
-	if (status != QDF_STATUS_SUCCESS) {
-		hdd_err("could not get MPDU LENGTH");
-		value = 0;
-	}
-
 	sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_BASIC_MCS_SET, &temp);
 	temp = (temp & VHT_MCS_1x1) | pconfig->vhtRxMCS;
 
@@ -1230,12 +1231,44 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
 		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895;
 
 
-	if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_80P80MHZ))
+	if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_80P80MHZ)) {
+		status = sme_cfg_set_int(hdd_ctx->hHal,
+				WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
+				VHT_CAP_160_AND_80P80_SUPP);
+		if (status == QDF_STATUS_E_FAILURE)
+			hdd_alert("could not set the VHT CAP 160");
 		band_5g->vht_cap.cap |=
 			IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
-	else if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_160MHZ))
+		ch_width = eHT_CHANNEL_WIDTH_80P80MHZ;
+	} else if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_160MHZ)) {
+		status = sme_cfg_set_int(hdd_ctx->hHal,
+				WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
+				VHT_CAP_160_SUPP);
+		if (status == QDF_STATUS_E_FAILURE)
+			hdd_alert("could not set the VHT CAP 160");
 		band_5g->vht_cap.cap |=
 			IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
+		ch_width = eHT_CHANNEL_WIDTH_160MHZ;
+	}
+	pconfig->vhtChannelWidth = QDF_MIN(pconfig->vhtChannelWidth,
+			ch_width);
+	/* Get the current supported chan width */
+	status = sme_cfg_get_int(hdd_ctx->hHal,
+				WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
+				&value);
+	if (status != QDF_STATUS_SUCCESS) {
+		hdd_err("could not get CH BW");
+		value = 0;
+	}
+	/* set the Guard interval 80MHz */
+	if (value) {
+		status = sme_cfg_set_int(hdd_ctx->hHal,
+				WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ,
+				cfg->vht_short_gi_160);
+
+		if (status == QDF_STATUS_E_FAILURE)
+			hdd_alert("failed to set SHORT GI 80MHZ");
+	}
 
 	if (cfg->vht_rx_ldpc & WMI_VHT_CAP_RX_LDPC)
 		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC;

+ 3 - 0
core/mac/inc/sir_mac_prot_def.h

@@ -410,6 +410,9 @@
 #define VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2       780
 #define VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2       780
 
+#define VHT_CAP_160_SUPP 1
+#define VHT_CAP_160_AND_80P80_SUPP 2
+
 #define VHT_MCS_1x1 0xFFFC
 #define VHT_MCS_2x2 0xFFF3
 

+ 2 - 2
core/mac/inc/wni_cfg.h

@@ -845,7 +845,7 @@ enum {
 
 #define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMIN    0
 #define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STAMAX    2
-#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STADEF    2
+#define WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET_STADEF    0
 
 #define WNI_CFG_VHT_LDPC_CODING_CAP_STAMIN    0
 #define WNI_CFG_VHT_LDPC_CODING_CAP_STAMAX    1
@@ -857,7 +857,7 @@ enum {
 
 #define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMIN    0
 #define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STAMAX    1
-#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STADEF    1
+#define WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ_STADEF    0
 
 #define WNI_CFG_VHT_TXSTBC_STAMIN    0
 #define WNI_CFG_VHT_TXSTBC_STAMAX    1