diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 9463cf4667..4977510541 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -181,6 +181,20 @@ init_deinit_update_vendor_handoff_control_caps(struct wmi_unified *wmi_handle, {} #endif +#ifdef FEATURE_WLAN_TDLS +static void init_deinit_update_tdls_caps(struct wmi_unified *wmi, + struct wlan_objmgr_psoc *psoc) +{ + if (wmi_service_enabled(wmi, wmi_service_tdls_concurrency_support)) + wlan_psoc_nif_fw_ext2_cap_set(psoc, + WLAN_TDLS_CONCURRENCIES_SUPPORT); +} +#else +static inline void init_deinit_update_tdls_caps(struct wmi_unified *wmi_handle, + struct wlan_objmgr_psoc *psoc) +{} +#endif + static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, uint8_t *event, uint32_t data_len) @@ -335,6 +349,7 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, init_deinit_update_roam_stats_cap(wmi_handle, psoc); init_deinit_update_wifi_pos_caps(wmi_handle, psoc); + init_deinit_update_tdls_caps(wmi_handle, psoc); /* override derived value, if it exceeds max peer count */ if ((wlan_psoc_get_max_peer_count(psoc) > diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h index 7f446765d7..2f65897018 100644 --- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h +++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h @@ -253,6 +253,9 @@ /* Restricted TWT */ #define WLAN_SOC_F_RESTRICTED_TWT 0x00000080 +/* Support for TDLS Concurrencies for Legacy STA & ML STA*/ +#define WLAN_TDLS_CONCURRENCIES_SUPPORT 0x0000100 + /* PSOC op flags */ /* Invalid VHT cap */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index fb188ddd24..5fc34d54a6 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -6299,6 +6299,7 @@ typedef enum { wmi_service_tdls_6g_support, #endif wmi_service_tdls_wideband_support, + wmi_service_tdls_concurrency_support, #endif wmi_service_is_my_mgmt_frame, wmi_service_linkspeed_roam_trigger_support, diff --git a/wmi/src/wmi_unified_sta_tlv.c b/wmi/src/wmi_unified_sta_tlv.c index 102db73846..28b070e1aa 100644 --- a/wmi/src/wmi_unified_sta_tlv.c +++ b/wmi/src/wmi_unified_sta_tlv.c @@ -544,7 +544,9 @@ static uint8_t tdls_get_wmi_offchannel_mode(uint8_t tdls_sw_mode) case DISABLE_CHANSWITCH: off_chan_mode = WMI_TDLS_DISABLE_OFFCHANNEL; break; - + case DISABLE_ACTIVE_CHANSWITCH: + off_chan_mode = WMI_TDLS_ACTIVE_DISABLE_OFFCHANNEL; + break; default: wmi_debug("unknown tdls_sw_mode: %d", tdls_sw_mode); off_chan_mode = WMI_TDLS_DISABLE_OFFCHANNEL; @@ -600,12 +602,21 @@ static QDF_STATUS send_set_tdls_offchan_mode_cmd_tlv(wmi_unified_t wmi_handle, { wmi_tdls_set_offchan_mode_cmd_fixed_param *cmd; wmi_buf_t wmi_buf; + uint8_t *buf_ptr; + struct tdls_ch_params *src_chan_info; + wmi_channel *chan_info; + uint16_t i; u_int16_t len = sizeof(wmi_tdls_set_offchan_mode_cmd_fixed_param); + len += WMI_TLV_HDR_SIZE + + sizeof(wmi_channel) * chan_switch_params->num_off_channels; + wmi_buf = wmi_buf_alloc(wmi_handle, len); if (!wmi_buf) { return QDF_STATUS_E_FAILURE; } + + buf_ptr = (uint8_t *)wmi_buf_data(wmi_buf); cmd = (wmi_tdls_set_offchan_mode_cmd_fixed_param *) wmi_buf_data(wmi_buf); WMITLV_SET_HDR(&cmd->tlv_header, @@ -641,6 +652,38 @@ static QDF_STATUS send_set_tdls_offchan_mode_cmd_tlv(wmi_unified_t wmi_handle, cmd->is_peer_responder, cmd->offchan_oper_class); + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + sizeof(wmi_channel) * + chan_switch_params->num_off_channels); + chan_info = (wmi_channel *)(buf_ptr + WMI_TLV_HDR_SIZE); + for (i = 0; i < chan_switch_params->num_off_channels; i++) { + WMITLV_SET_HDR(&chan_info->tlv_header, + WMITLV_TAG_STRUC_wmi_channel, + WMITLV_GET_STRUCT_TLVLEN(wmi_channel)); + + src_chan_info = &chan_switch_params->allowed_off_channels[i]; + + chan_info->mhz = src_chan_info->ch_freq; + chan_info->band_center_freq1 = chan_info->mhz; + chan_info->band_center_freq2 = 0; + if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_info->mhz)) + WMI_SET_CHANNEL_MODE(chan_info, MODE_11G); + else + WMI_SET_CHANNEL_MODE(chan_info, MODE_11A); + + if (src_chan_info->dfs_set) + WMI_SET_CHANNEL_FLAG(chan_info, WMI_CHAN_FLAG_PASSIVE); + + WMI_SET_CHANNEL_MAX_TX_POWER(chan_info, src_chan_info->pwr); + WMI_SET_CHANNEL_REG_POWER(chan_info, src_chan_info->pwr); + wmi_debug("chan[%d] = %u TX power:%d DFS[%d]", i, + chan_info->mhz, src_chan_info->pwr, + src_chan_info->dfs_set); + + chan_info++; + } + wmi_mtrace(WMI_TDLS_SET_OFFCHAN_MODE_CMDID, cmd->vdev_id, 0); if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, WMI_TDLS_SET_OFFCHAN_MODE_CMDID)) { diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index b50ed03bc7..cb868d8f7c 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -21891,6 +21891,8 @@ static void populate_tlv_service(uint32_t *wmi_service) #endif wmi_service[wmi_service_tdls_wideband_support] = WMI_SERVICE_TDLS_WIDEBAND_SUPPORT; + wmi_service[wmi_service_tdls_concurrency_support] = + WMI_SERVICE_TDLS_CONCURRENCY_SUPPORT; #endif #ifdef WLAN_SUPPORT_TWT