Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/ixgbe - For X550 and newer, print NVM Image Vers...



details:   https://anonhg.NetBSD.org/src/rev/0a78104fca5a
branches:  trunk
changeset: 357059:0a78104fca5a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Oct 25 04:45:41 2017 +0000

description:
- For X550 and newer, print NVM Image Version with %u.%02x (e.g. "0.05").
- Fix value check of OEM_NVM_IMAGE_VER.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r fbc4ca4280d1 -r 0a78104fca5a sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Oct 25 04:33:15 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Oct 25 04:45:41 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.106 2017/10/23 09:31:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.107 2017/10/25 04:45:41 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -972,8 +972,13 @@
                high = (nvmreg >> 12) & 0x0f;
                low = (nvmreg >> 4) & 0xff;
                id = nvmreg & 0x0f;
-               aprint_normal(" NVM Image Version %u.%u ID 0x%x,", high, low,
-                   id);
+               aprint_normal(" NVM Image Version %u.", high);
+               if (hw->mac.type == ixgbe_mac_X540)
+                       str = "%x";
+               else
+                       str = "%02x";
+               aprint_normal(str, low);
+               aprint_normal(" ID 0x%x,", id);
                break;
        case ixgbe_mac_X550EM_x:
        case ixgbe_mac_X550:
@@ -982,7 +987,7 @@
                        break;
                high = (nvmreg >> 12) & 0x0f;
                low = nvmreg & 0xff;
-               aprint_normal(" NVM Image Version %u.%u,", high, low);
+               aprint_normal(" NVM Image Version %u.%02x,", high, low);
                break;
        default:
                break;
@@ -998,7 +1003,7 @@
                high = (nvmreg >> 12) & 0x0f;
                low = (nvmreg >> 4) & 0xff;
                id = nvmreg & 0x000f;
-               aprint_normal(" PHY FW Revision %u.%u ID 0x%x,", high, low,
+               aprint_normal(" PHY FW Revision %u.%02x ID 0x%x,", high, low,
                    id);
                break;
        default:
@@ -1017,7 +1022,7 @@
                        aprint_normal(" NVM Map version %u.%02x,", high, low);
                }
                hw->eeprom.ops.read(hw, IXGBE_OEM_NVM_IMAGE_VER, &nvmreg);
-               if (nvmreg == 0xffff) {
+               if (nvmreg != 0xffff) {
                        high = (nvmreg >> 12) & 0x0f;
                        low = nvmreg & 0x00ff;
                        aprint_verbose(" OEM NVM Image version %u.%02x,", high,



Home | Main Index | Thread Index | Old Index