/drivers/net/wireless/bcmdhd_29/include/proto/p2p.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 512 lines · 335 code · 67 blank · 110 comment · 0 complexity · 41d8ddd28ae4f5d148b99e3caad541e8 MD5 · raw file

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