Statistical information for devices
typedef struct nic_stats {
uint32t revision;
uint32t media;
union {
nic_ethernet_stats_t estats;
nic_wifi_stats_t wstats;
} un;
uint32t valid_stats;
uint32t txed_ok;
uint32t rxed_ok;
uint64t octets_txed_ok;
uint64t octets_rxed_ok;
uint32t txed_multicast;
uint32t rxed_multicast;
uint32t txed_broadcast;
uint32t rxed_broadcast;
uint32t tx_failed_allocs;
uint32t rx_failed_allocs;
};
The net_stats_t structure is used when a
module wants to keep track of mandatory and non-mandatory statistical
information. Higher-level software may query the driver's
statistical counter by issuing the DCMD_IO_NET_GET_STATS
devctl(). The results from the devctl are stored in
net_stats_t.
The members include:
- revision
- Set this field to NIC_STATS_REVISION.
- media
- Describes the device medium. It must
be set to one of the nic_media_types enumerated
types defined in <hw/nicinfo.h>. It's important
to set this field correctly, since it affects how
the rest of the structure will be interpreted.
- un.estats
- If the media type is NIC_MEDIA_802_3, this structure should
be filled with Ethernet-specific statistics. See
nic_ethernet_stats_t structure for
a description of the Ethernet-specific statistics structure.
- un.wstats
- If the media type is NIC_MEDIA_802_11, this structure should
be filled with wireless-specific statistics. See
nic_wifi_stats_t for
a description of the wireless-specific statistics structure.
- valid_stats
- A set of flags that indicate which generic statistics the driver keeps track of.
The following flags are defined:
- NIC_STAT_TXED_MULTICAST -- the txed_multicast
field is valid.
- NIC_STAT_RXED_MULTICAST -- the rxed_multicast
field is valid.
- NIC_STAT_TXED_BROADCAST -- the txed_broadcast
field is valid.
- NIC_STAT_RXED_BROADCAST -- the rxed_broadcast
field is valid.
- NIC_STAT_TX_FAILED_ALLOCS -- the tx_failed_alloced
field is valid.
- NIC_STAT_RX_FAILED_ALLOCS -- the rx_failed_alloced
field is valid.
- txed_ok
- This mandatory statistic counts
the number of packets transmitted
successfully.
- rxed_ok
- This mandatory statistic counts
the number of packets received
successfully.
- octets_txed_ok
- This mandatory statistic counts
the number of bytes transmitted successfully.
- octets_rxed_ok
- This mandatory statistic counts
the number of bytes received successfully.
- txed_multicast
- Counts the number of multicast packets
the interface transmits.
- rxed_multicast
- Counts the number of multicast packets
the interface receives.
- txed_broadcast
- Counts the number of broadcast packets
the interface transmits.
- rxed_broadcast
- Counts the number of broadcast packets
the interface receives.
- txed_failed_allocs
- Counts the number of dropped packets
that couldn't be transmitted because of
a failed attempt to allocate memory.
- rxed_failed_allocs
- Counts the number of dropped packets
that couldn't be received because of a
failed attempt to allocate memory.
QNX Neutrino