aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
diff options
context:
space:
mode:
authorPhilipp <pmaier@sysmocom.de>2016-11-07 13:07:36 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-01-26 11:19:21 +0100
commitd935d88a8c5dbc3bce5476545a785a7a35cfc2d3 (patch)
treec2ee72eeb88dabe18b043accd74d705fad8a936f /src/bts.cpp
parente9a138e11111f509f988807bbdc5ca8cce2b3d3d (diff)
BTS: accept also relative frame numbers with rach requst
The rach request contains a relative frame number (Fn % 42432), while BTS::rcv_rach() accepts the full frame number only. Since the BTS is always aware of the full frame number this is not a problem. But for BSC co-located PCU schemes it is a problem since the rach request only contains the relative frame number as mentioned above. The pcu continusly receives frame number updates with the GSM time indication message. It is simple to re-calculate the full frame number from that information. This patch makes BTS::rcv_rach() compatible with relative frame numbers, while not breaking the compatibility for full frame numbers Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775
Diffstat (limited to 'src/bts.cpp')
-rw-r--r--src/bts.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 25cbc60f..e1c6dccf 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -536,6 +536,21 @@ int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
if (is_11bit)
rach_frame_11bit();
+ /* Note: If a BTS is sending in a rach request it will be fully aware
+ * of the frame number. If the PCU is used in a BSC-co-located setup.
+ * The BSC will forward the incoming RACH request. The RACH request
+ * only contains the relative frame number (Fn % 42432) in its request
+ * reference. This PCU implementation has to fit both secenarious, so
+ * we need to assume that Fn is a relative frame number. */
+
+ /* Ensure that all following calculations are performed with the
+ * relative frame number */
+ Fn = Fn % 42432;
+
+ /* Restore the full frame number
+ * (See also 3GPP TS 44.018, section 10.5.2.38) */
+ Fn = Fn + m_cur_fn - m_cur_fn % 42432;
+
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, "
"so we provide one \n"
"ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit);