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.2 2003/06/17 04:28:40 dillon Exp $
33 * last edit-date: [Sat Aug 11 18:08:10 2001]
35 *---------------------------------------------------------------------------*/
42 #error "only 1 (one) i4b device possible!"
47 #include <sys/param.h>
49 #if 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 __FreeBSD_version >= 500014
63 #include <sys/selinfo.h>
65 #include <sys/select.h>
70 #include <sys/types.h>
73 #if defined(__FreeBSD__)
83 #include <net/if_sppp.h>
89 #if defined(__FreeBSD__) && __FreeBSD__ == 3
90 #include "opt_devfs.h"
94 #include <sys/devfsext.h>
97 #endif /* __FreeBSD__*/
100 #include <machine/i4b_debug.h>
101 #include <machine/i4b_ioctl.h>
102 #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 <i4b/include/i4b_l3l4.h>
110 #include <i4b/include/i4b_mbuf.h>
111 #include <i4b/include/i4b_global.h>
113 #include <i4b/layer4/i4b_l4.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;
134 #define PDEVSTATIC /* - not static - */
135 PDEVSTATIC void i4battach __P((void));
136 PDEVSTATIC int i4bopen __P((dev_t dev, int flag, int fmt, struct proc *p));
137 PDEVSTATIC int i4bclose __P((dev_t dev, int flag, int fmt, struct proc *p));
138 PDEVSTATIC int i4bread __P((dev_t dev, struct uio *uio, int ioflag));
141 PDEVSTATIC int i4bioctl __P((dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p));
143 PDEVSTATIC int i4bioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
147 PDEVSTATIC int i4bpoll __P((dev_t dev, int events, struct proc *p));
149 PDEVSTATIC int i4bselect __P((dev_t dev, int rw, struct proc *p));
152 #endif /* #ifndef __FreeBSD__ */
154 #if 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(__FreeBSD__) && __FreeBSD__ >= 4
174 static struct cdevsw i4b_cdevsw = {
176 /* close */ i4bclose,
179 /* ioctl */ i4bioctl,
180 /* poll */ POLLFIELD,
182 /* strategy */ nostrategy,
184 /* maj */ CDEV_MAJOR,
191 static struct cdevsw i4b_cdevsw = {
192 i4bopen, i4bclose, i4bread, nowrite,
193 i4bioctl, nostop, nullreset, nodevtotty,
194 POLLFIELD, nommap, NULL, "i4b", NULL, -1
198 PDEVSTATIC void i4battach(void *);
199 PSEUDO_SET(i4battach, i4b_i4bdrv);
202 i4b_drvinit(void *unused)
204 #if defined(__FreeBSD__) && __FreeBSD__ >= 4
205 cdevsw_add(&i4b_cdevsw);
207 static int i4b_devsw_installed = 0;
210 if( ! i4b_devsw_installed )
212 dev = makedev(CDEV_MAJOR,0);
213 cdevsw_add(&dev,&i4b_cdevsw,NULL);
214 i4b_devsw_installed = 1;
219 SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
221 #endif /* BSD > 199306 && defined(__FreeBSD__) */
224 #include <sys/device.h>
225 int i4bmatch(struct device *parent, struct cfdata *cf, void *aux);
226 void dummy_i4battach(struct device*, struct device *, void *);
228 #define CDEV_MAJOR 65
230 static struct cfdriver i4bcd =
231 { NULL, "i4b", i4bmatch, dummy_i4battach, DV_DULL,
232 sizeof(struct cfdriver) };
235 i4bopen, i4bclose, i4bread, nowrite,
236 i4bioctl, i4bselect, nommap, nostrat,
237 nodump, nopsize, 0, nostop
241 i4bmatch(struct device *parent, struct cfdata *cf, void *aux)
243 printf("i4bmatch: aux=0x%x\n", aux);
247 dummy_i4battach(struct device *parent, struct device *self, void *aux)
249 printf("dummy_i4battach: aux=0x%x\n", aux);
251 #endif /* __bsdi__ */
253 /*---------------------------------------------------------------------------*
254 * interface attach routine
255 *---------------------------------------------------------------------------*/
258 i4battach(void *dummy)
263 printf("i4b: ISDN call control device attached\n");
265 i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
267 #if defined(__FreeBSD__) && __FreeBSD__ > 4
268 mtx_init(&i4b_rdqueue.ifq_mtx, "i4b_rdqueue", MTX_DEF);
271 #if defined(__FreeBSD__)
272 make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b");
276 /*---------------------------------------------------------------------------*
277 * i4bopen - device driver open routine
278 *---------------------------------------------------------------------------*/
280 i4bopen(dev_t dev, int flag, int fmt, struct proc *p)
292 i4b_l4_daemon_attached();
298 /*---------------------------------------------------------------------------*
299 * i4bclose - device driver close routine
300 *---------------------------------------------------------------------------*/
302 i4bclose(dev_t dev, int flag, int fmt, struct proc *p)
306 i4b_l4_daemon_detached();
307 i4b_Dcleanifq(&i4b_rdqueue);
312 /*---------------------------------------------------------------------------*
313 * i4bread - device driver read routine
314 *---------------------------------------------------------------------------*/
316 i4bread(dev_t dev, struct uio *uio, int ioflag)
326 IF_LOCK(&i4b_rdqueue);
327 while(IF_QEMPTY(&i4b_rdqueue))
330 #if defined (__FreeBSD__) && __FreeBSD__ > 4
331 error = msleep((caddr_t) &i4b_rdqueue, &i4b_rdqueue.ifq_mtx,
332 (PZERO + 1) | PCATCH, "bird", 0);
334 error = tsleep((caddr_t) &i4b_rdqueue, (PZERO + 1) | PCATCH,
338 IF_UNLOCK(&i4b_rdqueue);
344 _IF_DEQUEUE(&i4b_rdqueue, m);
345 IF_UNLOCK(&i4b_rdqueue);
350 error = uiomove(m->m_data, m->m_len, uio);
360 /*---------------------------------------------------------------------------*
361 * i4bioctl - device driver ioctl routine
362 *---------------------------------------------------------------------------*/
364 #if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
365 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
366 #elif defined(__bsdi__)
367 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
369 i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
380 /* cdid request, reserve cd and return cdid */
385 mir = (msg_cdid_req_t *)data;
387 mir->cdid = cd->cdid;
391 /* connect request, dial out to remote */
393 case I4B_CONNECT_REQ:
395 msg_connect_req_t *mcr;
396 mcr = (msg_connect_req_t *)data; /* setup ptr */
398 if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
400 NDBGL4(L4_ERR, "I4B_CONNECT_REQ ioctl, cdid not found!");
405 /* prevent dialling on leased lines */
406 if(ctrl_desc[mcr->controller].protocol == PROTOCOL_D64S)
408 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
409 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_LLDIAL);
410 i4b_l4_disconnect_ind(cd);
415 cd->controller = mcr->controller; /* fill cd */
416 cd->bprot = mcr->bprot;
417 cd->driver = mcr->driver;
418 cd->driver_unit = mcr->driver_unit;
419 cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
421 cd->shorthold_data.shorthold_algorithm = mcr->shorthold_data.shorthold_algorithm;
422 cd->shorthold_data.unitlen_time = mcr->shorthold_data.unitlen_time;
423 cd->shorthold_data.idle_time = mcr->shorthold_data.idle_time;
424 cd->shorthold_data.earlyhup_time = mcr->shorthold_data.earlyhup_time;
426 cd->last_aocd_time = 0;
427 if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
434 cd->max_idle_time = 0; /* this is outgoing */
436 cd->dir = DIR_OUTGOING;
438 NDBGL4(L4_TIMO, "I4B_CONNECT_REQ times, algorithm=%ld unitlen=%ld idle=%ld earlyhup=%ld",
439 (long)cd->shorthold_data.shorthold_algorithm, (long)cd->shorthold_data.unitlen_time,
440 (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time);
442 strcpy(cd->dst_telno, mcr->dst_telno);
443 strcpy(cd->src_telno, mcr->src_telno);
445 if(mcr->keypad[0] != '\0')
446 strcpy(cd->keypad, mcr->keypad);
448 cd->keypad[0] = '\0';
450 cd->display[0] = '\0';
452 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
453 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
459 if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
460 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
467 i < ctrl_desc[mcr->controller].nbch &&
468 ctrl_desc[mcr->controller].bch_state[i] != BCH_ST_FREE;
470 if (i == ctrl_desc[mcr->controller].nbch)
471 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
472 /* else mcr->channel = i; XXX */
477 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
481 cd->channelid = mcr->channel;
483 cd->isdntxdelay = mcr->txdelay;
485 /* check whether we have a pointer. Seems like */
486 /* this should be adequate. GJ 19.09.97 */
487 if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
488 /*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
490 if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
492 i4b_l4_disconnect_ind(cd);
497 (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
502 /* connect response, accept/reject/ignore incoming call */
504 case I4B_CONNECT_RESP:
506 msg_connect_resp_t *mcrsp;
508 mcrsp = (msg_connect_resp_t *)data;
510 if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
512 NDBGL4(L4_ERR, "I4B_CONNECT_RESP ioctl, cdid not found!");
519 cd->driver = mcrsp->driver;
520 cd->driver_unit = mcrsp->driver_unit;
521 cd->max_idle_time = mcrsp->max_idle_time;
523 cd->shorthold_data.shorthold_algorithm = SHA_FIXU;
524 cd->shorthold_data.unitlen_time = 0; /* this is incoming */
525 cd->shorthold_data.idle_time = 0;
526 cd->shorthold_data.earlyhup_time = 0;
528 cd->isdntxdelay = mcrsp->txdelay;
530 NDBGL4(L4_TIMO, "I4B_CONNECT_RESP max_idle_time set to %ld seconds", (long)cd->max_idle_time);
532 (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
536 /* disconnect request, actively terminate connection */
538 case I4B_DISCONNECT_REQ:
540 msg_discon_req_t *mdr;
542 mdr = (msg_discon_req_t *)data;
544 if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
546 NDBGL4(L4_ERR, "I4B_DISCONNECT_REQ ioctl, cdid not found!");
551 /* preset causes with our cause */
552 cd->cause_in = cd->cause_out = mdr->cause;
554 (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
558 /* controller info request */
560 case I4B_CTRL_INFO_REQ:
562 msg_ctrl_info_req_t *mcir;
564 mcir = (msg_ctrl_info_req_t *)data;
565 mcir->ncontroller = nctrl;
567 if(mcir->controller > nctrl)
569 mcir->ctrl_type = -1;
570 mcir->card_type = -1;
575 ctrl_desc[mcir->controller].ctrl_type;
577 ctrl_desc[mcir->controller].card_type;
579 ctrl_desc[mcir->controller].nbch;
581 if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
582 mcir->tei = ctrl_desc[mcir->controller].tei;
591 case I4B_DIALOUT_RESP:
593 drvr_link_t *dlt = NULL;
594 msg_dialout_resp_t *mdrsp;
596 mdrsp = (msg_dialout_resp_t *)data;
598 switch(mdrsp->driver)
602 dlt = ipr_ret_linktab(mdrsp->driver_unit);
608 dlt = i4bisppp_ret_linktab(mdrsp->driver_unit);
614 dlt = tel_ret_linktab(mdrsp->driver_unit);
620 dlt = ibc_ret_linktab(mdrsp->driver_unit);
626 dlt = ing_ret_linktab(mdrsp->driver_unit);
632 (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat, mdrsp->cause);
636 /* update timeout value */
638 case I4B_TIMEOUT_UPD:
640 msg_timeout_upd_t *mtu;
643 mtu = (msg_timeout_upd_t *)data;
645 NDBGL4(L4_TIMO, "I4B_TIMEOUT_UPD ioctl, alg %d, unit %d, idle %d, early %d!",
646 mtu->shorthold_data.shorthold_algorithm, mtu->shorthold_data.unitlen_time,
647 mtu->shorthold_data.idle_time, mtu->shorthold_data.earlyhup_time);
649 if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
651 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, cdid not found!");
656 switch( mtu->shorthold_data.shorthold_algorithm )
660 * For this algorithm unitlen_time,
661 * idle_time and earlyhup_time are used.
664 if(!(mtu->shorthold_data.unitlen_time >= 0 &&
665 mtu->shorthold_data.idle_time >= 0 &&
666 mtu->shorthold_data.earlyhup_time >= 0))
668 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for fix unit algorithm!");
675 * For this algorithm unitlen_time and
676 * idle_time are used. both must be
677 * positive integers. earlyhup_time is
678 * not used and must be 0.
681 if(!(mtu->shorthold_data.unitlen_time > 0 &&
682 mtu->shorthold_data.idle_time >= 0 &&
683 mtu->shorthold_data.earlyhup_time == 0))
685 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for var unit algorithm!");
691 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid algorithm!");
697 * any error set above requires us to break
698 * out of the outer switch
704 cd->shorthold_data.shorthold_algorithm = mtu->shorthold_data.shorthold_algorithm;
705 cd->shorthold_data.unitlen_time = mtu->shorthold_data.unitlen_time;
706 cd->shorthold_data.idle_time = mtu->shorthold_data.idle_time;
707 cd->shorthold_data.earlyhup_time = mtu->shorthold_data.earlyhup_time;
712 /* soft enable/disable interface */
716 msg_updown_ind_t *mui;
718 mui = (msg_updown_ind_t *)data;
721 if(mui->driver == BDRV_IPR)
724 dlt = ipr_ret_linktab(mui->driver_unit);
725 (*dlt->updown_ind)(mui->driver_unit, mui->updown);
731 /* send ALERT request */
735 msg_alert_req_t *mar;
737 mar = (msg_alert_req_t *)data;
739 if((cd = cd_by_cdid(mar->cdid)) == NULL)
741 NDBGL4(L4_ERR, "I4B_ALERT_REQ ioctl, cdid not found!");
748 (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
753 /* version/release number request */
759 mvr = (msg_vr_req_t *)data;
761 mvr->version = VERSION;
767 /* set D-channel protocol for a controller */
773 mpi = (msg_prot_ind_t *)data;
775 ctrl_desc[mpi->controller].protocol = mpi->protocol;
780 /* Download request */
782 case I4B_CTRL_DOWNLOAD:
784 struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
785 struct isdn_download_request *r =
786 (struct isdn_download_request*)data;
789 if (r->controller < 0 || r->controller >= nctrl)
795 if(!ctrl_desc[r->controller].N_DOWNLOAD)
801 prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
804 prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
807 if(!prots || !prots2)
813 copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
815 for(i = 0; i < r->numprotos; i++)
817 prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
818 copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
819 prots2[i].bytecount = prots[i].bytecount;
822 error = ctrl_desc[r->controller].N_DOWNLOAD(
823 ctrl_desc[r->controller].unit,
824 r->numprotos, prots2);
829 for(i = 0; i < r->numprotos; i++)
831 if(prots2[i].microcode)
833 free(prots2[i].microcode, M_DEVBUF);
836 free(prots2, M_DEVBUF);
841 free(prots, M_DEVBUF);
846 /* Diagnostic request */
848 case I4B_ACTIVE_DIAGNOSTIC:
850 struct isdn_diagnostic_request req, *r =
851 (struct isdn_diagnostic_request*)data;
853 req.in_param = req.out_param = NULL;
854 if (r->controller < 0 || r->controller >= nctrl)
860 if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
866 memcpy(&req, r, sizeof(req));
870 /* XXX arbitrary limit */
871 if (req.in_param_len >
872 I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
877 req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
884 error = copyin(r->in_param, req.in_param, req.in_param_len);
889 if(req.out_param_len)
891 req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
900 error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
902 if(!error && req.out_param_len)
903 error = copyout(req.out_param, r->out_param, req.out_param_len);
907 free(req.in_param, M_DEVBUF);
910 free(req.out_param, M_DEVBUF);
925 #ifdef OS_USES_SELECT
927 /*---------------------------------------------------------------------------*
928 * i4bselect - device driver select routine
929 *---------------------------------------------------------------------------*/
931 i4bselect(dev_t dev, int rw, struct proc *p)
941 if(!IF_QEMPTY(&i4b_rdqueue))
944 selrecord(p, &select_rd_info);
957 #else /* OS_USES_SELECT */
959 /*---------------------------------------------------------------------------*
960 * i4bpoll - device driver poll routine
961 *---------------------------------------------------------------------------*/
963 i4bpoll(dev_t dev, int events, struct proc *p)
970 if((events & POLLIN) || (events & POLLRDNORM))
972 if(!IF_QEMPTY(&i4b_rdqueue))
976 selrecord(p, &select_rd_info);
981 else if((events & POLLOUT) || (events & POLLWRNORM))
989 #endif /* OS_USES_SELECT */
991 /*---------------------------------------------------------------------------*
992 * i4bputqueue - put message into queue to userland
993 *---------------------------------------------------------------------------*/
995 i4bputqueue(struct mbuf *m)
1007 IF_LOCK(&i4b_rdqueue);
1008 if(_IF_QFULL(&i4b_rdqueue))
1011 _IF_DEQUEUE(&i4b_rdqueue, m1);
1013 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1016 _IF_ENQUEUE(&i4b_rdqueue, m);
1017 IF_UNLOCK(&i4b_rdqueue);
1024 wakeup((caddr_t) &i4b_rdqueue);
1030 selwakeup(&select_rd_info);
1034 /*---------------------------------------------------------------------------*
1035 * i4bputqueue_hipri - put message into front of queue to userland
1036 *---------------------------------------------------------------------------*/
1038 i4bputqueue_hipri(struct mbuf *m)
1050 IF_LOCK(&i4b_rdqueue);
1051 if(_IF_QFULL(&i4b_rdqueue))
1054 _IF_DEQUEUE(&i4b_rdqueue, m1);
1056 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1059 _IF_PREPEND(&i4b_rdqueue, m);
1060 IF_UNLOCK(&i4b_rdqueue);
1067 wakeup((caddr_t) &i4b_rdqueue);
1073 selwakeup(&select_rd_info);
1077 #endif /* NI4B > 0 */