From efe2c7b7bd12729335a795ddb255c87e4d6722f7 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 23 Oct 2023 23:38:38 +0700 Subject: [PATCH] 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 --- .../include/osmocom/bb/mobile/Makefile.am | 4 ++-- .../layer23/include/osmocom/bb/mobile/tch.h | 9 +++++++ .../layer23/include/osmocom/bb/mobile/voice.h | 9 ------- src/host/layer23/src/mobile/Makefile.am | 2 +- src/host/layer23/src/mobile/app_mobile.c | 4 ++-- src/host/layer23/src/mobile/gapk_io.c | 4 ++-- .../layer23/src/mobile/gsm44068_gcc_bcc.c | 2 +- src/host/layer23/src/mobile/gsm48_cc.c | 4 ++-- .../layer23/src/mobile/{voice.c => tch.c} | 24 +++++++++---------- 9 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 src/host/layer23/include/osmocom/bb/mobile/tch.h delete mode 100644 src/host/layer23/include/osmocom/bb/mobile/voice.h rename src/host/layer23/src/mobile/{voice.c => tch.c} (85%) diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am index 534b8659e..5d2eeaf8a 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 000000000..0e81769cf --- /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 8c4c5b627..000000000 --- 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 7b05f659a..ed2146fd7 100644 --- a/src/host/layer23/src/mobile/Makefile.am +++ b/src/host/layer23/src/mobile/Makefile.am @@ -30,9 +30,9 @@ libmobile_a_SOURCES = \ 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 b08976c20..cada8fc78 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include @@ -256,7 +256,7 @@ static int mobile_init(struct osmocom_ms *ms) 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 997ed8a2a..966d0f4fb 100644 --- a/src/host/layer23/src/mobile/gapk_io.c +++ b/src/host/layer23/src/mobile/gapk_io.c @@ -36,7 +36,7 @@ #include #include -#include +#include #include /* The RAW PCM format is common for both audio source and sink */ @@ -585,7 +585,7 @@ int gapk_io_serve_ms(struct osmocom_ms *ms) &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 4fe0b8225..65e016d30 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 #include #include -#include +#include #include #include diff --git a/src/host/layer23/src/mobile/gsm48_cc.c b/src/host/layer23/src/mobile/gsm48_cc.c index 9691c68c9..4e267137f 100644 --- a/src/host/layer23/src/mobile/gsm48_cc.c +++ b/src/host/layer23/src/mobile/gsm48_cc.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg); @@ -1978,7 +1978,7 @@ int mncc_tx_to_cc(void *inst, int msg_type, void *arg) 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 699bd8078..f6530fbab 100644 --- a/src/host/layer23/src/mobile/voice.c +++ b/src/host/layer23/src/mobile/tch.c @@ -31,10 +31,10 @@ #include #include #include -#include +#include /* 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 @@ exit_free: } /* 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 @@ static int gsm_recv_voice(struct osmocom_ms *ms, struct msgb *msg) } /* 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 @@ int gsm_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame *fra 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; }