GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / proto / p2p.h
blob251d025124156e0f4cf6e35118047e163a521a35
1 /*
2 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 * Fundamental types and constants relating to WFA P2P (aka WiFi Direct)
18 * $Id: p2p.h 327850 2012-04-16 22:59:17Z $
21 #ifndef _P2P_H_
22 #define _P2P_H_
24 #ifndef _TYPEDEFS_H_
25 #include <typedefs.h>
26 #endif
27 #include <wlioctl.h>
28 #include <proto/802.11.h>
30 /* This marks the start of a packed structure section. */
31 #include <packed_section_start.h>
34 /* WiFi P2P OUI values */
35 #define P2P_OUI WFA_OUI /* WiFi P2P OUI */
36 #define P2P_VER WFA_OUI_TYPE_P2P /* P2P version: 9=WiFi P2P v1.0 */
38 #define P2P_IE_ID 0xdd /* P2P IE element ID */
40 /* WiFi P2P IE */
41 BWL_PRE_PACKED_STRUCT struct wifi_p2p_ie {
42 uint8 id; /* IE ID: 0xDD */
43 uint8 len; /* IE length */
44 uint8 OUI[3]; /* WiFi P2P specific OUI: P2P_OUI */
45 uint8 oui_type; /* Identifies P2P version: P2P_VER */
46 uint8 subelts[1]; /* variable length subelements */
47 } BWL_POST_PACKED_STRUCT;
48 typedef struct wifi_p2p_ie wifi_p2p_ie_t;
50 #define P2P_IE_FIXED_LEN 6
52 #define P2P_ATTR_ID_OFF 0
53 #define P2P_ATTR_LEN_OFF 1
54 #define P2P_ATTR_DATA_OFF 3
56 #define P2P_ATTR_ID_LEN 1 /* ID filed length */
57 #define P2P_ATTR_LEN_LEN 2 /* length field length */
58 #define P2P_ATTR_HDR_LEN 3 /* ID + 2-byte length field spec 1.02 */
60 /* P2P IE Subelement IDs from WiFi P2P Technical Spec 1.00 */
61 #define P2P_SEID_STATUS 0 /* Status */
62 #define P2P_SEID_MINOR_RC 1 /* Minor Reason Code */
63 #define P2P_SEID_P2P_INFO 2 /* P2P Capability (capabilities info) */
64 #define P2P_SEID_DEV_ID 3 /* P2P Device ID */
65 #define P2P_SEID_INTENT 4 /* Group Owner Intent */
66 #define P2P_SEID_CFG_TIMEOUT 5 /* Configuration Timeout */
67 #define P2P_SEID_CHANNEL 6 /* Channel */
68 #define P2P_SEID_GRP_BSSID 7 /* P2P Group BSSID */
69 #define P2P_SEID_XT_TIMING 8 /* Extended Listen Timing */
70 #define P2P_SEID_INTINTADDR 9 /* Intended P2P Interface Address */
71 #define P2P_SEID_P2P_MGBTY 10 /* P2P Manageability */
72 #define P2P_SEID_CHAN_LIST 11 /* Channel List */
73 #define P2P_SEID_ABSENCE 12 /* Notice of Absence */
74 #define P2P_SEID_DEV_INFO 13 /* Device Info */
75 #define P2P_SEID_GROUP_INFO 14 /* Group Info */
76 #define P2P_SEID_GROUP_ID 15 /* Group ID */
77 #define P2P_SEID_P2P_IF 16 /* P2P Interface */
78 #define P2P_SEID_OP_CHANNEL 17 /* Operating Channel */
79 #define P2P_SEID_INVITE_FLAGS 18 /* Invitation Flags */
80 #define P2P_SEID_VNDR 221 /* Vendor-specific subelement */
82 #define P2P_SE_VS_ID_SERVICES 0x1b /* BRCM proprietary subel: L2 Services */
85 /* WiFi P2P IE subelement: P2P Capability (capabilities info) */
86 BWL_PRE_PACKED_STRUCT struct wifi_p2p_info_se_s {
87 uint8 eltId; /* SE ID: P2P_SEID_P2P_INFO */
88 uint8 len[2]; /* SE length not including eltId, len fields */
89 uint8 dev; /* Device Capability Bitmap */
90 uint8 group; /* Group Capability Bitmap */
91 } BWL_POST_PACKED_STRUCT;
92 typedef struct wifi_p2p_info_se_s wifi_p2p_info_se_t;
94 /* P2P Capability subelement's Device Capability Bitmap bit values */
95 #define P2P_CAPSE_DEV_SERVICE_DIS 0x1 /* Service Discovery */
96 #define P2P_CAPSE_DEV_CLIENT_DIS 0x2 /* Client Discoverability */
97 #define P2P_CAPSE_DEV_CONCURRENT 0x4 /* Concurrent Operation */
98 #define P2P_CAPSE_DEV_INFRA_MAN 0x8 /* P2P Infrastructure Managed */
99 #define P2P_CAPSE_DEV_LIMIT 0x10 /* P2P Device Limit */
100 #define P2P_CAPSE_INVITE_PROC 0x20 /* P2P Invitation Procedure */
102 /* P2P Capability subelement's Group Capability Bitmap bit values */
103 #define P2P_CAPSE_GRP_OWNER 0x1 /* P2P Group Owner */
104 #define P2P_CAPSE_PERSIST_GRP 0x2 /* Persistent P2P Group */
105 #define P2P_CAPSE_GRP_LIMIT 0x4 /* P2P Group Limit */
106 #define P2P_CAPSE_GRP_INTRA_BSS 0x8 /* Intra-BSS Distribution */
107 #define P2P_CAPSE_GRP_X_CONNECT 0x10 /* Cross Connection */
108 #define P2P_CAPSE_GRP_PERSISTENT 0x20 /* Persistent Reconnect */
109 #define P2P_CAPSE_GRP_FORMATION 0x40 /* Group Formation */
112 /* WiFi P2P IE subelement: Group Owner Intent */
113 BWL_PRE_PACKED_STRUCT struct wifi_p2p_intent_se_s {
114 uint8 eltId; /* SE ID: P2P_SEID_INTENT */
115 uint8 len[2]; /* SE length not including eltId, len fields */
116 uint8 intent; /* Intent Value 0...15 (0=legacy 15=master only) */
117 } BWL_POST_PACKED_STRUCT;
118 typedef struct wifi_p2p_intent_se_s wifi_p2p_intent_se_t;
120 /* WiFi P2P IE subelement: Configuration Timeout */
121 BWL_PRE_PACKED_STRUCT struct wifi_p2p_cfg_tmo_se_s {
122 uint8 eltId; /* SE ID: P2P_SEID_CFG_TIMEOUT */
123 uint8 len[2]; /* SE length not including eltId, len fields */
124 uint8 go_tmo; /* GO config timeout in units of 10 ms */
125 uint8 client_tmo; /* Client config timeout in units of 10 ms */
126 } BWL_POST_PACKED_STRUCT;
127 typedef struct wifi_p2p_cfg_tmo_se_s wifi_p2p_cfg_tmo_se_t;
129 /* WiFi P2P IE subelement: Listen Channel */
130 BWL_PRE_PACKED_STRUCT struct wifi_p2p_listen_channel_se_s {
131 uint8 eltId; /* SE ID: P2P_SEID_CHANNEL */
132 uint8 len[2]; /* SE length not including eltId, len fields */
133 uint8 country[3]; /* Country String */
134 uint8 op_class; /* Operating Class */
135 uint8 channel; /* Channel */
136 } BWL_POST_PACKED_STRUCT;
137 typedef struct wifi_p2p_listen_channel_se_s wifi_p2p_listen_channel_se_t;
139 /* WiFi P2P IE subelement: P2P Group BSSID */
140 BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_bssid_se_s {
141 uint8 eltId; /* SE ID: P2P_SEID_GRP_BSSID */
142 uint8 len[2]; /* SE length not including eltId, len fields */
143 uint8 mac[6]; /* P2P group bssid */
144 } BWL_POST_PACKED_STRUCT;
145 typedef struct wifi_p2p_grp_bssid_se_s wifi_p2p_grp_bssid_se_t;
147 /* WiFi P2P IE subelement: P2P Group ID */
148 BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_id_se_s {
149 uint8 eltId; /* SE ID: P2P_SEID_GROUP_ID */
150 uint8 len[2]; /* SE length not including eltId, len fields */
151 uint8 mac[6]; /* P2P device address */
152 uint8 ssid[1]; /* ssid. device id. variable length */
153 } BWL_POST_PACKED_STRUCT;
154 typedef struct wifi_p2p_grp_id_se_s wifi_p2p_grp_id_se_t;
156 /* WiFi P2P IE subelement: P2P Interface */
157 BWL_PRE_PACKED_STRUCT struct wifi_p2p_intf_se_s {
158 uint8 eltId; /* SE ID: P2P_SEID_P2P_IF */
159 uint8 len[2]; /* SE length not including eltId, len fields */
160 uint8 mac[6]; /* P2P device address */
161 uint8 ifaddrs; /* P2P Interface Address count */
162 uint8 ifaddr[1][6]; /* P2P Interface Address list */
163 } BWL_POST_PACKED_STRUCT;
164 typedef struct wifi_p2p_intf_se_s wifi_p2p_intf_se_t;
166 /* WiFi P2P IE subelement: Status */
167 BWL_PRE_PACKED_STRUCT struct wifi_p2p_status_se_s {
168 uint8 eltId; /* SE ID: P2P_SEID_STATUS */
169 uint8 len[2]; /* SE length not including eltId, len fields */
170 uint8 status; /* Status Code: P2P_STATSE_* */
171 } BWL_POST_PACKED_STRUCT;
172 typedef struct wifi_p2p_status_se_s wifi_p2p_status_se_t;
174 /* Status subelement Status Code definitions */
175 #define P2P_STATSE_SUCCESS 0
176 /* Success */
177 #define P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 1
178 /* Failed, information currently unavailable */
179 #define P2P_STATSE_PASSED_UP P2P_STATSE_FAIL_INFO_CURR_UNAVAIL
180 /* Old name for above in P2P spec 1.08 and older */
181 #define P2P_STATSE_FAIL_INCOMPAT_PARAMS 2
182 /* Failed, incompatible parameters */
183 #define P2P_STATSE_FAIL_LIMIT_REACHED 3
184 /* Failed, limit reached */
185 #define P2P_STATSE_FAIL_INVALID_PARAMS 4
186 /* Failed, invalid parameters */
187 #define P2P_STATSE_FAIL_UNABLE_TO_ACCOM 5
188 /* Failed, unable to accomodate request */
189 #define P2P_STATSE_FAIL_PROTO_ERROR 6
190 /* Failed, previous protocol error or disruptive behaviour */
191 #define P2P_STATSE_FAIL_NO_COMMON_CHAN 7
192 /* Failed, no common channels */
193 #define P2P_STATSE_FAIL_UNKNOWN_GROUP 8
194 /* Failed, unknown P2P Group */
195 #define P2P_STATSE_FAIL_INTENT 9
196 /* Failed, both peers indicated Intent 15 in GO Negotiation */
197 #define P2P_STATSE_FAIL_INCOMPAT_PROVIS 10
198 /* Failed, incompatible provisioning method */
199 #define P2P_STATSE_FAIL_USER_REJECT 11
200 /* Failed, rejected by user */
202 /* WiFi P2P IE attribute: Extended Listen Timing */
203 BWL_PRE_PACKED_STRUCT struct wifi_p2p_ext_se_s {
204 uint8 eltId; /* ID: P2P_SEID_EXT_TIMING */
205 uint8 len[2]; /* length not including eltId, len fields */
206 uint8 avail[2]; /* availibility period */
207 uint8 interval[2]; /* availibility interval */
208 } BWL_POST_PACKED_STRUCT;
209 typedef struct wifi_p2p_ext_se_s wifi_p2p_ext_se_t;
211 #define P2P_EXT_MIN 10 /* minimum 10ms */
213 /* WiFi P2P IE subelement: Intended P2P Interface Address */
214 BWL_PRE_PACKED_STRUCT struct wifi_p2p_intintad_se_s {
215 uint8 eltId; /* SE ID: P2P_SEID_INTINTADDR */
216 uint8 len[2]; /* SE length not including eltId, len fields */
217 uint8 mac[6]; /* intended P2P interface MAC address */
218 } BWL_POST_PACKED_STRUCT;
219 typedef struct wifi_p2p_intintad_se_s wifi_p2p_intintad_se_t;
221 /* WiFi P2P IE subelement: Channel */
222 BWL_PRE_PACKED_STRUCT struct wifi_p2p_channel_se_s {
223 uint8 eltId; /* SE ID: P2P_SEID_STATUS */
224 uint8 len[2]; /* SE length not including eltId, len fields */
225 uint8 band; /* Regulatory Class (band) */
226 uint8 channel; /* Channel */
227 } BWL_POST_PACKED_STRUCT;
228 typedef struct wifi_p2p_channel_se_s wifi_p2p_channel_se_t;
231 /* Channel Entry structure within the Channel List SE */
232 BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_entry_s {
233 uint8 band; /* Regulatory Class (band) */
234 uint8 num_channels; /* # of channels in the channel list */
235 uint8 channels[WL_NUMCHANNELS]; /* Channel List */
236 } BWL_POST_PACKED_STRUCT;
237 typedef struct wifi_p2p_chanlist_entry_s wifi_p2p_chanlist_entry_t;
238 #define WIFI_P2P_CHANLIST_SE_MAX_ENTRIES 2
240 /* WiFi P2P IE subelement: Channel List */
241 BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_se_s {
242 uint8 eltId; /* SE ID: P2P_SEID_CHAN_LIST */
243 uint8 len[2]; /* SE length not including eltId, len fields */
244 uint8 country[3]; /* Country String */
245 uint8 num_entries; /* # of channel entries */
246 wifi_p2p_chanlist_entry_t entries[WIFI_P2P_CHANLIST_SE_MAX_ENTRIES];
247 /* Channel Entry List */
248 } BWL_POST_PACKED_STRUCT;
249 typedef struct wifi_p2p_chanlist_se_s wifi_p2p_chanlist_se_t;
251 /* WiFi Primary Device Type structure */
252 BWL_PRE_PACKED_STRUCT struct wifi_p2p_pri_devtype_s {
253 uint16 cat_id; /* Category ID */
254 uint8 OUI[3]; /* WFA OUI: 0x0050F2 */
255 uint8 oui_type; /* WPS_OUI_TYPE */
256 uint16 sub_cat_id; /* Sub Category ID */
257 } BWL_POST_PACKED_STRUCT;
258 typedef struct wifi_p2p_pri_devtype_s wifi_p2p_pri_devtype_t;
260 /* WiFi P2P IE's Device Info subelement */
261 BWL_PRE_PACKED_STRUCT struct wifi_p2p_devinfo_se_s {
262 uint8 eltId; /* SE ID: P2P_SEID_DEVINFO */
263 uint8 len[2]; /* SE length not including eltId, len fields */
264 uint8 mac[6]; /* P2P Device MAC address */
265 uint16 wps_cfg_meths; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */
266 uint8 pri_devtype[8]; /* Primary Device Type */
267 } BWL_POST_PACKED_STRUCT;
268 typedef struct wifi_p2p_devinfo_se_s wifi_p2p_devinfo_se_t;
270 #define P2P_DEV_TYPE_LEN 8
272 /* WiFi P2P IE's Group Info subelement Client Info Descriptor */
273 BWL_PRE_PACKED_STRUCT struct wifi_p2p_cid_fixed_s {
274 uint8 len;
275 uint8 devaddr[ETHER_ADDR_LEN]; /* P2P Device Address */
276 uint8 ifaddr[ETHER_ADDR_LEN]; /* P2P Interface Address */
277 uint8 devcap; /* Device Capability */
278 uint8 cfg_meths[2]; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */
279 uint8 pridt[P2P_DEV_TYPE_LEN]; /* Primary Device Type */
280 uint8 secdts; /* Number of Secondary Device Types */
281 } BWL_POST_PACKED_STRUCT;
282 typedef struct wifi_p2p_cid_fixed_s wifi_p2p_cid_fixed_t;
284 /* WiFi P2P IE's Device ID subelement */
285 BWL_PRE_PACKED_STRUCT struct wifi_p2p_devid_se_s {
286 uint8 eltId;
287 uint8 len[2];
288 struct ether_addr addr; /* P2P Device MAC address */
289 } BWL_POST_PACKED_STRUCT;
290 typedef struct wifi_p2p_devid_se_s wifi_p2p_devid_se_t;
292 /* WiFi P2P IE subelement: P2P Manageability */
293 BWL_PRE_PACKED_STRUCT struct wifi_p2p_mgbt_se_s {
294 uint8 eltId; /* SE ID: P2P_SEID_P2P_MGBTY */
295 uint8 len[2]; /* SE length not including eltId, len fields */
296 uint8 mg_bitmap; /* manageability bitmap */
297 } BWL_POST_PACKED_STRUCT;
298 typedef struct wifi_p2p_mgbt_se_s wifi_p2p_mgbt_se_t;
299 /* mg_bitmap field bit values */
300 #define P2P_MGBTSE_P2PDEVMGMT_FLAG 0x1 /* AP supports Managed P2P Device */
302 /* WiFi P2P IE subelement: Group Info */
303 BWL_PRE_PACKED_STRUCT struct wifi_p2p_grpinfo_se_s {
304 uint8 eltId; /* SE ID: P2P_SEID_GROUP_INFO */
305 uint8 len[2]; /* SE length not including eltId, len fields */
306 } BWL_POST_PACKED_STRUCT;
307 typedef struct wifi_p2p_grpinfo_se_s wifi_p2p_grpinfo_se_t;
309 /* WiFi IE subelement: Operating Channel */
310 BWL_PRE_PACKED_STRUCT struct wifi_p2p_op_channel_se_s {
311 uint8 eltId; /* SE ID: P2P_SEID_OP_CHANNEL */
312 uint8 len[2]; /* SE length not including eltId, len fields */
313 uint8 country[3]; /* Country String */
314 uint8 op_class; /* Operating Class */
315 uint8 channel; /* Channel */
316 } BWL_POST_PACKED_STRUCT;
317 typedef struct wifi_p2p_op_channel_se_s wifi_p2p_op_channel_se_t;
319 /* WiFi IE subelement: INVITATION FLAGS */
320 BWL_PRE_PACKED_STRUCT struct wifi_p2p_invite_flags_se_s {
321 uint8 eltId; /* SE ID: P2P_SEID_INVITE_FLAGS */
322 uint8 len[2]; /* SE length not including eltId, len fields */
323 uint8 flags; /* Flags */
324 } BWL_POST_PACKED_STRUCT;
325 typedef struct wifi_p2p_invite_flags_se_s wifi_p2p_invite_flags_se_t;
327 /* WiFi P2P Action Frame */
328 BWL_PRE_PACKED_STRUCT struct wifi_p2p_action_frame {
329 uint8 category; /* P2P_AF_CATEGORY */
330 uint8 OUI[3]; /* OUI - P2P_OUI */
331 uint8 type; /* OUI Type - P2P_VER */
332 uint8 subtype; /* OUI Subtype - P2P_AF_* */
333 uint8 dialog_token; /* nonzero, identifies req/resp tranaction */
334 uint8 elts[1]; /* Variable length information elements. Max size =
335 * ACTION_FRAME_SIZE - sizeof(this structure) - 1
337 } BWL_POST_PACKED_STRUCT;
338 typedef struct wifi_p2p_action_frame wifi_p2p_action_frame_t;
339 #define P2P_AF_CATEGORY 0x7f
341 #define P2P_AF_FIXED_LEN 7
343 /* WiFi P2P Action Frame OUI Subtypes */
344 #define P2P_AF_NOTICE_OF_ABSENCE 0 /* Notice of Absence */
345 #define P2P_AF_PRESENCE_REQ 1 /* P2P Presence Request */
346 #define P2P_AF_PRESENCE_RSP 2 /* P2P Presence Response */
347 #define P2P_AF_GO_DISC_REQ 3 /* GO Discoverability Request */
350 /* WiFi P2P Public Action Frame */
351 BWL_PRE_PACKED_STRUCT struct wifi_p2p_pub_act_frame {
352 uint8 category; /* P2P_PUB_AF_CATEGORY */
353 uint8 action; /* P2P_PUB_AF_ACTION */
354 uint8 oui[3]; /* P2P_OUI */
355 uint8 oui_type; /* OUI type - P2P_VER */
356 uint8 subtype; /* OUI subtype - P2P_TYPE_* */
357 uint8 dialog_token; /* nonzero, identifies req/rsp transaction */
358 uint8 elts[1]; /* Variable length information elements. Max size =
359 * ACTION_FRAME_SIZE - sizeof(this structure) - 1
361 } BWL_POST_PACKED_STRUCT;
362 typedef struct wifi_p2p_pub_act_frame wifi_p2p_pub_act_frame_t;
363 #define P2P_PUB_AF_FIXED_LEN 8
364 #define P2P_PUB_AF_CATEGORY 0x04
365 #define P2P_PUB_AF_ACTION 0x09
367 /* WiFi P2P Public Action Frame OUI Subtypes */
368 #define P2P_PAF_GON_REQ 0 /* Group Owner Negotiation Req */
369 #define P2P_PAF_GON_RSP 1 /* Group Owner Negotiation Rsp */
370 #define P2P_PAF_GON_CONF 2 /* Group Owner Negotiation Confirm */
371 #define P2P_PAF_INVITE_REQ 3 /* P2P Invitation Request */
372 #define P2P_PAF_INVITE_RSP 4 /* P2P Invitation Response */
373 #define P2P_PAF_DEVDIS_REQ 5 /* Device Discoverability Request */
374 #define P2P_PAF_DEVDIS_RSP 6 /* Device Discoverability Response */
375 #define P2P_PAF_PROVDIS_REQ 7 /* Provision Discovery Request */
376 #define P2P_PAF_PROVDIS_RSP 8 /* Provision Discovery Response */
378 /* TODO: Stop using these obsolete aliases for P2P_PAF_GON_* */
379 #define P2P_TYPE_MNREQ P2P_PAF_GON_REQ
380 #define P2P_TYPE_MNRSP P2P_PAF_GON_RSP
381 #define P2P_TYPE_MNCONF P2P_PAF_GON_CONF
383 /* WiFi P2P IE subelement: Notice of Absence */
384 BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_desc {
385 uint8 cnt_type; /* Count/Type */
386 uint32 duration; /* Duration */
387 uint32 interval; /* Interval */
388 uint32 start; /* Start Time */
389 } BWL_POST_PACKED_STRUCT;
390 typedef struct wifi_p2p_noa_desc wifi_p2p_noa_desc_t;
392 BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_se {
393 uint8 eltId; /* Subelement ID */
394 uint8 len[2]; /* Length */
395 uint8 index; /* Index */
396 uint8 ops_ctw_parms; /* CTWindow and OppPS Parameters */
397 wifi_p2p_noa_desc_t desc[1]; /* Notice of Absence Descriptor(s) */
398 } BWL_POST_PACKED_STRUCT;
399 typedef struct wifi_p2p_noa_se wifi_p2p_noa_se_t;
401 #define P2P_NOA_SE_FIXED_LEN 5
403 /* cnt_type field values */
404 #define P2P_NOA_DESC_CNT_RESERVED 0 /* reserved and should not be used */
405 #define P2P_NOA_DESC_CNT_REPEAT 255 /* continuous schedule */
406 #define P2P_NOA_DESC_TYPE_PREFERRED 1 /* preferred values */
407 #define P2P_NOA_DESC_TYPE_ACCEPTABLE 2 /* acceptable limits */
409 /* ctw_ops_parms field values */
410 #define P2P_NOA_CTW_MASK 0x7f
411 #define P2P_NOA_OPS_MASK 0x80
412 #define P2P_NOA_OPS_SHIFT 7
414 #define P2P_CTW_MIN 10 /* minimum 10TU */
417 * P2P Service Discovery related
419 #define P2PSD_ACTION_CATEGORY 0x04
420 /* Public action frame */
421 #define P2PSD_ACTION_ID_GAS_IREQ 0x0a
422 /* Action value for GAS Initial Request AF */
423 #define P2PSD_ACTION_ID_GAS_IRESP 0x0b
424 /* Action value for GAS Initial Response AF */
425 #define P2PSD_ACTION_ID_GAS_CREQ 0x0c
426 /* Action value for GAS Comback Request AF */
427 #define P2PSD_ACTION_ID_GAS_CRESP 0x0d
428 /* Action value for GAS Comback Response AF */
429 #define P2PSD_AD_EID 0x6c
430 /* Advertisement Protocol IE ID */
431 #define P2PSD_ADP_TUPLE_QLMT_PAMEBI 0x00
432 /* Query Response Length Limit 7 bits plus PAME-BI 1 bit */
433 #define P2PSD_ADP_PROTO_ID 0x00
434 /* Advertisement Protocol ID. Always 0 for P2P SD */
435 #define P2PSD_GAS_OUI P2P_OUI
436 /* WFA OUI */
437 #define P2PSD_GAS_OUI_SUBTYPE P2P_VER
438 /* OUI Subtype for GAS IE */
439 #define P2PSD_GAS_NQP_INFOID 0xDDDD
440 /* NQP Query Info ID: 56797 */
441 #define P2PSD_GAS_COMEBACKDEALY 0x00
442 /* Not used in the Native GAS protocol */
444 /* Service Protocol Type */
445 typedef enum p2psd_svc_protype {
446 SVC_RPOTYPE_ALL = 0,
447 SVC_RPOTYPE_BONJOUR = 1,
448 SVC_RPOTYPE_UPNP = 2,
449 SVC_RPOTYPE_WSD = 3,
450 SVC_RPOTYPE_VENDOR = 255
451 } p2psd_svc_protype_t;
453 /* Service Discovery response status code */
454 typedef enum {
455 P2PSD_RESP_STATUS_SUCCESS = 0,
456 P2PSD_RESP_STATUS_PROTYPE_NA = 1,
457 P2PSD_RESP_STATUS_DATA_NA = 2,
458 P2PSD_RESP_STATUS_BAD_REQUEST = 3
459 } p2psd_resp_status_t;
461 /* Advertisement Protocol IE tuple field */
462 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_tpl {
463 uint8 llm_pamebi; /* Query Response Length Limit bit 0-6, set to 0 plus
464 * Pre-Associated Message Exchange BSSID Independent bit 7, set to 0
466 uint8 adp_id; /* Advertisement Protocol ID: 0 for NQP Native Query Protocol */
467 } BWL_POST_PACKED_STRUCT;
468 typedef struct wifi_p2psd_adp_tpl wifi_p2psd_adp_tpl_t;
470 /* Advertisement Protocol IE */
471 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_ie {
472 uint8 id; /* IE ID: 0x6c - 108 */
473 uint8 len; /* IE length */
474 wifi_p2psd_adp_tpl_t adp_tpl; /* Advertisement Protocol Tuple field. Only one
475 * tuple is defined for P2P Service Discovery
477 } BWL_POST_PACKED_STRUCT;
478 typedef struct wifi_p2psd_adp_ie wifi_p2psd_adp_ie_t;
480 /* NQP Vendor-specific Content */
481 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_nqp_query_vsc {
482 uint8 oui_subtype; /* OUI Subtype: 0x09 */
483 uint16 svc_updi; /* Service Update Indicator */
484 uint8 svc_tlvs[1]; /* wifi_p2psd_qreq_tlv_t type for service request,
485 * wifi_p2psd_qresp_tlv_t type for service response
487 } BWL_POST_PACKED_STRUCT;
488 typedef struct wifi_p2psd_nqp_query_vsc wifi_p2psd_nqp_query_vsc_t;
490 /* Service Request TLV */
491 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_tlv {
492 uint16 len; /* Length: 5 plus size of Query Data */
493 uint8 svc_prot; /* Service Protocol Type */
494 uint8 svc_tscid; /* Service Transaction ID */
495 uint8 query_data[1]; /* Query Data, passed in from above Layer 2 */
496 } BWL_POST_PACKED_STRUCT;
497 typedef struct wifi_p2psd_qreq_tlv wifi_p2psd_qreq_tlv_t;
499 /* Query Request Frame, defined in generic format, instead of NQP specific */
500 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_frame {
501 uint16 info_id; /* Info ID: 0xDDDD */
502 uint16 len; /* Length of service request TLV, 5 plus the size of request data */
503 uint8 oui[3]; /* WFA OUI: 0x0050F2 */
504 uint8 qreq_vsc[1]; /* Vendor-specific Content: wifi_p2psd_nqp_query_vsc_t type for NQP */
506 } BWL_POST_PACKED_STRUCT;
507 typedef struct wifi_p2psd_qreq_frame wifi_p2psd_qreq_frame_t;
509 /* GAS Initial Request AF body, "elts" in wifi_p2p_pub_act_frame */
510 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_ireq_frame {
511 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */
512 uint16 qreq_len; /* Query Request Length */
513 uint8 qreq_frm[1]; /* Query Request Frame wifi_p2psd_qreq_frame_t */
514 } BWL_POST_PACKED_STRUCT;
515 typedef struct wifi_p2psd_gas_ireq_frame wifi_p2psd_gas_ireq_frame_t;
517 /* Service Response TLV */
518 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_tlv {
519 uint16 len; /* Length: 5 plus size of Query Data */
520 uint8 svc_prot; /* Service Protocol Type */
521 uint8 svc_tscid; /* Service Transaction ID */
522 uint8 status; /* Value defined in Table 57 of P2P spec. */
523 uint8 query_data[1]; /* Response Data, passed in from above Layer 2 */
524 } BWL_POST_PACKED_STRUCT;
525 typedef struct wifi_p2psd_qresp_tlv wifi_p2psd_qresp_tlv_t;
527 /* Query Response Frame, defined in generic format, instead of NQP specific */
528 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_frame {
529 uint16 info_id; /* Info ID: 0xDDDD */
530 uint16 len; /* Lenth of service response TLV, 6 plus the size of resp data */
531 uint8 oui[3]; /* WFA OUI: 0x0050F2 */
532 uint8 qresp_vsc[1]; /* Vendor-specific Content: wifi_p2psd_qresp_tlv_t type for NQP */
534 } BWL_POST_PACKED_STRUCT;
535 typedef struct wifi_p2psd_qresp_frame wifi_p2psd_qresp_frame_t;
537 /* GAS Initial Response AF body, "elts" in wifi_p2p_pub_act_frame */
538 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_iresp_frame {
539 uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */
540 uint16 cb_delay; /* GAS Comeback Delay */
541 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */
542 uint16 qresp_len; /* Query Response Length */
543 uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */
544 } BWL_POST_PACKED_STRUCT;
545 typedef struct wifi_p2psd_gas_iresp_frame wifi_p2psd_gas_iresp_frame_t;
547 /* GAS Comeback Response AF body, "elts" in wifi_p2p_pub_act_frame */
548 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_cresp_frame {
549 uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */
550 uint8 fragment_id; /* Fragmentation ID */
551 uint16 cb_delay; /* GAS Comeback Delay */
552 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */
553 uint16 qresp_len; /* Query Response Length */
554 uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */
555 } BWL_POST_PACKED_STRUCT;
556 typedef struct wifi_p2psd_gas_cresp_frame wifi_p2psd_gas_cresp_frame_t;
558 /* Wi-Fi GAS Public Action Frame */
559 BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_pub_act_frame {
560 uint8 category; /* 0x04 Public Action Frame */
561 uint8 action; /* 0x6c Advertisement Protocol */
562 uint8 dialog_token; /* nonzero, identifies req/rsp transaction */
563 uint8 query_data[1]; /* Query Data. wifi_p2psd_gas_ireq_frame_t
564 * or wifi_p2psd_gas_iresp_frame_t format
566 } BWL_POST_PACKED_STRUCT;
567 typedef struct wifi_p2psd_gas_pub_act_frame wifi_p2psd_gas_pub_act_frame_t;
569 /* This marks the end of a packed structure section. */
570 #include <packed_section_end.h>
572 #endif /* _P2P_H_ */