Dear Holger,
I think I found a better way for initialization. The attached version of the
patch builds against latest master OpenBSC, contains the fixes I missed from
the previous version.
Tested:
1. Without using the config parameter, the reset timer defaults to 15 seconds
(as before),
2. With the configuration parameter, the reset timer will use the specified
value.
Tested with: InSite (daisy chained, two BTSes), MetroSite and UltraSite units.
Will create another patch for hopping (both baseband and sytheiser hopping
works, but it needs a change in the sourcecode, like the reset timer before).
There is another minor problem at the moment: UltraSite needs additional time
after OMU configuration done, before it can bootstrap the RSL links. This is
due to the fact that UltraSite starts to load the TRX SW after it got the "Use
current" command, and it takes arouned 45-50 seconds for the TRXes to be ready
for LAPD. So to first RSL bootstrap should be delayed after OMU config complete
is received by the BSC. Now the RSL link is bootstrapped right after the OMU is
configured and the LAPD link times out way before the TRX will be ready for
LAPD. Will try to create a patch for this too, until then, a small hack can
make this problem go away (changing n200 parameter to 100).
Regards,
Csaba
----- Eredeti üzenet -----
Feladó: "Holger Hans Peter Freyther" <[email protected]>
Címzett: "Sipos Csaba" <[email protected]>
Elküldött üzenetek: Hétfő, 2015. Február. 2. 9:50:50
Tárgy: Re: Patch for OpenBSC [Nokia Site family]
On Sun, Feb 01, 2015 at 10:53:19PM +0100, Sipos Csaba wrote:
> Can you please tell me where should I initialize the timer, when the config
> parameter is not used (user not specified it in the cfg file)?
>
> I tried to look at other parts of the code but I don't see where the default
> values are stored, if a parameter is not set in the config file.
>
> Otherwise I fixed the remaining problems.
It is not the best place but gsm_bts_alloc would allow you to
initialize this field correctly. The other option would be when
the type of the bts is set to nokia.
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index ac54fb2..9fdcbf3 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -644,6 +644,7 @@ struct gsm_bts {
unsigned int configured:1,
skip_reset:1,
no_loc_rel_cnf:1,
+ bts_reset_timer_cnf,
did_reset:1,
wait_reset:1;
struct osmo_timer_list reset_timer;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 588be26..af30f39 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -605,6 +605,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " nokia_site skip-reset %d%s", bts->nokia.skip_reset, VTY_NEWLINE);
vty_out(vty, " nokia_site no-local-rel-conf %d%s",
bts->nokia.no_loc_rel_cnf, VTY_NEWLINE);
+ vty_out(vty, " nokia_site bts-reset-timer %d%s", bts->nokia.bts_reset_timer_cnf, VTY_NEWLINE);
/* fall through: Nokia requires "oml e1" parameters also */
default:
config_write_e1_link(vty, &bts->oml_e1_link, " oml ");
@@ -1837,6 +1838,25 @@ DEFUN(cfg_bts_nokia_site_no_loc_rel_cnf,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_nokia_site_bts_reset_timer_cnf,
+ cfg_bts_nokia_site_bts_reset_timer_cnf_cmd,
+ "nokia_site bts-reset-timer <15-100>",
+ NOKIA_STR
+ "The amount of time (in sec.) between BTS_RESET is sent,\n"
+ "and the BTS is being bootstrapped.\n")
+{
+ struct gsm_bts *bts = vty->index;
+
+ if (!is_nokia_bts(bts)) {
+ vty_out(vty, "%% BTS is not of Nokia *Site type%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ bts->nokia.bts_reset_timer_cnf = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
#define OML_STR "Organization & Maintenance Link\n"
#define IPA_STR "A-bis/IP Specific Options\n"
@@ -3420,6 +3440,7 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_no_timezone_cmd);
install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd);
install_element(BTS_NODE, &cfg_bts_nokia_site_no_loc_rel_cnf_cmd);
+ install_element(BTS_NODE, &cfg_bts_nokia_site_bts_reset_timer_cnf_cmd);
install_element(BTS_NODE, &cfg_bts_stream_id_cmd);
install_element(BTS_NODE, &cfg_bts_oml_e1_cmd);
install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd);
diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/openbsc/src/libbsc/bts_nokia_site.c
index 376a048..bf8ac1c 100644
--- a/openbsc/src/libbsc/bts_nokia_site.c
+++ b/openbsc/src/libbsc/bts_nokia_site.c
@@ -42,8 +42,6 @@
/* TODO: put in a separate file ? */
-#define RESET_INTERVAL 15, 0 /* 15 seconds */
-
extern int abis_nm_sendmsg(struct gsm_bts *bts, struct msgb *msg);
/* was static in system_information.c */
extern int generate_cell_chan_list(uint8_t * chan_list, struct gsm_bts *bts);
@@ -1147,7 +1146,7 @@ static int abis_nm_reset(struct gsm_bts *bts, uint16_t ref)
{
uint8_t *data = reset;
int len_data = sizeof(reset);
-
+ LOGP(DLINP, LOGL_INFO, "Nokia BTS reset timer: %d\n", bts->nokia.bts_reset_timer_cnf);
return abis_nm_send(bts, NOKIA_MSG_RESET_REQ, ref, data, len_data);
}
@@ -1564,7 +1563,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
bts->nokia.reset_timer.cb = &reset_timer_cb;
bts->nokia.reset_timer.data = bts;
- osmo_timer_schedule(&bts->nokia.reset_timer, RESET_INTERVAL);
+ osmo_timer_schedule(&bts->nokia.reset_timer, bts->nokia.bts_reset_timer_cnf, 0);
struct gsm_e1_subslot *e1_link = &bts->oml_e1_link;
struct e1inp_line *line;
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index ef98f7d..5fd3ad3 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -284,6 +284,8 @@ int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type)
case GSM_BTS_TYPE_BS11:
case GSM_BTS_TYPE_UNKNOWN:
case GSM_BTS_TYPE_NOKIA_SITE:
+ /* Set default BTS reset timer */
+ bts->nokia.bts_reset_timer_cnf = 15;
case _NUM_GSM_BTS_TYPE:
break;
}