#ifndef mac_common_interval_h #define mac_common_interval_h /* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file mac/common/interval.h * \brief Functions to handle intervals * \ingroup mac_common * * This header declares function to handle intervals (add a new interval for * example). */ #include "mac/common/tonemap.h" /** Number of allocated FSM. */ extern u8 mac_interval_fsm_count_; /** Number of FSM repetition in the beacon period. */ extern u8 mac_interval_repetition_count_; /** * Measure shift tolerance. When a measure is considered to have the size of * an interval, the measure must not be too shifted from it's interval * position. The PPDU payload should start or end within MAC_TM_TOLERANCE_TCK * (µs) of the boundary. */ extern u16 mac_interval_measure_shift_tolerance_; BEGIN_DECLS /** * Clear temporary intervals list. * \param tms the tone maps structure. */ void mac_interval_clear (tonemaps_t *tms); /** * Append an intervals to the temporary intervals list. * \param tms the tone maps structure. * \param end_offset_atu the offset of the end of the intervals (in ATU). * \param tmi the tone map index to use for this interval. * \return the count of intervals, or 0 if the interval can not be added (no * more place, or interval lower than the last one. * * This function does not check end_offset_atu is valid (not too much overt * the beacon period) nor TMI is valid (TMI exists). */ u8 mac_interval_append (tonemaps_t *tms, u16 end_offset_atu, u8 tmi); /** * Switch intervals list to the temporary intervals list. * \param tms the tone maps structure. * This function swap the pointers of intervals and intervals_temp. */ void mac_interval_commit_changes (tonemaps_t *tms); #endif /* mac_common_interval_h */