PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/bcm4330/src/include/proto/bcmevent.h

https://github.com/drowningchild/Defuse-Kernel
C Header | 314 lines | 225 code | 30 blank | 59 comment | 0 complexity | b4b4a9fdc424e7dad94f8a0175353b9f MD5 | raw file
  1. /*
  2. * Broadcom Event protocol definitions
  3. *
  4. * Copyright (C) 1999-2011, Broadcom Corporation
  5. *
  6. * Unless you and Broadcom execute a separate written software license
  7. * agreement governing use of this software, this software is licensed to you
  8. * under the terms of the GNU General Public License version 2 (the "GPL"),
  9. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  10. * following added to such license:
  11. *
  12. * As a special exception, the copyright holders of this software give you
  13. * permission to link this software with independent modules, and to copy and
  14. * distribute the resulting executable under terms of your choice, provided that
  15. * you also meet, for each linked independent module, the terms and conditions of
  16. * the license of that module. An independent module is a module which is not
  17. * derived from this software. The special exception does not apply to any
  18. * modifications of the software.
  19. *
  20. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * Dependencies: proto/bcmeth.h
  25. *
  26. * $Id: bcmevent.h,v 9.64.2.8 2010/12/22 23:47:28 Exp $
  27. *
  28. */
  29. /*
  30. * Broadcom Ethernet Events protocol defines
  31. *
  32. */
  33. #ifndef _BCMEVENT_H_
  34. #define _BCMEVENT_H_
  35. #ifndef _TYPEDEFS_H_
  36. #include <typedefs.h>
  37. #endif
  38. /* This marks the start of a packed structure section. */
  39. #include <packed_section_start.h>
  40. #define BCM_EVENT_MSG_VERSION 2 /* wl_event_msg_t struct version */
  41. #define BCM_MSG_IFNAME_MAX 16 /* max length of interface name */
  42. /* flags */
  43. #define WLC_EVENT_MSG_LINK 0x01 /* link is up */
  44. #define WLC_EVENT_MSG_FLUSHTXQ 0x02 /* flush tx queue on MIC error */
  45. #define WLC_EVENT_MSG_GROUP 0x04 /* group MIC error */
  46. #define WLC_EVENT_MSG_UNKBSS 0x08 /* unknown source bsscfg */
  47. #define WLC_EVENT_MSG_UNKIF 0x10 /* unknown source OS i/f */
  48. /* these fields are stored in network order */
  49. /* version 1 */
  50. typedef BWL_PRE_PACKED_STRUCT struct
  51. {
  52. uint16 version;
  53. uint16 flags; /* see flags below */
  54. uint32 event_type; /* Message (see below) */
  55. uint32 status; /* Status code (see below) */
  56. uint32 reason; /* Reason code (if applicable) */
  57. uint32 auth_type; /* WLC_E_AUTH */
  58. uint32 datalen; /* data buf */
  59. struct ether_addr addr; /* Station address (if applicable) */
  60. char ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
  61. } BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
  62. /* the current version */
  63. typedef BWL_PRE_PACKED_STRUCT struct
  64. {
  65. uint16 version;
  66. uint16 flags; /* see flags below */
  67. uint32 event_type; /* Message (see below) */
  68. uint32 status; /* Status code (see below) */
  69. uint32 reason; /* Reason code (if applicable) */
  70. uint32 auth_type; /* WLC_E_AUTH */
  71. uint32 datalen; /* data buf */
  72. struct ether_addr addr; /* Station address (if applicable) */
  73. char ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
  74. uint8 ifidx; /* destination OS i/f index */
  75. uint8 bsscfgidx; /* source bsscfg index */
  76. } BWL_POST_PACKED_STRUCT wl_event_msg_t;
  77. /* used by driver msgs */
  78. typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
  79. struct ether_header eth;
  80. bcmeth_hdr_t bcm_hdr;
  81. wl_event_msg_t event;
  82. /* data portion follows */
  83. } BWL_POST_PACKED_STRUCT bcm_event_t;
  84. #define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
  85. /* Event messages */
  86. #define WLC_E_SET_SSID 0 /* indicates status of set SSID */
  87. #define WLC_E_JOIN 1 /* differentiates join IBSS from found (WLC_E_START) IBSS */
  88. #define WLC_E_START 2 /* STA founded an IBSS or AP started a BSS */
  89. #define WLC_E_AUTH 3 /* 802.11 AUTH request */
  90. #define WLC_E_AUTH_IND 4 /* 802.11 AUTH indication */
  91. #define WLC_E_DEAUTH 5 /* 802.11 DEAUTH request */
  92. #define WLC_E_DEAUTH_IND 6 /* 802.11 DEAUTH indication */
  93. #define WLC_E_ASSOC 7 /* 802.11 ASSOC request */
  94. #define WLC_E_ASSOC_IND 8 /* 802.11 ASSOC indication */
  95. #define WLC_E_REASSOC 9 /* 802.11 REASSOC request */
  96. #define WLC_E_REASSOC_IND 10 /* 802.11 REASSOC indication */
  97. #define WLC_E_DISASSOC 11 /* 802.11 DISASSOC request */
  98. #define WLC_E_DISASSOC_IND 12 /* 802.11 DISASSOC indication */
  99. #define WLC_E_QUIET_START 13 /* 802.11h Quiet period started */
  100. #define WLC_E_QUIET_END 14 /* 802.11h Quiet period ended */
  101. #define WLC_E_BEACON_RX 15 /* BEACONS received/lost indication */
  102. #define WLC_E_LINK 16 /* generic link indication */
  103. #define WLC_E_MIC_ERROR 17 /* TKIP MIC error occurred */
  104. #define WLC_E_NDIS_LINK 18 /* NDIS style link indication */
  105. #define WLC_E_ROAM 19 /* roam attempt occurred: indicate status & reason */
  106. #define WLC_E_TXFAIL 20 /* change in dot11FailedCount (txfail) */
  107. #define WLC_E_PMKID_CACHE 21 /* WPA2 pmkid cache indication */
  108. #define WLC_E_RETROGRADE_TSF 22 /* current AP's TSF value went backward */
  109. #define WLC_E_PRUNE 23 /* AP was pruned from join list for reason */
  110. #define WLC_E_AUTOAUTH 24 /* report AutoAuth table entry match for join attempt */
  111. #define WLC_E_EAPOL_MSG 25 /* Event encapsulating an EAPOL message */
  112. #define WLC_E_SCAN_COMPLETE 26 /* Scan results are ready or scan was aborted */
  113. #define WLC_E_ADDTS_IND 27 /* indicate to host addts fail/success */
  114. #define WLC_E_DELTS_IND 28 /* indicate to host delts fail/success */
  115. #define WLC_E_BCNSENT_IND 29 /* indicate to host of beacon transmit */
  116. #define WLC_E_BCNRX_MSG 30 /* Send the received beacon up to the host */
  117. #define WLC_E_BCNLOST_MSG 31 /* indicate to host loss of beacon */
  118. #define WLC_E_ROAM_PREP 32 /* before attempting to roam */
  119. #define WLC_E_PFN_NET_FOUND 33 /* PFN network found event */
  120. #define WLC_E_PFN_NET_LOST 34 /* PFN network lost event */
  121. #define WLC_E_RESET_COMPLETE 35
  122. #define WLC_E_JOIN_START 36
  123. #define WLC_E_ROAM_START 37
  124. #define WLC_E_ASSOC_START 38
  125. #define WLC_E_IBSS_ASSOC 39
  126. #define WLC_E_RADIO 40
  127. #define WLC_E_PSM_WATCHDOG 41 /* PSM microcode watchdog fired */
  128. #define WLC_E_PROBREQ_MSG 44 /* probe request received */
  129. #define WLC_E_SCAN_CONFIRM_IND 45
  130. #define WLC_E_PSK_SUP 46 /* WPA Handshake fail */
  131. #define WLC_E_COUNTRY_CODE_CHANGED 47
  132. #define WLC_E_EXCEEDED_MEDIUM_TIME 48 /* WMMAC excedded medium time */
  133. #define WLC_E_ICV_ERROR 49 /* WEP ICV error occurred */
  134. #define WLC_E_UNICAST_DECODE_ERROR 50 /* Unsupported unicast encrypted frame */
  135. #define WLC_E_MULTICAST_DECODE_ERROR 51 /* Unsupported multicast encrypted frame */
  136. #define WLC_E_TRACE 52
  137. #ifdef WLBTAMP
  138. #define WLC_E_BTA_HCI_EVENT 53
  139. #endif
  140. #define WLC_E_IF 54 /* I/F change (for dongle host notification) */
  141. #ifdef WLP2P
  142. #define WLC_E_P2P_DISC_LISTEN_COMPLETE 55 /* listen state expires */
  143. #endif
  144. #define WLC_E_RSSI 56 /* indicate RSSI change based on configured levels */
  145. #define WLC_E_PFN_SCAN_COMPLETE 57 /* PFN completed scan of network list */
  146. #define WLC_E_EXTLOG_MSG 58
  147. #define WLC_E_ACTION_FRAME 59 /* Action frame Rx */
  148. #define WLC_E_ACTION_FRAME_COMPLETE 60 /* Action frame Tx complete */
  149. #define WLC_E_PRE_ASSOC_IND 61 /* assoc request received */
  150. #define WLC_E_PRE_REASSOC_IND 62 /* re-assoc request received */
  151. #define WLC_E_CHANNEL_ADOPTED 63
  152. #define WLC_E_AP_STARTED 64 /* AP started */
  153. #define WLC_E_DFS_AP_STOP 65 /* AP stopped due to DFS */
  154. #define WLC_E_DFS_AP_RESUME 66 /* AP resumed due to DFS */
  155. #define WLC_E_WAI_STA_EVENT 67 /* WAI stations event */
  156. #define WLC_E_WAI_MSG 68 /* event encapsulating an WAI message */
  157. #define WLC_E_ESCAN_RESULT 69 /* escan result event */
  158. #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70 /* action frame off channel complete */
  159. #ifdef WLP2P
  160. #define WLC_E_PROBRESP_MSG 71 /* probe response received */
  161. #define WLC_E_P2P_PROBREQ_MSG 72 /* P2P Probe request received */
  162. #endif
  163. #define WLC_E_DCS_REQUEST 73
  164. #define WLC_E_FIFO_CREDIT_MAP 74 /* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
  165. #define WLC_E_ACTION_FRAME_RX 75 /* Received action frame event WITH
  166. * wl_event_rx_frame_data_t header
  167. */
  168. #define WLC_E_WAKE_EVENT 76 /* Wake Event timer fired, used for wake WLAN test mode */
  169. #define WLC_E_RM_COMPLETE 77 /* Radio measurement complete */
  170. #define WLC_E_HTSFSYNC 78 /* Synchronize TSF with the host */
  171. #define WLC_E_OVERLAY_REQ 79 /* request an overlay IOCTL/iovar from the host */
  172. #define WLC_E_LAST 80 /* highest val + 1 for range checking */
  173. /* Table of event name strings for UIs and debugging dumps */
  174. typedef struct {
  175. uint event;
  176. const char *name;
  177. } bcmevent_name_t;
  178. extern const bcmevent_name_t bcmevent_names[];
  179. extern const int bcmevent_names_size;
  180. /* Event status codes */
  181. #define WLC_E_STATUS_SUCCESS 0 /* operation was successful */
  182. #define WLC_E_STATUS_FAIL 1 /* operation failed */
  183. #define WLC_E_STATUS_TIMEOUT 2 /* operation timed out */
  184. #define WLC_E_STATUS_NO_NETWORKS 3 /* failed due to no matching network found */
  185. #define WLC_E_STATUS_ABORT 4 /* operation was aborted */
  186. #define WLC_E_STATUS_NO_ACK 5 /* protocol failure: packet not ack'd */
  187. #define WLC_E_STATUS_UNSOLICITED 6 /* AUTH or ASSOC packet was unsolicited */
  188. #define WLC_E_STATUS_ATTEMPT 7 /* attempt to assoc to an auto auth configuration */
  189. #define WLC_E_STATUS_PARTIAL 8 /* scan results are incomplete */
  190. #define WLC_E_STATUS_NEWSCAN 9 /* scan aborted by another scan */
  191. #define WLC_E_STATUS_NEWASSOC 10 /* scan aborted due to assoc in progress */
  192. #define WLC_E_STATUS_11HQUIET 11 /* 802.11h quiet period started */
  193. #define WLC_E_STATUS_SUPPRESS 12 /* user disabled scanning (WLC_SET_SCANSUPPRESS) */
  194. #define WLC_E_STATUS_NOCHANS 13 /* no allowable channels to scan */
  195. #define WLC_E_STATUS_CS_ABORT 15 /* abort channel select */
  196. #define WLC_E_STATUS_ERROR 16 /* request failed due to error */
  197. /* roam reason codes */
  198. #define WLC_E_REASON_INITIAL_ASSOC 0 /* initial assoc */
  199. #define WLC_E_REASON_LOW_RSSI 1 /* roamed due to low RSSI */
  200. #define WLC_E_REASON_DEAUTH 2 /* roamed due to DEAUTH indication */
  201. #define WLC_E_REASON_DISASSOC 3 /* roamed due to DISASSOC indication */
  202. #define WLC_E_REASON_BCNS_LOST 4 /* roamed due to lost beacons */
  203. #define WLC_E_REASON_MINTXRATE 9 /* roamed because at mintxrate for too long */
  204. #define WLC_E_REASON_TXFAIL 10 /* We can hear AP, but AP can't hear us */
  205. /* Roam codes used primarily by CCX */
  206. #define WLC_E_REASON_FAST_ROAM_FAILED 5 /* roamed due to fast roam failure */
  207. #define WLC_E_REASON_DIRECTED_ROAM 6 /* roamed due to request by AP */
  208. #define WLC_E_REASON_TSPEC_REJECTED 7 /* roamed due to TSPEC rejection */
  209. #define WLC_E_REASON_BETTER_AP 8 /* roamed due to finding better AP */
  210. /* prune reason codes */
  211. #define WLC_E_PRUNE_ENCR_MISMATCH 1 /* encryption mismatch */
  212. #define WLC_E_PRUNE_BCAST_BSSID 2 /* AP uses a broadcast BSSID */
  213. #define WLC_E_PRUNE_MAC_DENY 3 /* STA's MAC addr is in AP's MAC deny list */
  214. #define WLC_E_PRUNE_MAC_NA 4 /* STA's MAC addr is not in AP's MAC allow list */
  215. #define WLC_E_PRUNE_REG_PASSV 5 /* AP not allowed due to regulatory restriction */
  216. #define WLC_E_PRUNE_SPCT_MGMT 6 /* AP does not support STA locale spectrum mgmt */
  217. #define WLC_E_PRUNE_RADAR 7 /* AP is on a radar channel of STA locale */
  218. #define WLC_E_RSN_MISMATCH 8 /* STA does not support AP's RSN */
  219. #define WLC_E_PRUNE_NO_COMMON_RATES 9 /* No rates in common with AP */
  220. #define WLC_E_PRUNE_BASIC_RATES 10 /* STA does not support all basic rates of BSS */
  221. #define WLC_E_PRUNE_CIPHER_NA 12 /* BSS's cipher not supported */
  222. #define WLC_E_PRUNE_KNOWN_STA 13 /* AP is already known to us as a STA */
  223. #define WLC_E_PRUNE_WDS_PEER 15 /* AP is already known to us as a WDS peer */
  224. #define WLC_E_PRUNE_QBSS_LOAD 16 /* QBSS LOAD - AAC is too low */
  225. #define WLC_E_PRUNE_HOME_AP 17 /* prune home AP */
  226. /* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
  227. #define WLC_E_SUP_OTHER 0 /* Other reason */
  228. #define WLC_E_SUP_DECRYPT_KEY_DATA 1 /* Decryption of key data failed */
  229. #define WLC_E_SUP_BAD_UCAST_WEP128 2 /* Illegal use of ucast WEP128 */
  230. #define WLC_E_SUP_BAD_UCAST_WEP40 3 /* Illegal use of ucast WEP40 */
  231. #define WLC_E_SUP_UNSUP_KEY_LEN 4 /* Unsupported key length */
  232. #define WLC_E_SUP_PW_KEY_CIPHER 5 /* Unicast cipher mismatch in pairwise key */
  233. #define WLC_E_SUP_MSG3_TOO_MANY_IE 6 /* WPA IE contains > 1 RSN IE in key msg 3 */
  234. #define WLC_E_SUP_MSG3_IE_MISMATCH 7 /* WPA IE mismatch in key message 3 */
  235. #define WLC_E_SUP_NO_INSTALL_FLAG 8 /* INSTALL flag unset in 4-way msg */
  236. #define WLC_E_SUP_MSG3_NO_GTK 9 /* encapsulated GTK missing from msg 3 */
  237. #define WLC_E_SUP_GRP_KEY_CIPHER 10 /* Multicast cipher mismatch in group key */
  238. #define WLC_E_SUP_GRP_MSG1_NO_GTK 11 /* encapsulated GTK missing from group msg 1 */
  239. #define WLC_E_SUP_GTK_DECRYPT_FAIL 12 /* GTK decrypt failure */
  240. #define WLC_E_SUP_SEND_FAIL 13 /* message send failure */
  241. #define WLC_E_SUP_DEAUTH 14 /* received FC_DEAUTH */
  242. #define WLC_E_SUP_WPA_PSK_TMO 15 /* WPA PSK 4-way handshake timeout */
  243. /* Event data for events that include frames received over the air */
  244. /* WLC_E_PROBRESP_MSG
  245. * WLC_E_P2P_PROBREQ_MSG
  246. * WLC_E_ACTION_FRAME_RX
  247. */
  248. typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data {
  249. uint16 version;
  250. uint16 channel; /* Matches chanspec_t format from bcmwifi.h */
  251. int32 rssi;
  252. uint32 mactime;
  253. uint32 rate;
  254. } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_t;
  255. #define BCM_RX_FRAME_DATA_VERSION 1
  256. /* WLC_E_IF event data */
  257. typedef struct wl_event_data_if {
  258. uint8 ifidx;
  259. uint8 opcode; /* see I/F opcode */
  260. uint8 reserved;
  261. uint8 bssidx; /* bsscfg index */
  262. uint8 role; /* see I/F role */
  263. } wl_event_data_if_t;
  264. /* I/F opcode in WLC_E_IF event */
  265. #define WLC_E_IF_ADD 1 /* add */
  266. #define WLC_E_IF_DEL 2 /* delete */
  267. #define WLC_E_IF_CHANGE 3 /* change */
  268. /* I/F role code in WLC_E_IF event */
  269. #define WLC_E_IF_ROLE_STA 0 /* Infra STA */
  270. #define WLC_E_IF_ROLE_AP 1 /* Access Point */
  271. #define WLC_E_IF_ROLE_WDS 2 /* WDS link */
  272. #define WLC_E_IF_ROLE_P2P_GO 3 /* P2P Group Owner */
  273. #define WLC_E_IF_ROLE_P2P_CLIENT 4 /* P2P Client */
  274. /* Reason codes for LINK */
  275. #define WLC_E_LINK_BCN_LOSS 1 /* Link down because of beacon loss */
  276. #define WLC_E_LINK_DISASSOC 2 /* Link down because of disassoc */
  277. #define WLC_E_LINK_ASSOC_REC 3 /* Link down because assoc recreate failed */
  278. #define WLC_E_LINK_BSSCFG_DIS 4 /* Link down due to bsscfg down */
  279. /* reason codes for WLC_E_OVERLAY_REQ event */
  280. #define WLC_E_OVL_DOWNLOAD 0 /* overlay download request */
  281. #define WLC_E_OVL_UPDATE_IND 1 /* device indication of host overlay update */
  282. /* This marks the end of a packed structure section. */
  283. #include <packed_section_end.h>
  284. #endif /* _BCMEVENT_H_ */