#ifndef SAR_UNIT_TEST_FUNCTIONS_H_ #define SAR_UNIT_TEST_FUNCTIONS_H_ /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file sar_unit_test_functions.h * \brief function for the unit tests. * \ingroup mac/sar/inc * */ #include #include "lib/rnd.h" #include "mac/sar/sar.h" /** TODO REMOVE THIS FUNCTIONS **/ /** PB pool a pool used by the Pb proc to stock the data received from the other * STA. * TODO TBR*/ struct pb_pool_t { pb_t *head; pb_t *tail; uint quantity; }; typedef struct pb_pool_t pb_pool_t; /** Structure to konw the status of the PBDMA * TBR*/ struct dma_status_t { BITFIELDS_WORD ( u32 stop :1;, u32 request_irq :1;, u32 direction :1;, u32 cv_error :1;, u32 icv_reset :1;, u32 icv_store :1;, u32 append_zero :1;, u32 data_addr_mask :25; )}; typedef struct dma_status_t dma_status_t; struct sar_pbproc_t { u32 cpt_expiration; }; typedef struct sar_pbproc_t sar_pbproc_t; /** * Initialise pbproc and return its context. * \param config global mac configuration * \param store MFS and STA store * \param user_data user data passed to any callback * \param rx_cb MPDU RX callback * \return pbproc context */ pbproc_t * pbproc_init (mac_config_t *config, mac_store_t *store); void pbproc_init_cb (pbproc_t *ctx, void *user_data, pbproc_rx_cb_t rx_cb, pbproc_rx_beacon_cb_t rx_beacon_cb); void pbproc_uninit(pbproc_t *ctx); /** * Give segments back to pbproc for reception. * \param ctx pbproc context * \param first first segment * \param last last segment * \param nb number of segment */ void pbproc_rx_segment_refill (pbproc_t *ctx, pb_t *first, pb_t *last, uint nb); /** * Get the current NTB. * \param ctx pbproc context * \return current NTB */ u32 pbproc_get_ntb (pbproc_t *ctx); /** * Unregister an MFS from the Channel Access, so that it can no longer be * sent. * \param ctx ca context * \param mfs the MFS to remove * \return true if successful * * If unsuccessful, the caller should try later because the MFS is currently * been used for a transmission. */ bool ca_mfs_remove (ca_t *ctx, mfs_tx_t *mfs); /** * Register an MFS with the Channel Access, so it can be sent. * \param ctx ca context * \param mfs the MFS to add */ void ca_mfs_add (ca_t *ctx, mfs_tx_t *mfs); void ca_mfs_update (ca_t *ctx, mfs_tx_t *mfs); #endif /*SAR_UNIT_TEST_FUNCTIONS_H_*/