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 Print mac.type and the TrackID.



details:   https://anonhg.NetBSD.org/src/rev/4285470225f8
branches:  trunk
changeset: 821984:4285470225f8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Feb 24 05:38:30 2017 +0000

description:
Print mac.type and the TrackID.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c      |  44 ++++++++++++++++++++++++++++++++++++++++-
 sys/dev/pci/ixgbe/ixgbe_type.h |   4 ++-
 2 files changed, 45 insertions(+), 3 deletions(-)

diffs (99 lines):

diff -r f24d4e31f538 -r 4285470225f8 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 24 05:04:46 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 24 05:38:30 2017 +0000
@@ -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 @@
        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 @@
        /* 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 @@
                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:
diff -r f24d4e31f538 -r 4285470225f8 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h    Fri Feb 24 05:04:46 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h    Fri Feb 24 05:38:30 2017 +0000
@@ -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 @@
 
 #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



Home | Main Index | Thread Index | Old Index