diff options
| author | Srinivas Girigowda <sgirigow@qca.qualcomm.com> | 2014-05-28 18:18:10 -0700 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com> | 2014-05-30 19:19:04 +0530 |
| commit | 283df51807db411312571276e6f4bba59bd30196 (patch) | |
| tree | 7df137d149f91f2ffed5a9f4008a1557b982533e | |
| parent | 8ededa478abc216a34b5e5cc12b2c0a772d9adee (diff) | |
wlan: Do not allow beacon report request in disconnected state
Due to race condition, before supplicant receives DISCONNECT
event, it issues beacon request to the driver and session id
is invalid because of which SME queue got stuck and no further
requests are honored.
The fix is to not to allow beacon request to proceed if
device is not associated.
Change-Id: I012d08f6277d3259a5a6aedf64751eed938cf25b
CRs-Fixed: 671614
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_assoc.h | 7 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 45 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 24 |
3 files changed, 54 insertions, 22 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index a1d2bf950378..6bb8ed97419e 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -159,4 +159,11 @@ void hdd_SendPeerStatusIndToOemApp(v_MACADDR_t *peerMac, tANI_U8 sessionId, tANI_U8 chanId); #endif /* QCA_WIFI_2_0 */ +#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) +void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter, + const tANI_U16 measurementToken, + const tANI_BOOLEAN flag, + const tANI_U8 numBss); +#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ + #endif diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 54b48b35040b..8b98c2a6dc85 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -4409,7 +4409,33 @@ void hdd_indicateEseAdjApRepInd(hdd_adapter_t *pAdapter, wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); } -void hdd_indicateEseBcnReportInd(const hdd_adapter_t *pAdapter, +void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter, + const tANI_U16 measurementToken, + const tANI_BOOLEAN flag, + const tANI_U8 numBss) +{ + union iwreq_data wrqu; + char buf[IW_CUSTOM_MAX]; + char *pos = buf; + int nBytes = 0, freeBytes = IW_CUSTOM_MAX; + + memset(&wrqu, '\0', sizeof(wrqu)); + memset(buf, '\0', sizeof(buf)); + + hddLog(VOS_TRACE_LEVEL_INFO, FL("CCXBCNREP=%d %d %d"), measurementToken, flag, + numBss); + + nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d", measurementToken, + flag, numBss); + + wrqu.data.pointer = buf; + wrqu.data.length = nBytes; + // send the event + wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); +} + + +static void hdd_indicateEseBcnReportInd(const hdd_adapter_t *pAdapter, const tCsrRoamInfo *pRoamInfo) { union iwreq_data wrqu; @@ -4441,21 +4467,10 @@ void hdd_indicateEseBcnReportInd(const hdd_adapter_t *pAdapter, hddLog(VOS_TRACE_LEVEL_INFO, "Measurement Done but no scan results"); /* If the measurement is none and no scan results found, indicate the supplicant about measurement done */ - memset(&wrqu, '\0', sizeof(wrqu)); - memset(buf, '\0', sizeof(buf)); - - hddLog(VOS_TRACE_LEVEL_INFO, "CCXBCNREP=%d %d %d %d", - pRoamInfo->pEseBcnReportRsp->measurementToken, pRoamInfo->pEseBcnReportRsp->flag, - pRoamInfo->pEseBcnReportRsp->numBss, tot_bcn_ieLen); - - nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d", - pRoamInfo->pEseBcnReportRsp->measurementToken, pRoamInfo->pEseBcnReportRsp->flag, + hdd_indicateEseBcnReportNoResults(pAdapter, + pRoamInfo->pEseBcnReportRsp->measurementToken, + pRoamInfo->pEseBcnReportRsp->flag, pRoamInfo->pEseBcnReportRsp->numBss); - - wrqu.data.pointer = buf; - wrqu.data.length = nBytes; - // send the event - wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); } else { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 9f28f9d45c34..d374d1aa5db1 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -5170,6 +5170,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, tANI_U8 *value = command; tCsrEseBeaconReq eseBcnReq; eHalStatus status = eHAL_STATUS_SUCCESS; + status = hdd_parse_ese_beacon_req(value, &eseBcnReq); if (eHAL_STATUS_SUCCESS != status) { @@ -5179,19 +5180,28 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, goto exit; } + if (!hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))) { + hddLog(VOS_TRACE_LEVEL_INFO, FL("Not associated")); + hdd_indicateEseBcnReportNoResults (pAdapter, + eseBcnReq.bcnReq[0].measurementToken, + 0x02, //BIT(1) set for measurement done + 0); // no BSS + goto exit; + } + status = sme_SetEseBeaconRequest((tHalHandle)(pHddCtx->hHal), pAdapter->sessionId, &eseBcnReq); if (eHAL_STATUS_SUCCESS != status) - { - VOS_TRACE( VOS_MODULE_ID_HDD, - VOS_TRACE_LEVEL_ERROR, - "%s: sme_SetEseBeaconRequest failed (%d)", + { + VOS_TRACE( VOS_MODULE_ID_HDD, + VOS_TRACE_LEVEL_ERROR, + "%s: sme_SetEseBeaconRequest failed (%d)", __func__, status); - ret = -EINVAL; - goto exit; - } + ret = -EINVAL; + goto exit; + } } #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ else if (strncmp(command, "SETMCRATE", 9) == 0) |
