Browse Source

qcacld-3.0: Add support for the new NAN EXT vendor command

As part of the NAN Discovery DBS support, a new vendor command
- QCA_NL80211_VENDOR_SUBCMD_NAN_EXT - has been defined that can
carry the binary blob encapsulated within an attribute and can
carry additional attributes to enhance the NAN command interface.
Add related data structures in NAN component and add modules in
OSIF to parse and sanitize this new command data and forward
the NAN message to the NAN component.

Add support for the new NAN EXT vendor command.

Change-Id: I0e6bb833b01a8cbd65e4d42700b5b70599f3ef99
CRs-Fixed: 2339029
Nachiket Kukade 6 years ago
parent
commit
2d3a09d193
2 changed files with 101 additions and 9 deletions
  1. 64 0
      nan/core/inc/nan_public_structs.h
  2. 37 9
      nan/dispatcher/inc/nan_ucfg_api.h

+ 64 - 0
nan/core/inc/nan_public_structs.h

@@ -42,6 +42,18 @@ struct wlan_objmgr_vdev;
 #define NAN_PASSPHRASE_MAX_LEN 63
 #define NAN_CH_INFO_MAX_CHANNELS 4
 
+/**
+ * enum nan_discovery_msg_type - NAN msg type
+ * @NAN_GENERIC_REQ: Type for all the NAN requests other than enable/disable
+ * @NAN_ENABLE_REQ: Request type for enabling the NAN Discovery
+ * @NAN_DISABLE_REQ: Request type for disabling the NAN Discovery
+ */
+enum nan_discovery_msg_type {
+	NAN_GENERIC_REQ = 0,
+	NAN_ENABLE_REQ  = 1,
+	NAN_DISABLE_REQ = 2,
+};
+
 /**
  * enum nan_datapath_msg_type - NDP msg type
  * @NAN_DATAPATH_INF_CREATE_REQ: ndi create request
@@ -460,6 +472,58 @@ struct nan_datapath_end_req {
 	uint32_t ndp_ids[NDP_NUM_INSTANCE_ID];
 };
 
+/**
+ * struct nan_msg_params - NAN request params
+ * @request_data_len: request data length
+ * @request_data: request data
+ */
+struct nan_msg_params {
+	uint16_t request_data_len;
+	/* Variable length, do not add anything after this */
+	uint8_t request_data[];
+};
+
+/**
+ * struct nan_generic_req - A NAN request for the Target
+ * @psoc: Pointer to the psoc object
+ * @params: NAN request structure containing message fr the Target
+ */
+struct nan_generic_req {
+	struct wlan_objmgr_psoc *psoc;
+	/* Variable length, do not add anything after this */
+	struct nan_msg_params params;
+};
+
+/**
+ * struct nan_disable_req - NAN request to disable NAN Discovery
+ * @psoc: Pointer to the psoc object
+ * @disable_2g_discovery: Flag for disabling Discovery in 2G band
+ * @disable_5g_discovery: Flag for disabling Discovery in 5G band
+ * @params: NAN request structure containing message for the target
+ */
+struct nan_disable_req {
+	struct wlan_objmgr_psoc *psoc;
+	bool disable_2g_discovery;
+	bool disable_5g_discovery;
+	/* Variable length, do not add anything after this */
+	struct nan_msg_params params;
+};
+
+/**
+ * struct nan_enable_req - NAN request to enable NAN Discovery
+ * @psoc: Pointer to the psoc object
+ * @social_chan_2g: Social channel in 2G band for the NAN Discovery
+ * @social_chan_5g: Social channel in 5G band for the NAN Discovery
+ * @params: NAN request structure containing message for the target
+ */
+struct nan_enable_req {
+	struct wlan_objmgr_psoc *psoc;
+	uint8_t social_chan_2g;
+	uint8_t social_chan_5g;
+	/* Variable length, do not add anything after this */
+	struct nan_msg_params params;
+};
+
 /**
  * struct nan_datapath_end_rsp_event  - firmware response to ndp end request
  * @vdev: pointer to vdev object

+ 37 - 9
nan/dispatcher/inc/nan_ucfg_api.h

@@ -23,15 +23,8 @@
 #ifndef _NAN_UCFG_API_H_
 #define _NAN_UCFG_API_H_
 
-#include "qdf_types.h"
-#include "qdf_status.h"
 #include "wlan_objmgr_cmn.h"
-
-struct nan_callbacks;
-struct wlan_objmgr_vdev;
-struct wlan_objmgr_psoc;
-struct wlan_objmgr_vdev;
-struct nan_callbacks;
+#include "nan_public_structs.h"
 
 /**
  * ucfg_nan_set_ndi_state: set ndi state
@@ -235,5 +228,40 @@ int ucfg_nan_register_lim_callbacks(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS ucfg_nan_get_callbacks(struct wlan_objmgr_psoc *psoc,
 				  struct nan_callbacks *cb_obj);
 
-#endif /* _NAN_UCFG_API_H_ */
+/**
+ * ucfg_nan_discovery_req: ucfg API for NAN Discovery related requests
+ * @in_req: NAN request
+ * @req_type: Request type
+ *
+ * Return: status of operation
+ */
+static inline QDF_STATUS ucfg_nan_discovery_req(void *in_req, uint32_t req_type)
+{
+	return QDF_STATUS_SUCCESS;
+}
 
+/**
+ * ucfg_is_nan_dbs_supported() - ucfg API to query NAN DBS support
+ * @psoc: pointer to psoc object
+ *
+ * This function returns NAN DBS support status
+ *
+ * Return: True if NAN DBS is supported, False otherwise
+ */
+static inline bool ucfg_is_nan_dbs_supported(struct wlan_objmgr_psoc *psoc)
+{
+	return true;
+}
+
+/**
+ * ucfg_is_nan_enable_allowed() - ucfg API to query if NAN Discovery is
+ * allowed
+ * @psoc: pointer to psoc object
+ *
+ * Return: True if NAN Discovery enable is allowed, False otherwise
+ */
+static inline bool ucfg_is_nan_enable_allowed(struct wlan_objmgr_psoc *psoc)
+{
+	return true;
+}
+#endif /* _NAN_UCFG_API_H_ */