#ifndef cp2_conn_link_h #define cp2_conn_link_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file link.h * \brief link management * \ingroup cp2/conn * * « long description » */ #include "lib/blk.h" /** * cinfo structure */ struct cp_link_cinfo_t { /** * Validity : 0x00 not valid ; 0x01 valid */ u8 valid_cinfo; /** * type of connection requested */ u8 mac_service_t; /** * CAP */ u8 user_priority; /** * Transfer of the ATS to the HLE : 0x00 not 0x01 passed */ u8 ats; /** * 0x00 no smoothing 0x01 smoothing if possible */ u8 smoothing; }; typedef struct cp_link_cinfo_t cp_link_cinfo_t; /** * ble interval values */ struct cp_link_ble_interval_t { /** * ble value */ u8 ble; /** * end time */ u16 et; }; typedef struct cp_link_ble_interval_t cp_link_ble_interval_t; enum cp_link_presence_t { CP_LINK_PRESENCE_FILLED, CP_LINK_PRESENCE_NOT_FILLED }; typedef enum cp_link_presence_t cp_link_presence_t; /** * table used for 2 purposes. To know if a field has been informed and * how to access the data into the structure with only the FID. */ struct cp_link_cspec_field_status_t { /** * Field identifier */ u8 fid; /** * presence status */ cp_link_presence_t presence; /** * memory access too the value of a field. */ u32 fid_position; }; typedef struct cp_link_cspec_field_status_t cp_link_cspec_field_status_t; /** * Connection Specification */ struct cp_link_cspec_t { /** * Delay Bound */ u32 delay; /** * jitter bound */ u32 jitter; /** * Average MPDU size */ u16 av_MPDU_size; /** * Maximum MPDU size */ u16 max_MPDU_size; /** * Average data rate */ u16 av_data_rate; /** * Minimum data rate */ u16 min_data_rate; /** * Maximum data rate */ u16 max_data_rate; /** * Maximum inter-TXOP time */ u16 max_inter_TXOP; /** * Minimum inter TXOP time */ u16 min_inter_TXOP; /** * Maximum burst time */ u16 max_burst; /** * Exception Policy */ u8 exception; /** * Inatictivity interval */ u32 inactivity; /** * MSDU error rate */ u16 MSDU_error_rate; /** * Convergence Layer SAP Type */ u8 CLST; /** * ATS tolerance */ u16 ATS; /** * Smallest Tolerable Average Data rate */ u16 min_tol_data; /** * Original average Data rate */ u16 ori_av_data_rate; /** * RX window size */ u16 rx_window; /** * Smoothing buffer size */ u32 smoothing:24; /** * Bidirectional burst */ u8 bidir_burst; /** * Number of TXOPs per beacon */ u8 nb_TXOP; /** * Average number of PBs per TXOP */ u16 av_nb_pb; /** * Maximum number of PBs per TXOP */ u16 max_nb_pb; /** * Pending PB threshold */ u16 ppb_threshold; /** * Surplus of Bandwidth */ u16 surplus_bw; /** * table used for 2 purposes. To know if a field has been informed * and how to access the data into the structure with only the FID. */ cp_link_cspec_field_status_t* presence_table[25]; }; typedef struct cp_link_cspec_t cp_link_cspec_t; /** * Structure of a link. */ struct cp_link_t { /** * global link identifier */ u8 lid; /** * connection information */ cp_link_cinfo_t* cinfo; /** * forward BLE */ // cp_link_ble_interval_t *ble; blk_t *ble; /** * expiration date of the connection used by the garbadge collector */ u16 expiration; /** * PCO status of the connection : 0 not PCO 1 PCO */ bool pco_status; /** * MAC addr of the Destination STAs */ u64 oda:48; /** * MAC addr of the Source STA */ u64 osa:48; /** \todo fill the comment. */ cp_link_cspec_t* cspec; /** * 0 forward link - 1 reverse link */ bool side; }; typedef struct cp_link_t cp_link_t; /** * Initialise the memory taken buy a link * \param void no argument * */ cp_link_t* cp_link_init (cp_link_ble_interval_t *table_ble, u16 nb_ble); /** * Clear the Memory taken buy a specific link. * \param link link to flush * */ void cp_link_uninit (cp_link_t *link); #endif /* cp_link_h */