summaryrefslogtreecommitdiff
path: root/cesar/mac/common/sta.h
blob: 37134f65c576786633e70d2f171a9f3b29f44c92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef mac_common_sta_h
#define mac_common_sta_h
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/common/sta.h
 * \brief   Information about a peer.
 * \ingroup mac_common
 */
#include "mac/common/tonemap.h"
#include "cl/data_rate.h"

#include "mac/common/nek.h"
#include "ce/rx/bitloading/bitloading.h"
#include "ce/rx/bitloading/intervals.h"

/** Station information.  Must be < BLK_SIZE. */
struct sta_t
{
    /** Terminal equipment identifier. */
    u8 tei;
    /** Is this STA authenticated. */
    bool authenticated;
    /** EKS/NEK pairs pointer, used for unicast. */
    mac_nek_t (*nek)[2];
    /** Tonemaps for transmission. */
    tonemaps_t *tx_tonemaps;
    /** Tonemaps for reception. */
    tonemaps_t *rx_tonemaps;
    /** Station multi unicast reception capacity. */
    bool multi_unicast_receiver;
    /** Bit-loading state & data (CE/RX). */
    ce_rx_bitloading_t ce_rx_bt;
    /** Intervals state & data (CE/RX). */
    ce_rx_bitloading_intervals_t *intervals;
    /** Data rate for transmit from the local station to this one. */
    cl_data_rate_t tx_data_rate;
    /** Data rate for receive from this station to the local one. */
    cl_data_rate_t rx_data_rate;
};
typedef struct sta_t sta_t;

/**
 * Initialise a station, called from MAC store.
 * \param  sta  STA to initialise
 * \param  tei  TEI
 */
void
sta_init (sta_t *sta, uint tei);

/**
 * Release the blocks pointed by the sta_t
 * \param  sta Sta to uninit.
 *
 * Release the tonemaps,the set of tonemaps allocated during the existence of
 * the sta.( with eventually the tm_in_build used by Channel Estimation).
 */
void
sta_uninit (sta_t *sta);


#endif /* mac_common_sta_h */