2 * Host AP (software wireless LAN access point) user space daemon for
3 * Host AP kernel driver
4 * Copyright 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
5 * Copyright 2002-2004, Instant802 Networks, Inc.
6 * Copyright 2005, Devicescape Software, Inc.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #ifndef HOSTAPD_IOCTL_H
14 #define HOSTAPD_IOCTL_H
17 #include "ieee80211_shared.h"
18 #endif /* __KERNEL__ */
20 #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
21 #define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
22 #define PRISM2_IOCTL_HOSTAPD (SIOCIWFIRSTPRIV + 3)
23 #define PRISM2_IOCTL_TEST_PARAM (SIOCIWFIRSTPRIV + 4)
25 /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */
27 PRISM2_PARAM_PTYPE = 1,
28 PRISM2_PARAM_TXRATECTRL = 2,
29 PRISM2_PARAM_BEACON_INT = 3,
30 PRISM2_PARAM_PSEUDO_IBSS = 4,
32 PRISM2_PARAM_TXPOWER = 6,
33 PRISM2_PARAM_DUMP = 7,
34 PRISM2_PARAM_OTHER_AP_POLICY = 8,
35 PRISM2_PARAM_AP_MAX_INACTIVITY = 9,
36 PRISM2_PARAM_AP_BRIDGE_PACKETS = 10,
37 PRISM2_PARAM_DTIM_PERIOD = 11,
38 PRISM2_PARAM_AP_NULLFUNC_ACK = 12,
39 PRISM2_PARAM_MAX_WDS = 13,
40 PRISM2_PARAM_AP_AUTOM_AP_WDS = 14,
41 PRISM2_PARAM_AP_AUTH_ALGS = 15,
42 PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16,
43 PRISM2_PARAM_HOST_ENCRYPT = 17,
44 PRISM2_PARAM_HOST_DECRYPT = 18,
45 PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19,
46 PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20,
47 PRISM2_PARAM_HOST_ROAMING = 21,
48 PRISM2_PARAM_BCRX_STA_KEY = 22,
49 PRISM2_PARAM_IEEE_802_1X = 23,
50 PRISM2_PARAM_ANTSEL_TX = 24,
51 PRISM2_PARAM_ANTSEL_RX = 25,
52 PRISM2_PARAM_MONITOR_TYPE = 26,
53 PRISM2_PARAM_WDS_TYPE = 27,
54 PRISM2_PARAM_HOSTSCAN = 28,
55 PRISM2_PARAM_AP_SCAN = 29,
57 /* Instant802 additions */
58 PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001,
59 PRISM2_PARAM_DROP_UNENCRYPTED = 1002,
60 PRISM2_PARAM_PREAMBLE = 1003,
61 PRISM2_PARAM_RATE_LIMIT = 1004,
62 PRISM2_PARAM_RATE_LIMIT_BURST = 1005,
63 PRISM2_PARAM_SHORT_SLOT_TIME = 1006,
64 PRISM2_PARAM_TEST_MODE = 1007,
65 PRISM2_PARAM_NEXT_MODE = 1008,
66 PRISM2_PARAM_CLEAR_KEYS = 1009,
67 PRISM2_PARAM_ADM_STATUS = 1010,
68 PRISM2_PARAM_ANTENNA_SEL = 1011,
69 PRISM2_PARAM_CALIB_INT = 1012,
70 PRISM2_PARAM_ANTENNA_MODE = 1013,
71 PRISM2_PARAM_PRIVACY_INVOKED = 1014,
72 PRISM2_PARAM_BROADCAST_SSID = 1015,
73 PRISM2_PARAM_STAT_TIME = 1016,
74 PRISM2_PARAM_STA_ANTENNA_SEL = 1017,
75 PRISM2_PARAM_FORCE_UNICAST_RATE = 1018,
76 PRISM2_PARAM_RATE_CTRL_NUM_UP = 1019,
77 PRISM2_PARAM_RATE_CTRL_NUM_DOWN = 1020,
78 PRISM2_PARAM_MAX_RATECTRL_RATE = 1021,
79 PRISM2_PARAM_TX_POWER_REDUCTION = 1022,
80 PRISM2_PARAM_EAPOL = 1023,
81 PRISM2_PARAM_KEY_TX_RX_THRESHOLD = 1024,
82 PRISM2_PARAM_KEY_INDEX = 1025,
83 PRISM2_PARAM_DEFAULT_WEP_ONLY = 1026,
84 PRISM2_PARAM_WIFI_WME_NOACK_TEST = 1033,
85 PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS = 1034,
86 PRISM2_PARAM_SCAN_FLAGS = 1035,
87 PRISM2_PARAM_HW_MODES = 1036,
88 PRISM2_PARAM_CREATE_IBSS = 1037,
89 PRISM2_PARAM_WMM_ENABLED = 1038,
90 PRISM2_PARAM_MIXED_CELL = 1039,
91 PRISM2_PARAM_KEY_MGMT = 1040,
92 PRISM2_PARAM_RADAR_DETECT = 1043,
93 PRISM2_PARAM_SPECTRUM_MGMT = 1044,
94 /* NOTE: Please try to coordinate with other active development
95 * branches before allocating new param numbers so that each new param
96 * will be unique within all branches and the allocated number will not
97 * need to be changed when merging new features. Existing numbers in
98 * the mainline (or main devel branch) must not be changed when merging
102 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
104 PRISM2_HOSTAPD_FLUSH = 1,
105 PRISM2_HOSTAPD_ADD_STA = 2,
106 PRISM2_HOSTAPD_REMOVE_STA = 3,
107 PRISM2_HOSTAPD_GET_INFO_STA = 4,
108 /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
109 PRISM2_SET_ENCRYPTION = 6,
110 PRISM2_GET_ENCRYPTION = 7,
111 PRISM2_HOSTAPD_SET_FLAGS_STA = 8,
112 PRISM2_HOSTAPD_GET_RID = 9,
113 PRISM2_HOSTAPD_SET_RID = 10,
114 PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR = 11,
115 PRISM2_HOSTAPD_MLME = 13,
117 /* Instant802 additions */
118 PRISM2_HOSTAPD_SET_BEACON = 1001,
119 PRISM2_HOSTAPD_GET_HW_FEATURES = 1002,
120 PRISM2_HOSTAPD_SCAN = 1003,
121 PRISM2_HOSTAPD_WPA_TRIGGER = 1004,
122 PRISM2_HOSTAPD_SET_RATE_SETS = 1005,
123 PRISM2_HOSTAPD_ADD_IF = 1006,
124 PRISM2_HOSTAPD_REMOVE_IF = 1007,
125 PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE = 1008,
126 PRISM2_HOSTAPD_GET_LOAD_STATS = 1009,
127 PRISM2_HOSTAPD_SET_STA_VLAN = 1010,
128 PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM = 1011,
129 PRISM2_HOSTAPD_SET_CHANNEL_FLAG = 1012,
130 PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN = 1013,
131 PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS = 1014,
132 PRISM2_HOSTAPD_SET_BSS = 1015,
133 PRISM2_HOSTAPD_GET_TX_STATS = 1016,
134 PRISM2_HOSTAPD_UPDATE_IF = 1017,
135 PRISM2_HOSTAPD_SCAN_REQ = 1019,
136 PRISM2_STA_GET_STATE = 1020,
137 PRISM2_HOSTAPD_FLUSH_IFS = 1021,
138 PRISM2_HOSTAPD_SET_RADAR_PARAMS = 1023,
139 PRISM2_HOSTAPD_SET_QUIET_PARAMS = 1024,
140 PRISM2_HOSTAPD_GET_TX_POWER = 1025,
141 /* NOTE: Please try to coordinate with other active development
142 * branches before allocating new param numbers so that each new param
143 * will be unique within all branches and the allocated number will not
144 * need to be changed when merging new features. Existing numbers in
145 * the mainline (or main devel branch) must not be changed when merging
146 * in new features. */
149 /* these definitions mirror the ieee80211_i.h
150 * IEEE80211_DISABLED, ... IEEE80211_ASSOCIATED enumeration */
152 PRISM2_PARAM_STA_DISABLED,
153 PRISM2_PARAM_STA_AUTHENTICATE,
154 PRISM2_PARAM_STA_ASSOCIATE,
155 PRISM2_PARAM_STA_ASSOCIATED,
158 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
159 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
161 /* Use this to make sure that structure elements are correctly aligned
162 * for access as other types. Most commonly, this affects the placeholder
163 * types used for data at the end of a structure in this union.
167 #define ALIGNED __attribute__ ((aligned))
169 /* Check if it has been defined elsewhere */
171 #error "Must define ALIGNED to generate aligned structure elements"
175 struct prism2_hostapd_param {
177 u8 sta_addr[ETH_ALEN];
184 /* atheros_super_ag and enc_flags are only used with
185 * IEEE80211_ATHEROS_SUPER_AG
190 #define IEEE80211_STA_DYNAMIC_ENC BIT(0)
199 u32 current_tx_rate; /* in 100 kbps */
202 u32 num_ps_buf_frames;
209 u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN];
213 #define HOSTAP_SEQ_COUNTER_SIZE 8
214 u8 seq_counter[HOSTAP_SEQ_COUNTER_SIZE];
230 u8 data[0] ALIGNED; /* head_len + tail_len bytes */
235 u8 data[0] ALIGNED; /* num_modes * feature data */
242 s16 interval; /* seconds */
243 s32 listen; /* microseconds */
246 #define WPA_TRIGGER_FAIL_TX_MIC BIT(0)
247 #define WPA_TRIGGER_FAIL_TX_ICV BIT(1)
248 #define WPA_TRIGGER_FAIL_RX_MIC BIT(2)
249 #define WPA_TRIGGER_FAIL_RX_ICV BIT(3)
250 #define WPA_TRIGGER_TX_REPLAY BIT(4)
251 #define WPA_TRIGGER_TX_REPLAY_FRAG BIT(5)
252 #define WPA_TRIGGER_TX_SKIP_SEQ BIT(6)
256 u16 mode; /* MODE_* */
257 u16 num_supported_rates;
259 u8 data[0] ALIGNED; /* num_supported_rates * u16 +
260 * num_basic_rates * u16 */
263 u8 type; /* WDS, VLAN, etc */
267 struct dot11_counters {
268 u32 dot11TransmittedFragmentCount;
269 u32 dot11MulticastTransmittedFrameCount;
270 u32 dot11FailedCount;
271 u32 dot11ReceivedFragmentCount;
272 u32 dot11MulticastReceivedFrameCount;
273 u32 dot11FCSErrorCount;
274 u32 dot11TransmittedFrameCount;
275 u32 dot11WEPUndecryptableCount;
276 u32 dot11ACKFailureCount;
277 u32 dot11RTSFailureCount;
278 u32 dot11RTSSuccessCount;
279 } dot11CountersTable;
281 #define LOAD_STATS_CLEAR BIT(1)
286 char vlan_name[IFNAMSIZ];
292 } set_generic_info_elem;
294 u16 mode; /* MODE_* */
297 u8 power_level; /* regulatory limit in dBm */
302 } set_regulatory_domain;
308 u32 burst_time; /* maximum burst time in 0.1 ms, i.e.,
313 u8 bssid_mask[ETH_ALEN];
315 struct ieee80211_tx_stats {
317 unsigned int len; /* num packets in queue */
318 unsigned int limit; /* queue len (soft) limit
320 unsigned int count; /* total num frames sent */
331 #define MLME_STA_DEAUTH 0
332 #define MLME_STA_DISASSOC 1
347 unsigned int duration;
350 unsigned int tx_power_min;
351 unsigned int tx_power_max;
354 u8 dummy[80]; /* Make sizeof() this struct large enough
355 * with some compiler versions. */
361 #ifndef IEEE80211_TX_QUEUE_NUMS
362 #define IEEE80211_TX_QUEUE_NUMS
363 /* TODO: these need to be synchronized with ieee80211.h; make a shared header
364 * file that can be included into low-level drivers, 80211.o, and hostapd */
365 /* tx_queue_params - queue */
367 IEEE80211_TX_QUEUE_DATA0 = 0, /* used for EDCA AC_VO data */
368 IEEE80211_TX_QUEUE_DATA1 = 1, /* used for EDCA AC_VI data */
369 IEEE80211_TX_QUEUE_DATA2 = 2, /* used for EDCA AC_BE data */
370 IEEE80211_TX_QUEUE_DATA3 = 3, /* used for EDCA AC_BK data */
371 IEEE80211_TX_QUEUE_DATA4 = 4,
372 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
373 IEEE80211_TX_QUEUE_BEACON = 7
375 #endif /* IEEE80211_TX_QUEUE_NUMS */
378 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
379 #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
381 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
382 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
383 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
384 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
385 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
386 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
388 #define HOSTAP_HW_FLAG_NULLFUNC_OK BIT(0)
391 IEEE80211_KEY_MGMT_NONE = 0,
392 IEEE80211_KEY_MGMT_IEEE8021X = 1,
393 IEEE80211_KEY_MGMT_WPA_PSK = 2,
394 IEEE80211_KEY_MGMT_WPA_EAP = 3,
398 /* Data structures used for get_hw_features ioctl */
399 struct hostapd_ioctl_hw_modes_hdr {
405 struct ieee80211_channel_data {
406 short chan; /* channel number (IEEE 802.11) */
407 short freq; /* frequency in MHz */
408 int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
411 struct ieee80211_rate_data {
412 int rate; /* rate in 100 kbps */
413 int flags; /* IEEE80211_RATE_ flags */
417 /* ADD_IF, REMOVE_IF, and UPDATE_IF 'type' argument */
419 HOSTAP_IF_WDS = 1, HOSTAP_IF_VLAN = 2, HOSTAP_IF_BSS = 3,
423 struct hostapd_if_wds {
424 u8 remote_addr[ETH_ALEN];
427 struct hostapd_if_vlan {
431 struct hostapd_if_bss {
435 struct hostapd_if_sta {
438 #endif /* HOSTAPD_IOCTL_H */