Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/dev/ic Catch up to -current. No, really, for sure t...



details:   https://anonhg.NetBSD.org/src/rev/48885b56e0bc
branches:  nathanw_sa
changeset: 505522:48885b56e0bc
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Wed Jan 09 00:36:29 2002 +0000

description:
Catch up to -current. No, really, for sure this time.

diffstat:

 sys/dev/ic/wi.c      |   36 ++++++++++--
 sys/dev/ic/wi_ieee.h |   35 +++++++-----
 sys/dev/ic/wireg.h   |  139 ++++++++++++++++++++------------------------------
 sys/dev/ic/wivar.h   |    4 +-
 4 files changed, 108 insertions(+), 106 deletions(-)

diffs (truncated from 513 to 300 lines):

diff -r 5b5b2799de21 -r 48885b56e0bc sys/dev/ic/wi.c
--- a/sys/dev/ic/wi.c   Tue Jan 08 23:30:12 2002 +0000
+++ b/sys/dev/ic/wi.c   Wed Jan 09 00:36:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wi.c,v 1.17.2.7 2002/01/08 00:30:13 nathanw Exp $      */
+/*     $NetBSD: wi.c,v 1.17.2.8 2002/01/09 00:36:29 nathanw Exp $      */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -69,6 +69,9 @@
  * Oslo IETF plenary meeting.
  */
 
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.17.2.8 2002/01/09 00:36:29 nathanw Exp $");
+
 #define WI_HERMES_AUTOINC_WAR  /* Work around data write autoinc bug. */
 #define WI_HERMES_STATS_WAR    /* Work around stats counter bug. */
 
@@ -296,6 +299,9 @@
                return;
        }
 
+       /*
+        * Drop undecryptable or packets with receive errors here
+        */
        if (le16toh(rx_frame.wi_status) & WI_STAT_ERRSTAT) {
                ifp->if_ierrors++;
                return;
@@ -419,8 +425,6 @@
                return;
 
        wi_cmd(sc, WI_CMD_INQUIRE, WI_INFO_COUNTERS);
-
-       return;
 }
 
 void wi_update_stats(sc)
@@ -585,6 +589,20 @@
        return;
 }
 
+void
+wi_pci_reset(sc)
+       struct wi_softc         *sc;
+{
+       bus_space_write_2(sc->sc_iot, sc->sc_ioh,
+                         WI_PCI_COR, WI_PCI_SOFT_RESET);
+       DELAY(100*1000); /* 100 m sec */
+
+       bus_space_write_2(sc->sc_iot, sc->sc_ioh, WI_PCI_COR, 0x0);
+       DELAY(100*1000); /* 100 m sec */
+
+       return;
+}
+
 /*
  * Read an LTV record from the NIC.
  */
@@ -933,7 +951,7 @@
 allmulti:
                ifp->if_flags |= IFF_ALLMULTI;
                memset((char *)&mcast, 0, sizeof(mcast));
-               mcast.wi_type = WI_RID_MCAST;
+               mcast.wi_type = WI_RID_MCAST_LIST;
                mcast.wi_len = ((ETHER_ADDR_LEN / 2) * 16) + 1;
 
                wi_write_record(sc, (struct wi_ltv_gen *)&mcast);
@@ -956,7 +974,7 @@
        }
 
        ifp->if_flags &= ~IFF_ALLMULTI;
-       mcast.wi_type = WI_RID_MCAST;
+       mcast.wi_type = WI_RID_MCAST_LIST;
        mcast.wi_len = ((ETHER_ADDR_LEN / 2) * i) + 1;
        wi_write_record(sc, (struct wi_ltv_gen *)&mcast);
 }
@@ -1662,7 +1680,7 @@
 
        /* getting chip identity */
        memset(&ver, 0, sizeof(ver));
-       ver.wi_type = WI_RID_CARDID;
+       ver.wi_type = WI_RID_CARD_ID;
        ver.wi_len = 5;
        wi_read_record(sc, (struct wi_ltv_gen *)&ver);
        printf("%s: using ", sc->sc_dev.dv_xname);
@@ -1699,6 +1717,10 @@
                printf("RF:PRISM2.5 MAC:ISL3873");
                sc->sc_prism2 = 1;
                break;
+       case WI_NIC_3874A:
+               printf("RF:PRISM2.5 MAC:ISL3874A(PCI)");
+               sc->sc_prism2 = 1;
+               break;
        default:
                printf("Lucent chip or unknown chip\n");
                sc->sc_prism2 = 0;
@@ -1708,7 +1730,7 @@
        if (sc->sc_prism2) {
                /* try to get prism2 firm version */
                memset(&ver, 0, sizeof(ver));
-               ver.wi_type = WI_RID_IDENT;
+               ver.wi_type = WI_RID_STA_IDENTITY;
                ver.wi_len = 5;
                wi_read_record(sc, (struct wi_ltv_gen *)&ver);
                LE16TOH(ver.wi_ver[1]);
diff -r 5b5b2799de21 -r 48885b56e0bc sys/dev/ic/wi_ieee.h
--- a/sys/dev/ic/wi_ieee.h      Tue Jan 08 23:30:12 2002 +0000
+++ b/sys/dev/ic/wi_ieee.h      Wed Jan 09 00:36:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wi_ieee.h,v 1.3.2.6 2002/01/08 00:30:14 nathanw Exp $  */
+/*     $NetBSD: wi_ieee.h,v 1.3.2.7 2002/01/09 00:36:29 nathanw Exp $  */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -185,15 +185,14 @@
  * from the WaveLAN. Not all of them are temendously useful, but I
  * list as many as I know about here for completeness.
  */
-
-#define WI_RID_DNLD_BUF                0xFD01
-#define WI_RID_MEMSZ           0xFD02
-#define WI_RID_CARDID          0xFD0B
-#define WI_RID_DOMAINS         0xFD11
-#define WI_RID_CIS             0xFD13
-#define WI_RID_COMMQUAL                0xFD43
-#define WI_RID_SCALETHRESH     0xFD46
-#define WI_RID_PCF             0xFD87
+#define WI_SCAN_RESULTS_MAXLEN 512
+struct wi_scan_results {
+       int                     truncated;      /* incomplete data in result */
+       u_int                   scanning;       /* in hz units */
+       struct timeval          lastscan;       /* time scan was completed */
+       u_int16_t               len;            /* number of words */
+       u_int16_t               scan_results[WI_SCAN_RESULTS_MAXLEN];
+};
 
 /*
  * Network parameters, static configuration entities.
@@ -239,11 +238,15 @@
 /*
  * Network parameters, dynamic configuration entities
  */
-#define WI_RID_MCAST_LIST      0xFC80 /* list of multicast addrs */
+#define WI_RID_MCAST_LIST      0xFC80 /* multicast addrs to put in filter */
 #define WI_RID_CREATE_IBSS     0xFC81 /* create IBSS */
 #define WI_RID_FRAG_THRESH     0xFC82 /* frag len, unicast msg xmit */
 #define WI_RID_RTS_THRESH      0xFC83 /* frame len for RTS/CTS handshake */
-#define WI_RID_TX_RATE         0xFC84 /* data rate for message xmit */
+#define WI_RID_TX_RATE         0xFC84 /* data rate for message xmit
+                                       * 0 == Fixed 1mbps
+                                       * 1 == Fixed 2mbps
+                                       * 2 == auto fallback
+                                       */
 #define WI_RID_PROMISC         0xFC85 /* enable promisc mode */
 #define WI_RID_FRAG_THRESH0    0xFC90
 #define WI_RID_FRAG_THRESH1    0xFC91
@@ -268,7 +271,7 @@
 #define WI_RID_TX_RATE6                0xFCA4
 #define WI_RID_DEFLT_CRYPT_KEYS        0xFCB0
 #define WI_RID_TX_CRYPT_KEY    0xFCB1
-#define WI_RID_TICK_TIME       0xFCE0
+#define WI_RID_TICK_TIME       0xFCE0  /* Auxiliary Timer tick interval */
 #define WI_RID_SCAN_REQ                0xFCE1
 #define WI_RID_JOIN_REQ                0xFCE2
 
@@ -286,7 +289,8 @@
 /*
  * NIC information
  */
-#define WI_RID_FIRM_ID         0xFD02 /* Primary func firmware ID. */
+#define WI_RID_DNLD_BUF                0xFD01
+#define WI_RID_MEMSZ           0xFD02 /* memory size info */
 #define WI_RID_PRI_SUP_RANGE   0xFD03 /* primary supplier compatibility */
 #define WI_RID_CIF_ACT_RANGE   0xFD04 /* controller sup. compatibility */
 #define WI_RID_SERIALNO                0xFD0A /* card serial number */
@@ -301,6 +305,9 @@
 #define WI_RID_STA_SUP_RANGE   0xFD21 /* station supplier compat */
 #define WI_RID_MFI_ACT_RANGE   0xFD22
 #define WI_RID_CFI_ACT_RANGE   0xFD33
+#define WI_RID_COMMQUAL                0xFD43
+#define WI_RID_SCALETHRESH     0xFD46
+#define WI_RID_PCF             0xFD87
 
 /*
  * MAC information
diff -r 5b5b2799de21 -r 48885b56e0bc sys/dev/ic/wireg.h
--- a/sys/dev/ic/wireg.h        Tue Jan 08 23:30:12 2002 +0000
+++ b/sys/dev/ic/wireg.h        Wed Jan 09 00:36:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wireg.h,v 1.7.2.7 2002/01/08 00:30:14 nathanw Exp $    */
+/*     $NetBSD: wireg.h,v 1.7.2.8 2002/01/09 00:36:29 nathanw Exp $    */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -96,18 +96,24 @@
  * register space access macros
  */
 #define CSR_WRITE_4(sc, reg, val)      \
-       bus_space_write_4(sc->sc_iot, sc->sc_ioh, reg, val)
+       bus_space_write_4(sc->sc_iot, sc->sc_ioh,       \
+                       (sc->sc_pci? reg * 2: reg) , val)
 #define CSR_WRITE_2(sc, reg, val)      \
-       bus_space_write_2(sc->sc_iot, sc->sc_ioh, reg, val)
+       bus_space_write_2(sc->sc_iot, sc->sc_ioh,       \
+                       (sc->sc_pci? reg * 2: reg), val)
 #define CSR_WRITE_1(sc, reg, val)      \
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, reg, val)
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh,       \
+                       (sc->sc_pci? reg * 2: reg), val)
 
 #define CSR_READ_4(sc, reg)            \
-       bus_space_read_4(sc->sc_iot, sc->sc_ioh, reg)
+       bus_space_read_4(sc->sc_iot, sc->sc_ioh,        \
+                       (sc->sc_pci? reg * 2: reg))
 #define CSR_READ_2(sc, reg)            \
-       bus_space_read_2(sc->sc_iot, sc->sc_ioh, reg)
+       bus_space_read_2(sc->sc_iot, sc->sc_ioh,        \
+                       (sc->sc_pci? reg * 2: reg))
 #define CSR_READ_1(sc, reg)            \
-       bus_space_read_1(sc->sc_iot, sc->sc_ioh, reg)
+       bus_space_read_1(sc->sc_iot, sc->sc_ioh,        \
+                       (sc->sc_pci? reg * 2: reg))
 
 #ifndef __BUS_SPACE_HAS_STREAM_METHODS
 #define bus_space_write_stream_2       bus_space_write_2
@@ -117,13 +123,17 @@
 #endif
 
 #define CSR_WRITE_STREAM_2(sc, reg, val)       \
-       bus_space_write_stream_2(sc->sc_iot, sc->sc_ioh, reg, val)
+       bus_space_write_stream_2(sc->sc_iot, sc->sc_ioh,        \
+                       (sc->sc_pci? reg * 2: reg), val)
 #define CSR_WRITE_MULTI_STREAM_2(sc, reg, val, count)  \
-       bus_space_write_multi_stream_2(sc->sc_iot, sc->sc_ioh, reg, val, count)
+       bus_space_write_multi_stream_2(sc->sc_iot, sc->sc_ioh,  \
+                       (sc->sc_pci? reg * 2: reg), val, count)
 #define CSR_READ_STREAM_2(sc, reg)             \
-       bus_space_read_stream_2(sc->sc_iot, sc->sc_ioh, reg)
+       bus_space_read_stream_2(sc->sc_iot, sc->sc_ioh, \
+                       (sc->sc_pci? reg * 2: reg))
 #define CSR_READ_MULTI_STREAM_2(sc, reg, buf, count)           \
-       bus_space_read_multi_stream_2(sc->sc_iot, sc->sc_ioh, reg, buf, count)
+       bus_space_read_multi_stream_2(sc->sc_iot, sc->sc_ioh,   \
+                       (sc->sc_pci? reg * 2: reg), buf, count)
 
 /*
  * The WaveLAN/IEEE cards contain an 802.11 MAC controller which Lucent
@@ -165,12 +175,13 @@
  */
 
 /*
- * Size of Hermes I/O space.
+ * Size of Hermes & Prism2 I/O space.
  */
 #define WI_IOSIZE              0x40
+#define WI_PCI_CBMA            0x10    /* Configuration Base Memory Address */
 
 /*
- * Hermes register definitions and what little I know about them.
+ * Hermes & Prism2 register definitions 
  */
 
 /* Hermes command/status registers. */
@@ -276,7 +287,7 @@
 #define WI_SW0                 0x28
 #define WI_SW1                 0x2A
 #define WI_SW2                 0x2C
-#define WI_SW3                 0x2E
+#define WI_SW3                 0x2E    /* does not appear in Prism2 */
 
 #define WI_CNTL                        0x14
 
@@ -291,6 +302,28 @@
 #define WI_AUX_DATA            0x3E
 
 /*
+ * PCI Host Interface Registers (HFA3842 Specific)
+ * The value of all Register's Offset, such as WI_INFO_FID and WI_PARAM0,
+ * has doubled.
+ * About WI_PCI_COR: In this Register, only soft-reset bit implement; Bit(7).
+ */
+#define WI_PCI_COR             0x4C
+#define WI_PCI_HCR             0x5C
+#define WI_PCI_MASTER0_ADDRH   0x80
+#define WI_PCI_MASTER0_ADDRL   0x84
+#define WI_PCI_MASTER0_LEN     0x88
+#define WI_PCI_MASTER0_CON     0x8C
+
+#define WI_PCI_STATUS          0x98
+
+#define WI_PCI_MASTER1_ADDRH   0xA0
+#define WI_PCI_MASTER1_ADDRL   0xA4
+#define WI_PCI_MASTER1_LEN     0xA8
+#define WI_PCI_MASTER1_CON     0xAC
+
+#define WI_PCI_SOFT_RESET      (1 << 7)
+
+/*
  * One form of communication with the Hermes is with what Lucent calls



Home | Main Index | Thread Index | Old Index