ethtool: Call ethtool's get/set_settings callbacks with cleaned data
authorDavid Decotigny <decot@google.com>
Wed, 27 Apr 2011 18:32:38 +0000 (18:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Apr 2011 21:01:30 +0000 (14:01 -0700)
commit8ae6daca85c8bbd6a32c382db5e2a2a989f8bed2
tree0c85476c2af6568c3d3a73a960d582d2f91a1256
parent36504605432996590f889e33d47e2d9c581f7569
ethtool: Call ethtool's get/set_settings callbacks with cleaned data

This makes sure that when a driver calls the ethtool's
get/set_settings() callback of another driver, the data passed to it
is clean. This guarantees that speed_hi will be zeroed correctly if
the called callback doesn't explicitely set it: we are sure we don't
get a corrupted speed from the underlying driver. We also take care of
setting the cmd field appropriately (ETHTOOL_GSET/SSET).

This applies to dev_ethtool_get_settings(), which now makes sure it
sets up that ethtool command parameter correctly before passing it to
drivers. This also means that whoever calls dev_ethtool_get_settings()
does not have to clean the ethtool command parameter. This function
also becomes an exported symbol instead of an inline.

All drivers visible to make allyesconfig under x86_64 have been
updated.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
20 files changed:
arch/mips/txx9/generic/setup_tx4939.c
drivers/net/e100.c
drivers/net/mdio.c
drivers/net/mii.c
drivers/net/pch_gbe/pch_gbe_main.c
drivers/net/pch_gbe/pch_gbe_phy.c
drivers/net/pcnet32.c
drivers/net/sfc/mdio_10g.c
drivers/net/stmmac/stmmac_ethtool.c
drivers/net/usb/asix.c
drivers/net/usb/dm9601.c
drivers/net/usb/smsc75xx.c
drivers/net/usb/smsc95xx.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/fcoe/fcoe.c
include/linux/ethtool.h
include/linux/netdevice.h
include/rdma/ib_addr.h
net/core/dev.c
net/core/net-sysfs.c