diff options
| author | Maciej W. Rozycki <macro@linux-mips.org> | 2004-10-04 22:29:45 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2004-10-04 22:29:45 -0700 |
| commit | 6ac4b57fa1525c9e923a96f3b69fa8f2248b7ec2 (patch) | |
| tree | d0f3e2f9e9490195661e5a8592060e4bd3ade33d /include/linux | |
| parent | bbafa8abb067271768cd871d55cabecce70ac4df (diff) | |
[NET]: Fix fddi_statistics for 64-bit
There is a problem with "struct fddi_statistics" for 64-bit systems.
The starting members of the struct are expected to correspond to the
respective members of "struct net_device_stats" (drivers for FDDI
devices return "struct fddi_statistics" in the response to the
get_stats() call of "struct net_device"). Unfortunately, due to using
different types (u32 vs ulong) they do not. "struct net_device_stats"
is a public interface and as a result, bogus results are retrieved,
e.g. for /proc/net/dev.
Here is my proposal to address the problem. I think there is no
point in duplicating the layout of "struct net_device_stats" in
"struct fddi_statistics" as the former can simply be included as a
member avoiding this problem and actually any possible discrepancy in
the future. This also preserves the layout of the structure for
32-bit systems.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/if_fddi.h | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 221796362253..a912818e6361 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h @@ -5,7 +5,7 @@ * * Global definitions for the ANSI FDDI interface. * - * Version: @(#)if_fddi.h 1.0.1 09/16/96 + * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004 * * Author: Lawrence V. Stefani, <stefani@lkg.dec.com> * @@ -103,38 +103,12 @@ struct fddihdr } __attribute__ ((packed)); /* Define FDDI statistics structure */ -struct fddi_statistics - { - __u32 rx_packets; /* total packets received */ - __u32 tx_packets; /* total packets transmitted */ - __u32 rx_bytes; /* total bytes received */ - __u32 tx_bytes; /* total bytes transmitted */ - __u32 rx_errors; /* bad packets received */ - __u32 tx_errors; /* packet transmit problems */ - __u32 rx_dropped; /* no space in linux buffers */ - __u32 tx_dropped; /* no space available in linux */ - __u32 multicast; /* multicast packets received */ - __u32 transmit_collision; /* always 0 for FDDI */ +struct fddi_statistics { + + /* Generic statistics. */ - /* detailed rx_errors */ - __u32 rx_length_errors; - __u32 rx_over_errors; /* receiver ring buff overflow */ - __u32 rx_crc_errors; /* recved pkt with crc error */ - __u32 rx_frame_errors; /* recv'd frame alignment error */ - __u32 rx_fifo_errors; /* recv'r fifo overrun */ - __u32 rx_missed_errors; /* receiver missed packet */ + struct net_device_stats gen; - /* detailed tx_errors */ - __u32 tx_aborted_errors; - __u32 tx_carrier_errors; - __u32 tx_fifo_errors; - __u32 tx_heartbeat_errors; - __u32 tx_window_errors; - - /* for cslip etc */ - __u32 rx_compressed; - __u32 tx_compressed; - /* Detailed FDDI statistics. Adopted from RFC 1512 */ __u8 smt_station_id[8]; |
