Module Name:    src
Committed By:   msaitoh
Date:           Wed Oct 25 04:45:41 UTC 2017

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.106 src/sys/dev/pci/ixgbe/ixgbe.c:1.107
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.106	Mon Oct 23 09:31:18 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Oct 25 04:45:41 2017
@@ -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 @@ ixgbe_attach(device_t parent, device_t d
 		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 @@ ixgbe_attach(device_t parent, device_t d
 			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 @@ ixgbe_attach(device_t parent, device_t d
 		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 @@ ixgbe_attach(device_t parent, device_t d
 			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,

Reply via email to