summaryrefslogtreecommitdiffstats
path: root/src/target
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-12-11 16:25:33 +0100
committerHarald Welte <laforge@gnumonks.org>2019-05-23 13:03:42 +0200
commit854e526de205de1493770b91c27e4d00a65a6173 (patch)
treeda7f5be0f0181af1df8058de790a994d88608f9b /src/target
parent4fa1e68ebcf4dd3ac874f8ed1bbbea096e29a6fc (diff)
[WIP] HO: Transmit access bursts on DCCH of TCH channels
Diffstat (limited to 'src/target')
-rw-r--r--src/target/firmware/layer1/prim_rach.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/target/firmware/layer1/prim_rach.c b/src/target/firmware/layer1/prim_rach.c
index eeb0435f..d7f7c148 100644
--- a/src/target/firmware/layer1/prim_rach.c
+++ b/src/target/firmware/layer1/prim_rach.c
@@ -131,7 +131,7 @@ static uint8_t rach_to_t3_comb[27] = {
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
45, 46};
-/* request a RACH request at the next multiframe T3 = fn51 */
+/* schedule access burst */
void l1a_rach_req(uint16_t offset, uint8_t combined, uint8_t ra)
{
uint32_t fn_sched;
@@ -144,7 +144,19 @@ void l1a_rach_req(uint16_t offset, uint8_t combined, uint8_t ra)
}
local_firq_save(flags);
- if (combined) {
+ if (l1s.dedicated.type == GSM_DCHAN_TCH_F) {
+ fn_sched = l1s.current_time.fn + offset;
+ /* go next DCCH frame TCH/F channel */
+ if ((fn_sched % 13) == 12)
+ fn_sched++;
+ } else if (l1s.dedicated.type == GSM_DCHAN_TCH_H) {
+ fn_sched = l1s.current_time.fn + offset;
+ /* go next DCCH frame of TCH/H channel */
+ if ((fn_sched % 13) == 12)
+ fn_sched++;
+ if ((l1s.dedicated.chan_nr & 1) != ((fn_sched % 13) & 1))
+ fn_sched++;
+ } else if (combined) {
/* add elapsed RACH slots to offset */
offset += t3_to_rach_comb[l1s.current_time.t3];
/* offset is the number of RACH slots in the future */
@@ -154,6 +166,7 @@ void l1a_rach_req(uint16_t offset, uint8_t combined, uint8_t ra)
} else
fn_sched = l1s.current_time.fn + offset;
l1s.rach.ra = ra;
+ fn_sched %= 2715648;
sched_gsmtime(rach_sched_set_ul, fn_sched, 0);
local_irq_restore(flags);