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.3 2003/07/19 21:14:37 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,
334 error = tsleep((caddr_t) &i4b_rdqueue, PCATCH, "bird", 0);
337 IF_UNLOCK(&i4b_rdqueue);
343 _IF_DEQUEUE(&i4b_rdqueue, m);
344 IF_UNLOCK(&i4b_rdqueue);
349 error = uiomove(m->m_data, m->m_len, uio);
359 /*---------------------------------------------------------------------------*
360 * i4bioctl - device driver ioctl routine
361 *---------------------------------------------------------------------------*/
363 #if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
364 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
365 #elif defined(__bsdi__)
366 i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
368 i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
379 /* cdid request, reserve cd and return cdid */
384 mir = (msg_cdid_req_t *)data;
386 mir->cdid = cd->cdid;
390 /* connect request, dial out to remote */
392 case I4B_CONNECT_REQ:
394 msg_connect_req_t *mcr;
395 mcr = (msg_connect_req_t *)data; /* setup ptr */
397 if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
399 NDBGL4(L4_ERR, "I4B_CONNECT_REQ ioctl, cdid not found!");
404 /* prevent dialling on leased lines */
405 if(ctrl_desc[mcr->controller].protocol == PROTOCOL_D64S)
407 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
408 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_LLDIAL);
409 i4b_l4_disconnect_ind(cd);
414 cd->controller = mcr->controller; /* fill cd */
415 cd->bprot = mcr->bprot;
416 cd->driver = mcr->driver;
417 cd->driver_unit = mcr->driver_unit;
418 cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
420 cd->shorthold_data.shorthold_algorithm = mcr->shorthold_data.shorthold_algorithm;
421 cd->shorthold_data.unitlen_time = mcr->shorthold_data.unitlen_time;
422 cd->shorthold_data.idle_time = mcr->shorthold_data.idle_time;
423 cd->shorthold_data.earlyhup_time = mcr->shorthold_data.earlyhup_time;
425 cd->last_aocd_time = 0;
426 if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
433 cd->max_idle_time = 0; /* this is outgoing */
435 cd->dir = DIR_OUTGOING;
437 NDBGL4(L4_TIMO, "I4B_CONNECT_REQ times, algorithm=%ld unitlen=%ld idle=%ld earlyhup=%ld",
438 (long)cd->shorthold_data.shorthold_algorithm, (long)cd->shorthold_data.unitlen_time,
439 (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time);
441 strcpy(cd->dst_telno, mcr->dst_telno);
442 strcpy(cd->src_telno, mcr->src_telno);
444 if(mcr->keypad[0] != '\0')
445 strcpy(cd->keypad, mcr->keypad);
447 cd->keypad[0] = '\0';
449 cd->display[0] = '\0';
451 SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
452 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
458 if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
459 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
466 i < ctrl_desc[mcr->controller].nbch &&
467 ctrl_desc[mcr->controller].bch_state[i] != BCH_ST_FREE;
469 if (i == ctrl_desc[mcr->controller].nbch)
470 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
471 /* else mcr->channel = i; XXX */
476 SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
480 cd->channelid = mcr->channel;
482 cd->isdntxdelay = mcr->txdelay;
484 /* check whether we have a pointer. Seems like */
485 /* this should be adequate. GJ 19.09.97 */
486 if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
487 /*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
489 if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
491 i4b_l4_disconnect_ind(cd);
496 (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
501 /* connect response, accept/reject/ignore incoming call */
503 case I4B_CONNECT_RESP:
505 msg_connect_resp_t *mcrsp;
507 mcrsp = (msg_connect_resp_t *)data;
509 if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
511 NDBGL4(L4_ERR, "I4B_CONNECT_RESP ioctl, cdid not found!");
518 cd->driver = mcrsp->driver;
519 cd->driver_unit = mcrsp->driver_unit;
520 cd->max_idle_time = mcrsp->max_idle_time;
522 cd->shorthold_data.shorthold_algorithm = SHA_FIXU;
523 cd->shorthold_data.unitlen_time = 0; /* this is incoming */
524 cd->shorthold_data.idle_time = 0;
525 cd->shorthold_data.earlyhup_time = 0;
527 cd->isdntxdelay = mcrsp->txdelay;
529 NDBGL4(L4_TIMO, "I4B_CONNECT_RESP max_idle_time set to %ld seconds", (long)cd->max_idle_time);
531 (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
535 /* disconnect request, actively terminate connection */
537 case I4B_DISCONNECT_REQ:
539 msg_discon_req_t *mdr;
541 mdr = (msg_discon_req_t *)data;
543 if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
545 NDBGL4(L4_ERR, "I4B_DISCONNECT_REQ ioctl, cdid not found!");
550 /* preset causes with our cause */
551 cd->cause_in = cd->cause_out = mdr->cause;
553 (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
557 /* controller info request */
559 case I4B_CTRL_INFO_REQ:
561 msg_ctrl_info_req_t *mcir;
563 mcir = (msg_ctrl_info_req_t *)data;
564 mcir->ncontroller = nctrl;
566 if(mcir->controller > nctrl)
568 mcir->ctrl_type = -1;
569 mcir->card_type = -1;
574 ctrl_desc[mcir->controller].ctrl_type;
576 ctrl_desc[mcir->controller].card_type;
578 ctrl_desc[mcir->controller].nbch;
580 if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
581 mcir->tei = ctrl_desc[mcir->controller].tei;
590 case I4B_DIALOUT_RESP:
592 drvr_link_t *dlt = NULL;
593 msg_dialout_resp_t *mdrsp;
595 mdrsp = (msg_dialout_resp_t *)data;
597 switch(mdrsp->driver)
601 dlt = ipr_ret_linktab(mdrsp->driver_unit);
607 dlt = i4bisppp_ret_linktab(mdrsp->driver_unit);
613 dlt = tel_ret_linktab(mdrsp->driver_unit);
619 dlt = ibc_ret_linktab(mdrsp->driver_unit);
625 dlt = ing_ret_linktab(mdrsp->driver_unit);
631 (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat, mdrsp->cause);
635 /* update timeout value */
637 case I4B_TIMEOUT_UPD:
639 msg_timeout_upd_t *mtu;
642 mtu = (msg_timeout_upd_t *)data;
644 NDBGL4(L4_TIMO, "I4B_TIMEOUT_UPD ioctl, alg %d, unit %d, idle %d, early %d!",
645 mtu->shorthold_data.shorthold_algorithm, mtu->shorthold_data.unitlen_time,
646 mtu->shorthold_data.idle_time, mtu->shorthold_data.earlyhup_time);
648 if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
650 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, cdid not found!");
655 switch( mtu->shorthold_data.shorthold_algorithm )
659 * For this algorithm unitlen_time,
660 * idle_time and earlyhup_time are used.
663 if(!(mtu->shorthold_data.unitlen_time >= 0 &&
664 mtu->shorthold_data.idle_time >= 0 &&
665 mtu->shorthold_data.earlyhup_time >= 0))
667 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for fix unit algorithm!");
674 * For this algorithm unitlen_time and
675 * idle_time are used. both must be
676 * positive integers. earlyhup_time is
677 * not used and must be 0.
680 if(!(mtu->shorthold_data.unitlen_time > 0 &&
681 mtu->shorthold_data.idle_time >= 0 &&
682 mtu->shorthold_data.earlyhup_time == 0))
684 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for var unit algorithm!");
690 NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid algorithm!");
696 * any error set above requires us to break
697 * out of the outer switch
703 cd->shorthold_data.shorthold_algorithm = mtu->shorthold_data.shorthold_algorithm;
704 cd->shorthold_data.unitlen_time = mtu->shorthold_data.unitlen_time;
705 cd->shorthold_data.idle_time = mtu->shorthold_data.idle_time;
706 cd->shorthold_data.earlyhup_time = mtu->shorthold_data.earlyhup_time;
711 /* soft enable/disable interface */
715 msg_updown_ind_t *mui;
717 mui = (msg_updown_ind_t *)data;
720 if(mui->driver == BDRV_IPR)
723 dlt = ipr_ret_linktab(mui->driver_unit);
724 (*dlt->updown_ind)(mui->driver_unit, mui->updown);
730 /* send ALERT request */
734 msg_alert_req_t *mar;
736 mar = (msg_alert_req_t *)data;
738 if((cd = cd_by_cdid(mar->cdid)) == NULL)
740 NDBGL4(L4_ERR, "I4B_ALERT_REQ ioctl, cdid not found!");
747 (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
752 /* version/release number request */
758 mvr = (msg_vr_req_t *)data;
760 mvr->version = VERSION;
766 /* set D-channel protocol for a controller */
772 mpi = (msg_prot_ind_t *)data;
774 ctrl_desc[mpi->controller].protocol = mpi->protocol;
779 /* Download request */
781 case I4B_CTRL_DOWNLOAD:
783 struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
784 struct isdn_download_request *r =
785 (struct isdn_download_request*)data;
788 if (r->controller < 0 || r->controller >= nctrl)
794 if(!ctrl_desc[r->controller].N_DOWNLOAD)
800 prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
803 prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
806 if(!prots || !prots2)
812 copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
814 for(i = 0; i < r->numprotos; i++)
816 prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
817 copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
818 prots2[i].bytecount = prots[i].bytecount;
821 error = ctrl_desc[r->controller].N_DOWNLOAD(
822 ctrl_desc[r->controller].unit,
823 r->numprotos, prots2);
828 for(i = 0; i < r->numprotos; i++)
830 if(prots2[i].microcode)
832 free(prots2[i].microcode, M_DEVBUF);
835 free(prots2, M_DEVBUF);
840 free(prots, M_DEVBUF);
845 /* Diagnostic request */
847 case I4B_ACTIVE_DIAGNOSTIC:
849 struct isdn_diagnostic_request req, *r =
850 (struct isdn_diagnostic_request*)data;
852 req.in_param = req.out_param = NULL;
853 if (r->controller < 0 || r->controller >= nctrl)
859 if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
865 memcpy(&req, r, sizeof(req));
869 /* XXX arbitrary limit */
870 if (req.in_param_len >
871 I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
876 req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
883 error = copyin(r->in_param, req.in_param, req.in_param_len);
888 if(req.out_param_len)
890 req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
899 error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
901 if(!error && req.out_param_len)
902 error = copyout(req.out_param, r->out_param, req.out_param_len);
906 free(req.in_param, M_DEVBUF);
909 free(req.out_param, M_DEVBUF);
924 #ifdef OS_USES_SELECT
926 /*---------------------------------------------------------------------------*
927 * i4bselect - device driver select routine
928 *---------------------------------------------------------------------------*/
930 i4bselect(dev_t dev, int rw, struct proc *p)
940 if(!IF_QEMPTY(&i4b_rdqueue))
943 selrecord(p, &select_rd_info);
956 #else /* OS_USES_SELECT */
958 /*---------------------------------------------------------------------------*
959 * i4bpoll - device driver poll routine
960 *---------------------------------------------------------------------------*/
962 i4bpoll(dev_t dev, int events, struct proc *p)
969 if((events & POLLIN) || (events & POLLRDNORM))
971 if(!IF_QEMPTY(&i4b_rdqueue))
975 selrecord(p, &select_rd_info);
980 else if((events & POLLOUT) || (events & POLLWRNORM))
988 #endif /* OS_USES_SELECT */
990 /*---------------------------------------------------------------------------*
991 * i4bputqueue - put message into queue to userland
992 *---------------------------------------------------------------------------*/
994 i4bputqueue(struct mbuf *m)
1006 IF_LOCK(&i4b_rdqueue);
1007 if(_IF_QFULL(&i4b_rdqueue))
1010 _IF_DEQUEUE(&i4b_rdqueue, m1);
1012 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1015 _IF_ENQUEUE(&i4b_rdqueue, m);
1016 IF_UNLOCK(&i4b_rdqueue);
1023 wakeup((caddr_t) &i4b_rdqueue);
1029 selwakeup(&select_rd_info);
1033 /*---------------------------------------------------------------------------*
1034 * i4bputqueue_hipri - put message into front of queue to userland
1035 *---------------------------------------------------------------------------*/
1037 i4bputqueue_hipri(struct mbuf *m)
1049 IF_LOCK(&i4b_rdqueue);
1050 if(_IF_QFULL(&i4b_rdqueue))
1053 _IF_DEQUEUE(&i4b_rdqueue, m1);
1055 NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
1058 _IF_PREPEND(&i4b_rdqueue, m);
1059 IF_UNLOCK(&i4b_rdqueue);
1066 wakeup((caddr_t) &i4b_rdqueue);
1072 selwakeup(&select_rd_info);
1076 #endif /* NI4B > 0 */