mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-11 05:12:12 -05:00
qcacld-3.0: Cleanup the legacy PNO code
Cleanup the legacy PNO code as PNO is moved to common scan component
Change-Id: I63914e1f496627ac32ddebbe0c8be7da088316cb
CRs-Fixed: 2032432
This commit is contained in:
parent
01ba2548c7
commit
0481d66d9d
27 changed files with 148 additions and 1777 deletions
|
|
@ -10633,13 +10633,4 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, uint16_t *int_array,
|
|||
void hdd_cfg_print(hdd_context_t *pHddCtx);
|
||||
|
||||
QDF_STATUS hdd_update_nss(hdd_context_t *hdd_ctx, uint8_t nss);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
void hdd_set_pno_channel_prediction_config(
|
||||
tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx);
|
||||
#else
|
||||
static inline void hdd_set_pno_channel_prediction_config(
|
||||
tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6887,35 +6887,6 @@ bool hdd_update_config_cfg(hdd_context_t *hdd_ctx)
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* hdd_set_pno_channel_prediction_config() - Set PNO configuration
|
||||
* @sme_config: Config params from SME Context
|
||||
* @hdd_ctx: Config params from HDD Context
|
||||
*
|
||||
* Copy the PNO Channel prediction feature configuration parameters
|
||||
* from HDD context to SME context.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void hdd_set_pno_channel_prediction_config(
|
||||
tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx)
|
||||
{
|
||||
sme_config->csrConfig.dual_mac_feature_disable =
|
||||
hdd_ctx->config->dual_mac_feature_disable;
|
||||
sme_config->csrConfig.pno_channel_prediction =
|
||||
hdd_ctx->config->pno_channel_prediction;
|
||||
sme_config->csrConfig.top_k_num_of_channels =
|
||||
hdd_ctx->config->top_k_num_of_channels;
|
||||
sme_config->csrConfig.stationary_thresh =
|
||||
hdd_ctx->config->stationary_thresh;
|
||||
sme_config->csrConfig.channel_prediction_full_scan =
|
||||
hdd_ctx->config->channel_prediction_full_scan;
|
||||
sme_config->csrConfig.pnoscan_adaptive_dwell_mode =
|
||||
hdd_ctx->config->pnoscan_adaptive_dwell_mode;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hdd_update_per_config_to_sme() -initializes the sme config for PER roam
|
||||
*
|
||||
|
|
@ -7231,11 +7202,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
|
|||
sme_update_enable_ssr((tHalHandle) (pHddCtx->hHal),
|
||||
pHddCtx->config->enableSSR);
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/* Update PNO offoad status */
|
||||
smeConfig->csrConfig.pnoOffload = pHddCtx->config->PnoOffload;
|
||||
#endif
|
||||
|
||||
/* Update maximum interfaces information */
|
||||
smeConfig->csrConfig.max_intf_count = pHddCtx->max_intf_count;
|
||||
|
||||
|
|
@ -7282,7 +7248,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
|
|||
/* Update 802.11p config */
|
||||
smeConfig->csrConfig.enable_dot11p =
|
||||
(pHddCtx->config->dot11p_mode != WLAN_HDD_11P_DISABLED);
|
||||
hdd_set_pno_channel_prediction_config(smeConfig, pHddCtx);
|
||||
|
||||
smeConfig->csrConfig.early_stop_scan_enable =
|
||||
pHddCtx->config->early_stop_scan_enable;
|
||||
|
|
|
|||
|
|
@ -10053,10 +10053,10 @@ static void hdd_config_sched_scan_plans_to_wiphy(struct wiphy *wiphy,
|
|||
{
|
||||
if (config->configPNOScanSupport) {
|
||||
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
|
||||
wiphy->max_sched_scan_ssids = SIR_PNO_MAX_SUPP_NETWORKS;
|
||||
wiphy->max_match_sets = SIR_PNO_MAX_SUPP_NETWORKS;
|
||||
wiphy->max_sched_scan_ssids = SCAN_PNO_MAX_SUPP_NETWORKS;
|
||||
wiphy->max_match_sets = SCAN_PNO_MAX_SUPP_NETWORKS;
|
||||
wiphy->max_sched_scan_ie_len = SIR_MAC_MAX_IE_LENGTH;
|
||||
wiphy->max_sched_scan_plans = SIR_PNO_MAX_PLAN_REQUEST;
|
||||
wiphy->max_sched_scan_plans = SCAN_PNO_MAX_PLAN_REQUEST;
|
||||
if (config->max_sched_scan_plan_interval)
|
||||
wiphy->max_sched_scan_plan_interval =
|
||||
config->max_sched_scan_plan_interval;
|
||||
|
|
|
|||
|
|
@ -2501,145 +2501,6 @@ int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter)
|
|||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* hdd_sched_scan_callback - scheduled scan callback
|
||||
* @callbackContext: Callback context
|
||||
* @pPrefNetworkFoundInd: Preferred network found indication
|
||||
*
|
||||
* This is a callback function that is registerd with SME that is
|
||||
* invoked when a preferred network is discovered by firmware.
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void
|
||||
hdd_sched_scan_callback(void *callbackContext,
|
||||
tSirPrefNetworkFoundInd *pPrefNetworkFoundInd)
|
||||
{
|
||||
int ret;
|
||||
hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext;
|
||||
hdd_context_t *pHddCtx;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (NULL == pAdapter) {
|
||||
hdd_err("HDD adapter is Null");
|
||||
return;
|
||||
}
|
||||
|
||||
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
|
||||
if (NULL == pHddCtx) {
|
||||
hdd_err("HDD context is Null!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_spin_lock(&pHddCtx->sched_scan_lock);
|
||||
if (true == pHddCtx->isWiphySuspended) {
|
||||
pHddCtx->isSchedScanUpdatePending = true;
|
||||
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
||||
hdd_debug("Update cfg80211 scan database after it resume");
|
||||
return;
|
||||
}
|
||||
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
||||
|
||||
ret = wlan_hdd_cfg80211_update_bss(pHddCtx->wiphy, pAdapter, 0);
|
||||
|
||||
if (0 > ret)
|
||||
hdd_debug("NO SCAN result");
|
||||
|
||||
cfg80211_sched_scan_results(pHddCtx->wiphy);
|
||||
hdd_debug("cfg80211 scan result database updated");
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_hdd_is_pno_allowed() - Check if PNO is allowed
|
||||
* @adapter: HDD Device Adapter
|
||||
*
|
||||
* The PNO Start request is coming from upper layers.
|
||||
* It is to be allowed only for Infra STA device type
|
||||
* and the link should be in a disconnected state.
|
||||
*
|
||||
* Return: Success if PNO is allowed, Failure otherwise.
|
||||
*/
|
||||
static QDF_STATUS wlan_hdd_is_pno_allowed(hdd_adapter_t *adapter)
|
||||
{
|
||||
hdd_debug("dev_mode=%d, conn_state=%d, session ID=%d",
|
||||
adapter->device_mode,
|
||||
adapter->sessionCtx.station.conn_info.connState,
|
||||
adapter->sessionId);
|
||||
if ((adapter->device_mode == QDF_STA_MODE) &&
|
||||
(eConnectionState_NotConnected ==
|
||||
adapter->sessionCtx.station.conn_info.connState))
|
||||
return QDF_STATUS_SUCCESS;
|
||||
else
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
}
|
||||
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) || \
|
||||
defined(CFG80211_MULTI_SCAN_PLAN_BACKPORT)) && \
|
||||
defined(FEATURE_WLAN_SCAN_PNO)
|
||||
/**
|
||||
* hdd_config_sched_scan_plan() - configures the sched scan plans
|
||||
* from the framework.
|
||||
* @pno_req: pointer to PNO scan request
|
||||
* @request: pointer to scan request from framework
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void hdd_config_sched_scan_plan(tpSirPNOScanReq pno_req,
|
||||
struct cfg80211_sched_scan_request *request,
|
||||
hdd_context_t *hdd_ctx)
|
||||
{
|
||||
pno_req->delay_start_time = request->delay;
|
||||
/*
|
||||
* As of now max 2 scan plans were supported by firmware
|
||||
* if number of scan plan supported by firmware increased below logic
|
||||
* must change.
|
||||
*/
|
||||
if (request->n_scan_plans == SIR_PNO_MAX_PLAN_REQUEST) {
|
||||
pno_req->fast_scan_period =
|
||||
request->scan_plans[0].interval * MSEC_PER_SEC;
|
||||
pno_req->fast_scan_max_cycles =
|
||||
request->scan_plans[0].iterations;
|
||||
pno_req->slow_scan_period =
|
||||
request->scan_plans[1].interval * MSEC_PER_SEC;
|
||||
hdd_debug("Base scan interval: %d sec, scan cycles: %d, slow scan interval %d",
|
||||
request->scan_plans[0].interval,
|
||||
request->scan_plans[0].iterations,
|
||||
request->scan_plans[1].interval);
|
||||
} else if (request->n_scan_plans == 1) {
|
||||
pno_req->fast_scan_period =
|
||||
request->scan_plans[0].interval * MSEC_PER_SEC;
|
||||
/*
|
||||
* if only one scan plan is configured from framework
|
||||
* then both fast and slow scan should be configured with the
|
||||
* same value that is why fast scan cycles are hardcoded to one
|
||||
*/
|
||||
pno_req->fast_scan_max_cycles = 1;
|
||||
pno_req->slow_scan_period =
|
||||
request->scan_plans[0].interval * MSEC_PER_SEC;
|
||||
} else {
|
||||
hdd_err("Invalid number of scan plans %d !!",
|
||||
request->n_scan_plans);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void hdd_config_sched_scan_plan(tpSirPNOScanReq pno_req,
|
||||
struct cfg80211_sched_scan_request *request,
|
||||
hdd_context_t *hdd_ctx)
|
||||
{
|
||||
pno_req->fast_scan_period = request->interval;
|
||||
pno_req->fast_scan_max_cycles =
|
||||
hdd_ctx->config->configPNOScanTimerRepeatValue;
|
||||
pno_req->slow_scan_period =
|
||||
hdd_ctx->config->pno_slow_scan_multiplier *
|
||||
pno_req->fast_scan_period;
|
||||
hdd_debug("Base scan interval: %d sec PNOScanTimerRepeatValue: %d",
|
||||
(request->interval / 1000),
|
||||
hdd_ctx->config->configPNOScanTimerRepeatValue);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* __wlan_hdd_cfg80211_sched_scan_start() - cfg80211 scheduled scan(pno) start
|
||||
* @wiphy: Pointer to wiphy
|
||||
|
|
@ -2655,18 +2516,9 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
|
|||
*request)
|
||||
{
|
||||
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
tpSirPNOScanReq pPnoRequest = NULL;
|
||||
hdd_context_t *pHddCtx;
|
||||
tHalHandle hHal;
|
||||
uint32_t i, indx, num_ch, j;
|
||||
u8 valid_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
|
||||
u8 channels_allowed[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
|
||||
uint32_t num_channels_allowed = WNI_CFG_VALID_CHANNEL_LIST_LEN;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
int ret = 0;
|
||||
hdd_scaninfo_t *pScanInfo = &pAdapter->scan_info;
|
||||
struct hdd_config *config = NULL;
|
||||
uint32_t num_ignore_dfs_ch = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
|
@ -2686,214 +2538,21 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
|
|||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
if (!pHddCtx->config->PnoOffload) {
|
||||
hdd_debug("PnoOffloadis not enabled!!!");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!sme_is_session_id_valid(pHddCtx->hHal, pAdapter->sessionId))
|
||||
return -EINVAL;
|
||||
|
||||
config = pHddCtx->config;
|
||||
hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
||||
if (NULL == hHal) {
|
||||
hdd_err("HAL context is Null!!!");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef NAPIER_SCAN
|
||||
return wlan_cfg80211_sched_scan_start(pHddCtx->hdd_pdev, dev, request);
|
||||
#endif
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START,
|
||||
pAdapter->sessionId, pAdapter->device_mode));
|
||||
/*
|
||||
* The current umac is unable to handle the SCAN_PREEMPT and SCAN_DEQUEUED
|
||||
* so its necessary to terminate the existing scan which is already issued
|
||||
* otherwise the host won't enter into the suspend state due to the reason
|
||||
* that the wlan wakelock which was held in the wlan_hdd_cfg80211_scan
|
||||
* function.
|
||||
*/
|
||||
sme_scan_flush_result(hHal);
|
||||
if (true == pScanInfo->mScanPending) {
|
||||
ret = wlan_hdd_scan_abort(pAdapter);
|
||||
if (ret < 0) {
|
||||
hdd_err("aborting the existing scan is unsuccessful");
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
|
||||
if (QDF_STATUS_E_FAILURE == wlan_hdd_is_pno_allowed(pAdapter)) {
|
||||
hdd_err("pno is not allowed");
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
pPnoRequest = (tpSirPNOScanReq) qdf_mem_malloc(sizeof(tSirPNOScanReq));
|
||||
if (NULL == pPnoRequest) {
|
||||
hdd_err("qdf_mem_malloc failed");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pPnoRequest->enable = 1; /*Enable PNO */
|
||||
pPnoRequest->ucNetworksCount = request->n_match_sets;
|
||||
|
||||
if ((!pPnoRequest->ucNetworksCount) ||
|
||||
(pPnoRequest->ucNetworksCount > SIR_PNO_MAX_SUPP_NETWORKS)) {
|
||||
hdd_err("Network input is not correct %d",
|
||||
pPnoRequest->ucNetworksCount);
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (SIR_PNO_MAX_NETW_CHANNELS_EX < request->n_channels) {
|
||||
hdd_err("Incorrect number of channels %d",
|
||||
request->n_channels);
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Framework provides one set of channels(all)
|
||||
* common for all saved profile
|
||||
*/
|
||||
if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
channels_allowed, &num_channels_allowed)) {
|
||||
hdd_err("failed to get valid channel list");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
/* Checking each channel against allowed channel list */
|
||||
num_ch = 0;
|
||||
if (request->n_channels) {
|
||||
char chList[(request->n_channels * 5) + 1];
|
||||
int len;
|
||||
for (i = 0, len = 0; i < request->n_channels; i++) {
|
||||
for (indx = 0; indx < num_channels_allowed; indx++) {
|
||||
if (request->channels[i]->hw_value ==
|
||||
channels_allowed[indx]) {
|
||||
|
||||
if ((!config->enable_dfs_pno_chnl_scan)
|
||||
&& (CHANNEL_STATE_DFS ==
|
||||
cds_get_channel_state(
|
||||
channels_allowed[indx]))) {
|
||||
hdd_debug("Dropping DFS channel : %d",
|
||||
channels_allowed[indx]);
|
||||
num_ignore_dfs_ch++;
|
||||
break;
|
||||
}
|
||||
if (!cds_is_dsrc_channel(
|
||||
cds_chan_to_freq(
|
||||
request->channels[i]->hw_value))) {
|
||||
valid_ch[num_ch++] = request->
|
||||
channels[i]->hw_value;
|
||||
len += snprintf(chList + len,
|
||||
5, "%d ",
|
||||
request->channels[i]->
|
||||
hw_value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
hdd_debug("Channel-List: %s ", chList);
|
||||
|
||||
/* If all channels are DFS and dropped,
|
||||
* then ignore the PNO request
|
||||
*/
|
||||
if (!num_ch) {
|
||||
hdd_debug("Channel list empty due to filtering of DSRC,DFS channels");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
}
|
||||
/* Filling per profile params */
|
||||
for (i = 0; i < pPnoRequest->ucNetworksCount; i++) {
|
||||
pPnoRequest->aNetworks[i].ssId.length =
|
||||
request->match_sets[i].ssid.ssid_len;
|
||||
|
||||
if ((0 == pPnoRequest->aNetworks[i].ssId.length) ||
|
||||
(pPnoRequest->aNetworks[i].ssId.length > 32)) {
|
||||
hdd_err(" SSID Len %d is not correct for network %d",
|
||||
pPnoRequest->aNetworks[i].ssId.length, i);
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
memcpy(pPnoRequest->aNetworks[i].ssId.ssId,
|
||||
request->match_sets[i].ssid.ssid,
|
||||
request->match_sets[i].ssid.ssid_len);
|
||||
pPnoRequest->aNetworks[i].authentication = 0; /*eAUTH_TYPE_ANY */
|
||||
pPnoRequest->aNetworks[i].encryption = 0; /*eED_ANY */
|
||||
pPnoRequest->aNetworks[i].bcastNetwType = 0; /*eBCAST_UNKNOWN */
|
||||
|
||||
/*Copying list of valid channel into request */
|
||||
memcpy(pPnoRequest->aNetworks[i].aChannels, valid_ch, num_ch);
|
||||
pPnoRequest->aNetworks[i].ucChannelCount = num_ch;
|
||||
pPnoRequest->aNetworks[i].rssiThreshold =
|
||||
request->match_sets[i].rssi_thold;
|
||||
}
|
||||
|
||||
for (i = 0; i < request->n_ssids; i++) {
|
||||
j = 0;
|
||||
while (j < pPnoRequest->ucNetworksCount) {
|
||||
if ((pPnoRequest->aNetworks[j].ssId.length ==
|
||||
request->ssids[i].ssid_len) &&
|
||||
(0 == memcmp(pPnoRequest->aNetworks[j].ssId.ssId,
|
||||
request->ssids[i].ssid,
|
||||
pPnoRequest->aNetworks[j].ssId.
|
||||
length))) {
|
||||
pPnoRequest->aNetworks[j].bcastNetwType =
|
||||
eBCAST_HIDDEN;
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
hdd_debug("Number of hidden networks being Configured = %d",
|
||||
request->n_ssids);
|
||||
|
||||
/*
|
||||
* Before Kernel 4.4
|
||||
* Driver gets only one time interval which is hard coded in
|
||||
* supplicant for 10000ms.
|
||||
*
|
||||
* After Kernel 4.4
|
||||
* User can configure multiple scan_plans, each scan would have
|
||||
* separate scan cycle and interval. (interval is in unit of second.)
|
||||
* For our use case, we would only have supplicant set one scan_plan,
|
||||
* and firmware also support only one as well, so pick up the first
|
||||
* index.
|
||||
*
|
||||
* Taking power consumption into account
|
||||
* firmware after gPNOScanTimerRepeatValue times fast_scan_period
|
||||
* switches slow_scan_period. This is less frequent scans and firmware
|
||||
* shall be in slow_scan_period mode until next PNO Start.
|
||||
*/
|
||||
hdd_config_sched_scan_plan(pPnoRequest, request, pHddCtx);
|
||||
|
||||
hdd_debug("Base scan interval: %d sec PNOScanTimerRepeatValue: %d",
|
||||
(pPnoRequest->fast_scan_period / 1000),
|
||||
config->configPNOScanTimerRepeatValue);
|
||||
|
||||
pPnoRequest->modePNO = SIR_PNO_MODE_IMMEDIATE;
|
||||
|
||||
hdd_debug("SessionId %d, enable %d, modePNO %d",
|
||||
pAdapter->sessionId, pPnoRequest->enable, pPnoRequest->modePNO);
|
||||
|
||||
status = sme_set_preferred_network_list(WLAN_HDD_GET_HAL_CTX(pAdapter),
|
||||
pPnoRequest,
|
||||
pAdapter->sessionId,
|
||||
hdd_sched_scan_callback,
|
||||
pAdapter);
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
hdd_err("Failed to enable PNO");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
hdd_debug("PNO scanRequest offloaded");
|
||||
|
||||
error:
|
||||
qdf_mem_free(pPnoRequest);
|
||||
EXIT();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2920,74 +2579,39 @@ int wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
|
|||
|
||||
int wlan_hdd_sched_scan_stop(struct net_device *dev)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
hdd_context_t *hdd_ctx;
|
||||
tHalHandle hHal;
|
||||
tSirPNOScanReq *pno_req = NULL;
|
||||
int ret = 0;
|
||||
|
||||
ENTER_DEV(dev);
|
||||
|
||||
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
||||
hdd_err("Command not allowed in FTM mode");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->sessionId)) {
|
||||
hdd_err("invalid session id: %d", adapter->sessionId);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
if (NULL == hdd_ctx) {
|
||||
hdd_err("HDD context is Null");
|
||||
ret = -ENODEV;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!hdd_ctx->config->PnoOffload) {
|
||||
hdd_debug("PnoOffloadis not enabled!!!");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hHal = WLAN_HDD_GET_HAL_CTX(adapter);
|
||||
if (NULL == hHal) {
|
||||
hdd_err(" HAL context is Null!!!");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef NAPIER_SCAN
|
||||
return wlan_cfg80211_sched_scan_stop(hdd_ctx->hdd_pdev, dev);
|
||||
#endif
|
||||
pno_req = (tpSirPNOScanReq) qdf_mem_malloc(sizeof(tSirPNOScanReq));
|
||||
if (NULL == pno_req) {
|
||||
hdd_err("qdf_mem_malloc failed");
|
||||
ret = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP,
|
||||
adapter->sessionId, adapter->device_mode));
|
||||
|
||||
/* Disable PNO */
|
||||
pno_req->enable = 0;
|
||||
pno_req->ucNetworksCount = 0;
|
||||
status = sme_set_preferred_network_list(hHal, pno_req,
|
||||
adapter->sessionId,
|
||||
NULL, adapter);
|
||||
qdf_mem_free(pno_req);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
hdd_err("Failed to disabled PNO");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
hdd_debug("PNO scan disabled");
|
||||
|
||||
exit:
|
||||
EXIT();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@
|
|||
#include "os_if_wifi_pos.h"
|
||||
#include <cdp_txrx_stats.h>
|
||||
#include <cds_api.h>
|
||||
#include <wlan_osif_priv.h>
|
||||
|
||||
#define HDD_FINISH_ULA_TIME_OUT 800
|
||||
#define HDD_SET_MCBC_FILTERS_TO_FW 1
|
||||
#define HDD_DELETE_MCBC_FILTERS_FROM_FW 0
|
||||
|
|
@ -11948,35 +11950,45 @@ static int iw_get_statistics(struct net_device *dev,
|
|||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
|
||||
/*Max Len for PNO notification*/
|
||||
#define MAX_PNO_NOTIFY_LEN 100
|
||||
static void found_pref_network_cb(void *callbackContext,
|
||||
tSirPrefNetworkFoundInd *pPrefNetworkFoundInd)
|
||||
static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_event *event, void *args)
|
||||
{
|
||||
hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext;
|
||||
struct vdev_osif_priv *osif_priv;
|
||||
struct wireless_dev *wdev;
|
||||
union iwreq_data wrqu;
|
||||
char buf[MAX_PNO_NOTIFY_LEN + 1];
|
||||
|
||||
hdd_debug("A preferred network was found: %s with rssi: -%d",
|
||||
pPrefNetworkFoundInd->ssId.ssId, pPrefNetworkFoundInd->rssi);
|
||||
wlan_vdev_obj_lock(vdev);
|
||||
osif_priv = wlan_vdev_get_ospriv(vdev);
|
||||
wlan_vdev_obj_unlock(vdev);
|
||||
if (!osif_priv) {
|
||||
hdd_err("osif_priv is null");
|
||||
return;
|
||||
}
|
||||
|
||||
wdev = osif_priv->wdev;
|
||||
if (!wdev) {
|
||||
hdd_err("wdev is null");
|
||||
return;
|
||||
}
|
||||
|
||||
hdd_debug("A preferred network was found");
|
||||
|
||||
/* create the event */
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
memset(buf, 0, sizeof(buf));
|
||||
qdf_mem_zero(&wrqu, sizeof(wrqu));
|
||||
qdf_mem_zero(buf, sizeof(buf));
|
||||
|
||||
snprintf(buf, MAX_PNO_NOTIFY_LEN,
|
||||
"QCOM: Found preferred network: %s with RSSI of -%u",
|
||||
pPrefNetworkFoundInd->ssId.ssId,
|
||||
(unsigned int)pPrefNetworkFoundInd->rssi);
|
||||
"QCOM: Found preferred network:");
|
||||
|
||||
wrqu.data.pointer = buf;
|
||||
wrqu.data.length = strlen(buf);
|
||||
|
||||
/* send the event */
|
||||
|
||||
wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf);
|
||||
|
||||
wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -12025,17 +12037,21 @@ static int __iw_set_pno(struct net_device *dev,
|
|||
{
|
||||
hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
hdd_context_t *hdd_ctx;
|
||||
int ret;
|
||||
uint8_t value;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
int ret = 0;
|
||||
int offset;
|
||||
char *ptr;
|
||||
uint8_t i, j, params, mode;
|
||||
uint8_t i, j, params;
|
||||
QDF_STATUS status;
|
||||
|
||||
/* request is a large struct, so we make it static to avoid
|
||||
* stack overflow. This API is only invoked via ioctl, so it
|
||||
* is serialized by the kernel rtnl_lock and hence does not
|
||||
* need to be reentrant
|
||||
*/
|
||||
static tSirPNOScanReq request;
|
||||
static struct pno_scan_req_params req;
|
||||
|
||||
ENTER_DEV(dev);
|
||||
|
||||
|
|
@ -12048,167 +12064,195 @@ static int __iw_set_pno(struct net_device *dev,
|
|||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
hdd_debug("PNO data len %d data %s", wrqu->data.length, extra);
|
||||
vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->hdd_pdev,
|
||||
dev->dev_addr, WLAN_LEGACY_MAC_ID);
|
||||
if (!vdev) {
|
||||
hdd_err("vdev object is NULL");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
request.enable = 0;
|
||||
request.ucNetworksCount = 0;
|
||||
hdd_debug("PNO data len %d data %s", wrqu->data.length, extra);
|
||||
|
||||
ptr = extra;
|
||||
|
||||
if (1 != sscanf(ptr, "%hhu%n", &(request.enable), &offset)) {
|
||||
if (1 != sscanf(ptr, "%hhu%n", &value, &offset)) {
|
||||
hdd_err("PNO enable input is not valid %s", ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (0 == request.enable) {
|
||||
/* Disable PNO, ignore any other params */
|
||||
memset(&request, 0, sizeof(request));
|
||||
sme_set_preferred_network_list(WLAN_HDD_GET_HAL_CTX(adapter),
|
||||
&request, adapter->sessionId,
|
||||
found_pref_network_cb, adapter);
|
||||
return 0;
|
||||
if (!value) {
|
||||
status = ucfg_scan_pno_stop(vdev);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to disabled PNO");
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
hdd_debug("PNO scan disabled");
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (ucfg_scan_get_pno_in_progress(vdev)) {
|
||||
hdd_debug("pno is already in progress");
|
||||
ret = -EBUSY;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ptr += offset;
|
||||
|
||||
if (1 != sscanf(ptr, "%hhu %n", &(request.ucNetworksCount), &offset)) {
|
||||
if (1 != sscanf(ptr, "%hhu %n", &value, &offset)) {
|
||||
hdd_err("PNO count input not valid %s", ptr);
|
||||
return -EINVAL;
|
||||
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
req.networks_cnt = value;
|
||||
|
||||
hdd_debug("PNO enable %d networks count %d offset %d",
|
||||
request.enable, request.ucNetworksCount, offset);
|
||||
hdd_debug("PNO enable networks count %d offset %d",
|
||||
req.networks_cnt, offset);
|
||||
|
||||
if ((0 == request.ucNetworksCount) ||
|
||||
(request.ucNetworksCount > SIR_PNO_MAX_SUPP_NETWORKS)) {
|
||||
if ((0 == req.networks_cnt) ||
|
||||
(req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) {
|
||||
hdd_err("Network count %d invalid",
|
||||
request.ucNetworksCount);
|
||||
return -EINVAL;
|
||||
req.networks_cnt);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ptr += offset;
|
||||
|
||||
for (i = 0; i < request.ucNetworksCount; i++) {
|
||||
for (i = 0; i < req.networks_cnt; i++) {
|
||||
|
||||
request.aNetworks[i].ssId.length = 0;
|
||||
req.networks_list[i].ssid.length = 0;
|
||||
|
||||
params = sscanf(ptr, "%hhu %n",
|
||||
&(request.aNetworks[i].ssId.length),
|
||||
&(req.networks_list[i].ssid.length),
|
||||
&offset);
|
||||
|
||||
if (1 != params) {
|
||||
hdd_err("PNO ssid length input is not valid %s", ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((0 == request.aNetworks[i].ssId.length) ||
|
||||
(request.aNetworks[i].ssId.length > 32)) {
|
||||
if ((0 == req.networks_list[i].ssid.length) ||
|
||||
(req.networks_list[i].ssid.length > 32)) {
|
||||
hdd_err("SSID Len %d is not correct for network %d",
|
||||
request.aNetworks[i].ssId.length, i);
|
||||
return -EINVAL;
|
||||
req.networks_list[i].ssid.length, i);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Advance to SSID */
|
||||
ptr += offset;
|
||||
|
||||
memcpy(request.aNetworks[i].ssId.ssId, ptr,
|
||||
request.aNetworks[i].ssId.length);
|
||||
ptr += request.aNetworks[i].ssId.length;
|
||||
memcpy(req.networks_list[i].ssid.ssid, ptr,
|
||||
req.networks_list[i].ssid.length);
|
||||
ptr += req.networks_list[i].ssid.length;
|
||||
|
||||
params = sscanf(ptr, "%u %u %hhu %n",
|
||||
&(request.aNetworks[i].authentication),
|
||||
&(request.aNetworks[i].encryption),
|
||||
&(request.aNetworks[i].ucChannelCount),
|
||||
&(req.networks_list[i].authentication),
|
||||
&(req.networks_list[i].encryption),
|
||||
&(req.networks_list[i].channel_cnt),
|
||||
&offset);
|
||||
|
||||
if (3 != params) {
|
||||
hdd_err("Incorrect cmd %s", ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
hdd_debug("PNO len %d ssid %.*s auth %d encry %d channel count %d offset %d",
|
||||
request.aNetworks[i].ssId.length,
|
||||
request.aNetworks[i].ssId.length,
|
||||
request.aNetworks[i].ssId.ssId,
|
||||
request.aNetworks[i].authentication,
|
||||
request.aNetworks[i].encryption,
|
||||
request.aNetworks[i].ucChannelCount, offset);
|
||||
req.networks_list[i].ssid.length,
|
||||
req.networks_list[i].ssid.length,
|
||||
req.networks_list[i].ssid.ssid,
|
||||
req.networks_list[i].authentication,
|
||||
req.networks_list[i].encryption,
|
||||
req.networks_list[i].channel_cnt, offset);
|
||||
|
||||
/* Advance to channel list */
|
||||
ptr += offset;
|
||||
|
||||
if (SIR_PNO_MAX_NETW_CHANNELS <
|
||||
request.aNetworks[i].ucChannelCount) {
|
||||
if (SCAN_PNO_MAX_NETW_CHANNELS_EX <
|
||||
req.networks_list[i].channel_cnt) {
|
||||
hdd_err("Incorrect number of channels");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (0 != request.aNetworks[i].ucChannelCount) {
|
||||
for (j = 0; j < request.aNetworks[i].ucChannelCount;
|
||||
if (0 != req.networks_list[i].channel_cnt) {
|
||||
for (j = 0; j < req.networks_list[i].channel_cnt;
|
||||
j++) {
|
||||
if (1 != sscanf(ptr, "%hhu %n",
|
||||
&(request.aNetworks[i].
|
||||
aChannels[j]), &offset)) {
|
||||
if (1 != sscanf(ptr, "%hhu %n", &value,
|
||||
&offset)) {
|
||||
hdd_err("PNO network channel is not valid %s",
|
||||
ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
req.networks_list[i].channels[j] =
|
||||
cds_chan_to_freq(value);
|
||||
/* Advance to next channel number */
|
||||
ptr += offset;
|
||||
}
|
||||
}
|
||||
|
||||
if (1 != sscanf(ptr, "%u %n",
|
||||
&(request.aNetworks[i].bcastNetwType),
|
||||
&(req.networks_list[i].bc_new_type),
|
||||
&offset)) {
|
||||
hdd_err("PNO broadcast network type is not valid %s",
|
||||
ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
hdd_debug("PNO bcastNetwType %d offset %d",
|
||||
request.aNetworks[i].bcastNetwType, offset);
|
||||
req.networks_list[i].bc_new_type, offset);
|
||||
|
||||
/* Advance to rssi Threshold */
|
||||
ptr += offset;
|
||||
if (1 != sscanf(ptr, "%d %n",
|
||||
&(request.aNetworks[i].rssiThreshold),
|
||||
&(req.networks_list[i].rssi_thresh),
|
||||
&offset)) {
|
||||
hdd_err("PNO rssi threshold input is not valid %s",
|
||||
ptr);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
hdd_debug("PNO rssi %d offset %d",
|
||||
request.aNetworks[i].rssiThreshold, offset);
|
||||
req.networks_list[i].rssi_thresh, offset);
|
||||
/* Advance to next network */
|
||||
ptr += offset;
|
||||
} /* For ucNetworkCount */
|
||||
|
||||
request.fast_scan_period = 0;
|
||||
if (sscanf(ptr, "%u %n", &(request.fast_scan_period), &offset) > 0) {
|
||||
request.fast_scan_period *= MSEC_PER_SEC;
|
||||
req.fast_scan_period = 0;
|
||||
if (sscanf(ptr, "%u %n", &(req.fast_scan_period), &offset) > 0) {
|
||||
req.fast_scan_period *= MSEC_PER_SEC;
|
||||
ptr += offset;
|
||||
}
|
||||
|
||||
request.fast_scan_max_cycles = 0;
|
||||
if (sscanf(ptr, "%hhu %n", &(request.fast_scan_max_cycles),
|
||||
req.fast_scan_max_cycles = 0;
|
||||
if (sscanf(ptr, "%hhu %n", &value,
|
||||
&offset) > 0)
|
||||
ptr += offset;
|
||||
req.fast_scan_max_cycles = value;
|
||||
|
||||
params = sscanf(ptr, "%hhu %n", &(mode), &offset);
|
||||
wlan_pdev_obj_lock(hdd_ctx->hdd_pdev);
|
||||
psoc = wlan_pdev_get_psoc(hdd_ctx->hdd_pdev);
|
||||
wlan_pdev_obj_unlock(hdd_ctx->hdd_pdev);
|
||||
ucfg_scan_register_pno_cb(psoc,
|
||||
found_pref_network_cb, NULL);
|
||||
|
||||
request.modePNO = mode;
|
||||
/* for LA we just expose suspend option */
|
||||
if ((1 != params) || (mode >= SIR_PNO_MODE_MAX))
|
||||
request.modePNO = SIR_PNO_MODE_ON_SUSPEND;
|
||||
ucfg_scan_get_pno_def_params(vdev, &req);
|
||||
status = ucfg_scan_pno_start(vdev, &req);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to enable PNO");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
sme_set_preferred_network_list(WLAN_HDD_GET_HAL_CTX(adapter),
|
||||
&request,
|
||||
adapter->sessionId,
|
||||
found_pref_network_cb, adapter);
|
||||
exit:
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int iw_set_pno(struct net_device *dev,
|
||||
|
|
|
|||
|
|
@ -932,9 +932,6 @@ typedef struct sAniSirGlobal {
|
|||
|
||||
bool imps_enabled;
|
||||
|
||||
/* PNO offload */
|
||||
bool pnoOffload;
|
||||
|
||||
csr_readyToSuspendCallback readyToSuspendCallback;
|
||||
void *readyToSuspendContext;
|
||||
uint8_t lteCoexAntShare;
|
||||
|
|
|
|||
|
|
@ -2852,103 +2852,6 @@ typedef struct sAniIbssRouteTable {
|
|||
tAniDestIpNextHopMacPair destIpNextHopPair[1];
|
||||
} tAniIbssRouteTable;
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/* */
|
||||
/* PNO Messages */
|
||||
/* */
|
||||
|
||||
|
||||
/* Set PNO */
|
||||
#define SIR_PNO_MAX_PLAN_REQUEST 2
|
||||
#define SIR_PNO_MAX_NETW_CHANNELS 26
|
||||
#define SIR_PNO_MAX_NETW_CHANNELS_EX 60
|
||||
#define SIR_PNO_MAX_SUPP_NETWORKS 16
|
||||
|
||||
/*
|
||||
* size based of dot11 declaration without extra IEs as we will not carry those
|
||||
* for PNO
|
||||
*/
|
||||
#define SIR_PNO_MAX_PB_REQ_SIZE 450
|
||||
|
||||
#define SIR_PNO_24G_DEFAULT_CH 1
|
||||
#define SIR_PNO_5G_DEFAULT_CH 36
|
||||
|
||||
typedef enum {
|
||||
SIR_PNO_MODE_IMMEDIATE,
|
||||
SIR_PNO_MODE_ON_SUSPEND,
|
||||
SIR_PNO_MODE_ON_RESUME,
|
||||
SIR_PNO_MODE_MAX
|
||||
} eSirPNOMode;
|
||||
|
||||
typedef struct {
|
||||
tSirMacSSid ssId;
|
||||
uint32_t authentication;
|
||||
uint32_t encryption;
|
||||
uint32_t bcastNetwType;
|
||||
uint8_t ucChannelCount;
|
||||
uint8_t aChannels[SIR_PNO_MAX_NETW_CHANNELS_EX];
|
||||
int32_t rssiThreshold;
|
||||
} tSirNetworkType;
|
||||
|
||||
/**
|
||||
* struct sSirPNOScanReq - PNO Scan request structure
|
||||
* @enable: flag to enable or disable
|
||||
* @modePNO: PNO Mode
|
||||
* @ucNetworksCount: Number of networks
|
||||
* @aNetworks: Preferred network list
|
||||
* @sessionId: Session identifier
|
||||
* @fast_scan_period: Fast Scan period
|
||||
* @slow_scan_period: Slow scan period
|
||||
* @delay_start_time: delay in seconds to use before starting the first scan
|
||||
* @fast_scan_max_cycles: Fast scan max cycles
|
||||
* @us24GProbeTemplateLen: 2.4G probe template length
|
||||
* @p24GProbeTemplate: 2.4G probe template
|
||||
* @us5GProbeTemplateLen: 5G probe template length
|
||||
* @p5GProbeTemplate: 5G probe template
|
||||
*/
|
||||
typedef struct sSirPNOScanReq {
|
||||
uint8_t enable;
|
||||
eSirPNOMode modePNO;
|
||||
uint8_t ucNetworksCount;
|
||||
tSirNetworkType aNetworks[SIR_PNO_MAX_SUPP_NETWORKS];
|
||||
uint8_t sessionId;
|
||||
uint32_t fast_scan_period;
|
||||
uint32_t slow_scan_period;
|
||||
uint32_t delay_start_time;
|
||||
uint8_t fast_scan_max_cycles;
|
||||
|
||||
uint32_t active_min_time;
|
||||
uint32_t active_max_time;
|
||||
uint32_t passive_min_time;
|
||||
uint32_t passive_max_time;
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
bool pno_channel_prediction;
|
||||
uint8_t top_k_num_of_channels;
|
||||
uint8_t stationary_thresh;
|
||||
enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
|
||||
uint32_t channel_prediction_full_scan;
|
||||
#endif
|
||||
} tSirPNOScanReq, *tpSirPNOScanReq;
|
||||
|
||||
/* Preferred Network Found Indication */
|
||||
typedef struct {
|
||||
uint16_t mesgType;
|
||||
uint16_t mesgLen;
|
||||
/* Network that was found with the highest RSSI */
|
||||
tSirMacSSid ssId;
|
||||
/* Indicates the RSSI */
|
||||
uint8_t rssi;
|
||||
/* Length of the beacon or probe response
|
||||
* corresponding to the candidate found by PNO */
|
||||
uint32_t frameLength;
|
||||
uint8_t sessionId;
|
||||
/* Index to memory location where the contents of
|
||||
* beacon or probe response frame will be copied */
|
||||
uint8_t data[1];
|
||||
} tSirPrefNetworkFoundInd, *tpSirPrefNetworkFoundInd;
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
typedef struct {
|
||||
uint8_t acvo_uapsd:1;
|
||||
|
|
|
|||
|
|
@ -131,10 +131,6 @@ enum eWniMsgTypes {
|
|||
#endif
|
||||
|
||||
eWNI_SME_REGISTER_MGMT_FRAME_REQ,
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
eWNI_SME_PREF_NETWORK_FOUND_IND,
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
eWNI_SME_CHANGE_COUNTRY_CODE,
|
||||
eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE,
|
||||
eWNI_SME_MAX_ASSOC_EXCEEDED,
|
||||
|
|
|
|||
|
|
@ -342,10 +342,6 @@ typedef struct sSirMbMsgP2p {
|
|||
#define SIR_HAL_SET_NS_OFFLOAD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 118)
|
||||
#endif /* WLAN_NS_OFFLOAD */
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
#define SIR_HAL_SET_PNO_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 119)
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
#define SIR_HAL_SOC_ANTENNA_MODE_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 120)
|
||||
#define SIR_HAL_SOC_ANTENNA_MODE_RESP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 121)
|
||||
|
||||
|
|
@ -430,9 +426,6 @@ typedef struct sSirMbMsgP2p {
|
|||
#ifndef REMOVE_PKT_LOG
|
||||
#define SIR_HAL_PKTLOG_ENABLE_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 164)
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
#define SIR_HAL_SME_SCAN_CACHE_UPDATED (SIR_HAL_ITC_MSG_TYPES_BEGIN + 165)
|
||||
#endif
|
||||
#define SIR_HAL_START_SCAN_OFFLOAD_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 166)
|
||||
#define SIR_HAL_UPDATE_CHAN_LIST_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 167)
|
||||
#define SIR_CSA_OFFLOAD_EVENT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 169)
|
||||
|
|
|
|||
|
|
@ -3301,42 +3301,6 @@ void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* lim_send_sme_scan_cache_updated_ind()
|
||||
*
|
||||
***FUNCTION:
|
||||
* This function is used to post WMA_SME_SCAN_CACHE_UPDATED message to WMA.
|
||||
* This message is the indication to WMA that all scan cache results
|
||||
* are updated from LIM to SME. Mainly used only in PNO offload case.
|
||||
*
|
||||
***LOGIC:
|
||||
*
|
||||
***ASSUMPTIONS:
|
||||
* This function should be called after posting scan cache results to SME.
|
||||
*
|
||||
***NOTE:
|
||||
* NA
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void lim_send_sme_scan_cache_updated_ind(uint8_t sessionId)
|
||||
{
|
||||
struct scheduler_msg msg;
|
||||
|
||||
msg.type = WMA_SME_SCAN_CACHE_UPDATED;
|
||||
msg.reserved = 0;
|
||||
msg.bodyptr = NULL;
|
||||
msg.bodyval = sessionId;
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS
|
||||
(scheduler_post_msg(QDF_MODULE_ID_WMA, &msg)))
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Not able to post WMA_SME_SCAN_CACHE_UPDATED message to WMA",
|
||||
__func__);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void lim_send_scan_offload_complete(tpAniSirGlobal pMac,
|
||||
tSirScanOffloadEvent *pScanEvent)
|
||||
{
|
||||
|
|
@ -3344,9 +3308,6 @@ static void lim_send_scan_offload_complete(tpAniSirGlobal pMac,
|
|||
pMac->lim.gLimRspReqd = false;
|
||||
lim_send_sme_scan_rsp(pMac, pScanEvent->reasonCode,
|
||||
pScanEvent->sessionId, 0, pScanEvent->scanId);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
lim_send_sme_scan_cache_updated_ind(pScanEvent->sessionId);
|
||||
#endif
|
||||
}
|
||||
|
||||
void lim_process_rx_scan_event(tpAniSirGlobal pMac, void *buf)
|
||||
|
|
|
|||
|
|
@ -303,9 +303,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
|
|||
CASE_RETURN_STRING(eWNI_SME_ESE_ADJACENT_AP_REPORT);
|
||||
#endif
|
||||
CASE_RETURN_STRING(eWNI_SME_REGISTER_MGMT_FRAME_REQ);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
CASE_RETURN_STRING(eWNI_SME_PREF_NETWORK_FOUND_IND);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
CASE_RETURN_STRING(eWNI_SME_CHANGE_COUNTRY_CODE);
|
||||
CASE_RETURN_STRING(eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE);
|
||||
CASE_RETURN_STRING(eWNI_SME_MAX_ASSOC_EXCEEDED);
|
||||
|
|
@ -531,10 +528,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
|
|||
CASE_RETURN_STRING(WMA_AGGR_QOS_RSP);
|
||||
CASE_RETURN_STRING(WMA_FTM_CMD_REQ);
|
||||
CASE_RETURN_STRING(WMA_FTM_CMD_RSP);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
CASE_RETURN_STRING(WMA_SET_PNO_REQ);
|
||||
CASE_RETURN_STRING(WMA_SME_SCAN_CACHE_UPDATED);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
CASE_RETURN_STRING(WMA_ROAM_SCAN_OFFLOAD_REQ);
|
||||
#ifdef WLAN_FEATURE_PACKET_FILTERING
|
||||
CASE_RETURN_STRING(WMA_8023_MULTICAST_LIST_REQ);
|
||||
|
|
|
|||
|
|
@ -1260,18 +1260,10 @@ typedef struct tagCsrConfigParam {
|
|||
/* 802.11p enable */
|
||||
bool enable_dot11p;
|
||||
uint8_t max_scan_count;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
bool pno_channel_prediction;
|
||||
uint8_t top_k_num_of_channels;
|
||||
uint8_t stationary_thresh;
|
||||
enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
|
||||
uint32_t channel_prediction_full_scan;
|
||||
#endif
|
||||
bool early_stop_scan_enable;
|
||||
int8_t early_stop_scan_min_threshold;
|
||||
int8_t early_stop_scan_max_threshold;
|
||||
int8_t first_scan_bucket_threshold;
|
||||
bool pnoOffload;
|
||||
uint8_t fEnableDebugLog;
|
||||
uint8_t max_intf_count;
|
||||
bool enable5gEBT;
|
||||
|
|
|
|||
|
|
@ -603,13 +603,6 @@ typedef struct tagCsrConfig {
|
|||
uint8_t is_sta_connection_in_5gz_enabled;
|
||||
struct roam_ext_params roam_params;
|
||||
bool sendDeauthBeforeCon;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
bool pno_channel_prediction;
|
||||
uint8_t top_k_num_of_channels;
|
||||
uint8_t stationary_thresh;
|
||||
enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
|
||||
uint32_t channel_prediction_full_scan;
|
||||
#endif
|
||||
bool early_stop_scan_enable;
|
||||
int8_t early_stop_scan_min_threshold;
|
||||
int8_t early_stop_scan_max_threshold;
|
||||
|
|
@ -975,9 +968,6 @@ typedef struct tagCsrRoamSession {
|
|||
#ifdef WLAN_FEATURE_11AX
|
||||
tDot11fIEvendor_he_cap he_config;
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
bool pnoStarted;
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
csr_roam_offload_synch_params roamOffloadSynchParams;
|
||||
uint8_t psk_pmk[SIR_ROAM_SCAN_PSK_SIZE];
|
||||
|
|
@ -1292,12 +1282,6 @@ QDF_STATUS csr_roam_copy_connect_profile(tpAniSirGlobal pMac,
|
|||
bool csr_is_set_key_allowed(tpAniSirGlobal pMac, uint32_t sessionId);
|
||||
|
||||
void csr_set_opposite_band_channel_info(tpAniSirGlobal pMac);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
QDF_STATUS csr_scan_save_preferred_network_found(tpAniSirGlobal pMac,
|
||||
tSirPrefNetworkFoundInd *
|
||||
pPrefNetworkFoundInd);
|
||||
#endif
|
||||
|
||||
/* Returns whether the current association is a 11r assoc or not */
|
||||
bool csr_roam_is11r_assoc(tpAniSirGlobal pMac, uint8_t sessionId);
|
||||
|
||||
|
|
|
|||
|
|
@ -239,16 +239,6 @@ QDF_STATUS sme_close_session(tHalHandle hHal, uint8_t sessionId,
|
|||
void *pContext);
|
||||
QDF_STATUS sme_update_roam_params(tHalHandle hHal, uint8_t session_id,
|
||||
struct roam_ext_params roam_params_src, int update_param);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
void sme_update_roam_pno_channel_prediction_config(
|
||||
tHalHandle hal, tCsrConfigParam *csr_config,
|
||||
uint8_t copy_from_to);
|
||||
#else
|
||||
static inline void sme_update_roam_pno_channel_prediction_config(
|
||||
tHalHandle hal, tCsrConfigParam *csr_config,
|
||||
uint8_t copy_from_to)
|
||||
{}
|
||||
#endif
|
||||
QDF_STATUS sme_update_config(tHalHandle hHal,
|
||||
tpSmeConfigParams pSmeConfigParams);
|
||||
|
||||
|
|
@ -548,15 +538,6 @@ 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 FEATURE_WLAN_SCAN_PNO
|
||||
QDF_STATUS sme_set_preferred_network_list(tHalHandle hHal,
|
||||
tpSirPNOScanReq pRequest,
|
||||
uint8_t sessionId,
|
||||
preferred_network_found_ind_cb
|
||||
callbackRoutine, void *callbackContext);
|
||||
|
||||
QDF_STATUS sme_preferred_network_found_ind(tHalHandle hHal, void *pMsg);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#ifdef WLAN_FEATURE_PACKET_FILTERING
|
||||
QDF_STATUS sme_8023_multicast_list(tHalHandle hHal, uint8_t sessionId,
|
||||
tpSirRcvFltMcAddrList pMulticastAddrs);
|
||||
|
|
|
|||
|
|
@ -247,13 +247,6 @@ QDF_STATUS sme_release_global_lock(tSmeStruct *psSme);
|
|||
QDF_STATUS csr_process_add_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg);
|
||||
QDF_STATUS csr_process_del_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg);
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
QDF_STATUS pmc_set_preferred_network_list(tHalHandle hHal,
|
||||
tpSirPNOScanReq pRequest,
|
||||
uint8_t sessionId,
|
||||
preferred_network_found_ind_cb
|
||||
callbackRoutine, void *callbackContext);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
bool csr_roamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
QDF_STATUS csr_tdls_send_mgmt_req(tHalHandle hHal, uint8_t sessionId,
|
||||
|
|
|
|||
|
|
@ -132,13 +132,6 @@ typedef struct sSelfRecoveryStats {
|
|||
uint8_t cmdStatsIndx;
|
||||
} tSelfRecoveryStats;
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/*Pref netw found Cb declaration*/
|
||||
typedef void (*preferred_network_found_ind_cb)(void *callback_context,
|
||||
tpSirPrefNetworkFoundInd
|
||||
pPrefNetworkFoundInd);
|
||||
#endif
|
||||
|
||||
typedef void (*ocb_callback)(void *context, void *response);
|
||||
typedef void (*sme_set_thermal_level_callback)(void *context, u_int8_t level);
|
||||
typedef void (*p2p_lo_callback)(void *context, void *event);
|
||||
|
|
@ -219,12 +212,6 @@ typedef struct tagSmeStruct {
|
|||
void (*pGetTemperatureCb)(int temperature, void *context);
|
||||
uint8_t miracast_value;
|
||||
struct ps_global_info ps_global_info;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/* routine to call for Preferred Network Found Indication */
|
||||
preferred_network_found_ind_cb pref_netw_found_cb;
|
||||
/* value to be passed as parameter to routine specified above */
|
||||
void *preferred_network_found_ind_cb_ctx;
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
void (*rssi_threshold_breached_cb)(void *, struct rssi_breach_event *);
|
||||
#ifdef WLAN_FEATURE_MEMDUMP
|
||||
void (*fw_dump_callback)(void *context, struct fw_dump_rsp *rsp);
|
||||
|
|
|
|||
|
|
@ -83,19 +83,6 @@ QDF_STATUS sme_ps_open_per_session(tHalHandle hal_ctx, uint32_t session_id);
|
|||
void sme_auto_ps_entry_timer_expired(void *ps_param);
|
||||
QDF_STATUS sme_ps_close(tHalHandle hal_ctx);
|
||||
QDF_STATUS sme_ps_close_per_session(tHalHandle hal_ctx, uint32_t sessionId);
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
void sme_set_pno_channel_prediction(tpSirPNOScanReq request_buf,
|
||||
tpAniSirGlobal mac_ctx);
|
||||
QDF_STATUS sme_set_ps_preferred_network_list(tHalHandle hal_ctx,
|
||||
tpSirPNOScanReq request,
|
||||
uint8_t session_id,
|
||||
preferred_network_found_ind_cb callback_routine,
|
||||
void *callback_context);
|
||||
#else
|
||||
static inline void sme_set_pno_channel_prediction(void *request_buf,
|
||||
tpAniSirGlobal mac_ctx)
|
||||
{}
|
||||
#endif
|
||||
|
||||
bool sme_is_auto_ps_timer_running(tHalHandle hal_ctx,
|
||||
uint32_t session_id);
|
||||
|
|
|
|||
|
|
@ -2250,19 +2250,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
|
|||
sme_err("Empty message for: %d", pMsg->type);
|
||||
}
|
||||
break;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
case eWNI_SME_PREF_NETWORK_FOUND_IND:
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_WMA_MSG,
|
||||
NO_SESSION, pMsg->type));
|
||||
if (pMsg->bodyptr) {
|
||||
status = sme_preferred_network_found_ind((void *)pMac,
|
||||
pMsg->bodyptr);
|
||||
qdf_mem_free(pMsg->bodyptr);
|
||||
} else {
|
||||
sme_err("Empty message for: %d", pMsg->type);
|
||||
}
|
||||
break;
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
case eWNI_SME_CHANGE_COUNTRY_CODE:
|
||||
if (pMsg->bodyptr) {
|
||||
status = sme_handle_change_country_code((void *)pMac,
|
||||
|
|
@ -5942,42 +5929,6 @@ QDF_STATUS sme_set_keep_alive(tHalHandle hHal, uint8_t session_id,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/* ---------------------------------------------------------------------------
|
||||
\fn sme_set_preferred_network_list
|
||||
\brief API to set the Preferred Network List Offload feature.
|
||||
\param hHal - The handle returned by mac_open.
|
||||
\param request - Pointer to the offload request.
|
||||
\return QDF_STATUS
|
||||
---------------------------------------------------------------------------*/
|
||||
QDF_STATUS sme_set_preferred_network_list(tHalHandle hHal,
|
||||
tpSirPNOScanReq request,
|
||||
uint8_t sessionId,
|
||||
void (*callback_routine)(void *callback_context,
|
||||
tSirPrefNetworkFoundInd
|
||||
*pPrefNetworkFoundInd),
|
||||
void *callback_context)
|
||||
{
|
||||
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
|
||||
QDF_STATUS status;
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_SME,
|
||||
TRACE_CODE_SME_RX_HDD_PREF_NET_LIST,
|
||||
sessionId, request->ucNetworksCount));
|
||||
status = sme_acquire_global_lock(&pMac->sme);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
status = sme_set_ps_preferred_network_list(hHal, request,
|
||||
sessionId,
|
||||
callback_routine,
|
||||
callback_context);
|
||||
sme_release_global_lock(&pMac->sme);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
QDF_STATUS sme_abort_mac_scan(tHalHandle hHal, uint8_t sessionId,
|
||||
uint32_t scan_id, eCsrAbortReason reason)
|
||||
{
|
||||
|
|
@ -6679,132 +6630,6 @@ uint16_t sme_check_concurrent_channel_overlap(tHalHandle hHal, uint16_t sap_ch,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* sme_update_roam_pno_channel_prediction_config() - Update PNO config
|
||||
* @csr_config: config from SME context
|
||||
* @hal: Global Hal handle
|
||||
* @copy_from_to: Used to specify the source and destination
|
||||
*
|
||||
* Copy the PNO channel prediction configuration parameters from
|
||||
* SME context to MAC context or vice-versa
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void sme_update_roam_pno_channel_prediction_config(
|
||||
tHalHandle hal, tCsrConfigParam *csr_config,
|
||||
uint8_t copy_from_to)
|
||||
{
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
||||
if (copy_from_to == SME_CONFIG_TO_ROAM_CONFIG) {
|
||||
mac_ctx->roam.configParam.pno_channel_prediction =
|
||||
csr_config->pno_channel_prediction;
|
||||
mac_ctx->roam.configParam.top_k_num_of_channels =
|
||||
csr_config->top_k_num_of_channels;
|
||||
mac_ctx->roam.configParam.stationary_thresh =
|
||||
csr_config->stationary_thresh;
|
||||
mac_ctx->roam.configParam.channel_prediction_full_scan =
|
||||
csr_config->channel_prediction_full_scan;
|
||||
mac_ctx->roam.configParam.pnoscan_adaptive_dwell_mode =
|
||||
csr_config->pnoscan_adaptive_dwell_mode;
|
||||
} else if (copy_from_to == ROAM_CONFIG_TO_SME_CONFIG) {
|
||||
csr_config->pno_channel_prediction =
|
||||
mac_ctx->roam.configParam.pno_channel_prediction;
|
||||
csr_config->top_k_num_of_channels =
|
||||
mac_ctx->roam.configParam.top_k_num_of_channels;
|
||||
csr_config->stationary_thresh =
|
||||
mac_ctx->roam.configParam.stationary_thresh;
|
||||
csr_config->channel_prediction_full_scan =
|
||||
mac_ctx->roam.configParam.channel_prediction_full_scan;
|
||||
csr_config->pnoscan_adaptive_dwell_mode =
|
||||
mac_ctx->roam.configParam.pnoscan_adaptive_dwell_mode;
|
||||
}
|
||||
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: sme_preferred_network_found_ind
|
||||
*
|
||||
* Description:
|
||||
* Invoke Preferred Network Found Indication
|
||||
*
|
||||
* Parameters:
|
||||
* hHal - HAL handle for device
|
||||
* pMsg - found network description
|
||||
*
|
||||
* Returns: QDF_STATUS
|
||||
*
|
||||
******************************************************************************/
|
||||
QDF_STATUS sme_preferred_network_found_ind(tHalHandle hHal, void *pMsg)
|
||||
{
|
||||
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
tSirPrefNetworkFoundInd *pPrefNetworkFoundInd =
|
||||
(tSirPrefNetworkFoundInd *) pMsg;
|
||||
uint8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1];
|
||||
uint8_t ssIdLength = 0;
|
||||
|
||||
if (NULL == pMsg) {
|
||||
sme_err("msg ptr is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (pMac->pnoOffload) {
|
||||
/* Call Preferred Network Found Indication callback routine. */
|
||||
if (pMac->sme.pref_netw_found_cb != NULL) {
|
||||
pMac->sme.pref_netw_found_cb(pMac->sme.
|
||||
preferred_network_found_ind_cb_ctx,
|
||||
pPrefNetworkFoundInd);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
if (pPrefNetworkFoundInd->ssId.length > 0) {
|
||||
ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH,
|
||||
pPrefNetworkFoundInd->ssId.length);
|
||||
qdf_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId,
|
||||
ssIdLength);
|
||||
dumpSsId[ssIdLength] = 0;
|
||||
sme_debug("SSID: %s frame length: %d",
|
||||
dumpSsId, pPrefNetworkFoundInd->frameLength);
|
||||
|
||||
/* Flush scan results, So as to avoid indication/updation of
|
||||
* stale entries, which may not have aged out during APPS collapse
|
||||
*/
|
||||
sme_scan_flush_result(hHal);
|
||||
|
||||
/* Save the frame to scan result */
|
||||
if (pPrefNetworkFoundInd->mesgLen >
|
||||
sizeof(tSirPrefNetworkFoundInd)) {
|
||||
/* we may have a frame */
|
||||
status = csr_scan_save_preferred_network_found(pMac,
|
||||
pPrefNetworkFoundInd);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
sme_err("fail to save preferred network");
|
||||
}
|
||||
} else {
|
||||
sme_err("not enough data length %d needed %zu",
|
||||
pPrefNetworkFoundInd->mesgLen,
|
||||
sizeof(tSirPrefNetworkFoundInd));
|
||||
}
|
||||
|
||||
/* Call Preferred Netowrk Found Indication callback routine. */
|
||||
if (QDF_IS_STATUS_SUCCESS(status)
|
||||
&& (pMac->sme.pref_netw_found_cb != NULL)) {
|
||||
pMac->sme.pref_netw_found_cb(pMac->sme.
|
||||
preferred_network_found_ind_cb_ctx,
|
||||
pPrefNetworkFoundInd);
|
||||
}
|
||||
} else {
|
||||
sme_err("callback failed - SSID is NULL");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
/**
|
||||
* sme_set_tsfcb() - Set callback for TSF capture
|
||||
* @h_hal: Handler return by mac_open
|
||||
|
|
|
|||
|
|
@ -672,165 +672,6 @@ QDF_STATUS sme_ps_start_uapsd(tHalHandle hal_ctx, uint32_t session_id,
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* sme_set_pno_channel_prediction() - Prepare PNO buffer
|
||||
* @request_buf: Buffer to be filled up to send to WMA
|
||||
* @mac_ctx: MAC context
|
||||
*
|
||||
* Fill up the PNO buffer with the channel prediction configuration
|
||||
* parameters and send them to WMA
|
||||
*
|
||||
* Return: None
|
||||
**/
|
||||
void sme_set_pno_channel_prediction(tpSirPNOScanReq request_buf,
|
||||
tpAniSirGlobal mac_ctx)
|
||||
{
|
||||
request_buf->pno_channel_prediction =
|
||||
mac_ctx->roam.configParam.pno_channel_prediction;
|
||||
request_buf->top_k_num_of_channels =
|
||||
mac_ctx->roam.configParam.top_k_num_of_channels;
|
||||
request_buf->stationary_thresh =
|
||||
mac_ctx->roam.configParam.stationary_thresh;
|
||||
request_buf->channel_prediction_full_scan =
|
||||
mac_ctx->roam.configParam.channel_prediction_full_scan;
|
||||
request_buf->pnoscan_adaptive_dwell_mode =
|
||||
mac_ctx->roam.configParam.pnoscan_adaptive_dwell_mode;
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||
FL("channel_prediction: %d, top_k_num_of_channels: %d"),
|
||||
request_buf->pno_channel_prediction,
|
||||
request_buf->top_k_num_of_channels);
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||
FL("stationary_thresh: %d, ch_predict_full_scan: %d"),
|
||||
request_buf->stationary_thresh,
|
||||
request_buf->channel_prediction_full_scan);
|
||||
}
|
||||
QDF_STATUS sme_set_ps_preferred_network_list(tHalHandle hal_ctx,
|
||||
tpSirPNOScanReq request,
|
||||
uint8_t session_id,
|
||||
preferred_network_found_ind_cb callback_routine,
|
||||
void *callback_context)
|
||||
{
|
||||
tpSirPNOScanReq request_buf;
|
||||
struct scheduler_msg msg;
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
|
||||
tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
|
||||
uint8_t uc_dot11_mode;
|
||||
|
||||
if (NULL == session) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: session is NULL", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* save some work if PNO is already disabled */
|
||||
if (!session->pnoStarted && !request->enable) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: PNO already disabled", __func__);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: SSID = 0x%08x%08x%08x%08x%08x%08x%08x%08x, 0x%08x%08x%08x%08x%08x%08x%08x%08x", __func__,
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[0]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[4]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[8]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[12]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[16]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[20]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[24]),
|
||||
*((uint32_t *) &request->aNetworks[0].ssId.ssId[28]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[0]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[4]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[8]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[12]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[16]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[20]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[24]),
|
||||
*((uint32_t *) &request->aNetworks[1].ssId.ssId[28]));
|
||||
|
||||
if (!session) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: session is NULL", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
request_buf = qdf_mem_malloc(sizeof(tSirPNOScanReq));
|
||||
if (NULL == request_buf) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Not able to allocate memory for PNO request"));
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
qdf_mem_copy(request_buf, request, sizeof(tSirPNOScanReq));
|
||||
|
||||
/*Must translate the mode first */
|
||||
uc_dot11_mode = (uint8_t) csr_translate_to_wni_cfg_dot11_mode(mac_ctx,
|
||||
csr_find_best_phy_mode
|
||||
(mac_ctx,
|
||||
mac_ctx->roam.
|
||||
configParam.
|
||||
phyMode));
|
||||
|
||||
|
||||
if (mac_ctx->pnoOffload) {
|
||||
if (request_buf->enable)
|
||||
session->pnoStarted = true;
|
||||
else
|
||||
session->pnoStarted = false;
|
||||
|
||||
request_buf->sessionId = session_id;
|
||||
}
|
||||
sme_set_pno_channel_prediction(request_buf, mac_ctx);
|
||||
|
||||
if (csr_is_p2p_session_connected(mac_ctx)) {
|
||||
/* if AP-STA concurrency is active */
|
||||
request_buf->active_max_time =
|
||||
mac_ctx->roam.configParam.nActiveMaxChnTimeConc;
|
||||
request_buf->active_min_time =
|
||||
mac_ctx->roam.configParam.nActiveMinChnTimeConc;
|
||||
request_buf->passive_max_time =
|
||||
mac_ctx->roam.configParam.nPassiveMaxChnTimeConc;
|
||||
request_buf->passive_min_time =
|
||||
mac_ctx->roam.configParam.nPassiveMinChnTimeConc;
|
||||
request_buf->pnoscan_adaptive_dwell_mode =
|
||||
mac_ctx->roam.configParam.pnoscan_adaptive_dwell_mode;
|
||||
} else {
|
||||
request_buf->active_max_time =
|
||||
mac_ctx->roam.configParam.nActiveMaxChnTime;
|
||||
request_buf->active_min_time =
|
||||
mac_ctx->roam.configParam.nActiveMinChnTime;
|
||||
request_buf->passive_max_time =
|
||||
mac_ctx->roam.configParam.nPassiveMaxChnTime;
|
||||
request_buf->passive_min_time =
|
||||
mac_ctx->roam.configParam.nPassiveMinChnTime;
|
||||
request_buf->pnoscan_adaptive_dwell_mode =
|
||||
mac_ctx->roam.configParam.pnoscan_adaptive_dwell_mode;
|
||||
}
|
||||
|
||||
msg.type = WMA_SET_PNO_REQ;
|
||||
msg.reserved = 0;
|
||||
msg.bodyptr = request_buf;
|
||||
if (!QDF_IS_STATUS_SUCCESS
|
||||
(scheduler_post_msg(QDF_MODULE_ID_WMA, &msg))) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Not able to post WMA_SET_PNO_REQ message to WMA"));
|
||||
qdf_mem_free(request_buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* Cache the Preferred Network Found Indication callback information */
|
||||
mac_ctx->sme.pref_netw_found_cb =
|
||||
callback_routine;
|
||||
mac_ctx->sme.preferred_network_found_ind_cb_ctx =
|
||||
callback_context;
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, "-%s", __func__);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
/**
|
||||
* sme_set_ps_host_offload(): Set the host offload feature.
|
||||
* @hal_ctx - The handle returned by mac_open.
|
||||
|
|
|
|||
|
|
@ -2762,9 +2762,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
|
|||
pMac->roam.configParam.per_roam_config.rx_per_mon_time =
|
||||
pParam->per_roam_config.rx_per_mon_time;
|
||||
|
||||
/* update p2p offload status */
|
||||
pMac->pnoOffload = pParam->pnoOffload;
|
||||
|
||||
pMac->fEnableDebugLog = pParam->fEnableDebugLog;
|
||||
|
||||
/* update interface configuration */
|
||||
|
|
@ -2792,8 +2789,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
|
|||
pMac->fine_time_meas_cap = pParam->fine_time_meas_cap;
|
||||
pMac->dual_mac_feature_disable =
|
||||
pParam->dual_mac_feature_disable;
|
||||
sme_update_roam_pno_channel_prediction_config(pMac, pParam,
|
||||
SME_CONFIG_TO_ROAM_CONFIG);
|
||||
pMac->roam.configParam.early_stop_scan_enable =
|
||||
pParam->early_stop_scan_enable;
|
||||
pMac->roam.configParam.early_stop_scan_min_threshold =
|
||||
|
|
@ -3007,7 +3002,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
|
|||
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
|
||||
pParam->max_intf_count = pMac->sme.max_intf_count;
|
||||
pParam->enableSelfRecovery = pMac->sme.enableSelfRecovery;
|
||||
pParam->pnoOffload = pMac->pnoOffload;
|
||||
pParam->f_prefer_non_dfs_on_radar =
|
||||
pMac->f_prefer_non_dfs_on_radar;
|
||||
pParam->fine_time_meas_cap = pMac->fine_time_meas_cap;
|
||||
|
|
@ -3020,8 +3014,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
|
|||
pParam->enable5gEBT = pMac->enable5gEBT;
|
||||
pParam->f_sta_miracast_mcc_rest_time_val =
|
||||
pMac->f_sta_miracast_mcc_rest_time_val;
|
||||
sme_update_roam_pno_channel_prediction_config(pMac, pParam,
|
||||
ROAM_CONFIG_TO_SME_CONFIG);
|
||||
pParam->early_stop_scan_enable =
|
||||
pMac->roam.configParam.early_stop_scan_enable;
|
||||
pParam->early_stop_scan_min_threshold =
|
||||
|
|
|
|||
|
|
@ -5268,21 +5268,6 @@ QDF_STATUS csr_scan_sme_scan_response(tpAniSirGlobal pMac,
|
|||
return status;
|
||||
|
||||
error_handling:
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
if (pMac->pnoOffload && pScanRsp->statusCode == eSIR_PNO_SCAN_SUCCESS) {
|
||||
sme_debug("PNO Scan completion called");
|
||||
csr_save_scan_results(pMac, eCsrScanCandidateFound,
|
||||
pScanRsp->sessionId);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
} else {
|
||||
/*
|
||||
* Scan completion was called, PNO is active, but scan
|
||||
* response was not PNO
|
||||
*/
|
||||
sme_err("Scan completion called, scan rsp was not PNO");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif
|
||||
sme_err("Scan completion called, but no active SCAN command");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
|
@ -7536,184 +7521,6 @@ bool csr_roam_is_valid_channel(tpAniSirGlobal pMac, uint8_t channel)
|
|||
return fValid;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
QDF_STATUS csr_scan_save_preferred_network_found(tpAniSirGlobal pMac,
|
||||
tSirPrefNetworkFoundInd *
|
||||
pPrefNetworkFoundInd)
|
||||
{
|
||||
uint32_t uLen = 0;
|
||||
tpSirProbeRespBeacon parsed_frm;
|
||||
tCsrScanResult *pScanResult = NULL;
|
||||
tSirBssDescription *pBssDescr = NULL;
|
||||
bool fDupBss;
|
||||
tDot11fBeaconIEs *local_ie = NULL;
|
||||
tAniSSID tmpSsid;
|
||||
unsigned long timer = 0;
|
||||
QDF_STATUS status;
|
||||
|
||||
tpSirMacMgmtHdr macHeader =
|
||||
(tpSirMacMgmtHdr) pPrefNetworkFoundInd->data;
|
||||
parsed_frm =
|
||||
(tpSirProbeRespBeacon) qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
|
||||
|
||||
if (NULL == parsed_frm) {
|
||||
sme_err("fail to allocate memory for frame");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
if (pPrefNetworkFoundInd->frameLength <= SIR_MAC_HDR_LEN_3A) {
|
||||
sme_err("Incorrect len: %d",
|
||||
pPrefNetworkFoundInd->frameLength);
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
if (sir_convert_probe_frame2_struct(pMac,
|
||||
&pPrefNetworkFoundInd->data[SIR_MAC_HDR_LEN_3A],
|
||||
pPrefNetworkFoundInd->frameLength - SIR_MAC_HDR_LEN_3A,
|
||||
parsed_frm) != eSIR_SUCCESS
|
||||
|| !parsed_frm->ssidPresent) {
|
||||
sme_err("Parse error ProbeResponse, length: %d",
|
||||
pPrefNetworkFoundInd->frameLength);
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
/* 24 byte MAC header and 12 byte to ssid IE */
|
||||
if (pPrefNetworkFoundInd->frameLength >
|
||||
(SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET)) {
|
||||
uLen = pPrefNetworkFoundInd->frameLength -
|
||||
(SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET);
|
||||
}
|
||||
pScanResult = qdf_mem_malloc(sizeof(tCsrScanResult) + uLen);
|
||||
if (NULL == pScanResult) {
|
||||
sme_err("fail to allocate memory for frame");
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
pBssDescr = &pScanResult->Result.BssDescriptor;
|
||||
/*
|
||||
* Length of BSS desription is without length of length itself and
|
||||
* length of pointer that holds the next BSS description
|
||||
*/
|
||||
pBssDescr->length = (uint16_t)(offsetof(tSirBssDescription, ieFields[0])
|
||||
- sizeof(pBssDescr->length) + uLen);
|
||||
if (parsed_frm->dsParamsPresent)
|
||||
pBssDescr->channelId = parsed_frm->channelNumber;
|
||||
else if (parsed_frm->HTInfo.present)
|
||||
pBssDescr->channelId = parsed_frm->HTInfo.primaryChannel;
|
||||
else {
|
||||
/*
|
||||
* If Probe Responce received in PNO indication does not
|
||||
* contain DSParam IE or HT Info IE then add dummy channel
|
||||
* to the received BSS info so that Scan result received as
|
||||
* a part of PNO is updated to the supplicant. Specially
|
||||
* applicable in case of AP configured in 11A only mode.
|
||||
*/
|
||||
if ((pMac->roam.configParam.bandCapability == eCSR_BAND_ALL) ||
|
||||
(pMac->roam.configParam.bandCapability == eCSR_BAND_24))
|
||||
pBssDescr->channelId = 1;
|
||||
else if (pMac->roam.configParam.bandCapability == eCSR_BAND_5G)
|
||||
pBssDescr->channelId = 36;
|
||||
}
|
||||
if ((pBssDescr->channelId > 0) && (pBssDescr->channelId < 15)) {
|
||||
int i;
|
||||
/* 11b or 11g packet */
|
||||
/* 11g iff extended Rate IE is present or */
|
||||
/* if there is an A rate in suppRate IE */
|
||||
for (i = 0; i < parsed_frm->supportedRates.numRates; i++) {
|
||||
if (sirIsArate(parsed_frm->supportedRates.rate[i]
|
||||
& 0x7f)) {
|
||||
pBssDescr->nwType = eSIR_11G_NW_TYPE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (parsed_frm->extendedRatesPresent)
|
||||
pBssDescr->nwType = eSIR_11G_NW_TYPE;
|
||||
} else {
|
||||
/* 11a packet */
|
||||
pBssDescr->nwType = eSIR_11A_NW_TYPE;
|
||||
}
|
||||
pBssDescr->sinr = 0;
|
||||
pBssDescr->rssi = -1 * pPrefNetworkFoundInd->rssi;
|
||||
pBssDescr->beaconInterval = parsed_frm->beaconInterval;
|
||||
if (!pBssDescr->beaconInterval) {
|
||||
sme_warn("Bcn Interval is Zero , default to 100"
|
||||
MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pBssDescr->bssId));
|
||||
pBssDescr->beaconInterval = 100;
|
||||
}
|
||||
pBssDescr->timeStamp[0] = parsed_frm->timeStamp[0];
|
||||
pBssDescr->timeStamp[1] = parsed_frm->timeStamp[1];
|
||||
pBssDescr->capabilityInfo = *((uint16_t *)&parsed_frm->capabilityInfo);
|
||||
qdf_mem_copy((uint8_t *) &pBssDescr->bssId,
|
||||
(uint8_t *) macHeader->bssId, sizeof(tSirMacAddr));
|
||||
pBssDescr->received_time = (uint64_t)qdf_mc_timer_get_system_time();
|
||||
|
||||
/* MobilityDomain */
|
||||
pBssDescr->mdie[0] = 0;
|
||||
pBssDescr->mdie[1] = 0;
|
||||
pBssDescr->mdie[2] = 0;
|
||||
pBssDescr->mdiePresent = false;
|
||||
/*
|
||||
* If mdie is present in the probe rsp we fill it in the bss description
|
||||
*/
|
||||
if (parsed_frm->mdiePresent) {
|
||||
pBssDescr->mdiePresent = true;
|
||||
pBssDescr->mdie[0] = parsed_frm->mdie[0];
|
||||
pBssDescr->mdie[1] = parsed_frm->mdie[1];
|
||||
pBssDescr->mdie[2] = parsed_frm->mdie[2];
|
||||
}
|
||||
sme_debug("mdie=%02x%02x%02x",
|
||||
(unsigned int)pBssDescr->mdie[0],
|
||||
(unsigned int)pBssDescr->mdie[1],
|
||||
(unsigned int)pBssDescr->mdie[2]);
|
||||
|
||||
sme_debug("Bssid= "MAC_ADDRESS_STR" chan= %d, rssi = %d",
|
||||
MAC_ADDR_ARRAY(pBssDescr->bssId), pBssDescr->channelId,
|
||||
pBssDescr->rssi);
|
||||
/* IEs */
|
||||
if (uLen) {
|
||||
qdf_mem_copy(&pBssDescr->ieFields,
|
||||
pPrefNetworkFoundInd->data + (SIR_MAC_HDR_LEN_3A +
|
||||
SIR_MAC_B_PR_SSID_OFFSET), uLen);
|
||||
}
|
||||
local_ie = (tDot11fBeaconIEs *) (pScanResult->Result.pvIes);
|
||||
status = csr_get_parsed_bss_description_ies(pMac,
|
||||
&pScanResult->Result.BssDescriptor, &local_ie);
|
||||
if (!(local_ie || QDF_IS_STATUS_SUCCESS(status))) {
|
||||
sme_err("Cannot parse IEs");
|
||||
csr_free_scan_result_entry(pMac, pScanResult);
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_E_RESOURCES;
|
||||
}
|
||||
|
||||
fDupBss = csr_remove_dup_bss_description(pMac,
|
||||
&pScanResult->Result.BssDescriptor,
|
||||
local_ie, &tmpSsid, &timer, false);
|
||||
/* Check whether we have reach out limit */
|
||||
if (CSR_SCAN_IS_OVER_BSS_LIMIT(pMac)) {
|
||||
/* Limit reach */
|
||||
sme_err("BSS limit reached");
|
||||
/* Free the resources */
|
||||
if ((pScanResult->Result.pvIes == NULL) && local_ie)
|
||||
qdf_mem_free(local_ie);
|
||||
csr_free_scan_result_entry(pMac, pScanResult);
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_E_RESOURCES;
|
||||
}
|
||||
|
||||
if ((SIR_MAC_MGMT_FRAME == macHeader->fc.type) &&
|
||||
(SIR_MAC_MGMT_PROBE_RSP == macHeader->fc.subType))
|
||||
pScanResult->Result.BssDescriptor.fProbeRsp = 1;
|
||||
|
||||
/* Add to scan cache */
|
||||
csr_scan_add_result(pMac, pScanResult, local_ie,
|
||||
pPrefNetworkFoundInd->sessionId);
|
||||
|
||||
if ((pScanResult->Result.pvIes == NULL) && local_ie)
|
||||
qdf_mem_free(local_ie);
|
||||
qdf_mem_free(parsed_frm);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
#ifndef NAPIER_SCAN
|
||||
void csr_init_occupied_channels_list(tpAniSirGlobal pMac, uint8_t sessionId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,10 +52,6 @@ QDF_STATUS csr_msg_processor(tpAniSirGlobal mac_ctx, void *msg_buf)
|
|||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
tSirSmeRsp *sme_rsp = (tSirSmeRsp *) msg_buf;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
tSirMbMsg *msg = (tSirMbMsg *) msg_buf;
|
||||
tCsrRoamSession *session;
|
||||
#endif
|
||||
uint8_t session_id = sme_rsp->sessionId;
|
||||
eCsrRoamState cur_state = mac_ctx->roam.curState[session_id];
|
||||
|
||||
|
|
@ -66,31 +62,6 @@ QDF_STATUS csr_msg_processor(tpAniSirGlobal mac_ctx, void *msg_buf)
|
|||
mac_ctx->roam.curSubState[session_id]),
|
||||
session_id);
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/*
|
||||
* PNO scan responses have to be handled irrespective of CSR roam state.
|
||||
* Check if PNO has been started & only then process the PNO scan result
|
||||
* Also note that normal scan isn't allowed when PNO scan is in progress
|
||||
* and so the scan responses reaching here when PNO is started must be
|
||||
* PNO responses. For normal scan, the PNO started flag will be false
|
||||
* and it'll be processed as usual based on the current CSR roam state.
|
||||
*/
|
||||
session = CSR_GET_SESSION(mac_ctx, session_id);
|
||||
if (!session) {
|
||||
sme_err("session %d not found, msgType: %d",
|
||||
session_id, msg->type);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (eWNI_SME_SCAN_RSP == msg->type) {
|
||||
status = csr_scanning_state_msg_processor(mac_ctx, msg_buf);
|
||||
if (QDF_STATUS_SUCCESS != status)
|
||||
sme_err("handling PNO scan resp 0x%X CSR state %d",
|
||||
sme_rsp->messageType, cur_state);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Process the message based on the state of the roaming states... */
|
||||
#if defined(ANI_RTT_DEBUG)
|
||||
if (!pAdapter->fRttModeEnabled) {
|
||||
|
|
|
|||
|
|
@ -305,15 +305,6 @@ enum ds_mode {
|
|||
/* Default rssi threshold defined in CFG80211 */
|
||||
#define WMA_RSSI_THOLD_DEFAULT -300
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
#define WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
|
||||
#ifdef CONFIG_SLUB_DEBUG_ON
|
||||
#define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */
|
||||
#else
|
||||
#define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (1 * 1000) /* in msec */
|
||||
#endif /* CONFIG_SLUB_DEBUG_ON */
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
#define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
|
||||
#define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
|
||||
#define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
|
||||
|
|
@ -1025,10 +1016,6 @@ struct wma_txrx_node {
|
|||
struct scan_param scan_info;
|
||||
uint32_t type;
|
||||
uint32_t sub_type;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
bool nlo_match_evt_received;
|
||||
bool pno_in_progress;
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
bool plm_in_progress;
|
||||
#endif
|
||||
|
|
@ -1439,9 +1426,6 @@ typedef struct {
|
|||
tSetBssKeyParams ibsskey_info;
|
||||
struct ieee80211com *dfs_ic;
|
||||
txFailIndCallback hddTxFailCb;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
qdf_wake_lock_t pno_wake_lock;
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_EXTSCAN
|
||||
qdf_wake_lock_t extscan_wake_lock;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -291,28 +291,6 @@ void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
|
|||
|
||||
void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
QDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno);
|
||||
|
||||
QDF_STATUS wma_pno_stop(tp_wma_handle wma, uint8_t vdev_id);
|
||||
#ifndef NAPIER_SCAN
|
||||
void wma_config_pno(tp_wma_handle wma, tpSirPNOScanReq pno);
|
||||
#else
|
||||
static inline void wma_config_pno(tp_wma_handle wma, tpSirPNOScanReq pno) {}
|
||||
#endif
|
||||
|
||||
void wma_set_pno_channel_prediction(uint8_t *buf_ptr,
|
||||
tpSirPNOScanReq pno);
|
||||
void wma_scan_cache_updated_ind(tp_wma_handle wma, uint8_t sessionId);
|
||||
#else
|
||||
static inline void wma_set_pno_channel_prediction(uint8_t *buf_ptr,
|
||||
void *pno)
|
||||
{
|
||||
WMA_LOGD("PNO Channel Prediction feature not supported");
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_FIXED_STRUC, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
|
||||
#endif
|
||||
|
|
@ -423,12 +401,6 @@ void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
|
|||
int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
|
||||
uint32_t len);
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
int wma_nlo_match_evt_handler(void *handle, uint8_t *event, uint32_t len);
|
||||
|
||||
int wma_nlo_scan_cmp_evt_handler(void *handle, uint8_t *event, uint32_t len);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
|
||||
static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
|
||||
|
|
|
|||
|
|
@ -276,12 +276,6 @@
|
|||
#define WMA_FTM_CMD_RSP SIR_PTT_MSG_TYPES_END
|
||||
#define WMA_CSA_OFFLOAD_EVENT SIR_CSA_OFFLOAD_EVENT
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/*Requests sent to lower driver*/
|
||||
#define WMA_SET_PNO_REQ SIR_HAL_SET_PNO_REQ
|
||||
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
#define WMA_SET_PLM_REQ SIR_HAL_SET_PLM_REQ
|
||||
#endif
|
||||
|
|
@ -332,9 +326,6 @@
|
|||
#define WMA_IBSS_PEER_INACTIVITY_IND SIR_HAL_IBSS_PEER_INACTIVITY_IND
|
||||
|
||||
#define WMA_CLI_SET_CMD SIR_HAL_CLI_SET_CMD
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
#define WMA_SME_SCAN_CACHE_UPDATED SIR_HAL_SME_SCAN_CACHE_UPDATED
|
||||
#endif
|
||||
|
||||
#ifndef REMOVE_PKT_LOG
|
||||
#define WMA_PKTLOG_ENABLE_REQ SIR_HAL_PKTLOG_ENABLE_REQ
|
||||
|
|
|
|||
|
|
@ -2143,9 +2143,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
|
|||
qdf_mem_zero(wma_handle, sizeof(t_wma_handle));
|
||||
|
||||
if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
qdf_wake_lock_create(&wma_handle->pno_wake_lock, "wlan_pno_wl");
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#ifdef FEATURE_WLAN_EXTSCAN
|
||||
qdf_wake_lock_create(&wma_handle->extscan_wake_lock,
|
||||
"wlan_extscan_wl");
|
||||
|
|
@ -2611,9 +2608,6 @@ err_wmi_handle:
|
|||
err_wma_handle:
|
||||
|
||||
if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
qdf_wake_lock_destroy(&wma_handle->pno_wake_lock);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#ifdef FEATURE_WLAN_EXTSCAN
|
||||
qdf_wake_lock_destroy(&wma_handle->extscan_wake_lock);
|
||||
#endif /* FEATURE_WLAN_EXTSCAN */
|
||||
|
|
@ -3120,36 +3114,6 @@ QDF_STATUS wma_start(void *cds_ctx)
|
|||
qdf_status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
#ifndef NAPIER_SCAN
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
|
||||
WMI_SERVICE_NLO)) {
|
||||
|
||||
WMA_LOGD("FW supports pno offload, registering nlo match handler");
|
||||
|
||||
status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
WMI_NLO_MATCH_EVENTID,
|
||||
wma_nlo_match_evt_handler,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
if (status) {
|
||||
WMA_LOGE("Failed to register nlo match event cb");
|
||||
qdf_status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
WMI_NLO_SCAN_COMPLETE_EVENTID,
|
||||
wma_nlo_scan_cmp_evt_handler,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
if (status) {
|
||||
WMA_LOGE("Failed to register nlo scan comp event cb");
|
||||
qdf_status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#endif
|
||||
|
||||
#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
|
||||
defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
|
||||
WMA_LOGD("MCC TX Pause Event Handler register");
|
||||
|
|
@ -3622,9 +3586,6 @@ QDF_STATUS wma_close(void *cds_ctx)
|
|||
}
|
||||
wma_cleanup_dbs_phy_caps(wma_handle);
|
||||
if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
qdf_wake_lock_destroy(&wma_handle->pno_wake_lock);
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#ifdef FEATURE_WLAN_EXTSCAN
|
||||
qdf_wake_lock_destroy(&wma_handle->extscan_wake_lock);
|
||||
#endif /* FEATURE_WLAN_EXTSCAN */
|
||||
|
|
@ -6555,15 +6516,6 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, struct scheduler_msg *msg)
|
|||
wma_set_keepalive_req(wma_handle,
|
||||
(tSirKeepAliveReq *) msg->bodyptr);
|
||||
break;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
case WMA_SET_PNO_REQ:
|
||||
wma_config_pno(wma_handle, (tpSirPNOScanReq) msg->bodyptr);
|
||||
break;
|
||||
|
||||
case WMA_SME_SCAN_CACHE_UPDATED:
|
||||
wma_scan_cache_updated_ind(wma_handle, msg->bodyval);
|
||||
break;
|
||||
#endif /* FEATURE_WLAN_SCAN_PNO */
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
case WMA_SET_PLM_REQ:
|
||||
wma_config_plm(wma_handle, (tpSirPlmReq) msg->bodyptr);
|
||||
|
|
|
|||
|
|
@ -3011,195 +3011,6 @@ send_resp:
|
|||
wma_send_msg(wma, WMA_SWITCH_CHANNEL_RSP, (void *)params, 0);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
#ifndef NAPIER_SCAN
|
||||
/**
|
||||
* wma_set_pno_channel_prediction() - Set PNO configuration
|
||||
* @buf_ptr: Buffer passed by upper layers
|
||||
* @pno: Buffer to be sent to the firmware
|
||||
*
|
||||
* Copy the PNO Channel prediction configuration parameters
|
||||
* passed by the upper layers to a WMI format TLV and send it
|
||||
* down to the firmware.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wma_set_pno_channel_prediction(uint8_t *buf_ptr,
|
||||
tpSirPNOScanReq pno)
|
||||
{
|
||||
nlo_channel_prediction_cfg *channel_prediction_cfg =
|
||||
(nlo_channel_prediction_cfg *) buf_ptr;
|
||||
WMITLV_SET_HDR(&channel_prediction_cfg->tlv_header,
|
||||
WMITLV_TAG_ARRAY_BYTE,
|
||||
WMITLV_GET_STRUCT_TLVLEN(nlo_channel_prediction_cfg));
|
||||
channel_prediction_cfg->enable = pno->pno_channel_prediction;
|
||||
channel_prediction_cfg->top_k_num = pno->top_k_num_of_channels;
|
||||
channel_prediction_cfg->stationary_threshold = pno->stationary_thresh;
|
||||
channel_prediction_cfg->full_scan_period_ms =
|
||||
pno->channel_prediction_full_scan;
|
||||
buf_ptr += sizeof(nlo_channel_prediction_cfg);
|
||||
WMA_LOGD("enable: %d, top_k_num: %d, stat_thresh: %d, full_scan: %d",
|
||||
channel_prediction_cfg->enable,
|
||||
channel_prediction_cfg->top_k_num,
|
||||
channel_prediction_cfg->stationary_threshold,
|
||||
channel_prediction_cfg->full_scan_period_ms);
|
||||
}
|
||||
/**
|
||||
* wma_pno_start() - PNO start request
|
||||
* @wma: wma handle
|
||||
* @pno: PNO request
|
||||
*
|
||||
* This function request FW to start PNO request.
|
||||
* Request: QDF status
|
||||
*/
|
||||
QDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno)
|
||||
{
|
||||
struct pno_scan_req_params *params;
|
||||
uint32_t i;
|
||||
uint32_t num_channels;
|
||||
uint32_t *channel_list = NULL;
|
||||
QDF_STATUS status;
|
||||
|
||||
WMA_LOGD("PNO Start");
|
||||
|
||||
num_channels = (uint32_t) QDF_MIN(pno->aNetworks[0].ucChannelCount,
|
||||
WMI_NLO_MAX_CHAN);
|
||||
|
||||
if (num_channels) {
|
||||
channel_list = qdf_mem_malloc(sizeof(uint32_t) * num_channels);
|
||||
if (!channel_list)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
for (i = 0; i < num_channels; i++) {
|
||||
channel_list[i] = pno->aNetworks[0].aChannels[i];
|
||||
|
||||
if (channel_list[i] < WMA_NLO_FREQ_THRESH)
|
||||
channel_list[i] =
|
||||
cds_chan_to_freq(channel_list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
params = qdf_mem_malloc(sizeof(struct pno_scan_req_params));
|
||||
if (params == NULL) {
|
||||
WMA_LOGE("%s : Memory allocation failed", __func__);
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto exit_pno_start;
|
||||
}
|
||||
|
||||
params->enable = pno->enable;
|
||||
params->modePNO = (enum pno_mode) pno->modePNO;
|
||||
params->ucNetworksCount = pno->ucNetworksCount;
|
||||
params->sessionId = pno->sessionId;
|
||||
params->fast_scan_period = pno->fast_scan_period;
|
||||
params->slow_scan_period = pno->slow_scan_period;
|
||||
params->fast_scan_max_cycles = pno->fast_scan_max_cycles;
|
||||
params->delay_start_time = pno->delay_start_time;
|
||||
params->active_min_time = pno->active_min_time;
|
||||
params->active_max_time = pno->active_max_time;
|
||||
params->passive_min_time = pno->passive_min_time;
|
||||
params->passive_max_time = pno->passive_max_time;
|
||||
params->pnoscan_adaptive_dwell_mode = pno->pnoscan_adaptive_dwell_mode;
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
params->pno_channel_prediction = pno->pno_channel_prediction;
|
||||
params->top_k_num_of_channels = pno->top_k_num_of_channels;
|
||||
params->stationary_thresh = pno->stationary_thresh;
|
||||
params->channel_prediction_full_scan =
|
||||
pno->channel_prediction_full_scan;
|
||||
#endif
|
||||
for (i = 0; i < WMI_PNO_MAX_SUPP_NETWORKS; i++) {
|
||||
params->aNetworks[i].authentication =
|
||||
pno->aNetworks[i].authentication;
|
||||
params->aNetworks[i].encryption = pno->aNetworks[i].encryption;
|
||||
params->aNetworks[i].bcastNetwType =
|
||||
pno->aNetworks[i].bcastNetwType;
|
||||
params->aNetworks[i].ucChannelCount =
|
||||
pno->aNetworks[i].ucChannelCount;
|
||||
params->aNetworks[i].rssiThreshold =
|
||||
pno->aNetworks[i].rssiThreshold;
|
||||
qdf_mem_copy(params->aNetworks[i].aChannels,
|
||||
pno->aNetworks[i].aChannels,
|
||||
WMI_PNO_MAX_NETW_CHANNELS_EX);
|
||||
params->aNetworks[i].ssid.length =
|
||||
pno->aNetworks[i].ssId.length;
|
||||
qdf_mem_copy(params->aNetworks[i].ssid.mac_ssid,
|
||||
pno->aNetworks[i].ssId.ssId,
|
||||
WMI_MAC_MAX_SSID_LENGTH);
|
||||
}
|
||||
|
||||
status = wmi_unified_pno_start_cmd(wma->wmi_handle,
|
||||
params, channel_list);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
wma->interfaces[pno->sessionId].pno_in_progress = true;
|
||||
WMA_LOGD("PNO start request sent successfully for vdev %d",
|
||||
pno->sessionId);
|
||||
}
|
||||
|
||||
exit_pno_start:
|
||||
if (channel_list)
|
||||
qdf_mem_free(channel_list);
|
||||
if (params)
|
||||
qdf_mem_free(params);
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_pno_stop() - PNO stop request
|
||||
* @wma: wma handle
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* This function request FW to stop ongoing PNO operation.
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS wma_pno_stop(tp_wma_handle wma, uint8_t vdev_id)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
if (!wma->interfaces[vdev_id].pno_in_progress) {
|
||||
WMA_LOGD("No active pno session found for vdev %d, skip pno stop request",
|
||||
vdev_id);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
WMA_LOGD("PNO Stop");
|
||||
|
||||
status = wmi_unified_pno_stop_cmd(wma->wmi_handle, vdev_id);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return status;
|
||||
|
||||
wma->interfaces[vdev_id].pno_in_progress = false;
|
||||
|
||||
WMA_LOGD("PNO stop request sent successfully for vdev %d", vdev_id);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_config_pno() - config PNO
|
||||
* @wma: wma handle
|
||||
* @pno: PNO request parameters
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void wma_config_pno(tp_wma_handle wma, tpSirPNOScanReq pno)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
|
||||
if (pno->enable)
|
||||
ret = wma_pno_start(wma, pno);
|
||||
else
|
||||
ret = wma_pno_stop(wma, pno->sessionId);
|
||||
|
||||
if (ret)
|
||||
WMA_LOGE("%s: PNO %s failed %d", __func__,
|
||||
pno->enable ? "start" : "stop", ret);
|
||||
|
||||
/* SME expects WMA to free tpSirPNOScanReq memory after
|
||||
* processing PNO request. */
|
||||
qdf_mem_free(pno);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
/**
|
||||
* wma_plm_start() - plm start request
|
||||
|
|
@ -3415,172 +3226,6 @@ void wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_WLAN_SCAN_PNO
|
||||
/**
|
||||
* wma_scan_cache_updated_ind() - scan update indication
|
||||
* @wma: wma handle
|
||||
* @sessionId: session ID
|
||||
*
|
||||
* After pushing cached scan results (that are stored in LIM) to SME,
|
||||
* PE will post WMA_SME_SCAN_CACHE_UPDATED message indication to
|
||||
* wma and intern this function handles that message. This function will
|
||||
* check for PNO completion (by checking NLO match event) and post PNO
|
||||
* completion back to SME if PNO operation is completed successfully.
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void wma_scan_cache_updated_ind(tp_wma_handle wma, uint8_t sessionId)
|
||||
{
|
||||
tSirPrefNetworkFoundInd *nw_found_ind;
|
||||
QDF_STATUS status;
|
||||
struct scheduler_msg cds_msg;
|
||||
uint8_t len, i;
|
||||
|
||||
for (i = 0; i < wma->max_bssid; i++) {
|
||||
if (wma->interfaces[i].nlo_match_evt_received)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == wma->max_bssid) {
|
||||
WMA_LOGD("PNO match event is not received in any vdev, skip scan cache update indication");
|
||||
return;
|
||||
}
|
||||
wma->interfaces[i].nlo_match_evt_received = false;
|
||||
|
||||
WMA_LOGD("Posting PNO completion to umac");
|
||||
|
||||
len = sizeof(tSirPrefNetworkFoundInd);
|
||||
nw_found_ind = (tSirPrefNetworkFoundInd *) qdf_mem_malloc(len);
|
||||
|
||||
if (NULL == nw_found_ind) {
|
||||
WMA_LOGE("%s: Memory allocation failure", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
nw_found_ind->mesgType = eWNI_SME_PREF_NETWORK_FOUND_IND;
|
||||
nw_found_ind->mesgLen = len;
|
||||
nw_found_ind->sessionId = sessionId;
|
||||
|
||||
cds_msg.type = eWNI_SME_PREF_NETWORK_FOUND_IND;
|
||||
cds_msg.bodyptr = (void *)nw_found_ind;
|
||||
cds_msg.bodyval = 0;
|
||||
|
||||
status = scheduler_post_msg(QDF_MODULE_ID_SME, &cds_msg);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
WMA_LOGE("%s: Failed to post PNO completion match event to SME",
|
||||
__func__);
|
||||
qdf_mem_free(nw_found_ind);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_nlo_match_evt_handler() - nlo match event handler
|
||||
* @handle: wma handle
|
||||
* @event: event data
|
||||
* @len: data length
|
||||
*
|
||||
* Record NLO match event comes from FW. It's a indication that
|
||||
* one of the profile is matched.
|
||||
*
|
||||
* Return: 0 for success or error code.
|
||||
*/
|
||||
int wma_nlo_match_evt_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
tp_wma_handle wma = (tp_wma_handle) handle;
|
||||
wmi_nlo_event *nlo_event;
|
||||
WMI_NLO_MATCH_EVENTID_param_tlvs *param_buf =
|
||||
(WMI_NLO_MATCH_EVENTID_param_tlvs *) event;
|
||||
struct wma_txrx_node *node;
|
||||
|
||||
if (!param_buf) {
|
||||
WMA_LOGE("Invalid NLO match event buffer");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nlo_event = param_buf->fixed_param;
|
||||
WMA_LOGD("PNO match event received for vdev %d", nlo_event->vdev_id);
|
||||
|
||||
node = &wma->interfaces[nlo_event->vdev_id];
|
||||
if (node)
|
||||
node->nlo_match_evt_received = true;
|
||||
|
||||
cds_host_diag_log_work(&wma->pno_wake_lock,
|
||||
WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT,
|
||||
WIFI_POWER_EVENT_WAKELOCK_PNO);
|
||||
qdf_wake_lock_timeout_acquire(&wma->pno_wake_lock,
|
||||
WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_nlo_scan_cmp_evt_handler() - nlo scan completion handler
|
||||
* @handle: wma handle
|
||||
* @event: event handler
|
||||
* @len: length of data
|
||||
*
|
||||
* This function handles NLO scan completion event.
|
||||
*
|
||||
* Return: 0 for success or error code.
|
||||
*/
|
||||
int wma_nlo_scan_cmp_evt_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
tp_wma_handle wma = (tp_wma_handle) handle;
|
||||
wmi_nlo_event *nlo_event;
|
||||
WMI_NLO_SCAN_COMPLETE_EVENTID_param_tlvs *param_buf =
|
||||
(WMI_NLO_SCAN_COMPLETE_EVENTID_param_tlvs *) event;
|
||||
tSirScanOffloadEvent *scan_event;
|
||||
struct wma_txrx_node *node;
|
||||
|
||||
if (!param_buf) {
|
||||
WMA_LOGE("Invalid NLO scan comp event buffer");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nlo_event = param_buf->fixed_param;
|
||||
WMA_LOGD("PNO scan completion event received for vdev %d",
|
||||
nlo_event->vdev_id);
|
||||
|
||||
node = &wma->interfaces[nlo_event->vdev_id];
|
||||
|
||||
/* Handle scan completion event only after NLO match event. */
|
||||
if (!node || !node->nlo_match_evt_received) {
|
||||
WMA_LOGD("NLO match not received skip PNO complete ind for vdev %d",
|
||||
nlo_event->vdev_id);
|
||||
goto skip_pno_cmp_ind;
|
||||
}
|
||||
|
||||
qdf_wake_lock_release(&wma->pno_wake_lock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_PNO);
|
||||
node->wow_stats.pno_complete++;
|
||||
|
||||
scan_event = (tSirScanOffloadEvent *)
|
||||
qdf_mem_malloc(sizeof(tSirScanOffloadEvent));
|
||||
if (scan_event) {
|
||||
/* Posting scan completion msg would take scan cache result
|
||||
* from LIM module and update in scan cache maintained in SME.*/
|
||||
cds_host_diag_log_work(&wma->pno_wake_lock,
|
||||
WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT,
|
||||
WIFI_POWER_EVENT_WAKELOCK_PNO);
|
||||
qdf_wake_lock_timeout_acquire(&wma->pno_wake_lock,
|
||||
WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT);
|
||||
qdf_mem_zero(scan_event, sizeof(tSirScanOffloadEvent));
|
||||
scan_event->reasonCode = eSIR_PNO_SCAN_SUCCESS;
|
||||
scan_event->event = SIR_SCAN_EVENT_COMPLETED;
|
||||
scan_event->sessionId = nlo_event->vdev_id;
|
||||
wma_send_msg(wma, WMA_RX_SCAN_EVENT, (void *)scan_event, 0);
|
||||
} else {
|
||||
WMA_LOGE("Memory allocation failed for tSirScanOffloadEvent");
|
||||
}
|
||||
|
||||
skip_pno_cmp_ind:
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wma_register_extscan_event_handler() - register extscan event handler
|
||||
* @wma_handle: wma handle
|
||||
|
|
|
|||
Loading…
Reference in a new issue