• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * WPA Supplicant - driver interaction with Linux Host AP driver
3  * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14 
15 #ifndef HOSTAP_DRIVER_H
16 #define HOSTAP_DRIVER_H
17 
18 #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
19 #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6)
20 #define PRISM2_IOCTL_HOSTAPD (SIOCDEVPRIVATE + 14)
21 
22 /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */
23 enum {
24 	/* PRISM2_PARAM_PTYPE = 1, */ /* REMOVED 2003-10-22 */
25 	PRISM2_PARAM_TXRATECTRL = 2,
26 	PRISM2_PARAM_BEACON_INT = 3,
27 	PRISM2_PARAM_PSEUDO_IBSS = 4,
28 	PRISM2_PARAM_ALC = 5,
29 	/* PRISM2_PARAM_TXPOWER = 6, */ /* REMOVED 2003-10-22 */
30 	PRISM2_PARAM_DUMP = 7,
31 	PRISM2_PARAM_OTHER_AP_POLICY = 8,
32 	PRISM2_PARAM_AP_MAX_INACTIVITY = 9,
33 	PRISM2_PARAM_AP_BRIDGE_PACKETS = 10,
34 	PRISM2_PARAM_DTIM_PERIOD = 11,
35 	PRISM2_PARAM_AP_NULLFUNC_ACK = 12,
36 	PRISM2_PARAM_MAX_WDS = 13,
37 	PRISM2_PARAM_AP_AUTOM_AP_WDS = 14,
38 	PRISM2_PARAM_AP_AUTH_ALGS = 15,
39 	PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16,
40 	PRISM2_PARAM_HOST_ENCRYPT = 17,
41 	PRISM2_PARAM_HOST_DECRYPT = 18,
42 	PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19,
43 	PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20,
44 	PRISM2_PARAM_HOST_ROAMING = 21,
45 	PRISM2_PARAM_BCRX_STA_KEY = 22,
46 	PRISM2_PARAM_IEEE_802_1X = 23,
47 	PRISM2_PARAM_ANTSEL_TX = 24,
48 	PRISM2_PARAM_ANTSEL_RX = 25,
49 	PRISM2_PARAM_MONITOR_TYPE = 26,
50 	PRISM2_PARAM_WDS_TYPE = 27,
51 	PRISM2_PARAM_HOSTSCAN = 28,
52 	PRISM2_PARAM_AP_SCAN = 29,
53 	PRISM2_PARAM_ENH_SEC = 30,
54 	PRISM2_PARAM_IO_DEBUG = 31,
55 	PRISM2_PARAM_BASIC_RATES = 32,
56 	PRISM2_PARAM_OPER_RATES = 33,
57 	PRISM2_PARAM_HOSTAPD = 34,
58 	PRISM2_PARAM_HOSTAPD_STA = 35,
59 	PRISM2_PARAM_WPA = 36,
60 	PRISM2_PARAM_PRIVACY_INVOKED = 37,
61 	PRISM2_PARAM_TKIP_COUNTERMEASURES = 38,
62 	PRISM2_PARAM_DROP_UNENCRYPTED = 39,
63 	PRISM2_PARAM_SCAN_CHANNEL_MASK = 40,
64 };
65 
66 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
67 enum {
68 	PRISM2_HOSTAPD_FLUSH = 1,
69 	PRISM2_HOSTAPD_ADD_STA = 2,
70 	PRISM2_HOSTAPD_REMOVE_STA = 3,
71 	PRISM2_HOSTAPD_GET_INFO_STA = 4,
72 	/* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
73 	PRISM2_SET_ENCRYPTION = 6,
74 	PRISM2_GET_ENCRYPTION = 7,
75 	PRISM2_HOSTAPD_SET_FLAGS_STA = 8,
76 	PRISM2_HOSTAPD_GET_RID = 9,
77 	PRISM2_HOSTAPD_SET_RID = 10,
78 	PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR = 11,
79 	PRISM2_HOSTAPD_SET_GENERIC_ELEMENT = 12,
80 	PRISM2_HOSTAPD_MLME = 13,
81 	PRISM2_HOSTAPD_SCAN_REQ = 14,
82 	PRISM2_HOSTAPD_STA_CLEAR_STATS = 15,
83 };
84 
85 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
86 #define PRISM2_HOSTAPD_RID_HDR_LEN \
87 ((size_t) (&((struct prism2_hostapd_param *) 0)->u.rid.data))
88 #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
89 ((size_t) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data))
90 
91 /* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
92  */
93 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
94 
95 
96 struct prism2_hostapd_param {
97 	u32 cmd;
98 	u8 sta_addr[ETH_ALEN];
99 	union {
100 		struct {
101 			u16 aid;
102 			u16 capability;
103 			u8 tx_supp_rates;
104 		} add_sta;
105 		struct {
106 			u32 inactive_sec;
107 		} get_info_sta;
108 		struct {
109 			u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN];
110 			u32 flags;
111 			u32 err;
112 			u8 idx;
113 			u8 seq[8]; /* sequence counter (set: RX, get: TX) */
114 			u16 key_len;
115 			u8 key[0];
116 		} crypt;
117 		struct {
118 			u32 flags_and;
119 			u32 flags_or;
120 		} set_flags_sta;
121 		struct {
122 			u16 rid;
123 			u16 len;
124 			u8 data[0];
125 		} rid;
126 		struct {
127 			u8 len;
128 			u8 data[0];
129 		} generic_elem;
130 		struct {
131 #define MLME_STA_DEAUTH 0
132 #define MLME_STA_DISASSOC 1
133 			u16 cmd;
134 			u16 reason_code;
135 		} mlme;
136 		struct {
137 			u8 ssid_len;
138 			u8 ssid[32];
139 		} scan_req;
140 	} u;
141 };
142 
143 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY 0x01
144 #define HOSTAP_CRYPT_FLAG_PERMANENT 0x02
145 
146 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
147 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
148 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
149 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
150 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
151 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
152 
153 #endif /* HOSTAP_DRIVER_H */
154