wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
driver_hostap.h
Go to the documentation of this file.
1 
5 #ifndef HOSTAP_DRIVER_H
6 #define HOSTAP_DRIVER_H
7 
8 /* netdevice private ioctls (used, e.g., with iwpriv from user space) */
9 
10 /* New wireless extensions API - SET/GET convention (even ioctl numbers are
11  * root only)
12  */
13 #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
14 #define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
15 #define PRISM2_IOCTL_WRITEMIF (SIOCIWFIRSTPRIV + 2)
16 #define PRISM2_IOCTL_READMIF (SIOCIWFIRSTPRIV + 3)
17 #define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4)
18 #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6)
19 #define PRISM2_IOCTL_INQUIRE (SIOCIWFIRSTPRIV + 8)
20 #define PRISM2_IOCTL_WDS_ADD (SIOCIWFIRSTPRIV + 10)
21 #define PRISM2_IOCTL_WDS_DEL (SIOCIWFIRSTPRIV + 12)
22 #define PRISM2_IOCTL_SET_RID_WORD (SIOCIWFIRSTPRIV + 14)
23 #define PRISM2_IOCTL_MACCMD (SIOCIWFIRSTPRIV + 16)
24 #define PRISM2_IOCTL_ADDMAC (SIOCIWFIRSTPRIV + 18)
25 #define PRISM2_IOCTL_DELMAC (SIOCIWFIRSTPRIV + 20)
26 #define PRISM2_IOCTL_KICKMAC (SIOCIWFIRSTPRIV + 22)
27 
28 /* following are not in SIOCGIWPRIV list; check permission in the driver code
29  */
30 #define PRISM2_IOCTL_DOWNLOAD (SIOCDEVPRIVATE + 13)
31 #define PRISM2_IOCTL_HOSTAPD (SIOCDEVPRIVATE + 14)
32 
33 
34 /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */
35 enum {
36  /* PRISM2_PARAM_PTYPE = 1, */ /* REMOVED 2003-10-22 */
37  PRISM2_PARAM_TXRATECTRL = 2,
38  PRISM2_PARAM_BEACON_INT = 3,
39  PRISM2_PARAM_PSEUDO_IBSS = 4,
40  PRISM2_PARAM_ALC = 5,
41  /* PRISM2_PARAM_TXPOWER = 6, */ /* REMOVED 2003-10-22 */
42  PRISM2_PARAM_DUMP = 7,
43  PRISM2_PARAM_OTHER_AP_POLICY = 8,
44  PRISM2_PARAM_AP_MAX_INACTIVITY = 9,
45  PRISM2_PARAM_AP_BRIDGE_PACKETS = 10,
46  PRISM2_PARAM_DTIM_PERIOD = 11,
47  PRISM2_PARAM_AP_NULLFUNC_ACK = 12,
48  PRISM2_PARAM_MAX_WDS = 13,
49  PRISM2_PARAM_AP_AUTOM_AP_WDS = 14,
50  PRISM2_PARAM_AP_AUTH_ALGS = 15,
51  PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16,
52  PRISM2_PARAM_HOST_ENCRYPT = 17,
53  PRISM2_PARAM_HOST_DECRYPT = 18,
54  PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19,
55  PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20,
56  PRISM2_PARAM_HOST_ROAMING = 21,
57  PRISM2_PARAM_BCRX_STA_KEY = 22,
58  PRISM2_PARAM_IEEE_802_1X = 23,
59  PRISM2_PARAM_ANTSEL_TX = 24,
60  PRISM2_PARAM_ANTSEL_RX = 25,
61  PRISM2_PARAM_MONITOR_TYPE = 26,
62  PRISM2_PARAM_WDS_TYPE = 27,
63  PRISM2_PARAM_HOSTSCAN = 28,
64  PRISM2_PARAM_AP_SCAN = 29,
65  PRISM2_PARAM_ENH_SEC = 30,
66  PRISM2_PARAM_IO_DEBUG = 31,
67  PRISM2_PARAM_BASIC_RATES = 32,
68  PRISM2_PARAM_OPER_RATES = 33,
69  PRISM2_PARAM_HOSTAPD = 34,
70  PRISM2_PARAM_HOSTAPD_STA = 35,
71  PRISM2_PARAM_WPA = 36,
72  PRISM2_PARAM_PRIVACY_INVOKED = 37,
73  PRISM2_PARAM_TKIP_COUNTERMEASURES = 38,
74  PRISM2_PARAM_DROP_UNENCRYPTED = 39,
75  PRISM2_PARAM_SCAN_CHANNEL_MASK = 40,
76 };
77 
78 enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1,
79  HOSTAP_ANTSEL_LOW = 2, HOSTAP_ANTSEL_HIGH = 3 };
80 
81 
82 /* PRISM2_IOCTL_MACCMD ioctl() subcommands: */
83 enum { AP_MAC_CMD_POLICY_OPEN = 0, AP_MAC_CMD_POLICY_ALLOW = 1,
84  AP_MAC_CMD_POLICY_DENY = 2, AP_MAC_CMD_FLUSH = 3,
85  AP_MAC_CMD_KICKALL = 4 };
86 
87 
88 /* PRISM2_IOCTL_DOWNLOAD ioctl() dl_cmd: */
89 enum {
90  PRISM2_DOWNLOAD_VOLATILE = 1 /* RAM */,
91  /* Note! Old versions of prism2_srec have a fatal error in CRC-16
92  * calculation, which will corrupt all non-volatile downloads.
93  * PRISM2_DOWNLOAD_NON_VOLATILE used to be 2, but it is now 3 to
94  * prevent use of old versions of prism2_srec for non-volatile
95  * download. */
96  PRISM2_DOWNLOAD_NON_VOLATILE = 3 /* FLASH */,
97  PRISM2_DOWNLOAD_VOLATILE_GENESIS = 4 /* RAM in Genesis mode */,
98  /* Persistent versions of volatile download commands (keep firmware
99  * data in memory and automatically re-download after hw_reset */
100  PRISM2_DOWNLOAD_VOLATILE_PERSISTENT = 5,
101  PRISM2_DOWNLOAD_VOLATILE_GENESIS_PERSISTENT = 6,
102 };
103 
105  u32 dl_cmd;
106  u32 start_addr;
107  u32 num_areas;
109  u32 addr; /* wlan card address */
110  u32 len;
111  caddr_t ptr; /* pointer to data in user space */
112  } data[0];
113 };
114 
115 #define PRISM2_MAX_DOWNLOAD_AREA_LEN 131072
116 #define PRISM2_MAX_DOWNLOAD_LEN 262144
117 
118 
119 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
120 enum {
121  PRISM2_HOSTAPD_FLUSH = 1,
122  PRISM2_HOSTAPD_ADD_STA = 2,
123  PRISM2_HOSTAPD_REMOVE_STA = 3,
124  PRISM2_HOSTAPD_GET_INFO_STA = 4,
125  /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
126  PRISM2_SET_ENCRYPTION = 6,
127  PRISM2_GET_ENCRYPTION = 7,
128  PRISM2_HOSTAPD_SET_FLAGS_STA = 8,
129  PRISM2_HOSTAPD_GET_RID = 9,
130  PRISM2_HOSTAPD_SET_RID = 10,
131  PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR = 11,
132  PRISM2_HOSTAPD_SET_GENERIC_ELEMENT = 12,
133  PRISM2_HOSTAPD_MLME = 13,
134  PRISM2_HOSTAPD_SCAN_REQ = 14,
135  PRISM2_HOSTAPD_STA_CLEAR_STATS = 15,
136 };
137 
138 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
139 #define PRISM2_HOSTAPD_RID_HDR_LEN \
140 ((size_t) (&((struct prism2_hostapd_param *) 0)->u.rid.data))
141 #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
142 ((size_t) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data))
143 
144 /* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
145  */
146 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
147 
148 
150  u32 cmd;
151  u8 sta_addr[ETH_ALEN];
152  union {
153  struct {
154  u16 aid;
155  u16 capability;
156  u8 tx_supp_rates;
157  } add_sta;
158  struct {
159  u32 inactive_sec;
160  } get_info_sta;
161  struct {
162  u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN];
163  u32 flags;
164  u32 err;
165  u8 idx;
166  u8 seq[8]; /* sequence counter (set: RX, get: TX) */
167  u16 key_len;
168  u8 key[0];
169  } crypt;
170  struct {
171  u32 flags_and;
172  u32 flags_or;
173  } set_flags_sta;
174  struct {
175  u16 rid;
176  u16 len;
177  u8 data[0];
178  } rid;
179  struct {
180  u8 len;
181  u8 data[0];
182  } generic_elem;
183  struct {
184 #define MLME_STA_DEAUTH 0
185 #define MLME_STA_DISASSOC 1
186  u16 cmd;
187  u16 reason_code;
188  } mlme;
189  struct {
190  u8 ssid_len;
191  u8 ssid[SSID_MAX_LEN];
192  } scan_req;
193  } u;
194 };
195 
196 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
197 #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
198 
199 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
200 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
201 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
202 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
203 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
204 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
205 
206 #endif /* HOSTAP_DRIVER_H */
Definition: driver_hostap.h:104
Definition: driver_hostap.h:108
Definition: driver_hostap.h:149