summaryrefslogtreecommitdiff
path: root/cesar/hal/phy/maximus
diff options
context:
space:
mode:
authorburet2008-10-10 07:30:57 +0000
committerburet2008-10-10 07:30:57 +0000
commitdcd5c31364ecdd577827e2666ee369984bd63047 (patch)
tree62acf63c7685b3b1b26acb3812358c0aef186c8e /cesar/hal/phy/maximus
parentbf05e5129fedcf6e659b9587bbc82f8fe0e97dc2 (diff)
[maximus] add the station seed functionality
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@3243 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/hal/phy/maximus')
-rw-r--r--cesar/hal/phy/maximus/src/maximus_phy_ctrl.c28
-rw-r--r--cesar/hal/phy/maximus/test/src/test_phy_ctrl.c16
2 files changed, 44 insertions, 0 deletions
diff --git a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
index 0920e376a3..b43228991b 100644
--- a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -2094,6 +2094,34 @@ phy_date (phy_t *ctx)
/**
+ * Get station seed.
+ * \param ctx phy context
+ * \return station seed
+ * set errno to:
+ * - EINVAL if ctx is null
+ */
+u32
+phy_seed (phy_t *ctx)
+{
+ u32 seed = 0;
+
+ dbg_assert_ptr(ctx);
+ if (NULL == ctx)
+ {
+ errno = EINVAL;
+ station_log(&my_station, STATION_LOG_ERROR, STATION_LOGTYPE_PHY,
+ "%s: errno = %d", __FUNCTION__, errno);
+ }
+ else
+ {
+ seed = my_station.seed;
+ }
+
+ return seed;
+}
+
+
+/**
* Retrieve uncorrected current date.
* \param ctx phy context
* \return current uncorrected date
diff --git a/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c b/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
index 762d9d0588..f24ffe0328 100644
--- a/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
@@ -1070,6 +1070,21 @@ void phy_date_test_case(test_t t)
return;
}
+void phy_seed_test_case(test_t t)
+{
+ printf("seed\n");
+ test_case_begin(t, "seed");
+
+ test_begin(t, "seed")
+ {
+ my_station.seed = 0x12345678;
+ test_fail_unless ((my_station.seed == phy_seed(ctx))
+ && (EINVAL != errno));
+ } test_end;
+
+ return;
+}
+
void phy_tx_fc10_test_case(test_t t)
{
printf("tx fc10\n");
@@ -2907,6 +2922,7 @@ void phy_ctrl_test_suite(test_t t)
maximus_phy_fill_hdr_test_case(t);
maximus_phy_recv_test_case(t);
phy_date_test_case(t);
+ phy_seed_test_case(t);
phy_tx_fc10_test_case(t);
phy_tx_param_test_case(t);
phy_tx_frame_test_case(t);