annotate osmo-patches/osmo-bts-rtp-bfi.patch @ 203:e89619893c1e

sip-out: require minimum of 7 digits for E.164 numbers
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Apr 2023 21:09:50 -0800
parents f5c4f9a764be
children c76f42e0cd3f
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
176
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
2 index 8bcd417..42c97c4 100644
172
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;
176
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
40 + bfi[1] = (fn % 104 == 52); /* TAF */
172
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;
176
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
53 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
54 index 5c99824..e35fc2e 100644
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
55 --- a/src/osmo-bts-sysmo/l1_if.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
56 +++ b/src/osmo-bts-sysmo/l1_if.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
57 @@ -981,6 +981,10 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
58 return rc;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
59 }
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
60
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
61 + /* Themyscira addition: empty RTP "ticks" on FACCH */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
62 + if (data_ind->sapi == GsmL1_Sapi_FacchF)
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
63 + l1if_tch_rx_facch(trx, chan_nr, l1p_msg);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
64 +
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
65 /* fill L1SAP header */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
66 sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
67 l1sap = msgb_l1sap_prim(sap_msg);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
68 diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
69 index 8691eef..5b2da04 100644
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
70 --- a/src/osmo-bts-sysmo/l1_if.h
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
71 +++ b/src/osmo-bts-sysmo/l1_if.h
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
72 @@ -129,6 +129,8 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
73 const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
74 bool use_cache, bool marker);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
75 int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
76 +int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
77 + struct msgb *l1p_msg);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
78 int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
79 struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
80
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
81 diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
82 index a390c8c..f38d9fe 100644
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
83 --- a/src/osmo-bts-sysmo/tch.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
84 +++ b/src/osmo-bts-sysmo/tch.c
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
85 @@ -131,12 +131,16 @@ static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
86
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
87 cur[0] |= 0xC0;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
88 #endif /* USE_L1_RTP_MODE */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
89 +
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
90 +/* this code is a bogon: osmo_amr_rtp_dec() won't grok EFR RTP format! */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
91 +#if 0
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
92 enum osmo_amr_type ft;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
93 enum osmo_amr_quality bfi;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
94 uint8_t cmr;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
95 int8_t sti, cmi;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
96 osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
97 lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
98 +#endif
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
99
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
100 return msg;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
101 }
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
102 @@ -630,6 +634,38 @@ err_payload_match:
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
103 return -EINVAL;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
104 }
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
105
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
106 +/*
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
107 + * The following function is a Themyscira Wireless addition: we want to have
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
108 + * an RTP packet sent out on *every* 20 ms "tick", even during times when
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
109 + * TCH was stolen for FACCH. During FACCH stealing times, it appears that
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
110 + * sysmoBTS PHY sends GsmL1_Sapi_FacchF and no GsmL1_Sapi_TchF, and with
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
111 + * the original code l1if_tch_rx(), the function that feeds "ticks" to the
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
112 + * RTP output mechanism, was never called. Our added l1if_tch_rx_facch()
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
113 + * function sends an empty payload to the upper layers, and we call it
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
114 + * from the GsmL1_Sapi_FacchF code path.
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
115 + */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
116 +int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
117 + struct msgb *l1p_msg)
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
118 +{
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
119 + GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
120 + GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
121 + struct msgb *rmsg = NULL;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
122 + struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
123 +
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
124 + if (is_recv_only(lchan->abis_ip.speech_mode))
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
125 + return -EAGAIN;
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
126 +
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
127 + LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx FACCH\n", chan_nr);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
128 + /* Push empty payload to upper layers */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
129 + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
130 + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
131 + data_ind->measParam.fBer * 10000,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
132 + data_ind->measParam.fLinkQuality * 10,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
133 + 0, /* suppress RSSI like in osmo-bts-trx */
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
134 + data_ind->measParam.i16BurstTiming * 64,
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
135 + 0);
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
136 +}
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
137 +
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
138 struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
139 {
f5c4f9a764be osmo-bts-rtp-bfi.patch: updated version
Mychaela Falconia <falcon@freecalypso.org>
parents: 172
diff changeset
140 struct msgb *msg;