aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-09 09:17:14 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-09 09:42:56 +0200
commit88d60a1f86b083d6154c299aceceab44595f34d7 (patch)
tree1cdb8001181bda01e9627f736a94d436636aec53 /src/osmo-bts-sysmo/l1_if.c
parent2cc37035d73191b71b9ba9c0d559a0da6a5f35e5 (diff)
sysmobts: Add a unit test that checks of the behavior
We need to build a lot more code to be able to test these two new routines. I didn't want to move the code to a utils file as the check is called from a hot path. Add accessors to the inlined variant to be used by the unit test. While writing the unit tests I noticed that a re-transmission of the ciphering command would lead to an attempt to enable ciphering again. I am not sure that this MphConfig is idempotent.
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 90d3f426..16e2bc60 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -395,6 +395,20 @@ static inline void check_for_first_ciphrd(struct femtol1_hdl *fl1h,
l1if_set_ciphering(fl1h, lchan, 1);
}
+/* public helpers for the test */
+int bts_check_for_ciph_cmd(struct femtol1_hdl *fl1h,
+ struct msgb *msg, struct gsm_lchan *lchan)
+{
+ return check_for_ciph_cmd(fl1h, msg, lchan);
+}
+
+void bts_check_for_first_ciphrd(struct femtol1_hdl *fl1h,
+ GsmL1_MsgUnitParam_t *msgUnitParam,
+ struct gsm_lchan *lchan)
+{
+ return check_for_first_ciphrd(fl1h, msgUnitParam, lchan);
+}
+
static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,