1 /*        $NetBSD: if_malo_pcmciareg.h,v 1.1 2012/08/25 08:20:03 kiyohara Exp $ */
2 /*        $OpenBSD: if_maloreg.h,v 1.15 2007/10/08 22:08:12 mglocker Exp $ */
3 
4 /*
5  * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* registers */
21 #define MALO_REG_HOST_STATUS            0x00
22 #define MALO_REG_CARD_INTR_CAUSE        0x02
23 #define MALO_REG_HOST_INTR_MASK                   0x04
24 #define MALO_REG_DATA_READ              0x10
25 #define MALO_REG_CMD_READ               0x12
26 #define MALO_REG_DATA_WRITE_LEN                   0x14
27 #define MALO_REG_DATA_WRITE             0x16
28 #define MALO_REG_CMD_WRITE_LEN                    0x18
29 #define MALO_REG_CMD_WRITE              0x1a
30 #define MALO_REG_CARD_STATUS            0x20
31 #define MALO_REG_HOST_INTR_CAUSE        0x22
32 #define MALO_REG_DATA_READ_LEN                    0x24
33 #define MALO_REG_RBAL                             0x28
34 #define MALO_REG_CMD_READ_LEN           0x30
35 #define MALO_REG_SCRATCH                0x3f
36 #define MALO_REG_CARD_INTR_MASK                   0x44
37 
38 /* register values */
39 #define MALO_VAL_SCRATCH_READY                    0x00
40 #define MALO_VAL_TX_DL_OVER             0x01
41 #define MALO_VAL_RX_DL_OVER             0x02
42 #define MALO_VAL_CMD_DL_OVER            0x04
43 #define MALO_VAL_SCRATCH_FW_LOADED      0x5a
44 #define MALO_VAL_HOST_INTR_MASK_ON      0x001f
45 #define MALO_VAL_CARD_STATUS_MASK       0x7f00
46 
47 /* interrupt reasons */
48 #define MALO_VAL_HOST_INTR_TX           (1 << 0)
49 #define MALO_VAL_HOST_INTR_RX           (1 << 1)
50 #define MALO_VAL_HOST_INTR_CMD                    (1 << 3)
51 #define MALO_VAL_HOST_INTR_EVENT        (1 << 4)
52 
53 /* FW commands */
54 #define MALO_CMD_RESP                             0x8000
55 #define MALO_CMD_HWSPEC                           0x0003
56 #define MALO_CMD_RESET                            0x0005
57 #define MALO_CMD_SCAN                             0x0006
58 #define MALO_CMD_AUTH                             0x0011
59 #define MALO_CMD_WEP                              0x0013
60 #define MALO_CMD_SNMP                             0x0016
61 #define MALO_CMD_RADIO                            0x001c
62 #define MALO_CMD_CHANNEL                0x001d
63 #define MALO_CMD_TXPOWER                0x001e
64 #define MALO_CMD_ANTENNA                0x0020
65 #define MALO_CMD_MACCTRL                0x0028
66 #define MALO_CMD_MACADDR                0x004d
67 #define MALO_CMD_ASSOC                            0x0050
68 #define MALO_CMD_80211D                           0x005b
69 #define MALO_CMD_BGSCAN_CONFIG                    0x006b
70 #define MALO_CMD_BGSCAN_QUERY           0x006c
71 #define MALO_CMD_RATE                             0x0076
72 
73 /* FW command values */
74 #define MALO_CMD_RADIO_OFF              0x0000
75 #define MALO_CMD_RADIO_ON               0x0001
76 #define MALO_CMD_RADIO_LONG_P           0x0000
77 #define MALO_CMD_RADIO_SHORT_P                    0x0002
78 #define MALO_CMD_RADIO_AUTO_P           0x0004
79 #define MALO_CMD_MACCTRL_RX_ON                    0x0001
80 #define MALO_CMD_MACCTRL_TX_ON                    0x0002
81 #define MALO_CMD_MACCTRL_PROMISC_ON     0x0080
82 
83 /* events */
84 #define MALO_EVENT_DEAUTH               0x0008
85 #define MALO_EVENT_DISASSOC             0x0009
86