summaryrefslogtreecommitdiff
path: root/cesar/test_general/dataplane/inc/context.h
blob: 4307bfe168aef1e5c0a7eb7edd0b5dbc0aea2406 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef inc_context_h
#define inc_context_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    inc/context.h
 * \brief   Data plane test context.
 * \ingroup test
 */

#include <cyg/hal/hal_arch.h>
#include <cyg/kernel/kapi.h>

#include "hal/timer/timer.h"
#include "mac/pbproc/pbproc.h"
#include "mac/sar/sar.h"
#include "cl/cl.h"

#include "mac/ca/test/fcall/beacon_period.h"
#include "mac/common/test/fcall/set_tonemap.h"

/* Forward declaration. */
typedef struct test_dataplane_t test_dataplane_t;
typedef struct test_dataplane_msg_t test_dataplane_msg_t;

#include "inc/trace_dump.h"

/** Asynchronous message callback. */
typedef void (*test_dataplane_msg_cb_t) (test_dataplane_t *ctx,
                                         test_dataplane_msg_t *msg);

/** Data plane asynchronous messages. */
struct test_dataplane_msg_t
{
    /** Message callback. */
    test_dataplane_msg_cb_t cb;
    /** Message data. */
    union {
        test_dataplane_msg_trace_dump_t trace_dump;
    } msg;
};
/* Forward declared above. */

/** Data plane test context. */
struct test_dataplane_t
{
    /** Mac configuration. */
    mac_config_t config;
    /** Short network identifier. */
    u8 snid;
    /** Mac MFS and STA store. */
    mac_store_t *store;
    /** PBProc context. */
    pbproc_t *pbproc;
    /** SAR context. */
    sar_t *sar;
    /** CL context. */
    cl_t *cl;
    /** Timer context. */
    hal_timer_t *hal_timer;

    /** Add/set beacon period. */
    ca_test_fcall_beacon_period_t beacon_period;
    /** Set tonemap. */
    mac_test_fcall_set_tonemap_t set_tonemap;

    /** Function call context for return. */
    fcall_ctx_t *fcall;
    /** Function call identifier for return. */
    unsigned short fcall_msg_id;

    /** Asynchronous messages. */
    test_dataplane_msg_t msg;
    /** Asynchronous message semaphore. */
    cyg_sem_t msg_sem;

    /** Kernel thread handle. */
    cyg_handle_t thread;
    /** Kernel thread storage. */
    cyg_thread thread_storage;
    /* Thread stack. */
    u8 thread_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
};
/* Forward declared above. */

#endif /* inc_context_h */