Browse Source

qcacmn: Add 11ax related elements to common scan code

Add 11ax related elements, HECAP and HEOPS IE to common scan code.

Change-Id: Ic4413430e8183a1e41b53999746609f047caa374
CRs-Fixed: 1095299
Abhishek Singh 8 năm trước cách đây
mục cha
commit
e5f3f0f10e

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

@@ -63,6 +63,11 @@
 #define VHT_INTEROP_OUI_SUBTYPE 0x08
 #define VHT_INTEROP_OUI_SUBTYPE_VENDORSPEC 0x18
 
+/* ATH HE OUI ( in little endian) */
+#define ATH_HE_OUI                  0x741300
+#define ATH_HE_CAP_SUBTYPE          0x01
+#define ATH_HE_OP_SUBTYPE           0x02
+
 /* EPR information element flags */
 #define ERP_NON_ERP_PRESENT   0x01
 #define ERP_USE_PROTECTION    0x02
@@ -943,6 +948,37 @@ is_bwnss_oui(uint8_t *frm)
 		((ATH_OUI_BW_NSS_MAP_TYPE << 24) | ATH_OUI));
 }
 
+/**
+ * is_he_cap_oui() - If vendor IE is HE CAP OUI
+ * @frm: vendor IE pointer
+ *
+ * API to check if vendor IE is HE CAP
+ *
+ * Return: true if its HE CAP IE
+ */
+static inline bool
+is_he_cap_oui(uint8_t *frm)
+{
+	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
+		((ATH_HE_CAP_SUBTYPE << 24) | ATH_HE_OUI));
+}
+
+/**
+ * is_he_op_oui() - If vendor IE is HE OP OUI
+ * @frm: vendor IE pointer
+ *
+ * API to check if vendor IE is HE OP OUT
+ *
+ * Return: true if its HE OP OUI
+ */
+static inline bool
+is_he_op_oui(uint8_t *frm)
+{
+	return (frm[1] > 4) && (LE_READ_4(frm + 2) ==
+		((ATH_HE_OP_SUBTYPE << 24) | ATH_HE_OUI));
+}
+
+
 /**
  * wlan_parse_rsn_ie() - parse rsn ie
  * @rsn_ie: rsn ie ptr

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

@@ -142,6 +142,8 @@ struct ie_list {
 	uint8_t *bwnss_map;
 	uint8_t *secchanoff;
 	uint8_t *mdie;
+	uint8_t *hecap;
+	uint8_t *heop;
 };
 
 /**

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

@@ -646,6 +646,8 @@ util_scan_copy_beacon_data(struct scan_cache_entry *new_entry,
 	ie_lst->txpwrenvlp = conv_ptr(ie_lst->txpwrenvlp, old_ptr, new_ptr);
 	ie_lst->bwnss_map = conv_ptr(ie_lst->bwnss_map, old_ptr, new_ptr);
 	ie_lst->mdie = conv_ptr(ie_lst->mdie, old_ptr, new_ptr);
+	ie_lst->hecap = conv_ptr(ie_lst->hecap, old_ptr, new_ptr);
+	ie_lst->heop = conv_ptr(ie_lst->heop, old_ptr, new_ptr);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1242,6 +1244,35 @@ util_scan_entry_mlme_info(struct scan_cache_entry *scan_entry)
 	return &(scan_entry->mlme_info);
 }
 
+/**
+ * util_scan_entry_hecap() - function to read he caps vendor ie
+ * @scan_entry: scan entry
+ *
+ * API, function to read he caps vendor ie
+ *
+ * Return: he caps vendorie or NULL if ie is not present
+ */
+static inline uint8_t*
+util_scan_entry_hecap(struct scan_cache_entry *scan_entry)
+{
+	return scan_entry->ie_list.hecap;
+}
+
+
+/**
+ * util_scan_entry_heop() - function to read heop vendor ie
+ * @scan_entry: scan entry
+ *
+ * API, function to read heop vendor ie
+ *
+ * Return, heop vendorie or NULL if ie is not present
+ */
+static inline uint8_t*
+util_scan_entry_heop(struct scan_cache_entry *scan_entry)
+{
+	return scan_entry->ie_list.heop;
+}
+
 /**
  * util_get_last_scan_time() - function to get last scan time on this pdev
  * @vdev: vdev object

+ 7 - 0
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -392,7 +392,14 @@ util_scan_parse_vendor_ie(struct scan_cache_entry *scan_params,
 		 * hence copy data just after version byte
 		 */
 		scan_params->ie_list.bwnss_map = (((uint8_t *)ie) + 8);
+	} else if (is_he_cap_oui(((uint8_t *)(ie))) &&
+			!(scan_params->ie_list.hecap)) {
+		scan_params->ie_list.hecap = (uint8_t *)ie;
+	} else if (is_he_op_oui(((uint8_t *)(ie))) &&
+			!(scan_params->ie_list.heop)) {
+		scan_params->ie_list.heop = (uint8_t *)ie;
 	}
+
 }
 
 static QDF_STATUS