From: Jeff Garzik <jgarzik@pobox.com>
To: "David S. Miller" <davem@redhat.com>
Cc: willy@debian.org, netdev@oss.sgi.com
Subject: Re: [PATCH] ethtool_ops rev 4
Date: Fri, 01 Aug 2003 19:17:57 -0400 [thread overview]
Message-ID: <3F2AF525.3000605@pobox.com> (raw)
In-Reply-To: <20030801160136.3342c5cc.davem@redhat.com>
David S. Miller wrote:
> On Fri, 01 Aug 2003 19:01:21 -0400
> Jeff Garzik <jgarzik@pobox.com> wrote:
>
>
>>A DO_ETHTOOL_OPS macro in the driver's ->do_ioctl -- intentionally not
>>included in the kernel -- does the rest,
>
>
> I don't understand.
>
> Where does this DO_ETHTOOL_OPS macro come from? Is it defined
> by kcompat? If so, how will drivers in vanilla 2.4.x trees end
> up with the DO_ETHTOOL_OPS define?
If one wishes to implement kcompat design ("it looks like a 2.6
driver"), then you have two needs over and above Matthew's current
ethtool_ops patch: (1) naked struct deref of netdev->ethtool_ops will
break immediately on older kernels, and (2) to avoid code duplication,
you need to insert a call to kcompat's
do_ethtool_handling_the_old_way... i.e. basically what
net/core/ethtool.c does now.
Problem #1 is solved with a wrapper macro that disguises the naked
struct deref to ->ethtool_ops.
Problem #2 is solved by adding a call to DO_ETHTOOL_OPS macro in a
driver's ->do_ioctl handler.
So, with those two minor changes, a 2.6 driver will work on an older kernel.
To answer your question above, DO_ETHTOOL_OPS can occur one of two ways:
(1) my preferred approach, define a no-op DO_ETHTOOL_OPS macro
in-kernel -- but I did not think this would get accepted, so I chose (2)
DO_ETHTOOL_OPS exists entirely in kcompat, and people submitting kcompat
users to mainline would simply delete the one line calling
DO_ETHTOOL_OPS. Solution #2 chooses to create a tiny bit more
merge-to-mainline pain, but also keeps the mainline kernel drivers more
clean.
Jeff
next prev parent reply other threads:[~2003-08-01 23:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-01 15:02 [PATCH] ethtool_ops rev 4 Matthew Wilcox
2003-08-01 15:40 ` Jeff Garzik
2003-08-01 15:46 ` Matthew Wilcox
2003-08-01 16:25 ` Jeff Garzik
2003-08-01 20:20 ` David S. Miller
2003-08-01 22:26 ` Jeff Garzik
2003-08-01 22:32 ` David S. Miller
2003-08-01 23:01 ` Jeff Garzik
2003-08-01 23:01 ` David S. Miller
2003-08-01 23:17 ` Jeff Garzik [this message]
2003-08-01 23:19 ` David S. Miller
2003-08-01 23:42 ` Jeff Garzik
2003-08-01 23:43 ` David S. Miller
2003-08-01 22:35 ` Jeff Garzik
2003-08-01 22:34 ` David S. Miller
2003-08-01 23:09 ` Jeff Garzik
2003-08-01 23:08 ` David S. Miller
2003-08-01 23:35 ` Jeff Garzik
2003-08-01 23:34 ` David S. Miller
2003-08-02 22:21 ` Matthew Wilcox
2003-08-02 22:34 ` Jeff Garzik
2003-08-03 0:27 ` Matthew Wilcox
2003-08-03 3:14 ` Jeff Garzik
2003-08-03 14:56 ` Matthew Wilcox
2003-08-03 17:09 ` Jeff Garzik
2003-08-05 14:32 ` Matthew Wilcox
2003-08-03 0:28 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F2AF525.3000605@pobox.com \
--to=jgarzik@pobox.com \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
--cc=willy@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).