PERFORCE change 51320 for review

Robert Watson rwatson at FreeBSD.org
Sun Apr 18 19:15:39 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=51320

Change 51320 by rwatson at rwatson_paprika on 2004/04/18 19:14:37

	Integrate netperf_socket:
	
	sf_buf API simplification.
	further arl statistics and card support.
	ciss bugfixes.
	bde vs puc head to head.
	luigi cleans up, staticizes, and constifies more in the network stack.
	duplication of arpcom fields, et al, reduced.
	Loop back of if_ppp softc list locking.
	0/NULL cleanups.

Affected files ...

.. //depot/projects/netperf_socket/sys/alpha/alpha/vm_machdep.c#5 integrate
.. //depot/projects/netperf_socket/sys/alpha/include/sf_buf.h#2 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#8 integrate
.. //depot/projects/netperf_socket/sys/amd64/include/sf_buf.h#2 integrate
.. //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#11 integrate
.. //depot/projects/netperf_socket/sys/dev/arl/if_arl.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/arl/if_arlreg.h#3 integrate
.. //depot/projects/netperf_socket/sys/dev/awi/awi.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/ciss/ciss.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/puc/puc_pccard.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/puc/pucdata.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/puc/pucvar.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/random/nehemiah.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/random/randomdev.c#6 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/vm_machdep.c#5 integrate
.. //depot/projects/netperf_socket/sys/ia64/include/sf_buf.h#2 integrate
.. //depot/projects/netperf_socket/sys/isa/psm.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_intr.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/uipc_mbuf.c#4 integrate
.. //depot/projects/netperf_socket/sys/modules/netgraph/Makefile#4 integrate
.. //depot/projects/netperf_socket/sys/modules/netgraph/hub/Makefile#1 branch
.. //depot/projects/netperf_socket/sys/net/if.c#6 integrate
.. //depot/projects/netperf_socket/sys/net/if_arp.h#3 integrate
.. //depot/projects/netperf_socket/sys/net/if_ethersubr.c#11 integrate
.. //depot/projects/netperf_socket/sys/net/if_fddisubr.c#5 integrate
.. //depot/projects/netperf_socket/sys/net/if_iso88025subr.c#5 integrate
.. //depot/projects/netperf_socket/sys/net/if_ppp.c#4 integrate
.. //depot/projects/netperf_socket/sys/net/if_var.h#9 integrate
.. //depot/projects/netperf_socket/sys/net/radix.c#3 integrate
.. //depot/projects/netperf_socket/sys/net/radix.h#3 integrate
.. //depot/projects/netperf_socket/sys/net/route.c#7 integrate
.. //depot/projects/netperf_socket/sys/net/route.h#7 integrate
.. //depot/projects/netperf_socket/sys/net/rtsock.c#5 integrate
.. //depot/projects/netperf_socket/sys/netgraph/ng_eiface.c#2 integrate
.. //depot/projects/netperf_socket/sys/netgraph/ng_ether.c#3 integrate
.. //depot/projects/netperf_socket/sys/netgraph/ng_hub.c#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/ng_hub.h#1 branch
.. //depot/projects/netperf_socket/sys/netinet/if_ether.c#7 integrate
.. //depot/projects/netperf_socket/sys/netinet6/nd6.c#3 integrate
.. //depot/projects/netperf_socket/sys/netinet6/nd6_rtr.c#2 integrate
.. //depot/projects/netperf_socket/sys/netipsec/xform_ipip.c#3 integrate
.. //depot/projects/netperf_socket/sys/powerpc/include/sf_buf.h#2 integrate
.. //depot/projects/netperf_socket/sys/powerpc/powerpc/vm_machdep.c#7 integrate
.. //depot/projects/netperf_socket/sys/sys/mbuf.h#6 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/alpha/alpha/vm_machdep.c#5 (text+ko) ====

@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.102 2004/04/03 09:16:24 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.103 2004/04/18 06:24:51 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,21 +101,7 @@
 
 #include <sys/user.h>
 
-static void	sf_buf_init(void *arg);
-SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL)
-
 /*
- * Expanded sf_freelist head. Really an SLIST_HEAD() in disguise, with the
- * sf_freelist head with the sf_lock mutex.
- */
-static struct {
-	SLIST_HEAD(, sf_buf) sf_head;
-	struct mtx sf_lock;
-} sf_freelist;
-
-static u_int	sf_buf_alloc_want;
-
-/*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child
  * ready to run and return to user mode.
@@ -384,69 +370,24 @@
 }
 
 /*
- * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
+ * Allocate an sf_buf for the given vm_page.  On this machine, however, there
+ * is no sf_buf object.  Instead, an opaque pointer to the given vm_page is
+ * returned.
  */
-static void
-sf_buf_init(void *arg)
-{
-	struct sf_buf *sf_bufs;
-	int i;
-
-	mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
-	SLIST_INIT(&sf_freelist.sf_head);
-	sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
-	    M_NOWAIT | M_ZERO);
-	for (i = 0; i < nsfbufs; i++)
-		SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
-	sf_buf_alloc_want = 0;
-}
-
-/*
- * Get an sf_buf from the freelist. Will block if none are available.
- */
 struct sf_buf *
 sf_buf_alloc(struct vm_page *m, int pri)
 {
-	struct sf_buf *sf;
-	int error;
 
-	mtx_lock(&sf_freelist.sf_lock);
-	while ((sf = SLIST_FIRST(&sf_freelist.sf_head)) == NULL) {
-		sf_buf_alloc_want++;
-		mbstat.sf_allocwait++;
-		error = msleep(&sf_freelist, &sf_freelist.sf_lock, PVM | pri,
-		    "sfbufa", 0);
-		sf_buf_alloc_want--;
-
-		/*
-		 * If we got a signal, don't risk going back to sleep. 
-		 */
-		if (error)
-			break;
-	}
-	if (sf != NULL) {
-		SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
-		sf->m = m;
-		nsfbufsused++;
-		nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
-	}
-	mtx_unlock(&sf_freelist.sf_lock);
-	return (sf);
+	return ((struct sf_buf *)m);
 }
 
 /*
- * Release resources back to the system.
+ * Free the sf_buf.  In fact, do nothing because there are no resources
+ * associated with the sf_buf.
  */
 void
 sf_buf_free(struct sf_buf *sf)
 {
-
-	mtx_lock(&sf_freelist.sf_lock);
-	SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
-	nsfbufsused--;
-	if (sf_buf_alloc_want > 0)
-		wakeup_one(&sf_freelist);
-	mtx_unlock(&sf_freelist.sf_lock);
 }
 
 /*

==== //depot/projects/netperf_socket/sys/alpha/include/sf_buf.h#2 (text+ko) ====

@@ -23,35 +23,36 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/alpha/include/sf_buf.h,v 1.1 2003/11/16 06:11:24 alc Exp $
+ * $FreeBSD: src/sys/alpha/include/sf_buf.h,v 1.2 2004/04/18 06:24:51 alc Exp $
  */
 
 #ifndef _MACHINE_SF_BUF_H_
 #define _MACHINE_SF_BUF_H_
 
-#include <sys/queue.h>
-
 #include <vm/vm.h>
 #include <vm/vm_param.h>
 #include <vm/vm_page.h>
 
-struct sf_buf {
-	SLIST_ENTRY(sf_buf) free_list;	/* list of free buffer slots */
-	vm_page_t m;			/* currently mapped page */
-};
+/*
+ * On this machine, the only purpose for which sf_buf is used is to implement
+ * an opaque pointer required by the machine-independent parts of the kernel.
+ * That pointer references the vm_page that is "mapped" by the sf_buf.  The
+ * actual mapping is provided by the direct virtual-to-physical mapping.  
+ */
+struct sf_buf;
 
 static __inline vm_offset_t
 sf_buf_kva(struct sf_buf *sf)
 {
 
-	return (ALPHA_PHYS_TO_K0SEG(sf->m->phys_addr));
+	return (ALPHA_PHYS_TO_K0SEG(VM_PAGE_TO_PHYS((vm_page_t)sf)));
 }
 
 static __inline vm_page_t
 sf_buf_page(struct sf_buf *sf)
 {
 
-	return (sf->m);
+	return ((vm_page_t)sf);
 }
 
 #endif /* !_MACHINE_SF_BUF_H_ */

==== //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#8 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.233 2004/04/11 04:26:58 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.234 2004/04/18 05:36:37 alc Exp $");
 
 #include "opt_isa.h"
 #include "opt_cpu.h"
@@ -85,20 +85,7 @@
 static u_int	cpu_reset_proxyid;
 static volatile u_int	cpu_reset_proxy_active;
 #endif
-static void	sf_buf_init(void *arg);
-SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL)
-
-/*
- * Expanded sf_freelist head. Really an SLIST_HEAD() in disguise, with the
- * sf_freelist head with the sf_lock mutex.
- */
-static struct {
-	SLIST_HEAD(, sf_buf) sf_head;
-	struct mtx sf_lock;
-} sf_freelist;
 
-static u_int	sf_buf_alloc_want;
-
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child
@@ -439,69 +426,24 @@
 }
 
 /*
- * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
- */
-static void
-sf_buf_init(void *arg)
-{
-	struct sf_buf *sf_bufs;
-	int i;
-
-	mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
-	SLIST_INIT(&sf_freelist.sf_head);
-	sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
-	    M_NOWAIT | M_ZERO);
-	for (i = 0; i < nsfbufs; i++)
-		SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
-	sf_buf_alloc_want = 0;
-}
-
-/*
- * Get an sf_buf from the freelist. Will block if none are available.
+ * Allocate an sf_buf for the given vm_page.  On this machine, however, there
+ * is no sf_buf object.  Instead, an opaque pointer to the given vm_page is
+ * returned.
  */
 struct sf_buf *
 sf_buf_alloc(struct vm_page *m, int pri)
 {
-	struct sf_buf *sf;
-	int error;
 
-	mtx_lock(&sf_freelist.sf_lock);
-	while ((sf = SLIST_FIRST(&sf_freelist.sf_head)) == NULL) {
-		sf_buf_alloc_want++;
-		mbstat.sf_allocwait++;
-		error = msleep(&sf_freelist, &sf_freelist.sf_lock, PVM | pri,
-		    "sfbufa", 0);
-		sf_buf_alloc_want--;
-
-		/*
-		 * If we got a signal, don't risk going back to sleep. 
-		 */
-		if (error)
-			break;
-	}
-	if (sf != NULL) {
-		SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
-		sf->m = m;
-		nsfbufsused++;
-		nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
-	}
-	mtx_unlock(&sf_freelist.sf_lock);
-	return (sf);
+	return ((struct sf_buf *)m);
 }
 
 /*
- * Release resources back to the system.
+ * Free the sf_buf.  In fact, do nothing because there are no resources
+ * associated with the sf_buf.
  */
 void
 sf_buf_free(struct sf_buf *sf)
 {
-
-	mtx_lock(&sf_freelist.sf_lock);
-	SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
-	nsfbufsused--;
-	if (sf_buf_alloc_want > 0)
-		wakeup_one(&sf_freelist);
-	mtx_unlock(&sf_freelist.sf_lock);
 }
 
 /*

==== //depot/projects/netperf_socket/sys/amd64/include/sf_buf.h#2 (text+ko) ====

@@ -23,35 +23,36 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/sf_buf.h,v 1.1 2003/11/16 06:11:25 alc Exp $
+ * $FreeBSD: src/sys/amd64/include/sf_buf.h,v 1.2 2004/04/18 05:36:37 alc Exp $
  */
 
 #ifndef _MACHINE_SF_BUF_H_
 #define _MACHINE_SF_BUF_H_
 
-#include <sys/queue.h>
-
 #include <vm/vm.h>
 #include <vm/vm_param.h>
 #include <vm/vm_page.h>
 
-struct sf_buf {
-	SLIST_ENTRY(sf_buf) free_list;	/* list of free buffer slots */
-	vm_page_t m;			/* currently mapped page */
-};
+/*
+ * On this machine, the only purpose for which sf_buf is used is to implement
+ * an opaque pointer required by the machine-independent parts of the kernel.
+ * That pointer references the vm_page that is "mapped" by the sf_buf.  The
+ * actual mapping is provided by the direct virtual-to-physical mapping.  
+ */
+struct sf_buf;
 
 static __inline vm_offset_t
 sf_buf_kva(struct sf_buf *sf)
 {
 
-	return (PHYS_TO_DMAP(sf->m->phys_addr));
+	return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf)));
 }
 
 static __inline vm_page_t
 sf_buf_page(struct sf_buf *sf)
 {
 
-	return (sf->m);
+	return ((vm_page_t)sf);
 }
 
 #endif /* !_MACHINE_SF_BUF_H_ */

==== //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#11 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.35 2004/04/16 00:04:28 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.36 2004/04/18 18:38:59 wpaul Exp $");
 
 #include <sys/ctype.h>
 #include <sys/unistd.h>
@@ -1029,7 +1029,7 @@
 	__asm__ __volatile__ ("" : "=c" (lock));
 
 	while (atomic_cmpset_acq_int((volatile u_int *)lock, 0, 1) == 0)
-		/* do nothing */;
+		/* sit and spin */;
 
 	return;
 }
@@ -1041,7 +1041,7 @@
 
 	__asm__ __volatile__ ("" : "=c" (lock));
 
-	atomic_cmpset_rel_int((volatile u_int *)lock, 1, 0);
+	atomic_store_rel_int((volatile u_int *)lock, 0);
 
 	return;
 }

==== //depot/projects/netperf_socket/sys/dev/arl/if_arl.c#3 (text+ko) ====

@@ -3,7 +3,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/arl/if_arl.c,v 1.4 2004/04/15 20:31:07 luigi Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/arl/if_arl.c,v 1.5 2004/04/17 20:30:05 fjoe Exp $");
 
 #include "opt_inet.h"
 
@@ -69,6 +69,9 @@
  */
 #define ARL_CHECKREG(sc) (ar->registrationMode && ar->registrationStatus == 0)
 
+#define GET_ARL_PARAM(name) (arcfg.name = ar->name)
+#define SET_ARL_PARAM(name) (ar->name = arcfg.name)
+
 #ifndef BPF_MTAP
 #define BPF_MTAP(_ifp,_m)					\
 	do {							\
@@ -114,6 +117,13 @@
 
 devclass_t	arl_devclass;
 
+u_int8_t rate2media[4] = {
+	IFM_IEEE80211_DS354k,
+	IFM_IEEE80211_DS512k,
+	IFM_IEEE80211_DS1,
+	IFM_IEEE80211_DS2
+};
+
 /*
  * Copy config values to local cache
  */
@@ -194,13 +204,16 @@
 	ifmedia_init(&sc->arl_ifmedia, 0, arl_media_change, arl_media_status);
 #define ADD(s, o)	ifmedia_add(&sc->arl_ifmedia, \
 	IFM_MAKEWORD(IFM_IEEE80211, (s), (o), 0), 0, NULL)
+	ADD(IFM_IEEE80211_DS354k, 0);
+	ADD(IFM_IEEE80211_DS354k, IFM_IEEE80211_ADHOC);
+	ADD(IFM_IEEE80211_DS512k, 0);
+	ADD(IFM_IEEE80211_DS512k, IFM_IEEE80211_ADHOC);
 	ADD(IFM_IEEE80211_DS1, 0);
 	ADD(IFM_IEEE80211_DS1, IFM_IEEE80211_ADHOC);
 	ADD(IFM_IEEE80211_DS2, 0);
 	ADD(IFM_IEEE80211_DS2, IFM_IEEE80211_ADHOC);
 	ifmedia_set(&sc->arl_ifmedia, IFM_MAKEWORD(IFM_IEEE80211,
-		arcfg.spreadingCode == 4 ? IFM_IEEE80211_DS2 : IFM_IEEE80211_DS1
-		, 0, 0)); 
+		rate2media[arcfg.spreadingCode - 1], 0, 0));
 #undef ADD
 
 	/*
@@ -1152,16 +1165,19 @@
 	int i;
 	static int cache_slot = 0;
 	static int wrapindex = 0;
+	u_int8_t zero[6] = {0, 0, 0, 0, 0, 0};
+	u_char *mac;
 
 	if ((ntohs(eh->ether_type) != ETHERTYPE_IP)) {
 		return;
 	}
 
+	mac = (dir == ARLCACHE_RX ? eh->ether_shost : eh->ether_dhost);
+
 	for (i = 0; i < MAXARLCACHE; i++) {
-		if (!bcmp(dir == ARLCACHE_RX ? eh->ether_shost : eh->ether_dhost,
-				sc->arl_sigcache[i].macsrc, 6)) {
+		if (!bcmp(zero, sc->arl_sigcache[i].macsrc, 6) ||
+		    !bcmp(mac, sc->arl_sigcache[i].macsrc, 6))
 			break;
-		}
 	}
 
 	if (i < MAXARLCACHE)
@@ -1187,12 +1203,19 @@
 	struct arl_softc *sc = ifp->if_softc;
 	int otype = arcfg.registrationMode;
 	int orate = arcfg.spreadingCode;
+	int nrate, i;
+
+	nrate = IFM_SUBTYPE(sc->arl_ifmedia.ifm_cur->ifm_media);
+
+	for(i = 1; i <= 4; i++) {
+		if (rate2media[i - 1] == nrate)
+			break;
+	}
 
-	arcfg.spreadingCode = ieee80211_media2rate(
-		IFM_SUBTYPE(sc->arl_ifmedia.ifm_cur->ifm_media));
+	if (i == 5)
+		return (EINVAL);
 
-	if (arcfg.spreadingCode == 2)
-		arcfg.spreadingCode = 3;
+	arcfg.spreadingCode = i;
 
 	/* XXX Need fix for PSP mode */
 	if ((sc->arl_ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_ADHOC) != 0)
@@ -1213,14 +1236,14 @@
 	struct ifmediareq	*imr;
 {
 	struct arl_softc	*sc = ifp->if_softc;
-	int rate = (arcfg.spreadingCode == 4 ?  4 : 2);
 
 	imr->ifm_active = IFM_IEEE80211;
 
 	if (arcfg.registrationMode == 0)
 		imr->ifm_active |= IFM_IEEE80211_ADHOC;
 
-	imr->ifm_active |= ieee80211_rate2media(NULL, rate, IEEE80211_T_DS);
+	imr->ifm_active |= IFM_MAKEWORD(IFM_IEEE80211,
+				rate2media[arcfg.spreadingCode - 1], 0, 0);
 	imr->ifm_status = IFM_AVALID;
 	if (!ARL_CHECKREG(sc))
 		imr->ifm_status |= IFM_ACTIVE;

==== //depot/projects/netperf_socket/sys/dev/arl/if_arlreg.h#3 (text+ko) ====

@@ -1,6 +1,6 @@
 /*
  * $RISS: if_arl/dev/arl/if_arlreg.h,v 1.4 2004/03/16 04:43:27 count Exp $
- * $FreeBSD: src/sys/dev/arl/if_arlreg.h,v 1.3 2004/04/13 19:25:23 fjoe Exp $
+ * $FreeBSD: src/sys/dev/arl/if_arlreg.h,v 1.4 2004/04/17 20:30:05 fjoe Exp $
  */
 
 #ifndef _IF_ARLREG_H
@@ -299,9 +299,6 @@
 		} \
 	} while (0);
 
-#define GET_ARL_PARAM(name)	(arcfg.name = ar->name)
-#define SET_ARL_PARAM(name)	(ar->name = arcfg.name)
-
 #ifdef _KERNEL
 void	arl_release_resources	(device_t);
 int	arl_alloc_memory	(device_t, int, int);

==== //depot/projects/netperf_socket/sys/dev/awi/awi.c#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$NetBSD: awi.c,v 1.61 2004/01/15 13:29:05 onoe Exp $	*/
+/*	$NetBSD: awi.c,v 1.62 2004/01/16 14:13:15 onoe Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
@@ -86,10 +86,10 @@
 
 #include <sys/cdefs.h>
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.61 2004/01/15 13:29:05 onoe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.62 2004/01/16 14:13:15 onoe Exp $");
 #endif
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.31 2004/03/20 19:57:46 mdodd Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.32 2004/04/18 01:05:02 onoe Exp $");
 #endif
 
 #include "opt_inet.h"
@@ -1112,7 +1112,7 @@
 	}
 	sc->sc_mib_mac.aPromiscuous_Enable = 0;
 #ifdef __FreeBSD__
-	if (ifp->if_amcount != 0)
+	if (ifp->if_flags & IFF_ALLMULTI)
 		goto set_mib;
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -1141,10 +1141,12 @@
 	sc->sc_mib_local.Accept_All_Multicast_Dis = 1;
 
   set_mib:
+#ifndef __FreeBSD__
 	if (sc->sc_mib_local.Accept_All_Multicast_Dis)
 		ifp->if_flags &= ~IFF_ALLMULTI;
 	else
 		ifp->if_flags |= IFF_ALLMULTI;
+#endif
 	sc->sc_mib_mgt.Wep_Required =
 	    (sc->sc_ic.ic_flags & IEEE80211_F_WEPON) ? AWI_WEP_ON : AWI_WEP_OFF;
 
@@ -1926,7 +1928,7 @@
 			case IEEE80211_S_ASSOC:
 			case IEEE80211_S_INIT:
 				ieee80211_begin_scan(ifp);
-				/* FALLTHRU */
+				break;
 			case IEEE80211_S_SCAN:
 				/* scan next */
 				break;
@@ -2084,8 +2086,11 @@
 
 	return (*sc->sc_newstate)(ic, nstate, arg);
 out:
-	if (error != 0)
+	if (error != 0) {
+		if (error == EINPROGRESS)
+			error = 0;
 		return error;
+	}
 	return (*sc->sc_newstate)(ic, nstate, arg);
 }
 

==== //depot/projects/netperf_socket/sys/dev/ciss/ciss.c#5 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/ciss/ciss.c,v 1.41 2004/04/16 23:00:01 ps Exp $
+ *	$FreeBSD: src/sys/dev/ciss/ciss.c,v 1.43 2004/04/19 00:57:29 ps Exp $
  */
 
 /*
@@ -458,8 +458,6 @@
     /* flush adapter cache */
     ciss_flush_adapter(sc);
 
-    destroy_dev(sc->ciss_dev_t);
-
     /* release all resources */
     ciss_free(sc);
 
@@ -1503,6 +1501,10 @@
 
     ciss_kill_notify_thread(sc);
 
+    /* remove the control device */
+    if (sc->ciss_dev_t != NULL)
+	destroy_dev(sc->ciss_dev_t);
+
     /* free the controller data */
     if (sc->ciss_id != NULL)
 	free(sc->ciss_id, CISS_MALLOC_CLASS);
@@ -2906,7 +2908,10 @@
     cnc->synchronous = 0;
     cnc->ordered = 0;
     cnc->seek_to_oldest = 0;
-    cnc->new_only = 0;
+    if ((sc->ciss_flags & CISS_FLAG_RUNNING) == 0)
+	cnc->new_only = 1;
+    else
+	cnc->new_only = 0;
     cnc->length = htonl(CISS_NOTIFY_DATA_SIZE);
 
     /* submit the request */
@@ -3412,9 +3417,15 @@
 ciss_spawn_notify_thread(struct ciss_softc *sc)
 {
 
+#if __FreeBSD_version > 500005
     if (kthread_create((void(*)(void *))ciss_notify_thread, sc,
 		       &sc->ciss_notify_thread, 0, 0, "ciss_notify%d",
 		       device_get_unit(sc->ciss_dev)))
+#else
+    if (kthread_create((void(*)(void *))ciss_notify_thread, sc,
+		       &sc->ciss_notify_thread, "ciss_notify%d",
+		       device_get_unit(sc->ciss_dev)))
+#endif
 	panic("Could not create notify thread\n");
 }
 

==== //depot/projects/netperf_socket/sys/dev/puc/puc_pccard.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/puc_pccard.c,v 1.7 2003/10/27 06:41:40 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/puc_pccard.c,v 1.8 2004/04/18 14:37:27 bde Exp $");
 
 #include "opt_puc.h"
 
@@ -50,7 +50,6 @@
 
 	"ARGOSY SP320 Dual port serial PCMCIA",
 	/* http://www.argosy.com.tw/product/sp320.htm */
-	NULL,
 		{	0,	0,	0,	0	},
 		{	0,	0,	0,	0	},
 	{

==== //depot/projects/netperf_socket/sys/dev/puc/pucdata.c#3 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.30 2004/02/04 18:01:02 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.43 2004/04/18 14:37:27 bde Exp $");
 
 /*
  * PCI "universal" communications card driver configuration data (used to
@@ -51,19 +51,26 @@
 
 const struct puc_device_description puc_devices[] = {
 
+	{   "Sunix SUN1889",
+	    {	0x0009,	0x7168,	0,	0	},
+	    {	0xffff,	0xffff,	0,	0	},
+	    {
+		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ * 8 },
+	    },
+	},
+
 	{   "Diva Serial [GSP] Multiport UART",
-	    NULL,
-	    {   0x103c, 0x1048, 0x103c, 0x1282 },
-	    {   0xffff, 0xffff, 0xffff, 0xffff },
+	    {	0x103c,	0x1048,	0x103c,	0x1282	},
+	    {	0xffff,	0xffff,	0xffff,	0xffff	},
 	    {
-		{   PUC_PORT_TYPE_UART, 0x10, 0x00, 0, PUC_FLAGS_MEMORY },
-		{   PUC_PORT_TYPE_UART, 0x10, 0x10, 0, PUC_FLAGS_MEMORY },
-		{   PUC_PORT_TYPE_UART, 0x10, 0x38, 0, PUC_FLAGS_MEMORY },
+		{ PUC_PORT_TYPE_UART, 0x10, 0x00, 0, PUC_FLAGS_MEMORY },
+		{ PUC_PORT_TYPE_UART, 0x10, 0x10, 0, PUC_FLAGS_MEMORY },
+		{ PUC_PORT_TYPE_UART, 0x10, 0x38, 0, PUC_FLAGS_MEMORY },
 	    },
 	},
 
 	{   "Comtrol RocketPort 550/4 RJ45",
-	    NULL,
 	    {	0x11fe,	0x8014,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -75,7 +82,6 @@
 	},
 
 	{   "Comtrol RocketPort 550/Quad",
-	    NULL,
 	    {	0x11fe,	0x8015,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -87,7 +93,6 @@
 	},
 
 	{   "Comtrol RocketPort 550/8 RJ11 part A",
-	    NULL,
 	    {	0x11fe,	0x8010,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -98,7 +103,6 @@
 	    },
 	},
 	{   "Comtrol RocketPort 550/8 RJ11 part B",
-	    NULL,
 	    {	0x11fe,	0x8011,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -110,7 +114,6 @@
 	},
 
 	{   "Comtrol RocketPort 550/8 Octa part A",
-	    NULL,
 	    {	0x11fe,	0x8012,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -121,7 +124,6 @@
 	    },
 	},
 	{   "Comtrol RocketPort 550/8 Octa part B",
-	    NULL,
 	    {	0x11fe,	0x8013,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -133,7 +135,6 @@
 	},
 
 	{   "Comtrol RocketPort 550/8 part A",
-	    NULL,
 	    {	0x11fe,	0x8018,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -144,7 +145,6 @@
 	    },
 	},
 	{   "Comtrol RocketPort 550/8 part B",
-	    NULL,
 	    {	0x11fe,	0x8019,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -156,7 +156,6 @@
 	},
 
 	{   "Comtrol RocketPort 550/16 part A",
-	    NULL,
 	    {	0x11fe,	0x8016,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -167,7 +166,6 @@
 	    },
 	},
 	{   "Comtrol RocketPort 550/16 part B",
-	    NULL,
 	    {	0x11fe,	0x8017,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -198,7 +196,6 @@
 	 * network/misc (0x02/0x80) device.
 	 */
 	{   "Dolphin Peripherals 4014",
-	    NULL,
 	    {	0x10b5,	0x9050,	0xd84d,	0x6810	},
 	    {	0xffff,	0xffff,	0xffff,	0xffff	},
 	    {
@@ -219,7 +216,6 @@
 	 * network/misc (0x02/0x80) device.
 	 */
 	{   "Dolphin Peripherals 4035",
-	    NULL,
 	    {	0x10b5,	0x9050,	0xd84d,	0x6808	},
 	    {	0xffff,	0xffff,	0xffff,	0xffff	},
 	    {
@@ -233,12 +229,11 @@
 	 * (Dolpin 4025 has the same ID but only one port)
 	 */
 	{   "Dolphin Peripherals 4036",
-	    NULL,
-	    {	0x1409,	0x7168,	0x0,	0x0	},
-	    {	0xffff,	0xffff,	0x0,	0x0	},
+	    {	0x1409,	0x7168,	0,	0	},
+	    {	0xffff,	0xffff,	0,	0	},
 	    {
-		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ * 8},
-		{ PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ * 8},
+		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ * 8 },
 	    },
 	},
 
@@ -264,7 +259,6 @@
 
 	/* SIIG Cyber Serial PCI 16C550 (10x family): 1S */
 	{   "SIIG Cyber Serial PCI 16C550 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1000,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -274,7 +268,6 @@
 
 	/* SIIG Cyber Serial PCI 16C650 (10x family): 1S */
 	{   "SIIG Cyber Serial PCI 16C650 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1001,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -284,7 +277,6 @@
 
 	/* SIIG Cyber Serial PCI 16C850 (10x family): 1S */
 	{   "SIIG Cyber Serial PCI 16C850 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1002,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -294,7 +286,6 @@
 
 	/* SIIG Cyber I/O PCI 16C550 (10x family): 1S, 1P */
 	{   "SIIG Cyber I/O PCI 16C550 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1010,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -305,7 +296,6 @@
 
 	/* SIIG Cyber I/O PCI 16C650 (10x family): 1S, 1P */
 	{   "SIIG Cyber I/O PCI 16C650 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1011,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -316,7 +306,6 @@
 
 	/* SIIG Cyber I/O PCI 16C850 (10x family): 1S, 1P */
 	{   "SIIG Cyber I/O PCI 16C850 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1012,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -327,7 +316,6 @@
 
 	/* SIIG Cyber Parallel PCI (10x family): 1P */
 	{   "SIIG Cyber Parallel PCI (10x family)",
-	    NULL,
 	    {	0x131f,	0x1020,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -337,7 +325,6 @@
 
 	/* SIIG Cyber Parallel Dual PCI (10x family): 2P */
 	{   "SIIG Cyber Parallel Dual PCI (10x family)",
-	    NULL,
 	    {	0x131f,	0x1021,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -348,7 +335,6 @@
 
 	/* SIIG Cyber Serial Dual PCI 16C550 (10x family): 2S */
 	{   "SIIG Cyber Serial Dual PCI 16C550 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1030,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -359,7 +345,6 @@
 
 	/* SIIG Cyber Serial Dual PCI 16C650 (10x family): 2S */
 	{   "SIIG Cyber Serial Dual PCI 16C650 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1031,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -370,7 +355,6 @@
 
 	/* SIIG Cyber Serial Dual PCI 16C850 (10x family): 2S */
 	{   "SIIG Cyber Serial Dual PCI 16C850 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1032,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -381,7 +365,6 @@
 
 	/* SIIG Cyber 2S1P PCI 16C550 (10x family): 2S, 1P */
 	{   "SIIG Cyber 2S1P PCI 16C550 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1034,	0,	0	},	/* XXX really? */
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -393,7 +376,6 @@
 
 	/* SIIG Cyber 2S1P PCI 16C650 (10x family): 2S, 1P */
 	{   "SIIG Cyber 2S1P PCI 16C650 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1035,	0,	0	},	/* XXX really? */
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -405,7 +387,6 @@
 
 	/* SIIG Cyber 2S1P PCI 16C850 (10x family): 2S, 1P */
 	{   "SIIG Cyber 2S1P PCI 16C850 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1036,	0,	0	},	/* XXX really? */
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -417,7 +398,6 @@
 
 	/* SIIG Cyber 4S PCI 16C550 (10x family): 4S */
 	{   "SIIG Cyber 4S PCI 16C550 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1050,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -430,7 +410,6 @@
 
 	/* SIIG Cyber 4S PCI 16C650 (10x family): 4S */
 	{   "SIIG Cyber 4S PCI 16C650 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1051,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -443,7 +422,6 @@
 
 	/* SIIG Cyber 4S PCI 16C850 (10x family): 4S */
 	{   "SIIG Cyber 4S PCI 16C850 (10x family)",
-	    NULL,
 	    {	0x131f,	0x1052,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -460,7 +438,6 @@
 
 	/* SIIG Cyber Parallel PCI (20x family): 1P */
 	{   "SIIG Cyber Parallel PCI (20x family)",
-	    NULL,
 	    {	0x131f,	0x2020,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -470,7 +447,6 @@
 
 	/* SIIG Cyber Parallel Dual PCI (20x family): 2P */
 	{   "SIIG Cyber Parallel Dual PCI (20x family)",
-	    NULL,
 	    {	0x131f,	0x2021,	0,	0	},
 	    {	0xffff,	0xffff,	0,	0	},
 	    {
@@ -481,7 +457,6 @@
 
 	/* SIIG Cyber 2P1S PCI 16C550 (20x family): 1S, 2P */

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list