Home | History | Annotate | Line # | Download | only in ic
dp8390reg.h revision 1.4.12.1
      1  1.4.12.1   bouyer /*	$NetBSD: dp8390reg.h,v 1.4.12.1 2000/11/20 11:40:30 bouyer Exp $	*/
      2       1.1  mycroft 
      3       1.1  mycroft /*
      4       1.1  mycroft  * National Semiconductor DS8390 NIC register definitions.
      5       1.1  mycroft  *
      6       1.1  mycroft  * Copyright (C) 1993, David Greenman.  This software may be used, modified,
      7       1.1  mycroft  * copied, distributed, and sold, in both source and binary form provided that
      8       1.1  mycroft  * the above copyright and these terms are retained.  Under no circumstances is
      9       1.1  mycroft  * the author responsible for the proper functioning of this software, nor does
     10       1.1  mycroft  * the author assume any responsibility for damages incurred with its use.
     11       1.1  mycroft  */
     12       1.1  mycroft 
     13       1.1  mycroft /*
     14       1.1  mycroft  * Page 0 register offsets
     15       1.1  mycroft  */
     16       1.1  mycroft #define ED_P0_CR	0x00	/* Command Register */
     17       1.1  mycroft 
     18       1.1  mycroft #define ED_P0_CLDA0	0x01	/* Current Local DMA Addr low (read) */
     19       1.1  mycroft #define ED_P0_PSTART	0x01	/* Page Start register (write) */
     20       1.1  mycroft 
     21       1.1  mycroft #define ED_P0_CLDA1	0x02	/* Current Local DMA Addr high (read) */
     22       1.1  mycroft #define ED_P0_PSTOP	0x02	/* Page Stop register (write) */
     23       1.1  mycroft 
     24       1.1  mycroft #define ED_P0_BNRY	0x03	/* Boundary Pointer */
     25       1.1  mycroft 
     26       1.1  mycroft #define ED_P0_TSR	0x04	/* Transmit Status Register (read) */
     27       1.1  mycroft #define ED_P0_TPSR	0x04	/* Transmit Page Start (write) */
     28       1.1  mycroft 
     29       1.1  mycroft #define ED_P0_NCR	0x05	/* Number of Collisions Reg (read) */
     30       1.1  mycroft #define ED_P0_TBCR0	0x05	/* Transmit Byte count, low (write) */
     31       1.1  mycroft 
     32       1.1  mycroft #define ED_P0_FIFO	0x06	/* FIFO register (read) */
     33       1.1  mycroft #define ED_P0_TBCR1	0x06	/* Transmit Byte count, high (write) */
     34       1.1  mycroft 
     35       1.1  mycroft #define ED_P0_ISR	0x07	/* Interrupt Status Register */
     36       1.1  mycroft 
     37       1.1  mycroft #define ED_P0_CRDA0	0x08	/* Current Remote DMA Addr low (read) */
     38       1.1  mycroft #define ED_P0_RSAR0	0x08	/* Remote Start Address low (write) */
     39       1.1  mycroft 
     40       1.1  mycroft #define ED_P0_CRDA1	0x09	/* Current Remote DMA Addr high (read) */
     41       1.1  mycroft #define ED_P0_RSAR1	0x09	/* Remote Start Address high (write) */
     42       1.1  mycroft 
     43       1.1  mycroft #define ED_P0_RBCR0	0x0a	/* Remote Byte Count low (write) */
     44       1.1  mycroft 
     45       1.1  mycroft #define ED_P0_RBCR1	0x0b	/* Remote Byte Count high (write) */
     46       1.1  mycroft 
     47       1.1  mycroft #define ED_P0_RSR	0x0c	/* Receive Status (read) */
     48       1.1  mycroft #define ED_P0_RCR	0x0c	/* Receive Configuration Reg (write) */
     49       1.1  mycroft 
     50       1.1  mycroft #define ED_P0_CNTR0	0x0d	/* frame alignment error counter (read) */
     51       1.1  mycroft #define ED_P0_TCR	0x0d	/* Transmit Configuration Reg (write) */
     52       1.1  mycroft 
     53       1.1  mycroft #define ED_P0_CNTR1	0x0e	/* CRC error counter (read) */
     54       1.1  mycroft #define ED_P0_DCR	0x0e	/* Data Configuration Reg (write) */
     55       1.1  mycroft 
     56       1.1  mycroft #define ED_P0_CNTR2	0x0f	/* missed packet counter (read) */
     57       1.1  mycroft #define ED_P0_IMR	0x0f	/* Interrupt Mask Register (write) */
     58       1.1  mycroft 
     59       1.1  mycroft /*
     60       1.1  mycroft  * Page 1 register offsets
     61       1.1  mycroft  */
     62       1.1  mycroft #define ED_P1_CR	0x00	/* Command Register */
     63       1.1  mycroft #define ED_P1_PAR0	0x01	/* Physical Address Register 0 */
     64       1.1  mycroft #define ED_P1_PAR1	0x02	/* Physical Address Register 1 */
     65       1.1  mycroft #define ED_P1_PAR2	0x03	/* Physical Address Register 2 */
     66       1.1  mycroft #define ED_P1_PAR3	0x04	/* Physical Address Register 3 */
     67       1.1  mycroft #define ED_P1_PAR4	0x05	/* Physical Address Register 4 */
     68       1.1  mycroft #define ED_P1_PAR5	0x06	/* Physical Address Register 5 */
     69       1.1  mycroft #define ED_P1_CURR	0x07	/* Current RX ring-buffer page */
     70       1.1  mycroft #define ED_P1_MAR0	0x08	/* Multicast Address Register 0 */
     71       1.1  mycroft #define ED_P1_MAR1	0x09	/* Multicast Address Register 1 */
     72       1.1  mycroft #define ED_P1_MAR2	0x0a	/* Multicast Address Register 2 */
     73       1.1  mycroft #define ED_P1_MAR3	0x0b	/* Multicast Address Register 3 */
     74       1.1  mycroft #define ED_P1_MAR4	0x0c	/* Multicast Address Register 4 */
     75       1.1  mycroft #define ED_P1_MAR5	0x0d	/* Multicast Address Register 5 */
     76       1.1  mycroft #define ED_P1_MAR6	0x0e	/* Multicast Address Register 6 */
     77       1.1  mycroft #define ED_P1_MAR7	0x0f	/* Multicast Address Register 7 */
     78       1.1  mycroft 
     79       1.1  mycroft /*
     80       1.1  mycroft  * Page 2 register offsets
     81       1.1  mycroft  */
     82       1.1  mycroft #define ED_P2_CR	0x00	/* Command Register */
     83       1.1  mycroft #define ED_P2_PSTART	0x01	/* Page Start (read) */
     84       1.1  mycroft #define ED_P2_CLDA0	0x01	/* Current Local DMA Addr 0 (write) */
     85       1.1  mycroft #define ED_P2_PSTOP	0x02	/* Page Stop (read) */
     86       1.1  mycroft #define ED_P2_CLDA1	0x02	/* Current Local DMA Addr 1 (write) */
     87       1.1  mycroft #define ED_P2_RNPP	0x03	/* Remote Next Packet Pointer */
     88       1.1  mycroft #define ED_P2_TPSR	0x04	/* Transmit Page Start (read) */
     89       1.1  mycroft #define ED_P2_LNPP	0x05	/* Local Next Packet Pointer */
     90       1.1  mycroft #define ED_P2_ACU	0x06	/* Address Counter Upper */
     91       1.1  mycroft #define ED_P2_ACL	0x07	/* Address Counter Lower */
     92       1.1  mycroft #define ED_P2_RCR	0x0c	/* Receive Configuration Register (read) */
     93       1.1  mycroft #define ED_P2_TCR	0x0d	/* Transmit Configuration Register (read) */
     94       1.1  mycroft #define ED_P2_DCR	0x0e	/* Data Configuration Register (read) */
     95       1.1  mycroft #define ED_P2_IMR	0x0f	/* Interrupt Mask Register (read) */
     96       1.1  mycroft 
     97       1.1  mycroft /*
     98       1.1  mycroft  *		Command Register (CR) definitions
     99       1.1  mycroft  */
    100       1.1  mycroft 
    101       1.1  mycroft /*
    102       1.1  mycroft  * STP: SToP.  Software reset command.  Takes the controller offline.  No
    103       1.1  mycroft  * packets will be received or transmitted.  Any reception or transmission in
    104       1.1  mycroft  * progress will continue to completion before entering reset state.  To exit
    105       1.1  mycroft  * this state, the STP bit must reset and the STA bit must be set.  The
    106       1.1  mycroft  * software reset has executed only when indicated by the RST bit in the ISR
    107       1.1  mycroft  * being set.
    108       1.1  mycroft  */
    109       1.1  mycroft #define ED_CR_STP	0x01
    110       1.1  mycroft 
    111       1.1  mycroft /*
    112       1.1  mycroft  * STA: STArt.  This bit is used to activate the NIC after either power-up, or
    113       1.1  mycroft  * when the NIC has been put in reset mode by software command or error.
    114       1.1  mycroft  */
    115       1.1  mycroft #define ED_CR_STA	0x02
    116       1.1  mycroft 
    117       1.1  mycroft /*
    118       1.1  mycroft  * TXP: Transmit Packet.  This bit must be set to indicate transmission of a
    119       1.1  mycroft  * packet.  TXP is internally reset either after the transmission is completed
    120       1.1  mycroft  * or aborted.  This bit should be set only after the Transmit Byte Count and
    121       1.1  mycroft  * Transmit Page Start register have been programmed.
    122       1.1  mycroft  */
    123       1.1  mycroft #define ED_CR_TXP	0x04
    124       1.1  mycroft 
    125       1.1  mycroft /*
    126       1.1  mycroft  * RD0, RD1, RD2: Remote DMA Command.  These three bits control the operation
    127       1.1  mycroft  * of the remote DMA channel.  RD2 can be set to abort any remote DMA command
    128       1.1  mycroft  * in progress.  The Remote Byte Count registers should be cleared when a
    129       1.1  mycroft  * remote DMA has been aborted.  The Remote Start Addresses are not restored
    130       1.1  mycroft  * to the starting address if the remote DMA is aborted.
    131       1.1  mycroft  *
    132       1.1  mycroft  * RD2 RD1 RD0	function
    133       1.1  mycroft  *  0   0   0	not allowed
    134       1.1  mycroft  *  0   0   1	remote read
    135       1.1  mycroft  *  0   1   0	remote write
    136       1.1  mycroft  *  0   1   1	send packet
    137       1.1  mycroft  *  1   X   X	abort
    138       1.1  mycroft  */
    139       1.1  mycroft #define ED_CR_RD0	0x08
    140       1.1  mycroft #define ED_CR_RD1	0x10
    141       1.1  mycroft #define ED_CR_RD2	0x20
    142       1.1  mycroft 
    143       1.1  mycroft /*
    144       1.1  mycroft  * PS0, PS1: Page Select.  The two bits select which register set or 'page' to
    145       1.1  mycroft  * access.
    146       1.1  mycroft  *
    147       1.1  mycroft  * PS1 PS0  page
    148       1.1  mycroft  *  0   0   0
    149       1.1  mycroft  *  0   1   1
    150       1.1  mycroft  *  1   0   2
    151       1.4  thorpej  *  1   1   3 (only on chips which have extensions to the dp8390)
    152       1.1  mycroft  */
    153       1.1  mycroft #define ED_CR_PS0	0x40
    154       1.1  mycroft #define ED_CR_PS1	0x80
    155       1.1  mycroft /* bit encoded aliases */
    156       1.1  mycroft #define ED_CR_PAGE_0	0x00 /* (for consistency) */
    157       1.4  thorpej #define ED_CR_PAGE_1	(ED_CR_PS0)
    158       1.4  thorpej #define ED_CR_PAGE_2	(ED_CR_PS1)
    159       1.4  thorpej #define	ED_CR_PAGE_3	(ED_CR_PS1|ED_CR_PS0)
    160       1.1  mycroft 
    161       1.1  mycroft /*
    162       1.1  mycroft  *		Interrupt Status Register (ISR) definitions
    163       1.1  mycroft  */
    164       1.1  mycroft 
    165       1.1  mycroft /*
    166       1.1  mycroft  * PRX: Packet Received.  Indicates packet received with no errors.
    167       1.1  mycroft  */
    168       1.1  mycroft #define ED_ISR_PRX	0x01
    169       1.1  mycroft 
    170       1.1  mycroft /*
    171       1.1  mycroft  * PTX: Packet Transmitted.  Indicates packet transmitted with no errors.
    172       1.1  mycroft  */
    173       1.1  mycroft #define ED_ISR_PTX	0x02
    174       1.1  mycroft 
    175       1.1  mycroft /*
    176       1.1  mycroft  * RXE: Receive Error.  Indicates that a packet was received with one or more
    177       1.1  mycroft  * the following errors: CRC error, frame alignment error, FIFO overrun,
    178       1.1  mycroft  * missed packet.
    179       1.1  mycroft  */
    180       1.1  mycroft #define ED_ISR_RXE	0x04
    181       1.1  mycroft 
    182       1.1  mycroft /*
    183       1.1  mycroft  * TXE: Transmission Error.  Indicates that an attempt to transmit a packet
    184       1.1  mycroft  * resulted in one or more of the following errors: excessive collisions, FIFO
    185       1.1  mycroft  * underrun.
    186       1.1  mycroft  */
    187       1.1  mycroft #define ED_ISR_TXE	0x08
    188       1.1  mycroft 
    189       1.1  mycroft /*
    190       1.1  mycroft  * OVW: OverWrite.  Indicates a receive ring-buffer overrun.  Incoming network
    191       1.1  mycroft  * would exceed (has exceeded?) the boundary pointer, resulting in data that
    192       1.1  mycroft  * was previously received and not yet read from the buffer to be overwritten.
    193       1.1  mycroft  */
    194       1.1  mycroft #define ED_ISR_OVW	0x10
    195       1.1  mycroft 
    196       1.1  mycroft /*
    197       1.1  mycroft  * CNT: Counter Overflow.  Set when the MSB of one or more of the Network Tally
    198       1.1  mycroft  * Counters has been set.
    199       1.1  mycroft  */
    200       1.1  mycroft #define ED_ISR_CNT	0x20
    201       1.1  mycroft 
    202       1.1  mycroft /*
    203       1.1  mycroft  * RDC: Remote Data Complete.  Indicates that a Remote DMA operation has
    204       1.1  mycroft  * completed.
    205       1.1  mycroft  */
    206       1.1  mycroft #define ED_ISR_RDC	0x40
    207       1.1  mycroft 
    208       1.1  mycroft /*
    209       1.1  mycroft  * RST: Reset status.  Set when the NIC enters the reset state and cleared when
    210       1.1  mycroft  * a Start Command is issued to the CR.  This bit is also set when a receive
    211       1.1  mycroft  * ring-buffer overrun (OverWrite) occurs and is cleared when one or more
    212       1.1  mycroft  * packets have been removed from the ring.  This is a read-only bit.
    213       1.1  mycroft  */
    214       1.1  mycroft #define ED_ISR_RST	0x80
    215       1.1  mycroft 
    216       1.1  mycroft /*
    217       1.1  mycroft  *		Interrupt Mask Register (IMR) definitions
    218       1.1  mycroft  */
    219       1.1  mycroft 
    220       1.1  mycroft /*
    221       1.1  mycroft  * PRXE: Packet Received interrupt Enable.  If set, a received packet will
    222       1.1  mycroft  * cause an interrupt.
    223       1.1  mycroft  */
    224       1.1  mycroft #define ED_IMR_PRXE	0x01
    225       1.1  mycroft 
    226       1.1  mycroft /*
    227       1.1  mycroft  * PTXE: Packet Transmit interrupt Enable.  If set, an interrupt is generated
    228       1.1  mycroft  * when a packet transmission completes.
    229       1.1  mycroft  */
    230       1.1  mycroft #define ED_IMR_PTXE	0x02
    231       1.1  mycroft 
    232       1.1  mycroft /*
    233       1.1  mycroft  * RXEE: Receive Error interrupt Enable.  If set, an interrupt will occur
    234       1.1  mycroft  * whenever a packet is received with an error.
    235       1.1  mycroft  */
    236       1.1  mycroft #define ED_IMR_RXEE 	0x04
    237       1.1  mycroft 
    238       1.1  mycroft /*
    239       1.1  mycroft  * TXEE: Transmit Error interrupt Enable.  If set, an interrupt will occur
    240       1.1  mycroft  * whenever a transmission results in an error.
    241       1.1  mycroft  */
    242       1.1  mycroft #define ED_IMR_TXEE	0x08
    243       1.1  mycroft 
    244       1.1  mycroft /*
    245       1.1  mycroft  * OVWE: OverWrite error interrupt Enable.  If set, an interrupt is generated
    246       1.1  mycroft  * whenever the receive ring-buffer is overrun.  i.e. when the boundary pointer
    247       1.1  mycroft  * is exceeded.
    248       1.1  mycroft  */
    249       1.1  mycroft #define ED_IMR_OVWE	0x10
    250       1.1  mycroft 
    251       1.1  mycroft /*
    252       1.1  mycroft  * CNTE: Counter overflow interrupt Enable.  If set, an interrupt is generated
    253       1.1  mycroft  * whenever the MSB of one or more of the Network Statistics counters has been
    254       1.1  mycroft  * set.
    255       1.1  mycroft  */
    256       1.1  mycroft #define ED_IMR_CNTE	0x20
    257       1.1  mycroft 
    258       1.1  mycroft /*
    259       1.1  mycroft  * RDCE: Remote DMA Complete interrupt Enable.  If set, an interrupt is
    260       1.1  mycroft  * generated when a remote DMA transfer has completed.
    261       1.1  mycroft  */
    262       1.1  mycroft #define ED_IMR_RDCE	0x40
    263       1.1  mycroft 
    264       1.1  mycroft /*
    265       1.1  mycroft  * Bit 7 is unused/reserved.
    266       1.1  mycroft  */
    267       1.1  mycroft 
    268       1.1  mycroft /*
    269       1.1  mycroft  *		Data Configuration Register (DCR) definitions
    270       1.1  mycroft  */
    271       1.1  mycroft 
    272       1.1  mycroft /*
    273       1.1  mycroft  * WTS: Word Transfer Select.  WTS establishes byte or word transfers for both
    274       1.1  mycroft  * remote and local DMA transfers
    275       1.1  mycroft  */
    276       1.1  mycroft #define ED_DCR_WTS	0x01
    277       1.1  mycroft 
    278       1.1  mycroft /*
    279       1.1  mycroft  * BOS: Byte Order Select.  BOS sets the byte order for the host.  Should be 0
    280       1.1  mycroft  * for 80x86, and 1 for 68000 series processors
    281       1.1  mycroft  */
    282       1.1  mycroft #define ED_DCR_BOS	0x02
    283       1.1  mycroft 
    284       1.1  mycroft /*
    285       1.1  mycroft  * LAS: Long Address Select.  When LAS is 1, the contents of the remote DMA
    286       1.1  mycroft  * registers RSAR0 and RSAR1 are used to provide A16-A31.
    287       1.1  mycroft  */
    288       1.1  mycroft #define ED_DCR_LAS	0x04
    289       1.1  mycroft 
    290       1.1  mycroft /*
    291       1.1  mycroft  * LS: Loopback Select.  When 0, loopback mode is selected.  Bits D1 and D2 of
    292       1.1  mycroft  * the TCR must also be programmed for loopback operation.  When 1, normal
    293       1.1  mycroft  * operation is selected.
    294       1.1  mycroft  */
    295       1.1  mycroft #define ED_DCR_LS	0x08
    296       1.1  mycroft 
    297       1.1  mycroft /*
    298       1.1  mycroft  * AR: Auto-initialize Remote.  When 0, data must be removed from ring-buffer
    299       1.1  mycroft  * under program control.  When 1, remote DMA is automatically initiated and
    300       1.1  mycroft  * the boundary pointer is automatically updated.
    301       1.1  mycroft  */
    302       1.1  mycroft #define ED_DCR_AR	0x10
    303       1.1  mycroft 
    304       1.1  mycroft /*
    305       1.1  mycroft  * FT0, FT1: Fifo Threshold select.
    306       1.1  mycroft  *
    307       1.1  mycroft  * FT1 FT0  Word-width  Byte-width
    308       1.1  mycroft  *  0   0   1 word      2 bytes
    309       1.1  mycroft  *  0   1   2 words     4 bytes
    310       1.1  mycroft  *  1   0   4 words     8 bytes
    311       1.1  mycroft  *  1   1   8 words     12 bytes
    312       1.1  mycroft  *
    313       1.1  mycroft  * During transmission, the FIFO threshold indicates the number of bytes or
    314       1.1  mycroft  * words that the FIFO has filled from the local DMA before BREQ is asserted.
    315       1.1  mycroft  * The transmission threshold is 16 bytes minus the receiver threshold.
    316       1.1  mycroft  */
    317       1.1  mycroft #define ED_DCR_FT0	0x20
    318       1.1  mycroft #define ED_DCR_FT1	0x40
    319       1.1  mycroft 
    320       1.1  mycroft /*
    321       1.1  mycroft  * bit 7 (0x80) is unused/reserved
    322       1.1  mycroft  */
    323       1.1  mycroft 
    324       1.1  mycroft /*
    325       1.1  mycroft  *		Transmit Configuration Register (TCR) definitions
    326       1.1  mycroft  */
    327       1.1  mycroft 
    328       1.1  mycroft /*
    329       1.1  mycroft  * CRC: Inhibit CRC.  If 0, CRC will be appended by the transmitter, if 0, CRC
    330       1.1  mycroft  * is not appended by the transmitter.
    331       1.1  mycroft  */
    332       1.1  mycroft #define ED_TCR_CRC	0x01
    333       1.1  mycroft 
    334       1.1  mycroft /*
    335       1.1  mycroft  * LB0, LB1: Loopback control.  These two bits set the type of loopback that is
    336       1.1  mycroft  * to be performed.
    337       1.1  mycroft  *
    338       1.1  mycroft  * LB1 LB0		mode
    339       1.1  mycroft  *  0   0		0 - normal operation (DCR_LS = 0)
    340       1.1  mycroft  *  0   1		1 - internal loopback (DCR_LS = 0)
    341       1.1  mycroft  *  1   0		2 - external loopback (DCR_LS = 1)
    342       1.1  mycroft  *  1   1		3 - external loopback (DCR_LS = 0)
    343       1.1  mycroft  */
    344       1.1  mycroft #define ED_TCR_LB0	0x02
    345       1.1  mycroft #define ED_TCR_LB1	0x04
    346       1.1  mycroft 
    347       1.1  mycroft /*
    348       1.1  mycroft  * ATD: Auto Transmit Disable.  Clear for normal operation.  When set, allows
    349       1.1  mycroft  * another station to disable the NIC's transmitter by transmitting to a
    350       1.1  mycroft  * multicast address hashing to bit 62.  Reception of a multicast address
    351       1.1  mycroft  * hashing to bit 63 enables the transmitter.
    352       1.1  mycroft  */
    353       1.1  mycroft #define ED_TCR_ATD	0x08
    354       1.1  mycroft 
    355       1.1  mycroft /*
    356       1.1  mycroft  * OFST: Collision Offset enable.  This bit when set modifies the backoff
    357       1.1  mycroft  * algorithm to allow prioritization of nodes.
    358       1.1  mycroft  */
    359       1.1  mycroft #define ED_TCR_OFST	0x10
    360       1.1  mycroft 
    361       1.1  mycroft /*
    362       1.1  mycroft  * bits 5, 6, and 7 are unused/reserved
    363       1.1  mycroft  */
    364       1.1  mycroft 
    365       1.1  mycroft /*
    366       1.1  mycroft  *		Transmit Status Register (TSR) definitions
    367       1.1  mycroft  */
    368       1.1  mycroft 
    369       1.1  mycroft /*
    370       1.1  mycroft  * PTX: Packet Transmitted.  Indicates successful transmission of packet.
    371       1.1  mycroft  */
    372       1.1  mycroft #define ED_TSR_PTX	0x01
    373       1.1  mycroft 
    374       1.1  mycroft /*
    375       1.1  mycroft  * bit 1 (0x02) is unused/reserved
    376       1.1  mycroft  */
    377       1.1  mycroft 
    378       1.1  mycroft /*
    379       1.1  mycroft  * COL: Transmit Collided.  Indicates that the transmission collided at least
    380       1.1  mycroft  * once with another station on the network.
    381       1.1  mycroft  */
    382       1.1  mycroft #define ED_TSR_COL	0x04
    383       1.1  mycroft 
    384       1.1  mycroft /*
    385       1.1  mycroft  * ABT: Transmit aborted.  Indicates that the transmission was aborted due to
    386       1.1  mycroft  * excessive collisions.
    387       1.1  mycroft  */
    388       1.1  mycroft #define ED_TSR_ABT	0x08
    389       1.1  mycroft 
    390       1.1  mycroft /*
    391       1.1  mycroft  * CRS: Carrier Sense Lost.  Indicates that carrier was lost during the
    392       1.1  mycroft  * transmission of the packet.  (Transmission is not aborted because of a loss
    393       1.1  mycroft  * of carrier).
    394       1.1  mycroft  */
    395       1.1  mycroft #define ED_TSR_CRS	0x10
    396       1.1  mycroft 
    397       1.1  mycroft /*
    398       1.1  mycroft  * FU: FIFO Underrun.  Indicates that the NIC wasn't able to access bus/
    399       1.1  mycroft  * transmission memory before the FIFO emptied.  Transmission of the packet was
    400       1.1  mycroft  * aborted.
    401       1.1  mycroft  */
    402       1.1  mycroft #define ED_TSR_FU	0x20
    403       1.1  mycroft 
    404       1.1  mycroft /*
    405       1.1  mycroft  * CDH: CD Heartbeat.  Indicates that the collision detection circuitry isn't
    406       1.1  mycroft  * working correctly during a collision heartbeat test.
    407       1.1  mycroft  */
    408       1.1  mycroft #define ED_TSR_CDH	0x40
    409       1.1  mycroft 
    410       1.1  mycroft /*
    411       1.1  mycroft  * OWC: Out of Window Collision: Indicates that a collision occurred after a
    412       1.1  mycroft  * slot time (51.2us).  The transmission is rescheduled just as in normal
    413       1.1  mycroft  * collisions.
    414       1.1  mycroft  */
    415       1.1  mycroft #define ED_TSR_OWC	0x80
    416       1.1  mycroft 
    417       1.1  mycroft /*
    418       1.1  mycroft  *		Receiver Configuration Register (RCR) definitions
    419       1.1  mycroft  */
    420       1.1  mycroft 
    421       1.1  mycroft /*
    422       1.1  mycroft  * SEP: Save Errored Packets.  If 0, error packets are discarded.  If set to 1,
    423       1.1  mycroft  * packets with CRC and frame errors are not discarded.
    424       1.1  mycroft  */
    425       1.1  mycroft #define ED_RCR_SEP	0x01
    426       1.1  mycroft 
    427       1.1  mycroft /*
    428       1.1  mycroft  * AR: Accept Runt packet.  If 0, packet with less than 64 byte are discarded.
    429       1.1  mycroft  * If set to 1, packets with less than 64 byte are not discarded.
    430       1.1  mycroft  */
    431       1.1  mycroft #define ED_RCR_AR	0x02
    432       1.1  mycroft 
    433       1.1  mycroft /*
    434       1.1  mycroft  * AB: Accept Broadcast.  If set, packets sent to the broadcast address will be
    435       1.1  mycroft  * accepted.
    436       1.1  mycroft  */
    437       1.1  mycroft #define ED_RCR_AB	0x04
    438       1.1  mycroft 
    439       1.1  mycroft /*
    440       1.1  mycroft  * AM: Accept Multicast.  If set, packets sent to a multicast address are
    441       1.1  mycroft  * checked for a match in the hashing array.  If clear, multicast packets are
    442       1.1  mycroft  * ignored.
    443       1.1  mycroft  */
    444       1.1  mycroft #define ED_RCR_AM	0x08
    445       1.1  mycroft 
    446       1.1  mycroft /*
    447       1.1  mycroft  * PRO: Promiscuous Physical.  If set, all packets with a physical addresses
    448       1.1  mycroft  * are accepted.  If clear, a physical destination address must match this
    449       1.1  mycroft  * station's address.  Note: for full promiscuous mode, RCR_AB and RCR_AM must
    450       1.1  mycroft  * also be set.  In addition, the multicast hashing array must be set to all
    451       1.1  mycroft  * 1's so that all multicast addresses are accepted.
    452       1.1  mycroft  */
    453       1.1  mycroft #define ED_RCR_PRO	0x10
    454       1.1  mycroft 
    455       1.1  mycroft /*
    456       1.1  mycroft  * MON: Monitor Mode.  If set, packets will be checked for good CRC and
    457       1.1  mycroft  * framing, but are not stored in the ring-buffer.  If clear, packets are
    458       1.1  mycroft  * stored (normal operation).
    459       1.1  mycroft  */
    460       1.1  mycroft #define ED_RCR_MON	0x20
    461       1.1  mycroft 
    462       1.1  mycroft /*
    463  1.4.12.1   bouyer  * INTT: Interrupt Trigger Mode.  Must be set if AX88190.
    464  1.4.12.1   bouyer  */
    465  1.4.12.1   bouyer #define ED_RCR_INTT	0x40
    466  1.4.12.1   bouyer 
    467  1.4.12.1   bouyer /*
    468  1.4.12.1   bouyer  * Bit 7 is unused/reserved.
    469       1.1  mycroft  */
    470       1.1  mycroft 
    471       1.1  mycroft /*
    472       1.1  mycroft  *		Receiver Status Register (RSR) definitions
    473       1.1  mycroft  */
    474       1.1  mycroft 
    475       1.1  mycroft /*
    476       1.1  mycroft  * PRX: Packet Received without error.
    477       1.1  mycroft  */
    478       1.1  mycroft #define ED_RSR_PRX	0x01
    479       1.1  mycroft 
    480       1.1  mycroft /*
    481       1.1  mycroft  * CRC: CRC error.  Indicates that a packet has a CRC error.  Also set for
    482       1.1  mycroft  * frame alignment errors.
    483       1.1  mycroft  */
    484       1.1  mycroft #define ED_RSR_CRC	0x02
    485       1.1  mycroft 
    486       1.1  mycroft /*
    487       1.1  mycroft  * FAE: Frame Alignment Error.  Indicates that the incoming packet did not end
    488       1.1  mycroft  * on a byte boundary and the CRC did not match at the last byte boundary.
    489       1.1  mycroft  */
    490       1.1  mycroft #define ED_RSR_FAE	0x04
    491       1.1  mycroft 
    492       1.1  mycroft /*
    493       1.1  mycroft  * FO: FIFO Overrun.  Indicates that the FIFO was not serviced (during local
    494       1.1  mycroft  * DMA) causing it to overrun.  Reception of the packet is aborted.
    495       1.1  mycroft  */
    496       1.1  mycroft #define ED_RSR_FO	0x08
    497       1.1  mycroft 
    498       1.1  mycroft /*
    499       1.1  mycroft  * MPA: Missed Packet.  Indicates that the received packet couldn't be stored
    500       1.1  mycroft  * in the ring-buffer because of insufficient buffer space (exceeding the
    501       1.1  mycroft  * boundary pointer), or because the transfer to the ring-buffer was inhibited
    502       1.1  mycroft  * by RCR_MON - monitor mode.
    503       1.1  mycroft  */
    504       1.1  mycroft #define ED_RSR_MPA	0x10
    505       1.1  mycroft 
    506       1.1  mycroft /*
    507       1.1  mycroft  * PHY: Physical address.  If 0, the packet received was sent to a physical
    508       1.1  mycroft  * address.  If 1, the packet was accepted because of a multicast/broadcast
    509       1.1  mycroft  * address match.
    510       1.1  mycroft  */
    511       1.1  mycroft #define ED_RSR_PHY	0x20
    512       1.1  mycroft 
    513       1.1  mycroft /*
    514       1.1  mycroft  * DIS: Receiver Disabled.  Set to indicate that the receiver has enetered
    515       1.1  mycroft  * monitor mode.  Cleared when the receiver exits monitor mode.
    516       1.1  mycroft  */
    517       1.1  mycroft #define ED_RSR_DIS	0x40
    518       1.1  mycroft 
    519       1.1  mycroft /*
    520       1.1  mycroft  * DFR: Deferring.  Set to indicate a 'jabber' condition.  The CRS and COL
    521       1.1  mycroft  * inputs are active, and the transceiver has set the CD line as a result of
    522       1.1  mycroft  * the jabber.
    523       1.1  mycroft  */
    524       1.1  mycroft #define ED_RSR_DFR	0x80
    525       1.1  mycroft 
    526       1.1  mycroft /*
    527       1.3   scottr  * receive ring descriptor
    528       1.1  mycroft  *
    529       1.1  mycroft  * The National Semiconductor DS8390 Network interface controller uses the
    530       1.1  mycroft  * following receive ring headers.  The way this works is that the memory on
    531       1.1  mycroft  * the interface card is chopped up into 256 bytes blocks.  A contiguous
    532       1.1  mycroft  * portion of those blocks are marked for receive packets by setting start and
    533       1.1  mycroft  * end block #'s in the NIC.  For each packet that is put into the receive
    534       1.1  mycroft  * ring, one of these headers (4 bytes each) is tacked onto the front.   The
    535       1.1  mycroft  * first byte is a copy of the receiver status register at the time the packet
    536       1.1  mycroft  * was received.
    537       1.3   scottr  */
    538       1.3   scottr struct dp8390_ring	{
    539       1.3   scottr 	u_int8_t	rsr;		/* receiver status */
    540       1.3   scottr 	u_int8_t	next_packet;	/* pointer to next packet */
    541       1.3   scottr 	u_int16_t	count;		/* bytes in packet (length + 4) */
    542       1.3   scottr };
    543       1.3   scottr 
    544       1.3   scottr /*
    545       1.3   scottr  * XXX For compatibility only!  This needs to die when all drivers have
    546       1.3   scottr  * been converted to be front ends to the MI driver.
    547       1.1  mycroft  */
    548       1.1  mycroft struct ed_ring	{
    549       1.2  mycroft #if BYTE_ORDER == BIG_ENDIAN
    550       1.2  mycroft 	u_char	next_packet;		/* pointer to next packet */
    551       1.2  mycroft 	u_char	rsr;			/* receiver status */
    552       1.2  mycroft #else
    553       1.1  mycroft 	u_char	rsr;			/* receiver status */
    554       1.1  mycroft 	u_char	next_packet;		/* pointer to next packet */
    555       1.2  mycroft #endif
    556       1.1  mycroft 	u_short	count;			/* bytes in packet (length + 4) */
    557       1.1  mycroft };
    558       1.1  mycroft 
    559       1.1  mycroft /*
    560       1.1  mycroft  * Common constants
    561       1.1  mycroft  */
    562       1.1  mycroft #define ED_PAGE_SIZE		256	/* Size of RAM pages in bytes */
    563       1.1  mycroft #define	ED_PAGE_MASK		255
    564       1.1  mycroft #define	ED_PAGE_SHIFT		8
    565       1.1  mycroft 
    566       1.1  mycroft #define ED_TXBUF_SIZE		6	/* Size of TX buffer in pages */
    567