aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-07-08 15:05:42 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2011-07-08 15:05:42 +0200
commit1ca98b9e9d9861928a735cdbcfdde5916befccd1 (patch)
tree13b8bfc76ee9e6f77254b2e703c0faf7544945f9 /tests
parentcdd7c783631a71d23912ed1e59b209a2b6e7872a (diff)
tests: use the virtual E1 line used by OML for RSL link
The ipaccess driver is tricky. Since it uses two ports for OML and RSL links, the link for RSL needs to be done in the same line that the OML link. Now the BSC examples uses the virtual E1 line where the OML link is for the RSL one. This patch also verifies that the OML link is up before the someone tries to get the RSL link up.
Diffstat (limited to 'tests')
-rw-r--r--tests/e1inp_ipa_bsc_test.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/e1inp_ipa_bsc_test.c b/tests/e1inp_ipa_bsc_test.c
index 7522e56..3885dc9 100644
--- a/tests/e1inp_ipa_bsc_test.c
+++ b/tests/e1inp_ipa_bsc_test.c
@@ -24,6 +24,7 @@ static struct e1inp_sign_link *
sign_link_up(void *dev, struct e1inp_line *line, enum e1inp_sign_type type)
{
struct e1inp_sign_link *sign_link = NULL;
+ struct e1inp_line *oml_line;
switch(type) {
case E1INP_SIGN_OML:
@@ -34,11 +35,20 @@ sign_link_up(void *dev, struct e1inp_line *line, enum e1inp_sign_type type)
E1INP_SIGN_OML, NULL, 255, 0);
break;
case E1INP_SIGN_RSL:
+ if (!oml_sign_link) {
+ LOGP(DBSCTEST, LOGL_ERROR, "OML link not yet set, "
+ "giving up\n");
+ return NULL;
+ }
LOGP(DBSCTEST, LOGL_NOTICE, "RSL link up request received.\n");
- e1inp_ts_config_sign(&line->ts[E1INP_SIGN_RSL - 1], line);
+
+ /* We have to use the same line that the OML link. */
+ oml_line = oml_sign_link->ts->line;
+ e1inp_ts_config_sign(&oml_line->ts[E1INP_SIGN_RSL - 1],
+ oml_line);
sign_link = rsl_sign_link =
- e1inp_sign_link_create(&line->ts[E1INP_SIGN_RSL - 1],
- E1INP_SIGN_OML, NULL, 0, 0);
+ e1inp_sign_link_create(&oml_line->ts[E1INP_SIGN_RSL - 1],
+ E1INP_SIGN_RSL, NULL, 0, 0);
break;
default:
break;