Pārlūkot izejas kodu

qcacld-3.0: add support for 11n only TF card on MDM

Propagate from qcacld-2.0 to qcacld-3.0

To support 11n only TF card on MDM. Make sure
SAP can't be started on 2.4G/5G band with 11ac
mode and STA will use HT mode when connect to 11ac AP.

Change-Id: Ia62404b34aad9e0fc79971846b151aef72f9057f
CRs-Fixed: 945912
Yingying Tang 8 gadi atpakaļ
vecāks
revīzija
3ba3dbc26d

+ 31 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -9001,6 +9001,15 @@ static void wlan_hdd_update_band_cap(hdd_context_t *hdd_ctx)
 			hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap |=
 						IEEE80211_HT_CAP_TX_STBC;
 	}
+
+	if (!sme_is_feature_supported_by_fw(DOT11AC)) {
+		hdd_ctx->wiphy->bands[NL80211_BAND_2GHZ]->
+						vht_cap.vht_supported = 0;
+		hdd_ctx->wiphy->bands[NL80211_BAND_2GHZ]->vht_cap.cap = 0;
+		hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]->
+						vht_cap.vht_supported = 0;
+		hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.cap = 0;
+	}
 }
 
 /*
@@ -9016,6 +9025,28 @@ void wlan_hdd_update_wiphy(hdd_context_t *hdd_ctx)
 	wlan_hdd_update_band_cap(hdd_ctx);
 }
 
+/**
+ * wlan_hdd_update_11n_mode - update 11n mode in hdd cfg
+ * @cfg: hdd cfg
+ *
+ * this function update 11n mode in hdd cfg
+ *
+ * Return: void
+ */
+void wlan_hdd_update_11n_mode(struct hdd_config *cfg)
+{
+	if (sme_is_feature_supported_by_fw(DOT11AC)) {
+		hdd_notice("support 11ac");
+	} else {
+		hdd_notice("not support 11ac");
+		if ((cfg->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) ||
+		    (cfg->dot11Mode == eHDD_DOT11_MODE_11ac)) {
+			cfg->dot11Mode = eHDD_DOT11_MODE_11n;
+			cfg->sap_p2p_11ac_override = 0;
+		}
+	}
+}
+
 /* In this function we are registering wiphy. */
 int wlan_hdd_cfg80211_register(struct wiphy *wiphy)
 {

+ 2 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -3179,6 +3179,8 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy);
 
 void wlan_hdd_update_wiphy(hdd_context_t *hdd_ctx);
 
+void wlan_hdd_update_11n_mode(struct hdd_config *cfg);
+
 int wlan_hdd_cfg80211_register(struct wiphy *wiphy);
 void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter);
 

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8091,6 +8091,9 @@ int hdd_wlan_startup(struct device *dev)
 
 	if (hdd_ctx->config->enable_go_cts2self_for_sta)
 		sme_set_cts2self_for_p2p_go(hdd_ctx->hHal);
+
+	wlan_hdd_update_11n_mode(hdd_ctx->config);
+
 #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
 	status = qdf_mc_timer_init(&hdd_ctx->skip_acs_scan_timer,
 				   QDF_TIMER_TYPE_SW,