summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilenko Jelisavcic2010-09-01 16:16:16 +0200
committerMilenko Jelisavcic2010-09-06 11:15:27 +0200
commitd56e1977cb09bea9de625426e8759aa56d97ff87 (patch)
treea6de2acc3652f6eae1c9d6a0df8b8dc0616930db
parentb0c71f371f875b7fa4c16452d1948f4b0f3d8dcd (diff)
cesar/mac/pbproc: add a parameter to fetch channel data on data, closes #1715
Disable channel data on data in CE. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7271 017c9cb6-072f-447c-8318-d5b54f68fe89 Conflicts: cesar/mac/pbproc/inc/context.h cesar/mac/pbproc/src/fsm_rx_data.c
-rw-r--r--cesar/ce/rx/src/measure.c2
-rw-r--r--cesar/ce/rx/test/src/pbproc_stub.c4
-rw-r--r--cesar/mac/pbproc/inc/context.h2
-rw-r--r--cesar/mac/pbproc/pbproc.h4
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_data.c2
-rw-r--r--cesar/mac/pbproc/src/pbproc.c5
-rw-r--r--cesar/mac/pbproc/test/int/src/test_pbproc.c4
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c4
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/rx_data.c4
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/rx_sound.c8
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/tx_sound.c8
11 files changed, 28 insertions, 19 deletions
diff --git a/cesar/ce/rx/src/measure.c b/cesar/ce/rx/src/measure.c
index 485b0f0bde..b6f973d0ca 100644
--- a/cesar/ce/rx/src/measure.c
+++ b/cesar/ce/rx/src/measure.c
@@ -129,7 +129,7 @@ ce_rx_measure_init (ce_rx_t *ce_rx, sar_t *sar, pbproc_t *pbproc)
}
conf[CE_RX_MEASURE_CONF_SIZE - 1].last = 1;
/* Send it to the PBProc. */
- pbproc_set_chandata_conf (pbproc, conf, CE_RX_MEASURE_CONF_SIZE);
+ pbproc_set_chandata_conf (pbproc, conf, CE_RX_MEASURE_CONF_SIZE, false);
}
void
diff --git a/cesar/ce/rx/test/src/pbproc_stub.c b/cesar/ce/rx/test/src/pbproc_stub.c
index 6bebd2e9fe..7a15c7aa81 100644
--- a/cesar/ce/rx/test/src/pbproc_stub.c
+++ b/cesar/ce/rx/test/src/pbproc_stub.c
@@ -16,10 +16,12 @@
#include "lib/test.h"
void
-pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb)
+pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb,
+ bool data)
{
test_t *t = (test_t *) ctx;
dbg_assert (t);
+ dbg_assert (!data);
/* We need to check if we ask for the channel data (the NSR). */
test_begin (*t, "correct configuration of the PBProc for channel data")
{
diff --git a/cesar/mac/pbproc/inc/context.h b/cesar/mac/pbproc/inc/context.h
index 74185a0cc0..4bd5b37663 100644
--- a/cesar/mac/pbproc/inc/context.h
+++ b/cesar/mac/pbproc/inc/context.h
@@ -289,6 +289,8 @@ struct pbproc_t
/** True if station is polled from CCO in current beacon period */
bool polled;
#endif
+ /** Whether channel data should be collected for data MPDU. */
+ bool chandata_data;
};
/* Forward declaration in mac/pbproc/pbproc.h. */
diff --git a/cesar/mac/pbproc/pbproc.h b/cesar/mac/pbproc/pbproc.h
index c69f9fe61b..6c5b2071b6 100644
--- a/cesar/mac/pbproc/pbproc.h
+++ b/cesar/mac/pbproc/pbproc.h
@@ -237,13 +237,15 @@ pbproc_rx_segment_refill (pbproc_t *ctx, pb_t *first, pb_t *last,
* \param ctx pbproc context
* \param conf table of channel data configuration
* \param nb number of channel data configuration handled
+ * \param data collect channel data for data MPDU
*
* Configuration table will be copied to pbproc context. On each reception, a
* block is used for each given configuration to fetch channel data from
* hardware.
*/
void
-pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb);
+pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb,
+ bool data);
/**
* Set the coefficients of SPOC in SPOC registers when possible.
diff --git a/cesar/mac/pbproc/src/fsm_rx_data.c b/cesar/mac/pbproc/src/fsm_rx_data.c
index 324f569ed7..8c963ffa84 100644
--- a/cesar/mac/pbproc/src/fsm_rx_data.c
+++ b/cesar/mac/pbproc/src/fsm_rx_data.c
@@ -426,7 +426,7 @@ pbproc_frda__handle (pbproc_t *ctx, u32 rx_date, const pbproc_fc_t *fc_av)
ctx->recv_mpdu.rx_desc = (pbproc_rx_desc_t *) pool;
pool = pool->next;
/* Prepare channel data blocks and give them to PB DMA. */
- if (ctx->chandata_nb && nek_ok && !unassociated && pb_nb)
+ if (ctx->chandata_data && ctx->chandata_nb && nek_ok && !unassociated && pb_nb)
{
uint i;
/* Take from RX pool. */
diff --git a/cesar/mac/pbproc/src/pbproc.c b/cesar/mac/pbproc/src/pbproc.c
index 21329cba86..b73e14a80d 100644
--- a/cesar/mac/pbproc/src/pbproc.c
+++ b/cesar/mac/pbproc/src/pbproc.c
@@ -225,6 +225,7 @@ pbproc_init (mac_config_t *config, mac_store_t *store)
slist_init (ctx->rx_pool_, paste_size);
/* Channel data. */
ctx->chandata_nb = 0;
+ ctx->chandata_data = false;
/* Initialise FSM. */
pbproc_fsm_init (ctx, pbproc_deferred);
pbproc_ftop_init (ctx);
@@ -355,7 +356,8 @@ pbproc_rx_segment_refill (pbproc_t *ctx, pb_t *first, pb_t *last, uint nb)
}
void
-pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb)
+pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb,
+ bool data)
{
uint i;
dbg_assert (ctx);
@@ -368,6 +370,7 @@ pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb)
ctx->chandata_conf[i] = conf[i];
arch_reorder_barrier ();
ctx->chandata_nb = nb;
+ ctx->chandata_data = data;
}
void
diff --git a/cesar/mac/pbproc/test/int/src/test_pbproc.c b/cesar/mac/pbproc/test/int/src/test_pbproc.c
index ca93d80a54..3a3eaad831 100644
--- a/cesar/mac/pbproc/test/int/src/test_pbproc.c
+++ b/cesar/mac/pbproc/test/int/src/test_pbproc.c
@@ -201,10 +201,10 @@ test_pbproc_set_config_fcall (fcall_ctx_t *fcall, fcall_param_t **param,
}
conf[TEST_PBPROC_CHANDATA_CONF_SIZE - 1].last = 1;
pbproc_set_chandata_conf (ctx->pbproc, conf,
- TEST_PBPROC_CHANDATA_CONF_SIZE);
+ TEST_PBPROC_CHANDATA_CONF_SIZE, true);
}
else
- pbproc_set_chandata_conf (ctx->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (ctx->pbproc, NULL, 0, false);
/* Return. */
fcall_param_reset (*param);
return 0;
diff --git a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
index 9b5aa3409c..17a358db3d 100644
--- a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
@@ -109,7 +109,7 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
/* Ask for channel data to enable sound transmission. */
u32 chandata_conf[1] = { 0 };
pbproc_set_chandata_conf (
- tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1);
+ tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1, false);
/* Prepare tone map. */
tonemap_t *tm = &tp->config.tonemask_info.tonemap_robo[PHY_MOD_ROBO];
uint dx = MAC_DX417_TCK;
@@ -419,7 +419,7 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
utils_mfs_tx_cleanup (mfs);
if (params->tmi != PHY_MOD_ROBO || (params->encrypted && !params->bcast))
dbg_check (mac_store_sta_remove (tp->store, dtei));
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
tp->pbproc->detect.hp10_detected = false;
tp->pbproc->detect.hp11_detected = false;
tp->config.authenticated = false;
diff --git a/cesar/mac/pbproc/test/pbproc/src/rx_data.c b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
index 463b505597..806d5e94a2 100644
--- a/cesar/mac/pbproc/test/pbproc/src/rx_data.c
+++ b/cesar/mac/pbproc/test/pbproc/src/rx_data.c
@@ -369,7 +369,7 @@ rx_data_burst_test_f (test_t t, test_pbproc_t *tp,
chandata_conf[i] = i;
pbproc_set_chandata_conf (tp->pbproc,
(phy_chandata_conf_t *) chandata_conf,
- burst->chandata_nb);
+ burst->chandata_nb, true);
}
/* Allocate PB pool. */
blk_t *first, *last;
@@ -429,7 +429,7 @@ rx_data_burst_test_f (test_t t, test_pbproc_t *tp,
blk_release (mfs);
}
if (burst->chandata_nb)
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
}
void
diff --git a/cesar/mac/pbproc/test/pbproc/src/rx_sound.c b/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
index 1edc045744..bc1d0fb0ab 100644
--- a/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
+++ b/cesar/mac/pbproc/test/pbproc/src/rx_sound.c
@@ -45,7 +45,7 @@ rx_sound_test (test_t t, test_pbproc_t *tp, u32 date, uint chandata_nb,
chandata_conf[i] = i;
pbproc_set_chandata_conf (tp->pbproc,
(phy_chandata_conf_t *) chandata_conf,
- chandata_nb);
+ chandata_nb, false);
if (pool_pb_nb >= chandata_nb)
chandata = true;
}
@@ -179,7 +179,7 @@ rx_sound_test (test_t t, test_pbproc_t *tp, u32 date, uint chandata_nb,
slist_init (tp->pbproc->rx_pool_, paste_size);
}
if (chandata_nb)
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
}
void
@@ -248,7 +248,7 @@ rx_sound_nfu_test (test_t t, test_pbproc_t *tp, u32 date, rx_sound_nfu_t nfu)
chandata_conf[i] = i;
pbproc_set_chandata_conf (tp->pbproc,
(phy_chandata_conf_t *) chandata_conf,
- chandata_nb);
+ chandata_nb, false);
/* Compute frame size. */
tonemap_t *tm = &tp->config.tonemask_info.tonemap_robo[PHY_MOD_ROBO];
uint symb_nb = (1 * tm->bits_per_pb[PHY_PB_SIZE_520]
@@ -319,7 +319,7 @@ rx_sound_nfu_test (test_t t, test_pbproc_t *tp, u32 date, rx_sound_nfu_t nfu)
test_fail_unless (tp->pbproc->rx_pool_size == (nfu != NFU_POOL_SHORTAGE
? 4 : 3));
tp->pbproc->rx_pool_size = 0;
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
}
void
diff --git a/cesar/mac/pbproc/test/pbproc/src/tx_sound.c b/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
index 8ad225c606..17645008c7 100644
--- a/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
+++ b/cesar/mac/pbproc/test/pbproc/src/tx_sound.c
@@ -34,7 +34,7 @@ tx_sound_test (test_t t, test_pbproc_t *tp)
+ MAC_RIFS_DEFAULT_TCK + MAC_PREAMBLE_TCK + MAC_FC_AV_TCK;
u32 chandata_conf[1] = { 0 };
pbproc_set_chandata_conf (
- tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1);
+ tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1, false);
mfs_tx_t *mfs = utils_mfs_tx_prepare (false, false, lid, dtei, 1);
utils_sta_prepare_default_tonemap (tp, true, dtei,
TONEMAP_INDEX_INITIAL_START, 0, 0,
@@ -113,7 +113,7 @@ tx_sound_test (test_t t, test_pbproc_t *tp)
utils_mfs_tx_cleanup (mfs);
dbg_check (mac_store_sta_remove (tp->store, dtei));
test_fail_unless (tp->pbproc->fsm.current_state == PBPROC_FSM_STATE_IDLE);
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
}
void
@@ -140,7 +140,7 @@ tx_sound_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
const uint symb_nb = 19;
u32 chandata_conf[1] = { 0 };
pbproc_set_chandata_conf (
- tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1);
+ tp->pbproc, (phy_chandata_conf_t *) chandata_conf, 1, false);
mfs_tx_t *mfs = utils_mfs_tx_prepare (false, false, lid, dtei, 1);
utils_sta_prepare_default_tonemap (tp, true, dtei,
TONEMAP_INDEX_INITIAL_START, 0, 0,
@@ -293,7 +293,7 @@ tx_sound_cancel_test (test_t t, test_pbproc_t *tp, bool prp_won, bool rx_fc)
utils_mfs_tx_cleanup (mfs);
dbg_check (mac_store_sta_remove (tp->store, dtei));
test_fail_unless (tp->pbproc->fsm.current_state == PBPROC_FSM_STATE_IDLE);
- pbproc_set_chandata_conf (tp->pbproc, NULL, 0);
+ pbproc_set_chandata_conf (tp->pbproc, NULL, 0, false);
}
void