summaryrefslogtreecommitdiff
path: root/mac/ca/inc/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'mac/ca/inc/context.h')
-rw-r--r--mac/ca/inc/context.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/mac/ca/inc/context.h b/mac/ca/inc/context.h
new file mode 100644
index 0000000000..1c6fc5efe5
--- /dev/null
+++ b/mac/ca/inc/context.h
@@ -0,0 +1,49 @@
+#ifndef mac_ca_inc_context_h
+#define mac_ca_inc_context_h
+/* Maria 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"
+
+/** Schedule circular buffer size. \todo TBD */
+#define CA_SCHEDULE_BUFFER_SIZE 32
+
+/** Channel Access context. */
+struct ca_t
+{
+ /** \todo document context. */
+ /** Scheduled MFS for next access. */
+ mfs_t *access_mfs;
+ /** End date of the current VCS. */
+ u32 vcs_end_date;
+ /** Programmed end date. It may be farther than vcs_end_date when
+ * it lands in a unusable region or sooner when we have a exclusive
+ * access to the medium for a response or a burst. Does not include
+ * anticipation. */
+ u32 programmed_end_date;
+ /** Programmed anticipation, may be needed if the timer must be
+ * reprogrammed. */
+ u32 anticipation_tck;
+ /** Backoff context. */
+ ca_backoff_t backoff;
+ /** Schedule circular buffer head and tail. */
+ uint schedule_head, schedule_tail;
+ /** Schedule circular buffer. */
+ ca_schedule_t schedule[CA_SCHEDULE_BUFFER_SIZE];
+};
+/* Forward declaration in ca.h. */
+
+#endif /* mac_ca_inc_context_h */