summaryrefslogtreecommitdiff
path: root/cesar/mac/pbproc/test/maximus/inc
diff options
context:
space:
mode:
authorsave2008-04-07 14:17:42 +0000
committersave2008-04-07 14:17:42 +0000
commit3d58a62727346b7ac1a6cb36fed1a06ed72228dd (patch)
treed7788c3cf9f76426aef0286d0202e2097f0fa0eb /cesar/mac/pbproc/test/maximus/inc
parent095dca4b0a8d4924093bab424f71f588fdd84613 (diff)
Moved the complete svn base into the cesar directory.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1769 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/mac/pbproc/test/maximus/inc')
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/add_beacon_period.h23
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/add_seg.h23
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/context.h81
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/get_seg.h31
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/msg.h43
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/prepare_beacon.h23
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/set_tonemap.h23
-rw-r--r--cesar/mac/pbproc/test/maximus/inc/test_pbproc.h55
8 files changed, 302 insertions, 0 deletions
diff --git a/cesar/mac/pbproc/test/maximus/inc/add_beacon_period.h b/cesar/mac/pbproc/test/maximus/inc/add_beacon_period.h
new file mode 100644
index 0000000000..9df5a45281
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/add_beacon_period.h
@@ -0,0 +1,23 @@
+#ifndef inc_add_beacon_period_h
+#define inc_add_beacon_period_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/add_beacon_period.h
+ * \brief Add beacon period fcall.
+ * \ingroup test
+ */
+
+BEGIN_DECLS
+
+void
+test_pbproc_add_beacon_period_init (test_pbproc_t *ctx);
+
+END_DECLS
+
+#endif /* inc_add_beacon_period_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/add_seg.h b/cesar/mac/pbproc/test/maximus/inc/add_seg.h
new file mode 100644
index 0000000000..37705e1a90
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/add_seg.h
@@ -0,0 +1,23 @@
+#ifndef inc_add_seg_h
+#define inc_add_seg_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/add_seg.h
+ * \brief Add segments fcall.
+ * \ingroup test
+ */
+
+BEGIN_DECLS
+
+void
+test_pbproc_add_seg_init (test_pbproc_t *ctx);
+
+END_DECLS
+
+#endif /* inc_add_seg_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/context.h b/cesar/mac/pbproc/test/maximus/inc/context.h
new file mode 100644
index 0000000000..1a1fb93c6f
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/context.h
@@ -0,0 +1,81 @@
+#ifndef inc_context_h
+#define inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/context.h
+ * \brief PBProc test context.
+ * \ingroup test
+ */
+
+#include <cyg/hal/hal_arch.h>
+#include <cyg/kernel/kapi.h>
+
+#include "lib/rnd.h"
+#include "host/fcall.h"
+
+#include "mac/pbproc/pbproc.h"
+
+#include "inc/msg.h"
+
+/** Number of beacon periods to keep. */
+#define TEST_PBPROC_NB_BEACON_PERIOD 3
+
+typedef void
+(*test_pbproc_msg_handler_cb_t) (test_pbproc_t *ctx, test_pbproc_msg_t *msg);
+
+/** Test PBProc context. */
+struct test_pbproc_t
+{
+ /** Random context. */
+ lib_rnd_t rnd[1];
+ /** Mac configuration. */
+ mac_config_t config;
+ /** Mac MFS and STA store. */
+ mac_store_t *store;
+ /** PBProc context. */
+ pbproc_t *pbproc;
+ /** Channel Access context. */
+ ca_t *ca;
+
+ /** Beacon periods. */
+ ca_beacon_period_t beacon_periods[TEST_PBPROC_NB_BEACON_PERIOD];
+ /** Number of beacon periods. */
+ uint beacon_periods_nb;
+
+ /** Event semaphore. */
+ cyg_sem_t event_sem;
+ /** Mailbox handle. */
+ cyg_handle_t mbox;
+ /** Mailbox storage. */
+ cyg_mbox mbox_storage;
+ /** Static message. */
+ test_pbproc_msg_t static_msg;
+ /** Messages handlers. */
+ test_pbproc_msg_handler_cb_t msg_handlers[TEST_PBPROC_MSG_ID_NONE];
+
+ /** PBProc RX callback. */
+ pbproc_rx_cb_t rx_cb;
+ /** Number of received PB. */
+ uint rx_pb_nb;
+
+ /** Function call context for return. */
+ fcall_ctx_t *fcall;
+ /** Function call identifier for return. */
+ unsigned short fcall_msg_id;
+
+ /** 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 in inc/test_pbproc.h. */
+
+#endif /* inc_context_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/get_seg.h b/cesar/mac/pbproc/test/maximus/inc/get_seg.h
new file mode 100644
index 0000000000..c6dccc8697
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/get_seg.h
@@ -0,0 +1,31 @@
+#ifndef inc_get_seg_h
+#define inc_get_seg_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/get_seg.h
+ * \brief Get segments fcall.
+ * \ingroup test
+ */
+
+/** Get segments message. */
+struct test_pbproc_msg_get_seg_t
+{
+ /** Number of expected segments. */
+ uint seg_nb;
+};
+typedef struct test_pbproc_msg_get_seg_t test_pbproc_msg_get_seg_t;
+
+BEGIN_DECLS
+
+void
+test_pbproc_get_seg_init (test_pbproc_t *ctx);
+
+END_DECLS
+
+#endif /* inc_get_seg_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/msg.h b/cesar/mac/pbproc/test/maximus/inc/msg.h
new file mode 100644
index 0000000000..bd7ed8958a
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/msg.h
@@ -0,0 +1,43 @@
+#ifndef inc_msg_h
+#define inc_msg_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/msg.h
+ * \brief PBProc test messages.
+ * \ingroup test
+ */
+
+#include "inc/test_pbproc.h"
+#include "inc/add_seg.h"
+#include "inc/prepare_beacon.h"
+#include "inc/get_seg.h"
+#include "inc/add_beacon_period.h"
+#include "inc/set_tonemap.h"
+
+/** Test PBProc messages identifiers. */
+enum test_pbproc_msg_id_t
+{
+ TEST_PBPROC_MSG_ID_GET_SEG,
+ TEST_PBPROC_MSG_ID_NONE,
+};
+typedef enum test_pbproc_msg_id_t test_pbproc_msg_id_t;
+
+/** Message union. */
+struct test_pbproc_msg_t
+{
+ /** Message identifier. */
+ test_pbproc_msg_id_t id;
+ /** Message itself. */
+ union {
+ struct test_pbproc_msg_get_seg_t get_seg;
+ } msg;
+};
+typedef struct test_pbproc_msg_t test_pbproc_msg_t;
+
+#endif /* inc_msg_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/prepare_beacon.h b/cesar/mac/pbproc/test/maximus/inc/prepare_beacon.h
new file mode 100644
index 0000000000..d2446b1ddc
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/prepare_beacon.h
@@ -0,0 +1,23 @@
+#ifndef inc_prepare_beacon_h
+#define inc_prepare_beacon_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/prepare_beacon.h
+ * \brief Prepare beacon fcall.
+ * \ingroup test
+ */
+
+BEGIN_DECLS
+
+void
+test_pbproc_prepare_beacon_init (test_pbproc_t *ctx);
+
+END_DECLS
+
+#endif /* inc_prepare_beacon_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/set_tonemap.h b/cesar/mac/pbproc/test/maximus/inc/set_tonemap.h
new file mode 100644
index 0000000000..36fadbef99
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/set_tonemap.h
@@ -0,0 +1,23 @@
+#ifndef inc_set_tonemap_h
+#define inc_set_tonemap_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/set_tonemap.h
+ * \brief Set tonemap fcall.
+ * \ingroup test
+ */
+
+BEGIN_DECLS
+
+void
+test_pbproc_set_tonemap_init (test_pbproc_t *ctx);
+
+END_DECLS
+
+#endif /* inc_set_tonemap_h */
diff --git a/cesar/mac/pbproc/test/maximus/inc/test_pbproc.h b/cesar/mac/pbproc/test/maximus/inc/test_pbproc.h
new file mode 100644
index 0000000000..6cb16c87d0
--- /dev/null
+++ b/cesar/mac/pbproc/test/maximus/inc/test_pbproc.h
@@ -0,0 +1,55 @@
+#ifndef inc_test_pbproc_h
+#define inc_test_pbproc_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/test_pbproc.h
+ * \brief PBProc test on Maximus.
+ * \ingroup test
+ */
+#include "mac/pbproc/pbproc.h"
+
+/* Forward declaration. */
+typedef struct test_pbproc_t test_pbproc_t;
+
+/**
+ * Helper for parameter binding.
+ * \param name parameter string
+ * \param var parameter storage
+ * \return true if binding successful
+ */
+#define test_pbproc_fcall_bind(name, var) \
+ (fcall_param_bind (*param, *msg, (name), sizeof (var), &(var)) \
+ == sizeof (var))
+
+#define test_pbproc_fcall_bind_long(name, var) \
+ (fcall_param_bind_long (*param, *msg, (name), &(var)) == sizeof (var))
+
+/**
+ * Helper for parameter adding.
+ * \param name parameter string
+ * \param var parameter storage
+ */
+#define test_pbproc_fcall_add(name, var) \
+ dbg_check (fcall_param_add (&param, &msg, (name), sizeof (var), &(var)) \
+ != -1)
+
+#define test_pbproc_fcall_add_long(name, var) \
+ dbg_check (fcall_param_add_long (&param, &msg, (name), &(var)) != -1)
+
+BEGIN_DECLS
+
+void
+test_pbproc_default_rx_cb (void *user, mfs_t *mfs, mfs_t *mfs_mme,
+ const pbproc_rx_params_t *rx_params,
+ pb_t *pb_first, pb_t *pb_last, uint pb_nb,
+ pb_t *chandata_first, uint chandata_nb);
+
+END_DECLS
+
+#endif /* inc_test_pbproc_h */