emac.c (a402eae64d0ad12b1c4a411f250d6c161e67f623) | emac.c (bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221) |
---|---|
1/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. 2 * 3 * This program is free software; you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License version 2 and 5 * only version 2 as published by the Free Software Foundation. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of --- 298 unchanged lines hidden (view full) --- 307 308 if (!netdev->phydev) 309 return -ENODEV; 310 311 return phy_mii_ioctl(netdev->phydev, ifr, cmd); 312} 313 314/* Provide network statistics info for the interface */ | 1/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. 2 * 3 * This program is free software; you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License version 2 and 5 * only version 2 as published by the Free Software Foundation. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of --- 298 unchanged lines hidden (view full) --- 307 308 if (!netdev->phydev) 309 return -ENODEV; 310 311 return phy_mii_ioctl(netdev->phydev, ifr, cmd); 312} 313 314/* Provide network statistics info for the interface */ |
315static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev, 316 struct rtnl_link_stats64 *net_stats) | 315static void emac_get_stats64(struct net_device *netdev, 316 struct rtnl_link_stats64 *net_stats) |
317{ 318 struct emac_adapter *adpt = netdev_priv(netdev); 319 unsigned int addr = REG_MAC_RX_STATUS_BIN; 320 struct emac_stats *stats = &adpt->stats; 321 u64 *stats_itr = &adpt->stats.rx_ok; 322 u32 val; 323 324 spin_lock(&stats->lock); --- 47 unchanged lines hidden (view full) --- 372 373 net_stats->tx_errors = stats->tx_late_col + stats->tx_abort_col + 374 stats->tx_underrun + stats->tx_trunc; 375 net_stats->tx_fifo_errors = stats->tx_underrun; 376 net_stats->tx_aborted_errors = stats->tx_abort_col; 377 net_stats->tx_window_errors = stats->tx_late_col; 378 379 spin_unlock(&stats->lock); | 317{ 318 struct emac_adapter *adpt = netdev_priv(netdev); 319 unsigned int addr = REG_MAC_RX_STATUS_BIN; 320 struct emac_stats *stats = &adpt->stats; 321 u64 *stats_itr = &adpt->stats.rx_ok; 322 u32 val; 323 324 spin_lock(&stats->lock); --- 47 unchanged lines hidden (view full) --- 372 373 net_stats->tx_errors = stats->tx_late_col + stats->tx_abort_col + 374 stats->tx_underrun + stats->tx_trunc; 375 net_stats->tx_fifo_errors = stats->tx_underrun; 376 net_stats->tx_aborted_errors = stats->tx_abort_col; 377 net_stats->tx_window_errors = stats->tx_late_col; 378 379 spin_unlock(&stats->lock); |
380 381 return net_stats; | |
382} 383 384static const struct net_device_ops emac_netdev_ops = { 385 .ndo_open = emac_open, 386 .ndo_stop = emac_close, 387 .ndo_validate_addr = eth_validate_addr, 388 .ndo_start_xmit = emac_start_xmit, 389 .ndo_set_mac_address = eth_mac_addr, --- 379 unchanged lines hidden --- | 380} 381 382static const struct net_device_ops emac_netdev_ops = { 383 .ndo_open = emac_open, 384 .ndo_stop = emac_close, 385 .ndo_validate_addr = eth_validate_addr, 386 .ndo_start_xmit = emac_start_xmit, 387 .ndo_set_mac_address = eth_mac_addr, --- 379 unchanged lines hidden --- |