Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Only print an error about missing I/O BARs for c...



details:   https://anonhg.NetBSD.org/src/rev/949510c3a6c0
branches:  trunk
changeset: 989880:949510c3a6c0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 18 11:36:11 2021 +0000

description:
Only print an error about missing I/O BARs for chips that need it.

diffstat:

 sys/dev/pci/if_wm.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 58ccf2c2cc37 -r 949510c3a6c0 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Mon Oct 18 10:47:44 2021 +0000
+++ b/sys/dev/pci/if_wm.c       Mon Oct 18 11:36:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.709 2021/10/18 11:36:11 jmcneill Exp $     */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.709 2021/10/18 11:36:11 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2016,7 +2016,12 @@
         * this driver) to use it for normal operation, though it is
         * required to work around bugs in some chip versions.
         */
-       if (sc->sc_type >= WM_T_82544) {
+       switch (sc->sc_type) {
+       case WM_T_82544:
+       case WM_T_82541:
+       case WM_T_82541_2:
+       case WM_T_82547:
+       case WM_T_82547_2:
                /* First we have to find the I/O BAR. */
                for (i = PCI_MAPREG_START; i < PCI_MAPREG_END; i += 4) {
                        memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, i);
@@ -2049,7 +2054,9 @@
                                aprint_error_dev(sc->sc_dev,
                                    "WARNING: unable to map I/O space\n");
                }
-
+               break;
+       default:
+               break;
        }
 
        /* Enable bus mastering.  Disable MWI on the i82542 2.0. */



Home | Main Index | Thread Index | Old Index