Răsfoiți Sursa

qcacld-3.0: Separate pdev detach processing as per pdev attach

Separate out pdev detach processing as ol_txrx_pdev_detach()
and ol_txrx_pdev_pre_detach() corresponding to pdev attach
functions ol_txrx_pdev_attach() and ol_txrx_pdev_post_attach()
respectively.

Change-Id: I7fdbe70ad8262a57b61a742fcfb2779e323172af
CRs-Fixed: 2010653
Himanshu Agarwal 8 ani în urmă
părinte
comite
0b9bbc3533
3 a modificat fișierele cu 61 adăugiri și 31 ștergeri
  1. 11 0
      core/cds/src/cds_api.c
  2. 48 27
      core/dp/txrx/ol_txrx.c
  3. 2 4
      core/hdd/src/wlan_hdd_main.c

+ 11 - 0
core/cds/src/cds_api.c

@@ -967,6 +967,8 @@ QDF_STATUS cds_post_disable(v_CONTEXT_t cds_context)
 {
 	tp_wma_handle wma_handle;
 	struct hif_opaque_softc *hif_ctx;
+	struct cdp_pdev *txrx_pdev;
+
 	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
 	if (!wma_handle) {
 		cds_err("Failed to get wma_handle!");
@@ -979,6 +981,12 @@ QDF_STATUS cds_post_disable(v_CONTEXT_t cds_context)
 		return QDF_STATUS_E_INVAL;
 	}
 
+	txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	if (!txrx_pdev) {
+		cds_err("Failed to get txrx pdev!");
+		return QDF_STATUS_E_INVAL;
+	}
+
 	/*
 	 * With new state machine changes cds_close can be invoked without
 	 * cds_disable. So, send the following clean up prerequisites to fw,
@@ -994,6 +1002,9 @@ QDF_STATUS cds_post_disable(v_CONTEXT_t cds_context)
 	hif_disable_isr(hif_ctx);
 	hif_reset_soc(hif_ctx);
 
+	cdp_pdev_pre_detach(cds_get_context(QDF_MODULE_ID_SOC),
+		       (struct cdp_pdev *)txrx_pdev, 1);
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 48 - 27
core/dp/txrx/ol_txrx.c

@@ -1714,42 +1714,28 @@ static A_STATUS ol_txrx_pdev_attach_target(struct cdp_pdev *ppdev)
 }
 
 /**
- * ol_txrx_pdev_detach() - delete the data SW state
- *
+ * ol_txrx_pdev_pre_detach() - detach the data SW state
  * @pdev - the data physical device object being removed
  * @force - delete the pdev (and its vdevs and peers) even if
  * there are outstanding references by the target to the vdevs
  * and peers within the pdev
  *
  * This function is used when the WLAN driver is being removed to
- * remove the host data component within the driver.
- * All virtual devices within the physical device need to be deleted
- * (ol_txrx_vdev_detach) before the physical device itself is deleted.
+ * detach the host data component within the driver.
  *
+ * Return: None
  */
-static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
+static void ol_txrx_pdev_pre_detach(struct cdp_pdev *ppdev, int force)
 {
 	struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)ppdev;
 	int i;
 
-	/*checking to ensure txrx pdev structure is not NULL */
-	if (!pdev) {
-		TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "NULL pdev passed to %s\n", __func__);
-		return;
-	}
 	/* preconditions */
 	TXRX_ASSERT2(pdev);
 
 	/* check that the pdev has no vdevs allocated */
 	TXRX_ASSERT1(TAILQ_EMPTY(&pdev->vdev_list));
 
-	htt_pktlogmod_exit(pdev);
-
-	OL_RX_REORDER_TIMEOUT_CLEANUP(pdev);
-
-	if (pdev->cfg.is_high_latency)
-		ol_tx_sched_detach(pdev);
-
 #ifdef QCA_SUPPORT_TX_THROTTLE
 	/* Thermal Mitigation */
 	qdf_timer_stop(&pdev->tx_throttle.phase_timer);
@@ -1805,7 +1791,6 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
 		htt_tx_desc_free(pdev->htt_pdev, htt_tx_desc);
 	}
 
-	htt_deregister_rx_pkt_dump_callback(pdev->htt_pdev);
 	ol_tx_deregister_flow_control(pdev);
 	/* Stop the communication between HTT and target at first */
 	htt_detach_target(pdev->htt_pdev);
@@ -1819,14 +1804,8 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
 		htt_ipa_uc_detach(pdev->htt_pdev);
 
 	htt_detach(pdev->htt_pdev);
-	htt_pdev_free(pdev->htt_pdev);
-
 	ol_tx_desc_dup_detect_deinit(pdev);
 
-	ol_txrx_peer_find_detach(pdev);
-
-	ol_txrx_tso_stats_deinit(pdev);
-
 	qdf_spinlock_destroy(&pdev->tx_mutex);
 	qdf_spinlock_destroy(&pdev->peer_ref_mutex);
 	qdf_spinlock_destroy(&pdev->last_real_peer_mutex);
@@ -1845,12 +1824,11 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
 	OL_RX_REORDER_TRACE_DETACH(pdev);
 	OL_RX_PN_TRACE_DETACH(pdev);
 
-	ol_txrx_pdev_txq_log_destroy(pdev);
-	ol_txrx_pdev_grp_stat_destroy(pdev);
 	/*
 	 * WDI event detach
 	 */
 	wdi_event_detach(pdev);
+
 	ol_txrx_local_peer_id_cleanup(pdev);
 
 #ifdef QCA_COMPUTE_TX_DELAY
@@ -1859,6 +1837,48 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
 	qdf_mem_free(ppdev);
 }
 
+/**
+ * ol_txrx_pdev_detach() - delete the data SW state
+ * @ppdev - the data physical device object being removed
+ * @force - delete the pdev (and its vdevs and peers) even if
+ * there are outstanding references by the target to the vdevs
+ * and peers within the pdev
+ *
+ * This function is used when the WLAN driver is being removed to
+ * remove the host data component within the driver.
+ * All virtual devices within the physical device need to be deleted
+ * (ol_txrx_vdev_detach) before the physical device itself is deleted.
+ *
+ * Return: None
+ */
+static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
+{
+	struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)ppdev;
+
+	/*checking to ensure txrx pdev structure is not NULL */
+	if (!pdev) {
+		TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
+			   "NULL pdev passed to %s\n", __func__);
+		return;
+	}
+
+	htt_pktlogmod_exit(pdev);
+
+	OL_RX_REORDER_TIMEOUT_CLEANUP(pdev);
+
+	if (pdev->cfg.is_high_latency)
+		ol_tx_sched_detach(pdev);
+
+	htt_deregister_rx_pkt_dump_callback(pdev->htt_pdev);
+
+	htt_pdev_free(pdev->htt_pdev);
+	ol_txrx_peer_find_detach(pdev);
+	ol_txrx_tso_stats_deinit(pdev);
+
+	ol_txrx_pdev_txq_log_destroy(pdev);
+	ol_txrx_pdev_grp_stat_destroy(pdev);
+}
+
 #if defined(CONFIG_PER_VDEV_TX_DESC_POOL)
 
 /**
@@ -5281,6 +5301,7 @@ static struct cdp_cmn_ops ol_ops_cmn = {
 	.txrx_pdev_attach = ol_txrx_pdev_attach,
 	.txrx_pdev_attach_target = ol_txrx_pdev_attach_target,
 	.txrx_pdev_post_attach = ol_txrx_pdev_post_attach,
+	.txrx_pdev_pre_detach = ol_txrx_pdev_pre_detach,
 	.txrx_pdev_detach = ol_txrx_pdev_detach,
 	.txrx_peer_create = ol_txrx_peer_attach,
 	.txrx_peer_setup = NULL,

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

@@ -1969,8 +1969,6 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
 			goto close;
 		}
 
-		hdd_ctx->driver_status = DRIVER_MODULES_OPENED;
-
 		hdd_ctx->hHal = cds_get_context(QDF_MODULE_ID_SME);
 
 		status = cds_pre_enable(hdd_ctx->pcds_context);
@@ -1980,6 +1978,7 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
 		}
 
 		hdd_update_hw_sw_info(hdd_ctx);
+		hdd_ctx->driver_status = DRIVER_MODULES_OPENED;
 
 		if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 			sme_register_ftm_msg_processor(hdd_ctx->hHal,
@@ -9006,14 +9005,13 @@ err_wiphy_unregister:
 err_stop_modules:
 	hdd_wlan_stop_modules(hdd_ctx);
 
-
+err_exit_nl_srv:
 	status = cds_sched_close(hdd_ctx->pcds_context);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_alert("Failed to close CDS Scheduler");
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(status));
 	}
 
-err_exit_nl_srv:
 	hdd_green_ap_deinit(hdd_ctx);
 	hdd_request_manager_deinit();
 	hdd_exit_netlink_services(hdd_ctx);