Browse Source

qcacmn: Clean up code to avoid duplication

Avoid code duplication by using common definitions
i.e use enum wlan_ml_linfo_subelementid.

Change-Id: Ia09c1a42207461878d023e8f4534f2d26fb2f81b
CRs-Fixed: 3227859
Uraj Sasan 2 years ago
parent
commit
02a498a074
2 changed files with 21 additions and 31 deletions
  1. 13 23
      umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h
  2. 8 8
      umac/mlo_mgr/src/utils_mlo.c

+ 13 - 23
umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h

@@ -1948,6 +1948,19 @@ enum wlan_ml_variant {
 	WLAN_ML_VARIANT_INVALIDSTART,
 };
 
+/**
+ *  enum wlan_ml_linfo_subelementid - IDs for subelements in Multi-Link element
+ *  Link Info field.
+ *  @WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE: Per-STA Profile
+ *  @WLAN_ML_LINFO_SUBELEMID_VENDOR: Vendor specific
+ *  @WLAN_ML_LINFO_SUBELEMID_FRAGMENT: Fragment
+ */
+enum wlan_ml_linfo_subelementid {
+	WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE  = 0,
+	WLAN_ML_LINFO_SUBELEMID_VENDOR = 221,
+	WLAN_ML_LINFO_SUBELEMID_FRAGMENT = 254,
+};
+
 /* End of definitions related to Multi-Link element Control field applicable
  * across variants.
  */
@@ -2206,19 +2219,6 @@ enum wlan_ml_bv_cinfo_emlcap_transtimeout {
  * subelements.
  */
 
-/**
- *  enum wlan_ml_bv_linfo_subelementid - IDs for subelements in Basic variant
- *  Multi-Link element Link Info field.
- *  @WLAN_ML_BV_LINFO_SUBELEMID_PERSTAPROFILE: Per-STA Profile
- *  @WLAN_ML_BV_LINFO_SUBELEMID_VENDOR: Vendor specific
- *  @WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT: Fragment
- */
-enum wlan_ml_bv_linfo_subelementid {
-	WLAN_ML_BV_LINFO_SUBELEMID_PERSTAPROFILE  = 0,
-	WLAN_ML_BV_LINFO_SUBELEMID_VENDOR = 221,
-	WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT = 254,
-};
-
 /**
  * struct wlan_ml_bv_linfo_perstaprof - Fixed fields of Per-STA Profile
  * subelement in Basic variant Multi-Link element Link Info field
@@ -2345,16 +2345,6 @@ struct wlan_ml_bv_linfo_perstaprof_stainfo_dtiminfo {
  * subelements.
  */
 
-/**
- *  enum wlan_ml_prv_linfo_subelementid - IDs for subelements in Probe Req
- *  Multi-Link element Link Info field.
- *  @WLAN_ML_PRV_LINFO_SUBELEMID_PERSTAPROFILE: Per-STA Profile
- */
-enum wlan_ml_prv_linfo_subelementid {
-	WLAN_ML_PRV_LINFO_SUBELEMID_PERSTAPROFILE  = 0,
-	WLAN_ML_PRV_LINFO_SUBELEMID_FRAGMENT = 254,
-};
-
 /**
  * struct wlan_ml_prv_linfo_perstaprof - Fixed fields of Per-STA Profile
  * subelement in Probe Request variant Multi-Link element Link Info field

+ 8 - 8
umac/mlo_mgr/src/utils_mlo.c

@@ -799,7 +799,7 @@ QDF_STATUS util_parse_partner_info_from_linkinfo(uint8_t *linkinfo,
 		subelemseqtotallen = 0;
 		subelemseqpayloadlen = 0;
 
-		ret = wlan_get_subelem_fragseq_info(WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT,
+		ret = wlan_get_subelem_fragseq_info(WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 						    linkinfo_currpos,
 						    linkinfo_remlen,
 						    &is_subelemfragseq,
@@ -818,7 +818,7 @@ QDF_STATUS util_parse_partner_info_from_linkinfo(uint8_t *linkinfo,
 				  subelemseqpayloadlen);
 
 			ret = wlan_defrag_subelem_fragseq(true,
-							  WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT,
+							  WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 							  linkinfo_currpos,
 							  linkinfo_remlen,
 							  NULL,
@@ -855,7 +855,7 @@ QDF_STATUS util_parse_partner_info_from_linkinfo(uint8_t *linkinfo,
 			subelemseqpayloadlen = linkinfo_currpos[TAG_LEN_POS];
 		}
 
-		if (subelemid == WLAN_ML_BV_LINFO_SUBELEMID_PERSTAPROFILE) {
+		if (subelemid == WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE) {
 			is_macaddr_valid = false;
 
 			ret = util_parse_bvmlie_perstaprofile_stactrl(linkinfo_currpos +
@@ -966,7 +966,7 @@ util_parse_probereq_info_from_linkinfo(uint8_t *linkinfo,
 		subelemseqtotallen = 0;
 		subelemseqpayloadlen = 0;
 
-		ret = wlan_get_subelem_fragseq_info(WLAN_ML_PRV_LINFO_SUBELEMID_FRAGMENT,
+		ret = wlan_get_subelem_fragseq_info(WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 						    linkinfo_currpos,
 						    linkinfo_remlen,
 						    &is_subelemfragseq,
@@ -985,7 +985,7 @@ util_parse_probereq_info_from_linkinfo(uint8_t *linkinfo,
 				  subelemseqpayloadlen);
 
 			ret = wlan_defrag_subelem_fragseq(true,
-							  WLAN_ML_PRV_LINFO_SUBELEMID_FRAGMENT,
+							  WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 							  linkinfo_currpos,
 							  linkinfo_remlen,
 							  NULL,
@@ -1022,7 +1022,7 @@ util_parse_probereq_info_from_linkinfo(uint8_t *linkinfo,
 			subelemseqpayloadlen = linkinfo_currpos[TAG_LEN_POS];
 		}
 
-		if (subelemid == WLAN_ML_PRV_LINFO_SUBELEMID_PERSTAPROFILE) {
+		if (subelemid == WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE) {
 			ret = util_parse_prvmlie_perstaprofile_stactrl(linkinfo_currpos +
 								      sizeof(struct subelem_header),
 								      subelemseqpayloadlen,
@@ -1831,7 +1831,7 @@ QDF_STATUS util_gen_link_reqrsp_cmn(uint8_t *frame, qdf_size_t frame_len,
 	subelemseqtotallen = 0;
 	subelemseqpayloadlen = 0;
 
-	ret = wlan_get_subelem_fragseq_info(WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT,
+	ret = wlan_get_subelem_fragseq_info(WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 					    persta_prof,
 					    persta_prof_bufflen,
 					    &is_subelemfragseq,
@@ -1853,7 +1853,7 @@ QDF_STATUS util_gen_link_reqrsp_cmn(uint8_t *frame, qdf_size_t frame_len,
 			  subelemseqpayloadlen);
 
 		ret = wlan_defrag_subelem_fragseq(true,
-						  WLAN_ML_BV_LINFO_SUBELEMID_FRAGMENT,
+						  WLAN_ML_LINFO_SUBELEMID_FRAGMENT,
 						  persta_prof,
 						  persta_prof_bufflen,
 						  NULL,