2 * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 *---------------------------------------------------------------------------
27 * i4b_i4bdrv.c - i4b userland interface driver
28 * --------------------------------------------
30 * $FreeBSD: src/sys/i4b/layer4/i4b_i4bdrv.c,v 1.11.2.5 2001/12/16 15:12:59 hm Exp $
31 * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.11 2005/01/23 13:47:24 joerg Exp $
33 * last edit-date: [Sat Aug 11 18:08:10 2001]
35 *---------------------------------------------------------------------------*/
38 #include "use_i4bipr.h"
39 #include "use_i4btel.h"
42 #error "only 1 (one) i4b device possible!"
47 #include <sys/param.h>
49 #if defined(__DragonFly__) || defined(__FreeBSD__)
50 #include <sys/ioccom.h>
51 #include <sys/malloc.h>
54 #include <sys/ioctl.h>
57 #include <sys/kernel.h>
58 #include <sys/systm.h>
61 #include <sys/socket.h>
62 #if defined(__FreeBSD__) && __FreeBSD_version >= 500014
63 #include <sys/selinfo.h>
65 #include <sys/select.h>
70 #include <sys/types.h>
73 #if defined(__DragonFly__) || defined(__FreeBSD__)
74 #include "use_i4bing.h"
80 #if defined(__DragonFly__) || defined(__FreeBSD__)
81 #include "use_i4bisppp.h"
83 #include <net/if_sppp.h>
87 #if defined(__DragonFly__) || defined(__FreeBSD__)
89 #if defined(__FreeBSD__) && __FreeBSD__ == 3
90 #include "opt_devfs.h"
94 #include <sys/devfsext.h>
97 #endif /* __FreeBSD__*/
99 #if defined(__DragonFly__) || defined(__FreeBSD__)
100 #include <net/i4b/include/machine/i4b_debug.h>
101 #include <net/i4b/include/machine/i4b_ioctl.h>
102 #include <net/i4b/include/machine/i4b_cause.h>
104 #include <i4b/i4b_debug.h>
105 #include <i4b/i4b_ioctl.h>
106 #include <i4b/i4b_cause.h>
109 #include "../include/i4b_l3l4.h"
110 #include "../include/i4b_mbuf.h"
111 #include "../include/i4b_global.h"
116 #include <sys/poll.h>
119 struct selinfo select_rd_info;
121 static struct ifqueue i4b_rdqueue;
122 static int openflag = 0;
123 static int selflag = 0;
124 static int readflag = 0;
126 #if defined(__FreeBSD__) && __FreeBSD__ == 3
128 static void *devfs_token;
132 #if !defined(__DragonFly__) && !defined(__FreeBSD__)
134 #define PDEVSTATIC /* - not static - */
135 PDEVSTATIC void i4battach (void);
136 PDEVSTATIC int i4bopen (dev_t dev, int flag, int fmt, struct proc *p);
137 PDEVSTATIC int i4bclose (dev_t dev, int flag, int fmt, struct proc *p);
138 PDEVSTATIC int i4bread (dev_t dev, struct uio *uio, int ioflag);
141 PDEVSTATIC int i4bioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p);
143 PDEVSTATIC int i4bioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p);
147 PDEVSTATIC int i4bpoll (dev_t dev, int events, struct proc *p);
149 PDEVSTATIC int i4bselect (dev_t dev, int rw, struct proc *p);
152 #endif /* #ifndef __FreeBSD__ */
154 #if defined(__DragonFly__) || (BSD > 199306 && defined(__FreeBSD__))
156 #define PDEVSTATIC static
158 PDEVSTATIC d_open_t i4bopen;
159 PDEVSTATIC d_close_t i4bclose;
160 PDEVSTATIC d_read_t i4bread;
161 PDEVSTATIC d_ioctl_t i4bioctl;
164 PDEVSTATIC d_poll_t i4bpoll;
165 #define POLLFIELD i4bpoll
167 PDEVSTATIC d_select_t i4bselect;
168 #define POLLFIELD i4bselect
171 #define CDEV_MAJOR 60
173 #if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >= 4)
174 static struct cdevsw i4b_cdevsw = {
176 /* maj */ CDEV_MAJOR,
182 /* close */ i4bclose,
185 /* ioctl */ i4bioctl,
186 /* poll */ POLLFIELD,
188 /* strategy */ nostrategy,
193 static struct cdevsw i4b_cdevsw = {
194 i4bopen, i4bclose, i4bread, nowrite,
195 i4bioctl, nostop, nullreset, nodevtotty,
196 POLLFIELD, nommap, NULL, "i4b", NULL, -1
200 PDEVSTATIC void i4battach(void *);
201 PSEUDO_SET(i4battach, i4b_i4bdrv);
204 i4b_drvinit(void *unused)
206 #if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >= 4)
207 cdevsw_add(&i4b_cdevsw, 0, 0);
209 static int i4b_devsw_installed = 0;
212 if( ! i4b_devsw_installed )
214 dev = makedev(CDEV_MAJOR,0);
215 cdevsw_add(&dev,&i4b_cdevsw,NULL);
216 i4b_devsw_installed = 1;
221 SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
223 #endif /* BSD > 199306 && defined(__FreeBSD__) */
226 #include <sys/device.h>
227 int i4bmatch(struct device *parent, struct cfdata *cf, void *aux);
228 void dummy_i4battach(struct device*, struct device *, void *);
230 #define CDEV_MAJOR 65
232 static struct cfdriver i4bcd =
233 { NULL, "i4b", i4bmatch, dummy_i4battach, DV_DULL,
234 sizeof(struct cfdriver) };
237 i4bopen, i4bclose, i4bread, nowrite,
238 i4bioctl, i4bselect, nommap, nostrat,
239 nodump, nopsize, 0, nostop
243 i4bmatch(struct device *parent, struct cfdata *cf, void *aux)
245 printf("i4bmatch: aux=0x%x\n", aux);
249 dummy_i4battach(struct device *parent, struct device *self, void *aux)
251 printf("dummy_i4battach: aux=0x%x\n", aux);
253 #endif /* __bsdi__ */
255 /*---------------------------------------------------------------------------*
256 * interface attach routine
257 *---------------------------------------------------------------------------*/
259 #if defined(__DragonFly__) || defined(__FreeBSD__)
260 i4battach(void *dummy)
265 printf("i4b: ISDN call control device attached\n");
267 i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
269 #if defined(__FreeBSD__) && __FreeBSD__ > 4
270 mtx_init(&i4b_rdqueue.ifq_mtx, "i4b_rdqueue", MTX_DEF);
273 #if defined(__DragonFly__) || defined(__FreeBSD__)
274 make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b");
278 /*---------------------------------------------------------------------------*
279 * i4bopen - device driver open routine
280 *---------------------------------------------------------------------------*/
282 i4bopen(dev_t dev, int flag, int fmt, struct thread *td)
294 i4b_l4_daemon_attached();
300 /*---------------------------------------------------------------------------*
301 * i4bclose - device driver close routine
302 *---------------------------------------------------------------------------*/
304 i4bclose(dev_t dev, int flag, int fmt, struct thread *td)
308 i4b_l4_daemon_detached();
309 i4b_Dcleanifq(&i4b_rdqueue);
314 /*---------------------------------------------------------------------------*
315 * i4bread - device driver read routine
316 *---------------------------------------------------------------------------*/
318 i4bread(dev_t dev, struct uio *uio, int ioflag)
328 while(IF_QEMPTY(&i4b_rdqueue))
331 #if defined (__FreeBSD__) && __FreeBSD__ > 4
332 error = msleep((caddr_t) &i4b_rdqueue, &i4b_rdqueue.ifq_mtx,
335 error = tsleep((caddr_t) &i4b_rdqueue, PCATCH, "bird", 0);
343 IF_DEQUEUE(&i4b_rdqueue, m);
348 error = uiomove(m->m_data, m->m_len, uio);
358 /*---------------------------------------------------------------------------*
359 * i4bioctl - device driver ioctl routine
360 *---------------------------------------------------------------------------*/
362 #if defined(__DragonFly__) || (defined (__FreeBSD_version) && __FreeBSD_version >= 300003)
363 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
364 #elif defined(__bsdi__)
365 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
367 i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
378 /* cdid request, reserve cd and return cdid */
383 mir = (msg_cdid_req_t *)data;
385 mir->cdid = cd->cdid;
389 /* connect request, dial out to remote */
391 case I4B_CONNECT_REQ:
393 msg_connect_req_t *mcr;
394 mcr = (msg_connect_req_t *)data; /* setup ptr */
396 if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
398 NDBGL4(L4_ERR, "I4B_CONNECT_REQ ioctl, cdid not found!");
403 /* prevent dialling on leased lines */
404 if(ctrl_desc[mcr->controller].protocol == PROTOCOL_D64S)
406 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
407 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_LLDIAL);
408 i4b_l4_disconnect_ind(cd);
413 cd->controller = mcr->controller; /* fill cd */
414 cd->bprot = mcr->bprot;
415 cd->driver = mcr->driver;
416 cd->driver_unit = mcr->driver_unit;
417 cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
419 cd->shorthold_data.shorthold_algorithm = mcr->shorthold_data.shorthold_algorithm;
420 cd->shorthold_data.unitlen_time = mcr->shorthold_data.unitlen_time;
421 cd->shorthold_data.idle_time = mcr->shorthold_data.idle_time;
422 cd->shorthold_data.earlyhup_time = mcr->shorthold_data.earlyhup_time;
424 cd->last_aocd_time = 0;
425 if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
432 cd->max_idle_time = 0; /* this is outgoing */
434 cd->dir = DIR_OUTGOING;
436 NDBGL4(L4_TIMO, "I4B_CONNECT_REQ times, algorithm=%ld unitlen=%ld idle=%ld earlyhup=%ld",
437 (long)cd->shorthold_data.shorthold_algorithm, (long)cd->shorthold_data.unitlen_time,
438 (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time);
440 strcpy(cd->dst_telno, mcr->dst_telno);
441 strcpy(cd->src_telno, mcr->src_telno);
443 if(mcr->keypad[0] != '\0')
444 strcpy(cd->keypad, mcr->keypad);
446 cd->keypad[0] = '\0';
448 cd->display[0] = '\0';
450 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
451 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
457 if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
458 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
465 i < ctrl_desc[mcr->controller].nbch &&
466 ctrl_desc[mcr->controller].bch_state[i] != BCH_ST_FREE;
468 if (i == ctrl_desc[mcr->controller].nbch)
469 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
470 /* else mcr->channel = i; XXX */
475 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
479 cd->channelid = mcr->channel;
481 cd->isdntxdelay = mcr->txdelay;
483 /* check whether we have a pointer. Seems like */
484 /* this should be adequate. GJ 19.09.97 */
485 if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
486 /*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
488 if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
490 i4b_l4_disconnect_ind(cd);
495 (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
500 /* connect response, accept/reject/ignore incoming call */
502 case I4B_CONNECT_RESP:
504 msg_connect_resp_t *mcrsp;
506 mcrsp = (msg_connect_resp_t *)data;
508 if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
510 NDBGL4(L4_ERR, "I4B_CONNECT_RESP ioctl, cdid not found!");
517 cd->driver = mcrsp->driver;
518 cd->driver_unit = mcrsp->driver_unit;
519 cd->max_idle_time = mcrsp->max_idle_time;
521 cd->shorthold_data.shorthold_algorithm = SHA_FIXU;
522 cd->shorthold_data.unitlen_time = 0; /* this is incoming */
523 cd->shorthold_data.idle_time = 0;
524 cd->shorthold_data.earlyhup_time = 0;
526 cd->isdntxdelay = mcrsp->txdelay;
528 NDBGL4(L4_TIMO, "I4B_CONNECT_RESP max_idle_time set to %ld seconds", (long)cd->max_idle_time);
530 (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
534 /* disconnect request, actively terminate connection */
536 case I4B_DISCONNECT_REQ:
538 msg_discon_req_t *mdr;
540 mdr = (msg_discon_req_t *)data;
542 if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
544 NDBGL4(L4_ERR, "I4B_DISCONNECT_REQ ioctl, cdid not found!");
549 /* preset causes with our cause */
550 cd->cause_in = cd->cause_out = mdr->cause;
552 (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
556 /* controller info request */
558 case I4B_CTRL_INFO_REQ:
560 msg_ctrl_info_req_t *mcir;
562 mcir = (msg_ctrl_info_req_t *)data;
563 mcir->ncontroller = nctrl;
565 if(mcir->controller > nctrl)
567 mcir->ctrl_type = -1;
568 mcir->card_type = -1;
573 ctrl_desc[mcir->controller].ctrl_type;
575 ctrl_desc[mcir->controller].card_type;
577 ctrl_desc[mcir->controller].nbch;
579 if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
580 mcir->tei = ctrl_desc[mcir->controller].tei;
589 case I4B_DIALOUT_RESP:
591 drvr_link_t *dlt = NULL;
592 msg_dialout_resp_t *mdrsp;
594 mdrsp = (msg_dialout_resp_t *)data;
596 switch(mdrsp->driver)
600 dlt = ipr_ret_linktab(mdrsp->driver_unit);
606 dlt = i4bisppp_ret_linktab(mdrsp->driver_unit);
612 dlt = tel_ret_linktab(mdrsp->driver_unit);
618 dlt = ibc_ret_linktab(mdrsp->driver_unit);
624 dlt = ing_ret_linktab(mdrsp->driver_unit);
630 (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat, mdrsp->cause);
634 /* update timeout value */
636 case I4B_TIMEOUT_UPD:
638 msg_timeout_upd_t *mtu;
641 mtu = (msg_timeout_upd_t *)data;
643 NDBGL4(L4_TIMO, "I4B_TIMEOUT_UPD ioctl, alg %d, unit %d, idle %d, early %d!",
644 mtu->shorthold_data.shorthold_algorithm, mtu->shorthold_data.unitlen_time,
645 mtu->shorthold_data.idle_time, mtu->shorthold_data.earlyhup_time);
647 if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
649 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, cdid not found!");
654 switch( mtu->shorthold_data.shorthold_algorithm )
658 * For this algorithm unitlen_time,
659 * idle_time and earlyhup_time are used.
662 if(!(mtu->shorthold_data.unitlen_time >= 0 &&
663 mtu->shorthold_data.idle_time >= 0 &&
664 mtu->shorthold_data.earlyhup_time >= 0))
666 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for fix unit algorithm!");
673 * For this algorithm unitlen_time and
674 * idle_time are used. both must be
675 * positive integers. earlyhup_time is
676 * not used and must be 0.
679 if(!(mtu->shorthold_data.unitlen_time > 0 &&
680 mtu->shorthold_data.idle_time >= 0 &&
681 mtu->shorthold_data.earlyhup_time == 0))
683 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for var unit algorithm!");
689 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid algorithm!");
695 * any error set above requires us to break
696 * out of the outer switch
702 cd->shorthold_data.shorthold_algorithm = mtu->shorthold_data.shorthold_algorithm;
703 cd->shorthold_data.unitlen_time = mtu->shorthold_data.unitlen_time;
704 cd->shorthold_data.idle_time = mtu->shorthold_data.idle_time;
705 cd->shorthold_data.earlyhup_time = mtu->shorthold_data.earlyhup_time;
710 /* soft enable/disable interface */
714 msg_updown_ind_t *mui;
716 mui = (msg_updown_ind_t *)data;
719 if(mui->driver == BDRV_IPR)
722 dlt = ipr_ret_linktab(mui->driver_unit);
723 (*dlt->updown_ind)(mui->driver_unit, mui->updown);
729 /* send ALERT request */
733 msg_alert_req_t *mar;
735 mar = (msg_alert_req_t *)data;
737 if((cd = cd_by_cdid(mar->cdid)) == NULL)
739 NDBGL4(L4_ERR, "I4B_ALERT_REQ ioctl, cdid not found!");
746 (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
751 /* version/release number request */
757 mvr = (msg_vr_req_t *)data;
759 mvr->version = VERSION;
765 /* set D-channel protocol for a controller */
771 mpi = (msg_prot_ind_t *)data;
773 ctrl_desc[mpi->controller].protocol = mpi->protocol;
778 /* Download request */
780 case I4B_CTRL_DOWNLOAD:
782 struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
783 struct isdn_download_request *r =
784 (struct isdn_download_request*)data;
787 if (r->controller < 0 || r->controller >= nctrl)
793 if(!ctrl_desc[r->controller].N_DOWNLOAD)
799 prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
802 prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
805 if(!prots || !prots2)
811 copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
813 for(i = 0; i < r->numprotos; i++)
815 prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
816 copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
817 prots2[i].bytecount = prots[i].bytecount;
820 error = ctrl_desc[r->controller].N_DOWNLOAD(
821 ctrl_desc[r->controller].unit,
822 r->numprotos, prots2);
827 for(i = 0; i < r->numprotos; i++)
829 if(prots2[i].microcode)
831 free(prots2[i].microcode, M_DEVBUF);
834 free(prots2, M_DEVBUF);
839 free(prots, M_DEVBUF);
844 /* Diagnostic request */
846 case I4B_ACTIVE_DIAGNOSTIC:
848 struct isdn_diagnostic_request req, *r =
849 (struct isdn_diagnostic_request*)data;
851 req.in_param = req.out_param = NULL;
852 if (r->controller < 0 || r->controller >= nctrl)
858 if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
864 memcpy(&req, r, sizeof(req));
868 /* XXX arbitrary limit */
869 if (req.in_param_len >
870 I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
875 req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
882 error = copyin(r->in_param, req.in_param, req.in_param_len);
887 if(req.out_param_len)
889 req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
898 error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
900 if(!error && req.out_param_len)
901 error = copyout(req.out_param, r->out_param, req.out_param_len);
905 free(req.in_param, M_DEVBUF);
908 free(req.out_param, M_DEVBUF);
923 #ifdef OS_USES_SELECT
925 /*---------------------------------------------------------------------------*
926 * i4bselect - device driver select routine
927 *---------------------------------------------------------------------------*/
929 i4bselect(dev_t dev, int rw, struct thread *td)
939 if(!IF_QEMPTY(&i4b_rdqueue))
942 selrecord(td, &select_rd_info);
955 #else /* OS_USES_SELECT */
957 /*---------------------------------------------------------------------------*
958 * i4bpoll - device driver poll routine
959 *---------------------------------------------------------------------------*/
961 i4bpoll(dev_t dev, int events, struct thread *td)
968 if((events & POLLIN) || (events & POLLRDNORM))
970 if(!IF_QEMPTY(&i4b_rdqueue))
974 selrecord(td, &select_rd_info);
979 else if((events & POLLOUT) || (events & POLLWRNORM))
987 #endif /* OS_USES_SELECT */
989 /*---------------------------------------------------------------------------*
990 * i4bputqueue - put message into queue to userland
991 *---------------------------------------------------------------------------*/
993 i4bputqueue(struct mbuf *m)
1005 if(IF_QFULL(&i4b_rdqueue))
1008 IF_DEQUEUE(&i4b_rdqueue, m1);
1010 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1013 IF_ENQUEUE(&i4b_rdqueue, m);
1020 wakeup((caddr_t) &i4b_rdqueue);
1026 selwakeup(&select_rd_info);
1030 /*---------------------------------------------------------------------------*
1031 * i4bputqueue_hipri - put message into front of queue to userland
1032 *---------------------------------------------------------------------------*/
1034 i4bputqueue_hipri(struct mbuf *m)
1046 if(IF_QFULL(&i4b_rdqueue))
1049 IF_DEQUEUE(&i4b_rdqueue, m1);
1051 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1054 IF_PREPEND(&i4b_rdqueue, m);
1061 wakeup((caddr_t) &i4b_rdqueue);
1067 selwakeup(&select_rd_info);
1071 #endif /* NI4B > 0 */