PageRenderTime 67ms CodeModel.GetById 35ms RepoModel.GetById 0ms app.codeStats 1ms

/drivers/net/wireless/bcmdhd_b1/src/include/proto/p2p.h

https://bitbucket.org/cyanogenmod/lge-kernel-iproj
C Header | 564 lines | 389 code | 150 blank | 25 comment | 0 complexity | b66343f62d3d60074fe67e2c11583ec1 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /*
  2. * Copyright (C) 1999-2012, 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 311270 2012-01-28 00:11:54Z $
  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. #include <packed_section_start.h>
  34. #define P2P_OUI WFA_OUI
  35. #define P2P_VER WFA_OUI_TYPE_P2P
  36. #define P2P_IE_ID 0xdd
  37. BWL_PRE_PACKED_STRUCT struct wifi_p2p_ie {
  38. uint8 id;
  39. uint8 len;
  40. uint8 OUI[3];
  41. uint8 oui_type;
  42. uint8 subelts[1];
  43. } BWL_POST_PACKED_STRUCT;
  44. typedef struct wifi_p2p_ie wifi_p2p_ie_t;
  45. #define P2P_IE_FIXED_LEN 6
  46. #define P2P_ATTR_ID_OFF 0
  47. #define P2P_ATTR_LEN_OFF 1
  48. #define P2P_ATTR_DATA_OFF 3
  49. #define P2P_ATTR_ID_LEN 1
  50. #define P2P_ATTR_LEN_LEN 2
  51. #define P2P_ATTR_HDR_LEN 3
  52. #define P2P_SEID_STATUS 0
  53. #define P2P_SEID_MINOR_RC 1
  54. #define P2P_SEID_P2P_INFO 2
  55. #define P2P_SEID_DEV_ID 3
  56. #define P2P_SEID_INTENT 4
  57. #define P2P_SEID_CFG_TIMEOUT 5
  58. #define P2P_SEID_CHANNEL 6
  59. #define P2P_SEID_GRP_BSSID 7
  60. #define P2P_SEID_XT_TIMING 8
  61. #define P2P_SEID_INTINTADDR 9
  62. #define P2P_SEID_P2P_MGBTY 10
  63. #define P2P_SEID_CHAN_LIST 11
  64. #define P2P_SEID_ABSENCE 12
  65. #define P2P_SEID_DEV_INFO 13
  66. #define P2P_SEID_GROUP_INFO 14
  67. #define P2P_SEID_GROUP_ID 15
  68. #define P2P_SEID_P2P_IF 16
  69. #define P2P_SEID_OP_CHANNEL 17
  70. #define P2P_SEID_INVITE_FLAGS 18
  71. #define P2P_SEID_VNDR 221
  72. #define P2P_SE_VS_ID_SERVICES 0x1b
  73. BWL_PRE_PACKED_STRUCT struct wifi_p2p_info_se_s {
  74. uint8 eltId;
  75. uint8 len[2];
  76. uint8 dev;
  77. uint8 group;
  78. } BWL_POST_PACKED_STRUCT;
  79. typedef struct wifi_p2p_info_se_s wifi_p2p_info_se_t;
  80. #define P2P_CAPSE_DEV_SERVICE_DIS 0x1
  81. #define P2P_CAPSE_DEV_CLIENT_DIS 0x2
  82. #define P2P_CAPSE_DEV_CONCURRENT 0x4
  83. #define P2P_CAPSE_DEV_INFRA_MAN 0x8
  84. #define P2P_CAPSE_DEV_LIMIT 0x10
  85. #define P2P_CAPSE_INVITE_PROC 0x20
  86. #define P2P_CAPSE_GRP_OWNER 0x1
  87. #define P2P_CAPSE_PERSIST_GRP 0x2
  88. #define P2P_CAPSE_GRP_LIMIT 0x4
  89. #define P2P_CAPSE_GRP_INTRA_BSS 0x8
  90. #define P2P_CAPSE_GRP_X_CONNECT 0x10
  91. #define P2P_CAPSE_GRP_PERSISTENT 0x20
  92. #define P2P_CAPSE_GRP_FORMATION 0x40
  93. BWL_PRE_PACKED_STRUCT struct wifi_p2p_intent_se_s {
  94. uint8 eltId;
  95. uint8 len[2];
  96. uint8 intent;
  97. } BWL_POST_PACKED_STRUCT;
  98. typedef struct wifi_p2p_intent_se_s wifi_p2p_intent_se_t;
  99. BWL_PRE_PACKED_STRUCT struct wifi_p2p_cfg_tmo_se_s {
  100. uint8 eltId;
  101. uint8 len[2];
  102. uint8 go_tmo;
  103. uint8 client_tmo;
  104. } BWL_POST_PACKED_STRUCT;
  105. typedef struct wifi_p2p_cfg_tmo_se_s wifi_p2p_cfg_tmo_se_t;
  106. BWL_PRE_PACKED_STRUCT struct wifi_p2p_listen_channel_se_s {
  107. uint8 eltId;
  108. uint8 len[2];
  109. uint8 country[3];
  110. uint8 op_class;
  111. uint8 channel;
  112. } BWL_POST_PACKED_STRUCT;
  113. typedef struct wifi_p2p_listen_channel_se_s wifi_p2p_listen_channel_se_t;
  114. BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_bssid_se_s {
  115. uint8 eltId;
  116. uint8 len[2];
  117. uint8 mac[6];
  118. } BWL_POST_PACKED_STRUCT;
  119. typedef struct wifi_p2p_grp_bssid_se_s wifi_p2p_grp_bssid_se_t;
  120. BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_id_se_s {
  121. uint8 eltId;
  122. uint8 len[2];
  123. uint8 mac[6];
  124. uint8 ssid[1];
  125. } BWL_POST_PACKED_STRUCT;
  126. typedef struct wifi_p2p_grp_id_se_s wifi_p2p_grp_id_se_t;
  127. BWL_PRE_PACKED_STRUCT struct wifi_p2p_intf_se_s {
  128. uint8 eltId;
  129. uint8 len[2];
  130. uint8 mac[6];
  131. uint8 ifaddrs;
  132. uint8 ifaddr[1][6];
  133. } BWL_POST_PACKED_STRUCT;
  134. typedef struct wifi_p2p_intf_se_s wifi_p2p_intf_se_t;
  135. BWL_PRE_PACKED_STRUCT struct wifi_p2p_status_se_s {
  136. uint8 eltId;
  137. uint8 len[2];
  138. uint8 status;
  139. } BWL_POST_PACKED_STRUCT;
  140. typedef struct wifi_p2p_status_se_s wifi_p2p_status_se_t;
  141. #define P2P_STATSE_SUCCESS 0
  142. #define P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 1
  143. #define P2P_STATSE_PASSED_UP P2P_STATSE_FAIL_INFO_CURR_UNAVAIL
  144. #define P2P_STATSE_FAIL_INCOMPAT_PARAMS 2
  145. #define P2P_STATSE_FAIL_LIMIT_REACHED 3
  146. #define P2P_STATSE_FAIL_INVALID_PARAMS 4
  147. #define P2P_STATSE_FAIL_UNABLE_TO_ACCOM 5
  148. #define P2P_STATSE_FAIL_PROTO_ERROR 6
  149. #define P2P_STATSE_FAIL_NO_COMMON_CHAN 7
  150. #define P2P_STATSE_FAIL_UNKNOWN_GROUP 8
  151. #define P2P_STATSE_FAIL_INTENT 9
  152. #define P2P_STATSE_FAIL_INCOMPAT_PROVIS 10
  153. #define P2P_STATSE_FAIL_USER_REJECT 11
  154. BWL_PRE_PACKED_STRUCT struct wifi_p2p_ext_se_s {
  155. uint8 eltId;
  156. uint8 len[2];
  157. uint8 avail[2];
  158. uint8 interval[2];
  159. } BWL_POST_PACKED_STRUCT;
  160. typedef struct wifi_p2p_ext_se_s wifi_p2p_ext_se_t;
  161. #define P2P_EXT_MIN 10
  162. BWL_PRE_PACKED_STRUCT struct wifi_p2p_intintad_se_s {
  163. uint8 eltId;
  164. uint8 len[2];
  165. uint8 mac[6];
  166. } BWL_POST_PACKED_STRUCT;
  167. typedef struct wifi_p2p_intintad_se_s wifi_p2p_intintad_se_t;
  168. BWL_PRE_PACKED_STRUCT struct wifi_p2p_channel_se_s {
  169. uint8 eltId;
  170. uint8 len[2];
  171. uint8 band;
  172. uint8 channel;
  173. } BWL_POST_PACKED_STRUCT;
  174. typedef struct wifi_p2p_channel_se_s wifi_p2p_channel_se_t;
  175. BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_entry_s {
  176. uint8 band;
  177. uint8 num_channels;
  178. uint8 channels[WL_NUMCHANNELS];
  179. } BWL_POST_PACKED_STRUCT;
  180. typedef struct wifi_p2p_chanlist_entry_s wifi_p2p_chanlist_entry_t;
  181. #define WIFI_P2P_CHANLIST_SE_MAX_ENTRIES 2
  182. BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_se_s {
  183. uint8 eltId;
  184. uint8 len[2];
  185. uint8 country[3];
  186. uint8 num_entries;
  187. wifi_p2p_chanlist_entry_t entries[WIFI_P2P_CHANLIST_SE_MAX_ENTRIES];
  188. } BWL_POST_PACKED_STRUCT;
  189. typedef struct wifi_p2p_chanlist_se_s wifi_p2p_chanlist_se_t;
  190. BWL_PRE_PACKED_STRUCT struct wifi_p2p_pri_devtype_s {
  191. uint16 cat_id;
  192. uint8 OUI[3];
  193. uint8 oui_type;
  194. uint16 sub_cat_id;
  195. } BWL_POST_PACKED_STRUCT;
  196. typedef struct wifi_p2p_pri_devtype_s wifi_p2p_pri_devtype_t;
  197. BWL_PRE_PACKED_STRUCT struct wifi_p2p_devinfo_se_s {
  198. uint8 eltId;
  199. uint8 len[2];
  200. uint8 mac[6];
  201. uint16 wps_cfg_meths;
  202. uint8 pri_devtype[8];
  203. } BWL_POST_PACKED_STRUCT;
  204. typedef struct wifi_p2p_devinfo_se_s wifi_p2p_devinfo_se_t;
  205. #define P2P_DEV_TYPE_LEN 8
  206. BWL_PRE_PACKED_STRUCT struct wifi_p2p_cid_fixed_s {
  207. uint8 len;
  208. uint8 devaddr[ETHER_ADDR_LEN];
  209. uint8 ifaddr[ETHER_ADDR_LEN];
  210. uint8 devcap;
  211. uint8 cfg_meths[2];
  212. uint8 pridt[P2P_DEV_TYPE_LEN];
  213. uint8 secdts;
  214. } BWL_POST_PACKED_STRUCT;
  215. typedef struct wifi_p2p_cid_fixed_s wifi_p2p_cid_fixed_t;
  216. BWL_PRE_PACKED_STRUCT struct wifi_p2p_devid_se_s {
  217. uint8 eltId;
  218. uint8 len[2];
  219. struct ether_addr addr;
  220. } BWL_POST_PACKED_STRUCT;
  221. typedef struct wifi_p2p_devid_se_s wifi_p2p_devid_se_t;
  222. BWL_PRE_PACKED_STRUCT struct wifi_p2p_mgbt_se_s {
  223. uint8 eltId;
  224. uint8 len[2];
  225. uint8 mg_bitmap;
  226. } BWL_POST_PACKED_STRUCT;
  227. typedef struct wifi_p2p_mgbt_se_s wifi_p2p_mgbt_se_t;
  228. #define P2P_MGBTSE_P2PDEVMGMT_FLAG 0x1
  229. BWL_PRE_PACKED_STRUCT struct wifi_p2p_grpinfo_se_s {
  230. uint8 eltId;
  231. uint8 len[2];
  232. } BWL_POST_PACKED_STRUCT;
  233. typedef struct wifi_p2p_grpinfo_se_s wifi_p2p_grpinfo_se_t;
  234. BWL_PRE_PACKED_STRUCT struct wifi_p2p_op_channel_se_s {
  235. uint8 eltId;
  236. uint8 len[2];
  237. uint8 country[3];
  238. uint8 op_class;
  239. uint8 channel;
  240. } BWL_POST_PACKED_STRUCT;
  241. typedef struct wifi_p2p_op_channel_se_s wifi_p2p_op_channel_se_t;
  242. BWL_PRE_PACKED_STRUCT struct wifi_p2p_invite_flags_se_s {
  243. uint8 eltId;
  244. uint8 len[2];
  245. uint8 flags;
  246. } BWL_POST_PACKED_STRUCT;
  247. typedef struct wifi_p2p_invite_flags_se_s wifi_p2p_invite_flags_se_t;
  248. BWL_PRE_PACKED_STRUCT struct wifi_p2p_action_frame {
  249. uint8 category;
  250. uint8 OUI[3];
  251. uint8 type;
  252. uint8 subtype;
  253. uint8 dialog_token;
  254. uint8 elts[1];
  255. } BWL_POST_PACKED_STRUCT;
  256. typedef struct wifi_p2p_action_frame wifi_p2p_action_frame_t;
  257. #define P2P_AF_CATEGORY 0x7f
  258. #define P2P_AF_FIXED_LEN 7
  259. #define P2P_AF_NOTICE_OF_ABSENCE 0
  260. #define P2P_AF_PRESENCE_REQ 1
  261. #define P2P_AF_PRESENCE_RSP 2
  262. #define P2P_AF_GO_DISC_REQ 3
  263. BWL_PRE_PACKED_STRUCT struct wifi_p2p_pub_act_frame {
  264. uint8 category;
  265. uint8 action;
  266. uint8 oui[3];
  267. uint8 oui_type;
  268. uint8 subtype;
  269. uint8 dialog_token;
  270. uint8 elts[1];
  271. } BWL_POST_PACKED_STRUCT;
  272. typedef struct wifi_p2p_pub_act_frame wifi_p2p_pub_act_frame_t;
  273. #define P2P_PUB_AF_FIXED_LEN 8
  274. #define P2P_PUB_AF_CATEGORY 0x04
  275. #define P2P_PUB_AF_ACTION 0x09
  276. #define P2P_PAF_GON_REQ 0
  277. #define P2P_PAF_GON_RSP 1
  278. #define P2P_PAF_GON_CONF 2
  279. #define P2P_PAF_INVITE_REQ 3
  280. #define P2P_PAF_INVITE_RSP 4
  281. #define P2P_PAF_DEVDIS_REQ 5
  282. #define P2P_PAF_DEVDIS_RSP 6
  283. #define P2P_PAF_PROVDIS_REQ 7
  284. #define P2P_PAF_PROVDIS_RSP 8
  285. #define P2P_TYPE_MNREQ P2P_PAF_GON_REQ
  286. #define P2P_TYPE_MNRSP P2P_PAF_GON_RSP
  287. #define P2P_TYPE_MNCONF P2P_PAF_GON_CONF
  288. BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_desc {
  289. uint8 cnt_type;
  290. uint32 duration;
  291. uint32 interval;
  292. uint32 start;
  293. } BWL_POST_PACKED_STRUCT;
  294. typedef struct wifi_p2p_noa_desc wifi_p2p_noa_desc_t;
  295. BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_se {
  296. uint8 eltId;
  297. uint8 len[2];
  298. uint8 index;
  299. uint8 ops_ctw_parms;
  300. wifi_p2p_noa_desc_t desc[1];
  301. } BWL_POST_PACKED_STRUCT;
  302. typedef struct wifi_p2p_noa_se wifi_p2p_noa_se_t;
  303. #define P2P_NOA_SE_FIXED_LEN 5
  304. #define P2P_NOA_DESC_CNT_RESERVED 0
  305. #define P2P_NOA_DESC_CNT_REPEAT 255
  306. #define P2P_NOA_DESC_TYPE_PREFERRED 1
  307. #define P2P_NOA_DESC_TYPE_ACCEPTABLE 2
  308. #define P2P_NOA_CTW_MASK 0x7f
  309. #define P2P_NOA_OPS_MASK 0x80
  310. #define P2P_NOA_OPS_SHIFT 7
  311. #define P2P_CTW_MIN 10
  312. #define P2PSD_ACTION_CATEGORY 0x04
  313. #define P2PSD_ACTION_ID_GAS_IREQ 0x0a
  314. #define P2PSD_ACTION_ID_GAS_IRESP 0x0b
  315. #define P2PSD_ACTION_ID_GAS_CREQ 0x0c
  316. #define P2PSD_ACTION_ID_GAS_CRESP 0x0d
  317. #define P2PSD_AD_EID 0x6c
  318. #define P2PSD_ADP_TUPLE_QLMT_PAMEBI 0x00
  319. #define P2PSD_ADP_PROTO_ID 0x00
  320. #define P2PSD_GAS_OUI P2P_OUI
  321. #define P2PSD_GAS_OUI_SUBTYPE P2P_VER
  322. #define P2PSD_GAS_NQP_INFOID 0xDDDD
  323. #define P2PSD_GAS_COMEBACKDEALY 0x00
  324. typedef enum p2psd_svc_protype {
  325. SVC_RPOTYPE_ALL = 0,
  326. SVC_RPOTYPE_BONJOUR = 1,
  327. SVC_RPOTYPE_UPNP = 2,
  328. SVC_RPOTYPE_WSD = 3,
  329. SVC_RPOTYPE_VENDOR = 255
  330. } p2psd_svc_protype_t;
  331. typedef enum {
  332. P2PSD_RESP_STATUS_SUCCESS = 0,
  333. P2PSD_RESP_STATUS_PROTYPE_NA = 1,
  334. P2PSD_RESP_STATUS_DATA_NA = 2,
  335. P2PSD_RESP_STATUS_BAD_REQUEST = 3
  336. } p2psd_resp_status_t;
  337. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_tpl {
  338. uint8 llm_pamebi;
  339. uint8 adp_id;
  340. } BWL_POST_PACKED_STRUCT;
  341. typedef struct wifi_p2psd_adp_tpl wifi_p2psd_adp_tpl_t;
  342. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_ie {
  343. uint8 id;
  344. uint8 len;
  345. wifi_p2psd_adp_tpl_t adp_tpl;
  346. } BWL_POST_PACKED_STRUCT;
  347. typedef struct wifi_p2psd_adp_ie wifi_p2psd_adp_ie_t;
  348. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_nqp_query_vsc {
  349. uint8 oui_subtype;
  350. uint16 svc_updi;
  351. uint8 svc_tlvs[1];
  352. } BWL_POST_PACKED_STRUCT;
  353. typedef struct wifi_p2psd_nqp_query_vsc wifi_p2psd_nqp_query_vsc_t;
  354. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_tlv {
  355. uint16 len;
  356. uint8 svc_prot;
  357. uint8 svc_tscid;
  358. uint8 query_data[1];
  359. } BWL_POST_PACKED_STRUCT;
  360. typedef struct wifi_p2psd_qreq_tlv wifi_p2psd_qreq_tlv_t;
  361. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_frame {
  362. uint16 info_id;
  363. uint16 len;
  364. uint8 oui[3];
  365. uint8 qreq_vsc[1];
  366. } BWL_POST_PACKED_STRUCT;
  367. typedef struct wifi_p2psd_qreq_frame wifi_p2psd_qreq_frame_t;
  368. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_ireq_frame {
  369. wifi_p2psd_adp_ie_t adp_ie;
  370. uint16 qreq_len;
  371. uint8 qreq_frm[1];
  372. } BWL_POST_PACKED_STRUCT;
  373. typedef struct wifi_p2psd_gas_ireq_frame wifi_p2psd_gas_ireq_frame_t;
  374. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_tlv {
  375. uint16 len;
  376. uint8 svc_prot;
  377. uint8 svc_tscid;
  378. uint8 status;
  379. uint8 query_data[1];
  380. } BWL_POST_PACKED_STRUCT;
  381. typedef struct wifi_p2psd_qresp_tlv wifi_p2psd_qresp_tlv_t;
  382. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_frame {
  383. uint16 info_id;
  384. uint16 len;
  385. uint8 oui[3];
  386. uint8 qresp_vsc[1];
  387. } BWL_POST_PACKED_STRUCT;
  388. typedef struct wifi_p2psd_qresp_frame wifi_p2psd_qresp_frame_t;
  389. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_iresp_frame {
  390. uint16 status;
  391. uint16 cb_delay;
  392. wifi_p2psd_adp_ie_t adp_ie;
  393. uint16 qresp_len;
  394. uint8 qresp_frm[1];
  395. } BWL_POST_PACKED_STRUCT;
  396. typedef struct wifi_p2psd_gas_iresp_frame wifi_p2psd_gas_iresp_frame_t;
  397. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_cresp_frame {
  398. uint16 status;
  399. uint8 fragment_id;
  400. uint16 cb_delay;
  401. wifi_p2psd_adp_ie_t adp_ie;
  402. uint16 qresp_len;
  403. uint8 qresp_frm[1];
  404. } BWL_POST_PACKED_STRUCT;
  405. typedef struct wifi_p2psd_gas_cresp_frame wifi_p2psd_gas_cresp_frame_t;
  406. BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_pub_act_frame {
  407. uint8 category;
  408. uint8 action;
  409. uint8 dialog_token;
  410. uint8 query_data[1];
  411. } BWL_POST_PACKED_STRUCT;
  412. typedef struct wifi_p2psd_gas_pub_act_frame wifi_p2psd_gas_pub_act_frame_t;
  413. #include <packed_section_end.h>
  414. #endif