Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Aug 2004 22:37:02 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 58740 for review
Message-ID:  <200408022237.i72Mb2t9045001@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=58740

Change 58740 by rwatson@rwatson_paprika on 2004/08/02 22:36:53

	Integ netperf_socket from FreeBSD CVS:
	
	/dev/null re-fixed for SMP.
	/dev/io re-fixed.
	More ALTQ driver support.
	TLS definitions for ELF.
	ATPIC interrupt optimizations. 
	More KSE commenting.
	MBUMA/UMA now handle failed init.
	MAX_SAFE_MAXVNODES.

Affected files ...

.. //depot/projects/netperf_socket/sys/amd64/amd64/mem.c#7 integrate
.. //depot/projects/netperf_socket/sys/amd64/include/elf.h#2 integrate
.. //depot/projects/netperf_socket/sys/arm/include/endian.h#3 integrate
.. //depot/projects/netperf_socket/sys/arm/include/vmparam.h#2 integrate
.. //depot/projects/netperf_socket/sys/boot/ofw/common/main.c#2 integrate
.. //depot/projects/netperf_socket/sys/boot/ofw/libofw/libofw.h#2 integrate
.. //depot/projects/netperf_socket/sys/boot/ofw/libofw/ofw_memory.c#2 integrate
.. //depot/projects/netperf_socket/sys/boot/powerpc/loader/Makefile#4 integrate
.. //depot/projects/netperf_socket/sys/dev/an/if_an.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/ath/if_ath.c#7 integrate
.. //depot/projects/netperf_socket/sys/dev/en/midway.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/hme/if_hme.c#9 integrate
.. //depot/projects/netperf_socket/sys/dev/if_ndis/if_ndis.c#16 integrate
.. //depot/projects/netperf_socket/sys/dev/io/iodev.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/mem/memdev.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/null/null.c#7 integrate
.. //depot/projects/netperf_socket/sys/dev/random/randomdev.c#12 integrate
.. //depot/projects/netperf_socket/sys/dev/syscons/syscons.c#11 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ehci.c#8 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ehci_pci.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ehcireg.h#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ehcivar.h#3 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ohci.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ohci_pci.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ohcivar.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uhci.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uhci_pci.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uhcivar.h#2 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uhub.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/usb.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/usb_mem.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/wi/if_wi.c#6 integrate
.. //depot/projects/netperf_socket/sys/geom/nop/g_nop.c#5 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/intr_machdep.c#6 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/io_apic.c#5 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/mem.c#9 integrate
.. //depot/projects/netperf_socket/sys/i386/include/elf.h#2 integrate
.. //depot/projects/netperf_socket/sys/i386/include/intr_machdep.h#3 integrate
.. //depot/projects/netperf_socket/sys/i386/isa/atpic.c#7 integrate
.. //depot/projects/netperf_socket/sys/ia64/conf/GENERIC#6 integrate
.. //depot/projects/netperf_socket/sys/ia64/conf/SKI#4 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/mem.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_kse.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_mbuf.c#3 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_proc.c#13 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_thread.c#20 integrate
.. //depot/projects/netperf_socket/sys/kern/sys_pipe.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/vfs_subr.c#18 integrate
.. //depot/projects/netperf_socket/sys/modules/Makefile#14 integrate
.. //depot/projects/netperf_socket/sys/pci/if_vr.c#11 integrate
.. //depot/projects/netperf_socket/sys/powerpc/conf/GENERIC#7 integrate
.. //depot/projects/netperf_socket/sys/powerpc/powerpc/trap.c#5 integrate
.. //depot/projects/netperf_socket/sys/security/mac/mac_label.c#2 integrate
.. //depot/projects/netperf_socket/sys/sys/gpt.h#2 integrate
.. //depot/projects/netperf_socket/sys/sys/mbuf.h#16 integrate
.. //depot/projects/netperf_socket/sys/sys/param.h#22 integrate
.. //depot/projects/netperf_socket/sys/vm/uma.h#4 integrate
.. //depot/projects/netperf_socket/sys/vm/uma_core.c#12 integrate
.. //depot/projects/netperf_socket/sys/vm/uma_dbg.c#3 integrate
.. //depot/projects/netperf_socket/sys/vm/uma_dbg.h#2 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_map.c#16 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_mmap.c#10 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_object.c#10 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/amd64/amd64/mem.c#7 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.117 2004/08/01 11:40:50 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.119 2004/08/02 20:36:47 markm Exp $");
 
 /*
  * Memory special file
@@ -47,6 +47,7 @@
 #include <sys/conf.h>
 #include <sys/fcntl.h>
 #include <sys/ioccom.h>
+#include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/memrange.h>
@@ -58,6 +59,7 @@
 #include <sys/uio.h>
 
 #include <machine/specialreg.h>
+#include <machine/vmparam.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -65,8 +67,19 @@
 
 #include <machine/memdev.h>
 
+/*
+ * Used in /dev/mem drivers and elsewhere
+ */
+MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 struct mem_range_softc mem_range_softc;
 
+void
+mem_range_AP_init(void)
+{
+	if (mem_range_softc.mr_op && mem_range_softc.mr_op->initAP)
+		mem_range_softc.mr_op->initAP(&mem_range_softc);
+}
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -137,8 +150,10 @@
  * allow user processes to MMAP some memory sections
  * instead of going through read/write
  */
+/* ARGSUSED */
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
+    int prot __unused)
 {
 	if (minor(dev) == CDEV_MINOR_MEM)
 		*paddr = offset;
@@ -154,8 +169,9 @@
  * This is basically just an ioctl shim for mem_range_attr_get
  * and mem_range_attr_set.
  */
+/* ARGSUSED */
 int 
-memioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
+memioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags,
     struct thread *td)
 {
 	int nd, error = 0;
@@ -236,15 +252,6 @@
 	return (mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg));
 }
 
-#ifdef SMP
-void
-mem_range_AP_init(void)
-{
-	if (mem_range_softc.mr_op && mem_range_softc.mr_op->initAP)
-		(mem_range_softc.mr_op->initAP(&mem_range_softc));
-}
-#endif
-
 void
 dev_mem_md_init(void)
 {

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

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/elf.h,v 1.16 2003/09/25 01:10:23 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/elf.h,v 1.17 2004/08/02 19:12:17 dfr Exp $
  */
 
 #ifndef _MACHINE_ELF_H_
@@ -124,8 +124,16 @@
 #define	R_X86_64_PC16	13	/* Add 16 bit signed extended pc relative symbol value */
 #define	R_X86_64_8	14	/* Add 8 bit zero extended symbol value */
 #define	R_X86_64_PC8	15	/* Add 8 bit signed extended pc relative symbol value */
+#define R_X86_64_DTPMOD64 16	/* ID of module containing symbol */
+#define R_X86_64_DTPOFF64 17	/* Offset in TLS block */
+#define R_X86_64_TPOFF64 18	/* Offset in static TLS block */
+#define R_X86_64_TLSGD	19	/* PC relative offset to GD GOT entry */
+#define R_X86_64_TLSLD	20	/* PC relative offset to LD GOT entry */
+#define R_X86_64_DTPOFF32 21	/* Offset in TLS block */
+#define R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
+#define R_X86_64_TPOFF32 23	/* Offset in static TLS block */
 
-#define	R_X86_64_COUNT	16	/* Count of defined relocation types. */
+#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
 
 /* Define "machine" characteristics */
 #if __ELF_WORD_SIZE == 32

==== //depot/projects/netperf_socket/sys/arm/include/endian.h#3 (text+ko) ====

@@ -27,7 +27,7 @@
  *
  *	@(#)endian.h	8.1 (Berkeley) 6/10/93
  * $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $
- * $FreeBSD: src/sys/arm/include/endian.h,v 1.3 2004/05/04 22:24:56 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/endian.h,v 1.4 2004/08/02 12:24:18 cognet Exp $
  */
 
 #ifndef _ENDIAN_H_
@@ -56,8 +56,8 @@
 #define _QUAD_LOWWORD 0
 #define __ntohl(x)        (__bswap32(x))
 #define __ntohs(x)        (__bswap16(x))
-#define __htonl(x)        (__bswap16(x))
-#define __htons(x)        (__bswap32(x))
+#define __htonl(x)        (__bswap32(x))
+#define __htons(x)        (__bswap16(x))
 
 static __inline __uint64_t
 __bswap64(__uint64_t _x)

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

@@ -28,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.1 2004/05/14 11:46:44 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.2 2004/08/02 12:23:53 cognet Exp $
  */
 
 #ifndef	_MACHINE_VMPARAM_H_
@@ -112,8 +112,9 @@
 
 #define VM_MAX_KERNEL_ADDRESS	0xffffffff
 /*
- *  * Virtual size (bytes) for various kernel submaps.
- *   */
+ * Virtual size (bytes) for various kernel submaps.
+ */
+
 #ifndef VM_KMEM_SIZE
 #define VM_KMEM_SIZE            (12*1024*1024)
 #endif

==== //depot/projects/netperf_socket/sys/boot/ofw/common/main.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/ofw/common/main.c,v 1.5 2004/01/04 23:27:31 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/ofw/common/main.c,v 1.6 2004/08/02 03:05:09 grehan Exp $");
 
 #include <stand.h>
 #include "openfirm.h"
@@ -42,6 +42,7 @@
 extern char bootprog_maker[];
 
 phandle_t	chosen;
+u_int32_t	acells;
 
 static char bootargs[128];
 
@@ -60,31 +61,40 @@
 	setheap(base, (void *)((int)base + HEAP_SIZE));
 }
 
-uint32_t
+uint64_t
 memsize(void)
 {
 	ihandle_t	meminstance;
 	phandle_t	memory;
 	struct ofw_reg	reg[4];
+	struct ofw_reg2	reg2[8];
 	int		i;
-	int		sz, memsz;
+	u_int64_t	sz, memsz;
 
 	OF_getprop(chosen, "memory", &meminstance, sizeof(meminstance));
 	memory = OF_instance_to_package(meminstance);
 
-	sz = OF_getprop(memory, "reg", &reg, sizeof(reg));
+	if (acells == 1) {
+		sz = OF_getprop(memory, "reg", &reg, sizeof(reg));
+		sz /= sizeof(struct ofw_reg);
+
+		for (i = 0, memsz = 0; i < sz; i++)
+			memsz += reg[i].size;
+	} else if (acells == 2) {
+		sz = OF_getprop(memory, "reg", &reg2, sizeof(reg2));
+		sz /= sizeof(struct ofw_reg2);
 
-	sz /= sizeof(struct ofw_reg);
+		for (i = 0, memsz = 0; i < sz; i++)
+			memsz += reg2[i].size;
+	}
 
-	for (i = 0, memsz = 0; i < sz; i++)
-		memsz += reg[i].size;
-	
 	return (memsz);
 }
 
 int
 main(int (*openfirm)(void *))
 {
+	phandle_t	root;
 	int		i;
 	char		bootpath[64];
 	char		*ch;
@@ -96,8 +106,12 @@
 	 */
 	OF_init(openfirm);
 
+	root = OF_finddevice("/");
 	chosen = OF_finddevice("/chosen");
 
+	acells = 1;
+	OF_getprop(root, "#address-cells", &acells, sizeof(acells));
+
 	/*
          * Set up console.
          */
@@ -125,7 +139,7 @@
 	printf("\n");
 	printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
 	printf("(%s, %s)\n", bootprog_maker, bootprog_date);
-	printf("Memory: %dKB\n", memsize() / 1024);
+	printf("Memory: %lldKB\n", memsize() / 1024);
 
 	OF_getprop(chosen, "bootpath", bootpath, 64);
 	ch = index(bootpath, ':');
@@ -142,7 +156,7 @@
 	bargc = 0;
 	parse(&bargc, &bargv, bootargs);
 	if (bargc == 1)
-		env_setenv("currdev", EV_VOLATILE, bargv[0], ofw_setcurrdev, 
+		env_setenv("currdev", EV_VOLATILE, bargv[0], ofw_setcurrdev,
 		    env_nounset);
 	else
 		env_setenv("currdev", EV_VOLATILE, bootpath,
@@ -180,6 +194,6 @@
 command_memmap(int argc, char **argv)
 {
 
-	ofw_memmap();
+	ofw_memmap(acells);
 	return (CMD_OK);
 }

==== //depot/projects/netperf_socket/sys/boot/ofw/libofw/libofw.h#2 (text+ko) ====

@@ -22,7 +22,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/boot/ofw/libofw/libofw.h,v 1.8 2003/12/21 12:38:25 grehan Exp $
+ * $FreeBSD: src/sys/boot/ofw/libofw/libofw.h,v 1.9 2004/08/02 03:05:09 grehan Exp $
  */
 
 #include "openfirm.h"
@@ -50,7 +50,7 @@
 extern int	ofw_boot(void);
 extern int	ofw_autoload(void);
 
-void	ofw_memmap(void);
+void	ofw_memmap(int);
 void	*ofw_alloc_heap(unsigned int);
 void	ofw_release_heap(void);
 
@@ -70,4 +70,11 @@
 	cell_t		size;
 };
 
+struct ofw_reg2
+{
+	cell_t		base_hi;
+	cell_t		base_lo;
+	cell_t		size;
+};
+
 extern int (*openfirmware)(void *);

==== //depot/projects/netperf_socket/sys/boot/ofw/libofw/ofw_memory.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/ofw/libofw/ofw_memory.c,v 1.4 2004/01/04 23:27:31 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/ofw/libofw/ofw_memory.c,v 1.5 2004/08/02 03:05:09 grehan Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -45,34 +45,74 @@
         int             mode;
 };
 
+struct ofw_mapping2 {
+        vm_offset_t     va;
+        int             len;
+        vm_offset_t     pa_hi;
+        vm_offset_t     pa_lo;
+        int             mode;
+};
+
 void
-ofw_memmap(void)
+ofw_memmap(int acells)
 {
-        phandle_t       mmup;
-        int             nmapping, i;
-        struct          ofw_mapping mappings[256];
-   
-        mmup = OF_instance_to_package(mmu);
- 
-        bzero(mappings, sizeof(mappings));
- 
-        nmapping = OF_getprop(mmup, "translations", mappings, sizeof(mappings));
+	struct		ofw_mapping *mapptr;
+	struct		ofw_mapping2 *mapptr2;
+        phandle_t	mmup;
+        int		nmapping, i;
+        u_char		mappings[256 * sizeof(struct ofw_mapping2)];
+        char		lbuf[80];
+
+	mmup = OF_instance_to_package(mmu);
+
+	bzero(mappings, sizeof(mappings));
+
+	nmapping = OF_getprop(mmup, "translations", mappings, sizeof(mappings));
 	if (nmapping == -1) {
 		printf("Could not get memory map (%d)\n",
 		    nmapping);
 		return;
 	}
-        nmapping /= sizeof(struct ofw_mapping);
+
+	pager_open();
+	if (acells == 1) {
+		nmapping /= sizeof(struct ofw_mapping);
+		mapptr = (struct ofw_mapping *) mappings;
+
+		printf("%17s\t%17s\t%8s\t%6s\n", "Virtual Range",
+		    "Physical Range", "#Pages", "Mode");
+
+		for (i = 0; i < nmapping; i++) {
+			sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n",
+				mapptr[i].va,
+				mapptr[i].va + mapptr[i].len,
+				mapptr[i].pa,
+				mapptr[i].pa + mapptr[i].len,
+				mapptr[i].len / 0x1000,
+				mapptr[i].mode);
+			if (pager_output(lbuf))
+				break;
+		}
+	} else {
+		nmapping /= sizeof(struct ofw_mapping2);
+		mapptr2 = (struct ofw_mapping2 *) mappings;
 
-        printf("%17s %17s %8s %6s\n", "Virtual Range", "Physical Range",
-            "#Pages", "Mode");
+		printf("%17s\t%17s\t%8s\t%6s\n", "Virtual Range",
+		       "Physical Range", "#Pages", "Mode");
 
-        for (i = 0; i < nmapping; i++) {
-                printf("%08x-%08x %08x-%08x %8d %6x\n", mappings[i].pa,
-                    mappings[i].pa + mappings[i].len, mappings[i].va,
-                    mappings[i].va + mappings[i].len, mappings[i].len / 0x1000,
-                    mappings[i].mode);
+		for (i = 0; i < nmapping; i++) {
+			sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n",
+				mapptr2[i].va,
+				mapptr2[i].va + mapptr2[i].len,
+				mapptr2[i].pa_lo,
+				mapptr2[i].pa_lo + mapptr2[i].len,
+				mapptr2[i].len / 0x1000,
+				mapptr2[i].mode);
+			if (pager_output(lbuf))
+				break;
+		}
 	}
+	pager_close();
 }
 
 void *

==== //depot/projects/netperf_socket/sys/boot/powerpc/loader/Makefile#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/powerpc/loader/Makefile,v 1.14 2004/07/08 12:52:35 grehan Exp $
+# $FreeBSD: src/sys/boot/powerpc/loader/Makefile,v 1.15 2004/08/02 03:06:21 grehan Exp $
 
 PROG=		loader
 NOMAN=
@@ -69,6 +69,9 @@
 
 LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
 
+# 64-bit bridge extensions
+CFLAGS+= -Wa,-mppc64bridge
+
 # Pull in common loader code
 .PATH:		${.CURDIR}/../../ofw/common
 .include	"${.CURDIR}/../../ofw/common/Makefile.inc"

==== //depot/projects/netperf_socket/sys/dev/an/if_an.c#6 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.62 2004/06/17 02:19:11 ambrisko Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.63 2004/08/01 23:58:03 mlaier Exp $");
 
 /*
  * The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form.
@@ -760,7 +760,9 @@
 	ifp->if_watchdog = an_watchdog;
 	ifp->if_init = an_init;
 	ifp->if_baudrate = 10000000;
-	ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
+	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	bzero(sc->an_config.an_nodename, sizeof(sc->an_config.an_nodename));
 	bcopy(AN_DEFAULT_NODENAME, sc->an_config.an_nodename,
@@ -1254,7 +1256,7 @@
 	/* Re-enable interrupts. */
 	CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
 
-	if ((ifp->if_flags & IFF_UP) && (ifp->if_snd.ifq_head != NULL))
+	if ((ifp->if_flags & IFF_UP) && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		an_start(ifp);
 
 	AN_UNLOCK(sc);
@@ -2655,7 +2657,7 @@
 	/* We can't send in monitor mode so toss any attempts. */
 	if (sc->an_monitor && (ifp->if_flags & IFF_PROMISC)) {
 		for (;;) {
-			IF_DEQUEUE(&ifp->if_snd, m0);
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
 			if (m0 == NULL)
 				break;
 			m_freem(m0);
@@ -2669,7 +2671,7 @@
 		bzero((char *)&tx_frame_802_3, sizeof(tx_frame_802_3));
 
 		while (sc->an_rdata.an_tx_ring[idx] == 0) {
-			IF_DEQUEUE(&ifp->if_snd, m0);
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
 			if (m0 == NULL)
 				break;
 
@@ -2730,7 +2732,7 @@
 
 		while (sc->an_rdata.an_tx_empty ||
 		    idx != sc->an_rdata.an_tx_cons) {
-			IF_DEQUEUE(&ifp->if_snd, m0);
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
 			if (m0 == NULL) {
 				break;
 			}

==== //depot/projects/netperf_socket/sys/dev/ath/if_ath.c#7 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.54 2004/04/05 04:42:42 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.55 2004/08/01 23:58:04 mlaier Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -304,7 +304,9 @@
 	ifp->if_watchdog = ath_watchdog;
 	ifp->if_ioctl = ath_ioctl;
 	ifp->if_init = ath_init;
-	ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
+	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	ic->ic_softc = sc;
 	ic->ic_newassoc = ath_newassoc;
@@ -662,7 +664,7 @@
 			ath_stoprecv(sc);
 		else
 			sc->sc_rxlink = NULL;
-		IF_DRAIN(&ifp->if_snd);
+		IFQ_DRV_PURGE(&ifp->if_snd);
 		ath_beacon_free(sc);
 		ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
 		if (!sc->sc_invalid)
@@ -759,7 +761,7 @@
 				ATH_TXBUF_UNLOCK(sc);
 				break;
 			}
-			IF_DEQUEUE(&ifp->if_snd, m);
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m);	/* XXX: LOCK */
 			if (m == NULL) {
 				ATH_TXBUF_LOCK(sc);
 				TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);

==== //depot/projects/netperf_socket/sys/dev/en/midway.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/en/midway.c,v 1.62 2004/07/10 21:03:52 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/en/midway.c,v 1.63 2004/08/02 00:18:34 green Exp $");
 
 /*
  *
@@ -437,25 +437,21 @@
  *
  * LOCK: any, not needed
  */
-static void
-en_map_ctor(void *mem, int size, void *arg)
+static int
+en_map_ctor(void *mem, int size, void *arg, int flags)
 {
 	struct en_softc *sc = arg;
 	struct en_map *map = mem;
 	int err;
 
-	if (map->sc == NULL)
-		map->sc = sc;
-
-	if (!(map->flags & ENMAP_ALLOC)) {
-		err = bus_dmamap_create(sc->txtag, 0, &map->map);
-		if (err != 0)
-			if_printf(&sc->ifatm.ifnet,
-			    "cannot create DMA map %d\n", err);
-		else
-			map->flags |= ENMAP_ALLOC;
+	err = bus_dmamap_create(sc->txtag, 0, &map->map);
+	if (err != 0) {
+		if_printf(&sc->ifatm.ifnet, "cannot create DMA map %d\n", err);
+		return (err);
 	}
-	map->flags &= ~ENMAP_LOADED;
+	map->flags = ENMAP_ALLOC;
+	map->sc = sc;
+	return (0);
 }
 
 /*
@@ -490,8 +486,7 @@
 {
 	struct en_map *map = mem;
 
-	if (map->flags & ENMAP_ALLOC)
-		bus_dmamap_destroy(map->sc->txtag, map->map);
+	bus_dmamap_destroy(map->sc->txtag, map->map);
 }
 
 /*********************************************************************/
@@ -1041,11 +1036,9 @@
 		 * locks.
 		 */
 		map = uma_zalloc_arg(sc->map_zone, sc, M_NOWAIT);
-		if (map == NULL || !(map->flags & ENMAP_ALLOC)) {
+		if (map == NULL) {
 			/* drop that packet */
 			EN_COUNT(sc->stats.txnomap);
-			if (map != NULL)
-				uma_zfree(sc->map_zone, map);
 			EN_UNLOCK(sc);
 			m_freem(m);
 			continue;
@@ -2330,13 +2323,11 @@
 	if (m != NULL) {
 		/* M_NOWAIT - called from interrupt context */
 		map = uma_zalloc_arg(sc->map_zone, sc, M_NOWAIT);
-		if (map == NULL || !(map->flags & ENMAP_ALLOC)) {
+		if (map == NULL) {
 			rx.post_skip += mlen;
 			m_freem(m);
 			DBG(sc, SERV, ("rx%td: out of maps",
 			    slot - sc->rxslot));
-			if (map->map != NULL)
-				uma_zfree(sc->map_zone, map);
 			goto skip;
 		}
 		rx.m = m;

==== //depot/projects/netperf_socket/sys/dev/hme/if_hme.c#9 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.27 2004/06/12 02:23:06 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.28 2004/08/01 23:58:04 mlaier Exp $");
 
 /*
  * HME Ethernet module driver.
@@ -276,7 +276,9 @@
 	ifp->if_ioctl = hme_ioctl;
 	ifp->if_init = hme_init;
 	ifp->if_watchdog = hme_watchdog;
-	ifp->if_snd.ifq_maxlen = HME_NTXQ;
+	IFQ_SET_MAXLEN(&ifp->if_snd, HME_NTXQ);
+	ifp->if_snd.ifq_drv_maxlen = HME_NTXQ;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	hme_mifinit(sc);
 
@@ -1002,14 +1004,14 @@
 
 	error = 0;
 	for (;;) {
-		IF_DEQUEUE(&ifp->if_snd, m);
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;
 
 		error = hme_load_txmbuf(sc, m);
 		if (error == -1) {
 			ifp->if_flags |= IFF_OACTIVE;
-			IF_PREPEND(&ifp->if_snd, m);
+			IFQ_DRV_PREPEND(&ifp->if_snd, m);
 			break;
 		} else if (error > 0) {
 			printf("hme_start: error %d while loading mbuf\n",

==== //depot/projects/netperf_socket/sys/dev/if_ndis/if_ndis.c#16 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.67 2004/08/01 22:25:12 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.68 2004/08/01 23:58:04 mlaier Exp $");
 
 #include "opt_bdg.h"
 
@@ -490,7 +490,13 @@
 	ifp->if_watchdog = ndis_watchdog;
 	ifp->if_init = ndis_init;
 	ifp->if_baudrate = 10000000;
+#if __FreeBSD_version < 502114
 	ifp->if_snd.ifq_maxlen = 50;
+#else
+	IFQ_SET_MAXLEN(&ifp->if_snd, 50);
+	ifp->if_snd.ifq_drv_maxlen = 25;
+	IFQ_SET_READY(&ifp->if_snd);
+#endif
 	ifp->if_capenable = ifp->if_capabilities;
 	ifp->if_hwassist = sc->ndis_hwassist;
 
@@ -1151,7 +1157,11 @@
 	struct ifnet		*ifp;
 
 	ifp = arg;
+#if __FreeBSD_version < 502114
 	if (ifp->if_snd.ifq_head != NULL)
+#else
+	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+#endif
 		ndis_start(ifp);
 	return;
 }
@@ -1191,15 +1201,24 @@
 	p0 = &sc->ndis_txarray[sc->ndis_txidx];
 
 	while(sc->ndis_txpending) {
+#if __FreeBSD_version < 502114
 		IF_DEQUEUE(&ifp->if_snd, m);
+#else
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+#endif
 		if (m == NULL)
 			break;
 
 		sc->ndis_txarray[sc->ndis_txidx] = NULL;
 
 		if (ndis_mtop(m, &sc->ndis_txarray[sc->ndis_txidx])) {
+#if __FreeBSD_version >= 502114
+			IFQ_DRV_PREPEND(&ifp->if_snd, m);
+#endif
 			NDIS_UNLOCK(sc);
+#if __FreeBSD_version < 502114
 			IF_PREPEND(&ifp->if_snd, m);
+#endif
 			return;
 		}
 

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

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/io/iodev.c,v 1.1 2004/08/01 11:40:52 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/io/iodev.c,v 1.2 2004/08/02 20:42:28 markm Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -87,3 +87,4 @@
 }
 
 DEV_MODULE(io, io_modevent, NULL);
+MODULE_VERSION(io, 1);

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

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mem/memdev.c,v 1.1 2004/08/01 11:40:52 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mem/memdev.c,v 1.2 2004/08/02 20:42:28 markm Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -106,3 +106,4 @@
 }
 
 DEV_MODULE(mem, mem_modevent, NULL);
+MODULE_VERSION(mem, 1);

==== //depot/projects/netperf_socket/sys/dev/null/null.c#7 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/null/null.c,v 1.29 2004/08/01 18:22:44 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/null/null.c,v 1.30 2004/08/02 19:59:41 markm Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -49,8 +49,8 @@
 static d_read_t zero_read;
 
 #define CDEV_MAJOR	2
-#define NULL_MINOR	0
-#define ZERO_MINOR	1
+#define NULL_MINOR	2
+#define ZERO_MINOR	12
 
 static struct cdevsw null_cdevsw = {
 	.d_version =	D_VERSION,
@@ -140,3 +140,4 @@
 }
 
 DEV_MODULE(null, null_modevent, NULL);
+MODULE_VERSION(null, 1);

==== //depot/projects/netperf_socket/sys/dev/random/randomdev.c#12 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/random/randomdev.c,v 1.57 2004/07/18 09:07:58 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/random/randomdev.c,v 1.58 2004/08/02 20:42:28 markm Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -227,3 +227,4 @@
 }
 
 DEV_MODULE(random, random_modevent, NULL);
+MODULE_VERSION(random, 1);

==== //depot/projects/netperf_socket/sys/dev/syscons/syscons.c#11 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/syscons/syscons.c,v 1.425 2004/07/28 06:29:02 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/syscons/syscons.c,v 1.426 2004/08/02 02:07:56 scottl Exp $");
 
 #include "opt_syscons.h"
 #include "opt_splash.h"
@@ -135,7 +135,7 @@
 
 static	int		enable_panic_key;
 SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key,
-	   0, "");
+	   0, "Enable panic via keypress specified in kbdmap(5)");
 
 #define SC_CONSOLECTL	255
 

==== //depot/projects/netperf_socket/sys/dev/usb/ehci.c#8 (text+ko) ====

@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.12 2004/08/01 18:47:42 iedowse Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.14 2004/08/02 15:37:34 iedowse Exp $");
 
 /*
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -168,11 +168,6 @@
 	} u;
 };
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-Static void		ehci_shutdown(void *);
-Static void		ehci_power(int, void *);
-#endif
-
 Static usbd_status	ehci_open(usbd_pipe_handle);
 Static void		ehci_poll(struct usbd_bus *);
 Static void		ehci_softintr(void *);
@@ -930,32 +925,38 @@
 		ehci_intr1(sc);
 }
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
 int
 ehci_detach(struct ehci_softc *sc, int flags)
 {
 	int rv = 0;
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 	if (sc->sc_child != NULL)
 		rv = config_detach(sc->sc_child, flags);
 
 	if (rv != 0)
 		return (rv);
+#endif
 
+	EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
+	EOWRITE4(sc, EHCI_USBCMD, 0);
+	EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
 	usb_uncallout(sc->sc_tmo_pcd, ehci_pcd_enable, sc);
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 	if (sc->sc_powerhook != NULL)
 		powerhook_disestablish(sc->sc_powerhook);
 	if (sc->sc_shutdownhook != NULL)
 		shutdownhook_disestablish(sc->sc_shutdownhook);
+#endif
 
 	usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */
 
+	usb_freemem(&sc->sc_bus, &sc->sc_fldma);
 	/* XXX free other data structures XXX */
 
 	return (rv);
 }
-#endif
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int
@@ -982,10 +983,9 @@
  * Handle suspend/resume.
  *
  * We need to switch to polling mode here, because this routine is
- * called from an intterupt context.  This is all right since we
+ * called from an interrupt context.  This is all right since we
  * are almost suspended anyway.
  */
-#if defined(__NetBSD__) || defined(__OpenBSD__)
 void
 ehci_power(int why, void *v)
 {
@@ -1001,7 +1001,9 @@
 	s = splhardusb();
 	switch (why) {
 	case PWR_SUSPEND:
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 	case PWR_STANDBY:
+#endif
 		sc->sc_bus.use_polling++;
 #if 0
 OOO
@@ -1045,19 +1047,19 @@
 #endif
 		sc->sc_bus.use_polling--;
 		break;
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 	case PWR_SOFTSUSPEND:
 	case PWR_SOFTSTANDBY:
 	case PWR_SOFTRESUME:
 		break;
+#endif
 	}
 	splx(s);
 }
-#endif
 
 /*
  * Shut down the controller when the system is going down.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408022237.i72Mb2t9045001>