[PATCH] ethtool_ops

Matthew Wilcox (willy@debian.org)
Fri, 6 Jun 2003 15:29:51 +0100


The patch is 40k, so I'm not going to post it inline.
http://ftp.linux.org.uk/pub/linux/willy/patches/ethtool.diff

Right now, each network driver which supports the ethtool ioctl has its
own implementation of everything from decoding which ethtool ioctl it is,
copying data to and from userspace, marshalling and unmarshalling data
from ethtool packets, etc. The current setup makes it impossible to
use alternative interfaces to get at the same data (eg sysfs) and it's
not exactly typesafe.

This patch introduces ethtool_ops and converts tg3 to use it.
Drivers don't access userspace on their own under this scheme; they
just do the requested operation and return the appropriate value(s).
Compile-tested only; design approved by jgarzik. Comments welcomed.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/