Ethernet IRQ <--> suspend

From: Rick van Rein (vanrein@zonnet.nl)
Date: Fri Apr 21 2000 - 06:31:40 EST


Hello Donald (Cc. linux-kernel, Ecology-FAQ-people),

In order to get my system working with suspend (APM style) I needed to hack a
bit in my ethernet driver for Linux. It may be interesting for you to see if
there is a general kernel compiler option that works for all drivers that you
maintain; I lack the overview of ethernets to make it. Moreover, I even lack
the hardware docs to be sure this hack is `the right way' of doing this, but
it seems to work quite nicely (initial experiments).

I altered the following driver:
        3c59x.c:v0.99H 11/17/98 Donald Becker
in Linux 2.2.14.

My problem: I have a cable modem with a 3c900B-TPO [Etherlink XL TPO] (rev 04)
ethernet card. A cable network is shared with many others, and some of them
have a misguided protocol stack causing excessive amounts of broadcasting.
Needless to say, those broadcasts are far less interesting to me than they
would have been on a private network. The real problem however, is that those
broadcasts cause an enormous amount of interrupts on the ethernet card. So, I
dived into the 3c59x driver and changed two lines as marked below:

static void set_rx_mode(struct device *dev)
{
        long ioaddr = dev->base_addr;
        int new_mode;

        if (dev->flags & IFF_PROMISC) {
                if (vortex_debug > 0)
                        printk(KERN_NOTICE "%s: Setting promiscuous mode.\n", dev->name);
                new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm; } else if ((dev->mc_list) || (dev->flags & IFF_ALLMULTI)) {
                //RvR.patch new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast;
                new_mode = SetRxFilter|RxStation; // Overkill... just testin'
        } else
                //RvR.patch new_mode = SetRxFilter | RxStation | RxBroadcast;
                new_mode = SetRxFilter | RxStation; // No @Home wanted!

        outw(new_mode, ioaddr + EL3_CMD);
}

It appeared to me that this would shut off all broadcasted rubbish. And it does.
If I run the kernel *without* this patch, and enter "apm -S" it immediately
switches back on. If I run the kernel *with* this patch, the same command does
actually put my machine to a well-deserved rest. Indeed, this is due to a
drastic suppression in ehternet interrupts.

Needless to say, there are many daemons that should also be tailored to my
wits, notably rwhod and fetchmail, but that's all simple to do with commandline
options and ever-mighty root-sent kill signals. Without this change however, I
could not have put my machine to sleep.

Perhaps you could consider setting up an IOCTL interface to allow different
modes of operation on ethernet cards?

-Rick.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST