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