blob: 7a3c2beaece5e524700dbdab2900a9d6c0565a34 [file] [log] [blame]
Matthew Fredricksond105e202010-02-16 22:07:04 +01001/* OpenBSC Abis input driver for DAHDI */
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +01002
Harald Welteba0db5b2011-02-04 21:33:14 +01003/* (C) 2008-2011 by Harald Welte <laforge@gnumonks.org>
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +01004 * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
Matthew Fredricksond105e202010-02-16 22:07:04 +01005 * (C) 2010 by Digium and Matthew Fredrickson <creslin@digium.com>
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +01006 *
7 * All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 *
23 */
24
Harald Welteca17ef82011-02-05 15:13:27 +010025#include "../../bscconfig.h"
26
27#ifdef HAVE_DAHDI_USER_H
28
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010029#include <stdio.h>
30#include <unistd.h>
31#include <stdlib.h>
32#include <errno.h>
33#include <string.h>
34#include <time.h>
35#include <sys/fcntl.h>
36#include <sys/types.h>
37#include <sys/socket.h>
38#include <sys/ioctl.h>
39#include <arpa/inet.h>
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050040#include <dahdi/user.h>
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010041
Harald Welte1dd68c32011-02-05 13:58:46 +010042#include <osmocore/select.h>
43#include <osmocore/msgb.h>
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010044#include <openbsc/debug.h>
45#include <openbsc/gsm_data.h>
46#include <openbsc/abis_nm.h>
47#include <openbsc/abis_rsl.h>
48#include <openbsc/subchan_demux.h>
49#include <openbsc/e1_input.h>
Harald Welte1dd68c32011-02-05 13:58:46 +010050#include <osmocore/talloc.h>
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010051
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010052#include "lapd.h"
53
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010054#define TS1_ALLOC_SIZE 300
55
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010056static int handle_ts1_read(struct bsc_fd *bfd)
57{
58 struct e1inp_line *line = bfd->data;
59 unsigned int ts_nr = bfd->priv_nr;
60 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
61 struct e1inp_sign_link *link;
Matthew Fredricksonbc6649e2010-02-16 22:01:36 +010062 struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE, "DAHDI TS1");
Harald Welteba0db5b2011-02-04 21:33:14 +010063 lapd_mph_type prim;
64 unsigned int sapi, tei;
65 int ilen, ret;
Harald Welted38f1052011-02-05 19:13:00 +010066 uint8_t *idata;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010067
68 if (!msg)
69 return -ENOMEM;
70
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050071 ret = read(bfd->fd, msg->data, TS1_ALLOC_SIZE - 16);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010072 if (ret < 0) {
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010073 perror("read ");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010074 }
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050075 msgb_put(msg, ret - 2);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010076 if (ret <= 3) {
77 perror("read ");
78 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010079
Harald Welteba0db5b2011-02-04 21:33:14 +010080 sapi = msg->data[0] >> 2;
81 tei = msg->data[1] >> 1;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050082
Harald Welteba0db5b2011-02-04 21:33:14 +010083 DEBUGP(DMI, "<= len = %d, sapi(%d) tei(%d)", ret, sapi, tei);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010084
Harald Welted38f1052011-02-05 19:13:00 +010085 idata = lapd_receive(e1i_ts->driver.dahdi.lapd, msg->data, msg->len, &ilen, &prim);
86 if (!idata)
87 return -EIO;
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010088
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010089 msgb_pull(msg, 2);
90
Harald Welteba0db5b2011-02-04 21:33:14 +010091 DEBUGP(DMI, "prim %08x\n", prim);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010092
Harald Welteba0db5b2011-02-04 21:33:14 +010093 switch (prim) {
94 case 0:
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010095 break;
Harald Welteba0db5b2011-02-04 21:33:14 +010096 case LAPD_MPH_ACTIVATE_IND:
97 DEBUGP(DMI, "MPH_ACTIVATE_IND: sapi(%d) tei(%d)\n", sapi, tei);
98 ret = e1inp_event(e1i_ts, EVT_E1_TEI_UP, tei, sapi);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010099 break;
Harald Welteba0db5b2011-02-04 21:33:14 +0100100 case LAPD_MPH_DEACTIVATE_IND:
101 DEBUGP(DMI, "MPH_DEACTIVATE_IND: sapi(%d) tei(%d)\n", sapi, tei);
102 ret = e1inp_event(e1i_ts, EVT_E1_TEI_DN, tei, sapi);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +0100103 break;
Harald Welteba0db5b2011-02-04 21:33:14 +0100104 case LAPD_DL_DATA_IND:
105 case LAPD_DL_UNITDATA_IND:
Harald Welte1dd68c32011-02-05 13:58:46 +0100106 if (prim == LAPD_DL_DATA_IND)
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500107 msg->l2h = msg->data + 2;
108 else
109 msg->l2h = msg->data + 1;
110 DEBUGP(DMI, "RX: %s\n", hexdump(msgb_l2(msg), ret));
Harald Welteba0db5b2011-02-04 21:33:14 +0100111 ret = e1inp_rx_ts(e1i_ts, msg, tei, sapi);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100112 break;
113 default:
Harald Welteba0db5b2011-02-04 21:33:14 +0100114 printf("ERROR: unknown prim\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100115 break;
116 }
Harald Welteba0db5b2011-02-04 21:33:14 +0100117
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500118 DEBUGP(DMI, "Returned ok\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100119 return ret;
120}
121
122static int ts_want_write(struct e1inp_ts *e1i_ts)
123{
Harald Welteba0db5b2011-02-04 21:33:14 +0100124 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100125 * writeset, since it doesn't support poll() based
126 * write flow control */
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500127 if (e1i_ts->type == E1INP_TS_TYPE_TRAU) {
128 fprintf(stderr, "Trying to write TRAU ts\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100129 return 0;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500130 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100131
Harald Welted38f1052011-02-05 19:13:00 +0100132 e1i_ts->driver.dahdi.fd.when |= BSC_FD_WRITE;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100133
134 return 0;
135}
136
137static void timeout_ts1_write(void *data)
138{
139 struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data;
140
141 /* trigger write of ts1, due to tx delay timer */
142 ts_want_write(e1i_ts);
143}
144
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500145static void dahdi_write_msg(uint8_t *data, int len, void *cbdata)
146{
147 struct bsc_fd *bfd = cbdata;
148 int ret;
149
150 ret = write(bfd->fd, data, len + 2);
151
152 if (ret < 0)
153 fprintf(stderr, "%s write failed %d\n", __func__, ret);
154}
155
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100156static int handle_ts1_write(struct bsc_fd *bfd)
157{
158 struct e1inp_line *line = bfd->data;
159 unsigned int ts_nr = bfd->priv_nr;
160 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
161 struct e1inp_sign_link *sign_link;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100162 struct msgb *msg;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100163
164 bfd->when &= ~BSC_FD_WRITE;
165
166 /* get the next msg for this timeslot */
167 msg = e1inp_tx_ts(e1i_ts, &sign_link);
168 if (!msg) {
169 /* no message after tx delay timer */
170 return 0;
171 }
172
Harald Welted38f1052011-02-05 19:13:00 +0100173 lapd_transmit(e1i_ts->driver.dahdi.lapd, sign_link->tei, msg->data, msg->len);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100174 msgb_free(msg);
175
176 /* set tx delay timer for next event */
177 e1i_ts->sign.tx_timer.cb = timeout_ts1_write;
178 e1i_ts->sign.tx_timer.data = e1i_ts;
179 bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000);
180
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500181 return 0;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100182}
183
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500184
185static int invertbits = 1;
186
187static u_int8_t flip_table[256];
188
189static void init_flip_bits(void)
190{
191 int i,k;
192
193 for (i = 0 ; i < 256 ; i++) {
194 u_int8_t sample = 0 ;
195 for (k = 0; k<8; k++) {
196 if ( i & 1 << k ) sample |= 0x80 >> k;
197 }
198 flip_table[i] = sample;
199 }
200}
201
202static u_int8_t * flip_buf_bits ( u_int8_t * buf , int len)
203{
204 int i;
creslin287cd8b86f2010-03-26 12:57:31 -0500205 u_int8_t * start = buf;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500206
207 for (i = 0 ; i < len; i++) {
208 buf[i] = flip_table[(u_int8_t)buf[i]];
209 }
210
211 return start;
212}
213
creslin287cd8b86f2010-03-26 12:57:31 -0500214#define D_BCHAN_TX_GRAN 160
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100215/* write to a B channel TS */
216static int handle_tsX_write(struct bsc_fd *bfd)
217{
218 struct e1inp_line *line = bfd->data;
219 unsigned int ts_nr = bfd->priv_nr;
220 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500221 u_int8_t tx_buf[D_BCHAN_TX_GRAN];
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100222 struct subch_mux *mx = &e1i_ts->trau.mux;
223 int ret;
224
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500225 ret = subchan_mux_out(mx, tx_buf, D_BCHAN_TX_GRAN);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100226
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500227 if (ret != D_BCHAN_TX_GRAN) {
228 fprintf(stderr, "Huh, got ret of %d\n", ret);
229 if (ret < 0)
230 return ret;
231 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100232
233 DEBUGP(DMIB, "BCHAN TX: %s\n",
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500234 hexdump(tx_buf, D_BCHAN_TX_GRAN));
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100235
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500236 if (invertbits) {
237 flip_buf_bits(tx_buf, ret);
238 }
239
240 ret = write(bfd->fd, tx_buf, ret);
241 if (ret < D_BCHAN_TX_GRAN)
Harald Welte1dd68c32011-02-05 13:58:46 +0100242 fprintf(stderr, "send returns %d instead of %d\n", ret,
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500243 D_BCHAN_TX_GRAN);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100244
245 return ret;
246}
247
creslin287cd8b86f2010-03-26 12:57:31 -0500248#define D_TSX_ALLOC_SIZE (D_BCHAN_TX_GRAN)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100249/* FIXME: read from a B channel TS */
250static int handle_tsX_read(struct bsc_fd *bfd)
251{
252 struct e1inp_line *line = bfd->data;
253 unsigned int ts_nr = bfd->priv_nr;
254 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500255 struct msgb *msg = msgb_alloc(D_TSX_ALLOC_SIZE, "DAHDI TSx");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100256 int ret;
257
258 if (!msg)
259 return -ENOMEM;
260
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500261 ret = read(bfd->fd, msg->data, D_TSX_ALLOC_SIZE);
262 if (ret < 0 || ret != D_TSX_ALLOC_SIZE) {
263 fprintf(stderr, "read error %d %s\n", ret, strerror(errno));
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100264 return ret;
265 }
266
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500267 if (invertbits) {
268 flip_buf_bits(msg->data, ret);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100269 }
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500270
271 msgb_put(msg, ret);
272
273 msg->l2h = msg->data;
274 DEBUGP(DMIB, "BCHAN RX: %s\n",
275 hexdump(msgb_l2(msg), ret));
276 ret = e1inp_rx_ts(e1i_ts, msg, 0, 0);
277 /* physical layer indicates that data has been sent,
278 * we thus can send some more data */
creslin287cd8b86f2010-03-26 12:57:31 -0500279 ret = handle_tsX_write(bfd);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100280 msgb_free(msg);
281
282 return ret;
283}
284
285/* callback from select.c in case one of the fd's can be read/written */
286static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what)
287{
288 struct e1inp_line *line = bfd->data;
289 unsigned int ts_nr = bfd->priv_nr;
290 unsigned int idx = ts_nr-1;
291 struct e1inp_ts *e1i_ts = &line->ts[idx];
292 int rc = 0;
293
294 switch (e1i_ts->type) {
295 case E1INP_TS_TYPE_SIGN:
296 if (what & BSC_FD_READ)
297 rc = handle_ts1_read(bfd);
298 if (what & BSC_FD_WRITE)
299 rc = handle_ts1_write(bfd);
300 break;
301 case E1INP_TS_TYPE_TRAU:
302 if (what & BSC_FD_READ)
303 rc = handle_tsX_read(bfd);
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500304 if (what & BSC_FD_WRITE)
305 rc = handle_tsX_write(bfd);
Harald Welteba0db5b2011-02-04 21:33:14 +0100306 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100307 * writeset, since it doesn't support poll() based
308 * write flow control */
309 break;
310 default:
311 fprintf(stderr, "unknown E1 TS type %u\n", e1i_ts->type);
312 break;
313 }
314
315 return rc;
316}
317
Harald Welte1dd68c32011-02-05 13:58:46 +0100318static int dahdi_e1_line_update(struct e1inp_line *line);
319
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100320struct e1inp_driver dahdi_driver = {
321 .name = "DAHDI",
322 .want_write = ts_want_write,
Harald Welte1dd68c32011-02-05 13:58:46 +0100323 .line_update = &dahdi_e1_line_update,
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100324};
325
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500326void dahdi_set_bufinfo(int fd, int as_sigchan)
327{
328 struct dahdi_bufferinfo bi;
329 int x = 0;
330
331 if (ioctl(fd, DAHDI_GET_BUFINFO, &bi)) {
332 fprintf(stderr, "Error getting bufinfo\n");
333 exit(-1);
334 }
335
336 if (as_sigchan) {
337 bi.numbufs = 4;
338 bi.bufsize = 512;
339 } else {
creslin287cd8b86f2010-03-26 12:57:31 -0500340 bi.numbufs = 8;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500341 bi.bufsize = D_BCHAN_TX_GRAN;
creslin287cd8b86f2010-03-26 12:57:31 -0500342 bi.txbufpolicy = DAHDI_POLICY_WHEN_FULL;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500343 }
344
345 if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
346 fprintf(stderr, "Error setting bufinfo\n");
347 exit(-1);
348 }
349
350 if (!as_sigchan) {
351 if (ioctl(fd, DAHDI_AUDIOMODE, &x)) {
352 fprintf(stderr, "Error setting bufinfo\n");
353 exit(-1);
354 }
355 }
356
357}
358
Harald Welted38f1052011-02-05 19:13:00 +0100359static int dahdi_e1_setup(struct e1inp_line *line)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100360{
361 int ts, ret;
362
363 /* TS0 is CRC4, don't need any fd for it */
364 for (ts = 1; ts < NUM_E1_TS; ts++) {
365 unsigned int idx = ts-1;
366 char openstr[128];
367 struct e1inp_ts *e1i_ts = &line->ts[idx];
Harald Welted38f1052011-02-05 19:13:00 +0100368 struct bsc_fd *bfd = &e1i_ts->driver.dahdi.fd;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100369
370 bfd->data = line;
371 bfd->priv_nr = ts;
372 bfd->cb = dahdi_fd_cb;
373 snprintf(openstr, sizeof(openstr), "/dev/dahdi/%d", ts);
374
375 switch (e1i_ts->type) {
376 case E1INP_TS_TYPE_NONE:
377 continue;
378 break;
379 case E1INP_TS_TYPE_SIGN:
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500380 bfd->fd = open(openstr, O_RDWR | O_NONBLOCK);
381 if (bfd->fd == -1) {
382 fprintf(stderr, "%s could not open %s %s\n",
383 __func__, openstr, strerror(errno));
384 exit(-1);
385 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100386 bfd->when = BSC_FD_READ;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500387 dahdi_set_bufinfo(bfd->fd, 1);
Harald Welted38f1052011-02-05 19:13:00 +0100388 e1i_ts->driver.dahdi.lapd = lapd_instance_alloc(dahdi_write_msg, bfd);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100389 break;
390 case E1INP_TS_TYPE_TRAU:
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500391 bfd->fd = open(openstr, O_RDWR | O_NONBLOCK);
392 if (bfd->fd == -1) {
393 fprintf(stderr, "%s could not open %s %s\n",
394 __func__, openstr, strerror(errno));
395 exit(-1);
396 }
397 dahdi_set_bufinfo(bfd->fd, 0);
Harald Welteba0db5b2011-02-04 21:33:14 +0100398 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100399 * writeset, since it doesn't support poll() based
400 * write flow control */
creslin287cd8b86f2010-03-26 12:57:31 -0500401 bfd->when = BSC_FD_READ;// | BSC_FD_WRITE;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100402 break;
403 }
404
405 if (bfd->fd < 0) {
406 fprintf(stderr, "%s could not open %s %s\n",
407 __func__, openstr, strerror(errno));
408 return bfd->fd;
409 }
410
411 ret = bsc_register_fd(bfd);
412 if (ret < 0) {
413 fprintf(stderr, "could not register FD: %s\n",
414 strerror(ret));
415 return ret;
416 }
417 }
418
419 return 0;
420}
421
Harald Welte1dd68c32011-02-05 13:58:46 +0100422static int dahdi_e1_line_update(struct e1inp_line *line)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100423{
Matthew Fredricksonbc6649e2010-02-16 22:01:36 +0100424 if (line->driver != &dahdi_driver)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100425 return -EINVAL;
426
Harald Welted38f1052011-02-05 19:13:00 +0100427 return dahdi_e1_setup(line);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100428}
429
Harald Welte1dd68c32011-02-05 13:58:46 +0100430int e1inp_dahdi_init(void)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100431{
Harald Welted38f1052011-02-05 19:13:00 +0100432 init_flip_bits();
433
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100434 /* register the driver with the core */
Harald Welte50d369e2011-02-05 15:30:48 +0100435 return e1inp_driver_register(&dahdi_driver);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100436}
Harald Welteca17ef82011-02-05 15:13:27 +0100437
438#endif /* HAVE_DAHDI_USER_H */