summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-03-01 19:17:30 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-03-01 19:17:30 +0100
commit4066cfc7f7f5f2848e100937169e2a95dc49e4de (patch)
tree6144efffdd5ac646ce3836d43f2ef3e268ddc152
parenta4a41d27a6d40abe2a9b51cb967e7572f1d672f2 (diff)
Remove filler table from calypso BTS
It is still not required to transmit dummy bursts, synchronization bursts and frequency correction bursts. If they are not provided by the transceiver, they are filled automatically, depending on current slot configuration.
-rw-r--r--src/target/firmware/Makefile1
-rw-r--r--src/target/firmware/apps/trx/trx.c81
-rw-r--r--src/target/firmware/layer1/l23_api.c1
3 files changed, 21 insertions, 62 deletions
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 07dd7a1d..34b17423 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -90,7 +90,6 @@ APPLICATIONS?=hello_world compal_dsp_dump layer1 loader chainload rssi trx
APP_chainload_ENVIRONMENTS=compalram
APP_loader_ENVIRONMENTS=compalram highram
APP_rssi_ENVIRONMENTS=* -compalram
-APP_trx_ENVIRONMENTS=* -compalram
# Various objects that are currently linked into all applications
FLASH_OBJS=flash/cfi_flash.o
diff --git a/src/target/firmware/apps/trx/trx.c b/src/target/firmware/apps/trx/trx.c
index 8e5c89f7..e15da87b 100644
--- a/src/target/firmware/apps/trx/trx.c
+++ b/src/target/firmware/apps/trx/trx.c
@@ -35,54 +35,15 @@
/* Burst queue */
BURST_QUEUE_STATIC(g_bq, 8, 512, static)
-/* Filler table */
-static struct burst_data fill[8][52];
-static uint8_t fill_size[8];
-
/* TRX Helpers **************************************************************/
static void
-trx_init_filler(uint8_t tn, uint8_t type)
+trx_discarded_burst(__unused struct burst_data *burst,
+ __unused int head, uint32_t fn, __unused void *data)
{
- int i;
-
- if ((type >> 1) == 2) {
- for (i=0; i<51; i++) {
- if ((i % 51) == 50)
- fill[tn][i].type = BURST_DUMMY;
- else if (((i % 51) % 10) == 0)
- fill[tn][i].type = BURST_FB;
- else if (((i % 51) % 10) == 1)
- fill[tn][i].type = BURST_SB;
- else
- fill[tn][i].type = BURST_DUMMY;
- }
- fill_size[tn] = 51;
- } else if ((type >> 1) == 3) {
- for (i=0; i<51; i++)
- fill[tn][i].type = BURST_DUMMY;
- fill_size[tn] = 51;
- } else {
- for (i=0; i<52; i++)
- fill[tn][i].type = BURST_DUMMY;
- fill_size[tn] = 52;
- }
-}
-
-static void
-trx_discarded_burst(struct burst_data *burst,
- int head, uint32_t fn, uint8_t tn, __unused void *data)
-{
- /* Only TN=0 */
- if (head)
- return;
-
/* Debug */
printf("STALE BURST %" PRIu32 "\n", fn);
-
- /* Still copy to the filler table */
- memcpy(&fill[tn][fn % fill_size[tn]], burst, sizeof(struct burst_data));
}
@@ -91,15 +52,9 @@ trx_discarded_burst(struct burst_data *burst,
void
trx_init(void)
{
- int i;
-
/* Init burst queue */
bq_reset(&g_bq);
bq_set_discard_fn(&g_bq, trx_discarded_burst, NULL);
-
- /* Init filler table */
- for (i = 0; i < 8; i++)
- trx_init_filler(i, l1s.bts.type[i]);
}
int
@@ -134,19 +89,25 @@ trx_get_burst(uint32_t fn, uint8_t tn, uint8_t *data)
burst = bq_pop_head(&g_bq, tn, fn);
if (burst) {
- /* New burst: Copy to fill table & use it */
- memcpy(&fill[tn][fn % fill_size[tn]], burst,
- sizeof(struct burst_data));
-
- // printf("O %d %d %p\n", fn, g_bq.used, burst);
- } else {
- /* No data, just use the one from fill table */
- burst = &fill[tn][fn % fill_size[tn]];
- }
+ rc = burst->type;
+ if (burst->type == BURST_NB)
+ memcpy(data, burst->data, 15);
- rc = burst->type;
- if (burst->type == BURST_NB)
- memcpy(data, burst->data, 15);
+ return rc;
+ }
- return rc;
+ /* no burst, use dummy on non BCCH */
+ if ((l1s.bts.type[tn] >> 1) != 2)
+ return BURST_DUMMY;
+
+ /* no burst, use dummy,FCCH,SCH on BCCH */
+ fn = fn % 51;
+ if (fn == 50)
+ return BURST_DUMMY;
+ fn = fn % 10;
+ if (fn == 0)
+ return BURST_FB;
+ if (fn == 1)
+ return BURST_SB;
+ return BURST_DUMMY;
}
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index 7b41d4fa..78ae2e44 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -611,7 +611,6 @@ static int l1ctl_bts_mode(struct msgb *msg)
mframe_enable(MF_TASK_BTS);
for (i = 0; i < 8; i++)
l1s.bts.type[i] = bm->type[i];
- trx_init();
l1s.bts.gain = bm->gain;
/* Calculate TX and RX windows by bit masks */