aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-03-27 11:48:32 +0200
committerHarald Welte <laforge@osmocom.org>2023-03-27 11:55:26 +0200
commit89155afa3fe7a1c9458eedf7791546b98b19035c (patch)
treed12da1cd57e97db6c097ada8c83402d4e3573578
parente464ef652426c306aa02f5f3187d78e5d287175d (diff)
bts-{sysmo,oc2g,lc15}: Make sure RTP clock ticks during FACCH stealinglaforge/os5974
Whenever we have FACCH stealing happening, the RTP clock didn't continue to tick as we didn't report anything to RTP in those situations. Change-Id: Iae832137b8ef8dc7c1e6d0746df69efd41aafcf0 Closes: OS#5974
-rw-r--r--src/osmo-bts-lc15/l1_if.c3
-rw-r--r--src/osmo-bts-lc15/tch.c11
-rw-r--r--src/osmo-bts-oc2g/l1_if.c3
-rw-r--r--src/osmo-bts-oc2g/tch.c11
-rw-r--r--src/osmo-bts-sysmo/l1_if.c3
-rw-r--r--src/osmo-bts-sysmo/tch.c11
6 files changed, 33 insertions, 9 deletions
diff --git a/src/osmo-bts-lc15/l1_if.c b/src/osmo-bts-lc15/l1_if.c
index 987b6e35..4bc21037 100644
--- a/src/osmo-bts-lc15/l1_if.c
+++ b/src/osmo-bts-lc15/l1_if.c
@@ -1007,6 +1007,9 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in
return rc;
}
+ /* send empty TCH block to make RTP clock continue ticking in case of FACCH */
+ l1if_tch_rx(trx, chan_nr, NULL);
+
/* get rssi */
rssi = (int8_t) (data_ind->measParam.fRssi);
/* get data pointer and length */
diff --git a/src/osmo-bts-lc15/tch.c b/src/osmo-bts-lc15/tch.c
index 526b2ddf..8297bb10 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -358,8 +358,8 @@ static int is_recv_only(uint8_t speech_mode)
/*! \brief receive a traffic L1 primitive for a given lchan */
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
{
- GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
- GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
+ GsmL1_Prim_t *l1p;
+ GsmL1_PhDataInd_t *data_ind;
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
@@ -367,7 +367,12 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (l1p_msg) {
+ l1p = msgb_l1prim(l1p_msg);
+ data_ind = &l1p->u.phDataInd;
+ }
+
+ if (!l1p_msg || data_ind->msgUnitParam.u8Size < 1) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index 3308a462..34f4c28a 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -1064,6 +1064,9 @@ static int handle_ph_data_ind(struct oc2gl1_hdl *fl1, GsmL1_PhDataInd_t *data_in
return rc;
}
+ /* send empty TCH block to make RTP clock continue ticking in case of FACCH */
+ l1if_tch_rx(trx, chan_nr, NULL);
+
/* get rssi */
rssi = (int8_t) (data_ind->measParam.fRssi);
/* get data pointer and length */
diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c
index 09ee1e7c..82d698e4 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -358,8 +358,8 @@ static int is_recv_only(uint8_t speech_mode)
/*! \brief receive a traffic L1 primitive for a given lchan */
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
{
- GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
- GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
+ GsmL1_Prim_t *l1p;
+ GsmL1_PhDataInd_t *data_ind;
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
@@ -367,7 +367,12 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (l1p_msg) {
+ l1p = msgb_l1prim(l1p_msg);
+ data_ind = &l1p->u.phDataInd;
+ }
+
+ if (!l1p_msg || data_ind->msgUnitParam.u8Size < 1) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 646cf016..041f098e 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -980,6 +980,9 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
return rc;
}
+ /* send empty TCH block to make RTP clock continue ticking in case of FACCH */
+ l1if_tch_rx(trx, chan_nr, NULL);
+
/* fill L1SAP header */
sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size);
l1sap = msgb_l1sap_prim(sap_msg);
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index a390c8ca..ce94c729 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -503,8 +503,8 @@ static int is_recv_only(uint8_t speech_mode)
/*! \brief receive a traffic L1 primitive for a given lchan */
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
{
- GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
- GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
+ GsmL1_Prim_t *l1p;
+ GsmL1_PhDataInd_t *data_ind;
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
@@ -512,7 +512,12 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg)
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (l1p_msg) {
+ l1p = msgb_l1prim(l1p_msg);
+ data_ind = &l1p->u.phDataInd;
+ }
+
+ if (!l1p_msg || data_ind->msgUnitParam.u8Size < 1) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");