summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2010-02-23 12:53:25 +0000
committerlaranjeiro2010-02-23 12:53:25 +0000
commitc04c9cabfda635a739a001ec772ee40e4bbfc59b (patch)
tree07214e635861a432a88488b52923e344d39c0640 /cesar
parenta86137fd8eb01d4843fe466632c153e788220047 (diff)
cesar/mac/sar: initialise job_tx with DMA address, closes #1289
Remove the static allocation in the SAR context and add it statically in sar_init. SAR context only keep a pointer to the job data (not the sar_mfs_t object). git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6759 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/mac/sar/inc/sar_context.h4
-rw-r--r--cesar/mac/sar/src/sar.c21
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/activate.c2
3 files changed, 14 insertions, 13 deletions
diff --git a/cesar/mac/sar/inc/sar_context.h b/cesar/mac/sar/inc/sar_context.h
index c8f42f83fb..83c342f385 100644
--- a/cesar/mac/sar/inc/sar_context.h
+++ b/cesar/mac/sar/inc/sar_context.h
@@ -146,8 +146,8 @@ struct sar_t
/** Missing PBs number to allocate for the PB Pool. */
uint pbs_missing_for_pbproc;
- /** TX static job descriptor definition. */
- sar_job_mfs_t job_tx;
+ /** DMA pointer to TX static SAR job descriptor . */
+ sar_job_mfs_t *job_tx;
/** ****************** Layers context ***************/
diff --git a/cesar/mac/sar/src/sar.c b/cesar/mac/sar/src/sar.c
index ac902084ec..ce3b578b5b 100644
--- a/cesar/mac/sar/src/sar.c
+++ b/cesar/mac/sar/src/sar.c
@@ -428,7 +428,9 @@ sar_init (mac_store_t *mac_store, pbproc_t *pbproc, ca_t *ca, u32 seed)
cyg_thread_resume (ctx->thread_handle);
#endif
/* Initialise the TX static job. */
- sar_job_mfs_fill (&sar_global.job_tx, true);
+ static sar_job_mfs_t job_tx;
+ sar_global.job_tx = ARCH_CPU_TO_DMA (&job_tx);
+ sar_job_mfs_fill (&job_tx, true);
return &sar_global;
}
@@ -1693,20 +1695,19 @@ sar_tx_mac_framing (sar_t *ctx, sar_msdu_t *md_data)
dbg_claim ((md_data->length >= ETH_PACKET_MIN_SIZE_ALLOWED)
&& (md_data->length <= ETH_PACKET_MAX_SIZE));
/* initialise the job descriptor. */
- ctx->job_tx.mfs = (mfs_t *) md_data->mfs;
- ctx->job_tx.user_data = md_data->user_data;
- ctx->job_tx.job.first_pb_desc = NULL;
+ ctx->job_tx->mfs = (mfs_t *) md_data->mfs;
+ ctx->job_tx->user_data = md_data->user_data;
+ ctx->job_tx->job.first_pb_desc = NULL;
/* Take the last PB from the MFS if possible. */
- sar_tx_mac_framing__take_last_pb (ctx, md_data, &ctx->job_tx);
+ sar_tx_mac_framing__take_last_pb (ctx, md_data, ctx->job_tx);
/* Create the job for the Bridge DMA
* Fill the job and create allocate the PBs necessary to stock the MF
* contained in the md_data
*/
- ctx->job_tx.tail = sar_tx_job_desc_create (ctx, md_data, md_data->mfs,
- &ctx->job_tx);
- /* Convert address for the bridgedma. */
- phy_bridgedma_job_t *brg_job = ARCH_CPU_TO_UNCACHEABLE (&ctx->job_tx.job);
- phy_bridgedma_start (ctx->bridgedma_ctx, brg_job, brg_job);
+ ctx->job_tx->tail = sar_tx_job_desc_create (ctx, md_data, md_data->mfs,
+ ctx->job_tx);
+ phy_bridgedma_start (ctx->bridgedma_ctx, &ctx->job_tx->job,
+ &ctx->job_tx->job);
}
pb_t * ARCH_ILRAM
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/activate.c b/cesar/mac/sar/test/unit_test/ecos/src/activate.c
index 50d7ae758a..c0a66eadd0 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/activate.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/activate.c
@@ -57,7 +57,7 @@ test_case__sar_activate (test_t test)
if (i < 1)
{
pb_t *last;
- jobs[i] = &t.sar->job_tx;
+ jobs[i] = PARENT_OF (sar_job_mfs_t, job, t.sar->job_tx);
sar_job_mfs_fill (jobs[i], true);
/* Get the MFS. */
jobs[i]->mfs = (mfs_t *) mac_store_mfs_add_tx (t.mac_store,