path: root/src/bts.h
diff options
authorPhilipp Maier <pmaier@sysmocom.de>2017-02-21 19:35:23 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-05 12:23:56 +0000
commit1275a3f91a744e011b0dba82b09124d249c7abb5 (patch)
tree9426c2f0b7af9724b21ba086cbbc529a5e29c1e1 /src/bts.h
parenta01e2ee177d42bdbeaea00f28bcdd65bc27f96e2 (diff)
BTS: Convert relative frame numbers to absolute frame numbers
The implementation of the method rcv_rach() in class BTS, restores the absolute frame number of the incoming RACH-Request by using the relative frame number (RFn = Fn mod 42432) from the rach request and the already known internal absolute frame number m_cur_fn, which is continusly updated by the CCU interface. In some rare cases, a RACH request might be received by the BTS, a very short time before the frame number wraps in its 42432. Depending on the PCU location, RACH request might be received by the BSC, which forwards it to the PCU. It is then likely that, while the RACH request is being forwarded to the PCU, the PCU internal absolute frame number wraps before the RACH can be processed. The relative frame number from the rach request would then be interpreted as if it were received after the wrapping of the internal frame number modulos. This commit adds logic to detect and resolve this race condition. Also a unit test is added to check some cornercases. Change-Id: I74f00c11e5739d49f370ce6c357149e81d9aa759
Diffstat (limited to 'src/bts.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bts.h b/src/bts.h
index 2932154..5d8dc59 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -349,6 +349,8 @@ public:
int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn);
uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type,
uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority);
+ uint32_t rfn_to_fn(uint32_t rfn);
int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
enum ph_burst_type burst_type);