Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88d3aafd authored by Jeff Garzik's avatar Jeff Garzik Committed by David S. Miller
Browse files

[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: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09f75cd7
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -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,
+0 −3
Original line number Original line Diff line number Diff line
@@ -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,
};
};
+0 −3
Original line number Original line Diff line number Diff line
@@ -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,
+0 −4
Original line number Original line Diff line number Diff line
@@ -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,
};
};


+0 −3
Original line number Original line Diff line number Diff line
@@ -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 = {
	.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,
};
};


Loading