Parcourir la source

qcacmn: Add API to check NAN OUI

Firmware forwards certain action frames to host driver for NAN
functionality. Host driver forwards these frames to kernel.
Userspace may register for these frames on NAN interface and
receive the same.

So, filter the NAN action frames based on WFA OUI (0x50, 0x6f, 0x9a)
and NAN WFA version (0x13) and send them on NAN interface.
Add an API to check for the NAN WFA OUI + NAN WFA version.

Change-Id: I46640060299b9bff20f4b191c2c421deedf84e20
CRs-Fixed: 3694518
Rahul Gusain il y a 1 an
Parent
commit
564d0238ea
1 fichiers modifiés avec 24 ajouts et 3 suppressions
  1. 24 3
      umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h

+ 24 - 3
umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -154,9 +154,11 @@
 
 #define WLAN_SEQ_SEQ_SHIFT 4
 
-#define P2P_WFA_OUI {0x50, 0x6f, 0x9a}
+#define WFA_OUI {0x50, 0x6f, 0x9a}
 #define P2P_WFA_VER 0x09
 
+#define NAN_WFA_VER 0x13
+
 #define WSC_OUI 0x0050f204
 #define MBO_OCE_OUI 0x506f9a16
 #define MBO_OCE_OUI_SIZE 4
@@ -4066,7 +4068,7 @@ is_sfa_oui(uint8_t *frm)
 static inline bool
 is_p2p_oui(const uint8_t *frm)
 {
-	const uint8_t wfa_oui[3] = P2P_WFA_OUI;
+	const uint8_t wfa_oui[3] = WFA_OUI;
 
 	return (frm[1] >= 4) &&
 		(frm[2] == wfa_oui[0]) &&
@@ -4075,6 +4077,25 @@ is_p2p_oui(const uint8_t *frm)
 		(frm[5] == P2P_WFA_VER);
 }
 
+/**
+ * is_nan_oui() - If vendor OUI is NAN type
+ * @frm: pointer to OUI array
+ *
+ * API to check if frame is NAN
+ *
+ * Return: true if its NAN frame otherwise false
+ */
+static inline bool
+is_nan_oui(const uint8_t *frm)
+{
+	const uint8_t wfa_oui[3] = WFA_OUI;
+
+	return (frm[0] == wfa_oui[0]) &&
+		(frm[1] == wfa_oui[1]) &&
+		(frm[2] == wfa_oui[2]) &&
+		(frm[3] == NAN_WFA_VER);
+}
+
 /**
  * is_qca_son_oui() - If vendor IE is QCA WHC type
  * @frm: vendor IE pointer