Replace magic number with define

Value 4 used as magic number by both OpenBSC and OsmoBTS so it make
sense to add it to shared header. See
ebb483b69a5319e522ba5f713e9cb6f68a814a6a in osmo-bts for details.

Change-Id: I9c6ad68f4c6aa72d39ec7e5a6968b36ec20e79f4
This commit is contained in:
Max 2016-10-18 16:19:33 +02:00
parent fbd96f55fd
commit 582e4f6276
2 changed files with 5 additions and 1 deletions

View File

@ -46,6 +46,10 @@ enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_OTHER,
};
/* lchans 0..3 are SDCCH in combined channel configuration,
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
#define CCCH_LCHAN 4
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8

View File

@ -579,7 +579,7 @@ uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
* here. This should never be sent in an RSL message.
* See osmo-bts-xxx/oml.c:opstart_compl().
*/
if (lchan_nr == 4)
if (lchan_nr == CCCH_LCHAN)
chan_nr = 0;
else
OSMO_ASSERT(lchan_nr < 4);