Wake on LAN for USB ethernet?
Subsystems (4)
Is it reasonable to expect that Wake on LAN works if the target box is connected via a USB-to-ethernet adapter?
One of my validation testers has a USB ethernet device that successfully wakes up Windows from hibernate (S4), but it doesn't work under Linux. Wake on LAN works fine with the hardwired ethernet port. USB remote wakeup from S3/S4 works fine with a USB keyboard.
So I need to figure out if it's an issue with the kernel, their test suite, or the USB host controller.
I've experimented with USB ethernet devices with the pegasus driver with no success. Here's what I've tried:
1. Connect the USB to ethernet adapter to the rootport under the xHCI (USB 3.0) host controller. (lsusb for the two devices I've tried is attached)
2. Enable remote wakeup for all devices (including the PCI host) by echoing 'enabled' to power/wakeup. (script for that attached)
3. Use ethtool to turn on WOL:
sudo ethtool -s ethX wol g
4. Find the MAC address by running ifconfig and looking at the HWaddr field.
5. Verify with wireshark that I can see the Magic WOL packet when I run this command on another machine:
sudo etherwake -i ethX macaddr
6. Suspend or hibernate the target machine, and then send the Magic WOL packet from a second machine.
Am I missing any steps in testing this? Does WOL just not work for USB ethernet devices under Linux? Perhaps just the pegasus driver doesn't support WOL?
Note that I can't currently test USB remote wakeup for any devices under the EHCI host controller on my Lenovo x230. For some reason, whenever I enable remote wakeup for the rate matching hub under the EHCI host, the system will immediately resume when I attempt to suspend it. Don't know why yet.
Sarah Sharp
Bus 003 Device 013: ID 050d:0121 Belkin Components F5D5050 100Mbps Ethernet Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x050d Belkin Components idProduct 0x0121 F5D5050 100Mbps Ethernet bcdDevice 1.01 iManufacturer 1 ADMtek iProduct 2 USB To LAN Converter iSerial 3 0001 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 160mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 0 (Defined at Interface level)
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
Bus 003 Device 012: ID 07a6:8513 ADMtek, Inc. AN8513 Ethernet Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 255
bMaxPacketSize0 8
idVendor 0x07a6 ADMtek, Inc.
idProduct 0x8513 AN8513 Ethernet
bcdDevice 2.01
iManufacturer 1 USB iProduct 2 SMC2208USB/ETH iSerial 3 33D0 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 160mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 255
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled
Quoted 2 lines · Sarah Sharp
Is it reasonable to expect that Wake on LAN works if the target box is connected via a USB-to-ethernet adapter?
It is surely reasonable, and seems SMSC75xx or SMSC95xx can bring system out of suspend.
Quoted 17 lines
One of my validation testers has a USB ethernet device that successfully wakes up Windows from hibernate (S4), but it doesn't work under Linux. Wake on LAN works fine with the hardwired ethernet port. USB remote wakeup from S3/S4 works fine with a USB keyboard.
So I need to figure out if it's an issue with the kernel, their test suite, or the USB host controller.
I've experimented with USB ethernet devices with the pegasus driver with no success. Here's what I've tried:
1. Connect the USB to ethernet adapter to the rootport under the xHCI (USB 3.0) host controller. (lsusb for the two devices I've tried is attached)
Quoted 5 lines
2. Enable remote wakeup for all devices (including the PCI host) by echoing 'enabled' to power/wakeup. (script for that attached)
3. Use ethtool to turn on WOL:
sudo ethtool -s ethX wol g
Could you check here if the attribute 'power/wakeup' of the USB device has been enabled? If so, and step 6 still can't wakeup system, the problem may be in the set_wol stetting on hardware of the driver since your USB wakeup works.
Also, the wakeup enabling is missed in the pegasus_set_wol(), and the below patch is needed:
drivers/net/usb/pegasus.c +0 -0
@@ -1096,6 +1096,7 @@ pegasus_set_wol(struct net_device *dev, struct
ethtool_wolinfo *wol)
{
pegasus_t *pegasus = netdev_priv(dev);
u8 reg78 = 0x04;
+ int ret;
if (wol->wolopts & ~WOL_SUPPORTED)
return -EINVAL;
@@ -1110,7 +1111,11 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
else
pegasus->eth_regs[0] &= ~0x10;
pegasus->wolopts = wol->wolopts;
- return set_register(pegasus, WakeupControl, reg78);
+
+ ret = set_register(pegasus, WakeupControl, reg78);
+ if (!ret)
+ ret = device_set_wakeup_enable(&pegasus->usb->dev, 1);
+ return ret;
}
static inline void pegasus_reset_wol(struct net_device *dev)
Quoted 8 lines
4. Find the MAC address by running ifconfig and looking at the HWaddr field.
5. Verify with wireshark that I can see the Magic WOL packet when I run this command on another machine:
sudo etherwake -i ethX macaddr
Quoted 7 lines
6. Suspend or hibernate the target machine, and then send the Magic WOL packet from a second machine.
Am I missing any steps in testing this? Does WOL just not work for USB ethernet devices under Linux? Perhaps just the pegasus driver doesn't support WOL?
Probably the set_wol of pegasus is broken if wakeup has been enabled on the USB device.
Thanks,
--
Ming Lei
Petko Manolov
maintainerThe code in the driver is based on the specs from ADMTek (later, Infineon). Since i never suspend my machines this feature has not been tested by me.
However, if the proposed patch is the right thing to do i'd be happy to see it applied.
cheers,
Petko
Quoted 91 lines · Ming Lei
Quoted 2 lines · Sarah Sharp
Is it reasonable to expect that Wake on LAN works if the target box is connected via a USB-to-ethernet adapter?
It is surely reasonable, and seems SMSC75xx or SMSC95xx can bring system out of suspend.
Quoted 17 lines
One of my validation testers has a USB ethernet device that successfully wakes up Windows from hibernate (S4), but it doesn't work under Linux. Wake on LAN works fine with the hardwired ethernet port. USB remote wakeup from S3/S4 works fine with a USB keyboard.
So I need to figure out if it's an issue with the kernel, their test suite, or the USB host controller.
I've experimented with USB ethernet devices with the pegasus driver with no success. Here's what I've tried:
1. Connect the USB to ethernet adapter to the rootport under the xHCI (USB 3.0) host controller. (lsusb for the two devices I've tried is attached)
Quoted 5 lines
2. Enable remote wakeup for all devices (including the PCI host) by echoing 'enabled' to power/wakeup. (script for that attached)
3. Use ethtool to turn on WOL:
sudo ethtool -s ethX wol gCould you check here if the attribute 'power/wakeup' of the USB device has been enabled? If so, and step 6 still can't wakeup system, the problem may be in the
set_wolstetting on hardware of the driver since your USB wakeup works.Also, the wakeup enabling is missed in the
pegasus_set_wol(), and the below patch is needed:drivers/net/usb/pegasus.c +1
-0@@ -1096,6 +1096,7 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) {pegasus_t *pegasus =netdev_priv (dev);u8 reg78 =0x04 ; +int ret;if (wol->wolopts & ~WOL_SUPPORTED )return -EINVAL;drivers/net/usb/pegasus.c +5
-1@@ -1110,7 +1111,11 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) else pegasus->eth_regs[0] &= ~0x10; pegasus->wolopts = wol->wolopts; -return set_register (pegasus, WakeupControl, reg78); + + ret =set_register (pegasus, WakeupControl, reg78); +if (!ret) + ret =device_set_wakeup_enable (&pegasus->usb->dev,1 ); +return ret; }static inline void
pegasus_reset_wol(struct net_device *dev)Quoted 8 lines
4. Find the MAC address by running ifconfig and looking at the HWaddr field.
5. Verify with wireshark that I can see the Magic WOL packet when I run this command on another machine:
sudo etherwake -i ethX macaddrQuoted 7 lines
6. Suspend or hibernate the target machine, and then send the Magic WOL packet from a second machine.
Am I missing any steps in testing this? Does WOL just not work for USB ethernet devices under Linux? Perhaps just the pegasus driver doesn't support WOL?
Probably the
set_wolof pegasus is broken if wakeup has been enabled on the USB device.Thanks,
--
Ming Lei
A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.02.1301181047290.3637-dzx9CreErbMJK7zW1S5TsVaTQe2KTcn/@public.gmane.org
Quoted 5 lines · Petko Manolov
The code in the driver is based on the specs from ADMTek (later, Infineon). Since i never suspend my machines this feature has not been tested by me.
However, if the proposed patch is the right thing to do i'd be happy to see it applied.
I think it is the right thing, at least many network drivers do that, such as smsc usbnet drivers and many of PCI ethernet drivers.
So I will prepare one formal version for merge.
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html