2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
7 * Copyright (c) 1998 Be, Inc. All Rights Reserved
9 * Definitions private to ne2000 PCI ethernet driver
11 * Modification History (most recent first):
13 * 18 May 98 malyn new today
16 #ifndef _ETHERPCI_PRIVATE_H
17 #define _ETHERPCI_PRIVATE_H
19 #ifndef _KERNEL_EXPORT_H
20 #include <KernelExport.h>
24 * Wait this long before giving up on an ethernet transmit
26 #define ETHER_TRANSMIT_TIMEOUT ((bigtime_t)1000000) /* one second */
28 #define NIRQS 128 //x hmm...
32 #define ETHER_BUF_START_NE2000 0x4000
33 #define ETHER_BUF_SIZE_NE2000 0x4000
35 #define ETHER_BUF_SIZE_MAX ETHER_BUF_SIZE_NE2000
37 #define ETHER_MTU 1500
38 #define ETHER_MIN_SIZE 60
39 #define ETHER_MAX_SIZE 1514
40 #define ETHER_IRQ2 0x10
41 #define ETHER_IRQ3 0x20
42 #define ETHER_IRQ4 0x40
43 #define ETHER_IRQ5 0x80
46 #define ECNTRL_RESET 0x01
47 #define ECNTRL_ONBOARD 0x02
48 #define ECNTRL_SAPROM 0x04
50 #define EGACFR_NORM 0x49
51 #define EGACFR_IRQOFF 0xc9
53 #define EC_PAGE_SIZE 256
54 #define EC_PAGE_SHIFT 8
58 #define EN0_STARTPG 0x01
59 #define EN0_STOPPG 0x02
60 #define EN0_BOUNDARY 0x03
62 #define EN0_TCNTLO 0x05
63 #define EN0_TCNTHI 0x06
65 #define EN0_RADDRLO 0x08
66 #define EN0_RADDRHI 0x09
67 #define EN0_RCNTLO 0x0a
68 #define EN0_RCNTHI 0x0b
73 #define ISR_RECEIVE 0x01
74 #define ISR_TRANSMIT 0x02
75 #define ISR_RECEIVE_ERROR 0x04
76 #define ISR_TRANSMIT_ERROR 0x08
77 #define ISR_OVERWRITE 0x10
78 #define ISR_COUNTER 0x20
79 #define ISR_DMADONE 0x40
80 #define ISR_RESET 0x80
87 #define EN0_CNTR0 0x0d
88 #define EN0_CNTR1 0x0e
89 #define EN0_CNTR2 0x0f
92 #define DCFG_BM16 0x49
95 #define EN1_CURPAG 0x7
98 #define ENRXCR_MON 0x20
99 #define ENRXCR_MCST 0x08
100 #define ENRXCR_BCST 0x04
102 #define TXCR_LOOPBACK 0x02
104 #define ENC_PAGE0 0x00
105 #define ENC_STOP 0x01
106 #define ENC_START 0x02
107 #define ENC_TRANS 0x04
108 #define ENC_DMAREAD 0x08
109 #define ENC_DMAWRITE 0x10
110 #define ENC_NODMA 0x20
111 #define ENC_PAGE1 0x40
114 #define RSR_INTACT 0x01
116 #define TSR_ABORTED 0x08
117 #define TSR_UNDERRUN 0x20
118 #define TSR_HEARTBEAT 0x40
120 #define ETHER_ADDR_LEN 6
123 * Maximum iterations to poll before assuming error
125 #define MAXWAIT 10000
129 * Swap the bytes in a short, but not on a little-endian machine
131 static const union { long l
; char b
[4]; } ENDIAN_TEST
= { 1 };
132 #define LITTLE_ENDIAN ENDIAN_TEST.b[0]
133 #define SWAPSHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff))
134 #define swapshort(x) (LITTLE_ENDIAN ? (x) : SWAPSHORT(x))
138 * NS8390 ring header structure
140 typedef struct ring_header
{
141 unsigned char status
;
142 unsigned char next_packet
;
143 unsigned short count
;