From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] ethtool: allow const ethtool_ops
Date: Wed, 13 Sep 2006 14:09:48 +0900 [thread overview]
Message-ID: <20060913140948.3b55d604@localhost.localdomain> (raw)
In-Reply-To: <4506DB63.2040904@pobox.com>
On Tue, 12 Sep 2006 12:08:03 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:
> Stephen Hemminger wrote:
> > The ethtool_ops structure is immutable, it expected to be setup
> > by the driver and is never changed. This patch allows drivers to
> > declare there ethtool_ops structure read-only.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
>
> ACK, but I need the associated change-all-drivers patch, in order to
> apply this.
>
> Jeff
>
>
Actually, no driver is immediately required since this is valid:
exiting_driver.c:
static struct ethtool_ops myops= { ... };
static int mydriver_probe(...) {
...
dev = alloc_etherdev(sizeof(struct mypriv));
...
dev->ethtool_ops = &myops;
...
return register_netdev(dev);
}
Remember difference between:
struct net_device {
struct ethtool_ops *ethtool_ops;
Existing definition, allow network core to change contents of
dev->ethtool_ops.
const struct ethtool_ops *ethtool_ops;
Proposed patch, network code treats dev->ethtool_ops contents
as read-only. Devices MAY make ethtool_ops const.
Radical change would be:
struct ethtool_ops *const ethtool_ops;
This would mean every device would have to define ethtool_ops
as const. Devices MUST make ethtool_ops const.
next prev parent reply other threads:[~2006-09-13 5:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-08 18:16 [PATCH 1/2] ethtool: allow const ethtool_ops Stephen Hemminger
2006-09-08 18:20 ` [PATCH 2/2] loopback: minor statistics optimization Stephen Hemminger
2006-09-28 3:04 ` David Miller
2006-09-28 3:13 ` Stephen Hemminger
2006-09-28 3:25 ` David Miller
2006-09-12 16:08 ` [PATCH 1/2] ethtool: allow const ethtool_ops Jeff Garzik
2006-09-13 2:08 ` Stephen Hemminger
2006-09-13 2:12 ` Jeff Garzik
2006-09-13 2:19 ` Stephen Hemminger
2006-09-13 5:09 ` Stephen Hemminger [this message]
2006-09-13 6:00 ` Jeff Garzik
2006-09-13 17:45 ` Jeff Garzik
2006-09-14 1:54 ` Stephen Hemminger
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=20060913140948.3b55d604@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.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