netxen: code cleanup

o remove unused structure defs.
o remove unnecessary includes.
o replace enums with specific #defines.
o reduce footprint of stats structure.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dhananjay Phadke
2009-04-07 22:50:38 +00:00
committed by David S. Miller
parent 577c9c456f
commit e98e3350c0
8 changed files with 143 additions and 253 deletions

View File

@@ -29,7 +29,7 @@
*/
#include <linux/vmalloc.h>
#include <linux/highmem.h>
#include <linux/interrupt.h>
#include "netxen_nic_hw.h"
#include "netxen_nic.h"
@@ -1598,10 +1598,6 @@ static void netxen_tx_timeout_task(struct work_struct *work)
netif_wake_queue(adapter->netdev);
}
/*
* netxen_nic_get_stats - Get System Network Statistics
* @netdev: network interface device structure
*/
struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
{
struct netxen_adapter *adapter = netdev_priv(netdev);
@@ -1609,22 +1605,11 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
memset(stats, 0, sizeof(*stats));
/* total packets received */
stats->rx_packets = adapter->stats.no_rcv;
/* total packets transmitted */
stats->tx_packets = adapter->stats.xmitedframes +
adapter->stats.xmitfinished;
/* total bytes received */
stats->tx_packets = adapter->stats.xmitfinished;
stats->rx_bytes = adapter->stats.rxbytes;
/* total bytes transmitted */
stats->tx_bytes = adapter->stats.txbytes;
/* bad packets received */
stats->rx_errors = adapter->stats.rcvdbadskb;
/* packet transmit problems */
stats->tx_errors = adapter->stats.nocmddescriptor;
/* no space in linux buffers */
stats->rx_dropped = adapter->stats.rxdropped;
/* no space available in linux */
stats->tx_dropped = adapter->stats.txdropped;
return stats;