Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 2003 16:53:25 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 37344 for review
Message-ID:  <200309012353.h81NrPLa008494@repoman.freebsd.org>

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

Change 37344 by marcel@marcel_nfs on 2003/09/01 16:52:40

	IFC @37342

Affected files ...

.. //depot/projects/uart/alpha/include/varargs.h#2 integrate
.. //depot/projects/uart/amd64/include/varargs.h#2 integrate
.. //depot/projects/uart/conf/files.i386#8 integrate
.. //depot/projects/uart/conf/options.i386#4 integrate
.. //depot/projects/uart/dev/aac/aac.c#6 integrate
.. //depot/projects/uart/dev/ata/ata-all.c#5 integrate
.. //depot/projects/uart/dev/ata/ata-lowlevel.c#5 integrate
.. //depot/projects/uart/dev/ath/if_ath.c#8 integrate
.. //depot/projects/uart/dev/ichsmb/ichsmb_pci.c#5 integrate
.. //depot/projects/uart/dev/pci/pci.c#7 integrate
.. //depot/projects/uart/dev/usb/usb_mem.h#4 integrate
.. //depot/projects/uart/dev/usb/usb_subr.c#5 integrate
.. //depot/projects/uart/geom/geom.h#3 integrate
.. //depot/projects/uart/geom/geom_bsd.c#2 integrate
.. //depot/projects/uart/geom/geom_dev.c#5 integrate
.. //depot/projects/uart/geom/geom_disk.c#2 integrate
.. //depot/projects/uart/geom/geom_mbr.c#3 integrate
.. //depot/projects/uart/geom/geom_pc98.c#2 integrate
.. //depot/projects/uart/i386/i386/geode.c#1 branch
.. //depot/projects/uart/i386/include/varargs.h#2 integrate
.. //depot/projects/uart/ia64/ia64/machdep.c#10 integrate
.. //depot/projects/uart/ia64/ia64/vm_machdep.c#6 integrate
.. //depot/projects/uart/kern/uipc_domain.c#2 integrate
.. //depot/projects/uart/kern/uipc_mbuf.c#3 integrate
.. //depot/projects/uart/kern/vfs_bio.c#5 integrate
.. //depot/projects/uart/net80211/ieee80211_output.c#4 integrate
.. //depot/projects/uart/netinet/ip_flow.c#2 integrate
.. //depot/projects/uart/netinet/ip_flow.h#2 integrate
.. //depot/projects/uart/netinet/ip_output.c#5 integrate
.. //depot/projects/uart/netinet/raw_ip.c#6 integrate
.. //depot/projects/uart/netipsec/ipsec.c#3 integrate
.. //depot/projects/uart/netipsec/ipsec.h#2 integrate
.. //depot/projects/uart/netipsec/ipsec_input.c#3 integrate
.. //depot/projects/uart/netipsec/ipsec_output.c#3 integrate
.. //depot/projects/uart/netipsec/key.c#3 integrate
.. //depot/projects/uart/netipsec/key.h#2 integrate
.. //depot/projects/uart/netipsec/keydb.h#2 integrate
.. //depot/projects/uart/netipsec/xform_ah.c#3 integrate
.. //depot/projects/uart/netipsec/xform_esp.c#3 integrate
.. //depot/projects/uart/netipsec/xform_ipcomp.c#3 integrate
.. //depot/projects/uart/pci/amdpm.c#3 integrate
.. //depot/projects/uart/powerpc/include/varargs.h#2 integrate
.. //depot/projects/uart/sparc64/include/varargs.h#2 integrate
.. //depot/projects/uart/sparc64/sparc64/vm_machdep.c#5 integrate
.. //depot/projects/uart/sys/buf.h#4 integrate
.. //depot/projects/uart/sys/mbuf.h#2 integrate
.. //depot/projects/uart/ufs/ffs/ffs_softdep.c#3 integrate
.. //depot/projects/uart/vm/vm_init.c#4 integrate
.. //depot/projects/uart/vm/vm_kern.c#5 integrate

Differences ...

==== //depot/projects/uart/alpha/include/varargs.h#2 (text+ko) ====

@@ -38,11 +38,11 @@
  *
  *	@(#)varargs.h	8.2 (Berkeley) 3/22/94
  *	$NetBSD: varargs.h,v 1.7 1997/04/06 08:47:46 cgd Exp $
- * $FreeBSD: src/sys/alpha/include/varargs.h,v 1.5 2002/10/06 22:02:06 mike Exp $
+ * $FreeBSD: src/sys/alpha/include/varargs.h,v 1.6 2003/09/01 03:01:45 kan Exp $
  */
 
-#ifndef _ALPHA_VARARGS_H_
-#define	_ALPHA_VARARGS_H_
+#ifndef _MACHINE_VARARGS_H_
+#define	_MACHINE_VARARGS_H_
 
 #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
 
@@ -80,4 +80,4 @@
 
 #endif /* __GNUC__ post GCC 2.95 */
 
-#endif /* !_ALPHA_VARARGS_H_ */
+#endif /* !_MACHINE_VARARGS_H_ */

==== //depot/projects/uart/amd64/include/varargs.h#2 (text+ko) ====

@@ -37,11 +37,11 @@
  * SUCH DAMAGE.
  *
  *	@(#)varargs.h	8.2 (Berkeley) 3/22/94
- * $FreeBSD: src/sys/amd64/include/varargs.h,v 1.11 2002/10/06 22:02:06 mike Exp $
+ * $FreeBSD: src/sys/amd64/include/varargs.h,v 1.12 2003/09/01 03:01:45 kan Exp $
  */
 
-#ifndef _VARARGS_H_
-#define	_VARARGS_H_
+#ifndef _MACHINE_VARARGS_H_
+#define	_MACHINE_VARARGS_H_
 
 #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
 
@@ -86,4 +86,4 @@
 
 #endif /* __GNUC__ post GCC 2.95 */
 
-#endif /* !_VARARGS_H_ */
+#endif /* !_MACHINE_VARARGS_H_ */

==== //depot/projects/uart/conf/files.i386#8 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.452 2003/08/23 18:00:31 mdodd Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.453 2003/08/31 16:20:34 phk Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -187,6 +187,7 @@
 i386/i386/elan-mmcr.c		optional	cpu_elan
 i386/i386/elf_machdep.c		standard
 i386/i386/exception.s		standard
+i386/i386/geode.c		optional	cpu_geode
 i386/i386/i386-gdbstub.c	optional	ddb
 i386/i386/i686_mem.c		standard
 i386/i386/identcpu.c		standard

==== //depot/projects/uart/conf/options.i386#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.196 2003/07/22 11:42:45 ticso Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.197 2003/08/31 16:20:34 phk Exp $
 # Options specific to the i386 platform kernels
 
 DISABLE_PSE		opt_pmap.h
@@ -48,6 +48,7 @@
 CPU_DISABLE_5X86_LSSER		opt_cpu.h
 CPU_ELAN			opt_cpu.h
 CPU_FASTER_5X86_FPU		opt_cpu.h
+CPU_GEODE			opt_cpu.h
 CPU_I486_ON_386			opt_cpu.h
 CPU_IORT			opt_cpu.h
 CPU_L2_LATENCY			opt_cpu.h

==== //depot/projects/uart/dev/aac/aac.c#6 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.75 2003/08/24 17:48:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.77 2003/09/01 20:44:18 scottl Exp $");
 
 /*
  * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -727,6 +727,8 @@
 			sc->flags |= AAC_QUEUE_FRZN;
 			error = 0;
 		}
+	} else {
+		aac_map_command_sg(cm, NULL, 0, 0);
 	}
 	return (error);
 }
@@ -1581,8 +1583,9 @@
 	 * virtue of a table.
 	 */
 	qoffset = offsetof(struct aac_common, ac_qbuf) + AAC_QUEUE_ALIGN;
-	qoffset &= (AAC_QUEUE_ALIGN - 1);
-	sc->aac_queues = (struct aac_queue_table *)((uintptr_t)sc->aac_common + qoffset);
+	qoffset &= ~(AAC_QUEUE_ALIGN - 1);
+	sc->aac_queues =
+	    (struct aac_queue_table *)((uintptr_t)sc->aac_common + qoffset);
 	ip->CommHeaderAddress = sc->aac_common_busaddr + qoffset;
 
 	sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX] =

==== //depot/projects/uart/dev/ata/ata-all.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.187 2003/08/27 15:27:56 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.188 2003/09/01 11:13:21 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -523,14 +523,19 @@
 	if (request) {
 	    request->device = atadev;
 	    request->u.ata.command = command;
-	    request->flags = ATA_R_READ;
+	    request->flags = (ATA_R_READ | ATA_R_QUIET);
 	    request->data = (caddr_t)atacap;
 	    request->timeout = 2;
-	    request->retries = 2;
+	    request->retries = 3;
 	    request->bytecount = sizeof(struct ata_params);
 	    request->transfersize = DEV_BSIZE;
-	    ata_queue_request(request);
-	    error = request->result;
+	    while (request->retries) {
+		ata_queue_request(request);
+		if (!(error = request->result))
+		    break;
+		request->flags &= ~ATA_R_QUIET;
+		request->retries--;
+	    }
 	    ata_free_request(request);
 	}
 	if (error) {

==== //depot/projects/uart/dev/ata/ata-lowlevel.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.7 2003/08/28 09:15:05 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.8 2003/09/01 11:13:21 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -480,7 +480,7 @@
 static void
 ata_reset(struct ata_channel *ch)
 {
-    u_int8_t lsb, msb, ostat0, ostat1;
+    u_int8_t err, lsb, msb, ostat0, ostat1;
     u_int8_t stat0 = 0, stat1 = 0;
     int mask = 0, timeout;
 
@@ -496,6 +496,7 @@
     ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
     DELAY(10);	
     ostat1 = ATA_IDX_INB(ch, ATA_STATUS);
+
     /* in some setups we dont want to test for a slave */
     if (!(ch->flags & ATA_NO_SLAVE)) {
 	if ((ostat1 & 0xf8) != 0xf8 && ostat1 != 0xa5) {
@@ -511,7 +512,7 @@
 	return;
 
     if (bootverbose)
-	ata_printf(ch, -1, "pre reset mask=%02x ostat0=%02x ostat2=%02x\n",
+	ata_printf(ch, -1, "reset tp1 mask=%02x ostat0=%02x ostat1=%02x\n",
 		   mask, ostat0, ostat1);
 
     /* reset channel */
@@ -527,36 +528,40 @@
 	if (stat0 & ATA_S_BUSY) {
 	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
 	    DELAY(10);
-    	    ATA_IDX_INB(ch, ATA_ERROR);
+    	    err = ATA_IDX_INB(ch, ATA_ERROR);
+	    lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
+	    msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
 	    stat0 = ATA_IDX_INB(ch, ATA_STATUS);
-	    if (!(stat0 & ATA_S_BUSY)) {
-		/* check for ATAPI signature while its still there */
-		lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
-		msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
-		if (bootverbose)
-		    ata_printf(ch, ATA_MASTER, "ATAPI %02x %02x\n", lsb, msb);
-		if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
+	    if (bootverbose)
+		ata_printf(ch, ATA_MASTER,
+			   "stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n",
+			   stat0, err, lsb, msb);
+	    if (!(stat0 & ATA_S_BUSY) && err == ATA_E_ILI) {
+		if (stat0 & ATA_S_READY) {
+		    ch->devices |= ATA_ATA_MASTER;
+		}
+		else if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 		    ch->devices |= ATA_ATAPI_MASTER;
-		    ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0x00);
-		    ATA_IDX_OUTB(ch, ATA_CYL_MSB, 0x00);
 		}
 	    }
 	}
 	if (stat1 & ATA_S_BUSY) {
 	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
 	    DELAY(10);
-    	    ATA_IDX_INB(ch, ATA_ERROR);
+    	    err = ATA_IDX_INB(ch, ATA_ERROR);
+	    lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
+	    msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
 	    stat1 = ATA_IDX_INB(ch, ATA_STATUS);
-	    if (!(stat1 & ATA_S_BUSY)) {
-		/* check for ATAPI signature while its still there */
-		lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
-		msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
-		if (bootverbose)
-		    ata_printf(ch, ATA_SLAVE, "ATAPI %02x %02x\n", lsb, msb);
-		if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
+	    if (bootverbose)
+		ata_printf(ch, ATA_SLAVE,
+			   "stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n",
+			   stat0, err, lsb, msb);
+	    if (!(stat1 & ATA_S_BUSY) && err == ATA_E_ILI) {
+		if (stat1 & ATA_S_READY) {
+		    ch->devices |= ATA_ATA_SLAVE;
+		}
+		else if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 		    ch->devices |= ATA_ATAPI_SLAVE;
-		    ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0x00);
-		    ATA_IDX_OUTB(ch, ATA_CYL_MSB, 0x00);
 		}
 	    }
 	}
@@ -567,51 +572,55 @@
 	    if (!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 20))
 		break;
 	if (mask == 0x03)      /* wait for both master & slave */
-	    if ((!(stat0 & ATA_S_BUSY) && !(stat1 & ATA_S_BUSY)) ||
-		(stat0 == 0xff && stat1 == 0xff && timeout > 20))
-
+	    if ((!(stat0 & ATA_S_BUSY) || (stat0 == 0xff && timeout > 20)) &&
+	        (!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 20)))
 		break;
 	DELAY(100000);
     }	
-    DELAY(10);
-    ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_4BIT);
 
     if (stat0 & ATA_S_BUSY)
 	mask &= ~0x01;
     if (stat1 & ATA_S_BUSY)
 	mask &= ~0x02;
+
     if (bootverbose)
-	ata_printf(ch, -1, "after reset mask=%02x stat0=%02x stat1=%02x\n", 
-		   mask, stat0, stat1);
+	ata_printf(ch, -1,
+		   "reset tp2 mask=%02x stat0=%02x stat1=%02x devices=0x%b\n",
+		   mask, stat0, stat1, ch->devices,
+		   "\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER");
     if (!mask)
 	return;
 
-    if (mask & 0x01 && ostat0 != 0x00 && !(ch->devices & ATA_ATAPI_MASTER)) {
+    if (mask & 0x01 && ostat0 != 0x00 &&
+        !(ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))) {
 	ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
 	DELAY(10);
 	ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
 	ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
-	lsb = ATA_IDX_INB(ch, ATA_ERROR);
-	msb = ATA_IDX_INB(ch, ATA_CYL_LSB);
+	err = ATA_IDX_INB(ch, ATA_ERROR);
+	lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
 	if (bootverbose)
-	    ata_printf(ch, ATA_MASTER, "ATA %02x %02x\n", lsb, msb);
-	if (lsb != 0x58 && msb == 0xa5)
+	    ata_printf(ch, ATA_MASTER, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
+	if (err != 0x58 && lsb == 0xa5)
 	    ch->devices |= ATA_ATA_MASTER;
     }
-    if (mask & 0x02 && ostat1 != 0x00 && !(ch->devices & ATA_ATAPI_SLAVE)) {
+    if (mask & 0x02 && ostat1 != 0x00 &&
+	!(ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))) {
 	ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
 	DELAY(10);
 	ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
 	ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
-	lsb = ATA_IDX_INB(ch, ATA_ERROR);
-	msb = ATA_IDX_INB(ch, ATA_CYL_LSB);
+	err = ATA_IDX_INB(ch, ATA_ERROR);
+	lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
 	if (bootverbose)
-	    ata_printf(ch, ATA_SLAVE, "ATA %02x %02x\n", lsb, msb);
-	if (lsb != 0x58 && msb == 0xa5)
+	    ata_printf(ch, ATA_SLAVE, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
+	if (err != 0x58 && lsb == 0xa5)
 	    ch->devices |= ATA_ATA_SLAVE;
     }
+
     if (bootverbose)
-	ata_printf(ch, -1, "devices=%02x\n", ch->devices);
+	ata_printf(ch, -1, "reset tp3 devices=0x%b\n", ch->devices,
+		   "\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER");
 }
 
 static int
@@ -682,6 +691,9 @@
 	return -1;
     }
 
+    /* enable interrupt */
+    ATA_IDX_OUTB(atadev->channel, ATA_ALTSTAT, ATA_A_4BIT);
+
     /* only use 48bit addressing if needed (avoid bugs and overhead) */
     if ((lba > 268435455 || count > 256) && atadev->param && 
 	atadev->param->support.command2 & ATA_SUPPORT_ADDRESS48) {

==== //depot/projects/uart/dev/ath/if_ath.c#8 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.12 2003/08/19 22:17:03 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.13 2003/09/01 03:12:19 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -899,6 +899,8 @@
 	/* receive filter */
 	rfilt = (ath_hal_getrxfilter(ah) & HAL_RX_FILTER_PHYERR)
 	      | HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | HAL_RX_FILTER_MCAST;
+	if (ic->ic_opmode != IEEE80211_M_STA)
+		rfilt |= HAL_RX_FILTER_PROBEREQ;
 	if (ic->ic_opmode != IEEE80211_M_HOSTAP &&
 	    (ifp->if_flags & IFF_PROMISC))
 		rfilt |= HAL_RX_FILTER_PROM;
@@ -2231,6 +2233,8 @@
 		goto bad;
 	rfilt = (ath_hal_getrxfilter(ah) & HAL_RX_FILTER_PHYERR)
 	      | HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | HAL_RX_FILTER_MCAST;
+	if (ic->ic_opmode != IEEE80211_M_STA)
+		rfilt |= HAL_RX_FILTER_PROBEREQ;
 	if (ic->ic_opmode != IEEE80211_M_HOSTAP &&
 	    (ifp->if_flags & IFF_PROMISC))
 		rfilt |= HAL_RX_FILTER_PROM;

==== //depot/projects/uart/dev/ichsmb/ichsmb_pci.c#5 (text+ko) ====

@@ -37,11 +37,11 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb_pci.c,v 1.9 2003/08/31 01:28:02 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb_pci.c,v 1.10 2003/08/31 19:23:00 njl Exp $");
 
 /*
  * Support for the SMBus controller logical device which is part of the
- * Intel 81801AA/AB/BA/CA/DC (ICH/ICH[0234]) I/O controller hub chips.
+ * Intel 81801AA/AB/BA/CA/DC/EB (ICH/ICH[02345]) I/O controller hub chips.
  */
 
 #include <sys/param.h>

==== //depot/projects/uart/dev/pci/pci.c#7 (text+ko) ====

@@ -25,7 +25,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/pci/pci.c,v 1.227 2003/08/28 21:22:25 jhb Exp $
+ * $FreeBSD: src/sys/dev/pci/pci.c,v 1.228 2003/09/01 15:01:49 dfr Exp $
  *
  */
 
@@ -1344,12 +1344,15 @@
 			break;
 		case SYS_RES_IOPORT:
 		case SYS_RES_MEMORY:
-			/*
-			 * Enable the I/O mode.  We should also be allocating
-			 * resources too. XXX
-			 */
-			if (PCI_ENABLE_IO(dev, child, type))
-				return (NULL);
+			if (*rid < PCIR_MAPS + 4*cfg->nummaps) {
+				/*
+				 * Enable the I/O mode.  We should
+				 * also be allocating resources
+				 * too. XXX
+				 */
+				if (PCI_ENABLE_IO(dev, child, type))
+					return (NULL);
+			}
 			break;
 		}
 	}

==== //depot/projects/uart/dev/usb/usb_mem.h#4 (text+ko) ====

@@ -1,5 +1,5 @@
 /*	$NetBSD: usb_mem.h,v 1.18 2002/05/28 17:45:17 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.19 2003/07/15 22:42:37 jmg Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.20 2003/09/01 01:07:24 jmg Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
 } usb_dma_block_t;
 
 #ifdef __FreeBSD__
-#define DMAADDR(dma, o) ((uint32_t)(uintptr_t)(((char *)(dma)->block->segs[0].ds_addr) + (dma)->offs + (o)))
+#define DMAADDR(dma, o) ((dma)->block->segs[0].ds_addr + (dma)->offs + (o))
 #else
 #define DMAADDR(dma, o) (((char *)(dma)->block->map->dm_segs[0].ds_addr) + (dma)->offs + (o))
 #endif

==== //depot/projects/uart/dev/usb/usb_subr.c#5 (text+ko) ====

@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.57 2003/08/24 17:55:55 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.58 2003/09/01 07:47:42 ticso Exp $");
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -971,6 +971,7 @@
 	usbd_device_handle dev;
 	struct usbd_device *hub;
 	usb_device_descriptor_t *dd;
+	usb_port_status_t ps;
 	usbd_status err;
 	int addr;
 	int i;
@@ -1027,12 +1028,14 @@
 	up->device = dev;
 	dd = &dev->ddesc;
 	/* Try a few times in case the device is slow (i.e. outside specs.) */
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < 15; i++) {
 		/* Get the first 8 bytes of the device descriptor. */
 		err = usbd_get_desc(dev, UDESC_DEVICE, 0, USB_MAX_IPACKET, dd);
 		if (!err)
 			break;
 		usbd_delay_ms(dev, 200);
+		if ((i & 3) == 3)
+			usbd_reset_port(up->parent, port, &ps);
 	}
 	if (err) {
 		DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc "

==== //depot/projects/uart/geom/geom.h#3 (text+ko) ====

@@ -32,7 +32,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/geom/geom.h,v 1.72 2003/08/30 18:33:55 phk Exp $
+ * $FreeBSD: src/sys/geom/geom.h,v 1.73 2003/09/01 20:45:32 phk Exp $
  */
 
 #ifndef _GEOM_GEOM_H_
@@ -64,8 +64,8 @@
 typedef int g_ctl_config_geom_t (struct gctl_req *, struct g_geom *gp, const char *verb);
 typedef void g_init_t (struct g_class *mp);
 typedef void g_fini_t (struct g_class *mp);
-typedef struct g_geom * g_taste_t (struct g_class *, struct g_provider *,
-    int flags);
+typedef struct g_geom * g_taste_t (struct g_class *, struct g_provider *, int flags);
+typedef int g_ioctl_t(struct g_provider *pp, u_long cmd, void *data, struct thread *td);
 #define G_TF_NORMAL		0
 #define G_TF_INSIST		1
 #define G_TF_TRANSPARENT	2
@@ -116,6 +116,7 @@
 	g_dumpconf_t		*dumpconf;
 	g_access_t		*access;
 	g_orphan_t		*orphan;
+	g_ioctl_t		*ioctl;
 	void			*softc;
 	unsigned		flags;
 #define	G_GEOM_WITHER		1
@@ -231,20 +232,6 @@
 
 /* geom_kern.c / geom_kernsim.c */
 
-#ifndef _SYS_CONF_H_
-typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data,
-		      int fflag, struct thread *td);
-#endif
-
-struct g_ioctl {
-	u_long		cmd;
-	void		*data;
-	int		fflag;
-	struct thread	*td;
-	d_ioctl_t	*func;
-	void		*dev;
-};
-
 #ifdef _KERNEL
 
 struct g_kerneldump {

==== //depot/projects/uart/geom/geom_bsd.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_bsd.c,v 1.65 2003/06/11 06:49:15 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_bsd.c,v 1.66 2003/09/01 20:45:32 phk Exp $");
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -267,99 +267,7 @@
 	return(error);
 }
 
-
 /*
- * Implement certain ioctls to modify disklabels with.  This function
- * is called by the event handler thread with topology locked as result
- * of the g_post_event() in g_bsd_start().  It is not necessary to keep
- * topology locked all the time but make sure to return with topology
- * locked as well.
- */
-
-static void
-g_bsd_ioctl(void *arg, int flag)
-{
-	struct bio *bp;
-	struct g_geom *gp;
-	struct g_ioctl *gio;
-	u_char *label;
-	int error;
-
-	g_topology_assert();
-	bp = arg;
-	if (flag == EV_CANCEL) {
-		g_io_deliver(bp, ENXIO);
-		return;
-	}
-
-	gp = bp->bio_to->geom;
-	gio = (struct g_ioctl *)bp->bio_data;
-
-	label = g_malloc(LABELSIZE, M_WAITOK);
-
-	/* The disklabel to set is the ioctl argument. */
-	bsd_disklabel_le_enc(label, gio->data);
-
-	/* Validate and modify our slice instance to match. */
-	error = g_bsd_modify(gp, label);	/* Picks up topology lock on success. */
-	g_free(label);
-	if (error || gio->cmd == DIOCSDINFO) {
-		g_io_deliver(bp, error);
-		return;
-	}
-	
-	KASSERT(gio->cmd == DIOCWDINFO, ("Unknown ioctl in g_bsd_ioctl"));
-	g_io_deliver(bp, g_bsd_writelabel(gp, NULL));
-}
-
-/*
- * Rewrite the bootblock, which is BBSIZE bytes from the start of the disk.
- * We punch down the disklabel where we expect it to be before writing.
- */
-static int
-g_bsd_diocbsdbb(dev_t dev, u_long cmd __unused, caddr_t data, int fflag __unused, struct thread *td __unused)
-{
-	struct g_geom *gp;
-	struct g_slicer *gsp;
-	struct g_bsd_softc *ms;
-	struct g_consumer *cp;
-	u_char *buf;
-	void *p;
-	int error, i;
-	uint64_t sum;
-
-	/* Get hold of the interesting bits from the bio. */
-	gp = (void *)dev;
-	gsp = gp->softc;
-	ms = gsp->softc;
-
-	/* The disklabel to set is the ioctl argument. */
-	buf = g_malloc(BBSIZE, M_WAITOK);
-	p = *(void **)data;
-	error = copyin(p, buf, BBSIZE);
-	if (!error) {
-		DROP_GIANT();
-		g_topology_lock();
-		/* Validate and modify our slice instance to match. */
-		error = g_bsd_modify(gp, buf + ms->labeloffset);
-		if (!error) {
-			cp = LIST_FIRST(&gp->consumer);
-			if (ms->labeloffset == ALPHA_LABEL_OFFSET) {
-				sum = 0;
-				for (i = 0; i < 63; i++)
-					sum += le64dec(buf + i * 8);
-				le64enc(buf + 504, sum);
-			}
-			error = g_write_data(cp, 0, buf, BBSIZE);
-		}
-		g_topology_unlock();
-		PICKUP_GIANT();
-	}
-	g_free(buf);
-	return (error);
-}
-
-/*
  * If the user tries to overwrite our disklabel through an open partition
  * or via a magicwrite config call, we end up here and try to prevent
  * footshooting as best we can.
@@ -406,68 +314,96 @@
  *    * Don't grab the topology lock.
  *    * Don't call biowait, g_getattr(), g_setattr() or g_read_data()
  */
+static int
+g_bsd_ioctl(struct g_provider *pp, u_long cmd, void * data, struct thread *td)
+{
+	struct g_geom *gp;
+	struct g_bsd_softc *ms;
+	struct g_slicer *gsp;
+	u_char *label;
+	int error;
 
+	gp = pp->geom;
+	gsp = gp->softc;
+	ms = gsp->softc;
+
+	switch(cmd) {
+	case DIOCGDINFO:
+		/* Return a copy of the disklabel to userland. */
+		bsd_disklabel_le_dec(ms->label, data, MAXPARTITIONS);
+		return(0);
+	case DIOCBSDBB: {
+		struct g_consumer *cp;
+		u_char *buf;
+		void *p;
+		int error, i;
+		uint64_t sum;
+
+		/* The disklabel to set is the ioctl argument. */
+		buf = g_malloc(BBSIZE, M_WAITOK);
+		p = *(void **)data;
+		error = copyin(p, buf, BBSIZE);
+		if (!error) {
+			/* XXX: Rude, but supposedly safe */
+			DROP_GIANT();
+			g_topology_lock();
+			/* Validate and modify our slice instance to match. */
+			error = g_bsd_modify(gp, buf + ms->labeloffset);
+			if (!error) {
+				cp = LIST_FIRST(&gp->consumer);
+				if (ms->labeloffset == ALPHA_LABEL_OFFSET) {
+					sum = 0;
+					for (i = 0; i < 63; i++)
+						sum += le64dec(buf + i * 8);
+					le64enc(buf + 504, sum);
+				}
+				error = g_write_data(cp, 0, buf, BBSIZE);
+			}
+			g_topology_unlock();
+			PICKUP_GIANT();
+		}
+		g_free(buf);
+		return (error);
+	}
+	case DIOCSDINFO:
+	case DIOCWDINFO: {
+		label = g_malloc(LABELSIZE, M_WAITOK);
+
+		/* The disklabel to set is the ioctl argument. */
+		bsd_disklabel_le_enc(label, data);
+
+		DROP_GIANT();
+		g_topology_lock();
+		/* Validate and modify our slice instance to match. */
+		error = g_bsd_modify(gp, label);
+		if (error == 0 && cmd == DIOCWDINFO)
+			error = g_bsd_writelabel(gp, NULL);
+		g_topology_unlock();
+		PICKUP_GIANT();
+		g_free(label);
+		return(error);
+	}
+	default:
+		return (ENOIOCTL);
+	}
+}
+
 static int
 g_bsd_start(struct bio *bp)
 {
 	struct g_geom *gp;
 	struct g_bsd_softc *ms;
 	struct g_slicer *gsp;
-	struct g_ioctl *gio;
-	int error;
 
 	gp = bp->bio_to->geom;
 	gsp = gp->softc;
 	ms = gsp->softc;
-	switch(bp->bio_cmd) {
-	case BIO_GETATTR:
+	if (bp->bio_cmd == BIO_GETATTR) {
 		if (g_handleattr(bp, "BSD::labelsum", ms->labelsum,
 		    sizeof(ms->labelsum)))
 			return (1);
-		break;
-	default:
-		KASSERT(0 == 1, ("Unknown bio_cmd in g_bsd_start (%d)",
-		    bp->bio_cmd));
 	}
-
-	/* We only handle ioctl(2) requests of the right format. */
-	if (strcmp(bp->bio_attribute, "GEOM::ioctl"))
-		return (0);
-	else if (bp->bio_length != sizeof(*gio))
-		return (0);
-
-	/* Get hold of the ioctl parameters. */
-	gio = (struct g_ioctl *)bp->bio_data;
-
-	switch (gio->cmd) {
-	case DIOCGDINFO:
-		/* Return a copy of the disklabel to userland. */
-		bsd_disklabel_le_dec(ms->label, gio->data, MAXPARTITIONS);
-		g_io_deliver(bp, 0);
-		return (1);
-	case DIOCBSDBB:
-		gio->func = g_bsd_diocbsdbb;
-		gio->dev = (void *)gp;
-		g_io_deliver(bp, EDIRIOCTL);
-		return (1);
-	case DIOCSDINFO:
-	case DIOCWDINFO:
-		/*
-		 * These we cannot do without the topology lock and some
-		 * some I/O requests.  Ask the event-handler to schedule
-		 * us in a less restricted environment.
-		 */
-		error = g_post_event(g_bsd_ioctl, bp, M_NOWAIT, gp, NULL);
-		if (error)
-			g_io_deliver(bp, error);
-		/*
-		 * We must return non-zero to indicate that we will deal
-		 * with this bio, even though we have not done so yet.
-		 */
-		return (1);
-	default:
-		return (0);
-	}
+	return (0);
 }
 
 /*
@@ -559,6 +495,7 @@
 	 * routine which the "slice" code should call at the right time
 	 */
 	gp->dumpconf = g_bsd_dumpconf;
+	gp->ioctl = g_bsd_ioctl;
 
 	/* Get the geom_slicer softc from the geom. */
 	gsp = gp->softc;

==== //depot/projects/uart/geom/geom_dev.c#5 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.66 2003/08/30 18:33:55 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.67 2003/09/01 20:45:32 phk Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -279,17 +279,14 @@
 	struct g_kerneldump kd;
 	int i, error;
 	u_int u;
-	struct g_ioctl *gio;
 
 	gp = dev->si_drv1;
 	cp = dev->si_drv2;
-	gio = NULL;
 
 	error = 0;
 	KASSERT(cp->acr || cp->acw,
 	    ("Consumer with zero access count in g_dev_ioctl"));
 
-	gio = NULL;
 	i = IOCPARM_LEN(cmd);
 	switch (cmd) {
 	case DIOCGSECTORSIZE:
@@ -331,46 +328,14 @@
 		break;
 
 	default:
-		gio = g_malloc(sizeof *gio, M_WAITOK | M_ZERO);
-		gio->cmd = cmd;
-		gio->data = data;
-		gio->fflag = fflag;
-		gio->td = td;
-		i = sizeof *gio;
-		/*
-		 * We always issue ioctls as getattr since the direction of data
-		 * movement in ioctl is no indication of the ioctl being a "set"
-		 * or "get" type ioctl or if such simplistic terms even apply
-		 */
-		error = g_io_getattr("GEOM::ioctl", cp, &i, gio);
-		break;
+		if (cp->provider->geom->ioctl != NULL) {
+			error = cp->provider->geom->ioctl(cp->provider, cmd, data, td);
+			if (error != ENOIOCTL)
+				return (error);
+		}
 	}
 
-	if (error == EDIRIOCTL) {
-		KASSERT(gio != NULL, ("NULL gio but EDIRIOCTL"));
-		KASSERT(gio->func != NULL, ("NULL function but EDIRIOCTL"));
-		error = (gio->func)(gio->dev, cmd, data, fflag, td);
-	}
 	g_waitidle();
-	if (gio != NULL && (error == EOPNOTSUPP || error == ENOIOCTL)) {
-		if (g_debugflags & G_T_TOPOLOGY) {
-			i = IOCGROUP(cmd);
-			printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name);
-			if (i > ' ' && i <= '~')
-				printf(" '%c'", (int)IOCGROUP(cmd));
-			else
-				printf(" 0x%lx", IOCGROUP(cmd));
-			printf("/%ld ", cmd & 0xff);
-			if (cmd & IOC_IN)
-				printf("I");
-			if (cmd & IOC_OUT)
-				printf("O");
-			printf("(%ld) = ENOIOCTL\n", IOCPARM_LEN(cmd));
-		}
-		error = ENOTTY;
-	}
-	if (gio != NULL)
-		g_free(gio);
 	return (error);
 }
 

==== //depot/projects/uart/geom/geom_disk.c#2 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_disk.c,v 1.75 2003/06/11 06:49:15 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_disk.c,v 1.77 2003/09/01 20:45:32 phk Exp $");
 
 #include "opt_geom.h"
 
@@ -194,12 +194,29 @@
 	mtx_unlock(&g_disk_done_mtx);
 }
 
+static int
+g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, struct thread *td)
+{
+	struct g_geom *gp;
+	struct disk *dp;
+	int error;
+
+	gp = pp->geom;
+	dp = gp->softc;
+
+	if (dp->d_ioctl == NULL)
+		return (ENOIOCTL);
+	g_disk_lock_giant(dp);
+	error = dp->d_ioctl(dp, cmd, data, 0, td);
+	g_disk_unlock_giant(dp);
+	return(error);
+}
+
 static void
 g_disk_start(struct bio *bp)
 {
 	struct bio *bp2, *bp3;
 	struct disk *dp;
-	struct g_ioctl *gio;
 	int error;
 	off_t off;
 
@@ -264,15 +281,7 @@
 			break;
 		else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump"))
 			g_disk_kerneldump(bp, dp);
-		else if ((g_debugflags & G_F_DISKIOCTL) &&
-		    (dp->d_ioctl != NULL) &&
-		    !strcmp(bp->bio_attribute, "GEOM::ioctl") &&
-		    bp->bio_length == sizeof *gio) {
-			gio = (struct g_ioctl *)bp->bio_data;
-			gio->dev =  dp;
-			gio->func = (d_ioctl_t *)(dp->d_ioctl);
-			error = EDIRIOCTL;
-		} else 
+		else 
 			error = ENOIOCTL;
 		break;
 	default:
@@ -317,6 +326,7 @@
 	gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit);
 	gp->start = g_disk_start;
 	gp->access = g_disk_access;
+	gp->ioctl = g_disk_ioctl;
 	gp->softc = dp;
 	gp->dumpconf = g_disk_dumpconf;
 	pp = g_new_providerf(gp, "%s", gp->name);
@@ -332,7 +342,16 @@
 	g_error_provider(pp, 0);
 }
 

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



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