Przeglądaj źródła

qcacmn: T2LM timer changes

Currently the T2LM timer is maintained by host.
Code change made to add support to run the T2LM timer in FW.

CRs-Fixed: 3594141
Change-Id: I7eee4800f68b07d5492a0336e3fe8e0db17d2020
Amruta Kulkarni 1 rok temu
rodzic
commit
1684c8ceac

+ 33 - 0
target_if/mlo_mgr/src/target_if_mlo_mgr.c

@@ -655,6 +655,25 @@ static inline void target_if_fill_provisioned_links(
 		     &t2lm->ieee_link_map_tid,
 		     sizeof(uint16_t) * T2LM_MAX_NUM_TIDS);
 }
+
+/**
+ * target_if_fill_timer() - API to fill the t2lm timer values
+ * @params: Pointer to T2LM params structure
+ * @t2lm: Pointer to T2LM info structure
+ *
+ * Return: none
+ */
+static inline void
+target_if_fill_timer(struct wmi_host_tid_to_link_map_params *params,
+		     struct wlan_t2lm_info *t2lm)
+{
+	if (t2lm->mapping_switch_time_present)
+		params->mapping_switch_time = t2lm->mapping_switch_time;
+
+	if (t2lm->expected_duration_present)
+		params->expected_duration = t2lm->expected_duration;
+}
+
 #else
 static inline void target_if_fill_provisioned_links(
 		struct wmi_host_tid_to_link_map_params *params,
@@ -664,6 +683,12 @@ static inline void target_if_fill_provisioned_links(
 		     &t2lm->hw_link_map_tid,
 		     sizeof(uint16_t) * T2LM_MAX_NUM_TIDS);
 }
+
+static inline void
+target_if_fill_timer(struct wmi_host_tid_to_link_map_params *params,
+		     struct wlan_t2lm_info *t2lm)
+{
+}
 #endif
 
 static QDF_STATUS
@@ -702,6 +727,14 @@ target_if_mlo_send_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
 	if (!params.t2lm_info[params.num_dir].default_link_mapping)
 		target_if_fill_provisioned_links(&params, t2lm);
 
+	target_if_fill_timer(&params, t2lm);
+	t2lm_debug("mapping_switch_time_present %d MST %d",
+		   t2lm->mapping_switch_time_present,
+		   params.mapping_switch_time);
+	t2lm_debug("expected_switch_time_present %d EDT %d",
+		   t2lm->expected_duration_present,
+		   params.expected_duration);
+
 	t2lm_debug("num_dir:%d direction:%d default_link_mapping:%d",
 		   params.num_dir, params.t2lm_info[params.num_dir].direction,
 		   params.t2lm_info[params.num_dir].default_link_mapping);

+ 6 - 0
umac/mlo_mgr/inc/wlan_mlo_t2lm.h

@@ -395,6 +395,8 @@ typedef QDF_STATUS (*wlan_mlo_t2lm_link_update_handler)(
  * @tsf: time sync func value received via beacon
  * @link_update_handler: handler to update T2LM link
  * @is_valid_handler: T2LM handler is valid or not
+ * @mst_start_tsf: calculated mapping switch start tsf
+ * @mst_end_tsf: calculated mapping switch end tsf
  */
 struct wlan_t2lm_context {
 	struct wlan_mlo_t2lm_ie established_t2lm;
@@ -409,6 +411,10 @@ struct wlan_t2lm_context {
 	wlan_mlo_t2lm_link_update_handler
 		link_update_handler[MAX_T2LM_HANDLERS];
 	bool is_valid_handler[MAX_T2LM_HANDLERS];
+#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+	uint64_t mst_start_tsf;
+	uint64_t mst_end_tsf;
+#endif
 };
 
 #ifdef WLAN_FEATURE_11BE

+ 4 - 0
wmi/inc/wmi_unified_param.h

@@ -1153,6 +1153,8 @@ struct wlan_host_t2lm_of_tids {
  * @peer_macaddr: link peer macaddr
  * @num_dir: number of directions for which T2LM info is available
  * @t2lm_info: TID-to-link mapping info for the given directions
+ * @mapping_switch_time: Mapping switch time of this T2LM IE
+ * @expected_duration: Expected duration of this T2LM IE
  * @preferred_links: Preferred link info.
  */
 struct wmi_host_tid_to_link_map_params {
@@ -1160,6 +1162,8 @@ struct wmi_host_tid_to_link_map_params {
 	uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
 	uint8_t num_dir;
 	struct wlan_host_t2lm_of_tids t2lm_info[WLAN_T2LM_MAX_DIRECTION];
+	uint16_t mapping_switch_time;
+	uint32_t expected_duration;
 #ifdef WMI_AP_SUPPORT
 	struct wlan_host_preferred_links preferred_links;
 #endif

+ 15 - 0
wmi/src/wmi_unified_11be_tlv.c

@@ -1409,6 +1409,12 @@ static uint8_t *populate_link_control_tlv(
 
 	return buf_ptr;
 }
+
+static void
+populate_fill_t2lm_timer_tlv(wmi_peer_tid_to_link_map_fixed_param *cmd,
+			     struct wmi_host_tid_to_link_map_params *params)
+{
+}
 #else
 static uint32_t find_buf_len_pref_link(
 		struct wmi_host_tid_to_link_map_params *params,
@@ -1428,6 +1434,14 @@ static uint8_t *populate_link_control_tlv(
 {
 	return buf_ptr;
 }
+
+static void
+populate_fill_t2lm_timer_tlv(wmi_peer_tid_to_link_map_fixed_param *cmd,
+			     struct wmi_host_tid_to_link_map_params *params)
+{
+	cmd->mapping_switch_time = params->mapping_switch_time;
+	cmd->expected_duration = params->expected_duration;
+}
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
@@ -1647,6 +1661,7 @@ static QDF_STATUS send_mlo_peer_tid_to_link_map_cmd_tlv(
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(params->peer_macaddr, &cmd->link_macaddr);
 
 	buf_ptr += sizeof(wmi_peer_tid_to_link_map_fixed_param);
+	populate_fill_t2lm_timer_tlv(cmd, params);
 
 	if (t2lm_info) {
 		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,