fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34917?usp=email )

Change subject: mobile: rename voice.[ch] to tch.[ch]
......................................................................

mobile: rename voice.[ch] to tch.[ch]

Also take a chance to change the 'tch_' prefix for all functions.

Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/mobile/Makefile.am
A src/host/layer23/include/osmocom/bb/mobile/tch.h
D src/host/layer23/include/osmocom/bb/mobile/voice.h
M src/host/layer23/src/mobile/Makefile.am
M src/host/layer23/src/mobile/app_mobile.c
M src/host/layer23/src/mobile/gapk_io.c
M src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
M src/host/layer23/src/mobile/gsm48_cc.c
R src/host/layer23/src/mobile/tch.c
9 files changed, 43 insertions(+), 31 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am 
b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index 534b865..5d2eeaf 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,4 +1,4 @@
 noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
                 gsm48_rr.h mncc.h gsm44068_gcc_bcc.h \
-                transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h \
-                app_mobile.h voice.h gapk_io.h
+                tch.h transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h \
+                app_mobile.h gapk_io.h
diff --git a/src/host/layer23/include/osmocom/bb/mobile/tch.h 
b/src/host/layer23/include/osmocom/bb/mobile/tch.h
new file mode 100644
index 0000000..0e81769
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/mobile/tch.h
@@ -0,0 +1,9 @@
+#pragma once
+
+struct osmocom_ms;
+struct gsm_data_frame;
+struct msgb;
+
+int tch_init(struct osmocom_ms *ms);
+int tch_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg);
+int tch_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame);
diff --git a/src/host/layer23/include/osmocom/bb/mobile/voice.h 
b/src/host/layer23/include/osmocom/bb/mobile/voice.h
deleted file mode 100644
index 8c4c5b6..0000000
--- a/src/host/layer23/include/osmocom/bb/mobile/voice.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-struct osmocom_ms;
-struct gsm_data_frame;
-struct msgb;
-
-int gsm_voice_init(struct osmocom_ms *ms);
-int gsm_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg);
-int gsm_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame);
diff --git a/src/host/layer23/src/mobile/Makefile.am 
b/src/host/layer23/src/mobile/Makefile.am
index 7b05f65..ed2146f 100644
--- a/src/host/layer23/src/mobile/Makefile.am
+++ b/src/host/layer23/src/mobile/Makefile.am
@@ -30,9 +30,9 @@
        mnccms.c \
        mncc_sock.c \
        primitives.c \
+       tch.c \
        transaction.c \
        vty_interface.c \
-       voice.c \
        $(NULL)

 bin_PROGRAMS = mobile
diff --git a/src/host/layer23/src/mobile/app_mobile.c 
b/src/host/layer23/src/mobile/app_mobile.c
index b08976c..cada8fc 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -41,7 +41,7 @@
 #include <osmocom/bb/mobile/vty.h>
 #include <osmocom/bb/mobile/app_mobile.h>
 #include <osmocom/bb/mobile/mncc.h>
-#include <osmocom/bb/mobile/voice.h>
+#include <osmocom/bb/mobile/tch.h>
 #include <osmocom/bb/mobile/gapk_io.h>
 #include <osmocom/bb/mobile/primitives.h>

@@ -256,7 +256,7 @@
        gsm480_ss_init(ms);
        gsm411_sms_init(ms);
        gsm44068_gcc_init(ms);
-       gsm_voice_init(ms);
+       tch_init(ms);
        gsm_subscr_init(ms);
        gsm48_rr_init(ms);
        gsm48_mm_init(ms);
diff --git a/src/host/layer23/src/mobile/gapk_io.c 
b/src/host/layer23/src/mobile/gapk_io.c
index 997ed8a..966d0f4 100644
--- a/src/host/layer23/src/mobile/gapk_io.c
+++ b/src/host/layer23/src/mobile/gapk_io.c
@@ -36,7 +36,7 @@
 #include <osmocom/bb/common/ms.h>
 #include <osmocom/bb/common/logging.h>

-#include <osmocom/bb/mobile/voice.h>
+#include <osmocom/bb/mobile/tch.h>
 #include <osmocom/bb/mobile/gapk_io.h>
 
 /* The RAW PCM format is common for both audio source and sink */
@@ -585,7 +585,7 @@
                                             &gapk_io->tch_ul_fb_len);

                /* Push a voice frame to the lower layers */
-               gsm_send_voice_msg(ms, tch_msg);
+               tch_send_voice_msg(ms, tch_msg);

                work |= 1;
        }
diff --git a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c 
b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
index 4fe0b82..65e016d 100644
--- a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
+++ b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
@@ -64,7 +64,7 @@
 #include <osmocom/bb/mobile/mncc.h>
 #include <osmocom/bb/mobile/transaction.h>
 #include <osmocom/bb/mobile/gsm44068_gcc_bcc.h>
-#include <osmocom/bb/mobile/voice.h>
+#include <osmocom/bb/mobile/tch.h>
 #include <osmocom/bb/mobile/vty.h>
 #include <l1ctl_proto.h>

diff --git a/src/host/layer23/src/mobile/gsm48_cc.c 
b/src/host/layer23/src/mobile/gsm48_cc.c
index 9691c68..4e26713 100644
--- a/src/host/layer23/src/mobile/gsm48_cc.c
+++ b/src/host/layer23/src/mobile/gsm48_cc.c
@@ -33,7 +33,7 @@
 #include <osmocom/bb/mobile/transaction.h>
 #include <osmocom/bb/mobile/gsm48_cc.h>
 #include <osmocom/bb/mobile/gsm44068_gcc_bcc.h>
-#include <osmocom/bb/mobile/voice.h>
+#include <osmocom/bb/mobile/tch.h>
 #include <l1ctl_proto.h>

 static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg);
@@ -1978,7 +1978,7 @@
        case GSM_TCHH_FRAME:
        case GSM_TCH_FRAME_AMR:
        case GSM_BAD_FRAME:
-               return gsm_send_voice_frame(ms, arg);
+               return tch_send_voice_frame(ms, arg);
        case MNCC_LCHAN_MODIFY:
                return 0;
        case MNCC_FRAME_RECV:
diff --git a/src/host/layer23/src/mobile/voice.c 
b/src/host/layer23/src/mobile/tch.c
similarity index 85%
rename from src/host/layer23/src/mobile/voice.c
rename to src/host/layer23/src/mobile/tch.c
index 699bd80..f6530fb 100644
--- a/src/host/layer23/src/mobile/voice.c
+++ b/src/host/layer23/src/mobile/tch.c
@@ -31,10 +31,10 @@
 #include <osmocom/bb/mobile/gapk_io.h>
 #include <osmocom/bb/mobile/mncc.h>
 #include <osmocom/bb/mobile/mncc_sock.h>
-#include <osmocom/bb/mobile/voice.h>
+#include <osmocom/bb/mobile/tch.h>
 
 /* Forward a Downlink voice frame to the external MNCC handler */
-static int gsm_forward_mncc(struct osmocom_ms *ms, struct msgb *msg)
+static int tch_forward_mncc(struct osmocom_ms *ms, struct msgb *msg)
 {
        struct gsm_data_frame *mncc;

@@ -74,16 +74,16 @@
 }

 /* Receive a Downlink voice frame from the lower layers */
-static int gsm_recv_voice(struct osmocom_ms *ms, struct msgb *msg)
+static int tch_recv_voice(struct osmocom_ms *ms, struct msgb *msg)
 {
        switch (ms->settings.tch_voice.io_handler) {
        case TCH_VOICE_IOH_LOOPBACK:
                /* Remove the DL info header */
                msgb_pull_to_l2(msg);
                /* Send voice frame back */
-               return gsm_send_voice_msg(ms, msg);
+               return tch_send_voice_msg(ms, msg);
        case TCH_VOICE_IOH_MNCC_SOCK:
-               return gsm_forward_mncc(ms, msg);
+               return tch_forward_mncc(ms, msg);
        case TCH_VOICE_IOH_GAPK:
 #ifdef WITH_GAPK_IO
                /* Enqueue a frame to the DL TCH buffer */
@@ -103,14 +103,14 @@
 }

 /* Send an Uplink voice frame to the lower layers */
-int gsm_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg)
+int tch_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg)
 {
        /* Forward to RR */
        return gsm48_rr_tx_traffic(ms, msg);
 }

-/* gsm_send_voice_msg() wrapper accepting an MNCC structure */
-int gsm_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame)
+/* tch_send_voice_msg() wrapper accepting an MNCC structure */
+int tch_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame)
 {
        struct msgb *nmsg;
        int len;
@@ -139,13 +139,13 @@
        nmsg->l2h = msgb_put(nmsg, len);
        memcpy(nmsg->l2h, frame->data, len);

-       return gsm_send_voice_msg(ms, nmsg);
+       return tch_send_voice_msg(ms, nmsg);
 }

-/* Initialize voice router */
-int gsm_voice_init(struct osmocom_ms *ms)
+/* Initialize the TCH router */
+int tch_init(struct osmocom_ms *ms)
 {
-       ms->l1_entity.l1_traffic_ind = gsm_recv_voice;
+       ms->l1_entity.l1_traffic_ind = tch_recv_voice;

        return 0;
 }

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34917?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0
Gerrit-Change-Number: 34917
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to