grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / networks / prism2 / prism2.h
blob2db1e266a87ef745b4cea9beb001689c030bd169
1 /*
3 Copyright (C) 2004-2011 Neil Cafferkey
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 MA 02111-1307, USA.
22 #ifndef PRISM2_H
23 #define PRISM2_H
26 /* General */
27 /* ======= */
29 #define P2_HEADERSIZE 0x2E
30 #define P2_MAXMCASTENTRIES 16
31 #define P2_AIROWEPRECLEN 0x1c
32 #define P2_ALTWEPRECLEN 0x21
33 #define P2_APRECLEN 0x32 /* ALT... ? */
35 #define P2_MSGTYPE_RFC1042 1
36 #define P2_MSGTYPE_TUNNEL 2
37 #define P2_MSGTYPE_WMPMSG 3
38 #define P2_MSGTYPE_MGMT 4
41 /* Registers */
42 /* ========= */
44 #define P2_REG_COMMAND 0x0
45 #define P2_REG_PARAM0 0x2
46 #define P2_REG_PARAM1 0x4
47 #define P2_REG_PARAM2 0x6
48 #define P2_REG_STATUS 0x8
49 #define P2_REG_RESP0 0xA
50 #define P2_REG_RESP1 0xC
51 #define P2_REG_RESP2 0xE
52 #define P2_REG_INFOFID 0x10
53 #define P2_REG_CONTROL 0x14
54 #define P2_REG_SELECT0 0x18
55 #define P2_REG_SELECT1 0x1A
56 #define P2_REG_OFFSET0 0x1C
57 #define P2_REG_OFFSET1 0x1E
58 #define P2_REG_RXFID 0x20
59 #define P2_REG_ALLOCFID 0x22
60 #define P2_REG_TXCMPFID 0x24
61 #define P2_REG_PCICOR 0x26
62 #define P2_REG_EVENTS 0x30
63 #define P2_REG_INTMASK 0x32
64 #define P2_REG_ACKEVENTS 0x34
65 #define P2_REG_DATA0 0x36
66 #define P2_REG_DATA1 0x38
67 #define P2_REG_AUXPAGE 0x3A
68 #define P2_REG_AUXOFFSET 0x3C
69 #define P2_REG_AUXDATA 0x3E
72 /* Events */
73 /* ======= */
75 #define P2_EVENTB_TICK 15
76 #define P2_EVENTB_RES 14
77 #define P2_EVENTB_INFODROP 13
78 #define P2_EVENTB_NOCARD 11
79 #define P2_EVENTB_DUIFRX 10
80 #define P2_EVENTB_INFO 7
81 #define P2_EVENTB_CMD 4
82 #define P2_EVENTB_ALLOCMEM 3
83 #define P2_EVENTB_TXFAIL 2
84 #define P2_EVENTB_TX 1
85 #define P2_EVENTB_RX 0
87 #define P2_EVENTF_TICK (1 << P2_EVENTB_TICK)
88 #define P2_EVENTF_RES (1 << P2_EVENTB_RES)
89 #define P2_EVENTF_INFODROP (1 << P2_EVENTB_INFODROP)
90 #define P2_EVENTF_NOCARD (1 << P2_EVENTB_NOCARD)
91 #define P2_EVENTF_DUIFRX (1 << P2_EVENTB_DUIFRX)
92 #define P2_EVENTF_INFO (1 << P2_EVENTB_INFO)
93 #define P2_EVENTF_CMD (1 << P2_EVENTB_CMD)
94 #define P2_EVENTF_ALLOCMEM (1 << P2_EVENTB_ALLOCMEM)
95 #define P2_EVENTF_TXFAIL (1 << P2_EVENTB_TXFAIL)
96 #define P2_EVENTF_TX (1 << P2_EVENTB_TX)
97 #define P2_EVENTF_RX (1 << P2_EVENTB_RX)
100 /* Commands */
101 /* ======== */
103 #define P2_CMD_INIT 0x0000
104 #define P2_CMD_ENABLE 0x0001
105 #define P2_CMD_DISABLE 0x0002
106 #define P2_CMD_DIAG 0x0003
107 #define P2_CMD_EXECUTE 0x0004
108 #define P2_CMD_ALLOCMEM 0x000A
109 #define P2_CMD_TX 0x000B
110 #define P2_CMD_NOTIFY 0x0010
111 #define P2_CMD_INQUIRE 0x0011
112 #define P2_CMD_ACCESS 0x0021
113 #define P2_CMD_PROGRAM 0x0022
114 #define P2_CMD_READEE 0x0030
116 /* Command flags */
118 #define P2_CMDB_RECLAIM 8
119 #define P2_CMDB_WRITE 8
121 #define P2_CMDF_RECLAIM (1 << P2_CMDB_RECLAIM)
122 #define P2_CMDF_WRITE (1 << P2_CMDB_WRITE)
125 /* LTV records */
126 /* =========== */
128 #define P2_REC_PORTTYPE 0xFC00
129 #define P2_REC_ADDRESS 0xFC01
130 #define P2_REC_DESIREDSSID 0xFC02
131 #define P2_REC_OWNCHNL 0xFC03
132 #define P2_REC_OWNSSID 0xFC04
133 #define P2_REC_SYSTEMSCALE 0xFC06
134 #define P2_REC_MAXDATALEN 0xFC07
135 #define P2_REC_ROAMINGMODE 0xFC2D /* ??? */
136 #define P2_REC_MCASTLIST 0xFC80
137 #define P2_REC_CREATEIBSS 0xFC81
138 #define P2_REC_RTSTHRESH 0xFC83
139 #define P2_REC_TXRATE 0xFC84
140 #define P2_REC_PROMISC 0xFC85
141 #define P2_REC_PRIIDENTITY 0xFD02
142 #define P2_REC_NICIDENTITY 0xFD0B
143 #define P2_REC_STAIDENTITY 0xFD20
144 #define P2_REC_LINKQUALITY 0xFD43
145 #define P2_REC_CURTXRATE 0xFD44 /* ??? */
146 #define P2_REC_HASWEP 0xFD4F
148 /* Intersil/Symbol-specific records */
150 #define P2_REC_TXCRYPTKEY 0xFC23
151 #define P2_REC_CRYPTKEY0 0xFC24
152 #define P2_REC_CRYPTKEY1 0xFC25
153 #define P2_REC_CRYPTKEY2 0xFC26
154 #define P2_REC_CRYPTKEY3 0xFC27
155 #define P2_REC_ENCRYPTION 0xFC28
156 #define P2_REC_AUTHTYPE 0xFC2A
157 #define P2_REC_ROAMINGMODE 0xFC2D
158 #define P2_REC_DBMOFFSET 0xFC46
159 #define P2_REC_WPAIE 0xFC48
160 #define P2_REC_ALTHOSTSCAN 0xFCAB /* ??? */
161 #define P2_REC_RXMGMTFRAMES 0xFCBB
162 #define P2_REC_JOIN 0xFCE2
163 #define P2_REC_HOSTSCAN 0xFCE5
164 /*#define P2_REC_PRIMARYID 0xFD02*/ /* ??? */
166 /* Lucent-specific records */
168 #define P2_REC_ALTENCRYPTION 0xFC20
169 #define P2_REC_ALTAUTHTYPE 0xFC21
170 #define P2_REC_DEFLTCRYPTKEYS 0xFCB0
171 #define P2_REC_ALTTXCRYPTKEY 0xFCB1
172 #define P2_REC_SCANSSID 0xFCB2
173 #define P2_REC_ADDDEFAULTTKIPKEY 0xFCB4
174 #define P2_REC_KEYMGMTSUITE 0xFCB5
175 #define P2_REC_REMDEFAULTTKIPKEY 0xFCB6
176 #define P2_REC_ADDMAPPEDTKIPKEY 0xFCB7
177 #define P2_REC_REMMAPPEDTKIPKEY 0xFCB8
178 #define P2_REC_SCANCHANNELS 0xFCC2
180 /* Symbol-specific records */
182 /*#define P2_REC_SYMBOLIDENTITY 0xFD24*/
184 /* Aironet-specific records */
186 #define P2_REC_CAPABILITIES 0xFF00
187 #define P2_REC_APINFO 0xFF01
188 #define P2_REC_RADIOINFO 0xFF02
189 #define P2_REC_RSSI 0xFF04
190 #define P2_REC_CONFIG 0xFF10
191 #define P2_REC_SSID 0xFF11
192 #define P2_REC_APLIST 0xFF12
193 #define P2_REC_DRVNAME 0xFF13
194 #define P2_REC_ETHERENCAP 0xFF14
195 #define P2_REC_WEPTEMP 0xFF15
196 #define P2_REC_WEPPERM 0xFF16
197 #define P2_REC_MODULATION 0xFF17
198 #define P2_REC_OPTIONS 0xFF18
199 #define P2_REC_ACTUALCONFIG 0xFF20
200 #define P2_REC_FACTORYCONFIG 0xFF21
201 #define P2_REC_LEAPUSERNAME 0xFF23
202 #define P2_REC_LEAPPASSWORD 0xFF24
203 #define P2_REC_STATUS 0xFF50
204 #define P2_REC_BEACON_HST 0xFF51
205 #define P2_REC_BUSYHST 0xFF52
206 #define P2_REC_RETRIES_HST 0xFF53
207 #define P2_REC_MIC 0xFF57
208 #define P2_REC_STATS16 0xFF60
209 #define P2_REC_STATS16DELTA 0xFF61
210 #define P2_REC_STATS16DELTACLEAR 0xFF62
211 #define P2_REC_STATS 0xFF68
212 #define P2_REC_STATSDELTA 0xFF69
213 #define P2_REC_STATSDELTACLEAR 0xFF6A
214 #define P2_REC_ECHOTESTRID 0xFF70
215 #define P2_REC_ECHOTESTRESULTS 0xFF71
216 #define P2_REC_BSSLISTFIRST 0xFF72
217 #define P2_REC_BSSLISTNEXT 0xFF73
220 /* Information frames */
221 /* ================== */
223 #define P2_INFO_NOTIFY 0xF000
224 #define P2_INFO_COUNTERS 0xF100
225 #define P2_INFO_SCANRESULTS 0xF101
226 #define P2_INFO_SCANRESULT 0xF102
227 #define P2_INFO_HOSTSCANRESULTS 0xF103
228 //#define P2_INFO_ALTHOSTSCANRESULTS 0xF104
229 #define P2_INFO_LINKSTATUS 0xF200
230 /*#define P2_INFO_ASSOCSTATUS 0xF201*/ /* AP only? */
233 /* Register Details */
234 /* ================ */
236 /* Command Register */
238 #define P2_REG_COMMANDB_BUSY 15
240 #define P2_REG_COMMANDF_BUSY (1 << P2_REG_COMMANDB_BUSY)
242 /* Offset Register */
244 #define P2_REG_OFFSETB_BUSY 15
245 #define P2_REG_OFFSETB_ERROR 14
247 #define P2_REG_OFFSETF_BUSY (1 << P2_REG_OFFSETB_BUSY)
248 #define P2_REG_OFFSETF_ERROR (1 << P2_REG_OFFSETB_ERROR)
250 /* Control Register */
252 #define P2_REG_CONTROLB_AUX 14
254 #define P2_REG_CONTROLF_AUX (0x3 << P2_REG_CONTROLB_AUX)
256 #define P2_REG_CONTROL_AUXDISABLED (0 << P2_REG_CONTROLB_AUX)
257 #define P2_REG_CONTROL_DISABLEAUX (1 << P2_REG_CONTROLB_AUX)
258 #define P2_REG_CONTROL_ENABLEAUX (2 << P2_REG_CONTROLB_AUX)
259 #define P2_REG_CONTROL_AUXENABLED (3 << P2_REG_CONTROLB_AUX)
262 /* Record Details */
263 /* ============== */
265 #if 0 /* Contrary to docs in Agere code, these should be bit numbers */
266 #define P2_REC_ALTAUTHTYPE_OPEN 0
267 #define P2_REC_ALTAUTHTYPE_SHARED 1
268 #define P2_REC_ALTAUTHTYPE_LEAP 2
269 #endif
271 #define P2_REC_ENCRYPTIONB_ENABLE 0
272 #define P2_REC_ENCRYPTIONB_NOPLAINTEXT 1
273 #define P2_REC_ENCRYPTIONB_HOSTENCRYPT 4
274 #define P2_REC_ENCRYPTIONB_HOSTDECRYPT 7
276 #define P2_REC_ENCRYPTIONF_ENABLE (1 << P2_REC_ENCRYPTIONB_ENABLE)
277 #define P2_REC_ENCRYPTIONF_NOPLAINTEXT (1 << P2_REC_ENCRYPTIONB_NOPLAINTEXT)
278 #define P2_REC_ENCRYPTIONF_HOSTENCRYPT (1 << P2_REC_ENCRYPTIONB_HOSTENCRYPT)
279 #define P2_REC_ENCRYPTIONF_HOSTDECRYPT (1 << P2_REC_ENCRYPTIONB_HOSTDECRYPT)
281 #define P2_REC_AUTHTYPEB_OPEN 0
282 #define P2_REC_AUTHTYPEB_SHARED 1
284 #define P2_REC_AUTHTYPEF_OPEN (1 << P2_REC_AUTHTYPEB_OPEN)
285 #define P2_REC_AUTHTYPEF_SHARED (1 << P2_REC_AUTHTYPEB_SHARED)
287 #define P2_REC_CAPABILITIES_OEMADDR 0x40
289 #define P2_REC_CONFIG_OPMODE 0x2
290 #define P2_REC_CONFIG_MACADDR 0xA
291 #define P2_REC_CONFIG_DSCHANNEL 0x66
294 /* Information Frame Details */
295 /* ========================= */
297 #define P2_APREC_CHANNEL 0x0
298 #define P2_APREC_NOISE 0x2
299 #define P2_APREC_SIGNAL 0x4
300 #define P2_APREC_BSSID 0x6
301 #define P2_APREC_INTERVAL 0xc
302 #define P2_APREC_CAPABILITIES 0xe
303 #define P2_APREC_NAMELEN 0x10
304 #define P2_APREC_NAME 0x12
307 /* Frame descriptors */
308 /* ================= */
310 /* Standard frame */
312 #define P2_FRM_STATUS 0x0
313 #define P2_FRM_NOISE 0x6
314 #define P2_FRM_SIGNAL 0x7
315 #define P2_FRM_TXCONTROL 0xc
316 #define P2_FRM_HEADER 0xe
317 #define P2_FRM_DATALEN 0x2c
318 #define P2_FRM_ALTTXCONTROL 0x2c
319 #define P2_FRM_ETHFRAME 0x2e
320 #define P2_FRM_DATA 0x3c
322 /* Hermes-II frame */
324 #define P2_H2FRM_TXCONTROL 0x36
325 #define P2_H2FRM_DATALEN 0x38
326 #define P2_H2FRM_ETHFRAME 0x3a
327 #define P2_H2FRM_DATA 0x48
329 #define P2_AIROFRM_STATUS 0x4
330 #define P2_AIROFRM_FRAME 0x14
332 /* Status field */
334 #define P2_FRM_STATUSB_BADCRC 0
335 #define P2_FRM_STATUSB_RETERR 0
336 #define P2_FRM_STATUSB_BADCRYPT 1
337 #define P2_FRM_STATUSB_AGEDERR 1
338 #define P2_FRM_STATUSB_DISCONNECT 2
339 #define P2_FRM_STATUSB_FORMERR 3
340 #define P2_FRM_STATUSB_MACPORT 8
341 #define P2_FRM_STATUSB_PCF 12
342 #define P2_FRM_STATUSB_MSGTYPE 13
344 #define P2_FRM_STATUSF_BADCRC (1 << P2_FRM_STATUSB_BADCRC)
345 #define P2_FRM_STATUSF_RETERR (1 << P2_FRM_STATUSB_RETERR)
346 #define P2_FRM_STATUSF_BADCRYPT (1 << P2_FRM_STATUSB_BADCRYPT)
347 #define P2_FRM_STATUSF_AGEDERR (1 << P2_FRM_STATUSB_AGEDERR)
348 #define P2_FRM_STATUSF_DISCONNECT (1 << P2_FRM_STATUSB_DISCONNECT)
349 #define P2_FRM_STATUSF_FORMERR (1 << P2_FRM_STATUSB_FORMERR)
350 #define P2_FRM_STATUSF_MACPORT (7 << P2_FRM_STATUSB_MACPORT)
351 #define P2_FRM_STATUSF_PCF (1 << P2_FRM_STATUSB_PCF)
352 #define P2_FRM_STATUSF_MSGTYPE (7 << P2_FRM_STATUSB_MSGTYPE)
354 /* TX Control field */
356 #define P2_FRM_TXCONTROLB_NATIVE 3
357 #define P2_FRM_TXCONTROLB_MIC 4 // HERMES only
358 #define P2_FRM_TXCONTROLB_NOENC 7
359 #define P2_FRM_TXCONTROLB_MICKEYID 11 // HERMES only
361 #define P2_FRM_TXCONTROLF_NATIVE (1 << P2_FRM_TXCONTROLB_NATIVE)
362 #define P2_FRM_TXCONTROLF_MIC (1 << P2_FRM_TXCONTROLB_MIC)
363 #define P2_FRM_TXCONTROLF_NOENC (1 << P2_FRM_TXCONTROLB_NOENC)
364 #define P2_FRM_TXCONTROLF_MICKEYID (3 << P2_FRM_TXCONTROLB_MICKEYID)
366 #endif