]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/io/eth/v2_0/include/eth_drv_stats.h
Initial revision
[karo-tx-redboot.git] / packages / io / eth / v2_0 / include / eth_drv_stats.h
1 #ifndef CYGONCE_IO_ETH_ETH_DRV_STATS_H
2 #define CYGONCE_IO_ETH_ETH_DRV_STATS_H
3 //==========================================================================
4 //
5 //      include/cyg/io/eth/eth_drv_stats.h
6 //
7 //      High level networking driver interfaces - statistics gathering
8 //
9 //==========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 //
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
18 //
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 // for more details.
23 //
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 //
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
34 //
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
37 //
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //==========================================================================
43 //#####DESCRIPTIONBEGIN####
44 //
45 // Author(s):    hmt
46 // Contributors: hmt
47 // Date:         2000-08-23
48 // Purpose:      
49 // Description:  High level networking driver interfaces - stats gathering
50 //              
51 //
52 //####DESCRIPTIONEND####
53 //
54 //==========================================================================
55
56 #include <pkgconf/system.h>
57
58 #ifdef CYGPKG_NET
59 #include <sys/param.h>
60 #include <sys/socket.h>
61
62 #include <net/if.h>
63
64 // This information is oriented towards SNMP's needs.
65
66 #define DESC_LEN (48)
67 #define SNMP_CHIPSET_LEN (20)
68
69 struct ether_drv_stats {
70     struct ifreq ifreq;                 // tell ioctl() which interface.
71
72     char description[ DESC_LEN ];       // Textual description of hardware
73     unsigned char snmp_chipset[ SNMP_CHIPSET_LEN ];
74                                         // SNMP ID of chipset
75     unsigned char duplex;               // 1 = UNKNOWN, 2 = SIMPLEX, 3 = DUPLEX
76     unsigned char operational;          // 1 = UNKNOWN, 2 = DOWN, 3 = UP
77     // These are general status information:
78     unsigned int speed;                 // 10,000,000 or 100,000,000
79                                         //     to infinity and beyond?
80
81     // These are typically kept by device hardware - and there may be some
82     // cost for getting up to date values:
83
84     unsigned int supports_dot3;  /* Boolean value if the device supports dot3*/
85     unsigned int tx_good;
86     unsigned int tx_max_collisions;
87     unsigned int tx_late_collisions;
88     unsigned int tx_underrun;
89     unsigned int tx_carrier_loss;
90     unsigned int tx_deferred;
91     unsigned int tx_sqetesterrors;
92     unsigned int tx_single_collisions;
93     unsigned int tx_mult_collisions;
94     unsigned int tx_total_collisions;
95     unsigned int rx_good;
96     unsigned int rx_crc_errors;
97     unsigned int rx_align_errors;
98     unsigned int rx_resource_errors;
99     unsigned int rx_overrun_errors;
100     unsigned int rx_collisions;
101     unsigned int rx_short_frames;
102     unsigned int rx_too_long_frames;
103     unsigned int rx_symbol_errors;
104
105     // These are typically kept by driver software:
106     unsigned int interrupts;
107     unsigned int rx_count;
108     unsigned int rx_deliver;
109     unsigned int rx_resource;
110     unsigned int rx_restart;
111     unsigned int tx_queue_len;
112     unsigned int tx_count;
113     unsigned int tx_complete;
114     unsigned int tx_dropped;
115
116     // Add any others here...
117
118 };
119 #endif // CYGPKG_NET
120 #endif // CYGONCE_IO_ETH_ETH_DRV_STATS_H
121
122 // EOF include/cyg/io/eth/eth_drv_stats.h