Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa

Before this patch it was being coded as SDCCH4 TS0 SS 0, and as a
result the state LCHAN_REL_ACT_OML applied in opstart_compl in abused
SDCCH4 TS0 SS 4 was not being checked when deciding whether to send a
Chan Act ACK in rsl_tx_chan_act_acknack.

Fixes: OS#3513
Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
This commit is contained in:
Pau Espin 2018-10-22 13:18:15 +02:00
parent e6ce1718ae
commit 34018dd4c9
2 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,7 @@
#define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1)
#define L1SAP_CHAN2SS_SDCCH4(chan_nr) ((chan_nr >> 3) & 3)
#define L1SAP_CHAN2SS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7)
#define L1SAP_CHAN2SS_BCCH(chan_nr) (CCCH_LCHAN)
/* logical channel from chan_nr + link_id */
#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH)
@ -48,6 +49,8 @@ static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
/* subslot from any chan_nr */
static inline uint8_t l1sap_chan2ss(uint8_t chan_nr)
{
if (L1SAP_IS_CHAN_BCCH(chan_nr))
return L1SAP_CHAN2SS_BCCH(chan_nr);
if (L1SAP_IS_CHAN_SDCCH8(chan_nr))
return L1SAP_CHAN2SS_SDCCH8(chan_nr);
if (L1SAP_IS_CHAN_SDCCH4(chan_nr))

View File

@ -622,11 +622,12 @@ uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
* See osmo-bts-xxx/oml.c:opstart_compl().
*/
if (lchan_nr == CCCH_LCHAN)
lchan_nr = 0;
else
cbits = 0x10; /* BCCH */
else {
OSMO_ASSERT(lchan_nr < 4);
cbits = 0x04;
cbits += lchan_nr;
cbits = 0x04;
cbits += lchan_nr;
}
break;
case GSM_PCHAN_SDCCH8_SACCH8C:
case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: