summaryrefslogtreecommitdiff
path: root/cesar/cp2/beacon/ntb/src/ntb_clock_sync.c
diff options
context:
space:
mode:
authorchertier2008-04-17 08:27:20 +0000
committerchertier2008-04-17 08:27:20 +0000
commiteac7520b059d8464a27719b884022b3779b5c2fb (patch)
tree708e683dedffe5efe73e68d6d6c9c5a22b3c7e34 /cesar/cp2/beacon/ntb/src/ntb_clock_sync.c
parentcc382c565a6e83bbd37ee23ebf2e7a098e916f70 (diff)
update
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1838 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2/beacon/ntb/src/ntb_clock_sync.c')
-rwxr-xr-xcesar/cp2/beacon/ntb/src/ntb_clock_sync.c53
1 files changed, 44 insertions, 9 deletions
diff --git a/cesar/cp2/beacon/ntb/src/ntb_clock_sync.c b/cesar/cp2/beacon/ntb/src/ntb_clock_sync.c
index a38ca89285..1b56af6c4f 100755
--- a/cesar/cp2/beacon/ntb/src/ntb_clock_sync.c
+++ b/cesar/cp2/beacon/ntb/src/ntb_clock_sync.c
@@ -9,6 +9,13 @@
* \file cp/beacon/ntb/src/ntb_clock_sync.c
* \brief 25Mhz clock management and synchronization functions.
* \ingroup cp_beacon
+ *
+ * NTB clock management module initialisation and uninit
+ *
+ * Synchronize local STA clock by adjusting its clock divisor as needed
+ *
+ * NTB clock synchronization utilities
+ *
*/
#include "common/std.h"
#include <stdlib.h>
@@ -95,12 +102,12 @@ cp_beacon_ntb_update_offset_in_mac_config(cp_t *cp_ctx, signed long offset)
cp_ctx->ntb_mac_config->ntb_offset_tck = (unsigned long) offset;
}
-/*
+/**
* NTB clock management module initialisation.
*
* \param cp_ctx pointer to CP context
*
- * \return pointer to ntb_t NTB context data structure
+ * \return pointer to ntb_t NTB context data structure
*
* following contexts are needed and found in the CP context passed in argument
* pointer to phy context (phy_t *phy_ctx)
@@ -146,7 +153,29 @@ cp_beacon_ntb_init(cp_t *cp_ctx)
return ntb_ctx;
}
-/*
+/**
+ * Uninitialise the NTB clock synchronization manager.
+ *
+ * \param cp_ctx pointer to CP context.
+ */
+void
+cp_beacon_ntb_uninit( cp_t * cp_ctx )
+{
+ cp_beacon_ntb_reset_histo(cp_ctx);
+}
+
+/**
+ * Reset the NTB history data.
+ *
+ * \param cp_ctx pointer to the CP context.
+ */
+void
+cp_beacon_ntb_reset_histo( ntb_t * ctx )
+{
+ // TODO
+}
+
+/**
* Calculate the number of beacons lost (if any) between 2 beacons received.
*
* \param delta_ticks difference of BTS timestamp between 2 last received beacons
@@ -176,7 +205,7 @@ cp_beacon_ntb_lost_beacons(unsigned long delta_ticks)
return i;
}
-/*
+/**
* Synchronize local STA clock by adjusting its clock divisor as needed
* depending on
*
@@ -378,10 +407,16 @@ cp_beacon_ntb_clk_sync(cp_t *cp_ctx, unsigned long beacon_bts, unsigned long bea
#ifdef MANUFACTURER_TEST
-// Computing clock synchronization over time & beacons transmitted by CCo and received by STAs...
-// argv[1] = initial date for CCo
-// argv[2] = initial date for STA1
-// argv[3] = initial date for STA2
+/**
+ * Computing clock synchronization over time & beacons transmitted by CCo and received by STAs...
+ *
+ * \param argc count of arguments
+ * \param argv[1] initial date for CCo
+ * \param argv[2] initial date for STA1
+ * \param argv[3] initial date for STA2
+ *
+ * \return success (0) or failure (-1) status
+ */
int main(int argc, char *argv[])
{
unsigned long s;
@@ -557,4 +592,4 @@ int main(int argc, char *argv[])
return 0;
}
-#endif
+#endif /* MANUFACTURER_TEST */