aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-08-10 12:21:22 +0200
committerHarald Welte <laforge@netfilter.org>2009-08-10 12:21:22 +0200
commit21bd3a52f180080869a5cd2da797061441bd729a (patch)
treef67be217d46bdf9d851626fe24f57ce478f7481c /openbsc
parent65f68fa9611c87d3bab75d5c69b45e99d6ee3eae (diff)
move chcomb4pchan to public abis_nm_chcomb4pchan() function
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/abis_nm.h2
-rw-r--r--openbsc/src/abis_nm.c17
-rw-r--r--openbsc/src/chan_alloc.c11
3 files changed, 20 insertions, 10 deletions
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h
index 946d2379d..ab4b1ce6e 100644
--- a/openbsc/include/openbsc/abis_nm.h
+++ b/openbsc/include/openbsc/abis_nm.h
@@ -696,6 +696,8 @@ int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class,
u_int8_t test_nr, u_int8_t auton_report,
u_int8_t *phys_config, u_int16_t phys_config_len);
+int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan);
+
/* Siemens / BS-11 specific */
int abis_nm_bs11_reset_resource(struct gsm_bts *bts);
int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin);
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c
index 8fcfdba4e..a75ef7a1e 100644
--- a/openbsc/src/abis_nm.c
+++ b/openbsc/src/abis_nm.c
@@ -404,6 +404,23 @@ static const struct tlv_definition nm_att_tlvdef = {
},
};
+static const enum abis_nm_chan_comb chcomb4pchan[] = {
+ [GSM_PCHAN_CCCH] = NM_CHANC_mainBCCH,
+ [GSM_PCHAN_CCCH_SDCCH4] = NM_CHANC_BCCHComb,
+ [GSM_PCHAN_TCH_F] = NM_CHANC_TCHFull,
+ [GSM_PCHAN_TCH_H] = NM_CHANC_TCHHalf,
+ [GSM_PCHAN_SDCCH8_SACCH8C] = NM_CHANC_SDCCH,
+ /* FIXME: bounds check */
+};
+
+int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan)
+{
+ if (pchan < ARRAY_SIZE(chcomb4pchan))
+ return chcomb4pchan[pchan];
+
+ return -EINVAL;
+}
+
int abis_nm_tlv_parse(struct tlv_parsed *tp, const u_int8_t *buf, int len)
{
return tlv_parse(tp, &nm_att_tlvdef, buf, len, 0, 0);
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 5d1e137b9..039fccf71 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -53,15 +53,6 @@ struct gsm_bts_trx_ts *ts_c0_alloc(struct gsm_bts *bts,
return ts;
}
-static const enum abis_nm_chan_comb chcomb4pchan[] = {
- [GSM_PCHAN_CCCH] = NM_CHANC_mainBCCH,
- [GSM_PCHAN_CCCH_SDCCH4] = NM_CHANC_BCCHComb,
- [GSM_PCHAN_TCH_F] = NM_CHANC_TCHFull,
- [GSM_PCHAN_TCH_H] = NM_CHANC_TCHHalf,
- [GSM_PCHAN_SDCCH8_SACCH8C] = NM_CHANC_SDCCH,
- /* FIXME: bounds check */
-};
-
/* Allocate a physical channel (TS) */
struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts,
enum gsm_phys_chan_config pchan)
@@ -108,7 +99,7 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts,
if (ts->pchan == GSM_PCHAN_NONE) {
ts->pchan = pchan;
/* set channel attribute on OML */
- abis_nm_set_channel_attr(ts, chcomb4pchan[pchan]);
+ abis_nm_set_channel_attr(ts, abis_nm_chcomb4pchan(pchan));
return ts;
}
}