R-Car/Tests:sh eth

This document describes test procedures for Renesas Electronics SH EtherMAC.

Wake-on-Lan
Some versions of SH EtherMAC supports Wake-on-Lan using MagicPacket, this describes how to test it on the Renesas Koelsch board. Wake-on-Lan is not yet available in upstream Linux but exist in renesas-drivers tree (git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git).

To test WoL the target (Koelsch) and the host needs to have working network configuration. It's possible to have target and host on different subnets as long as packets can be routed directly from host to target. However for this test it is assumed target and host are directly connected and on the same subnet, that way we don't have to worry about routing and such. The network interface on target are named eth0 and the interface on the host are named net0.

1. Find out the MAC address of the target, for example by running the ip command on the target itself.

root@koelsch ~ # ip address show eth0 2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 2e:09:0a:00:3d:cf brd ff:ff:ff:ff:ff:ff inet 10.0.1.6/24 brd 10.0.1.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::2c09:aff:fe00:3dcf/64 scope link valid_lft forever preferred_lft forever

The MAC address 2e:09:0a:00:3d:cf will be used in this example.

2. Set target to listen and wake-up by MagicPacket received on eth0 using ethtool.

root@koelsch ~ # ethtool -s eth0 wol g

3. Suspend target.

root@koelsch ~ # echo mem > /sys/power/state

4. Wake target up by sending MagicPacket from host interface net0 to a target with MAC address 2e:09:0a:00:3d:cf using the tool etherwake.

root@host ~ # etherwake -i net0 2e:09:0a:00:3d:cf

Caution: There are alternatives to etherwake which can be used to send a MagicPacket, a common one is wol. If you use wol to send MagicPacket from a host with more then one network interface you are not asked with interface on the host to send on instead which IP address the target have, this is then used to figure out which interface to use. If the IP given to wol do not have a complete entry in the hosts ARP table it will be sent on the host default interface which might or might not be the correct, wol will in any case report that sending of MagicPacket are OK. If WoL do not work for you or more likely stops working at random please make sure MagicPacket are sent out on correct interface as the ARP cache entry might have expired.