summaryrefslogtreecommitdiff
path: root/cesar/bsu/ntb
diff options
context:
space:
mode:
authorlaranjeiro2010-05-17 09:08:06 +0000
committerlaranjeiro2010-05-17 09:08:06 +0000
commit05e9041696ed5816d4cb57bd15b99d3ca8d35c09 (patch)
tree8985e13f95cb9cf6ca7684db43fc315e73ca4800 /cesar/bsu/ntb
parent75e65578cc26ec84491d43fdb824634cec6e2e0e (diff)
cesar/bsu: add BSU and sub module headers
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7015 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/bsu/ntb')
-rw-r--r--cesar/bsu/ntb/ntb.h45
-rw-r--r--cesar/bsu/ntb/ntb_sync.h55
2 files changed, 100 insertions, 0 deletions
diff --git a/cesar/bsu/ntb/ntb.h b/cesar/bsu/ntb/ntb.h
new file mode 100644
index 0000000000..a71b9861d2
--- /dev/null
+++ b/cesar/bsu/ntb/ntb.h
@@ -0,0 +1,45 @@
+#ifndef bsu_ntb_ntb_h
+#define bsu_ntb_ntb_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2010 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file bsu/ntb/ntb.h
+ * \brief NTB clock synchronization.
+ * \ingroup bsu
+ */
+#include "bsu/ntb/ntb_sync.h"
+#include "mac/common/config.h"
+#include "hal/phy/phy.h"
+
+BEGIN_DECLS
+
+/*
+ * Synchronize local clock to be as close as possible to estimated value
+ * of the NTB clock reference.
+ * \param ctx the module context data.
+ * \param phy the phy context.
+ * \param beacon_bts beacon time stamp
+ * \param beacon_sta_ltmr STA local time captured when receiving beacon
+ */
+void
+bsu_ntb_clk_sync (bsu_ntb_sync_t * ctx, phy_t *phy, u32 beacon_bts,
+ u32 beacon_sys_ltmr, u32 beacon_sta_ltmr);
+
+/**
+ * Configure the clock frequency.
+ * \param ctx the module context data.
+ * \param mac_config the mac config object.
+ * \param phy the phy context.
+ */
+void
+bsu_ntb_clock_configure (bsu_ntb_sync_t *ctx, mac_config_t *mac_config,
+ phy_t *phy);
+
+END_DECLS
+
+#endif /* bsu_ntb_ntb_h */
diff --git a/cesar/bsu/ntb/ntb_sync.h b/cesar/bsu/ntb/ntb_sync.h
new file mode 100644
index 0000000000..a2f011c0aa
--- /dev/null
+++ b/cesar/bsu/ntb/ntb_sync.h
@@ -0,0 +1,55 @@
+#ifndef bsu_ntb_ntb_sync_h
+#define bsu_ntb_ntb_sync_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2010 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file bsu/ntb/ntb_sync.h
+ * \brief NTB synchronisation.
+ * \ingroup bsu_ntb
+ */
+
+struct bsu_ntb_sync_t
+{
+ /** Initialised ? */
+ bool init;
+ /** Number of beacon processed. */
+ u32 beacon_nb;
+ /** Frequency error. */
+ double fe;
+ /** beacon time stamp. */
+ u32 bts;
+ /** Preamble sys date. */
+ u32 preamble_sysdate;
+ /** Preamble sta date. */
+ u32 preamble_stadate;
+ /** Station frequency numerator. */
+ u32 sta_numerator;
+ /** NTB clock tick offset. */
+ u32 ntb_offset_tck;
+};
+typedef struct bsu_ntb_sync_t bsu_ntb_sync_t;
+
+BEGIN_DECLS
+
+/**
+ * Initialise NTB clock synchronisation.
+ * \param ctx the ntb context.
+ */
+void
+bsu_ntb_init (bsu_ntb_sync_t *ctx);
+
+/**
+ * Uninitialise NTB clock synchronisation.
+ * \param ctx the ntb context.
+ */
+void
+bsu_ntb_uninit (bsu_ntb_sync_t *ctx);
+
+END_DECLS
+
+#endif /* bsu_ntb_ntb_sync_h */