aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-09-16 18:38:33 +0200
committerMax <msuraev@sysmocom.de>2016-09-23 14:53:46 +0000
commit80473a113d012321fa1faec24794f0b048cb1a58 (patch)
tree1c017f8f37006f835dbd529cf103f8198b00553d
parent0a05181603ed7c42900f049654de007005de86f3 (diff)
DTX: fix last SID saving
Previously SID was saved explicitly by each BTS model (lc15, sysmo) instead of relying on generic function. Fix it by using generic function and propagating necessary parameters for it. Change-Id: Ie545212cce5ed2b3ea3228597f18a473f5e1deb4 Fixes: OS#1800
-rw-r--r--src/osmo-bts-litecell15/l1_if.c2
-rw-r--r--src/osmo-bts-litecell15/l1_if.h2
-rw-r--r--src/osmo-bts-litecell15/tch.c16
-rw-r--r--src/osmo-bts-sysmo/l1_if.c2
-rw-r--r--src/osmo-bts-sysmo/l1_if.h2
-rw-r--r--src/osmo-bts-sysmo/tch.c16
6 files changed, 14 insertions, 26 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 3672b8f6..da63e005 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -469,7 +469,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len);
+ msg->data, msg->len, u32Fn);
}
/* no message/data, we generate an empty traffic msg */
diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h
index 2d136af9..41d69894 100644
--- a/src/osmo-bts-litecell15/l1_if.h
+++ b/src/osmo-bts-litecell15/l1_if.h
@@ -88,7 +88,7 @@ struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer)
/* tch.c */
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len);
+ const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn);
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index 187f6884..5badc4d7 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -200,7 +200,7 @@ static struct msgb *l1_to_rtppayload_amr(uint8_t *l1_payload, uint8_t payload_le
*/
static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
uint8_t payload_len,
- struct gsm_lchan *lchan)
+ struct gsm_lchan *lchan, uint32_t fn)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
enum osmo_amr_type ft;
@@ -270,14 +270,8 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID) {
- /* store the last SID frame in lchan context */
- unsigned int copy_len;
- copy_len = OSMO_MIN(payload_len+1,
- ARRAY_SIZE(lchan->tch.last_sid.buf));
- lchan->tch.last_sid.len = copy_len;
- memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
- }
+ if (ft == AMR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn, sti);
return payload_len+1;
}
@@ -297,7 +291,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* pre-fill the primtive.
*/
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len)
+ const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
uint8_t *l1_payload;
@@ -329,7 +323,7 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
- rtp_pl_len, lchan);
+ rtp_pl_len, lchan, fn);
break;
default:
/* we don't support CSD modes */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 40ac12d6..787a91db 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -462,7 +462,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len);
+ msg->data, msg->len, u32Fn);
}
/* no message/data, we generate an empty traffic msg */
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 2fc8a296..bd694ec3 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -108,7 +108,7 @@ struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer)
/* tch.c */
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len);
+ const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn);
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index 39feae10..6c78ceb0 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -283,7 +283,7 @@ static struct msgb *l1_to_rtppayload_amr(uint8_t *l1_payload, uint8_t payload_le
*/
static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
uint8_t payload_len,
- struct gsm_lchan *lchan)
+ struct gsm_lchan *lchan, uint32_t fn)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
enum osmo_amr_type ft;
@@ -367,14 +367,8 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID) {
- /* store the last SID frame in lchan context */
- unsigned int copy_len;
- copy_len = OSMO_MIN(payload_len+1,
- ARRAY_SIZE(lchan->tch.last_sid.buf));
- lchan->tch.last_sid.len = copy_len;
- memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
- }
+ if (ft == AMR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn, sti);
return payload_len+1;
}
@@ -394,7 +388,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* pre-fill the primtive.
*/
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len)
+ const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
uint8_t *l1_payload;
@@ -428,7 +422,7 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
- rtp_pl_len, lchan);
+ rtp_pl_len, lchan, fn);
break;
default:
/* we don't support CSD modes */