blob: a8e5dca9b4dc113210e4d31f59d4b3220c893437 [file] [log] [blame]
Harald Welte8470bf22008-12-25 23:28:35 +00001/* OpenBSC Abis interface to mISDNuser */
2
3/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
Harald Welte52b1f982008-12-23 20:25:15 +00004 *
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 */
22
23#include <stdio.h>
24#include <unistd.h>
25#include <stdlib.h>
26#include <errno.h>
27#include <string.h>
Harald Weltee9a82612008-12-27 16:45:29 +000028#include <sys/fcntl.h>
Harald Welte52b1f982008-12-23 20:25:15 +000029#include <sys/types.h>
30#include <sys/socket.h>
31#include <sys/ioctl.h>
32#include <mISDNif.h>
33
Harald Welte8470bf22008-12-25 23:28:35 +000034//#define AF_COMPATIBILITY_FUNC
35//#include <compat_af_isdn.h>
36#define AF_ISDN 34
37#define PF_ISDN AF_ISDN
38
39#include <openbsc/select.h>
40#include <openbsc/msgb.h>
41#include <openbsc/debug.h>
42#include <openbsc/gsm_data.h>
43#include <openbsc/abis_nm.h>
44#include <openbsc/abis_rsl.h>
Harald Welte52b1f982008-12-23 20:25:15 +000045
46#define NUM_E1_TS 32
47
48/* data structure for one E1 interface with A-bis */
49struct mi_e1_handle {
50 struct gsm_bts *bts;
Harald Welte52b1f982008-12-23 20:25:15 +000051 /* The mISDN card number of the card we use */
52 int cardnr;
Harald Welte52b1f982008-12-23 20:25:15 +000053 /* The RSL adress */
54 struct sockaddr_mISDN l2addr;
Harald Welte52b1f982008-12-23 20:25:15 +000055 /* The OML adress */
56 struct sockaddr_mISDN omladdr;
Harald Welte8470bf22008-12-25 23:28:35 +000057 /* list (queue) of to-be-sent msgb's */
58 struct llist_head rsl_tx_list;
59 struct llist_head oml_tx_list;
Harald Welte52b1f982008-12-23 20:25:15 +000060
Harald Weltead384642008-12-26 10:20:07 +000061 void (*cb)(int event, struct gsm_bts *bts);
Harald Welte8470bf22008-12-25 23:28:35 +000062 struct bsc_fd fd[NUM_E1_TS];
Harald Weltee9a82612008-12-27 16:45:29 +000063
64 int ts2_fd;
Harald Welte52b1f982008-12-23 20:25:15 +000065};
66
Harald Welte8470bf22008-12-25 23:28:35 +000067/* FIXME: this needs to go */
68static struct mi_e1_handle *global_e1h;
69
Harald Welte52b1f982008-12-23 20:25:15 +000070#define SAPI_L2ML 0
71#define SAPI_OML 62
Harald Weltead384642008-12-26 10:20:07 +000072#define SAPI_RSL 0 /* 63 ? */
Harald Welte52b1f982008-12-23 20:25:15 +000073
74#define TEI_L2ML 127
75#define TEI_OML 25
76#define TEI_RSL 1
77
Harald Welte702d8702008-12-26 20:25:35 +000078void hexdump(unsigned char *buf, int len)
Harald Welte52b1f982008-12-23 20:25:15 +000079{
80 int i;
81 for (i = 0; i < len; i++) {
82 fprintf(stdout, "%02x ", buf[i]);
83 }
84 fprintf(stdout, "\n");
85}
86
87#define TS1_ALLOC_SIZE 300
88
89static int handle_ts1_read(struct bsc_fd *bfd)
90{
91 struct mi_e1_handle *e1h = bfd->data;
92 struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE);
Harald Welte8470bf22008-12-25 23:28:35 +000093 struct sockaddr_mISDN l2addr;
94 struct mISDNhead *hh;
Harald Welte52b1f982008-12-23 20:25:15 +000095 socklen_t alen;
Harald Welte8470bf22008-12-25 23:28:35 +000096 int ret;
Harald Welte52b1f982008-12-23 20:25:15 +000097
98 if (!msg)
99 return -ENOMEM;
100
Harald Welte8470bf22008-12-25 23:28:35 +0000101 hh = (struct mISDNhead *) msg->data;
102
103 /* FIXME: Map TEI/SAPI to TRX */
104 msg->trx = e1h->bts->c0;
Harald Welte52b1f982008-12-23 20:25:15 +0000105
106 alen = sizeof(l2addr);
107 ret = recvfrom(bfd->fd, msg->data, 300, 0,
108 (struct sockaddr *) &l2addr, &alen);
109 if (ret < 0) {
110 fprintf(stderr, "recvfrom error %s\n", strerror(errno));
111 return ret;
112 }
113
114 if (alen != sizeof(l2addr))
115 return -EINVAL;
116
117 msgb_put(msg, ret);
118
119 DEBUGP(DMI, "alen =%d, dev(%d) channel(%d) sapi(%d) tei(%d)\n",
120 alen, l2addr.dev, l2addr.channel, l2addr.sapi, l2addr.tei);
121
122 DEBUGP(DMI, "<= len = %d, prim(0x%x) id(0x%x)\n",
123 ret, hh->prim, hh->id);
124
125 switch (hh->prim) {
126 case DL_INFORMATION_IND:
127 DEBUGP(DMI, "got DL_INFORMATION_IND\n");
Harald Welte8470bf22008-12-25 23:28:35 +0000128 struct sockaddr_mISDN *sa = NULL;
Harald Welte52b1f982008-12-23 20:25:15 +0000129 char *lstr = "UNKN";
130
131 switch (l2addr.tei) {
132 case TEI_OML:
133 sa = &e1h->omladdr;
134 lstr = "OML";
135 break;
136 case TEI_RSL:
137 sa = &e1h->l2addr;
138 lstr = "RSL";
139 break;
140 default:
Harald Welte8470bf22008-12-25 23:28:35 +0000141 break;
Harald Welte52b1f982008-12-23 20:25:15 +0000142 }
Harald Welte8470bf22008-12-25 23:28:35 +0000143 if (sa) {
144 DEBUGP(DMI, "%s use channel(%d) sapi(%d) tei(%d) for now\n",
145 lstr, l2addr.channel, l2addr.sapi, l2addr.tei);
146 memcpy(sa, &l2addr, sizeof(l2addr));
147 }
Harald Welte52b1f982008-12-23 20:25:15 +0000148 break;
149 case DL_ESTABLISH_IND:
150 DEBUGP(DMI, "got DL_ESTABLISH_IND\n");
151 break;
152 case DL_ESTABLISH_CNF:
153 DEBUGP(DMI, "got DL_ESTABLISH_CNF\n");
154 break;
155 case DL_RELEASE_IND:
Harald Weltead384642008-12-26 10:20:07 +0000156 DEBUGP(DMI, "got DL_RELEASE_IND: E1 Layer 1 disappeared?\n");
Harald Welte52b1f982008-12-23 20:25:15 +0000157 break;
158 case MPH_ACTIVATE_IND:
159 DEBUGP(DMI, "got MPH_ACTIVATE_IND\n");
Harald Weltead384642008-12-26 10:20:07 +0000160 if (l2addr.tei == TEI_OML && l2addr.sapi == SAPI_OML)
161 e1h->cb(EVT_E1_OML_UP, e1h->bts);
162 else if (l2addr.tei == TEI_RSL && l2addr.sapi == SAPI_RSL)
163 e1h->cb(EVT_E1_RSL_UP, e1h->bts);
Harald Welte52b1f982008-12-23 20:25:15 +0000164 break;
165 case MPH_DEACTIVATE_IND:
Harald Weltead384642008-12-26 10:20:07 +0000166 DEBUGP(DMI, "got MPH_DEACTIVATE_IND: TEI link closed?\n");
167 if (l2addr.tei == TEI_OML && l2addr.sapi == SAPI_OML)
168 e1h->cb(EVT_E1_OML_DN, e1h->bts);
169 else if (l2addr.tei == TEI_RSL && l2addr.sapi == SAPI_RSL)
170 e1h->cb(EVT_E1_RSL_DN, e1h->bts);
171 break;
Harald Welte52b1f982008-12-23 20:25:15 +0000172 case DL_DATA_IND:
173 DEBUGP(DMI, "got DL_DATA_IND\n");
Harald Weltead384642008-12-26 10:20:07 +0000174
Harald Weltead384642008-12-26 10:20:07 +0000175 msg->l2h = msg->data + MISDN_HEADER_LEN;
176
177 fprintf(stdout, "RX: ");
Harald Welte52b1f982008-12-23 20:25:15 +0000178 hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN);
179 switch (l2addr.tei) {
180 case TEI_OML:
181 ret = abis_nm_rcvmsg(msg);
182 break;
183 case TEI_RSL:
184 ret = abis_rsl_rcvmsg(msg);
185 break;
186 default:
187 fprintf(stderr, "DATA_IND for unknown TEI\n");
188 break;
189 }
190 break;
191 default:
192 DEBUGP(DMI, "got unexpected 0x%x prim\n", hh->prim);
193 break;
194 }
195 return ret;
196}
197
198static int handle_ts1_write(struct bsc_fd *bfd)
199{
200 struct mi_e1_handle *e1h = bfd->data;
Harald Welte8470bf22008-12-25 23:28:35 +0000201 struct msgb *msg;
202 struct mISDNhead *hh;
Harald Weltead384642008-12-26 10:20:07 +0000203 int ret, no_oml = 0;
Harald Welte52b1f982008-12-23 20:25:15 +0000204
Harald Weltead384642008-12-26 10:20:07 +0000205 msg = msgb_dequeue(&e1h->oml_tx_list);
Harald Welte8470bf22008-12-25 23:28:35 +0000206 if (!msg)
Harald Weltead384642008-12-26 10:20:07 +0000207 no_oml = 1;
Harald Welte8470bf22008-12-25 23:28:35 +0000208 else {
Harald Weltead384642008-12-26 10:20:07 +0000209 u_int8_t *l2_data = msg->data;
210
Harald Welte8470bf22008-12-25 23:28:35 +0000211 /* prepend the mISDNhead */
212 hh = (struct mISDNhead *) msgb_push(msg, sizeof(*hh));
213 hh->prim = DL_DATA_REQ;
Harald Welte52b1f982008-12-23 20:25:15 +0000214
Harald Weltead384642008-12-26 10:20:07 +0000215 fprintf(stdout, "OML TX: ");
216 hexdump(l2_data, msg->len - MISDN_HEADER_LEN);
217
Harald Welte8470bf22008-12-25 23:28:35 +0000218 ret = sendto(bfd->fd, msg->data, msg->len, 0,
Harald Welte5d2f8ec2008-12-26 10:46:24 +0000219 (struct sockaddr *)&e1h->omladdr,
220 sizeof(e1h->omladdr));
Harald Weltee571fb82008-12-25 23:50:30 +0000221 msgb_free(msg);
Harald Welte8470bf22008-12-25 23:28:35 +0000222 usleep(100000);
Harald Weltead384642008-12-26 10:20:07 +0000223 /* we always dequeue all OML messages */
224 return ret;
Harald Welte8470bf22008-12-25 23:28:35 +0000225 }
Harald Weltead384642008-12-26 10:20:07 +0000226
Harald Welte8470bf22008-12-25 23:28:35 +0000227 msg = msgb_dequeue(&e1h->rsl_tx_list);
228 if (!msg) {
Harald Weltead384642008-12-26 10:20:07 +0000229 if (no_oml)
Harald Welte8470bf22008-12-25 23:28:35 +0000230 bfd->when &= ~BSC_FD_WRITE;
231 } else {
Harald Weltead384642008-12-26 10:20:07 +0000232 u_int8_t *l2_data = msg->data;
233
Harald Welte8470bf22008-12-25 23:28:35 +0000234 /* prepend the mISDNhead */
235 hh = (struct mISDNhead *) msgb_push(msg, sizeof(*hh));
236 hh->prim = DL_DATA_REQ;
237
Harald Weltead384642008-12-26 10:20:07 +0000238 fprintf(stdout, "RSL TX: ");
239 hexdump(l2_data, msg->len - MISDN_HEADER_LEN);
240
Harald Welte8470bf22008-12-25 23:28:35 +0000241 ret = sendto(bfd->fd, msg->data, msg->len, 0,
Harald Welte5d2f8ec2008-12-26 10:46:24 +0000242 (struct sockaddr *)&e1h->l2addr,
243 sizeof(e1h->l2addr));
Harald Weltee571fb82008-12-25 23:50:30 +0000244 msgb_free(msg);
Harald Welteb2750422008-12-27 11:24:23 +0000245 usleep(10000);
Harald Welte702d8702008-12-26 20:25:35 +0000246 //sleep(1);
Harald Welte8470bf22008-12-25 23:28:35 +0000247 }
248
249 return ret;
Harald Welte52b1f982008-12-23 20:25:15 +0000250}
251
Harald Weltee9a82612008-12-27 16:45:29 +0000252#define TSX_ALLOC_SIZE 4096
253
254/* FIXME: read from a B channel TS */
Harald Welte52b1f982008-12-23 20:25:15 +0000255static int handle_tsX_read(struct bsc_fd *bfd)
256{
Harald Weltee9a82612008-12-27 16:45:29 +0000257 struct mi_e1_handle *e1h = bfd->data;
258 struct msgb *msg = msgb_alloc(TSX_ALLOC_SIZE);
259 struct mISDNhead *hh;
260 int ret;
261
262 if (!msg)
263 return -ENOMEM;
264
265 hh = (struct mISDNhead *) msg->data;
266
267 /* FIXME: Map TEI/SAPI to TRX */
268 msg->trx = e1h->bts->c0;
269
270 ret = recv(bfd->fd, msg->data, TSX_ALLOC_SIZE, 0);
271 if (ret < 0) {
272 fprintf(stderr, "recvfrom error %s\n", strerror(errno));
273 return ret;
274 }
275
276 msgb_put(msg, ret);
277
278 DEBUGP(DMIB, "<= BCHAN len = %d, prim(0x%x) id(0x%x)\n", ret, hh->prim, hh->id);
279
280 switch (hh->prim) {
281 case PH_CONTROL_IND:
282 DEBUGP(DMIB, "got PH_CONTROL_IND\n");
283 break;
284 case PH_DATA_IND:
285 DEBUGP(DMIB, "got PH_DATA_IND\n");
286
287 msg->l2h = msg->data + MISDN_HEADER_LEN;
288
Harald Welte75a983f2008-12-27 21:34:06 +0000289#if 0
Harald Weltee9a82612008-12-27 16:45:29 +0000290 fprintf(stdout, "BCHAN RX: ");
291 hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN);
Harald Welte75a983f2008-12-27 21:34:06 +0000292#endif
Harald Weltee9a82612008-12-27 16:45:29 +0000293 if (!e1h->ts2_fd)
294 e1h->ts2_fd = open("/tmp/ts2.dump", O_WRONLY|O_APPEND|O_CREAT, 0660);
295
296 write(e1h->ts2_fd, msgb_l2(msg), ret - MISDN_HEADER_LEN);
297
298 break;
299 default:
300 DEBUGP(DMIB, "got unexpected 0x%x prim\n", hh->prim);
301 break;
302 }
303 return ret;
Harald Welte52b1f982008-12-23 20:25:15 +0000304}
305
Harald Welte8470bf22008-12-25 23:28:35 +0000306static int handle_tsX_write(struct bsc_fd *bfd)
Harald Welte52b1f982008-12-23 20:25:15 +0000307{
308 /* FIXME: write to a B channel TS */
Holger Freyther059c2542008-12-27 09:39:48 +0000309 return -1;
Harald Welte52b1f982008-12-23 20:25:15 +0000310}
311
312/* callback from select.c in case one of the fd's can be read/written */
Harald Welte8470bf22008-12-25 23:28:35 +0000313static int misdn_fd_cb(struct bsc_fd *bfd, unsigned int what)
Harald Welte52b1f982008-12-23 20:25:15 +0000314{
315 unsigned int e1_ts = bfd->priv_nr;
316 int rc = 0;
317
318 switch (e1_ts) {
319 case 1:
320 if (what & BSC_FD_READ)
321 rc = handle_ts1_read(bfd);
322 if (what & BSC_FD_WRITE)
323 rc = handle_ts1_write(bfd);
324 break;
325 default:
326 if (what & BSC_FD_READ)
327 rc = handle_tsX_read(bfd);
328 if (what & BSC_FD_WRITE)
329 rc = handle_tsX_write(bfd);
330 break;
331 }
332
333 return rc;
334}
335
Harald Welte8470bf22008-12-25 23:28:35 +0000336int abis_rsl_sendmsg(struct msgb *msg)
Harald Welte52b1f982008-12-23 20:25:15 +0000337{
Harald Welte8470bf22008-12-25 23:28:35 +0000338 struct mi_e1_handle *e1h = global_e1h;
339
Harald Weltead384642008-12-26 10:20:07 +0000340 msg->l2h = msg->data;
Harald Welte8470bf22008-12-25 23:28:35 +0000341 msgb_enqueue(&e1h->rsl_tx_list, msg);
342 e1h->fd[0].when |= BSC_FD_WRITE;
343
344 return 0;
345}
346
Harald Weltead384642008-12-26 10:20:07 +0000347int _abis_nm_sendmsg(struct msgb *msg)
Harald Welte8470bf22008-12-25 23:28:35 +0000348{
349 struct mi_e1_handle *e1h = global_e1h;
350
Harald Weltead384642008-12-26 10:20:07 +0000351 msg->l2h = msg->data;
Harald Welte8470bf22008-12-25 23:28:35 +0000352 msgb_enqueue(&e1h->oml_tx_list, msg);
353 e1h->fd[0].when |= BSC_FD_WRITE;
354
355 return 0;
356}
357
Harald Weltee9a82612008-12-27 16:45:29 +0000358static int activate_bchan(struct mi_e1_handle *e1h, int ts)
359{
360 struct mISDNhead hh;
361 int ret;
362 struct bsc_fd *bfd = &e1h->fd[ts-1];
363
364 fprintf(stdout, "activate bchan\n");
365 hh.prim = PH_ACTIVATE_REQ;
366 hh.id = MISDN_ID_ANY;
367 ret = sendto(bfd->fd, &hh, sizeof(hh), 0, NULL, 0);
368 if (ret < 0) {
369 fprintf(stdout, "could not send ACTIVATE_RQ %s\n",
370 strerror(errno));
371 return 0;
372 }
373
374 return ret;
375}
376
Harald Welte8470bf22008-12-25 23:28:35 +0000377static int mi_e1_setup(struct mi_e1_handle *e1h)
378{
379 int ts, sk, ret, cnt;
380 struct mISDN_devinfo devinfo;
Harald Welte52b1f982008-12-23 20:25:15 +0000381
382 sk = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
Harald Welte8470bf22008-12-25 23:28:35 +0000383 if (sk < 0) {
Harald Welte52b1f982008-12-23 20:25:15 +0000384 fprintf(stderr, "could not open socket %s\n", strerror(errno));
385 return sk;
386 }
387
388 ret = ioctl(sk, IMGETCOUNT, &cnt);
389 if (ret) {
390 fprintf(stderr, "error getting interf count: %s\n",
391 strerror(errno));
392 close(sk);
393 return -ENODEV;
394 }
Harald Weltead384642008-12-26 10:20:07 +0000395 //DEBUGP(DMI,"%d device%s found\n", cnt, (cnt==1)?"":"s");
396 printf("%d device%s found\n", cnt, (cnt==1)?"":"s");
397#if 1
398 devinfo.id = e1h->cardnr;
Harald Welte52b1f982008-12-23 20:25:15 +0000399 ret = ioctl(sk, IMGETDEVINFO, &devinfo);
400 if (ret < 0) {
401 fprintf(stdout, "error getting info for device %d: %s\n",
Harald Weltead384642008-12-26 10:20:07 +0000402 e1h->cardnr, strerror(errno));
Harald Welte52b1f982008-12-23 20:25:15 +0000403 return -ENODEV;
404 }
405 fprintf(stdout, " id: %d\n", devinfo.id);
406 fprintf(stdout, " Dprotocols: %08x\n", devinfo.Dprotocols);
407 fprintf(stdout, " Bprotocols: %08x\n", devinfo.Bprotocols);
408 fprintf(stdout, " protocol: %d\n", devinfo.protocol);
409 fprintf(stdout, " nrbchan: %d\n", devinfo.nrbchan);
410 fprintf(stdout, " name: %s\n", devinfo.name);
411#endif
412
413 /* TS0 is CRC4, don't need any fd for it */
414 for (ts = 1; ts < NUM_E1_TS; ts++) {
Harald Welte8470bf22008-12-25 23:28:35 +0000415 unsigned int idx = ts-1;
Harald Welte52b1f982008-12-23 20:25:15 +0000416 struct bsc_fd *bfd = &e1h->fd[idx];
417 struct sockaddr_mISDN addr;
418
Harald Welte8470bf22008-12-25 23:28:35 +0000419 bfd->data = e1h;
420 bfd->priv_nr = ts;
421 bfd->cb = misdn_fd_cb;
422
423 if (ts == 1) {
Harald Weltead384642008-12-26 10:20:07 +0000424 bfd->fd = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_LAPD_NT);
Harald Welte8470bf22008-12-25 23:28:35 +0000425 bfd->when = BSC_FD_READ;
426 } else
Harald Welte52b1f982008-12-23 20:25:15 +0000427 bfd->fd = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_B_RAW);
428
Harald Welte8470bf22008-12-25 23:28:35 +0000429 if (bfd->fd < 0) {
Harald Welte52b1f982008-12-23 20:25:15 +0000430 fprintf(stderr, "could not open socket %s\n",
431 strerror(errno));
432 return bfd->fd;
433 }
434
435 memset(&addr, 0, sizeof(addr));
436 addr.family = AF_ISDN;
437 addr.dev = e1h->cardnr;
438 if (ts == 1) {
439 addr.channel = 0;
440 addr.sapi = 0;/* SAPI not supported yet in kernel */
441 addr.tei = TEI_L2ML;
442 } else
443 addr.channel = ts;
444
445 ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr));
446 if (ret < 0) {
Harald Welte8470bf22008-12-25 23:28:35 +0000447 fprintf(stderr, "could not bind l2 socket %s\n",
Harald Welte52b1f982008-12-23 20:25:15 +0000448 strerror(errno));
449 return -EIO;
450 }
Harald Welte8470bf22008-12-25 23:28:35 +0000451
Harald Weltee9a82612008-12-27 16:45:29 +0000452 if (ts == 2) {
453 bfd->when = BSC_FD_READ;
454 activate_bchan(e1h, ts);
455 }
456
Harald Welte8470bf22008-12-25 23:28:35 +0000457 ret = bsc_register_fd(bfd);
458 if (ret < 0) {
459 fprintf(stderr, "could not register FD: %s\n",
460 strerror(ret));
461 return ret;
462 }
Harald Welte52b1f982008-12-23 20:25:15 +0000463 }
Harald Welte8470bf22008-12-25 23:28:35 +0000464
465 return 0;
Harald Welte52b1f982008-12-23 20:25:15 +0000466}
467
Harald Weltead384642008-12-26 10:20:07 +0000468int mi_setup(struct gsm_bts *bts, int cardnr,
469 void (cb)(int event, struct gsm_bts *bts))
Harald Welte8470bf22008-12-25 23:28:35 +0000470{
471 struct mi_e1_handle *e1h;
472
473 e1h = malloc(sizeof(*e1h));
474 memset(e1h, 0, sizeof(*e1h));
475
476 e1h->cardnr = cardnr;
477 e1h->bts = bts;
Harald Weltead384642008-12-26 10:20:07 +0000478 e1h->cb = cb;
Harald Welte8470bf22008-12-25 23:28:35 +0000479 INIT_LLIST_HEAD(&e1h->oml_tx_list);
480 INIT_LLIST_HEAD(&e1h->rsl_tx_list);
481
482 global_e1h = e1h;
483
484 return mi_e1_setup(e1h);
485}