Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Update from OpenBSD merging in 1.111 and 1.112 w...



details:   https://anonhg.NetBSD.org/src/rev/72753dc222ed
branches:  trunk
changeset: 770203:72753dc222ed
user:      elric <elric%NetBSD.org@localhost>
date:      Fri Oct 07 22:42:18 2011 +0000

description:
Update from OpenBSD merging in 1.111 and 1.112 with log messages:

1.112   Differential gain calibration makes the 6005 firmware crap
        out, so skip it for now until we figure out why.  This
        probably means the device won't function optimally, but
        that's better than not functioning at all.  Makes my "Intel
        Centrinto Advanced-N 6205" work quite well.

1.111   The 6005 and 6050-based parts need DC calibration turned
        on, otherwise the firmware will crap out, at least on the
        6005.  First step to getting my "Intel Centrino Advanced-N
        6205" to work.

Both are commited by kettenis%openbsd.org@localhost.

diffstat:

 sys/dev/pci/if_iwn.c |  36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diffs (78 lines):

diff -r ed56da9e2931 -r 72753dc222ed sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Fri Oct 07 22:30:56 2011 +0000
+++ b/sys/dev/pci/if_iwn.c      Fri Oct 07 22:42:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $        */
+/*     $NetBSD: if_iwn.c,v 1.59 2011/10/07 22:42:18 elric Exp $        */
 /*     $OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $      */
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.59 2011/10/07 22:42:18 elric Exp $");
 
 #define IWN_USE_RBUF   /* Use local storage for RX */
 #undef IWN_HWCRYPTO    /* XXX does not even compile yet */
@@ -226,6 +226,7 @@
                    const struct iwn_rx_stats *);
 static int     iwn_send_sensitivity(struct iwn_softc *);
 static int     iwn_set_pslevel(struct iwn_softc *, int, int, int);
+static int     iwn5000_runtime_calib(struct iwn_softc *);
 static int     iwn_config(struct iwn_softc *);
 static int     iwn_scan(struct iwn_softc *, uint16_t);
 static int     iwn_auth(struct iwn_softc *);
@@ -2173,6 +2174,14 @@
                return;
        }
 
+       /*
+        * XXX Differential gain calibration makes the 6005 firmware
+        * crap out, so skip it for now.  This effectively disables
+        * sensitivity tuning as well.
+        */
+       if (sc->hw_type == IWN_HW_REV_TYPE_6005)
+               return;
+
        if (calib->state == IWN_CALIB_STATE_ASSOC)
                iwn_collect_noise(sc, &stats->rx.general);
        else if (calib->state == IWN_CALIB_STATE_RUN)
@@ -4089,6 +4098,18 @@
        return iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, async);
 }
 
+ int
+iwn5000_runtime_calib(struct iwn_softc *sc)
+{
+       struct iwn5000_calib_config cmd;
+
+       memset(&cmd, 0, sizeof cmd);
+       cmd.ucode.once.enable = 0xffffffff;
+       cmd.ucode.once.start = IWN5000_CALIB_DC;
+       DPRINTF(("configuring runtime calibration\n"));
+       return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0);
+}
+
 static int
 iwn_config(struct iwn_softc *sc)
 {
@@ -4100,6 +4121,17 @@
        uint16_t rxchain;
        int error;
 
+       if (sc->hw_type == IWN_HW_REV_TYPE_6050 ||
+           sc->hw_type == IWN_HW_REV_TYPE_6005) {
+               /* Configure runtime DC calibration. */
+               error = iwn5000_runtime_calib(sc);
+               if (error != 0) {
+                       printf("%s: could not configure runtime calibration\n",
+                           sc->sc_dev.dv_xname);
+                       return error;
+               }
+       }
+
        /* Configure valid TX chains for 5000 Series. */
        if (sc->hw_type != IWN_HW_REV_TYPE_4965) {
                txmask = htole32(sc->txchainmask);



Home | Main Index | Thread Index | Old Index