Lines Matching refs:n_stats

758 			rsp->info.n_stats = rc;  in ethtool_get_drvinfo()
2448 int ret, n_stats; in ethtool_get_stats() local
2453 n_stats = ops->get_sset_count(dev, ETH_SS_STATS); in ethtool_get_stats()
2454 if (n_stats < 0) in ethtool_get_stats()
2455 return n_stats; in ethtool_get_stats()
2456 if (n_stats > S32_MAX / sizeof(u64)) in ethtool_get_stats()
2458 WARN_ON_ONCE(!n_stats); in ethtool_get_stats()
2462 stats.n_stats = n_stats; in ethtool_get_stats()
2464 if (n_stats) { in ethtool_get_stats()
2465 data = vzalloc(array_size(n_stats, sizeof(u64))); in ethtool_get_stats()
2477 if (n_stats && copy_to_user(useraddr, data, array_size(n_stats, sizeof(u64)))) in ethtool_get_stats()
2486 static int ethtool_vzalloc_stats_array(int n_stats, u64 **data) in ethtool_vzalloc_stats_array() argument
2488 if (n_stats < 0) in ethtool_vzalloc_stats_array()
2489 return n_stats; in ethtool_vzalloc_stats_array()
2490 if (n_stats > S32_MAX / sizeof(u64)) in ethtool_vzalloc_stats_array()
2492 if (WARN_ON_ONCE(!n_stats)) in ethtool_vzalloc_stats_array()
2495 *data = vzalloc(array_size(n_stats, sizeof(u64))); in ethtool_vzalloc_stats_array()
2507 int n_stats, ret; in ethtool_get_phy_stats_phydev() local
2512 n_stats = phy_ops->get_sset_count(phydev); in ethtool_get_phy_stats_phydev()
2514 ret = ethtool_vzalloc_stats_array(n_stats, data); in ethtool_get_phy_stats_phydev()
2518 stats->n_stats = n_stats; in ethtool_get_phy_stats_phydev()
2527 int n_stats, ret; in ethtool_get_phy_stats_ethtool() local
2532 n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS); in ethtool_get_phy_stats_ethtool()
2534 ret = ethtool_vzalloc_stats_array(n_stats, data); in ethtool_get_phy_stats_ethtool()
2538 stats->n_stats = n_stats; in ethtool_get_phy_stats_ethtool()
2569 if (copy_to_user(useraddr, data, array_size(stats.n_stats, sizeof(u64)))) in ethtool_get_phy_stats()