xref: /OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/wl_cfgnan.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Neighbor Awareness Networking
3  *
4  * Copyright (C) 2020, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions of
16  * the license of that module.  An independent module is a module which is not
17  * derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *
21  * <<Broadcom-WL-IPTag/Dual:>>
22  */
23 
24 #ifndef _wl_cfgnan_h_
25 #define _wl_cfgnan_h_
26 
27 /* NAN structs versioning b/w DHD and HAL
28 * define new version if any change in any of the shared structs
29 */
30 #define NAN_HAL_VERSION_1	0x2
31 
32 #define NAN_EVENT_BUFFER_SIZE_LARGE	1024u
33 
34 #define NAN_RANGE_EXT_CANCEL_SUPPORT_VER 2
35 #define WL_NAN_IOV_BATCH_VERSION	0x8000
36 #define WL_NAN_AVAIL_REPEAT_INTVL	0x0200
37 #define WL_NAN_AVAIL_START_INTVL	160
38 #define WL_NAN_AVAIL_DURATION_INTVL	336
39 #define NAN_IOCTL_BUF_SIZE		256u
40 #define NAN_IOCTL_BUF_SIZE_MED		512u
41 #define NAN_IOCTL_BUF_SIZE_LARGE	1024u
42 #define NAN_EVENT_NAME_MAX_LEN		40u
43 #define NAN_RTT_IOVAR_BUF_SIZE		1024u
44 #define WL_NAN_EVENT_CLEAR_BIT		32
45 #define NAN_EVENT_MASK_ALL			0x7fffffff
46 #define NAN_MAX_AWAKE_DW_INTERVAL	5
47 #define NAN_MAXIMUM_ID_NUMBER 255
48 #define NAN_MAXIMUM_MASTER_PREFERENCE 254
49 #define NAN_ID_RESERVED	0
50 #define NAN_ID_MIN	1
51 #define NAN_ID_MAX	255
52 #define NAN_DEF_SOCIAL_CHAN_2G	6
53 #define NAN_DEF_SOCIAL_CHAN_5G	149
54 #define NAN_DEF_SEC_SOCIAL_CHAN_5G	44
55 #define NAN_MAX_SOCIAL_CHANNELS	3
56 /* Keeping RSSI threshold value to be -70dBm */
57 #define NAN_DEF_RSSI_NOTIF_THRESH -70
58 /* Keeping default RSSI mid value to be -70dBm */
59 #define NAN_DEF_RSSI_MID -75
60 /* Keeping default RSSI close value to be -60dBm */
61 #define NAN_DEF_RSSI_CLOSE -60
62 #define WL_AVAIL_BIT_MAP	"1111111111111111111111111111111100000000000000000000000000000000"
63 #define WL_5G_AVAIL_BIT_MAP	"0000000011111111111111111111111111111111000000000000000000000000"
64 #define WL_AVAIL_CHANNEL_2G	6
65 #define WL_AVAIL_BANDWIDTH_2G	WL_CHANSPEC_BW_20
66 #define WL_AVAIL_CHANNEL_5G	149
67 #define WL_AVAIL_BANDWIDTH_5G	WL_CHANSPEC_BW_80
68 #define NAN_RANGING_PERIOD WL_AVAIL_PERIOD_1024
69 #define NAN_SYNC_DEF_AWAKE_DW	1
70 #define NAN_RNG_TERM_FLAG_NONE	0
71 
72 #define NAN_BLOOM_LENGTH_DEFAULT        240u
73 #define NAN_SRF_MAX_MAC (NAN_BLOOM_LENGTH_DEFAULT / ETHER_ADDR_LEN)
74 #define NAN_SRF_CTRL_FIELD_LEN 1u
75 
76 #define MAX_IF_ADD_WAIT_TIME	1000
77 #define NAN_DP_ROLE_INITIATOR  0x0001
78 #define NAN_DP_ROLE_RESPONDER  0x0002
79 
80 #define WL_NAN_OBUF_DATA_OFFSET  (OFFSETOF(bcm_iov_batch_buf_t, cmds[0]) + \
81 		OFFSETOF(bcm_iov_batch_subcmd_t, data[0]))
82 #define NAN_INVALID_ROLE(role)	(role > WL_NAN_ROLE_ANCHOR_MASTER)
83 #define NAN_INVALID_CHANSPEC(chanspec)	((chanspec == INVCHANSPEC) || \
84 	(chanspec == 0))
85 #define NAN_INVALID_EVENT(num)	((num < WL_NAN_EVENT_START) || \
86 	(num >= WL_NAN_EVENT_INVALID))
87 #define NAN_INVALID_PROXD_EVENT(num)	(num != WLC_E_PROXD_NAN_EVENT)
88 #define NAN_EVENT_BIT(event) (1U << (event - WL_NAN_EVENT_START))
89 #define NAN_EVENT_MAP(event) ((event) - WL_NAN_EVENT_START)
90 #define NAME_TO_STR(name) #name
91 #define NAN_ID_CTRL_SIZE ((NAN_MAXIMUM_ID_NUMBER/8) + 1)
92 
93 #define tolower(c) bcm_tolower(c)
94 
95 #define NMR2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5], (a)[6], (a)[7]
96 #define NMRSTR "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x"
97 
98 #define NAN_DBG_ENTER() {WL_DBG(("Enter\n"));}
99 #define NAN_DBG_EXIT() {WL_DBG(("Exit\n"));}
100 
101 /* Service Control Type length */
102 #define NAN_SVC_CONTROL_TYPE_MASK	((1 << NAN_SVC_CONTROL_TYPE_LEN) - 1)
103 
104 #ifndef strtoul
105 #define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
106 #endif
107 
108 #define NAN_MAC_ADDR_LEN 6u
109 #define NAN_DP_MAX_APP_INFO_LEN	512u
110 
111 #define NAN_SDE_CF_DP_REQUIRED      (1 << 2)
112 #define NAN_SDE_CF_DP_TYPE      (1 << 3)
113 #define NAN_SDE_CF_MULTICAST_TYPE   (1 << 4)
114 #define NAN_SDE_CF_SECURITY_REQUIRED    (1 << 6)
115 #define NAN_SDE_CF_RANGING_REQUIRED (1 << 7)
116 #define NAN_SDE_CF_RANGE_PRESENT    (1 << 8)
117 
118 #define CHECK_BIT(m, n) ((m >> n) & 1)? 1 : 0
119 #define WL_NAN_EVENT_DIC_MAC_ADDR_BIT	0
120 #define WL_NAN_EVENT_START_EVENT	1
121 #define WL_NAN_EVENT_JOIN_EVENT		2
122 
123 /* Disabling svc specific(as per part of sub & pub calls) events based on below bits */
124 #define WL_NAN_EVENT_SUPPRESS_TERMINATE_BIT	0
125 #define WL_NAN_EVENT_SUPPRESS_MATCH_EXP_BIT	1
126 #define WL_NAN_EVENT_SUPPRESS_RECEIVE_BIT	2
127 #define WL_NAN_EVENT_SUPPRESS_REPLIED_BIT	3
128 
129 /* Disabling tranmsit followup events based on below bit */
130 #define WL_NAN_EVENT_SUPPRESS_FOLLOWUP_RECEIVE_BIT	0
131 
132 #define C2S(x)  case x: id2str = #x
133 #define NAN_BLOOM_LENGTH_DEFAULT	240u
134 #define NAN_SRF_MAX_MAC			(NAN_BLOOM_LENGTH_DEFAULT / ETHER_ADDR_LEN)
135 #define NAN_MAX_PMK_LEN			32u
136 #define NAN_ERROR_STR_LEN		255u
137 
138 /* NAN related Capabilities */
139 #define MAX_CONCURRENT_NAN_CLUSTERS		1u
140 #define MAX_PUBLISHES				8u
141 #define MAX_SUBSCRIBES				8u
142 #define MAX_SVC_NAME_LEN			255u
143 #define MAX_MATCH_FILTER_LEN			255u
144 #define MAX_TOTAL_MATCH_FILTER_LEN		510u
145 #define	NAN_MAX_SERVICE_SPECIFIC_INFO_LEN	255u
146 #define NAN_MAX_NDI				3u
147 #define MAX_NDP_SESSIONS			5u
148 #define MAX_APP_INFO_LEN			255u
149 #define	MAX_QUEUED_TX_FOLLOUP_MSGS		10u
150 #define	MAX_SDEA_SVC_INFO_LEN			255u
151 #define	MAX_SUBSCRIBE_ADDRESS			10u
152 #define	CIPHER_SUITE_SUPPORTED			1u
153 #define	MAX_SCID_LEN				0u
154 #define	IS_NDP_SECURITY_SUPPORTED		true
155 #define	NDP_SUPPORTED_BANDS			2u
156 #define NAN_MAX_RANGING_INST			8u
157 #define NAN_MAX_RANGING_SSN_ALLOWED		1u
158 #define NAN_MAX_SVC_INST			(MAX_PUBLISHES + MAX_SUBSCRIBES)
159 #define NAN_SVC_INST_SIZE			32u
160 #define NAN_START_STOP_TIMEOUT			5000u
161 #define NAN_MAX_NDP_PEER			8u
162 #define NAN_DISABLE_CMD_DELAY			530u
163 #define NAN_WAKELOCK_TIMEOUT			(NAN_DISABLE_CMD_DELAY + 100u)
164 
165 #define NAN_NMI_RAND_PVT_CMD_VENDOR		(1 << 31)
166 #define NAN_NMI_RAND_CLUSTER_MERGE_ENAB		(1 << 30)
167 #define NAN_NMI_RAND_AUTODAM_LWT_MODE_ENAB	(1 << 29)
168 
169 #ifdef WL_NAN_DEBUG
170 #define NAN_MUTEX_LOCK() {WL_DBG(("Mutex Lock: Enter: %s\n", __FUNCTION__)); \
171 	mutex_lock(&cfg->nancfg->nan_sync);}
172 #define NAN_MUTEX_UNLOCK() {mutex_unlock(&cfg->nancfg->nan_sync); \
173 	WL_DBG(("Mutex Unlock: Exit: %s\n", __FUNCTION__));}
174 #else
175 #define NAN_MUTEX_LOCK() {mutex_lock(&cfg->nancfg->nan_sync);}
176 #define NAN_MUTEX_UNLOCK() {mutex_unlock(&cfg->nancfg->nan_sync);}
177 #endif /* WL_NAN_DEBUG */
178 #define	NAN_ATTR_SUPPORT_2G_CONFIG		(1<<0)
179 #define	NAN_ATTR_SYNC_DISC_2G_BEACON_CONFIG	(1<<1)
180 #define	NAN_ATTR_SDF_2G_SUPPORT_CONFIG		(1<<2)
181 #define	NAN_ATTR_SUPPORT_5G_CONFIG		(1<<3)
182 #define	NAN_ATTR_SYNC_DISC_5G_BEACON_CONFIG	(1<<4)
183 #define	NAN_ATTR_SDF_5G_SUPPORT_CONFIG		(1<<5)
184 #define	NAN_ATTR_2G_DW_CONFIG			(1<<6)
185 #define	NAN_ATTR_5G_DW_CONFIG			(1<<7)
186 #define	NAN_ATTR_2G_CHAN_CONFIG			(1<<8)
187 #define	NAN_ATTR_5G_CHAN_CONFIG			(1<<9)
188 #define	NAN_ATTR_2G_DWELL_TIME_CONFIG		(1<<10)
189 #define	NAN_ATTR_5G_DWELL_TIME_CONFIG		(1<<11)
190 #define	NAN_ATTR_2G_SCAN_PERIOD_CONFIG		(1<<12)
191 #define	NAN_ATTR_5G_SCAN_PERIOD_CONFIG		(1<<13)
192 #define	NAN_ATTR_RSSI_CLOSE_CONFIG		(1<<14)
193 #define	NAN_ATTR_RSSI_MIDDLE_2G_CONFIG		(1<<15)
194 #define	NAN_ATTR_RSSI_PROXIMITY_2G_CONFIG	(1<<16)
195 #define	NAN_ATTR_RSSI_CLOSE_5G_CONFIG		(1<<17)
196 #define	NAN_ATTR_RSSI_MIDDLE_5G_CONFIG		(1<<18)
197 #define	NAN_ATTR_RSSI_PROXIMITY_5G_CONFIG	(1<<19)
198 #define	NAN_ATTR_RSSI_WINDOW_SIZE_CONFIG	(1<<20)
199 #define	NAN_ATTR_HOP_COUNT_LIMIT_CONFIG		(1<<21)
200 #define	NAN_ATTR_SID_BEACON_CONFIG		(1<<22)
201 #define	NAN_ATTR_HOP_COUNT_FORCE_CONFIG		(1<<23)
202 #define	NAN_ATTR_RAND_FACTOR_CONFIG		(1<<24)
203 #define	NAN_ATTR_CLUSTER_VAL_CONFIG		(1<<25)
204 #define	NAN_ATTR_IF_ADDR_CONFIG			(1<<26)
205 #define	NAN_ATTR_OUI_CONFIG			(1<<27)
206 #define	NAN_ATTR_SUB_SID_BEACON_CONFIG		(1<<28)
207 #define NAN_ATTR_DISC_BEACON_INTERVAL		(1<<29)
208 #define NAN_IOVAR_NAME_SIZE	4u
209 #define NAN_XTLV_ID_LEN_SIZE OFFSETOF(bcm_xtlv_t, data)
210 #define NAN_RANGING_INDICATE_CONTINUOUS_MASK   0x01
211 #define NAN_RANGE_REQ_CMD 0
212 #define NAN_RNG_REQ_ACCEPTED_BY_HOST    1
213 #define NAN_RNG_REQ_REJECTED_BY_HOST    0
214 
215 #define NAN_RNG_REQ_ACCEPTED_BY_PEER	0
216 #define NAN_RNG_REQ_REJECTED_BY_PEER	1
217 
218 #define NAN_RNG_GEOFENCE_MAX_RETRY_CNT	3u
219 
220 #define NAN_MAX_CHANNEL_INFO_SUPPORTED	4u
221 /*
222 * Discovery Beacon Interval config,
223 * Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
224 */
225 #define NAN_DISC_BCN_INTERVAL_2G_DEF 128u
226 #define NAN_DISC_BCN_INTERVAL_5G_DEF 176u
227 
228 typedef uint32 nan_data_path_id;
229 
230 typedef enum nan_range_status {
231 	NAN_RANGING_INVALID = 0,
232 	NAN_RANGING_REQUIRED = 1,
233 	NAN_RANGING_SETUP_IN_PROGRESS = 2,
234 	NAN_RANGING_SESSION_IN_PROGRESS = 3
235 } nan_range_status_t;
236 
237 typedef enum nan_range_role {
238 	NAN_RANGING_ROLE_INVALID = 0,
239 	NAN_RANGING_ROLE_INITIATOR = 1,
240 	NAN_RANGING_ROLE_RESPONDER = 2
241 } nan_range_role_t;
242 
243 typedef struct nan_svc_inst {
244 	uint8  inst_id;      /* publisher/subscriber id */
245 	uint8  inst_type;    /* publisher/subscriber */
246 } nan_svc_inst_t;
247 
248 /* Range Status Flag bits for svc info */
249 #define SVC_RANGE_REP_EVENT_ONCE 0x01
250 
251 /* Range Status Flag bits for svc info */
252 #define SVC_RANGE_REP_EVENT_ONCE 0x01
253 
254 #define NAN_RANGING_SETUP_IS_IN_PROG(status) \
255 	((status) == NAN_RANGING_SETUP_IN_PROGRESS)
256 
257 #define NAN_RANGING_IS_IN_PROG(status) \
258 	(((status) == NAN_RANGING_SETUP_IN_PROGRESS) || \
259 	((status) == NAN_RANGING_SESSION_IN_PROGRESS))
260 
261 typedef struct nan_svc_info {
262 	bool valid;
263 	nan_data_path_id ndp_id[NAN_MAX_SVC_INST];
264 	uint8 svc_hash[WL_NAN_SVC_HASH_LEN];        /* service hash */
265 	uint8 svc_id;
266 	uint8 ranging_required;
267 	uint8 ranging_ind;
268 	uint8 status;
269 	uint32 ranging_interval;
270 	uint32 ingress_limit;
271 	uint32 egress_limit;
272 	uint32 flags;
273 	uint8 tx_match_filter[MAX_MATCH_FILTER_LEN];        /* TX match filter */
274 	uint8 tx_match_filter_len;
275 	uint8 svc_range_status; /* For managing any svc range status flags */
276 } nan_svc_info_t;
277 
278 /* NAN Peer DP state */
279 typedef enum {
280 	NAN_PEER_DP_NOT_CONNECTED = 0,
281 	NAN_PEER_DP_CONNECTING = 1,
282 	NAN_PEER_DP_CONNECTED = 2
283 } nan_peer_dp_state_t;
284 
285 typedef struct nan_ndp_peer {
286 	uint8 peer_dp_state;
287 	uint8 dp_count;
288 	struct ether_addr peer_addr;
289 } nan_ndp_peer_t;
290 
291 #define INVALID_DISTANCE		0xFFFFFFFF
292 #define NAN_RTT_FTM_SSN_RETRIES		2
293 
294 typedef struct nan_ranging_inst {
295 	uint8 range_id;
296 	nan_range_status_t range_status;
297 	struct ether_addr peer_addr;
298 	int range_type;
299 	uint8 num_svc_ctx;
300 	nan_svc_info_t *svc_idx[MAX_SUBSCRIBES];
301 	uint32 prev_distance_mm;
302 	nan_range_role_t range_role;
303 	bool in_use;
304 	uint8 geof_retry_count;
305 	uint8 ftm_ssn_retry_count;
306 	bool role_concurrency_status;
307 } nan_ranging_inst_t;
308 
309 #define DUMP_NAN_RTT_INST(inst) { printf("svc instance ID %d", (inst)->svc_inst_id); \
310 	printf("Range ID %d", (inst)->range_id); \
311 	printf("range_status %d", (inst)->range_status); \
312 	printf("Range Type %d", (inst)->range_type); \
313 	printf("Peer MAC "MACDBG"\n", MAC2STRDBG((inst)->peer_addr.octet)); \
314 	}
315 
316 #define DUMP_NAN_RTT_RPT(rpt) { printf("Range ID %d", (rpt)->rng_id); \
317 	printf("Distance in MM %d", (rpt)->dist_mm); \
318 	printf("range_indication %d", (rpt)->indication); \
319 	printf("Peer MAC "MACDBG"\n", MAC2STRDBG((rpt)->peer_m_addr.octet)); \
320 	}
321 /*
322  * Data request Initiator/Responder
323  * app/service related info
324  */
325 typedef struct nan_data_path_app_info {
326 	uint16 ndp_app_info_len;
327 	uint8 ndp_app_info[NAN_DP_MAX_APP_INFO_LEN];
328 } nan_data_path_app_info_t;
329 
330 /* QoS configuration */
331 typedef enum {
332 	NAN_DP_CONFIG_NO_QOS = 0,
333 	NAN_DP_CONFIG_QOS
334 } nan_data_path_qos_cfg_t;
335 
336 /* Data request Responder's response */
337 typedef enum {
338 	NAN_DP_REQUEST_ACCEPT = 0,
339 	NAN_DP_REQUEST_REJECT
340 } nan_data_path_response_code_t;
341 
342 /* NAN DP security Configuration */
343 typedef enum {
344 	NAN_DP_CONFIG_NO_SECURITY = 0,
345 	NAN_DP_CONFIG_SECURITY
346 } nan_data_path_security_cfg_status_t;
347 
348 /* NAN Security Key Input Type */
349 typedef enum {
350 	NAN_SECURITY_KEY_INPUT_PMK = 1,
351 	NAN_SECURITY_KEY_INPUT_PASSPHRASE
352 } nan_security_key_input_type;
353 
354 /* Configuration params of Data request Initiator/Responder */
355 typedef struct nan_data_path_cfg {
356 	/* Status Indicating Security/No Security */
357 	nan_data_path_security_cfg_status_t security_cfg;
358 	nan_data_path_qos_cfg_t qos_cfg;
359 } nan_data_path_cfg_t;
360 
361 enum nan_dp_states {
362 	NAN_DP_STATE_DISABLED = 0,
363 	NAN_DP_STATE_ENABLED = 1
364 };
365 
366 enum {
367 	SRF_TYPE_BLOOM_FILTER = 0,
368 	SRF_TYPE_SEQ_MAC_ADDR = 1
369 };
370 
371 /* NAN Match indication type */
372 typedef enum {
373     NAN_MATCH_ALG_MATCH_ONCE		= 0,
374     NAN_MATCH_ALG_MATCH_CONTINUOUS	= 1,
375     NAN_MATCH_ALG_MATCH_NEVER		= 2
376 } nan_match_alg;
377 
378 typedef struct nan_str_data {
379 	uint32 dlen;
380 	uint8 *data;
381 } nan_str_data_t;
382 
383 typedef struct nan_mac_list {
384 	uint32 num_mac_addr;
385 	uint8 *list;
386 } nan_mac_list_t;
387 
388 typedef struct nan_channel_info {
389 	uint32 channel;
390 	uint32 bandwidth;
391 	uint32 nss;
392 } nan_channel_info_t;
393 
394 typedef struct nan_ndl_sched_info {
395 	uint32 num_channels;
396 	nan_channel_info_t channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
397 } nan_ndl_sched_info_t;
398 
399 typedef struct wl_nan_sid_beacon_tune {
400 	uint8 sid_enable;	/* flag for sending service id in beacon */
401 	uint8 sid_count;	/* Limit for number of SIDs to be included in Beacons */
402 	uint8 sub_sid_enable;	/* flag for sending subscribe service id in beacon */
403 	uint8 sub_sid_count;	/* Limit for number of SUb SIDs to be included in Beacons */
404 } wl_nan_sid_beacon_ctrl_t;
405 
406 typedef struct nan_avail_cmd_data {
407 	chanspec_t chanspec[NAN_MAX_SOCIAL_CHANNELS];    /* channel */
408 	uint32 bmap;            /* bitmap */
409 	uint8 duration;
410 	uint8 avail_period;
411 	/* peer mac address reqd for ranging avail type */
412 	struct ether_addr peer_nmi;
413 	bool no_config_avail;
414 } nan_avail_cmd_data;
415 
416 typedef struct nan_discover_cmd_data {
417 	nan_str_data_t svc_info;        /* service information */
418 	nan_str_data_t sde_svc_info;	/* extended service information */
419 	nan_str_data_t svc_hash;        /* service hash */
420 	nan_str_data_t rx_match;        /* matching filter rx */
421 	nan_str_data_t tx_match;        /* matching filter tx */
422 	nan_str_data_t key;        /* Security key information */
423 	nan_str_data_t scid;        /* security context information */
424 	nan_data_path_cfg_t ndp_cfg;
425 	struct ether_addr mac_addr;     /* mac address */
426 	nan_mac_list_t mac_list;   /* mac list */
427 	wl_nan_instance_id_t pub_id;    /* publisher id */
428 	wl_nan_instance_id_t sub_id;    /* subscriber id */
429 	wl_nan_instance_id_t local_id;  /* Local id */
430 	wl_nan_instance_id_t remote_id; /* Remote id */
431 	uint32 status;
432 	uint32 ttl;             /* time to live */
433 	uint32 period;          /* publish period */
434 	uint32 flags;           /* Flag bits */
435 	bool sde_control_config; /* whether sde_control present */
436 	uint16 sde_control_flag;
437 	uint16 token; /* transmit fup token id */
438 	uint8 csid;	/* cipher suite type */
439 	nan_security_key_input_type key_type;	/* cipher suite type */
440 	uint8 priority;         /* Priority of Transmit */
441 	uint8 life_count;       /* life count of the instance */
442 	uint8 srf_type;         /* SRF type */
443 	uint8 srf_include;      /* SRF include */
444 	uint8 use_srf;          /* use SRF */
445 	uint8 recv_ind_flag;    /* Receive Indication Flag */
446 	uint8 disc_ind_cfg;	/* Discovery Ind cfg */
447 	uint8 ranging_indication;
448 	uint32 ranging_intvl_msec; /* ranging interval in msec */
449 	uint32 ingress_limit;
450 	uint32 egress_limit;
451 	bool response;
452 	uint8 service_responder_policy;
453 	bool svc_update;
454 } nan_discover_cmd_data_t;
455 
456 typedef struct nan_datapath_cmd_data {
457 	nan_avail_cmd_data avail_params;	/* Avail config params */
458 	nan_str_data_t svc_hash;        /* service hash */
459 	nan_str_data_t svc_info;        /* service information */
460 	nan_str_data_t key;        /* security key information */
461 	nan_data_path_response_code_t rsp_code;
462 	nan_data_path_id ndp_instance_id;
463 	nan_data_path_cfg_t ndp_cfg;
464 	wl_nan_instance_id_t pub_id;    /* publisher id */
465 	nan_security_key_input_type key_type;	/* cipher suite type */
466 	struct ether_addr if_addr;      /* if addr */
467 	struct ether_addr mac_addr;     /* mac address */
468 	chanspec_t chanspec[NAN_MAX_SOCIAL_CHANNELS];    /* channel */
469 	uint32 status;
470 	uint32 bmap;            /* bitmap */
471 	uint16 service_instance_id;
472 	uint16 sde_control_flag;
473 	uint8 csid;	/* cipher suite type */
474 	uint8 peer_disc_mac_addr[ETHER_ADDR_LEN];
475 	uint8 peer_ndi_mac_addr[ETHER_ADDR_LEN];
476 	uint8 num_ndp_instances;
477 	uint8 duration;
478 	char ndp_iface[IFNAMSIZ+1];
479 } nan_datapath_cmd_data_t;
480 
481 typedef struct nan_rssi_cmd_data {
482 	int8 rssi_middle_2dot4g_val;
483 	int8 rssi_close_2dot4g_val;
484 	int8 rssi_proximity_2dot4g_val;
485 	int8 rssi_proximity_5g_val;
486 	int8 rssi_middle_5g_val;
487 	int8 rssi_close_5g_val;
488 	uint16 rssi_window_size; /* Window size over which rssi calculated */
489 } nan_rssi_cmd_data_t;
490 
491 typedef struct election_metrics {
492 	uint8 random_factor;    /* Configured random factor */
493 	uint8 master_pref;     /* configured master preference */
494 } election_metrics_t;
495 
496 typedef struct nan_awake_dws {
497 	uint8 dw_interval_2g;   /* 2G DW interval */
498 	uint8 dw_interval_5g;   /* 5G DW interval */
499 } nan_awake_dws_t;
500 
501 typedef struct nan_config_cmd_data {
502 	nan_rssi_cmd_data_t rssi_attr;	/* RSSI related data */
503 	election_metrics_t metrics;
504 	nan_awake_dws_t awake_dws;	/* Awake DWs */
505 	nan_avail_cmd_data avail_params;	/* Avail config params */
506 	nan_str_data_t p2p_info;        /* p2p information */
507 	nan_str_data_t scid;        /* security context information */
508 	struct ether_addr clus_id;      /* cluster id */
509 	struct ether_addr mac_addr;     /* mac address */
510 	wl_nan_sid_beacon_ctrl_t sid_beacon;    /* sending service id in beacon */
511 	chanspec_t chanspec[NAN_MAX_SOCIAL_CHANNELS];    /* channel */
512 	uint32 status;
513 	uint32 bmap;            /* bitmap */
514 	uint32 nan_oui;         /* configured nan oui */
515 	uint32 warmup_time;     /* Warm up time */
516 	uint8 duration;
517 	uint8 hop_count_limit;  /* hop count limit */
518 	uint8 support_5g;       /* To decide dual band support */
519 	uint8 support_2g;       /* To decide dual band support */
520 	uint8 beacon_2g_val;
521 	uint8 beacon_5g_val;
522 	uint8 sdf_2g_val;
523 	uint8 sdf_5g_val;
524 	uint8 dwell_time[NAN_MAX_SOCIAL_CHANNELS];
525 	uint8 scan_period[NAN_MAX_SOCIAL_CHANNELS];
526 	uint8 config_cluster_val;
527 	uint8 disc_ind_cfg;	/* Discovery Ind cfg */
528 	uint8 csid;	/* cipher suite type */
529 	uint32 nmi_rand_intvl; /* nmi randomization interval */
530 	uint32 use_ndpe_attr;
531 	uint8 enable_merge;
532 	uint16 cluster_low;
533 	uint16 cluster_high;
534 	wl_nan_disc_bcn_interval_t disc_bcn_interval;
535 	uint32 dw_early_termination;
536 } nan_config_cmd_data_t;
537 
538 typedef struct nan_event_hdr {
539 	uint32 flags;							/* future use */
540 	uint16 event_subtype;
541 } nan_event_hdr_t;
542 
543 typedef struct nan_event_data {
544 	uint8 svc_name[WL_NAN_SVC_HASH_LEN];    /* service name */
545 	uint8 enabled;        /* NAN Enabled */
546 	uint8 nan_de_evt_type;  /* DE event type */
547 	uint8 status;           /* status */
548 	uint8 ndp_id;           /* data path instance id */
549 	uint8 security;         /* data path security */
550 	uint8 type;
551 	uint8 attr_num;
552 	uint8 reason;          /* reason */
553 	wl_nan_instance_id_t pub_id;          /* publisher id */
554 	wl_nan_instance_id_t sub_id;          /* subscriber id */
555 	wl_nan_instance_id_t local_inst_id;   /* local instance id */
556 	wl_nan_instance_id_t requestor_id;    /* Requestor instance id */
557 	int publish_rssi;	/* discovery rssi value */
558 	int sub_rssi;	/* Sub rssi value */
559 	int fup_rssi;		/* followup rssi */
560 	uint16 attr_list_len;  /* sizeof attributes attached to payload */
561 	nan_str_data_t svc_info;        /* service info */
562 	nan_str_data_t vend_info;       /* vendor info */
563 	nan_str_data_t sde_svc_info;	/* extended service information */
564 	nan_str_data_t tx_match_filter;	/* tx match filter */
565 	nan_str_data_t rx_match_filter;	/* rx match filter */
566 	struct ether_addr local_nmi;      /* local nmi */
567 	struct ether_addr clus_id;        /* cluster id */
568 	struct ether_addr remote_nmi;     /* remote nmi */
569 	struct ether_addr initiator_ndi;        /* initiator_ndi */
570 	struct ether_addr responder_ndi;        /* responder_ndi */
571 	uint16 token; /* transmit fup token id */
572 	uint8 peer_cipher_suite; /* peer cipher suite type */
573 	nan_str_data_t scid;        /* security context information */
574 	char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
575 	uint16 sde_control_flag;
576 	uint8 ranging_result_present;
577 	uint32 range_measurement_cm;
578 	uint32 ranging_ind;
579 	uint8 rng_id;
580 } nan_event_data_t;
581 
582 /*
583  *   Various NAN Protocol Response code
584 */
585 typedef enum {
586 	/* NAN Protocol Response Codes */
587 	NAN_STATUS_SUCCESS = 0,
588 	/*  NAN Discovery Engine/Host driver failures */
589 	NAN_STATUS_INTERNAL_FAILURE = 1,
590 	/*  NAN OTA failures */
591 	NAN_STATUS_PROTOCOL_FAILURE = 2,
592 	/* if the publish/subscribe id is invalid */
593 	NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID = 3,
594 	/* If we run out of resources allocated */
595 	NAN_STATUS_NO_RESOURCE_AVAILABLE = 4,
596 	/* if invalid params are passed */
597 	NAN_STATUS_INVALID_PARAM = 5,
598 	/*  if the requestor instance id is invalid */
599 	NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID = 6,
600 	/*  if the ndp id is invalid */
601 	NAN_STATUS_INVALID_NDP_ID = 7,
602 	/* if NAN is enabled when wifi is turned off */
603 	NAN_STATUS_NAN_NOT_ALLOWED = 8,
604 	/* if over the air ack is not received */
605 	NAN_STATUS_NO_OTA_ACK = 9,
606 	/* If NAN is already enabled and we are try to re-enable the same */
607 	NAN_STATUS_ALREADY_ENABLED = 10,
608 	/* If followup message internal queue is full */
609 	NAN_STATUS_FOLLOWUP_QUEUE_FULL = 11,
610 	/* Unsupported concurrency session enabled, NAN disabled notified */
611 	NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
612 } nan_status_type_t;
613 
614 typedef struct {
615 	nan_status_type_t status;
616 	char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
617 } nan_hal_status_t;
618 
619 typedef struct nan_parse_event_ctx {
620 	struct bcm_cfg80211 *cfg;
621 	nan_event_data_t *nan_evt_data;
622 } nan_parse_event_ctx_t;
623 
624 /* Capabilities info supported by FW */
625 typedef struct nan_hal_capabilities {
626 	uint32 max_concurrent_nan_clusters;
627 	uint32 max_publishes;
628 	uint32 max_subscribes;
629 	uint32 max_service_name_len;
630 	uint32 max_match_filter_len;
631 	uint32 max_total_match_filter_len;
632 	uint32 max_service_specific_info_len;
633 	uint32 max_vsa_data_len;
634 	uint32 max_mesh_data_len;
635 	uint32 max_ndi_interfaces;
636 	uint32 max_ndp_sessions;
637 	uint32 max_app_info_len;
638 	uint32 max_queued_transmit_followup_msgs;
639 	uint32 ndp_supported_bands;
640 	uint32 cipher_suites_supported;
641 	uint32 max_scid_len;
642 	bool is_ndp_security_supported;
643 	uint32 max_sdea_service_specific_info_len;
644 	uint32 max_subscribe_address;
645 	uint32 ndpe_attr_supported;
646 } nan_hal_capabilities_t;
647 
648 typedef struct _nan_hal_resp {
649 	uint16 instance_id;
650 	uint16 subcmd;
651 	int32 status;
652 	int32 value;
653 	/* Identifier for the instance of the NDP */
654 	uint16 ndp_instance_id;
655 	/* Publisher NMI */
656 	uint8 pub_nmi[NAN_MAC_ADDR_LEN];
657 	/* SVC_HASH */
658 	uint8 svc_hash[WL_NAN_SVC_HASH_LEN];
659 	char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
660 	char pad[3];
661 	nan_hal_capabilities_t capabilities;
662 } nan_hal_resp_t;
663 
664 typedef struct wl_nan_iov {
665 	uint16 nan_iov_len;
666 	uint8 *nan_iov_buf;
667 } wl_nan_iov_t;
668 
669 #ifdef WL_NAN_DISC_CACHE
670 
671 #define NAN_MAX_CACHE_DISC_RESULT 16
672 typedef struct {
673 	bool valid;
674 	wl_nan_instance_id_t pub_id;
675 	wl_nan_instance_id_t sub_id;
676 	uint8 svc_hash[WL_NAN_SVC_HASH_LEN];
677 	struct ether_addr peer;
678 	int8 publish_rssi;
679 	uint8 peer_cipher_suite;
680 	uint8 security;
681 	nan_str_data_t svc_info;        /* service info */
682 	nan_str_data_t vend_info;       /* vendor info */
683 	nan_str_data_t sde_svc_info;	/* extended service information */
684 	nan_str_data_t tx_match_filter; /* tx match filter */
685 	uint16 sde_control_flag;
686 } nan_disc_result_cache;
687 
688 typedef struct nan_datapath_sec_info {
689 	nan_data_path_id ndp_instance_id;
690 	wl_nan_instance_id_t pub_id;    /* publisher id */
691 	struct ether_addr mac_addr;     /* mac address */
692 } nan_datapath_sec_info_cmd_data_t;
693 #endif /* WL_NAN_DISC_CACHE */
694 
695 typedef enum {
696 	NAN_RANGING_AUTO_RESPONSE_ENABLE = 0,
697 	NAN_RANGING_AUTO_RESPONSE_DISABLE
698 } NanRangingAutoResponseCfg;
699 
700 typedef struct wl_ndi_data
701 {
702 	u8 ifname[IFNAMSIZ];
703 	u8 in_use;
704 	u8 created;
705 	struct net_device *nan_ndev;
706 } wl_ndi_data_t;
707 
708 typedef struct wl_nancfg
709 {
710 	struct bcm_cfg80211 *cfg;
711 	bool nan_enable;
712 	nan_svc_inst_t nan_inst_ctrl[NAN_ID_CTRL_SIZE];
713 	struct ether_addr initiator_ndi;
714 	uint8 nan_dp_state;
715 	bool nan_init_state; /* nan initialization state */
716 	wait_queue_head_t ndp_if_change_event;
717 	uint8 support_5g;
718 	u8 nan_nmi_mac[ETH_ALEN];
719 	u8 nan_dp_count;
720 	struct delayed_work	nan_disable;
721 	int nan_disc_count;
722 	nan_disc_result_cache *nan_disc_cache;
723 	nan_svc_info_t svc_info[NAN_MAX_SVC_INST];
724 	nan_ranging_inst_t nan_ranging_info[NAN_MAX_RANGING_INST];
725 	wl_nan_ver_t version;
726 	struct mutex nan_sync;
727 	uint8 svc_inst_id_mask[NAN_SVC_INST_SIZE];
728 	uint8 inst_id_start;
729 	/* wait queue and condition variable for nan event */
730 	bool nan_event_recvd;
731 	wait_queue_head_t nan_event_wait;
732 	bool notify_user;
733 	bool mac_rand;
734 	uint8 max_ndp_count;       /* Max no. of NDPs */
735 	nan_ndp_peer_t *nan_ndp_peer_info;
736 	nan_data_path_id ndp_id[NAN_MAX_NDP_PEER];
737 	uint8 ndpe_enabled;
738 	uint8 max_ndi_supported;
739 	wl_ndi_data_t *ndi;
740 	bool ranging_enable;
741 } wl_nancfg_t;
742 
743 bool wl_cfgnan_is_enabled(struct bcm_cfg80211 *cfg);
744 int wl_cfgnan_check_nan_disable_pending(struct bcm_cfg80211 *cfg,
745 bool force_disable, bool is_sync_reqd);
746 int wl_cfgnan_start_handler(struct net_device *ndev,
747 	struct bcm_cfg80211 *cfg, nan_config_cmd_data_t *cmd_data, uint32 nan_attr_mask);
748 int wl_cfgnan_stop_handler(struct net_device *ndev, struct bcm_cfg80211 *cfg);
749 void wl_cfgnan_delayed_disable(struct work_struct *work);
750 int wl_cfgnan_config_handler(struct net_device *ndev,
751 	struct bcm_cfg80211 *cfg, nan_config_cmd_data_t *cmd_data, uint32 nan_attr_mask);
752 int wl_cfgnan_support_handler(struct net_device *ndev,
753 	struct bcm_cfg80211 *cfg, nan_config_cmd_data_t *cmd_data);
754 int wl_cfgnan_status_handler(struct net_device *ndev,
755 	struct bcm_cfg80211 *cfg, nan_config_cmd_data_t *cmd_data);
756 int wl_cfgnan_publish_handler(struct net_device *ndev,
757 	struct bcm_cfg80211 *cfg, nan_discover_cmd_data_t *cmd_data);
758 int wl_cfgnan_subscribe_handler(struct net_device *ndev,
759 	struct bcm_cfg80211 *cfg, nan_discover_cmd_data_t *cmd_data);
760 int wl_cfgnan_cancel_pub_handler(struct net_device *ndev,
761 	struct bcm_cfg80211 *cfg, nan_discover_cmd_data_t *cmd_data);
762 int wl_cfgnan_cancel_sub_handler(struct net_device *ndev,
763 	struct bcm_cfg80211 *cfg, nan_discover_cmd_data_t *cmd_data);
764 int wl_cfgnan_transmit_handler(struct net_device *ndev,
765 	struct bcm_cfg80211 *cfg, nan_discover_cmd_data_t *cmd_data);
766 s32 wl_cfgnan_notify_nan_status(struct bcm_cfg80211 *cfg,
767 	bcm_struct_cfgdev *cfgdev, const wl_event_msg_t *e, void *data);
768 int wl_cfgnan_generate_inst_id(struct bcm_cfg80211 *cfg, uint8 *p_inst_id);
769 int wl_cfgnan_remove_inst_id(struct bcm_cfg80211 *cfg, uint8 inst_id);
770 int wl_cfgnan_get_capablities_handler(struct net_device *ndev,
771 	struct bcm_cfg80211 *cfg, nan_hal_capabilities_t *capabilities);
772 int wl_cfgnan_data_path_iface_create_delete_handler(struct net_device *ndev,
773 	struct bcm_cfg80211 *cfg, char *ifname, uint16 type, uint8 busstate);
774 int wl_cfgnan_data_path_request_handler(struct net_device *ndev,
775 	struct bcm_cfg80211 *cfg, nan_datapath_cmd_data_t *cmd_data,
776 	uint8 *ndp_instance_id);
777 int wl_cfgnan_data_path_response_handler(struct net_device *ndev,
778 	struct bcm_cfg80211 *cfg, nan_datapath_cmd_data_t *cmd_data);
779 int wl_cfgnan_data_path_end_handler(struct net_device *ndev,
780 	struct bcm_cfg80211 *cfg, nan_data_path_id ndp_instance_id,
781 	int *status);
782 const char * nan_event_to_str(u16 cmd);
783 
784 #ifdef WL_NAN_DISC_CACHE
785 int wl_cfgnan_sec_info_handler(struct bcm_cfg80211 *cfg,
786 	nan_datapath_sec_info_cmd_data_t *cmd_data, nan_hal_resp_t *nan_req_resp);
787 /* ranging quest and response iovar handler */
788 #endif /* WL_NAN_DISC_CACHE */
789 bool wl_cfgnan_is_dp_active(struct net_device *ndev);
790 bool wl_cfgnan_data_dp_exists_with_peer(struct bcm_cfg80211 *cfg,
791 	struct ether_addr *peer_addr);
792 s32 wl_cfgnan_delete_ndp(struct bcm_cfg80211 *cfg, struct net_device *nan_ndev);
793 int wl_cfgnan_set_enable_merge(struct net_device *ndev,
794 	struct bcm_cfg80211 *cfg, uint8 enable, uint32 *status);
795 int wl_cfgnan_attach(struct bcm_cfg80211 *cfg);
796 void wl_cfgnan_detach(struct bcm_cfg80211 *cfg);
797 int wl_cfgnan_get_status(struct net_device *ndev, wl_nan_conf_status_t *nan_status);
798 
799 #ifdef RTT_SUPPORT
800 int wl_cfgnan_trigger_ranging(struct net_device *ndev,
801 	struct bcm_cfg80211 *cfg, void *event_data, nan_svc_info_t *svc,
802 	uint8 range_req, bool accept_req);
803 nan_ranging_inst_t *wl_cfgnan_get_ranging_inst(struct bcm_cfg80211 *cfg,
804 	struct ether_addr *peer, nan_range_role_t range_role);
805 nan_ranging_inst_t* wl_cfgnan_check_for_ranging(struct bcm_cfg80211 *cfg,
806 	struct ether_addr *peer);
807 int wl_cfgnan_trigger_geofencing_ranging(struct net_device *dev,
808 	struct ether_addr *peer_addr);
809 int wl_cfgnan_suspend_geofence_rng_session(struct net_device *ndev,
810 	struct ether_addr *peer, int suspend_reason, u8 cancel_flags);
811 void wl_cfgnan_suspend_all_geofence_rng_sessions(struct net_device *ndev,
812 	int suspend_reason, u8 cancel_flags);
813 int wl_cfgnan_terminate_directed_rtt_sessions(struct net_device *ndev, struct bcm_cfg80211 *cfg);
814 void wl_cfgnan_reset_geofence_ranging(struct bcm_cfg80211 *cfg,
815 	nan_ranging_inst_t * rng_inst, int sched_reason, bool need_rtt_mutex);
816 void wl_cfgnan_reset_geofence_ranging_for_cur_target(dhd_pub_t *dhd, int sched_reason);
817 void wl_cfgnan_process_range_report(struct bcm_cfg80211 *cfg,
818 	wl_nan_ev_rng_rpt_ind_t *range_res, int rtt_status);
819 int wl_cfgnan_cancel_ranging(struct net_device *ndev,
820 	struct bcm_cfg80211 *cfg, uint8 *range_id, uint8 flags, uint32 *status);
821 bool wl_cfgnan_ranging_allowed(struct bcm_cfg80211 *cfg);
822 uint8 wl_cfgnan_cancel_rng_responders(struct net_device *ndev);
823 bool wl_cfgnan_check_role_concurrency(struct bcm_cfg80211 *cfg,
824 	struct ether_addr *peer_addr);
825 bool wl_cfgnan_update_geofence_target_idx(struct bcm_cfg80211 *cfg);
826 bool wl_cfgnan_ranging_is_in_prog_for_peer(struct bcm_cfg80211 *cfg,
827 	struct ether_addr *peer_addr);
828 #endif /* RTT_SUPPORT */
829 
830 typedef enum {
831 	NAN_ATTRIBUTE_HEADER                            = 100,
832 	NAN_ATTRIBUTE_HANDLE                            = 101,
833 	NAN_ATTRIBUTE_TRANSAC_ID                        = 102,
834 
835 	/* NAN Enable request attributes */
836 	NAN_ATTRIBUTE_2G_SUPPORT                        = 103,
837 	NAN_ATTRIBUTE_5G_SUPPORT                        = 104,
838 	NAN_ATTRIBUTE_CLUSTER_LOW                       = 105,
839 	NAN_ATTRIBUTE_CLUSTER_HIGH                      = 106,
840 	NAN_ATTRIBUTE_SID_BEACON                        = 107,
841 	NAN_ATTRIBUTE_SYNC_DISC_2G_BEACON               = 108,
842 	NAN_ATTRIBUTE_SYNC_DISC_5G_BEACON               = 109,
843 	NAN_ATTRIBUTE_SDF_2G_SUPPORT                    = 110,
844 	NAN_ATTRIBUTE_SDF_5G_SUPPORT                    = 111,
845 	NAN_ATTRIBUTE_RSSI_CLOSE                        = 112,
846 	NAN_ATTRIBUTE_RSSI_MIDDLE                       = 113,
847 	NAN_ATTRIBUTE_RSSI_PROXIMITY                    = 114,
848 	NAN_ATTRIBUTE_HOP_COUNT_LIMIT                   = 115,
849 	NAN_ATTRIBUTE_RANDOM_TIME                       = 116,
850 	NAN_ATTRIBUTE_MASTER_PREF                       = 117,
851 	NAN_ATTRIBUTE_PERIODIC_SCAN_INTERVAL            = 118,
852 
853 	/* Nan Publish/Subscribe request attributes */
854 	NAN_ATTRIBUTE_PUBLISH_ID                        = 119,
855 	NAN_ATTRIBUTE_TTL                               = 120,
856 	NAN_ATTRIBUTE_PERIOD                            = 121,
857 	NAN_ATTRIBUTE_REPLIED_EVENT_FLAG                = 122,
858 	NAN_ATTRIBUTE_PUBLISH_TYPE                      = 123,
859 	NAN_ATTRIBUTE_TX_TYPE                           = 124,
860 	NAN_ATTRIBUTE_PUBLISH_COUNT                     = 125,
861 	NAN_ATTRIBUTE_SERVICE_NAME_LEN                  = 126,
862 	NAN_ATTRIBUTE_SERVICE_NAME                      = 127,
863 	NAN_ATTRIBUTE_SERVICE_SPECIFIC_INFO_LEN         = 128,
864 	NAN_ATTRIBUTE_SERVICE_SPECIFIC_INFO             = 129,
865 	NAN_ATTRIBUTE_RX_MATCH_FILTER_LEN               = 130,
866 	NAN_ATTRIBUTE_RX_MATCH_FILTER                   = 131,
867 	NAN_ATTRIBUTE_TX_MATCH_FILTER_LEN               = 132,
868 	NAN_ATTRIBUTE_TX_MATCH_FILTER                   = 133,
869 	NAN_ATTRIBUTE_SUBSCRIBE_ID                      = 134,
870 	NAN_ATTRIBUTE_SUBSCRIBE_TYPE                    = 135,
871 	NAN_ATTRIBUTE_SERVICERESPONSEFILTER             = 136,
872 	NAN_ATTRIBUTE_SERVICERESPONSEINCLUDE            = 137,
873 	NAN_ATTRIBUTE_USESERVICERESPONSEFILTER          = 138,
874 	NAN_ATTRIBUTE_SSIREQUIREDFORMATCHINDICATION     = 139,
875 	NAN_ATTRIBUTE_SUBSCRIBE_MATCH                   = 140,
876 	NAN_ATTRIBUTE_SUBSCRIBE_COUNT                   = 141,
877 	NAN_ATTRIBUTE_MAC_ADDR                          = 142,
878 	NAN_ATTRIBUTE_MAC_ADDR_LIST                     = 143,
879 	NAN_ATTRIBUTE_MAC_ADDR_LIST_NUM_ENTRIES         = 144,
880 	NAN_ATTRIBUTE_PUBLISH_MATCH                     = 145,
881 
882 	/* Nan Event attributes */
883 	NAN_ATTRIBUTE_ENABLE_STATUS                     = 146,
884 	NAN_ATTRIBUTE_JOIN_STATUS                       = 147,
885 	NAN_ATTRIBUTE_ROLE                              = 148,
886 	NAN_ATTRIBUTE_MASTER_RANK                       = 149,
887 	NAN_ATTRIBUTE_ANCHOR_MASTER_RANK                = 150,
888 	NAN_ATTRIBUTE_CNT_PEND_TXFRM                    = 151,
889 	NAN_ATTRIBUTE_CNT_BCN_TX                        = 152,
890 	NAN_ATTRIBUTE_CNT_BCN_RX                        = 153,
891 	NAN_ATTRIBUTE_CNT_SVC_DISC_TX                   = 154,
892 	NAN_ATTRIBUTE_CNT_SVC_DISC_RX                   = 155,
893 	NAN_ATTRIBUTE_AMBTT                             = 156,
894 	NAN_ATTRIBUTE_CLUSTER_ID                        = 157,
895 	NAN_ATTRIBUTE_INST_ID                           = 158,
896 	NAN_ATTRIBUTE_OUI                               = 159,
897 	NAN_ATTRIBUTE_STATUS                            = 160,
898 	NAN_ATTRIBUTE_DE_EVENT_TYPE                     = 161,
899 	NAN_ATTRIBUTE_MERGE                             = 162,
900 	NAN_ATTRIBUTE_IFACE                             = 163,
901 	NAN_ATTRIBUTE_CHANNEL                           = 164,
902 	NAN_ATTRIBUTE_PEER_ID                           = 165,
903 	NAN_ATTRIBUTE_NDP_ID                            = 167,
904 	NAN_ATTRIBUTE_SECURITY                          = 168,
905 	NAN_ATTRIBUTE_QOS                               = 169,
906 	NAN_ATTRIBUTE_RSP_CODE                          = 170,
907 	NAN_ATTRIBUTE_INST_COUNT                        = 171,
908 	NAN_ATTRIBUTE_PEER_DISC_MAC_ADDR                = 172,
909 	NAN_ATTRIBUTE_PEER_NDI_MAC_ADDR                 = 173,
910 	NAN_ATTRIBUTE_IF_ADDR                           = 174,
911 	NAN_ATTRIBUTE_WARMUP_TIME                       = 175,
912 	NAN_ATTRIBUTE_RECV_IND_CFG                      = 176,
913 	NAN_ATTRIBUTE_RSSI_CLOSE_5G                     = 177,
914 	NAN_ATTRIBUTE_RSSI_MIDDLE_5G                    = 178,
915 	NAN_ATTRIBUTE_RSSI_PROXIMITY_5G                 = 179,
916 	NAN_ATTRIBUTE_CONNMAP                           = 180,
917 	NAN_ATTRIBUTE_24G_CHANNEL                       = 181,
918 	NAN_ATTRIBUTE_5G_CHANNEL                        = 182,
919 	NAN_ATTRIBUTE_DWELL_TIME                        = 183,
920 	NAN_ATTRIBUTE_SCAN_PERIOD                       = 184,
921 	NAN_ATTRIBUTE_RSSI_WINDOW_SIZE			= 185,
922 	NAN_ATTRIBUTE_CONF_CLUSTER_VAL			= 186,
923 	NAN_ATTRIBUTE_AVAIL_BIT_MAP                     = 187,
924 	NAN_ATTRIBUTE_ENTRY_CONTROL			= 188,
925 	NAN_ATTRIBUTE_CIPHER_SUITE_TYPE                 = 189,
926 	NAN_ATTRIBUTE_KEY_TYPE                          = 190,
927 	NAN_ATTRIBUTE_KEY_LEN                           = 191,
928 	NAN_ATTRIBUTE_SCID                              = 192,
929 	NAN_ATTRIBUTE_SCID_LEN                          = 193,
930 	NAN_ATTRIBUTE_SDE_CONTROL_CONFIG_DP             = 194,
931 	NAN_ATTRIBUTE_SDE_CONTROL_SECURITY		= 195,
932 	NAN_ATTRIBUTE_SDE_CONTROL_DP_TYPE		= 196,
933 	NAN_ATTRIBUTE_SDE_CONTROL_RANGE_SUPPORT		= 197,
934 	NAN_ATTRIBUTE_NO_CONFIG_AVAIL			= 198,
935 	NAN_ATTRIBUTE_2G_AWAKE_DW			= 199,
936 	NAN_ATTRIBUTE_5G_AWAKE_DW			= 200,
937 	NAN_ATTRIBUTE_RANGING_INTERVAL			= 201,
938 	NAN_ATTRIBUTE_RANGING_INDICATION		= 202,
939 	NAN_ATTRIBUTE_RANGING_INGRESS_LIMIT		= 203,
940 	NAN_ATTRIBUTE_RANGING_EGRESS_LIMIT		= 204,
941 	NAN_ATTRIBUTE_RANGING_AUTO_ACCEPT		= 205,
942 	NAN_ATTRIBUTE_RANGING_RESULT			= 206,
943 	NAN_ATTRIBUTE_DISC_IND_CFG			= 207,
944 	NAN_ATTRIBUTE_RSSI_THRESHOLD_FLAG		= 208,
945 	NAN_ATTRIBUTE_KEY_DATA                          = 209,
946 	NAN_ATTRIBUTE_SDEA_SERVICE_SPECIFIC_INFO_LEN    = 210,
947 	NAN_ATTRIBUTE_SDEA_SERVICE_SPECIFIC_INFO        = 211,
948 	NAN_ATTRIBUTE_REASON				= 212,
949 	NAN_ATTRIBUTE_DWELL_TIME_5G                     = 215,
950 	NAN_ATTRIBUTE_SCAN_PERIOD_5G                    = 216,
951 	NAN_ATTRIBUTE_SVC_RESPONDER_POLICY              = 217,
952 	NAN_ATTRIBUTE_EVENT_MASK			= 218,
953 	NAN_ATTRIBUTE_SUB_SID_BEACON                    = 219,
954 	NAN_ATTRIBUTE_RANDOMIZATION_INTERVAL            = 220,
955 	NAN_ATTRIBUTE_CMD_RESP_DATA			= 221,
956 	NAN_ATTRIBUTE_CMD_USE_NDPE			= 222,
957 	NAN_ATTRIBUTE_ENABLE_MERGE			= 223,
958 	NAN_ATTRIBUTE_DISCOVERY_BEACON_INTERVAL		= 224,
959 	NAN_ATTRIBUTE_NSS				= 225,
960 	NAN_ATTRIBUTE_ENABLE_RANGING			= 226,
961 	NAN_ATTRIBUTE_DW_EARLY_TERM			= 227,
962 	NAN_ATTRIBUTE_CHANNEL_INFO			= 228,
963 	NAN_ATTRIBUTE_NUM_CHANNELS			= 229,
964 	NAN_ATTRIBUTE_INSTANT_MODE_ENABLE		= 230,
965 	NAN_ATTRIBUTE_INSTANT_COMM_CHAN			= 231,
966 	NAN_ATTRIBUTE_MAX				= 232
967 } NAN_ATTRIBUTE;
968 
969 enum geofence_suspend_reason {
970 	RTT_GEO_SUSPN_HOST_DIR_RTT_TRIG = 0,
971 	RTT_GEO_SUSPN_PEER_RTT_TRIGGER = 1,
972 	RTT_GEO_SUSPN_HOST_NDP_TRIGGER = 2,
973 	RTT_GEO_SUSPN_PEER_NDP_TRIGGER = 3,
974 	RTT_GEO_SUSPN_RANGE_RES_REPORTED = 4
975 };
976 #endif	/* _wl_cfgnan_h_ */
977