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;
|