Rev 3666 | Rev 3886 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3666 | Rev 3846 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | * @file |
34 | * @file |
35 | */ |
35 | */ |
36 | 36 | ||
37 | #include "../int_map.h" |
37 | #include "../int_map.h" |
38 | 38 | ||
39 | #ifndef __NET_NETIF_DEVICE_ID_TYPE_H__ |
39 | #ifndef __NET_DEVICE_ID_TYPE_H__ |
40 | #define __NET_NETIF_DEVICE_ID_TYPE_H__ |
40 | #define __NET_DEVICE_ID_TYPE_H__ |
41 | 41 | ||
42 | #define DEVICE_MAP_DECLARE INT_MAP_DECLARE |
42 | #define DEVICE_MAP_DECLARE INT_MAP_DECLARE |
43 | #define DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT |
43 | #define DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT |
44 | 44 | ||
45 | typedef int netif_device_id_t; |
45 | typedef int device_id_t; |
- | 46 | ||
- | 47 | typedef enum device_state device_state_t; |
|
- | 48 | ||
- | 49 | typedef struct device_stats device_stats_t; |
|
- | 50 | typedef device_stats_t * device_stats_ref; |
|
- | 51 | ||
- | 52 | enum device_state{ |
|
- | 53 | NETIF_NULL = 0, |
|
- | 54 | NETIF_STOPPED, |
|
- | 55 | NETIF_ACTIVE, |
|
- | 56 | NETIF_CARRIER_LOST |
|
- | 57 | }; |
|
- | 58 | ||
- | 59 | // based on linux_kernel/include/linux/netdevice.h |
|
- | 60 | ||
- | 61 | struct device_stats{ |
|
- | 62 | unsigned long rx_packets; /* total packets received */ |
|
- | 63 | unsigned long tx_packets; /* total packets transmitted */ |
|
- | 64 | unsigned long rx_bytes; /* total bytes received */ |
|
- | 65 | unsigned long tx_bytes; /* total bytes transmitted */ |
|
- | 66 | unsigned long rx_errors; /* bad packets received */ |
|
- | 67 | unsigned long tx_errors; /* packet transmit problems */ |
|
- | 68 | unsigned long rx_dropped; /* no space in linux buffers */ |
|
- | 69 | unsigned long tx_dropped; /* no space available in linux */ |
|
- | 70 | unsigned long multicast; /* multicast packets received */ |
|
- | 71 | unsigned long collisions; |
|
- | 72 | ||
- | 73 | /* detailed rx_errors: */ |
|
- | 74 | unsigned long rx_length_errors; |
|
- | 75 | unsigned long rx_over_errors; /* receiver ring buff overflow */ |
|
- | 76 | unsigned long rx_crc_errors; /* recved pkt with crc error */ |
|
- | 77 | unsigned long rx_frame_errors; /* recv'd frame alignment error */ |
|
- | 78 | unsigned long rx_fifo_errors; /* recv'r fifo overrun */ |
|
- | 79 | unsigned long rx_missed_errors; /* receiver missed packet */ |
|
- | 80 | ||
- | 81 | /* detailed tx_errors */ |
|
- | 82 | unsigned long tx_aborted_errors; |
|
- | 83 | unsigned long tx_carrier_errors; |
|
- | 84 | unsigned long tx_fifo_errors; |
|
- | 85 | unsigned long tx_heartbeat_errors; |
|
- | 86 | unsigned long tx_window_errors; |
|
- | 87 | ||
- | 88 | /* for cslip etc */ |
|
- | 89 | unsigned long rx_compressed; |
|
- | 90 | unsigned long tx_compressed; |
|
- | 91 | }; |
|
46 | 92 | ||
47 | #endif |
93 | #endif |
48 | 94 | ||
49 | /** @} |
95 | /** @} |
50 | */ |
96 | */ |