/*
    Copyright 2000 (c) by Oliver Pfister,
    Swiss Federal Institute of Technology,
    Computer Engineering and Networks Laboratory.
 
    TOPSY -- A Teachable Operating System.
             Implementation of a tiny and simple
             micro kernel for teaching purposes.
 
    For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
    This software is provided under the terms of the GNU General Public 
    Licence. A full copy of the GNU GPL is provided in the file COPYING 
    found in the development root of Topsy.
*/
/*
	
    File:                  $Source: /home/ruf/cvs_Topsy/cvs/Topsy/IO/ia32/Drivers/IOPciNetDeviceStats.h,v $
    Author(s):             
    Affiliation:           ETH Zuerich, TIK
    Version:               $Revision: 2922 $
    Creation Date:         
    Last Date of Change:   $Date: 2007-03-19 17:48:52 +0100 (Mon, 19 Mär 2007) $      by: $Author: baderma $
*/
#ifndef _IOPCINETDEVICESTATS_H
#define _IOPCINETDEVICESTATS_H

#include "IODevice.h"
#include "IOPci.h"

// Network statistics and Errors
typedef struct netDeviceStats_t
{
  u64 rx_packets;       /* total packets received */
  u64 tx_packets;       /* total packets transmitted */
  u64 rx_bytes;         /* total bytes received    */
  u64 tx_bytes;         /* total bytes transmitted */
  u64 rx_errors;        /* bad packets received    */
  u64 tx_errors;        /* packet transmit problems    */
  u64 rx_dropped;       /* number of dropped received packets */
  u64 collisions;       /* number of collisions */

  /* detailed rx_errors: */
  u64 rx_over_errors;   /* receiver ring buff overflow */
  u64 rx_crc_errors;    /* recved pkt with crc error */
  u64 rx_frame_errors;  /* recv'd frame alignment error */
  u64 rx_fifo_errors;   /* recv'r fifo overrun */
  u64 rx_missed_errors; /* receiver missed packet */

  /* detailed tx_errors: */
  u64 tx_aborted_errors;
  u64 tx_carrier_errors;
  u64 tx_fifo_errors;
  u64 tx_window_errors;
}
netDeviceStats;

void IOPciNetDevicePrintStats(netDeviceStats * stats);

#endif _IOPCINETDEVICESTATS_H
