/drivers/net/wireless/bcmdhd_29/include/proto/p2p.h
C Header | 512 lines | 335 code | 67 blank | 110 comment | 0 complexity | 41d8ddd28ae4f5d148b99e3caad541e8 MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
1/* 2 * Copyright (C) 1999-2011, Broadcom Corporation 3 * 4 * Unless you and Broadcom execute a separate written software license 5 * agreement governing use of this software, this software is licensed to you 6 * under the terms of the GNU General Public License version 2 (the "GPL"), 7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 8 * following added to such license: 9 * 10 * As a special exception, the copyright holders of this software give you 11 * permission to link this software with independent modules, and to copy and 12 * distribute the resulting executable under terms of your choice, provided that 13 * you also meet, for each linked independent module, the terms and conditions of 14 * the license of that module. An independent module is a module which is not 15 * derived from this software. The special exception does not apply to any 16 * modifications of the software. 17 * 18 * Notwithstanding the above, under no circumstances may you combine this 19 * software in any way with any other Broadcom software provided under a license 20 * other than the GPL, without Broadcom's express prior written consent. 21 * 22 * Fundamental types and constants relating to WFA P2P (aka WiFi Direct) 23 * 24 * $Id: p2p.h 277737 2011-08-16 17:54:59Z $ 25 */ 26 27#ifndef _P2P_H_ 28#define _P2P_H_ 29 30#ifndef _TYPEDEFS_H_ 31#include <typedefs.h> 32#endif 33#include <wlioctl.h> 34#include <proto/802.11.h> 35 36/* This marks the start of a packed structure section. */ 37#include <packed_section_start.h> 38 39 40/* WiFi P2P OUI values */ 41#define P2P_OUI WFA_OUI /* WiFi P2P OUI */ 42#define P2P_VER WFA_OUI_TYPE_P2P /* P2P version: 9=WiFi P2P v1.0 */ 43 44#define P2P_IE_ID 0xdd /* P2P IE element ID */ 45 46/* WiFi P2P IE */ 47BWL_PRE_PACKED_STRUCT struct wifi_p2p_ie { 48 uint8 id; /* IE ID: 0xDD */ 49 uint8 len; /* IE length */ 50 uint8 OUI[3]; /* WiFi P2P specific OUI: P2P_OUI */ 51 uint8 oui_type; /* Identifies P2P version: P2P_VER */ 52 uint8 subelts[1]; /* variable length subelements */ 53} BWL_POST_PACKED_STRUCT; 54typedef struct wifi_p2p_ie wifi_p2p_ie_t; 55 56#define P2P_IE_FIXED_LEN 6 57 58#define P2P_ATTR_ID_OFF 0 59#define P2P_ATTR_LEN_OFF 1 60#define P2P_ATTR_DATA_OFF 3 61 62#define P2P_ATTR_HDR_LEN 3 /* ID + 2-byte length field spec 1.02 */ 63 64/* P2P IE Subelement IDs from WiFi P2P Technical Spec 1.00 */ 65#define P2P_SEID_STATUS 0 /* Status */ 66#define P2P_SEID_MINOR_RC 1 /* Minor Reason Code */ 67#define P2P_SEID_P2P_INFO 2 /* P2P Capability (capabilities info) */ 68#define P2P_SEID_DEV_ID 3 /* P2P Device ID */ 69#define P2P_SEID_INTENT 4 /* Group Owner Intent */ 70#define P2P_SEID_CFG_TIMEOUT 5 /* Configuration Timeout */ 71#define P2P_SEID_CHANNEL 6 /* Channel */ 72#define P2P_SEID_GRP_BSSID 7 /* P2P Group BSSID */ 73#define P2P_SEID_XT_TIMING 8 /* Extended Listen Timing */ 74#define P2P_SEID_INTINTADDR 9 /* Intended P2P Interface Address */ 75#define P2P_SEID_P2P_MGBTY 10 /* P2P Manageability */ 76#define P2P_SEID_CHAN_LIST 11 /* Channel List */ 77#define P2P_SEID_ABSENCE 12 /* Notice of Absence */ 78#define P2P_SEID_DEV_INFO 13 /* Device Info */ 79#define P2P_SEID_GROUP_INFO 14 /* Group Info */ 80#define P2P_SEID_GROUP_ID 15 /* Group ID */ 81#define P2P_SEID_P2P_IF 16 /* P2P Interface */ 82#define P2P_SEID_VNDR 221 /* Vendor-specific subelement */ 83 84#define P2P_SE_VS_ID_SERVICES 0x1b /* BRCM proprietary subel: L2 Services */ 85 86 87/* WiFi P2P IE subelement: P2P Capability (capabilities info) */ 88BWL_PRE_PACKED_STRUCT struct wifi_p2p_info_se_s { 89 uint8 eltId; /* SE ID: P2P_SEID_P2P_INFO */ 90 uint8 len[2]; /* SE length not including eltId, len fields */ 91 uint8 dev; /* Device Capability Bitmap */ 92 uint8 group; /* Group Capability Bitmap */ 93} BWL_POST_PACKED_STRUCT; 94typedef struct wifi_p2p_info_se_s wifi_p2p_info_se_t; 95 96/* P2P Capability subelement's Device Capability Bitmap bit values */ 97#define P2P_CAPSE_DEV_SERVICE_DIS 0x1 /* Service Discovery */ 98#define P2P_CAPSE_DEV_CLIENT_DIS 0x2 /* Client Discoverability */ 99#define P2P_CAPSE_DEV_CONCURRENT 0x4 /* Concurrent Operation */ 100#define P2P_CAPSE_DEV_INFRA_MAN 0x8 /* P2P Infrastructure Managed */ 101#define P2P_CAPSE_DEV_LIMIT 0x10 /* P2P Device Limit */ 102#define P2P_CAPSE_INVITE_PROC 0x20 /* P2P Invitation Procedure */ 103 104/* P2P Capability subelement's Group Capability Bitmap bit values */ 105#define P2P_CAPSE_GRP_OWNER 0x1 /* P2P Group Owner */ 106#define P2P_CAPSE_PERSIST_GRP 0x2 /* Persistent P2P Group */ 107#define P2P_CAPSE_GRP_LIMIT 0x4 /* P2P Group Limit */ 108#define P2P_CAPSE_GRP_INTRA_BSS 0x8 /* Intra-BSS Distribution */ 109#define P2P_CAPSE_GRP_X_CONNECT 0x10 /* Cross Connection */ 110#define P2P_CAPSE_GRP_PERSISTENT 0x20 /* Persistent Reconnect */ 111#define P2P_CAPSE_GRP_FORMATION 0x40 /* Group Formation */ 112 113 114/* WiFi P2P IE subelement: Group Owner Intent */ 115BWL_PRE_PACKED_STRUCT struct wifi_p2p_intent_se_s { 116 uint8 eltId; /* SE ID: P2P_SEID_INTENT */ 117 uint8 len[2]; /* SE length not including eltId, len fields */ 118 uint8 intent; /* Intent Value 0...15 (0=legacy 15=master only) */ 119} BWL_POST_PACKED_STRUCT; 120typedef struct wifi_p2p_intent_se_s wifi_p2p_intent_se_t; 121 122/* WiFi P2P IE subelement: Configuration Timeout */ 123BWL_PRE_PACKED_STRUCT struct wifi_p2p_cfg_tmo_se_s { 124 uint8 eltId; /* SE ID: P2P_SEID_CFG_TIMEOUT */ 125 uint8 len[2]; /* SE length not including eltId, len fields */ 126 uint8 go_tmo; /* GO config timeout in units of 10 ms */ 127 uint8 client_tmo; /* Client config timeout in units of 10 ms */ 128} BWL_POST_PACKED_STRUCT; 129typedef struct wifi_p2p_cfg_tmo_se_s wifi_p2p_cfg_tmo_se_t; 130 131 132/* WiFi P2P IE subelement: Status */ 133BWL_PRE_PACKED_STRUCT struct wifi_p2p_status_se_s { 134 uint8 eltId; /* SE ID: P2P_SEID_STATUS */ 135 uint8 len[2]; /* SE length not including eltId, len fields */ 136 uint8 status; /* Status Code: P2P_STATSE_* */ 137} BWL_POST_PACKED_STRUCT; 138typedef struct wifi_p2p_status_se_s wifi_p2p_status_se_t; 139 140/* Status subelement Status Code definitions */ 141#define P2P_STATSE_SUCCESS 0 142 /* Success */ 143#define P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 1 144 /* Failed, information currently unavailable */ 145#define P2P_STATSE_PASSED_UP P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 146 /* Old name for above in P2P spec 1.08 and older */ 147#define P2P_STATSE_FAIL_INCOMPAT_PARAMS 2 148 /* Failed, incompatible parameters */ 149#define P2P_STATSE_FAIL_LIMIT_REACHED 3 150 /* Failed, limit reached */ 151#define P2P_STATSE_FAIL_INVALID_PARAMS 4 152 /* Failed, invalid parameters */ 153#define P2P_STATSE_FAIL_UNABLE_TO_ACCOM 5 154 /* Failed, unable to accomodate request */ 155#define P2P_STATSE_FAIL_PROTO_ERROR 6 156 /* Failed, previous protocol error or disruptive behaviour */ 157#define P2P_STATSE_FAIL_NO_COMMON_CHAN 7 158 /* Failed, no common channels */ 159#define P2P_STATSE_FAIL_UNKNOWN_GROUP 8 160 /* Failed, unknown P2P Group */ 161#define P2P_STATSE_FAIL_INTENT 9 162 /* Failed, both peers indicated Intent 15 in GO Negotiation */ 163#define P2P_STATSE_FAIL_INCOMPAT_PROVIS 10 164 /* Failed, incompatible provisioning method */ 165#define P2P_STATSE_FAIL_USER_REJECT 11 166 /* Failed, rejected by user */ 167 168/* WiFi P2P IE attribute: Extended Listen Timing */ 169BWL_PRE_PACKED_STRUCT struct wifi_p2p_ext_se_s { 170 uint8 eltId; /* ID: P2P_SEID_EXT_TIMING */ 171 uint8 len[2]; /* length not including eltId, len fields */ 172 uint8 avail[2]; /* availibility period */ 173 uint8 interval[2]; /* availibility interval */ 174} BWL_POST_PACKED_STRUCT; 175typedef struct wifi_p2p_ext_se_s wifi_p2p_ext_se_t; 176 177#define P2P_EXT_MIN 10 /* minimum 10ms */ 178 179/* WiFi P2P IE subelement: Intended P2P Interface Address */ 180BWL_PRE_PACKED_STRUCT struct wifi_p2p_intintad_se_s { 181 uint8 eltId; /* SE ID: P2P_SEID_INTINTADDR */ 182 uint8 len[2]; /* SE length not including eltId, len fields */ 183 uint8 mac[6]; /* intended P2P interface MAC address */ 184} BWL_POST_PACKED_STRUCT; 185typedef struct wifi_p2p_intintad_se_s wifi_p2p_intintad_se_t; 186 187/* WiFi P2P IE subelement: Channel */ 188BWL_PRE_PACKED_STRUCT struct wifi_p2p_channel_se_s { 189 uint8 eltId; /* SE ID: P2P_SEID_STATUS */ 190 uint8 len[2]; /* SE length not including eltId, len fields */ 191 uint8 band; /* Regulatory Class (band) */ 192 uint8 channel; /* Channel */ 193} BWL_POST_PACKED_STRUCT; 194typedef struct wifi_p2p_channel_se_s wifi_p2p_channel_se_t; 195 196 197/* Channel Entry structure within the Channel List SE */ 198BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_entry_s { 199 uint8 band; /* Regulatory Class (band) */ 200 uint8 num_channels; /* # of channels in the channel list */ 201 uint8 channels[WL_NUMCHANNELS]; /* Channel List */ 202} BWL_POST_PACKED_STRUCT; 203typedef struct wifi_p2p_chanlist_entry_s wifi_p2p_chanlist_entry_t; 204#define WIFI_P2P_CHANLIST_SE_MAX_ENTRIES 2 205 206/* WiFi P2P IE subelement: Channel List */ 207BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_se_s { 208 uint8 eltId; /* SE ID: P2P_SEID_STATUS */ 209 uint8 len[2]; /* SE length not including eltId, len fields */ 210 uint8 country[3]; /* Country String */ 211 uint8 num_entries; /* # of channel entries */ 212 wifi_p2p_chanlist_entry_t entries[WIFI_P2P_CHANLIST_SE_MAX_ENTRIES]; 213 /* Channel Entry List */ 214} BWL_POST_PACKED_STRUCT; 215typedef struct wifi_p2p_chanlist_se_s wifi_p2p_chanlist_se_t; 216 217/* WiFi P2P IE's Device Info subelement */ 218BWL_PRE_PACKED_STRUCT struct wifi_p2p_devinfo_se_s { 219 uint8 eltId; /* SE ID: P2P_SEID_DEVINFO */ 220 uint8 len[2]; /* SE length not including eltId, len fields */ 221 uint8 mac[6]; /* P2P Device MAC address */ 222 uint16 wps_cfg_meths; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */ 223 uint8 pri_devtype[8]; /* Primary Device Type */ 224} BWL_POST_PACKED_STRUCT; 225typedef struct wifi_p2p_devinfo_se_s wifi_p2p_devinfo_se_t; 226 227#define P2P_DEV_TYPE_LEN 8 228 229/* WiFi P2P IE's Group Info subelement Client Info Descriptor */ 230BWL_PRE_PACKED_STRUCT struct wifi_p2p_cid_fixed_s { 231 uint8 len; 232 uint8 devaddr[ETHER_ADDR_LEN]; /* P2P Device Address */ 233 uint8 ifaddr[ETHER_ADDR_LEN]; /* P2P Interface Address */ 234 uint8 devcap; /* Device Capability */ 235 uint8 cfg_meths[2]; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */ 236 uint8 pridt[P2P_DEV_TYPE_LEN]; /* Primary Device Type */ 237 uint8 secdts; /* Number of Secondary Device Types */ 238} BWL_POST_PACKED_STRUCT; 239typedef struct wifi_p2p_cid_fixed_s wifi_p2p_cid_fixed_t; 240 241/* WiFi P2P IE's Device ID subelement */ 242BWL_PRE_PACKED_STRUCT struct wifi_p2p_devid_se_s { 243 uint8 eltId; 244 uint8 len[2]; 245 struct ether_addr addr; /* P2P Device MAC address */ 246} BWL_POST_PACKED_STRUCT; 247typedef struct wifi_p2p_devid_se_s wifi_p2p_devid_se_t; 248 249/* WiFi P2P IE subelement: P2P Manageability */ 250BWL_PRE_PACKED_STRUCT struct wifi_p2p_mgbt_se_s { 251 uint8 eltId; /* SE ID: P2P_SEID_P2P_MGBTY */ 252 uint8 len[2]; /* SE length not including eltId, len fields */ 253 uint8 mg_bitmap; /* manageability bitmap */ 254} BWL_POST_PACKED_STRUCT; 255typedef struct wifi_p2p_mgbt_se_s wifi_p2p_mgbt_se_t; 256/* mg_bitmap field bit values */ 257#define P2P_MGBTSE_P2PDEVMGMT_FLAG 0x1 /* AP supports Managed P2P Device */ 258 259/* WiFi P2P IE subelement: Group Info */ 260BWL_PRE_PACKED_STRUCT struct wifi_p2p_grpinfo_se_s { 261 uint8 eltId; /* SE ID: P2P_SEID_GROUP_INFO */ 262 uint8 len[2]; /* SE length not including eltId, len fields */ 263} BWL_POST_PACKED_STRUCT; 264typedef struct wifi_p2p_grpinfo_se_s wifi_p2p_grpinfo_se_t; 265 266 267/* WiFi P2P Action Frame */ 268BWL_PRE_PACKED_STRUCT struct wifi_p2p_action_frame { 269 uint8 category; /* P2P_AF_CATEGORY */ 270 uint8 OUI[3]; /* OUI - P2P_OUI */ 271 uint8 type; /* OUI Type - P2P_VER */ 272 uint8 subtype; /* OUI Subtype - P2P_AF_* */ 273 uint8 dialog_token; /* nonzero, identifies req/resp tranaction */ 274 uint8 elts[1]; /* Variable length information elements. Max size = 275 * ACTION_FRAME_SIZE - sizeof(this structure) - 1 276 */ 277} BWL_POST_PACKED_STRUCT; 278typedef struct wifi_p2p_action_frame wifi_p2p_action_frame_t; 279#define P2P_AF_CATEGORY 0x7f 280 281#define P2P_AF_FIXED_LEN 7 282 283/* WiFi P2P Action Frame OUI Subtypes */ 284#define P2P_AF_NOTICE_OF_ABSENCE 0 /* Notice of Absence */ 285#define P2P_AF_PRESENCE_REQ 1 /* P2P Presence Request */ 286#define P2P_AF_PRESENCE_RSP 2 /* P2P Presence Response */ 287#define P2P_AF_GO_DISC_REQ 3 /* GO Discoverability Request */ 288 289 290/* WiFi P2P Public Action Frame */ 291BWL_PRE_PACKED_STRUCT struct wifi_p2p_pub_act_frame { 292 uint8 category; /* P2P_PUB_AF_CATEGORY */ 293 uint8 action; /* P2P_PUB_AF_ACTION */ 294 uint8 oui[3]; /* P2P_OUI */ 295 uint8 oui_type; /* OUI type - P2P_VER */ 296 uint8 subtype; /* OUI subtype - P2P_TYPE_* */ 297 uint8 dialog_token; /* nonzero, identifies req/rsp transaction */ 298 uint8 elts[1]; /* Variable length information elements. Max size = 299 * ACTION_FRAME_SIZE - sizeof(this structure) - 1 300 */ 301} BWL_POST_PACKED_STRUCT; 302typedef struct wifi_p2p_pub_act_frame wifi_p2p_pub_act_frame_t; 303#define P2P_PUB_AF_FIXED_LEN 8 304#define P2P_PUB_AF_CATEGORY 0x04 305#define P2P_PUB_AF_ACTION 0x09 306 307/* WiFi P2P Public Action Frame OUI Subtypes */ 308#define P2P_PAF_GON_REQ 0 /* Group Owner Negotiation Req */ 309#define P2P_PAF_GON_RSP 1 /* Group Owner Negotiation Rsp */ 310#define P2P_PAF_GON_CONF 2 /* Group Owner Negotiation Confirm */ 311#define P2P_PAF_INVITE_REQ 3 /* P2P Invitation Request */ 312#define P2P_PAF_INVITE_RSP 4 /* P2P Invitation Response */ 313#define P2P_PAF_DEVDIS_REQ 5 /* Device Discoverability Request */ 314#define P2P_PAF_DEVDIS_RSP 6 /* Device Discoverability Response */ 315#define P2P_PAF_PROVDIS_REQ 7 /* Provision Discovery Request */ 316#define P2P_PAF_PROVDIS_RSP 8 /* Provision Discovery Request */ 317 318/* TODO: Stop using these obsolete aliases for P2P_PAF_GON_* */ 319#define P2P_TYPE_MNREQ P2P_PAF_GON_REQ 320#define P2P_TYPE_MNRSP P2P_PAF_GON_RSP 321#define P2P_TYPE_MNCONF P2P_PAF_GON_CONF 322 323/* WiFi P2P IE subelement: Notice of Absence */ 324BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_desc { 325 uint8 cnt_type; /* Count/Type */ 326 uint32 duration; /* Duration */ 327 uint32 interval; /* Interval */ 328 uint32 start; /* Start Time */ 329} BWL_POST_PACKED_STRUCT; 330typedef struct wifi_p2p_noa_desc wifi_p2p_noa_desc_t; 331 332BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_se { 333 uint8 eltId; /* Subelement ID */ 334 uint8 len[2]; /* Length */ 335 uint8 index; /* Index */ 336 uint8 ops_ctw_parms; /* CTWindow and OppPS Parameters */ 337 wifi_p2p_noa_desc_t desc[1]; /* Notice of Absence Descriptor(s) */ 338} BWL_POST_PACKED_STRUCT; 339typedef struct wifi_p2p_noa_se wifi_p2p_noa_se_t; 340 341#define P2P_NOA_SE_FIXED_LEN 5 342 343/* cnt_type field values */ 344#define P2P_NOA_DESC_CNT_RESERVED 0 /* reserved and should not be used */ 345#define P2P_NOA_DESC_CNT_REPEAT 255 /* continuous schedule */ 346#define P2P_NOA_DESC_TYPE_PREFERRED 1 /* preferred values */ 347#define P2P_NOA_DESC_TYPE_ACCEPTABLE 2 /* acceptable limits */ 348 349/* ctw_ops_parms field values */ 350#define P2P_NOA_CTW_MASK 0x7f 351#define P2P_NOA_OPS_MASK 0x80 352#define P2P_NOA_OPS_SHIFT 7 353 354#define P2P_CTW_MIN 10 /* minimum 10TU */ 355 356/* 357 * P2P Service Discovery related 358 */ 359#define P2PSD_ACTION_CATEGORY 0x04 360 /* Public action frame */ 361#define P2PSD_ACTION_ID_GAS_IREQ 0x0a 362 /* Action value for GAS Initial Request AF */ 363#define P2PSD_ACTION_ID_GAS_IRESP 0x0b 364 /* Action value for GAS Initial Response AF */ 365#define P2PSD_ACTION_ID_GAS_CREQ 0x0c 366 /* Action value for GAS Comback Request AF */ 367#define P2PSD_ACTION_ID_GAS_CRESP 0x0d 368 /* Action value for GAS Comback Response AF */ 369#define P2PSD_AD_EID 0x6c 370 /* Advertisement Protocol IE ID */ 371#define P2PSD_ADP_TUPLE_QLMT_PAMEBI 0x00 372 /* Query Response Length Limit 7 bits plus PAME-BI 1 bit */ 373#define P2PSD_ADP_PROTO_ID 0x00 374 /* Advertisement Protocol ID. Always 0 for P2P SD */ 375#define P2PSD_GAS_OUI P2P_OUI 376 /* WFA OUI */ 377#define P2PSD_GAS_OUI_SUBTYPE P2P_VER 378 /* OUI Subtype for GAS IE */ 379#define P2PSD_GAS_NQP_INFOID 0xDDDD 380 /* NQP Query Info ID: 56797 */ 381#define P2PSD_GAS_COMEBACKDEALY 0x00 382 /* Not used in the Native GAS protocol */ 383 384/* Service Protocol Type */ 385typedef enum p2psd_svc_protype { 386 SVC_RPOTYPE_ALL = 0, 387 SVC_RPOTYPE_BONJOUR = 1, 388 SVC_RPOTYPE_UPNP = 2, 389 SVC_RPOTYPE_WSD = 3, 390 SVC_RPOTYPE_VENDOR = 255 391} p2psd_svc_protype_t; 392 393/* Service Discovery response status code */ 394typedef enum { 395 P2PSD_RESP_STATUS_SUCCESS = 0, 396 P2PSD_RESP_STATUS_PROTYPE_NA = 1, 397 P2PSD_RESP_STATUS_DATA_NA = 2, 398 P2PSD_RESP_STATUS_BAD_REQUEST = 3 399} p2psd_resp_status_t; 400 401/* Advertisement Protocol IE tuple field */ 402BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_tpl { 403 uint8 llm_pamebi; /* Query Response Length Limit bit 0-6, set to 0 plus 404 * Pre-Associated Message Exchange BSSID Independent bit 7, set to 0 405 */ 406 uint8 adp_id; /* Advertisement Protocol ID: 0 for NQP Native Query Protocol */ 407} BWL_POST_PACKED_STRUCT; 408typedef struct wifi_p2psd_adp_tpl wifi_p2psd_adp_tpl_t; 409 410/* Advertisement Protocol IE */ 411BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_ie { 412 uint8 id; /* IE ID: 0x6c - 108 */ 413 uint8 len; /* IE length */ 414 wifi_p2psd_adp_tpl_t adp_tpl; /* Advertisement Protocol Tuple field. Only one 415 * tuple is defined for P2P Service Discovery 416 */ 417} BWL_POST_PACKED_STRUCT; 418typedef struct wifi_p2psd_adp_ie wifi_p2psd_adp_ie_t; 419 420/* NQP Vendor-specific Content */ 421BWL_PRE_PACKED_STRUCT struct wifi_p2psd_nqp_query_vsc { 422 uint8 oui_subtype; /* OUI Subtype: 0x09 */ 423 uint16 svc_updi; /* Service Update Indicator */ 424 uint8 svc_tlvs[1]; /* wifi_p2psd_qreq_tlv_t type for service request, 425 * wifi_p2psd_qresp_tlv_t type for service response 426 */ 427} BWL_POST_PACKED_STRUCT; 428typedef struct wifi_p2psd_nqp_query_vsc wifi_p2psd_nqp_query_vsc_t; 429 430/* Service Request TLV */ 431BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_tlv { 432 uint16 len; /* Length: 5 plus size of Query Data */ 433 uint8 svc_prot; /* Service Protocol Type */ 434 uint8 svc_tscid; /* Service Transaction ID */ 435 uint8 query_data[1]; /* Query Data, passed in from above Layer 2 */ 436} BWL_POST_PACKED_STRUCT; 437typedef struct wifi_p2psd_qreq_tlv wifi_p2psd_qreq_tlv_t; 438 439/* Query Request Frame, defined in generic format, instead of NQP specific */ 440BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_frame { 441 uint16 info_id; /* Info ID: 0xDDDD */ 442 uint16 len; /* Length of service request TLV, 5 plus the size of request data */ 443 uint8 oui[3]; /* WFA OUI: 0x0050F2 */ 444 uint8 qreq_vsc[1]; /* Vendor-specific Content: wifi_p2psd_nqp_query_vsc_t type for NQP */ 445 446} BWL_POST_PACKED_STRUCT; 447typedef struct wifi_p2psd_qreq_frame wifi_p2psd_qreq_frame_t; 448 449/* GAS Initial Request AF body, "elts" in wifi_p2p_pub_act_frame */ 450BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_ireq_frame { 451 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ 452 uint16 qreq_len; /* Query Request Length */ 453 uint8 qreq_frm[1]; /* Query Request Frame wifi_p2psd_qreq_frame_t */ 454} BWL_POST_PACKED_STRUCT; 455typedef struct wifi_p2psd_gas_ireq_frame wifi_p2psd_gas_ireq_frame_t; 456 457/* Service Response TLV */ 458BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_tlv { 459 uint16 len; /* Length: 5 plus size of Query Data */ 460 uint8 svc_prot; /* Service Protocol Type */ 461 uint8 svc_tscid; /* Service Transaction ID */ 462 uint8 status; /* Value defined in Table 57 of P2P spec. */ 463 uint8 query_data[1]; /* Response Data, passed in from above Layer 2 */ 464} BWL_POST_PACKED_STRUCT; 465typedef struct wifi_p2psd_qresp_tlv wifi_p2psd_qresp_tlv_t; 466 467/* Query Response Frame, defined in generic format, instead of NQP specific */ 468BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_frame { 469 uint16 info_id; /* Info ID: 0xDDDD */ 470 uint16 len; /* Lenth of service response TLV, 6 plus the size of resp data */ 471 uint8 oui[3]; /* WFA OUI: 0x0050F2 */ 472 uint8 qresp_vsc[1]; /* Vendor-specific Content: wifi_p2psd_qresp_tlv_t type for NQP */ 473 474} BWL_POST_PACKED_STRUCT; 475typedef struct wifi_p2psd_qresp_frame wifi_p2psd_qresp_frame_t; 476 477/* GAS Initial Response AF body, "elts" in wifi_p2p_pub_act_frame */ 478BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_iresp_frame { 479 uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */ 480 uint16 cb_delay; /* GAS Comeback Delay */ 481 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ 482 uint16 qresp_len; /* Query Response Length */ 483 uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */ 484} BWL_POST_PACKED_STRUCT; 485typedef struct wifi_p2psd_gas_iresp_frame wifi_p2psd_gas_iresp_frame_t; 486 487/* GAS Comeback Response AF body, "elts" in wifi_p2p_pub_act_frame */ 488BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_cresp_frame { 489 uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */ 490 uint8 fragment_id; /* Fragmentation ID */ 491 uint16 cb_delay; /* GAS Comeback Delay */ 492 wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ 493 uint16 qresp_len; /* Query Response Length */ 494 uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */ 495} BWL_POST_PACKED_STRUCT; 496typedef struct wifi_p2psd_gas_cresp_frame wifi_p2psd_gas_cresp_frame_t; 497 498/* Wi-Fi GAS Public Action Frame */ 499BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_pub_act_frame { 500 uint8 category; /* 0x04 Public Action Frame */ 501 uint8 action; /* 0x6c Advertisement Protocol */ 502 uint8 dialog_token; /* nonzero, identifies req/rsp transaction */ 503 uint8 query_data[1]; /* Query Data. wifi_p2psd_gas_ireq_frame_t 504 * or wifi_p2psd_gas_iresp_frame_t format 505 */ 506} BWL_POST_PACKED_STRUCT; 507typedef struct wifi_p2psd_gas_pub_act_frame wifi_p2psd_gas_pub_act_frame_t; 508 509/* This marks the end of a packed structure section. */ 510#include <packed_section_end.h> 511 512#endif /* _P2P_H_ */