annotate osmo-patches/osmo-bts-rtp-bfi.patch @ 172:60e2d6379fce

osmo-patches/osmo-bts-rtp-bfi.patch: checking in
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 21 Nov 2022 01:05:58 -0800
parents
children f5c4f9a764be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
172
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 index 8bcd417..bfdc37f 100644
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 --- a/src/common/l1sap.c
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 +++ b/src/common/l1sap.c
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 @@ -1244,6 +1244,12 @@ static bool rtppayload_is_octet_aligned(const uint8_t *rtp_pl, uint8_t payload_l
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 static bool rtppayload_is_valid(struct gsm_lchan *lchan, struct msgb *resp_msg)
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 {
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 + /* Discard Themyscira BFI packets - because we have our own
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 + * TDMA timing, there is no difference for us between receiving
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 + * an explicit BFI packet vs receiving nothing at all. */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 + if (resp_msg->len == 2 && resp_msg->data[0] == 0xBF)
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 + return false;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 +
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 /* Avoid sending bw-efficient AMR to lower layers, most bts models
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 * don't support it. */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR &&
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 @@ -1574,6 +1580,7 @@ static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap,
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 struct gsm_lchan *lchan;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 uint8_t chan_nr;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 uint32_t fn;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 + uint8_t bfi[2];
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 chan_nr = tch_ind->chan_nr;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 fn = tch_ind->fn;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 @@ -1619,13 +1626,19 @@ static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap,
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 /* Only clear the marker bit once we have sent a RTP packet with it */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 lchan->rtp_tx_marker = false;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 } else {
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 - DEBUGPGT(DRTP, &g_time, "Skipping RTP frame with lost payload (chan_nr=0x%02x)\n",
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 - chan_nr);
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 - if (lchan->abis_ip.osmux.use)
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 - lchan_osmux_skipped_frame(lchan, fn_ms_adj(fn, lchan));
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 - else if (lchan->abis_ip.rtp_socket)
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 - osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan));
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 - lchan->rtp_tx_marker = true;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 + /* Themyscira change: send explicit BFI packets instead of
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 + * gaps in the RTP stream. */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 + bfi[0] = 0xBF;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 + bfi[1] = 0; /* TAF will go here */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 + if (lchan->abis_ip.osmux.use) {
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 + lchan_osmux_send_frame(lchan, bfi, 2,
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 + fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 + } else if (lchan->abis_ip.rtp_socket) {
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 + bfi, 2, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 + }
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 + /* clear the marker like in the regular code path */
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 + lchan->rtp_tx_marker = false;
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 }
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
60e2d6379fce osmo-patches/osmo-bts-rtp-bfi.patch: checking in
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 lchan->tch.last_fn = fn;