Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/arch/mac68k/nubus Pull up revision 1.20 (requested ...



details:   https://anonhg.NetBSD.org/src/rev/a2cfe9f93762
branches:  netbsd-1-4
changeset: 470682:a2cfe9f93762
user:      he <he%NetBSD.org@localhost>
date:      Tue Jun 27 15:19:55 2000 +0000

description:
Pull up revision 1.20 (requested by scottr):
  Add support for the Macintosh LC Ethernet Adapter.  This was
  previously erroneously recognized as an 8390-based card, where
  in fact it is using the 83932 (SONIC) controller.

diffstat:

 sys/arch/mac68k/nubus/if_sn_nubus.c |  37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diffs (86 lines):

diff -r a34e786927df -r a2cfe9f93762 sys/arch/mac68k/nubus/if_sn_nubus.c
--- a/sys/arch/mac68k/nubus/if_sn_nubus.c       Tue Jun 27 15:19:39 2000 +0000
+++ b/sys/arch/mac68k/nubus/if_sn_nubus.c       Tue Jun 27 15:19:55 2000 +0000
@@ -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.19.10.1 2000/06/27 15:19:55 he Exp $ */
 
 /*
  * Copyright (C) 1997 Allen Briggs
@@ -91,6 +91,7 @@
 
                case SN_VENDOR_APPLE:
                case SN_VENDOR_APPLE16:
+               case SN_VENDOR_ASANTELC:
                case SN_VENDOR_DAYNA:
                        rv = 1;
                        break;
@@ -116,6 +117,7 @@
        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 @@
 
        sc->sc_regt = bst;
 
+       cardtype = nubus_get_card_name(bst, bsh, na->fmt);
+
        success = 0;
 
        sc->slotno = na->slot;
@@ -204,6 +208,30 @@
                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 @@
                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 @@
                        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;



Home | Main Index | Thread Index | Old Index