summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschodet2009-12-22 16:14:49 +0000
committerschodet2009-12-22 16:14:49 +0000
commit8d292d3436612073c81d45f16d28adc1748049fe (patch)
tree18da4e3af78434e4fffd8c47321172bd417eda2e
parentb4b326474eb5767b53a78afe4bb2a79e59561df1 (diff)
cesar/hal/phy: phy_{tx_param,rx_prepare}* interface changes, closes #1007
This includes: - replace mod, fecrate and pb_size with a combo parameter ; - remove unused tonemap_index ; - use specialised short_ppdu functions. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6574 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--cesar/hal/phy/inc/trace.h2
-rw-r--r--cesar/hal/phy/maximus/src/maximus_phy_ctrl.c87
-rw-r--r--cesar/hal/phy/maximus/src/maximus_tmdma.c4
-rw-r--r--cesar/hal/phy/maximus/test/src/test_phy_ctrl.c79
-rw-r--r--cesar/hal/phy/maximus/test/src/test_tmdma.c4
-rw-r--r--cesar/hal/phy/phy.h59
-rw-r--r--cesar/hal/phy/src/phy.c9
-rw-r--r--cesar/hal/phy/src/rx.c56
-rw-r--r--cesar/hal/phy/src/trace.c40
-rw-r--r--cesar/hal/phy/src/tx.c56
-rw-r--r--cesar/hal/phy/test/phy/src/burst.c29
-rw-r--r--cesar/hal/phy/test/phy/src/data.c23
-rw-r--r--cesar/mac/pbproc/inc/prep_mpdu.h6
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_beacon.c5
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_data.c6
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_sound.c4
-rw-r--r--cesar/mac/pbproc/src/fsm_tx_data.c7
-rw-r--r--cesar/mac/pbproc/src/fsm_tx_sound.c3
-rw-r--r--cesar/mac/pbproc/src/prep_mpdu.c8
-rw-r--r--cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h18
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/phy.c99
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c12
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/rx_data.c29
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/rx_sound.c8
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/tx_data.c42
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/tx_sound.c6
-rw-r--r--cesar/maximus/stationtest/src/main_example.c5
-rw-r--r--cesar/maximus/stationtest/src/test_false_alarm.c5
-rw-r--r--cesar/maximus/stationtest/src/test_send.c5
-rw-r--r--cesar/maximus/stationtest/src/test_tx_rx.c18
30 files changed, 379 insertions, 355 deletions
diff --git a/cesar/hal/phy/inc/trace.h b/cesar/hal/phy/inc/trace.h
index f1420b4995..2dcc14c925 100644
--- a/cesar/hal/phy/inc/trace.h
+++ b/cesar/hal/phy/inc/trace.h
@@ -54,6 +54,7 @@ enum
PHY_TRACE_DATE_WARNING,
PHY_TRACE_TX_FC10,
PHY_TRACE_TX_PARAM,
+ PHY_TRACE_TX_PARAM_SHORT,
PHY_TRACE_TX_PARAM_SOUND,
PHY_TRACE_TX_FRAME,
PHY_TRACE_TX_PREPARE,
@@ -64,6 +65,7 @@ enum
PHY_TRACE_RX_ACTIVATE,
PHY_TRACE_RX_ACTIVATE_NOW,
PHY_TRACE_RX_PREPARE,
+ PHY_TRACE_RX_PREPARE_SHORT,
PHY_TRACE_RX_PREPARE_SOUND,
PHY_TRACE_EXTRA_TIMER_PROGRAM,
PHY_TRACE_EXTRA_TIMER_CANCEL,
diff --git a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
index b3c62e8f9f..9bde0efa47 100644
--- a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -2371,7 +2371,7 @@ phy_tx_fc10 (phy_t *ctx, u32 date, u32 fc_10)
/**
- * Set TX parameters.
+ * Set TX parameters, common function.
* \param ctx phy context
* \param fc_mode frame control mode
* \param short_ppdu true if no data symbols will be sent
@@ -2387,10 +2387,10 @@ phy_tx_fc10 (phy_t *ctx, u32 date, u32 fc_10)
*
* When modulation type is a ROBO mode, following arguments are ignored.
*/
-void
-phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
- phy_mod_t mod, phy_fecrate_t fecrate, phy_pb_size_t pb_size,
- phy_gil_t gil, uint tonemap_index)
+static void
+phy_tx_param_common (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
+ phy_mod_t mod, phy_fecrate_t fecrate,
+ phy_pb_size_t pb_size, phy_gil_t gil, uint tonemap_index)
{
/* Set the fc_mode value of PHY context.
* Set the short_ppdu value of PHY context.
@@ -2476,21 +2476,44 @@ phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
}
+void
+phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, u32 mod_fecrate_pb_size,
+ phy_gil_t gil)
+{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
+ phy_tx_param_common (ctx, fc_mode, false, mod, fecrate, pb_size, gil, 0);
+}
+
+
+void
+phy_tx_param_short (phy_t *ctx, phy_fc_mode_t fc_mode)
+{
+ phy_tx_param_common (ctx, fc_mode, true, PHY_MOD_NONE, PHY_FEC_RATE_NONE,
+ PHY_PB_SIZE_NONE, PHY_GIL_NONE, 0);
+}
+
+
/**
* Set TX parameters for SOUND transmission.
* \param ctx phy context
* \param fc_mode frame control mode
* \param nb_pb number of SOUND PB
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
*/
void
phy_tx_param_sound (phy_t *ctx, phy_fc_mode_t fc_mode, uint nb_pb,
- phy_mod_t mod, phy_fecrate_t fecrate,
- phy_pb_size_t pb_size, phy_gil_t gil)
+ u32 mod_fecrate_pb_size, phy_gil_t gil)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
/* Set the fc_mode value of PHY context.
* Set the nb_pb value of PHY context.
* Set the mod value of PHY context.
@@ -2753,7 +2776,7 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool pre_detection)
/**
- * Set parameter for frame payload reception.
+ * Set parameter for frame payload reception, common function.
* \param ctx phy context
* \param short_ppdu true if no data symbols will be received
* \param mod modulation type
@@ -2769,9 +2792,9 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool pre_detection)
* data.
*/
void
-phy_rx_prepare (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size, phy_gil_t gil,
- uint tonemap_index, uint symbol_nb)
+phy_rx_prepare_common (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
+ phy_fecrate_t fecrate, phy_pb_size_t pb_size,
+ phy_gil_t gil, uint tonemap_index, uint symbol_nb)
{
/* PBP prepares HW for reception.
* This function is called when a FC is received, in the 'rx_fc_cb'. */
@@ -2882,22 +2905,44 @@ phy_rx_prepare (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
}
+void
+phy_rx_prepare (phy_t *ctx, u32 mod_fecrate_pb_size, phy_gil_t gil,
+ uint symbol_nb)
+{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
+ phy_rx_prepare_common (ctx, false, mod, fecrate, pb_size, gil, 0,
+ symbol_nb);
+}
+
+
+void
+phy_rx_prepare_short (phy_t *ctx)
+{
+ phy_rx_prepare_common (ctx, true, PHY_MOD_NONE, PHY_FEC_RATE_NONE,
+ PHY_PB_SIZE_NONE, PHY_GIL_NONE, 0, 0);
+}
+
+
/**
* Set parameter for SOUND payload reception.
* \param ctx phy context
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
* \param symbol_nb number of expected symbols
- * \param end_date date at which the reception is done and chandata can be
- * retrieved
*/
void
-phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size,
+phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
phy_gil_t gil, uint symbol_nb)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
u32 end_date = phy_date (ctx) + 1; // TODO: remove this.
/* PBP prepares HW for reception.
* This function is called when a FC is received, in the 'rx_fc_cb'. */
diff --git a/cesar/hal/phy/maximus/src/maximus_tmdma.c b/cesar/hal/phy/maximus/src/maximus_tmdma.c
index a81cb87a0c..39439d8966 100644
--- a/cesar/hal/phy/maximus/src/maximus_tmdma.c
+++ b/cesar/hal/phy/maximus/src/maximus_tmdma.c
@@ -67,7 +67,6 @@ phy_set_tonemask (phy_t *ctx, u32 *tonemask, uint carrier_nb)
/**
* Transfer tone map to hardware using the TM DMA.
* \param ctx phy context
- * \param tonemap_index tonemap index where to store tonemap
* \param tonemap tonemap blocks first descriptor
* set errno to:
* - EINVAL if ctx or tonemap are null, or if arguments are out-of-range or incorrect
@@ -75,8 +74,9 @@ phy_set_tonemask (phy_t *ctx, u32 *tonemask, uint carrier_nb)
* The tonemap uses two blocks.
*/
void
-phy_set_tonemap (phy_t *ctx, uint tonemap_index, blk_t *tonemap)
+phy_set_tonemap (phy_t *ctx, blk_t *tonemap)
{
+ uint tonemap_index = 0;
/* Set the tonemap_index value of PHY context.
* Copy tonemap contents into PHY context. */
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 3a48b3e920..4e56782359 100644
--- a/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
@@ -1414,7 +1414,7 @@ void phy_tx_param_test_case(test_t t)
phy_fecrate_t fecrate = PHY_FEC_RATE_16_21;
phy_pb_size_t pb_size = PHY_PB_SIZE_136;
phy_gil_t gil = PHY_GIL_417;
- uint tonemap_index = 3;
+ uint tonemap_index = 0;
printf("tx param\n");
test_case_begin(t, "tx param");
@@ -1423,9 +1423,8 @@ void phy_tx_param_test_case(test_t t)
{
mod = PHY_MOD_TM;
- phy_tx_param (ctx, fc_mode, short_ppdu,
- mod, fecrate, pb_size,
- gil, tonemap_index);
+ phy_tx_param (ctx, fc_mode, PHY_COMBO_PARAMS (mod, fecrate, pb_size),
+ gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& (short_ppdu == ctx->control.next_tx_param.short_ppdu)
@@ -1441,9 +1440,8 @@ void phy_tx_param_test_case(test_t t)
{
mod = PHY_MOD_HS_ROBO;
- phy_tx_param (ctx, fc_mode, short_ppdu,
- mod, fecrate, pb_size,
- gil, tonemap_index);
+ phy_tx_param (ctx, fc_mode, PHY_COMBO_PARAMS (mod, fecrate, pb_size),
+ gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& (short_ppdu == ctx->control.next_tx_param.short_ppdu)
@@ -1459,9 +1457,8 @@ void phy_tx_param_test_case(test_t t)
{
mod = PHY_MOD_MINI_ROBO;
- phy_tx_param (ctx, fc_mode, short_ppdu,
- mod, fecrate, pb_size,
- gil, tonemap_index);
+ phy_tx_param (ctx, fc_mode, PHY_COMBO_PARAMS (mod, fecrate, pb_size),
+ gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& (short_ppdu == ctx->control.next_tx_param.short_ppdu)
@@ -1493,8 +1490,7 @@ void phy_tx_param_sound_test_case(test_t t)
mod = PHY_MOD_MINI_ROBO;
phy_tx_param_sound (ctx, fc_mode, nb_pb,
- mod, fecrate,
- pb_size, gil);
+ PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& !ctx->control.next_tx_param.short_ppdu
@@ -1513,8 +1509,7 @@ void phy_tx_param_sound_test_case(test_t t)
gil = PHY_GIL_417;
phy_tx_param_sound (ctx, fc_mode, nb_pb,
- mod, fecrate,
- pb_size, gil);
+ PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& !ctx->control.next_tx_param.short_ppdu
@@ -1531,8 +1526,7 @@ void phy_tx_param_sound_test_case(test_t t)
mod = PHY_MOD_ROBO;
phy_tx_param_sound (ctx, fc_mode, nb_pb,
- mod, fecrate,
- pb_size, gil);
+ PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil);
test_fail_unless((EINVAL != errno)
&& (fc_mode == ctx->control.next_tx_param.fc_mode)
&& !ctx->control.next_tx_param.short_ppdu
@@ -1567,7 +1561,7 @@ void phy_tx_frame_test_case(test_t t)
blk_t tonemap2;
u8 tonemap1_data[MAC_PB520_BYTES];
u8 tonemap2_data[(PHY_CARRIER_NB+1)/2-MAC_PB520_BYTES];
- uint tonemap_index = 3;
+ uint tonemap_index = 0;
printf("tx frame\n");
test_case_begin(t, "tx frame");
@@ -1620,7 +1614,7 @@ void phy_tx_frame_test_case(test_t t)
tonemap1.next = &tonemap2;
tonemap1.data = tonemap1_data;
ctx->control.next_tx_param.mod = PHY_MOD_TM;
- phy_set_tonemap (ctx, tonemap_index, &tonemap1);
+ phy_set_tonemap (ctx, &tonemap1);
// set fc av
memset(&fc_av, '\0', 4*sizeof(u32));
@@ -2731,7 +2725,6 @@ void maximus_phy_send_test_case(test_t t)
blk_t tonemap2;
u8 tonemap1_data[MAC_PB520_BYTES];
u8 tonemap2_data[(PHY_CARRIER_NB+1)/2-MAC_PB520_BYTES];
- uint tonemap_index = 3;
printf("maximus phy send\n");
test_case_begin(t, "maximus phy send");
@@ -2743,7 +2736,7 @@ void maximus_phy_send_test_case(test_t t)
tonemap2.data = tonemap2_data;
tonemap1.next = &tonemap2;
tonemap1.data = tonemap1_data;
- phy_set_tonemap (ctx, tonemap_index, &tonemap1);
+ phy_set_tonemap (ctx, &tonemap1);
ctx->control.current_tx_param.mod = PHY_MOD_ROBO;
// set medium state
@@ -3176,7 +3169,7 @@ void phy_rx_prepare_test_case(test_t t)
phy_fecrate_t fecrate = PHY_FEC_RATE_1_2;
phy_pb_size_t pb_size = PHY_PB_SIZE_136;
phy_gil_t gil = PHY_GIL_417;
- uint tonemap_index = 3;
+ uint tonemap_index = 0;
uint symbol_nb = 0;
printf("rx prepare\n");
@@ -3186,13 +3179,7 @@ void phy_rx_prepare_test_case(test_t t)
{
mod = PHY_MOD_TM;
- phy_rx_prepare (ctx,
- short_ppdu,
- mod,
- fecrate,
- pb_size,
- gil,
- tonemap_index,
+ phy_rx_prepare (ctx, PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil,
symbol_nb);
test_fail_unless ((EINVAL != errno)
&& (short_ppdu == ctx->control.rx_param.short_ppdu)
@@ -3245,13 +3232,7 @@ void phy_rx_prepare_test_case(test_t t)
{
mod = PHY_MOD_ROBO;
- phy_rx_prepare (ctx,
- short_ppdu,
- mod,
- fecrate,
- pb_size,
- gil,
- tonemap_index,
+ phy_rx_prepare (ctx, PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil,
symbol_nb);
test_fail_unless ((EINVAL != errno)
&& (short_ppdu == ctx->control.rx_param.short_ppdu)
@@ -3304,13 +3285,7 @@ void phy_rx_prepare_test_case(test_t t)
{
mod = PHY_MOD_MINI_ROBO;
- phy_rx_prepare (ctx,
- short_ppdu,
- mod,
- fecrate,
- pb_size,
- gil,
- tonemap_index,
+ phy_rx_prepare (ctx, PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil,
symbol_nb);
test_fail_unless ((EINVAL != errno)
&& (short_ppdu == ctx->control.rx_param.short_ppdu)
@@ -3377,13 +3352,9 @@ void phy_rx_prepare_sound_test_case(test_t t)
{
mod = PHY_MOD_ROBO;
- phy_rx_prepare_sound (ctx,
- 0,
- mod,
- fecrate,
- pb_size,
- gil,
- symbol_nb);
+ phy_rx_prepare_sound (ctx, 0,
+ PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil,
+ symbol_nb);
test_fail_unless ((EINVAL != errno)
&& !ctx->control.rx_param.short_ppdu
&& (mod == ctx->control.rx_param.mod)
@@ -3437,13 +3408,9 @@ void phy_rx_prepare_sound_test_case(test_t t)
pb_size = PHY_PB_SIZE_136;
gil = PHY_GIL_567;
- phy_rx_prepare_sound (ctx,
- 0,
- mod,
- fecrate,
- pb_size,
- gil,
- symbol_nb);
+ phy_rx_prepare_sound (ctx, 0,
+ PHY_COMBO_PARAMS (mod, fecrate, pb_size), gil,
+ symbol_nb);
test_fail_unless ((EINVAL != errno)
&& !ctx->control.rx_param.short_ppdu
&& (mod == ctx->control.rx_param.mod)
diff --git a/cesar/hal/phy/maximus/test/src/test_tmdma.c b/cesar/hal/phy/maximus/test/src/test_tmdma.c
index 297653ef26..58e33257da 100644
--- a/cesar/hal/phy/maximus/test/src/test_tmdma.c
+++ b/cesar/hal/phy/maximus/test/src/test_tmdma.c
@@ -94,7 +94,7 @@ void phy_set_tonemap_test_case(test_t t)
blk_t tonemap2;
u8 tonemap1_data[MAC_PB520_BYTES];
u8 tonemap2_data[(PHY_CARRIER_NB+1)/2-MAC_PB520_BYTES]; // 4 bits per carrier
- uint tonemap_index = 3;
+ uint tonemap_index = 0;
memset(tonemap1_data, 'b', MAC_PB520_BYTES*sizeof(u8));
memset(tonemap2_data, 'c', ((PHY_CARRIER_NB+1)/2-MAC_PB520_BYTES)*sizeof(u8));
@@ -103,7 +103,7 @@ void phy_set_tonemap_test_case(test_t t)
tonemap1.next = &tonemap2;
tonemap1.data = tonemap1_data;
- phy_set_tonemap (ctx, tonemap_index, &tonemap1);
+ phy_set_tonemap (ctx, &tonemap1);
test_fail_unless ((EINVAL != errno)
&& (0 == memcmp(tonemap1.data, ctx->tmdma.tonemap[tonemap_index]->data, MAC_PB520_BYTES))
&& (0 == memcmp(tonemap2.data, ctx->tmdma.tonemap[tonemap_index]->next->data, (PHY_CARRIER_NB+1)/2-MAC_PB520_BYTES)));
diff --git a/cesar/hal/phy/phy.h b/cesar/hal/phy/phy.h
index 04f18e3cd9..e04a398c3d 100644
--- a/cesar/hal/phy/phy.h
+++ b/cesar/hal/phy/phy.h
@@ -159,13 +159,12 @@ phy_clock_get_zero_cross_captured_sysdate (phy_t *ctx);
/**
* Transfer tone map to hardware using the TM DMA.
* \param ctx phy context
- * \param tonemap_index tonemap index where to store tonemap
* \param tonemap tonemap blocks first descriptor
*
* The tonemap uses two blocks.
*/
void
-phy_set_tonemap (phy_t *ctx, uint tonemap_index, blk_t *tonemap);
+phy_set_tonemap (phy_t *ctx, blk_t *tonemap);
/**
* Start Homeplug 1.0 frame control encoding.
@@ -180,46 +179,32 @@ phy_tx_fc10 (phy_t *ctx, u32 date, u32 fc_10);
* Set TX parameters.
* \param ctx phy context
* \param fc_mode frame control mode
- * \param short_ppdu true if no data symbols will be sent
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
- * \param tonemap_index tone map index
- *
- * For short PPDU, following arguments are ignored.
*/
void
-phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
- phy_mod_t mod, phy_fecrate_t fecrate, phy_pb_size_t pb_size,
- phy_gil_t gil, uint tonemap_index);
+phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, u32 mod_fecrate_pb_size,
+ phy_gil_t gil);
/**
* Set TX parameters, shortcut for short_ppdu.
* \param ctx phy context
* \param fc_mode frame control mode
*/
-extern inline void
-phy_tx_param_short (phy_t *ctx, phy_fc_mode_t fc_mode)
-{
- phy_tx_param (ctx, fc_mode, true, PHY_MOD_NONE, PHY_FEC_RATE_NONE,
- PHY_PB_SIZE_NONE, PHY_GIL_NB, 0);
-}
+void
+phy_tx_param_short (phy_t *ctx, phy_fc_mode_t fc_mode);
/**
* Set TX parameters for SOUND transmission.
* \param ctx phy context
* \param fc_mode frame control mode
* \param nb_pb number of SOUND PB
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
*/
void
phy_tx_param_sound (phy_t *ctx, phy_fc_mode_t fc_mode, uint nb_pb,
- phy_mod_t mod, phy_fecrate_t fecrate,
- phy_pb_size_t pb_size, phy_gil_t gil);
+ u32 mod_fecrate_pb_size, phy_gil_t gil);
/**
* Schedule a TX start.
@@ -272,48 +257,36 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool flag);
/**
* Set parameter for frame payload reception.
* \param ctx phy context
- * \param short_ppdu true if no data symbols will be received
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
- * \param tonemap_index tone map index
* \param symbol_nb number of expected symbols
*
* This call signals hardware that it can continue to process the incoming
* data.
*/
void
-phy_rx_prepare (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size, phy_gil_t gil,
- uint tonemap_index, uint symbol_nb);
+phy_rx_prepare (phy_t *ctx, u32 mod_fecrate_pb_size, phy_gil_t gil,
+ uint symbol_nb);
/**
- * Set parameter for frame payload reception, shortcut for short PPDU.
+ * Set parameter for short frame reception.
* \param ctx phy context
*
* This call signals hardware that it can continue to process the incoming
* data. In the short PPDU case, it actually stops any further processing.
*/
-extern inline void
-phy_rx_prepare_short (phy_t *ctx)
-{
- phy_rx_prepare (ctx, true, PHY_MOD_NONE, PHY_FEC_RATE_NONE,
- PHY_PB_SIZE_NONE, PHY_GIL_NB, 0, 0);
-}
+void
+phy_rx_prepare_short (phy_t *ctx);
/**
* Set parameter for SOUND payload reception.
* \param ctx phy context
- * \param mod modulation type
- * \param fecrate TCC rate
- * \param pb_size PB size
+ * \param mod_fecrate_pb_size combined modulation type, TCC rate, PB size
* \param gil guard interval for third symbol and following symbols
* \param symbol_nb number of expected symbols
*/
void
-phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size,
+phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
phy_gil_t gil, uint symbol_nb);
/**
diff --git a/cesar/hal/phy/src/phy.c b/cesar/hal/phy/src/phy.c
index 33b6d2ef53..102d481061 100644
--- a/cesar/hal/phy/src/phy.c
+++ b/cesar/hal/phy/src/phy.c
@@ -688,10 +688,9 @@ phy_seed (void)
}
void ARCH_ILRAM
-phy_set_tonemap (phy_t *ctx, uint tonemap_index, blk_t *tonemap)
+phy_set_tonemap (phy_t *ctx, blk_t *tonemap)
{
dbg_claim (ctx);
- dbg_claim (tonemap_index < 2);
dbg_claim_ptr (tonemap);
dbg_claim (ARCH_DMA_VALID (tonemap));
dbg_claim_ptr (tonemap->data);
@@ -700,17 +699,17 @@ phy_set_tonemap (phy_t *ctx, uint tonemap_index, blk_t *tonemap)
dbg_claim (ARCH_DMA_VALID (tonemap->next));
dbg_claim_ptr (tonemap->next->data);
dbg_claim (ARCH_DMA_VALID (tonemap->next->data));
- PHY_TRACE (SET_TONEMAP, tonemap_index, tonemap);
+ PHY_TRACE (SET_TONEMAP, tonemap);
/* Send new tonemap. */
dbg_claim (PHY_TONEMAP_WORDS > BLK_SIZE / 4
&& PHY_TONEMAP_WORDS < 2 * BLK_SIZE / 4);
phy_tmdma_desc_t *desc = (phy_tmdma_desc_t *) tonemap;
desc->size_words = BLK_SIZE / 4;
- desc->mem_index = PHY_TMDMA_MEM_TONEMAP_0 + tonemap_index;
+ desc->mem_index = PHY_TMDMA_MEM_TONEMAP_0;
desc->last = 0;
desc->local_start_addr = 0;
desc->next->size_words = PHY_TONEMAP_WORDS - BLK_SIZE / 4;
- desc->next->mem_index = PHY_TMDMA_MEM_TONEMAP_0 + tonemap_index;
+ desc->next->mem_index = PHY_TMDMA_MEM_TONEMAP_0;
desc->next->last = 1;
desc->next->local_start_addr = BLK_SIZE / 4;
arch_write_buffer_flush ();
diff --git a/cesar/hal/phy/src/rx.c b/cesar/hal/phy/src/rx.c
index ee5d9c705d..d02563fe2d 100644
--- a/cesar/hal/phy/src/rx.c
+++ b/cesar/hal/phy/src/rx.c
@@ -72,20 +72,24 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool flag)
extern inline void
phy_rx_prepare_common (phy_t *ctx, bool short_ppdu, bool sound,
- phy_mod_t mod, phy_fecrate_t fecrate,
- phy_pb_size_t pb_size, phy_gil_t gil,
- uint tonemap_index, uint symbol_nb)
+ u32 mod_fecrate_pb_size, phy_gil_t gil, uint symbol_nb)
{
dbg_claim (ctx);
dbg_claim (ctx->rx_fc_mode < PHY_FC_MODE_NB);
dbg_claim (!sound || (sound && !short_ppdu));
dbg_claim ((short_ppdu && symbol_nb == 0)
|| (!short_ppdu
- && mod < PHY_MOD_NONE
- && fecrate < PHY_FEC_RATE_NONE
- && pb_size < PHY_PB_SIZE_NONE
+ && (BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size)
+ < PHY_MOD_NONE)
+ && (BF_GET (PHY_COMBO_PARAMS__FECRATE, mod_fecrate_pb_size)
+ < PHY_FEC_RATE_NONE)
+ && (BF_GET (PHY_COMBO_PARAMS__PB_SIZE, mod_fecrate_pb_size)
+ < PHY_PB_SIZE_NONE)
+ && (mod_fecrate_pb_size
+ & ~(BF_MASK (PHY_COMBO_PARAMS__MOD)
+ | BF_MASK (PHY_COMBO_PARAMS__FECRATE)
+ | BF_MASK (PHY_COMBO_PARAMS__PB_SIZE))) == 0
&& gil < PHY_GIL_NB
- && BF_CHECK (PHY_DSPSS_RX_PARAM__TMBI, tonemap_index)
&& BF_CHECK (PHY_DSPSS_RESYS_PARAM__LAST_SYMB_INDEX,
symbol_nb)));
/* Set RX parameters. */
@@ -100,14 +104,12 @@ phy_rx_prepare_common (phy_t *ctx, bool short_ppdu, bool sound,
{
PHY_DSPSS_RX_PARAM =
BF_FILL (PHY_DSPSS_RX_PARAM,
- (PB_SIZE, pb_size),
- (PB_RATE, fecrate),
- (PB_MOD, mod),
(FC_MODE, ctx->rx_fc_mode),
(LONG_PPDU, 1),
- (TMBI, tonemap_index),
+ (TMBI, 0),
(SOUND_FRAME, sound ? 1 : 0),
(SOUND_ENABLE, sound ? 1 : 0))
+ | mod_fecrate_pb_size
| PHY_DSPSS_RX_PARAM__DEFAULT;
}
/* Freeze RESYS to write offset table. */
@@ -127,34 +129,42 @@ phy_rx_prepare_common (phy_t *ctx, bool short_ppdu, bool sound,
}
void ARCH_ILRAM
-phy_rx_prepare (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size, phy_gil_t gil,
- uint tonemap_index, uint symbol_nb)
+phy_rx_prepare (phy_t *ctx, u32 mod_fecrate_pb_size, phy_gil_t gil,
+ uint symbol_nb)
{
dbg_claim (ctx);
/* Prepare. */
- phy_rx_prepare_common (ctx, short_ppdu, false, mod, fecrate, pb_size, gil,
- tonemap_index, symbol_nb);
+ phy_rx_prepare_common (ctx, false, false, mod_fecrate_pb_size, gil,
+ symbol_nb);
+ /* Trace when done. */
+ PHY_TRACE (RX_PREPARE, phy_date (ctx), mod_fecrate_pb_size, gil,
+ symbol_nb);
+}
+
+void ARCH_ILRAM
+phy_rx_prepare_short (phy_t *ctx)
+{
+ dbg_claim (ctx);
+ /* Prepare. */
+ phy_rx_prepare_common (ctx, true, false, 0, PHY_GIL_417, 0);
/* Trace when done. */
- PHY_TRACE (RX_PREPARE, phy_date (ctx), short_ppdu, mod, fecrate, pb_size,
- gil, tonemap_index, symbol_nb);
+ PHY_TRACE (RX_PREPARE_SHORT, phy_date (ctx));
}
void ARCH_ILRAM
-phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size,
+phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
phy_gil_t gil, uint symbol_nb)
{
dbg_claim (ctx);
/* Prepare. */
- phy_tx_param_sound (ctx, ctx->rx_fc_mode, nb_pb, mod, fecrate, pb_size,
+ phy_tx_param_sound (ctx, ctx->rx_fc_mode, nb_pb, mod_fecrate_pb_size,
gil);
- phy_rx_prepare_common (ctx, false, true, mod, fecrate, pb_size, gil, 0,
+ phy_rx_prepare_common (ctx, false, true, mod_fecrate_pb_size, gil,
symbol_nb);
/* Need to start PBDMA. */
ctx->pbdma_start_on_resys_it = true;
/* Trace when done. */
- PHY_TRACE (RX_PREPARE_SOUND, phy_date (ctx), nb_pb, mod, fecrate, pb_size,
+ PHY_TRACE (RX_PREPARE_SOUND, phy_date (ctx), nb_pb, mod_fecrate_pb_size,
gil, symbol_nb);
}
diff --git a/cesar/hal/phy/src/trace.c b/cesar/hal/phy/src/trace.c
index 424f07832c..6f8377aa27 100644
--- a/cesar/hal/phy/src/trace.c
+++ b/cesar/hal/phy/src/trace.c
@@ -50,6 +50,26 @@ phy_trace_format_csma (char *text, uint text_size, int data)
return t - text;
}
+/**
+ * Format combo parameters.
+ * \see trace_format_t.
+ */
+static int
+phy_trace_format_combo_params (char *text, uint text_size, int data)
+{
+ int r;
+ u32 reg = data;
+ /* CAP. */
+ r = snprintf (text, text_size, "mod=%d fecrate=%d pb_size=%d",
+ BF_GET (PHY_COMBO_PARAMS__MOD, reg),
+ BF_GET (PHY_COMBO_PARAMS__FECRATE, reg),
+ BF_GET (PHY_COMBO_PARAMS__PB_SIZE, reg)
+ );
+ if (r >= (int) text_size)
+ return -1;
+ return r;
+}
+
void
phy_trace_init (phy_t *ctx)
{
@@ -63,15 +83,13 @@ phy_trace_init (phy_t *ctx)
PHY_TRACE_EVENT (ISR_EXIT, "isr exit", TIMESTAMP),
PHY_TRACE_EVENT (CLOCK_SET_NUMERATOR,
"clock set numerator %u"),
- PHY_TRACE_EVENT (SET_TONEMAP, "set tonemap %u, %x"),
+ PHY_TRACE_EVENT (SET_TONEMAP, "set tonemap %x"),
PHY_TRACE_EVENT (DATE_WARNING, "date warning %d", TIMESTAMP),
PHY_TRACE_EVENT (TX_FC10, "tx fc10 %x"),
- PHY_TRACE_EVENT (TX_PARAM,
- "tx param mode=%u short=%b mod=%u "
- "fecrate=%u pb_size=%u gil=%u tm=%u"),
+ PHY_TRACE_EVENT (TX_PARAM, "tx param mode=%u %P gil=%u"),
+ PHY_TRACE_EVENT (TX_PARAM_SHORT, "tx param short mode=%u"),
PHY_TRACE_EVENT (TX_PARAM_SOUND,
- "tx sound mode=%u nb_pb=%u mod=%u "
- "fecrate=%u pb_size=%u gil=%u"),
+ "tx sound mode=%u nb_pb=%u %P gil=%u"),
PHY_TRACE_EVENT (TX_FRAME,
"tx frame date=%x want_conf=%b "
"stop_on_prp_lost=%b fc=%x", TIMESTAMP),
@@ -86,11 +104,11 @@ phy_trace_init (phy_t *ctx)
PHY_TRACE_EVENT (RX_ACTIVATE_NOW,
"rx activate now flag=%b", TIMESTAMP),
PHY_TRACE_EVENT (RX_PREPARE,
- "rx prepare short=%b mod=%u fecrate=%u "
- "pb_size=%u gil=%u tm=%u symb_nb=%u", TIMESTAMP),
+ "rx prepare %P gil=%u symb_nb=%u", TIMESTAMP),
+ PHY_TRACE_EVENT (RX_PREPARE_SHORT,
+ "rx prepare short", TIMESTAMP),
PHY_TRACE_EVENT (RX_PREPARE_SOUND,
- "rx sound nb_pb=%u mod=%u fecrate=%u pb_size=%u "
- "gil=%u symb_nb=%u", TIMESTAMP),
+ "rx sound nb_pb=%u %P gil=%u symb_nb=%u", TIMESTAMP),
PHY_TRACE_EVENT (EXTRA_TIMER_PROGRAM,
"extra timer program %x"),
PHY_TRACE_EVENT (EXTRA_TIMER_CANCEL, "extra timer cancel"),
@@ -128,6 +146,8 @@ phy_trace_init (phy_t *ctx)
dbg_assert (ctx);
trace_namespace_init (&namespace, event_ids, COUNT (event_ids));
trace_namespace_register_format (&namespace, 'C', phy_trace_format_csma);
+ trace_namespace_register_format (&namespace, 'P',
+ phy_trace_format_combo_params);
trace_buffer_add (&ctx->trace, "phy", 8, 16, true, &namespace);
}
diff --git a/cesar/hal/phy/src/tx.c b/cesar/hal/phy/src/tx.c
index a6802c6c26..86f18ba92b 100644
--- a/cesar/hal/phy/src/tx.c
+++ b/cesar/hal/phy/src/tx.c
@@ -83,9 +83,8 @@ phy_tx_param_set_gil (phy_t *ctx, phy_fc_mode_t fc_mode, phy_gil_t gil)
extern inline void
phy_tx_param_common (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
- bool sound, uint sound_nb_pb, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size,
- phy_gil_t gil, uint tonemap_index)
+ bool sound, uint sound_nb_pb, u32 mod_fecrate_pb_size,
+ phy_gil_t gil)
{
dbg_claim (ctx);
dbg_claim ((!sound && sound_nb_pb == 1)
@@ -93,11 +92,17 @@ phy_tx_param_common (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
&& sound_nb_pb <= 4));
dbg_claim (fc_mode < PHY_FC_MODE_NB
&& ((short_ppdu == false
- && mod < PHY_MOD_NONE
- && fecrate < PHY_FEC_RATE_NONE
- && pb_size < PHY_PB_SIZE_NONE
- && gil < PHY_GIL_NB
- && BF_CHECK (PHY_DSPSS_TX_PARAM__TMBI, tonemap_index))
+ && (BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size)
+ < PHY_MOD_NONE)
+ && (BF_GET (PHY_COMBO_PARAMS__FECRATE, mod_fecrate_pb_size)
+ < PHY_FEC_RATE_NONE)
+ && (BF_GET (PHY_COMBO_PARAMS__PB_SIZE, mod_fecrate_pb_size)
+ < PHY_PB_SIZE_NONE)
+ && (mod_fecrate_pb_size
+ & ~(BF_MASK (PHY_COMBO_PARAMS__MOD)
+ | BF_MASK (PHY_COMBO_PARAMS__FECRATE)
+ | BF_MASK (PHY_COMBO_PARAMS__PB_SIZE))) == 0
+ && gil < PHY_GIL_NB)
|| short_ppdu == true));
/* TX parameters. */
if (short_ppdu)
@@ -113,14 +118,12 @@ phy_tx_param_common (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
{
PHY_DSPSS_TX_PARAM =
BF_FILL (PHY_DSPSS_TX_PARAM,
- (PB_SIZE, pb_size),
- (PB_RATE, fecrate),
- (PB_MOD, mod),
(FC_MODE, fc_mode),
(LONG_PPDU, 1),
- (TMBI, tonemap_index),
+ (TMBI, 0),
(SOUND_FRAME, sound),
(NB_PB_SOUND, sound_nb_pb - 1))
+ | mod_fecrate_pb_size
| PHY_DSPSS_TX_PARAM__DEFAULT;
}
ctx->tx_fc_mode = fc_mode;
@@ -129,26 +132,31 @@ phy_tx_param_common (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
}
void ARCH_ILRAM
-phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
- phy_mod_t mod, phy_fecrate_t fecrate, phy_pb_size_t pb_size,
- phy_gil_t gil, uint tonemap_index)
+phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, u32 mod_fecrate_pb_size,
+ phy_gil_t gil)
{
dbg_claim (ctx);
- PHY_TRACE (TX_PARAM, fc_mode, short_ppdu, mod, fecrate, pb_size, gil,
- tonemap_index);
- phy_tx_param_common (ctx, fc_mode, short_ppdu, false, 1, mod, fecrate,
- pb_size, gil, tonemap_index);
+ PHY_TRACE (TX_PARAM, fc_mode, mod_fecrate_pb_size, gil);
+ phy_tx_param_common (ctx, fc_mode, false, false, 1, mod_fecrate_pb_size,
+ gil);
+}
+
+void ARCH_ILRAM
+phy_tx_param_short (phy_t *ctx, phy_fc_mode_t fc_mode)
+{
+ dbg_claim (ctx);
+ PHY_TRACE (TX_PARAM_SHORT, fc_mode);
+ phy_tx_param_common (ctx, fc_mode, true, false, 1, 0, PHY_GIL_417);
}
void ARCH_ILRAM
phy_tx_param_sound (phy_t *ctx, phy_fc_mode_t fc_mode, uint nb_pb,
- phy_mod_t mod, phy_fecrate_t fecrate,
- phy_pb_size_t pb_size, phy_gil_t gil)
+ u32 mod_fecrate_pb_size, phy_gil_t gil)
{
dbg_claim (ctx);
- PHY_TRACE (TX_PARAM_SOUND, fc_mode, nb_pb, mod, fecrate, pb_size, gil);
- phy_tx_param_common (ctx, fc_mode, false, true, nb_pb, mod, fecrate,
- pb_size, gil, 0);
+ PHY_TRACE (TX_PARAM_SOUND, fc_mode, nb_pb, mod_fecrate_pb_size, gil);
+ phy_tx_param_common (ctx, fc_mode, false, true, nb_pb,
+ mod_fecrate_pb_size, gil);
}
void ARCH_ILRAM
diff --git a/cesar/hal/phy/test/phy/src/burst.c b/cesar/hal/phy/test/phy/src/burst.c
index 493beb3aa2..ed6fbf5e21 100644
--- a/cesar/hal/phy/test/phy/src/burst.c
+++ b/cesar/hal/phy/test/phy/src/burst.c
@@ -118,19 +118,23 @@ test_phy_burst_tx_handle (test_phy_t *ctx)
if (!d->sound && !d->short_ppdu)
{
if (d->mod == PHY_MOD_TM)
- phy_set_tonemap (ctx->phy, 0, d->tonemap->tmdma_desc_head);
+ phy_set_tonemap (ctx->phy, d->tonemap->tmdma_desc_head);
phy_pbdma_start (ctx->phy, d->bypass_aes, d->nek, d->pb_nb_total,
d->pb_nb_ready,
(!b->csma && b->trace_isr) ? d->pb_nb_total : 0,
b->tx_pbs, NULL, false);
}
/* Program TX. */
- if (!d->sound || d->short_ppdu)
- phy_tx_param (ctx->phy, d->fc_mode, d->short_ppdu, d->mod, d->fecrate,
- d->pb_size, d->gil, 0);
+ if (d->short_ppdu)
+ phy_tx_param_short (ctx->phy, d->fc_mode);
+ else if (!d->sound)
+ phy_tx_param (ctx->phy, d->fc_mode,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
+ d->gil);
else
- phy_tx_param_sound (ctx->phy, d->fc_mode, d->pb_nb_total, d->mod,
- d->fecrate, d->pb_size, d->gil);
+ phy_tx_param_sound (ctx->phy, d->fc_mode, d->pb_nb_total,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
+ d->gil);
u32 fc[4];
fc[0] = 0x1;
fc[1] = b->tx_date;
@@ -369,9 +373,10 @@ test_phy_burst_rx_handle (test_phy_t *ctx, u32 rx_date, const u32 *fc_av)
else if (!d->sound)
{
if (d->mod == PHY_MOD_TM)
- phy_set_tonemap (ctx->phy, 0, d->tonemap->tmdma_desc_head);
- phy_rx_prepare (ctx->phy, false, d->mod, d->fecrate, d->pb_size,
- d->gil, 0, d->symb_nb);
+ phy_set_tonemap (ctx->phy, d->tonemap->tmdma_desc_head);
+ phy_rx_prepare (ctx->phy,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
+ d->gil, d->symb_nb);
phy_pbdma_start (ctx->phy, d->bypass_aes, d->nek, d->pb_nb_total,
d->pb_nb_total,
b->chandata_nb && !b->reply ? 0 : d->pb_nb_total,
@@ -380,8 +385,10 @@ test_phy_burst_rx_handle (test_phy_t *ctx, u32 rx_date, const u32 *fc_av)
}
else
{
- phy_rx_prepare_sound (ctx->phy, d->pb_nb_total, d->mod, d->fecrate,
- d->pb_size, d->gil, d->symb_nb);
+ phy_rx_prepare_sound (ctx->phy, d->pb_nb_total,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate,
+ d->pb_size),
+ d->gil, d->symb_nb);
if (b->chandata_nb)
phy_pbdma_start_chandata (ctx->phy, b->chandata_blocks);
return !b->chandata_nb;
diff --git a/cesar/hal/phy/test/phy/src/data.c b/cesar/hal/phy/test/phy/src/data.c
index c4ac4aa839..bd835098ef 100644
--- a/cesar/hal/phy/test/phy/src/data.c
+++ b/cesar/hal/phy/test/phy/src/data.c
@@ -163,11 +163,16 @@ test_phy_data_data_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
dbg_assert (ctx->static_msg.id == TEST_PHY_MSG_ID_DATA);
test_phy_data_parameters_t *d = &ctx->static_msg.msg.data.data_parameters;
if (d->mod == PHY_MOD_TM)
- phy_set_tonemap (ctx->phy, 0, d->tonemap->tmdma_desc_head);
- phy_rx_prepare (ctx->phy, d->short_ppdu, d->mod, d->fecrate,
- d->pb_size, d->gil, 0, d->symb_nb);
- if (!d->short_ppdu)
+ phy_set_tonemap (ctx->phy, d->tonemap->tmdma_desc_head);
+ if (d->short_ppdu)
{
+ phy_rx_prepare_short (ctx->phy);
+ }
+ else
+ {
+ phy_rx_prepare (ctx->phy,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
+ d->gil, d->symb_nb);
phy_pbdma_start (ctx->phy, d->bypass_aes, d->nek, d->pb_nb_total,
d->pb_nb_total, d->pb_nb_total, d->pool_head, NULL,
true);
@@ -234,7 +239,7 @@ test_phy_data_data (test_t t, test_phy_t *ctx, test_phy_data_parameters_t *d,
}
/* Program PB DMA. */
if (d->mod == PHY_MOD_TM)
- phy_set_tonemap (ctx->phy, 0, d->tonemap->tmdma_desc_head);
+ phy_set_tonemap (ctx->phy, d->tonemap->tmdma_desc_head);
phy_pb_t *pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_total, NULL);
phy_pbdma_start (ctx->phy, d->bypass_aes, d->nek, d->pb_nb_total,
d->pb_nb_ready < 4 ? d->pb_nb_ready : 4, 0, pbs,
@@ -243,8 +248,12 @@ test_phy_data_data (test_t t, test_phy_t *ctx, test_phy_data_parameters_t *d,
for (i = 0; i < d->pb_nb_ready; i++)
pbs = PARENT_OF (phy_pb_t, blk, pbs->blk.next);
/* Program TX. */
- phy_tx_param (ctx->phy, d->fc_mode, d->short_ppdu, d->mod, d->fecrate,
- d->pb_size, d->gil, 0);
+ if (d->short_ppdu)
+ phy_tx_param_short (ctx->phy, d->fc_mode);
+ else
+ phy_tx_param (ctx->phy, d->fc_mode,
+ PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
+ d->gil);
u32 fc[4];
fc[0] = 0x1;
fc[1] = pre_date;
diff --git a/cesar/mac/pbproc/inc/prep_mpdu.h b/cesar/mac/pbproc/inc/prep_mpdu.h
index 5816496c88..113353bb04 100644
--- a/cesar/mac/pbproc/inc/prep_mpdu.h
+++ b/cesar/mac/pbproc/inc/prep_mpdu.h
@@ -46,10 +46,8 @@ struct pbproc_prep_mpdu_t
phy_fc_mode_t fc_mode;
/** Modulation type. */
phy_mod_t mod;
- /** TCC rate. */
- phy_fecrate_t fecrate;
- /** PB size. */
- phy_pb_size_t pb_size;
+ /** Phy combo parameters. */
+ u32 phy_combo_params;
/** Guard interval. */
phy_gil_t gil;
/** Tonemap. */
diff --git a/cesar/mac/pbproc/src/fsm_rx_beacon.c b/cesar/mac/pbproc/src/fsm_rx_beacon.c
index 4114f21597..90afb6f566 100644
--- a/cesar/mac/pbproc/src/fsm_rx_beacon.c
+++ b/cesar/mac/pbproc/src/fsm_rx_beacon.c
@@ -39,8 +39,9 @@ pbproc_frbe__handle (pbproc_t *ctx, u32 rx_date,
uint symb_nb = (1 * bits_per_pb + tm->bits_per_symbol - 1) /
tm->bits_per_symbol;
/* Unlock the hardware. */
- phy_rx_prepare (ctx->phy, false, PHY_MOD_MINI_ROBO, PHY_FEC_RATE_1_2,
- PHY_PB_SIZE_136, PHY_GIL_567, 0, symb_nb);
+ phy_rx_prepare (ctx->phy, PHY_COMBO_PARAMS (
+ PHY_MOD_MINI_ROBO, PHY_FEC_RATE_1_2, PHY_PB_SIZE_136),
+ PHY_GIL_567, symb_nb);
/* Program PB DMA. */
dbg_assert (ctx->rx_pool_size >= 1);
phy_pbdma_start (ctx->phy, true, NULL, 1, 1, 1,
diff --git a/cesar/mac/pbproc/src/fsm_rx_data.c b/cesar/mac/pbproc/src/fsm_rx_data.c
index ea9c733944..385e7c2231 100644
--- a/cesar/mac/pbproc/src/fsm_rx_data.c
+++ b/cesar/mac/pbproc/src/fsm_rx_data.c
@@ -217,9 +217,9 @@ pbproc_frda__handle (pbproc_t *ctx, u32 rx_date, const pbproc_fc_sof_t *sof)
}
/* First thing to do: unblock the hardware. */
if (tmi >= PHY_MOD_ROBO_NB)
- phy_set_tonemap (ctx->phy, 0, tm->tmdma_desc_head);
- phy_rx_prepare (ctx->phy, false, tmi < PHY_MOD_ROBO_NB ? tmi : PHY_MOD_TM,
- tm->fecrate, PHY_PB_SIZE_520, tm->gil, 0, symb_nb);
+ phy_set_tonemap (ctx->phy, tm->tmdma_desc_head);
+ phy_rx_prepare (ctx->phy, tm->phy_combo_params[PHY_PB_SIZE_520], tm->gil,
+ symb_nb);
/* Save received MPDU parameters. */
ctx->recv_mpdu.rx_params.preamble_ntb = rx_date
+ ctx->config->ntb_offset_tck;
diff --git a/cesar/mac/pbproc/src/fsm_rx_sound.c b/cesar/mac/pbproc/src/fsm_rx_sound.c
index f4bdafcc7d..e5ad6ecea2 100644
--- a/cesar/mac/pbproc/src/fsm_rx_sound.c
+++ b/cesar/mac/pbproc/src/fsm_rx_sound.c
@@ -74,8 +74,8 @@ pbproc_frso__handle (pbproc_t *ctx, u32 rx_date,
if (chandata)
{
/* Unblock hardware. */
- phy_rx_prepare_sound (ctx->phy, 1, mod, tm->fecrate, pb_size, tm->gil,
- symb_nb);
+ phy_rx_prepare_sound (ctx->phy, 1, tm->phy_combo_params[pb_size],
+ tm->gil, symb_nb);
/* Is sound completed? */
sta_t *sta = mac_store_sta_get (ctx->store, sound->stei);
if (sta)
diff --git a/cesar/mac/pbproc/src/fsm_tx_data.c b/cesar/mac/pbproc/src/fsm_tx_data.c
index f3c06cf23a..67c1f7d9cc 100644
--- a/cesar/mac/pbproc/src/fsm_tx_data.c
+++ b/cesar/mac/pbproc/src/fsm_tx_data.c
@@ -54,10 +54,9 @@ pbproc_ftda__handle (pbproc_t *ctx)
ctx->prep_mpdu.wack ? 0 : ctx->prep_mpdu.main_seg_nb,
&ctx->prep_mpdu.head->phy_pb, NULL, false);
if (ctx->prep_mpdu.mod == PHY_MOD_TM)
- phy_set_tonemap (ctx->phy, 0, ctx->prep_mpdu.tonemap);
- phy_tx_param (ctx->phy, ctx->prep_mpdu.fc_mode, false, ctx->prep_mpdu.mod,
- ctx->prep_mpdu.fecrate, ctx->prep_mpdu.pb_size,
- ctx->prep_mpdu.gil, 0);
+ phy_set_tonemap (ctx->phy, ctx->prep_mpdu.tonemap);
+ phy_tx_param (ctx->phy, ctx->prep_mpdu.fc_mode,
+ ctx->prep_mpdu.phy_combo_params, ctx->prep_mpdu.gil);
bool prp = ctx->access.prp && !ctx->prep_mpdu.rts_cts;
phy_tx_frame (ctx->phy, ctx->prep_mpdu.tx_date, true, prp,
ctx->prep_mpdu.fc_av.words);
diff --git a/cesar/mac/pbproc/src/fsm_tx_sound.c b/cesar/mac/pbproc/src/fsm_tx_sound.c
index a168e8fb77..6ccf688c2a 100644
--- a/cesar/mac/pbproc/src/fsm_tx_sound.c
+++ b/cesar/mac/pbproc/src/fsm_tx_sound.c
@@ -39,8 +39,7 @@ pbproc_ftso__handle (pbproc_t *ctx)
if (PHY_FC_MODE_IS_HYBRID (ctx->prep_mpdu.fc_mode))
phy_tx_fc10 (ctx->phy, ctx->prep_mpdu.tx_date, ctx->prep_mpdu.fc10);
phy_tx_param_sound (ctx->phy, ctx->prep_mpdu.fc_mode, 1,
- ctx->prep_mpdu.mod, ctx->prep_mpdu.fecrate,
- ctx->prep_mpdu.pb_size, ctx->prep_mpdu.gil);
+ ctx->prep_mpdu.phy_combo_params, ctx->prep_mpdu.gil);
bool prp = ctx->access.prp && !ctx->prep_mpdu.rts_cts;
phy_tx_frame (ctx->phy, ctx->prep_mpdu.tx_date, false, prp,
ctx->prep_mpdu.fc_av.words);
diff --git a/cesar/mac/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/src/prep_mpdu.c
index 9782349479..776a0efe3c 100644
--- a/cesar/mac/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/src/prep_mpdu.c
@@ -110,9 +110,8 @@ pbproc_prep_beacon (pbproc_t *ctx)
/* Modulation. */
prep->mod = PHY_MOD_MINI_ROBO;
tonemap_t *tm;
- tm = &ctx->config->tonemask_info.tonemap_robo[prep->mod];
- prep->fecrate = tm->fecrate;
- prep->pb_size = PHY_PB_SIZE_136;
+ tm = &ctx->config->tonemask_info.tonemap_robo[PHY_MOD_MINI_ROBO];
+ prep->phy_combo_params = tm->phy_combo_params[PHY_PB_SIZE_136];
prep->gil = tm->gil;
prep->tonemap = tm->tmdma_desc_head;
/* Compute number of symbols. */
@@ -289,8 +288,7 @@ pbproc_prep_mpdu (pbproc_t *ctx)
sound_reason_code = TONEMAP_SRC_NULL;
/* Prepare parameters. */
prep->mod = tmi < PHY_MOD_ROBO_NB ? tmi : PHY_MOD_TM;
- prep->fecrate = tm->fecrate;
- prep->pb_size = PHY_PB_SIZE_520;
+ prep->phy_combo_params = tm->phy_combo_params[PHY_PB_SIZE_520];
prep->gil = tm->gil;
prep->tonemap = tm->tmdma_desc_head;
prep->sound_reason_code = sound_reason_code;
diff --git a/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h b/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
index a31bb635c4..3ed2aa85f3 100644
--- a/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
+++ b/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
@@ -88,6 +88,7 @@ scenario_action_pbproc_activate_cb (scenario_globals_t *globals,
phy_set_tonemap, \
phy_tx_fc10, \
phy_tx_param, \
+ phy_tx_param_short, \
phy_tx_param_sound, \
phy_tx_frame, \
phy_tx_prepare, \
@@ -95,6 +96,7 @@ scenario_action_pbproc_activate_cb (scenario_globals_t *globals,
phy_rx_param, \
phy_rx_activate, \
phy_rx_prepare, \
+ phy_rx_prepare_short, \
phy_rx_prepare_sound, \
phy_pbdma_start, \
phy_pbdma_update, \
@@ -113,10 +115,7 @@ scenario_action_pbproc_activate_cb (scenario_globals_t *globals,
pbproc_rx_cb, \
pbproc_rx_beacon_cb
-typedef struct
-{
- uint tonemap_index;
-} scenario_event_phy_set_tonemap_t;
+typedef scenario_empty_t scenario_event_phy_set_tonemap_t;
typedef struct
{
@@ -127,17 +126,20 @@ typedef struct
typedef struct
{
phy_fc_mode_t fc_mode;
- bool short_ppdu;
phy_mod_t mod;
phy_fecrate_t fecrate;
phy_pb_size_t pb_size;
phy_gil_t gil;
- uint tonemap_index;
} scenario_event_phy_tx_param_t;
typedef struct
{
phy_fc_mode_t fc_mode;
+} scenario_event_phy_tx_param_short_t;
+
+typedef struct
+{
+ phy_fc_mode_t fc_mode;
uint nb_pb;
phy_mod_t mod;
phy_fecrate_t fecrate;
@@ -170,15 +172,15 @@ typedef struct
typedef struct
{
- bool short_ppdu;
phy_mod_t mod;
phy_fecrate_t fecrate;
phy_pb_size_t pb_size;
phy_gil_t gil;
- uint tonemap_index;
uint symbol_nb;
} scenario_event_phy_rx_prepare_t;
+typedef scenario_empty_t scenario_event_phy_rx_prepare_short_t;
+
typedef struct
{
uint nb_pb;
diff --git a/cesar/mac/pbproc/test/pbproc/src/phy.c b/cesar/mac/pbproc/test/pbproc/src/phy.c
index 770a6d2c9f..4244e6357a 100644
--- a/cesar/mac/pbproc/test/pbproc/src/phy.c
+++ b/cesar/mac/pbproc/test/pbproc/src/phy.c
@@ -63,10 +63,9 @@ phy_set_tonemask (phy_t *ctx, u32 *tonemask, uint carrier_nb)
}
void
-phy_set_tonemap (phy_t *ctx, uint tonemap_index, blk_t *tonemap)
+phy_set_tonemap (phy_t *ctx, blk_t *tonemap)
{
- scenario_event (phy_set_tonemap, params);
- test_fail_unless (tonemap_index == params->tonemap_index);
+ scenario_event (phy_set_tonemap);
/* Test tonemap? */
}
@@ -79,36 +78,38 @@ phy_tx_fc10 (phy_t *ctx, u32 date, u32 fc_10)
}
void
-phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, bool short_ppdu,
- phy_mod_t mod, phy_fecrate_t fecrate, phy_pb_size_t pb_size,
- phy_gil_t gil, uint tonemap_index)
+phy_tx_param (phy_t *ctx, phy_fc_mode_t fc_mode, u32 mod_fecrate_pb_size,
+ phy_gil_t gil)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
scenario_event (phy_tx_param, params);
test_fail_unless (fc_mode == params->fc_mode);
- test_fail_unless (short_ppdu == params->short_ppdu);
- if (short_ppdu)
- {
- test_fail_unless (mod == PHY_MOD_NONE);
- test_fail_unless (fecrate == PHY_FEC_RATE_NONE);
- test_fail_unless (pb_size == PHY_PB_SIZE_NONE);
- test_fail_unless (gil == PHY_GIL_NB);
- test_fail_unless (tonemap_index == 0);
- }
- else
- {
- test_fail_unless (mod == params->mod);
- test_fail_unless (fecrate == params->fecrate);
- test_fail_unless (pb_size == params->pb_size);
- test_fail_unless (gil == params->gil);
- test_fail_unless (tonemap_index == params->tonemap_index);
- }
+ test_fail_unless (mod == params->mod);
+ test_fail_unless (fecrate == params->fecrate);
+ test_fail_unless (pb_size == params->pb_size);
+ test_fail_unless (gil == params->gil);
+}
+
+void
+phy_tx_param_short (phy_t *ctx, phy_fc_mode_t fc_mode)
+{
+ scenario_event (phy_tx_param_short, params);
+ test_fail_unless (fc_mode == params->fc_mode);
}
void
phy_tx_param_sound (phy_t *ctx, phy_fc_mode_t fc_mode, uint nb_pb,
- phy_mod_t mod, phy_fecrate_t fecrate,
- phy_pb_size_t pb_size, phy_gil_t gil)
+ u32 mod_fecrate_pb_size, phy_gil_t gil)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
scenario_event (phy_tx_param_sound, params);
test_fail_unless (fc_mode == params->fc_mode);
test_fail_unless (nb_pb == params->nb_pb);
@@ -161,37 +162,37 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool pre_detection)
}
void
-phy_rx_prepare (phy_t *ctx, bool short_ppdu, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size, phy_gil_t gil,
- uint tonemap_index, uint symbol_nb)
+phy_rx_prepare (phy_t *ctx, u32 mod_fecrate_pb_size, phy_gil_t gil,
+ uint symbol_nb)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
scenario_event (phy_rx_prepare, params);
- test_fail_unless (short_ppdu == params->short_ppdu);
- if (short_ppdu)
- {
- test_fail_unless (mod == PHY_MOD_NONE);
- test_fail_unless (fecrate == PHY_FEC_RATE_NONE);
- test_fail_unless (pb_size == PHY_PB_SIZE_NONE);
- test_fail_unless (gil == PHY_GIL_NB);
- test_fail_unless (tonemap_index == 0);
- test_fail_unless (symbol_nb == 0);
- }
- else
- {
- test_fail_unless (mod == params->mod);
- test_fail_unless (fecrate == params->fecrate);
- test_fail_unless (pb_size == params->pb_size);
- test_fail_unless (gil == params->gil);
- test_fail_unless (tonemap_index == params->tonemap_index);
- test_fail_unless (symbol_nb == params->symbol_nb);
- }
+ test_fail_unless (mod == params->mod);
+ test_fail_unless (fecrate == params->fecrate);
+ test_fail_unless (pb_size == params->pb_size);
+ test_fail_unless (gil == params->gil);
+ test_fail_unless (symbol_nb == params->symbol_nb);
+}
+
+void
+phy_rx_prepare_short (phy_t *ctx)
+{
+ scenario_event (phy_rx_prepare_short);
}
void
-phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, phy_mod_t mod,
- phy_fecrate_t fecrate, phy_pb_size_t pb_size,
+phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
phy_gil_t gil, uint symbol_nb)
{
+ phy_mod_t mod = BF_GET (PHY_COMBO_PARAMS__MOD, mod_fecrate_pb_size);
+ phy_fecrate_t fecrate = BF_GET (PHY_COMBO_PARAMS__FECRATE,
+ mod_fecrate_pb_size);
+ phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
+ mod_fecrate_pb_size);
scenario_event (phy_rx_prepare_sound, params);
test_fail_unless (mod == params->mod);
test_fail_unless (fecrate == params->fecrate);
diff --git a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
index 9ced2713ab..3a2282b31f 100644
--- a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
@@ -147,8 +147,8 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
test_fail_unless (prep->fc_mode == PHY_FC_MODE_AV_1);
test_fail_unless (prep->mod == (tmi < PHY_MOD_ROBO_NB ? tmi
: PHY_MOD_TM));
- test_fail_unless (prep->fecrate == tm->fecrate);
- test_fail_unless (prep->pb_size == PHY_PB_SIZE_520);
+ test_fail_unless (prep->phy_combo_params == PHY_COMBO_PARAMS (
+ prep->mod, tm->fecrate, PHY_PB_SIZE_520));
test_fail_unless (prep->gil == tm->gil);
test_fail_unless (prep->tonemap == tm->tmdma_desc_head);
test_fail_unless (prep->sound_reason_code == sound_reason_code);
@@ -218,8 +218,8 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
test_fail_unless (prep->fc_mode == PHY_FC_MODE_AV_1);
test_fail_unless (prep->mod == (tmi < PHY_MOD_ROBO_NB ? tmi
: PHY_MOD_TM));
- test_fail_unless (prep->fecrate == tm->fecrate);
- test_fail_unless (prep->pb_size == PHY_PB_SIZE_520);
+ test_fail_unless (prep->phy_combo_params == PHY_COMBO_PARAMS (
+ prep->mod, tm->fecrate, PHY_PB_SIZE_520));
test_fail_unless (prep->gil == tm->gil);
test_fail_unless (prep->tonemap == tm->tmdma_desc_head);
test_fail_unless (prep->sound_reason_code == sound_reason_code);
@@ -626,8 +626,8 @@ prep_beacon_test (test_t t, test_pbproc_t *tp, u32 date, bool prepared,
test_fail_unless (prep->fc_mode == PHY_FC_MODE_HYBRID_1);
test_fail_unless (prep->sound_reason_code == TONEMAP_SRC_NULL);
test_fail_unless (prep->mod == PHY_MOD_MINI_ROBO);
- test_fail_unless (prep->fecrate == PHY_FEC_RATE_1_2);
- test_fail_unless (prep->pb_size == PHY_PB_SIZE_136);
+ test_fail_unless (prep->phy_combo_params == PHY_COMBO_PARAMS (
+ prep->mod, PHY_FEC_RATE_1_2, PHY_PB_SIZE_136));
test_fail_unless (prep->gil == PHY_GIL_567);
test_fail_unless (prep->tonemap == NULL);
test_fail_unless (prep->flp_tck == MAC_PREAMBLE_HYBRID_TCK
diff --git a/cesar/mac/pbproc/test/pbproc/src/rx_data.c b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
index d48e1fb98d..75a2888f96 100644
--- a/cesar/mac/pbproc/test/pbproc/src/rx_data.c
+++ b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
@@ -190,13 +190,11 @@ rx_data_burst_test_mpdu (test_t t, test_pbproc_t *tp,
ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT_COND (m->tmi >= PHY_MOD_ROBO_NB, phy_set_tonemap,
- .tonemap_index = 0),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = false,
+ SCENARIO_EVENT_COND (m->tmi >= PHY_MOD_ROBO_NB, phy_set_tonemap),
+ SCENARIO_EVENT (phy_rx_prepare,
.mod = m->tmi < PHY_MOD_ROBO_NB ? m->tmi : PHY_MOD_TM,
.fecrate = tm->fecrate, .pb_size = PHY_PB_SIZE_520,
- .gil = tm->gil, .tonemap_index = 0,
- .symbol_nb = m->symb_nb),
+ .gil = tm->gil, .symbol_nb = m->symb_nb),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = !m->encrypted || drop,
.nb_total = m->pb_nb, .nb_ready = m->pb_nb,
.nb_pb_it = m->pb_nb == nb_pb_it && chandata_nb ? 0
@@ -213,9 +211,8 @@ rx_data_burst_test_mpdu (test_t t, test_pbproc_t *tp,
.crc_bitmap = m->crc_error,
.crc_bitmap_bits = m->pb_nb),
SCENARIO_EVENT_COND (burst->wack && m->mpdu_cnt == 0,
- phy_tx_param,
- .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = true),
+ phy_tx_param_short,
+ .fc_mode = PHY_FC_MODE_AV_1),
SCENARIO_EVENT_COND (burst->wack && m->mpdu_cnt == 0,
phy_tx_frame,
.date = date + pre_fc_fl_tck,
@@ -419,11 +416,11 @@ rx_beacon_test (test_t t, test_pbproc_t *tp, u32 date, uint symb_nb)
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = false,
+ SCENARIO_EVENT (phy_rx_prepare,
.mod = PHY_MOD_MINI_ROBO,
.fecrate = PHY_FEC_RATE_1_2,
.pb_size = PHY_PB_SIZE_136, .gil = PHY_GIL_567,
- .tonemap_index = 0, .symbol_nb = symb_nb),
+ .symbol_nb = symb_nb),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true,
.nb_total = 1, .nb_ready = 1, .nb_pb_it = 1,
.chandata = false, .now = true),
@@ -878,7 +875,7 @@ rx_data_nfu_test (test_t t, test_pbproc_t *tp, u32 date, rx_data_nfu_t nfu)
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = restart_date,
.length_tck = length_tck,
@@ -993,9 +990,9 @@ rx_data_sack_error_test (test_t t, test_pbproc_t *tp,
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
- SCENARIO_EVENT_COND (wack, phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
+ SCENARIO_EVENT_COND (wack, phy_tx_param_short,
+ .fc_mode = PHY_FC_MODE_AV_1),
SCENARIO_EVENT_COND (wack, phy_tx_frame, .date = date + pre_fc_fl_tck,
.want_conf = false,
.stop_tx_on_prp_lost = false),
@@ -1057,7 +1054,7 @@ rx_data_errors_test_case (test_t t)
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date,
.length_tck = MAC_EIFS_AV_TCK,
@@ -1091,7 +1088,7 @@ rx_data_errors_test_case (test_t t)
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date,
.length_tck = MAC_EIFS_AV_TCK,
diff --git a/cesar/mac/pbproc/test/pbproc/src/rx_sound.c b/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
index 695921dbcb..194e49cbce 100644
--- a/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
+++ b/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
@@ -94,10 +94,10 @@ rx_sound_test (test_t t, test_pbproc_t *tp, u32 date, uint chandata_nb,
.pb_size = pb_size, .gil = tm->gil,
.symbol_nb = symb_nb),
SCENARIO_EVENT_COND (chandata, phy_pbdma_start_chandata),
- SCENARIO_EVENT_COND (!chandata, phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT_COND (!chandata, phy_rx_prepare_short),
SCENARIO_ACTION_COND (chandata, phy_pbdma, .end_chandata = true),
- SCENARIO_EVENT_COND (!burst, phy_tx_param,
- .fc_mode = PHY_FC_MODE_AV_1, .short_ppdu = true),
+ SCENARIO_EVENT_COND (!burst, phy_tx_param_short,
+ .fc_mode = PHY_FC_MODE_AV_1),
SCENARIO_EVENT_COND (!burst, phy_tx_frame,
.date = date + pre_fc_fl_tck, .want_conf = false,
.stop_tx_on_prp_lost = false),
@@ -282,7 +282,7 @@ rx_sound_nfu_test (test_t t, test_pbproc_t *tp, u32 date, rx_sound_nfu_t nfu)
SCENARIO_EVENT (ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = restart_date,
.length_tck = length_tck,
diff --git a/cesar/mac/pbproc/test/pbproc/src/tx_data.c b/cesar/mac/pbproc/test/pbproc/src/tx_data.c
index c332b18331..9cb47c7cb2 100644
--- a/cesar/mac/pbproc/test/pbproc/src/tx_data.c
+++ b/cesar/mac/pbproc/test/pbproc/src/tx_data.c
@@ -73,10 +73,8 @@ tx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.nb_ready = initial_pb_nb, .nb_pb_it = 0,
.chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = false, .mod = PHY_MOD_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417,
- .tonemap_index = 0),
+ .mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
SCENARIO_EVENT (phy_tx_frame, .date = date, .want_conf = true,
.stop_tx_on_prp_lost = true),
SCENARIO_EVENT (ca_access_vcs_restart, .start_date = date,
@@ -98,7 +96,7 @@ tx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.pre_detection = true),
SCENARIO_ACTION (phy_rx_fc, .rx_date = date + pre_fc_fl_tck,
.fc_av = (u32 *) &sack_fc),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_mfs_update, .mfs = mfs),
SCENARIO_EVENT (ca_backoff_success),
SCENARIO_EVENT (ca_access_vcs_restart,
@@ -148,10 +146,8 @@ tx_data_woack_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.nb_ready = initial_pb_nb, .nb_pb_it = initial_pb_nb,
.chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = false, .mod = PHY_MOD_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417,
- .tonemap_index = 0),
+ .mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
SCENARIO_EVENT (phy_tx_frame, .date = date, .want_conf = true,
.stop_tx_on_prp_lost = true),
SCENARIO_EVENT (ca_access_vcs_restart, .start_date = date,
@@ -270,10 +266,8 @@ tx_data_beacon_test (test_t t, test_pbproc_t *tp, u32 date, uint duration_tck,
.nb_ready = 1, .nb_pb_it = 1, .chandata = false,
.now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_HYBRID_1,
- .short_ppdu = false, .mod = PHY_MOD_MINI_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_136, .gil = PHY_GIL_567,
- .tonemap_index = 0),
+ .mod = PHY_MOD_MINI_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_136, .gil = PHY_GIL_567),
SCENARIO_EVENT (phy_tx_frame, .date = date, .want_conf = true,
.stop_tx_on_prp_lost = false),
SCENARIO_ACTION (phy_access_conf),
@@ -408,10 +402,8 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
.nb_ready = 1, .nb_pb_it = 0, .chandata = false,
.now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = false, .mod = PHY_MOD_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417,
- .tonemap_index = 0),
+ .mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
SCENARIO_EVENT (phy_tx_frame, .date = date, .want_conf = true,
.stop_tx_on_prp_lost = true),
SCENARIO_EVENT (ca_access_vcs_restart, .start_date = date,
@@ -426,7 +418,7 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
SCENARIO_EVENT_COND (!prp_won, ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date - MAC_SLOT_TCK,
.length_tck = sack_length_tck,
@@ -443,10 +435,8 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
.nb_ready = 1, .nb_pb_it = 0, .chandata = false,
.now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = false, .mod = PHY_MOD_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417,
- .tonemap_index = 0),
+ .mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
SCENARIO_EVENT (phy_tx_frame, .date = date, .want_conf = true,
.stop_tx_on_prp_lost = true),
SCENARIO_EVENT (ca_access_vcs_restart, .start_date = date,
@@ -461,10 +451,8 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
.nb_ready = 1, .nb_pb_it = 0, .chandata = false,
.now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
- .short_ppdu = false, .mod = PHY_MOD_ROBO,
- .fecrate = PHY_FEC_RATE_1_2,
- .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417,
- .tonemap_index = 0),
+ .mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
+ .pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
SCENARIO_EVENT (phy_tx_frame, .date = date2, .want_conf = true,
.stop_tx_on_prp_lost = false),
SCENARIO_ACTION (phy_rx_fc, .rx_date = date2 - MAC_SLOT_TCK,
@@ -474,7 +462,7 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
SCENARIO_EVENT (ca_backoff_deferred, .slot_count = 3),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date2 - MAC_SLOT_TCK,
.length_tck = sack_length_tck,
diff --git a/cesar/mac/pbproc/test/pbproc/src/tx_sound.c b/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
index 04f3d24642..8eb119e994 100644
--- a/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
+++ b/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
@@ -92,7 +92,7 @@ tx_sound_test (test_t t, test_pbproc_t *tp)
.pre_detection = true),
SCENARIO_ACTION (phy_rx_fc, .rx_date = date + pre_fc_fl_tck,
.fc_av = (u32 *) &sound_ack_fc),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_backoff_success),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date + pre_fc_fl_tck,
@@ -212,7 +212,7 @@ tx_sound_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
SCENARIO_EVENT_COND (!prp_won, ca_backoff_cancel),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date - MAC_SLOT_TCK,
.length_tck = sack_length_tck,
@@ -262,7 +262,7 @@ tx_sound_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
SCENARIO_EVENT (ca_backoff_deferred, .slot_count = 3),
SCENARIO_EVENT (phy_tx_cancel),
SCENARIO_EVENT (ca_access_hold),
- SCENARIO_EVENT (phy_rx_prepare, .short_ppdu = true),
+ SCENARIO_EVENT (phy_rx_prepare_short),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date2 - MAC_SLOT_TCK,
.length_tck = sack_length_tck,
diff --git a/cesar/maximus/stationtest/src/main_example.c b/cesar/maximus/stationtest/src/main_example.c
index fb871bd8fe..78aa221065 100644
--- a/cesar/maximus/stationtest/src/main_example.c
+++ b/cesar/maximus/stationtest/src/main_example.c
@@ -26,9 +26,8 @@ bool phy_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
{
diag_write_string("=> phy_rx_fc_cb\n");
- phy_rx_prepare(phy, false, PHY_MOD_MINI_ROBO,
- PHY_FEC_RATE_1_2, PHY_PB_SIZE_136, PHY_GIL_567,
- 0 /* tonemap_index */, 0 /* symbol_nb */);
+ phy_rx_prepare(phy, PHY_COMBO_PARAMS (PHY_MOD_MINI_ROBO, PHY_FEC_RATE_1_2,
+ PHY_PB_SIZE_136), PHY_GIL_567, 0);
return true;
}
diff --git a/cesar/maximus/stationtest/src/test_false_alarm.c b/cesar/maximus/stationtest/src/test_false_alarm.c
index b141853a29..e04e012de0 100644
--- a/cesar/maximus/stationtest/src/test_false_alarm.c
+++ b/cesar/maximus/stationtest/src/test_false_alarm.c
@@ -30,9 +30,8 @@ bool phy_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
// Reset IT
maximus_pending_isrs &= (0 << PHY_HAL_INTERRUPT_PHY);
- phy_rx_prepare(ctx, false, PHY_MOD_MINI_ROBO,
- PHY_FEC_RATE_1_2, PHY_PB_SIZE_136, PHY_GIL_567,
- 0 /* tonemap_index */, 0 /* symbol_nb */);
+ phy_rx_prepare(ctx, PHY_COMBO_PARAMS (PHY_MOD_MINI_ROBO, PHY_FEC_RATE_1_2,
+ PHY_PB_SIZE_136), PHY_GIL_567, 0);
return true;
}
diff --git a/cesar/maximus/stationtest/src/test_send.c b/cesar/maximus/stationtest/src/test_send.c
index e3f20c3c6b..f5017df4e4 100644
--- a/cesar/maximus/stationtest/src/test_send.c
+++ b/cesar/maximus/stationtest/src/test_send.c
@@ -40,9 +40,8 @@ bool phy_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
diag_write_string("=> phy_rx_fc_cb\n");
// When the FC is received, prepare RX
- phy_rx_prepare(ctx, short_ppdu, (phy_mod_t)mod,
- (phy_fecrate_t)fecrate, (phy_pb_size_t)pb_size, (phy_gil_t)gil,
- 0 /* tonemap_index */, 0 /* symbol_nb */);
+ phy_rx_prepare(ctx, PHY_COMBO_PARAMS (mod, fecrate, pb_size),
+ (phy_gil_t)gil, 0);
return true;
}
diff --git a/cesar/maximus/stationtest/src/test_tx_rx.c b/cesar/maximus/stationtest/src/test_tx_rx.c
index 85ecda0974..32b3f719d6 100644
--- a/cesar/maximus/stationtest/src/test_tx_rx.c
+++ b/cesar/maximus/stationtest/src/test_tx_rx.c
@@ -132,9 +132,8 @@ bool phy_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
maximus_pending_isrs &= (0 << PHY_HAL_INTERRUPT_PHY);
// When the FC is received, prepare RX
- phy_rx_prepare(ctx, short_ppdu, (phy_mod_t)mod,
- (phy_fecrate_t)fecrate, (phy_pb_size_t)pb_size, (phy_gil_t)gil,
- 0 /* tonemap_index */, 0 /* symbol_nb */);
+ phy_rx_prepare(ctx, PHY_COMBO_PARAMS (mod, fecrate, pb_size),
+ (phy_gil_t)gil, 0);
return true;
}
@@ -173,9 +172,14 @@ bool phy_pbdma_cb (void *user, u32 status_word)
if (status.end_rx_pb)
{
// Set TX parameters
- phy_tx_param (ctx, ctx->control.rx_param.fc_mode, ctx->control.rx_param.short_ppdu,
- ctx->control.rx_param.mod, ctx->control.rx_param.fecrate, ctx->control.rx_param.pb_size,
- ctx->control.rx_param.gil, ctx->control.rx_param.tonemap_index);
+ if (ctx->control.rx_param.short_ppdu)
+ phy_tx_param_short (ctx, ctx->control.rx_param.fc_mode);
+ else
+ phy_tx_param (ctx, ctx->control.rx_param.fc_mode,
+ PHY_COMBO_PARAMS (ctx->control.rx_param.mod,
+ ctx->control.rx_param.fecrate,
+ ctx->control.rx_param.pb_size),
+ ctx->control.rx_param.gil);
if (0 != ctx->control.rx_param.fc_10)
{
phy_tx_fc10 (ctx, (u32)my_station.current_tick_tck +
@@ -260,7 +264,7 @@ int set_tonemask (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, vo
tonemap2.data = tonemap2_data;
tonemap1.next = &tonemap2;
tonemap1.data = tonemap1_data;
- phy_set_tonemap(ctx, 0 /* tonemap_index */, &tonemap1);
+ phy_set_tonemap(ctx, &tonemap1);
/* now make the return parameter list */
fcall_param_reset(*param);