summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k/dev/if_sn_nubus.c
diff options
context:
space:
mode:
authorbriggs <briggs@cvs.openbsd.org>1997-03-29 23:26:51 +0000
committerbriggs <briggs@cvs.openbsd.org>1997-03-29 23:26:51 +0000
commit70225f16e75db6227bb63cd836b5ab3d967e4b15 (patch)
tree57c4245b1741134bcb6bb477e4d9a052011c1dd8 /sys/arch/mac68k/dev/if_sn_nubus.c
parent124c87306a0b4d73a205e860c33978d228abfc65 (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_nubus.c')
-rw-r--r--sys/arch/mac68k/dev/if_sn_nubus.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/sys/arch/mac68k/dev/if_sn_nubus.c b/sys/arch/mac68k/dev/if_sn_nubus.c
index 745309a3b25..977d14ce759 100644
--- a/sys/arch/mac68k/dev/if_sn_nubus.c
+++ b/sys/arch/mac68k/dev/if_sn_nubus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sn_nubus.c,v 1.3 1997/03/17 04:16:59 briggs Exp $ */
+/* $OpenBSD: if_sn_nubus.c,v 1.4 1997/03/29 23:26:49 briggs Exp $ */
/*
* Copyright (C) 1997 Allen Briggs
@@ -124,8 +124,9 @@ sn_nubus_attach(parent, self, aux)
switch (sn_nb_card_vendor(na)) {
case AE_VENDOR_DAYNA:
- sc->s_dcr = DCR_ASYNC | DCR_WAIT0 | DCR_USR1 |
- DCR_DW32 | DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16;
+ sc->snr_dcr = DCR_ASYNC | DCR_WAIT0 | DCR_DW32 |
+ DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16;
+ sc->snr_dcr2 = 0;
if (bus_space_subregion(bst, bsh, 0x00180000, SN_REGSIZE,
&sc->sc_regh)) {
@@ -141,6 +142,11 @@ sn_nubus_attach(parent, self, aux)
/*
* Copy out the ethernet address from the card's ROM
+ *
+ * See if_sn_obio.c for a discussion of bit reversal
+ * in Apple's MAC address PROMs. As far as I can tell
+ * Dayna stores their Mac address in ethernet format,
+ * not Token Ring.
*/
for (i = 0; i < ETHER_ADDR_LEN; ++i)
sc->sc_arpcom.ac_enaddr[i] =
@@ -156,8 +162,9 @@ sn_nubus_attach(parent, self, aux)
* for a new card, the following defaults are a
* good starting point.
*/
- sc->s_dcr = DCR_LBR | DCR_SYNC | DCR_WAIT0 |
- DCR_DW32 | DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16;
+ sc->snr_dcr = DCR_SYNC | DCR_WAIT0 | DCR_DW32 |
+ DCR_DMABLOCK | DCR_RFT16 | DCR_TFT16;
+ sc->snr_dcr2 = 0;
return;
}
@@ -167,6 +174,20 @@ sn_nubus_attach(parent, self, aux)
}
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(bst, bsh, NBMEMSIZE);
+ return;
+ }
+
+ add_nubus_intr(sc->slotno, snintr, (void *)sc);
+
+ return;
}
static int
@@ -205,6 +226,9 @@ sn_nb_card_vendor(na)
break;
}
break;
+ case NUBUS_DRSW_DAYNA:
+ vendor = AE_VENDOR_DAYNA;
+ break;
default:
#ifdef DIAGNOSTIC
printf("Unknown ethernet drsw: %x\n", na->drsw);