diff options
| author | Leo Chang <schang@qca.qualcomm.com> | 2014-09-15 17:59:08 -0700 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-09-19 21:29:31 +0530 |
| commit | 646909aa6bb8edefb25f11e61ef51e5c9a1e2a0b (patch) | |
| tree | 0a5e12c11c1c0a5cc932ff9bfbab6928ce9aab56 | |
| parent | 782015d95411543ea119dfd238d9b290c45a19b5 (diff) | |
qca-cld: sap restart with lte coex issue fix
If softap preferred channel is subset of unsafe channel,
softap interface should keep preferred channel.
When channel avoid indication arrive to host driver,
host driver should check preferred channel list and if preferred
channel list is subset of unsafe channel, softap should not restart.
This will prevent softap keep restarting problem when firmware
keep sending channel avoid indication over and over again.
Change-Id: I663f69e4fd328e1edcd06b649c655760cc1fe403
CRs-fixed: 724706
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 41a60f810732..6bdaf8466d5e 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -13323,6 +13323,65 @@ v_U16_t hdd_freq_to_chn /**--------------------------------------------------------------------------- + \brief hdd_find_prefd_safe_chnl() - + + Try to find safe channel within preferred channel + In case auto channel selection enabled + - Preferred and safe channel should be used + - If no overlapping, preferred channel should be used + + \param - hdd_ctxt hdd context pointer + + \return - 1: found preferred safe channel + 0: could not found preferred safe channel + + --------------------------------------------------------------------------*/ +static v_U8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt) +{ + v_U16_t safe_channels[NUM_20MHZ_RF_CHANNELS]; + v_U16_t safe_channel_count; + v_U8_t is_unsafe = 1; + v_U16_t i; + v_U16_t channel_loop; + + safe_channel_count = 0; + for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + is_unsafe = 0; + for (channel_loop = 0; + channel_loop < hdd_ctxt->unsafe_channel_count; + channel_loop++) { + if (rfChannels[i].channelNum == + hdd_ctxt->unsafe_channel_list[channel_loop]) { + is_unsafe = 1; + break; + } + } + if (!is_unsafe) { + safe_channels[safe_channel_count] = rfChannels[i].channelNum; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "safe channel %d", safe_channels[safe_channel_count]); + safe_channel_count++; + } + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "perferred range %d - %d", + hdd_ctxt->cfg_ini->apStartChannelNum, + hdd_ctxt->cfg_ini->apEndChannelNum); + for (i = 0; i < safe_channel_count; i++) { + if ((safe_channels[i] >= hdd_ctxt->cfg_ini->apStartChannelNum) && + (safe_channels[i] <= hdd_ctxt->cfg_ini->apEndChannelNum)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "safe channel %d is in perferred range", safe_channels[i]); + return 1; + } + } + + return 0; +} + +/**--------------------------------------------------------------------------- + \brief hdd_ch_avoid_cb() - Avoid channel notification from FW handler. @@ -13459,6 +13518,17 @@ void hdd_ch_avoid_cb } #endif + /* If auto channel select is enabled + * preferred channel is in safe channel, + * re-start softap interface with safe channel. + * no overlap with preferred channel and safe channel + * do not re-start softap interface + * stay current operating channel. */ + if ((hdd_ctxt->cfg_ini->apAutoChannelSelection) && + (!hdd_find_prefd_safe_chnl(hdd_ctxt))) { + return; + } + if (hdd_ctxt->unsafe_channel_count) { hostapd_adapter = hdd_get_adapter(hdd_ctxt, WLAN_HDD_SOFTAP); if (hostapd_adapter) |
