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
This commit is contained in:
Vadim Yanitskiy 2023-10-23 23:38:38 +07:00
parent b6083dcd13
commit efe2c7b7bd
9 changed files with 31 additions and 31 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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 @@ 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);

View File

@ -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 @@ 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;
}

View File

@ -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>

View File

@ -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 @@ 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:

View File

@ -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 @@ 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;
}