summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorYacine Belkadi2013-05-29 14:13:12 +0200
committerYacine Belkadi2013-06-06 15:49:10 +0200
commit024eaf1e8267ebae85cfadf8fa042433ee7da655 (patch)
tree4e837207918ac3cb77b91cdecd67997fd7aae1cc /cesar
parent5af00d1f1bd21bf0b463758a7b050339741fdabf (diff)
cesar/{hal/phy,mac/pbproc}: on SPOC reset, set initial rho_q30 value, closes #4004
When SPOC_RHO_INITIAL_Q30 is set in the internal.conf file, that value should be the one set on a SPOC reset, not 0. Make pbproc_spoc_reset() use the initial spoc rho q30 value. This also moves the knowledge about the initial SPOC parameters to the phy layer, which seems more appropriate.
Diffstat (limited to 'cesar')
-rw-r--r--cesar/hal/phy/maximus/src/maximus_phy_ctrl.c12
-rw-r--r--cesar/mac/pbproc/src/pbproc.c19
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/phy.c8
3 files changed, 34 insertions, 5 deletions
diff --git a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
index 7a45cf51e0..0b3283b4c0 100644
--- a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -21,6 +21,7 @@
#include "hal/phy/maximus/inc/maximus_defs.h"
#include "hal/phy/maximus/inc/maximus_aes.h"
#include "hal/phy/defs.h" /* for 'PHY_PREAMBLE_CONFIRMATION_DELAY_TCK' */
+#include "hal/phy/spoc/spoc.h"
#include "lib/swap.h" // for 'ntohl'
#include "mac/common/timings.h" // for 'MAC_PREAMBLE_TCK', 'MAC_PREAMBLE_HYBRID_TCK', 'MAC_FC_10_TCK' and 'MAC_FC_AV_TCK'
#include "mac/common/defs.h" // for 'MAC_PB520_BYTES' and 'MAC_MAX_SYMB_PER_MPDU'
@@ -3174,3 +3175,14 @@ phy_zero_cross_init (phy_t *ctx, phy_zero_cross_cb_t zero_cross_cb)
}
}
+void
+phy_compute_spoc_coeff (s32 rho_q30, phy_spoc_coeff_t *coeff)
+{
+ phy_spoc_compute_all (rho_q30, coeff);
+}
+
+void
+phy_compute_spoc_initial_coeff (phy_spoc_coeff_t *coeff)
+{
+ phy_compute_spoc_coeff (0, coeff);
+}
diff --git a/cesar/mac/pbproc/src/pbproc.c b/cesar/mac/pbproc/src/pbproc.c
index 8769b2ce0a..87d5d527cf 100644
--- a/cesar/mac/pbproc/src/pbproc.c
+++ b/cesar/mac/pbproc/src/pbproc.c
@@ -404,12 +404,21 @@ pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb,
}
static void
-pbproc_spoc_update_ (pbproc_t *ctx, bool sync, s32 rho_q30)
+pbproc_spoc_update_ (pbproc_t *ctx, bool reset, bool sync, s32 rho_q30)
{
dbg_assert (ctx);
phy_spoc_coeff_t *coeff = blk_alloc ();
coeff->part2 = blk_alloc ();
- phy_spoc_compute_all (rho_q30, coeff);
+
+ if (reset)
+ {
+ sync = false;
+ phy_compute_spoc_initial_coeff (coeff);
+ }
+ else
+ {
+ phy_compute_spoc_coeff (rho_q30, coeff);
+ }
PBPROC_TRACE (SPOC_COEFF_SET, sync, coeff->rho_q30);
/* Update pending SPOC coefficients. */
@@ -428,13 +437,15 @@ pbproc_spoc_update_ (pbproc_t *ctx, bool sync, s32 rho_q30)
void
pbproc_spoc_reset (pbproc_t *ctx)
{
- pbproc_spoc_update_ (ctx, false, 0);
+ bool dummy_sync = false;
+ s32 dummy_rho_q30 = 0;
+ pbproc_spoc_update_ (ctx, true, dummy_sync, dummy_rho_q30);
}
void
pbproc_spoc_update (pbproc_t *ctx, bool sync, s32 rho_q30)
{
- pbproc_spoc_update_ (ctx, sync, rho_q30);
+ pbproc_spoc_update_ (ctx, false, sync, rho_q30);
}
static bool
diff --git a/cesar/mac/pbproc/test/pbproc/src/phy.c b/cesar/mac/pbproc/test/pbproc/src/phy.c
index 1b687efadf..8cc3284061 100644
--- a/cesar/mac/pbproc/test/pbproc/src/phy.c
+++ b/cesar/mac/pbproc/test/pbproc/src/phy.c
@@ -379,8 +379,14 @@ phy_rx_agc_gain (phy_t *ctx)
}
void
-phy_spoc_compute_all (s32 rho_q30, phy_spoc_coeff_t *coeff)
+phy_compute_spoc_coeff (s32 rho_q30, phy_spoc_coeff_t *coeff)
{
dbg_assert (coeff);
coeff->rho_q30 = rho_q30;
}
+
+void
+phy_compute_spoc_initial_coeff (phy_spoc_coeff_t *coeff)
+{
+ phy_compute_spoc_coeff (0, coeff);
+}