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.12 2005/06/03 16:50:13 dillon 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 #include <sys/thread2.h>
63 #if defined(__FreeBSD__) && __FreeBSD_version >= 500014
64 #include <sys/selinfo.h>
66 #include <sys/select.h>
71 #include <sys/types.h>
74 #if defined(__DragonFly__) || defined(__FreeBSD__)
75 #include "use_i4bing.h"
81 #if defined(__DragonFly__) || defined(__FreeBSD__)
82 #include "use_i4bisppp.h"
84 #include <net/if_sppp.h>
88 #if defined(__DragonFly__) || defined(__FreeBSD__)
90 #if defined(__FreeBSD__) && __FreeBSD__ == 3
91 #include "opt_devfs.h"
95 #include <sys/devfsext.h>
98 #endif /* __FreeBSD__*/
100 #if defined(__DragonFly__) || defined(__FreeBSD__)
101 #include <net/i4b/include/machine/i4b_debug.h>
102 #include <net/i4b/include/machine/i4b_ioctl.h>
103 #include <net/i4b/include/machine/i4b_cause.h>
105 #include <i4b/i4b_debug.h>
106 #include <i4b/i4b_ioctl.h>
107 #include <i4b/i4b_cause.h>
110 #include "../include/i4b_l3l4.h"
111 #include "../include/i4b_mbuf.h"
112 #include "../include/i4b_global.h"
117 #include <sys/poll.h>
120 struct selinfo select_rd_info;
122 static struct ifqueue i4b_rdqueue;
123 static int openflag = 0;
124 static int selflag = 0;
125 static int readflag = 0;
127 #if defined(__FreeBSD__) && __FreeBSD__ == 3
129 static void *devfs_token;
133 #if !defined(__DragonFly__) && !defined(__FreeBSD__)
135 #define PDEVSTATIC /* - not static - */
136 PDEVSTATIC void i4battach (void);
137 PDEVSTATIC int i4bopen (dev_t dev, int flag, int fmt, struct proc *p);
138 PDEVSTATIC int i4bclose (dev_t dev, int flag, int fmt, struct proc *p);
139 PDEVSTATIC int i4bread (dev_t dev, struct uio *uio, int ioflag);
142 PDEVSTATIC int i4bioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p);
144 PDEVSTATIC int i4bioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p);
148 PDEVSTATIC int i4bpoll (dev_t dev, int events, struct proc *p);
150 PDEVSTATIC int i4bselect (dev_t dev, int rw, struct proc *p);
153 #endif /* #ifndef __FreeBSD__ */
155 #if defined(__DragonFly__) || (BSD > 199306 && defined(__FreeBSD__))
157 #define PDEVSTATIC static
159 PDEVSTATIC d_open_t i4bopen;
160 PDEVSTATIC d_close_t i4bclose;
161 PDEVSTATIC d_read_t i4bread;
162 PDEVSTATIC d_ioctl_t i4bioctl;
165 PDEVSTATIC d_poll_t i4bpoll;
166 #define POLLFIELD i4bpoll
168 PDEVSTATIC d_select_t i4bselect;
169 #define POLLFIELD i4bselect
172 #define CDEV_MAJOR 60
174 #if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >= 4)
175 static struct cdevsw i4b_cdevsw = {
177 /* maj */ CDEV_MAJOR,
183 /* close */ i4bclose,
186 /* ioctl */ i4bioctl,
187 /* poll */ POLLFIELD,
189 /* strategy */ nostrategy,
194 static struct cdevsw i4b_cdevsw = {
195 i4bopen, i4bclose, i4bread, nowrite,
196 i4bioctl, nostop, nullreset, nodevtotty,
197 POLLFIELD, nommap, NULL, "i4b", NULL, -1
201 PDEVSTATIC void i4battach(void *);
202 PSEUDO_SET(i4battach, i4b_i4bdrv);
205 i4b_drvinit(void *unused)
207 #if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >= 4)
208 cdevsw_add(&i4b_cdevsw, 0, 0);
210 static int i4b_devsw_installed = 0;
213 if( ! i4b_devsw_installed )
215 dev = makedev(CDEV_MAJOR,0);
216 cdevsw_add(&dev,&i4b_cdevsw,NULL);
217 i4b_devsw_installed = 1;
222 SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
224 #endif /* BSD > 199306 && defined(__FreeBSD__) */
227 #include <sys/device.h>
228 int i4bmatch(struct device *parent, struct cfdata *cf, void *aux);
229 void dummy_i4battach(struct device*, struct device *, void *);
231 #define CDEV_MAJOR 65
233 static struct cfdriver i4bcd =
234 { NULL, "i4b", i4bmatch, dummy_i4battach, DV_DULL,
235 sizeof(struct cfdriver) };
238 i4bopen, i4bclose, i4bread, nowrite,
239 i4bioctl, i4bselect, nommap, nostrat,
240 nodump, nopsize, 0, nostop
244 i4bmatch(struct device *parent, struct cfdata *cf, void *aux)
246 printf("i4bmatch: aux=0x%x\n", aux);
250 dummy_i4battach(struct device *parent, struct device *self, void *aux)
252 printf("dummy_i4battach: aux=0x%x\n", aux);
254 #endif /* __bsdi__ */
256 /*---------------------------------------------------------------------------*
257 * interface attach routine
258 *---------------------------------------------------------------------------*/
260 #if defined(__DragonFly__) || defined(__FreeBSD__)
261 i4battach(void *dummy)
266 printf("i4b: ISDN call control device attached\n");
268 i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
270 #if defined(__FreeBSD__) && __FreeBSD__ > 4
271 mtx_init(&i4b_rdqueue.ifq_mtx, "i4b_rdqueue", MTX_DEF);
274 #if defined(__DragonFly__) || defined(__FreeBSD__)
275 make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b");
279 /*---------------------------------------------------------------------------*
280 * i4bopen - device driver open routine
281 *---------------------------------------------------------------------------*/
283 i4bopen(dev_t dev, int flag, int fmt, struct thread *td)
293 i4b_l4_daemon_attached();
299 /*---------------------------------------------------------------------------*
300 * i4bclose - device driver close routine
301 *---------------------------------------------------------------------------*/
303 i4bclose(dev_t dev, int flag, int fmt, struct thread *td)
307 i4b_l4_daemon_detached();
308 i4b_Dcleanifq(&i4b_rdqueue);
313 /*---------------------------------------------------------------------------*
314 * i4bread - device driver read routine
315 *---------------------------------------------------------------------------*/
317 i4bread(dev_t dev, struct uio *uio, int ioflag)
326 while(IF_QEMPTY(&i4b_rdqueue))
329 #if defined (__FreeBSD__) && __FreeBSD__ > 4
330 error = msleep((caddr_t) &i4b_rdqueue, &i4b_rdqueue.ifq_mtx,
333 error = tsleep((caddr_t) &i4b_rdqueue, PCATCH, "bird", 0);
341 IF_DEQUEUE(&i4b_rdqueue, m);
346 error = uiomove(m->m_data, m->m_len, uio);
356 /*---------------------------------------------------------------------------*
357 * i4bioctl - device driver ioctl routine
358 *---------------------------------------------------------------------------*/
360 #if defined(__DragonFly__) || (defined (__FreeBSD_version) && __FreeBSD_version >= 300003)
361 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
362 #elif defined(__bsdi__)
363 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
365 i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
376 /* cdid request, reserve cd and return cdid */
381 mir = (msg_cdid_req_t *)data;
383 mir->cdid = cd->cdid;
387 /* connect request, dial out to remote */
389 case I4B_CONNECT_REQ:
391 msg_connect_req_t *mcr;
392 mcr = (msg_connect_req_t *)data; /* setup ptr */
394 if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
396 NDBGL4(L4_ERR, "I4B_CONNECT_REQ ioctl, cdid not found!");
401 /* prevent dialling on leased lines */
402 if(ctrl_desc[mcr->controller].protocol == PROTOCOL_D64S)
404 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
405 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_LLDIAL);
406 i4b_l4_disconnect_ind(cd);
411 cd->controller = mcr->controller; /* fill cd */
412 cd->bprot = mcr->bprot;
413 cd->driver = mcr->driver;
414 cd->driver_unit = mcr->driver_unit;
415 cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
417 cd->shorthold_data.shorthold_algorithm = mcr->shorthold_data.shorthold_algorithm;
418 cd->shorthold_data.unitlen_time = mcr->shorthold_data.unitlen_time;
419 cd->shorthold_data.idle_time = mcr->shorthold_data.idle_time;
420 cd->shorthold_data.earlyhup_time = mcr->shorthold_data.earlyhup_time;
422 cd->last_aocd_time = 0;
423 if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
430 cd->max_idle_time = 0; /* this is outgoing */
432 cd->dir = DIR_OUTGOING;
434 NDBGL4(L4_TIMO, "I4B_CONNECT_REQ times, algorithm=%ld unitlen=%ld idle=%ld earlyhup=%ld",
435 (long)cd->shorthold_data.shorthold_algorithm, (long)cd->shorthold_data.unitlen_time,
436 (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time);
438 strcpy(cd->dst_telno, mcr->dst_telno);
439 strcpy(cd->src_telno, mcr->src_telno);
441 if(mcr->keypad[0] != '\0')
442 strcpy(cd->keypad, mcr->keypad);
444 cd->keypad[0] = '\0';
446 cd->display[0] = '\0';
448 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
449 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
455 if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
456 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
463 i < ctrl_desc[mcr->controller].nbch &&
464 ctrl_desc[mcr->controller].bch_state[i] != BCH_ST_FREE;
466 if (i == ctrl_desc[mcr->controller].nbch)
467 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
468 /* else mcr->channel = i; XXX */
473 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
477 cd->channelid = mcr->channel;
479 cd->isdntxdelay = mcr->txdelay;
481 /* check whether we have a pointer. Seems like */
482 /* this should be adequate. GJ 19.09.97 */
483 if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
484 /*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
486 if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
488 i4b_l4_disconnect_ind(cd);
493 (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
498 /* connect response, accept/reject/ignore incoming call */
500 case I4B_CONNECT_RESP:
502 msg_connect_resp_t *mcrsp;
504 mcrsp = (msg_connect_resp_t *)data;
506 if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
508 NDBGL4(L4_ERR, "I4B_CONNECT_RESP ioctl, cdid not found!");
515 cd->driver = mcrsp->driver;
516 cd->driver_unit = mcrsp->driver_unit;
517 cd->max_idle_time = mcrsp->max_idle_time;
519 cd->shorthold_data.shorthold_algorithm = SHA_FIXU;
520 cd->shorthold_data.unitlen_time = 0; /* this is incoming */
521 cd->shorthold_data.idle_time = 0;
522 cd->shorthold_data.earlyhup_time = 0;
524 cd->isdntxdelay = mcrsp->txdelay;
526 NDBGL4(L4_TIMO, "I4B_CONNECT_RESP max_idle_time set to %ld seconds", (long)cd->max_idle_time);
528 (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
532 /* disconnect request, actively terminate connection */
534 case I4B_DISCONNECT_REQ:
536 msg_discon_req_t *mdr;
538 mdr = (msg_discon_req_t *)data;
540 if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
542 NDBGL4(L4_ERR, "I4B_DISCONNECT_REQ ioctl, cdid not found!");
547 /* preset causes with our cause */
548 cd->cause_in = cd->cause_out = mdr->cause;
550 (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
554 /* controller info request */
556 case I4B_CTRL_INFO_REQ:
558 msg_ctrl_info_req_t *mcir;
560 mcir = (msg_ctrl_info_req_t *)data;
561 mcir->ncontroller = nctrl;
563 if(mcir->controller > nctrl)
565 mcir->ctrl_type = -1;
566 mcir->card_type = -1;
571 ctrl_desc[mcir->controller].ctrl_type;
573 ctrl_desc[mcir->controller].card_type;
575 ctrl_desc[mcir->controller].nbch;
577 if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
578 mcir->tei = ctrl_desc[mcir->controller].tei;
587 case I4B_DIALOUT_RESP:
589 drvr_link_t *dlt = NULL;
590 msg_dialout_resp_t *mdrsp;
592 mdrsp = (msg_dialout_resp_t *)data;
594 switch(mdrsp->driver)
598 dlt = ipr_ret_linktab(mdrsp->driver_unit);
604 dlt = i4bisppp_ret_linktab(mdrsp->driver_unit);
610 dlt = tel_ret_linktab(mdrsp->driver_unit);
616 dlt = ibc_ret_linktab(mdrsp->driver_unit);
622 dlt = ing_ret_linktab(mdrsp->driver_unit);
628 (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat, mdrsp->cause);
632 /* update timeout value */
634 case I4B_TIMEOUT_UPD:
636 msg_timeout_upd_t *mtu;
638 mtu = (msg_timeout_upd_t *)data;
640 NDBGL4(L4_TIMO, "I4B_TIMEOUT_UPD ioctl, alg %d, unit %d, idle %d, early %d!",
641 mtu->shorthold_data.shorthold_algorithm, mtu->shorthold_data.unitlen_time,
642 mtu->shorthold_data.idle_time, mtu->shorthold_data.earlyhup_time);
644 if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
646 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, cdid not found!");
651 switch( mtu->shorthold_data.shorthold_algorithm )
655 * For this algorithm unitlen_time,
656 * idle_time and earlyhup_time are used.
659 if(!(mtu->shorthold_data.unitlen_time >= 0 &&
660 mtu->shorthold_data.idle_time >= 0 &&
661 mtu->shorthold_data.earlyhup_time >= 0))
663 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for fix unit algorithm!");
670 * For this algorithm unitlen_time and
671 * idle_time are used. both must be
672 * positive integers. earlyhup_time is
673 * not used and must be 0.
676 if(!(mtu->shorthold_data.unitlen_time > 0 &&
677 mtu->shorthold_data.idle_time >= 0 &&
678 mtu->shorthold_data.earlyhup_time == 0))
680 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for var unit algorithm!");
686 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid algorithm!");
692 * any error set above requires us to break
693 * out of the outer switch
699 cd->shorthold_data.shorthold_algorithm = mtu->shorthold_data.shorthold_algorithm;
700 cd->shorthold_data.unitlen_time = mtu->shorthold_data.unitlen_time;
701 cd->shorthold_data.idle_time = mtu->shorthold_data.idle_time;
702 cd->shorthold_data.earlyhup_time = mtu->shorthold_data.earlyhup_time;
707 /* soft enable/disable interface */
711 msg_updown_ind_t *mui;
713 mui = (msg_updown_ind_t *)data;
716 if(mui->driver == BDRV_IPR)
719 dlt = ipr_ret_linktab(mui->driver_unit);
720 (*dlt->updown_ind)(mui->driver_unit, mui->updown);
726 /* send ALERT request */
730 msg_alert_req_t *mar;
732 mar = (msg_alert_req_t *)data;
734 if((cd = cd_by_cdid(mar->cdid)) == NULL)
736 NDBGL4(L4_ERR, "I4B_ALERT_REQ ioctl, cdid not found!");
743 (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
748 /* version/release number request */
754 mvr = (msg_vr_req_t *)data;
756 mvr->version = VERSION;
762 /* set D-channel protocol for a controller */
768 mpi = (msg_prot_ind_t *)data;
770 ctrl_desc[mpi->controller].protocol = mpi->protocol;
775 /* Download request */
777 case I4B_CTRL_DOWNLOAD:
779 struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
780 struct isdn_download_request *r =
781 (struct isdn_download_request*)data;
784 if (r->controller < 0 || r->controller >= nctrl)
790 if(!ctrl_desc[r->controller].N_DOWNLOAD)
796 prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
799 prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
802 if(!prots || !prots2)
808 copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
810 for(i = 0; i < r->numprotos; i++)
812 prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
813 copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
814 prots2[i].bytecount = prots[i].bytecount;
817 error = ctrl_desc[r->controller].N_DOWNLOAD(
818 ctrl_desc[r->controller].unit,
819 r->numprotos, prots2);
824 for(i = 0; i < r->numprotos; i++)
826 if(prots2[i].microcode)
828 free(prots2[i].microcode, M_DEVBUF);
831 free(prots2, M_DEVBUF);
836 free(prots, M_DEVBUF);
841 /* Diagnostic request */
843 case I4B_ACTIVE_DIAGNOSTIC:
845 struct isdn_diagnostic_request req, *r =
846 (struct isdn_diagnostic_request*)data;
848 req.in_param = req.out_param = NULL;
849 if (r->controller < 0 || r->controller >= nctrl)
855 if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
861 memcpy(&req, r, sizeof(req));
865 /* XXX arbitrary limit */
866 if (req.in_param_len >
867 I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
872 req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
879 error = copyin(r->in_param, req.in_param, req.in_param_len);
884 if(req.out_param_len)
886 req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
895 error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
897 if(!error && req.out_param_len)
898 error = copyout(req.out_param, r->out_param, req.out_param_len);
902 free(req.in_param, M_DEVBUF);
905 free(req.out_param, M_DEVBUF);
920 #ifdef OS_USES_SELECT
922 /*---------------------------------------------------------------------------*
923 * i4bselect - device driver select routine
924 *---------------------------------------------------------------------------*/
926 i4bselect(dev_t dev, int rw, struct thread *td)
934 if(!IF_QEMPTY(&i4b_rdqueue))
937 selrecord(td, &select_rd_info);
950 #else /* OS_USES_SELECT */
952 /*---------------------------------------------------------------------------*
953 * i4bpoll - device driver poll routine
954 *---------------------------------------------------------------------------*/
956 i4bpoll(dev_t dev, int events, struct thread *td)
961 if((events & POLLIN) || (events & POLLRDNORM))
963 if(!IF_QEMPTY(&i4b_rdqueue))
967 selrecord(td, &select_rd_info);
972 else if((events & POLLOUT) || (events & POLLWRNORM))
980 #endif /* OS_USES_SELECT */
982 /*---------------------------------------------------------------------------*
983 * i4bputqueue - put message into queue to userland
984 *---------------------------------------------------------------------------*/
986 i4bputqueue(struct mbuf *m)
996 if(IF_QFULL(&i4b_rdqueue))
999 IF_DEQUEUE(&i4b_rdqueue, m1);
1001 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1004 IF_ENQUEUE(&i4b_rdqueue, m);
1011 wakeup((caddr_t) &i4b_rdqueue);
1017 selwakeup(&select_rd_info);
1021 /*---------------------------------------------------------------------------*
1022 * i4bputqueue_hipri - put message into front of queue to userland
1023 *---------------------------------------------------------------------------*/
1025 i4bputqueue_hipri(struct mbuf *m)
1035 if(IF_QFULL(&i4b_rdqueue))
1038 IF_DEQUEUE(&i4b_rdqueue, m1);
1040 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1043 IF_PREPEND(&i4b_rdqueue, m);
1050 wakeup((caddr_t) &i4b_rdqueue);
1056 selwakeup(&select_rd_info);
1060 #endif /* NI4B > 0 */