summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_main.c55
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;
}