/*
    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.c,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 $
*/
#include "IOPciNetDeviceStats.h"

// Global strings
static char strNetStatistics[] =	"NET : Statistics :\n";
static char strNumRxPackets[] =	 	"      Number of Received Packets     : %i\n";
static char strNumTxPackets[] =	 	"      Number of Transmitted Packets  : %i\n";
static char strBytesRx[] =			"      Total Bytes Received           : %i\n";
static char strBytesTx[] =			"      Total Bytes Transmitted        : %i\n";
static char strNumRxErrors[] =		"      Number of RX Errors            : %i\n";
static char strNumTxErrors[] =		"      Number of TX Errors            : %i\n";
static char strDroppedRxPackets[] = "      Number of Dropped RX Packets   : %i\n";
static char strNumCollisions[] =	"      Number of Collisions           : %i\n";
static char strDetailedRxErrors[] = "NET : Detailed RX Errors :\n";
static char strNumOverflows[] =	 	"      Number of Overflows            : %i\n";
static char strNumCRCErrors[] =	 	"      Number of CRC Errors           : %i\n";
static char strNumFrameErrors[] =	"      Number of Frame Errors         : %i\n";
static char strNumRxFifoErrors[] =	"      Number of Fifo Errors          : %i\n";
static char strNumMissedPackets[] = "      Number of Missed Packets       : %i\n";
static char strDetailedTxErrors[] = "NET : Detailed TX Errors :\n";
static char strNumAbortErrors[] = 	"      Number of Abort Errors         : %i\n";
static char strNumCarrierErrors[] = "      Number of Carrier Errors       : %i\n";
static char strNumTxFifoErrors[] =  "      Number of Fifo Errors          : %i\n";
static char strNumWindowErrors[] =  "      Number of Window Errors        : %i\n";


void IOPciNetDevicePrintStats(netDeviceStats * stats)
{
  printf("\n");
  printf(strNetStatistics);
  printf(strNumRxPackets, stats->rx_packets);
  printf(strNumTxPackets, stats->tx_packets);
  printf(strBytesRx, stats->rx_bytes);
  printf(strBytesTx, stats->tx_bytes);
  printf(strNumRxErrors, stats->rx_errors);
  printf(strNumTxErrors, stats->tx_errors);
  printf(strDroppedRxPackets, stats->rx_dropped);
  printf(strNumCollisions, stats->collisions);
  printf(strDetailedRxErrors);
  printf(strNumOverflows, stats->rx_over_errors);
  printf(strNumCRCErrors, stats->rx_crc_errors);
  printf(strNumFrameErrors, stats->rx_frame_errors);
  printf(strNumRxFifoErrors, stats->rx_fifo_errors);
  printf(strNumMissedPackets, stats->rx_missed_errors);
  printf(strDetailedTxErrors);
  printf(strNumAbortErrors, stats->tx_aborted_errors);
  printf(strNumCarrierErrors, stats->tx_carrier_errors);
  printf(strNumTxFifoErrors, stats->tx_fifo_errors);
  printf(strNumWindowErrors, stats->tx_window_errors);
  printf("\n");
}
