if_levar.h revision 1.4 1 /* $NetBSD: if_levar.h,v 1.4 1996/04/29 20:03:23 christos Exp $ */
2
3 /*
4 * LANCE Ethernet driver header file
5 *
6 * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
7 *
8 * Copyright (C) 1993, Paul Richards. This software may be used, modified,
9 * copied, distributed, and sold, in both source and binary form provided
10 * that the above copyright and these terms are retained. Under no
11 * circumstances is the author responsible for the proper functioning
12 * of this software, nor does the author assume any responsibility
13 * for damages incurred with its use.
14 */
15
16 /* Board types */
17 #define BICC 1
18 #define BICC_RDP 0xc
19 #define BICC_RAP 0xe
20
21 #define NE2100 2
22 #define PCnet_ISA 4
23 #define PCnet_PCI 5
24 #define NE2100_RDP 0x10
25 #define NE2100_RAP 0x12
26
27 #define DEPCA 3
28 #define DEPCA_CSR 0x0
29 #define DEPCA_CSR_SHE 0x80 /* Shared memory enabled */
30 #define DEPCA_CSR_SWAP32 0x40 /* Byte swapped */
31 #define DEPCA_CSR_DUM 0x08 /* rev E compatibility */
32 #define DEPCA_CSR_IM 0x04 /* Interrupt masked */
33 #define DEPCA_CSR_IEN 0x02 /* Interrupt enabled */
34 #define DEPCA_CSR_NORMAL \
35 (DEPCA_CSR_SHE | DEPCA_CSR_DUM | DEPCA_CSR_IEN)
36 #define DEPCA_RDP 0x4
37 #define DEPCA_RAP 0x6
38 #define DEPCA_ADP 0xc
39
40 /*
41 * Ethernet software status per interface.
42 *
43 * Each interface is referenced by a network interface structure,
44 * arpcom.ac_if, which the routing code uses to locate the interface.
45 * This structure contains the output queue for the interface, its address, ...
46 */
47 struct le_softc {
48 struct device sc_dev; /* base structure */
49 struct arpcom sc_arpcom; /* Ethernet common part */
50
51 void (*sc_copytodesc) /* Copy to descriptor */
52 __P((struct le_softc *, void *, int, int));
53 void (*sc_copyfromdesc) /* Copy from descriptor */
54 __P((struct le_softc *, void *, int, int));
55 void (*sc_copytobuf) /* Copy to buffer */
56 __P((struct le_softc *, void *, int, int));
57 void (*sc_copyfrombuf) /* Copy from buffer */
58 __P((struct le_softc *, void *, int, int));
59 void (*sc_zerobuf) /* and Zero bytes in buffer */
60 __P((struct le_softc *, int, int));
61
62 u_int16_t sc_conf3; /* CSR3 value */
63
64 void *sc_mem; /* base address of RAM -- CPU's view */
65 u_long sc_addr; /* base address of RAM -- LANCE's view */
66 u_long sc_memsize; /* size of RAM */
67
68 int sc_nrbuf; /* number of receive buffers */
69 int sc_ntbuf; /* number of transmit buffers */
70 int sc_last_rd;
71 int sc_first_td, sc_last_td, sc_no_td;
72
73 int sc_initaddr;
74 int sc_rmdaddr;
75 int sc_tmdaddr;
76 int sc_rbufaddr;
77 int sc_tbufaddr;
78
79 #ifdef LEDEBUG
80 int sc_debug;
81 #endif
82
83 void *sc_ih;
84 bus_io_handle_t sc_ioh;
85 void *sc_sh;
86 int sc_card;
87 int sc_rap, sc_rdp; /* LANCE registers */
88 };
89