summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Kumar <abhikuma@codeaurora.org>2018-07-13 17:59:08 +0530
committernshrivas <nshrivas@codeaurora.org>2018-07-19 12:01:56 -0700
commita60095683d652ac5d0a873ca59cb3916f23eaf15 (patch)
treeeecaed3dc47f56c7e3be6d4026d95982c42ce6de
parent10a8e641bec577f64d2418108aa58fc7cf4dd829 (diff)
qcacld-3.0: Host sends VDEV_DELETE cmd to fw before stop_bss
When stop_ap command comes from userspace, __wlan_hdd_cfg80211_stop_ap calls sap_fsm to change the states of SAP from started to disconnect. In order to change SAP states, __wlan_hdd_cfg80211_stop_ap sends WMI_VDEV_STOP_CMDID followed by WMI_VDEV_DOWN_CMDID and WMI_VDEV_DELETE_CMDID to fw. After the successful change in state of SAP machine, driver invokes an HDD callback, hdd_hostapd_sap_event_cb for cleanup and subsequently invokes hdd_softap_stop_bss to reclaim all resources. This API sends IPA_OFFLOAD_ENABLE_DISABLE cmd to fw for the VDEV on which SAP started. Which results assert in firmware as host sends HDD IPA event for the VDEV which is already deleted while changing the state of SAP. Fix is to send HDD_IPA_AP_DISCONNECT IPA events before stop BSS. Change-Id: Ief9318bb476b480fd52f4155a0788a34c1e2ed53 CRs-Fixed: 2276125
-rw-r--r--core/cds/src/cds_concurrency.c1
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c17
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.h9
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
-rw-r--r--core/hdd/src/wlan_hdd_softap_tx_rx.c8
5 files changed, 29 insertions, 8 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index c97d7a573426..145b2607f114 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -8753,6 +8753,7 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter)
hdd_cleanup_actionframe(hdd_ctx, ap_adapter);
hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
+ hdd_ipa_ap_disconnect(ap_adapter);
if (QDF_STATUS_SUCCESS == wlansap_stop_bss(sap_ctx)) {
qdf_status =
qdf_wait_for_event_completion(&hostapd_state->
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 0adfa9e1cc36..7395044db6de 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -735,6 +735,7 @@ static int hdd_stop_bss_link(hdd_adapter_t *pHostapdAdapter,
return status;
if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) {
+ hdd_ipa_ap_disconnect(pHostapdAdapter);
status = wlansap_stop_bss(
WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
if (QDF_IS_STATUS_SUCCESS(status))
@@ -5348,6 +5349,7 @@ __iw_softap_stopbss(struct net_device *dev,
WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
qdf_event_reset(&pHostapdState->qdf_stop_bss_event);
+ hdd_ipa_ap_disconnect(pHostapdAdapter);
status = wlansap_stop_bss(
WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
if (QDF_IS_STATUS_SUCCESS(status)) {
@@ -8868,6 +8870,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), true);
qdf_event_reset(&pHostapdState->qdf_stop_bss_event);
+ hdd_ipa_ap_disconnect(pAdapter);
status = wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter));
if (QDF_IS_STATUS_SUCCESS(status)) {
qdf_status =
@@ -9570,3 +9573,17 @@ void hdd_sap_destroy_events(hdd_adapter_t *adapter)
}
EXIT();
}
+void hdd_ipa_ap_disconnect(hdd_adapter_t *pAdapter)
+{
+ hdd_context_t *hdd_ctx;
+ hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+
+ if (hdd_ipa_is_enabled(hdd_ctx)) {
+ if (hdd_ipa_wlan_evt(pAdapter,
+ WLAN_HDD_GET_AP_CTX_PTR(pAdapter)->uBCStaId,
+ HDD_IPA_AP_DISCONNECT,
+ pAdapter->dev->dev_addr)) {
+ hdd_err("WLAN_AP_DISCONNECT event failed");
+ }
+ }
+}
diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h
index cbfa35b82aa8..7f80d05e2488 100644
--- a/core/hdd/src/wlan_hdd_hostapd.h
+++ b/core/hdd/src/wlan_hdd_hostapd.h
@@ -142,4 +142,13 @@ void hdd_sap_destroy_events(hdd_adapter_t *adapter);
QDF_STATUS hdd_softap_set_peer_authorized(hdd_adapter_t *adapter,
struct qdf_mac_addr *peer_mac);
+/**
+ * hdd_ipa_ap_disconnect() - call hdd_ipa_wlan_evt if
+ * ipa is enabled
+ * @pAdapter: pointer to adapter context
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+void hdd_ipa_ap_disconnect(hdd_adapter_t *pAdapter);
+
#endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index d5ac889e9cd6..00e043df7ff9 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -4917,6 +4917,7 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
QDF_STATUS status;
QDF_STATUS qdf_status;
+ hdd_ipa_ap_disconnect(adapter);
/* Stop Bss. */
status = wlansap_stop_bss(
WLAN_HDD_GET_SAP_CTX_PTR(adapter));
@@ -12049,6 +12050,7 @@ void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter)
hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
hdd_debug("Now doing SAP STOPBSS");
qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
+ hdd_ipa_ap_disconnect(ap_adapter);
if (QDF_STATUS_SUCCESS == wlansap_stop_bss(hdd_ap_ctx->
sapContext)) {
qdf_status = qdf_wait_for_event_completion(
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index 11b927486171..d3450e20b292 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -1206,14 +1206,6 @@ QDF_STATUS hdd_softap_stop_bss(hdd_adapter_t *pAdapter)
sme_update_channel_list(pHddCtx->hHal);
}
- if (hdd_ipa_is_enabled(pHddCtx)) {
- if (hdd_ipa_wlan_evt(pAdapter,
- WLAN_HDD_GET_AP_CTX_PTR(pAdapter)->uBCStaId,
- HDD_IPA_AP_DISCONNECT,
- pAdapter->dev->dev_addr))
- hdd_err("WLAN_AP_DISCONNECT event failed");
- }
-
return qdf_status;
}