[vortex] WakeOnLan with 3c905C-TX-M

Ing. Simanek Milan zam simanek@fel.cvut.cz
Fri Jun 21 05:24:01 2002


> On Mon, 17 Jun 2002, Ing. Simanek Milan zam wrote:
> > > > I am trying to power on my PC using WakeOnLan feature, but the lan card
> > > > does not receive WOL frames.
> > > > 1) When I power off computer, all leds on the card turn off and nothing
> > > >    else happens.

> > After rmmod 3c59x (just before poweroff) pci-config reports this:
> ...
> >   Extended capabilities, first structure at offset 0xdc.
> >   Extended PCI capability type 1 at 0xdc, next 0.
> >    Power management entry ver. 2: Capabilities fe02, Ctrl 4103, Event b700.
> >    Power state D3.
> 
> This looks reasonable, except for 'Event'.
> Are you certain that you are using my driver?
> 
> The event register bits are
>  ...1   Wake on defined wake-up packet (e.g. ARP)
>  ...2   Wake on Magic packet
>  ...4   Wake on link change
>  ...8   Wake on timer expiration
> When these events happen we see
>  ..1.   A wake-up event/packet has happened on timer expiration
>  ..2.   A Magic Packet has arrived
>  ..4.   Link status changed
>  ..8.   Timer expired

Thank you for explanation about event bits. I have doubt that function
outw(2, ioaddr + 0x0c);
in acpi_set_WOL() does not set up event register bits. I don't know why,
but I am sure that the value of the Event register is 0xb700 both before
and after outw. Have you any idea?

Milan Simanek

==========================================================================
I have cut a part of pci-config.c code and inserted it into 3c59x.c to see
Event register status:

#define D(a...) printk( KERN_INFO "MiSi: " a)
void MY_info(struct pci_dev *dev, char *msg)
{
   unsigned int config[64];
   unsigned char *pcfg = (void*)config;
   int cap_idx, i;

   D("MY_info: %s \n", msg);
   for (i = 0; i < 64; i++) pci_read_config_dword(dev, i<<2, &config[i]);
   cap_idx = config[13] & 0xff;
   D("ext. caps at offset 0x%02x\n", cap_idx);

   for (; cap_idx; cap_idx = pcfg[cap_idx + 1]) {
                D("  Ext. PCI capability type %d at 0x%2.2x, next %d.\n",
                           pcfg[cap_idx], cap_idx, pcfg[cap_idx + 1]);
                if (pcfg[cap_idx] == 1) {
                        D("   PM entry ver. %d: Caps %2.2x%2.2x, "
                             "Ctrl %2.2x%2.2x, Event %2.2x%2.2x.\n",
                                   pcfg[cap_idx + 2] & 7,
                                   pcfg[cap_idx + 3], pcfg[cap_idx + 2],
                                   pcfg[cap_idx + 5], pcfg[cap_idx + 4],
                                   pcfg[cap_idx + 7], pcfg[cap_idx + 6]);
                        D("   Power state D%d.\n", pcfg[cap_idx + 4] & 3);
                }
        }
   D("MY_info: --- end ---\n");
}

static void acpi_set_WOL(struct net_device *dev)
{
        struct vortex_private *vp = (struct vortex_private *)dev->priv;
        long ioaddr = dev->base_addr;

        MY_info(vp->pci_dev, "acpi_set_WOL: entry");

        /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link */
        EL3WINDOW(7);
        outw(2, ioaddr + 0x0c);
        MY_info(vp->pci_dev, "acpi_set_WOL: after outw");
	...


Here is my debug info:
------------------------------------------------------------------------
Jun 21 10:52:19 zip1 kernel: MiSi: MY_info: acpi_set_WOL: entry
Jun 21 10:52:19 zip1 kernel: MiSi: ext. caps at offset 0xdc
Jun 21 10:52:19 zip1 kernel: MiSi:   Ext. PCI capability type 1 at 0xdc,
next 0.
Jun 21 10:52:19 zip1 kernel: MiSi:    PM entry ver. 2: Caps fe02,
Ctrl c000, Event b700.
Jun 21 10:52:19 zip1 kernel: MiSi:    Power state D0.
Jun 21 10:52:19 zip1 kernel: MiSi: MY_info: --- end ---
Jun 21 10:52:19 zip1 kernel: MiSi: MY_info: acpi_set_WOL: after outw
Jun 21 10:52:19 zip1 kernel: MiSi: ext. caps at offset 0xdc
Jun 21 10:52:19 zip1 kernel: MiSi:   Ext. PCI capability type 1 at 0xdc,
next 0.
Jun 21 10:52:19 zip1 kernel: MiSi:    PM entry ver. 2: Caps fe02,
Ctrl c000, Event b700.
Jun 21 10:52:19 zip1 kernel: MiSi:    Power state D0.
Jun 21 10:52:19 zip1 kernel: MiSi: MY_info: --- end ---
------------------------------------------------------------------------