diff mbox

[net,2/2] ixgbe: fix WoL issue with fiber

Message ID 1334393478-31885-3-git-send-email-jeffrey.t.kirsher@intel.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Kirsher, Jeffrey T April 14, 2012, 8:51 a.m. UTC
From: Don Skidmore <donald.c.skidmore@intel.com>

There are times we turn of the laser before shutdown.  This is a bad thing
if we want to wake on lan to work so now we make sure the laser is on
before shutdown if we support WoL.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Comments

Jan Ceuleers April 14, 2012, 6:47 p.m. UTC | #1
Jeff Kirsher wrote:
> From: Don Skidmore<donald.c.skidmore@intel.com>
>
> There are times we turn of the laser before shutdown.  This is a bad thing
> if we want to wake on lan to work so now we make sure the laser is on
> before shutdown if we support WoL.

I'm ever-so-sorry if this is a silly question, but:

WOL is receive-only, right? Why does the laser need to be on?

Thanks, Jan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Skidmore, Donald C April 16, 2012, 1:57 p.m. UTC | #2
>-----Original Message-----
>From: Jan Ceuleers [mailto:jan.ceuleers@computer.org]
>Sent: Saturday, April 14, 2012 11:48 AM
>To: Kirsher, Jeffrey T
>Cc: davem@davemloft.net; Skidmore, Donald C; netdev@vger.kernel.org;
>gospo@redhat.com; sassmann@redhat.com
>Subject: Re: [net 2/2] ixgbe: fix WoL issue with fiber
>
>Jeff Kirsher wrote:
>> From: Don Skidmore<donald.c.skidmore@intel.com>
>>
>> There are times we turn of the laser before shutdown.  This is a bad
>thing
>> if we want to wake on lan to work so now we make sure the laser is on
>> before shutdown if we support WoL.
>
>I'm ever-so-sorry if this is a silly question, but:
>
>WOL is receive-only, right? Why does the laser need to be on?
>
>Thanks, Jan

Without the laser on we can't get link and without link we can't get the magic packet to wake us up.

Thanks,
-Don Skidmore <donald.c.skidmore@intel.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 3e26b1f..dac7c01 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4893,6 +4893,16 @@  static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
 	if (wufc) {
 		ixgbe_set_rx_mode(netdev);
 
+		/*
+		 * enable the optics for both mult-speed fiber and
+		 * 82599 SFP+ fiber as we can WoL.
+		 */
+		if (hw->mac.ops.enable_tx_laser &&
+		    (hw->phy.multispeed_fiber ||
+		    (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber &&
+		     hw->mac.type == ixgbe_mac_82599EB)))
+			hw->mac.ops.enable_tx_laser(hw);
+
 		/* turn on all-multi mode if wake on multicast is enabled */
 		if (wufc & IXGBE_WUFC_MC) {
 			fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);