Bläddra i källkod

qcacmn: Read service capability for TDLS concurrencies

Read the new service capability:
WMI_SERVICE_TDLS_CONCURRENCY_SUPPORT for TDLS concurrencies
support. With this service capability below concurrencies are
supported:
STA+TDLS+P2P
STA+TDLS+P2P+P2P
STA+TDLS+P2P+SAP

Host driver will check this capability to disable TDLS
off channel when concurrent interface comes up. If this
service cap is not advertised by the firmware then
existing TDLS connection will be teared down when concurrent
interface is started.

Change-Id: I744775080a22ca8f3bc88894c349916eea27fd3a
CRs-Fixed: 3414266
Pragaspathi Thilagaraj 2 år sedan
förälder
incheckning
381a41f67d

+ 15 - 0
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) >

+ 3 - 0
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 */

+ 1 - 0
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,

+ 44 - 1
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)) {

+ 2 - 0
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