#ifndef mac_common_link_stats_h #define mac_common_link_stats_h /* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file mac/common/link_stats.h * \brief MAC frame stream. * \ingroup mac_common */ #if defined (ECOS) && ECOS # include #endif /** TX link stats. */ struct link_stats_tx_t { /** Date of the begining of statistics collection. */ u32 statistics_start_rtc_date; /** Number of MSDUs received from HLE. */ u32 num_msdus; /** Number of octets of MSDUs payload received from HLE. */ u32 octets; /** Number of segments that were generated. */ u32 num_segs; /** Number of segments that were successfully delivered. */ u32 num_segs_suc; /** Number of segments that were dropped. */ u32 num_segs_dropped; /** Number of PBs handed over to the PHY for transmission. */ u32 num_pbs; /** Number of MPDUs that were transmitted. */ u32 num_mpdus; /** Number of burts that were transmitted. */ u32 num_bursts; /** Number of MPDUs that were successfully acknoledged. */ u32 num_sacks; /** Number of bad CRCs from transmitted pbs. */ u32 num_bad_pbs_crc; }; typedef struct link_stats_tx_t link_stats_tx_t; /** RX link stats. */ struct link_stats_rx_t { /** Date of the begining of statistics collection. */ u32 statistics_start_rtc_date; /** Number of MSDUs successfully received. */ u32 num_msdus; /** Number of octets of MSDUs payload successfully received. */ u32 octets; /** Number of segments that were successfully received. */ u32 num_segs_suc; /** Number of segments that were missed. */ u32 num_segs_missed; /** Number of PBs handed over from the PHY to the MAC. */ u32 num_pbs; /** Number of MPDUs that were received. */ u32 num_mpdus; /** Number of burts that were received. */ u32 num_bursts; /** Number of received MAC frame from which ICV failed. */ u32 num_icv_fails; /** Number of bad CRCs from received pbs. */ u32 num_bad_pbs_crc; }; typedef struct link_stats_rx_t link_stats_rx_t; /** * Reset TX link stats. * \param stats stats structure */ extern inline void link_stats_tx_reset (link_stats_tx_t *stats) { #if defined (ECOS) && ECOS stats->statistics_start_rtc_date = cyg_current_time (); #else stats->statistics_start_rtc_date = 0; #endif stats->num_msdus = 0; stats->octets = 0; stats->num_segs = 0; stats->num_segs_suc = 0; stats->num_segs_dropped = 0; stats->num_pbs = 0; stats->num_mpdus = 0; stats->num_bursts = 0; stats->num_sacks = 0; stats->num_bad_pbs_crc = 0; } /** * Reset RX link stats. * \param stats stats structure */ extern inline void link_stats_rx_reset (link_stats_rx_t *stats) { #if defined (ECOS) && ECOS stats->statistics_start_rtc_date = cyg_current_time (); #else stats->statistics_start_rtc_date = 0; #endif stats->num_msdus = 0; stats->octets = 0; stats->num_segs_suc = 0; stats->num_segs_missed = 0; stats->num_pbs = 0; stats->num_mpdus = 0; stats->num_bursts = 0; stats->num_icv_fails = 0; stats->num_bad_pbs_crc = 0; } #endif /* mac_common_link_stats_h */