if_rayreg.h revision 1.11 1 1.11 dholland /* $NetBSD: if_rayreg.h,v 1.11 2015/09/06 06:01:00 dholland Exp $ */
2 1.8 perry /*
3 1.1 chopps * Copyright (c) 2000 Christian E. Hopps
4 1.1 chopps * All rights reserved.
5 1.8 perry *
6 1.1 chopps * Redistribution and use in source and binary forms, with or without
7 1.1 chopps * modification, are permitted provided that the following conditions
8 1.1 chopps * are met:
9 1.1 chopps * 1. Redistributions of source code must retain the above copyright
10 1.1 chopps * notice, this list of conditions and the following disclaimer.
11 1.1 chopps * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 chopps * notice, this list of conditions and the following disclaimer in the
13 1.1 chopps * documentation and/or other materials provided with the distribution.
14 1.1 chopps * 3. Neither the name of the author nor the names of any co-contributors
15 1.1 chopps * may be used to endorse or promote products derived from this software
16 1.1 chopps * without specific prior written permission.
17 1.1 chopps *
18 1.1 chopps * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 1.1 chopps * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 1.1 chopps * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 1.1 chopps * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 1.1 chopps * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 1.1 chopps * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 1.1 chopps * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 1.1 chopps * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 1.1 chopps * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.1 chopps * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.1 chopps * SUCH DAMAGE.
29 1.1 chopps */
30 1.1 chopps
31 1.11 dholland #include <sys/ioccom.h>
32 1.11 dholland
33 1.1 chopps #define RAY_MAXSSIDLEN 32
34 1.1 chopps
35 1.1 chopps /*
36 1.8 perry * CCR registers
37 1.1 chopps */
38 1.4 martin #define RAY_COR 0 /* config option register */
39 1.4 martin #define RAY_CCSR 1 /* card config and status register */
40 1.4 martin #define RAY_PIN 2 /* not in hw */
41 1.4 martin #define RAY_SOCKETCOPY 3 /* not used by hw */
42 1.4 martin #define RAY_HCSIR 5 /* HCS intr register */
43 1.4 martin #define RAY_ECFIR 6 /* ECF intr register */
44 1.4 martin #define RAY_AR0 8 /* authorization register 0 (unused) */
45 1.4 martin #define RAY_AR1 9 /* authorization register 1 (unused) */
46 1.5 martin #define RAY_PMR 10 /* program mode register (unused) */
47 1.5 martin #define RAY_TMR 11 /* pc test mode register (unused) */
48 1.5 martin #define RAY_FCWR 16 /* frequency control word register */
49 1.5 martin
50 1.1 chopps /*
51 1.5 martin * XXX these registers cannot be accessed with pcmcia.c's 0x14 byte mapping
52 1.1 chopps * of the CCR for us
53 1.1 chopps */
54 1.1 chopps #if 0
55 1.5 martin #define RAY_TMC1 0x014 /* test mode control 1 (unused) */
56 1.5 martin #define RAY_TMC2 0x015 /* test mode control 1 (unused) */
57 1.5 martin #define RAY_TMC3 0x016 /* test mode control 1 (unused) */
58 1.5 martin #define RAY_TMC4 0x017 /* test mode control 1 (unused) */
59 1.1 chopps #endif
60 1.1 chopps
61 1.1 chopps /*
62 1.1 chopps * COR register bits
63 1.1 chopps */
64 1.1 chopps #define RAY_COR_CFG_NUM 0x01 /* currently ignored and set */
65 1.1 chopps #define RAY_COR_CFG_MASK 0x3f /* mask for function */
66 1.1 chopps #define RAY_COR_LEVEL_IRQ 0x40 /* currently ignored and set */
67 1.1 chopps #define RAY_COR_RESET 0x80 /* soft-reset the card */
68 1.1 chopps
69 1.1 chopps /*
70 1.1 chopps * CCS register bits
71 1.1 chopps */
72 1.1 chopps /* XXX the linux driver indicates bit 0 is the irq bit */
73 1.1 chopps #define RAY_CCS_IRQ 0x02 /* interrupt pending */
74 1.1 chopps #define RAY_CCS_POWER_DOWN 0x04
75 1.1 chopps
76 1.1 chopps /*
77 1.1 chopps * HCSI register bits
78 1.1 chopps *
79 1.1 chopps * the host can only clear this bit.
80 1.1 chopps */
81 1.1 chopps #define RAY_HCSIR_IRQ 0x01 /* indicates an interrupt */
82 1.1 chopps
83 1.1 chopps /*
84 1.1 chopps * ECFI register values
85 1.1 chopps */
86 1.1 chopps #define RAY_ECSIR_IRQ 0x01 /* interrupt the card */
87 1.1 chopps
88 1.1 chopps /*
89 1.1 chopps * authorization register 0 values
90 1.1 chopps * -- used for testing/programming the card (unused)
91 1.1 chopps */
92 1.1 chopps #define RAY_AR0_ON 0x57
93 1.1 chopps
94 1.1 chopps /*
95 1.1 chopps * authorization register 1 values
96 1.1 chopps * -- used for testing/programming the card (unused)
97 1.1 chopps */
98 1.1 chopps #define RAY_AR1_ON 0x82
99 1.1 chopps
100 1.1 chopps /*
101 1.1 chopps * PMR bits -- these are used to program the card (unused)
102 1.1 chopps */
103 1.1 chopps #define RAY_PMR_PC2PM 0x02 /* grant access to firmware flash */
104 1.1 chopps #define RAY_PMR_PC2CAL 0x10 /* read access to the A/D modem inp */
105 1.1 chopps #define RAY_PMR_MLSE 0x20 /* read access to the MSLE prom */
106 1.1 chopps
107 1.1 chopps /*
108 1.1 chopps * TMR bits -- get access to test modes (unused)
109 1.1 chopps */
110 1.1 chopps #define RAY_TMR_TEST 0x08 /* test mode */
111 1.1 chopps
112 1.1 chopps /*
113 1.1 chopps * FCWR -- frequency control word, values from [0x02,0xA6] map to
114 1.1 chopps * RF frequency values.
115 1.1 chopps */
116 1.1 chopps
117 1.1 chopps /*
118 1.1 chopps * 48k of memory -- would like to map this into smaller isa windows
119 1.1 chopps * but doesn't seem currently possible with the pcmcia code
120 1.1 chopps */
121 1.1 chopps #define RAY_SRAM_MEM_BASE 0
122 1.1 chopps #define RAY_SRAM_MEM_SIZE 0xc000
123 1.1 chopps
124 1.1 chopps /*
125 1.1 chopps * offsets into shared ram
126 1.1 chopps */
127 1.1 chopps #define RAY_SCB_BASE 0x0 /* cfg/status/ctl area */
128 1.1 chopps #define RAY_STATUS_BASE 0x0100
129 1.1 chopps #define RAY_HOST_TO_ECF_BASE 0x0200
130 1.1 chopps #define RAY_ECF_TO_HOST_BASE 0x0300
131 1.1 chopps #define RAY_CCS_BASE 0x0400
132 1.1 chopps #define RAY_RCS_BASE 0x0800
133 1.1 chopps #define RAY_APOINT_TIM_BASE 0x0c00
134 1.1 chopps #define RAY_SSID_LIST_BASE 0x0d00
135 1.1 chopps #define RAY_TX_BASE 0x1000
136 1.1 chopps #define RAY_TX_SIZE 0x7000
137 1.1 chopps #define RAY_TX_END 0x8000
138 1.1 chopps #define RAY_RX_BASE 0x8000
139 1.1 chopps #define RAY_RX_END 0xc000
140 1.1 chopps #define RAY_RX_MASK 0x3fff
141 1.1 chopps
142 1.1 chopps struct ray_ecf_startup {
143 1.1 chopps u_int8_t e_status; /* RAY_ECFS_ */
144 1.1 chopps u_int8_t e_station_addr[ETHER_ADDR_LEN];
145 1.1 chopps u_int8_t e_resv0;
146 1.1 chopps u_int8_t e_rates[8];
147 1.1 chopps u_int8_t e_japan_callsign[12];
148 1.1 chopps u_int8_t e_prg_cksum;
149 1.1 chopps u_int8_t e_cis_cksum;
150 1.1 chopps u_int8_t e_fw_build_string;
151 1.1 chopps u_int8_t e_fw_build;
152 1.1 chopps u_int8_t e_fw_resv;
153 1.1 chopps u_int8_t e_asic_version;
154 1.1 chopps u_int8_t e_tib_size;
155 1.1 chopps u_int8_t e_resv1[29];
156 1.1 chopps };
157 1.1 chopps
158 1.1 chopps #define RAY_ECFS_RESERVED0 0x01
159 1.1 chopps #define RAY_ECFS_PROC_SELF_TEST 0x02
160 1.1 chopps #define RAY_ECFS_PROG_MEM_CHECKSUM 0x04
161 1.1 chopps #define RAY_ECFS_DATA_MEM_TEST 0x08
162 1.1 chopps #define RAY_ECFS_RX_CALIBRATION 0x10
163 1.1 chopps #define RAY_ECFS_FW_VERSION_COMPAT 0x20
164 1.1 chopps #define RAY_ECFS_RERSERVED1 0x40
165 1.1 chopps #define RAY_ECFS_TEST_COMPLETE 0x80
166 1.1 chopps #define RAY_ECFS_CARD_OK RAY_ECFS_TEST_COMPLETE
167 1.1 chopps
168 1.1 chopps /* configure/status/control memory */
169 1.1 chopps struct ray_csc {
170 1.1 chopps u_int8_t csc_mrxo_own; /* 0 ECF writes, 1 host write */
171 1.1 chopps u_int8_t csc_mrxc_own; /* " */
172 1.1 chopps u_int8_t csc_rxhc_own; /* " */
173 1.1 chopps u_int8_t csc_resv;
174 1.1 chopps u_int16_t csc_mrx_overflow; /* ECF incs on rx overflow */
175 1.1 chopps u_int16_t csc_mrx_cksum; /* " on cksum error */
176 1.1 chopps u_int16_t csc_rx_hcksum; /* " on header cksum error */
177 1.6 mjl u_int8_t csc_rx_noise; /* average RSL measurement */
178 1.1 chopps };
179 1.1 chopps
180 1.1 chopps /* status area */
181 1.1 chopps struct ray_status {
182 1.1 chopps u_int8_t st_startup_word;
183 1.1 chopps u_int8_t st_station_addr[ETHER_ADDR_LEN];
184 1.1 chopps u_int8_t st_calc_prog_cksum;
185 1.1 chopps u_int8_t st_calc_cis_cksum;
186 1.1 chopps u_int8_t st_ecf_spare[7];
187 1.1 chopps u_int8_t st_japan_callsign[12];
188 1.1 chopps };
189 1.1 chopps
190 1.1 chopps /*
191 1.1 chopps * Host to ECF data formats
192 1.1 chopps */
193 1.1 chopps struct ray_startup_params_head {
194 1.1 chopps u_int8_t sp_net_type; /* 0: ad-hoc 1: infra */
195 1.1 chopps u_int8_t sp_ap_status; /* 0: terminal 1: access-point */
196 1.1 chopps u_int8_t sp_ssid[RAY_MAXSSIDLEN]; /* current SSID */
197 1.1 chopps u_int8_t sp_scan_mode; /* 1: active */
198 1.1 chopps u_int8_t sp_apm_mode; /* 0: none 1: power-saving */
199 1.1 chopps u_int8_t sp_mac_addr[ETHER_ADDR_LEN];
200 1.1 chopps u_int8_t sp_frag_thresh[2];
201 1.1 chopps /*2c*/ u_int8_t sp_dwell_time[2];
202 1.1 chopps /*2e*/ u_int8_t sp_beacon_period[2];
203 1.1 chopps /*30*/ u_int8_t sp_dtim_interval;
204 1.1 chopps /*31*/ u_int8_t sp_max_retry; /* number of times to attemp tx */
205 1.1 chopps /*32*/ u_int8_t sp_ack_timo;
206 1.1 chopps /*33*/ u_int8_t sp_sifs;
207 1.1 chopps /*34*/ u_int8_t sp_difs;
208 1.1 chopps /*35*/ u_int8_t sp_pifs;
209 1.1 chopps /*36*/ u_int8_t sp_rts_thresh[2];
210 1.1 chopps /*38*/ u_int8_t sp_scan_dwell[2];
211 1.1 chopps /*3a*/ u_int8_t sp_scan_max_dwell[2];
212 1.1 chopps /*3c*/ u_int8_t sp_assoc_timo;
213 1.1 chopps /*3d*/ u_int8_t sp_adhoc_scan_cycle;
214 1.1 chopps /*3e*/ u_int8_t sp_infra_scan_cycle;
215 1.1 chopps /*3f*/ u_int8_t sp_infra_super_scan_cycle;
216 1.1 chopps /*40*/ u_int8_t sp_promisc;
217 1.1 chopps /*41*/ u_int8_t sp_uniq_word[2];
218 1.1 chopps /*43*/ u_int8_t sp_slot_time;
219 1.1 chopps /*44*/ u_int8_t sp_roam_low_snr_thresh; /* if below this inc count */
220 1.1 chopps
221 1.1 chopps /*45*/ u_int8_t sp_low_snr_count; /* roam after cnt below thrsh */
222 1.1 chopps /*46*/ u_int8_t sp_infra_missed_beacon_count;
223 1.1 chopps /*47*/ u_int8_t sp_adhoc_missed_beacon_count;
224 1.1 chopps
225 1.1 chopps /*48*/ u_int8_t sp_country_code;
226 1.1 chopps /*49*/ u_int8_t sp_hop_seq;
227 1.1 chopps /*4a*/ u_int8_t sp_hop_seq_len; /* no longer supported */
228 1.10 perry } __packed;
229 1.1 chopps
230 1.1 chopps /* build 5 tail to the startup params */
231 1.1 chopps struct ray_startup_params_tail_5 {
232 1.1 chopps u_int8_t sp_cw_max[2];
233 1.1 chopps u_int8_t sp_cw_min[2];
234 1.1 chopps u_int8_t sp_noise_filter_gain;
235 1.1 chopps u_int8_t sp_noise_limit_offset;
236 1.1 chopps u_int8_t sp_rssi_thresh_offset;
237 1.1 chopps u_int8_t sp_busy_thresh_offset;
238 1.1 chopps u_int8_t sp_sync_thresh;
239 1.1 chopps u_int8_t sp_test_mode;
240 1.1 chopps u_int8_t sp_test_min_chan;
241 1.1 chopps u_int8_t sp_test_max_chan;
242 1.1 chopps u_int8_t sp_allow_probe_resp;
243 1.1 chopps u_int8_t sp_privacy_must_start;
244 1.1 chopps u_int8_t sp_privacy_can_join;
245 1.1 chopps u_int8_t sp_basic_rate_set[8];
246 1.10 perry } __packed;
247 1.1 chopps
248 1.1 chopps /* build 4 (webgear) tail to the startup params */
249 1.1 chopps struct ray_startup_params_tail_4 {
250 1.1 chopps /*4b*/ u_int8_t sp_cw_max; /* 2 bytes in build 5 */
251 1.1 chopps /*4c*/ u_int8_t sp_cw_min; /* 2 bytes in build 5 */
252 1.1 chopps /*4e*/ u_int8_t sp_noise_filter_gain;
253 1.1 chopps /*4f*/ u_int8_t sp_noise_limit_offset;
254 1.1 chopps u_int8_t sp_rssi_thresh_offset;
255 1.1 chopps u_int8_t sp_busy_thresh_offset;
256 1.1 chopps u_int8_t sp_sync_thresh;
257 1.1 chopps u_int8_t sp_test_mode;
258 1.1 chopps u_int8_t sp_test_min_chan;
259 1.1 chopps u_int8_t sp_test_max_chan;
260 1.1 chopps /* more bytes in build 5 */
261 1.10 perry } __packed;
262 1.1 chopps
263 1.1 chopps /*
264 1.1 chopps * Parameter IDs for the update/report param commands and values if
265 1.1 chopps * relevant
266 1.1 chopps */
267 1.1 chopps #define RAY_PID_NET_TYPE 0
268 1.1 chopps #define RAY_PID_AP_STATUS 1
269 1.1 chopps #define RAY_PID_SSID 2
270 1.1 chopps #define RAY_PID_SCAN_MODE 3
271 1.1 chopps #define RAY_PID_APM_MODE 4
272 1.1 chopps #define RAY_PID_MAC_ADDR 5
273 1.1 chopps #define RAY_PID_FRAG_THRESH 6
274 1.1 chopps #define RAY_PID_DWELL_TIME 7
275 1.1 chopps #define RAY_PID_BEACON_PERIOD 8
276 1.1 chopps #define RAY_PID_DTIM_INT 9
277 1.1 chopps #define RAY_PID_MAX_RETRY 10
278 1.1 chopps #define RAY_PID_ACK_TIMO 11
279 1.1 chopps #define RAY_PID_SIFS 12
280 1.1 chopps #define RAY_PID_DIFS 13
281 1.1 chopps #define RAY_PID_PIFS 14
282 1.1 chopps #define RAY_PID_RTS_THRESH 15
283 1.1 chopps #define RAY_PID_SCAN_DWELL_PERIOD 16
284 1.1 chopps #define RAY_PID_MAX_SCAN_DWELL_PERIOD 17
285 1.1 chopps #define RAY_PID_ASSOC_TIMO 18
286 1.1 chopps #define RAY_PID_ADHOC_SCAN_CYCLE 19
287 1.1 chopps #define RAY_PID_INFRA_SCAN_CYCLE 20
288 1.1 chopps #define RAY_PID_INFRA_SUPER_SCAN_CYCLE 21
289 1.1 chopps #define RAY_PID_PROMISC 22
290 1.1 chopps #define RAY_PID_UNIQ_WORD 23
291 1.1 chopps #define RAY_PID_SLOT_TIME 24
292 1.1 chopps #define RAY_PID_ROAM_LOW_SNR_THRESH 25
293 1.1 chopps #define RAY_PID_LOW_SNR_COUNT 26
294 1.1 chopps #define RAY_PID_INFRA_MISSED_BEACON_COUNT 27
295 1.1 chopps #define RAY_PID_ADHOC_MISSED_BEACON_COUNT 28
296 1.1 chopps #define RAY_PID_COUNTRY_CODE 29
297 1.1 chopps #define RAY_PID_HOP_SEQ 30
298 1.1 chopps #define RAY_PID_HOP_SEQ_LEN 31
299 1.1 chopps #define RAY_PID_CW_MAX 32
300 1.1 chopps #define RAY_PID_CW_MIN 33
301 1.1 chopps #define RAY_PID_NOISE_FILTER_GAIN 34
302 1.1 chopps #define RAY_PID_NOISE_LIMIT_OFFSET 35
303 1.1 chopps #define RAY_PID_RSSI_THRESH_OFFSET 36
304 1.1 chopps #define RAY_PID_BUSY_THRESH_OFFSET 37
305 1.1 chopps #define RAY_PID_SYNC_THRESH 38
306 1.1 chopps #define RAY_PID_TEST_MODE 39
307 1.1 chopps #define RAY_PID_TEST_MIN_CHAN 40
308 1.1 chopps #define RAY_PID_TEST_MAX_CHAN 41
309 1.1 chopps #define RAY_PID_ALLOW_PROBE_RESP 42
310 1.1 chopps #define RAY_PID_PRIVACY_MUST_START 43
311 1.1 chopps #define RAY_PID_PRIVACY_CAN_JOIN 44
312 1.1 chopps #define RAY_PID_BASIC_RATE_SET 45
313 1.1 chopps #define RAY_PID_MAX 46
314 1.1 chopps
315 1.1 chopps /*
316 1.1 chopps * various values for the above parameters
317 1.1 chopps */
318 1.1 chopps #define RAY_PID_NET_TYPE_ADHOC 0x00
319 1.1 chopps #define RAY_PID_NET_TYPE_INFRA 0x01
320 1.1 chopps
321 1.1 chopps #define RAY_PID_AP_STATUS_TERMINAL 0x00 /* not access-point */
322 1.1 chopps #define RAY_PID_AP_STATUS_AP 0x01 /* act as access-point */
323 1.1 chopps
324 1.1 chopps #define RAY_PID_SCAN_MODE_PASSIVE 0x00 /* hw doesn't implement */
325 1.1 chopps #define RAY_PID_SCAN_MODE_ACTIVE 0x01
326 1.1 chopps
327 1.1 chopps #define RAY_PID_APM_MODE_NONE 0x00 /* no power saving */
328 1.1 chopps #define RAY_PID_APM_MODE_PS 0x01 /* power saving mode */
329 1.1 chopps
330 1.1 chopps #define RAY_PID_COUNTRY_CODE_USA 0x1
331 1.1 chopps #define RAY_PID_COUNTRY_CODE_EUROPE 0x2
332 1.1 chopps #define RAY_PID_COUNTRY_CODE_JAPAN 0x3
333 1.1 chopps #define RAY_PID_COUNTRY_CODE_KOREA 0x4
334 1.1 chopps #define RAY_PID_COUNTRY_CODE_SPAIN 0x5
335 1.1 chopps #define RAY_PID_COUNTRY_CODE_FRANCE 0x6
336 1.1 chopps #define RAY_PID_COUNTRY_CODE_ISRAEL 0x7
337 1.1 chopps #define RAY_PID_COUNTRY_CODE_AUSTRALIA 0x8
338 1.1 chopps #define RAY_PID_COUNTRY_CODE_JAPAN_TEST 0x9
339 1.1 chopps #define RAY_PID_COUNTRY_CODE_MAX 0xa
340 1.1 chopps
341 1.1 chopps #define RAY_PID_TEST_MODE_NORMAL 0x0
342 1.1 chopps #define RAY_PID_TEST_MODE_ANT_1 0x1
343 1.1 chopps #define RAY_PID_TEST_MODE_ATN_2 0x2
344 1.1 chopps #define RAY_PID_TEST_MODE_ATN_BOTH 0x3
345 1.1 chopps
346 1.1 chopps #define RAY_PID_ALLOW_PROBE_RESP_DISALLOW 0x0
347 1.1 chopps #define RAY_PID_ALLOW_PROBE_RESP_ALLOW 0x1
348 1.1 chopps
349 1.1 chopps #define RAY_PID_PRIVACY_MUST_START_NOWEP 0x0
350 1.1 chopps #define RAY_PID_PRIVACY_MUST_START_WEP 0x1
351 1.1 chopps
352 1.1 chopps #define RAY_PID_PRIVACY_CAN_JOIN_NOWEP 0x0
353 1.1 chopps #define RAY_PID_PRIVACY_CAN_JOIN_WEP 0x1
354 1.1 chopps #define RAY_PID_PRIVACY_CAN_JOIN_DONT_CARE 0x2
355 1.1 chopps
356 1.1 chopps #define RAY_PID_BASIC_RATE_500K 1
357 1.1 chopps #define RAY_PID_BASIC_RATE_1000K 2
358 1.1 chopps #define RAY_PID_BASIC_RATE_1500K 3
359 1.1 chopps #define RAY_PID_BASIC_RATE_2000K 4
360 1.1 chopps
361 1.1 chopps /*
362 1.1 chopps * System Control Block
363 1.1 chopps */
364 1.1 chopps #define RAY_SCB_CCSI 0x00 /* host CCS index */
365 1.1 chopps #define RAY_SCB_RCCSI 0x01 /* ecf RCCS index */
366 1.1 chopps
367 1.1 chopps /*
368 1.1 chopps * command control structures (for CCSR commands)
369 1.1 chopps */
370 1.1 chopps
371 1.1 chopps /*
372 1.1 chopps * commands for CCSR
373 1.1 chopps */
374 1.1 chopps #define RAY_CMD_START_PARAMS 0x01 /* download start params */
375 1.1 chopps #define RAY_CMD_UPDATE_PARAMS 0x02 /* update params */
376 1.1 chopps #define RAY_CMD_REPORT_PARAMS 0x03 /* report params */
377 1.1 chopps #define RAY_CMD_UPDATE_MCAST 0x04 /* update mcast list */
378 1.1 chopps #define RAY_CMD_UPDATE_APM 0x05 /* update power saving mode */
379 1.1 chopps #define RAY_CMD_START_NET 0x06
380 1.1 chopps #define RAY_CMD_JOIN_NET 0x07
381 1.1 chopps #define RAY_CMD_START_ASSOC 0x08
382 1.1 chopps #define RAY_CMD_TX_REQ 0x09
383 1.1 chopps #define RAY_CMD_TEST_MEM 0x0a
384 1.1 chopps #define RAY_CMD_SHUTDOWN 0x0b
385 1.1 chopps #define RAY_CMD_DUMP_MEM 0x0c
386 1.1 chopps #define RAY_CMD_START_TIMER 0x0d
387 1.1 chopps #define RAY_CMD_MAX 0x0e
388 1.1 chopps
389 1.1 chopps /*
390 1.6 mjl * unsolicited commands from the ECF
391 1.1 chopps */
392 1.1 chopps #define RAY_ECMD_RX_DONE 0x80 /* process rx packet */
393 1.1 chopps #define RAY_ECMD_REJOIN_DONE 0x81 /* rejoined the network */
394 1.7 wiz #define RAY_ECMD_ROAM_START 0x82 /* roaming started */
395 1.1 chopps #define RAY_ECMD_JAPAN_CALL_SIGNAL 0x83 /* japan test thing */
396 1.1 chopps
397 1.1 chopps
398 1.1 chopps #define RAY_CCS_LINK_NULL 0xff
399 1.1 chopps #define RAY_CCS_SIZE 16
400 1.1 chopps
401 1.1 chopps #define RAY_CCS_TX_FIRST 0
402 1.1 chopps #define RAY_CCS_TX_LAST 13
403 1.1 chopps #define RAY_CCS_NTX (RAY_CCS_TX_LAST - RAY_CCS_TX_FIRST + 1)
404 1.1 chopps #define RAY_TX_BUF_SIZE 2048
405 1.1 chopps #define RAY_CCS_CMD_FIRST 14
406 1.1 chopps #define RAY_CCS_CMD_LAST 63
407 1.1 chopps #define RAY_CCS_NCMD (RAY_CCS_CMD_LAST - RAY_CCS_CMD_FIRST + 1)
408 1.1 chopps #define RAY_CCS_LAST 63
409 1.1 chopps
410 1.1 chopps #define RAY_RCCS_FIRST 64
411 1.1 chopps #define RAY_RCCS_LAST 127
412 1.1 chopps
413 1.1 chopps struct ray_cmd {
414 1.1 chopps u_int8_t c_status; /* ccs generic header */
415 1.1 chopps u_int8_t c_cmd; /* " */
416 1.1 chopps u_int8_t c_link; /* " */
417 1.1 chopps };
418 1.1 chopps
419 1.1 chopps #define RAY_CCS_STATUS_FREE 0x0
420 1.1 chopps #define RAY_CCS_STATUS_BUSY 0x1
421 1.1 chopps #define RAY_CCS_STATUS_COMPLETE 0x2
422 1.1 chopps #define RAY_CCS_STATUS_FAIL 0x3
423 1.1 chopps
424 1.1 chopps /* RAY_CMD_UPDATE_PARAMS */
425 1.1 chopps struct ray_cmd_update {
426 1.1 chopps u_int8_t c_status; /* ccs generic header */
427 1.1 chopps u_int8_t c_cmd; /* " */
428 1.1 chopps u_int8_t c_link; /* " */
429 1.1 chopps u_int8_t c_paramid;
430 1.1 chopps u_int8_t c_nparam;
431 1.1 chopps u_int8_t c_failcause;
432 1.1 chopps };
433 1.1 chopps
434 1.1 chopps /* RAY_CMD_REPORT_PARAMS */
435 1.1 chopps struct ray_cmd_report {
436 1.1 chopps u_int8_t c_status; /* ccs generic header */
437 1.1 chopps u_int8_t c_cmd; /* " */
438 1.1 chopps u_int8_t c_link; /* " */
439 1.1 chopps u_int8_t c_paramid;
440 1.1 chopps u_int8_t c_nparam;
441 1.1 chopps u_int8_t c_failcause;
442 1.1 chopps u_int8_t c_len;
443 1.1 chopps };
444 1.1 chopps
445 1.1 chopps /* RAY_CMD_UPDATE_MCAST */
446 1.1 chopps struct ray_cmd_update_mcast {
447 1.1 chopps u_int8_t c_status; /* ccs generic header */
448 1.1 chopps u_int8_t c_cmd; /* " */
449 1.1 chopps u_int8_t c_link; /* " */
450 1.1 chopps u_int8_t c_nmcast;
451 1.1 chopps };
452 1.1 chopps
453 1.1 chopps /* RAY_CMD_UPDATE_APM */
454 1.1 chopps struct ray_cmd_udpate_apm {
455 1.1 chopps u_int8_t c_status; /* ccs generic header */
456 1.1 chopps u_int8_t c_cmd; /* " */
457 1.1 chopps u_int8_t c_link; /* " */
458 1.1 chopps u_int8_t c_mode;
459 1.1 chopps };
460 1.1 chopps
461 1.1 chopps /* RAY_CMD_START_NET and RAY_CMD_JOIN_NET */
462 1.1 chopps struct ray_cmd_net {
463 1.1 chopps u_int8_t c_status; /* ccs generic header */
464 1.1 chopps u_int8_t c_cmd; /* " */
465 1.1 chopps u_int8_t c_link; /* " */
466 1.1 chopps u_int8_t c_upd_param;
467 1.1 chopps u_int8_t c_bss_id[ETHER_ADDR_LEN];
468 1.1 chopps u_int8_t c_inited;
469 1.1 chopps u_int8_t c_def_txrate;
470 1.1 chopps u_int8_t c_encrypt;
471 1.1 chopps };
472 1.1 chopps
473 1.1 chopps /* parameters passwd in h2e section when c_upd_param is set in ray_cmd_net */
474 1.1 chopps struct ray_net_params {
475 1.1 chopps u_int8_t p_net_type;
476 1.1 chopps u_int8_t p_ssid[32];
477 1.1 chopps u_int8_t p_privacy_must_start;
478 1.1 chopps u_int8_t p_privacy_can_join;
479 1.1 chopps };
480 1.1 chopps
481 1.1 chopps /* RAY_CMD_UPDATE_ASSOC */
482 1.1 chopps struct ray_cmd_update_assoc {
483 1.1 chopps u_int8_t c_status; /* ccs generic header */
484 1.1 chopps u_int8_t c_cmd; /* " */
485 1.1 chopps u_int8_t c_link; /* " */
486 1.1 chopps u_int8_t c_astatus;
487 1.1 chopps u_int8_t c_aid[2];
488 1.1 chopps };
489 1.1 chopps
490 1.1 chopps /* RAY_CMD_TX_REQ */
491 1.1 chopps struct ray_cmd_tx {
492 1.1 chopps u_int8_t c_status; /* ccs generic header */
493 1.1 chopps u_int8_t c_cmd; /* " */
494 1.1 chopps u_int8_t c_link; /* " */
495 1.1 chopps u_int8_t c_bufp[2];
496 1.1 chopps u_int8_t c_len[2];
497 1.1 chopps u_int8_t c_resv[5];
498 1.1 chopps u_int8_t c_tx_rate;
499 1.1 chopps u_int8_t c_apm_mode;
500 1.1 chopps u_int8_t c_nretry;
501 1.1 chopps u_int8_t c_antenna;
502 1.1 chopps };
503 1.1 chopps
504 1.6 mjl /* RAY_CMD_TX_REQ (for build 4) */
505 1.1 chopps struct ray_cmd_tx_4 {
506 1.1 chopps u_int8_t c_status; /* ccs generic header */
507 1.1 chopps u_int8_t c_cmd; /* " */
508 1.1 chopps u_int8_t c_link; /* " */
509 1.1 chopps u_int8_t c_bufp[2];
510 1.1 chopps u_int8_t c_len[2];
511 1.1 chopps u_int8_t c_addr[ETHER_ADDR_LEN];
512 1.1 chopps u_int8_t c_apm_mode;
513 1.1 chopps u_int8_t c_nretry;
514 1.1 chopps u_int8_t c_antenna;
515 1.1 chopps };
516 1.1 chopps
517 1.1 chopps /* RAY_CMD_DUMP_MEM */
518 1.1 chopps struct ray_cmd_dump_mem {
519 1.1 chopps u_int8_t c_status; /* ccs generic header */
520 1.1 chopps u_int8_t c_cmd; /* " */
521 1.1 chopps u_int8_t c_link; /* " */
522 1.1 chopps u_int8_t c_memtype;
523 1.1 chopps u_int8_t c_memp[2];
524 1.1 chopps u_int8_t c_len;
525 1.1 chopps };
526 1.1 chopps
527 1.1 chopps /* RAY_CMD_START_TIMER */
528 1.1 chopps struct ray_cmd_start_timer {
529 1.1 chopps u_int8_t c_status; /* ccs generic header */
530 1.1 chopps u_int8_t c_cmd; /* " */
531 1.1 chopps u_int8_t c_link; /* " */
532 1.1 chopps u_int8_t c_duration[2];
533 1.1 chopps };
534 1.1 chopps
535 1.1 chopps struct ray_cmd_rx {
536 1.1 chopps u_int8_t c_status; /* ccs generic header */
537 1.1 chopps u_int8_t c_cmd; /* " */
538 1.1 chopps u_int8_t c_link; /* " */
539 1.1 chopps u_int8_t c_bufp[2]; /* buffer pointer */
540 1.1 chopps u_int8_t c_len[2]; /* length */
541 1.1 chopps u_int8_t c_siglev; /* signal level */
542 1.1 chopps u_int8_t c_nextfrag; /* next fragment in packet */
543 1.1 chopps u_int8_t c_pktlen[2]; /* total packet length */
544 1.1 chopps u_int8_t c_antenna; /* antenna with best reception */
545 1.1 chopps u_int8_t c_updbss; /* only 1 for beacon messages */
546 1.1 chopps };
547 1.1 chopps
548 1.1 chopps #define RAY_TX_PHY_SIZE 0x4
549 1.1 chopps
550 1.1 chopps /* this is used by the user to request objects */
551 1.1 chopps struct ray_param_req {
552 1.1 chopps int r_failcause;
553 1.1 chopps u_int8_t r_paramid;
554 1.1 chopps u_int8_t r_len;
555 1.1 chopps u_int8_t r_data[256];
556 1.1 chopps };
557 1.1 chopps #define RAY_FAILCAUSE_EIDRANGE 1
558 1.1 chopps #define RAY_FAILCAUSE_ELENGTH 2
559 1.1 chopps /* device can possibly return up to 255 */
560 1.1 chopps #define RAY_FAILCAUSE_EDEVSTOP 256
561 1.1 chopps
562 1.1 chopps #ifdef _KERNEL
563 1.1 chopps #define RAY_FAILCAUSE_WAITING 257
564 1.1 chopps #endif
565 1.1 chopps
566 1.1 chopps /* get a param the data is a ray_param_request structure */
567 1.1 chopps #define SIOCSRAYPARAM SIOCSIFGENERIC
568 1.1 chopps #define SIOCGRAYPARAM SIOCGIFGENERIC
569 1.1 chopps
570 1.1 chopps #define RAY_PID_STRINGS { \
571 1.1 chopps "RAY_PID_NET_TYPE", \
572 1.1 chopps "RAY_PID_AP_STATUS", \
573 1.1 chopps "RAY_PID_SSID", \
574 1.1 chopps "RAY_PID_SCAN_MODE", \
575 1.1 chopps "RAY_PID_APM_MODE", \
576 1.1 chopps "RAY_PID_MAC_ADDR", \
577 1.1 chopps "RAY_PID_FRAG_THRESH", \
578 1.1 chopps "RAY_PID_DWELL_TIME", \
579 1.1 chopps "RAY_PID_BEACON_PERIOD", \
580 1.1 chopps "RAY_PID_DTIM_INT", \
581 1.1 chopps "RAY_PID_MAX_RETRY", \
582 1.1 chopps "RAY_PID_ACK_TIMO", \
583 1.1 chopps "RAY_PID_SIFS", \
584 1.1 chopps "RAY_PID_DIFS", \
585 1.1 chopps "RAY_PID_PIFS", \
586 1.1 chopps "RAY_PID_RTS_THRESH", \
587 1.1 chopps "RAY_PID_SCAN_DWELL_PERIOD", \
588 1.1 chopps "RAY_PID_MAX_SCAN_DWELL_PERIOD", \
589 1.1 chopps "RAY_PID_ASSOC_TIMO", \
590 1.1 chopps "RAY_PID_ADHOC_SCAN_CYCLE", \
591 1.1 chopps "RAY_PID_INFRA_SCAN_CYCLE", \
592 1.1 chopps "RAY_PID_INFRA_SUPER_SCAN_CYCLE", \
593 1.1 chopps "RAY_PID_PROMISC", \
594 1.1 chopps "RAY_PID_UNIQ_WORD", \
595 1.1 chopps "RAY_PID_SLOT_TIME", \
596 1.1 chopps "RAY_PID_ROAM_LOW_SNR_THRESH", \
597 1.1 chopps "RAY_PID_LOW_SNR_COUNT", \
598 1.1 chopps "RAY_PID_INFRA_MISSED_BEACON_COUNT", \
599 1.1 chopps "RAY_PID_ADHOC_MISSED_BEACON_COUNT", \
600 1.1 chopps "RAY_PID_COUNTRY_CODE", \
601 1.1 chopps "RAY_PID_HOP_SEQ", \
602 1.1 chopps "RAY_PID_HOP_SEQ_LEN", \
603 1.1 chopps "RAY_PID_CW_MAX", \
604 1.1 chopps "RAY_PID_CW_MIN", \
605 1.1 chopps "RAY_PID_NOISE_FILTER_GAIN", \
606 1.1 chopps "RAY_PID_NOISE_LIMIT_OFFSET", \
607 1.1 chopps "RAY_PID_RSSI_THRESH_OFFSET", \
608 1.1 chopps "RAY_PID_BUSY_THRESH_OFFSET", \
609 1.1 chopps "RAY_PID_SYNC_THRESH", \
610 1.1 chopps "RAY_PID_TEST_MODE", \
611 1.1 chopps "RAY_PID_TEST_MIN_CHAN", \
612 1.1 chopps "RAY_PID_TEST_MAX_CHAN", \
613 1.1 chopps "RAY_PID_ALLOW_PROBE_RESP", \
614 1.1 chopps "RAY_PID_PRIVACY_MUST_START", \
615 1.1 chopps "RAY_PID_PRIVACY_CAN_JOIN", \
616 1.1 chopps "RAY_PID_BASIC_RATE_SET" \
617 1.1 chopps }
618 1.2 augustss
619 1.2 augustss #ifdef RAY_DO_SIGLEV
620 1.2 augustss #define SIOCGRAYSIGLEV _IOWR('i', 201, struct ifreq)
621 1.2 augustss
622 1.2 augustss #define RAY_NSIGLEVRECS 8
623 1.2 augustss #define RAY_NSIGLEV 8
624 1.2 augustss
625 1.2 augustss struct ray_siglev {
626 1.2 augustss u_int8_t rsl_host[ETHER_ADDR_LEN]; /* MAC address */
627 1.2 augustss u_int8_t rsl_siglevs[RAY_NSIGLEV]; /* levels, newest in [0] */
628 1.2 augustss struct timeval rsl_time; /* time of last packet */
629 1.2 augustss };
630 1.2 augustss #endif
631