summaryrefslogtreecommitdiff
path: root/cesar/mac/common/config.h
blob: f6b957ab614ce785b5e28f3efa43b12f36b8e49c (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
#ifndef mac_common_config_h
#define mac_common_config_h
/* Maria project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/common/config.h
 * \brief   MAC global configuration.
 * \ingroup mac_common
 *
 * Contains information about the current STA and AVLN settings.
 */
#include "mac/common/defs.h"
#include "mac/common/nek.h"
#include "mac/common/tonemask.h"

/** Global mac configuration.
 * \todo Document how to change a value (layers will want to be informed of
 * the change, does the stack needs to be reseted). */
struct mac_config_t
{
    /** Our terminal equipment identifier. */
    u8 tei;
    /** RTS broadcast flag. */
    bool rts_broadcast;
    /** Is this STA authenticated. */
    bool authenticated;
    /** EKS/NEK pairs, used for broadcast. */
    mac_nek_t nek[2];
    /** Number of FC symbol. */
    uint fc_symbols_nb;
    /** Tonemask. */
    tonemask_info_t tonemask_info;
    /** NTB offset.  NTB = phy_date () + ntb_offset_tck. */
    u32 ntb_offset_tck;
    /** Random seed.
     * For tests, it should be different for each station, but it should be
     * the same for each run.
     * For production run, it should be chosen as randomly as possible (may be
     * sampled from medium). */
    u32 seed;
    /** The mac address of the station */
    mac_t sta_mac_address;
    /** TEI used for partial acknowledgment if none is specified in the MFS,
     * or MAC_TEI_BCAST for none. */
    u8 partial_ack_tei_default;
};
typedef struct mac_config_t mac_config_t;

BEGIN_DECLS

/**
 * Provide a default MAC global configuration.
 * \param  config  global configuration.
 */
void
mac_config_init (mac_config_t *config);

END_DECLS

#endif /* mac_common_config_h */