xref: /freebsd/contrib/wpa/src/common/nan.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
1 /*
2  * NAN (Wi-Fi Aware) definitions
3  * Copyright (c) 2024, Qualcomm Innovation Center, Inc.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef NAN_H
10 #define NAN_H
11 
12 enum nan_attr_id {
13 	NAN_ATTR_MASTER_INDICATION = 0x00,
14 	NAN_ATTR_CLUSTER = 0x01,
15 	NAN_ATTR_NAN_ATTR_SERVICE_ID_LIST = 0x02,
16 	NAN_ATTR_SDA = 0x03, /* Service Descriptor attribute */
17 	NAN_ATTR_CONN_CAPA = 0x04,
18 	NAN_ATTR_WLAN_INFRA = 0x05,
19 	NAN_ATTR_P2P_OPER = 0x06,
20 	NAN_ATTR_IBSS = 0x07,
21 	NAN_ATTR_MESH = 0x08,
22 	NAN_ATTR_FURTHER_NAN_SD = 0x09,
23 	NAN_ATTR_FURTHER_AVAIL_MAP = 0x0A,
24 	NAN_ATTR_COUNTRY_CODE = 0x0B,
25 	NAN_ATTR_RANGIN = 0x0C,
26 	NAN_ATTR_CLUSTER_DISCOVERY = 0x0D,
27 	NAN_ATTR_SDEA = 0x0E, /* Service Descriptor Extension attribute */
28 	NAN_ATTR_DEVICE_CAPABILITY = 0x0F,
29 	NAN_ATTR_NDP = 0x10,
30 	NAN_ATTR_NAN_AVAILABILITY = 0x12,
31 	NAN_ATTR_NDC = 0x13,
32 	NAN_ATTR_NDL = 0x14,
33 	NAN_ATTR_NDL_QOS = 0x15,
34 	NAN_ATTR_UNALIGNED_SCHEDULE = 0x17,
35 	NAN_ATTR_RANGING_INFO = 0x1A,
36 	NAN_ATTR_RANGING_SETUP = 0x1B,
37 	NAN_ATTR_FTM_RANGING_REPORT = 0x1C,
38 	NAN_ATTR_ELEM_CONTAINER = 0x1D,
39 	NAN_ATTR_EXT_WLAN_INFRA = 0x1E,
40 	NAN_ATTR_EXT_P2P_OPER = 0x1FE,
41 	NAN_ATTR_EXT_IBSS = 0x20,
42 	NAN_ATTR_EXT_MESH = 0x21,
43 	NAN_ATTR_CSIA = 0x22, /* Cipher Suite Info attribute */
44 	NAN_ATTR_SCIA = 0x23, /* Security Context Info attribute */
45 	NAN_ATTR_SHARED_KEY_DESCR = 0x24,
46 	NAN_ATTR_PUBLIC_AVAILABILITY = 0x27,
47 	NAN_ATTR_SUBSC_SERVICE_ID_LIST = 0x28,
48 	NAN_ATTR_NDP_EXT = 0x29,
49 	NAN_ATTR_DCEA = 0x2A, /* Device Capability Extension attribute */
50 	NAN_ATTR_NIRA = 0x2B, /* NAN Identity Resolution attribute */
51 	NAN_ATTR_BPBA = 0x2C, /* NAN Pairing Bootstrapping attribute */
52 	NAN_ATTR_S3 = 0x2D,
53 	NAN_ATTR_TPEA = 0x2E, /* Transmit Power Envelope attribute */
54 	NAN_ATTR_VENDOR_SPECIFIC = 0xDD,
55 };
56 
57 /* Service Descriptor attribute (SDA) */
58 
59 /* Service Control field */
60 #define NAN_SRV_CTRL_TYPE_MASK (BIT(0) | BIT(1))
61 #define NAN_SRV_CTRL_MATCHING_FILTER BIT(2)
62 #define NAN_SRV_CTRL_RESP_FILTER BIT(3)
63 #define NAN_SRV_CTRL_SRV_INFO BIT(4)
64 #define NAN_SRV_CTRL_DISCOVERY_RANGE_LIMITED BIT(5)
65 #define NAN_SRV_CTRL_BINDING_BITMAP BIT(6)
66 
67 enum nan_service_control_type {
68 	NAN_SRV_CTRL_PUBLISH = 0,
69 	NAN_SRV_CTRL_SUBSCRIBE = 1,
70 	NAN_SRV_CTRL_FOLLOW_UP = 2,
71 };
72 
73 /* Service Descriptor Extension attribute (SDEA) */
74 
75 /* SDEA Control field */
76 #define NAN_SDEA_CTRL_FSD_REQ BIT(0)
77 #define NAN_SDEA_CTRL_FSD_GAS BIT(1)
78 #define NAN_SDEA_CTRL_DATA_PATH_REQ BIT(2)
79 #define NAN_SDEA_CTRL_DATA_PATH_TYPE BIT(3)
80 #define NAN_SDEA_CTRL_QOS_REQ BIT(5)
81 #define NAN_SDEA_CTRL_SECURITY_REQ BIT(6)
82 #define NAN_SDEA_CTRL_RANGING_REQ BIT(7)
83 #define NAN_SDEA_CTRL_RANGE_LIMIT BIT(8)
84 #define NAN_SDEA_CTRL_SRV_UPD_INDIC BIT(9)
85 #define NAN_SDEA_CTRL_GTK_REQ BIT(10)
86 
87 enum nan_service_protocol_type {
88 	NAN_SRV_PROTO_BONJOUR = 1,
89 	NAN_SRV_PROTO_GENERIC = 2,
90 	NAN_SRV_PROTO_CSA_MATTER = 3,
91 };
92 
93 #define NAN_ATTR_HDR_LEN 3
94 #define NAN_SERVICE_ID_LEN 6
95 
96 #define NAN_USD_DEFAULT_FREQ 2437
97 
98 #endif /* NAN_H */
99