summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplunky <plunky@NetBSD.org>2007-11-09 21:00:05 +0000
committerplunky <plunky@NetBSD.org>2007-11-09 21:00:05 +0000
commit985d6fdf0befcd1ec86ce8f5090d4f50e7579dfd (patch)
tree7f1d914e2d367ab0ce357745d7726a8d41d64e11
parentf9f695f53537a6e59cf133f7694f36923794d03e (diff)
Do not use insque/remque from libkern; they are about to be removed.
As an interim measure while the netiso code is being converted to use queue(3) macros, define and use our own private equivalent functions iso_insque/iso_remque.
-rw-r--r--sys/netiso/if_eon.c8
-rw-r--r--sys/netiso/iso.c81
-rw-r--r--sys/netiso/iso_pcb.c8
-rw-r--r--sys/netiso/iso_var.h4
-rw-r--r--sys/netiso/tp_input.c6
-rw-r--r--sys/netiso/tp_output.c6
-rw-r--r--sys/netiso/tp_pcb.c8
-rw-r--r--sys/netiso/tp_subr2.c6
-rw-r--r--sys/netiso/tp_usrreq.c7
9 files changed, 107 insertions, 27 deletions
diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c
index f0831e3ab24..4606178c81f 100644
--- a/sys/netiso/if_eon.c
+++ b/sys/netiso/if_eon.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eon.c,v 1.61 2007/10/19 12:16:47 ad Exp $ */
+/* $NetBSD: if_eon.c,v 1.62 2007/11/09 21:00:05 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -67,7 +67,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_eon.c,v 1.61 2007/10/19 12:16:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eon.c,v 1.62 2007/11/09 21:00:05 plunky Exp $");
#include "opt_eon.h"
@@ -266,7 +266,7 @@ eonrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
switch (cmd) {
case RTM_DELETE:
if (el) {
- remque(&el->el_qhdr);
+ iso_remque(&el->el_qhdr);
rtcache_free(&el->el_iproute);
Free(el);
rt->rt_llinfo = NULL;
@@ -281,7 +281,7 @@ eonrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
if (el == NULL)
return;
memset(el, 0, sizeof(*el));
- insque(&el->el_qhdr, &eon_llinfo.el_qhdr);
+ iso_insque(&el->el_qhdr, &eon_llinfo.el_qhdr);
el->el_rt = rt;
break;
}
diff --git a/sys/netiso/iso.c b/sys/netiso/iso.c
index 6049a345afa..23af77b4a2b 100644
--- a/sys/netiso/iso.c
+++ b/sys/netiso/iso.c
@@ -1,4 +1,37 @@
-/* $NetBSD: iso.c,v 1.42 2007/05/02 20:40:28 dyoung Exp $ */
+/* $NetBSD: iso.c,v 1.43 2007/11/09 21:00:06 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
/*-
* Copyright (c) 1991, 1993
@@ -62,7 +95,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iso.c,v 1.42 2007/05/02 20:40:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iso.c,v 1.43 2007/11/09 21:00:06 plunky Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -952,3 +985,47 @@ dump_isoaddr(const struct sockaddr_iso *s)
}
#endif /* ARGO_DEBUG */
+
+struct queue {
+ struct queue *q_next, *q_prev;
+};
+
+/*
+ * FUNCTION: iso_insque
+ *
+ * PURPOSE: insert an element into a queue
+ *
+ * RETURNS:
+ */
+void
+iso_insque(void *v1, void *v2)
+{
+ struct queue *elem = v1, *head = v2;
+ struct queue *next;
+
+ next = head->q_next;
+ elem->q_next = next;
+ head->q_next = elem;
+ elem->q_prev = head;
+ next->q_prev = elem;
+}
+
+/*
+ * FUNCTION: iso_remque
+ *
+ * PURPOSE: remove an element from a queue
+ *
+ * RETURNS:
+ */
+void
+iso_remque(void *v)
+{
+ struct queue *elem = v;
+ struct queue *next, *prev;
+
+ next = elem->q_next;
+ prev = elem->q_prev;
+ next->q_prev = prev;
+ prev->q_next = next;
+ elem->q_prev = NULL;
+}
diff --git a/sys/netiso/iso_pcb.c b/sys/netiso/iso_pcb.c
index 1b54829e1f5..4bb19f1516a 100644
--- a/sys/netiso/iso_pcb.c
+++ b/sys/netiso/iso_pcb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: iso_pcb.c,v 1.39 2007/05/02 20:40:29 dyoung Exp $ */
+/* $NetBSD: iso_pcb.c,v 1.40 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -62,7 +62,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iso_pcb.c,v 1.39 2007/05/02 20:40:29 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iso_pcb.c,v 1.40 2007/11/09 21:00:06 plunky Exp $");
#include "opt_iso.h"
@@ -118,7 +118,7 @@ iso_pcballoc(struct socket *so, void *v)
return ENOBUFS;
isop->isop_head = head;
isop->isop_socket = so;
- insque(isop, head);
+ iso_insque(isop, head);
if (so)
so->so_pcb = isop;
return 0;
@@ -545,7 +545,7 @@ iso_pcbdetach(void *v)
printf("iso_pcbdetach 4 \n");
}
#endif
- remque(isop);
+ iso_remque(isop);
#ifdef ARGO_DEBUG
if (argo_debug[D_ISO]) {
printf("iso_pcbdetach 5 \n");
diff --git a/sys/netiso/iso_var.h b/sys/netiso/iso_var.h
index 94eb6242891..393ca36fe65 100644
--- a/sys/netiso/iso_var.h
+++ b/sys/netiso/iso_var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: iso_var.h,v 1.26 2007/05/02 20:40:29 dyoung Exp $ */
+/* $NetBSD: iso_var.h,v 1.27 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1988, 1991, 1993
@@ -160,6 +160,8 @@ int iso_eqtype (struct iso_addr *, struct iso_addr *);
struct iso_ifaddr *iso_localifa (const struct sockaddr_iso *);
int iso_nlctloutput (int, int, void *, struct mbuf *);
void dump_isoaddr(const struct sockaddr_iso *);
+void iso_insque(void *, void *);
+void iso_remque(void *);
/* iso_chksum.c */
int iso_check_csum (struct mbuf *, int);
diff --git a/sys/netiso/tp_input.c b/sys/netiso/tp_input.c
index ad24e04051f..485dca0885a 100644
--- a/sys/netiso/tp_input.c
+++ b/sys/netiso/tp_input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tp_input.c,v 1.28 2007/03/04 06:03:33 christos Exp $ */
+/* $NetBSD: tp_input.c,v 1.29 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -79,7 +79,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tp_input.c,v 1.28 2007/03/04 06:03:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tp_input.c,v 1.29 2007/11/09 21:00:06 plunky Exp $");
#include "opt_iso.h"
@@ -899,7 +899,7 @@ again:
goto respond;
}
tpcb = sototpcb(so);
- insque(tpcb, parent_tpcb);
+ iso_insque(tpcb, parent_tpcb);
/*
* Stash the addresses in the net level pcb
diff --git a/sys/netiso/tp_output.c b/sys/netiso/tp_output.c
index 55a2016d0bd..8c6eb04c523 100644
--- a/sys/netiso/tp_output.c
+++ b/sys/netiso/tp_output.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tp_output.c,v 1.33 2007/04/29 20:23:36 msaitoh Exp $ */
+/* $NetBSD: tp_output.c,v 1.34 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -62,7 +62,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tp_output.c,v 1.33 2007/04/29 20:23:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tp_output.c,v 1.34 2007/11/09 21:00:06 plunky Exp $");
#include "opt_inet.h"
#include "opt_iso.h"
@@ -534,7 +534,7 @@ tp_ctloutput(int cmd, struct socket *so, int level, int optname,
tpcb->tp_lsuffixlen = 0;
tpcb->tp_state = TP_LISTENING;
error = 0;
- remque(tpcb);
+ iso_remque(tpcb);
tpcb->tp_next = tpcb->tp_prev = tpcb;
tpcb->tp_nextlisten = tp_listeners;
tp_listeners = tpcb;
diff --git a/sys/netiso/tp_pcb.c b/sys/netiso/tp_pcb.c
index 09865d73e20..3cdcbb99970 100644
--- a/sys/netiso/tp_pcb.c
+++ b/sys/netiso/tp_pcb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tp_pcb.c,v 1.34 2007/03/04 06:03:33 christos Exp $ */
+/* $NetBSD: tp_pcb.c,v 1.35 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -68,7 +68,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tp_pcb.c,v 1.34 2007/03/04 06:03:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tp_pcb.c,v 1.35 2007/11/09 21:00:06 plunky Exp $");
#include "opt_inet.h"
#include "opt_iso.h"
@@ -809,7 +809,7 @@ tp_detach(struct tp_pcb *tpcb)
tp_rsyflush(tpcb);
if (tpcb->tp_next) {
- remque(tpcb);
+ iso_remque(tpcb);
tpcb->tp_next = tpcb->tp_prev = 0;
}
tpcb->tp_notdetached = 0;
@@ -996,7 +996,7 @@ tp_pcbbind(void *v, struct mbuf *nam, struct lwp *l)
}
}
bcopy(tsel, tpcb->tp_lsuffix, (tpcb->tp_lsuffixlen = tlen));
- insque(tpcb, &tp_bound_pcbs);
+ iso_insque(tpcb, &tp_bound_pcbs);
} else {
if (tlen || siso == 0)
return (EINVAL);
diff --git a/sys/netiso/tp_subr2.c b/sys/netiso/tp_subr2.c
index 41787ae1ce4..b6b78df136f 100644
--- a/sys/netiso/tp_subr2.c
+++ b/sys/netiso/tp_subr2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tp_subr2.c,v 1.34 2007/03/04 06:03:33 christos Exp $ */
+/* $NetBSD: tp_subr2.c,v 1.35 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -66,7 +66,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tp_subr2.c,v 1.34 2007/03/04 06:03:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tp_subr2.c,v 1.35 2007/11/09 21:00:06 plunky Exp $");
/*
* this def'n is to cause the expansion of this macro in the routine
@@ -656,7 +656,7 @@ tp_route_to(struct mbuf *m, struct tp_pcb *tpcb, void *channel)
* level options or done a pcbconnect and XXXXXXX'edly apply
* to both inpcb's and isopcb's
*/
- remque(isop_new);
+ iso_remque(isop_new);
free(isop_new, M_PCB);
tpcb->tp_npcb = (void *) isop;
tpcb->tp_netservice = ISO_CONS;
diff --git a/sys/netiso/tp_usrreq.c b/sys/netiso/tp_usrreq.c
index 8665c912ed2..082b748d850 100644
--- a/sys/netiso/tp_usrreq.c
+++ b/sys/netiso/tp_usrreq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tp_usrreq.c,v 1.32 2007/03/04 06:03:33 christos Exp $ */
+/* $NetBSD: tp_usrreq.c,v 1.33 2007/11/09 21:00:06 plunky Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -65,7 +65,7 @@ SOFTWARE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tp_usrreq.c,v 1.32 2007/03/04 06:03:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tp_usrreq.c,v 1.33 2007/11/09 21:00:06 plunky Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: tp_usrreq.c,v 1.32 2007/03/04 06:03:33 christos Exp
#include <netiso/tp_meas.h>
#include <netiso/iso.h>
#include <netiso/iso_errno.h>
+#include <netiso/iso_var.h>
int TNew;
int TPNagle1, TPNagle2;
@@ -455,7 +456,7 @@ tp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
error = EINVAL;
else {
struct tp_pcb **tt;
- remque(tpcb);
+ iso_remque(tpcb);
tpcb->tp_next = tpcb->tp_prev = tpcb;
for (tt = &tp_listeners; *tt; tt = &((*tt)->tp_nextlisten))
if ((*tt)->tp_lsuffixlen)