summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cds/inc/cds_concurrency.h26
-rw-r--r--core/cds/inc/cds_sched.h1
-rw-r--r--core/cds/src/cds_concurrency.c408
-rw-r--r--core/hdd/inc/wlan_hdd_main.h3
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c13
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c23
-rw-r--r--core/mac/inc/sir_api.h12
-rw-r--r--core/mac/src/include/sir_params.h2
-rw-r--r--core/mac/src/pe/include/lim_session.h1
-rw-r--r--core/mac/src/pe/lim/lim_process_message_queue.c159
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c1
-rw-r--r--core/sap/src/sap_api_link_cntl.c146
-rw-r--r--core/sme/inc/csr_api.h3
-rw-r--r--core/sme/inc/sme_internal.h1
-rw-r--r--core/sme/src/common/sme_api.c30
-rw-r--r--core/sme/src/csr/csr_api_roam.c7
-rw-r--r--core/wma/src/wma_dev_if.c11
-rw-r--r--core/wma/src/wma_mgmt.c1
18 files changed, 298 insertions, 550 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h
index 3dd9786e706a..fd44258ef48f 100644
--- a/core/cds/inc/cds_concurrency.h
+++ b/core/cds/inc/cds_concurrency.h
@@ -172,6 +172,18 @@ enum cds_con_mode {
};
/**
+ * enum cds_mac_use - MACs that are used
+ * @CDS_MAC0: Only MAC0 is used
+ * @CDS_MAC1: Only MAC1 is used
+ * @CDS_MAC0_AND_MAC1: Both MAC0 and MAC1 are used
+ */
+enum cds_mac_use {
+ CDS_MAC0 = 1,
+ CDS_MAC1 = 2,
+ CDS_MAC0_AND_MAC1 = 3
+};
+
+/**
* enum cds_pcl_type - Various types of Preferred channel list (PCL).
*
* @CDS_NONE: No channel preference
@@ -481,8 +493,8 @@ enum cds_two_connection_mode {
* @CDS_NOP: No action
* @CDS_DBS: switch to DBS mode
* @CDS_DBS_DOWNGRADE: switch to DBS mode & downgrade to 1x1
- * @CDS_MCC: switch to MCC/SCC mode
- * @CDS_MCC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2
+ * @CDS_SINGLE_MAC: switch to MCC/SCC mode
+ * @CDS_SINGLE_MAC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2
* @CDS_MAX_CONC_PRIORITY_MODE: Max place holder
*
* These are generic IDs that identify the various roles
@@ -492,8 +504,8 @@ enum cds_conc_next_action {
CDS_NOP = 0,
CDS_DBS,
CDS_DBS_DOWNGRADE,
- CDS_MCC,
- CDS_MCC_UPGRADE,
+ CDS_SINGLE_MAC,
+ CDS_SINGLE_MAC_UPGRADE,
CDS_MAX_CONC_NEXT_ACTION
};
@@ -540,8 +552,6 @@ struct cds_conc_connection_info {
bool in_use;
};
-enum cds_conc_next_action cds_get_pref_hw_mode_for_chan(uint32_t vdev_id,
- uint32_t target_channel);
bool cds_is_connection_in_progress(void);
void cds_dump_concurrency_info(void);
void cds_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode);
@@ -746,4 +756,8 @@ QDF_STATUS cds_get_pcl_for_existing_conn(enum cds_con_mode mode,
uint8_t *pcl_ch, uint32_t *len,
uint8_t *weight_list, uint32_t weight_len);
QDF_STATUS cds_get_valid_chan_weights(struct sir_pcl_chan_weights *weight);
+QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id);
+void cds_set_do_hw_mode_change_flag(bool flag);
+bool cds_is_hw_mode_change_after_vdev_up(void);
+void cds_dump_connection_status_info(void);
#endif /* __CDS_CONCURRENCY_H */
diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h
index 46908e6701f6..4a26355e580b 100644
--- a/core/cds/inc/cds_sched.h
+++ b/core/cds/inc/cds_sched.h
@@ -291,6 +291,7 @@ typedef struct _cds_context_type {
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t);
#endif
+ bool do_hw_mode_change;
} cds_context_type, *p_cds_contextType;
/*---------------------------------------------------------------------------
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index b90592766319..478a27f19083 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -2085,6 +2085,8 @@ static void cds_update_conc_list(uint32_t conn_index,
conc_connection_list[conn_index].original_nss = original_nss;
conc_connection_list[conn_index].vdev_id = vdev_id;
conc_connection_list[conn_index].in_use = in_use;
+
+ cds_dump_connection_status_info();
}
/**
@@ -2239,6 +2241,7 @@ static void cds_update_hw_mode_conn_info(uint32_t num_vdev_mac_entries,
conc_connection_list[conn_index].rx_spatial_stream);
}
}
+ cds_dump_connection_status_info();
qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
}
@@ -3588,7 +3591,7 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
return upgrade;
}
- /* Are both mac's still in use*/
+ /* Are both mac's still in use */
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
cds_debug("index:%d mac:%d in_use:%d chan:%d org_nss:%d",
@@ -3599,13 +3602,13 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
conc_connection_list[conn_index].original_nss);
if ((conc_connection_list[conn_index].mac == 0) &&
conc_connection_list[conn_index].in_use) {
- mac |= 1;
- if (3 == mac)
+ mac |= CDS_MAC0;
+ if (CDS_MAC0_AND_MAC1 == mac)
goto done;
} else if ((conc_connection_list[conn_index].mac == 1) &&
conc_connection_list[conn_index].in_use) {
- mac |= 2;
- if (3 == mac)
+ mac |= CDS_MAC1;
+ if (CDS_MAC0_AND_MAC1 == mac)
goto done;
}
}
@@ -3618,13 +3621,13 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
}
#endif
/* Let's request for single MAC mode */
- upgrade = CDS_MCC;
+ upgrade = CDS_SINGLE_MAC;
/* Is there any connection had an initial connection with 2x2 */
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if ((conc_connection_list[conn_index].original_nss == 1) &&
conc_connection_list[conn_index].in_use) {
- upgrade = CDS_MCC_UPGRADE;
+ upgrade = CDS_SINGLE_MAC_UPGRADE;
goto done;
}
}
@@ -3955,6 +3958,8 @@ QDF_STATUS cds_init_policy_mgr(void)
return status;
}
+ cds_ctx->do_hw_mode_change = false;
+
return QDF_STATUS_SUCCESS;
}
@@ -5976,7 +5981,7 @@ bool cds_wait_for_nss_update(uint8_t action)
break;
}
}
- } else if (CDS_MCC == action) {
+ } else if (CDS_SINGLE_MAC == action) {
for (conn_index = 0;
conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
@@ -6046,7 +6051,7 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id,
conc_connection_list[conn_index].rx_spatial_stream = 1;
wait = cds_wait_for_nss_update(next_action);
break;
- case CDS_MCC:
+ case CDS_SINGLE_MAC:
conc_connection_list[conn_index].tx_spatial_stream = 2;
conc_connection_list[conn_index].rx_spatial_stream = 2;
wait = cds_wait_for_nss_update(next_action);
@@ -6196,8 +6201,8 @@ QDF_STATUS cds_next_actions(uint32_t session_id,
*/
if ((((CDS_DBS_DOWNGRADE == action) || (CDS_DBS == action))
&& hw_mode.dbs_cap) ||
- (((CDS_MCC_UPGRADE == action) || (CDS_MCC == action))
- && !hw_mode.dbs_cap)) {
+ (((CDS_SINGLE_MAC_UPGRADE == action) ||
+ (CDS_SINGLE_MAC == action)) && !hw_mode.dbs_cap)) {
cds_err("driver is already in %s mode, no further action needed",
(hw_mode.dbs_cap) ? "dbs" : "non dbs");
return QDF_STATUS_E_ALREADY;
@@ -6222,16 +6227,16 @@ QDF_STATUS cds_next_actions(uint32_t session_id,
HW_MODE_AGILE_DFS_NONE,
reason);
break;
- case CDS_MCC_UPGRADE:
+ case CDS_SINGLE_MAC_UPGRADE:
/*
* check if we have a beaconing entity that advertised 2x2
* intially. If yes, update the beacon template & notify FW.
* Once FW confirms beacon updated, send the HW mode change req
*/
- status = cds_complete_action(CDS_RX_NSS_2, CDS_MCC, reason,
- session_id);
+ status = cds_complete_action(CDS_RX_NSS_2, CDS_SINGLE_MAC,
+ reason, session_id);
break;
- case CDS_MCC:
+ case CDS_SINGLE_MAC:
status = cds_pdev_set_hw_mode(session_id,
HW_MODE_SS_2x2,
HW_MODE_80_MHZ,
@@ -8073,22 +8078,19 @@ QDF_STATUS qdf_init_connection_update(void)
}
/**
- * cds_get_pref_hw_mode_for_chan() - Get preferred hw mode for new channel
- * @vdev_id: vdev id whose target channel needs to change
- * @target_channel: Target channel
+ * cds_get_current_pref_hw_mode() - Get the current preferred hw mode
*
- * Get the preferred hw mode based on the vdev whose channel is going to change
+ * Get the preferred hw mode based on the current connection combinations
*
- * Return: No change (CDS_NOP), MCC (CDS_MCC_UPGRADE), DBS (CDS_DBS_DOWNGRADE)
+ * Return: No change (CDS_NOP), MCC (CDS_SINGLE_MAC_UPGRADE),
+ * DBS (CDS_DBS_DOWNGRADE)
*/
-enum cds_conc_next_action cds_get_pref_hw_mode_for_chan(uint32_t vdev_id,
- uint32_t target_channel)
+enum cds_conc_next_action cds_get_current_pref_hw_mode(void)
{
uint32_t num_connections;
- uint32_t conn_index = 0;
- bool found = false;
- uint8_t old_band, new_band;
-#ifdef QCA_WIFI_3_0_EMU
+ uint8_t band1, band2, band3;
+ struct sir_hw_mode_params hw_mode;
+ QDF_STATUS status;
hdd_context_t *hdd_ctx;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
@@ -8096,40 +8098,22 @@ enum cds_conc_next_action cds_get_pref_hw_mode_for_chan(uint32_t vdev_id,
cds_err("HDD context is NULL");
return CDS_NOP;
}
-#endif
- while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
- if ((vdev_id == conc_connection_list[conn_index].vdev_id) &&
- (conc_connection_list[conn_index].in_use == true)) {
- found = true;
- break;
- }
- conn_index++;
- }
-
- if (!found) {
- cds_err("vdev_id:%d not available in the conn info", vdev_id);
+ status = wma_get_current_hw_mode(&hw_mode);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ cds_err("wma_get_current_hw_mode failed");
return CDS_NOP;
}
- old_band = cds_chan_to_band(conc_connection_list[conn_index].chan);
- new_band = cds_chan_to_band(target_channel);
-
num_connections = cds_get_connection_count();
- cds_debug("vdev_id:%d conn_index:%d target_channel:%d chan[0]:%d chan[1]:%d chan[2]:%d num_connections:%d",
- vdev_id, conn_index, target_channel,
+ cds_debug("chan[0]:%d chan[1]:%d chan[2]:%d num_connections:%d dbs:%d",
conc_connection_list[0].chan, conc_connection_list[1].chan,
- conc_connection_list[2].chan,
- num_connections);
+ conc_connection_list[2].chan, num_connections, hw_mode.dbs_cap);
- /* If the band of the new channel to which the switching is done is same
- * as the band of the old channel, then there is no need for a hw mode
- * change. The driver would already be in the required hw mode.
+ /* If the band of operation of both the MACs is the same,
+ * single MAC is preferred, otherwise DBS is preferred.
*/
- if (old_band == new_band)
- return CDS_NOP;
-
switch (num_connections) {
case 1:
#ifdef QCA_WIFI_3_0_EMU
@@ -8137,69 +8121,33 @@ enum cds_conc_next_action cds_get_pref_hw_mode_for_chan(uint32_t vdev_id,
* request DBS
*/
if (hdd_ctx->config->enable_m2m_limitation &&
- CDS_IS_CHANNEL_24GHZ(target_channel))
+ CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan))
return CDS_DBS_DOWNGRADE;
#endif
/* The driver would already be in the required hw mode */
return CDS_NOP;
case 2:
- /* If the band of the new channel, is same as that of the band
- * of the channel on the other interface, the driver needs to
- * move to single MAC.
- *
- * If the band of the new channel, is different than that of the
- * band of the channel on the other interface, the driver needs
- * to move to DBS.
- */
- if (conn_index == 0) {
- if (new_band == cds_chan_to_band(
- conc_connection_list[1].chan))
- return CDS_MCC_UPGRADE;
- else if (new_band != cds_chan_to_band(
- conc_connection_list[1].chan))
- return CDS_DBS_DOWNGRADE;
- } else {
- if (new_band == cds_chan_to_band(
- conc_connection_list[0].chan))
- return CDS_MCC_UPGRADE;
- else if (new_band != cds_chan_to_band(
- conc_connection_list[0].chan))
- return CDS_DBS_DOWNGRADE;
- }
+ band1 = cds_chan_to_band(conc_connection_list[0].chan);
+ band2 = cds_chan_to_band(conc_connection_list[1].chan);
+ if ((band1 == band2) && (hw_mode.dbs_cap))
+ return CDS_SINGLE_MAC_UPGRADE;
+ else if ((band1 != band2) && (!hw_mode.dbs_cap))
+ return CDS_DBS_DOWNGRADE;
+ else
+ return CDS_NOP;
+
case 3:
- /* If the band of the new channel, is same as that of the band
- * of the channel on the other two interfaces, the driver needs
- * to move to single MAC.
- *
- * If the band of the new channel, is different than that of the
- * band of the channel on the other two interfaces, the driver
- * needs to move to DBS.
- */
- if (conn_index == 0) {
- if ((new_band == cds_chan_to_band(
- conc_connection_list[1].chan)) &&
- (new_band == cds_chan_to_band(
- conc_connection_list[2].chan)))
- return CDS_MCC_UPGRADE;
- else
- return CDS_DBS_DOWNGRADE;
- } else if (conn_index == 1) {
- if ((new_band == cds_chan_to_band(
- conc_connection_list[0].chan)) &&
- (new_band == cds_chan_to_band(
- conc_connection_list[2].chan)))
- return CDS_MCC_UPGRADE;
- else
- return CDS_DBS_DOWNGRADE;
- } else {
- if ((new_band == cds_chan_to_band(
- conc_connection_list[0].chan)) &&
- (new_band == cds_chan_to_band(
- conc_connection_list[1].chan)))
- return CDS_MCC_UPGRADE;
- else
- return CDS_DBS_DOWNGRADE;
- }
+ band1 = cds_chan_to_band(conc_connection_list[0].chan);
+ band2 = cds_chan_to_band(conc_connection_list[1].chan);
+ band3 = cds_chan_to_band(conc_connection_list[2].chan);
+ if (((band1 == band2) && (band2 == band3)) &&
+ (hw_mode.dbs_cap))
+ return CDS_SINGLE_MAC_UPGRADE;
+ else if (((band1 != band2) || (band2 != band3) ||
+ (band1 != band3)) && (!hw_mode.dbs_cap))
+ return CDS_DBS_DOWNGRADE;
+ else
+ return CDS_NOP;
default:
cds_err("unexpected num_connections value %d",
num_connections);
@@ -8239,87 +8187,6 @@ QDF_STATUS cds_stop_start_opportunistic_timer(void)
return status;
}
-/**
- * cds_handle_hw_mode_change_on_csa() - handle hw mode change for csa
- * @session_id: SME session id
- * @channel: given channel
- * @bssid: pointer to bssid
- * @dst: pointer to dest buffer
- * @src: pointer to src buffer
- * @numbytes: number of bytes to copy from src to dst
- *
- * Use this function to decide whether the hw mode upgrage or downgrade
- * is required based on session_id and given channel
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS cds_handle_hw_mode_change_on_csa(uint16_t session_id,
- uint8_t channel, uint8_t *bssid, void *dst, void *src,
- uint32_t numbytes)
-{
- enum cds_conc_next_action action;
- QDF_STATUS status;
-
- /*
- * Since all the write to the policy manager table happens in the
- * MC thread context and this channel change event is also processed
- * in the MC thread context, explicit lock/unlock of qdf_conc_list_lock
- * is not done here
- */
- action = cds_get_pref_hw_mode_for_chan(session_id, channel);
-
- if (action == CDS_NOP) {
- cds_info("no need for hw mode change");
- /* Proceed with processing csa params. So, not freeing it */
- return QDF_STATUS_SUCCESS;
- }
- cds_info("session:%d action:%d", session_id, action);
-
- /*
- * 1. Start opportunistic timer
- * 2. Do vdev restart on the new channel (by the caller)
- * 3. PM will check if MCC upgrade can be done after timer expiry
- */
- if (action == CDS_MCC_UPGRADE) {
- status = cds_stop_start_opportunistic_timer();
- if (QDF_IS_STATUS_SUCCESS(status))
- cds_info("opportunistic timer for MCC upgrade");
-
- /*
- * After opportunistic timer is triggered, we can go ahead
- * with processing the csa params. So, not freeing the memory
- * through 'err' label.
- */
- return QDF_STATUS_SUCCESS;
- }
-
- /*
- * CDS_DBS_DOWNGRADE:
- * 1. PM will initiate HW mode change to DBS rightaway
- * 2. Do vdev restart on the new channel (on getting hw mode resp)
- */
- status = cds_next_actions(session_id, action,
- SIR_UPDATE_REASON_CHANNEL_SWITCH_STA);
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- cds_err("no set hw mode command was issued");
- /* Proceed with processing csa params. So, not freeing it */
- return QDF_STATUS_SUCCESS;
- } else {
- if ((NULL == dst) || (NULL == src)) {
- cds_err("given buffers are null, can't copy csa param");
- return QDF_STATUS_E_FAILURE;
- }
- /* Save the csa params to be used after DBS downgrade */
- qdf_mem_copy(dst, src, numbytes);
- cds_info("saved csa params for dbs downgrade for bssid %pM",
- bssid);
-
- /* Returning error so that csa params are not processed here */
- status = QDF_STATUS_E_FAILURE;
- }
- return status;
-}
-
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/**
* cds_register_sap_restart_channel_switch_cb() - Register callback for SAP
@@ -8500,3 +8367,166 @@ QDF_STATUS cds_get_valid_chan_weights(struct sir_pcl_chan_weights *weight)
return QDF_STATUS_SUCCESS;
}
+
+/**
+ * cds_set_hw_mode_on_channel_switch() - Set hw mode after channel switch
+ * @session_id: Session ID
+ *
+ * Sets hw mode after doing a channel switch
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id)
+{
+ QDF_STATUS status = QDF_STATUS_E_FAILURE, qdf_status;
+ cds_context_type *cds_ctx;
+ enum cds_conc_next_action action;
+ hdd_context_t *hdd_ctx;
+
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+ if (!hdd_ctx) {
+ cds_err("HDD context is NULL");
+ return status;
+ }
+
+ if (!(hdd_ctx->config->policy_manager_enabled &&
+ wma_is_hw_dbs_capable())) {
+ cds_err("PM/DBS is disabled");
+ return status;
+ }
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+ if (!cds_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+ FL("Invalid CDS Context"));
+ return status;
+ }
+
+ qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+
+ action = cds_get_current_pref_hw_mode();
+
+ if ((action != CDS_DBS_DOWNGRADE) &&
+ (action != CDS_SINGLE_MAC_UPGRADE)) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+ FL("Invalid action: %d"), action);
+ status = QDF_STATUS_SUCCESS;
+ goto done;
+ }
+
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
+ FL("action:%d session id:%d"),
+ action, session_id);
+
+ /* Opportunistic timer is started, PM will check if MCC upgrade can be
+ * done on timer expiry. This avoids any possible ping pong effect
+ * as well.
+ */
+ if (action == CDS_SINGLE_MAC_UPGRADE) {
+ qdf_status = cds_stop_start_opportunistic_timer();
+ if (QDF_IS_STATUS_SUCCESS(qdf_status))
+ cds_info("opportunistic timer for MCC upgrade");
+ goto done;
+ }
+
+ /* For DBS, we want to move right away to DBS mode */
+ status = cds_next_actions(session_id, action,
+ SIR_UPDATE_REASON_CHANNEL_SWITCH);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+ FL("no set hw mode command was issued"));
+ goto done;
+ }
+done:
+ qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
+ /* success must be returned only when a set hw mode was done */
+ return status;
+}
+
+/**
+ * cds_dump_connection_status_info() - Dump the concurrency information
+ *
+ * Prints the concurrency information such as tx/rx spatial stream, chainmask,
+ * etc.
+ *
+ * Return: None
+ */
+void cds_dump_connection_status_info(void)
+{
+ cds_context_type *cds_ctx;
+ uint32_t i;
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return;
+ }
+
+ for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) {
+ cds_debug("%d: use:%d vdev:%d tx:%d rx:%d mode:%d mac:%d chan:%d chainmask:%d orig nss:%d bw:%d",
+ i, conc_connection_list[i].in_use,
+ conc_connection_list[i].vdev_id,
+ conc_connection_list[i].tx_spatial_stream,
+ conc_connection_list[i].rx_spatial_stream,
+ conc_connection_list[i].mode,
+ conc_connection_list[i].mac,
+ conc_connection_list[i].chan,
+ conc_connection_list[i].chain_mask,
+ conc_connection_list[i].original_nss,
+ conc_connection_list[i].bw);
+ }
+}
+
+/**
+ * cds_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change
+ * @flag: Indicate if hw mode change is required or not
+ *
+ * Set the flag to indicate whether a hw mode change is required after a
+ * vdev up or not. Flag value of true indicates that a hw mode change is
+ * required after vdev up.
+ *
+ * Return: None
+ */
+void cds_set_do_hw_mode_change_flag(bool flag)
+{
+ cds_context_type *cds_ctx;
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return;
+ }
+
+ qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+ cds_ctx->do_hw_mode_change = flag;
+ qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
+
+ cds_debug("hw_mode_change_channel:%d", flag);
+}
+
+/**
+ * cds_is_hw_mode_change_after_vdev_up() - Check if hw mode change is needed
+ *
+ * Returns the flag which indicates if a hw mode change is required after
+ * vdev up.
+ *
+ * Return: True if hw mode change is required, false otherwise
+ */
+bool cds_is_hw_mode_change_after_vdev_up(void)
+{
+ cds_context_type *cds_ctx;
+ bool flag;
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return INVALID_CHANNEL_ID;
+ }
+
+ qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+ flag = cds_ctx->do_hw_mode_change;
+ qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
+
+ return flag;
+}
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index ab3873a552de..31cb452da246 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1597,6 +1597,9 @@ uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
uint8_t bw_offset);
void hdd_update_config(hdd_context_t *hdd_ctx);
+QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter,
+ struct net_device *dev, uint8_t oper_chan);
+
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void);
#else
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index 67066ebc1733..ac874632c7bd 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -4296,6 +4296,19 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
break;
}
#endif /* FEATURE_WLAN_ESE */
+ case eCSR_ROAM_STA_CHANNEL_SWITCH:
+ hdd_info("channel switch for session:%d to channel:%d",
+ pAdapter->sessionId, pRoamInfo->chan_info.chan_id);
+
+ status = hdd_chan_change_notify(pAdapter, pAdapter->dev,
+ pRoamInfo->chan_info.chan_id);
+ if (QDF_IS_STATUS_ERROR(status))
+ hdd_err("channel change notification failed");
+
+ status = cds_set_hw_mode_on_channel_switch(pAdapter->sessionId);
+ if (QDF_IS_STATUS_ERROR(status))
+ hdd_info("set hw mode change not done");
+ break;
default:
break;
}
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index ab894f63ab1b..7ed1ebad7315 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -706,7 +706,7 @@ hdd_update_chandef(hdd_adapter_t *hostapd_adapter,
* Return: Success on intimating userspace
*
*/
-QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
+QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter,
struct net_device *dev,
uint8_t oper_chan)
{
@@ -716,7 +716,7 @@ QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
eCsrPhyMode phy_mode;
ePhyChanBondState cb_mode;
uint32_t freq;
- tHalHandle hal = WLAN_HDD_GET_HAL_CTX(hostapd_adapter);
+ tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
if (NULL == hal) {
hdd_err("hal is NULL");
@@ -725,14 +725,18 @@ QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
freq = cds_chan_to_freq(oper_chan);
- chan = __ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
+ chan = __ieee80211_get_channel(adapter->wdev.wiphy, freq);
if (!chan) {
hdd_err("Invalid input frequency for channel conversion");
return QDF_STATUS_E_FAILURE;
}
- phy_mode = hdd_sap_get_phymode(hostapd_adapter);
+ if (adapter->device_mode == QDF_SAP_MODE ||
+ adapter->device_mode == QDF_P2P_GO_MODE)
+ phy_mode = hdd_sap_get_phymode(adapter);
+ else
+ phy_mode = sme_get_phy_mode(hal);
if (oper_chan <= 14)
cb_mode = sme_get_cb_phy_state_from_cb_ini_value(
@@ -767,7 +771,7 @@ QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
if ((phy_mode == eCSR_DOT11_MODE_11ac) ||
(phy_mode == eCSR_DOT11_MODE_11ac_ONLY))
- hdd_update_chandef(hostapd_adapter, &chandef, cb_mode);
+ hdd_update_chandef(adapter, &chandef, cb_mode);
cfg80211_ch_switch_notify(dev, &chandef);
@@ -1099,6 +1103,15 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
cds_dump_concurrency_info();
/* Send SCC/MCC Switching event to IPA */
hdd_ipa_send_mcc_scc_msg(pHddCtx, pHddCtx->mcc_mode);
+
+ if (cds_is_hw_mode_change_after_vdev_up()) {
+ hdd_info("check for possible hw mode change");
+ status = cds_set_hw_mode_on_channel_switch(
+ pHostapdAdapter->sessionId);
+ if (QDF_IS_STATUS_ERROR(status))
+ hdd_info("set hw mode change not done");
+ cds_set_do_hw_mode_change_flag(false);
+ }
break; /* Event will be sent after Switch-Case stmt */
case eSAP_STOP_BSS_EVENT:
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 0ffc244385c7..bc35820e756e 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -5630,18 +5630,6 @@ struct csa_offload_params {
};
/**
- * struct sir_saved_csa_params - saved csa offload params
- * @message_type: Message type
- * @length: Message length
- * @session_id: Session id
- */
-struct sir_saved_csa_params {
- uint16_t message_type;
- uint16_t length;
- uint32_t session_id;
-};
-
-/**
* enum obss_ht40_scancmd_type - obss scan command type
* @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
* @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index 34d26ca32412..af4faed28d75 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -637,7 +637,7 @@ typedef struct sSirMbMsgP2p {
#define SIR_LIM_SCH_CLEAN_MSG (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xB)
/* Message from ISR upon Radar Detection */
#define SIR_LIM_RADAR_DETECT_IND (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xC)
-#define SIR_LIM_CSA_POST_HW_MODE_CHANGE (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xD)
+/* Message id 0xD available */
/* Message from Hal to send out a DEL-TS indication */
#define SIR_LIM_DEL_TS_IND (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xE)
diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h
index 8ff3010ee5a7..c44aecc887aa 100644
--- a/core/mac/src/pe/include/lim_session.h
+++ b/core/mac/src/pe/include/lim_session.h
@@ -472,7 +472,6 @@ typedef struct sPESession /* Added to Support BT-AMP */
uint8_t country_info_present;
uint8_t nss;
bool add_bss_failed;
- struct csa_offload_params saved_csa_params;
/* To hold OBSS Scan IE Parameters */
struct obss_scanparam obss_ht40_scanparam;
/* Supported NSS is intersection of self and peer NSS */
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index e2d0e786725d..499cee125e68 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1241,160 +1241,6 @@ static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx,
}
/**
- * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode
- * @mac_ctx: Global MAC context
- * @msg: Received message
- *
- * Checks if hw mode change is required for the new channel.
- * If MCC upgrade is required, this function will start the opportunistic
- * timer and the caller will invoke the other APIs to perform vdev restart on
- * the new channel.
- *
- * If DBS downgrade is required, this function will initiate the hw mode
- * change and vdev restart will happen on the new channel after getting hw
- * mode response
- *
- * Return: QDF_STATUS_SUCCESS if processing of csa params (and hence vdev
- * restart) needs to happen or if no hw mode change is required,
- * QDF_STATUS_E_FAILURE otherwise.
- */
-static QDF_STATUS lim_handle_hw_mode_change_on_csa(tpAniSirGlobal mac_ctx,
- tpSirMsgQ msg)
-{
- tpPESession session_entry;
- struct csa_offload_params *csa_params =
- (struct csa_offload_params *) (msg->bodyptr);
- tpDphHashNode sta_ds = NULL;
- uint8_t session_id;
- uint16_t aid = 0;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- lim_log(mac_ctx, LOG1, FL("handle hw mode change for csa"));
-
- if (!csa_params) {
- lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL"));
- /* qdf_mem_free() can handle NULL values */
- goto err;
- }
-
- session_entry = pe_find_session_by_bssid(mac_ctx,
- csa_params->bssId, &session_id);
- if (!session_entry) {
- lim_log(mac_ctx, LOGE, FL("Session does not exist"));
- goto err;
- }
-
- sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid,
- &session_entry->dph.dphHashTable);
-
- if (!sta_ds) {
- lim_log(mac_ctx, LOGE, FL("sta_ds does not exist"));
- goto err;
- }
-
- status = cds_handle_hw_mode_change_on_csa(session_entry->smeSessionId,
- csa_params->channel, csa_params->bssId,
- &session_entry->saved_csa_params, csa_params,
- sizeof(session_entry->saved_csa_params));
-
- if (QDF_IS_STATUS_SUCCESS(status))
- return status;
-
-err:
- qdf_mem_free(csa_params);
- return status;
-}
-
-/**
- * lim_handle_hw_mode_change_on_csa_event() - Handle hw mode change on csa
- * @mac_ctx: Pointer to the Global Mac Context
- * @msg: Received message
- *
- * Checks if a hw mode change is required for the received csa event. Processes
- * csa params and do vdev restart immediately if the there is no need for a hw
- * mode change or if MCC upgrade is required
- *
- * Return: None
- */
-static void lim_handle_hw_mode_change_on_csa_event(tpAniSirGlobal mac_ctx,
- tpSirMsgQ msg)
-{
- QDF_STATUS qdf_status;
-
- lim_log(mac_ctx, LOG1, FL("lim received csa offload event"));
- if (mac_ctx->policy_manager_enabled &&
- wma_is_hw_dbs_capable() == true) {
- /* Check if a hw mode change is required */
- qdf_status = lim_handle_hw_mode_change_on_csa(mac_ctx,
- msg);
- /* Process csa params and do vdev restart immediately if
- * there is no need for a hw mode change or if MCC upgrade is
- * required.
- */
- if (QDF_IS_STATUS_SUCCESS(qdf_status))
- lim_handle_csa_offload_msg(mac_ctx, msg);
- } else {
- lim_handle_csa_offload_msg(mac_ctx, msg);
- }
-}
-
-/**
- * lim_handle_csa_event_post_dbs_downgrade() - Process csa event post dbs
- * downgrade
- * @mac_ctx: Pointer to the Global Mac Context
- * @msg: Received message
- *
- * Process the csa event to do vdev restart on the new channel after the dbs
- * downgrade. If there was a DBS downgrade as part of the event
- * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will be received after
- * receiving the set hw mode response, where this processing will happen.
- *
- * Return: None
- */
-static void lim_handle_csa_event_post_dbs_downgrade(tpAniSirGlobal mac_ctx,
- tpSirMsgQ msg)
-{
- tSirMsgQ csa_msg;
- tpPESession session_entry;
-
- struct sir_saved_csa_params *buf =
- (struct sir_saved_csa_params *)msg->bodyptr;
-
- /* Null check for 'msg' already done before coming here in the caller */
-
- session_entry = pe_find_session_by_sme_session_id(mac_ctx,
- buf->session_id);
- if (!session_entry) {
- lim_log(mac_ctx, LOGE, FL("Invalid session id:%d"),
- buf->session_id);
- return;
- }
-
- lim_log(mac_ctx, LOG1,
- FL("received csa offload event post hw change for %pM"),
- session_entry->saved_csa_params.bssId);
-
- csa_msg.bodyptr = qdf_mem_malloc(
- sizeof(struct csa_offload_params));
- if (!csa_msg.bodyptr) {
- lim_log(mac_ctx, LOGE, FL("malloc failed for csa msg"));
- goto clean_msg_body;
- }
-
- qdf_mem_copy((void *)csa_msg.bodyptr,
- (void *)&session_entry->saved_csa_params,
- sizeof(struct csa_offload_params));
- /* If there was a DBS downgrade as part of the event
- * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will
- * be received after receiving the set hw mode response.
- */
- lim_handle_csa_offload_msg(mac_ctx, &csa_msg);
-clean_msg_body:
- if (msg->bodyptr)
- qdf_mem_free(msg->bodyptr);
-}
-
-/**
* lim_process_messages() - Process messages from upper layers.
*
* @mac_ctx: Pointer to the Global Mac Context.
@@ -1853,10 +1699,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
lim_handle_delete_bss_rsp(mac_ctx, msg);
break;
case WMA_CSA_OFFLOAD_EVENT:
- lim_handle_hw_mode_change_on_csa_event(mac_ctx, msg);
- break;
- case SIR_LIM_CSA_POST_HW_MODE_CHANGE:
- lim_handle_csa_event_post_dbs_downgrade(mac_ctx, msg);
+ lim_handle_csa_offload_msg(mac_ctx, msg);
break;
case WMA_SET_BSSKEY_RSP:
case WMA_SET_STA_BCASTKEY_RSP:
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index 4659053ecb90..c25da0223394 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -3207,6 +3207,7 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body)
* the policy manager connection table needs to be updated.
*/
cds_update_connection_info(psessionEntry->smeSessionId);
+ cds_set_do_hw_mode_change_flag(true);
}
break;
default:
diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c
index 78b71b4b0c3e..7d76f9cd3cf1 100644
--- a/core/sap/src/sap_api_link_cntl.c
+++ b/core/sap/src/sap_api_link_cntl.c
@@ -507,128 +507,6 @@ wlansap_roam_process_ch_change_success(tpAniSirGlobal mac_ctx,
}
/**
- * wlansap_set_hw_mode_on_channel_switch() - Set hw mode before channel switch
- * @sap_ctx: Global SAP context
- * @target_channel: Target channel
- *
- * Sets hw mode, if needed, before doing a channel switch
- *
- * Return: None
- */
-static QDF_STATUS wlansap_set_hw_mode_on_channel_switch(tpAniSirGlobal mac_ctx,
- ptSapContext sap_ctx,
- uint32_t target_channel)
-{
- QDF_STATUS status = QDF_STATUS_E_FAILURE, qdf_status;
- cds_context_type *cds_ctx;
- enum cds_conc_next_action action;
-
- cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
- if (!cds_ctx) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
- FL("Invalid CDS Context"));
- return status;
- }
-
- qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
-
- action = cds_get_pref_hw_mode_for_chan(sap_ctx->sessionId,
- target_channel);
-
- if ((action != CDS_DBS_DOWNGRADE) && (action != CDS_MCC_UPGRADE)) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
- FL("Invalid action: %d"), action);
- goto done;
- }
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
- FL("action:%d session id:%d"),
- action, sap_ctx->sessionId);
-
- /* For MCC, opportunistic timer will be trigerred. We do not
- * want to do hw mode change here to avoid the ping pong effect.
- * e.g., If a new connection is immediately coming up, we could be
- * moving in and out of MCC. The timer after DBS_OPPORTUNISTIC_TIME
- * seconds will check if the driver can move to MCC or not.
- *
- * 1. Start opportunistic timer
- * 2. Do vdev restart on the new channel
- * 3. PM will check if MCC upgrade can be done after timer expiry
- */
- if (action == CDS_MCC_UPGRADE) {
- qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer);
- qdf_status = qdf_mc_timer_start(
- &cds_ctx->dbs_opportunistic_timer,
- DBS_OPPORTUNISTIC_TIME *
- 1000);
- if (!QDF_IS_STATUS_SUCCESS(qdf_status))
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
- FL("Failed to start dbs opportunistic timer"));
- else
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
- FL("opportunistic timer for MCC upgrade"));
- goto done;
- }
-
- /* For DBS, we want to move right away to DBS mode. Else, we could
- * be doing MCC momentarily.
- *
- * 1. PM will initiate HW mode change to DBS rightaway
- * 2. Do vdev restart on the new channel
- */
- status = cds_next_actions(sap_ctx->sessionId, action,
- SIR_UPDATE_REASON_CHANNEL_SWITCH);
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
- FL("no set hw mode command was issued"));
- goto done;
- }
-done:
- qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
- /* success must be returned only when a set hw mode was done */
- return status;
-}
-
-/**
- * wlansap_update_hw_mode() - Set the hw mode for the new channel switch
- * @hal: HAL pointer
- * @sap_ctx: SAP context
- *
- * Sets the hw mode, if needed, for the driver based on the new channel
- * to which the vdev is going to switch to
- *
- * Return: None
- */
-void wlansap_update_hw_mode(tHalHandle hal, ptSapContext sap_ctx)
-{
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
- tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
- tCsrRoamInfo roam_info = {0};
-
- if (mac_ctx->policy_manager_enabled &&
- wma_is_hw_dbs_capable() == true) {
- status = wlansap_set_hw_mode_on_channel_switch(mac_ctx, sap_ctx,
- mac_ctx->sap.SapDfsInfo.target_channel);
- }
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
- FL("status:%d"), status);
-
- /*
- * If no set hw mode was done, proceed as before by doing set channel.
- * If set hw mode was done, perform the following in the callback so
- * that the set channel operations are done after the driver moves to
- * the required hw mode.
- */
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- csr_roam_call_callback(mac_ctx, sap_ctx->sessionId,
- &roam_info, 0,
- eCSR_ROAM_STATUS_UPDATE_HW_MODE,
- eCSR_ROAM_RESULT_UPDATE_HW_MODE);
- }
-}
-
-/**
* wlansap_roam_process_dfs_chansw_update() - handles the case for
* eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS in wlansap_roam_callback()
*
@@ -1097,10 +975,6 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("Received Chan Sw Update Notification"));
break;
- case eCSR_ROAM_STATUS_UPDATE_HW_MODE:
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- FL("Received HW mode update notification"));
- break;
case eCSR_ROAM_SET_CHANNEL_RSP:
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("Received set channel response"));
@@ -1316,26 +1190,8 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
&qdf_ret_status);
break;
case eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS:
- /* eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS indicates the
- * completion of sending (E)CSA IEs. After these IEs are sent,
- * in eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS state, check
- * for DBS downgrade/MCC upgrade is done.
- * (1) From this state
- * eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS, on MCC upgrade,
- * transition immediately happens to the state
- * eCSR_ROAM_RESULT_UPDATE_HW_MODE, where the vdev restart
- * happens internally.
- * (2) From this state,
- * eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS, on DBS downgrade,
- * transition happens to the state
- * eCSR_ROAM_RESULT_UPDATE_HW_MODE to do vdev restart only after
- * SME received the set HW mode response.
- */
- wlansap_update_hw_mode(hal, sap_ctx);
- break;
- case eCSR_ROAM_RESULT_UPDATE_HW_MODE:
wlansap_roam_process_dfs_chansw_update(hal, sap_ctx,
- &qdf_ret_status);
+ &qdf_ret_status);
break;
case eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS:
wlansap_roam_process_ch_change_success(mac_ctx, sap_ctx,
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index ae0c98749e4f..dd566f26ed17 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -492,9 +492,9 @@ typedef enum {
/* Channel sw update notification */
eCSR_ROAM_DFS_CHAN_SW_NOTIFY,
eCSR_ROAM_EXT_CHG_CHNL_IND,
- eCSR_ROAM_STATUS_UPDATE_HW_MODE,
eCSR_ROAM_DISABLE_QUEUES,
eCSR_ROAM_ENABLE_QUEUES,
+ eCSR_ROAM_STA_CHANNEL_SWITCH,
} eRoamCmdStatus;
/* comment inside indicates what roaming callback gets */
@@ -591,7 +591,6 @@ typedef enum {
eCSR_ROAM_RESULT_CHANNEL_CHANGE_FAILURE,
eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS,
eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND,
- eCSR_ROAM_RESULT_UPDATE_HW_MODE,
} eCsrRoamResult;
/*----------------------------------------------------------------------------
diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h
index f681208043f3..674e8b597846 100644
--- a/core/sme/inc/sme_internal.h
+++ b/core/sme/inc/sme_internal.h
@@ -234,7 +234,6 @@ typedef struct tagSmeStruct {
ocb_callback dcc_stats_event_callback;
sme_set_thermal_level_callback set_thermal_level_cb;
void *saved_scan_cmd;
- struct csa_offload_params saved_csa_params;
} tSmeStruct, *tpSmeStruct;
#endif /* #if !defined( __SMEINTERNAL_H ) */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 49c7d685b708..06ba472c1d42 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -155,8 +155,6 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
struct sir_set_hw_mode_resp *param;
enum sir_conn_update_reason reason;
tSmeCmd *saved_cmd;
- tCsrRoamInfo roam_info = {0};
- QDF_STATUS status;
sms_log(mac, LOG1, FL("%s"), __func__);
param = (struct sir_set_hw_mode_resp *)msg;
@@ -251,34 +249,6 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
saved_cmd = NULL;
mac->sme.saved_scan_cmd = NULL;
}
- } else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH) {
- csr_roam_call_callback(mac,
- command->u.set_hw_mode_cmd.session_id,
- &roam_info, 0,
- eCSR_ROAM_STATUS_UPDATE_HW_MODE,
- eCSR_ROAM_RESULT_UPDATE_HW_MODE);
- } else if (reason == SIR_UPDATE_REASON_CHANNEL_SWITCH_STA) {
- struct sir_saved_csa_params *msg;
-
- sms_log(mac, LOG1, FL("process channel switch sta"));
- msg = qdf_mem_malloc(sizeof(*msg));
- if (!msg) {
- sms_log(mac, LOGE,
- FL("memory alloc fail for csa "));
- goto end;
- }
-
- msg->message_type = SIR_LIM_CSA_POST_HW_MODE_CHANGE;
- msg->length = sizeof(*msg);
- msg->session_id = command->u.set_hw_mode_cmd.session_id;
-
- status = cds_send_mb_message_to_mac(msg);
- if (!QDF_IS_STATUS_SUCCESS(status))
- sms_log(mac, LOGE,
- FL("failed to process csa params"));
- else
- sms_log(mac, LOG1,
- FL("csa after hw mode change"));
}
end:
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index ee72ae9a44c9..342ff292a210 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -10250,6 +10250,7 @@ csr_roam_chk_lnk_swt_ch_ind(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr)
uint32_t sessionId = CSR_SESSION_ID_INVALID;
QDF_STATUS status;
tpSirSmeSwitchChannelInd pSwitchChnInd;
+ tCsrRoamInfo roamInfo;
/* in case of STA, the SWITCH_CHANNEL originates from its AP */
sms_log(mac_ctx, LOGW, FL("eWNI_SME_SWITCH_CHL_IND from SME"));
@@ -10272,6 +10273,12 @@ csr_roam_chk_lnk_swt_ch_ind(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr)
session->pConnectBssDesc->channelId =
(uint8_t) pSwitchChnInd->newChannelId;
}
+
+ qdf_mem_set(&roamInfo, sizeof(tCsrRoamInfo), 0);
+ roamInfo.chan_info.chan_id = pSwitchChnInd->newChannelId;
+ status = csr_roam_call_callback(mac_ctx, sessionId,
+ &roamInfo, 0, eCSR_ROAM_STA_CHANNEL_SWITCH,
+ eCSR_ROAM_RESULT_NONE);
}
}
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index efdde8dd5b5c..6cc6a04bf1d3 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -73,6 +73,8 @@
#include <cdp_txrx_cfg.h>
#include <cdp_txrx_cmn.h>
+#include "cds_concurrency.h"
+
/**
* wma_find_vdev_by_addr() - find vdev_id from mac address
* @wma: wma handle
@@ -790,6 +792,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
if (NULL == mac_ctx) {
WMA_LOGE("%s: Failed to get mac_ctx", __func__);
+ cds_set_do_hw_mode_change_flag(false);
return -EINVAL;
}
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
@@ -798,12 +801,14 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
param_buf = (WMI_VDEV_START_RESP_EVENTID_param_tlvs *) cmd_param_info;
if (!param_buf) {
WMA_LOGE("Invalid start response event buffer");
+ cds_set_do_hw_mode_change_flag(false);
return -EINVAL;
}
resp_event = param_buf->fixed_param;
if (!resp_event) {
WMA_LOGE("Invalid start response event buffer");
+ cds_set_do_hw_mode_change_flag(false);
return -EINVAL;
}
@@ -857,6 +862,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
wma->interfaces[resp_event->vdev_id].bssid,
&param) != QDF_STATUS_SUCCESS) {
WMA_LOGE("%s : failed to send vdev up", __func__);
+ cds_set_do_hw_mode_change_flag(false);
return -EEXIST;
}
qdf_atomic_set(&wma->interfaces[resp_event->vdev_id].
@@ -871,6 +877,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
if (!req_msg) {
WMA_LOGE("%s: Failed to lookup request message for vdev %d",
__func__, resp_event->vdev_id);
+ cds_set_do_hw_mode_change_flag(false);
return -EINVAL;
}
@@ -889,6 +896,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
if (!params) {
WMA_LOGE("%s: channel switch params is NULL for vdev %d",
__func__, resp_event->vdev_id);
+ cds_set_do_hw_mode_change_flag(false);
return -EINVAL;
}
@@ -913,6 +921,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
__func__, resp_event->vdev_id);
wma->interfaces[resp_event->vdev_id].vdev_up =
false;
+ cds_set_do_hw_mode_change_flag(false);
} else {
wma->interfaces[resp_event->vdev_id].vdev_up =
true;
@@ -932,6 +941,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
iface->bssid,
&param) != QDF_STATUS_SUCCESS) {
WMA_LOGE(FL("failed to send vdev up"));
+ cds_set_do_hw_mode_change_flag(false);
return -EEXIST;
}
iface->vdev_up = true;
@@ -3802,6 +3812,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
&param) != QDF_STATUS_SUCCESS) {
WMA_LOGP("%s: Failed to send vdev up cmd: vdev %d bssid %pM",
__func__, params->smesessionId, params->bssId);
+ cds_set_do_hw_mode_change_flag(false);
status = QDF_STATUS_E_FAILURE;
} else {
wma->interfaces[params->smesessionId].vdev_up = true;
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index e7a0ca05d3ab..60ac1ba4454a 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -2343,6 +2343,7 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
&param);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE("%s : failed to send vdev up", __func__);
+ cds_set_do_hw_mode_change_flag(false);
return;
}
wma->interfaces[vdev_id].vdev_up = true;