diff options
author | Tom Tsou <tom.tsou@ettus.com> | 2016-07-01 00:10:31 -0700 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-07-28 06:18:12 +0000 |
commit | dab54b91783d5197e0129de950a705e2da2a4cb9 (patch) | |
tree | 12a5bbac7761cfa734c3cd617cc2be347991eb4a /src/common | |
parent | 9407e644b0246fadec74a45faeedb570a0c04c6b (diff) |
trx: Enable EGPRS handling through burst lengths
Existing interfaces are coded with the implicit expectation of using
a burst sequence length of 148, which is constant with GSM and GPRS.
That changes with EGPRS, where the burst length may be 444 due to
the use of 8-PSK instead of GMSK modulation.
Setup the interface to accept and return a length value with the
burst sequence. This allows 444 length bit vectors to/from the
EGPRS decoder/encoder. Length is explicitly used as a identifier for
8-PSK vs. GMSK modulated sequences.
Change-Id: I90b46b46b11b6ce280e7f8232d5a2fccec2d4f18
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/scheduler.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 507be789..eeaf2c13 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -47,7 +47,7 @@ static int rts_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, static int rts_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, enum trx_chan_type chan); /*! \brief Dummy Burst (TS 05.02 Chapter 5.2.6) */ -static const ubit_t dummy_burst[148] = { +static const ubit_t dummy_burst[GSM_BURST_LEN] = { 0,0,0, 1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,0,0,0,0,0,1,0,1,0,0,1,0,0,1,1,1,0, 0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,0,0, @@ -58,7 +58,7 @@ static const ubit_t dummy_burst[148] = { }; /*! \brief FCCH Burst (TS 05.02 Chapter 5.2.4) */ -const ubit_t _sched_fcch_burst[148] = { +const ubit_t _sched_fcch_burst[GSM_BURST_LEN] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -1504,7 +1504,8 @@ int _sched_rts(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn) } /* process downlink burst */ -const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn) +const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn, + uint32_t fn, uint16_t *nbits) { struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); struct l1sched_chan_state *l1cs; @@ -1529,11 +1530,14 @@ const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn) l1cs = &l1ts->chan_state[chan]; /* check if channel is active */ - if (!trx_chan_desc[chan].auto_active && !l1cs->active) - goto no_data; + if (!trx_chan_desc[chan].auto_active && !l1cs->active) { + if (nbits) + *nbits = GSM_BURST_LEN; + goto no_data; + } /* get burst from function */ - bits = func(l1t, tn, fn, chan, bid); + bits = func(l1t, tn, fn, chan, bid, nbits); /* encrypt */ if (bits && l1cs->dl_encr_algo) { @@ -1562,7 +1566,7 @@ if (0) if (chan != TRXC_IDLE) // hack /* process uplink burst */ int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t current_fn, - sbit_t *bits, int8_t rssi, float toa) + sbit_t *bits, uint16_t nbits, int8_t rssi, float toa) { struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); struct l1sched_chan_state *l1cs; @@ -1623,12 +1627,12 @@ int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t current_fn, } } - func(l1t, tn, fn, chan, bid, bits, rssi, toa); + func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa); } else if (chan != TRXC_RACH && !l1cs->ho_rach_detect) { - sbit_t spare[148]; + sbit_t spare[GSM_BURST_LEN]; - memset(spare, 0, 148); - func(l1t, tn, fn, chan, bid, spare, -128, 0); + memset(spare, 0, GSM_BURST_LEN); + func(l1t, tn, fn, chan, bid, spare, GSM_BURST_LEN, -128, 0); } next_frame: |