maloreg.h revision 1.1 1 1.1 degroote /* $NetBSD: maloreg.h,v 1.1 2012/07/30 18:57:19 degroote Exp $ */
2 1.1 degroote /* $OpenBSD: if_maloreg.h,v 1.15 2007/10/08 22:08:12 mglocker Exp $ */
3 1.1 degroote
4 1.1 degroote /*
5 1.1 degroote * Copyright (c) 2007 Marcus Glocker <mglocker (at) openbsd.org>
6 1.1 degroote *
7 1.1 degroote * Permission to use, copy, modify, and distribute this software for any
8 1.1 degroote * purpose with or without fee is hereby granted, provided that the above
9 1.1 degroote * copyright notice and this permission notice appear in all copies.
10 1.1 degroote *
11 1.1 degroote * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 1.1 degroote * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 1.1 degroote * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 1.1 degroote * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 1.1 degroote * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 1.1 degroote * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 1.1 degroote * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 1.1 degroote */
19 1.1 degroote
20 1.1 degroote #define MALO_REG_INT_CODE 0x00000C14
21 1.1 degroote /* From host to ARM */
22 1.1 degroote #define MALO_REG_H2A_INTERRUPT_EVENTS 0x00000C18
23 1.1 degroote
24 1.1 degroote /* bit definitions for MALO_REG_H2A_INTERRUPT_CAUSE */
25 1.1 degroote #define MALO_H2ARIC_BIT_PPA_READY 0x00000001
26 1.1 degroote #define MALO_H2ARIC_BIT_DOOR_BELL 0x00000002 /* bit 1 */
27 1.1 degroote #define MALO_H2ARIC_BIT_PS 0x00000004
28 1.1 degroote #define MALO_H2ARIC_BIT_PSPOLL 0x00000008 /* bit 3 */
29 1.1 degroote
30 1.1 degroote /* From ARM to host */
31 1.1 degroote #define MALO_REG_A2H_INTERRUPT_CAUSE 0x00000C30
32 1.1 degroote #define MALO_REG_A2H_INTERRUPT_MASK 0x00000C34
33 1.1 degroote #define MALO_REG_A2H_INTERRUPT_CLEAR_SEL 0x00000C38
34 1.1 degroote #define MALO_REG_A2H_INTERRUPT_STATUS_MASK 0x00000C3C
35 1.1 degroote
36 1.1 degroote /* bit definitions for MALO_REG_A2H_INTERRUPT_CAUSE */
37 1.1 degroote #define MALO_A2HRIC_BIT_TX_DONE 0x00000001 /* bit 0 */
38 1.1 degroote #define MALO_A2HRIC_BIT_RX_RDY 0x00000002 /* bit 1 */
39 1.1 degroote #define MALO_A2HRIC_BIT_OPC_DONE 0x00000004
40 1.1 degroote #define MALO_A2HRIC_BIT_MAC_EVENT 0x00000008
41 1.1 degroote #define MALO_A2HRIC_BIT_RX_PROBLEM 0x00000010
42 1.1 degroote #define MALO_A2HRIC_BIT_RADIO_OFF 0x00000020 /* bit 5 */
43 1.1 degroote #define MALO_A2HRIC_BIT_RADIO_ON 0x00000040
44 1.1 degroote #define MALO_A2HRIC_BIT_RADAR_DETECT 0x00000080
45 1.1 degroote #define MALO_A2HRIC_BIT_ICV_ERROR 0x00000100
46 1.1 degroote #define MALO_A2HRIC_BIT_MIC_ERROR 0x00000200 /* bit 9 */
47 1.1 degroote #define MALO_A2HRIC_BIT_QUEUE_EMPTY 0x00000400
48 1.1 degroote #define MALO_A2HRIC_BIT_QUEUE_FULL 0x00000800
49 1.1 degroote #define MALO_A2HRIC_BIT_CHAN_SWITCH 0x00001000
50 1.1 degroote #define MALO_A2HRIC_BIT_TX_WATCHDOG 0x00002000
51 1.1 degroote #define MALO_A2HRIC_BIT_BA_WATCHDOG 0x00004000
52 1.1 degroote
53 1.1 degroote #define MALO_ISR_SRC_BITS \
54 1.1 degroote (MALO_A2HRIC_BIT_RX_RDY | \
55 1.1 degroote MALO_A2HRIC_BIT_TX_DONE | \
56 1.1 degroote MALO_A2HRIC_BIT_OPC_DONE | \
57 1.1 degroote MALO_A2HRIC_BIT_MAC_EVENT | \
58 1.1 degroote MALO_A2HRIC_BIT_MIC_ERROR | \
59 1.1 degroote MALO_A2HRIC_BIT_ICV_ERROR | \
60 1.1 degroote MALO_A2HRIC_BIT_RADAR_DETECT | \
61 1.1 degroote MALO_A2HRIC_BIT_CHAN_SWITCH | \
62 1.1 degroote MALO_A2HRIC_BIT_TX_WATCHDOG | \
63 1.1 degroote MALO_A2HRIC_BIT_QUEUE_EMPTY)
64 1.1 degroote #define MALO_ISR_RESET (1<<15)
65 1.1 degroote
66 1.1 degroote #define MALO_A2HRIC_BIT_MASK MALO_ISR_SRC_BITS
67 1.1 degroote
68 1.1 degroote /* map to 0x80000000 on BAR1 */
69 1.1 degroote #define MALO_REG_GEN_PTR 0x00000C10
70 1.1 degroote #define MALO_REG_INT_CODE 0x00000C14
71 1.1 degroote #define MALO_REG_SCRATCH 0x00000C40
72 1.1 degroote
73 1.1 degroote /*
74 1.1 degroote * define OpMode for SoftAP/Station mode
75 1.1 degroote *
76 1.1 degroote * the following mode signature has to be written to PCI scratch register#0
77 1.1 degroote * right after successfully downloading the last block of firmware and
78 1.1 degroote * before waiting for firmware ready signature
79 1.1 degroote */
80 1.1 degroote #define MALO_HOSTCMD_STA_MODE 0x5A
81 1.1 degroote #define MALO_HOSTCMD_STA_FWRDY_SIGNATURE 0xF0F1F2F4
82 1.1 degroote
83 1.1 degroote /*
84 1.1 degroote * 16 bit host command code
85 1.1 degroote */
86 1.1 degroote #define MALO_HOSTCMD_NONE 0x0000
87 1.1 degroote #define MALO_HOSTCMD_CODE_DNLD 0x0001
88 1.1 degroote #define MALO_HOSTCMD_GET_HW_SPEC 0x0003
89 1.1 degroote #define MALO_HOSTCMD_SET_HW_SPEC 0x0004
90 1.1 degroote #define MALO_HOSTCMD_MAC_MULTICAST_ADR 0x0010
91 1.1 degroote #define MALO_HOSTCMD_SET_WEPKEY 0x0013
92 1.1 degroote #define MALO_HOSTCMD_802_11_RADIO_CONTROL 0x001c
93 1.1 degroote #define MALO_HOSTCMD_802_11_RF_TX_POWER 0x001e
94 1.1 degroote #define MALO_HOSTCMD_802_11_RF_ANTENNA 0x0020
95 1.1 degroote #define MALO_HOSTCMD_SET_PRE_SCAN 0x0107
96 1.1 degroote #define MALO_HOSTCMD_SET_POST_SCAN 0x0108
97 1.1 degroote #define MALO_HOSTCMD_SET_RF_CHANNEL 0x010a
98 1.1 degroote #define MALO_HOSTCMD_SET_AID 0x010d
99 1.1 degroote #define MALO_HOSTCMD_SET_RATE 0x0110
100 1.1 degroote #define MALO_HOSTCMD_SET_SLOT 0x0114
101 1.1 degroote /* define DFS lab commands */
102 1.1 degroote #define MALO_HOSTCMD_SET_FIXED_RATE 0x0126
103 1.1 degroote #define MALO_HOSTCMD_SET_REGION_POWER 0x0128
104 1.1 degroote #define MALO_HOSTCMD_GET_CALTABLE 0x1134
105 1.1 degroote
106 1.1 degroote /*
107 1.1 degroote * definition of action or option for each command.
108 1.1 degroote */
109 1.1 degroote /* define general purpose action */
110 1.1 degroote #define MALO_HOSTCMD_ACT_GEN_GET 0x0000
111 1.1 degroote #define MALO_HOSTCMD_ACT_GEN_SET 0x0001
112 1.1 degroote #define MALO_HOSTCMD_ACT_GEN_SET_LIST 0x0002
113 1.1 degroote
114 1.1 degroote /* define action or option for HostCmd_FW_USE_FIXED_RATE */
115 1.1 degroote #define MALO_HOSTCMD_ACT_USE_FIXED_RATE 0x0001
116 1.1 degroote #define MALO_HOSTCMD_ACT_NOT_USE_FIXED_RATE 0x0002
117 1.1 degroote
118 1.1 degroote /* INT code register event definition */
119 1.1 degroote #define MALO_INT_CODE_CMD_FINISHED 0x00000005
120