[PATCH] osmo-bts[master]: DTX: fix last SID saving

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Sep 16 16:59:50 UTC 2016


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/845

to look at the new patch set (#4).

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
---
M src/osmo-bts-litecell15/l1_if.c
M src/osmo-bts-litecell15/l1_if.h
M src/osmo-bts-litecell15/tch.c
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/l1_if.h
M src/osmo-bts-sysmo/tch.c
6 files changed, 14 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/845/4

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 3672b8f..da63e00 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -469,7 +469,7 @@
 		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 2d136af..41d6989 100644
--- a/src/osmo-bts-litecell15/l1_if.h
+++ b/src/osmo-bts-litecell15/l1_if.h
@@ -88,7 +88,7 @@
 
 /* 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 187f688..5badc4d 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -200,7 +200,7 @@
  */
 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 @@
 	}
 #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 @@
  * 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 @@
 	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 0880ee9..7280c1d 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -462,7 +462,7 @@
 		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 2fc8a29..bd694ec 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -108,7 +108,7 @@
 
 /* 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 39feae1..6c78ceb 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -283,7 +283,7 @@
  */
 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 @@
 	}
 #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 @@
  * 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 @@
 	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 */

-- 
To view, visit https://gerrit.osmocom.org/845
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie545212cce5ed2b3ea3228597f18a473f5e1deb4
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list