ソースを参照

qcacld-3.0: Add support to update HE cap Nss using ioctl

Add support to update HE Nss capability using ioctl command

Change-Id: I0f32da6eb5835c008b6b35f000e4c670a22b111b
CRs-Fixed: 2181263
Kiran Kumar Lokere 7 年 前
コミット
44a2943836

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

@@ -15424,7 +15424,7 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, uint16_t *int_array,
 
 void hdd_cfg_print(struct hdd_context *hdd_ctx);
 
-QDF_STATUS hdd_update_nss(struct hdd_context *hdd_ctx, uint8_t nss);
+QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t nss);
 
 /**
  * hdd_dfs_indicate_radar() - Block tx as radar found on the channel

+ 4 - 2
core/hdd/src/wlan_hdd_cfg.c

@@ -9433,7 +9433,7 @@ next_token:
  * hdd_update_nss() - Update the number of spatial streams supported.
  * Ensure that nss is either 1 or 2 before calling this.
  *
- * @hdd_ctx: the pointer to hdd context
+ * @adapter: the pointer to adapter
  * @nss: the number of spatial streams to be updated
  *
  * This function is used to modify the number of spatial streams
@@ -9442,8 +9442,9 @@ next_token:
  * Return: QDF_STATUS_SUCCESS if nss is correctly updated,
  *              otherwise QDF_STATUS_E_FAILURE would be returned
  */
-QDF_STATUS hdd_update_nss(struct hdd_context *hdd_ctx, uint8_t nss)
+QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t nss)
 {
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct hdd_config *hdd_config = hdd_ctx->config;
 	uint32_t temp = 0;
 	uint32_t rx_supp_data_rate, tx_supp_data_rate;
@@ -9573,6 +9574,7 @@ QDF_STATUS hdd_update_nss(struct hdd_context *hdd_ctx, uint8_t nss)
 		status = false;
 		hdd_err("Could not pass on MCS SET to CFG");
 	}
+	sme_update_he_cap_nss(hdd_ctx->hHal, adapter->session_id, nss);
 #undef WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES
 
 	if (QDF_STATUS_SUCCESS != sme_update_nss(hdd_ctx->hHal, nss))

+ 1 - 2
core/hdd/src/wlan_hdd_wext.c

@@ -5809,8 +5809,7 @@ static int __iw_setint_getnone(struct net_device *dev,
 			ret = -EINVAL;
 		} else {
 			if (QDF_STATUS_SUCCESS !=
-				hdd_update_nss(WLAN_HDD_GET_CTX(adapter),
-				set_value))
+				hdd_update_nss(adapter, set_value))
 				ret = -EINVAL;
 		}
 		break;

+ 17 - 0
core/sme/inc/sme_api.h

@@ -2095,4 +2095,21 @@ static inline QDF_STATUS sme_handle_sae_msg(tHalHandle hal, uint8_t session_id,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11AX
+/**
+ * sme_update_he_cap_nss() - sets the nss based on user request
+ * @hal: Pointer to HAL
+ * @session_id: SME session id
+ * @nss: no.of spatial streams value
+ *
+ * Return: None
+ */
+void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id,
+		uint8_t nss);
+#else
+static inline void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id,
+		uint8_t nss)
+{}
+#endif
+
 #endif /* #if !defined( __SME_API_H ) */

+ 31 - 0
core/sme/src/common/sme_api.c

@@ -13127,6 +13127,37 @@ void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss)
 	mac_ctx->user_configured_nss = nss;
 }
 
+#ifdef WLAN_FEATURE_11AX
+void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id,
+		uint8_t nss)
+{
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+	struct csr_roam_session *csr_session;
+	uint32_t tx_mcs_map = 0;
+	uint32_t rx_mcs_map = 0;
+
+	if (!nss || (nss > 2)) {
+		sme_err("invalid Nss value %d", nss);
+	}
+	csr_session = CSR_GET_SESSION(mac_ctx, session_id);
+	sme_cfg_get_int(mac_ctx, WNI_CFG_HE_RX_MCS_MAP_LT_80, &rx_mcs_map);
+	sme_cfg_get_int(mac_ctx, WNI_CFG_HE_TX_MCS_MAP_LT_80, &tx_mcs_map);
+	if (nss == 1) {
+		tx_mcs_map = HE_SET_MCS_4_NSS(tx_mcs_map, HE_MCS_DISABLE, 2);
+		rx_mcs_map = HE_SET_MCS_4_NSS(rx_mcs_map, HE_MCS_DISABLE, 2);
+	} else {
+		tx_mcs_map = HE_SET_MCS_4_NSS(tx_mcs_map, HE_MCS_0_11, 2);
+		rx_mcs_map = HE_SET_MCS_4_NSS(rx_mcs_map, HE_MCS_0_11, 2);
+	}
+	sme_info("new HE Nss MCS MAP: Rx 0x%0X, Tx: 0x%0X",
+			rx_mcs_map, tx_mcs_map);
+	sme_cfg_set_int(mac_ctx, WNI_CFG_HE_RX_MCS_MAP_LT_80, rx_mcs_map);
+	sme_cfg_set_int(mac_ctx, WNI_CFG_HE_TX_MCS_MAP_LT_80, tx_mcs_map);
+	csr_update_session_he_cap(mac_ctx, csr_session);
+
+}
+#endif
+
 /**
  * sme_set_nud_debug_stats_cb() - set nud debug stats callback
  * @hal: global hal handle

+ 1 - 6
core/sme/src/csr/csr_api_roam.c

@@ -2330,7 +2330,7 @@ static void csr_start_bss_copy_he_cap(tSirSmeStartBssReq *req,
 		     sizeof(session->he_config));
 }
 
-static void csr_update_session_he_cap(tpAniSirGlobal mac_ctx,
+void csr_update_session_he_cap(tpAniSirGlobal mac_ctx,
 			struct csr_roam_session *session)
 {
 	uint32_t value = 0;
@@ -2535,11 +2535,6 @@ static inline void csr_start_bss_copy_he_cap(tSirSmeStartBssReq *req,
 {
 }
 
-static inline void csr_update_session_he_cap(tpAniSirGlobal mac_ctx,
-			struct csr_roam_session *session)
-{
-}
-
 #endif
 
 /**

+ 9 - 0
core/sme/src/csr/csr_inside_api.h

@@ -1155,5 +1155,14 @@ bool csr_lookup_pmkid_using_bssid(tpAniSirGlobal mac,
 					struct csr_roam_session *session,
 					tPmkidCacheInfo *pmk_cache,
 					uint32_t *index);
+#ifdef WLAN_FEATURE_11AX
+void csr_update_session_he_cap(tpAniSirGlobal mac_ctx,
+			struct csr_roam_session *session);
+#else
+static inline void csr_update_session_he_cap(tpAniSirGlobal mac_ctx,
+			struct csr_roam_session *session)
+{
+}
+#endif
 
 #endif /* CSR_INSIDE_API_H__ */