qcacld-3.0: Restrict the band in SET PCL command
Restrict the band of PCL to the connected band if intra band roaming is enabled Change-Id: I78e9a29d7f8eb226e899e944e4d2980629c52a01 CRs-Fixed: 2302607
This commit is contained in:

committed by
nshrivas

parent
c0edc4ada3
commit
951de5dc27
@@ -7143,4 +7143,14 @@ struct sir_sae_msg {
|
|||||||
uint8_t sae_status;
|
uint8_t sae_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct set_pcl_req - Request message to set the PCL
|
||||||
|
* @chan_weights: PCL channel weights
|
||||||
|
* @band: Supported band
|
||||||
|
*/
|
||||||
|
struct set_pcl_req {
|
||||||
|
struct wmi_pcl_chan_weights chan_weights;
|
||||||
|
enum band_info band;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __SIR_API_H */
|
#endif /* __SIR_API_H */
|
||||||
|
@@ -13247,6 +13247,28 @@ QDF_STATUS sme_reset_rssi_threshold_breached_cb(mac_handle_t mac_handle)
|
|||||||
return sme_set_rssi_threshold_breached_cb(mac_handle, NULL);
|
return sme_set_rssi_threshold_breached_cb(mac_handle, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum band_info sme_get_connected_roaming_vdev_band(void)
|
||||||
|
{
|
||||||
|
enum band_info band = BAND_ALL;
|
||||||
|
tpAniSirGlobal mac = sme_get_mac_context();
|
||||||
|
struct csr_roam_session *session;
|
||||||
|
uint8_t session_id, channel;
|
||||||
|
|
||||||
|
if (!mac) {
|
||||||
|
sme_debug("MAC Context is NULL");
|
||||||
|
return band;
|
||||||
|
}
|
||||||
|
session_id = csr_get_roam_enabled_sta_sessionid(mac);
|
||||||
|
if (session_id != CSR_SESSION_ID_INVALID) {
|
||||||
|
session = CSR_GET_SESSION(mac, session_id);
|
||||||
|
channel = session->connectedProfile.operationChannel;
|
||||||
|
band = csr_get_rf_band(channel);
|
||||||
|
return band;
|
||||||
|
}
|
||||||
|
|
||||||
|
return band;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sme_pdev_set_pcl() - Send WMI_PDEV_SET_PCL_CMDID to the WMA
|
* sme_pdev_set_pcl() - Send WMI_PDEV_SET_PCL_CMDID to the WMA
|
||||||
* @hal: Handle returned by macOpen
|
* @hal: Handle returned by macOpen
|
||||||
@@ -13260,8 +13282,8 @@ QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg)
|
|||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
tpAniSirGlobal mac = sme_get_mac_context();
|
tpAniSirGlobal mac = sme_get_mac_context();
|
||||||
struct scheduler_msg message = {0};
|
struct scheduler_msg message = {0};
|
||||||
struct wmi_pcl_chan_weights *req_msg;
|
struct set_pcl_req *req_msg;
|
||||||
uint32_t len, i;
|
uint32_t i;
|
||||||
|
|
||||||
if (!mac) {
|
if (!mac) {
|
||||||
sme_err("mac is NULL");
|
sme_err("mac is NULL");
|
||||||
@@ -13273,20 +13295,23 @@ QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg)
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sizeof(*req_msg);
|
req_msg = qdf_mem_malloc(sizeof(*req_msg));
|
||||||
|
|
||||||
req_msg = qdf_mem_malloc(len);
|
|
||||||
if (!req_msg) {
|
if (!req_msg) {
|
||||||
sme_err("qdf_mem_malloc failed");
|
sme_err("qdf_mem_malloc failed");
|
||||||
return QDF_STATUS_E_NOMEM;
|
return QDF_STATUS_E_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req_msg->band = BAND_ALL;
|
||||||
|
if (CSR_IS_ROAM_INTRA_BAND_ENABLED(mac)) {
|
||||||
|
req_msg->band = sme_get_connected_roaming_vdev_band();
|
||||||
|
sme_debug("Connected STA band %d", req_msg->band);
|
||||||
|
}
|
||||||
for (i = 0; i < msg->pcl_len; i++) {
|
for (i = 0; i < msg->pcl_len; i++) {
|
||||||
req_msg->pcl_list[i] = msg->pcl_list[i];
|
req_msg->chan_weights.pcl_list[i] = msg->pcl_list[i];
|
||||||
req_msg->weight_list[i] = msg->weight_list[i];
|
req_msg->chan_weights.weight_list[i] = msg->weight_list[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
req_msg->pcl_len = msg->pcl_len;
|
req_msg->chan_weights.pcl_len = msg->pcl_len;
|
||||||
|
|
||||||
status = sme_acquire_global_lock(&mac->sme);
|
status = sme_acquire_global_lock(&mac->sme);
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
|
@@ -19717,6 +19717,7 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
|
|||||||
struct roam_ext_params *roam_params_src;
|
struct roam_ext_params *roam_params_src;
|
||||||
uint8_t i, temp_session_id;
|
uint8_t i, temp_session_id;
|
||||||
uint8_t op_channel;
|
uint8_t op_channel;
|
||||||
|
bool prev_roaming_state;
|
||||||
|
|
||||||
sme_debug("RSO Command %d, Session id %d, Reason %d", command,
|
sme_debug("RSO Command %d, Session id %d, Reason %d", command,
|
||||||
session_id, reason);
|
session_id, reason);
|
||||||
@@ -19994,18 +19995,22 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
|
|||||||
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||||
req_buf->assoc_ie.addIEdata, req_buf->assoc_ie.length);
|
req_buf->assoc_ie.addIEdata, req_buf->assoc_ie.length);
|
||||||
|
|
||||||
|
prev_roaming_state = roam_info->b_roam_scan_offload_started;
|
||||||
|
if (ROAM_SCAN_OFFLOAD_START == command)
|
||||||
|
roam_info->b_roam_scan_offload_started = true;
|
||||||
|
else if (ROAM_SCAN_OFFLOAD_STOP == command)
|
||||||
|
roam_info->b_roam_scan_offload_started = false;
|
||||||
|
policy_mgr_pdev_set_pcl(mac_ctx->psoc, QDF_STA_MODE);
|
||||||
|
|
||||||
if (!QDF_IS_STATUS_SUCCESS(
|
if (!QDF_IS_STATUS_SUCCESS(
|
||||||
csr_roam_send_rso_cmd(mac_ctx, session_id, req_buf))) {
|
csr_roam_send_rso_cmd(mac_ctx, session_id, req_buf))) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: Not able to post message to PE",
|
"%s: Not able to post message to PE",
|
||||||
__func__);
|
__func__);
|
||||||
|
roam_info->b_roam_scan_offload_started = prev_roaming_state;
|
||||||
|
policy_mgr_pdev_set_pcl(mac_ctx->psoc, QDF_STA_MODE);
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
if (ROAM_SCAN_OFFLOAD_START == command)
|
|
||||||
roam_info->b_roam_scan_offload_started = true;
|
|
||||||
else if (ROAM_SCAN_OFFLOAD_STOP == command)
|
|
||||||
roam_info->b_roam_scan_offload_started = false;
|
|
||||||
|
|
||||||
/* update the last sent cmd */
|
/* update the last sent cmd */
|
||||||
roam_info->last_sent_cmd = command;
|
roam_info->last_sent_cmd = command;
|
||||||
|
|
||||||
|
@@ -1752,7 +1752,7 @@ QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
|
|||||||
#endif /* FEATURE_RSSI_MONITOR */
|
#endif /* FEATURE_RSSI_MONITOR */
|
||||||
|
|
||||||
QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
||||||
struct wmi_pcl_chan_weights *msg);
|
struct set_pcl_req *msg);
|
||||||
|
|
||||||
QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
|
QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
|
||||||
struct policy_mgr_hw_mode *msg);
|
struct policy_mgr_hw_mode *msg);
|
||||||
|
@@ -8369,7 +8369,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
|
|||||||
break;
|
break;
|
||||||
case SIR_HAL_PDEV_SET_PCL_TO_FW:
|
case SIR_HAL_PDEV_SET_PCL_TO_FW:
|
||||||
wma_send_pdev_set_pcl_cmd(wma_handle,
|
wma_send_pdev_set_pcl_cmd(wma_handle,
|
||||||
(struct wmi_pcl_chan_weights *)msg->bodyptr);
|
(struct set_pcl_req *)msg->bodyptr);
|
||||||
qdf_mem_free(msg->bodyptr);
|
qdf_mem_free(msg->bodyptr);
|
||||||
break;
|
break;
|
||||||
case SIR_HAL_PDEV_SET_HW_MODE:
|
case SIR_HAL_PDEV_SET_HW_MODE:
|
||||||
@@ -8637,7 +8637,7 @@ static wmi_pcl_chan_weight wma_map_pcl_weights(uint32_t pcl_weight)
|
|||||||
* Return: Success if the cmd is sent successfully to the firmware
|
* Return: Success if the cmd is sent successfully to the firmware
|
||||||
*/
|
*/
|
||||||
QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
||||||
struct wmi_pcl_chan_weights *msg)
|
struct set_pcl_req *msg)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
@@ -8649,26 +8649,33 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < wma_handle->saved_chan.num_channels; i++) {
|
for (i = 0; i < wma_handle->saved_chan.num_channels; i++) {
|
||||||
msg->saved_chan_list[i] =
|
msg->chan_weights.saved_chan_list[i] =
|
||||||
wma_handle->saved_chan.channel_list[i];
|
wma_handle->saved_chan.channel_list[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->saved_num_chan = wma_handle->saved_chan.num_channels;
|
msg->chan_weights.saved_num_chan = wma_handle->saved_chan.num_channels;
|
||||||
status = policy_mgr_get_valid_chan_weights(wma_handle->psoc,
|
status = policy_mgr_get_valid_chan_weights(wma_handle->psoc,
|
||||||
(struct policy_mgr_pcl_chan_weights *)msg);
|
(struct policy_mgr_pcl_chan_weights *)&msg->chan_weights);
|
||||||
|
|
||||||
for (i = 0; i < msg->saved_num_chan; i++) {
|
for (i = 0; i < msg->chan_weights.saved_num_chan; i++) {
|
||||||
msg->weighed_valid_list[i] =
|
msg->chan_weights.weighed_valid_list[i] =
|
||||||
wma_map_pcl_weights(msg->weighed_valid_list[i]);
|
wma_map_pcl_weights(
|
||||||
|
msg->chan_weights.weighed_valid_list[i]);
|
||||||
/* Dont allow roaming on 2G when 5G_ONLY configured */
|
/* Dont allow roaming on 2G when 5G_ONLY configured */
|
||||||
if ((wma_handle->bandcapability == BAND_5G) &&
|
if (((wma_handle->bandcapability == BAND_5G) ||
|
||||||
(msg->saved_chan_list[i] <= MAX_24GHZ_CHANNEL)) {
|
(msg->band == BAND_5G)) &&
|
||||||
msg->weighed_valid_list[i] =
|
(WLAN_REG_IS_24GHZ_CH(
|
||||||
|
msg->chan_weights.saved_chan_list[i]))) {
|
||||||
|
msg->chan_weights.weighed_valid_list[i] =
|
||||||
WEIGHT_OF_DISALLOWED_CHANNELS;
|
WEIGHT_OF_DISALLOWED_CHANNELS;
|
||||||
}
|
}
|
||||||
|
if ((msg->band == BAND_2G) &&
|
||||||
|
WLAN_REG_IS_5GHZ_CH(msg->chan_weights.saved_chan_list[i]))
|
||||||
|
msg->chan_weights.weighed_valid_list[i] =
|
||||||
|
WEIGHT_OF_DISALLOWED_CHANNELS;
|
||||||
WMA_LOGD("%s: chan:%d weight[%d]=%d", __func__,
|
WMA_LOGD("%s: chan:%d weight[%d]=%d", __func__,
|
||||||
msg->saved_chan_list[i], i,
|
msg->chan_weights.saved_chan_list[i], i,
|
||||||
msg->weighed_valid_list[i]);
|
msg->chan_weights.weighed_valid_list[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||||
@@ -8676,7 +8683,8 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wmi_unified_pdev_set_pcl_cmd(wma_handle->wmi_handle, msg))
|
if (wmi_unified_pdev_set_pcl_cmd(wma_handle->wmi_handle,
|
||||||
|
&msg->chan_weights))
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user