Explorar el Código

qcacmn: Add WMI support for Tbtt sync in Multi Soc

Support synchronization of Tbtt in multi SoC case.
Add WMI to send vdev details of one soc to another.
Info includes beacon interval, bssid and tbtt calculated
in host wrt to other Soc.

Change-Id: I465140268b0fe5e0cb69f636ebeb08dc80667cf7
Sumedh Baikady hace 5 años
padre
commit
84bcbc29b5

+ 33 - 0
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h

@@ -146,6 +146,39 @@ struct sta_ps_params {
 	uint32_t value;
 };
 
+/**
+ * struct rnr_bss_tbtt_info_param: Reported Vdev info
+ * @bss_mac: Mac address
+ * @beacon_intval: Beacon interval of reported AP
+ * @opclass: Channel Opclass
+ * @chan_idx: Channel number
+ * @next_qtime_tbtt_high: Tbtt higher 32bit
+ * @next_qtime_tbtt_low: Tbtt lower 32bit
+ */
+struct rnr_bss_tbtt_info_param {
+	uint8_t bss_mac[QDF_MAC_ADDR_SIZE];
+	uint32_t beacon_intval;
+	uint32_t opclass;
+	uint32_t chan_idx;
+	uint32_t next_qtime_tbtt_high;
+	uint32_t next_qtime_tbtt_low;
+};
+
+/**
+ * struct rnr_tbtt_multisoc_sync_param - Params to
+ * sync tbtt with non self SoCs timers
+ * @pdev_id: Host pdev_id
+ * @rnr_vap_count: Count of Vap to be included in WMI cmd
+ * @cmd_type: Set/Get tbtt sync info
+ * @rnr_bss_tbtt: Reported AP Vap info
+ */
+struct rnr_tbtt_multisoc_sync_param {
+	uint32_t pdev_id;
+	uint8_t rnr_vap_count;
+	uint8_t cmd_type;
+	struct rnr_bss_tbtt_info_param *rnr_bss_tbtt;
+};
+
 /**
  * struct tbttoffset_params - Tbttoffset event params
  * @vdev_id: Virtual AP device identifier

+ 11 - 0
wmi/inc/wmi_unified_param.h

@@ -5261,6 +5261,7 @@ struct wmi_host_fw_abi_ver {
  * @ast_tid_low_mask_enable: enable tid valid mask for low priority flow
  * @nan_separate_iface_support: Separate iface creation for NAN
  * @time_sync_ftm: enable ftm based time sync
+ * @max_rnr_neighbours: Max supported RNR neighbors in multisoc APs
  */
 typedef struct {
 	uint32_t num_vdevs;
@@ -5359,6 +5360,7 @@ typedef struct {
 		 ast_tid_low_mask_enable:8;
 	bool nan_separate_iface_support;
 	bool time_sync_ftm;
+	uint32_t max_rnr_neighbours;
 } target_resource_config;
 
 /**
@@ -8150,4 +8152,13 @@ struct wmi_host_ani_level_event {
 	uint32_t ani_level;
 };
 #endif /* FEATURE_ANI_LEVEL_REQUEST */
+
+#define WMI_HOST_TBTT_OFFSET_INVALID 0xffffffff
+#define MAX_SUPPORTED_NEIGHBORS 16
+
+/* command type for WMI_PDEV_TBTT_OFFSET_SYNC_CMDID */
+enum wmi_host_tbtt_offset_cmd_type {
+	WMI_HOST_PDEV_GET_TBTT_OFFSET,
+	WMI_HOST_PDEV_SET_TBTT_OFFSET,
+};
 #endif /* _WMI_UNIFIED_PARAM_H_ */

+ 3 - 0
wmi/inc/wmi_unified_priv.h

@@ -2239,6 +2239,9 @@ QDF_STATUS (*extract_vdev_mgmt_offload_event)(
 				struct mgmt_offload_event_params *params);
 #endif /* WLAN_FEATURE_PKT_CAPTURE */
 
+QDF_STATUS (*multisoc_tbtt_sync_cmd)(wmi_unified_t wmi_handle,
+				     struct rnr_tbtt_multisoc_sync_param *param);
+
 #ifdef FEATURE_WLAN_TIME_SYNC_FTM
 QDF_STATUS (*send_wlan_time_sync_ftm_trigger_cmd)(wmi_unified_t wmi_handle,
 						  uint32_t vdev_id,

+ 11 - 0
wmi/inc/wmi_unified_vdev_api.h

@@ -161,4 +161,15 @@ QDF_STATUS wmi_extract_multi_vdev_restart_resp_event(
 		struct wmi_unified *wmi_handle,
 		void *evt_buf,
 		struct multi_vdev_restart_resp *restart_rsp);
+
+/**
+ * wmi_unified_multisoc_tbtt_sync_cmd() - Send cmd to sync tbtt in multisoc case
+ * @wmi_handle: wmi handle
+ * @param: params received in rnr_tbtt_multisoc_sync_param
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_unified_multisoc_tbtt_sync_cmd(wmi_unified_t wmi_handle,
+				   struct rnr_tbtt_multisoc_sync_param *param);
 #endif

+ 6 - 0
wmi/src/wmi_unified_tlv.c

@@ -6729,6 +6729,12 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg,
 	resource_cfg->num_max_sta_vdevs = tgt_res_cfg->num_max_sta_vdevs;
 	resource_cfg->max_bssid_indicator = tgt_res_cfg->max_bssid_indicator;
 	resource_cfg->max_num_group_keys = tgt_res_cfg->max_num_group_keys;
+	/* Deferred AI: Max rnr neighbors supported in multisoc case
+	 * where in SoC can support 6ghz. During WMI init of a SoC
+	 * currently there is no way to figure if another SOC is plugged in
+	 * and it can support 6Ghz.
+	 */
+	resource_cfg->max_rnr_neighbours = MAX_SUPPORTED_NEIGHBORS;
 	if (tgt_res_cfg->atf_config)
 		WMI_RSRC_CFG_FLAG_ATF_CONFIG_ENABLE_SET(resource_cfg->flag1, 1);
 	if (tgt_res_cfg->mgmt_comp_evt_bundle_support)

+ 10 - 0
wmi/src/wmi_unified_vdev_api.c

@@ -167,3 +167,13 @@ QDF_STATUS wmi_extract_multi_vdev_restart_resp_event(
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+QDF_STATUS wmi_unified_multisoc_tbtt_sync_cmd(wmi_unified_t wmi_handle,
+			struct rnr_tbtt_multisoc_sync_param *param)
+{
+	if (wmi_handle->ops->multisoc_tbtt_sync_cmd)
+		return wmi_handle->ops->multisoc_tbtt_sync_cmd(wmi_handle,
+				param);
+
+	return QDF_STATUS_E_FAILURE;
+}