Browse Source

qcacld-3.0: Refactor hdd_cleanup_conn_info() API

The cleanup of existing connection info is per link so
change the function argument to take link info pointer
to reset the info.
Existing references are changed to deflink.

Change-Id: Ic6e8e181faadcfb568a0580e368b665cb95f7b26
CRs-Fixed: 3462660
Vinod Kumar Pirla 2 years ago
parent
commit
c4c6664685

+ 2 - 2
core/hdd/inc/wlan_hdd_main.h

@@ -4707,14 +4707,14 @@ static inline bool hdd_nbuf_dst_addr_is_self_addr(struct hdd_adapter *adapter,
 
 /**
  * hdd_cleanup_conn_info() - Cleanup connectin info
- * @adapter: Adapter upon which the command was received
+ * @link_info: pointer to link_info struct in adapter
  *
  * This function frees the memory allocated for the connection
  * info structure
  *
  * Return: none
  */
-void hdd_cleanup_conn_info(struct hdd_adapter *adapter);
+void hdd_cleanup_conn_info(struct wlan_hdd_link_info *link_info);
 
 #ifdef FEATURE_WLAN_RESIDENT_DRIVER
 extern char *country_code;

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

@@ -21033,7 +21033,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 
 	if (hdd_is_client_mode(adapter->device_mode)) {
 		if (adapter->device_mode == QDF_STA_MODE)
-			hdd_cleanup_conn_info(adapter);
+			hdd_cleanup_conn_info(adapter->deflink);
 
 		if (hdd_is_client_mode(new_mode)) {
 			errno = hdd_change_adapter_mode(adapter, new_mode);

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

@@ -1045,7 +1045,7 @@ static void hdd_cm_save_bss_info(struct hdd_adapter *adapter,
 	 */
 	if (adapter->device_mode == QDF_STA_MODE) {
 		/* Cleanup already existing he info */
-		hdd_cleanup_conn_info(adapter);
+		hdd_cleanup_conn_info(adapter->deflink);
 
 		/* Cache last connection info */
 		qdf_mem_copy(&hdd_sta_ctx->cache_conn_info,

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

@@ -7356,10 +7356,10 @@ static void hdd_cleanup_prev_ap_bcn_ie(struct wlan_hdd_link_info *link_info)
 	}
 }
 
-void hdd_cleanup_conn_info(struct hdd_adapter *adapter)
+void hdd_cleanup_conn_info(struct wlan_hdd_link_info *link_info)
 {
-	hdd_cleanup_he_operation_info(adapter->deflink);
-	hdd_cleanup_prev_ap_bcn_ie(adapter->deflink);
+	hdd_cleanup_he_operation_info(link_info);
+	hdd_cleanup_prev_ap_bcn_ie(link_info);
 }
 
 /**
@@ -7377,7 +7377,7 @@ static void hdd_sta_destroy_ctx_all(struct hdd_context *hdd_ctx)
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_STA_DESTROY_CTX_ALL) {
 		if (adapter->device_mode == QDF_STA_MODE)
-			hdd_cleanup_conn_info(adapter);
+			hdd_cleanup_conn_info(adapter->deflink);
 		hdd_adapter_dev_put_debug(adapter,
 					  NET_DEV_HOLD_STA_DESTROY_CTX_ALL);
 	}
@@ -8288,7 +8288,7 @@ static void __hdd_close_adapter(struct hdd_context *hdd_ctx,
 
 	qdf_copy_macaddr(&adapter_mac, &adapter->mac_addr);
 	if (adapter->device_mode == QDF_STA_MODE)
-		hdd_cleanup_conn_info(adapter);
+		hdd_cleanup_conn_info(adapter->deflink);
 	qdf_list_destroy(&adapter->blocked_scan_request_q);
 	qdf_mutex_destroy(&adapter->blocked_scan_request_q_lock);
 	policy_mgr_clear_concurrency_mode(hdd_ctx->psoc, adapter->device_mode);