Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Don't print the Image Unique ID if an NVM is iNV...



details:   https://anonhg.NetBSD.org/src/rev/81c86216bcfc
branches:  trunk
changeset: 354641:81c86216bcfc
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jun 23 06:10:31 2017 +0000

description:
Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).

diffstat:

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

diffs (52 lines):

diff -r d59454266992 -r 81c86216bcfc sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Jun 23 05:46:10 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Jun 23 06:10:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.511 2017/06/20 10:10:36 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.512 2017/06/23 06:10:31 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.511 2017/06/20 10:10:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.512 2017/06/23 06:10:31 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -12172,6 +12172,7 @@
        bool check_version = false;
        bool check_optionrom = false;
        bool have_build = false;
+       bool have_uid = true;
 
        /*
         * Version format:
@@ -12208,10 +12209,12 @@
                break;
        case WM_T_I211:
                wm_nvm_version_invm(sc);
+               have_uid = false;
                goto printver;
        case WM_T_I210:
                if (!wm_nvm_get_flash_presence_i210(sc)) {
                        wm_nvm_version_invm(sc);
+                       have_uid = false;
                        goto printver;
                }
                /* FALLTHROUGH */
@@ -12265,8 +12268,10 @@
                }
        }
 
-       wm_nvm_read(sc, NVM_OFF_IMAGE_UID0, 1, &uid0);
-       aprint_verbose(", Image Unique ID %08x", (uid1 << 16) | uid0);
+       if (have_uid) {
+               wm_nvm_read(sc, NVM_OFF_IMAGE_UID0, 1, &uid0);
+               aprint_verbose(", Image Unique ID %08x", (uid1 << 16) | uid0);
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index