#ifndef mac_pbproc_inc_prep_mpdu_h #define mac_pbproc_inc_prep_mpdu_h /* Maria project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file mac/pbproc/inc/prep_mpdu.h * \brief Prepare MPDU complex function. * \ingroup mac_pbproc */ #include "mac/pbproc/pbproc.h" #include "mac/pbproc/inc/fc.h" /** Information about the prepared MPDU. Only contains information for one * SOF frame, not a complete burst. */ struct pbproc_prep_mpdu_t { /** Destination TEI. */ u8 dtei; /** Link identifier. */ u8 lid; /** Is there a prepared frame. */ bool valid; /** With acknowledgement (unicast or multicast partial * acknowledgement). */ bool wack; /** Use RTS/CTS. */ bool rts_cts; /** Is a burst, TODO: this may become a MPDU count. */ bool burst; /** RTS TX date of start of preamble. */ u32 rts_tx_date; /** RTS frame control. */ pbproc_fc_t rts_fc_av; /** RTS frame control 1.0. */ u32 rts_fc_10; /** Frame control mode. */ phy_fc_mode_t fc_mode; /** Modulation type. */ phy_mod_t mod; /** TCC rate. */ phy_fecrate_t fecrate; /** PB size. */ phy_pb_size_t pb_size; /** Guard interval. */ phy_gil_t gil; /** Tonemap. */ blk_t *tonemap; /** SOF TX date of start of preamble. */ u32 tx_date; /** SOF frame control. */ pbproc_fc_t fc_av; /** SOF frame control 1.0. */ u32 fc_10; /** Frame length with preamble (including IFS). */ uint flp_tck; /** Used main MFS. */ mfs_tx_t *main_mfs; /** Main MFS first segment. */ pb_t *main_head; /** Main MFS last segment. */ pb_t *main_tail; /** Number of main MFS segment. */ uint main_seg_nb; /** Number of reserved main MFS segment from MFS still to be queued. */ uint main_seg_nb_reserved; /** Used combined MFS. */ mfs_tx_t *combined_mfs; /** Combined MFS first segment. */ pb_t *combined_head; /** Combined MFS last segment. */ pb_t *combined_tail; /** Number of combined MFS segment. */ uint combined_seg_nb; /** Number of reserved combined MFS segment from MFS still to be * queued. */ uint combined_seg_nb_reserved; /** Number of pending segments, if no new segment is available, they will * be sent as PB null. */ uint seg_nb_pending; /** First PB. */ pb_t *head; /** Last PB. */ pb_t *tail; /** Total number of PB. */ uint pb_nb_total; /** Do not use AES encryption. */ bool bypass_aes; /** First three AES initialisation vector words. */ u32 iv[3]; /** AES network encryption key. */ u32 *nek; }; typedef struct pbproc_prep_mpdu_t pbproc_prep_mpdu_t; BEGIN_DECLS /** * Initialise prepared MPDU structure. * \param ctx pbproc context */ void pbproc_prep_mpdu_init (pbproc_t *ctx); /** * Prepare a beacon, using informations from CA. * \param ctx pbproc context */ void pbproc_prep_beacon (pbproc_t *ctx); /** * Prepare the next MPDU, using informations from CA. * \param ctx pbproc context */ void pbproc_prep_mpdu (pbproc_t *ctx); /** * Chain the remaining segments. * \param ctx pbproc context */ void pbproc_prep_mpdu_chain (pbproc_t *ctx); /** * Cancel a MPDU preparation and repair MFS. * \param ctx pbproc context */ void pbproc_prep_mpdu_cancel (pbproc_t *ctx); /** * Acknowledge every PB. * \param ctx pbproc context */ void pbproc_prep_mpdu_ack_all (pbproc_t *ctx); /** * Acknowledge a selection of PBs based on bitmap information. * \param ctx pbproc context * \param bmp bitmap * \param bmps bitmap start offset * \param bmpl bitmap available bits */ void pbproc_prep_mpdu_ack_bitmap (pbproc_t *ctx, const u32 *bmp, uint bmps, uint bmpl); /** * Acknowledge a selection of PBs based on compressed bitmap information. * \param ctx pbproc context * \param si SACKI bits * \param sil number of SACKI bits */ void pbproc_prep_mpdu_ack_encoded (pbproc_t *ctx, u32 si[3], uint sil); END_DECLS #endif /* mac_pbproc_inc_prep_mpdu_h */