libosmocore[master]: Add strings with PH primitive names
diff mbox

Message ID gerrit.1464191537381.Id7a6d478fd725c51f54ad746bdf9b9095579ff77@gerrit.osmocom.org
State New
Headers show

Commit Message

gerrit-no-reply@lists.osmocom.org May 25, 2016, 3:52 p.m. UTC
Review at  https://gerrit.osmocom.org/117

Add strings with PH primitive names

It's useful debugging helper while troubleshooting L1-related issues.

Change-Id: Id7a6d478fd725c51f54ad746bdf9b9095579ff77
---
M include/osmocom/gsm/l1sap.h
M src/gsm/lapdm.c
M src/gsm/libosmogsm.map
3 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/117/1

Comments

gerrit-no-reply@lists.osmocom.org May 25, 2016, 7:43 p.m. UTC | #1
Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/117/1/src/gsm/lapdm.c
File src/gsm/lapdm.c:

Line 122: 	{ PRIM_TCH_RTS,		"TCH-RTS" },
Please add the NULL termination here.
gerrit-no-reply@lists.osmocom.org May 26, 2016, 12:05 p.m. UTC | #2
Patch Set 2: Code-Review+1
gerrit-no-reply@lists.osmocom.org May 30, 2016, 7:56 a.m. UTC | #3
Patch Set 2: Code-Review+1

Test, please ignore.
gerrit-no-reply@lists.osmocom.org May 30, 2016, 9:21 p.m. UTC | #4
Patch Set 2: Code-Review+2

Patch
diff mbox

diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h
index 1af8ba8..ad942ea 100644
--- a/include/osmocom/gsm/l1sap.h
+++ b/include/osmocom/gsm/l1sap.h
@@ -14,6 +14,8 @@ 
 	PRIM_TCH_RTS,		/*!< \brief TCH */
 };
 
+extern const struct value_string osmo_ph_prim_names[];
+
 /*! \brief PH-SAP related primitives (L1<->L2 SAP) */
 enum osmo_mph_info_type {
 	PRIM_INFO_TIME,		/*!< \brief Current GSM time */
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index d44335f..36a97f4 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -111,6 +111,17 @@ 
 	LAPDm_FMT_B4,
 };
 
+const struct value_string osmo_ph_prim_names[] = {
+	{ PRIM_PH_DATA,		"PH-DATA" },
+	{ PRIM_PH_RACH,		"PH-RANDOM_ACCESS" },
+	{ PRIM_PH_CONN,		"PH-CONNECT" },
+	{ PRIM_PH_EMPTY_FRAME,	"PH-EMPTY_FRAME" },
+	{ PRIM_PH_RTS,		"PH-RTS" },
+	{ PRIM_MPH_INFO,	"MPH-INFO" },
+	{ PRIM_TCH,		"TCH" },
+	{ PRIM_TCH_RTS,		"TCH-RTS" },
+};
+
 static int lapdm_send_ph_data_req(struct lapd_msg_ctx *lctx, struct msgb *msg);
 static int send_rslms_dlsap(struct osmo_dlsap_prim *dp,
 	struct lapd_msg_ctx *lctx);
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 1e2d323..301f5aa 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -223,6 +223,8 @@ 
 lapdm_phsap_up;
 lapdm_rslms_recvmsg;
 
+osmo_ph_prim_names;
+
 milenage_auts;
 milenage_check;
 milenage_f1;