summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-12-29 17:47:08 +0100
committerHarald Welte <laforge@gnumonks.org>2014-12-30 00:35:44 +0100
commit142d12d829d4207e2fe7dee34b8d82dd89015615 (patch)
tree4598d7a6095ccd1a6d9d103eeef0c9c5ed7899ce /openbsc
parent30f1f376383df3ae8d85e96542bf14d174c25d89 (diff)
move gsm_bts_get_cbch() to gsm_data_shared() as its needed in osmo-bts
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h1
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h3
-rw-r--r--openbsc/src/libbsc/system_information.c23
-rw-r--r--openbsc/src/libcommon/gsm_data_shared.c21
4 files changed, 26 insertions, 22 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index ae6757d7d..b278309f7 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -418,6 +418,7 @@ void subscr_con_free(struct gsm_subscriber_connection *conn);
struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net,
enum gsm_bts_type type,
uint8_t tsc, uint8_t bsic);
+
void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
uint8_t e1_ts, uint8_t e1_ts_ss);
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 30f6bc32f..54dda1ff8 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -767,6 +767,9 @@ void gsm_bts_mo_reset(struct gsm_bts *bts);
uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr);
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
+/* return the gsm_lchan for the CBCH (if it exists at all) */
+struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
+
/*
* help with parsing regexps
*/
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c
index 29b9b191d..ea9e335ea 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -555,27 +555,6 @@ static int generate_si3(uint8_t *output, struct gsm_bts *bts)
return sizeof(*si3) + rc;
}
-/* return the gsm_lchan for the CBCH (if it exists at all) */
-static struct gsm_lchan *bts_get_cbch(struct gsm_bts *bts)
-{
- struct gsm_lchan *lchan = NULL;
- struct gsm_bts_trx *trx = bts->c0;
-
- if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH)
- lchan = &trx->ts[0].lchan[2];
- else {
- int i;
- for (i = 0; i < 8; i++) {
- if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) {
- lchan = &trx->ts[i].lchan[2];
- break;
- }
- }
- }
-
- return lchan;
-}
-
static int generate_si4(uint8_t *output, struct gsm_bts *bts)
{
int rc;
@@ -600,7 +579,7 @@ static int generate_si4(uint8_t *output, struct gsm_bts *bts)
si4->rach_control = bts->si_common.rach_control;
/* Optional: CBCH Channel Description + CBCH Mobile Allocation */
- cbch_lchan = bts_get_cbch(bts);
+ cbch_lchan = gsm_bts_get_cbch(bts);
if (cbch_lchan) {
struct gsm48_chan_desc cd;
gsm48_lchan2chan_desc(&cd, cbch_lchan);
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index 210d2284b..ad3d7cba9 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -544,3 +544,24 @@ uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan)
{
return gsm_ts2chan_nr(lchan->ts, lchan->nr);
}
+
+/* return the gsm_lchan for the CBCH (if it exists at all) */
+struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts)
+{
+ struct gsm_lchan *lchan = NULL;
+ struct gsm_bts_trx *trx = bts->c0;
+
+ if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH)
+ lchan = &trx->ts[0].lchan[2];
+ else {
+ int i;
+ for (i = 0; i < 8; i++) {
+ if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) {
+ lchan = &trx->ts[i].lchan[2];
+ break;
+ }
+ }
+ }
+
+ return lchan;
+}