laforge has uploaded this change for review.

View Change

bts-{sysmo,oc2g,lc15}: Make sure RTP clock ticks during FACCH stealing

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
---
M src/osmo-bts-lc15/l1_if.c
M src/osmo-bts-lc15/tch.c
M src/osmo-bts-oc2g/l1_if.c
M src/osmo-bts-oc2g/tch.c
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/tch.c
6 files changed, 46 insertions(+), 9 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/82/32082/1
diff --git a/src/osmo-bts-lc15/l1_if.c b/src/osmo-bts-lc15/l1_if.c
index 987b6e3..4bc2103 100644
--- a/src/osmo-bts-lc15/l1_if.c
+++ b/src/osmo-bts-lc15/l1_if.c
@@ -1007,6 +1007,9 @@
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 526b2dd..8297bb1 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -358,8 +358,8 @@
/*! \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 @@
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 3308a46..34f4c28 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -1064,6 +1064,9 @@
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 09ee1e7..82d698e 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -358,8 +358,8 @@
/*! \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 @@
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 646cf01..041f098 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -980,6 +980,9 @@
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 a390c8c..ce94c72 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -503,8 +503,8 @@
/*! \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 @@
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");

To view, visit change 32082. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iae832137b8ef8dc7c1e6d0746df69efd41aafcf0
Gerrit-Change-Number: 32082
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-MessageType: newchange