diff options
author | Harald Welte <laforge@netfilter.org> | 2009-08-04 14:11:49 +0200 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-08-04 14:11:49 +0200 |
commit | 9e85b54799e25c857bce5861a8cc5046b2f5c6c9 (patch) | |
tree | 5ddbbcfc238124e4b627922ac40654a790cacf0c /openbsc/src/input | |
parent | 602f2b88d67cb372bc59174ef382cdd27df78b32 (diff) |
prepare mISDN driver for multiple lines/instances
In order to use multiple mISDN cards, we need to:
1) move driver initialization out of line initialization
2) make sure we allow partial (virtual) E1 cards with < 30 B-channels
Diffstat (limited to 'openbsc/src/input')
-rw-r--r-- | openbsc/src/input/misdn.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/openbsc/src/input/misdn.c b/openbsc/src/input/misdn.c index a04c2abd7..2ec74b8ea 100644 --- a/openbsc/src/input/misdn.c +++ b/openbsc/src/input/misdn.c @@ -477,14 +477,7 @@ int mi_setup(int cardnr, struct e1inp_line *line, int release_l2) int sk, ret, cnt; struct mISDN_devinfo devinfo; - /* register the driver with the core */ - /* FIXME: do this in the plugin initializer function */ - ret = e1inp_driver_register(&misdn_driver); - if (ret) - return ret; - /* create the actual line instance */ - /* FIXME: do this independent of driver registration */ e1h = talloc(tall_bsc_ctx, struct mi_e1_handle); memset(e1h, 0, sizeof(*e1h)); @@ -531,14 +524,15 @@ int mi_setup(int cardnr, struct e1inp_line *line, int release_l2) return -EINVAL; } - if (devinfo.nrbchan != 30) { - fprintf(stderr, "error: E1 card has no 30 B-channels\n"); - return -EINVAL; - } - ret = mi_e1_setup(line, release_l2); if (ret) return ret; return e1inp_line_register(line); } + +static __attribute__((constructor)) void on_dso_load_sms(void) +{ + /* register the driver with the core */ + e1inp_driver_register(&misdn_driver); +} |