Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pcmcia Use the Ethernet vendor ID to differentiate m...



details:   https://anonhg.NetBSD.org/src/rev/a506f2ad5bc6
branches:  trunk
changeset: 481252:a506f2ad5bc6
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Jan 25 08:06:49 2000 +0000

description:
Use the Ethernet vendor ID to differentiate multiple cards with the same
vendor,product pair.  (Yuck.)

diffstat:

 sys/dev/pcmcia/if_ne_pcmcia.c |  47 +++++++++++++++++++++++-------------------
 sys/dev/pcmcia/pcmciadevs     |  11 +++++++--
 2 files changed, 34 insertions(+), 24 deletions(-)

diffs (131 lines):

diff -r 8157b86da15c -r a506f2ad5bc6 sys/dev/pcmcia/if_ne_pcmcia.c
--- a/sys/dev/pcmcia/if_ne_pcmcia.c     Tue Jan 25 07:19:11 2000 +0000
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c     Tue Jan 25 08:06:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ne_pcmcia.c,v 1.45 1999/12/05 20:08:39 danw Exp $   */
+/*     $NetBSD: if_ne_pcmcia.c,v 1.46 2000/01/25 08:06:50 mycroft Exp $        */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -135,11 +135,6 @@
       PCMCIA_CIS_SVEC_LANCARD,
       0, 0x7f0, { 0x00, 0xc0, 0x6c } },
 
-    { PCMCIA_STR_PLANEX_FNW3600T,
-      PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
-      PCMCIA_CIS_PLANEX_FNW3600T,
-      0, -1, { 0x00, 0x90, 0xcc }, NE2000DVF_DL10019 },
-
     { PCMCIA_STR_EPSON_EEN10B,
       PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_EPSON_EEN10B,
       PCMCIA_CIS_EPSON_EEN10B,
@@ -166,6 +161,16 @@
       PCMCIA_CIS_LINKSYS_ECARD_1, 
       0, -1, { 0x00, 0x80, 0xc8 } },
 
+    { PCMCIA_STR_PLANEX_FNW3600T,
+      PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD,
+      PCMCIA_CIS_PLANEX_FNW3600T,
+      0, -1, { 0x00, 0x90, 0xcc }, NE2000DVF_DL10019 },
+
+    { PCMCIA_STR_SVEC_PN650TX,
+      PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD,
+      PCMCIA_CIS_SVEC_PN650TX,
+      0, -1, { 0x00, 0xe0, 0x98 }, NE2000DVF_DL10019 },
+
     { PCMCIA_STR_LINKSYS_COMBO_ECARD, 
       PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD,
       PCMCIA_CIS_LINKSYS_COMBO_ECARD, 
@@ -508,7 +513,9 @@
        /*
         * Read the station address from the board.
         */
-       for (i = 0; i < NE2000_NDEVS; i++) {
+       i = 0;
+again:
+       for (; i < NE2000_NDEVS; i++) {
                if ((ne_dev = ne2000_match(pa->card, pa->pf->number, i))
                    != NULL) {
                        if (ne_dev->enet_maddr >= 0) {
@@ -537,20 +544,25 @@
                        break;
                }
        }
+       if (i == NE2000_NDEVS) {
+               printf("%s: can't match ethernet vendor code\n",
+                   dsc->sc_dev.dv_xname);
+               return;
+       }
 
        if ((ne_dev->flags & NE2000DVF_DL10019) != 0) {
 #define PAR0   0x04
-               for (i = 0, sum = 0; i < 8; i++)
+               for (j = 0, sum = 0; j < 8; j++)
                        sum += bus_space_read_1(nsc->sc_asict, nsc->sc_asich,
-                           PAR0 + i);
+                           PAR0 + j);
                if (sum != 0xff) {
                        printf("%s: sum(0x%x) should be 0xff\n",
                            dsc->sc_dev.dv_xname, sum);
                        return;
                }
-               for (i = 0; i < ETHER_ADDR_LEN; i++)
-                       myea[i] = bus_space_read_1(nsc->sc_asict,
-                           nsc->sc_asich, PAR0 + i);
+               for (j = 0; j < ETHER_ADDR_LEN; j++)
+                       myea[j] = bus_space_read_1(nsc->sc_asict,
+                           nsc->sc_asich, PAR0 + j);
                enaddr = myea;
                nsc->sc_type = NE2000_TYPE_DL10019;
 #undef PAR0
@@ -563,15 +575,8 @@
                if (enaddr[0] != ne_dev->enet_vendor[0] ||
                    enaddr[1] != ne_dev->enet_vendor[1] ||
                    enaddr[2] != ne_dev->enet_vendor[2]) {
-                       printf("%s: enet addr has incorrect vendor code\n",
-                           dsc->sc_dev.dv_xname);
-                       printf("%s: (%02x:%02x:%02x should be "
-                           "%02x:%02x:%02x)\n", dsc->sc_dev.dv_xname,
-                           enaddr[0], enaddr[1], enaddr[2],
-                           ne_dev->enet_vendor[0],
-                           ne_dev->enet_vendor[1],
-                           ne_dev->enet_vendor[2]);
-                       return;
+                       ++i;
+                       goto again;
                }
        }
 
diff -r 8157b86da15c -r a506f2ad5bc6 sys/dev/pcmcia/pcmciadevs
--- a/sys/dev/pcmcia/pcmciadevs Tue Jan 25 07:19:11 2000 +0000
+++ b/sys/dev/pcmcia/pcmciadevs Tue Jan 25 08:06:49 2000 +0000
@@ -1,4 +1,4 @@
-$NetBSD: pcmciadevs,v 1.69 2000/01/25 06:52:54 jlam Exp $
+$NetBSD: pcmciadevs,v 1.70 2000/01/25 08:06:49 mycroft Exp $
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -215,9 +215,9 @@
 product PLANET SMARTCOM2000    { "PCMCIA", "UE2212", NULL, NULL } Planet SmartCOM 2000
 /*
  * vendor ID of FNW-3600-T is LINKSYS(0x0149) and product ID is 0xc1ab, but
- * it conflicts with LINKSYS Combo EhternetCard.
+ * it conflicts with LINKSYS Combo EthernetCard.
  */
-product PLANEX FNW3600T                { "Fast&spEthernet", "Adapter", "1.0", NULL } Planex FNW-3600-T
+product PLANEX FNW3600T                -1 Planex FNW-3600-T
 product DLINK DE650            { "D-Link", "DE-650", NULL, NULL } D-Link DE-650
 product DLINK DE660            { "D-Link", "DE-660", NULL, NULL } D-Link DE-660
 product RPTI EP401             { "RPTI", "EP401&spEthernet&spNE2000&spCompatible", NULL, NULL } RPTI EP401
@@ -231,6 +231,11 @@
 product COREGA FAST_ETHER_PCC_TX       { "corega&spK.K.", "corega&spFastEther&spPCC-TX", NULL, NULL } Corega
 product SVEC COMBOCARD { "Ethernet", "Adapter", NULL, NULL } SVEC/Hawking Tech. Combo Card
 product SVEC LANCARD   { "SVEC", "FD605&spPCMCIA&spEtherNet&spCard", "V1-1", NULL } SVEC PCMCIA Lan Card
+/*
+ * vendor ID of PN650TX is LINKSYS(0x0149) and product ID is 0xc1ab, but
+ * it conflicts with LINKSYS Combo EthernetCard.
+ */
+product SVEC PN650TX           -1 SVEC PN650TX 10/100 Dual Speed Fast Ethernet PC Card
 product AMBICOM AMB8002T       { "AmbiCom&spInc", "AMB8002T", NULL, NULL } AmbiCom AMB8002T
 product IODATA PCLAT           { "I-O&spDATA", "PCLA", "ETHERNET", NULL } IO-DATA PCLA/T
 product EPSON EEN10B           { "Seiko&spEpson&spCorp.", "Ethernet", "P/N:&spEEN10B&spRev.&sp00", NULL } Epson EEN10B



Home | Main Index | Thread Index | Old Index