qcacld-3.0: Update RRM scan results to user space

qcacld-2.0 to qcacld-3.0 propagation

Currently RRM scan results are sent out to the requesting AP, but
are not updated to the kernel.

Update the results to the kernel so that it will be useful in future
in the userspace if a BTM request is received and the lookup of
scan cache can fetch a result for the target AP and an additional
scan can be avoided.

Git-commit: 3075ac910c015ce525bf8badd1eb4a277286b28f
Change-Id: Ie56b86e5c54910648cb2ae8bf2a7dac2ee873e00
CRs-Fixed: 1010596
This commit is contained in:
Selvaraj, Sridhar 2016-08-03 21:34:51 +05:30 • committed by Gerrit - the friendly Code Review server
commit fe696d2bac
5 changed files with 39 additions and 4 deletions

View file

@ -4605,6 +4605,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
QDF_STATUS status = QDF_STATUS_SUCCESS;
hdd_context_t *pHddCtx = NULL;
struct hdd_chan_change_params chan_change;
struct cfg80211_bss *bss_status;
hddLog(LOG2,
"CSR Callback: status= %d result= %d roamID=%d",
@ -4966,6 +4967,20 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
if (QDF_IS_STATUS_ERROR(status))
hdd_info("set hw mode change not done");
break;
case eCSR_ROAM_UPDATE_SCAN_RESULT:
if ((NULL != pRoamInfo) && (NULL != pRoamInfo->pBssDesc)) {
bss_status = wlan_hdd_cfg80211_inform_bss_frame(
pAdapter, pRoamInfo->pBssDesc);
if (NULL == bss_status)
hdd_info("UPDATE_SCAN_RESULT returned NULL");
else
cfg80211_put_bss(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) || defined(WITH_BACKPORTS)
(WLAN_HDD_GET_CTX(pAdapter))->wiphy,
#endif
bss_status);
}
break;
case eCSR_ROAM_NDP_STATUS_UPDATE:
hdd_ndp_event_handler(pAdapter, pRoamInfo, roamId, roamStatus,
roamResult);

View file

@ -9612,9 +9612,8 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
*
* Return: struct cfg80211_bss pointer
*/
static struct cfg80211_bss *
wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
tSirBssDescription *bss_desc)
struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
tSirBssDescription *bss_desc)
{
/*
* cfg80211_inform_bss() is not updating ie field of bss entry, if entry

View file

@ -2900,4 +2900,6 @@ static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev,
GFP_KERNEL);
}
#endif
struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
tSirBssDescription *bss_desc);
#endif

View file

@ -512,6 +512,7 @@ typedef enum {
eCSR_ROAM_ENABLE_QUEUES,
eCSR_ROAM_STA_CHANNEL_SWITCH,
eCSR_ROAM_NDP_STATUS_UPDATE,
eCSR_ROAM_UPDATE_SCAN_RESULT,
} eRoamCmdStatus;
/* comment inside indicates what roaming callback gets */

View file

@ -429,6 +429,7 @@ static QDF_STATUS sme_rrm_send_scan_result(tpAniSirGlobal mac_ctx,
uint8_t counter = 0;
tpRrmSMEContext rrm_ctx = &mac_ctx->rrm.rrmSmeContext;
uint32_t session_id;
tCsrRoamInfo *roam_info;
qdf_mem_zero(&filter, sizeof(filter));
qdf_mem_zero(scanresults_arr,
@ -519,16 +520,31 @@ static QDF_STATUS sme_rrm_send_scan_result(tpAniSirGlobal mac_ctx,
NULL, measurementdone, 0);
}
counter = 0;
roam_info = qdf_mem_malloc(sizeof(*roam_info));
if (NULL == roam_info) {
sms_log(mac_ctx, LOGP, FL("vos_mem_malloc failed"));
status = QDF_STATUS_E_NOMEM;
goto rrm_send_scan_results_done;
}
while (scan_results) {
next_result = sme_scan_result_get_next(mac_ctx, result_handle);
sms_log(mac_ctx, LOG1, "Scan res timer:%lu, rrm scan timer:%lu",
scan_results->timer, rrm_scan_timer);
if (scan_results->timer >= rrm_scan_timer)
if (scan_results->timer >= rrm_scan_timer) {
qdf_mem_zero(roam_info, sizeof(*roam_info));
roam_info->pBssDesc = &scan_results->BssDescriptor;
csr_roam_call_callback(mac_ctx, session_id, roam_info,
0, eCSR_ROAM_UPDATE_SCAN_RESULT,
eCSR_ROAM_RESULT_NONE);
scanresults_arr[counter++] = scan_results;
}
scan_results = next_result;
if (counter >= SIR_BCN_REPORT_MAX_BSS_DESC)
break;
}
qdf_mem_free(roam_info);
/*
* The beacon report should be sent whether the counter is zero or
* non-zero. There might be a few scan results in the cache but not
@ -554,6 +570,8 @@ static QDF_STATUS sme_rrm_send_scan_result(tpAniSirGlobal mac_ctx,
scanresults_arr, measurementdone,
counter);
}
rrm_send_scan_results_done:
sme_scan_result_purge(mac_ctx, result_handle);
return status;
}