Module Name: src Committed By: msaitoh Date: Wed Oct 11 09:43:17 UTC 2023
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h Log Message: ixg(4): Print DEVICE_CAPS register. To generate a diff of this commit: cvs rdiff -u -r1.339 -r1.340 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.60 -r1.61 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.339 src/sys/dev/pci/ixgbe/ixgbe.c:1.340 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.339 Wed Oct 11 03:48:35 2023 +++ src/sys/dev/pci/ixgbe/ixgbe.c Wed Oct 11 09:43:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.339 2023/10/11 03:48:35 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.340 2023/10/11 09:43:17 msaitoh Exp $ */ /****************************************************************************** @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.339 2023/10/11 03:48:35 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.340 2023/10/11 09:43:17 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -809,7 +809,7 @@ ixgbe_attach(device_t parent, device_t d struct ixgbe_hw *hw; int error = -1; u32 ctrl_ext; - u16 high, low, nvmreg; + u16 high, low, nvmreg, dev_caps; pcireg_t id, subid; const ixgbe_vendor_info_t *ent; struct pci_attach_args *pa = aux; @@ -1277,10 +1277,15 @@ ixgbe_attach(device_t parent, device_t d if (sc->feat_en & IXGBE_FEATURE_NETMAP) ixgbe_netmap_attach(sc); + /* Print some flags */ snprintb(buf, sizeof(buf), IXGBE_FEATURE_FLAGS, sc->feat_cap); aprint_verbose_dev(dev, "feature cap %s\n", buf); snprintb(buf, sizeof(buf), IXGBE_FEATURE_FLAGS, sc->feat_en); aprint_verbose_dev(dev, "feature ena %s\n", buf); + if (ixgbe_get_device_caps(hw, &dev_caps) == 0) { + snprintb(buf, sizeof(buf), IXGBE_DEVICE_CAPS_FLAGS, dev_caps); + aprint_verbose_dev(dev, "device cap %s\n", buf); + } if (pmf_device_register(dev, ixgbe_suspend, ixgbe_resume)) pmf_class_network_register(dev, sc->ifp); Index: src/sys/dev/pci/ixgbe/ixgbe_type.h diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.60 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.61 --- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.60 Fri Oct 6 14:48:08 2023 +++ src/sys/dev/pci/ixgbe/ixgbe_type.h Wed Oct 11 09:43:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_type.h,v 1.60 2023/10/06 14:48:08 msaitoh Exp $ */ +/* $NetBSD: ixgbe_type.h,v 1.61 2023/10/11 09:43:17 msaitoh Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -2553,6 +2553,10 @@ enum { #define IXGBE_DEVICE_CAPS_WOL_PORT0 0x8 /* WoL supported on port 0 */ #define IXGBE_DEVICE_CAPS_WOL_MASK 0xC /* Mask for WoL capabilities */ +#define IXGBE_DEVICE_CAPS_FLAGS "\20" \ + "\1ALLOW_ANY_SFP" "\2FCOE_OFFLOAD" "\3WOL_PORT0_1" "\4WOL_PORT0" \ + "\10NO_CROSSTALK_WR" + /* PCI Bus Info */ #define IXGBE_PCI_DEVICE_STATUS 0xAA #define IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING 0x0020