Explorar el Código

qcacld-3.0: Fix compilation with WLAN_FEATURE_ROAM_OFFLOAD disabled

When LFR3 compile time flag WLAN_FEATURE_ROAM_OFFLOAD is
disabled, compilation of wlan driver fails as btk_key is defined
under WLAN_FEATURE_ROAM_OFFLOAD but sme_add_key_btk tries to
access this value irrespective of the compile time flag.

As the caller of sme_add_key_btk, calls this only if the
function hdd_is_btk_enc_type returns true and this function
hdd_is_btk_enc_type() is conditionally compiled based on
WLAN_FEATURE_ROAM_OFFLOAD, its better to include sme_add_key_btk
only if WLAN_FEATURE_ROAM_OFFLOAD is enabled.

Change-Id: I51315ed3bff8979120b86f75c06362a1c8a5658c
CRs-Fixed: 2408418
Pragaspathi Thilagaraj hace 6 años
padre
commit
974c27e69c
Se han modificado 2 ficheros con 13 adiciones y 6 borrados
  1. 11 6
      core/sme/inc/sme_api.h
  2. 2 0
      core/sme/src/common/sme_api.c

+ 11 - 6
core/sme/inc/sme_api.h

@@ -3016,7 +3016,7 @@ sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
 }
 #endif
 
-#ifdef FEATURE_WLAN_ESE
+#if defined(FEATURE_WLAN_ESE) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /**
  * sme_add_key_btk() - Add BTK key
  * @mac_handle: MAC handle
@@ -3028,6 +3028,16 @@ sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
  */
 int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
 		    const uint8_t *key, const int key_len);
+
+#else
+static inline int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
+				  const uint8_t *key, const int key_len)
+{
+	return 0;
+}
+#endif
+
+#ifdef FEATURE_WLAN_ESE
 /**
  * sme_add_key_krk() - Add KRK key
  * @mac_handle: MAC handle
@@ -3041,11 +3051,6 @@ int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
 		    const uint8_t *key, const int key_len);
 
 #else
-static inline int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
-				  const uint8_t *key, const int key_len)
-{
-	return 0;
-}
 
 static inline int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
 				  const uint8_t *key, const int key_len)

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

@@ -6193,7 +6193,9 @@ int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
 
 	return 0;
 }
+#endif
 
+#if defined(FEATURE_WLAN_ESE) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
 int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
 		    const uint8_t *key, const int key_len)
 {