Browse Source

qcacld-3.0: Move IP notifier work cancel and fc deregister

Move APIs related to IP notifier work callback and flow control
deregister to two new APIs.

New APIs:
1) hdd_cancel_ip_notifier_work()
2) hdd_adapter_deregister_fc()

Change-Id: Id76a92f52d80fb7e0ed52d46bb52a95b22cbd25e
CRs-Fixed: 3523483
Vinod Kumar Pirla 2 years ago
parent
commit
06b6176019
3 changed files with 55 additions and 24 deletions
  1. 30 0
      core/hdd/inc/wlan_hdd_main.h
  2. 23 18
      core/hdd/src/wlan_hdd_main.c
  3. 2 6
      core/hdd/src/wlan_hdd_nan_datapath.c

+ 30 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -2821,6 +2821,36 @@ hdd_get_adapter_by_rand_macaddr(struct hdd_context *hdd_ctx,
  */
 bool hdd_is_vdev_in_conn_state(struct wlan_hdd_link_info *link_info);
 
+/**
+ * hdd_adapter_deregister_fc() - Deregisters flow control
+ * callbacks
+ * @adapter: HDD adapter
+ *
+ * The function call deregisters flow control callbacks
+ *
+ * Return: void
+ */
+void hdd_adapter_deregister_fc(struct hdd_adapter *adapter);
+
+#ifdef WLAN_OPEN_SOURCE
+/**
+ * hdd_cancel_ip_notifier_work() - Cancel scheduled IP
+ * notifier deferred work
+ * @adapter: HDD adapter
+ *
+ * The API calls cancel work for IPv4 and IPv6 notifier
+ * deferred task
+ *
+ * Return: void
+ */
+void hdd_cancel_ip_notifier_work(struct hdd_adapter *adapter);
+#else
+static inline
+void hdd_cancel_ip_notifier_work(struct hdd_adapter *adapter)
+{
+}
+#endif
+
 /**
  * hdd_vdev_create() - Create the vdev in the firmware
  * @adapter: hdd adapter

+ 23 - 18
core/hdd/src/wlan_hdd_main.c

@@ -8717,6 +8717,22 @@ static inline void hdd_dump_func_call_map(void)
 }
 #endif
 
+#ifdef WLAN_OPEN_SOURCE
+void hdd_cancel_ip_notifier_work(struct hdd_adapter *adapter)
+{
+	cancel_work_sync(&adapter->ipv4_notifier_work);
+#ifdef WLAN_NS_OFFLOAD
+	cancel_work_sync(&adapter->ipv6_notifier_work);
+#endif
+}
+#endif
+
+void hdd_adapter_deregister_fc(struct hdd_adapter *adapter)
+{
+	hdd_deregister_hl_netdev_fc_timer(adapter);
+	hdd_deregister_tx_flow_control(adapter);
+}
+
 QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 				struct hdd_adapter *adapter)
 {
@@ -8826,14 +8842,8 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 		wlan_hdd_cleanup_remain_on_channel_ctx(link_info);
 		status = wlan_hdd_flush_pmksa_cache(link_info);
 
-		hdd_deregister_hl_netdev_fc_timer(adapter);
-
-		hdd_deregister_tx_flow_control(adapter);
-
-		cancel_work_sync(&adapter->ipv4_notifier_work);
-#ifdef WLAN_NS_OFFLOAD
-		cancel_work_sync(&adapter->ipv6_notifier_work);
-#endif
+		hdd_adapter_deregister_fc(adapter);
+		hdd_cancel_ip_notifier_work(adapter);
 
 		if (adapter->device_mode == QDF_STA_MODE) {
 			if (vdev)
@@ -8878,8 +8888,8 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 				WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE);
 		}
 		wlan_hdd_scan_abort(link_info);
-		hdd_deregister_hl_netdev_fc_timer(adapter);
-		hdd_deregister_tx_flow_control(adapter);
+		hdd_adapter_deregister_fc(adapter);
+
 		status = hdd_disable_monitor_mode();
 		if (QDF_IS_STATUS_ERROR(status))
 			hdd_err_rl("datapath reset failed for monitor mode");
@@ -8934,8 +8944,7 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 			hdd_abort_ongoing_sta_connection(hdd_ctx);
 		}
 
-		hdd_deregister_hl_netdev_fc_timer(adapter);
-		hdd_deregister_tx_flow_control(adapter);
+		hdd_adapter_deregister_fc(adapter);
 		hdd_destroy_acs_timer(adapter);
 
 		mutex_lock(&hdd_ctx->sap_lock);
@@ -9013,10 +9022,7 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 				wlan_hdd_send_avoid_freq_for_dnbs(hdd_ctx, 0);
 		}
 
-		cancel_work_sync(&adapter->ipv4_notifier_work);
-#ifdef WLAN_NS_OFFLOAD
-		cancel_work_sync(&adapter->ipv6_notifier_work);
-#endif
+		hdd_cancel_ip_notifier_work(adapter);
 		sap_release_vdev_ref(ap_ctx->sap_context);
 
 		if (adapter->device_mode == QDF_SAP_MODE) {
@@ -9034,8 +9040,7 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 		cdp_clear_peer(cds_get_context(QDF_MODULE_ID_SOC),
 			       OL_TXRX_PDEV_ID,
 			       sta_ctx->conn_info.peer_macaddr[0]);
-		hdd_deregister_hl_netdev_fc_timer(adapter);
-		hdd_deregister_tx_flow_control(adapter);
+		hdd_adapter_deregister_fc(adapter);
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
 		hdd_vdev_destroy(adapter);
 		break;

+ 2 - 6
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -92,13 +92,9 @@ static int hdd_close_ndi(struct hdd_adapter *adapter)
 				     WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
 				     WLAN_CONTROL_PATH);
 
-	cancel_work_sync(&adapter->ipv4_notifier_work);
-	hdd_deregister_hl_netdev_fc_timer(adapter);
-	hdd_deregister_tx_flow_control(adapter);
+	hdd_cancel_ip_notifier_work(adapter);
+	hdd_adapter_deregister_fc(adapter);
 
-#ifdef WLAN_NS_OFFLOAD
-	cancel_work_sync(&adapter->ipv6_notifier_work);
-#endif
 	errno = hdd_vdev_destroy(adapter);
 	if (errno)
 		hdd_err("failed to destroy vdev: %d", errno);