summaryrefslogtreecommitdiff
path: root/mac/ca/inc/context.h
blob: 0096042cdf2a26a3c9485aa97dd914b5f8fa5fbd (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_ca_inc_context_h
#define mac_ca_inc_context_h
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/ca/inc/context.h
 * \brief   Channel Access private context.
 * \ingroup mac_ca
 */

#include "mac/ca/ca.h"
#include "mac/common/mfs.h"

#include "mac/ca/inc/backoff.h"
#include "mac/ca/inc/trace.h"

/** Channel Access context. */
struct ca_t
{
    /** Phy context. */
    phy_t *phy;
    /** Global configuration. */
    mac_config_t *config;
    /** MAC STA & MFS store. */
    mac_store_t *store;
#if CONFIG_TRACE
    /** CA trace. */
    trace_buffer_t trace;
    /** CA trace name space. */
    trace_namespace_t trace_namespace;
#endif /* !CONFIG_TRACE */
    /** Next ACCESS event parameters. */
    ca_access_param_t access_param;
    /** Start date of the current VCS. */
    u32 vcs_start_date;
    /** Length of the current VCS. */
    uint vcs_length_tck;
    /** Is current VCS a EIFS. */
    bool vcs_eifs;
    /** Programmed anticipation, may be needed if the timer must be
     * reprogrammed. */
    uint anticipation_tck;
    /** Backoff context. */
    ca_backoff_t backoff;
    /** Beacon period circular buffer head and tail. */
    uint beacon_periods_head, beacon_periods_tail;
    /** Beacon period circular buffer. */
    ca_beacon_period_t beacon_periods[CA_BEACON_PERIOD_NB];
    /** Schedules table. */
    ca_schedule_t schedules[CA_SCHEDULE_NB];
    /** Current beacon period index in buffer, or tail if not set. */
    uint current_beacon_period;
    /** Current allocation index in current schedule. */
    uint current_allocation_index;
    /** Priority sorted MFS heap. */
    heap_t mfs_heap;
    /** List of CFP MFS held until the next beacon period. */
    list_t cfp_held;
};
/* Forward declaration in mac/ca/ca.h. */

#endif /* mac_ca_inc_context_h */