diff options
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_common.h')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_common.h | 435 |
1 files changed, 435 insertions, 0 deletions
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h new file mode 100644 index 000000000000..6f4fa9dc308f --- /dev/null +++ b/drivers/net/wireless/hostap/hostap_common.h | |||
@@ -0,0 +1,435 @@ | |||
1 | #ifndef HOSTAP_COMMON_H | ||
2 | #define HOSTAP_COMMON_H | ||
3 | |||
4 | #define BIT(x) (1 << (x)) | ||
5 | |||
6 | #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] | ||
7 | #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" | ||
8 | |||
9 | |||
10 | /* IEEE 802.11 defines */ | ||
11 | |||
12 | /* Information Element IDs */ | ||
13 | #define WLAN_EID_SSID 0 | ||
14 | #define WLAN_EID_SUPP_RATES 1 | ||
15 | #define WLAN_EID_FH_PARAMS 2 | ||
16 | #define WLAN_EID_DS_PARAMS 3 | ||
17 | #define WLAN_EID_CF_PARAMS 4 | ||
18 | #define WLAN_EID_TIM 5 | ||
19 | #define WLAN_EID_IBSS_PARAMS 6 | ||
20 | #define WLAN_EID_CHALLENGE 16 | ||
21 | #define WLAN_EID_RSN 48 | ||
22 | #define WLAN_EID_GENERIC 221 | ||
23 | |||
24 | |||
25 | /* HFA384X Configuration RIDs */ | ||
26 | #define HFA384X_RID_CNFPORTTYPE 0xFC00 | ||
27 | #define HFA384X_RID_CNFOWNMACADDR 0xFC01 | ||
28 | #define HFA384X_RID_CNFDESIREDSSID 0xFC02 | ||
29 | #define HFA384X_RID_CNFOWNCHANNEL 0xFC03 | ||
30 | #define HFA384X_RID_CNFOWNSSID 0xFC04 | ||
31 | #define HFA384X_RID_CNFOWNATIMWINDOW 0xFC05 | ||
32 | #define HFA384X_RID_CNFSYSTEMSCALE 0xFC06 | ||
33 | #define HFA384X_RID_CNFMAXDATALEN 0xFC07 | ||
34 | #define HFA384X_RID_CNFWDSADDRESS 0xFC08 | ||
35 | #define HFA384X_RID_CNFPMENABLED 0xFC09 | ||
36 | #define HFA384X_RID_CNFPMEPS 0xFC0A | ||
37 | #define HFA384X_RID_CNFMULTICASTRECEIVE 0xFC0B | ||
38 | #define HFA384X_RID_CNFMAXSLEEPDURATION 0xFC0C | ||
39 | #define HFA384X_RID_CNFPMHOLDOVERDURATION 0xFC0D | ||
40 | #define HFA384X_RID_CNFOWNNAME 0xFC0E | ||
41 | #define HFA384X_RID_CNFOWNDTIMPERIOD 0xFC10 | ||
42 | #define HFA384X_RID_CNFWDSADDRESS1 0xFC11 /* AP f/w only */ | ||
43 | #define HFA384X_RID_CNFWDSADDRESS2 0xFC12 /* AP f/w only */ | ||
44 | #define HFA384X_RID_CNFWDSADDRESS3 0xFC13 /* AP f/w only */ | ||
45 | #define HFA384X_RID_CNFWDSADDRESS4 0xFC14 /* AP f/w only */ | ||
46 | #define HFA384X_RID_CNFWDSADDRESS5 0xFC15 /* AP f/w only */ | ||
47 | #define HFA384X_RID_CNFWDSADDRESS6 0xFC16 /* AP f/w only */ | ||
48 | #define HFA384X_RID_CNFMULTICASTPMBUFFERING 0xFC17 /* AP f/w only */ | ||
49 | #define HFA384X_RID_UNKNOWN1 0xFC20 | ||
50 | #define HFA384X_RID_UNKNOWN2 0xFC21 | ||
51 | #define HFA384X_RID_CNFWEPDEFAULTKEYID 0xFC23 | ||
52 | #define HFA384X_RID_CNFDEFAULTKEY0 0xFC24 | ||
53 | #define HFA384X_RID_CNFDEFAULTKEY1 0xFC25 | ||
54 | #define HFA384X_RID_CNFDEFAULTKEY2 0xFC26 | ||
55 | #define HFA384X_RID_CNFDEFAULTKEY3 0xFC27 | ||
56 | #define HFA384X_RID_CNFWEPFLAGS 0xFC28 | ||
57 | #define HFA384X_RID_CNFWEPKEYMAPPINGTABLE 0xFC29 | ||
58 | #define HFA384X_RID_CNFAUTHENTICATION 0xFC2A | ||
59 | #define HFA384X_RID_CNFMAXASSOCSTA 0xFC2B /* AP f/w only */ | ||
60 | #define HFA384X_RID_CNFTXCONTROL 0xFC2C | ||
61 | #define HFA384X_RID_CNFROAMINGMODE 0xFC2D | ||
62 | #define HFA384X_RID_CNFHOSTAUTHENTICATION 0xFC2E /* AP f/w only */ | ||
63 | #define HFA384X_RID_CNFRCVCRCERROR 0xFC30 | ||
64 | #define HFA384X_RID_CNFMMLIFE 0xFC31 | ||
65 | #define HFA384X_RID_CNFALTRETRYCOUNT 0xFC32 | ||
66 | #define HFA384X_RID_CNFBEACONINT 0xFC33 | ||
67 | #define HFA384X_RID_CNFAPPCFINFO 0xFC34 /* AP f/w only */ | ||
68 | #define HFA384X_RID_CNFSTAPCFINFO 0xFC35 | ||
69 | #define HFA384X_RID_CNFPRIORITYQUSAGE 0xFC37 | ||
70 | #define HFA384X_RID_CNFTIMCTRL 0xFC40 | ||
71 | #define HFA384X_RID_UNKNOWN3 0xFC41 /* added in STA f/w 0.7.x */ | ||
72 | #define HFA384X_RID_CNFTHIRTY2TALLY 0xFC42 /* added in STA f/w 0.8.0 */ | ||
73 | #define HFA384X_RID_CNFENHSECURITY 0xFC43 /* AP f/w or STA f/w >= 1.6.3 */ | ||
74 | #define HFA384X_RID_CNFDBMADJUST 0xFC46 /* added in STA f/w 1.3.1 */ | ||
75 | #define HFA384X_RID_GENERICELEMENT 0xFC48 /* added in STA f/w 1.7.0; | ||
76 | * write only */ | ||
77 | #define HFA384X_RID_PROPAGATIONDELAY 0xFC49 /* added in STA f/w 1.7.6 */ | ||
78 | #define HFA384X_RID_GROUPADDRESSES 0xFC80 | ||
79 | #define HFA384X_RID_CREATEIBSS 0xFC81 | ||
80 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD 0xFC82 | ||
81 | #define HFA384X_RID_RTSTHRESHOLD 0xFC83 | ||
82 | #define HFA384X_RID_TXRATECONTROL 0xFC84 | ||
83 | #define HFA384X_RID_PROMISCUOUSMODE 0xFC85 | ||
84 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD0 0xFC90 /* AP f/w only */ | ||
85 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD1 0xFC91 /* AP f/w only */ | ||
86 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD2 0xFC92 /* AP f/w only */ | ||
87 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD3 0xFC93 /* AP f/w only */ | ||
88 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD4 0xFC94 /* AP f/w only */ | ||
89 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD5 0xFC95 /* AP f/w only */ | ||
90 | #define HFA384X_RID_FRAGMENTATIONTHRESHOLD6 0xFC96 /* AP f/w only */ | ||
91 | #define HFA384X_RID_RTSTHRESHOLD0 0xFC97 /* AP f/w only */ | ||
92 | #define HFA384X_RID_RTSTHRESHOLD1 0xFC98 /* AP f/w only */ | ||
93 | #define HFA384X_RID_RTSTHRESHOLD2 0xFC99 /* AP f/w only */ | ||
94 | #define HFA384X_RID_RTSTHRESHOLD3 0xFC9A /* AP f/w only */ | ||
95 | #define HFA384X_RID_RTSTHRESHOLD4 0xFC9B /* AP f/w only */ | ||
96 | #define HFA384X_RID_RTSTHRESHOLD5 0xFC9C /* AP f/w only */ | ||
97 | #define HFA384X_RID_RTSTHRESHOLD6 0xFC9D /* AP f/w only */ | ||
98 | #define HFA384X_RID_TXRATECONTROL0 0xFC9E /* AP f/w only */ | ||
99 | #define HFA384X_RID_TXRATECONTROL1 0xFC9F /* AP f/w only */ | ||
100 | #define HFA384X_RID_TXRATECONTROL2 0xFCA0 /* AP f/w only */ | ||
101 | #define HFA384X_RID_TXRATECONTROL3 0xFCA1 /* AP f/w only */ | ||
102 | #define HFA384X_RID_TXRATECONTROL4 0xFCA2 /* AP f/w only */ | ||
103 | #define HFA384X_RID_TXRATECONTROL5 0xFCA3 /* AP f/w only */ | ||
104 | #define HFA384X_RID_TXRATECONTROL6 0xFCA4 /* AP f/w only */ | ||
105 | #define HFA384X_RID_CNFSHORTPREAMBLE 0xFCB0 | ||
106 | #define HFA384X_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1 | ||
107 | #define HFA384X_RID_CNFAUTHENTICATIONRSPTO 0xFCB2 | ||
108 | #define HFA384X_RID_CNFBASICRATES 0xFCB3 | ||
109 | #define HFA384X_RID_CNFSUPPORTEDRATES 0xFCB4 | ||
110 | #define HFA384X_RID_CNFFALLBACKCTRL 0xFCB5 /* added in STA f/w 1.3.1 */ | ||
111 | #define HFA384X_RID_WEPKEYDISABLE 0xFCB6 /* added in STA f/w 1.3.1 */ | ||
112 | #define HFA384X_RID_WEPKEYMAPINDEX 0xFCB7 /* ? */ | ||
113 | #define HFA384X_RID_BROADCASTKEYID 0xFCB8 /* ? */ | ||
114 | #define HFA384X_RID_ENTSECFLAGEYID 0xFCB9 /* ? */ | ||
115 | #define HFA384X_RID_CNFPASSIVESCANCTRL 0xFCBA /* added in STA f/w 1.5.0 */ | ||
116 | #define HFA384X_RID_SSNHANDLINGMODE 0xFCBB /* added in STA f/w 1.7.0 */ | ||
117 | #define HFA384X_RID_MDCCONTROL 0xFCBC /* added in STA f/w 1.7.0 */ | ||
118 | #define HFA384X_RID_MDCCOUNTRY 0xFCBD /* added in STA f/w 1.7.0 */ | ||
119 | #define HFA384X_RID_TXPOWERMAX 0xFCBE /* added in STA f/w 1.7.0 */ | ||
120 | #define HFA384X_RID_CNFLFOENABLED 0xFCBF /* added in STA f/w 1.6.3 */ | ||
121 | #define HFA384X_RID_CAPINFO 0xFCC0 /* added in STA f/w 1.7.0 */ | ||
122 | #define HFA384X_RID_LISTENINTERVAL 0xFCC1 /* added in STA f/w 1.7.0 */ | ||
123 | #define HFA384X_RID_SW_ANT_DIV 0xFCC2 /* added in STA f/w 1.7.0; Prism3 */ | ||
124 | #define HFA384X_RID_LED_CTRL 0xFCC4 /* added in STA f/w 1.7.6 */ | ||
125 | #define HFA384X_RID_HFODELAY 0xFCC5 /* added in STA f/w 1.7.6 */ | ||
126 | #define HFA384X_RID_DISALLOWEDBSSID 0xFCC6 /* added in STA f/w 1.8.0 */ | ||
127 | #define HFA384X_RID_TICKTIME 0xFCE0 | ||
128 | #define HFA384X_RID_SCANREQUEST 0xFCE1 | ||
129 | #define HFA384X_RID_JOINREQUEST 0xFCE2 | ||
130 | #define HFA384X_RID_AUTHENTICATESTATION 0xFCE3 /* AP f/w only */ | ||
131 | #define HFA384X_RID_CHANNELINFOREQUEST 0xFCE4 /* AP f/w only */ | ||
132 | #define HFA384X_RID_HOSTSCAN 0xFCE5 /* added in STA f/w 1.3.1 */ | ||
133 | |||
134 | /* HFA384X Information RIDs */ | ||
135 | #define HFA384X_RID_MAXLOADTIME 0xFD00 | ||
136 | #define HFA384X_RID_DOWNLOADBUFFER 0xFD01 | ||
137 | #define HFA384X_RID_PRIID 0xFD02 | ||
138 | #define HFA384X_RID_PRISUPRANGE 0xFD03 | ||
139 | #define HFA384X_RID_CFIACTRANGES 0xFD04 | ||
140 | #define HFA384X_RID_NICSERNUM 0xFD0A | ||
141 | #define HFA384X_RID_NICID 0xFD0B | ||
142 | #define HFA384X_RID_MFISUPRANGE 0xFD0C | ||
143 | #define HFA384X_RID_CFISUPRANGE 0xFD0D | ||
144 | #define HFA384X_RID_CHANNELLIST 0xFD10 | ||
145 | #define HFA384X_RID_REGULATORYDOMAINS 0xFD11 | ||
146 | #define HFA384X_RID_TEMPTYPE 0xFD12 | ||
147 | #define HFA384X_RID_CIS 0xFD13 | ||
148 | #define HFA384X_RID_STAID 0xFD20 | ||
149 | #define HFA384X_RID_STASUPRANGE 0xFD21 | ||
150 | #define HFA384X_RID_MFIACTRANGES 0xFD22 | ||
151 | #define HFA384X_RID_CFIACTRANGES2 0xFD23 | ||
152 | #define HFA384X_RID_PRODUCTNAME 0xFD24 /* added in STA f/w 1.3.1; | ||
153 | * only Prism2.5(?) */ | ||
154 | #define HFA384X_RID_PORTSTATUS 0xFD40 | ||
155 | #define HFA384X_RID_CURRENTSSID 0xFD41 | ||
156 | #define HFA384X_RID_CURRENTBSSID 0xFD42 | ||
157 | #define HFA384X_RID_COMMSQUALITY 0xFD43 | ||
158 | #define HFA384X_RID_CURRENTTXRATE 0xFD44 | ||
159 | #define HFA384X_RID_CURRENTBEACONINTERVAL 0xFD45 | ||
160 | #define HFA384X_RID_CURRENTSCALETHRESHOLDS 0xFD46 | ||
161 | #define HFA384X_RID_PROTOCOLRSPTIME 0xFD47 | ||
162 | #define HFA384X_RID_SHORTRETRYLIMIT 0xFD48 | ||
163 | #define HFA384X_RID_LONGRETRYLIMIT 0xFD49 | ||
164 | #define HFA384X_RID_MAXTRANSMITLIFETIME 0xFD4A | ||
165 | #define HFA384X_RID_MAXRECEIVELIFETIME 0xFD4B | ||
166 | #define HFA384X_RID_CFPOLLABLE 0xFD4C | ||
167 | #define HFA384X_RID_AUTHENTICATIONALGORITHMS 0xFD4D | ||
168 | #define HFA384X_RID_PRIVACYOPTIONIMPLEMENTED 0xFD4F | ||
169 | #define HFA384X_RID_DBMCOMMSQUALITY 0xFD51 /* added in STA f/w 1.3.1 */ | ||
170 | #define HFA384X_RID_CURRENTTXRATE1 0xFD80 /* AP f/w only */ | ||
171 | #define HFA384X_RID_CURRENTTXRATE2 0xFD81 /* AP f/w only */ | ||
172 | #define HFA384X_RID_CURRENTTXRATE3 0xFD82 /* AP f/w only */ | ||
173 | #define HFA384X_RID_CURRENTTXRATE4 0xFD83 /* AP f/w only */ | ||
174 | #define HFA384X_RID_CURRENTTXRATE5 0xFD84 /* AP f/w only */ | ||
175 | #define HFA384X_RID_CURRENTTXRATE6 0xFD85 /* AP f/w only */ | ||
176 | #define HFA384X_RID_OWNMACADDR 0xFD86 /* AP f/w only */ | ||
177 | #define HFA384X_RID_SCANRESULTSTABLE 0xFD88 /* added in STA f/w 0.8.3 */ | ||
178 | #define HFA384X_RID_HOSTSCANRESULTS 0xFD89 /* added in STA f/w 1.3.1 */ | ||
179 | #define HFA384X_RID_AUTHENTICATIONUSED 0xFD8A /* added in STA f/w 1.3.4 */ | ||
180 | #define HFA384X_RID_CNFFAASWITCHCTRL 0xFD8B /* added in STA f/w 1.6.3 */ | ||
181 | #define HFA384X_RID_ASSOCIATIONFAILURE 0xFD8D /* added in STA f/w 1.8.0 */ | ||
182 | #define HFA384X_RID_PHYTYPE 0xFDC0 | ||
183 | #define HFA384X_RID_CURRENTCHANNEL 0xFDC1 | ||
184 | #define HFA384X_RID_CURRENTPOWERSTATE 0xFDC2 | ||
185 | #define HFA384X_RID_CCAMODE 0xFDC3 | ||
186 | #define HFA384X_RID_SUPPORTEDDATARATES 0xFDC6 | ||
187 | #define HFA384X_RID_LFO_VOLT_REG_TEST_RES 0xFDC7 /* added in STA f/w 1.7.1 */ | ||
188 | #define HFA384X_RID_BUILDSEQ 0xFFFE | ||
189 | #define HFA384X_RID_FWID 0xFFFF | ||
190 | |||
191 | |||
192 | struct hfa384x_comp_ident | ||
193 | { | ||
194 | u16 id; | ||
195 | u16 variant; | ||
196 | u16 major; | ||
197 | u16 minor; | ||
198 | } __attribute__ ((packed)); | ||
199 | |||
200 | #define HFA384X_COMP_ID_PRI 0x15 | ||
201 | #define HFA384X_COMP_ID_STA 0x1f | ||
202 | #define HFA384X_COMP_ID_FW_AP 0x14b | ||
203 | |||
204 | struct hfa384x_sup_range | ||
205 | { | ||
206 | u16 role; | ||
207 | u16 id; | ||
208 | u16 variant; | ||
209 | u16 bottom; | ||
210 | u16 top; | ||
211 | } __attribute__ ((packed)); | ||
212 | |||
213 | |||
214 | struct hfa384x_build_id | ||
215 | { | ||
216 | u16 pri_seq; | ||
217 | u16 sec_seq; | ||
218 | } __attribute__ ((packed)); | ||
219 | |||
220 | /* FD01 - Download Buffer */ | ||
221 | struct hfa384x_rid_download_buffer | ||
222 | { | ||
223 | u16 page; | ||
224 | u16 offset; | ||
225 | u16 length; | ||
226 | } __attribute__ ((packed)); | ||
227 | |||
228 | /* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */ | ||
229 | struct hfa384x_comms_quality { | ||
230 | u16 comm_qual; /* 0 .. 92 */ | ||
231 | u16 signal_level; /* 27 .. 154 */ | ||
232 | u16 noise_level; /* 27 .. 154 */ | ||
233 | } __attribute__ ((packed)); | ||
234 | |||
235 | |||
236 | /* netdevice private ioctls (used, e.g., with iwpriv from user space) */ | ||
237 | |||
238 | /* New wireless extensions API - SET/GET convention (even ioctl numbers are | ||
239 | * root only) | ||
240 | */ | ||
241 | #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0) | ||
242 | #define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1) | ||
243 | #define PRISM2_IOCTL_WRITEMIF (SIOCIWFIRSTPRIV + 2) | ||
244 | #define PRISM2_IOCTL_READMIF (SIOCIWFIRSTPRIV + 3) | ||
245 | #define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4) | ||
246 | #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6) | ||
247 | #define PRISM2_IOCTL_INQUIRE (SIOCIWFIRSTPRIV + 8) | ||
248 | #define PRISM2_IOCTL_WDS_ADD (SIOCIWFIRSTPRIV + 10) | ||
249 | #define PRISM2_IOCTL_WDS_DEL (SIOCIWFIRSTPRIV + 12) | ||
250 | #define PRISM2_IOCTL_SET_RID_WORD (SIOCIWFIRSTPRIV + 14) | ||
251 | #define PRISM2_IOCTL_MACCMD (SIOCIWFIRSTPRIV + 16) | ||
252 | #define PRISM2_IOCTL_ADDMAC (SIOCIWFIRSTPRIV + 18) | ||
253 | #define PRISM2_IOCTL_DELMAC (SIOCIWFIRSTPRIV + 20) | ||
254 | #define PRISM2_IOCTL_KICKMAC (SIOCIWFIRSTPRIV + 22) | ||
255 | |||
256 | /* following are not in SIOCGIWPRIV list; check permission in the driver code | ||
257 | */ | ||
258 | #define PRISM2_IOCTL_DOWNLOAD (SIOCDEVPRIVATE + 13) | ||
259 | #define PRISM2_IOCTL_HOSTAPD (SIOCDEVPRIVATE + 14) | ||
260 | |||
261 | |||
262 | /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */ | ||
263 | enum { | ||
264 | /* PRISM2_PARAM_PTYPE = 1, */ /* REMOVED 2003-10-22 */ | ||
265 | PRISM2_PARAM_TXRATECTRL = 2, | ||
266 | PRISM2_PARAM_BEACON_INT = 3, | ||
267 | PRISM2_PARAM_PSEUDO_IBSS = 4, | ||
268 | PRISM2_PARAM_ALC = 5, | ||
269 | /* PRISM2_PARAM_TXPOWER = 6, */ /* REMOVED 2003-10-22 */ | ||
270 | PRISM2_PARAM_DUMP = 7, | ||
271 | PRISM2_PARAM_OTHER_AP_POLICY = 8, | ||
272 | PRISM2_PARAM_AP_MAX_INACTIVITY = 9, | ||
273 | PRISM2_PARAM_AP_BRIDGE_PACKETS = 10, | ||
274 | PRISM2_PARAM_DTIM_PERIOD = 11, | ||
275 | PRISM2_PARAM_AP_NULLFUNC_ACK = 12, | ||
276 | PRISM2_PARAM_MAX_WDS = 13, | ||
277 | PRISM2_PARAM_AP_AUTOM_AP_WDS = 14, | ||
278 | PRISM2_PARAM_AP_AUTH_ALGS = 15, | ||
279 | PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16, | ||
280 | PRISM2_PARAM_HOST_ENCRYPT = 17, | ||
281 | PRISM2_PARAM_HOST_DECRYPT = 18, | ||
282 | /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19, REMOVED 2005-08-14 */ | ||
283 | /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20, REMOVED 2005-08-14 */ | ||
284 | PRISM2_PARAM_HOST_ROAMING = 21, | ||
285 | PRISM2_PARAM_BCRX_STA_KEY = 22, | ||
286 | PRISM2_PARAM_IEEE_802_1X = 23, | ||
287 | PRISM2_PARAM_ANTSEL_TX = 24, | ||
288 | PRISM2_PARAM_ANTSEL_RX = 25, | ||
289 | PRISM2_PARAM_MONITOR_TYPE = 26, | ||
290 | PRISM2_PARAM_WDS_TYPE = 27, | ||
291 | PRISM2_PARAM_HOSTSCAN = 28, | ||
292 | PRISM2_PARAM_AP_SCAN = 29, | ||
293 | PRISM2_PARAM_ENH_SEC = 30, | ||
294 | PRISM2_PARAM_IO_DEBUG = 31, | ||
295 | PRISM2_PARAM_BASIC_RATES = 32, | ||
296 | PRISM2_PARAM_OPER_RATES = 33, | ||
297 | PRISM2_PARAM_HOSTAPD = 34, | ||
298 | PRISM2_PARAM_HOSTAPD_STA = 35, | ||
299 | PRISM2_PARAM_WPA = 36, | ||
300 | PRISM2_PARAM_PRIVACY_INVOKED = 37, | ||
301 | PRISM2_PARAM_TKIP_COUNTERMEASURES = 38, | ||
302 | PRISM2_PARAM_DROP_UNENCRYPTED = 39, | ||
303 | PRISM2_PARAM_SCAN_CHANNEL_MASK = 40, | ||
304 | }; | ||
305 | |||
306 | enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1, | ||
307 | HOSTAP_ANTSEL_LOW = 2, HOSTAP_ANTSEL_HIGH = 3 }; | ||
308 | |||
309 | |||
310 | /* PRISM2_IOCTL_MACCMD ioctl() subcommands: */ | ||
311 | enum { AP_MAC_CMD_POLICY_OPEN = 0, AP_MAC_CMD_POLICY_ALLOW = 1, | ||
312 | AP_MAC_CMD_POLICY_DENY = 2, AP_MAC_CMD_FLUSH = 3, | ||
313 | AP_MAC_CMD_KICKALL = 4 }; | ||
314 | |||
315 | |||
316 | /* PRISM2_IOCTL_DOWNLOAD ioctl() dl_cmd: */ | ||
317 | enum { | ||
318 | PRISM2_DOWNLOAD_VOLATILE = 1 /* RAM */, | ||
319 | /* Note! Old versions of prism2_srec have a fatal error in CRC-16 | ||
320 | * calculation, which will corrupt all non-volatile downloads. | ||
321 | * PRISM2_DOWNLOAD_NON_VOLATILE used to be 2, but it is now 3 to | ||
322 | * prevent use of old versions of prism2_srec for non-volatile | ||
323 | * download. */ | ||
324 | PRISM2_DOWNLOAD_NON_VOLATILE = 3 /* FLASH */, | ||
325 | PRISM2_DOWNLOAD_VOLATILE_GENESIS = 4 /* RAM in Genesis mode */, | ||
326 | /* Persistent versions of volatile download commands (keep firmware | ||
327 | * data in memory and automatically re-download after hw_reset */ | ||
328 | PRISM2_DOWNLOAD_VOLATILE_PERSISTENT = 5, | ||
329 | PRISM2_DOWNLOAD_VOLATILE_GENESIS_PERSISTENT = 6, | ||
330 | }; | ||
331 | |||
332 | struct prism2_download_param { | ||
333 | u32 dl_cmd; | ||
334 | u32 start_addr; | ||
335 | u32 num_areas; | ||
336 | struct prism2_download_area { | ||
337 | u32 addr; /* wlan card address */ | ||
338 | u32 len; | ||
339 | void __user *ptr; /* pointer to data in user space */ | ||
340 | } data[0]; | ||
341 | }; | ||
342 | |||
343 | #define PRISM2_MAX_DOWNLOAD_AREA_LEN 131072 | ||
344 | #define PRISM2_MAX_DOWNLOAD_LEN 262144 | ||
345 | |||
346 | |||
347 | /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */ | ||
348 | enum { | ||
349 | PRISM2_HOSTAPD_FLUSH = 1, | ||
350 | PRISM2_HOSTAPD_ADD_STA = 2, | ||
351 | PRISM2_HOSTAPD_REMOVE_STA = 3, | ||
352 | PRISM2_HOSTAPD_GET_INFO_STA = 4, | ||
353 | /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */ | ||
354 | PRISM2_SET_ENCRYPTION = 6, | ||
355 | PRISM2_GET_ENCRYPTION = 7, | ||
356 | PRISM2_HOSTAPD_SET_FLAGS_STA = 8, | ||
357 | PRISM2_HOSTAPD_GET_RID = 9, | ||
358 | PRISM2_HOSTAPD_SET_RID = 10, | ||
359 | PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR = 11, | ||
360 | PRISM2_HOSTAPD_SET_GENERIC_ELEMENT = 12, | ||
361 | PRISM2_HOSTAPD_MLME = 13, | ||
362 | PRISM2_HOSTAPD_SCAN_REQ = 14, | ||
363 | PRISM2_HOSTAPD_STA_CLEAR_STATS = 15, | ||
364 | }; | ||
365 | |||
366 | #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024 | ||
367 | #define PRISM2_HOSTAPD_RID_HDR_LEN \ | ||
368 | ((int) (&((struct prism2_hostapd_param *) 0)->u.rid.data)) | ||
369 | #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \ | ||
370 | ((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data)) | ||
371 | |||
372 | /* Maximum length for algorithm names (-1 for nul termination) used in ioctl() | ||
373 | */ | ||
374 | #define HOSTAP_CRYPT_ALG_NAME_LEN 16 | ||
375 | |||
376 | |||
377 | struct prism2_hostapd_param { | ||
378 | u32 cmd; | ||
379 | u8 sta_addr[ETH_ALEN]; | ||
380 | union { | ||
381 | struct { | ||
382 | u16 aid; | ||
383 | u16 capability; | ||
384 | u8 tx_supp_rates; | ||
385 | } add_sta; | ||
386 | struct { | ||
387 | u32 inactive_sec; | ||
388 | } get_info_sta; | ||
389 | struct { | ||
390 | u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN]; | ||
391 | u32 flags; | ||
392 | u32 err; | ||
393 | u8 idx; | ||
394 | u8 seq[8]; /* sequence counter (set: RX, get: TX) */ | ||
395 | u16 key_len; | ||
396 | u8 key[0]; | ||
397 | } crypt; | ||
398 | struct { | ||
399 | u32 flags_and; | ||
400 | u32 flags_or; | ||
401 | } set_flags_sta; | ||
402 | struct { | ||
403 | u16 rid; | ||
404 | u16 len; | ||
405 | u8 data[0]; | ||
406 | } rid; | ||
407 | struct { | ||
408 | u8 len; | ||
409 | u8 data[0]; | ||
410 | } generic_elem; | ||
411 | struct { | ||
412 | #define MLME_STA_DEAUTH 0 | ||
413 | #define MLME_STA_DISASSOC 1 | ||
414 | u16 cmd; | ||
415 | u16 reason_code; | ||
416 | } mlme; | ||
417 | struct { | ||
418 | u8 ssid_len; | ||
419 | u8 ssid[32]; | ||
420 | } scan_req; | ||
421 | } u; | ||
422 | }; | ||
423 | |||
424 | #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0) | ||
425 | #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1) | ||
426 | |||
427 | #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2 | ||
428 | #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3 | ||
429 | #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4 | ||
430 | #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5 | ||
431 | #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6 | ||
432 | #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7 | ||
433 | |||
434 | |||
435 | #endif /* HOSTAP_COMMON_H */ | ||