PERFORCE change 42273 for review

Sam Leffler sam at FreeBSD.org
Thu Nov 13 13:27:07 PST 2003


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

Change 42273 by sam at sam_ebb on 2003/11/13 13:26:27

	IFC @ 42272

Affected files ...

.. //depot/projects/netperf/sys/alpha/alpha/clock.c#3 integrate
.. //depot/projects/netperf/sys/alpha/conf/GENERIC#3 integrate
.. //depot/projects/netperf/sys/amd64/amd64/exception.S#5 integrate
.. //depot/projects/netperf/sys/amd64/ia32/ia32_exception.S#2 integrate
.. //depot/projects/netperf/sys/amd64/isa/icu_vector.S#2 integrate
.. //depot/projects/netperf/sys/dev/aha/aha.c#5 integrate
.. //depot/projects/netperf/sys/dev/aha/aha_isa.c#5 integrate
.. //depot/projects/netperf/sys/dev/aha/ahareg.h#5 integrate
.. //depot/projects/netperf/sys/dev/ath/if_ath.c#34 integrate
.. //depot/projects/netperf/sys/dev/bge/if_bge.c#13 integrate
.. //depot/projects/netperf/sys/dev/ed/if_ed.c#6 integrate
.. //depot/projects/netperf/sys/dev/fe/if_fe.c#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/if_fwe.c#9 integrate
.. //depot/projects/netperf/sys/dev/lge/if_lge.c#5 integrate
.. //depot/projects/netperf/sys/dev/lnc/if_lnc.c#4 integrate
.. //depot/projects/netperf/sys/dev/my/if_my.c#6 integrate
.. //depot/projects/netperf/sys/dev/nge/if_nge.c#5 integrate
.. //depot/projects/netperf/sys/dev/re/if_re.c#6 integrate
.. //depot/projects/netperf/sys/dev/sn/if_sn.c#6 integrate
.. //depot/projects/netperf/sys/dev/tx/if_tx.c#6 integrate
.. //depot/projects/netperf/sys/dev/usb/if_aue.c#6 integrate
.. //depot/projects/netperf/sys/dev/usb/if_axe.c#4 integrate
.. //depot/projects/netperf/sys/dev/usb/if_cue.c#6 integrate
.. //depot/projects/netperf/sys/dev/usb/if_rue.c#5 integrate
.. //depot/projects/netperf/sys/dev/wl/if_wl.c#5 integrate
.. //depot/projects/netperf/sys/dev/xe/if_xe.c#8 integrate
.. //depot/projects/netperf/sys/fs/specfs/spec_vnops.c#8 integrate
.. //depot/projects/netperf/sys/i386/i386/apic_vector.s#3 integrate
.. //depot/projects/netperf/sys/i386/include/apicvar.h#3 integrate
.. //depot/projects/netperf/sys/i386/isa/clock.c#7 integrate
.. //depot/projects/netperf/sys/kern/kern_tc.c#5 integrate
.. //depot/projects/netperf/sys/net80211/ieee80211_ioctl.c#8 integrate
.. //depot/projects/netperf/sys/netgraph/atm/ng_atm.h#3 integrate
.. //depot/projects/netperf/sys/netgraph/atm/ng_sscop.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/atm/ngatmbase.h#2 integrate
.. //depot/projects/netperf/sys/netinet/in_pcb.c#16 integrate
.. //depot/projects/netperf/sys/netkey/key.c#8 integrate
.. //depot/projects/netperf/sys/pci/if_dc.c#13 integrate
.. //depot/projects/netperf/sys/pci/if_pcn.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_rl.c#12 integrate
.. //depot/projects/netperf/sys/pci/if_sf.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_sis.c#16 integrate
.. //depot/projects/netperf/sys/pci/if_sk.c#8 integrate
.. //depot/projects/netperf/sys/pci/if_ste.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_tl.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_vr.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_wb.c#5 integrate
.. //depot/projects/netperf/sys/pci/if_xl.c#11 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/machdep.c#8 integrate
.. //depot/projects/netperf/sys/ufs/ffs/ffs_snapshot.c#7 integrate

Differences ...

==== //depot/projects/netperf/sys/alpha/alpha/clock.c#3 (text+ko) ====

@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.34 2003/08/17 06:42:07 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.35 2003/11/13 09:24:21 jeff Exp $");
 
 #include "opt_clock.h"
 
@@ -737,13 +737,13 @@
 
 	outb(TIMER_CNTR2, pitch);
 	outb(TIMER_CNTR2, (pitch>>8));
+	mtx_unlock_spin(&clock_lock);
 	if (!beeping) {
 		/* enable counter2 output to speaker */
 		if (pitch) outb(IO_PPI, inb(IO_PPI) | 3);
 		beeping = period;
 		timeout(sysbeepstop, (void *)NULL, period);
 	}
-	mtx_unlock_spin(&clock_lock);
 	return (0);
 }
 

==== //depot/projects/netperf/sys/alpha/conf/GENERIC#3 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.163 2003/09/19 20:04:55 joerg Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.164 2003/11/13 02:04:34 jeff Exp $
 
 machine		alpha
 cpu		EV4
@@ -74,6 +74,7 @@
 options 	INVARIANTS		#Enable calls of extra sanity checking
 options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
 #options 	WITNESS			#Enable checks to detect deadlocks and cycles
+options         WITNESS_SKIPSPIN        #Don't run witness on spinlocks for speed
 
 # To make an SMP kernel, the next line is needed
 options 	SMP			# Symmetric MultiProcessor Kernel

==== //depot/projects/netperf/sys/amd64/amd64/exception.S#5 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.113 2003/10/15 02:04:52 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.114 2003/11/13 02:38:33 peter Exp $
  */
 
 #include <machine/asmacros.h>
@@ -172,11 +172,8 @@
 	movq	%r14,TF_R14(%rsp)
 	movq	%r15,TF_R15(%rsp)
 alltraps_with_regs_pushed:
-	FAKE_MCOUNT(13*4(%rsp))
 calltrap:
-	FAKE_MCOUNT(btrap)		/* init "from" btrap -> calltrap */
 	call	trap
-	MEXITCOUNT
 	jmp	doreti			/* Handle any pending ASTs */
 
 	/*
@@ -298,7 +295,6 @@
 	movq	%rbx, %rsi		/* arg1 */
 	movq	%rsp, %rdx		/* trapframe pointer */
 	call	fork_exit
-	MEXITCOUNT
 	jmp	doreti			/* Handle any ASTs */
 
 
@@ -322,7 +318,6 @@
 	.globl	doreti
 	.type	doreti, at function
 doreti:
-	FAKE_MCOUNT(bintr)		/* init "from" bintr -> doreti */
 	/*
 	 * Check if ASTs can be handled now.
 	 */
@@ -352,8 +347,6 @@
 	 *	registers.  The fault is handled in trap.c.
 	 */
 doreti_exit:
-	MEXITCOUNT
-
 	movq	TF_RDI(%rsp),%rdi
 	movq	TF_RSI(%rsp),%rsi
 	movq	TF_RDX(%rsp),%rdx

==== //depot/projects/netperf/sys/amd64/ia32/ia32_exception.S#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/ia32/ia32_exception.S,v 1.1 2003/05/14 04:10:48 peter Exp $
+ * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.2 2003/11/13 02:38:33 peter Exp $
  */
 
 #include <machine/asmacros.h>
@@ -63,7 +63,5 @@
 	movq	%r13,TF_R13(%rsp)
 	movq	%r14,TF_R14(%rsp)
 	movq	%r15,TF_R15(%rsp)
-	FAKE_MCOUNT(13*4(%rsp))
 	call	ia32_syscall
-	MEXITCOUNT
 	jmp	doreti

==== //depot/projects/netperf/sys/amd64/isa/icu_vector.S#2 (text+ko) ====

@@ -1,6 +1,6 @@
 /*
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/amd64/isa/icu_vector.S,v 1.39 2003/05/12 02:37:29 peter Exp $
+ * $FreeBSD: src/sys/amd64/isa/icu_vector.S,v 1.40 2003/11/13 02:38:33 peter Exp $
  */
 
 #define	IRQ_BIT(irq_num)	(1 << ((irq_num) % 8))
@@ -43,7 +43,6 @@
 	movq	%r13,TF_R13(%rsp) ;					\
 	movq	%r14,TF_R14(%rsp) ;					\
 	movq	%r15,TF_R15(%rsp) ;					\
-	FAKE_MCOUNT((12)*4(%rsp)) ;					\
 	call	critical_enter ;					\
 	movq	PCPU(CURTHREAD),%rbx ;					\
 	incl	TD_INTR_NESTING_LEVEL(%rbx) ;				\
@@ -55,7 +54,6 @@
 	incq	(%rax) ;						\
 	decl	TD_INTR_NESTING_LEVEL(%rbx) ;				\
 	call	critical_exit ;						\
-	MEXITCOUNT ;							\
 	jmp	doreti
 
 /* 
@@ -98,11 +96,9 @@
 	enable_icus ;							\
 	movq	PCPU(CURTHREAD),%rbx ;					\
 	incl	TD_INTR_NESTING_LEVEL(%rbx) ;				\
-	FAKE_MCOUNT(13*4(%rsp)) ;	/* XXX late to avoid double count */ \
 	movq	$irq_num, %rdi;	/* pass the IRQ */			\
 	call	sched_ithd ;						\
 	decl	TD_INTR_NESTING_LEVEL(%rbx) ;				\
-	MEXITCOUNT ;							\
 	/* We could usually avoid the following jmp by inlining some of */ \
 	/* doreti, but it's probably better to use less cache. */	\
 	jmp	doreti

==== //depot/projects/netperf/sys/dev/aha/aha.c#5 (text+ko) ====

@@ -57,9 +57,10 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aha/aha.c,v 1.54 2003/11/10 02:47:11 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aha/aha.c,v 1.55 2003/11/13 04:14:53 imp Exp $");
 
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/systm.h>
 #include <sys/malloc.h>
 #include <sys/kernel.h>
@@ -79,7 +80,7 @@
 
 #include <dev/aha/ahareg.h>
 
-#define	PRVERB(x) if (bootverbose) printf x
+#define	PRVERB(x) do { if (bootverbose) device_printf x; } while (0)
 
 /* Macro to determine that a rev is potentially a new valid one
  * so that the driver doesn't keep breaking on new revs as it
@@ -91,6 +92,8 @@
 static __inline void	ahanextinbox(struct aha_softc *aha);
 static __inline void	ahanextoutbox(struct aha_softc *aha);
 
+#define aha_name(aha)	device_get_nameunit(aha->dev)
+
 static __inline void
 ahanextinbox(struct aha_softc *aha)
 {
@@ -242,14 +245,13 @@
 	status = aha_inb(aha, STATUS_REG);
 	if ((status == 0) ||
 	    (status & (DIAG_ACTIVE|CMD_REG_BUSY | STATUS_REG_RSVD)) != 0) {
-		PRVERB(("%s: status reg test failed %x\n", aha_name(aha),
-		    status));
+		PRVERB((aha->dev, "status reg test failed %x\n", status));
 		return (ENXIO);
 	}
 
 	intstat = aha_inb(aha, INTSTAT_REG);
 	if ((intstat & INTSTAT_REG_RSVD) != 0) {
-		PRVERB(("%s: Failed Intstat Reg Test\n", aha_name(aha)));
+		PRVERB((aha->dev, "Failed Intstat Reg Test\n"));
 		return (ENXIO);
 	}
 
@@ -259,7 +261,7 @@
 	 * looking at a BusLogic.
 	 */
 	if ((error = ahareset(aha, /*hard_reset*/TRUE)) != 0) {
-		PRVERB(("%s: Failed Reset\n", aha_name(aha)));
+		PRVERB((aha->dev, "Failed Reset\n"));
 		return (ENXIO);
 	}
 
@@ -270,7 +272,7 @@
 	error = aha_cmd(aha, AOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
 	    (uint8_t*)&board_id, sizeof(board_id), DEFAULT_CMD_TIMEOUT);
 	if (error != 0) {
-		PRVERB(("%s: INQUIRE failed %x\n", aha_name(aha), error));
+		PRVERB((aha->dev, "INQUIRE failed %x\n", error));
 		return (ENXIO);
 	}
 	aha->fw_major = board_id.firmware_rev_major;
@@ -306,8 +308,8 @@
 		DELAY(10000);
 		status = aha_inb(aha, GEOMETRY_REG);
 		if (status != 0xff && status != 0x00 && status != 0x7f) {
-			PRVERB(("%s: Geometry Register test failed 0x%x\n",
-				aha_name(aha), status));
+			PRVERB((aha->dev, "Geometry Register test failed %#x\n",
+				status));
 			return (ENXIO);
 		}
 	}
@@ -373,21 +375,19 @@
 		    /*paramlen*/0, (u_char *)&extbios, sizeof(extbios),
 		    DEFAULT_CMD_TIMEOUT);
 		if (error != 0) {
-			printf("%s: AOP_RETURN_EXT_BIOS_INFO - Failed.",
-			    aha_name(aha));
+			device_printf(aha->dev,
+			    "AOP_RETURN_EXT_BIOS_INFO - Failed.");
 			return (error);
 		}
 		error = aha_cmd(aha, AOP_MBOX_IF_ENABLE, (uint8_t *)&extbios,
 		    /*paramlen*/2, NULL, 0, DEFAULT_CMD_TIMEOUT);
 		if (error != 0) {
-			printf("%s: AOP_MBOX_IF_ENABLE - Failed.",
-			    aha_name(aha));
+			device_printf(aha->dev, "AOP_MBOX_IF_ENABLE - Failed.");
 			return (error);
 		}
 	}
 	if (aha->boardid < 0x41)
-		printf("%s: Warning: aha-1542A won't likely work.\n",
-		    aha_name(aha));
+		device_printf(aha->dev, "Warning: aha-1542A won't work.\n");
 
 	aha->max_sg = 17;		/* Need >= 17 to do 64k I/O */
 	aha->diff_bus = 0;
@@ -400,8 +400,8 @@
 	    /*paramlen*/1, (uint8_t*)&setup_info, sizeof(setup_info),
 	    DEFAULT_CMD_TIMEOUT);
 	if (error != 0) {
-		printf("%s: aha_fetch_adapter_info - Failed "
-		    "Get Setup Info\n", aha_name(aha));
+		device_printf(aha->dev, "aha_fetch_adapter_info - Failed "
+		    "Get Setup Info\n");
 		return (error);
 	}
 	if (setup_info.initiate_sync != 0) {
@@ -416,8 +416,8 @@
 	error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
 	    (uint8_t*)&config_data, sizeof(config_data), DEFAULT_CMD_TIMEOUT);
 	if (error != 0) {
-		printf("%s: aha_fetch_adapter_info - Failed Get Config\n",
-		    aha_name(aha));
+		device_printf(aha->dev,
+		    "aha_fetch_adapter_info - Failed Get Config\n");
 		return (error);
 	}
 	aha->scsi_id = config_data.scsi_id;
@@ -431,7 +431,7 @@
 aha_init(struct aha_softc* aha)
 {
 	/* Announce the Adapter */
-	printf("%s: AHA-%s FW Rev. %c.%c (ID=%x) ", aha_name(aha),
+	device_printf(aha->dev, "AHA-%s FW Rev. %c.%c (ID=%x) ",
 	    aha->model, aha->fw_major, aha->fw_minor, aha->boardid);
 
 	if (aha->diff_bus != 0)
@@ -567,8 +567,8 @@
 	ahaallocccbs(aha);
 
 	if (aha->num_ccbs == 0) {
-		printf("%s: aha_init - Unable to allocate initial ccbs\n",
-		    aha_name(aha));
+		device_printf(aha->dev,
+		    "aha_init - Unable to allocate initial ccbs\n");
 		goto error_exit;
 	}
 
@@ -624,15 +624,6 @@
 	return (0);
 }
 
-char *
-aha_name(struct aha_softc *aha)
-{
-	static char name[10];
-
-	snprintf(name, sizeof(name), "aha%d", aha->unit);
-	return (name);
-}
-
 static void
 ahaallocccbs(struct aha_softc *aha)
 {
@@ -723,7 +714,7 @@
 		ahaallocccbs(aha);
 		accb = SLIST_FIRST(&aha->free_aha_ccbs);
 		if (accb == NULL)
-			printf("%s: Can't malloc ACCB\n", aha_name(aha));
+			device_printf(aha->dev, "Can't malloc ACCB\n");
 		else {
 			SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
 			aha->active_ccbs++;
@@ -1023,8 +1014,9 @@
 
 	if (error != 0) {
 		if (error != EFBIG)
-			printf("%s: Unexepected error 0x%x returned from "
-			    "bus_dmamap_load\n", aha_name(aha), error);
+			device_printf(aha->dev,
+			    "Unexepected error 0x%x returned from "
+			    "bus_dmamap_load\n", error);
 		if (ccb->ccb_h.status == CAM_REQ_INPROG) {
 			xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
 			ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN;
@@ -1104,9 +1096,9 @@
 		 * hung, one of the pending transactions will
 		 * timeout causing us to start recovery operations.
 		 */
-		printf("%s: Encountered busy mailbox with %d out of %d "
-		    "commands active!!!", aha_name(aha), aha->active_ccbs,
-		    aha->max_ccbs);
+		device_printf(aha->dev,
+		    "Encountered busy mailbox with %d out of %d "
+		    "commands active!!!", aha->active_ccbs, aha->max_ccbs);
 		untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch);
 		if (nseg != 0)
 			bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
@@ -1168,8 +1160,9 @@
 	csio = &accb->ccb->csio;
 
 	if ((accb->flags & ACCB_ACTIVE) == 0) {
-		printf("%s: ahadone - Attempt to free non-active ACCB %p\n",
-		    aha_name(aha), (void *)accb);
+		device_printf(aha->dev, 
+		    "ahadone - Attempt to free non-active ACCB %p\n",
+		    (void *)accb);
 		return;
 	}
 
@@ -1221,7 +1214,7 @@
 				ccb_h = LIST_NEXT(ccb_h, sim_links.le);
 			}
 		}
-		printf("%s: No longer in timeout\n", aha_name(aha));
+		device_printf(aha->dev, "No longer in timeout\n");
 		return;
 	}
 
@@ -1229,12 +1222,12 @@
 
 	switch (comp_code) {
 	case AMBI_FREE:
-		printf("%s: ahadone - CCB completed with free status!\n",
-		       aha_name(aha));
+		device_printf(aha->dev,
+		    "ahadone - CCB completed with free status!\n");
 		break;
 	case AMBI_NOT_FOUND:
-		printf("%s: ahadone - CCB Abort failed to find CCB\n",
-		       aha_name(aha));
+		device_printf(aha->dev,
+		    "ahadone - CCB Abort failed to find CCB\n");
 		break;
 	case AMBI_ABORT:
 	case AMBI_ERROR:
@@ -1292,8 +1285,8 @@
 				panic("%s: Invalid CCB Opcode %x hccb = %p",
 				    aha_name(aha), accb->hccb.opcode,
 				    &accb->hccb);
-			printf("%s: AHA-1540A detected, compensating\n",
-			    aha_name(aha));
+			device_printf(aha->dev,
+			    "AHA-1540A detected, maybe compensating\n");
 			aha->ccb_sg_opcode = INITIATOR_SG_CCB;
 			aha->ccb_ccb_opcode = INITIATOR_CCB;
 			xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
@@ -1363,8 +1356,8 @@
 		DELAY(100);
 	}
 	if (timeout == 0) {
-		PRVERB(("%s: ahareset - Diagnostic Active failed to "
-		    "assert. status = 0x%x\n", aha_name(aha), status));
+		PRVERB((aha->dev, "ahareset - Diagnostic Active failed to "
+		    "assert. status = %#x\n", status));
 		return (ETIMEDOUT);
 	}
 
@@ -1391,21 +1384,19 @@
 		DELAY(100);
 	}
 	if (timeout == 0) {
-		printf("%s: ahareset - Host adapter failed to come ready. "
-		    "status = 0x%x\n", aha_name(aha), status);
+		device_printf(aha->dev, "ahareset - Host adapter failed to "
+		    "come ready. status = 0x%x\n", status);
 		return (ETIMEDOUT);
 	}
 
 	/* If the diagnostics failed, tell the user */
 	if ((status & DIAG_FAIL) != 0
 	 || (status & HA_READY) == 0) {
-		printf("%s: ahareset - Adapter failed diagnostics\n",
-		    aha_name(aha));
+		device_printf(aha->dev, "ahareset - Adapter failed diag\n");
 
 		if ((status & DATAIN_REG_READY) != 0)
-			printf("%s: ahareset - Host Adapter Error "
-			    "code = 0x%x\n", aha_name(aha),
-			    aha_inb(aha, DATAIN_REG));
+			device_printf(aha->dev, "ahareset - Host Adapter "
+			    "Error code = 0x%x\n", aha_inb(aha, DATAIN_REG));
 		return (ENXIO);
 	}
 
@@ -1475,8 +1466,8 @@
 	splx(s);
 
 	if (timeout == 0) {
-		printf("%s: aha_cmd: Timeout waiting for adapter idle\n",
-		    aha_name(aha));
+		device_printf(aha->dev, 
+		    "aha_cmd: Timeout waiting for adapter idle\n");
 		return (ETIMEDOUT);
 	}
 	aha->command_cmp = 0;
@@ -1499,8 +1490,8 @@
 		DELAY(100);
 	}
 	if (timeout == 0) {
-		printf("%s: aha_cmd: Timeout waiting for adapter ready, "
-		    "status = 0x%x\n", aha_name(aha), status);
+		device_printf(aha->dev, "aha_cmd: Timeout waiting for adapter"
+		    " ready, status = 0x%x\n", status);
 		return (ETIMEDOUT);
 	}
 
@@ -1541,8 +1532,8 @@
 		}
 	}
 	if (timeout == 0) {
-		printf("%s: aha_cmd: Timeout sending parameters, "
-		       "status = 0x%x\n", aha_name(aha), status);
+		device_printf(aha->dev, "aha_cmd: Timeout sending parameters, "
+		    "status = 0x%x\n", status);
 		error = ETIMEDOUT;
 	}
 
@@ -1576,9 +1567,9 @@
 			if (reply_len < reply_buf_size) {
 				*reply_data++ = data;
 			} else {
-				printf("%s: aha_cmd - Discarded reply data "
-				    "byte for opcode 0x%x\n", aha_name(aha),
-				    opcode);
+				device_printf(aha->dev, 
+				    "aha_cmd - Discarded reply data "
+				    "byte for opcode 0x%x\n", opcode);
 			}
 			/*
 			 * Reset timeout to ensure at least a second
@@ -1590,10 +1581,9 @@
 		DELAY(100);
 	}
 	if (cmd_timeout == 0) {
-		printf("%s: aha_cmd: Timeout waiting for reply data and "
-		    "command complete.\n%s: status = 0x%x, intstat = 0x%x, "
-		    "reply_len = %d\n", aha_name(aha), aha_name(aha), status,
-		    intstat, reply_len);
+		device_printf(aha->dev, "aha_cmd: Timeout: status = 0x%x, "
+		    "intstat = 0x%x, reply_len = %d\n", status, intstat,
+		    reply_len);
 		return (ETIMEDOUT);
 	}
 
@@ -1612,7 +1602,7 @@
 	 * If the command was rejected by the controller, tell the caller.
 	 */
 	if ((saved_status & CMD_INVALID) != 0) {
-		PRVERB(("%s: Invalid Command 0x%x\n", aha_name(aha), opcode));
+		PRVERB((aha->dev, "Invalid Command 0x%x\n", opcode));
 		/*
 		 * Some early adapters may not recover properly from
 		 * an invalid command.  If it appears that the controller
@@ -1631,15 +1621,15 @@
 
 	if (param_len > 0) {
 		/* The controller did not accept the full argument list */
-		PRVERB(("%s: Controller did not accept full argument list "
-		    "(%d > 0)\n", aha_name(aha), param_len));
+		PRVERB((aha->dev, "Controller did not accept full argument "
+		    "list (%d > 0)\n", param_len));
 	 	return (E2BIG);
 	}
 
 	if (reply_len != reply_buf_size) {
 		/* Too much or too little data received */
-		PRVERB(("%s: Too much or too little data received (%d != %d)\n",
-		    aha_name(aha), reply_len, reply_buf_size));
+		PRVERB((aha->dev, "data received mismatch (%d != %d)\n",
+		    reply_len, reply_buf_size));
 		return (EMSGSIZE);
 	}
 
@@ -1699,8 +1689,9 @@
 	    (uint8_t*)&setup_info, sizeof(setup_info), DEFAULT_CMD_TIMEOUT);
 
 	if (error != 0) {
-		printf("%s: ahafetchtransinfo - Inquire Setup Info Failed %d\n",
-		    aha_name(aha), error);
+		device_printf(aha->dev,
+		    "ahafetchtransinfo - Inquire Setup Info Failed %d\n",
+		    error);
 		return;
 	}
 
@@ -1827,7 +1818,7 @@
 		 */
 		ccb->ccb_h.status = CAM_CMD_TIMEOUT;
 		ahareset(aha, /*hardreset*/TRUE);
-		printf("%s: No longer in timeout\n", aha_name(aha));
+		device_printf(aha->dev, "No longer in timeout\n");
 	} else {
 		/*
 		 * Send a Bus Device Reset message:

==== //depot/projects/netperf/sys/dev/aha/aha_isa.c#5 (text+ko) ====

@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aha/aha_isa.c,v 1.27 2003/11/10 02:47:11 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aha/aha_isa.c,v 1.28 2003/11/13 04:14:53 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,6 +115,7 @@
 	int	irq;
 	config_data_t config_data;
 
+	aha->dev = dev;
 	/* Check isapnp ids */
 	if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO)
 		return (ENXIO);
@@ -193,6 +194,7 @@
 	void		 *ih;
 	int		 error;
 
+	aha->dev = dev;
 	aha->portrid = 0;
 	aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid,
 	    0, ~0, AHA_NREGS, RF_ACTIVE);

==== //depot/projects/netperf/sys/dev/aha/ahareg.h#5 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/aha/ahareg.h,v 1.16 2003/11/12 05:44:44 imp Exp $
+ * $FreeBSD: src/sys/dev/aha/ahareg.h,v 1.17 2003/11/13 04:14:53 imp Exp $
  */
 
 #ifndef _AHAREG_H_
@@ -396,6 +396,7 @@
 	struct resource		*drq;
 	int			 drqrid;
 	void			**ih;
+	device_t		 dev;
 };
 
 void aha_alloc(struct aha_softc *, int, bus_space_tag_t, bus_space_handle_t);
@@ -409,7 +410,6 @@
 int aha_init(struct aha_softc *); 
 void aha_intr(void *);
 int aha_iop_from_bio(isa_compat_io_t);
-char *aha_name(struct aha_softc *);
 int aha_probe(struct aha_softc *);
 
 #define DEFAULT_CMD_TIMEOUT 10000	/* 1 sec */

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

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.31 2003/11/01 03:37:33 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.32 2003/11/13 05:35:07 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.

==== //depot/projects/netperf/sys/dev/bge/if_bge.c#13 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.58 2003/11/11 17:57:03 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.59 2003/11/13 20:55:47 obrien Exp $");
 
 /*
  * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.58 2003/11/11 17:57:03 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.59 2003/11/13 20:55:47 obrien Exp $");
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -209,7 +209,7 @@
 static u_int8_t	bge_eeprom_getbyte	(struct bge_softc *, int, u_int8_t *);
 static int bge_read_eeprom	(struct bge_softc *, caddr_t, int, int);
 
-static u_int32_t bge_crc	(caddr_t);
+static u_int32_t bge_mchash	(caddr_t);
 static void bge_setmulti	(struct bge_softc *);
 
 static void bge_handle_events	(struct bge_softc *);
@@ -1134,10 +1134,12 @@
 #define BGE_POLY	0xEDB88320
 
 static u_int32_t
-bge_crc(addr)
+bge_mchash(addr)
 	caddr_t addr;
 {
-	u_int32_t idx, bit, data, crc;
+	u_int32_t crc;
+	int idx, bit;
+	u_int8_t data;
 
 	/* Compute CRC for the address value. */
 	crc = 0xFFFFFFFF; /* initial value */
@@ -1177,7 +1179,7 @@
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		h = bge_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+		h = bge_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
 		hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F);
 	}
 

==== //depot/projects/netperf/sys/dev/ed/if_ed.c#6 (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/ed/if_ed.c,v 1.221 2003/10/31 18:31:58 brooks Exp $
+ * $FreeBSD: src/sys/dev/ed/if_ed.c,v 1.222 2003/11/13 20:55:48 obrien Exp $
  */
 
 /*
@@ -103,7 +103,7 @@
 
 static void	ed_setrcr	(struct ed_softc *);
 
-static u_int32_t ds_crc		(u_char *ep);
+static u_int32_t ds_mchash	(caddr_t addr);
 
 /*
  * Interrupt conversion table for WD/SMC ASIC/83C584
@@ -3531,22 +3531,20 @@
  * Compute crc for ethernet address
  */
 static u_int32_t
-ds_crc(ep)
-	u_char *ep;
+ds_mchash(addr)
+	caddr_t addr;
 {
-#define POLYNOMIAL 0x04c11db6
+#define ED_POLYNOMIAL 0x04c11db6
 	register u_int32_t crc = 0xffffffff;
-	register int carry, i, j;
-	register u_char b;
+	register int carry, idx, bit;
+	register u_char data;
 
-	for (i = 6; --i >= 0;) {
-		b = *ep++;
-		for (j = 8; --j >= 0;) {
-			carry = ((crc & 0x80000000) ? 1 : 0) ^ (b & 0x01);
+	for (idx = 6; --idx >= 0;) {
+		for (data = *addr++, bit = 8; --bit >= 0; data >>=1 ) {
+			carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01);
 			crc <<= 1;
-			b >>= 1;
 			if (carry)
-				crc = (crc ^ POLYNOMIAL) | carry;
+				crc = (crc ^ ED_POLYNOMIAL) | carry;
 		}
 	}
 	return crc;
@@ -3572,7 +3570,7 @@
 	TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))
+		index = ds_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))
 			>> 26;
 		af[index >> 3] |= 1 << (index & 7);
 	}

==== //depot/projects/netperf/sys/dev/fe/if_fe.c#4 (text+ko) ====

@@ -21,7 +21,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fe/if_fe.c,v 1.78 2003/10/31 18:32:00 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fe/if_fe.c,v 1.79 2003/11/13 20:55:48 obrien Exp $");
 
 /*
  *
@@ -2046,26 +2046,24 @@
 /*
  * Compute hash value for an Ethernet address
  */
-static int
-fe_hash ( u_char * ep )
+static u_int32_t
+fe_mchash (caddr_t addr)
 {
-#define FE_HASH_MAGIC_NUMBER 0xEDB88320L
+#define	FE_POLY 0xEDB88320L
 
-	u_long hash = 0xFFFFFFFFL;
-	int i, j;
-	u_char b;
-	u_long m;
+	u_long carry, crc = 0xFFFFFFFFL;
+	int idx, bit;
+	u_int8_t data;
 
-	for ( i = ETHER_ADDR_LEN; --i >= 0; ) {
-		b = *ep++;
-		for ( j = 8; --j >= 0; ) {
-			m = hash;
-			hash >>= 1;
-			if ( ( m ^ b ) & 1 ) hash ^= FE_HASH_MAGIC_NUMBER;
-			b >>= 1;
+	for ( idx = ETHER_ADDR_LEN; --idx >= 0; ) {
+		for (data = *addr++, bit = 8; --bit >= 0; data >>= 1) {
+			carry = crc;
+			crc >>= 1;
+			if ((carry ^ data) & 1)
+				crc ^= FE_POLY;
 		}
 	}
-	return ( ( int )( hash >> 26 ) );
+	return (crc >> 26);
 }
 
 /*
@@ -2083,7 +2081,7 @@
 	TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+		index = fe_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
 #ifdef FE_DEBUG
 		printf("%s: hash(%6D) == %d\n",
 			sc->sc_xname, enm->enm_addrlo , ":", index);

==== //depot/projects/netperf/sys/dev/firewire/if_fwe.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.24 2003/11/07 08:59:35 simokawa Exp $
+ * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.25 2003/11/13 06:29:40 simokawa Exp $
  */
 
 #include "opt_inet.h"
@@ -60,7 +60,6 @@
 
 #define FWEDEBUG	if (fwedebug) if_printf
 #define TX_MAX_QUEUE	(FWMAXQUEUE - 1)
-#define RX_MAX_QUEUE	FWMAXQUEUE
 
 /* network interface */
 static void fwe_start __P((struct ifnet *));
@@ -74,16 +73,23 @@
 static int fwedebug = 0;
 static int stream_ch = 1;
 static int tx_speed = 2;
+static int rx_queue_len = FWMAXQUEUE;
 
 MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface");
 SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, "");
 SYSCTL_DECL(_hw_firewire);
 SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0,
-	"Ethernet Emulation Subsystem");
+	"Ethernet emulation subsystem");
 SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RW, &stream_ch, 0,
 	"Stream channel to use");
 SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, tx_speed, CTLFLAG_RW, &tx_speed, 0,
-	"Transmission Speed");
+	"Transmission speed");
+SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len,
+	0, "Length of the receive queue");
+
+TUNABLE_INT("hw.firewire.fwe.stream_ch", &stream_ch);
+TUNABLE_INT("hw.firewire.fwe.tx_speed", &tx_speed);
+TUNABLE_INT("hw.firewire.fwe.rx_queue_len", &rx_queue_len);
 
 #ifdef DEVICE_POLLING
 #define FWE_POLL_REGISTER(func, fwe, ifp)			\
@@ -318,7 +324,7 @@
 		/* register fwe_input handler */
 		xferq->sc = (caddr_t) fwe;
 		xferq->hand = fwe_as_input;
-		xferq->bnchunk = RX_MAX_QUEUE;
+		xferq->bnchunk = rx_queue_len;
 		xferq->bnpacket = 1;
 		xferq->psize = MCLBYTES;
 		xferq->queued = 0;

==== //depot/projects/netperf/sys/dev/lge/if_lge.c#5 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/lge/if_lge.c,v 1.24 2003/10/31 18:32:02 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/lge/if_lge.c,v 1.25 2003/11/13 20:55:49 obrien Exp $");
 
 /*
  * Level 1 LXT1001 gigabit ethernet driver for FreeBSD. Public
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/lge/if_lge.c,v 1.24 2003/10/31 18:32:02 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/lge/if_lge.c,v 1.25 2003/11/13 20:55:49 obrien Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -152,7 +152,7 @@
 static void lge_miibus_statchg(device_t);
 
 static void lge_setmulti(struct lge_softc *);
-static u_int32_t lge_crc(struct lge_softc *, caddr_t);
+static u_int32_t lge_mchash(caddr_t);
 static void lge_reset(struct lge_softc *);
 static int lge_list_rx_init(struct lge_softc *);
 static int lge_list_tx_init(struct lge_softc *);
@@ -371,23 +371,20 @@
 }
 
 static u_int32_t
-lge_crc(sc, addr)
-	struct lge_softc	*sc;
-	caddr_t			addr;
+lge_mchash(addr)
+	caddr_t		addr;
 {
-	u_int32_t		crc, carry;
-	int			i, j;
-	u_int8_t		c;
+	u_int32_t	crc, carry;
+	int		idx, bit;
+	u_int8_t	data;
 
 	/* Compute CRC for the address value. */
 	crc = 0xFFFFFFFF; /* initial value */
 
-	for (i = 0; i < 6; i++) {
-		c = *(addr + i);
-		for (j = 0; j < 8; j++) {
-			carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
+	for (idx = 0; idx < 6; idx++) {
+		for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1) {
+			carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01);
 			crc <<= 1;
-			c >>= 1;
 			if (carry)
 				crc = (crc ^ 0x04c11db6) | carry;
 		}
@@ -426,7 +423,7 @@
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		h = lge_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+		h = lge_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
 		if (h < 32)
 			hashes[0] |= (1 << h);
 		else

==== //depot/projects/netperf/sys/dev/lnc/if_lnc.c#4 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/lnc/if_lnc.c,v 1.98 2003/10/31 18:32:02 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/lnc/if_lnc.c,v 1.99 2003/11/13 20:55:49 obrien Exp $");
 
 /*
 #define DIAGNOSTIC
@@ -190,22 +190,22 @@
 		return (UNKNOWN);
 }
 
-static __inline u_long
-ether_crc(const u_char *ether_addr)
+static __inline u_int32_t
+lnc_mchash(caddr_t ether_addr)
 {
-#define POLYNOMIAL           0xEDB88320UL

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


More information about the p4-projects mailing list