diff options
| author | hqu <hqu@codeaurora.org> | 2019-08-16 16:31:25 +0800 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2019-08-28 01:59:09 -0700 |
| commit | bbbb924342f933726944ded0458cbb72e09042ae (patch) | |
| tree | 9779d88917b1ee8cb63af2b5b45c3edd032fbab0 | |
| parent | 71b19609f331d2b57abf73844997d89ebe5be4c5 (diff) | |
qcacld-3.0: Follow concurrent SAP switch channel in the same band
When lte channel avoidance event triggered, multiple SAP will choose
safe channel from pcl/acs combination and switch to the safe channel
one by one.
Actually when force SCC mode is enabled, if one SAP is the same band
as other concurrent SAP whose channel is already safe, it doesn't
need to choose safe channel from pcl/acs again, just needs to
follow concurrent SAP channel. Add code to implement this policy.
Change-Id: Icc9b2a53bb56915daeab8d94eceaaa64a660cb65
CRs-Fixed: 2500183
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ab25265eb507..e5a6d939c047 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8229,6 +8229,32 @@ static void hdd_send_svc_coex_info(hdd_context_t *hdd_ctx, } /** + * hdd_store_sap_restart_channel() - store sap restart channel + * @restart_chan: restart channel + * @restart_chan_store: pointer to restart channel store + * + * The function will store new sap restart channel. + * + * Return - none + */ +static void +hdd_store_sap_restart_channel(uint8_t restart_chan, uint8_t *restart_chan_store) +{ + uint8_t i; + + for (i = 0; i < SAP_MAX_NUM_SESSION; i++) { + if (*(restart_chan_store + i) == restart_chan) + return; + + if (*(restart_chan_store + i)) + continue; + + *(restart_chan_store + i) = restart_chan; + return; + } +} + +/** * hdd_unsafe_channel_restart_sap() - restart sap if sap is on unsafe channel * @hdd_ctx: hdd context pointer * @@ -8246,6 +8272,7 @@ void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctxt) uint32_t i; bool found = false; uint8_t restart_chan; + uint8_t restart_chan_store[SAP_MAX_NUM_SESSION] = {0}; status = hdd_get_front_adapter(hdd_ctxt, &adapter_node); while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { @@ -8287,13 +8314,31 @@ void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctxt) } if (!found) { + hdd_store_sap_restart_channel( + adapter_temp->sessionCtx.ap.operatingChannel, + restart_chan_store); hdd_debug("ch:%d is safe. no need to change channel", adapter_temp->sessionCtx.ap.operatingChannel); goto next_adapater; } - restart_chan = - wlansap_get_safe_channel_from_pcl_and_acs_range( + restart_chan = 0; + for (i = 0; i < SAP_MAX_NUM_SESSION; i++) { + if (!restart_chan_store[i]) + continue; + + if (cds_is_force_scc() && + CDS_IS_SAME_BAND_CHANNELS( + restart_chan_store[i], + adapter_temp->sessionCtx.ap. + operatingChannel)) { + restart_chan = restart_chan_store[i]; + break; + } + } + if (!restart_chan) + restart_chan = + wlansap_get_safe_channel_from_pcl_and_acs_range( adapter_temp->sessionCtx.ap.sapContext); if (!restart_chan) { hdd_err("fail to restart SAP"); @@ -8310,8 +8355,12 @@ void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctxt) restart_chan); hdd_debug("driver to start sap: %d", hdd_ctxt->config->sap_internal_restart); - if (hdd_ctxt->config->sap_internal_restart) + if (hdd_ctxt->config->sap_internal_restart) { hdd_restart_sap(adapter_temp, restart_chan); + hdd_store_sap_restart_channel( + restart_chan, + restart_chan_store); + } else return; } |
