qcacld-3.0: cleanup legacy scan request processing
Cleanup legacy scan request processing from HDD and SME api to process the same. Change-Id: Ic160dfafcfa015eb42a226304260b1be3dddc6f0 CRs-Fixed: 2136149
This commit is contained in:

committed by
snandini

szülő
7855452db0
commit
999ba33342
@@ -654,230 +654,11 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
|
||||
!qdf_mem_cmp(&request->ssids[0], "DIRECT-", 7))
|
||||
ucfg_p2p_status_scan(adapter->hdd_vdev);
|
||||
|
||||
#ifdef NAPIER_SCAN
|
||||
status = wlan_cfg80211_scan(hdd_ctx->hdd_pdev, request, ¶ms);
|
||||
if (params.default_ie.ptr)
|
||||
qdf_mem_free(params.default_ie.ptr);
|
||||
return status;
|
||||
#else
|
||||
/* Below code will be removed once common scan module is available.*/
|
||||
qdf_mem_zero(&scan_req, sizeof(scan_req));
|
||||
|
||||
scan_req.timestamp = qdf_mc_timer_get_system_time();
|
||||
|
||||
/* Even though supplicant doesn't provide any SSIDs, n_ssids is
|
||||
* set to 1. Because of this, driver is assuming that this is not
|
||||
* wildcard scan and so is not aging out the scan results.
|
||||
*/
|
||||
if ((request->ssids) && (request->n_ssids == 1) &&
|
||||
('\0' == request->ssids->ssid[0])) {
|
||||
request->n_ssids = 0;
|
||||
}
|
||||
|
||||
if ((request->ssids) && (0 < request->n_ssids)) {
|
||||
tCsrSSIDInfo *SsidInfo;
|
||||
int j;
|
||||
|
||||
scan_req.SSIDs.numOfSSIDs = request->n_ssids;
|
||||
/* Allocate num_ssid tCsrSSIDInfo structure */
|
||||
SsidInfo = scan_req.SSIDs.SSIDList =
|
||||
qdf_mem_malloc(request->n_ssids * sizeof(tCsrSSIDInfo));
|
||||
|
||||
if (NULL == scan_req.SSIDs.SSIDList) {
|
||||
hdd_err("memory alloc failed SSIDInfo buffer");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* copy all the ssid's and their length */
|
||||
for (j = 0; j < request->n_ssids; j++, SsidInfo++) {
|
||||
/* get the ssid length */
|
||||
SsidInfo->SSID.length = request->ssids[j].ssid_len;
|
||||
qdf_mem_copy(SsidInfo->SSID.ssId,
|
||||
&request->ssids[j].ssid[0],
|
||||
SsidInfo->SSID.length);
|
||||
SsidInfo->SSID.ssId[SsidInfo->SSID.length] = '\0';
|
||||
hdd_debug("SSID number %d: %s", j,
|
||||
SsidInfo->SSID.ssId);
|
||||
}
|
||||
/* set the scan type to active */
|
||||
scan_req.scanType = eSIR_ACTIVE_SCAN;
|
||||
} else if (QDF_P2P_GO_MODE == adapter->device_mode) {
|
||||
/* set the scan type to active */
|
||||
scan_req.scanType = eSIR_ACTIVE_SCAN;
|
||||
} else {
|
||||
/*
|
||||
* Set the scan type to passive if there is no ssid list
|
||||
* provided else set default type configured in the driver.
|
||||
*/
|
||||
if (!request->ssids)
|
||||
scan_req.scanType = eSIR_PASSIVE_SCAN;
|
||||
else
|
||||
scan_req.scanType = hdd_ctx->ioctl_scan_mode;
|
||||
}
|
||||
if (scan_req.scanType == eSIR_PASSIVE_SCAN) {
|
||||
scan_req.minChnTime = cfg_param->nPassiveMinChnTime;
|
||||
scan_req.maxChnTime = cfg_param->nPassiveMaxChnTime;
|
||||
} else {
|
||||
scan_req.minChnTime = cfg_param->nActiveMinChnTime;
|
||||
scan_req.maxChnTime = cfg_param->nActiveMaxChnTime;
|
||||
}
|
||||
|
||||
wlan_hdd_copy_bssid_scan_request(&scan_req, request);
|
||||
|
||||
/* set BSSType to default type */
|
||||
scan_req.BSSType = eCSR_BSS_TYPE_ANY;
|
||||
|
||||
if (MAX_CHANNEL < request->n_channels) {
|
||||
hdd_warn("No of Scan Channels exceeded limit: %d",
|
||||
request->n_channels);
|
||||
request->n_channels = MAX_CHANNEL;
|
||||
}
|
||||
|
||||
if (request->n_channels) {
|
||||
char chList[(request->n_channels * 5) + 1];
|
||||
int len;
|
||||
|
||||
channelList = qdf_mem_malloc(request->n_channels);
|
||||
if (NULL == channelList) {
|
||||
hdd_err("channelList malloc failed channelList");
|
||||
status = -ENOMEM;
|
||||
goto free_mem;
|
||||
}
|
||||
for (i = 0, len = 0; i < request->n_channels; i++) {
|
||||
if (WLAN_REG_IS_11P_CH(
|
||||
pHddCrequest->channels[i]->hw_value))
|
||||
continue;
|
||||
|
||||
channelList[num_chan] = request->channels[i]->hw_value;
|
||||
len += snprintf(chList + len, 5, "%d ", channelList[i]);
|
||||
num_chan++;
|
||||
}
|
||||
hdd_debug("Channel-List: %s", chList);
|
||||
hdd_debug("No. of Scan Channels: %d", num_chan);
|
||||
}
|
||||
if (!num_chan) {
|
||||
hdd_err("Received zero non-dsrc channels");
|
||||
status = -EINVAL;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
scan_req.ChannelInfo.numOfChannels = num_chan;
|
||||
scan_req.ChannelInfo.ChannelList = channelList;
|
||||
|
||||
/* set requestType to full scan */
|
||||
scan_req.requestType = eCSR_SCAN_REQUEST_FULL_SCAN;
|
||||
|
||||
/* Flush the scan results(only p2p beacons) for STA scan and P2P
|
||||
* search (Flush on both full scan and social scan but not on single
|
||||
* channel scan).P2P search happens on 3 social channels (1, 6, 11)
|
||||
*/
|
||||
|
||||
/* Supplicant does single channel scan after 8-way handshake
|
||||
* and in that case driver shoudnt flush scan results. If
|
||||
* driver flushes the scan results here and unfortunately if
|
||||
* the AP doesnt respond to our probe req then association
|
||||
* fails which is not desired
|
||||
*/
|
||||
|
||||
if ((request->n_ssids == 1) &&
|
||||
(request->ssids != NULL) &&
|
||||
qdf_mem_cmp(&request->ssids[0], "DIRECT-", 7))
|
||||
is_p2p_scan = true;
|
||||
|
||||
if (is_p2p_scan ||
|
||||
(request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN)) {
|
||||
hdd_debug("Flushing P2P Results");
|
||||
sme_scan_flush_p2p_result(WLAN_HDD_GET_HAL_CTX(adapter),
|
||||
adapter->session_id);
|
||||
}
|
||||
if (request->ie_len) {
|
||||
pP2pIe = wlan_hdd_get_p2p_ie_ptr((uint8_t *) request->ie,
|
||||
request->ie_len);
|
||||
if (pP2pIe != NULL) {
|
||||
/* no_cck will be set during p2p find to
|
||||
* disable 11b rates
|
||||
*/
|
||||
if (request->no_cck) {
|
||||
hdd_debug("This is a P2P Search");
|
||||
scan_req.p2pSearch = 1;
|
||||
|
||||
if (request->n_channels ==
|
||||
WLAN_HDD_P2P_SOCIAL_CHANNELS) {
|
||||
/* set requestType to P2P Discovery */
|
||||
scan_req.requestType =
|
||||
eCSR_SCAN_P2P_DISCOVERY;
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip Dfs Channel in case of P2P Search if
|
||||
* it is set in ini file
|
||||
*/
|
||||
if (cfg_param->skipDfsChnlInP2pSearch)
|
||||
scan_req.skipDfsChnlInP2pSearch = 1;
|
||||
else
|
||||
scan_req.skipDfsChnlInP2pSearch = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scan_req.uIEFieldLen = scan_info->scan_add_ie.length;
|
||||
scan_req.pIEField = scan_info->scan_add_ie.addIEdata;
|
||||
|
||||
/* acquire the wakelock to avoid the apps suspend during the scan. To
|
||||
* address the following issues.
|
||||
* 1) Disconnected scenario: we are not allowing the suspend as WLAN
|
||||
* is not in BMPS/IMPS this result in android trying to suspend
|
||||
* aggressively and backing off for long time, this result in apps
|
||||
* running at full power for long time.
|
||||
* 2) Connected scenario: If we allow the suspend during the scan,
|
||||
* RIVA will be stuck in full power because of resume BMPS
|
||||
*/
|
||||
hdd_prevent_suspend_timeout(HDD_WAKE_LOCK_SCAN_DURATION,
|
||||
WIFI_POWER_EVENT_WAKELOCK_SCAN);
|
||||
|
||||
hdd_debug("requestType %d, scanType %d, minChnTime %d, maxChnTime %d,p2pSearch %d, skipDfsChnlIn P2pSearch %d",
|
||||
scan_req.requestType, scan_req.scanType,
|
||||
scan_req.minChnTime, scan_req.maxChnTime,
|
||||
scan_req.p2pSearch, scan_req.skipDfsChnlInP2pSearch);
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0))
|
||||
if (request->flags & NL80211_SCAN_FLAG_FLUSH)
|
||||
sme_scan_flush_result(WLAN_HDD_GET_HAL_CTX(adapter));
|
||||
#endif
|
||||
status = sme_scan_request(WLAN_HDD_GET_HAL_CTX(adapter),
|
||||
adapter->session_id, &scan_req,
|
||||
&hdd_cfg80211_scan_done_callback, dev);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
hdd_err("sme_scan_request returned error %d", status);
|
||||
if (QDF_STATUS_E_RESOURCES == status) {
|
||||
scan_ebusy_cnt++;
|
||||
hdd_err("HO is in progress. Defer scan scan_ebusy_cnt: %d",
|
||||
scan_ebusy_cnt);
|
||||
status = -EBUSY;
|
||||
} else {
|
||||
status = -EIO;
|
||||
}
|
||||
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN);
|
||||
goto free_mem;
|
||||
}
|
||||
wlan_hdd_scan_request_enqueue(adapter, request, source,
|
||||
scan_req.scan_id, scan_req.timestamp);
|
||||
adapter->scan_info.mScanPending = true;
|
||||
hdd_ctx->beacon_probe_rsp_cnt_per_scan = 0;
|
||||
free_mem:
|
||||
if (scan_req.SSIDs.SSIDList)
|
||||
qdf_mem_free(scan_req.SSIDs.SSIDList);
|
||||
|
||||
if (channelList)
|
||||
qdf_mem_free(channelList);
|
||||
|
||||
if (status == 0)
|
||||
scan_ebusy_cnt = 0;
|
||||
|
||||
EXIT();
|
||||
return status;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#undef SCAN_FAILURE
|
||||
|
@@ -1834,7 +1834,7 @@ QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context,
|
||||
/* Set requestType to Full scan */
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("calling sme_scan_request"));
|
||||
FL("calling ucfg_scan_start"));
|
||||
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
||||
if (sap_context->acs_cfg->skip_scan_status ==
|
||||
eSAP_DO_NEW_ACS_SCAN)
|
||||
@@ -1846,7 +1846,7 @@ QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context,
|
||||
|
||||
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("sme_scan_request fail %d!!!"),
|
||||
FL("scan request fail %d!!!"),
|
||||
qdf_ret_status);
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("SAP Configuring default channel, Ch=%d"),
|
||||
|
@@ -280,9 +280,6 @@ QDF_STATUS sme_ser_cmd_callback(void *buf,
|
||||
QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg);
|
||||
QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg);
|
||||
void sme_free_msg(tHalHandle hHal, struct scheduler_msg *pMsg);
|
||||
QDF_STATUS sme_scan_request(tHalHandle hHal, uint8_t sessionId,
|
||||
tCsrScanRequest *, csr_scan_completeCallback callback,
|
||||
void *pContext);
|
||||
QDF_STATUS sme_scan_get_result(tHalHandle hHal, uint8_t sessionId,
|
||||
tCsrScanResultFilter *pFilter,
|
||||
tScanResultHandle *phResult);
|
||||
|
@@ -2710,100 +2710,6 @@ QDF_STATUS sme_remove_bssid_from_scan_list(tHalHandle hal,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifndef NAPIER_SCAN
|
||||
/**
|
||||
* sme_scan_request() - wrapper function to Request a 11d or full scan from CSR.
|
||||
* @hal: hal global context
|
||||
* @session_id: session id
|
||||
* @scan_req: scan req
|
||||
* @callback: a callback function that scan calls upon finish, will not
|
||||
* be called if csr_scan_request returns error
|
||||
* @ctx: a pointer passed in for the callback
|
||||
*
|
||||
* This is a wrapper function to Request a 11d or full scan from CSR. This is
|
||||
* an asynchronous call
|
||||
*
|
||||
* Return: Status of operation
|
||||
*/
|
||||
QDF_STATUS sme_scan_request(tHalHandle hal, uint8_t session_id,
|
||||
tCsrScanRequest *scan_req,
|
||||
csr_scan_completeCallback callback, void *ctx)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
||||
struct ani_scan_req *scan_msg;
|
||||
struct scheduler_msg msg = {0};
|
||||
uint32_t scan_req_id, scan_count;
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_SME,
|
||||
TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, session_id,
|
||||
scan_req->scanType));
|
||||
|
||||
if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
|
||||
sme_err("Invalid session id: %d", session_id);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (!mac_ctx->scan.fScanEnable) {
|
||||
sme_err("fScanEnable false");
|
||||
return status;
|
||||
}
|
||||
|
||||
scan_count = csr_scan_active_ll_count(mac_ctx);
|
||||
if (scan_count >= mac_ctx->scan.max_scan_count) {
|
||||
sme_err("Max scan reached");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
wma_get_scan_id(&scan_req_id);
|
||||
scan_req->scan_id = scan_req_id;
|
||||
|
||||
status = sme_acquire_global_lock(&mac_ctx->sme);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
sme_err("Unable to acquire lock");
|
||||
return status;
|
||||
}
|
||||
scan_msg = qdf_mem_malloc(sizeof(struct ani_scan_req));
|
||||
if (NULL == scan_msg) {
|
||||
sme_err("Failed to allocate memory for scan_msg");
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
scan_msg->msg_type = eWNI_SME_SCAN_CMD;
|
||||
scan_msg->msg_len = (uint16_t) sizeof(struct ani_scan_req);
|
||||
scan_msg->session_id = session_id;
|
||||
scan_msg->callback = callback;
|
||||
scan_msg->ctx = ctx;
|
||||
scan_msg->scan_param = qdf_mem_malloc(sizeof(tCsrScanRequest));
|
||||
if (NULL == scan_msg->scan_param) {
|
||||
sme_err("Failed to allocate memory for scan_param");
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
qdf_mem_free(scan_msg);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
csr_scan_copy_request(mac_ctx, scan_msg->scan_param, scan_req);
|
||||
msg.type = eWNI_SME_SCAN_CMD;
|
||||
msg.bodyptr = scan_msg;
|
||||
msg.reserved = 0;
|
||||
msg.bodyval = 0;
|
||||
if (QDF_STATUS_SUCCESS !=
|
||||
scheduler_post_msg(QDF_MODULE_ID_SME, &msg)) {
|
||||
sme_err("sme_scan_req failed to post msg");
|
||||
csr_scan_free_request(mac_ctx, scan_msg->scan_param);
|
||||
qdf_mem_free(scan_msg->scan_param);
|
||||
qdf_mem_free(scan_msg);
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
QDF_STATUS sme_scan_request(tHalHandle hal, uint8_t session_id,
|
||||
tCsrScanRequest *scan_req,
|
||||
csr_scan_completeCallback callback, void *ctx)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* sme_scan_get_result
|
||||
|
Reference in New Issue
Block a user