Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Use correct IWN_HW_REV_TYPE_MASK.



details:   https://anonhg.NetBSD.org/src/rev/b2b3b233aae0
branches:  trunk
changeset: 333573:b2b3b233aae0
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Sun Nov 09 14:40:54 2014 +0000

description:
Use correct IWN_HW_REV_TYPE_MASK.

diffstat:

 sys/dev/pci/if_iwn.c    |  8 +++++---
 sys/dev/pci/if_iwnreg.h |  4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r 80498fb02373 -r b2b3b233aae0 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sun Nov 09 14:33:21 2014 +0000
+++ b/sys/dev/pci/if_iwn.c      Sun Nov 09 14:40:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwn.c,v 1.73 2014/11/09 14:29:13 nonaka Exp $       */
+/*     $NetBSD: if_iwn.c,v 1.74 2014/11/09 14:40:54 nonaka Exp $       */
 /*     $OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $     */
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.73 2014/11/09 14:29:13 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.74 2014/11/09 14:40:54 nonaka Exp $");
 
 #define IWN_USE_RBUF   /* Use local storage for RX */
 #undef IWN_HWCRYPTO    /* XXX does not even compile yet */
@@ -436,7 +436,9 @@
        aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
        /* Read hardware revision and attach. */
-       sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xf;
+       sc->hw_type =
+           (IWN_READ(sc, IWN_HW_REV) & IWN_HW_REV_TYPE_MASK)
+             >> IWN_HW_REV_TYPE_SHIFT;
        if (sc->hw_type == IWN_HW_REV_TYPE_4965)
                error = iwn4965_attach(sc, PCI_PRODUCT(pa->pa_id));
        else
diff -r 80498fb02373 -r b2b3b233aae0 sys/dev/pci/if_iwnreg.h
--- a/sys/dev/pci/if_iwnreg.h   Sun Nov 09 14:33:21 2014 +0000
+++ b/sys/dev/pci/if_iwnreg.h   Sun Nov 09 14:40:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwnreg.h,v 1.14 2014/10/30 13:05:58 nonaka Exp $    */
+/*     $NetBSD: if_iwnreg.h,v 1.15 2014/11/09 14:40:54 nonaka Exp $    */
 /*     $OpenBSD: if_iwnreg.h,v 1.49 2014/09/09 18:56:24 sthen Exp $    */
 
 /*-
@@ -201,7 +201,7 @@
 
 /* Possible flags for register IWN_HW_REV. */
 #define IWN_HW_REV_TYPE_SHIFT  4
-#define IWN_HW_REV_TYPE_MASK   0x000000f0
+#define IWN_HW_REV_TYPE_MASK   0x000001f0
 #define IWN_HW_REV_TYPE_4965   0
 #define IWN_HW_REV_TYPE_5300   2
 #define IWN_HW_REV_TYPE_5350   3



Home | Main Index | Thread Index | Old Index