|
@@ -4883,13 +4883,19 @@ bool lim_check_vht_op_mode_change(struct mac_context *mac,
|
|
|
uint8_t chanWidth, uint8_t *peerMac)
|
|
|
{
|
|
|
QDF_STATUS status;
|
|
|
- bool update_allow = false;
|
|
|
+ bool update_allow;
|
|
|
struct ch_params ch_params;
|
|
|
struct csa_offload_params *csa_param;
|
|
|
+ enum QDF_OPMODE mode = wlan_vdev_mlme_get_opmode(pe_session->vdev);
|
|
|
|
|
|
- status = lim_get_update_bw_allow(pe_session, chanWidth, &update_allow);
|
|
|
- if (QDF_IS_STATUS_ERROR(status))
|
|
|
- return false;
|
|
|
+ if (mode == QDF_STA_MODE || mode == QDF_P2P_CLIENT_MODE) {
|
|
|
+ status = lim_get_update_bw_allow(pe_session, chanWidth,
|
|
|
+ &update_allow);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ update_allow = true;
|
|
|
+ }
|
|
|
|
|
|
if (update_allow) {
|
|
|
tUpdateVHTOpMode tempParam;
|
|
@@ -4904,6 +4910,10 @@ bool lim_check_vht_op_mode_change(struct mac_context *mac,
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ if (!wlan_cm_is_vdev_connected(pe_session->vdev))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ /* use vdev restart to update STA mode */
|
|
|
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
|
|
ch_params.ch_width = chanWidth;
|
|
|
wlan_reg_set_channel_params_for_pwrmode(mac->pdev,
|
|
@@ -11064,10 +11074,12 @@ void lim_update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
|
|
|
bool lim_update_channel_width(struct mac_context *mac_ctx,
|
|
|
tpDphHashNode sta_ptr,
|
|
|
struct pe_session *session,
|
|
|
- uint8_t ch_width, uint8_t *new_ch_width)
|
|
|
+ enum phy_ch_width ch_width,
|
|
|
+ enum phy_ch_width *new_ch_width)
|
|
|
{
|
|
|
- uint8_t cb_mode, oper_mode;
|
|
|
- uint32_t fw_vht_ch_wd;
|
|
|
+ uint8_t cb_mode;
|
|
|
+ enum phy_ch_width oper_mode;
|
|
|
+ enum phy_ch_width fw_vht_ch_wd;
|
|
|
|
|
|
if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq))
|
|
|
cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz;
|
|
@@ -11085,53 +11097,52 @@ bool lim_update_channel_width(struct mac_context *mac_ctx,
|
|
|
if (sta_ptr->htSupportedChannelWidthSet) {
|
|
|
if (sta_ptr->vhtSupportedChannelWidthSet >
|
|
|
WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
|
|
|
- oper_mode = eHT_CHANNEL_WIDTH_160MHZ;
|
|
|
+ oper_mode = CH_WIDTH_160MHZ;
|
|
|
else
|
|
|
oper_mode = sta_ptr->vhtSupportedChannelWidthSet + 1;
|
|
|
} else {
|
|
|
- oper_mode = eHT_CHANNEL_WIDTH_20MHZ;
|
|
|
+ oper_mode = CH_WIDTH_20MHZ;
|
|
|
}
|
|
|
|
|
|
- if (((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) &&
|
|
|
- (ch_width > eHT_CHANNEL_WIDTH_80MHZ)) ||
|
|
|
- (oper_mode == ch_width))
|
|
|
- return false;
|
|
|
+ fw_vht_ch_wd = wlan_mlme_get_max_bw();
|
|
|
|
|
|
- fw_vht_ch_wd = wma_get_vht_ch_width();
|
|
|
+ if (ch_width > fw_vht_ch_wd) {
|
|
|
+ pe_debug_rl(QDF_MAC_ADDR_FMT ": Downgrade new bw: %d to max %d",
|
|
|
+ QDF_MAC_ADDR_REF(sta_ptr->staAddr),
|
|
|
+ ch_width, fw_vht_ch_wd);
|
|
|
+ ch_width = fw_vht_ch_wd;
|
|
|
+ }
|
|
|
+ if (oper_mode == ch_width)
|
|
|
+ return false;
|
|
|
|
|
|
- pe_debug("ChannelWidth - Current : %d, New: %d mac : " QDF_MAC_ADDR_FMT,
|
|
|
- oper_mode, ch_width, QDF_MAC_ADDR_REF(sta_ptr->staAddr));
|
|
|
+ pe_debug(QDF_MAC_ADDR_FMT ": Current : %d, New: %d max %d ",
|
|
|
+ QDF_MAC_ADDR_REF(sta_ptr->staAddr), oper_mode,
|
|
|
+ ch_width, fw_vht_ch_wd);
|
|
|
|
|
|
- if (ch_width >= eHT_CHANNEL_WIDTH_160MHZ &&
|
|
|
- (fw_vht_ch_wd >= eHT_CHANNEL_WIDTH_160MHZ)) {
|
|
|
+ if (ch_width >= CH_WIDTH_160MHZ) {
|
|
|
sta_ptr->vhtSupportedChannelWidthSet =
|
|
|
WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ;
|
|
|
- sta_ptr->htSupportedChannelWidthSet =
|
|
|
- eHT_CHANNEL_WIDTH_40MHZ;
|
|
|
- *new_ch_width = eHT_CHANNEL_WIDTH_160MHZ;
|
|
|
- } else if (ch_width >= eHT_CHANNEL_WIDTH_80MHZ) {
|
|
|
+ ch_width = CH_WIDTH_160MHZ;
|
|
|
+ } else if (ch_width == CH_WIDTH_80MHZ) {
|
|
|
sta_ptr->vhtSupportedChannelWidthSet =
|
|
|
WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
|
|
|
- sta_ptr->htSupportedChannelWidthSet =
|
|
|
- eHT_CHANNEL_WIDTH_40MHZ;
|
|
|
- *new_ch_width = eHT_CHANNEL_WIDTH_80MHZ;
|
|
|
- } else if (ch_width == eHT_CHANNEL_WIDTH_40MHZ) {
|
|
|
+ } else if (ch_width == CH_WIDTH_40MHZ) {
|
|
|
sta_ptr->vhtSupportedChannelWidthSet =
|
|
|
WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
|
|
|
- sta_ptr->htSupportedChannelWidthSet =
|
|
|
- eHT_CHANNEL_WIDTH_40MHZ;
|
|
|
- *new_ch_width = eHT_CHANNEL_WIDTH_40MHZ;
|
|
|
- } else if (ch_width == eHT_CHANNEL_WIDTH_20MHZ) {
|
|
|
+ } else if (ch_width == CH_WIDTH_20MHZ) {
|
|
|
sta_ptr->vhtSupportedChannelWidthSet =
|
|
|
WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
|
|
|
- sta_ptr->htSupportedChannelWidthSet =
|
|
|
- eHT_CHANNEL_WIDTH_20MHZ;
|
|
|
- *new_ch_width = eHT_CHANNEL_WIDTH_20MHZ;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
}
|
|
|
+ if (ch_width >= CH_WIDTH_40MHZ)
|
|
|
+ sta_ptr->htSupportedChannelWidthSet = CH_WIDTH_40MHZ;
|
|
|
+ else
|
|
|
+ sta_ptr->htSupportedChannelWidthSet = CH_WIDTH_20MHZ;
|
|
|
+ *new_ch_width = ch_width;
|
|
|
|
|
|
- lim_check_vht_op_mode_change(mac_ctx, session, *new_ch_width,
|
|
|
- sta_ptr->staAddr);
|
|
|
- return true;
|
|
|
+ return lim_check_vht_op_mode_change(mac_ctx, session, *new_ch_width,
|
|
|
+ sta_ptr->staAddr);
|
|
|
}
|
|
|
|
|
|
uint8_t lim_get_vht_ch_width(tDot11fIEVHTCaps *vht_cap,
|
|
@@ -11484,3 +11495,25 @@ next:
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+enum phy_ch_width
|
|
|
+lim_convert_vht_chwidth_to_phy_chwidth(uint8_t ch_width, bool is_40)
|
|
|
+{
|
|
|
+ switch (ch_width) {
|
|
|
+ case WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ:
|
|
|
+ return CH_WIDTH_80P80MHZ;
|
|
|
+ case WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ:
|
|
|
+ return CH_WIDTH_160MHZ;
|
|
|
+ case WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ:
|
|
|
+ return CH_WIDTH_80MHZ;
|
|
|
+ case WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ:
|
|
|
+ if (is_40)
|
|
|
+ return CH_WIDTH_40MHZ;
|
|
|
+ else
|
|
|
+ return CH_WIDTH_20MHZ;
|
|
|
+ default:
|
|
|
+ pe_debug("Unknown VHT ch width %d", ch_width);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return CH_WIDTH_20MHZ;
|
|
|
+}
|