blob: 08bd1e01cd42f5e269680df57951ef9d83594062 [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];
Matthew Fredricksonbc6649e2010-02-16 22:01:36 +010061 struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE, "DAHDI TS1");
Harald Welteba0db5b2011-02-04 21:33:14 +010062 lapd_mph_type prim;
63 unsigned int sapi, tei;
64 int ilen, ret;
Harald Welted38f1052011-02-05 19:13:00 +010065 uint8_t *idata;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010066
67 if (!msg)
68 return -ENOMEM;
69
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050070 ret = read(bfd->fd, msg->data, TS1_ALLOC_SIZE - 16);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010071 if (ret < 0) {
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010072 perror("read ");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010073 }
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050074 msgb_put(msg, ret - 2);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010075 if (ret <= 3) {
76 perror("read ");
77 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010078
Harald Welteba0db5b2011-02-04 21:33:14 +010079 sapi = msg->data[0] >> 2;
80 tei = msg->data[1] >> 1;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -050081
Harald Welteba0db5b2011-02-04 21:33:14 +010082 DEBUGP(DMI, "<= len = %d, sapi(%d) tei(%d)", ret, sapi, tei);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +010083
Harald Welted38f1052011-02-05 19:13:00 +010084 idata = lapd_receive(e1i_ts->driver.dahdi.lapd, msg->data, msg->len, &ilen, &prim);
Harald Welte1458ec62011-02-05 19:50:44 +010085 if (!idata && prim == 0)
Harald Welted38f1052011-02-05 19:13:00 +010086 return -EIO;
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010087
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010088 msgb_pull(msg, 2);
89
Harald Welteba0db5b2011-02-04 21:33:14 +010090 DEBUGP(DMI, "prim %08x\n", prim);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010091
Harald Welteba0db5b2011-02-04 21:33:14 +010092 switch (prim) {
93 case 0:
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010094 break;
Harald Welteba0db5b2011-02-04 21:33:14 +010095 case LAPD_MPH_ACTIVATE_IND:
96 DEBUGP(DMI, "MPH_ACTIVATE_IND: sapi(%d) tei(%d)\n", sapi, tei);
97 ret = e1inp_event(e1i_ts, EVT_E1_TEI_UP, tei, sapi);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +010098 break;
Harald Welteba0db5b2011-02-04 21:33:14 +010099 case LAPD_MPH_DEACTIVATE_IND:
100 DEBUGP(DMI, "MPH_DEACTIVATE_IND: sapi(%d) tei(%d)\n", sapi, tei);
101 ret = e1inp_event(e1i_ts, EVT_E1_TEI_DN, tei, sapi);
Matthew Fredricksonb1cb8eb2010-02-17 19:25:39 +0100102 break;
Harald Welteba0db5b2011-02-04 21:33:14 +0100103 case LAPD_DL_DATA_IND:
104 case LAPD_DL_UNITDATA_IND:
Harald Welte1dd68c32011-02-05 13:58:46 +0100105 if (prim == LAPD_DL_DATA_IND)
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500106 msg->l2h = msg->data + 2;
107 else
108 msg->l2h = msg->data + 1;
109 DEBUGP(DMI, "RX: %s\n", hexdump(msgb_l2(msg), ret));
Harald Welteba0db5b2011-02-04 21:33:14 +0100110 ret = e1inp_rx_ts(e1i_ts, msg, tei, sapi);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100111 break;
112 default:
Harald Welteba0db5b2011-02-04 21:33:14 +0100113 printf("ERROR: unknown prim\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100114 break;
115 }
Harald Welteba0db5b2011-02-04 21:33:14 +0100116
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500117 DEBUGP(DMI, "Returned ok\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100118 return ret;
119}
120
121static int ts_want_write(struct e1inp_ts *e1i_ts)
122{
Harald Welteba0db5b2011-02-04 21:33:14 +0100123 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100124 * writeset, since it doesn't support poll() based
125 * write flow control */
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500126 if (e1i_ts->type == E1INP_TS_TYPE_TRAU) {
127 fprintf(stderr, "Trying to write TRAU ts\n");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100128 return 0;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500129 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100130
Harald Welted38f1052011-02-05 19:13:00 +0100131 e1i_ts->driver.dahdi.fd.when |= BSC_FD_WRITE;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100132
133 return 0;
134}
135
136static void timeout_ts1_write(void *data)
137{
138 struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data;
139
140 /* trigger write of ts1, due to tx delay timer */
141 ts_want_write(e1i_ts);
142}
143
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500144static void dahdi_write_msg(uint8_t *data, int len, void *cbdata)
145{
146 struct bsc_fd *bfd = cbdata;
147 int ret;
148
149 ret = write(bfd->fd, data, len + 2);
150
151 if (ret < 0)
152 fprintf(stderr, "%s write failed %d\n", __func__, ret);
153}
154
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100155static int handle_ts1_write(struct bsc_fd *bfd)
156{
157 struct e1inp_line *line = bfd->data;
158 unsigned int ts_nr = bfd->priv_nr;
159 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
160 struct e1inp_sign_link *sign_link;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100161 struct msgb *msg;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100162
163 bfd->when &= ~BSC_FD_WRITE;
164
165 /* get the next msg for this timeslot */
166 msg = e1inp_tx_ts(e1i_ts, &sign_link);
167 if (!msg) {
168 /* no message after tx delay timer */
169 return 0;
170 }
171
Harald Welted38f1052011-02-05 19:13:00 +0100172 lapd_transmit(e1i_ts->driver.dahdi.lapd, sign_link->tei, msg->data, msg->len);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100173 msgb_free(msg);
174
175 /* set tx delay timer for next event */
176 e1i_ts->sign.tx_timer.cb = timeout_ts1_write;
177 e1i_ts->sign.tx_timer.data = e1i_ts;
178 bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000);
179
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500180 return 0;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100181}
182
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500183
184static int invertbits = 1;
185
186static u_int8_t flip_table[256];
187
188static void init_flip_bits(void)
189{
190 int i,k;
191
192 for (i = 0 ; i < 256 ; i++) {
193 u_int8_t sample = 0 ;
194 for (k = 0; k<8; k++) {
195 if ( i & 1 << k ) sample |= 0x80 >> k;
196 }
197 flip_table[i] = sample;
198 }
199}
200
201static u_int8_t * flip_buf_bits ( u_int8_t * buf , int len)
202{
203 int i;
creslin287cd8b86f2010-03-26 12:57:31 -0500204 u_int8_t * start = buf;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500205
206 for (i = 0 ; i < len; i++) {
207 buf[i] = flip_table[(u_int8_t)buf[i]];
208 }
209
210 return start;
211}
212
creslin287cd8b86f2010-03-26 12:57:31 -0500213#define D_BCHAN_TX_GRAN 160
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100214/* write to a B channel TS */
215static int handle_tsX_write(struct bsc_fd *bfd)
216{
217 struct e1inp_line *line = bfd->data;
218 unsigned int ts_nr = bfd->priv_nr;
219 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500220 u_int8_t tx_buf[D_BCHAN_TX_GRAN];
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100221 struct subch_mux *mx = &e1i_ts->trau.mux;
222 int ret;
223
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500224 ret = subchan_mux_out(mx, tx_buf, D_BCHAN_TX_GRAN);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100225
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500226 if (ret != D_BCHAN_TX_GRAN) {
227 fprintf(stderr, "Huh, got ret of %d\n", ret);
228 if (ret < 0)
229 return ret;
230 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100231
232 DEBUGP(DMIB, "BCHAN TX: %s\n",
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500233 hexdump(tx_buf, D_BCHAN_TX_GRAN));
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100234
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500235 if (invertbits) {
236 flip_buf_bits(tx_buf, ret);
237 }
238
239 ret = write(bfd->fd, tx_buf, ret);
240 if (ret < D_BCHAN_TX_GRAN)
Harald Welte1dd68c32011-02-05 13:58:46 +0100241 fprintf(stderr, "send returns %d instead of %d\n", ret,
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500242 D_BCHAN_TX_GRAN);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100243
244 return ret;
245}
246
creslin287cd8b86f2010-03-26 12:57:31 -0500247#define D_TSX_ALLOC_SIZE (D_BCHAN_TX_GRAN)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100248/* FIXME: read from a B channel TS */
249static int handle_tsX_read(struct bsc_fd *bfd)
250{
251 struct e1inp_line *line = bfd->data;
252 unsigned int ts_nr = bfd->priv_nr;
253 struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500254 struct msgb *msg = msgb_alloc(D_TSX_ALLOC_SIZE, "DAHDI TSx");
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100255 int ret;
256
257 if (!msg)
258 return -ENOMEM;
259
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500260 ret = read(bfd->fd, msg->data, D_TSX_ALLOC_SIZE);
261 if (ret < 0 || ret != D_TSX_ALLOC_SIZE) {
262 fprintf(stderr, "read error %d %s\n", ret, strerror(errno));
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100263 return ret;
264 }
265
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500266 if (invertbits) {
267 flip_buf_bits(msg->data, ret);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100268 }
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500269
270 msgb_put(msg, ret);
271
272 msg->l2h = msg->data;
273 DEBUGP(DMIB, "BCHAN RX: %s\n",
274 hexdump(msgb_l2(msg), ret));
275 ret = e1inp_rx_ts(e1i_ts, msg, 0, 0);
276 /* physical layer indicates that data has been sent,
277 * we thus can send some more data */
creslin287cd8b86f2010-03-26 12:57:31 -0500278 ret = handle_tsX_write(bfd);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100279 msgb_free(msg);
280
281 return ret;
282}
283
284/* callback from select.c in case one of the fd's can be read/written */
285static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what)
286{
287 struct e1inp_line *line = bfd->data;
288 unsigned int ts_nr = bfd->priv_nr;
289 unsigned int idx = ts_nr-1;
290 struct e1inp_ts *e1i_ts = &line->ts[idx];
291 int rc = 0;
292
293 switch (e1i_ts->type) {
294 case E1INP_TS_TYPE_SIGN:
295 if (what & BSC_FD_READ)
296 rc = handle_ts1_read(bfd);
297 if (what & BSC_FD_WRITE)
298 rc = handle_ts1_write(bfd);
299 break;
300 case E1INP_TS_TYPE_TRAU:
301 if (what & BSC_FD_READ)
302 rc = handle_tsX_read(bfd);
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500303 if (what & BSC_FD_WRITE)
304 rc = handle_tsX_write(bfd);
Harald Welteba0db5b2011-02-04 21:33:14 +0100305 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100306 * writeset, since it doesn't support poll() based
307 * write flow control */
308 break;
309 default:
310 fprintf(stderr, "unknown E1 TS type %u\n", e1i_ts->type);
311 break;
312 }
313
314 return rc;
315}
316
Harald Welte1dd68c32011-02-05 13:58:46 +0100317static int dahdi_e1_line_update(struct e1inp_line *line);
318
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100319struct e1inp_driver dahdi_driver = {
320 .name = "DAHDI",
321 .want_write = ts_want_write,
Harald Welte1dd68c32011-02-05 13:58:46 +0100322 .line_update = &dahdi_e1_line_update,
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100323};
324
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500325void dahdi_set_bufinfo(int fd, int as_sigchan)
326{
327 struct dahdi_bufferinfo bi;
328 int x = 0;
329
330 if (ioctl(fd, DAHDI_GET_BUFINFO, &bi)) {
331 fprintf(stderr, "Error getting bufinfo\n");
332 exit(-1);
333 }
334
335 if (as_sigchan) {
336 bi.numbufs = 4;
337 bi.bufsize = 512;
338 } else {
creslin287cd8b86f2010-03-26 12:57:31 -0500339 bi.numbufs = 8;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500340 bi.bufsize = D_BCHAN_TX_GRAN;
creslin287cd8b86f2010-03-26 12:57:31 -0500341 bi.txbufpolicy = DAHDI_POLICY_WHEN_FULL;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500342 }
343
344 if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
345 fprintf(stderr, "Error setting bufinfo\n");
346 exit(-1);
347 }
348
349 if (!as_sigchan) {
350 if (ioctl(fd, DAHDI_AUDIOMODE, &x)) {
351 fprintf(stderr, "Error setting bufinfo\n");
352 exit(-1);
353 }
354 }
355
356}
357
Harald Welted38f1052011-02-05 19:13:00 +0100358static int dahdi_e1_setup(struct e1inp_line *line)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100359{
360 int ts, ret;
361
362 /* TS0 is CRC4, don't need any fd for it */
363 for (ts = 1; ts < NUM_E1_TS; ts++) {
364 unsigned int idx = ts-1;
365 char openstr[128];
366 struct e1inp_ts *e1i_ts = &line->ts[idx];
Harald Welted38f1052011-02-05 19:13:00 +0100367 struct bsc_fd *bfd = &e1i_ts->driver.dahdi.fd;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100368
369 bfd->data = line;
370 bfd->priv_nr = ts;
371 bfd->cb = dahdi_fd_cb;
372 snprintf(openstr, sizeof(openstr), "/dev/dahdi/%d", ts);
373
374 switch (e1i_ts->type) {
375 case E1INP_TS_TYPE_NONE:
376 continue;
377 break;
378 case E1INP_TS_TYPE_SIGN:
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500379 bfd->fd = open(openstr, O_RDWR | O_NONBLOCK);
380 if (bfd->fd == -1) {
381 fprintf(stderr, "%s could not open %s %s\n",
382 __func__, openstr, strerror(errno));
383 exit(-1);
384 }
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100385 bfd->when = BSC_FD_READ;
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500386 dahdi_set_bufinfo(bfd->fd, 1);
Harald Welted38f1052011-02-05 19:13:00 +0100387 e1i_ts->driver.dahdi.lapd = lapd_instance_alloc(dahdi_write_msg, bfd);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100388 break;
389 case E1INP_TS_TYPE_TRAU:
Matthew Fredricksoncc2bc352010-03-15 12:22:37 -0500390 bfd->fd = open(openstr, O_RDWR | O_NONBLOCK);
391 if (bfd->fd == -1) {
392 fprintf(stderr, "%s could not open %s %s\n",
393 __func__, openstr, strerror(errno));
394 exit(-1);
395 }
396 dahdi_set_bufinfo(bfd->fd, 0);
Harald Welteba0db5b2011-02-04 21:33:14 +0100397 /* We never include the DAHDI B-Channel FD into the
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100398 * writeset, since it doesn't support poll() based
399 * write flow control */
creslin287cd8b86f2010-03-26 12:57:31 -0500400 bfd->when = BSC_FD_READ;// | BSC_FD_WRITE;
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100401 break;
402 }
403
404 if (bfd->fd < 0) {
405 fprintf(stderr, "%s could not open %s %s\n",
406 __func__, openstr, strerror(errno));
407 return bfd->fd;
408 }
409
410 ret = bsc_register_fd(bfd);
411 if (ret < 0) {
412 fprintf(stderr, "could not register FD: %s\n",
413 strerror(ret));
414 return ret;
415 }
416 }
417
418 return 0;
419}
420
Harald Welte1dd68c32011-02-05 13:58:46 +0100421static int dahdi_e1_line_update(struct e1inp_line *line)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100422{
Matthew Fredricksonbc6649e2010-02-16 22:01:36 +0100423 if (line->driver != &dahdi_driver)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100424 return -EINVAL;
425
Harald Welted38f1052011-02-05 19:13:00 +0100426 return dahdi_e1_setup(line);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100427}
428
Harald Welte1dd68c32011-02-05 13:58:46 +0100429int e1inp_dahdi_init(void)
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100430{
Harald Welted38f1052011-02-05 19:13:00 +0100431 init_flip_bits();
432
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100433 /* register the driver with the core */
Harald Welte50d369e2011-02-05 15:30:48 +0100434 return e1inp_driver_register(&dahdi_driver);
Matthew Fredricksonb5ddc182010-02-16 21:55:50 +0100435}
Harald Welteca17ef82011-02-05 15:13:27 +0100436
437#endif /* HAVE_DAHDI_USER_H */