Prechádzať zdrojové kódy

qcacld-3.0: Clean up SAP DP TX/RX init and deinit APIs in DP component

Remove SAP DP TX/RX init, deinit APIs dependency from
HDD module.

Change-Id: I5bf248dfd4e19fea784595c8c05e1a51610f3338
CRs-Fixed: 3402662
Roopavathi Lingampalli 2 rokov pred
rodič
commit
ed0007c0c9

+ 3 - 0
components/dp/core/src/wlan_dp_main.c

@@ -940,6 +940,7 @@ dp_vdev_obj_create_notification(struct wlan_objmgr_vdev *vdev, void *arg)
 			dp_err("eap frm done event init failed!!");
 			return status;
 		}
+		qdf_mem_zero(&dp_intf->stats, sizeof(qdf_net_dev_stats));
 	}
 
 	status = wlan_objmgr_vdev_component_obj_attach(vdev,
@@ -988,6 +989,8 @@ dp_vdev_obj_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg)
 			dp_err("eap frm done event destroy failed!!");
 			return status;
 		}
+		dp_intf->tx_fn = NULL;
+		dp_intf->sap_tx_block_mask |= DP_TX_FN_CLR;
 	}
 	qdf_mem_zero(&dp_intf->conn_info, sizeof(struct wlan_dp_conn_info));
 	dp_intf->intf_id = WLAN_UMAC_VDEV_ID_MAX;

+ 1 - 17
components/dp/dispatcher/inc/wlan_dp_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -311,22 +311,6 @@ QDF_STATUS ucfg_dp_init_txrx(struct wlan_objmgr_vdev *vdev);
  */
 QDF_STATUS ucfg_dp_deinit_txrx(struct wlan_objmgr_vdev *vdev);
 
-/**
- * ucfg_dp_softap_init_txrx() - Initialize SAP DP init TX/RX
- * @vdev: vdev mapped to SAP DP interface
- *
- * Return: 0 on success and non zero on failure.
- */
-QDF_STATUS ucfg_dp_softap_init_txrx(struct wlan_objmgr_vdev *vdev);
-
-/**
- * ucfg_dp_softap_deinit_txrx() - Deinitialize SAP DP init TX/RX
- * @vdev: vdev mapped to SAP DP interface
- *
- * Return: 0 on success and non zero on failure.
- */
-QDF_STATUS ucfg_dp_softap_deinit_txrx(struct wlan_objmgr_vdev *vdev);
-
 /**
  * ucfg_dp_start_xmit() - Transmit packet on STA interface
  * @nbuf: n/w buffer to transmitted

+ 0 - 29
components/dp/dispatcher/src/wlan_dp_ucfg_api.c

@@ -1212,35 +1212,6 @@ QDF_STATUS ucfg_dp_deinit_txrx(struct wlan_objmgr_vdev *vdev)
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS ucfg_dp_softap_init_txrx(struct wlan_objmgr_vdev *vdev)
-{
-	struct wlan_dp_intf *dp_intf;
-
-	dp_intf = dp_get_vdev_priv_obj(vdev);
-	if (unlikely(!dp_intf)) {
-		dp_err("DP interface not found");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	qdf_mem_zero(&dp_intf->stats, sizeof(qdf_net_dev_stats));
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS ucfg_dp_softap_deinit_txrx(struct wlan_objmgr_vdev *vdev)
-{
-	struct wlan_dp_intf *dp_intf;
-
-	dp_intf = dp_get_vdev_priv_obj(vdev);
-	if (unlikely(!dp_intf)) {
-		dp_err("DP interface not found");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	dp_intf->tx_fn = NULL;
-	dp_intf->sap_tx_block_mask |= DP_TX_FN_CLR;
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS ucfg_dp_start_xmit(qdf_nbuf_t nbuf, struct wlan_objmgr_vdev *vdev)
 {
 	struct wlan_dp_intf *dp_intf;

+ 4 - 19
core/hdd/src/wlan_hdd_hostapd.c

@@ -4111,11 +4111,6 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	/* Cache station count initialize to zero */
 	qdf_atomic_init(&adapter->cache_sta_count);
 
-	/* Initialize the data path module */
-	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_DP_ID);
-	if (vdev)
-		ucfg_dp_softap_init_txrx(vdev);
-
 	status = hdd_wmm_adapter_init(adapter);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("hdd_wmm_adapter_init() failed code: %08d [x%08x]",
@@ -4137,12 +4132,16 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 		hdd_err("wmi_pdev_param_burst_enable set failed: %d", ret);
 
 
+	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_ID);
 	ucfg_mlme_is_6g_sap_fd_enabled(hdd_ctx->psoc, &is_6g_sap_fd_enabled);
 	hdd_debug("6g sap fd enabled %d", is_6g_sap_fd_enabled);
 	if (is_6g_sap_fd_enabled && vdev)
 		wlan_vdev_mlme_feat_ext_cap_set(vdev,
 						WLAN_VDEV_FEXT_FILS_DISC_6G_SAP);
 
+	if (vdev)
+		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
+
 	hdd_set_netdev_flags(adapter);
 
 	if (!reinit) {
@@ -4159,18 +4158,12 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	/* rcpi info initialization */
 	qdf_mem_zero(&adapter->rcpi, sizeof(adapter->rcpi));
 
-	if (vdev)
-		hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
 	hdd_exit();
 
 	return status;
 
 error_release_softap_tx_rx:
 	hdd_unregister_wext(adapter->dev);
-	if (vdev) {
-		ucfg_dp_softap_deinit_txrx(vdev);
-		hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
-	}
 error_deinit_sap_session:
 	hdd_hostapd_deinit_sap_session(adapter);
 error_release_vdev:
@@ -4182,8 +4175,6 @@ void hdd_deinit_ap_mode(struct hdd_context *hdd_ctx,
 			struct hdd_adapter *adapter,
 			bool rtnl_held)
 {
-	struct wlan_objmgr_vdev *vdev;
-
 	hdd_enter_dev(adapter->dev);
 
 	if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
@@ -4199,12 +4190,6 @@ void hdd_deinit_ap_mode(struct hdd_context *hdd_ctx,
 		wlan_hdd_enable_roaming(adapter, RSO_SAP_CHANNEL_CHANGE);
 	}
 
-	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_DP_ID);
-	if (vdev) {
-		ucfg_dp_softap_deinit_txrx(vdev);
-		hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
-	}
-
 	if (hdd_hostapd_deinit_sap_session(adapter))
 		hdd_err("Failed:hdd_hostapd_deinit_sap_session");