From b6c92ae7828c349427e5dcde37e8079b6d202ff8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 21 Feb 2009 20:15:32 +0000 Subject: [PATCH] * set OML TEI and E1 timeslot in one command * introduce new 'oml-tei' command of bs11_config --- include/openbsc/abis_nm.h | 5 ++--- src/abis_nm.c | 23 ++++++----------------- src/bs11_config.c | 5 +++-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/include/openbsc/abis_nm.h b/include/openbsc/abis_nm.h index fb9e2f26b..5d0917212 100644 --- a/include/openbsc/abis_nm.h +++ b/include/openbsc/abis_nm.h @@ -539,9 +539,8 @@ int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx); int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx); int abis_nm_bs11_delete_object(struct gsm_bts *bts, enum abis_bs11_objtype type, u_int8_t idx); -int abis_nm_bs11_set_oml_tei(struct gsm_bts *bts, u_int8_t tei); -int abis_nm_bs11_conn_oml(struct gsm_bts *bts, u_int8_t e1_port, - u_int8_t e1_timeslot, u_int8_t e1_subslot); +int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port, + u_int8_t e1_timeslot, u_int8_t e1_subslot, u_int8_t tei); int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts); int abis_nm_bs11_get_serno(struct gsm_bts *bts); int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level); diff --git a/src/abis_nm.c b/src/abis_nm.c index b7565bd99..a8bdd6796 100644 --- a/src/abis_nm.c +++ b/src/abis_nm.c @@ -1594,19 +1594,6 @@ int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx) return abis_nm_sendmsg(bts, msg); } -int abis_nm_bs11_set_oml_tei(struct gsm_bts *bts, u_int8_t tei) -{ - struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); - - oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); - fill_om_fom_hdr(oh, 2, NM_MT_BS11_SET_ATTR, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - msgb_tv_put(msg, NM_ATT_TEI, tei); - - return abis_nm_sendmsg(bts, msg); -} - static const u_int8_t sm_attr[] = { NM_ATT_TEI, NM_ATT_ABIS_CHANNEL }; int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts) { @@ -1621,20 +1608,22 @@ int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts) return abis_nm_sendmsg(bts, msg); } -/* like abis_nm_conn_terr_traf */ -int abis_nm_bs11_conn_oml(struct gsm_bts *bts, u_int8_t e1_port, - u_int8_t e1_timeslot, u_int8_t e1_subslot) +/* like abis_nm_conn_terr_traf + set_tei */ +int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port, + u_int8_t e1_timeslot, u_int8_t e1_subslot, + u_int8_t tei) { struct abis_om_hdr *oh; struct abis_nm_channel *ch; struct msgb *msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); - fill_om_fom_hdr(oh, sizeof(*ch), NM_MT_BS11_SET_ATTR, + fill_om_fom_hdr(oh, sizeof(*ch)+2, NM_MT_BS11_SET_ATTR, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff); ch = (struct abis_nm_channel *) msgb_put(msg, sizeof(*ch)); fill_nm_channel(ch, e1_port, e1_timeslot, e1_subslot); + msgb_tv_put(msg, NM_ATT_TEI, tei); return abis_nm_sendmsg(bts, msg); } diff --git a/src/bs11_config.c b/src/bs11_config.c index 9fadc45c9..7605d93e0 100644 --- a/src/bs11_config.c +++ b/src/bs11_config.c @@ -92,8 +92,7 @@ static int create_objects(struct gsm_bts *bts) abis_nm_bs11_create_envaBTSE(bts, 2); abis_nm_bs11_create_envaBTSE(bts, 3); - abis_nm_bs11_conn_oml(bts, 0, 1, 0xff); - abis_nm_bs11_set_oml_tei(bts, TEI_OML); + abis_nm_bs11_conn_oml_tei(bts, 0, 1, 0xff, TEI_OML); abis_nm_bs11_set_trx_power(&bts->trx[0], BS11_TRX_POWER_GSM_30mW); @@ -440,6 +439,8 @@ static int handle_state_resp(enum abis_bs11_phase state) sleep(5); abis_nm_bs11_factory_logon(g_bts, 0); command = NULL; + } else if (!strcmp(command, "oml-tei")) { + abis_nm_bs11_conn_oml_tei(g_bts, 0, 1, 0xff, TEI_OML); } else if (!strcmp(command, "restart")) { abis_nm_bs11_restart(g_bts); command = NULL;