[PATCH 1/4] femto: Add L1P_T_INVALID to l1prim_type

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Mon Nov 4 13:56:09 UTC 2013


Currently uninitialized elements of the femtobts_sysprim_type array
are mistaken as L1P_T_REQ (which is accidently the first element and
thus 0).

This patch adds a new element to the enum that has the value 0 to
detect uninitialized elements of the femtobts_sysprim_type array.
Those will then show up in the log as 'SYS Prim XXX is not a
Request!'.

This patch also adds missing definitions of the CalibTbl messages
in the femtobts_sysprim_type mapping so that the requests can still
be identified as such.

Sponsored-by: On-Waves ehf
---
 src/osmo-bts-sysmo/femtobts.c |   10 ++++++++++
 src/osmo-bts-sysmo/femtobts.h |    1 +
 2 files changed, 11 insertions(+)

diff --git a/src/osmo-bts-sysmo/femtobts.c b/src/osmo-bts-sysmo/femtobts.c
index 6bd9ce4..1e513bf 100644
--- a/src/osmo-bts-sysmo/femtobts.c
+++ b/src/osmo-bts-sysmo/femtobts.c
@@ -106,6 +106,16 @@ const enum l1prim_type femtobts_sysprim_type[SuperFemto_PrimId_NUM] = {
 	[SuperFemto_PrimId_RfClockSetupCnf]	= L1P_T_CONF,
 	[SuperFemto_PrimId_Layer1ResetReq]	= L1P_T_REQ,
 	[SuperFemto_PrimId_Layer1ResetCnf]	= L1P_T_CONF,
+#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(2,1,0)
+	[SuperFemto_PrimId_GetTxCalibTblReq]	= L1P_T_REQ,
+	[SuperFemto_PrimId_GetTxCalibTblCnf]	= L1P_T_CONF,
+	[SuperFemto_PrimId_SetTxCalibTblReq]	= L1P_T_REQ,
+	[SuperFemto_PrimId_SetTxCalibTblCnf]	= L1P_T_CONF,
+	[SuperFemto_PrimId_GetRxCalibTblReq]	= L1P_T_REQ,
+	[SuperFemto_PrimId_GetRxCalibTblCnf]	= L1P_T_CONF,
+	[SuperFemto_PrimId_SetRxCalibTblReq]	= L1P_T_REQ,
+	[SuperFemto_PrimId_SetRxCalibTblCnf]	= L1P_T_CONF,
+#endif
 };
 
 const struct value_string femtobts_sysprim_names[SuperFemto_PrimId_NUM+1] = {
diff --git a/src/osmo-bts-sysmo/femtobts.h b/src/osmo-bts-sysmo/femtobts.h
index 7239757..a2b8dea 100644
--- a/src/osmo-bts-sysmo/femtobts.h
+++ b/src/osmo-bts-sysmo/femtobts.h
@@ -44,6 +44,7 @@
 	(OSMO_MAX(sizeof(SuperFemto_Prim_t), sizeof(GsmL1_Prim_t)) + 128)
 
 enum l1prim_type {
+	L1P_T_INVALID, /* this must be 0 to detect uninitialized elements */
 	L1P_T_REQ,
 	L1P_T_CONF,
 	L1P_T_IND,
-- 
1.7.9.5





More information about the OpenBSC mailing list