Module Name:    src
Committed By:   msaitoh
Date:           Fri Feb 24 05:38:30 UTC 2017

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

Log Message:
 Print mac.type and the TrackID.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixgbe_type.h

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.78 src/sys/dev/pci/ixgbe/ixgbe.c:1.79
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.78	Thu Feb 16 08:01:11 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Feb 24 05:38:30 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.78 2017/02/16 08:01:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.79 2017/02/24 05:38:30 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -453,10 +453,11 @@ ixgbe_attach(device_t parent, device_t d
 	struct adapter *adapter;
 	struct ixgbe_hw *hw;
 	int             error = -1;
-	u16		csum;
+	u16		csum, high, low;
 	u32		ctrl_ext;
 	ixgbe_vendor_info_t *ent;
 	struct pci_attach_args *pa = aux;
+	const char *str;
 
 	INIT_DEBUGOUT("ixgbe_attach: begin");
 
@@ -493,6 +494,40 @@ ixgbe_attach(device_t parent, device_t d
 	/* Determine hardware revision */
 	ixgbe_identify_hardware(adapter);
 
+	switch (hw->mac.type) {
+	case ixgbe_mac_82598EB:
+		str = "82598EB";
+		break;
+	case ixgbe_mac_82599EB:
+		str = "82599EB";
+		break;
+	case ixgbe_mac_82599_vf:
+		str = "82599 VF";
+		break;
+	case ixgbe_mac_X540:
+		str = "X540";
+		break;
+	case ixgbe_mac_X540_vf:
+		str = "X540 VF";
+		break;
+	case ixgbe_mac_X550:
+		str = "X550";
+		break;
+	case ixgbe_mac_X550EM_x:
+		str = "X550EM";
+		break;
+	case ixgbe_mac_X550_vf:
+		str = "X550 VF";
+		break;
+	case ixgbe_mac_X550EM_x_vf:
+		str = "X550EM X VF";
+		break;
+	default:
+		str = "Unknown";
+		break;
+	}
+	aprint_normal_dev(dev, "device %s\n", str);
+
 	/* Do base PCI setup - map BAR0 */
 	if (ixgbe_allocate_pci_resources(adapter, pa)) {
 		aprint_error_dev(dev, "Allocation of PCI resources failed\n");
@@ -582,6 +617,11 @@ ixgbe_attach(device_t parent, device_t d
 		goto err_late;
 	}
 
+	/* Print the TrackID */
+	hw->eeprom.ops.read(hw, IXGBE_TRACKID_H, &high);
+	hw->eeprom.ops.read(hw, IXGBE_TRACKID_L, &low);
+	aprint_normal_dev(dev, "TrackID %08x\n", ((uint32_t)high << 16) | low);
+
 	error = ixgbe_init_hw(hw);
 	switch (error) {
 	case IXGBE_ERR_EEPROM_VERSION:

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.18 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.19
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.18	Thu Jan 19 06:56:33 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Fri Feb 24 05:38:30 2017
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.18 2017/01/19 06:56:33 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.19 2017/02/24 05:38:30 msaitoh Exp $*/
 
 #ifndef _IXGBE_TYPE_H_
 #define _IXGBE_TYPE_H_
@@ -2225,6 +2225,8 @@ enum {
 
 #define IXGBE_SAN_MAC_ADDR_PTR		0x28
 #define IXGBE_DEVICE_CAPS		0x2C
+#define IXGBE_TRACKID_L			0x2d
+#define IXGBE_TRACKID_H			0x2e
 #define IXGBE_SERIAL_NUMBER_MAC_ADDR	0x11
 #define IXGBE_PCIE_MSIX_82599_CAPS	0x72
 #define IXGBE_MAX_MSIX_VECTORS_82599	0x40

Reply via email to