1 /* 2 * Copyright (c) 2010 Broadcom Corporation 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. 15 */ 16 17 #ifndef _BCMEVENT_H_ 18 #define _BCMEVENT_H_ 19 20 #include <linux/if_ether.h> 21 22 #define BCM_EVENT_MSG_VERSION 1 23 #define BCM_MSG_IFNAME_MAX 16 24 25 #define WLC_EVENT_MSG_LINK 0x01 26 #define WLC_EVENT_MSG_FLUSHTXQ 0x02 27 #define WLC_EVENT_MSG_GROUP 0x04 28 29 typedef struct { 30 u16 version; 31 u16 flags; 32 u32 event_type; 33 u32 status; 34 u32 reason; 35 u32 auth_type; 36 u32 datalen; 37 u8 addr[ETH_ALEN]; 38 char ifname[BCM_MSG_IFNAME_MAX]; 39 } __attribute__((packed)) wl_event_msg_t; 40 41 #ifdef BRCM_FULLMAC 42 typedef struct bcm_event { 43 struct ethhdr eth; 44 bcmeth_hdr_t bcm_hdr; 45 wl_event_msg_t event; 46 } __attribute__((packed)) bcm_event_t; 47 #endif 48 #define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - \ 49 sizeof(struct ether_header)) 50 51 #define WLC_E_SET_SSID 0 52 #define WLC_E_JOIN 1 53 #define WLC_E_START 2 54 #define WLC_E_AUTH 3 55 #define WLC_E_AUTH_IND 4 56 #define WLC_E_DEAUTH 5 57 #define WLC_E_DEAUTH_IND 6 58 #define WLC_E_ASSOC 7 59 #define WLC_E_ASSOC_IND 8 60 #define WLC_E_REASSOC 9 61 #define WLC_E_REASSOC_IND 10 62 #define WLC_E_DISASSOC 11 63 #define WLC_E_DISASSOC_IND 12 64 #define WLC_E_QUIET_START 13 65 #define WLC_E_QUIET_END 14 66 #define WLC_E_BEACON_RX 15 67 #define WLC_E_LINK 16 68 #define WLC_E_MIC_ERROR 17 69 #define WLC_E_NDIS_LINK 18 70 #define WLC_E_ROAM 19 71 #define WLC_E_TXFAIL 20 72 #define WLC_E_PMKID_CACHE 21 73 #define WLC_E_RETROGRADE_TSF 22 74 #define WLC_E_PRUNE 23 75 #define WLC_E_AUTOAUTH 24 76 #define WLC_E_EAPOL_MSG 25 77 #define WLC_E_SCAN_COMPLETE 26 78 #define WLC_E_ADDTS_IND 27 79 #define WLC_E_DELTS_IND 28 80 #define WLC_E_BCNSENT_IND 29 81 #define WLC_E_BCNRX_MSG 30 82 #define WLC_E_BCNLOST_MSG 31 83 #define WLC_E_ROAM_PREP 32 84 #define WLC_E_PFN_NET_FOUND 33 85 #define WLC_E_PFN_NET_LOST 34 86 #define WLC_E_RESET_COMPLETE 35 87 #define WLC_E_JOIN_START 36 88 #define WLC_E_ROAM_START 37 89 #define WLC_E_ASSOC_START 38 90 #define WLC_E_IBSS_ASSOC 39 91 #define WLC_E_RADIO 40 92 #define WLC_E_PSM_WATCHDOG 41 93 #define WLC_E_PROBREQ_MSG 44 94 #define WLC_E_SCAN_CONFIRM_IND 45 95 #define WLC_E_PSK_SUP 46 96 #define WLC_E_COUNTRY_CODE_CHANGED 47 97 #define WLC_E_EXCEEDED_MEDIUM_TIME 48 98 #define WLC_E_ICV_ERROR 49 99 #define WLC_E_UNICAST_DECODE_ERROR 50 100 #define WLC_E_MULTICAST_DECODE_ERROR 51 101 #define WLC_E_TRACE 52 102 #define WLC_E_IF 54 103 #define WLC_E_RSSI 56 104 #define WLC_E_PFN_SCAN_COMPLETE 57 105 #define WLC_E_EXTLOG_MSG 58 106 #define WLC_E_ACTION_FRAME 59 107 #define WLC_E_ACTION_FRAME_COMPLETE 60 108 #define WLC_E_PRE_ASSOC_IND 61 109 #define WLC_E_PRE_REASSOC_IND 62 110 #define WLC_E_CHANNEL_ADOPTED 63 111 #define WLC_E_AP_STARTED 64 112 #define WLC_E_DFS_AP_STOP 65 113 #define WLC_E_DFS_AP_RESUME 66 114 #define WLC_E_RESERVED1 67 115 #define WLC_E_RESERVED2 68 116 #define WLC_E_ESCAN_RESULT 69 117 #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70 118 #define WLC_E_DCS_REQUEST 73 119 120 #define WLC_E_FIFO_CREDIT_MAP 74 121 122 #define WLC_E_LAST 75 123 124 typedef struct { 125 uint event; 126 const char *name; 127 } bcmevent_name_t; 128 129 extern const bcmevent_name_t bcmevent_names[]; 130 extern const int bcmevent_names_size; 131 132 #define WLC_E_STATUS_SUCCESS 0 133 #define WLC_E_STATUS_FAIL 1 134 #define WLC_E_STATUS_TIMEOUT 2 135 #define WLC_E_STATUS_NO_NETWORKS 3 136 #define WLC_E_STATUS_ABORT 4 137 #define WLC_E_STATUS_NO_ACK 5 138 #define WLC_E_STATUS_UNSOLICITED 6 139 #define WLC_E_STATUS_ATTEMPT 7 140 #define WLC_E_STATUS_PARTIAL 8 141 #define WLC_E_STATUS_NEWSCAN 9 142 #define WLC_E_STATUS_NEWASSOC 10 143 #define WLC_E_STATUS_11HQUIET 11 144 #define WLC_E_STATUS_SUPPRESS 12 145 #define WLC_E_STATUS_NOCHANS 13 146 #define WLC_E_STATUS_CS_ABORT 15 147 #define WLC_E_STATUS_ERROR 16 148 149 #define WLC_E_REASON_INITIAL_ASSOC 0 150 #define WLC_E_REASON_LOW_RSSI 1 151 #define WLC_E_REASON_DEAUTH 2 152 #define WLC_E_REASON_DISASSOC 3 153 #define WLC_E_REASON_BCNS_LOST 4 154 #define WLC_E_REASON_MINTXRATE 9 155 #define WLC_E_REASON_TXFAIL 10 156 157 #define WLC_E_REASON_FAST_ROAM_FAILED 5 158 #define WLC_E_REASON_DIRECTED_ROAM 6 159 #define WLC_E_REASON_TSPEC_REJECTED 7 160 #define WLC_E_REASON_BETTER_AP 8 161 162 #define WLC_E_PRUNE_ENCR_MISMATCH 1 163 #define WLC_E_PRUNE_BCAST_BSSID 2 164 #define WLC_E_PRUNE_MAC_DENY 3 165 #define WLC_E_PRUNE_MAC_NA 4 166 #define WLC_E_PRUNE_REG_PASSV 5 167 #define WLC_E_PRUNE_SPCT_MGMT 6 168 #define WLC_E_PRUNE_RADAR 7 169 #define WLC_E_RSN_MISMATCH 8 170 #define WLC_E_PRUNE_NO_COMMON_RATES 9 171 #define WLC_E_PRUNE_BASIC_RATES 10 172 #define WLC_E_PRUNE_CIPHER_NA 12 173 #define WLC_E_PRUNE_KNOWN_STA 13 174 #define WLC_E_PRUNE_WDS_PEER 15 175 #define WLC_E_PRUNE_QBSS_LOAD 16 176 #define WLC_E_PRUNE_HOME_AP 17 177 178 #define WLC_E_SUP_OTHER 0 179 #define WLC_E_SUP_DECRYPT_KEY_DATA 1 180 #define WLC_E_SUP_BAD_UCAST_WEP128 2 181 #define WLC_E_SUP_BAD_UCAST_WEP40 3 182 #define WLC_E_SUP_UNSUP_KEY_LEN 4 183 #define WLC_E_SUP_PW_KEY_CIPHER 5 184 #define WLC_E_SUP_MSG3_TOO_MANY_IE 6 185 #define WLC_E_SUP_MSG3_IE_MISMATCH 7 186 #define WLC_E_SUP_NO_INSTALL_FLAG 8 187 #define WLC_E_SUP_MSG3_NO_GTK 9 188 #define WLC_E_SUP_GRP_KEY_CIPHER 10 189 #define WLC_E_SUP_GRP_MSG1_NO_GTK 11 190 #define WLC_E_SUP_GTK_DECRYPT_FAIL 12 191 #define WLC_E_SUP_SEND_FAIL 13 192 #define WLC_E_SUP_DEAUTH 14 193 194 #define WLC_E_IF_ADD 1 195 #define WLC_E_IF_DEL 2 196 #define WLC_E_IF_CHANGE 3 197 198 #define WLC_E_IF_ROLE_STA 0 199 #define WLC_E_IF_ROLE_AP 1 200 #define WLC_E_IF_ROLE_WDS 2 201 202 #define WLC_E_LINK_BCN_LOSS 1 203 #define WLC_E_LINK_DISASSOC 2 204 #define WLC_E_LINK_ASSOC_REC 3 205 #define WLC_E_LINK_BSSCFG_DIS 4 206 207 #endif /* _BCMEVENT_H_ */ 208