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_sn_obio.c | |
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_sn_obio.c')
-rw-r--r-- | sys/arch/mac68k/dev/if_sn_obio.c | 84 |
1 files changed, 64 insertions, 20 deletions
diff --git a/sys/arch/mac68k/dev/if_sn_obio.c b/sys/arch/mac68k/dev/if_sn_obio.c index 358c53415bf..831209f4868 100644 --- a/sys/arch/mac68k/dev/if_sn_obio.c +++ b/sys/arch/mac68k/dev/if_sn_obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn_obio.c,v 1.4 1997/03/29 02:27:11 briggs Exp $ */ +/* $OpenBSD: if_sn_obio.c,v 1.5 1997/03/29 23:26:49 briggs Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -84,25 +84,33 @@ sn_obio_attach(parent, self, aux) { struct obio_attach_args *oa = (struct obio_attach_args *) aux; struct sn_softc *sc = (void *)self; + int i; - sc->s_dcr = DCR_LBR | DCR_SYNC | DCR_WAIT0 | - DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16; + sc->snr_dcr = DCR_SYNC | DCR_WAIT0 | DCR_DMABLOCK | + DCR_RFT16 | DCR_TFT16; + sc->snr_dcr2 = 0; - switch (current_mac_model->class) { - case MACH_CLASSQ: - case MACH_CLASSQ2: - sc->s_dcr |= DCR_DW32; + switch (current_mac_model->machineid) { + case MACH_MACQ700: /* only tested on Q700 */ + case MACH_MACQ900: + case MACH_MACQ950: + sc->snr_dcr |= DCR_LBR | DCR_DW32; sc->bitmode = 1; - break; - - case MACH_CLASSPB: - sc->s_dcr |= DCR_DW16; - sc->bitmode = 0; - break; + break; + + case MACH_MACQ800: + case MACH_MACQ650: + case MACH_MACC650: + case MACH_MACC610: + case MACH_MACQ610: + sc->snr_dcr |= DCR_EXBUS | DCR_DW32; + sc->bitmode = 1; + break; - default: - printf("unsupported machine type\n"); - return; + case MACH_MACPB500: + sc->snr_dcr |= DCR_LBR | DCR_DW16; + sc->bitmode = 0; + break; } sc->sc_regt = oa->oa_tag; @@ -115,7 +123,18 @@ sn_obio_attach(parent, self, aux) sn_obio_getaddr(sc); - snsetup(sc); + /* regs are addressed as words, big-endian. */ + for (i = 0; i < SN_NREGS; i++) { + sc->sc_reg_map[i] = (bus_size_t)((i * 4) + 2); + } + + /* snsetup returns 1 if something fails */ + if (snsetup(sc)) { + bus_space_unmap(sc->sc_regt, sc->sc_regh, SN_REGSIZE); + return; + } + + add_nubus_intr(sc->slotno, snintr, (void *)sc); } static u_char bbr4[] = {0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15}; @@ -134,9 +153,34 @@ sn_obio_getaddr(sc) } /* - * Apparently Apple goofed here. The ethernet MAC address is - * stored in bit-byte-reversed format. It is rumored that this - * is only true for some systems. + * For reasons known only to Apple, MAC addresses in the ethernet + * PROM are stored in Token Ring (IEEE 802.5) format, that is + * with all of the bits in each byte reversed (canonical bit format). + * When the address is read out it must be reversed to ethernet format + * before use. + * + * Apple has been assigned OUI's 00:08:07 and 00:a0:40. All onboard + * ethernet addresses on 68K machines should be in one of these + * two ranges. + * + * Here is where it gets complicated. + * + * The PMac 7200, 7500, 8500, and 9500 accidentally had the PROM + * written in standard ethernet format. The MacOS accounted for this + * in these systems, and did not reverse the bytes. Some other + * networking utilities were not so forgiving, and got confused. + * "Some" of Apple's Nubus ethernet cards also had their bits + * burned in ethernet format. + * + * Apple petitioned the IEEE and was granted the 00:05:02 (bit reversal + * of 00:a0:40) as well. As of OpenTransport 1.1.1, Apple removed + * their workaround and now reverses the bits regardless of + * what kind of machine it is. So PMac systems and the affected + * Nubus cards now use 00:05:02, instead of the 00:a0:40 for which they + * were intended. + * + * See Apple Techinfo article TECHINFO-0020552, "OpenTransport 1.1.1 + * and MacOS System 7.5.3 FAQ (10/96)" for more details. */ do_bbr = 0; b = bus_space_read_1(sc->sc_regt, bsh, 0); |