]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sys/dev/cnw/if_cnwreg.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sys / dev / cnw / if_cnwreg.h
1 /*      $NetBSD: if_cnwreg.h,v 1.3 2000/07/05 18:42:19 itojun Exp $     */
2 /* $FreeBSD$ */
3
4 /*-
5  * Copyright (c) 1998 The NetBSD Foundation, Inc.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to The NetBSD Foundation
9  * by Michael Eriksson.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. All advertising materials mentioning features or use of this software
20  *    must display the following acknowledgement:
21  *      This product includes software developed by the NetBSD
22  *      Foundation, Inc. and its contributors.
23  * 4. Neither the name of The NetBSD Foundation nor the names of its
24  *    contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGE.
38  */
39
40
41 /* I/O area */
42 #define CNW_IO_SIZE             0x10
43 /* I/O area can be accessed via mapped memory too */
44 #define CNW_IOM_ADDR            0x28000
45 #define CNW_IOM_SIZE            CNW_IO_SIZE
46 #define CNW_IOM_OFF             (CNW_IOM_ADDR - CNW_MEM_ADDR)
47
48 /* I/O registers */
49 #define CNW_REG_COR             0x0
50 #    define CNW_COR_IENA                0x01    /* Interrupt enable */
51 #    define CNW_COR_LVLREQ              0x40    /* Keep high */
52 #define CNW_REG_CCSR            0x2
53 #define CNW_REG_ASR             0x4
54 #    define CNW_ASR_TXBA                0x01    /* Trasmit buffer available */
55 #    define CNW_ASR_WOC                 0x08    /* Write Operation Complete */
56 #    define CNW_ASR_TXDN                0x20    /* Transmit done */
57 #    define CNW_ASR_RXERR               0x40    /* Receive error */
58 #    define CNW_ASR_RXRDY               0x80    /* Packet received */ 
59 #define CNW_REG_IOLOW           0x6
60 #define CNW_REG_IOHI            0x7
61 #define CNW_REG_IOCONTROL       0x8
62 #define CNW_REG_IMR             0xa
63 #    define CNW_IMR_IENA                0x02    /* Interrupt enable */
64 #    define CNW_IMR_RFU1                0x10    /* RFU intr mask, keep high */
65 #define CNW_REG_PMR             0xc
66 #    define CNW_PMR_RESET               0x80
67 #define CNW_REG_DATA            0xf
68
69
70 /* Mapped memory */
71 #define CNW_MEM_ADDR            0x20000
72 #define CNW_MEM_SIZE            0x8000
73
74 /* Extended I/O registers (memory mapped) */
75 #define CNW_EREG_CB             0x100
76 #define CNW_EREG_ASCC           0x114
77 #define CNW_EREG_RSER           0x120
78 #    define CNW_RSER_RXBIG              0x02
79 #    define CNW_RSER_RXCRC              0x04
80 #    define CNW_RSER_RXOVERRUN          0x08
81 #    define CNW_RSER_RXOVERFLOW         0x10
82 #    define CNW_RSER_RXERR              0x40
83 #    define CNW_RSER_RXAVAIL            0x80
84 #define CNW_EREG_RSERW          0x124
85 #define CNW_EREG_TSER           0x130
86 #    define CNW_TSER_RTRY               0x0f
87 #    define CNW_TSER_TXERR              0x10
88 #    define CNW_TSER_TXOK               0x20
89 #    define CNW_TSER_TXNOAP             0x40
90 #    define CNW_TSER_TXGU               0x80
91 #    define CNW_TSER_ERROR              (CNW_TSER_TXERR | CNW_TSER_TXNOAP | \
92                                          CNW_TSER_TXGU)
93 #define CNW_EREG_TSERW          0x134
94 #define CNW_EREG_TDP            0x140
95 #define CNW_EREG_LIF            0x14e
96 #define CNW_EREG_RDP            0x150
97 #define CNW_EREG_SPCQ           0x154
98 #define CNW_EREG_SPU            0x155
99 #define CNW_EREG_ISPLQ          0x156
100 #define CNW_EREG_HHC            0x158
101 #define CNW_EREG_PA             0x160
102 #define CNW_EREG_ARW            0x166
103 #define CNW_EREG_MHS            0x16b
104 #define CNW_EREG_NI             0x16e
105 #define CNW_EREG_CRBP           0x17a
106 #define CNW_EREG_EC             0x180
107 #define CNW_EREG_STAT_RXERR     0x184
108 #define CNW_EREG_STAT_FRAME     0x186
109 #define CNW_EREG_STAT_IBEAT     0x188
110 #define CNW_EREG_STAT_RXBUF     0x18e
111 #define CNW_EREG_STAT_RXMULTI   0x190
112 #define CNW_EREG_STAT_TXRETRY   0x192
113 #define CNW_EREG_STAT_TXABORT   0x194
114 #define CNW_EREG_STAT_OBEAT     0x198
115 #define CNW_EREG_STAT_TXOK      0x19a
116 #define CNW_EREG_STAT_TXSENT    0x19c
117
118 /*
119  * Commands used in the extended command buffer
120  * CNW_EREG_CB (0x100-0x10f) 
121  */
122 #define CNW_CMD_NOP             0x00
123 #define CNW_CMD_SRC             0x01
124 #    define CNW_RXCONF_RXENA            0x80    /* Receive Enable */
125 #    define CNW_RXCONF_MAC              0x20    /* MAC host receive mode */
126 #    define CNW_RXCONF_PRO              0x10    /* Promiscuous */
127 #    define CNW_RXCONF_AMP              0x08    /* Accept Multicast Packets */
128 #    define CNW_RXCONF_BCAST            0x04    /* Accept Broadcast Packets */
129 #define CNW_CMD_STC             0x02
130 #    define CNW_TXCONF_TXENA            0x80    /* Transmit Enable */
131 #    define CNW_TXCONF_MAC              0x20    /* Host sends MAC mode */
132 #    define CNW_TXCONF_EUD              0x10    /* Enable Uni-Data packets */
133 #    define CNW_TXCONF_KEY              0x02    /* Scramble data packets */
134 #    define CNW_TXCONF_LOOP             0x01    /* Loopback mode */
135 #define CNW_CMD_AMA             0x03
136 #define CNW_CMD_DMA             0x04
137 #define CNW_CMD_SAMA            0x05
138 #define CNW_CMD_ER              0x06
139 #define CNW_CMD_DR              0x07
140 #define CNW_CMD_TL              0x08
141 #define CNW_CMD_SRP             0x09
142 #define CNW_CMD_SSK             0x0a
143 #define CNW_CMD_SMD             0x0b
144 #define CNW_CMD_SAPD            0x0c
145 #define CNW_CMD_SSS             0x11
146 #define CNW_CMD_EOC             0x00            /* End-of-command marker */
147