summaryrefslogtreecommitdiff
path: root/cesar/cp/conn/inc/conn_defs.h
diff options
context:
space:
mode:
authorsave2008-04-07 14:17:42 +0000
committersave2008-04-07 14:17:42 +0000
commit3d58a62727346b7ac1a6cb36fed1a06ed72228dd (patch)
treed7788c3cf9f76426aef0286d0202e2097f0fa0eb /cesar/cp/conn/inc/conn_defs.h
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/cp/conn/inc/conn_defs.h')
-rw-r--r--cesar/cp/conn/inc/conn_defs.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/cesar/cp/conn/inc/conn_defs.h b/cesar/cp/conn/inc/conn_defs.h
new file mode 100644
index 0000000000..4884f89500
--- /dev/null
+++ b/cesar/cp/conn/inc/conn_defs.h
@@ -0,0 +1,118 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/conn/inc/conn_types.h
+ * \brief basics types for the conn module
+ * \ingroup cp_conn
+ */
+
+#ifndef CONN_TYPES_H_
+#define CONN_TYPES_H_
+
+#include "cp/cp_types.h"
+#include "mac/common/defs.h"
+#include "lib/blk.h"
+
+/*
+ * max number of BLE intervalle for a link
+ */
+#define MAX_NB_BLE_INT 10
+/*
+ * max number of available connexions
+ */
+#define MAX_NB_CONN (MAC_TEI_STA_NB * MAC_LLID_NB)
+
+// TODO : move this structure to the LINK module
+typedef struct link_t
+{
+ u8 tl_flag; // 11.5.35
+ tei_t stei;
+ tei_t dtei[MAX_STA_NB];
+ u8 lid;
+} link_t;
+
+typedef enum conn_status_t
+{
+ CONN_FREE,
+ CONN_WAIT,
+ CONN_ECTED
+} __attribute__ ((packed)) conn_status_t;
+
+typedef enum mac_service_type_t
+{
+ CONN_CONTENTION_FREE = 0,
+ CONN_CONTENTION_BASED = 1,
+ CONN_CONTENTION_FREE_PREFERED = 2
+} __attribute__ ((packed)) mac_service_type_t;
+
+typedef struct cinfo_t // table 7-145
+{
+ u8 valid;
+ mac_service_type_t mac_service_type;
+ u8 user_priority;
+ u8 arrival_time_stamp;
+ u8 smoothing;
+} cinfo_t;
+
+typedef struct qmp_t // table 7-147
+{
+ u16 cf[0x1C];
+ u32 cfl[4];
+ u8 cdesc;
+} qmp_t;
+
+typedef struct cspec_t // table 7-144
+{
+ cinfo_t cinfo_fw;
+ cinfo_t cinfo_rv;
+ qmp_t qmp_fw;
+ qmp_t qmp_rv;
+} cspec_t;
+
+typedef struct ble_t // table 11-196
+{
+ u16 end_time;
+ u8 ble;
+} ble_t;
+
+typedef struct con_info_t
+{
+ cspec_t cspec;
+ u16 cid;
+ mac_address_t init;
+ mac_address_t term;
+ ble_t ble_fw[MAX_NB_BLE_INT];
+ ble_t ble_rv[MAX_NB_BLE_INT];
+} con_info_t;
+
+typedef struct classifier_rules_t // 6.3
+{
+ u8 rule_id;
+ u8 rule[16];
+} classifier_rules_t;
+
+#define NB_RULES (BLK_SIZE - (2*sizeof(link_t) + sizeof(con_info_t))) / sizeof(classifier_rules_t)
+
+
+typedef struct connexion_t
+{
+ link_t fl; // forward link
+ link_t rl; // reverse link
+ con_info_t con_info;
+ classifier_rules_t rules[NB_RULES];
+} connexion_t;
+
+typedef struct conn_data_t
+{
+ conn_status_t conn_status;
+ connexion_t *connexion;
+ u16 req_id; // the id given by HLE
+}conn_data_t;
+
+
+#endif /*CONN_TYPES_H_*/