* set OML TEI and E1 timeslot in one command

* introduce new 'oml-tei' command of bs11_config
This commit is contained in:
Harald Welte 2009-02-21 20:15:32 +00:00
parent fd2fb458ac
commit b6c92ae782
3 changed files with 11 additions and 22 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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;