#ifndef bsu_inc_context_h #define bsu_inc_context_h /* Cesar project {{{ * * Copyright (C) 2010 Spidcom * * <<>> * * }}} */ /** * \file bsu/inc/context.h * \brief BSU context. * \ingroup bsu */ #include "common/defs/homeplugAV.h" #include "bsu/bsu.h" #include "bsu/ntb/ntb_sync.h" #include "bsu/beacon/beacon.h" #include "bsu/inc/trace.h" /** Number of foreign AVLNs handled. */ #define BSU_FOREIGN_AVLNS_NB (HPAV_AVLNS_NB_MAX - 1) /** Index of processed data used by the merge schedule process. */ struct bsu_avln_schedules_process_t { /** Persistent schedules to use. */ bsu_beacon_bmi_persistent_schedule_desc_t *ps; /** Persistent schedules allocation index. */ uint ps_alloc_index; /** Non persistent schedules allocation index. */ uint nps_alloc_index; }; typedef struct bsu_avln_schedules_process_t bsu_avln_schedules_process_t; /** BSU AVLN data. */ struct bsu_avln_t { /** The beacon schedules data. */ bsu_beacon_avln_t bs; /** NTB synchronisation data. */ bsu_ntb_sync_t sync; }; struct bsu_t { /** Mac config. */ mac_config_t *mac_config; /** Mac Store. */ mac_store_t *mac_store; /** Channel access context. */ ca_t *ca; /** SAR context. */ sar_t *sar; /** Phy context. */ phy_t *phy; /** Upper layer user data.*/ void *ul_data; /** Call back to provide the beacon to the upper layer. */ bsu_beacon_processed_t ul_cb; /** ACLF context. */ bsu_aclf_t *aclf; /** Station's AVLN. */ bsu_avln_t *sta_avln; /** Others AVLN's data. */ bsu_avln_t avlns[HPAV_AVLNS_NB_MAX]; /** Number of others AVLN NTB. */ uint avlns_nb; /** Special power on AVLN data. */ bsu_avln_t poweron; /** NID to track. */ u64 nid_track; /** SNID to track. */ u16 snid_track; /** TEI to track. */ u8 tei_track; /** CA schedule index. */ u8 ca_index; /** Is station */ bsu_update_sta_type_t is_sta; /** Beacon data to use. */ bsu_beacon_t beacon; /** HAL timer context. */ hal_timer_t *hal_timer; /** HAL timer instance. */ hal_timer_instance_t timer; /** Activated status. */ bool activate; /** Beacons MFS. */ mfs_tx_t *mfs_beacons[BSU_BEACON_TYPE_NB]; /** Statistics sent beacons. */ u32 beacon_nb_sent[BSU_BEACON_TYPE_NB]; /** Statistics received beacons. */ u32 beacon_nb_recv[BSU_BEACON_TYPE_NB]; #if CONFIG_TRACE /** Trace system. */ trace_buffer_t trace; #endif /* !CONFIG_TRACE */ }; #endif /* bsu_inc_context_h */