diff options
| author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2018-09-12 22:26:42 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-09-12 22:26:42 -0700 |
| commit | 54ec2508a76fd9a201070441a2e2d69ab5e8a4c3 (patch) | |
| tree | 37a256d925922227e8de2fd72c1a40c1d8f30abd | |
| parent | f7cca403083d745af3598a2c568569a9cd74419d (diff) | |
| parent | fec8e2878b09f54e3222f16109f25456a84a6545 (diff) | |
Merge "qcacld-2.0: Free memory when sending 11k empty beacon response" into wlan-cld2.driver.lnx.1.0
| -rw-r--r-- | CORE/SERVICES/WMA/regdomain.c | 40 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/regdomain_common.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/rrm/sme_rrm.c | 10 |
3 files changed, 49 insertions, 2 deletions
diff --git a/CORE/SERVICES/WMA/regdomain.c b/CORE/SERVICES/WMA/regdomain.c index 1c5dcd23ff82..aa86daf086a5 100644 --- a/CORE/SERVICES/WMA/regdomain.c +++ b/CORE/SERVICES/WMA/regdomain.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011,2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011,2013-2014, 2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -707,6 +707,44 @@ u_int16_t regdm_get_opclass_from_channel(u_int8_t *country, u_int8_t channel, } /* + * Get channel list for a given regulatory class + */ +void regdm_get_channel_from_opclass(u_int8_t *country, + u_int8_t op_class) +{ + regdm_op_class_map_t *class = NULL; + u_int16_t i = 0; + + if (0 == adf_os_mem_cmp(country,"US", 2)) { + class = us_op_class; + } else if (0 == adf_os_mem_cmp(country,"EU", 2)) { + class = euro_op_class; + } else if (0 == adf_os_mem_cmp(country,"JP", 2)) { + class = japan_op_class; + } else { + class = global_op_class; + } + + while (class->op_class) { + if (class->op_class == op_class) { + for (i = 0; + (i < MAX_CHANNELS_PER_OPERATING_CLASS && + class->channels[i]); + i++) { + adf_os_print(KERN_ERR + "%s: Valid channel(%d) in requested RC(%d)\n", + __func__, class->channels[i], op_class); + } + break; + } + class++; + } + if (!class->op_class) + adf_os_print(KERN_ERR "%s: Invalid requested RC (%d)\n", + __func__, op_class); +} + +/* * Set current operating classes per country, regdomain */ u_int16_t regdm_set_curr_opclasses(u_int8_t num_classes, u_int8_t *class) diff --git a/CORE/SERVICES/WMA/regdomain_common.h b/CORE/SERVICES/WMA/regdomain_common.h index d743355d6d34..1dddcd6777ff 100644 --- a/CORE/SERVICES/WMA/regdomain_common.h +++ b/CORE/SERVICES/WMA/regdomain_common.h @@ -2003,6 +2003,7 @@ typedef struct _regdm_supp_op_classes { u_int16_t regdm_get_opclass_from_channel(u_int8_t *country, u_int8_t channel, u_int8_t offset); +void regdm_get_channel_from_opclass(u_int8_t *country, u_int8_t op_class); u_int16_t regdm_get_chanwidth_from_opclass(u_int8_t *country, u_int8_t channel, u_int8_t opclass); u_int16_t regdm_set_curr_opclasses(u_int8_t num_classes, u_int8_t *class); diff --git a/CORE/SME/src/rrm/sme_rrm.c b/CORE/SME/src/rrm/sme_rrm.c index 587b0c5954ca..d4b2eaedb6fb 100644 --- a/CORE/SME/src/rrm/sme_rrm.c +++ b/CORE/SME/src/rrm/sme_rrm.c @@ -769,7 +769,12 @@ eHalStatus sme_RrmIssueScanReq( tpAniSirGlobal pMac ) } if ((pSmeRrmContext->currentIndex) >= pSmeRrmContext->channelList.numOfChannels) + { + sme_RrmSendBeaconReportXmitInd(pMac, NULL, true, 0); + vos_mem_free( pSmeRrmContext->channelList.ChannelList ); + smsLog( pMac, LOGE, "%s : done with the complete ch lt. finish and fee now", __func__); return status; + } if( eRRM_MSG_SOURCE_ESE_UPLOAD == pSmeRrmContext->msgSource || eRRM_MSG_SOURCE_LEGACY_ESE == pSmeRrmContext->msgSource ) @@ -903,6 +908,7 @@ eHalStatus sme_RrmIssueScanReq( tpAniSirGlobal pMac ) /* If this is not done, pCurrentReq pointer will not be freed and PE will not handle subsequent Beacon requests */ sme_RrmSendBeaconReportXmitInd(pMac, NULL, true, 0); + vos_mem_free( pSmeRrmContext->channelList.ChannelList ); } return status; @@ -948,7 +954,9 @@ eHalStatus sme_RrmProcessBeaconReportReqInd(tpAniSirGlobal pMac, void *pMsgBuf) smsLog( pMac, LOGE, FL("Allocated memory for ChannelList") ); #endif csrGetCfgValidChannels( pMac, pSmeRrmContext->channelList.ChannelList, &len ); - + /* Listing all the channels in the requested RC */ + regdm_get_channel_from_opclass(pMac->scan.countryCodeCurrent, + pBeaconReq->channelInfo.regulatoryClass); for (i = 0 ; i <len; i++) { if (regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, |
