summaryrefslogtreecommitdiff
path: root/hal/phy
diff options
context:
space:
mode:
authorburet2007-11-23 09:59:53 +0000
committerburet2007-11-23 09:59:53 +0000
commit3363b2a4d8a3d4fe1945e9e60800d10f94b2f071 (patch)
tree83da49cda7ec5e425c5776b6b27a21ed5b6d5d6b /hal/phy
parentce6ec0063dc14615ae1178a75ebc1ff3a428e169 (diff)
Maximus V2: modify noise data reception.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1039 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'hal/phy')
-rw-r--r--hal/phy/maximus/src/maximus_phy_ctrl.c10
-rw-r--r--hal/phy/maximus/test/src/test_phy_ctrl.c9
2 files changed, 10 insertions, 9 deletions
diff --git a/hal/phy/maximus/src/maximus_phy_ctrl.c b/hal/phy/maximus/src/maximus_phy_ctrl.c
index bb0999f3f5..29518e20ed 100644
--- a/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -911,14 +911,14 @@ maximus_phy_recv_noise (phy_t *ctx, sci_msg_t *msg)
u8 time_noise[MAC_MAX_SYMB_PER_MPDU*sizeof(u16)];
u8 * noise;
- // when message is received, time_noise is read
- memcpy(time_noise, msg->data_begin, MAC_MAX_SYMB_PER_MPDU*sizeof(u16));
- sci_msg_pop(msg, MAC_MAX_SYMB_PER_MPDU*sizeof(u16));
-
- // then, frequency_noise is read
+ // when message is received, frequency_noise is read
memcpy(frequency_noise, msg->data_begin, PHY_CARRIER_NB*sizeof(u16));
sci_msg_pop(msg, PHY_CARRIER_NB*sizeof(u16));
+ // then, time_noise is read
+ memcpy(time_noise, msg->data_begin, MAC_MAX_SYMB_PER_MPDU*sizeof(u16));
+ sci_msg_pop(msg, MAC_MAX_SYMB_PER_MPDU*sizeof(u16));
+
// for pb dma callback
memset(&ctx->pbdma.status_word, '\0', sizeof(phy_pbdma_status_t));
diff --git a/hal/phy/maximus/test/src/test_phy_ctrl.c b/hal/phy/maximus/test/src/test_phy_ctrl.c
index 136f43a870..bcf734f6a8 100644
--- a/hal/phy/maximus/test/src/test_phy_ctrl.c
+++ b/hal/phy/maximus/test/src/test_phy_ctrl.c
@@ -604,14 +604,15 @@ void maximus_phy_recv_test_case(test_t t)
}
// fill sci data
- test_fail_unless ((PHY_CARRIER_NB*sizeof(u16) == sci_msg_push(&msg, PHY_CARRIER_NB*sizeof(u16)))
- && (EINVAL != errno)
- && (ENOSPC != errno));
- memcpy(msg.data_begin, freq_noise, PHY_CARRIER_NB*sizeof(u16));
test_fail_unless ((MAC_MAX_SYMB_PER_MPDU*sizeof(u16) == sci_msg_push(&msg, MAC_MAX_SYMB_PER_MPDU*sizeof(u16)))
&& (EINVAL != errno)
&& (ENOSPC != errno));
memcpy(msg.data_begin, time_noise, MAC_MAX_SYMB_PER_MPDU*sizeof(u16));
+ test_fail_unless ((PHY_CARRIER_NB*sizeof(u16) == sci_msg_push(&msg, PHY_CARRIER_NB*sizeof(u16)))
+ && (EINVAL != errno)
+ && (ENOSPC != errno));
+ memcpy(msg.data_begin, freq_noise, PHY_CARRIER_NB*sizeof(u16));
+
}
// RX
if (PHY_TYPE_RX == phy_hdr.type)