提交 88d3aafd 编写于 作者: J Jeff Garzik 提交者: David S. Miller

[ETHTOOL] Provide default behaviors for a few ethtool sub-ioctls

For the operations
	get-tx-csum
	get-sg
	get-tso
	get-ufo
the default ethtool_op_xxx behavior is fine for all drivers, so we
permit op==NULL to imply the default behavior.

This provides a more uniform behavior across all drivers, eliminating
ethtool(8) "ioctl not supported" errors on older drivers that had
not been updated for the latest sub-ioctls.

The ethtool_op_xxx() functions are left exported, in case anyone
wishes to call them directly from a driver-private implementation --
a not-uncommon case.  Should an ethtool_op_xxx() helper remain unused
for a while, except by net/core/ethtool.c, we can un-export it at a
later date.

[ Resolved conflicts with set/get value ethtool patch... -DaveM ]
Signed-off-by: NJeff Garzik <jeff@garzik.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 09f75cd7
...@@ -1572,11 +1572,8 @@ static const struct ethtool_ops cp_ethtool_ops = { ...@@ -1572,11 +1572,8 @@ static const struct ethtool_ops cp_ethtool_ops = {
.set_msglevel = cp_set_msglevel, .set_msglevel = cp_set_msglevel,
.get_rx_csum = cp_get_rx_csum, .get_rx_csum = cp_get_rx_csum,
.set_rx_csum = cp_set_rx_csum, .set_rx_csum = cp_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, /* local! */ .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_regs = cp_get_regs, .get_regs = cp_get_regs,
.get_wol = cp_get_wol, .get_wol = cp_get_wol,
......
...@@ -489,15 +489,12 @@ const struct ethtool_ops atl1_ethtool_ops = { ...@@ -489,15 +489,12 @@ const struct ethtool_ops atl1_ethtool_ops = {
.get_pauseparam = atl1_get_pauseparam, .get_pauseparam = atl1_get_pauseparam,
.set_pauseparam = atl1_set_pauseparam, .set_pauseparam = atl1_set_pauseparam,
.get_rx_csum = atl1_get_rx_csum, .get_rx_csum = atl1_get_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_hw_csum, .set_tx_csum = ethtool_op_set_tx_hw_csum,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_strings = atl1_get_strings, .get_strings = atl1_get_strings,
.nway_reset = atl1_nway_reset, .nway_reset = atl1_nway_reset,
.get_ethtool_stats = atl1_get_ethtool_stats, .get_ethtool_stats = atl1_get_ethtool_stats,
.get_stats_count = atl1_get_stats_count, .get_stats_count = atl1_get_stats_count,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
}; };
...@@ -6257,11 +6257,8 @@ static const struct ethtool_ops bnx2_ethtool_ops = { ...@@ -6257,11 +6257,8 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
.set_pauseparam = bnx2_set_pauseparam, .set_pauseparam = bnx2_set_pauseparam,
.get_rx_csum = bnx2_get_rx_csum, .get_rx_csum = bnx2_get_rx_csum,
.set_rx_csum = bnx2_set_rx_csum, .set_rx_csum = bnx2_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = bnx2_set_tx_csum, .set_tx_csum = bnx2_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = bnx2_set_tso, .set_tso = bnx2_set_tso,
.self_test_count = bnx2_self_test_count, .self_test_count = bnx2_self_test_count,
.self_test = bnx2_self_test, .self_test = bnx2_self_test,
......
...@@ -4202,10 +4202,6 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, ...@@ -4202,10 +4202,6 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
} }
static const struct ethtool_ops bond_ethtool_ops = { static const struct ethtool_ops bond_ethtool_ops = {
.get_tx_csum = ethtool_op_get_tx_csum,
.get_tso = ethtool_op_get_tso,
.get_ufo = ethtool_op_get_ufo,
.get_sg = ethtool_op_get_sg,
.get_drvinfo = bond_ethtool_get_drvinfo, .get_drvinfo = bond_ethtool_get_drvinfo,
}; };
......
...@@ -794,9 +794,7 @@ static const struct ethtool_ops t1_ethtool_ops = { ...@@ -794,9 +794,7 @@ static const struct ethtool_ops t1_ethtool_ops = {
.set_pauseparam = set_pauseparam, .set_pauseparam = set_pauseparam,
.get_rx_csum = get_rx_csum, .get_rx_csum = get_rx_csum,
.set_rx_csum = set_rx_csum, .set_rx_csum = set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_strings = get_strings, .get_strings = get_strings,
...@@ -804,7 +802,6 @@ static const struct ethtool_ops t1_ethtool_ops = { ...@@ -804,7 +802,6 @@ static const struct ethtool_ops t1_ethtool_ops = {
.get_ethtool_stats = get_stats, .get_ethtool_stats = get_stats,
.get_regs_len = get_regs_len, .get_regs_len = get_regs_len,
.get_regs = get_regs, .get_regs = get_regs,
.get_tso = ethtool_op_get_tso,
.set_tso = set_tso, .set_tso = set_tso,
}; };
......
...@@ -1634,9 +1634,7 @@ static const struct ethtool_ops cxgb_ethtool_ops = { ...@@ -1634,9 +1634,7 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.set_pauseparam = set_pauseparam, .set_pauseparam = set_pauseparam,
.get_rx_csum = get_rx_csum, .get_rx_csum = get_rx_csum,
.set_rx_csum = set_rx_csum, .set_rx_csum = set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_strings = get_strings, .get_strings = get_strings,
...@@ -1647,7 +1645,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = { ...@@ -1647,7 +1645,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_regs_len = get_regs_len, .get_regs_len = get_regs_len,
.get_regs = get_regs, .get_regs = get_regs,
.get_wol = get_wol, .get_wol = get_wol,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
}; };
......
...@@ -1965,9 +1965,7 @@ static const struct ethtool_ops e1000_ethtool_ops = { ...@@ -1965,9 +1965,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.set_rx_csum = e1000_set_rx_csum, .set_rx_csum = e1000_set_rx_csum,
.get_tx_csum = e1000_get_tx_csum, .get_tx_csum = e1000_get_tx_csum,
.set_tx_csum = e1000_set_tx_csum, .set_tx_csum = e1000_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = e1000_set_tso, .set_tso = e1000_set_tso,
.self_test_count = e1000_diag_test_count, .self_test_count = e1000_diag_test_count,
.self_test = e1000_diag_test, .self_test = e1000_diag_test,
......
...@@ -262,9 +262,6 @@ const struct ethtool_ops ehea_ethtool_ops = { ...@@ -262,9 +262,6 @@ const struct ethtool_ops ehea_ethtool_ops = {
.get_msglevel = ehea_get_msglevel, .get_msglevel = ehea_get_msglevel,
.set_msglevel = ehea_set_msglevel, .set_msglevel = ehea_set_msglevel,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_strings = ehea_get_strings, .get_strings = ehea_get_strings,
.get_stats_count = ehea_get_stats_count, .get_stats_count = ehea_get_stats_count,
......
...@@ -1494,8 +1494,6 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -1494,8 +1494,6 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_link = netdev_get_link, .get_link = netdev_get_link,
.get_msglevel = netdev_get_msglevel, .get_msglevel = netdev_get_msglevel,
.set_msglevel = netdev_set_msglevel, .set_msglevel = netdev_set_msglevel,
.get_sg = ethtool_op_get_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.begin = ethtool_begin, .begin = ethtool_begin,
.complete = ethtool_complete .complete = ethtool_complete
}; };
......
...@@ -1891,8 +1891,6 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -1891,8 +1891,6 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_link = netdev_get_link, .get_link = netdev_get_link,
.get_msglevel = netdev_get_msglevel, .get_msglevel = netdev_get_msglevel,
.set_msglevel = netdev_set_msglevel, .set_msglevel = netdev_set_msglevel,
.get_sg = ethtool_op_get_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
}; };
static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
......
...@@ -1041,9 +1041,7 @@ static const struct ethtool_ops fec_ethtool_ops = { ...@@ -1041,9 +1041,7 @@ static const struct ethtool_ops fec_ethtool_ops = {
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_msglevel = fec_get_msglevel, .get_msglevel = fec_get_msglevel,
.set_msglevel = fec_set_msglevel, .set_msglevel = fec_set_msglevel,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, /* local! */ .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_regs = fec_get_regs, .get_regs = fec_get_regs,
}; };
......
...@@ -4710,7 +4710,6 @@ static const struct ethtool_ops ops = { ...@@ -4710,7 +4710,6 @@ static const struct ethtool_ops ops = {
.get_regs_len = nv_get_regs_len, .get_regs_len = nv_get_regs_len,
.get_regs = nv_get_regs, .get_regs = nv_get_regs,
.nway_reset = nv_nway_reset, .nway_reset = nv_nway_reset,
.get_tso = ethtool_op_get_tso,
.set_tso = nv_set_tso, .set_tso = nv_set_tso,
.get_ringparam = nv_get_ringparam, .get_ringparam = nv_get_ringparam,
.set_ringparam = nv_set_ringparam, .set_ringparam = nv_set_ringparam,
...@@ -4718,9 +4717,7 @@ static const struct ethtool_ops ops = { ...@@ -4718,9 +4717,7 @@ static const struct ethtool_ops ops = {
.set_pauseparam = nv_set_pauseparam, .set_pauseparam = nv_set_pauseparam,
.get_rx_csum = nv_get_rx_csum, .get_rx_csum = nv_get_rx_csum,
.set_rx_csum = nv_set_rx_csum, .set_rx_csum = nv_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = nv_set_tx_csum, .set_tx_csum = nv_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = nv_set_sg, .set_sg = nv_set_sg,
.get_strings = nv_get_strings, .get_strings = nv_get_strings,
.get_stats_count = nv_get_stats_count, .get_stats_count = nv_get_stats_count,
......
...@@ -907,9 +907,7 @@ static const struct ethtool_ops fs_ethtool_ops = { ...@@ -907,9 +907,7 @@ static const struct ethtool_ops fs_ethtool_ops = {
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_msglevel = fs_get_msglevel, .get_msglevel = fs_get_msglevel,
.set_msglevel = fs_set_msglevel, .set_msglevel = fs_set_msglevel,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, /* local! */ .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_regs = fs_get_regs, .get_regs = fs_get_regs,
}; };
......
...@@ -1900,8 +1900,6 @@ static const struct ethtool_ops emac_ethtool_ops = { ...@@ -1900,8 +1900,6 @@ static const struct ethtool_ops emac_ethtool_ops = {
.get_ethtool_stats = emac_ethtool_get_ethtool_stats, .get_ethtool_stats = emac_ethtool_get_ethtool_stats,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
}; };
static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
......
...@@ -821,15 +821,11 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -821,15 +821,11 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo, .get_drvinfo = netdev_get_drvinfo,
.get_settings = netdev_get_settings, .get_settings = netdev_get_settings,
.get_link = netdev_get_link, .get_link = netdev_get_link,
.get_sg = ethtool_op_get_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ibmveth_set_tx_csum, .set_tx_csum = ibmveth_set_tx_csum,
.get_rx_csum = ibmveth_get_rx_csum, .get_rx_csum = ibmveth_get_rx_csum,
.set_rx_csum = ibmveth_set_rx_csum, .set_rx_csum = ibmveth_set_rx_csum,
.get_tso = ethtool_op_get_tso,
.get_ufo = ethtool_op_get_ufo,
.get_strings = ibmveth_get_strings, .get_strings = ibmveth_get_strings,
.get_stats_count = ibmveth_get_stats_count, .get_stats_count = ibmveth_get_stats_count,
.get_ethtool_stats = ibmveth_get_ethtool_stats, .get_ethtool_stats = ibmveth_get_ethtool_stats,
}; };
......
...@@ -713,11 +713,9 @@ static const struct ethtool_ops ixgb_ethtool_ops = { ...@@ -713,11 +713,9 @@ static const struct ethtool_ops ixgb_ethtool_ops = {
.set_rx_csum = ixgb_set_rx_csum, .set_rx_csum = ixgb_set_rx_csum,
.get_tx_csum = ixgb_get_tx_csum, .get_tx_csum = ixgb_get_tx_csum,
.set_tx_csum = ixgb_set_tx_csum, .set_tx_csum = ixgb_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_msglevel = ixgb_get_msglevel, .get_msglevel = ixgb_get_msglevel,
.set_msglevel = ixgb_set_msglevel, .set_msglevel = ixgb_set_msglevel,
.get_tso = ethtool_op_get_tso,
.set_tso = ixgb_set_tso, .set_tso = ixgb_set_tso,
.get_strings = ixgb_get_strings, .get_strings = ixgb_get_strings,
.phys_id = ixgb_phys_id, .phys_id = ixgb_phys_id,
......
...@@ -192,7 +192,6 @@ static u32 always_on(struct net_device *dev) ...@@ -192,7 +192,6 @@ static u32 always_on(struct net_device *dev)
static const struct ethtool_ops loopback_ethtool_ops = { static const struct ethtool_ops loopback_ethtool_ops = {
.get_link = always_on, .get_link = always_on,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_tx_csum = always_on, .get_tx_csum = always_on,
.get_sg = always_on, .get_sg = always_on,
......
...@@ -282,10 +282,6 @@ static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev) ...@@ -282,10 +282,6 @@ static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev)
static const struct ethtool_ops macvlan_ethtool_ops = { static const struct ethtool_ops macvlan_ethtool_ops = {
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_rx_csum = macvlan_ethtool_get_rx_csum, .get_rx_csum = macvlan_ethtool_get_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_tso = ethtool_op_get_tso,
.get_ufo = ethtool_op_get_ufo,
.get_sg = ethtool_op_get_sg,
.get_drvinfo = macvlan_ethtool_get_drvinfo, .get_drvinfo = macvlan_ethtool_get_drvinfo,
}; };
......
...@@ -2735,7 +2735,6 @@ static const struct ethtool_ops mv643xx_ethtool_ops = { ...@@ -2735,7 +2735,6 @@ static const struct ethtool_ops mv643xx_ethtool_ops = {
.set_settings = mv643xx_set_settings, .set_settings = mv643xx_set_settings,
.get_drvinfo = mv643xx_get_drvinfo, .get_drvinfo = mv643xx_get_drvinfo,
.get_link = mv643xx_eth_get_link, .get_link = mv643xx_eth_get_link,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_stats_count = mv643xx_get_stats_count, .get_stats_count = mv643xx_get_stats_count,
.get_ethtool_stats = mv643xx_get_ethtool_stats, .get_ethtool_stats = mv643xx_get_ethtool_stats,
......
...@@ -1499,11 +1499,8 @@ static const struct ethtool_ops myri10ge_ethtool_ops = { ...@@ -1499,11 +1499,8 @@ static const struct ethtool_ops myri10ge_ethtool_ops = {
.get_ringparam = myri10ge_get_ringparam, .get_ringparam = myri10ge_get_ringparam,
.get_rx_csum = myri10ge_get_rx_csum, .get_rx_csum = myri10ge_get_rx_csum,
.set_rx_csum = myri10ge_set_rx_csum, .set_rx_csum = myri10ge_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_hw_csum, .set_tx_csum = ethtool_op_set_tx_hw_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_strings = myri10ge_get_strings, .get_strings = myri10ge_get_strings,
......
...@@ -635,8 +635,6 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev, ...@@ -635,8 +635,6 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev,
static const struct ethtool_ops ne2k_pci_ethtool_ops = { static const struct ethtool_ops ne2k_pci_ethtool_ops = {
.get_drvinfo = ne2k_pci_get_drvinfo, .get_drvinfo = ne2k_pci_get_drvinfo,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
}; };
static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev) static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
......
...@@ -744,11 +744,8 @@ struct ethtool_ops netxen_nic_ethtool_ops = { ...@@ -744,11 +744,8 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
.get_ringparam = netxen_nic_get_ringparam, .get_ringparam = netxen_nic_get_ringparam,
.get_pauseparam = netxen_nic_get_pauseparam, .get_pauseparam = netxen_nic_get_pauseparam,
.set_pauseparam = netxen_nic_set_pauseparam, .set_pauseparam = netxen_nic_set_pauseparam,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.self_test_count = netxen_nic_diag_test_count, .self_test_count = netxen_nic_diag_test_count,
.self_test = netxen_nic_diag_test, .self_test = netxen_nic_diag_test,
......
...@@ -1509,9 +1509,6 @@ static const struct ethtool_ops pcnet32_ethtool_ops = { ...@@ -1509,9 +1509,6 @@ static const struct ethtool_ops pcnet32_ethtool_ops = {
.get_link = pcnet32_get_link, .get_link = pcnet32_get_link,
.get_ringparam = pcnet32_get_ringparam, .get_ringparam = pcnet32_get_ringparam,
.set_ringparam = pcnet32_set_ringparam, .set_ringparam = pcnet32_set_ringparam,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
.get_tso = ethtool_op_get_tso,
.get_strings = pcnet32_get_strings, .get_strings = pcnet32_get_strings,
.self_test_count = pcnet32_self_test_count, .self_test_count = pcnet32_self_test_count,
.self_test = pcnet32_ethtool_test, .self_test = pcnet32_ethtool_test,
......
...@@ -1061,11 +1061,8 @@ static const struct ethtool_ops rtl8169_ethtool_ops = { ...@@ -1061,11 +1061,8 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
.set_msglevel = rtl8169_set_msglevel, .set_msglevel = rtl8169_set_msglevel,
.get_rx_csum = rtl8169_get_rx_csum, .get_rx_csum = rtl8169_get_rx_csum,
.set_rx_csum = rtl8169_set_rx_csum, .set_rx_csum = rtl8169_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_regs = rtl8169_get_regs, .get_regs = rtl8169_get_regs,
.get_wol = rtl8169_get_wol, .get_wol = rtl8169_get_wol,
......
...@@ -6326,13 +6326,10 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -6326,13 +6326,10 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.set_pauseparam = s2io_ethtool_setpause_data, .set_pauseparam = s2io_ethtool_setpause_data,
.get_rx_csum = s2io_ethtool_get_rx_csum, .get_rx_csum = s2io_ethtool_get_rx_csum,
.set_rx_csum = s2io_ethtool_set_rx_csum, .set_rx_csum = s2io_ethtool_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = s2io_ethtool_op_set_tx_csum, .set_tx_csum = s2io_ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = s2io_ethtool_op_get_tso, .get_tso = s2io_ethtool_op_get_tso,
.set_tso = s2io_ethtool_op_set_tso, .set_tso = s2io_ethtool_op_set_tso,
.get_ufo = ethtool_op_get_ufo,
.set_ufo = ethtool_op_set_ufo, .set_ufo = ethtool_op_set_ufo,
.self_test_count = s2io_ethtool_self_test_count, .self_test_count = s2io_ethtool_self_test_count,
.self_test = s2io_ethtool_test, .self_test = s2io_ethtool_test,
......
...@@ -1396,13 +1396,9 @@ static struct ethtool_ops sc92031_ethtool_ops = { ...@@ -1396,13 +1396,9 @@ static struct ethtool_ops sc92031_ethtool_ops = {
.set_wol = sc92031_ethtool_set_wol, .set_wol = sc92031_ethtool_set_wol,
.nway_reset = sc92031_ethtool_nway_reset, .nway_reset = sc92031_ethtool_nway_reset,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
.get_tso = ethtool_op_get_tso,
.get_strings = sc92031_ethtool_get_strings, .get_strings = sc92031_ethtool_get_strings,
.get_stats_count = sc92031_ethtool_get_stats_count, .get_stats_count = sc92031_ethtool_get_stats_count,
.get_ethtool_stats = sc92031_ethtool_get_ethtool_stats, .get_ethtool_stats = sc92031_ethtool_get_ethtool_stats,
.get_ufo = ethtool_op_get_ufo,
}; };
static int __devinit sc92031_probe(struct pci_dev *pdev, static int __devinit sc92031_probe(struct pci_dev *pdev,
......
...@@ -811,9 +811,7 @@ static const struct ethtool_ops skge_ethtool_ops = { ...@@ -811,9 +811,7 @@ static const struct ethtool_ops skge_ethtool_ops = {
.set_pauseparam = skge_set_pauseparam, .set_pauseparam = skge_set_pauseparam,
.get_coalesce = skge_get_coalesce, .get_coalesce = skge_get_coalesce,
.set_coalesce = skge_set_coalesce, .set_coalesce = skge_set_coalesce,
.get_sg = ethtool_op_get_sg,
.set_sg = skge_set_sg, .set_sg = skge_set_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = skge_set_tx_csum, .set_tx_csum = skge_set_tx_csum,
.get_rx_csum = skge_get_rx_csum, .get_rx_csum = skge_get_rx_csum,
.set_rx_csum = skge_set_rx_csum, .set_rx_csum = skge_set_rx_csum,
......
...@@ -3710,11 +3710,8 @@ static const struct ethtool_ops sky2_ethtool_ops = { ...@@ -3710,11 +3710,8 @@ static const struct ethtool_ops sky2_ethtool_ops = {
.get_eeprom_len = sky2_get_eeprom_len, .get_eeprom_len = sky2_get_eeprom_len,
.get_eeprom = sky2_get_eeprom, .get_eeprom = sky2_get_eeprom,
.set_eeprom = sky2_set_eeprom, .set_eeprom = sky2_set_eeprom,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = sky2_set_tx_csum, .set_tx_csum = sky2_set_tx_csum,
.get_tso = ethtool_op_get_tso,
.set_tso = sky2_set_tso, .set_tso = sky2_set_tso,
.get_rx_csum = sky2_get_rx_csum, .get_rx_csum = sky2_get_rx_csum,
.set_rx_csum = sky2_set_rx_csum, .set_rx_csum = sky2_set_rx_csum,
......
...@@ -188,7 +188,6 @@ const struct ethtool_ops spider_net_ethtool_ops = { ...@@ -188,7 +188,6 @@ const struct ethtool_ops spider_net_ethtool_ops = {
.nway_reset = spider_net_ethtool_nway_reset, .nway_reset = spider_net_ethtool_nway_reset,
.get_rx_csum = spider_net_ethtool_get_rx_csum, .get_rx_csum = spider_net_ethtool_get_rx_csum,
.set_rx_csum = spider_net_ethtool_set_rx_csum, .set_rx_csum = spider_net_ethtool_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_ringparam = spider_net_ethtool_get_ringparam, .get_ringparam = spider_net_ethtool_get_ringparam,
.get_strings = spider_net_get_strings, .get_strings = spider_net_get_strings,
......
...@@ -9278,11 +9278,8 @@ static const struct ethtool_ops tg3_ethtool_ops = { ...@@ -9278,11 +9278,8 @@ static const struct ethtool_ops tg3_ethtool_ops = {
.set_pauseparam = tg3_set_pauseparam, .set_pauseparam = tg3_set_pauseparam,
.get_rx_csum = tg3_get_rx_csum, .get_rx_csum = tg3_get_rx_csum,
.set_rx_csum = tg3_set_rx_csum, .set_rx_csum = tg3_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = tg3_set_tx_csum, .set_tx_csum = tg3_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = tg3_set_tso, .set_tso = tg3_set_tso,
.self_test_count = tg3_get_test_count, .self_test_count = tg3_get_test_count,
.self_test = tg3_self_test, .self_test = tg3_self_test,
......
...@@ -1670,8 +1670,6 @@ static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs, ...@@ -1670,8 +1670,6 @@ static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
static const struct ethtool_ops de_ethtool_ops = { static const struct ethtool_ops de_ethtool_ops = {
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
.get_drvinfo = de_get_drvinfo, .get_drvinfo = de_get_drvinfo,
.get_regs_len = de_get_regs_len, .get_regs_len = de_get_regs_len,
.get_settings = de_get_settings, .get_settings = de_get_settings,
......
...@@ -1451,8 +1451,6 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -1451,8 +1451,6 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_link = netdev_get_link, .get_link = netdev_get_link,
.get_msglevel = netdev_get_msglevel, .get_msglevel = netdev_get_msglevel,
.set_msglevel = netdev_set_msglevel, .set_msglevel = netdev_set_msglevel,
.get_sg = ethtool_op_get_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
}; };
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
......
...@@ -1236,11 +1236,8 @@ static const struct ethtool_ops typhoon_ethtool_ops = { ...@@ -1236,11 +1236,8 @@ static const struct ethtool_ops typhoon_ethtool_ops = {
.set_wol = typhoon_set_wol, .set_wol = typhoon_set_wol,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_rx_csum = typhoon_get_rx_csum, .get_rx_csum = typhoon_get_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso, .set_tso = ethtool_op_set_tso,
.get_ringparam = typhoon_get_ringparam, .get_ringparam = typhoon_get_ringparam,
}; };
......
...@@ -373,9 +373,7 @@ static const struct ethtool_ops uec_ethtool_ops = { ...@@ -373,9 +373,7 @@ static const struct ethtool_ops uec_ethtool_ops = {
.set_ringparam = uec_set_ringparam, .set_ringparam = uec_set_ringparam,
.get_pauseparam = uec_get_pauseparam, .get_pauseparam = uec_get_pauseparam,
.set_pauseparam = uec_set_pauseparam, .set_pauseparam = uec_set_pauseparam,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg, .set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.get_stats_count = uec_get_stats_count, .get_stats_count = uec_get_stats_count,
.get_strings = uec_get_strings, .get_strings = uec_get_strings,
.get_ethtool_stats = uec_get_ethtool_stats, .get_ethtool_stats = uec_get_ethtool_stats,
......
...@@ -1813,8 +1813,6 @@ static const struct ethtool_ops netdev_ethtool_ops = { ...@@ -1813,8 +1813,6 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.set_msglevel = netdev_set_msglevel, .set_msglevel = netdev_set_msglevel,
.get_wol = rhine_get_wol, .get_wol = rhine_get_wol,
.set_wol = rhine_set_wol, .set_wol = rhine_set_wol,
.get_sg = ethtool_op_get_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
}; };
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
......
...@@ -1617,11 +1617,8 @@ static void backend_changed(struct xenbus_device *dev, ...@@ -1617,11 +1617,8 @@ static void backend_changed(struct xenbus_device *dev,
static struct ethtool_ops xennet_ethtool_ops = static struct ethtool_ops xennet_ethtool_ops =
{ {
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum, .set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = xennet_set_sg, .set_sg = xennet_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = xennet_set_tso, .set_tso = xennet_set_tso,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
}; };
......
...@@ -150,11 +150,8 @@ static int br_set_tx_csum(struct net_device *dev, u32 data) ...@@ -150,11 +150,8 @@ static int br_set_tx_csum(struct net_device *dev, u32 data)
static struct ethtool_ops br_ethtool_ops = { static struct ethtool_ops br_ethtool_ops = {
.get_drvinfo = br_getinfo, .get_drvinfo = br_getinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_sg = ethtool_op_get_sg,
.set_sg = br_set_sg, .set_sg = br_set_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = br_set_tx_csum, .set_tx_csum = br_set_tx_csum,
.get_tso = ethtool_op_get_tso,
.set_tso = br_set_tso, .set_tso = br_set_tso,
}; };
......
...@@ -893,21 +893,27 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) ...@@ -893,21 +893,27 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
break; break;
case ETHTOOL_GTXCSUM: case ETHTOOL_GTXCSUM:
rc = ethtool_get_value(dev, useraddr, ethcmd, rc = ethtool_get_value(dev, useraddr, ethcmd,
dev->ethtool_ops->get_tx_csum); (dev->ethtool_ops->get_tx_csum ?
dev->ethtool_ops->get_tx_csum :
ethtool_op_get_tx_csum));
break; break;
case ETHTOOL_STXCSUM: case ETHTOOL_STXCSUM:
rc = ethtool_set_tx_csum(dev, useraddr); rc = ethtool_set_tx_csum(dev, useraddr);
break; break;
case ETHTOOL_GSG: case ETHTOOL_GSG:
rc = ethtool_get_value(dev, useraddr, ethcmd, rc = ethtool_get_value(dev, useraddr, ethcmd,
dev->ethtool_ops->get_sg); (dev->ethtool_ops->get_sg ?
dev->ethtool_ops->get_sg :
ethtool_op_get_sg));
break; break;
case ETHTOOL_SSG: case ETHTOOL_SSG:
rc = ethtool_set_sg(dev, useraddr); rc = ethtool_set_sg(dev, useraddr);
break; break;
case ETHTOOL_GTSO: case ETHTOOL_GTSO:
rc = ethtool_get_value(dev, useraddr, ethcmd, rc = ethtool_get_value(dev, useraddr, ethcmd,
dev->ethtool_ops->get_tso); (dev->ethtool_ops->get_tso ?
dev->ethtool_ops->get_tso :
ethtool_op_get_tso));
break; break;
case ETHTOOL_STSO: case ETHTOOL_STSO:
rc = ethtool_set_tso(dev, useraddr); rc = ethtool_set_tso(dev, useraddr);
...@@ -929,7 +935,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) ...@@ -929,7 +935,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
break; break;
case ETHTOOL_GUFO: case ETHTOOL_GUFO:
rc = ethtool_get_value(dev, useraddr, ethcmd, rc = ethtool_get_value(dev, useraddr, ethcmd,
dev->ethtool_ops->get_ufo); (dev->ethtool_ops->get_ufo ?
dev->ethtool_ops->get_ufo :
ethtool_op_get_ufo));
break; break;
case ETHTOOL_SUFO: case ETHTOOL_SUFO:
rc = ethtool_set_ufo(dev, useraddr); rc = ethtool_set_ufo(dev, useraddr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册