From patchwork Thu Mar 24 10:54:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max X-Patchwork-Id: 601539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3qW3Hs5kGyz9sCy for ; Thu, 24 Mar 2016 21:55:37 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id E80AB1CA77; Thu, 24 Mar 2016 10:55:32 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from mail.sysmocom.de (mail.sysmocom.de [IPv6:2a01:4f8:191:444c::2:4]) by lists.osmocom.org (Postfix) with ESMTP id 030AC1CA68 for ; Thu, 24 Mar 2016 10:55:31 +0000 (UTC) Received: from mail.sysmocom.de (mail.sysmocom.de [144.76.43.93]) by mail.sysmocom.de (Postfix) with ESMTP id 3327318CDD8; Thu, 24 Mar 2016 10:55:01 +0000 (UTC) Received: from pbell.local (ip5b418565.dynamic.kabel-deutschland.de [91.65.133.101]) by mail.sysmocom.de (Postfix) with ESMTPSA id E79FD18CDD7; Thu, 24 Mar 2016 10:55:00 +0000 (UTC) From: msuraev@sysmocom.de To: openbsc@lists.osmocom.org Subject: [PATCH] Export names for gsm_chan_t and gsm48_chan_mode Date: Thu, 24 Mar 2016 11:54:59 +0100 Message-Id: <1458816899-30771-1-git-send-email-msuraev@sysmocom.de> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From: Max This can be used with get_value_string() to improve debugging output. --- include/osmocom/gsm/gsm_utils.h | 13 +++++++++++++ include/osmocom/gsm/protocol/gsm_04_08.h | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 6458447..dcbee36 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -28,6 +28,7 @@ #include #include +#include #define ADD_MODULO(sum, delta, modulo) do { \ if ((sum += delta) >= modulo) \ @@ -199,6 +200,18 @@ enum gsm_chan_t { _GSM_LCHAN_MAX }; +static const struct value_string gsm_chan_t_names[] = { + { GSM_LCHAN_NONE, "NONE" }, + { GSM_LCHAN_SDCCH, "SDCCH" }, + { GSM_LCHAN_TCH_F, "TCH_F" }, + { GSM_LCHAN_TCH_H, "TCH_H" }, + { GSM_LCHAN_UNKNOWN, "UNKNOWN" }, + { GSM_LCHAN_CCCH, "CCCH" }, + { GSM_LCHAN_PDTCH, "PDTCH" }, + { GSM_LCHAN_CBCH, "CBCH" }, + { 0, NULL }, +}; + /* Deprectated functions */ /* Limit encoding and decoding to use no more than this amount of buffer bytes */ #define GSM_7BIT_LEGACY_MAX_BUFFER_SIZE 0x10000 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index d49b77f..604c86d 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -2,6 +2,8 @@ #include +#include + /* GSM TS 04.08 definitions */ struct gsm_lchan; @@ -347,6 +349,18 @@ enum gsm48_chan_mode { GSM48_CMODE_DATA_3k6 = 0x13, }; +static const struct value_string gsm48_chan_mode_names[] = { + { GSM48_CMODE_SIGN, "SIGNALLING" }, + { GSM48_CMODE_SPEECH_V1, "SPEECH_V1" }, + { GSM48_CMODE_SPEECH_EFR, "SPEECH_EFR" }, + { GSM48_CMODE_SPEECH_AMR, "SPEECH_AMR" }, + { GSM48_CMODE_DATA_14k5, "DATA_14k5" }, + { GSM48_CMODE_DATA_12k0, "DATA_12k0" }, + { GSM48_CMODE_DATA_6k0, "DATA_6k0" }, + { GSM48_CMODE_DATA_3k6, "DATA_3k6" }, + { 0, NULL }, +}; + /* Chapter 9.1.2 */ struct gsm48_ass_cmd { /* Semantic is from 10.5.2.5a */