Project

General

Profile

Bug #5974 ยป os5974-themwi.patch

falconia, 03/27/2023 03:56 PM

View differences:

src/osmo-bts-sysmo/l1_if.c
981 981
		return rc;
982 982
	}
983 983

  
984
	/* Themyscira addition: empty RTP "ticks" on FACCH */
985
	if (data_ind->sapi == GsmL1_Sapi_FacchF)
986
		l1if_tch_rx_facch(trx, chan_nr, l1p_msg);
987

  
984 988
	/* fill L1SAP header */
985 989
	sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size);
986 990
	l1sap = msgb_l1sap_prim(sap_msg);
src/osmo-bts-sysmo/l1_if.h
129 129
		    const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn,
130 130
		    bool use_cache, bool marker);
131 131
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
132
int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
133
		      struct msgb *l1p_msg);
132 134
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
133 135
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn);
134 136

  
src/osmo-bts-sysmo/tch.c
630 630
	return -EINVAL;
631 631
}
632 632

  
633
/*
634
 * The following function is a Themyscira Wireless addition: we want to have
635
 * an RTP packet sent out on *every* 20 ms "tick", even during times when
636
 * TCH was stolen for FACCH.  During FACCH stealing times, it appears that
637
 * sysmoBTS PHY sends GsmL1_Sapi_FacchF and no GsmL1_Sapi_TchF, and with
638
 * the original code l1if_tch_rx(), the function that feeds "ticks" to the
639
 * RTP output mechanism, was never called.  Our added l1if_tch_rx_facch()
640
 * function sends an empty payload to the upper layers, and we call it
641
 * from the GsmL1_Sapi_FacchF code path.
642
 */
643
int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
644
		      struct msgb *l1p_msg)
645
{
646
	GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
647
	GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
648
	struct msgb *rmsg = NULL;
649
	struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
650

  
651
	if (is_recv_only(lchan->abis_ip.speech_mode))
652
		return -EAGAIN;
653

  
654
	LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx FACCH\n", chan_nr);
655
	/* Push empty payload to upper layers */
656
	rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
657
	return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
658
				data_ind->measParam.fBer * 10000,
659
				data_ind->measParam.fLinkQuality * 10,
660
				0,	/* suppress RSSI like in osmo-bts-trx */
661
				data_ind->measParam.i16BurstTiming * 64,
662
				0);
663
}
664

  
633 665
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
634 666
{
635 667
	struct msgb *msg;
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)