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

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

[netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count



These have been superceded by the new ->get_sset_count() hook.

Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 753f4920
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2833,9 +2833,14 @@ static void vortex_set_msglevel(struct net_device *dev, u32 dbg)
	vortex_debug = dbg;
}

static int vortex_get_stats_count(struct net_device *dev)
static int vortex_get_sset_count(struct net_device *dev, int sset)
{
	switch (sset) {
	case ETH_SS_STATS:
		return VORTEX_NUM_STATS;
	default:
		return -EOPNOTSUPP;
	}
}

static void vortex_get_ethtool_stats(struct net_device *dev,
@@ -2892,7 +2897,7 @@ static const struct ethtool_ops vortex_ethtool_ops = {
	.get_msglevel           = vortex_get_msglevel,
	.set_msglevel           = vortex_set_msglevel,
	.get_ethtool_stats      = vortex_get_ethtool_stats,
	.get_stats_count        = vortex_get_stats_count,
	.get_sset_count		= vortex_get_sset_count,
	.get_settings           = vortex_get_settings,
	.set_settings           = vortex_set_settings,
	.get_link               = ethtool_op_get_link,
+8 −3
Original line number Diff line number Diff line
@@ -1383,9 +1383,14 @@ static int cp_get_regs_len(struct net_device *dev)
	return CP_REGS_SIZE;
}

static int cp_get_stats_count (struct net_device *dev)
static int cp_get_sset_count (struct net_device *dev, int sset)
{
	switch (sset) {
	case ETH_SS_STATS:
		return CP_NUM_STATS;
	default:
		return -EOPNOTSUPP;
	}
}

static int cp_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -1563,7 +1568,7 @@ static void cp_get_ethtool_stats (struct net_device *dev,
static const struct ethtool_ops cp_ethtool_ops = {
	.get_drvinfo		= cp_get_drvinfo,
	.get_regs_len		= cp_get_regs_len,
	.get_stats_count	= cp_get_stats_count,
	.get_sset_count		= cp_get_sset_count,
	.get_settings		= cp_get_settings,
	.set_settings		= cp_set_settings,
	.nway_reset		= cp_nway_reset,
+8 −3
Original line number Diff line number Diff line
@@ -2406,9 +2406,14 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
}
#endif /* CONFIG_8139TOO_MMIO */

static int rtl8139_get_stats_count(struct net_device *dev)
static int rtl8139_get_sset_count(struct net_device *dev, int sset)
{
	switch (sset) {
	case ETH_SS_STATS:
		return RTL_NUM_STATS;
	default:
		return -EOPNOTSUPP;
	}
}

static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data)
@@ -2439,7 +2444,7 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
	.get_wol		= rtl8139_get_wol,
	.set_wol		= rtl8139_set_wol,
	.get_strings		= rtl8139_get_strings,
	.get_stats_count	= rtl8139_get_stats_count,
	.get_sset_count		= rtl8139_get_sset_count,
	.get_ethtool_stats	= rtl8139_get_ethtool_stats,
};

+8 −3
Original line number Diff line number Diff line
@@ -88,9 +88,14 @@ static void atl1_get_ethtool_stats(struct net_device *netdev,

}

static int atl1_get_stats_count(struct net_device *netdev)
static int atl1_get_sset_count(struct net_device *netdev, int sset)
{
	switch (sset) {
	case ETH_SS_STATS:
		return ARRAY_SIZE(atl1_gstrings_stats);
	default:
		return -EOPNOTSUPP;
	}
}

static int atl1_get_settings(struct net_device *netdev,
@@ -495,6 +500,6 @@ const struct ethtool_ops atl1_ethtool_ops = {
	.get_strings		= atl1_get_strings,
	.nway_reset		= atl1_nway_reset,
	.get_ethtool_stats	= atl1_get_ethtool_stats,
	.get_stats_count	= atl1_get_stats_count,
	.get_sset_count		= atl1_get_sset_count,
	.set_tso		= ethtool_op_set_tso,
};
+8 −3
Original line number Diff line number Diff line
@@ -1962,9 +1962,14 @@ static void b44_get_strings(struct net_device *dev, u32 stringset, u8 *data)
	}
}

static int b44_get_stats_count(struct net_device *dev)
static int b44_get_sset_count(struct net_device *dev, int sset)
{
	switch (sset) {
	case ETH_SS_STATS:
		return ARRAY_SIZE(b44_gstrings);
	default:
		return -EOPNOTSUPP;
	}
}

static void b44_get_ethtool_stats(struct net_device *dev,
@@ -2025,7 +2030,7 @@ static const struct ethtool_ops b44_ethtool_ops = {
	.get_msglevel		= b44_get_msglevel,
	.set_msglevel		= b44_set_msglevel,
	.get_strings		= b44_get_strings,
	.get_stats_count	= b44_get_stats_count,
	.get_sset_count		= b44_get_sset_count,
	.get_ethtool_stats	= b44_get_ethtool_stats,
};

Loading