From 0a11f8dc6f438cd2346b07f01ea6bbf3f7fce9ee Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Fri, 23 Jun 2017 15:53:29 -0700 Subject: [PATCH] qcacld-3.0: Cleanup legacy scan code Cleanup unused legacy scan code related to abort scan. Change-Id: I32c4c81b54bd464ebd5918c5a697fc57f505abc7 CRs-Fixed: 2063667 --- core/hdd/inc/wlan_hdd_main.h | 2 - core/hdd/src/wlan_hdd_main.c | 14 +---- core/hdd/src/wlan_hdd_scan.c | 111 +--------------------------------- core/sme/inc/sme_api.h | 14 ----- core/sme/src/common/sme_api.c | 19 ------ 5 files changed, 5 insertions(+), 155 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index ec410a8b191f..c302e35028d3 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1866,8 +1866,6 @@ uint8_t hdd_get_operating_channel(hdd_context_t *pHddCtx, void hdd_set_conparam(uint32_t con_param); enum tQDF_GLOBAL_CON_MODE hdd_get_conparam(void); -void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId, - uint32_t scan_id, eCsrAbortReason reason); void hdd_cleanup_actionframe(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c259588915a8..ca9f4723b554 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8987,12 +8987,11 @@ static void hdd_features_deinit(hdd_context_t *hdd_ctx) wlan_hdd_tsf_deinit(hdd_ctx); } -#ifdef NAPIER_SCAN /** - * hdd_post_cds_enable_config() - HDD post cds start config helper - * @adapter - Pointer to the HDD + * hdd_register_bcn_cb() - register scan beacon callback + * @hdd_ctx - Pointer to the HDD context * - * Return: None + * Return: QDF_STATUS */ static inline QDF_STATUS hdd_register_bcn_cb(hdd_context_t *hdd_ctx) { @@ -9009,13 +9008,6 @@ static inline QDF_STATUS hdd_register_bcn_cb(hdd_context_t *hdd_ctx) return QDF_STATUS_SUCCESS; } -#else -static inline QDF_STATUS hdd_register_bcn_cb(hdd_context_t *hdd_ctx) -{ - return QDF_STATUS_SUCCESS; -} - -#endif /** * hdd_configure_cds() - Configure cds modules diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 55c006b78b52..4593ec78fafc 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -52,10 +52,7 @@ #include "wlan_cfg80211.h" #endif #include - -#ifdef NAPIER_SCAN #include -#endif #define MAX_RATES 12 #define HDD_WAKE_LOCK_SCAN_DURATION (5 * 1000) /* in msec */ @@ -287,27 +284,6 @@ static QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx, } #endif -/** - * hdd_abort_mac_scan() - aborts ongoing mac scan - * @pHddCtx: Pointer to hdd context - * @sessionId: session id - * @scan_id: scan id - * @reason: abort reason - * - * Abort any MAC scan if in progress - * - * Return: none - */ -void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId, - uint32_t scan_id, eCsrAbortReason reason) -{ -#ifndef NAPIER_SCAN - sme_abort_mac_scan(pHddCtx->hHal, sessionId, scan_id, reason); -#else - wlan_abort_scan(pHddCtx->hdd_pdev, INVAL_PDEV_ID, - sessionId, scan_id, false); -#endif -} /** * hdd_vendor_scan_callback() - Scan completed callback event * @hddctx: HDD context @@ -1725,61 +1701,7 @@ int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, return ret; } -/* Below code will be removed once common scan module is available.*/ -#ifndef NAPIER_SCAN -/** - * wlan_hdd_get_scanid() - API to get the scan id - * from the scan cookie attribute. - * @hdd_ctx: Pointer to HDD context - * @scan_id: Pointer to scan id - * @cookie : Scan cookie attribute - * - * API to get the scan id from the scan cookie attribute - * sent from supplicant by matching scan request. - * - * Return: 0 for success, non zero for failure - */ -static int wlan_hdd_get_scanid(hdd_context_t *hdd_ctx, - uint32_t *scan_id, uint64_t cookie) -{ - struct hdd_scan_req *scan_req; - qdf_list_node_t *node = NULL; - qdf_list_node_t *ptr_node = NULL; - int ret = -EINVAL; - qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock); - if (qdf_list_empty(&hdd_ctx->hdd_scan_req_q)) { - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - return ret; - } - - if (QDF_STATUS_SUCCESS != - qdf_list_peek_front(&hdd_ctx->hdd_scan_req_q, - &ptr_node)) { - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - return ret; - } - - do { - node = ptr_node; - scan_req = container_of(node, struct hdd_scan_req, node); - - if (cookie == - (uintptr_t)(scan_req->scan_request)) { - *scan_id = scan_req->scan_id; - ret = 0; - break; - } - } while (QDF_STATUS_SUCCESS == - qdf_list_peek_next(&hdd_ctx->hdd_scan_req_q, - node, &ptr_node)); - - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - - return ret; - -} -#endif /** * __wlan_hdd_vendor_abort_scan() - API to process vendor command for * abort scan @@ -1797,11 +1719,6 @@ static int __wlan_hdd_vendor_abort_scan( int data_len) { hdd_context_t *hdd_ctx = wiphy_priv(wiphy); -#ifndef NAPIER_SCAN - struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SCAN_MAX + 1]; - uint32_t scan_id = 0; - uint64_t cookie; -#endif int ret; if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { @@ -1813,30 +1730,9 @@ static int __wlan_hdd_vendor_abort_scan( if (0 != ret) return ret; -/* Below code will be removed once common scan module is available.*/ -#ifndef NAPIER_SCAN - ret = -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data, - data_len, scan_policy)) { - hdd_err("Invalid ATTR"); - return ret; - } - - if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE]) { - cookie = nla_get_u64( - tb[QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE]); - ret = wlan_hdd_get_scanid(hdd_ctx, - &scan_id, - cookie); - if (ret != 0) - return ret; - wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID, - HDD_SESSION_ID_INVALID, scan_id, false); - } -#else wlan_vendor_abort_scan(hdd_ctx->hdd_pdev, data, data_len); -#endif + return ret; } @@ -2103,11 +1999,8 @@ static void __wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy, if (ret) return; -#ifndef NAPIER_SCAN - wlan_hdd_scan_abort(adapter); -#else wlan_cfg80211_abort_scan(hdd_ctx->hdd_pdev); -#endif + EXIT(); } diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 64778023c6cf..f3da8b155098 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -539,20 +539,6 @@ uint16_t sme_check_concurrent_channel_overlap(tHalHandle hHal, uint16_t sap_ch, eCsrPhyMode sapPhyMode, uint8_t cc_switch_mode); #endif -/** - * sme_abort_mac_scan() - API to cancel MAC scan - * @hHal: The handle returned by mac_open - * @sessionId: sessionId on which we need to abort scan - * @scan_id: scan id on which we need to abort scan - * @reason: Reason to abort the scan - * - * This function aborts MAC scan. - * - * Return: QDF_STATUS_E_FAILURE for failure, QDF_STATUS_SUCCESS for - * success - */ -QDF_STATUS sme_abort_mac_scan(tHalHandle hHal, uint8_t sessionId, - uint32_t scan_id, eCsrAbortReason reason); QDF_STATUS sme_get_cfg_valid_channels(uint8_t *aValidChannels, uint32_t *len); #ifdef WLAN_FEATURE_PACKET_FILTERING diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index faacb8b06711..bc970663d0f7 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -5923,25 +5923,6 @@ QDF_STATUS sme_set_keep_alive(tHalHandle hHal, uint8_t session_id, return QDF_STATUS_SUCCESS; } -QDF_STATUS sme_abort_mac_scan(tHalHandle hHal, uint8_t sessionId, - uint32_t scan_id, eCsrAbortReason reason) -{ - QDF_STATUS status; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - - MTRACE(qdf_trace(QDF_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); - status = sme_acquire_global_lock(&pMac->sme); - if (QDF_IS_STATUS_SUCCESS(status)) { - status = csr_scan_abort_mac_scan(pMac, sessionId, - scan_id, reason); - - sme_release_global_lock(&pMac->sme); - } - - return status; -} - /* ---------------------------------------------------------------------------- \fn sme_get_operation_channel \brief API to get current channel on which STA is parked