aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-26 16:02:04 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-21 13:53:41 +0100
commitd85642a1a7dc52a9618c56402ad85ee5f0739d0e (patch)
treec2181ee6697342c78cedf41949c2522e231c5a2c /openbsc
parent6f615551a402ea87843077e3d79d16251d53f078 (diff)
ts Make the e1inp_ts delay configurable
Currently the nanoBTS bootstrap code requires a high delay otherwise we are not bringing the device up properly. Changing the init code turns out harder than it seems like. So this is a workaround for that to allow a high speed RSL/OML connection after the bringup. The line driver can have a default TS delay. It is set to the current default for the nanoBTS and the BS11. For the ipaccess case we will set the delay lower for the RSL connection and inside the ipaccess-config we can set it low right away to have fast firmware flashing and such.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/e1_input.h3
-rw-r--r--openbsc/src/e1_input.c4
-rw-r--r--openbsc/src/input/ipaccess.c4
-rw-r--r--openbsc/src/input/misdn.c3
-rw-r--r--openbsc/src/ipaccess/ipaccess-config.c2
5 files changed, 14 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h
index 1a3d9d6ad..aa4aa392f 100644
--- a/openbsc/include/openbsc/e1_input.h
+++ b/openbsc/include/openbsc/e1_input.h
@@ -66,6 +66,8 @@ struct e1inp_ts {
struct {
/* list of all signalling links on this TS */
struct llist_head sign_links;
+ /* delay for the queue */
+ int delay;
/* timer when to dequeue next frame */
struct timer_list tx_timer;
} sign;
@@ -93,6 +95,7 @@ struct e1inp_driver {
struct llist_head list;
const char *name;
int (*want_write)(struct e1inp_ts *ts);
+ int default_delay;
};
struct e1inp_line {
diff --git a/openbsc/src/e1_input.c b/openbsc/src/e1_input.c
index 9b205b7d0..f7d69c521 100644
--- a/openbsc/src/e1_input.c
+++ b/openbsc/src/e1_input.c
@@ -303,6 +303,10 @@ int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
switch (type) {
case E1INP_TS_TYPE_SIGN:
+ if (line->driver)
+ ts->sign.delay = line->driver->default_delay;
+ else
+ ts->sign.delay = 100000;
INIT_LLIST_HEAD(&ts->sign.sign_links);
break;
case E1INP_TS_TYPE_TRAU:
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c
index 18268f6b9..03eba8b4d 100644
--- a/openbsc/src/input/ipaccess.c
+++ b/openbsc/src/input/ipaccess.c
@@ -282,6 +282,7 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg,
trx->rsl_link = e1inp_sign_link_create(e1i_ts,
E1INP_SIGN_RSL, trx,
trx->rsl_tei, 0);
+ trx->rsl_link->ts->sign.delay = 10;
/* get rid of our old temporary bfd */
memcpy(newbfd, bfd, sizeof(*newbfd));
@@ -589,7 +590,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
e1i_ts->sign.tx_timer.data = e1i_ts;
/* Reducing this might break the nanoBTS 900 init. */
- bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 100000);
+ bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
return ret;
}
@@ -622,6 +623,7 @@ static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what)
struct e1inp_driver ipaccess_driver = {
.name = "ip.access",
.want_write = ts_want_write,
+ .default_delay = 100000,
};
/* callback of the OML listening filedescriptor */
diff --git a/openbsc/src/input/misdn.c b/openbsc/src/input/misdn.c
index fa8aca02c..b36bdf8b2 100644
--- a/openbsc/src/input/misdn.c
+++ b/openbsc/src/input/misdn.c
@@ -247,7 +247,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
/* set tx delay timer for next event */
e1i_ts->sign.tx_timer.cb = timeout_ts1_write;
e1i_ts->sign.tx_timer.data = e1i_ts;
- bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000);
+ bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
return ret;
}
@@ -387,6 +387,7 @@ static int activate_bchan(struct e1inp_line *line, int ts, int act)
struct e1inp_driver misdn_driver = {
.name = "mISDNuser",
.want_write = ts_want_write,
+ .default_delay = 50000,
};
static int mi_e1_setup(struct e1inp_line *line, int release_l2)
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c
index 081239dab..98d8bccb7 100644
--- a/openbsc/src/ipaccess/ipaccess-config.c
+++ b/openbsc/src/ipaccess/ipaccess-config.c
@@ -865,6 +865,8 @@ int main(int argc, char **argv)
exit(1);
}
+ bts->oml_link->ts->sign.delay = 10;
+ bts->c0->rsl_link->ts->sign.delay = 10;
while (1) {
rc = bsc_select_main(0);
if (rc < 0)