From 8e9fd55168f52c220aff52150540c57143aef48b Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 29 Sep 1999 06:04:50 +0000 Subject: [PATCH] Add support for the Macintosh LC Ethernet Adapter, from Ken'ichi Ishizaka. This was erroneously recognized as an 8390-based card, where in fact it is using the 83932 (SONIC) controller. --- sys/arch/mac68k/dev/if_snvar.h | 3 ++- sys/arch/mac68k/nubus/if_ae_nubus.c | 7 +++++- sys/arch/mac68k/nubus/if_sn_nubus.c | 37 ++++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/sys/arch/mac68k/dev/if_snvar.h b/sys/arch/mac68k/dev/if_snvar.h index 754e4093fc05..151354913286 100644 --- a/sys/arch/mac68k/dev/if_snvar.h +++ b/sys/arch/mac68k/dev/if_snvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_snvar.h,v 1.13 1998/12/22 08:47:05 scottr Exp $ */ +/* $NetBSD: if_snvar.h,v 1.14 1999/09/29 06:04:50 scottr Exp $ */ /* * Copyright (c) 1991 Algorithmics Ltd (http://www.algor.co.uk) @@ -17,6 +17,7 @@ #define SN_VENDOR_APPLE 0x00 /* Apple Computer/compatible */ #define SN_VENDOR_DAYNA 0x01 /* Dayna/Kinetics EtherPort */ #define SN_VENDOR_APPLE16 0x02 /* Apple Twisted Pair NB */ +#define SN_VENDOR_ASANTELC 0x09 /* Asante Macintosh LC Ethernet */ /* * Memory access macros. Since we handle SONIC in 16 bit mode (PB5X0) diff --git a/sys/arch/mac68k/nubus/if_ae_nubus.c b/sys/arch/mac68k/nubus/if_ae_nubus.c index a600bb6906a8..db91235b6581 100644 --- a/sys/arch/mac68k/nubus/if_ae_nubus.c +++ b/sys/arch/mac68k/nubus/if_ae_nubus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ae_nubus.c,v 1.28 1998/09/27 14:39:11 scottr Exp $ */ +/* $NetBSD: if_ae_nubus.c,v 1.29 1999/09/29 06:04:51 scottr Exp $ */ /* * Copyright (C) 1997 Scott Reynolds @@ -418,6 +418,11 @@ ae_nb_card_vendor(bst, bsh, na) } break; case NUBUS_DRSW_APPLE: + if (na->drhw == NUBUS_DRHW_ASANTE_LC) { + vendor = DP8390_VENDOR_UNKNOWN; + break; + } + /* FALLTHROUGH */ case NUBUS_DRSW_DAYNA2: case NUBUS_DRSW_TECHWORKS: case NUBUS_DRSW_TFLLAN: diff --git a/sys/arch/mac68k/nubus/if_sn_nubus.c b/sys/arch/mac68k/nubus/if_sn_nubus.c index 15b8657ace57..c9711738ee3a 100644 --- a/sys/arch/mac68k/nubus/if_sn_nubus.c +++ b/sys/arch/mac68k/nubus/if_sn_nubus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn_nubus.c,v 1.19 1998/07/05 00:51:10 jonathan Exp $ */ +/* $NetBSD: if_sn_nubus.c,v 1.20 1999/09/29 06:04:51 scottr Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -91,6 +91,7 @@ sn_nubus_match(parent, cf, aux) case SN_VENDOR_APPLE: case SN_VENDOR_APPLE16: + case SN_VENDOR_ASANTELC: case SN_VENDOR_DAYNA: rv = 1; break; @@ -116,6 +117,7 @@ sn_nubus_attach(parent, self, aux) bus_space_tag_t bst; bus_space_handle_t bsh, tmp_bsh; u_int8_t myaddr[ETHER_ADDR_LEN]; + char *cardtype; (void)(&offset); /* Work around lame gcc initialization bug */ @@ -127,6 +129,8 @@ sn_nubus_attach(parent, self, aux) sc->sc_regt = bst; + cardtype = nubus_get_card_name(bst, bsh, na->fmt); + success = 0; sc->slotno = na->slot; @@ -204,6 +208,30 @@ sn_nubus_attach(parent, self, aux) success = 1; break; + case SN_VENDOR_ASANTELC: /* Macintosh LC Ethernet Adapter */ + sc->snr_dcr = DCR_ASYNC | DCR_WAIT0 | + DCR_DMABLOCK | DCR_PO1 | DCR_RFT16 | DCR_TFT16; + sc->snr_dcr2 = 0; + sc->bitmode = 0; /* 16 bit card */ + + if (bus_space_subregion(bst, bsh, + 0x0, SN_REGSIZE, &sc->sc_regh)) { + printf(": failed to map register space.\n"); + break; + } + + if (bus_space_subregion(bst, bsh, + 0x400000, ETHER_ADDR_LEN, &tmp_bsh)) { + printf(": failed to map ROM space.\n"); + break; + } + + sn_get_enaddr(bst, tmp_bsh, 0, myaddr); + + offset = 0; + success = 1; + break; + default: /* * You can't actually get this default, the snmatch @@ -228,6 +256,8 @@ sn_nubus_attach(parent, self, aux) sc->sc_reg_map[i] = (bus_size_t)((i * 4) + offset); } + printf(": %s\n", cardtype); + /* snsetup returns 1 if something fails */ if (snsetup(sc, myaddr)) { bus_space_unmap(bst, bsh, NBMEMSIZE); @@ -255,6 +285,11 @@ sn_nb_card_vendor(bst, bsh, na) vendor = SN_VENDOR_APPLE16; break; case NUBUS_DRSW_APPLE: + if (na->drhw == NUBUS_DRHW_ASANTE_LC) + vendor = SN_VENDOR_ASANTELC; + else + vendor = SN_VENDOR_APPLE; + break; case NUBUS_DRSW_TECHWORKS: vendor = SN_VENDOR_APPLE; break;