Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 12:00:22 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13166 for review
Message-ID:  <200206191900.g5JJ0MT67475@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13166

Change 13166 by julian@julian_ref on 2002/06/19 12:00:04

	MFC

Affected files ...

... //depot/projects/kse/bin/ksetest/kse_threads_test.c#8 edit
... //depot/projects/kse/sys/dev/ata/ata-dma.c#21 integrate
... //depot/projects/kse/sys/dev/ata/ata-pci.c#22 integrate
... //depot/projects/kse/sys/dev/ata/atapi-fd.c#10 integrate
... //depot/projects/kse/sys/dev/ata/atapi-fd.h#4 integrate
... //depot/projects/kse/sys/dev/wi/if_wi.c#23 integrate
... //depot/projects/kse/sys/dev/wi/if_wireg.h#10 integrate
... //depot/projects/kse/sys/dev/wi/if_wivar.h#4 integrate
... //depot/projects/kse/sys/kern/sys_generic.c#27 integrate
... //depot/projects/kse/sys/pc98/conf/GENERIC#16 integrate
... //depot/projects/kse/sys/pc98/pc98/fd.c#10 integrate
... //depot/projects/kse/sys/pc98/pc98/sio.c#16 integrate
... //depot/projects/kse/sys/sys/disklabel.h#11 integrate
... //depot/projects/kse/sys/ufs/ufs/ufs_readwrite.c#9 integrate

Differences ...

==== //depot/projects/kse/bin/ksetest/kse_threads_test.c#8 (text+ko) ====


==== //depot/projects/kse/sys/dev/ata/ata-dma.c#21 (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/ata/ata-dma.c,v 1.98 2002/04/26 22:48:20 mike Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.99 2002/06/19 12:26:20 sos Exp $
  */
 
 #include <sys/param.h>
@@ -1027,8 +1027,8 @@
 	}
 	break;
 
+    case 0x0d30105a:	/* Promise OEM ATA100 controllers */
     case 0x4d30105a:	/* Promise Ultra/FastTrak 100 controllers */
-    case 0x0d30105a:	/* Promise OEM ATA100 controllers */
 	if (!ATAPI_DEVICE(atadev) && udmamode >= 5 && 
 	    !(pci_read_config(parent, 0x50, 2) & (channel ? 1<<11 : 1<<10))) {
 	    error = ata_command(atadev, ATA_C_SETFEATURES, 0,
@@ -1044,6 +1044,7 @@
 	}
 	/* FALLTHROUGH */
 
+    case 0x0d38105a:	/* Promise FastTrak 66 controllers */
     case 0x4d38105a:	/* Promise Ultra/FastTrak 66 controllers */
 	if (!ATAPI_DEVICE(atadev) && udmamode >= 4 && 
 	    !(pci_read_config(parent, 0x50, 2) & (channel ? 1<<11 : 1<<10))) {
@@ -1398,9 +1399,10 @@
 	}
 	break;
 
+    case 0x0d38105a:  /* Promise Fasttrak 66 */
     case 0x4d38105a:  /* Promise Ultra/Fasttrak 66 */
+    case 0x0d30105a:  /* Promise OEM ATA 100 */
     case 0x4d30105a:  /* Promise Ultra/Fasttrak 100 */
-    case 0x0d30105a:  /* Promise OEM ATA 100 */
 	switch (mode) {
 	default:
 	case ATA_PIO0:	t->pa = 15; t->pb = 31; t->mb = 7; t->mc = 15; break;

==== //depot/projects/kse/sys/dev/ata/ata-pci.c#22 (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/ata/ata-pci.c,v 1.41 2002/04/16 08:30:51 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.42 2002/06/19 12:26:20 sos Exp $
  */
 
 #include "opt_ata.h"
@@ -243,6 +243,7 @@
     case 0x4d33105a:
 	return "Promise ATA33 controller";
 
+    case 0x0d38105a:
     case 0x4d38105a:
 	return "Promise ATA66 controller";
 
@@ -404,9 +405,10 @@
 			 (pci_read_config(dev, 0x53, 1) & ~0x01) | 0x02, 1);
 	break;
 
-    case 0x4d38105a: /* Promise 66 & 100 (before TX2) need the clock changed */
+    case 0x0d30105a: /* Promise 66 & 100 (before TX2) need the clock changed */
     case 0x4d30105a:
-    case 0x0d30105a:
+    case 0x0d38105a:
+    case 0x4d38105a:
 	ATA_OUTB(controller->bmio, 0x11, ATA_INB(controller->bmio, 0x11)|0x0a);
 	/* FALLTHROUGH */
 
@@ -565,9 +567,10 @@
 	break;
 
     case 0x4d33105a:	/* Promise Ultra/Fasttrak 33 */
+    case 0x0d38105a:	/* Promise Fasttrak 66 */
     case 0x4d38105a:	/* Promise Ultra/Fasttrak 66 */
+    case 0x0d30105a:	/* Promise OEM ATA100 */
     case 0x4d30105a:	/* Promise Ultra/Fasttrak 100 */
-    case 0x0d30105a:	/* Promise OEM ATA100 */
 	if (!(ATA_INL(ch->r_bmio, (ch->unit ? 0x14 : 0x1c)) &
 	      (ch->unit ? 0x00004000 : 0x00000400)))
 	    return 1;

==== //depot/projects/kse/sys/dev/ata/atapi-fd.c#10 (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/ata/atapi-fd.c,v 1.72 2002/05/25 11:18:02 bde Exp $
+ * $FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.73 2002/06/19 12:41:05 sos Exp $
  */
 
 #include <sys/param.h>
@@ -69,7 +69,6 @@
 /* prototypes */
 static int afd_sense(struct afd_softc *);
 static void afd_describe(struct afd_softc *);
-static int afd_partial_done(struct atapi_request *);
 static int afd_done(struct atapi_request *);
 static int afd_eject(struct afd_softc *, int);
 static int afd_start_stop(struct afd_softc *, int);
@@ -101,17 +100,20 @@
 	return 0;
     }
 
-    if (!strncmp(atadev->param->model, "IOMEGA ZIP", 10))
-	fdp->transfersize = 64;
-
     devstat_add_entry(&fdp->stats, "afd", fdp->lun, DEV_BSIZE,
 		      DEVSTAT_NO_ORDERED_TAGS,
 		      DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE,
 		      DEVSTAT_PRIORITY_WFD);
     dev = disk_create(fdp->lun, &fdp->disk, 0, &afd_cdevsw, &afddisk_cdevsw);
     dev->si_drv1 = fdp;
-    dev->si_iosize_max = 252 * DEV_BSIZE;
     fdp->dev = dev;
+
+    if (!strncmp(atadev->param->model, "IOMEGA ZIP", 10) ||
+	!strncmp(atadev->param->model, "IOMEGA Clik!", 12))
+	fdp->dev->si_iosize_max = 64 * DEV_BSIZE;
+    else
+	fdp->dev->si_iosize_max = 252 * DEV_BSIZE;
+
     afd_describe(fdp);
     atadev->flags |= ATA_D_MEDIA_CHANGED;
     atadev->driver = fdp;
@@ -147,7 +149,6 @@
 
     /* The IOMEGA Clik! doesn't support reading the cap page, fake it */
     if (!strncmp(fdp->device->param->model, "IOMEGA Clik!", 12)) {
-	fdp->transfersize = 64;
 	fdp->cap.transfer_rate = 500;
 	fdp->cap.heads = 1;
 	fdp->cap.sectors = 2;
@@ -189,8 +190,6 @@
 		   fdp->cap.cylinders, fdp->cap.heads, fdp->cap.sectors,
 		   fdp->cap.sector_size);
 	ata_prtdev(fdp->device, "%dKB/s,", fdp->cap.transfer_rate / 8);
-	if (fdp->transfersize)
-	    printf(" transfer limit %d blks,", fdp->transfersize);
 	printf(" %s\n", ata_mode2str(fdp->device->mode));
 	if (fdp->cap.medium_type) {
 	    ata_prtdev(fdp->device, "Medium: ");
@@ -294,6 +293,13 @@
 	return;
     }
 
+    /* if it's a null transfer, return immediatly. */
+    if (bp->bio_bcount == 0) {
+	bp->bio_resid = 0;
+	biodone(bp);
+	return;
+    }
+
     s = splbio();
     bioqdisksort(&fdp->queue, bp);
     splx(s);
@@ -324,7 +330,7 @@
     lba = bp->bio_pblkno;
     count = bp->bio_bcount / fdp->cap.sector_size;
     data_ptr = bp->bio_data;
-    bp->bio_resid = 0; 
+    bp->bio_resid = bp->bio_bcount; 
 
     bzero(ccb, sizeof(ccb));
 
@@ -333,26 +339,6 @@
     else
 	ccb[0] = ATAPI_WRITE_BIG;
 
-    devstat_start_transaction(&fdp->stats);
-
-    while (fdp->transfersize && (count > fdp->transfersize)) {
-	ccb[2] = lba>>24;
-	ccb[3] = lba>>16;
-	ccb[4] = lba>>8;
-	ccb[5] = lba;
-	ccb[7] = fdp->transfersize>>8;
-	ccb[8] = fdp->transfersize;
-
-	atapi_queue_cmd(fdp->device, ccb, data_ptr, 
-			fdp->transfersize * fdp->cap.sector_size,
-			(bp->bio_cmd == BIO_READ) ? ATPR_F_READ : 0, 30,
-			afd_partial_done, bp);
-
-	count -= fdp->transfersize;
-	lba += fdp->transfersize;
-	data_ptr += fdp->transfersize * fdp->cap.sector_size;
-    }
-
     ccb[2] = lba>>24;
     ccb[3] = lba>>16;
     ccb[4] = lba>>8;
@@ -360,25 +346,14 @@
     ccb[7] = count>>8;
     ccb[8] = count;
 
+    devstat_start_transaction(&fdp->stats);
+
     atapi_queue_cmd(fdp->device, ccb, data_ptr, count * fdp->cap.sector_size,
 		    (bp->bio_cmd == BIO_READ) ? ATPR_F_READ : 0, 30,
 		    afd_done, bp);
 }
 
 static int 
-afd_partial_done(struct atapi_request *request)
-{
-    struct bio *bp = request->driver;
-
-    if (request->error) {
-	bp->bio_error = request->error;
-	bp->bio_flags |= BIO_ERROR;
-    }
-    bp->bio_resid += request->bytecount;
-    return 0;
-}
-
-static int 
 afd_done(struct atapi_request *request)
 {
     struct bio *bp = request->driver;
@@ -389,7 +364,7 @@
 	bp->bio_flags |= BIO_ERROR;
     }
     else
-	bp->bio_resid += (bp->bio_bcount - request->donecount);
+	bp->bio_resid = bp->bio_bcount - request->donecount;
     biofinish(bp, &fdp->stats, 0);
     return 0;
 }

==== //depot/projects/kse/sys/dev/ata/atapi-fd.h#4 (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/ata/atapi-fd.h,v 1.16 2002/02/04 19:23:40 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/atapi-fd.h,v 1.17 2002/06/19 12:41:05 sos Exp $
  */
 
 /* ATAPI Rewriteable drive Capabilities and Mechanical Status Page */
@@ -71,7 +71,6 @@
 struct afd_softc {
     struct ata_device		*device;	/* device softc */
     int				lun;		/* logical device unit */
-    int				transfersize;	/* max size of each transfer */
     struct bio_queue_head	queue;		/* queue of i/o requests */
     struct afd_cappage		cap;		/* capabilities page info */
     struct disk			disk;		/* virtual drives */

==== //depot/projects/kse/sys/dev/wi/if_wi.c#23 (text+ko) ====

@@ -103,7 +103,7 @@
 
 #if !defined(lint)
 static const char rcsid[] =
-  "$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.105 2002/05/29 20:24:09 phk Exp $";
+  "$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.106 2002/06/19 17:37:34 imp Exp $";
 #endif
 
 static void wi_intr(void *);
@@ -313,6 +313,39 @@
 	sc->wi_channel = gen.wi_val;
 
 	/*
+	 * Set flags based on firmware version.
+	 */
+	switch (sc->sc_firmware_type) {
+	case WI_LUCENT:
+		sc->wi_flags |= WI_FLAGS_HAS_ROAMING;
+		if (sc->sc_sta_firmware_ver >= 60000)
+			sc->wi_flags |= WI_FLAGS_HAS_MOR;
+		if (sc->sc_sta_firmware_ver >= 60006) {
+			sc->wi_flags |= WI_FLAGS_HAS_IBSS;
+			sc->wi_flags |= WI_FLAGS_HAS_CREATE_IBSS;
+		}
+		sc->wi_ibss_port = htole16(1);
+		break;
+	case WI_INTERSIL:
+		sc->wi_flags |= WI_FLAGS_HAS_ROAMING;
+		if (sc->sc_sta_firmware_ver >= 800) {
+			sc->wi_flags |= WI_FLAGS_HAS_IBSS;
+			sc->wi_flags |= WI_FLAGS_HAS_CREATE_IBSS;
+		}
+		sc->wi_ibss_port = htole16(0);
+		break;
+	case WI_SYMBOL:
+		sc->wi_flags |= WI_FLAGS_HAS_DIVERSITY;
+		if (sc->sc_sta_firmware_ver >= 20000)
+			sc->wi_flags |= WI_FLAGS_HAS_IBSS;
+		/* Older Symbol firmware does not support IBSS creation. */
+		if (sc->sc_sta_firmware_ver >= 25000)
+			sc->wi_flags |= WI_FLAGS_HAS_CREATE_IBSS;
+		sc->wi_ibss_port = htole16(4);
+		break;
+	}
+
+	/*
 	 * Find out if we support WEP on this card.
 	 */
 	gen.wi_type = WI_RID_WEP_AVAIL;
@@ -326,10 +359,13 @@
 	/* 
 	 * Find supported rates.
 	 */
-	gen.wi_type = WI_RID_TX_RATE;
+	gen.wi_type = WI_RID_DATA_RATES;
 	gen.wi_len = 2;
-	wi_read_record(sc, &gen);
-	sc->wi_supprates = gen.wi_val;
+	if (wi_read_record(sc, &gen))
+		sc->wi_supprates = WI_SUPPRATES_1M | WI_SUPPRATES_2M |
+		    WI_SUPPRATES_5M | WI_SUPPRATES_11M;
+	else
+		sc->wi_supprates = gen.wi_val;
 
 	bzero((char *)&sc->wi_stats, sizeof(sc->wi_stats));
 
@@ -337,36 +373,76 @@
 	wi_stop(sc);
 
 	ifmedia_init(&sc->ifmedia, 0, wi_media_change, wi_media_status);
-	/* XXX: Should read from card capabilities */
 #define ADD(m, c)       ifmedia_add(&sc->ifmedia, (m), (c), NULL)
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1,
-	    IFM_IEEE80211_ADHOC, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1, 0, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2,
-	    IFM_IEEE80211_ADHOC, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2, 0, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5,
-	    IFM_IEEE80211_ADHOC, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5, 0, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11,
-	    IFM_IEEE80211_ADHOC, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11, 0, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, 
-		IFM_IEEE80211_ADHOC, 0), 0);
-	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, 0, 0), 0);
-	if (sc->sc_firmware_type == WI_INTERSIL) {
+	if (sc->wi_supprates & WI_SUPPRATES_1M) {
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1, 0, 0), 0);
 		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1,
-		    IFM_IEEE80211_HOSTAP, 0), 0);
+		    IFM_IEEE80211_ADHOC, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1,
+			    IFM_IEEE80211_IBSS, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1,
+			    IFM_IEEE80211_IBSSMASTER, 0), 0);
+		if (sc->sc_firmware_type == WI_INTERSIL)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS1,
+			    IFM_IEEE80211_HOSTAP, 0), 0);
+	}
+	if (sc->wi_supprates & WI_SUPPRATES_2M) {
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2, 0, 0), 0);
 		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2,
-		    IFM_IEEE80211_HOSTAP, 0), 0);
+		    IFM_IEEE80211_ADHOC, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2,
+			    IFM_IEEE80211_IBSS, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2,
+			    IFM_IEEE80211_IBSSMASTER, 0), 0);
+		if (sc->sc_firmware_type == WI_INTERSIL)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS2,
+			    IFM_IEEE80211_HOSTAP, 0), 0);
+	}
+	if (sc->wi_supprates & WI_SUPPRATES_5M) {
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5, 0, 0), 0);
 		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5,
-		    IFM_IEEE80211_HOSTAP, 0), 0);
+		    IFM_IEEE80211_ADHOC, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5,
+			    IFM_IEEE80211_IBSS, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5,
+			    IFM_IEEE80211_IBSSMASTER, 0), 0);
+		if (sc->sc_firmware_type == WI_INTERSIL)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS5,
+			    IFM_IEEE80211_HOSTAP, 0), 0);
+	}
+	if (sc->wi_supprates & WI_SUPPRATES_11M) {
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11, 0, 0), 0);
 		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11,
+		    IFM_IEEE80211_ADHOC, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11,
+			    IFM_IEEE80211_IBSS, 0), 0);
+		if (sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11,
+			    IFM_IEEE80211_IBSSMASTER, 0), 0);
+		if (sc->sc_firmware_type == WI_INTERSIL)
+			ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_IEEE80211_DS11,
+			    IFM_IEEE80211_HOSTAP, 0), 0);
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_MANUAL, 0, 0), 0);
+	}
+	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, IFM_IEEE80211_ADHOC, 0), 0);
+	if (sc->wi_flags & WI_FLAGS_HAS_IBSS)
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, IFM_IEEE80211_IBSS,
+		    0), 0);
+	if (sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS)
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO,
+		    IFM_IEEE80211_IBSSMASTER, 0), 0);
+	if (sc->sc_firmware_type == WI_INTERSIL)
+		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO,
 		    IFM_IEEE80211_HOSTAP, 0), 0);
-		ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, 
-		    IFM_IEEE80211_HOSTAP, 0), 0);
-	}
-#undef	ADD
+	ADD(IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO, 0, 0), 0);
+#undef ADD
 	ifmedia_set(&sc->ifmedia, IFM_MAKEWORD(IFM_IEEE80211, IFM_AUTO,
 	    0, 0));
 
@@ -1065,7 +1141,15 @@
 	for (i = 0; i < ltv->wi_len - 1; i++)
 		ptr[i] = CSR_READ_2(sc, WI_DATA1);
 
-	if (sc->sc_firmware_type != WI_LUCENT) {
+	if (ltv->wi_type == WI_RID_PORTTYPE && sc->wi_ptype == WI_PORTTYPE_IBSS
+	    && ltv->wi_val == sc->wi_ibss_port) {
+		/*
+		 * Convert vendor IBSS port type to WI_PORTTYPE_IBSS.
+		 * Since Lucent uses port type 1 for BSS *and* IBSS we
+		 * have to rely on wi_ptype to distinguish this for us.
+		 */
+		ltv->wi_val = htole16(WI_PORTTYPE_IBSS);
+	} else if (sc->sc_firmware_type != WI_LUCENT) {
 		switch (oltv->wi_type) {
 		case WI_RID_TX_RATE:
 		case WI_RID_CUR_TX_RATE:
@@ -1116,7 +1200,14 @@
 	int			i;
 	struct wi_ltv_gen	p2ltv;
 
-	if (sc->sc_firmware_type != WI_LUCENT) {
+	if (ltv->wi_type == WI_RID_PORTTYPE &&
+	    le16toh(ltv->wi_val) == WI_PORTTYPE_IBSS) {
+		/* Convert WI_PORTTYPE_IBSS to vendor IBSS port type. */
+		p2ltv.wi_type = WI_RID_PORTTYPE;
+		p2ltv.wi_len = 2;
+		p2ltv.wi_val = sc->wi_ibss_port;
+		ltv = &p2ltv;
+	} else if (sc->sc_firmware_type != WI_LUCENT) {
 		switch (ltv->wi_type) {
 		case WI_RID_TX_RATE:
 			p2ltv.wi_type = WI_RID_TX_RATE;
@@ -1935,12 +2026,12 @@
 	/* Program max data length. */
 	WI_SETVAL(WI_RID_MAX_DATALEN, sc->wi_max_data_len);
 
+	/* Set the port type. */
+	WI_SETVAL(WI_RID_PORTTYPE, sc->wi_ptype);
+
 	/* Enable/disable IBSS creation. */
 	WI_SETVAL(WI_RID_CREATE_IBSS, sc->wi_create_ibss);
 
-	/* Set the port type. */
-	WI_SETVAL(WI_RID_PORTTYPE, sc->wi_ptype);
-
 	/* Program the RTS/CTS threshold. */
 	WI_SETVAL(WI_RID_RTS_THRESH, sc->wi_rts_thresh);
 
@@ -2725,13 +2816,37 @@
 	struct wi_softc		*sc = ifp->if_softc;
 	int			otype = sc->wi_ptype;
 	int			orate = sc->wi_tx_rate;
+	int			ocreate_ibss = sc->wi_create_ibss;
+
+	if ((sc->ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_HOSTAP) &&
+	    sc->sc_firmware_type != WI_INTERSIL)
+		return (EINVAL);
 
-	if ((sc->ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_ADHOC) != 0)
+	sc->wi_create_ibss = 0;
+
+	switch (sc->ifmedia.ifm_cur->ifm_media & IFM_OMASK) {
+	case 0:
+		sc->wi_ptype = WI_PORTTYPE_BSS;
+		break;
+	case IFM_IEEE80211_ADHOC:
 		sc->wi_ptype = WI_PORTTYPE_ADHOC;
-	else if ((sc->ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_HOSTAP) != 0)
+		break;
+	case IFM_IEEE80211_HOSTAP:
 		sc->wi_ptype = WI_PORTTYPE_AP;
-	else
-		sc->wi_ptype = WI_PORTTYPE_BSS;
+		break;
+	case IFM_IEEE80211_IBSSMASTER:
+	case IFM_IEEE80211_IBSSMASTER|IFM_IEEE80211_IBSS:
+		if (!(sc->wi_flags & WI_FLAGS_HAS_CREATE_IBSS))
+			return (EINVAL);
+		sc->wi_create_ibss = 1;
+		/* FALLTHROUGH */
+	case IFM_IEEE80211_IBSS:
+		sc->wi_ptype = WI_PORTTYPE_IBSS;
+		break;
+	default:
+		/* Invalid combination. */
+		return (EINVAL);
+	}
 
 	switch (IFM_SUBTYPE(sc->ifmedia.ifm_cur->ifm_media)) {
 	case IFM_IEEE80211_DS1:
@@ -2751,7 +2866,7 @@
 		break;
 	}
 
-	if (otype != sc->wi_ptype ||
+	if (ocreate_ibss != sc->wi_create_ibss || otype != sc->wi_ptype ||
 	    orate != sc->wi_tx_rate)
 		wi_init(sc);
 
@@ -2772,6 +2887,12 @@
 			imr->ifm_active |= IFM_IEEE80211_ADHOC;
 		else if (sc->wi_ptype == WI_PORTTYPE_AP)
 			imr->ifm_active |= IFM_IEEE80211_HOSTAP;
+		else if (sc->wi_ptype == WI_PORTTYPE_IBSS) {
+			if (sc->wi_create_ibss)
+				imr->ifm_active |= IFM_IEEE80211_IBSSMASTER;
+			else
+				imr->ifm_active |= IFM_IEEE80211_IBSS;
+		}
 		wreq.wi_type = WI_RID_CUR_TX_RATE;
 		wreq.wi_len = WI_MAX_DATALEN;
 		if (wi_read_record(sc, (struct wi_ltv_gen *)&wreq) == 0) {
@@ -2795,7 +2916,8 @@
 	}
 
 	imr->ifm_status = IFM_AVALID;
-	if (sc->wi_ptype == WI_PORTTYPE_ADHOC)
+	if (sc->wi_ptype == WI_PORTTYPE_ADHOC ||
+	    sc->wi_ptype == WI_PORTTYPE_IBSS)
 		/*
 		 * XXX: It would be nice if we could give some actually
 		 * useful status like whether we joined another IBSS or

==== //depot/projects/kse/sys/dev/wi/if_wireg.h#10 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/wi/if_wireg.h,v 1.31 2002/04/11 07:21:16 imp Exp $
+ * $FreeBSD: src/sys/dev/wi/if_wireg.h,v 1.32 2002/06/19 17:37:34 imp Exp $
  */
 
 #define WI_DELAY	5
@@ -497,10 +497,10 @@
  *	(Only PRISM2; not 802.11 compliant mode, testing use only)
  * 6 == HOST AP (Only PRISM2)
  */
-#define WI_PORTTYPE_IBSS	0x0
 #define WI_PORTTYPE_BSS		0x1
 #define WI_PORTTYPE_WDS		0x2
 #define WI_PORTTYPE_ADHOC	0x3
+#define WI_PORTTYPE_IBSS	0x4
 #define WI_PORTTYPE_AP		0x6
 
 /*

==== //depot/projects/kse/sys/dev/wi/if_wivar.h#4 (text+ko) ====

@@ -31,7 +31,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/wi/if_wivar.h,v 1.8 2002/04/26 23:11:23 imp Exp $
+ * $FreeBSD: src/sys/dev/wi/if_wivar.h,v 1.9 2002/06/19 17:37:34 imp Exp $
  */
 
 #define WICACHE			/* turn on signal strength cache code */  
@@ -123,6 +123,15 @@
 	int			wi_tx_data_id;
 	int			wi_tx_mgmt_id;
 	int			wi_gone;
+	int			wi_flags;
+#define WI_FLAGS_ATTACHED		0x01
+#define WI_FLAGS_INITIALIZED		0x02
+#define WI_FLAGS_HAS_WEP		0x04
+#define WI_FLAGS_HAS_IBSS		0x08
+#define WI_FLAGS_HAS_CREATE_IBSS	0x10
+#define WI_FLAGS_HAS_MOR		0x20
+#define WI_FLAGS_HAS_ROAMING		0x30
+#define WI_FLAGS_HAS_DIVERSITY		0x40
 	int			wi_if_flags;
 	u_int16_t		wi_procframe;
 	u_int16_t		wi_ptype;
@@ -159,6 +168,7 @@
 	struct wihap_info	wi_hostap_info;
 	u_int32_t		wi_icv;
 	int			wi_icv_flag;
+	int			wi_ibss_port;
 	struct callout_handle	wi_stat_ch;
 #if __FreeBSD_version >= 500000
 	struct mtx		wi_mtx;

==== //depot/projects/kse/sys/kern/sys_generic.c#27 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)sys_generic.c	8.5 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/kern/sys_generic.c,v 1.101 2002/06/12 02:08:18 kbyanc Exp $
+ * $FreeBSD: src/sys/kern/sys_generic.c,v 1.102 2002/06/19 08:37:02 phk Exp $
  */
 
 #include "opt_ktrace.h"
@@ -646,28 +646,6 @@
 		*(caddr_t *)data = uap->data;
 	}
 
-#ifdef __alpha__
-	{
-	int annoy = 1;
-
-	if (com == DIOCGDINFO_ALPHAHACK)
-		com = DIOCGDINFO;
-	else if (com == DIOCSDINFO_ALPHAHACK)
-		com = DIOCSDINFO;
-	else if (com == DIOCWDINFO_ALPHAHACK)
-		com = DIOCWDINFO;
-	else if (com == DIOCGDVIRGIN_ALPHAHACK)
-		com = DIOCGDVIRGIN;
-	else
-		annoy = 0;
-	if (annoy) {
-		uprintf("Recompile this program, it uses obsolete ioctls.\n");
-		printf("Program using uses obsolete ioctls used, recompile.\n");
-		tsleep(&annoy, PPAUSE, "syncer", 15 * hz);
-	}
-	}
-#endif
-
 	switch (com) {
 
 	case FIONBIO:

==== //depot/projects/kse/sys/pc98/conf/GENERIC#16 (text+ko) ====

@@ -15,7 +15,7 @@
 # device lines is also present in the NOTES configuration file. If you are
 # in doubt as to the purpose or necessity of a line, check first in NOTES.
 #
-# $FreeBSD: src/sys/pc98/conf/GENERIC,v 1.203 2002/05/03 17:59:23 jmallett Exp $
+# $FreeBSD: src/sys/pc98/conf/GENERIC,v 1.204 2002/06/19 13:47:53 nyan Exp $
 
 machine		pc98
 #cpu		I386_CPU		#Do not enable with other cpu types
@@ -64,6 +64,7 @@
 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
+options 	ALT_BREAK_TO_DEBUGGER
 
 # To make an SMP kernel, the next two are needed
 #options 	SMP			# Symmetric MultiProcessor Kernel
@@ -160,6 +161,7 @@
 
 # PCI Ethernet NICs.
 device		de		# DEC/Intel DC21x4x (``Tulip'')
+device		em		# Intel PRO/1000 adapter Gigabit Ethernet Card
 device		txp		# 3Com 3cR990 (``Typhoon'')
 device		vx		# 3Com 3c590, 3c595 (``Vortex'')
 

==== //depot/projects/kse/sys/pc98/pc98/fd.c#10 (text+ko) ====

@@ -50,7 +50,7 @@
  * SUCH DAMAGE.
  *
  *	from:	@(#)fd.c	7.4 (Berkeley) 5/25/91
- * $FreeBSD: src/sys/pc98/pc98/fd.c,v 1.118 2002/05/14 12:30:52 nyan Exp $
+ * $FreeBSD: src/sys/pc98/pc98/fd.c,v 1.119 2002/06/19 13:17:43 nyan Exp $
  */
 
 #include "opt_fdc.h"
@@ -1899,26 +1899,29 @@
 /*
  * FDC IO functions, take care of the main status register, timeout
  * in case the desired status bits are never set.
+ *
+ * These PIO loops initially start out with short delays between
+ * each iteration in the expectation that the required condition
+ * is usually met quickly, so it can be handled immediately.  After
+ * about 1 ms, stepping is increased to achieve a better timing
+ * accuracy in the calls to DELAY().
  */
 static int
 fd_in(struct fdc_data *fdc, int *ptr)
 {
-	int i, j = FDSTS_TIMEOUT;
-	while ((i = fdsts_rd(fdc) & (NE7_DIO|NE7_RQM))
-		!= (NE7_DIO|NE7_RQM) && j-- > 0) {
+	int i, j, step;
+
+	for (j = 0, step = 1;
+	    (i = fdsts_rd(fdc) & (NE7_DIO|NE7_RQM)) != (NE7_DIO|NE7_RQM) &&
+	    j < FDSTS_TIMEOUT;
+	    j += step) {
 		if (i == NE7_RQM)
 			return (fdc_err(fdc, "ready for output in input\n"));
-		/*
-		 * After (maybe) 1 msec of waiting, back off to larger
-		 * stepping to get the timing more accurate.
-		 */
-		if (FDSTS_TIMEOUT - j > 1000) {
-			DELAY(1000);
-			j -= 999;
-		} else
-			DELAY(1);
+		if (j == 1000)
+			step = 1000;
+		DELAY(step);
 	}
-	if (j <= 0)
+	if (j >= FDSTS_TIMEOUT)
 		return (fdc_err(fdc, bootverbose? "input ready timeout\n": 0));
 #ifdef	FDC_DEBUG
 	i = fddata_rd(fdc);
@@ -1936,36 +1939,19 @@
 int
 out_fdc(struct fdc_data *fdc, int x)
 {
-	int i;
+	int i, j, step;
 
-	/* Check that the direction bit is set */
-	i = FDSTS_TIMEOUT;
-	while ((fdsts_rd(fdc) & NE7_DIO) && i-- > 0)
-		/*
-		 * After (maybe) 1 msec of waiting, back off to larger
-		 * stepping to get the timing more accurate.
-		 */
-		if (FDSTS_TIMEOUT - i > 1000) {
-			DELAY(1000);
-			i -= 999;
-		} else
-			DELAY(1);
-	if (i <= 0)
-		return (fdc_err(fdc, "direction bit not set\n"));
-
-	/* Check that the floppy controller is ready for a command */
-	i = FDSTS_TIMEOUT;
-	while ((fdsts_rd(fdc) & NE7_RQM) == 0 && i-- > 0)
-		/*
-		 * After (maybe) 1 msec of waiting, back off to larger
-		 * stepping to get the timing more accurate.
-		 */
-		if (FDSTS_TIMEOUT - i > 1000) {
-			DELAY(1000);
-			i -= 999;
-		} else
-			DELAY(1);
-	if (i <= 0)
+	for (j = 0, step = 1;
+	    (i = fdsts_rd(fdc) & (NE7_DIO|NE7_RQM)) != NE7_RQM &&
+	    j < FDSTS_TIMEOUT;
+	    j += step) {
+		if (i == (NE7_DIO|NE7_RQM))
+			return (fdc_err(fdc, "ready for input in output\n"));
+		if (j == 1000)
+			step = 1000;
+		DELAY(step);
+	}
+	if (j >= FDSTS_TIMEOUT)
 		return (fdc_err(fdc, bootverbose? "output ready timeout\n": 0));
 
 	/* Send the command and return */

==== //depot/projects/kse/sys/pc98/pc98/sio.c#16 (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/pc98/pc98/sio.c,v 1.173 2002/06/18 21:30:36 n_hibma Exp $
+ * $FreeBSD: src/sys/pc98/pc98/sio.c,v 1.174 2002/06/19 13:20:20 nyan Exp $
  *	from: @(#)com.c	7.5 (Berkeley) 5/16/91
  *	from: i386/isa sio.c,v 1.234
  */
@@ -435,9 +435,7 @@
 	    &gdbdefaultrate, GDBSPEED, "");
 static	u_int	com_events;	/* input chars + weighted output completions */
 static	Port_t	siocniobase;
-#ifndef __alpha__
-static	int	siocnunit;
-#endif
+static	int	siocnunit = -1;
 static	Port_t	siogdbiobase;
 static	int	siogdbunit = -1;
 static	void	*sio_slow_ih;
@@ -4416,6 +4414,7 @@
 	int	s;
 	struct siocnstate	sp;
 	Port_t	iobase;
+	speed_t	speed;
 
 	if (minor(dev) == siocnunit) {
 		iobase = siocniobase;
@@ -4445,12 +4444,20 @@
 {
 	int	c;
 	Port_t	iobase;
+	speed_t	speed;
 	int	s;
 	struct siocnstate	sp;
 
-	iobase = siogdbiobase;
+	if (minor(dev) == siocnunit) {
+		iobase = siocniobase;
+		speed = comdefaultrate;
+	} else {
+		iobase = siogdbiobase;
+		speed = gdbdefaultrate;
+	}
+
 	s = spltty();
-	siocnopen(&sp, iobase, gdbdefaultrate);
+	siocnopen(&sp, iobase, speed);
 	while (!(inb(iobase + com_lsr) & LSR_RXRDY))
 		;
 	c = inb(iobase + com_data);
@@ -4463,11 +4470,21 @@
 siogdbputc(c)
 	int	c;
 {
+	Port_t	iobase;
+	speed_t	speed;
 	int	s;
 	struct siocnstate	sp;
 
+	if (minor(dev) == siocnunit) {
+		iobase = siocniobase;
+		speed = comdefaultrate;
+	} else {
+		iobase = siogdbiobase;
+		speed = gdbdefaultrate;
+	}
+
 	s = spltty();
-	siocnopen(&sp, siogdbiobase, gdbdefaultrate);
+	siocnopen(&sp, iobase, speed);
 	siocntxwait(siogdbiobase);
 	outb(siogdbiobase + com_data, c);
 	siocnclose(&sp, siogdbiobase);

==== //depot/projects/kse/sys/sys/disklabel.h#11 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)disklabel.h	8.2 (Berkeley) 7/10/94
- * $FreeBSD: src/sys/sys/disklabel.h,v 1.85 2002/05/16 21:28:26 trhodes Exp $
+ * $FreeBSD: src/sys/sys/disklabel.h,v 1.86 2002/06/19 08:36:59 phk Exp $
  */
 
 #ifndef _SYS_DISKLABEL_H_
@@ -358,20 +358,6 @@
 
 #define DIOCWLABEL	_IOW('d', 109, int)	/* write en/disable label */
 
-#ifdef __alpha__
-struct disklabel_alphahack {
-	struct disklabel dl;
-	char pad[4];
-};
-#define DIOCGDINFO_ALPHAHACK	_IOR('d', 101, struct disklabel_alphahack)/* get */
-#define DIOCSDINFO_ALPHAHACK	_IOW('d', 102, struct disklabel_alphahack)/* set */
-#define DIOCWDINFO_ALPHAHACK	_IOW('d', 103, struct disklabel_alphahack)/* set, update disk */
-#define DIOCGDVIRGIN_ALPHAHACK	_IOR('d', 105, struct disklabel_alphahack)/* get virgin label */
-#ifdef CTASSERT
-CTASSERT(sizeof(struct disklabel_alphahack) == 280);
-#endif
-#endif
-
 #ifdef _KERNEL
 
 /*

==== //depot/projects/kse/sys/ufs/ufs/ufs_readwrite.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)ufs_readwrite.c	8.11 (Berkeley) 5/8/95
- * $FreeBSD: src/sys/ufs/ufs/ufs_readwrite.c,v 1.89 2002/05/17 18:59:53 phk Exp $
+ * $FreeBSD: src/sys/ufs/ufs/ufs_readwrite.c,v 1.90 2002/06/19 09:39:41 dillon Exp $
  */
 
 #define	BLKSIZE(a, b, c)	blksize(a, b, c)
@@ -491,23 +491,27 @@
 			vnode_pager_setsize(vp, uio->uio_offset + xfersize);
 
                 /*      
-                 * Avoid a data-consistency race between write() and mmap()
-                 * by ensuring that newly allocated blocks are zerod.  The
-                 * race can occur even in the case where the write covers
-                 * the entire block.
+		 * We must perform a read-before-write if the transfer size
+		 * does not cover the entire buffer.
                  */
-		flags |= B_CLRBUF;
-#if 0
 		if (fs->fs_bsize > xfersize)
 			flags |= B_CLRBUF;
 		else
 			flags &= ~B_CLRBUF;
-#endif
 /* XXX is uio->uio_offset the right thing here? */
 		error = UFS_BALLOC(vp, uio->uio_offset, xfersize,
 		    ap->a_cred, flags, &bp);
 		if (error != 0)
 			break;
+		/*
+		 * If the buffer is not valid we have to clear out any
+		 * garbage data from the pages instantiated for the buffer.
+		 * If we do not, a failed uiomove() during a write can leave
+		 * the prior contents of the pages exposed to a userland
+		 * mmap().  XXX deal with uiomove() errors a better way.
+		 */
+		if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize)
+			vfs_bio_clrbuf(bp);
 		if (ioflag & IO_DIRECT)
 			bp->b_flags |= B_DIRECT;
 		if (ioflag & IO_NOWDRAIN)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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