diff options
| author | Vignesh Viswanathan <viswanat@codeaurora.org> | 2018-10-24 14:41:25 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-10-24 10:41:37 -0700 |
| commit | db92e5ec7bf8d2d7a464f0bf5c9847a8c1bcb3ab (patch) | |
| tree | 6659ff1924db98958019d7d453ee19a4811f2efb /core | |
| parent | 244ecf8640fccb3be8b54e6eb9a9259f9cdf72ef (diff) | |
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.
Also remove SET PCL for STA vdev from CDS as it
is being done now from csr_roam_offload_scan for STA
Change-Id: I78e9a29d7f8eb226e899e944e4d2980629c52a01
CRs-Fixed: 2302607
Diffstat (limited to 'core')
| -rw-r--r-- | core/cds/inc/cds_concurrency.h | 12 | ||||
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 25 | ||||
| -rw-r--r-- | core/mac/inc/sir_api.h | 10 | ||||
| -rw-r--r-- | core/sme/src/common/sme_api.c | 35 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_roam.c | 14 | ||||
| -rw-r--r-- | core/wma/inc/wma.h | 2 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 41 |
7 files changed, 89 insertions, 50 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index 78a161ae9de9..f088b61254a6 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -1135,4 +1135,16 @@ bool cds_is_sta_sap_scc(uint8_t sap_ch); * Restart: None */ void cds_flush_sta_ap_intf_work(hdd_context_t *hdd_ctx); + +/** + * cds_pdev_set_pcl() - Sets PCL to FW + * @mode: adapter mode + * + * Fetches the PCL and sends the PCL to SME + * module which in turn will send the WMI + * command WMI_PDEV_SET_PCL_CMDID to the fw + * + * Return: None + */ +void cds_pdev_set_pcl(enum tQDF_ADAPTER_MODE mode); #endif /* __CDS_CONCURRENCY_H */ diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 3b0affd4d499..d168c2ae575f 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3826,18 +3826,8 @@ void cds_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode) hdd_green_ap_start_bss(hdd_ctx); } -/** - * cds_pdev_set_pcl() - Sets PCL to FW - * @mode: adapter mode - * - * Fetches the PCL and sends the PCL to SME - * module which in turn will send the WMI - * command WMI_PDEV_SET_PCL_CMDID to the fw - * - * Return: None - */ #if defined(QCA_WIFI_3_0) -static void cds_pdev_set_pcl(enum tQDF_ADAPTER_MODE mode) +void cds_pdev_set_pcl(enum tQDF_ADAPTER_MODE mode) { QDF_STATUS status; enum cds_con_mode con_mode; @@ -4023,18 +4013,7 @@ void cds_incr_active_session(enum tQDF_ADAPTER_MODE mode, cds_debug("No.# of active sessions for mode %d = %d", mode, hdd_ctx->no_of_active_sessions[mode]); - /* - * Get PCL logic makes use of the connection info structure. - * Let us set the PCL to the FW before updating the connection - * info structure about the new connection. - */ - if (mode == QDF_STA_MODE) { - qdf_mutex_release(&cds_ctx->qdf_conc_list_lock); - /* Set PCL of STA to the FW */ - cds_pdev_set_pcl(mode); - qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock); - cds_debug("Set PCL of STA to FW"); - } + cds_incr_connection_count(session_id); if ((cds_mode_specific_connection_count(CDS_STA_MODE, NULL) > 0) && (mode != QDF_STA_MODE)) { diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 6d29ed76f973..c4795c1f745f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -8536,4 +8536,14 @@ struct sir_sae_msg { 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; + tSirRFBand band; +}; + #endif /* __SIR_API_H */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 265de1e717df..f17ea5c16a7b 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16006,6 +16006,22 @@ QDF_STATUS sme_set_rssi_monitoring(tHalHandle hal, return status; } +static tSirRFBand sme_get_connected_roaming_vdev_band(tpAniSirGlobal mac_ctx) +{ + tSirRFBand band = SIR_BAND_ALL; + tCsrRoamSession *session; + uint8_t session_id, channel; + + session_id = csr_get_roam_enabled_sta_sessionid(mac_ctx); + if (session_id != CSR_SESSION_ID_INVALID) { + session = CSR_GET_SESSION(mac_ctx, session_id); + channel = session->connectedProfile.operationChannel; + band = get_rf_band(channel); + } + + return band; +} + /** * sme_pdev_set_pcl() - Send WMI_PDEV_SET_PCL_CMDID to the WMA * @hal: Handle returned by macOpen @@ -16021,23 +16037,28 @@ QDF_STATUS sme_pdev_set_pcl(tHalHandle hal, QDF_STATUS status = QDF_STATUS_SUCCESS; tpAniSirGlobal mac = PMAC_STRUCT(hal); cds_msg_t cds_message; - struct wmi_pcl_chan_weights *req_msg; - uint32_t len, i; + struct set_pcl_req *req_msg; + uint32_t i; - len = sizeof(*req_msg); + req_msg = qdf_mem_malloc(sizeof(*req_msg)); - req_msg = qdf_mem_malloc(len); if (!req_msg) { sme_err("qdf_mem_malloc failed"); return QDF_STATUS_E_NOMEM; } + req_msg->band = SIR_BAND_ALL; + if (CSR_IS_ROAM_INTRA_BAND_ENABLED(mac)) { + req_msg->band = sme_get_connected_roaming_vdev_band(mac); + sme_debug("Connected STA band %d", req_msg->band); + } + for (i = 0; i < msg.pcl_len; i++) { - req_msg->pcl_list[i] = msg.pcl_list[i]; - req_msg->weight_list[i] = msg.weight_list[i]; + req_msg->chan_weights.pcl_list[i] = msg.pcl_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); if (status != QDF_STATUS_SUCCESS) { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 2c3da0f6aaf9..81c4e0016338 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20634,6 +20634,7 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, struct roam_ext_params *roam_params_src; uint8_t i, temp_session_id; uint8_t op_channel; + bool prev_roaming_state; sme_debug("RSO Command %d, Session id %d, Reason %d", command, session_id, reason); @@ -20886,17 +20887,22 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, 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; + cds_pdev_set_pcl(QDF_STA_MODE); + if (!QDF_IS_STATUS_SUCCESS( csr_roam_send_rso_cmd(mac_ctx, session_id, req_buf))) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "%s: Not able to post message to PE", __func__); + roam_info->b_roam_scan_offload_started = prev_roaming_state; + cds_pdev_set_pcl(QDF_STA_MODE); 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 */ roam_info->last_sent_cmd = command; diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index bde43c4c1f4b..03c7a5c91456 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -2383,7 +2383,7 @@ QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma, struct rssi_monitor_req *req); 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, struct sir_hw_mode *msg); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 1cc0f1b609a8..2a9b0f54f011 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -8096,7 +8096,7 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) break; case SIR_HAL_PDEV_SET_PCL_TO_FW: 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); break; case SIR_HAL_PDEV_SET_HW_MODE: @@ -8411,7 +8411,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 */ 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; QDF_STATUS status; @@ -8423,26 +8423,36 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle, } 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]; } - msg->saved_num_chan = wma_handle->saved_chan.num_channels; - status = cds_get_valid_chan_weights((struct sir_pcl_chan_weights *)msg, - CDS_STA_MODE); + msg->chan_weights.saved_num_chan = wma_handle->saved_chan.num_channels; + status = cds_get_valid_chan_weights( + (struct sir_pcl_chan_weights *)&msg->chan_weights, + CDS_STA_MODE); - for (i = 0; i < msg->saved_num_chan; i++) { - msg->weighed_valid_list[i] = - wma_map_pcl_weights(msg->weighed_valid_list[i]); + for (i = 0; i < msg->chan_weights.saved_num_chan; i++) { + msg->chan_weights.weighed_valid_list[i] = + wma_map_pcl_weights(msg->chan_weights. + weighed_valid_list[i]); /* Dont allow roaming on 2G when 5G_ONLY configured */ - if ((wma_handle->bandcapability == SIR_BAND_5_GHZ) && - (msg->saved_chan_list[i] <= MAX_24GHZ_CHANNEL)) { - msg->weighed_valid_list[i] = + if (((wma_handle->bandcapability == SIR_BAND_5_GHZ) || + (msg->band == SIR_BAND_5_GHZ)) && + (CDS_IS_CHANNEL_24GHZ( + msg->chan_weights.saved_chan_list[i]))) { + msg->chan_weights.weighed_valid_list[i] = + WEIGHT_OF_DISALLOWED_CHANNELS; + } + if ((msg->band == SIR_BAND_2_4_GHZ) && + CDS_IS_CHANNEL_5GHZ((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__, - msg->saved_chan_list[i], i, - msg->weighed_valid_list[i]); + msg->chan_weights.saved_chan_list[i], i, + msg->chan_weights.weighed_valid_list[i]); } if (!QDF_IS_STATUS_SUCCESS(status)) { @@ -8450,7 +8460,8 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle, 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_SUCCESS; |
