Browse Source

qcacld-3.0: Report HT TX STBC capability to kernel

Propagate from qcacld-2.0 to qcacld-3.0

Currently the driver does not report HT TX STBC capability
to the kernel. This prevents hostapd from starting if it
has been configured with HT TX STBC capability. To prevent
this issue correctly report the HT TX STBC capability to the
kernel.

CRs-Fixed: 1046306
Change-Id: Id182de3916f4e556dde30048776ea07b0fbfdc7d
Yingying Tang 8 years ago
parent
commit
80e15f39ef
3 changed files with 41 additions and 7 deletions
  1. 39 5
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 1 1
      core/hdd/src/wlan_hdd_cfg80211.h
  3. 1 1
      core/hdd/src/wlan_hdd_main.c

+ 39 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -8947,8 +8947,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
 }
 
 /**
- * wlan_hdd_cfg80211_deinit - Deinit cfg80211
- * @ wiphy: the wiphy to validate against
+ * wlan_hdd_cfg80211_deinit() - Deinit cfg80211
+ * @wiphy: the wiphy to validate against
  *
  * this function deinit cfg80211 and cleanup the
  * memory allocated in wlan_hdd_cfg80211_init also
@@ -8970,15 +8970,50 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy)
 	hdd_reset_global_reg_params();
 }
 
+/**
+ * wlan_hdd_update_band_cap() - update capabilities for supported bands
+ * @hdd_ctx: HDD context
+ *
+ * this function will update capabilities for supported bands
+ *
+ * Return: void
+ */
+static void wlan_hdd_update_band_cap(hdd_context_t *hdd_ctx)
+{
+	uint32_t val32;
+	uint16_t val16;
+	tSirMacHTCapabilityInfo *ht_cap_info;
+	QDF_STATUS status;
+
+	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val32);
+	if (QDF_STATUS_SUCCESS != status) {
+		hdd_err("could not get HT capability info");
+		val32 = 0;
+	}
+	val16 = (uint16_t)val32;
+	ht_cap_info = (tSirMacHTCapabilityInfo *)&val16;
+
+	if (ht_cap_info->txSTBC == true) {
+		if (NULL != hdd_ctx->wiphy->bands[NL80211_BAND_2GHZ])
+			hdd_ctx->wiphy->bands[NL80211_BAND_2GHZ]->ht_cap.cap |=
+						IEEE80211_HT_CAP_TX_STBC;
+		if (NULL != hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ])
+			hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.cap |=
+						IEEE80211_HT_CAP_TX_STBC;
+	}
+}
+
 /*
  * In this function, wiphy structure is updated after QDF
  * initialization. In wlan_hdd_cfg80211_init, only the
  * default values will be initialized. The final initialization
  * of all required members can be done here.
  */
-void wlan_hdd_update_wiphy(struct wiphy *wiphy, struct hdd_config *pCfg)
+void wlan_hdd_update_wiphy(hdd_context_t *hdd_ctx)
 {
-	wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers;
+	hdd_ctx->wiphy->max_ap_assoc_sta = hdd_ctx->config->maxNumberOfPeers;
+
+	wlan_hdd_update_band_cap(hdd_ctx);
 }
 
 /* In this function we are registering wiphy. */
@@ -8987,7 +9022,6 @@ int wlan_hdd_cfg80211_register(struct wiphy *wiphy)
 	ENTER();
 	/* Register our wiphy dev with cfg80211 */
 	if (0 > wiphy_register(wiphy)) {
-		/* print error */
 		hdd_err("wiphy register failed");
 		return -EIO;
 	}

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.h

@@ -3177,7 +3177,7 @@ int wlan_hdd_cfg80211_init(struct device *dev,
 
 void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy);
 
-void wlan_hdd_update_wiphy(struct wiphy *wiphy, struct hdd_config *pCfg);
+void wlan_hdd_update_wiphy(hdd_context_t *hdd_ctx);
 
 int wlan_hdd_cfg80211_register(struct wiphy *wiphy);
 void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter);

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -8037,7 +8037,7 @@ int hdd_wlan_startup(struct device *dev)
 		goto err_exit_nl_srv;
 	}
 
-	wlan_hdd_update_wiphy(hdd_ctx->wiphy, hdd_ctx->config);
+	wlan_hdd_update_wiphy(hdd_ctx);
 
 	hdd_ctx->hHal = cds_get_context(QDF_MODULE_ID_SME);