summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2017-02-23 16:23:05 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-02-28 21:25:08 -0800
commitbaf2e0a5707771000ddc27dcf0ae5565c8ed8249 (patch)
tree8d100eae4209fadd3db65240dd0e514360ca356b
parent4943ae73365cd4c2a6b855af7165323c15eede5c (diff)
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
-rw-r--r--core/cds/src/cds_api.c12
-rw-r--r--core/dp/txrx/ol_txrx.c72
-rw-r--r--core/hdd/src/wlan_hdd_main.c7
3 files changed, 58 insertions, 33 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index 4998a6761ce1..710cf83ba3b3 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -823,6 +823,8 @@ QDF_STATUS cds_post_disable(void)
{
tp_wma_handle wma_handle;
struct hif_opaque_softc *hif_ctx;
+ ol_txrx_pdev_handle txrx_pdev;
+
wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma_handle) {
cds_err("Failed to get wma_handle!");
@@ -835,6 +837,12 @@ QDF_STATUS cds_post_disable(void)
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,
@@ -850,6 +858,8 @@ QDF_STATUS cds_post_disable(void)
hif_disable_isr(hif_ctx);
hif_reset_soc(hif_ctx);
+ ol_txrx_pdev_pre_detach(txrx_pdev, 1);
+
return QDF_STATUS_SUCCESS;
}
@@ -879,7 +889,7 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context)
gp_cds_context->htc_ctx = NULL;
}
- ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx, 1);
+ ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx);
cds_free_context(cds_context, QDF_MODULE_ID_TXRX,
gp_cds_context->pdev_txrx_ctx);
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index 994a83265842..36f9af2c4744 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -1689,43 +1689,28 @@ A_STATUS ol_txrx_pdev_attach_target(ol_txrx_pdev_handle pdev)
}
/**
- * 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
*/
-void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, int force)
+void ol_txrx_pdev_pre_detach(ol_txrx_pdev_handle pdev, int force)
{
int i;
int num_freed_tx_desc = 0;
- struct hif_opaque_softc *osc = cds_get_context(QDF_MODULE_ID_HIF);
- /*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, osc);
-
- 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);
@@ -1787,7 +1772,6 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, int force)
"freed %d tx frames for which no resp from target",
num_freed_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);
@@ -1801,14 +1785,8 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, 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);
@@ -1827,12 +1805,11 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, 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
@@ -1840,6 +1817,45 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, int force)
#endif
}
+/**
+ * ol_txrx_pdev_detach() - delete the data SW state
+ * @pdev - the data physical device object being removed
+ *
+ * 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
+ */
+void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev)
+{
+ struct hif_opaque_softc *osc = cds_get_context(QDF_MODULE_ID_HIF);
+
+ /*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, osc);
+
+ 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)
/**
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 01dd9ee43239..5dd8c4d88520 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1820,8 +1820,6 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
goto ol_cds_free;
}
- 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);
@@ -1830,6 +1828,8 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
goto close;
}
+ hdd_ctx->driver_status = DRIVER_MODULES_OPENED;
+
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
sme_register_ftm_msg_processor(hdd_ctx->hHal,
hdd_ftm_mc_process_msg);
@@ -8513,14 +8513,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_exit_netlink_services(hdd_ctx);