Quellcode durchsuchen

qcacld-3.0: Add support for wildcard OUI in Action OUI framework

Add support for wildcard OUI 0xFFFFFF in action OUI framework.
When the OUI FFFFFF is defined for some action OUI ini and bit 0
of info_presence bit is set to 0 then the check for vendor OUI
in vendor specific IEs and the vendor IE data checks are skipped
and other checks like MAC, Capabilities are done during connection.

Change-Id: I6e996c5d79f4f7bd91e11134b1b8ba69a1ff0253
CRs-Fixed: 2293167
Vignesh Viswanathan vor 6 Jahren
Ursprung
Commit
c6812821f7

+ 25 - 3
components/action_oui/core/src/wlan_action_oui_parse.c

@@ -298,7 +298,6 @@ validate_and_convert_info_mask(uint8_t *token,
 
 	info_mask = hex_value;
 
-	info_mask |= ACTION_OUI_INFO_OUI;
 	ext->info_mask = info_mask;
 
 	if (!info_mask || !(info_mask & ~ACTION_OUI_INFO_OUI)) {
@@ -311,6 +310,16 @@ validate_and_convert_info_mask(uint8_t *token,
 		return false;
 	}
 
+	/*
+	 * If OUI bit is not set in the info presence, we need to ignore the
+	 * OUI and OUI Data. Set OUI and OUI data length to 0 here.
+	 */
+	if (!(info_mask & ACTION_OUI_INFO_OUI)) {
+		ext->oui_length = 0;
+		ext->data_length = 0;
+		ext->data_mask_length = 0;
+	}
+
 	if (info_mask & ACTION_OUI_INFO_MAC_ADDRESS) {
 		*action_token = ACTION_OUI_MAC_ADDR_TOKEN;
 		return true;
@@ -861,6 +870,7 @@ action_oui_search(struct action_oui_psoc_priv *psoc_priv,
 	qdf_list_t *extension_list;
 	QDF_STATUS qdf_status;
 	const uint8_t *oui_ptr;
+	bool wildcard_oui = false;
 
 	oui_priv = psoc_priv->oui_priv[action_id];
 	if (!oui_priv) {
@@ -883,11 +893,22 @@ action_oui_search(struct action_oui_psoc_priv *psoc_priv,
 					   struct action_oui_extension_priv,
 					   item);
 		extension = &priv_ext->extension;
+
+		/*
+		 * If a wildcard OUI bit is not set in the info_mask, proceed
+		 * to other checks skipping the OUI and vendor data checks
+		 */
+
+		if (!(extension->info_mask & ACTION_OUI_INFO_OUI)) {
+			action_oui_debug("Wildcard OUI found");
+			wildcard_oui = true;
+		}
+
 		oui_ptr = wlan_get_vendor_ie_ptr_from_oui(extension->oui,
 							 extension->oui_length,
 							 attr->ie_data,
 							 attr->ie_length);
-		if (!oui_ptr) {
+		if (!oui_ptr  && !wildcard_oui) {
 			action_oui_debug("No matching IE found for OUI");
 			QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE,
 					   QDF_TRACE_LEVEL_DEBUG,
@@ -902,7 +923,7 @@ action_oui_search(struct action_oui_psoc_priv *psoc_priv,
 				   extension->oui,
 				   extension->oui_length);
 
-		if (extension->data_length &&
+		if (extension->data_length && !wildcard_oui &&
 		    !check_for_vendor_oui_data(extension, oui_ptr)) {
 			action_oui_debug("Vendor IE Data mismatch");
 			goto next;
@@ -932,6 +953,7 @@ next:
 
 		node = next_node;
 		next_node = NULL;
+		wildcard_oui = false;
 	}
 
 	qdf_mutex_release(&oui_priv->extension_lock);

+ 5 - 2
core/hdd/inc/wlan_hdd_cfg.h

@@ -13465,6 +13465,9 @@ enum hdd_external_acs_policy {
  *
  * <OUI> is mandatory and it can be either 3 or 5 bytes means 6 or 10
  * hexa-decimal characters
+ * If the OUI and Data checks needs to be ignored, the oui FFFFFF
+ * needs to be provided as OUI and bit 0 of Info_Presence_Bit should
+ * be set to 0.
  *
  * <Data_Length> is mandatory field and should give length of
  * the <Data> if present else zero
@@ -13485,8 +13488,8 @@ enum hdd_external_acs_policy {
  * Presence of <Mac_Address> and <Capability> is
  * controlled by <Info_Presence_Bit> which is mandatory
  * <Info_Presence_Bit> will give the information for
- *   OUI – bit 0 (set/reset don't effect the behaviour,
- *                always enabled in the code)
+ *   OUI – bit 0 Should be set to 1
+ *               Setting to 0 will ignore OUI and data check
  *   Mac Address present – bit 1
  *   NSS – bit 2
  *   HT check – bit 3