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)
24 /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes:
25 * This table is no longer added to, the whole sub-ioctl
26 * mess shall be deleted completely. */
28 PRISM2_PARAM_BEACON_INT
= 3,
29 PRISM2_PARAM_AP_BRIDGE_PACKETS
= 10,
30 PRISM2_PARAM_DTIM_PERIOD
= 11,
31 PRISM2_PARAM_AP_AUTH_ALGS
= 15,
32 PRISM2_PARAM_HOST_ENCRYPT
= 17,
33 PRISM2_PARAM_HOST_DECRYPT
= 18,
34 PRISM2_PARAM_IEEE_802_1X
= 23,
35 PRISM2_PARAM_ANTSEL_TX
= 24,
36 PRISM2_PARAM_ANTSEL_RX
= 25,
38 /* Instant802 additions */
39 PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES
= 1001,
40 PRISM2_PARAM_DROP_UNENCRYPTED
= 1002,
41 PRISM2_PARAM_PREAMBLE
= 1003,
42 PRISM2_PARAM_SHORT_SLOT_TIME
= 1006,
43 PRISM2_PARAM_NEXT_MODE
= 1008,
44 PRISM2_PARAM_CLEAR_KEYS
= 1009,
45 PRISM2_PARAM_RADIO_ENABLED
= 1010,
46 PRISM2_PARAM_ANTENNA_MODE
= 1013,
47 PRISM2_PARAM_PRIVACY_INVOKED
= 1014,
48 PRISM2_PARAM_BROADCAST_SSID
= 1015,
49 PRISM2_PARAM_STAT_TIME
= 1016,
50 PRISM2_PARAM_STA_ANTENNA_SEL
= 1017,
51 PRISM2_PARAM_FORCE_UNICAST_RATE
= 1018,
52 PRISM2_PARAM_RATE_CTRL_NUM_UP
= 1019,
53 PRISM2_PARAM_RATE_CTRL_NUM_DOWN
= 1020,
54 PRISM2_PARAM_MAX_RATECTRL_RATE
= 1021,
55 PRISM2_PARAM_TX_POWER_REDUCTION
= 1022,
56 PRISM2_PARAM_EAPOL
= 1023,
57 PRISM2_PARAM_KEY_TX_RX_THRESHOLD
= 1024,
58 PRISM2_PARAM_KEY_INDEX
= 1025,
59 PRISM2_PARAM_DEFAULT_WEP_ONLY
= 1026,
60 PRISM2_PARAM_WIFI_WME_NOACK_TEST
= 1033,
61 PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS
= 1034,
62 PRISM2_PARAM_SCAN_FLAGS
= 1035,
63 PRISM2_PARAM_HW_MODES
= 1036,
64 PRISM2_PARAM_CREATE_IBSS
= 1037,
65 PRISM2_PARAM_WMM_ENABLED
= 1038,
66 PRISM2_PARAM_MIXED_CELL
= 1039,
67 PRISM2_PARAM_KEY_MGMT
= 1040,
68 PRISM2_PARAM_RADAR_DETECT
= 1043,
69 PRISM2_PARAM_SPECTRUM_MGMT
= 1044,
70 PRISM2_PARAM_USER_SPACE_MLME
= 1045,
71 PRISM2_PARAM_MGMT_IF
= 1046,
74 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd:
75 * This table is no longer added to, the hostapd ioctl
76 * shall be deleted completely. */
78 PRISM2_HOSTAPD_FLUSH
= 1,
79 PRISM2_HOSTAPD_ADD_STA
= 2,
80 PRISM2_HOSTAPD_REMOVE_STA
= 3,
81 PRISM2_HOSTAPD_GET_INFO_STA
= 4,
82 PRISM2_SET_ENCRYPTION
= 6,
83 PRISM2_GET_ENCRYPTION
= 7,
84 PRISM2_HOSTAPD_SET_FLAGS_STA
= 8,
85 PRISM2_HOSTAPD_MLME
= 13,
87 /* Instant802 additions */
88 PRISM2_HOSTAPD_SET_BEACON
= 1001,
89 PRISM2_HOSTAPD_GET_HW_FEATURES
= 1002,
90 PRISM2_HOSTAPD_WPA_TRIGGER
= 1004,
91 PRISM2_HOSTAPD_SET_RATE_SETS
= 1005,
92 PRISM2_HOSTAPD_ADD_IF
= 1006,
93 PRISM2_HOSTAPD_REMOVE_IF
= 1007,
94 PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE
= 1008,
95 PRISM2_HOSTAPD_GET_LOAD_STATS
= 1009,
96 PRISM2_HOSTAPD_SET_STA_VLAN
= 1010,
97 PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM
= 1011,
98 PRISM2_HOSTAPD_SET_CHANNEL_FLAG
= 1012,
99 PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN
= 1013,
100 PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS
= 1014,
101 PRISM2_HOSTAPD_GET_TX_STATS
= 1016,
102 PRISM2_HOSTAPD_UPDATE_IF
= 1017,
103 PRISM2_HOSTAPD_SCAN_REQ
= 1019,
104 PRISM2_STA_GET_STATE
= 1020,
105 PRISM2_HOSTAPD_FLUSH_IFS
= 1021,
106 PRISM2_HOSTAPD_SET_RADAR_PARAMS
= 1023,
107 PRISM2_HOSTAPD_SET_QUIET_PARAMS
= 1024,
110 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
111 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
114 #define ALIGNED __attribute__ ((aligned))
117 struct prism2_hostapd_param
{
119 u8 sta_addr
[ETH_ALEN
];
127 #define IEEE80211_STA_DYNAMIC_ENC BIT(0)
137 u32 current_tx_rate
; /* in 100 kbps */
140 u32 num_ps_buf_frames
;
147 char alg
[HOSTAP_CRYPT_ALG_NAME_LEN
];
151 #define HOSTAP_SEQ_COUNTER_SIZE 8
152 u8 seq_counter
[HOSTAP_SEQ_COUNTER_SIZE
];
163 u8 data
[0] ALIGNED
; /* head_len + tail_len bytes */
168 u8 data
[0] ALIGNED
; /* num_modes * feature data */
175 s16 interval
; /* seconds */
176 s32 listen
; /* microseconds */
179 #define WPA_TRIGGER_FAIL_TX_MIC BIT(0)
180 #define WPA_TRIGGER_FAIL_TX_ICV BIT(1)
181 #define WPA_TRIGGER_FAIL_RX_MIC BIT(2)
182 #define WPA_TRIGGER_FAIL_RX_ICV BIT(3)
183 #define WPA_TRIGGER_TX_REPLAY BIT(4)
184 #define WPA_TRIGGER_TX_REPLAY_FRAG BIT(5)
185 #define WPA_TRIGGER_TX_SKIP_SEQ BIT(6)
189 u16 mode
; /* MODE_* */
190 u16 num_supported_rates
;
192 u8 data
[0] ALIGNED
; /* num_supported_rates * u16 +
193 * num_basic_rates * u16 */
196 u8 type
; /* WDS, VLAN, etc */
200 struct dot11_counters
{
201 u32 dot11TransmittedFragmentCount
;
202 u32 dot11MulticastTransmittedFrameCount
;
203 u32 dot11FailedCount
;
204 u32 dot11ReceivedFragmentCount
;
205 u32 dot11MulticastReceivedFrameCount
;
206 u32 dot11FCSErrorCount
;
207 u32 dot11TransmittedFrameCount
;
208 u32 dot11WEPUndecryptableCount
;
209 u32 dot11ACKFailureCount
;
210 u32 dot11RTSFailureCount
;
211 u32 dot11RTSSuccessCount
;
212 } dot11CountersTable
;
214 #define LOAD_STATS_CLEAR BIT(1)
219 char vlan_name
[IFNAMSIZ
];
225 } set_generic_info_elem
;
227 u16 mode
; /* MODE_* */
230 u8 power_level
; /* regulatory limit in dBm */
235 } set_regulatory_domain
;
241 u32 burst_time
; /* maximum burst time in 0.1 ms, i.e.,
244 struct ieee80211_tx_stats
{
246 unsigned int len
; /* num packets in queue */
247 unsigned int limit
; /* queue len (soft) limit
249 unsigned int count
; /* total num frames sent */
260 #define MLME_STA_DEAUTH 0
261 #define MLME_STA_DISASSOC 1
266 u8 radar_firpwr_threshold
;
267 u8 radar_rssi_threshold
;
268 u8 pulse_height_threshold
;
269 u8 pulse_rssi_threshold
;
270 u8 pulse_inband_threshold
;
275 unsigned int duration
;
278 u8 dummy
[80]; /* Make sizeof() this struct large enough
279 * with some compiler versions. */
284 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
285 #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
287 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
288 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
289 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
290 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
291 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
292 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
294 #define HOSTAP_HW_FLAG_NULLFUNC_OK BIT(0)
297 IEEE80211_KEY_MGMT_NONE
= 0,
298 IEEE80211_KEY_MGMT_IEEE8021X
= 1,
299 IEEE80211_KEY_MGMT_WPA_PSK
= 2,
300 IEEE80211_KEY_MGMT_WPA_EAP
= 3,
304 /* Data structures used for get_hw_features ioctl */
305 struct hostapd_ioctl_hw_modes_hdr
{
311 struct ieee80211_channel_data
{
312 short chan
; /* channel number (IEEE 802.11) */
313 short freq
; /* frequency in MHz */
314 int flag
; /* flag for hostapd use (IEEE80211_CHAN_*) */
317 struct ieee80211_rate_data
{
318 int rate
; /* rate in 100 kbps */
319 int flags
; /* IEEE80211_RATE_ flags */
323 /* ADD_IF, REMOVE_IF, and UPDATE_IF 'type' argument */
325 HOSTAP_IF_WDS
= 1, HOSTAP_IF_VLAN
= 2, HOSTAP_IF_BSS
= 3,
329 struct hostapd_if_wds
{
330 u8 remote_addr
[ETH_ALEN
];
333 struct hostapd_if_vlan
{
337 struct hostapd_if_bss
{
341 struct hostapd_if_sta
{
344 #endif /* HOSTAPD_IOCTL_H */