Browse Source

qcacmn: add __packed for bit mapping structures

Currently, structure tbtt_information_header and
rnr_mld_info don't have attribute __packed. When
fetching the value of bss_param_change_cnt, it
tries to align with byte and causes wrong value.

And these are OTA structures which should be moved
to file wlan_cmn_ieee80211.h.

Change-Id: I326e62e6f513c2b43fe08c278aa4b5a245d2d35c
CRs-Fixed: 3313710
Paul Zhang 2 years ago
parent
commit
2158048410

+ 30 - 0
umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h

@@ -1406,6 +1406,21 @@ struct htcap_ie {
 	struct htcap_cmn_ie ie;
 } qdf_packed;
 
+/**
+ * struct tbtt_information_header - TBTT information header
+ * @tbbt_info_fieldtype: TBTT information field type
+ * @filter_neighbor_ap: filtered neighbor ap
+ * @tbbt_info_count: TBTT information count
+ * @tbtt_info_length: TBTT information length
+ */
+struct tbtt_information_header {
+	uint16_t tbbt_info_fieldtype:2,
+		 filtered_neighbor_ap:1,
+		 reserved:1,
+		 tbtt_info_count:4,
+		 tbtt_info_length:8;
+} qdf_packed;
+
 /**
  * struct fils_indication_ie: FILS indication IE element
  * @id: id
@@ -1879,6 +1894,21 @@ struct wlan_ie_ehtops {
 /* Size in octets of the BSS Parameters Change Count (sub)field */
 #define WLAN_ML_BSSPARAMCHNGCNT_SIZE                    1
 
+/**
+ * struct rnr_mld_info - Reduced Neighbor Report MLD information
+ * @mld_id: MLD ID
+ * @link_id: Link ID
+ * @bss_param_change_cnt: BSS parameters change count
+ * @all_updates_included: All Updates Included
+ */
+struct rnr_mld_info {
+	uint8_t mld_id;
+	uint16_t link_id: 4,
+		 bss_param_change_cnt: 8,
+		 all_updates_included: 1,
+		 reserved: 3;
+} qdf_packed;
+
 /**
  * struct wlan_ie_multilink - Fixed fields in Multi-Link IE
  * @elem_id: Element ID

+ 0 - 31
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -408,22 +408,6 @@ struct non_inheritance_ie {
 	bool non_inh_ie_found;
 };
 
-#ifdef WLAN_FEATURE_11BE_MLO
-/**
- * struct rnr_mld_info - Reduced Neighbor Report MLD information
- * @mld_id: MLD ID
- * @link_id: Link ID
- * @bss_param_change_cnt: BSS parameters change count
- * @all_updates_included: All Updates Included
- */
-struct rnr_mld_info {
-	uint8_t mld_id;
-	uint16_t link_id: 4,
-		 bss_param_change_cnt: 8,
-		 all_updates_included: 1,
-		 reserved: 3;
-};
-#endif
 /**
  * struct rnr_bss_info - Reduced Neighbor Report BSS information
  * @neighbor_ap_tbtt_offset: Neighbor AP TBTT offset
@@ -450,21 +434,6 @@ struct rnr_bss_info {
 #endif
 };
 
-/**
- * struct tbtt_information_header - TBTT information header
- * @tbbt_info_fieldtype: TBTT information field type
- * @filter_neighbor_ap: filtered neighbor ap
- * @tbbt_info_count: TBTT information count
- * @tbtt_info_length: TBTT information length
- */
-struct tbtt_information_header {
-	uint16_t tbbt_info_fieldtype:2;
-	uint16_t filtered_neighbor_ap:1;
-	uint16_t reserved:1;
-	uint16_t tbtt_info_count:4;
-	uint16_t tbtt_info_length:8;
-};
-
 /**
  * struct neighbor_ap_info_field - Neighbor information field
  * @tbtt_info_header: TBTT information header