O
> + * 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_port *port = netdev_priv(netdev);
> +     struct net_device_stats *stats = &port->net_stats;
> +
> +     memset(stats, 0, sizeof(*stats));
> +
> +     /* total packets received   */
> +     stats->rx_packets = port->stats.no_rcv;
> +     /* total packets transmitted    */
> +     stats->tx_packets = port->stats.xmitedframes + port->stats.xmitfinished;
> +     /* total bytes received     */
> +     stats->rx_bytes = port->stats.rxbytes;
> +     /* total bytes transmitted  */
> +     stats->tx_bytes = port->stats.txbytes;
> +     /* bad packets received     */
> +     stats->rx_errors = port->stats.rcvdbadskb;
> +     /* packet transmit problems */
> +     stats->tx_errors = port->stats.nocmddescriptor;
> +     /* no space in linux buffers    */
> +     stats->rx_dropped = port->stats.updropped;
> +     /* no space available in linux  */
> +     stats->tx_dropped = port->stats.txdropped;
> +
> +     return stats;
> +}

Why keep track of statistics in one structure then copy out to net_device
format? Instead just use original format.

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to