diff --git a/umac/tdls/core/src/wlan_tdls_ct.c b/umac/tdls/core/src/wlan_tdls_ct.c index 95ddd82ac94c..d7c50ab7c68f 100644 --- a/umac/tdls/core/src/wlan_tdls_ct.c +++ b/umac/tdls/core/src/wlan_tdls_ct.c @@ -979,17 +979,19 @@ int tdls_set_tdls_secoffchanneloffset(struct tdls_soc_priv_obj *tdls_soc, switch (offchanoffset) { case TDLS_SEC_OFFCHAN_OFFSET_0: - tdls_soc->tdls_channel_offset = (1 << BW_20_OFFSET_BIT); + tdls_soc->tdls_channel_offset = BW20; break; case TDLS_SEC_OFFCHAN_OFFSET_40PLUS: + tdls_soc->tdls_channel_offset = BW40_LOW_PRIMARY; + break; case TDLS_SEC_OFFCHAN_OFFSET_40MINUS: - tdls_soc->tdls_channel_offset = (1 << BW_40_OFFSET_BIT); + tdls_soc->tdls_channel_offset = BW40_LOW_PRIMARY; break; case TDLS_SEC_OFFCHAN_OFFSET_80: - tdls_soc->tdls_channel_offset = (1 << BW_80_OFFSET_BIT); + tdls_soc->tdls_channel_offset = BW80; break; case TDLS_SEC_OFFCHAN_OFFSET_160: - tdls_soc->tdls_channel_offset = (1 << BW_160_OFFSET_BIT); + tdls_soc->tdls_channel_offset = BWALL; break; default: tdls_err("Invalid tdls secondary off channel offset %d", diff --git a/umac/tdls/dispatcher/inc/wlan_tdls_public_structs.h b/umac/tdls/dispatcher/inc/wlan_tdls_public_structs.h index 6ab5f663fb08..3aa85b71aeb5 100644 --- a/umac/tdls/dispatcher/inc/wlan_tdls_public_structs.h +++ b/umac/tdls/dispatcher/inc/wlan_tdls_public_structs.h @@ -1140,7 +1140,7 @@ struct tdls_set_offchanmode { */ struct tdls_set_secoffchanneloffset { struct wlan_objmgr_vdev *vdev; - uint8_t offchan_offset; + int offchan_offset; tdls_offchan_parms_callback callback; }; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 8f9829613cec..0b1e5b7ee362 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -10272,11 +10272,49 @@ static uint8_t tdls_get_wmi_offchannel_mode(uint8_t tdls_sw_mode) } return off_chan_mode; } + +/** + * tdls_get_wmi_offchannel_bw - Get WMI tdls off channel Bandwidth + * @tdls_sw_mode: tdls_sw_mode + * + * This function returns wmi tdls offchannel bandwidth + * + * Return: TDLS offchannel bandwidth + */ +static uint8_t tdls_get_wmi_offchannel_bw(uint16_t tdls_off_ch_bw_offset) +{ + uint8_t off_chan_bw; + + switch (tdls_off_ch_bw_offset) { + case BW20: + off_chan_bw = WMI_TDLS_OFFCHAN_20MHZ; + break; + case BW40_LOW_PRIMARY: + case BW40_HIGH_PRIMARY: + off_chan_bw = WMI_TDLS_OFFCHAN_40MHZ; + break; + case BW80: + off_chan_bw = WMI_TDLS_OFFCHAN_80MHZ; + case BWALL: + off_chan_bw = WMI_TDLS_OFFCHAN_160MHZ; + default: + WMI_LOGD(FL("unknown tdls_offchannel bw offset %d"), + off_chan_bw); + off_chan_bw = WMI_TDLS_OFFCHAN_20MHZ; + } + return off_chan_bw; +} + #else static uint8_t tdls_get_wmi_offchannel_mode(uint8_t tdls_sw_mode) { return WMI_TDLS_DISABLE_OFFCHANNEL; } + +static uint8_t tdls_get_wmi_offchannel_bw(uint16_t tdls_off_ch_bw_offset) +{ + return WMI_TDLS_OFFCHAN_20MHZ; +} #endif /** @@ -10314,7 +10352,9 @@ static QDF_STATUS send_set_tdls_offchan_mode_cmd_tlv(wmi_unified_t wmi_handle, tdls_get_wmi_offchannel_mode(chan_switch_params->tdls_sw_mode); cmd->is_peer_responder = chan_switch_params->is_responder; cmd->offchan_num = chan_switch_params->tdls_off_ch; - cmd->offchan_bw_bitmap = chan_switch_params->tdls_off_ch_bw_offset; + cmd->offchan_bw_bitmap = + tdls_get_wmi_offchannel_bw( + chan_switch_params->tdls_off_ch_bw_offset); cmd->offchan_oper_class = chan_switch_params->oper_class; WMI_LOGD(FL("Peer MAC Addr mac_addr31to0: 0x%x, mac_addr47to32: 0x%x"),