blob: bb9145f446e742053572419ed5241c3a43f28812 [file] [log] [blame]
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +02001/* OpenBSC Abis input driver for mISDNuser */
2
3/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
4 * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
5 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include "internal.h"
24
25#include <stdio.h>
26#include <unistd.h>
27#include <stdlib.h>
28#include <errno.h>
29#include <string.h>
30#include <time.h>
31#include <sys/fcntl.h>
32#include <sys/socket.h>
33#include <sys/ioctl.h>
34#include <arpa/inet.h>
35#include <mISDNif.h>
36
37//#define AF_COMPATIBILITY_FUNC
38//#include <compat_af_isdn.h>
39#ifndef AF_ISDN
40#define AF_ISDN 34
41#define PF_ISDN AF_ISDN
42#endif
43
44#include <osmocom/core/select.h>
45#include <osmocom/core/msgb.h>
46#include <osmocom/core/logging.h>
Pablo Neira Ayuso177094b2011-06-07 12:21:51 +020047#include <osmocom/abis/e1_input.h>
Harald Welte71d87b22011-07-18 14:49:56 +020048#include <osmocom/core/talloc.h>
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +020049
50#define TS1_ALLOC_SIZE 300
51
52struct prim_name {
53 unsigned int prim;
54 const char *name;
55};
56
57const struct prim_name prim_names[] = {
58 { PH_CONTROL_IND, "PH_CONTROL_IND" },
59 { PH_DATA_IND, "PH_DATA_IND" },
60 { PH_DATA_CNF, "PH_DATA_CNF" },
61 { PH_ACTIVATE_IND, "PH_ACTIVATE_IND" },
62 { DL_ESTABLISH_IND, "DL_ESTABLISH_IND" },
63 { DL_ESTABLISH_CNF, "DL_ESTABLISH_CNF" },
64 { DL_RELEASE_IND, "DL_RELEASE_IND" },
65 { DL_RELEASE_CNF, "DL_RELEASE_CNF" },
66 { DL_DATA_IND, "DL_DATA_IND" },
67 { DL_UNITDATA_IND, "DL_UNITDATA_IND" },
68 { DL_INFORMATION_IND, "DL_INFORMATION_IND" },
69 { MPH_ACTIVATE_IND, "MPH_ACTIVATE_IND" },
70 { MPH_DEACTIVATE_IND, "MPH_DEACTIVATE_IND" },
71};
72
73const char *get_prim_name(unsigned int prim)
74{
75 int i;
76
77 for (i = 0; i < ARRAY_SIZE(prim_names); i++) {
78 if (prim_names[i].prim == prim)
79 return prim_names[i].name;
80 }
81
82 return "UNKNOWN";
83}
84
85static int handle_ts1_read(struct osmo_fd *bfd)
86{
87 struct e1inp_line *line = bfd->data;
88 unsigned int ts_nr = bfd->priv_nr;
89 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
90 struct e1inp_sign_link *link;
91 struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE, "mISDN TS1");
92 struct sockaddr_mISDN l2addr;
93 struct mISDNhead *hh;
94 socklen_t alen;
95 int ret;
96
97 if (!msg)
98 return -ENOMEM;
99
100 hh = (struct mISDNhead *) msg->data;
101
102 alen = sizeof(l2addr);
103 ret = recvfrom(bfd->fd, msg->data, 300, 0,
104 (struct sockaddr *) &l2addr, &alen);
105 if (ret < 0) {
106 fprintf(stderr, "recvfrom error %s\n", strerror(errno));
107 return ret;
108 }
109
110 if (alen != sizeof(l2addr)) {
Pablo Neira Ayusoc9c4fd32011-06-30 12:19:42 +0200111 fprintf(stderr, "%s error len\n", __func__);
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200112 return -EINVAL;
113 }
114
115 msgb_put(msg, ret);
116
Harald Weltecc2241b2011-07-19 16:06:06 +0200117 DEBUGP(DLMI, "alen =%d, dev(%d) channel(%d) sapi(%d) tei(%d)\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200118 alen, l2addr.dev, l2addr.channel, l2addr.sapi, l2addr.tei);
119
Harald Weltecc2241b2011-07-19 16:06:06 +0200120 DEBUGP(DLMI, "<= len = %d, prim(0x%x) id(0x%x): %s\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200121 ret, hh->prim, hh->id, get_prim_name(hh->prim));
122
123 switch (hh->prim) {
124 case DL_INFORMATION_IND:
125 /* mISDN tells us which channel number is allocated for this
126 * tuple of (SAPI, TEI). */
Harald Weltecc2241b2011-07-19 16:06:06 +0200127 DEBUGP(DLMI, "DL_INFORMATION_IND: use channel(%d) sapi(%d) tei(%d) for now\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200128 l2addr.channel, l2addr.sapi, l2addr.tei);
129 link = e1inp_lookup_sign_link(e1i_ts, l2addr.tei, l2addr.sapi);
130 if (!link) {
Harald Weltecc2241b2011-07-19 16:06:06 +0200131 DEBUGPC(DLMI, "mISDN message for unknown sign_link\n");
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200132 msgb_free(msg);
133 return -EINVAL;
134 }
135 /* save the channel number in the driver private struct */
136 link->driver.misdn.channel = l2addr.channel;
137 break;
138 case DL_ESTABLISH_IND:
Harald Weltecc2241b2011-07-19 16:06:06 +0200139 DEBUGP(DLMI, "DL_ESTABLISH_IND: channel(%d) sapi(%d) tei(%d)\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200140 l2addr.channel, l2addr.sapi, l2addr.tei);
141 /* For some strange reason, sometimes the DL_INFORMATION_IND tells
142 * us the wrong channel, and we only get the real channel number
143 * during the DL_ESTABLISH_IND */
144 link = e1inp_lookup_sign_link(e1i_ts, l2addr.tei, l2addr.sapi);
145 if (!link) {
Harald Weltecc2241b2011-07-19 16:06:06 +0200146 DEBUGPC(DLMI, "mISDN message for unknown sign_link\n");
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200147 msgb_free(msg);
148 return -EINVAL;
149 }
150 /* save the channel number in the driver private struct */
151 link->driver.misdn.channel = l2addr.channel;
Pablo Neira Ayusode668912011-08-16 17:26:23 +0200152 ret = e1inp_event(e1i_ts, S_L_INP_TEI_UP, l2addr.tei, l2addr.sapi);
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200153 break;
154 case DL_RELEASE_IND:
Harald Weltecc2241b2011-07-19 16:06:06 +0200155 DEBUGP(DLMI, "DL_RELEASE_IND: channel(%d) sapi(%d) tei(%d)\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200156 l2addr.channel, l2addr.sapi, l2addr.tei);
Pablo Neira Ayusode668912011-08-16 17:26:23 +0200157 ret = e1inp_event(e1i_ts, S_L_INP_TEI_DN, l2addr.tei, l2addr.sapi);
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200158 break;
159 case DL_DATA_IND:
160 case DL_UNITDATA_IND:
161 msg->l2h = msg->data + MISDN_HEADER_LEN;
Harald Weltecc2241b2011-07-19 16:06:06 +0200162 DEBUGP(DLMI, "RX: %s\n", osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN));
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200163 ret = e1inp_rx_ts(e1i_ts, msg, l2addr.tei, l2addr.sapi);
164 break;
165 case PH_ACTIVATE_IND:
Harald Weltecc2241b2011-07-19 16:06:06 +0200166 DEBUGP(DLMI, "PH_ACTIVATE_IND: channel(%d) sapi(%d) tei(%d)\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200167 l2addr.channel, l2addr.sapi, l2addr.tei);
168 break;
169 case PH_DEACTIVATE_IND:
Harald Weltecc2241b2011-07-19 16:06:06 +0200170 DEBUGP(DLMI, "PH_DEACTIVATE_IND: channel(%d) sapi(%d) tei(%d)\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200171 l2addr.channel, l2addr.sapi, l2addr.tei);
172 break;
173 default:
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200174 break;
175 }
176 return ret;
177}
178
179static int ts_want_write(struct e1inp_ts *e1i_ts)
180{
181 /* We never include the mISDN B-Channel FD into the
182 * writeset, since it doesn't support poll() based
183 * write flow control */
184 if (e1i_ts->type == E1INP_TS_TYPE_TRAU)
185 return 0;
186
187 e1i_ts->driver.misdn.fd.when |= BSC_FD_WRITE;
188
189 return 0;
190}
191
192static void timeout_ts1_write(void *data)
193{
194 struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data;
195
196 /* trigger write of ts1, due to tx delay timer */
197 ts_want_write(e1i_ts);
198}
199
200static int handle_ts1_write(struct osmo_fd *bfd)
201{
202 struct e1inp_line *line = bfd->data;
203 unsigned int ts_nr = bfd->priv_nr;
204 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
205 struct e1inp_sign_link *sign_link;
206 struct sockaddr_mISDN sa;
207 struct msgb *msg;
208 struct mISDNhead *hh;
209 uint8_t *l2_data;
210 int ret;
211
212 bfd->when &= ~BSC_FD_WRITE;
213
214 /* get the next msg for this timeslot */
215 msg = e1inp_tx_ts(e1i_ts, &sign_link);
216 if (!msg) {
217 /* no message after tx delay timer */
218 return 0;
219 }
220
221 l2_data = msg->data;
222
223 /* prepend the mISDNhead */
224 hh = (struct mISDNhead *) msgb_push(msg, sizeof(*hh));
225 hh->prim = DL_DATA_REQ;
226
Harald Weltecc2241b2011-07-19 16:06:06 +0200227 DEBUGP(DLMI, "TX channel(%d) TEI(%d) SAPI(%d): %s\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200228 sign_link->driver.misdn.channel, sign_link->tei,
229 sign_link->sapi, osmo_hexdump(l2_data, msg->len - MISDN_HEADER_LEN));
230
231 /* construct the sockaddr */
232 sa.family = AF_ISDN;
233 sa.sapi = sign_link->sapi;
234 sa.dev = sign_link->tei;
235 sa.channel = sign_link->driver.misdn.channel;
236
237 ret = sendto(bfd->fd, msg->data, msg->len, 0,
238 (struct sockaddr *)&sa, sizeof(sa));
239 if (ret < 0)
240 fprintf(stderr, "%s sendto failed %d\n", __func__, ret);
241 msgb_free(msg);
242
243 /* set tx delay timer for next event */
244 e1i_ts->sign.tx_timer.cb = timeout_ts1_write;
245 e1i_ts->sign.tx_timer.data = e1i_ts;
246 osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
247
248 return ret;
249}
250
251#define BCHAN_TX_GRAN 160
252/* write to a B channel TS */
253static int handle_tsX_write(struct osmo_fd *bfd)
254{
255 struct e1inp_line *line = bfd->data;
256 unsigned int ts_nr = bfd->priv_nr;
257 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
258 struct mISDNhead *hh;
259 uint8_t tx_buf[BCHAN_TX_GRAN + sizeof(*hh)];
260 struct subch_mux *mx = &e1i_ts->trau.mux;
261 int ret;
262
263 hh = (struct mISDNhead *) tx_buf;
264 hh->prim = PH_DATA_REQ;
265
266 subchan_mux_out(mx, tx_buf+sizeof(*hh), BCHAN_TX_GRAN);
267
Harald Weltecc2241b2011-07-19 16:06:06 +0200268 DEBUGP(DLMIB, "BCHAN TX: %s\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200269 osmo_hexdump(tx_buf+sizeof(*hh), BCHAN_TX_GRAN));
270
271 ret = send(bfd->fd, tx_buf, sizeof(*hh) + BCHAN_TX_GRAN, 0);
272 if (ret < sizeof(*hh) + BCHAN_TX_GRAN)
Harald Weltecc2241b2011-07-19 16:06:06 +0200273 DEBUGP(DLMIB, "send returns %d instead of %zu\n", ret,
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200274 sizeof(*hh) + BCHAN_TX_GRAN);
275
276 return ret;
277}
278
279#define TSX_ALLOC_SIZE 4096
280/* FIXME: read from a B channel TS */
281static int handle_tsX_read(struct osmo_fd *bfd)
282{
283 struct e1inp_line *line = bfd->data;
284 unsigned int ts_nr = bfd->priv_nr;
285 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
286 struct msgb *msg = msgb_alloc(TSX_ALLOC_SIZE, "mISDN TSx");
287 struct mISDNhead *hh;
288 int ret;
289
290 if (!msg)
291 return -ENOMEM;
292
293 hh = (struct mISDNhead *) msg->data;
294
295 ret = recv(bfd->fd, msg->data, TSX_ALLOC_SIZE, 0);
296 if (ret < 0) {
297 fprintf(stderr, "recvfrom error %s\n", strerror(errno));
298 return ret;
299 }
300
301 msgb_put(msg, ret);
302
303 if (hh->prim != PH_CONTROL_IND)
Harald Weltecc2241b2011-07-19 16:06:06 +0200304 DEBUGP(DLMIB, "<= BCHAN len = %d, prim(0x%x) id(0x%x): %s\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200305 ret, hh->prim, hh->id, get_prim_name(hh->prim));
306
307 switch (hh->prim) {
308 case PH_DATA_IND:
309 msg->l2h = msg->data + MISDN_HEADER_LEN;
Harald Weltecc2241b2011-07-19 16:06:06 +0200310 DEBUGP(DLMIB, "BCHAN RX: %s\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200311 osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN));
312 ret = e1inp_rx_ts(e1i_ts, msg, 0, 0);
313 break;
314 case PH_ACTIVATE_IND:
315 case PH_DATA_CNF:
316 /* physical layer indicates that data has been sent,
317 * we thus can send some more data */
318 ret = handle_tsX_write(bfd);
319 default:
320 break;
321 }
322 /* FIXME: why do we free signalling msgs in the caller, and trau not? */
323 msgb_free(msg);
324
325 return ret;
326}
327
328/* callback from select.c in case one of the fd's can be read/written */
329static int misdn_fd_cb(struct osmo_fd *bfd, unsigned int what)
330{
331 struct e1inp_line *line = bfd->data;
332 unsigned int ts_nr = bfd->priv_nr;
333 unsigned int idx = ts_nr-1;
334 struct e1inp_ts *e1i_ts = &line->ts[idx];
335 int rc = 0;
336
337 switch (e1i_ts->type) {
338 case E1INP_TS_TYPE_SIGN:
339 if (what & BSC_FD_READ)
340 rc = handle_ts1_read(bfd);
341 if (what & BSC_FD_WRITE)
342 rc = handle_ts1_write(bfd);
343 break;
344 case E1INP_TS_TYPE_TRAU:
345 if (what & BSC_FD_READ)
346 rc = handle_tsX_read(bfd);
347 /* We never include the mISDN B-Channel FD into the
348 * writeset, since it doesn't support poll() based
349 * write flow control */
350 break;
351 default:
352 fprintf(stderr, "unknown E1 TS type %u\n", e1i_ts->type);
353 break;
354 }
355
356 return rc;
357}
358
359static int activate_bchan(struct e1inp_line *line, int ts, int act)
360{
361 struct mISDNhead hh;
362 int ret;
363 unsigned int idx = ts-1;
364 struct e1inp_ts *e1i_ts = &line->ts[idx];
365 struct osmo_fd *bfd = &e1i_ts->driver.misdn.fd;
366
367 fprintf(stdout, "activate bchan\n");
368 if (act)
369 hh.prim = PH_ACTIVATE_REQ;
370 else
371 hh.prim = PH_DEACTIVATE_REQ;
372
373 hh.id = MISDN_ID_ANY;
374 ret = sendto(bfd->fd, &hh, sizeof(hh), 0, NULL, 0);
375 if (ret < 0) {
376 fprintf(stdout, "could not send ACTIVATE_RQ %s\n",
377 strerror(errno));
378 }
379
380 return ret;
381}
382
Pablo Neira Ayuso4e862cb2011-08-19 18:43:38 +0200383static int mi_e1_line_update(struct e1inp_line *line);
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200384
385struct e1inp_driver misdn_driver = {
386 .name = "misdn",
387 .want_write = ts_want_write,
388 .default_delay = 50000,
389 .line_update = &mi_e1_line_update,
390};
391
392static int mi_e1_setup(struct e1inp_line *line, int release_l2)
393{
394 int ts, ret;
395
396 /* TS0 is CRC4, don't need any fd for it */
397 for (ts = 1; ts < NUM_E1_TS; ts++) {
398 unsigned int idx = ts-1;
399 struct e1inp_ts *e1i_ts = &line->ts[idx];
400 struct osmo_fd *bfd = &e1i_ts->driver.misdn.fd;
401 struct sockaddr_mISDN addr;
402
403 bfd->data = line;
404 bfd->priv_nr = ts;
405 bfd->cb = misdn_fd_cb;
406
407 switch (e1i_ts->type) {
408 case E1INP_TS_TYPE_NONE:
409 continue;
410 break;
411 case E1INP_TS_TYPE_SIGN:
412 bfd->fd = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_LAPD_NT);
413 bfd->when = BSC_FD_READ;
414 break;
415 case E1INP_TS_TYPE_TRAU:
416 bfd->fd = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_B_RAW);
417 /* We never include the mISDN B-Channel FD into the
418 * writeset, since it doesn't support poll() based
419 * write flow control */
420 bfd->when = BSC_FD_READ;
421 break;
422 }
423
424 if (bfd->fd < 0) {
425 fprintf(stderr, "%s could not open socket %s\n",
426 __func__, strerror(errno));
427 return bfd->fd;
428 }
429
430 memset(&addr, 0, sizeof(addr));
431 addr.family = AF_ISDN;
432 addr.dev = line->num;
433 switch (e1i_ts->type) {
434 case E1INP_TS_TYPE_SIGN:
435 addr.channel = 0;
436 /* SAPI not supported yet in kernel */
437 //addr.sapi = e1inp_ts->sign.sapi;
438 addr.sapi = 0;
439 addr.tei = GROUP_TEI;
440 break;
441 case E1INP_TS_TYPE_TRAU:
442 addr.channel = ts;
443 break;
444 default:
Harald Weltecc2241b2011-07-19 16:06:06 +0200445 DEBUGP(DLMI, "unsupported E1 TS type: %u\n",
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200446 e1i_ts->type);
447 break;
448 }
449
450 ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr));
451 if (ret < 0) {
452 fprintf(stderr, "could not bind l2 socket %s\n",
453 strerror(errno));
454 return -EIO;
455 }
456
457 if (e1i_ts->type == E1INP_TS_TYPE_SIGN) {
458 ret = ioctl(bfd->fd, IMCLEAR_L2, &release_l2);
459 if (ret < 0) {
460 fprintf(stderr, "could not send IOCTL IMCLEAN_L2 %s\n", strerror(errno));
461 return -EIO;
462 }
463 }
464
465 /* FIXME: only activate B-Channels once we start to
466 * use them to conserve CPU power */
467 if (e1i_ts->type == E1INP_TS_TYPE_TRAU)
468 activate_bchan(line, ts, 1);
469
470 ret = osmo_fd_register(bfd);
471 if (ret < 0) {
472 fprintf(stderr, "could not register FD: %s\n",
473 strerror(ret));
474 return ret;
475 }
476 }
477
478 return 0;
479}
480
Pablo Neira Ayuso4e862cb2011-08-19 18:43:38 +0200481static int mi_e1_line_update(struct e1inp_line *line)
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200482{
483 struct mISDN_devinfo devinfo;
484 int sk, ret, cnt;
485
486 if (line->driver != &misdn_driver)
487 return -EINVAL;
488
489 /* open the ISDN card device */
490 sk = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
491 if (sk < 0) {
492 fprintf(stderr, "%s could not open socket %s\n",
493 __func__, strerror(errno));
494 return sk;
495 }
496
497 ret = ioctl(sk, IMGETCOUNT, &cnt);
498 if (ret) {
499 fprintf(stderr, "%s error getting interf count: %s\n",
500 __func__, strerror(errno));
501 close(sk);
502 return -ENODEV;
503 }
Harald Weltecc2241b2011-07-19 16:06:06 +0200504 //DEBUGP(DLMI,"%d device%s found\n", cnt, (cnt==1)?"":"s");
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200505 printf("%d device%s found\n", cnt, (cnt==1)?"":"s");
506#if 1
507 devinfo.id = line->num;
508 ret = ioctl(sk, IMGETDEVINFO, &devinfo);
509 if (ret < 0) {
510 fprintf(stdout, "error getting info for device %d: %s\n",
511 line->num, strerror(errno));
512 return -ENODEV;
513 }
514 fprintf(stdout, " id: %d\n", devinfo.id);
515 fprintf(stdout, " Dprotocols: %08x\n", devinfo.Dprotocols);
516 fprintf(stdout, " Bprotocols: %08x\n", devinfo.Bprotocols);
517 fprintf(stdout, " protocol: %d\n", devinfo.protocol);
518 fprintf(stdout, " nrbchan: %d\n", devinfo.nrbchan);
519 fprintf(stdout, " name: %s\n", devinfo.name);
520#endif
521
522 if (!(devinfo.Dprotocols & (1 << ISDN_P_NT_E1))) {
523 fprintf(stderr, "error: card is not of type E1 (NT-mode)\n");
524 return -EINVAL;
525 }
526
527 ret = mi_e1_setup(line, 1);
528 if (ret)
529 return ret;
530
531 return 0;
532}
533
534void e1inp_misdn_init(void)
535{
536 /* register the driver with the core */
537 e1inp_driver_register(&misdn_driver);
538}