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