Hello,
second try to add support to bs11_config for bport0/1 configuration. This time with enum abis_bs11_line_cfg. It seems sometimes creating bport1 fails, even LMT shows create obj greyed out. Don't know why yet.
Regards, Daniel Willmann
Daniel Willmann (1): Add {create,delete}-bport1 and bport0-{star,multidrop} to bs11-config
openbsc/include/openbsc/abis_nm.h | 10 +++++++++- openbsc/src/abis_nm.c | 31 +++++++++++++++++++++++++++++-- openbsc/src/bs11_config.c | 26 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 3 deletions(-)
This adds the possibility to bs11-config to add the second bport and change the line config to star or multidrop. --- openbsc/include/openbsc/abis_nm.h | 10 +++++++++- openbsc/src/abis_nm.c | 31 +++++++++++++++++++++++++++++-- openbsc/src/bs11_config.c | 26 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index d8cd9fa..112b56e 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -589,6 +589,12 @@ enum abis_bs11_li_pll_mode { BS11_LI_PLL_STANDALONE = 3, };
+enum abis_bs11_line_cfg { + BS11_LINE_CFG_STAR = 0x00, + BS11_LINE_CFG_MULTIDROP = 0x01, + BS11_LINE_CFG_LOOP = 0x02, +}; + enum abis_bs11_phase { BS11_STATE_SOFTWARE_RQD = 0x01, BS11_STATE_LOAD_SMU_INTENDED = 0x11, @@ -654,7 +660,7 @@ int abis_nm_tlv_parse(struct tlv_parsed *tp, const u_int8_t *buf, int len); int abis_nm_rx(struct msgb *msg); int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8_t i1, u_int8_t i2); int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, - u_int8_t i1, u_int8_t i2, u_int8_t adm_state); + u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state); int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr, u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot, u_int8_t tei); @@ -695,6 +701,7 @@ 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_delete_bport(struct gsm_bts *bts, u_int8_t idx); 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); @@ -710,6 +717,7 @@ int abis_nm_bs11_get_state(struct gsm_bts *bts); int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, u_int8_t win_size, int forced, gsm_cbfn *cbfn); int abis_nm_bs11_set_ext_time(struct gsm_bts *bts); +int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport, enum abis_bs11_line_cfg line_cfg); int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect); int abis_nm_bs11_restart(struct gsm_bts *bts);
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index 31f1df0..ea18c2f 100644 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -1755,7 +1755,7 @@ int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8
/* Chapter 8.8.5 */ int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, - u_int8_t i1, u_int8_t i2, u_int8_t adm_state) + u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state) { struct abis_om_hdr *oh; struct msgb *msg = nm_msgb_alloc(); @@ -1934,7 +1934,19 @@ int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx)
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, 0, NM_MT_BS11_CREATE_OBJ, NM_OC_BS11_BPORT, - idx, 0, 0); + idx, 0xff, 0xff); + + return abis_nm_sendmsg(bts, msg); +} + +int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx) +{ + 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, 0, NM_MT_BS11_DELETE_OBJ, NM_OC_BS11_BPORT, + idx, 0xff, 0xff);
return abis_nm_sendmsg(bts, msg); } @@ -2322,6 +2334,21 @@ int abis_nm_bs11_set_ext_time(struct gsm_bts *bts) return abis_nm_sendmsg(bts, msg); }
+int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport, enum abis_bs11_line_cfg line_cfg) +{ + struct abis_om_hdr *oh; + struct msgb *msg = nm_msgb_alloc(); + struct bs11_date_time aet; + + get_bs11_date_time(&aet); + 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_BS11_BPORT, + bport, 0xff, 0x02); + msgb_tv_put(msg, NM_ATT_BS11_LINE_CFG, line_cfg); + + return abis_nm_sendmsg(bts, msg); +} + /* ip.access nanoBTS specific commands */ static const char ipaccess_magic[] = "com.ipaccess";
diff --git a/openbsc/src/bs11_config.c b/openbsc/src/bs11_config.c index 0fb7cd7..3e8bf88 100644 --- a/openbsc/src/bs11_config.c +++ b/openbsc/src/bs11_config.c @@ -541,6 +541,28 @@ static int handle_state_resp(enum abis_bs11_phase state) command = NULL; } else if (!strcmp(command, "query")) { cmd_query(); + } else if (!strcmp(command, "create-bport1")) { + abis_nm_bs11_create_bport(g_bts, 1); + sleep(1); + abis_nm_bs11_factory_logon(g_bts, 0); + command = NULL; + } else if (!strcmp(command, "delete-bport1")) { + abis_nm_chg_adm_state(g_bts, NM_OC_BS11_BPORT, 1, 0xff, 0xff, NM_STATE_LOCKED); + sleep(1); + abis_nm_bs11_delete_bport(g_bts, 1); + sleep(1); + abis_nm_bs11_factory_logon(g_bts, 0); + command = NULL; + } else if (!strcmp(command, "bport0-star")) { + abis_nm_bs11_set_bport_line_cfg(g_bts, 0, BS11_LINE_CFG_STAR); + sleep(1); + abis_nm_bs11_factory_logon(g_bts, 0); + command = NULL; + } else if (!strcmp(command, "bport0-multidrop")) { + abis_nm_bs11_set_bport_line_cfg(g_bts, 0, BS11_LINE_CFG_MULTIDROP); + sleep(1); + abis_nm_bs11_factory_logon(g_bts, 0); + command = NULL; } } break; @@ -692,6 +714,10 @@ static void print_help(void) printf("\tpll-e1-locked\tSet the PLL to be locked to E1 clock\n"); printf("\tpll-standalone\tSet the PLL to be in standalone mode\n"); printf("\toml-tei\tSet OML E1 TS and TEI\n"); + printf("\tbport0-star\tSet BPORT0 line config to star\n"); + printf("\tbport0-multiport\tSet BPORT0 line config to multiport\n"); + printf("\tcreate-bport1\tCreate BPORT1 object\n"); + printf("\tdelete-bport1\tDelete BPORT1 object\n"); }
static void handle_options(int argc, char **argv)
On Sun, Aug 09, 2009 at 07:03:30PM +0200, Daniel Willmann wrote:
Hello,
second try to add support to bs11_config for bport0/1 configuration. This time with enum abis_bs11_line_cfg. It seems sometimes creating bport1 fails, even LMT shows create obj greyed out. Don't know why yet.
thanks, applied.
Hi Folks,
When i want to load the hfcmulti driver i get the following output:
[ 796.302786] Unknown HFC multiport controller (vendor:1397 device:30b1 subvendor:ffffffff subdevice:ffffffff) [ 796.302891] Please contact the driver maintainer for support
Does anyone know whats going wrong here? When i take another HFC-E1 card everything works fine.
The problem seems to be not new see here: http://www.ip-phone-forum.de/showthread.php?t=196275 and here http://article.gmane.org/gmane.linux.isdn.i4l.user/3707
regards. Philipp
On Monday 17 August 2009 19:37:08 dexter wrote:
Hi Folks,
When i want to load the hfcmulti driver i get the following output:
[ 796.302786] Unknown HFC multiport controller (vendor:1397 device:30b1 subvendor:ffffffff subdevice:ffffffff) [ 796.302891] Please contact the driver maintainer for support
Does anyone know whats going wrong here? When i take another HFC-E1 card everything works fine.
Stupid question... could you check the jumpers on your card?
z.
Hi all,
getting back to a very old post:
On Sun, Aug 09, 2009 at 07:03:30PM +0200, Daniel Willmann wrote:
It seems sometimes creating bport1 fails, even LMT shows create obj greyed out. Don't know why yet.
I discovered that this happens when you wnat to create BPORT1 while BPORT0 is in star mode. You have to set BPORT0 to multi-drop _before_ creating BPORT1.