Lines Matching refs:n_stats
758 rsp->info.n_stats = rc; in ethtool_get_drvinfo()
2361 int ret, n_stats; in ethtool_get_stats() local
2366 n_stats = ops->get_sset_count(dev, ETH_SS_STATS); in ethtool_get_stats()
2367 if (n_stats < 0) in ethtool_get_stats()
2368 return n_stats; in ethtool_get_stats()
2369 if (n_stats > S32_MAX / sizeof(u64)) in ethtool_get_stats()
2371 WARN_ON_ONCE(!n_stats); in ethtool_get_stats()
2375 stats.n_stats = n_stats; in ethtool_get_stats()
2377 if (n_stats) { in ethtool_get_stats()
2378 data = vzalloc(array_size(n_stats, sizeof(u64))); in ethtool_get_stats()
2390 if (n_stats && copy_to_user(useraddr, data, array_size(n_stats, sizeof(u64)))) in ethtool_get_stats()
2399 static int ethtool_vzalloc_stats_array(int n_stats, u64 **data) in ethtool_vzalloc_stats_array() argument
2401 if (n_stats < 0) in ethtool_vzalloc_stats_array()
2402 return n_stats; in ethtool_vzalloc_stats_array()
2403 if (n_stats > S32_MAX / sizeof(u64)) in ethtool_vzalloc_stats_array()
2405 if (WARN_ON_ONCE(!n_stats)) in ethtool_vzalloc_stats_array()
2408 *data = vzalloc(array_size(n_stats, sizeof(u64))); in ethtool_vzalloc_stats_array()
2420 int n_stats, ret; in ethtool_get_phy_stats_phydev() local
2425 n_stats = phy_ops->get_sset_count(phydev); in ethtool_get_phy_stats_phydev()
2427 ret = ethtool_vzalloc_stats_array(n_stats, data); in ethtool_get_phy_stats_phydev()
2431 stats->n_stats = n_stats; in ethtool_get_phy_stats_phydev()
2440 int n_stats, ret; in ethtool_get_phy_stats_ethtool() local
2445 n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS); in ethtool_get_phy_stats_ethtool()
2447 ret = ethtool_vzalloc_stats_array(n_stats, data); in ethtool_get_phy_stats_ethtool()
2451 stats->n_stats = n_stats; in ethtool_get_phy_stats_ethtool()
2482 if (copy_to_user(useraddr, data, array_size(stats.n_stats, sizeof(u64)))) in ethtool_get_phy_stats()