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 Fix a bug that hw.ixgN.wol_enable=0 doesn'...
details: https://anonhg.NetBSD.org/src/rev/53ac5c29b171
branches: trunk
changeset: 349928:53ac5c29b171
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Dec 28 09:29:35 2016 +0000
description:
Fix a bug that hw.ixgN.wol_enable=0 doesn't work correctly. Clear the WUC
and WUFC register if wol_enable is 0. ixgbe_setup_low_power_mode() calls
ixgbe_stop() and it resets the chip. The reset change WUC and WUFC registers to
the default, so clearing WUC and WUFC should be done after ixgbe_stop().
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diffs (61 lines):
diff -r a82be5bdcc50 -r 53ac5c29b171 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Dec 28 08:57:20 2016 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Dec 28 09:29:35 2016 +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.57 2016/12/28 07:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.58 2016/12/28 09:29:35 msaitoh Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -4157,12 +4157,27 @@
KASSERT(mutex_owned(&adapter->core_mtx));
- if (!hw->wol_enabled)
- ixgbe_set_phy_power(hw, FALSE);
-
/* Limit power management flow to X550EM baseT */
if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T
&& hw->phy.ops.enter_lplu) {
+ /* X550EM baseT adapters need a special LPLU flow */
+ hw->phy.reset_disable = true;
+ ixgbe_stop(adapter);
+ error = hw->phy.ops.enter_lplu(hw);
+ if (error)
+ device_printf(dev,
+ "Error entering LPLU: %d\n", error);
+ hw->phy.reset_disable = false;
+ } else {
+ /* Just stop for other adapters */
+ ixgbe_stop(adapter);
+ }
+
+ if (!hw->wol_enabled) {
+ ixgbe_set_phy_power(hw, FALSE);
+ IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0);
+ 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);
@@ -4183,17 +4198,6 @@
IXGBE_WRITE_REG(hw, IXGBE_WUC,
IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN);
- /* X550EM baseT adapters need a special LPLU flow */
- hw->phy.reset_disable = true;
- ixgbe_stop(adapter);
- error = hw->phy.ops.enter_lplu(hw);
- if (error)
- device_printf(dev,
- "Error entering LPLU: %d\n", error);
- hw->phy.reset_disable = false;
- } else {
- /* Just stop for other adapters */
- ixgbe_stop(adapter);
}
return error;
Home |
Main Index |
Thread Index |
Old Index