diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-12-28 15:00:45 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-12-30 00:35:28 +0100 |
commit | 30f1f376383df3ae8d85e96542bf14d174c25d89 (patch) | |
tree | d2c7cf085cce2a44ad055b741b25ef8794f105a2 /openbsc/src/libbsc/chan_alloc.c | |
parent | 65be6de155407142ddab44faf8aee5f8d5ebf628 (diff) |
Add basic support for CBCH / SMS-CB (Cell Brroadcast)
We can now configure the pyisical channel types for CBCH either in the
CCCH+SDCCH4 or in the SDCCH8 chanel combination.
Depending on whether a CBCH exists on the BTS, we also generate the SI4
with matching CBCH channel description to notify the phones of the
existance of the CBCH.
There is now a VTY command how a SMS-CB message can be sent to a given
BTS.
We do not yet have any logic at all for actual scheduling of multiple
CBCH RSL messages towards one or multiple BTSs yet, though.
Diffstat (limited to 'openbsc/src/libbsc/chan_alloc.c')
-rw-r--r-- | openbsc/src/libbsc/chan_alloc.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index cd96c1b38..657aedcf7 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -65,7 +65,8 @@ struct gsm_bts_trx_ts *ts_c0_alloc(struct gsm_bts *bts, struct gsm_bts_trx_ts *ts = &trx->ts[0]; if (pchan != GSM_PCHAN_CCCH && - pchan != GSM_PCHAN_CCCH_SDCCH4) + pchan != GSM_PCHAN_CCCH_SDCCH4 && + pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) return NULL; if (ts->pchan != GSM_PCHAN_NONE) @@ -96,6 +97,7 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts, switch (pchan) { case GSM_PCHAN_CCCH: case GSM_PCHAN_CCCH_SDCCH4: + case GSM_PCHAN_CCCH_SDCCH4_CBCH: from = 0; to = 0; break; case GSM_PCHAN_TCH_F: @@ -103,6 +105,7 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts, from = 1; to = 7; break; case GSM_PCHAN_SDCCH8_SACCH8C: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: default: return NULL; } @@ -110,7 +113,7 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts, /* Every secondary TRX is configured for TCH/F * and TCH/H only */ switch (pchan) { - case GSM_PCHAN_SDCCH8_SACCH8C: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: from = 1; to = 1; case GSM_PCHAN_TCH_F: case GSM_PCHAN_TCH_H: @@ -153,6 +156,8 @@ static const uint8_t subslots_per_pchan[] = { [GSM_PCHAN_SDCCH8_SACCH8C] = 8, /* FIXME: what about dynamic TCH_F_TCH_H ? */ [GSM_PCHAN_TCH_F_PDCH] = 1, + [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, + [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, }; static struct gsm_lchan * @@ -211,7 +216,9 @@ _lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) } /* we cannot allocate more of these */ - if (pchan == GSM_PCHAN_CCCH_SDCCH4) + if (pchan == GSM_PCHAN_CCCH_SDCCH4 || + pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH || + pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) return NULL; /* if we've reached here, we need to allocate a new physical @@ -229,21 +236,29 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger) { struct gsm_lchan *lchan = NULL; - enum gsm_phys_chan_config first, second; + enum gsm_phys_chan_config first, first_cbch, second, second_cbch; switch (type) { case GSM_LCHAN_SDCCH: if (bts->chan_alloc_reverse) { first = GSM_PCHAN_SDCCH8_SACCH8C; + first_cbch = GSM_PCHAN_SDCCH8_SACCH8C_CBCH; second = GSM_PCHAN_CCCH_SDCCH4; + second_cbch = GSM_PCHAN_CCCH_SDCCH4_CBCH; } else { first = GSM_PCHAN_CCCH_SDCCH4; + first_cbch = GSM_PCHAN_CCCH_SDCCH4_CBCH; second = GSM_PCHAN_SDCCH8_SACCH8C; + second_cbch = GSM_PCHAN_SDCCH8_SACCH8C_CBCH; } lchan = _lc_find_bts(bts, first); if (lchan == NULL) + lchan = _lc_find_bts(bts, first_cbch); + if (lchan == NULL) lchan = _lc_find_bts(bts, second); + if (lchan == NULL) + lchan = _lc_find_bts(bts, second_cbch); /* allow to assign bigger channels */ if (allow_bigger) { |