浏览代码

qcacld-3.0: Use OkcEnabled .ini flag to control firmware OKC

Turn off opportunistic key caching (OKC) in firmware based on
"OkcEnabled" parameter in WCNSS_qcom_cfg.ini.
It is enabled by default and can be turned off with value 0.
Remove FEATURE_WLAN_OKC compilation option because OKC is always
compiled in for cld3.0. Remove underlying empty routine
cb_notify_set_okc_feature_enabled().

CRs-Fixed: 1057181
Change-Id: I174e860abef0532d62517635fe56927d8c3c9fd3
Deepak Dhamdhere 8 年之前
父节点
当前提交
f2a7d8be0e

+ 0 - 7
Kbuild

@@ -79,9 +79,6 @@ ifeq ($(KERNEL_BUILD), 0)
 	#Flag to enable Legacy Fast Roaming3(LFR3)
 	CONFIG_QCACLD_WLAN_LFR3 := y
 
-	#JB kernel has PMKSA patches, hence enabling this flag
-	CONFIG_PRIMA_WLAN_OKC := y
-
 	# JB kernel has CPU enablement patches, so enable
 	ifeq ($(CONFIG_ROME_IF),pci)
 		CONFIG_PRIMA_WLAN_11AC_HIGH_TP := y
@@ -1176,10 +1173,6 @@ ifeq ($(CONFIG_QCACLD_WLAN_LFR2),y)
 CDEFINES += -DWLAN_FEATURE_HOST_ROAM
 endif
 
-ifeq ($(CONFIG_PRIMA_WLAN_OKC),y)
-CDEFINES += -DFEATURE_WLAN_OKC
-endif
-
 ifeq ($(BUILD_DIAG_VERSION),1)
 CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT
 CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT_CSR

+ 0 - 4
core/hdd/inc/wlan_hdd_cfg.h

@@ -711,12 +711,10 @@ typedef enum {
 #define CFG_ROAM_SCAN_HOME_AWAY_TIME_DEFAULT                (CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN)
 /* disabled by default */
 
-#ifdef FEATURE_WLAN_OKC
 #define CFG_OKC_FEATURE_ENABLED_NAME                       "OkcEnabled"
 #define CFG_OKC_FEATURE_ENABLED_MIN                        (0)
 #define CFG_OKC_FEATURE_ENABLED_MAX                        (1)
 #define CFG_OKC_FEATURE_ENABLED_DEFAULT                    (1)
-#endif
 
 #define CFG_ROAM_SCAN_OFFLOAD_ENABLED                       "gRoamScanOffloadEnabled"
 #define CFG_ROAM_SCAN_OFFLOAD_ENABLED_MIN                   (0)
@@ -3646,9 +3644,7 @@ struct hdd_config {
 	bool isFastTransitionEnabled;
 	uint8_t RoamRssiDiff;
 	bool isWESModeEnabled;
-#ifdef FEATURE_WLAN_OKC
 	bool isOkcIniFeatureEnabled;
-#endif
 	bool isRoamOffloadScanEnabled;
 	bool bImplicitQosEnabled;
 

+ 7 - 25
core/hdd/src/wlan_hdd_cfg.c

@@ -96,15 +96,6 @@ cb_notify_set_roam_scan_home_away_time(hdd_context_t *pHddCtx, unsigned long not
 					    true);
 }
 
-#ifdef FEATURE_WLAN_OKC
-static void
-cb_notify_set_okc_feature_enabled(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-}
-#endif
-
 static void
 notify_is_fast_roam_ini_feature_enabled(hdd_context_t *pHddCtx,
 					unsigned long notifyId)
@@ -1079,16 +1070,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
 			     CFG_ENABLE_WES_MODE_NAME_MIN,
 			     CFG_ENABLE_WES_MODE_NAME_MAX,
 			     cb_notify_set_wes_mode, 0),
-#ifdef FEATURE_WLAN_OKC
-	REG_DYNAMIC_VARIABLE(CFG_OKC_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, isOkcIniFeatureEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_OKC_FEATURE_ENABLED_DEFAULT,
-			     CFG_OKC_FEATURE_ENABLED_MIN,
-			     CFG_OKC_FEATURE_ENABLED_MAX,
-			     cb_notify_set_okc_feature_enabled, 0),
-#endif
+	REG_VARIABLE(CFG_OKC_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, isOkcIniFeatureEnabled,
+		     VAR_FLAGS_OPTIONAL |
+		     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_OKC_FEATURE_ENABLED_DEFAULT,
+		     CFG_OKC_FEATURE_ENABLED_MIN,
+		     CFG_OKC_FEATURE_ENABLED_MAX),
 	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_OFFLOAD_ENABLED, WLAN_PARAM_Integer,
 			     struct hdd_config, isRoamOffloadScanEnabled,
 			     VAR_FLAGS_OPTIONAL |
@@ -5004,11 +4992,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "Name = [isWESModeEnabled] Value = [%u] ",
 		  pHddCtx->config->isWESModeEnabled);
-#ifdef FEATURE_WLAN_OKC
 	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "Name = [OkcEnabled] Value = [%u] ",
 		  pHddCtx->config->isOkcIniFeatureEnabled);
-#endif
 #ifdef FEATURE_WLAN_SCAN_PNO
 	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "Name = [configPNOScanSupport] Value = [%u] ",
@@ -7363,11 +7349,7 @@ bool hdd_is_okc_mode_enabled(hdd_context_t *pHddCtx)
 		hddLog(QDF_TRACE_LEVEL_FATAL, "%s: pHddCtx is NULL", __func__);
 		return -EINVAL;
 	}
-#ifdef FEATURE_WLAN_OKC
 	return pHddCtx->config->isOkcIniFeatureEnabled;
-#else
-	return false;
-#endif
 }
 
 /**

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

@@ -3463,10 +3463,10 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 	status = wlan_hdd_validate_context(hdd_ctx_ptr);
 	if (status)
 		return status;
-
 	sme_update_roam_key_mgmt_offload_enabled(hdd_ctx_ptr->hHal,
 			hdd_adapter_ptr->sessionId,
-			true);
+			true,
+			hdd_is_okc_mode_enabled(hdd_ctx_ptr));
 	qdf_mem_zero(&local_pmk, SIR_ROAM_SCAN_PSK_SIZE);
 	qdf_mem_copy(local_pmk, data, data_len);
 	sme_roam_set_psk_pmk(WLAN_HDD_GET_HAL_CTX(hdd_adapter_ptr),
@@ -10005,7 +10005,6 @@ int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter,
 					     tCsrRoamInfo *pRoamInfo,
 					     int index, bool preauth)
 {
-#ifdef FEATURE_WLAN_OKC
 	struct net_device *dev = pAdapter->dev;
 	hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx;
 
@@ -10024,7 +10023,6 @@ int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter,
 						pRoamInfo->bssid.bytes,
 						preauth, GFP_KERNEL);
 	}
-#endif /* FEATURE_WLAN_OKC */
 	return 0;
 }
 

+ 0 - 2
core/hdd/src/wlan_hdd_ioctl.c

@@ -7004,9 +7004,7 @@ static const hdd_drv_cmd_t hdd_drv_cmds[] = {
 	{"SETFASTTRANSITION",         drv_cmd_set_fast_transition},
 	{"FASTREASSOC",               drv_cmd_fast_reassoc},
 	{"SETROAMSCANCONTROL",        drv_cmd_set_roam_scan_control},
-#ifdef FEATURE_WLAN_OKC
 	{"SETOKCMODE",                drv_cmd_set_okc_mode},
-#endif /* FEATURE_WLAN_OKC */
 	{"GETROAMSCANCONTROL",        drv_cmd_get_roam_scan_control},
 	{"BTCOEXMODE",                drv_cmd_bt_coex_mode},
 	{"SCAN-ACTIVE",               drv_cmd_scan_active},

+ 1 - 0
core/mac/inc/sir_api.h

@@ -3009,6 +3009,7 @@ typedef struct sSirRoamOffloadScanReq {
 	uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
 	uint32_t R0KH_ID_Length;
 	uint8_t RoamKeyMgmtOffloadEnabled;
+	bool okc_enabled;
 #endif
 	struct roam_ext_params roam_params;
 	uint8_t  middle_of_roaming;

+ 1 - 0
core/sme/inc/csr_internal.h

@@ -986,6 +986,7 @@ typedef struct tagCsrRoamSession {
 	size_t pmk_len;
 	uint8_t RoamKeyMgmtOffloadEnabled;
 	roam_offload_synch_ind *roam_synch_data;
+	bool okc_enabled;
 #endif
 	tftSMEContext ftSmeContext;
 	/* This count represents the number of bssid's we try to join. */

+ 4 - 3
core/sme/inc/sme_api.h

@@ -893,9 +893,10 @@ QDF_STATUS sme_set_wisa_params(tHalHandle hal,
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 QDF_STATUS sme_update_roam_offload_enabled(tHalHandle hHal,
 		bool nRoamOffloadEnabled);
-QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(tHalHandle hHal,
-		uint8_t sessionId,
-		bool nRoamKeyMgmtOffloadEnabled);
+QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(tHalHandle hal_ctx,
+		uint8_t session_id,
+		bool key_mgmt_offload_enabled,
+		bool okc_enabled);
 #endif
 #ifdef WLAN_FEATURE_NAN
 QDF_STATUS sme_nan_event(tHalHandle hHal, void *pMsg);

+ 24 - 23
core/sme/src/common/sme_api.c

@@ -14033,38 +14033,39 @@ QDF_STATUS sme_update_roam_offload_enabled(tHalHandle hHal,
 	return status;
 }
 
-/*--------------------------------------------------------------------------
-   \brief sme_update_roam_key_mgmt_offload_enabled() - enable/disable key mgmt
-	offload
-	This is a synchronous call
-   \param hHal - The handle returned by mac_open.
-   \param  sessionId - Session Identifier
-   \param nRoamKeyMgmtOffloadEnabled - The bool to update with
-   \return QDF_STATUS_SUCCESS - SME update config successfully.
-	   Other status means SME is failed to update.
-   \sa
-   --------------------------------------------------------------------------*/
+/**
+ * sme_update_roam_key_mgmt_offload_enabled() - enable/disable key mgmt offload
+ * This is a synchronous call
+ * @hal_ctx: The handle returned by mac_open.
+ * @session_id: Session Identifier
+ * @key_mgmt_offload_enabled: key mgmt enable/disable flag
+ * @okc_enabled: Opportunistic key caching enable/disable flag
+ * Return: QDF_STATUS_SUCCESS - SME updated config successfully.
+ * Other status means SME is failed to update.
+ */
 
-QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(tHalHandle hHal,
-						    uint8_t sessionId,
-						    bool nRoamKeyMgmtOffloadEnabled)
+QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(tHalHandle hal_ctx,
+						uint8_t session_id,
+						bool key_mgmt_offload_enabled,
+						bool okc_enabled)
 {
-	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
-	status = sme_acquire_global_lock(&pMac->sme);
+	status = sme_acquire_global_lock(&mac_ctx->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		if (CSR_IS_SESSION_VALID(pMac, sessionId)) {
+		if (CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
 			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
-				  "%s: LFR3: KeyMgmtOffloadEnabled changed to %d",
-				  __func__, nRoamKeyMgmtOffloadEnabled);
-			status = csr_roam_set_key_mgmt_offload(pMac,
-							       sessionId,
-							       nRoamKeyMgmtOffloadEnabled);
+				"%s: LFR3: key_mgmt_offload_enabled changed to %d",
+				  __func__, key_mgmt_offload_enabled);
+			status = csr_roam_set_key_mgmt_offload(mac_ctx,
+						session_id,
+						key_mgmt_offload_enabled,
+						okc_enabled);
 		} else {
 			status = QDF_STATUS_E_INVAL;
 		}
-		sme_release_global_lock(&pMac->sme);
+		sme_release_global_lock(&mac_ctx->sme);
 	}
 
 	return status;

+ 21 - 7
core/sme/src/csr/csr_api_roam.c

@@ -16636,16 +16636,29 @@ QDF_STATUS csr_get_statistics(tpAniSirGlobal pMac,
 }
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal pMac,
-					 uint32_t sessionId,
-					 bool nRoamKeyMgmtOffloadEnabled)
+/**
+ * csr_roam_set_key_mgmt_offload() - enable/disable key mgmt offload
+ * @mac_ctx: mac context.
+ * @session_id: Session Identifier
+ * @roam_key_mgmt_offload_enabled: key mgmt enable/disable flag
+ * @okc_enabled: Opportunistic key caching enable/disable flag
+ *
+ * Return: QDF_STATUS_SUCCESS - CSR updated config successfully.
+ * Other status means CSR is failed to update.
+ */
+
+QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal mac_ctx,
+					 uint32_t session_id,
+					 bool roam_key_mgmt_offload_enabled,
+					 bool okc_enabled)
 {
-	tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
-	if (!pSession) {
-		sms_log(pMac, LOGE, FL("session %d not found"), sessionId);
+	tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
+	if (!session) {
+		sms_log(mac_ctx, LOGE, FL("session %d not found"), session_id);
 		return QDF_STATUS_E_FAILURE;
 	}
-	pSession->RoamKeyMgmtOffloadEnabled = nRoamKeyMgmtOffloadEnabled;
+	session->RoamKeyMgmtOffloadEnabled = roam_key_mgmt_offload_enabled;
+	session->okc_enabled = okc_enabled;
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -17100,6 +17113,7 @@ csr_create_roam_scan_offload_request(tpAniSirGlobal mac_ctx,
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	req_buf->RoamOffloadEnabled = csr_roamIsRoamOffloadEnabled(mac_ctx);
 	req_buf->RoamKeyMgmtOffloadEnabled = session->RoamKeyMgmtOffloadEnabled;
+	req_buf->okc_enabled = session->okc_enabled;
 	/* Roam Offload piggybacks upon the Roam Scan offload command. */
 	if (req_buf->RoamOffloadEnabled)
 		csr_update_roam_scan_offload_request(mac_ctx, req_buf, session);

+ 4 - 12
core/sme/src/csr/csr_inside_api.h

@@ -771,18 +771,10 @@ QDF_STATUS csr_roam_set_pmkid_cache(tpAniSirGlobal pMac, uint32_t sessionId,
 QDF_STATUS csr_roam_set_psk_pmk(tpAniSirGlobal pMac, uint32_t sessionId,
 				uint8_t *pPSK_PMK, size_t pmk_len);
 
-/* ---------------------------------------------------------------------------
-   *\fn csr_roam_set_key_mgmt_offload
-   *\brief sets nRoamKeyMgmtOffloadEnabled
-   *\param pMac  - pointer to global structure for MAC
-   *\param sessionId - Sme session id
-   *\param nRoamKeyMgmtOffloadEnabled - value of key mgmt offload enable
-   *\return QDF_STATUS - usually it succeed unless sessionId is not found
-   *\Note:
- *-------------------------------------------------------------------------------*/
-QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal pMac,
-					 uint32_t sessionId,
-					 bool nRoamKeyMgmtOffloadEnabled);
+QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal mac_ctx,
+					 uint32_t session_id,
+					 bool roam_key_mgmt_offload_enabled,
+					 bool okc_enabled);
 #endif
 /* ---------------------------------------------------------------------------
     \fn csr_roam_get_wpa_rsn_req_ie

+ 1 - 0
core/wma/src/wma_scan_roam.c

@@ -780,6 +780,7 @@ QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
 				roam_req->RoamKeyMgmtOffloadEnabled;
 		wma_roam_scan_fill_self_caps(wma_handle,
 			&params.roam_offload_params, roam_req);
+		params.okc_enabled = roam_req->okc_enabled;
 #endif
 		params.is_ese_assoc = roam_req->IsESEAssoc;
 		params.mdid.mdie_present = roam_req->MDID.mdiePresent;