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 <linux/types.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, /* no longer used */
62 PRISM2_PARAM_RATE_LIMIT_BURST
= 1005, /* no longer used */
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_RADIO_ENABLED
= 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 PRISM2_PARAM_USER_SPACE_MLME
= 1045,
95 PRISM2_PARAM_MGMT_IF
= 1046,
96 /* NOTE: Please try to coordinate with other active development
97 * branches before allocating new param numbers so that each new param
98 * will be unique within all branches and the allocated number will not
99 * need to be changed when merging new features. Existing numbers in
100 * the mainline (or main devel branch) must not be changed when merging
101 * in new features. */
104 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
106 PRISM2_HOSTAPD_FLUSH
= 1,
107 PRISM2_HOSTAPD_ADD_STA
= 2,
108 PRISM2_HOSTAPD_REMOVE_STA
= 3,
109 PRISM2_HOSTAPD_GET_INFO_STA
= 4,
110 /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
111 PRISM2_SET_ENCRYPTION
= 6,
112 PRISM2_GET_ENCRYPTION
= 7,
113 PRISM2_HOSTAPD_SET_FLAGS_STA
= 8,
114 PRISM2_HOSTAPD_GET_RID
= 9,
115 PRISM2_HOSTAPD_SET_RID
= 10,
116 PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR
= 11,
117 PRISM2_HOSTAPD_MLME
= 13,
119 /* Instant802 additions */
120 PRISM2_HOSTAPD_SET_BEACON
= 1001,
121 PRISM2_HOSTAPD_GET_HW_FEATURES
= 1002,
122 PRISM2_HOSTAPD_SCAN
= 1003,
123 PRISM2_HOSTAPD_WPA_TRIGGER
= 1004,
124 PRISM2_HOSTAPD_SET_RATE_SETS
= 1005,
125 PRISM2_HOSTAPD_ADD_IF
= 1006,
126 PRISM2_HOSTAPD_REMOVE_IF
= 1007,
127 PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE
= 1008,
128 PRISM2_HOSTAPD_GET_LOAD_STATS
= 1009,
129 PRISM2_HOSTAPD_SET_STA_VLAN
= 1010,
130 PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM
= 1011,
131 PRISM2_HOSTAPD_SET_CHANNEL_FLAG
= 1012,
132 PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN
= 1013,
133 PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS
= 1014,
134 PRISM2_HOSTAPD_GET_TX_STATS
= 1016,
135 PRISM2_HOSTAPD_UPDATE_IF
= 1017,
136 PRISM2_HOSTAPD_SCAN_REQ
= 1019,
137 PRISM2_STA_GET_STATE
= 1020,
138 PRISM2_HOSTAPD_FLUSH_IFS
= 1021,
139 PRISM2_HOSTAPD_SET_RADAR_PARAMS
= 1023,
140 PRISM2_HOSTAPD_SET_QUIET_PARAMS
= 1024,
141 PRISM2_HOSTAPD_GET_TX_POWER
= 1025,
142 /* NOTE: Please try to coordinate with other active development
143 * branches before allocating new param numbers so that each new param
144 * will be unique within all branches and the allocated number will not
145 * need to be changed when merging new features. Existing numbers in
146 * the mainline (or main devel branch) must not be changed when merging
147 * in new features. */
150 /* these definitions mirror the ieee80211_i.h
151 * IEEE80211_DISABLED, ... IEEE80211_ASSOCIATED enumeration */
153 PRISM2_PARAM_STA_DISABLED
,
154 PRISM2_PARAM_STA_AUTHENTICATE
,
155 PRISM2_PARAM_STA_ASSOCIATE
,
156 PRISM2_PARAM_STA_ASSOCIATED
,
159 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
160 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
162 /* Use this to make sure that structure elements are correctly aligned
163 * for access as other types. Most commonly, this affects the placeholder
164 * types used for data at the end of a structure in this union.
168 #define ALIGNED __attribute__ ((aligned))
170 /* Check if it has been defined elsewhere */
172 #error "Must define ALIGNED to generate aligned structure elements"
176 struct prism2_hostapd_param
{
178 u8 sta_addr
[ETH_ALEN
];
186 #define IEEE80211_STA_DYNAMIC_ENC BIT(0)
196 u32 current_tx_rate
; /* in 100 kbps */
199 u32 num_ps_buf_frames
;
206 char alg
[HOSTAP_CRYPT_ALG_NAME_LEN
];
210 #define HOSTAP_SEQ_COUNTER_SIZE 8
211 u8 seq_counter
[HOSTAP_SEQ_COUNTER_SIZE
];
227 u8 data
[0] ALIGNED
; /* head_len + tail_len bytes */
232 u8 data
[0] ALIGNED
; /* num_modes * feature data */
239 s16 interval
; /* seconds */
240 s32 listen
; /* microseconds */
243 #define WPA_TRIGGER_FAIL_TX_MIC BIT(0)
244 #define WPA_TRIGGER_FAIL_TX_ICV BIT(1)
245 #define WPA_TRIGGER_FAIL_RX_MIC BIT(2)
246 #define WPA_TRIGGER_FAIL_RX_ICV BIT(3)
247 #define WPA_TRIGGER_TX_REPLAY BIT(4)
248 #define WPA_TRIGGER_TX_REPLAY_FRAG BIT(5)
249 #define WPA_TRIGGER_TX_SKIP_SEQ BIT(6)
253 u16 mode
; /* MODE_* */
254 u16 num_supported_rates
;
256 u8 data
[0] ALIGNED
; /* num_supported_rates * u16 +
257 * num_basic_rates * u16 */
260 u8 type
; /* WDS, VLAN, etc */
264 struct dot11_counters
{
265 u32 dot11TransmittedFragmentCount
;
266 u32 dot11MulticastTransmittedFrameCount
;
267 u32 dot11FailedCount
;
268 u32 dot11ReceivedFragmentCount
;
269 u32 dot11MulticastReceivedFrameCount
;
270 u32 dot11FCSErrorCount
;
271 u32 dot11TransmittedFrameCount
;
272 u32 dot11WEPUndecryptableCount
;
273 u32 dot11ACKFailureCount
;
274 u32 dot11RTSFailureCount
;
275 u32 dot11RTSSuccessCount
;
276 } dot11CountersTable
;
278 #define LOAD_STATS_CLEAR BIT(1)
283 char vlan_name
[IFNAMSIZ
];
289 } set_generic_info_elem
;
291 u16 mode
; /* MODE_* */
294 u8 power_level
; /* regulatory limit in dBm */
299 } set_regulatory_domain
;
305 u32 burst_time
; /* maximum burst time in 0.1 ms, i.e.,
310 u8 bssid_mask
[ETH_ALEN
];
312 struct ieee80211_tx_stats
{
314 unsigned int len
; /* num packets in queue */
315 unsigned int limit
; /* queue len (soft) limit
317 unsigned int count
; /* total num frames sent */
328 #define MLME_STA_DEAUTH 0
329 #define MLME_STA_DISASSOC 1
334 u8 radar_firpwr_threshold
;
335 u8 radar_rssi_threshold
;
336 u8 pulse_height_threshold
;
337 u8 pulse_rssi_threshold
;
338 u8 pulse_inband_threshold
;
343 unsigned int duration
;
346 unsigned int tx_power_min
;
347 unsigned int tx_power_max
;
350 u8 dummy
[80]; /* Make sizeof() this struct large enough
351 * with some compiler versions. */
357 #ifndef IEEE80211_TX_QUEUE_NUMS
358 #define IEEE80211_TX_QUEUE_NUMS
359 /* TODO: these need to be synchronized with ieee80211.h; make a shared header
360 * file that can be included into low-level drivers, 80211.o, and hostapd */
361 /* tx_queue_params - queue */
363 IEEE80211_TX_QUEUE_DATA0
= 0, /* used for EDCA AC_VO data */
364 IEEE80211_TX_QUEUE_DATA1
= 1, /* used for EDCA AC_VI data */
365 IEEE80211_TX_QUEUE_DATA2
= 2, /* used for EDCA AC_BE data */
366 IEEE80211_TX_QUEUE_DATA3
= 3, /* used for EDCA AC_BK data */
367 IEEE80211_TX_QUEUE_DATA4
= 4,
368 IEEE80211_TX_QUEUE_AFTER_BEACON
= 6,
369 IEEE80211_TX_QUEUE_BEACON
= 7
371 #endif /* IEEE80211_TX_QUEUE_NUMS */
374 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
375 #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
377 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
378 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
379 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
380 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
381 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
382 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
384 #define HOSTAP_HW_FLAG_NULLFUNC_OK BIT(0)
387 IEEE80211_KEY_MGMT_NONE
= 0,
388 IEEE80211_KEY_MGMT_IEEE8021X
= 1,
389 IEEE80211_KEY_MGMT_WPA_PSK
= 2,
390 IEEE80211_KEY_MGMT_WPA_EAP
= 3,
394 /* Data structures used for get_hw_features ioctl */
395 struct hostapd_ioctl_hw_modes_hdr
{
401 struct ieee80211_channel_data
{
402 short chan
; /* channel number (IEEE 802.11) */
403 short freq
; /* frequency in MHz */
404 int flag
; /* flag for hostapd use (IEEE80211_CHAN_*) */
407 struct ieee80211_rate_data
{
408 int rate
; /* rate in 100 kbps */
409 int flags
; /* IEEE80211_RATE_ flags */
413 /* ADD_IF, REMOVE_IF, and UPDATE_IF 'type' argument */
415 HOSTAP_IF_WDS
= 1, HOSTAP_IF_VLAN
= 2, HOSTAP_IF_BSS
= 3,
419 struct hostapd_if_wds
{
420 u8 remote_addr
[ETH_ALEN
];
423 struct hostapd_if_vlan
{
427 struct hostapd_if_bss
{
431 struct hostapd_if_sta
{
434 #endif /* HOSTAPD_IOCTL_H */