summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2011-03-01 13:52:03 +0100
committerNicolas Schodet2011-03-04 11:30:12 +0100
commit34980ef65650a6b34c33ee24b642b8c7e7eb3e8a (patch)
tree1a39e8e4fc7a45051c028003d8cdd8774c17abe1
parent911b0a18cf7a8d3b059e9ddf3bd6ee2a8077ba28 (diff)
cesar/hal/phy, cesar/mac/pbproc: remove nb_ready for PBDMA, closes #2316
-rw-r--r--cesar/hal/phy/maximus/src/maximus_pbdma.c19
-rw-r--r--cesar/hal/phy/maximus/src/maximus_trace.c5
-rw-r--r--cesar/hal/phy/maximus/test/src/test_pbdma.c13
-rw-r--r--cesar/hal/phy/pbdma.h6
-rw-r--r--cesar/hal/phy/src/pbdma.c27
-rw-r--r--cesar/hal/phy/src/trace.c8
-rw-r--r--cesar/hal/phy/test/phy/doc/test_phy.txt2
-rw-r--r--cesar/hal/phy/test/phy/inc/msg.h3
-rw-r--r--cesar/hal/phy/test/phy/py/valid/pbdma.2.py32
-rw-r--r--cesar/hal/phy/test/phy/src/burst.c8
-rw-r--r--cesar/hal/phy/test/phy/src/data.c12
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_beacon.c2
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_data.c6
-rw-r--r--cesar/mac/pbproc/src/fsm_tx_data.c7
-rw-r--r--cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h2
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/phy.c6
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/rx_data.c7
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/tx_data.c24
-rw-r--r--cesar/maximus/stationtest/src/main_example.c3
-rw-r--r--cesar/maximus/stationtest/src/test_send.c6
-rw-r--r--cesar/maximus/stationtest/src/test_tx_rx.c8
-rw-r--r--cesar/tools/sniffer_phy/src/lowlevel.c3
22 files changed, 60 insertions, 149 deletions
diff --git a/cesar/hal/phy/maximus/src/maximus_pbdma.c b/cesar/hal/phy/maximus/src/maximus_pbdma.c
index 0da9e496e3..2e90a0d87e 100644
--- a/cesar/hal/phy/maximus/src/maximus_pbdma.c
+++ b/cesar/hal/phy/maximus/src/maximus_pbdma.c
@@ -24,12 +24,11 @@
*/
void
phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
- uint nb_ready, uint nb_pb_it, phy_pb_t *first_pb,
+ uint nb_pb_it, phy_pb_t *first_pb,
phy_chandata_t *first_chandata, bool now)
{
dbg_assert_ptr(ctx);
dbg_assert(MAC_MAX_PB_PER_MPDU >= nb_total);
- dbg_assert(nb_total >= nb_ready);
dbg_assert(nb_total >= nb_pb_it);
dbg_assert_ptr(first_pb);
if (first_chandata)
@@ -38,11 +37,10 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
dbg_assert((PHY_CHANDATA_TYPE_NO_MEMORY_READ < first_chandata->conf.type) && (PHY_CHANDATA_TYPE_NRJ_SYMBOL >= first_chandata->conf.type));
}
MAXIMUS_PHY_TRACE (PBDMA_START, my_station.current_tick_tck, bypass_aes,
- nb_total, nb_ready, nb_pb_it,
+ nb_total, nb_pb_it,
first_chandata ? true : false, now);
if ((NULL == ctx)
|| (MAC_MAX_PB_PER_MPDU < nb_total)
- || (nb_total < nb_ready)
|| (nb_total < nb_pb_it)
|| (NULL == first_pb))
{
@@ -62,7 +60,7 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
memset(ctx->pbdma.nek, '\0', 4*sizeof(u32));
}
ctx->pbdma.nb_total = nb_total;
- ctx->pbdma.nb_ready = nb_ready;
+ ctx->pbdma.nb_ready = nb_total;
ctx->pbdma.nb_pb_it = nb_pb_it;
ctx->pbdma.first_pb = first_pb;
ctx->pbdma.first_chandata = first_chandata;
@@ -78,17 +76,13 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
* - EINVAL if ctx is null, or if arguments are incoherent
*/
void
-phy_pbdma_update (phy_t *ctx, uint nb_ready, uint nb_pb_it)
+phy_pbdma_update (phy_t *ctx, uint nb_pb_it)
{
dbg_assert_ptr(ctx);
- dbg_assert(nb_ready >= ctx->pbdma.nb_ready);
dbg_assert(nb_pb_it <= ctx->pbdma.nb_total);
- dbg_assert(nb_ready <= ctx->pbdma.nb_total);
- MAXIMUS_PHY_TRACE (PBDMA_UPDATE, nb_ready, nb_pb_it);
+ MAXIMUS_PHY_TRACE (PBDMA_UPDATE, nb_pb_it);
if ((NULL == ctx)
- || (nb_ready < ctx->pbdma.nb_ready)
- || (nb_pb_it > ctx->pbdma.nb_total)
- || (nb_ready > ctx->pbdma.nb_total))
+ || (nb_pb_it > ctx->pbdma.nb_total))
{
errno = EINVAL;
station_log(&my_station, STATION_LOG_ERROR, STATION_LOGTYPE_PHY,
@@ -96,7 +90,6 @@ phy_pbdma_update (phy_t *ctx, uint nb_ready, uint nb_pb_it)
}
else
{
- ctx->pbdma.nb_ready = nb_ready;
ctx->pbdma.nb_pb_it = nb_pb_it;
}
}
diff --git a/cesar/hal/phy/maximus/src/maximus_trace.c b/cesar/hal/phy/maximus/src/maximus_trace.c
index 320ce36d1a..947e49f0ad 100644
--- a/cesar/hal/phy/maximus/src/maximus_trace.c
+++ b/cesar/hal/phy/maximus/src/maximus_trace.c
@@ -76,10 +76,9 @@ maximus_phy_trace_init (phy_t *ctx)
MAXIMUS_PHY_TRACE_EVENT (ACCESS_CB, "access cb", TIMESTAMP),
MAXIMUS_PHY_TRACE_EVENT (PBDMA_START, "pbdma start bypass_aes=%b "
- "nb_total=%u nb_ready=%u nb_pb_it=%u "
+ "nb_total=%u nb_pb_it=%u "
"chandata=%b now=%b", TIMESTAMP),
- MAXIMUS_PHY_TRACE_EVENT (PBDMA_UPDATE, "pbdma update nb_ready=%u "
- "nb_pb_it=%u"),
+ MAXIMUS_PHY_TRACE_EVENT (PBDMA_UPDATE, "pbdma update nb_pb_it=%u"),
MAXIMUS_PHY_TRACE_EVENT (PBDMA_START_CHANDATA,
"pbdma start chandata"),
MAXIMUS_PHY_TRACE_EVENT (PBDMA_CB, "pbdma cb %x", TIMESTAMP),
diff --git a/cesar/hal/phy/maximus/test/src/test_pbdma.c b/cesar/hal/phy/maximus/test/src/test_pbdma.c
index e99a9c9374..19b6651414 100644
--- a/cesar/hal/phy/maximus/test/src/test_pbdma.c
+++ b/cesar/hal/phy/maximus/test/src/test_pbdma.c
@@ -34,7 +34,6 @@ void phy_pbdma_start_test_case(test_t t)
bool bypass_aes = false;
u32 nek[4];
uint nb_total = PHY_PB_MAX_NB;
- uint nb_ready = PHY_PB_MAX_NB-1;
uint nb_pb_it = PHY_PB_MAX_NB-1;
phy_pb_t pb[PHY_PB_MAX_NB];
u8 pb_data[PHY_PB_MAX_NB][MAC_PB520_BYTES];
@@ -66,13 +65,13 @@ void phy_pbdma_start_test_case(test_t t)
}
phy_pbdma_start (ctx, bypass_aes,
- nek, nb_total, nb_ready,
+ nek, nb_total,
nb_pb_it, &pb[0], NULL, false);
test_fail_unless ((EINVAL != errno)
&& (bypass_aes == ctx->pbdma.bypass_aes)
&& (0 == memcmp(nek, ctx->pbdma.nek, 4*sizeof(u32)))
&& (nb_total == ctx->pbdma.nb_total)
- && (nb_ready == ctx->pbdma.nb_ready)
+ && (nb_total == ctx->pbdma.nb_ready)
&& (nb_pb_it == ctx->pbdma.nb_pb_it)
&& (pb == ctx->pbdma.first_pb)
&& (!ctx->pbdma.chandata_transfer)
@@ -109,13 +108,13 @@ void phy_pbdma_start_test_case(test_t t)
}
phy_pbdma_start (ctx, bypass_aes,
- nek, nb_total, nb_ready,
+ nek, nb_total,
nb_pb_it, &pb[0], NULL, false);
test_fail_unless ((EINVAL != errno)
&& (bypass_aes == ctx->pbdma.bypass_aes)
&& (0 == memcmp(nek, ctx->pbdma.nek, 4*sizeof(u32)))
&& (nb_total == ctx->pbdma.nb_total)
- && (nb_ready == ctx->pbdma.nb_ready)
+ && (nb_total == ctx->pbdma.nb_ready)
&& (nb_pb_it == ctx->pbdma.nb_pb_it)
&& (pb == ctx->pbdma.first_pb)
&& (!ctx->pbdma.chandata_transfer)
@@ -130,12 +129,10 @@ void phy_pbdma_update_test_case(test_t t)
test_begin(t, "pbdma update")
{
- uint nb_ready = PHY_PB_MAX_NB;
uint nb_pb_it = PHY_PB_MAX_NB-1;
- phy_pbdma_update (ctx, nb_ready, nb_pb_it);
+ phy_pbdma_update (ctx, nb_pb_it);
test_fail_unless ((EINVAL != errno)
- && (nb_ready == ctx->pbdma.nb_ready)
&& (nb_pb_it == ctx->pbdma.nb_pb_it));
} test_end;
}
diff --git a/cesar/hal/phy/pbdma.h b/cesar/hal/phy/pbdma.h
index f2fe824b7c..b68cb98a0f 100644
--- a/cesar/hal/phy/pbdma.h
+++ b/cesar/hal/phy/pbdma.h
@@ -180,7 +180,6 @@ BEGIN_DECLS
* \param bypass_aes do not encrypt or decrypt using AES
* \param nek AES network encryption key
* \param nb_total total number of PB
- * \param nb_ready number of ready descriptors
* \param nb_pb_it number of the PB after which an interrupt is triggered
* \param first_pb first PB descriptor
* \param first_chandata first channel data descriptor, or NULL
@@ -190,17 +189,16 @@ BEGIN_DECLS
*/
void
phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
- uint nb_ready, uint nb_pb_it, phy_pb_t *first_pb,
+ uint nb_pb_it, phy_pb_t *first_pb,
phy_chandata_t *first_chandata, bool now);
/**
* Update PB transfer counters.
* \param ctx phy context
- * \param nb_ready number of ready descriptors
* \param nb_pb_it number of the PB after which an interrupt is triggered
*/
void
-phy_pbdma_update (phy_t *ctx, uint nb_ready, uint nb_pb_it);
+phy_pbdma_update (phy_t *ctx, uint nb_pb_it);
/**
* Retrieve last used PB descriptor.
diff --git a/cesar/hal/phy/src/pbdma.c b/cesar/hal/phy/src/pbdma.c
index 79a8a90065..a19c38d3ea 100644
--- a/cesar/hal/phy/src/pbdma.c
+++ b/cesar/hal/phy/src/pbdma.c
@@ -19,15 +19,13 @@
void ARCH_ILRAM
phy_pbdma_start (phy_t *ctx, bool bypass_aes,
- const u32 nek[4], uint nb_total, uint nb_ready,
- uint nb_pb_it, phy_pb_t *first_pb,
- phy_chandata_t *first_chandata, bool now)
+ const u32 nek[4], uint nb_total, uint nb_pb_it,
+ phy_pb_t *first_pb, phy_chandata_t *first_chandata, bool now)
{
dbg_claim (ctx);
dbg_claim ((bypass_aes == true)
|| (bypass_aes == false && nek));
dbg_claim (nb_total > 0 && nb_total < 255
- && nb_total >= nb_ready
&& nb_total >= nb_pb_it);
dbg_claim_ptr (first_pb);
dbg_claim (ARCH_DMA_VALID (first_pb));
@@ -42,7 +40,7 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes,
PHY_PBDMA_PTR_CHANDATA = (u32) first_chandata;
u32 config_pb = BF_FILL (PHY_PBDMA_CONFIG_PB,
(PB_NB_TOTAL, nb_total),
- (PB_NB_READY, nb_ready),
+ (PB_NB_READY, nb_total),
(PB_NB_IT, nb_pb_it ? nb_pb_it : 0xff));
PHY_PBDMA_CONFIG_PB = config_pb;
/* Set encryption parameters. */
@@ -71,19 +69,16 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes,
}
void ARCH_ILRAM
-phy_pbdma_update (phy_t *ctx, uint nb_ready, uint nb_pb_it)
+phy_pbdma_update (phy_t *ctx, uint nb_pb_it)
{
dbg_claim (ctx);
- PHY_TRACE (PBDMA_UPDATE, nb_ready, nb_pb_it);
- uint nb_total = BF_GET (PHY_PBDMA_CONFIG_PB__PB_NB_TOTAL,
- PHY_PBDMA_CONFIG_PB);
- dbg_claim (nb_total > 0 && nb_total < 255
- && nb_total >= nb_ready
- && nb_total >= nb_pb_it);
- PHY_PBDMA_CONFIG_PB = BF_FILL (PHY_PBDMA_CONFIG_PB,
- (PB_NB_TOTAL, nb_total),
- (PB_NB_READY, nb_ready),
- (PB_NB_IT, nb_pb_it ? nb_pb_it : 0xff));
+ PHY_TRACE (PBDMA_UPDATE, nb_pb_it);
+ u32 config_pb = PHY_PBDMA_CONFIG_PB;
+ dbg_claim (nb_pb_it <= BF_GET (PHY_PBDMA_CONFIG_PB__PB_NB_TOTAL,
+ config_pb));
+ PHY_PBDMA_CONFIG_PB = BF_SET (config_pb,
+ PHY_PBDMA_CONFIG_PB__PB_NB_IT,
+ nb_pb_it ? nb_pb_it : 0xff);
}
phy_pb_t * ARCH_ILRAM
diff --git a/cesar/hal/phy/src/trace.c b/cesar/hal/phy/src/trace.c
index 267ba5b1ea..a8f006515b 100644
--- a/cesar/hal/phy/src/trace.c
+++ b/cesar/hal/phy/src/trace.c
@@ -80,12 +80,11 @@ phy_trace_format_nb_pb (char *text, uint text_size, int data)
int r;
u32 reg = data;
uint nb_total = BF_GET (PHY_PBDMA_CONFIG_PB__PB_NB_TOTAL, reg);
- uint nb_ready = BF_GET (PHY_PBDMA_CONFIG_PB__PB_NB_READY, reg);
uint nb_pb_it = BF_GET (PHY_PBDMA_CONFIG_PB__PB_NB_IT, reg);
if (nb_pb_it == 0xff)
nb_pb_it = 0;
- r = snprintf (text, text_size, "nb_total=%u nb_ready=%u nb_pb_it=%u",
- nb_total, nb_ready, nb_pb_it);
+ r = snprintf (text, text_size, "nb_total=%u nb_pb_it=%u",
+ nb_total, nb_pb_it);
if (r >= (int) text_size)
return -1;
return r;
@@ -157,8 +156,7 @@ phy_trace_init (phy_t *ctx)
PHY_TRACE_EVENT (PBDMA_START, "pbdma start bypass_aes=%b %N "
"chandata=%b", TIMESTAMP),
- PHY_TRACE_EVENT (PBDMA_UPDATE, "pbdma update nb_ready=%u "
- "nb_pb_it=%u"),
+ PHY_TRACE_EVENT (PBDMA_UPDATE, "pbdma update nb_pb_it=%u"),
PHY_TRACE_EVENT (PBDMA_START_CHANDATA,
"pbdma start chandata"),
PHY_TRACE_EVENT (PBDMA_CB, "pbdma cb %x", TIMESTAMP),
diff --git a/cesar/hal/phy/test/phy/doc/test_phy.txt b/cesar/hal/phy/test/phy/doc/test_phy.txt
index 86b1252c32..535114340c 100644
--- a/cesar/hal/phy/test/phy/doc/test_phy.txt
+++ b/cesar/hal/phy/test/phy/doc/test_phy.txt
@@ -231,8 +231,6 @@ nek (uint sequence)
Four words of AES key.
pb_nb_total (uint)
Number of PB to transmit.
-pb_nb_ready (uint, default: pb_nb_total)
- Number of ready PB when the frame is programmed.
sound (boolean, default: false)
Use SOUND frame instead of payload.
diff --git a/cesar/hal/phy/test/phy/inc/msg.h b/cesar/hal/phy/test/phy/inc/msg.h
index 243929b06e..bd0094dfab 100644
--- a/cesar/hal/phy/test/phy/inc/msg.h
+++ b/cesar/hal/phy/test/phy/inc/msg.h
@@ -155,9 +155,6 @@ struct test_phy_data_parameters_t
u32 nek[4];
/** Total number of transmitted PB. */
uint pb_nb_total;
- /** Total number of ready transmitted PB (will send null after this
- * number). */
- uint pb_nb_ready;
/** SOUND frame. */
bool sound;
/** PB Pool for RX. */
diff --git a/cesar/hal/phy/test/phy/py/valid/pbdma.2.py b/cesar/hal/phy/test/phy/py/valid/pbdma.2.py
deleted file mode 100644
index fc9d8daa75..0000000000
--- a/cesar/hal/phy/test/phy/py/valid/pbdma.2.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""pbdma.2 - Send a smaller number of PB than planned and generate a NULL
-PB."""
-
-import common
-import test_phy
-from params import chandata, diag_params
-from check import check
-
-t1, t2 = common.begin (test_phy, 2)
-
-for p in diag_params:
- if 'short_ppdu' in p and p['short_ppdu']:
- continue
- for pb_nb_ready in range (1, p['pb_nb_total']):
- params = dict (
- nb_frames = 1,
- pb_nb_ready = pb_nb_ready,
- )
- params.update (p)
- common.step (**params)
- t2.burst_rx (
- timeout_tck = 25 * 1000000,
- chandata = chandata,
- collect_chandata = False,
- **params)
- t1.burst_tx (
- **params)
- stats = t2.burst_stats ()
- print stats
- check (params, stats)
-
-common.end (t1, t2)
diff --git a/cesar/hal/phy/test/phy/src/burst.c b/cesar/hal/phy/test/phy/src/burst.c
index 1a52fa542a..93af81ac57 100644
--- a/cesar/hal/phy/test/phy/src/burst.c
+++ b/cesar/hal/phy/test/phy/src/burst.c
@@ -108,7 +108,6 @@ test_phy_burst_tx_handle (test_phy_t *ctx)
if (d->mod == PHY_MOD_TM)
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);
}
@@ -274,7 +273,7 @@ test_phy_burst_tx (test_phy_t *ctx, test_phy_msg_burst_t *b)
if (b->reply)
phy_rx_param (ctx->phy, d->fc_mode);
/* Program ACCESS. */
- b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_ready, NULL);
+ b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_total, NULL);
b->next_tx_date = phy_date () + 2 * b->anticip_tck;
phy_access_timer_program (ctx->phy, b->next_tx_date - b->anticip_tck);
/* Wait end. */
@@ -369,7 +368,6 @@ test_phy_burst_rx_handle (test_phy_t *ctx, u32 rx_date, const u32 *fc_av)
PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
d->gil, d->symb_nb, d->tcc_halfit);
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,
d->pool_head, b->chandata_blocks, true);
return false;
@@ -714,7 +712,7 @@ test_phy_burst_rx_allocs (test_phy_t *ctx, test_phy_msg_burst_t *b)
b->chandata_blocks = NULL;
/* If comparison is requested, build reference PB. */
if (b->compare_pb)
- b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_ready, NULL);
+ b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_total, NULL);
}
static void
@@ -1093,7 +1091,7 @@ test_phy_burst_csma (test_phy_t *ctx, test_phy_msg_burst_t *b)
b->rx_stop = false;
/* Allocations. */
test_phy_burst_rx_allocs (ctx, b);
- b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_ready, NULL);
+ b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_total, NULL);
/* Prepare callbacks. */
ctx->rx_fc_cb = test_phy_burst_csma_rx_fc_cb;
ctx->access_cb = test_phy_burst_csma_access_cb;
diff --git a/cesar/hal/phy/test/phy/src/data.c b/cesar/hal/phy/test/phy/src/data.c
index 87f9e7d251..35fc2af7b4 100644
--- a/cesar/hal/phy/test/phy/src/data.c
+++ b/cesar/hal/phy/test/phy/src/data.c
@@ -174,8 +174,7 @@ test_phy_data_data_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
PHY_COMBO_PARAMS (d->mod, d->fecrate, d->pb_size),
d->gil, d->symb_nb, d->tcc_halfit);
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);
+ d->pb_nb_total, d->pool_head, NULL, true);
}
return true;
}
@@ -203,7 +202,7 @@ test_phy_data_data_access_conf_cb (void *user)
dbg_assert (ctx->static_msg.id == TEST_PHY_MSG_ID_DATA);
test_phy_data_parameters_t *d = &ctx->static_msg.msg.data.data_parameters;
phy_tx_prepare (ctx->phy);
- phy_pbdma_update (ctx->phy, d->pb_nb_ready, d->pb_nb_total);
+ phy_pbdma_update (ctx->phy, d->pb_nb_total);
return true;
}
@@ -242,10 +241,9 @@ test_phy_data_data (test_t t, test_phy_t *ctx, test_phy_data_parameters_t *d,
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,
- NULL, false);
+ 0, pbs, NULL, false);
uint i;
- for (i = 0; i < d->pb_nb_ready; i++)
+ for (i = 0; i < d->pb_nb_total; i++)
pbs = PARENT_OF (phy_pb_t, blk, pbs->blk.next);
/* Program TX. */
if (d->short_ppdu)
@@ -515,8 +513,6 @@ test_phy_data_fcall_bind_parameters (test_phy_t *ctx, fcall_param_t **param,
}
if (!fcall_param_bind_long_helper (_ ("pb_nb_total"), d->pb_nb_total))
return -1;
- if (!fcall_param_bind_long_helper (_ ("pb_nb_ready"), d->pb_nb_ready))
- d->pb_nb_ready = d->pb_nb_total;
if (!fcall_param_bind_helper (_ ("sound"), d->sound))
d->sound = false;
}
diff --git a/cesar/mac/pbproc/src/fsm_rx_beacon.c b/cesar/mac/pbproc/src/fsm_rx_beacon.c
index a050160980..01eeb1acaa 100644
--- a/cesar/mac/pbproc/src/fsm_rx_beacon.c
+++ b/cesar/mac/pbproc/src/fsm_rx_beacon.c
@@ -65,7 +65,7 @@ pbproc_frbe__handle (pbproc_t *ctx, u32 rx_date,
PHY_MOD_MINI_ROBO, PHY_FEC_RATE_1_2, PHY_PB_SIZE_136),
PHY_GIL_567, symb_nb, tm->tcc_halfit);
/* Program PB DMA. */
- phy_pbdma_start (ctx->phy, true, NULL, 1, 1, 1,
+ phy_pbdma_start (ctx->phy, true, NULL, 1, 1,
&ctx->rx_pool_head->phy_pb, NULL, true);
/* Save received beacon parameters. */
pbproc_rx_beacon_params_t *params = (void *) (ctx->rx_pool_head->data
diff --git a/cesar/mac/pbproc/src/fsm_rx_data.c b/cesar/mac/pbproc/src/fsm_rx_data.c
index 27b466c789..812ac39b51 100644
--- a/cesar/mac/pbproc/src/fsm_rx_data.c
+++ b/cesar/mac/pbproc/src/fsm_rx_data.c
@@ -308,8 +308,7 @@ pbproc_frda__handle (pbproc_t *ctx, u32 rx_date, const pbproc_fc_sof_t *sof)
else
pb_it = pb_nb;
ctx->recv_mpdu.pb_head = pool;
- phy_pbdma_start (ctx->phy, bypass_aes, key, pb_nb, pb_nb, pb_it,
- &pool->phy_pb,
+ phy_pbdma_start (ctx->phy, bypass_aes, key, pb_nb, pb_it, &pool->phy_pb,
&ctx->recv_mpdu.chandata_head->phy_pb.chandata, true);
/* Program VCS. */
pbproc_frda_vcs_restart (ctx);
@@ -348,8 +347,7 @@ pbproc_frda__rx_data_wack__pbdma (pbproc_t *ctx)
PBPROC_SACKD_ANTICIP_PB_NB, false);
/* Program next access using PB DMA after last PB reception. */
uint pb_nb = ctx->recv_mpdu.pb_nb;
- phy_pbdma_update (ctx->phy, pb_nb,
- ctx->recv_mpdu.chandata_nb ? 0 : pb_nb);
+ phy_pbdma_update (ctx->phy, ctx->recv_mpdu.chandata_nb ? 0 : pb_nb);
pbproc_fsm_change_state (ctx, PBPROC_FSM_STATE_RX_DATA_WACK_LAST_PB);
}
diff --git a/cesar/mac/pbproc/src/fsm_tx_data.c b/cesar/mac/pbproc/src/fsm_tx_data.c
index 5a51f35ad7..9f0f75d387 100644
--- a/cesar/mac/pbproc/src/fsm_tx_data.c
+++ b/cesar/mac/pbproc/src/fsm_tx_data.c
@@ -50,8 +50,7 @@ pbproc_ftda__handle (pbproc_t *ctx)
phy_tx_fc10 (ctx->phy, ctx->prep_mpdu.tx_date, ctx->prep_mpdu.fc10);
phy_pbdma_start (ctx->phy, ctx->prep_mpdu.bypass_aes,
ctx->prep_mpdu.nek, ctx->prep_mpdu.pb_nb_total,
- ctx->prep_mpdu.main_seg_nb,
- ctx->prep_mpdu.wack ? 0 : ctx->prep_mpdu.main_seg_nb,
+ ctx->prep_mpdu.wack ? 0 : ctx->prep_mpdu.pb_nb_total,
&ctx->prep_mpdu.head->phy_pb, NULL, false);
if (ctx->prep_mpdu.mod == PHY_MOD_TM)
phy_set_tonemap (ctx->phy, ctx->prep_mpdu.tonemap);
@@ -103,7 +102,6 @@ pbproc_ftda__tx_wait_access_conf__access_conf (pbproc_t *ctx)
if (ctx->prep_mpdu.burst)
{
/* Burst. */
- phy_pbdma_update (ctx->phy, ctx->prep_mpdu.main_seg_nb, 0);
ca_access_program (ctx->ca, ctx->prep_mpdu.tx_date +
ctx->prep_mpdu.flp_tck, PBPROC_ANTICIP_TCK);
pbproc_fsm_change_state (ctx, PBPROC_FSM_STATE_TX_BURST);
@@ -114,7 +112,6 @@ pbproc_ftda__tx_wait_access_conf__access_conf (pbproc_t *ctx)
if (ctx->prep_mpdu.wack)
{
/* With ACK. */
- phy_pbdma_update (ctx->phy, ctx->prep_mpdu.main_seg_nb, 0);
ca_backoff_deferred (ctx->ca,
phy_access_backoff_slot_count (ctx->phy)
- 2);
@@ -130,8 +127,6 @@ pbproc_ftda__tx_wait_access_conf__access_conf (pbproc_t *ctx)
else
{
/* Without ACK. */
- phy_pbdma_update (ctx->phy, ctx->prep_mpdu.main_seg_nb,
- ctx->prep_mpdu.pb_nb_total);
ca_access_hold (ctx->ca);
pbproc_fsm_change_state (ctx, PBPROC_FSM_STATE_TX_WAIT_TX_END);
if (ctx->prep_mpdu.main_mfs->beacon)
diff --git a/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h b/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
index daef6a4787..59169a126c 100644
--- a/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
+++ b/cesar/mac/pbproc/test/pbproc/inc/scenario_defs.h
@@ -230,7 +230,6 @@ typedef struct
{
bool bypass_aes;
uint nb_total;
- uint nb_ready;
uint nb_pb_it;
bool chandata;
bool now;
@@ -238,7 +237,6 @@ typedef struct
typedef struct
{
- uint nb_ready;
uint nb_pb_it;
} scenario_event_phy_pbdma_update_t;
diff --git a/cesar/mac/pbproc/test/pbproc/src/phy.c b/cesar/mac/pbproc/test/pbproc/src/phy.c
index 5132842824..d765667692 100644
--- a/cesar/mac/pbproc/test/pbproc/src/phy.c
+++ b/cesar/mac/pbproc/test/pbproc/src/phy.c
@@ -270,13 +270,12 @@ phy_access_backoff_prp_won (phy_t *ctx)
void
phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
- uint nb_ready, uint nb_pb_it, phy_pb_t *first_pb,
+ uint nb_pb_it, phy_pb_t *first_pb,
phy_chandata_t *first_chandata, bool now)
{
scenario_event (phy_pbdma_start, params);
test_fail_unless (bypass_aes == params->bypass_aes);
test_fail_unless (nb_total == params->nb_total);
- test_fail_unless (nb_ready == params->nb_ready);
test_fail_unless (nb_pb_it == params->nb_pb_it);
test_fail_unless ((first_chandata ? true : false) == params->chandata);
test_fail_unless (now == params->now);
@@ -285,10 +284,9 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes, const u32 nek[4], uint nb_total,
}
void
-phy_pbdma_update (phy_t *ctx, uint nb_ready, uint nb_pb_it)
+phy_pbdma_update (phy_t *ctx, uint nb_pb_it)
{
scenario_event (phy_pbdma_update, params);
- test_fail_unless (nb_ready == params->nb_ready);
test_fail_unless (nb_pb_it == params->nb_pb_it);
}
diff --git a/cesar/mac/pbproc/test/pbproc/src/rx_data.c b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
index 8c8813335c..ae0cf5bb64 100644
--- a/cesar/mac/pbproc/test/pbproc/src/rx_data.c
+++ b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
@@ -231,7 +231,7 @@ rx_data_burst_test_mpdu (test_t t, test_pbproc_t *tp,
? m->real_symb_nb : m->symb_nb,
.tcc_halfit = tm->tcc_halfit),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = !m->encrypted || drop,
- .nb_total = m->pb_nb, .nb_ready = m->pb_nb,
+ .nb_total = m->pb_nb,
.nb_pb_it = m->pb_nb == nb_pb_it && chandata_nb ? 0
: nb_pb_it, .chandata = chandata_nb ? true : false,
.now = true),
@@ -251,7 +251,6 @@ rx_data_burst_test_mpdu (test_t t, test_pbproc_t *tp,
.crc_bitmap = m->crc_error,
.crc_bitmap_bits = nb_pb_it),
SCENARIO_EVENT_COND (m->pb_nb != nb_pb_it, phy_pbdma_update,
- .nb_ready = m->pb_nb,
.nb_pb_it = chandata_nb ? 0 : m->pb_nb),
SCENARIO_ACTION (phy_pbdma, .pb_it = true, .end_rx_pb = true,
.pb_crc_error = pb_crc_error_last,
@@ -479,8 +478,8 @@ rx_beacon_test (test_t t, test_pbproc_t *tp, u32 date, uint symb_nb)
.pb_size = PHY_PB_SIZE_136, .gil = PHY_GIL_567,
.symbol_nb = symb_nb, .tcc_halfit = 1),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true,
- .nb_total = 1, .nb_ready = 1, .nb_pb_it = 1,
- .chandata = false, .now = true),
+ .nb_total = 1, .nb_pb_it = 1, .chandata = false,
+ .now = true),
SCENARIO_ACTION (phy_pbdma, .pb_it = true, .end_rx_pb = true),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date + pre_fc_fl_tck,
diff --git a/cesar/mac/pbproc/test/pbproc/src/tx_data.c b/cesar/mac/pbproc/test/pbproc/src/tx_data.c
index 58fd71ab03..ff924020d0 100644
--- a/cesar/mac/pbproc/test/pbproc/src/tx_data.c
+++ b/cesar/mac/pbproc/test/pbproc/src/tx_data.c
@@ -66,7 +66,6 @@ tx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.sacki_last = 0,
.fccs_av = 0,
};
- const uint initial_pb_nb = MIN (data_seg_nb_total, 4u);
const uint pre_fc_fl_tck = MAC_PREAMBLE_TCK + MAC_FC_AV_TCK
+ MAC_PAYLOAD_TCK (symb_nb, MAC_DX417_TCK) + rifs_tck;
scenario_entry_t entries[] = {
@@ -75,8 +74,7 @@ tx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true,
.nb_total = data_seg_nb_total,
- .nb_ready = initial_pb_nb, .nb_pb_it = 0,
- .chandata = false, .now = false),
+ .nb_pb_it = 0, .chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.mod = tmi < PHY_MOD_ROBO_NB ? tmi : PHY_MOD_TM,
.fecrate = tm->fecrate, .pb_size = PHY_PB_SIZE_520,
@@ -89,8 +87,6 @@ tx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.eifs = true),
SCENARIO_ACTION (phy_access_conf),
SCENARIO_EVENT (phy_tx_prepare),
- SCENARIO_EVENT (phy_pbdma_update, .nb_ready = data_seg_nb_total,
- .nb_pb_it = 0),
SCENARIO_EVENT (ca_backoff_deferred, .slot_count = 0),
SCENARIO_EVENT (ca_access_vcs_restart,
.start_date = date + pre_fc_fl_tck,
@@ -160,7 +156,6 @@ tx_data_woack_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.prp = true,
.cfp = false,
};
- const uint initial_pb_nb = MIN (data_seg_nb_total, 4u);
const uint pre_fc_fl_tck = MAC_PREAMBLE_TCK + MAC_FC_AV_TCK
+ MAC_PAYLOAD_TCK (symb_nb, MAC_DX417_TCK) + MAC_RIFS_DEFAULT_TCK;
scenario_entry_t entries[] = {
@@ -169,7 +164,7 @@ tx_data_woack_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true,
.nb_total = data_seg_nb_total,
- .nb_ready = initial_pb_nb, .nb_pb_it = initial_pb_nb,
+ .nb_pb_it = data_seg_nb_total,
.chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
@@ -182,8 +177,6 @@ tx_data_woack_test (test_t t, test_pbproc_t *tp, u32 date, uint mfs_seg_nb,
.eifs = true),
SCENARIO_ACTION (phy_access_conf),
SCENARIO_EVENT (phy_tx_prepare),
- SCENARIO_EVENT (phy_pbdma_update, .nb_ready = data_seg_nb_total,
- .nb_pb_it = data_seg_nb_total),
SCENARIO_EVENT (ca_access_hold),
SCENARIO_ACTION (phy_pbdma, .pb_it = true, .end_tx_pb = true),
SCENARIO_EVENT (ca_mfs_update, .mfs = mfs),
@@ -301,8 +294,7 @@ tx_data_beacon_test (test_t t, test_pbproc_t *tp, u32 date, uint duration_tck,
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_tx_fc10, .date = date, .fc10 = 0x2f00),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true, .nb_total = 1,
- .nb_ready = 1, .nb_pb_it = 1, .chandata = false,
- .now = false),
+ .nb_pb_it = 1, .chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_HYBRID_1,
.mod = PHY_MOD_MINI_ROBO, .fecrate = PHY_FEC_RATE_1_2,
.pb_size = PHY_PB_SIZE_136, .gil = PHY_GIL_567),
@@ -314,7 +306,6 @@ tx_data_beacon_test (test_t t, test_pbproc_t *tp, u32 date, uint duration_tck,
.eifs = true),
SCENARIO_ACTION (phy_access_conf),
SCENARIO_EVENT (phy_tx_prepare),
- SCENARIO_EVENT (phy_pbdma_update, .nb_ready = 1, .nb_pb_it = 1),
SCENARIO_EVENT (ca_access_hold),
SCENARIO_ACTION (phy_pbdma, .pb_it = true, .end_tx_pb = true),
SCENARIO_EVENT (ca_mfs_update, .mfs = mfs),
@@ -491,8 +482,7 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
.prp_won = true, .slot_count = 6),
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true, .nb_total = 1,
- .nb_ready = 1, .nb_pb_it = 0, .chandata = false,
- .now = false),
+ .nb_pb_it = 0, .chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
.pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
@@ -524,8 +514,7 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
.prp_won = true, .slot_count = 6),
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true, .nb_total = 1,
- .nb_ready = 1, .nb_pb_it = 0, .chandata = false,
- .now = false),
+ .nb_pb_it = 0, .chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
.pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
@@ -540,8 +529,7 @@ tx_data_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
SCENARIO_EVENT (ca_mfs_update, .mfs = mfs),
SCENARIO_EVENT (ca_access_hold),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = true, .nb_total = 1,
- .nb_ready = 1, .nb_pb_it = 0, .chandata = false,
- .now = false),
+ .nb_pb_it = 0, .chandata = false, .now = false),
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.mod = PHY_MOD_ROBO, .fecrate = PHY_FEC_RATE_1_2,
.pb_size = PHY_PB_SIZE_520, .gil = PHY_GIL_417),
diff --git a/cesar/maximus/stationtest/src/main_example.c b/cesar/maximus/stationtest/src/main_example.c
index 447e2e3acf..8a4853bb61 100644
--- a/cesar/maximus/stationtest/src/main_example.c
+++ b/cesar/maximus/stationtest/src/main_example.c
@@ -324,8 +324,7 @@ int prepare_rx (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void
{
nek[i] = i;
}
- phy_pbdma_start(phy, true /* bypass_aes */,
- nek, 1 /* nb_total */, 1 /* nb_ready */,
+ phy_pbdma_start(phy, true /* bypass_aes */, nek, 1 /* nb_total */,
1 /* nb_pb_it */, &first_pb, NULL, true);
/* now make the return parameter list */
diff --git a/cesar/maximus/stationtest/src/test_send.c b/cesar/maximus/stationtest/src/test_send.c
index 269b78185d..70a03398ee 100644
--- a/cesar/maximus/stationtest/src/test_send.c
+++ b/cesar/maximus/stationtest/src/test_send.c
@@ -158,9 +158,9 @@ int prepare_rx (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void
{
nek[i] = i;
}
- phy_pbdma_start(ctx, true /* bypass_aes */,
- nek, (uint)pb_nb /* nb_total */, (uint)pb_nb /* nb_ready */,
- (uint)pb_nb /* nb_pb_it */, &pb[0], NULL, true);
+ phy_pbdma_start(ctx, true /* bypass_aes */, nek,
+ (uint)pb_nb /* nb_total */, (uint)pb_nb /* nb_pb_it */,
+ &pb[0], NULL, true);
// Start chandata
for (i=0; i<chan_length; i++)
diff --git a/cesar/maximus/stationtest/src/test_tx_rx.c b/cesar/maximus/stationtest/src/test_tx_rx.c
index 9295ebb0bc..9abcf09218 100644
--- a/cesar/maximus/stationtest/src/test_tx_rx.c
+++ b/cesar/maximus/stationtest/src/test_tx_rx.c
@@ -73,9 +73,9 @@ void start_pbdma (void)
{
nek[i] = i;
}
- phy_pbdma_start(ctx, true /* bypass_aes */,
- nek, (uint)pb_nb /* nb_total */, (uint)pb_nb /* nb_ready */,
- (uint)pb_nb /* nb_pb_it */, &pb[0], NULL, false);
+ phy_pbdma_start(ctx, true /* bypass_aes */, nek,
+ (uint)pb_nb /* nb_total */, (uint)pb_nb /* nb_pb_it */,
+ &pb[0], NULL, false);
}
@@ -190,7 +190,7 @@ bool phy_pbdma_cb (void *user, u32 status_word)
{
// Start PBDMA
phy_pbdma_start(ctx, ctx->pbdma.bypass_aes,
- ctx->pbdma.nek, (uint)pb_nb /* nb_total */, (uint)pb_nb /* nb_ready */,
+ ctx->pbdma.nek, (uint)pb_nb /* nb_total */,
(uint)pb_nb /* nb_pb_it */, ctx->pbdma.first_pb,
NULL, false);
}
diff --git a/cesar/tools/sniffer_phy/src/lowlevel.c b/cesar/tools/sniffer_phy/src/lowlevel.c
index 4a38e52374..8efbc9bf50 100644
--- a/cesar/tools/sniffer_phy/src/lowlevel.c
+++ b/cesar/tools/sniffer_phy/src/lowlevel.c
@@ -166,8 +166,7 @@ lowlevel_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
rx->pb_head = head;
ctx->lowlevel.rxing = desc;
phy_pbdma_start (ctx->lowlevel.phy, true, NULL, mpdu.pb_nb,
- mpdu.pb_nb, mpdu.pb_nb, &head->phy_pb, NULL,
- true);
+ mpdu.pb_nb, &head->phy_pb, NULL, true);
}
rx->pb_nb = mpdu.pb_nb;
rx->pb_size = mpdu.pb_size;