소스 검색

qcacmn: Add WMI MLO params for CSA beacon template

A new TLV is added to send partner link CSA/ECSA count offset to FW as
part of beacon template. Add WMI changes to populate these TLVs in the
beacon template send function.

To fix the compilation issue, added forward declaration of 'struct
vdev_mlme_obj' and removed 'include/wlan_vdev_mlme.h' include file from
wlan_mlo_mgr_public_structs.h.

Change-Id: I6e421b29bb887bec711a23db1458aca4d112ade4
CRs-Fixed: 2983249
Shashikala Prabhu 4 년 전
부모
커밋
3925ddf85b

+ 36 - 2
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h

@@ -26,6 +26,9 @@
 #define __WLAN_VDEV_MGR_TX_OPS_DEFS_H__
 
 #include <qdf_nbuf.h>
+#ifdef WLAN_FEATURE_11BE_MLO
+#include <wlan_mlo_mgr_public_structs.h>
+#endif
 
 /** slot time long */
 #define WLAN_MLME_VDEV_SLOT_TIME_LONG   0x1
@@ -192,6 +195,34 @@ struct tbttoffset_params {
 /* Send CSA switch count event for every update to switch count */
 #define WLAN_CSA_EVENT_BMAP_ALL                  0XFFFFFFFF
 
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * struct ml_bcn_partner_info - Partner link beacon information
+ * @vdev_id: Vdev id
+ * @hw_link_id: Unique hw link id across SoCs
+ * @beacon_interval: Beacon interval
+ * @csa_switch_count_offset: CSA swith count offset in beacon frame
+ * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
+ */
+struct ml_bcn_partner_info {
+	uint32_t vdev_id;
+	uint32_t hw_link_id;
+	uint32_t beacon_interval;
+	uint32_t csa_switch_count_offset;
+	uint32_t ext_csa_switch_count_offset;
+};
+
+/**
+ * struct mlo_bcn_templ_partner_links - ML partner links
+ * @num_links: Number of links
+ * @partner_info: Partner link info
+ */
+struct mlo_bcn_templ_partner_links {
+	uint8_t num_links;
+	struct ml_bcn_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS];
+};
+#endif
+
 /**
  * struct beacon_tmpl_params - beacon template cmd parameter
  * @vdev_id: vdev id
@@ -212,6 +243,7 @@ struct tbttoffset_params {
  *     switch count is 0, 1, 4, and 5, set the bitmap to (0X80000033)
  * @enable_bigtk: enable bigtk or not
  * @frm: beacon template parameter
+ * @mlo_partner: Partner link information
  */
 struct beacon_tmpl_params {
 	uint8_t vdev_id;
@@ -227,6 +259,9 @@ struct beacon_tmpl_params {
 	uint32_t csa_event_bitmap;
 	bool enable_bigtk;
 	uint8_t *frm;
+#ifdef WLAN_FEATURE_11BE_MLO
+	struct mlo_bcn_templ_partner_links mlo_partner;
+#endif
 };
 
 /**
@@ -479,7 +514,6 @@ struct ml_vdev_start_partner_info {
 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
 };
 
-#define MAX_ML_PARTNER_LINKS 4
 /**
  * struct mlo_vdev_start__partner_links - ML partner links
  * @num_links: Number of links
@@ -487,7 +521,7 @@ struct ml_vdev_start_partner_info {
  */
 struct mlo_vdev_start_partner_links {
 	uint8_t num_links;
-	struct ml_vdev_start_partner_info partner_info[MAX_ML_PARTNER_LINKS];
+	struct ml_vdev_start_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS];
 };
 #endif
 /**

+ 1 - 1
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -27,7 +27,6 @@
 #include <wlan_cmn_ieee80211.h>
 #include <wlan_cmn.h>
 #include <wlan_objmgr_global_obj.h>
-#include <include/wlan_vdev_mlme.h>
 
 /* MAX MLO dev support */
 #define WLAN_UMAC_MLO_MAX_VDEVS 3
@@ -39,6 +38,7 @@
 #define MAX_MLO_PEER 512
 
 struct mlo_mlme_ext_ops;
+struct vdev_mlme_obj;
 
 /*
  * struct mlo_setup_info

+ 17 - 0
wmi/inc/wmi_unified_11be_tlv.h

@@ -58,6 +58,16 @@ uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr,
  */
 uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 					 struct vdev_start_params *req);
+/**
+ * bcn_tmpl_add_ml_partner_links - Add MLO partner links in beacon template
+ *                                 command
+ * @buf_ptr: pointer to beacon cmd buffer.
+ * @param: pointer to beacon template params
+ *
+ * Return: pointer to new offset of cmd buffer
+ */
+uint8_t *bcn_tmpl_add_ml_partner_links(uint8_t *buf_ptr,
+				       struct beacon_tmpl_params *param);
 /**
  *  peer_create_add_mlo_params() - Add MLO params in peer create cmd
  *  @buf_ptr: pointer to peer create cmd buffer.
@@ -131,6 +141,13 @@ static uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 	return buf_ptr + WMI_TLV_HDR_SIZE;
 }
 
+static uint8_t *bcn_tmpl_add_ml_partner_links(uint8_t *buf_ptr,
+					      struct beacon_tmpl_params *param)
+{
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+	return buf_ptr + WMI_TLV_HDR_SIZE;
+}
+
 static uint8_t *peer_create_add_mlo_params(uint8_t *buf_ptr,
 					  struct peer_create_params *req)
 {

+ 1 - 2
wmi/inc/wmi_unified_param.h

@@ -1057,7 +1057,6 @@ struct ml_partner_info {
 	uint32_t hw_mld_link_id;
 };
 
-#define WMI_MAX_ML_PARTNER_LINKS 4
 /**
  * struct peer_assoc_ml_partner_links - ML partner links
  * @num_links: Number of links
@@ -1065,7 +1064,7 @@ struct ml_partner_info {
  */
 struct peer_assoc_ml_partner_links {
 	uint8_t num_links;
-	struct ml_partner_info partner_info[WMI_MAX_ML_PARTNER_LINKS];
+	struct ml_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS];
 };
 #endif
 /**

+ 42 - 0
wmi/src/wmi_unified_11be_tlv.c

@@ -113,6 +113,48 @@ uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 		 sizeof(wmi_partner_link_params));
 }
 
+uint8_t *bcn_tmpl_add_ml_partner_links(uint8_t *buf_ptr,
+				       struct beacon_tmpl_params *param)
+{
+	wmi_bcn_tmpl_ml_params *ml_partner_link;
+	struct mlo_bcn_templ_partner_links *ml_bcn_tmpl;
+	uint8_t i;
+
+	if (param->mlo_partner.num_links > WLAN_UMAC_MLO_MAX_VDEVS) {
+		wmi_err("mlo_partner.num_link(%d) are greater than supported partner links(%d)",
+			param->mlo_partner.num_links, WLAN_UMAC_MLO_MAX_VDEVS);
+		return buf_ptr;
+	}
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+		       (param->mlo_partner.num_links *
+			sizeof(wmi_bcn_tmpl_ml_params)));
+	buf_ptr += sizeof(uint32_t);
+
+	ml_bcn_tmpl = &param->mlo_partner;
+	ml_partner_link = (wmi_bcn_tmpl_ml_params *)buf_ptr;
+	for (i = 0; i < ml_bcn_tmpl->num_links; i++) {
+		WMITLV_SET_HDR(&ml_partner_link->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_bcn_tmpl_ml_params,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_bcn_tmpl_ml_params)
+			       );
+		ml_partner_link->vdev_id = ml_bcn_tmpl->partner_info[i].vdev_id;
+		ml_partner_link->hw_link_id =
+			ml_bcn_tmpl->partner_info[i].hw_link_id;
+		ml_partner_link->beacon_interval =
+			ml_bcn_tmpl->partner_info[i].beacon_interval;
+		ml_partner_link->csa_switch_count_offset =
+			ml_bcn_tmpl->partner_info[i].csa_switch_count_offset;
+		ml_partner_link->ext_csa_switch_count_offset =
+			ml_bcn_tmpl->partner_info[i].ext_csa_switch_count_offset;
+		ml_partner_link++;
+	}
+
+	return buf_ptr +
+		(param->mlo_partner.num_links *
+		 sizeof(wmi_bcn_tmpl_ml_params));
+}
+
 size_t peer_create_mlo_params_size(struct peer_create_params *req)
 {
 	return sizeof(wmi_peer_create_mlo_params) + WMI_TLV_HDR_SIZE;

+ 3 - 0
wmi/src/wmi_unified_tlv.c

@@ -2498,6 +2498,9 @@ static QDF_STATUS send_beacon_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle,
 	WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(buf_ptr, param->frm,
 					param->tmpl_len);
 
+	buf_ptr += param->tmpl_len;
+	buf_ptr = bcn_tmpl_add_ml_partner_links(buf_ptr, param);
+
 	wmi_mtrace(WMI_BCN_TMPL_CMDID, cmd->vdev_id, 0);
 	ret = wmi_unified_cmd_send(wmi_handle,
 				   wmi_buf, wmi_buf_len, WMI_BCN_TMPL_CMDID);