Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/pcmcia Pullup 802.11 stuff (approved by jhawk)



details:   https://anonhg.NetBSD.org/src/rev/7e71d63dee9c
branches:  netbsd-1-5
changeset: 488617:7e71d63dee9c
user:      onoe <onoe%NetBSD.org@localhost>
date:      Fri Jul 21 18:52:09 2000 +0000

description:
Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
  to wi driver.
        syssrc/sys/dev/pcmcia/pcmciadevs                1.95
        syssrc/sys/dev/pcmcia/pcmciadevs.h              1.94
        syssrc/sys/dev/pcmcia/pcmciadevs_data.h         1.94
        syssrc/sys/dev/pcmcia/if_wi.c                   1.24
        syssrc/sys/dev/pcmcia/if_wivar.h                1.11

diffstat:

 sys/dev/pcmcia/if_wi.c           |  94 ++++++++++++++++++++++++++++++++++++---
 sys/dev/pcmcia/if_wivar.h        |   3 +-
 sys/dev/pcmcia/pcmciadevs        |   4 +-
 sys/dev/pcmcia/pcmciadevs.h      |   6 ++-
 sys/dev/pcmcia/pcmciadevs_data.h |  16 ++++++-
 5 files changed, 110 insertions(+), 13 deletions(-)

diffs (235 lines):

diff -r 3d44a6016e74 -r 7e71d63dee9c sys/dev/pcmcia/if_wi.c
--- a/sys/dev/pcmcia/if_wi.c    Fri Jul 21 18:49:22 2000 +0000
+++ b/sys/dev/pcmcia/if_wi.c    Fri Jul 21 18:52:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wi.c,v 1.21.2.2 2000/07/21 18:45:47 onoe Exp $      */
+/*     $NetBSD: if_wi.c,v 1.21.2.3 2000/07/21 18:52:10 onoe Exp $      */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -117,6 +117,15 @@
 static u_int8_t        wi_mcast_addr[6] = { 0x01, 0x60, 0x1D, 0x00, 0x01, 0x00 };
 #endif
 
+struct wi_pcmcia_product {
+       u_int32_t       pp_vendor;      /* vendor ID */
+       u_int32_t       pp_product;     /* product ID */
+       const char      *pp_cisinfo[4]; /* CIS information */
+       const char      *pp_name;       /* product name */
+       int             pp_prism2;      /* prism2 chipset */
+};
+
+static struct wi_pcmcia_product *wi_lookup __P((struct pcmcia_attach_args *pa));
 static int wi_match            __P((struct device *, struct cfdata *, void *));
 static void wi_attach          __P((struct device *, struct device *, void *));
 static int wi_detach           __P((struct device *, int));
@@ -165,6 +174,71 @@
        sizeof(struct wi_softc), wi_match, wi_attach, wi_detach, wi_activate
 };
 
+static struct wi_pcmcia_product wi_pcmcia_products[] = {
+       { PCMCIA_VENDOR_LUCENT,
+         PCMCIA_PRODUCT_LUCENT_WAVELAN_IEEE,
+         PCMCIA_CIS_LUCENT_WAVELAN_IEEE,
+         PCMCIA_STR_LUCENT_WAVELAN_IEEE,
+         0 },
+
+       { PCMCIA_VENDOR_3COM,
+         PCMCIA_PRODUCT_3COM_3CRWE737A,
+         PCMCIA_CIS_3COM_3CRWE737A,
+         PCMCIA_STR_3COM_3CRWE737A,
+         1 },
+
+       { PCMCIA_VENDOR_COREGA,
+         PCMCIA_PRODUCT_COREGA_WIRELESS_LAN_PCC_11,
+         PCMCIA_CIS_COREGA_WIRELESS_LAN_PCC_11,
+         PCMCIA_STR_COREGA_WIRELESS_LAN_PCC_11,
+         1 },
+
+       { PCMCIA_VENDOR_INTERSIL,
+         PCMCIA_PRODUCT_INTERSIL_PRISM2,
+         PCMCIA_CIS_INTERSIL_PRISM2,
+         PCMCIA_STR_INTERSIL_PRISM2,
+         1 },
+
+       { 0,
+         0,
+         { NULL, NULL, NULL, NULL },
+         NULL,
+         0 }
+};
+
+static struct wi_pcmcia_product *
+wi_lookup(pa)
+       struct pcmcia_attach_args *pa;
+{
+       struct wi_pcmcia_product *pp;
+
+       /*
+        * match by CIS information first
+        * XXX: Farallon SkyLINE 11mb uses PRISM II but vendor ID
+        *      and product ID is the same as Lucent WaveLAN
+        */
+       for (pp = wi_pcmcia_products; pp->pp_name != NULL; pp++) {
+               if (pa->card->cis1_info[0] != NULL &&
+                   pp->pp_cisinfo[0] != NULL &&
+                   strcmp(pa->card->cis1_info[0], pp->pp_cisinfo[0]) == 0 &&
+                   pa->card->cis1_info[1] != NULL &&
+                   pp->pp_cisinfo[1] != NULL &&
+                   strcmp(pa->card->cis1_info[1], pp->pp_cisinfo[1]) == 0)
+                       return pp;
+       }
+
+       /* match by vendor/product id */
+       for (pp = wi_pcmcia_products; pp->pp_name != NULL; pp++) {
+               if (pa->manufacturer != PCMCIA_VENDOR_INVALID &&
+                   pa->manufacturer == pp->pp_vendor &&
+                   pa->product != PCMCIA_PRODUCT_INVALID &&
+                   pa->product == pp->pp_product)
+                       return pp;
+       }
+
+       return NULL;
+}
+
 static int
 wi_match(parent, match, aux)
        struct device *parent;
@@ -173,14 +247,8 @@
 {
        struct pcmcia_attach_args *pa = aux;
 
-       if (pa->manufacturer == PCMCIA_VENDOR_LUCENT &&
-           pa->product == PCMCIA_PRODUCT_LUCENT_WAVELAN_IEEE)
-         return 1;
-
-       if (pa->manufacturer == PCMCIA_VENDOR_3COM &&
-           pa->product == PCMCIA_PRODUCT_3COM_3CRWE737A)
-         return 1;
-
+       if (wi_lookup(pa) != NULL)
+               return 1;
        return 0;
 }
 
@@ -232,6 +300,7 @@
        struct wi_softc *sc = (void *) self;
        struct pcmcia_attach_args *pa = aux;
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
+       struct wi_pcmcia_product *pp;
        struct wi_ltv_macaddr   mac;
        struct wi_ltv_gen       gen;
        static const u_int8_t empty_macaddr[ETHER_ADDR_LEN] = {
@@ -260,6 +329,13 @@
        sc->wi_btag = sc->sc_pcioh.iot;
        sc->wi_bhandle = sc->sc_pcioh.ioh;
 
+       pp = wi_lookup(pa);
+       if (pp == NULL) {
+               /* should not happen */
+               sc->sc_prism2 = 0;
+       } else
+               sc->sc_prism2 = pp->pp_prism2;
+
        callout_init(&sc->wi_inquire_ch);
 
        /* Make sure interrupts are disabled. */
diff -r 3d44a6016e74 -r 7e71d63dee9c sys/dev/pcmcia/if_wivar.h
--- a/sys/dev/pcmcia/if_wivar.h Fri Jul 21 18:49:22 2000 +0000
+++ b/sys/dev/pcmcia/if_wivar.h Fri Jul 21 18:52:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wivar.h,v 1.9.4.1 2000/07/21 18:45:47 onoe Exp $    */
+/*     $NetBSD: if_wivar.h,v 1.9.4.2 2000/07/21 18:52:11 onoe Exp $    */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -46,6 +46,7 @@
        struct pcmcia_io_handle sc_pcioh;
        int sc_iowin;
        int sc_enabled;
+       int sc_prism2;
 
        bus_space_tag_t         wi_btag;
        bus_space_handle_t      wi_bhandle;
diff -r 3d44a6016e74 -r 7e71d63dee9c sys/dev/pcmcia/pcmciadevs
--- a/sys/dev/pcmcia/pcmciadevs Fri Jul 21 18:49:22 2000 +0000
+++ b/sys/dev/pcmcia/pcmciadevs Fri Jul 21 18:52:09 2000 +0000
@@ -1,4 +1,4 @@
-$NetBSD: pcmciadevs,v 1.93.2.1 2000/07/03 22:34:04 thorpej Exp $
+$NetBSD: pcmciadevs,v 1.93.2.2 2000/07/21 18:52:09 onoe Exp $
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -252,6 +252,7 @@
 vendor ICOM                    -1      ICOM Inc
 vendor BILLIONTON              -1      Billionton Systems Inc.
 vendor AMD                     -1      AMD
+vendor INTERSIL                        -1      Intersil
 
 product MEGAHERTZ XJ2288       { "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem
 product PREMAX PE200           { "PMX&sp&sp&sp", "PE-200", NULL, NULL } PreMax PE-200
@@ -291,3 +292,4 @@
 product XIRCOM CFE_10          { "Xircom", "CompactCard&spEthernet", "CFE-10", "1.00" } Xircom CompactCard CFE-10
 product BILLIONTON LNT10TN     { "PCMCIA", "LNT-10TN", NULL, NULL } Billionton Systems Inc. LNT-10TN NE2000 Compatible Card
 product NDC ND5100_E           { "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card
+product INTERSIL PRISM2                { "INTERSIL", "HFA384x/IEEE", "Version 01.02", NULL} Intersil Prism II
diff -r 3d44a6016e74 -r 7e71d63dee9c sys/dev/pcmcia/pcmciadevs.h
--- a/sys/dev/pcmcia/pcmciadevs.h       Fri Jul 21 18:49:22 2000 +0000
+++ b/sys/dev/pcmcia/pcmciadevs.h       Fri Jul 21 18:52:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcmciadevs.h,v 1.92.2.1 2000/07/03 22:34:17 thorpej Exp $      */
+/*     $NetBSD: pcmciadevs.h,v 1.92.2.2 2000/07/21 18:52:09 onoe Exp $ */
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -417,6 +417,7 @@
 #define        PCMCIA_VENDOR_ICOM      -1      /* ICOM Inc */
 #define        PCMCIA_VENDOR_BILLIONTON        -1      /* Billionton Systems Inc. */
 #define        PCMCIA_VENDOR_AMD       -1      /* AMD */
+#define        PCMCIA_VENDOR_INTERSIL  -1      /* Intersil */
 
 #define        PCMCIA_CIS_MEGAHERTZ_XJ2288     { "MEGAHERTZ", "MODEM XJ2288", NULL, NULL }
 #define        PCMCIA_PRODUCT_MEGAHERTZ_XJ2288 -1
@@ -516,3 +517,6 @@
 #define        PCMCIA_CIS_NDC_ND5100_E { "NDC", "Ethernet", "A", NULL }
 #define        PCMCIA_PRODUCT_NDC_ND5100_E     -1
 #define        PCMCIA_STR_NDC_ND5100_E "Sohoware ND5100E NE2000 Compatible Card"
+#define        PCMCIA_CIS_INTERSIL_PRISM2      { "INTERSIL", "HFA384x/IEEE", "Version 01.02", NULL}
+#define        PCMCIA_PRODUCT_INTERSIL_PRISM2  -1
+#define        PCMCIA_STR_INTERSIL_PRISM2      "Intersil Prism II"
diff -r 3d44a6016e74 -r 7e71d63dee9c sys/dev/pcmcia/pcmciadevs_data.h
--- a/sys/dev/pcmcia/pcmciadevs_data.h  Fri Jul 21 18:49:22 2000 +0000
+++ b/sys/dev/pcmcia/pcmciadevs_data.h  Fri Jul 21 18:52:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcmciadevs_data.h,v 1.92.2.1 2000/07/03 22:34:17 thorpej Exp $ */
+/*     $NetBSD: pcmciadevs_data.h,v 1.92.2.2 2000/07/21 18:52:10 onoe Exp $    */
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -808,6 +808,13 @@
            "Sohoware ND5100E NE2000 Compatible Card"   },
        },
        {
+           PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_INTERSIL_PRISM2,
+           PCMCIA_CIS_INTERSIL_PRISM2,
+           0,
+           "Intersil",
+           "Intersil Prism II" },
+       },
+       {
            PCMCIA_VENDOR_FUJITSU, 0,
            PCMCIA_KNOWNDEV_NOPROD,
            PCMCIA_CIS_INVALID,
@@ -1185,5 +1192,12 @@
            "AMD",
            NULL,
        },
+       {
+           PCMCIA_VENDOR_INTERSIL, 0,
+           PCMCIA_KNOWNDEV_NOPROD,
+           PCMCIA_CIS_INVALID,
+           "Intersil",
+           NULL,
+       },
        { 0, 0, { NULL, NULL, NULL, NULL }, 0, NULL, NULL, }
 };



Home | Main Index | Thread Index | Old Index