static int igb_txerrors(char *page, char **start, off_t off, int count, int *eof, void *data) { struct igb_adapter *adapter = (struct igb_adapter *)data; struct net_device_stats *net_stats; if (adapter == NULL) return snprintf(page, count, "error: no adapter\n"); net_stats = procfs_get_stats(adapter->netdev); if (net_stats == NULL) return snprintf(page, count, "error: no net stats\n"); return snprintf(page, count, "%lu\n", net_stats->tx_errors); }
static int ixgbe_txbytes(char *page, char __always_unused **start, off_t __always_unused off, int count, int __always_unused *eof, void *data) { struct ixgbe_adapter *adapter = (struct ixgbe_adapter *)data; struct net_device_stats *net_stats; if (adapter == NULL) return snprintf(page, count, "error: no adapter\n"); net_stats = procfs_get_stats(adapter->netdev); if (net_stats == NULL) return snprintf(page, count, "error: no net stats\n"); return snprintf(page, count, "%lu\n", net_stats->tx_bytes); }