aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c14
-rw-r--r--src/osmo-bts-sysmo/l1_if.h8
2 files changed, 22 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,
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 1168aeaf..77144931 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -7,6 +7,8 @@
#include <osmocom/core/timer.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <sysmocom/femtobts/gsml1prim.h>
+
enum {
MQ_SYS_READ,
MQ_L1_READ,
@@ -124,4 +126,10 @@ int calib_load(struct femtol1_hdl *fl1h);
int l1if_rf_clock_info_reset(struct femtol1_hdl *fl1h);
int l1if_rf_clock_info_correct(struct femtol1_hdl *fl1h);
+/* public helpers for test */
+int bts_check_for_ciph_cmd(struct femtol1_hdl *fl1h,
+ struct msgb *msg, struct gsm_lchan *lchan);
+void bts_check_for_first_ciphrd(struct femtol1_hdl *fl1h,
+ GsmL1_MsgUnitParam_t *msgUnitParam,
+ struct gsm_lchan *lchan);
#endif /* _FEMTO_L1_H */