On Tue, 12 Sep 2006 12:08:03 -0400 Jeff Garzik <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > > 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. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html