[10/33] l1sap: correctly set chan_nr on PRIM_PH_RACH / INDICATION
diff mbox

Message ID 1409176492-13269-11-git-send-email-laforge@gnumonks.org
State Superseded
Headers show

Commit Message

Harald Welte Aug. 27, 2014, 9:54 p.m. UTC
In case of a RACH INDICATION on CCCH, we need to set CHAN_NR to
0x88 (RSL_CHAN_RACH).  In other cases, chan_nr needs to reflect
the actual logical channel (TCH/SDCCH) on whcih the handover happened.
---
 src/osmo-bts-sysmo/l1_if.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch
diff mbox

diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index c28e467..9c6817c 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1065,6 +1065,11 @@  static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
 	l1sap->u.rach_ind.ra = ra;
 	l1sap->u.rach_ind.acc_delay = acc_delay;
 	l1sap->u.rach_ind.fn = fn;
+	if (!lchan || lchan->ts->pchan == GSM_PCHAN_CCCH ||
+	    lchan->ts->pchan == GSM_PCHAN_CCCH_SDCCH4)
+		l1sap->u.rach_ind.chan_nr = 0x88;
+	else
+		l1sap->u.rach_ind.chan_nr = gsm_lchan2chan_nr(lchan);
 
 	return l1sap_up(trx, l1sap);
 }