Module Name:    src
Committed By:   msaitoh
Date:           Fri Sep 14 09:51:09 UTC 2018

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

Log Message:
- Fix a bug that Denverton accessed wrong register in
  ixgbe_setup_low_power_mode(). The location of some registers in Denverton
  were changed. The GRC register is one of them, so use IXGBE_GRC_BY_MAC(hw)
  instead of IXGBE_GRC.
- ixgbe_check_wol_support() tests the capability of WOL, but the sysctl
  knobs for WOL were added only for IXGBE_DEV_ID_X550EM_X_10G_T. Add the
  knobs when adapter->wol_support is not 0.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 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.165 src/sys/dev/pci/ixgbe/ixgbe.c:1.166
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.165	Mon Sep  3 16:29:33 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Sep 14 09:51:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.165 2018/09/03 16:29:33 riastradh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.166 2018/09/14 09:51:09 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -3279,7 +3279,7 @@ ixgbe_add_device_sysctls(struct adapter 
 			aprint_error_dev(dev, "could not create sysctl\n");
 
 	/* for WoL-capable devices */
-	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if (adapter->wol_support) {
 		if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READWRITE,
 		    CTLTYPE_BOOL, "wol_enable",
 		    SYSCTL_DESCR("Enable/Disable Wake on LAN"),
@@ -3665,8 +3665,8 @@ ixgbe_setup_low_power_mode(struct adapte
 		IXGBE_WRITE_REG(hw, IXGBE_WUC, 0);
 	} else {
 		/* Turn off support for APM wakeup. (Using ACPI instead) */
-		IXGBE_WRITE_REG(hw, IXGBE_GRC,
-		    IXGBE_READ_REG(hw, IXGBE_GRC) & ~(u32)2);
+		IXGBE_WRITE_REG(hw, IXGBE_GRC_BY_MAC(hw),
+		    IXGBE_READ_REG(hw, IXGBE_GRC_BY_MAC(hw)) & ~(u32)2);
 
 		/*
 		 * Clear Wake Up Status register to prevent any previous wakeup

Reply via email to