diff options
author | briggs <briggs@cvs.openbsd.org> | 1997-03-29 23:26:51 +0000 |
---|---|---|
committer | briggs <briggs@cvs.openbsd.org> | 1997-03-29 23:26:51 +0000 |
commit | 70225f16e75db6227bb63cd836b5ab3d967e4b15 (patch) | |
tree | 57c4245b1741134bcb6bb477e4d9a052011c1dd8 /sys/arch/mac68k/dev/if_snvar.h | |
parent | 124c87306a0b4d73a205e860c33978d228abfc65 (diff) |
Update from Denton Gentry with minor bug fixes by me.
Denny says:
if_sn.c:
- allocate sc->space using malloc (Scott wanted this).
- make csr accesses use NIC_PUT/GET, remove sc->sc_csr.
- add multicast and IFF_PROMISC support. multicast isn't
well tested, but I made sure the unicast case still
works.
- finish the new arp interface, remove sc->sc_enaddr
if_snreg.h:
- remove struct sonic_reg
if_snvar.h:
- add NIC_PUT and NIC_GET macros a la if_ae
- remove sc_txhead, it isn't used.
if_sn_nubus.c:
- clean up support for my SE/30 card.
- Move add_nubus_intr from if_sn.c (to keep if_sn.c MI)
if_sn_obio.c:
- make Q610, C610, Q650, C650, Q800 use EXBUS.
- PB500 had a "return" where "break" was intended. PB500
probably wasn't working.
- move add_nubus_intr from if_sn.c.
- add an "explanation" why Apple's ethernet addr is encoded
in token ring format in the PROM.
Diffstat (limited to 'sys/arch/mac68k/dev/if_snvar.h')
-rw-r--r-- | sys/arch/mac68k/dev/if_snvar.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/sys/arch/mac68k/dev/if_snvar.h b/sys/arch/mac68k/dev/if_snvar.h index e89d0f50966..fa6c3aecc1d 100644 --- a/sys/arch/mac68k/dev/if_snvar.h +++ b/sys/arch/mac68k/dev/if_snvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_snvar.h,v 1.2 1997/03/14 14:11:36 briggs Exp $ */ +/* $OpenBSD: if_snvar.h,v 1.3 1997/03/29 23:26:50 briggs Exp $ */ /* * Copyright (c) 1991 Algorithmics Ltd (http://www.algor.co.uk) @@ -7,7 +7,7 @@ */ /* - * if_sonic.h -- National Semiconductor DP83932BVF (SONIC) + * if_snvar.h -- National Semiconductor DP83932BVF (SONIC) NetBSD/mac68k vars */ /* @@ -22,6 +22,23 @@ (*(u_int16_t *)((u_int16_t *)a + o) & 0xffff)) /* + * Register access macros. We use bus_space_* to talk to the Sonic + * registers. A mapping table is used in case a particular configuration + * hooked the regs up at non-word offsets. + */ +#define NIC_GET(sc, reg) (bus_space_read_2((sc)->sc_regt, \ + (sc)->sc_regh, \ + ((sc)->sc_reg_map[reg]))) +#define NIC_PUT(sc, reg, val) (bus_space_write_2((sc)->sc_regt, \ + (sc)->sc_regh, \ + ((sc)->sc_reg_map[reg]), \ + (val))) +#define SN_REGSIZE SN_NREGS*4 + +/* mac68k does not have any write buffers to flush... */ +#define wbflush() + +/* * buffer sizes in 32 bit mode * 1 TXpkt is 4 hdr words + (3 * FRAGMAX) + 1 link word * FRAGMAX == 16 => 54 words == 216 bytes @@ -52,6 +69,8 @@ #define NTXB 10 /* Number of xmit buffers */ #define TXBSIZE 1536 /* 6*2^8 -- the same size as the 8390 TXBUF */ +#define SN_NPAGES 1 + 8 + 5 + /* * Statistics collected over time */ @@ -102,12 +121,13 @@ typedef struct sn_softc { struct sn_stats sc_sum; short sc_iflags; unsigned short bitmode; /* 32 bit mode == 1, 16 == 0 */ + bus_size_t sc_reg_map[SN_NREGS]; /* register offsets */ - unsigned int s_dcr; /* DCR for this instance */ + u_int16_t snr_dcr; /* DCR for this instance */ + u_int16_t snr_dcr2; /* DCR2 for this instance */ int slotno; /* Slot number */ - struct sonic_reg *sc_csr; /* hardware pointer */ - int sc_rxmark; /* pos. in rx ring for reading buffs */ + int sc_rxmark; /* pos. in rx ring for reading buffs */ int sc_rramark; /* index into p_rra of wp */ void *p_rra[NRRA]; /* RX resource descs */ int v_rra[NRRA]; /* DMA addresses of p_rra */ @@ -119,7 +139,6 @@ typedef struct sn_softc { caddr_t rbuf[NRBA]; - int sc_txhead; /*XXX idx of first TDA passed to chip */ int sc_missed; /* missed packet counter */ int txb_cnt; /* total number of xmit buffers */ @@ -142,7 +161,7 @@ typedef struct sn_softc { void *p_cda; int v_cda; - unsigned char space[(1 + 1 + 8 + 5) * NBPG]; + unsigned char *space; } sn_softc_t; /* @@ -217,4 +236,5 @@ typedef struct sn_softc { #define CDA_ENABLE 64 /* mask enabling CAM entries */ #define CDA_SIZE(sc) ((4*16 + 1) * ((sc->bitmode) ? 4 : 2)) -void snsetup __P((struct sn_softc *sc)); +int snsetup __P((struct sn_softc *sc)); +void snintr __P((void *, int)); |