Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 2003 11:20:33 -0700 (PDT)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 39360 for review
Message-ID:  <200310081820.h98IKXYG082022@repoman.freebsd.org>

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

Change 39360 by sam@sam_ebb on 2003/10/08 11:19:52

	IFC

Affected files ...

.. //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#8 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_da.c#11 integrate
.. //depot/projects/netperf/sys/dev/an/if_an_pccard.c#3 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-all.c#6 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-card.c#4 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-dma.c#7 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#6 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-queue.c#4 integrate
.. //depot/projects/netperf/sys/dev/cardbus/cardbus_cis.c#5 integrate
.. //depot/projects/netperf/sys/dev/cardbus/cardbus_cis.h#2 integrate
.. //depot/projects/netperf/sys/dev/exca/exca.c#5 integrate
.. //depot/projects/netperf/sys/dev/kbd/atkbd.c#3 integrate
.. //depot/projects/netperf/sys/dev/pccard/card_if.m#3 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccard.c#6 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccard_cis.c#4 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccard_cis.h#1 branch
.. //depot/projects/netperf/sys/dev/pccard/pccard_cis_quirks.c#4 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccarddevs#7 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccarddevs.h#7 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccardreg.h#2 integrate
.. //depot/projects/netperf/sys/dev/sio/sio_pccard.c#4 integrate
.. //depot/projects/netperf/sys/dev/uart/uart_bus_pccard.c#4 integrate
.. //depot/projects/netperf/sys/geom/bde/g_bde.h#2 integrate
.. //depot/projects/netperf/sys/geom/bde/g_bde_lock.c#2 integrate
.. //depot/projects/netperf/sys/net/net_osdep.c#2 integrate
.. //depot/projects/netperf/sys/net/route.c#13 integrate
.. //depot/projects/netperf/sys/netinet/icmp6.h#3 integrate
.. //depot/projects/netperf/sys/netinet/in_gif.c#2 integrate
.. //depot/projects/netperf/sys/netinet/in_gif.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ah_core.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/ah_output.c#3 integrate
.. //depot/projects/netperf/sys/netinet6/dest6.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/esp_core.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/esp_input.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/esp_output.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/frag6.c#4 integrate
.. //depot/projects/netperf/sys/netinet6/icmp6.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/in6.c#6 integrate
.. //depot/projects/netperf/sys/netinet6/in6.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_output.c#11 integrate
.. //depot/projects/netperf/sys/netkey/key_var.h#2 integrate
.. //depot/projects/netperf/sys/vm/vm_fault.c#6 integrate
.. //depot/projects/netperf/sys/vm/vm_page.c#8 integrate
.. //depot/projects/netperf/sys/vm/vm_page.h#4 integrate

Differences ...

==== //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#8 (text+ko) ====

@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.85 2003/10/06 10:39:13 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.86 2003/10/07 14:46:59 thomas Exp $");
 
 #include "opt_cd.h"
 
@@ -92,17 +92,18 @@
 } cd_quirks;
 
 typedef enum {
-	CD_FLAG_INVALID		= 0x001,
-	CD_FLAG_NEW_DISC	= 0x002,
-	CD_FLAG_DISC_LOCKED	= 0x004,
-	CD_FLAG_DISC_REMOVABLE	= 0x008,
-	CD_FLAG_TAGGED_QUEUING	= 0x010,
-	CD_FLAG_CHANGER		= 0x040,
-	CD_FLAG_ACTIVE		= 0x080,
-	CD_FLAG_SCHED_ON_COMP	= 0x100,
-	CD_FLAG_RETRY_UA	= 0x200,
-	CD_FLAG_VALID_MEDIA	= 0x400,
-	CD_FLAG_VALID_TOC	= 0x800
+	CD_FLAG_INVALID		= 0x0001,
+	CD_FLAG_NEW_DISC	= 0x0002,
+	CD_FLAG_DISC_LOCKED	= 0x0004,
+	CD_FLAG_DISC_REMOVABLE	= 0x0008,
+	CD_FLAG_TAGGED_QUEUING	= 0x0010,
+	CD_FLAG_CHANGER		= 0x0040,
+	CD_FLAG_ACTIVE		= 0x0080,
+	CD_FLAG_SCHED_ON_COMP	= 0x0100,
+	CD_FLAG_RETRY_UA	= 0x0200,
+	CD_FLAG_VALID_MEDIA	= 0x0400,
+	CD_FLAG_VALID_TOC	= 0x0800,
+	CD_FLAG_SCTX_INIT	= 0x1000
 } cd_flags;
 
 typedef enum {
@@ -421,7 +422,8 @@
 	xpt_print_path(periph->path);
 	printf("removing device entry\n");
 
-	if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+	if ((softc->flags & CD_FLAG_SCTX_INIT) != 0
+	    && sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
 		xpt_print_path(periph->path);
 		printf("can't remove sysctl context\n");
 	}
@@ -581,6 +583,7 @@
 	mtx_lock(&Giant);
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
+	softc->flags |= CD_FLAG_SCTX_INIT;
 	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO,
 		tmpstr2, CTLFLAG_RD, 0, tmpstr);

==== //depot/projects/netperf/sys/cam/scsi/scsi_da.c#11 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.159 2003/09/04 01:01:20 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.160 2003/10/08 07:12:30 thomas Exp $");
 
 #ifdef _KERNEL
 #include "opt_da.h"
@@ -89,7 +89,8 @@
 	DA_FLAG_NEED_OTAG	= 0x020,
 	DA_FLAG_WENT_IDLE	= 0x040,
 	DA_FLAG_RETRY_UA	= 0x080,
-	DA_FLAG_OPEN		= 0x100
+	DA_FLAG_OPEN		= 0x100,
+	DA_FLAG_SCTX_INIT	= 0x200
 } da_flags;
 
 typedef enum {
@@ -838,7 +839,8 @@
 	/*
 	 * If we can't free the sysctl tree, oh well...
 	 */
-	if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+	if ((softc->flags & DA_FLAG_SCTX_INIT) != 0
+	    && sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
 		xpt_print_path(periph->path);
 		printf("can't remove sysctl context\n");
 	}
@@ -925,6 +927,7 @@
 
 	mtx_lock(&Giant);
 	sysctl_ctx_init(&softc->sysctl_ctx);
+	softc->flags |= DA_FLAG_SCTX_INIT;
 	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
 		CTLFLAG_RD, 0, tmpstr);

==== //depot/projects/netperf/sys/dev/an/if_an_pccard.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.21 2003/08/24 17:48:04 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.22 2003/10/08 01:20:00 imp Exp $");
 
 #include "opt_inet.h"
 
@@ -112,6 +112,7 @@
 	PCMCIA_CARD(AIRONET, PC4800, 0),
 	PCMCIA_CARD(AIRONET, PC4500, 0),
 	PCMCIA_CARD(AIRONET, 350, 0),
+	PCMCIA_CARD(XIRCOM, CWE1130, 0), 
 	{ NULL }
 };
 

==== //depot/projects/netperf/sys/dev/ata/ata-all.c#6 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.190 2003/09/27 12:00:58 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.191 2003/10/07 13:44:15 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -221,8 +221,9 @@
 int
 ata_reinit(struct ata_channel *ch)
 {
+    struct ata_request *request = ch->running;
     int devices, misdev, newdev;
-
+    
     if (!ch->r_irq)
 	return ENXIO;
 
@@ -237,11 +238,29 @@
     /* detach what left the channel during reset */
     if ((misdev = devices & ~ch->devices)) {
 	if ((misdev & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) &&
-	    ch->device[MASTER].detach)
+	    ch->device[MASTER].detach) {
+	    if (request && (request->device == &ch->device[MASTER])) {
+		request->result = ENXIO;
+		request->flags |= ATA_R_DONE;
+		if (request->callback)
+		    (request->callback)(request);
+		else
+        	    wakeup(request);
+	    }
 	    ch->device[MASTER].detach(&ch->device[MASTER]);
+	}
 	if ((misdev & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE)) &&
-	    ch->device[SLAVE].detach)
+	    ch->device[SLAVE].detach) {
+	    if (request && (request->device == &ch->device[SLAVE])) {
+		request->result = ENXIO;
+		request->flags |= ATA_R_DONE;
+		if (request->callback)
+		    (request->callback)(request);
+		else
+        	    wakeup(request);
+	    }
 	    ch->device[SLAVE].detach(&ch->device[SLAVE]);
+	}
     }
 
     /* identify whats present on this channel now */

==== //depot/projects/netperf/sys/dev/ata/ata-card.c#4 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-card.c,v 1.18 2003/08/25 09:01:49 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-card.c,v 1.19 2003/10/07 04:26:14 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,9 +42,10 @@
 #include <machine/bus.h>
 #include <sys/rman.h>
 #include <dev/ata/ata-all.h>
+#include <dev/pccard/pccard_cis.h>
+#include <dev/pccard/pccarddevs.h>
 #include <dev/pccard/pccardreg.h>
 #include <dev/pccard/pccardvar.h>
-#include <dev/pccard/pccarddevs.h>
 
 static const struct pccard_product ata_pccard_products[] = {
 	PCMCIA_CARD(FREECOM, PCCARDIDE, 0),

==== //depot/projects/netperf/sys/dev/ata/ata-dma.c#7 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.120 2003/08/25 11:13:04 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.121 2003/10/07 13:48:55 sos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -93,19 +93,20 @@
 {
     struct ata_dc_cb_args ccba;
 
-    if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
-			   BUS_SPACE_MAXADDR, NULL, NULL, MAXCTLDMASZ,
-			   ATA_DMA_ENTRIES, BUS_SPACE_MAXSIZE_32BIT, 0,
-			   NULL, NULL, &ch->dma->dmatag))
+    if (bus_dma_tag_create(NULL, 1, 0,
+			   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
+			   NULL, NULL, MAXCTLDMASZ,
+			   ATA_DMA_ENTRIES, BUS_SPACE_MAXSIZE_32BIT,
+			   BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->dmatag))
 	goto error;
 
-    if (bus_dma_tag_create(ch->dma->dmatag, 1, PAGE_SIZE,
+    if (bus_dma_tag_create(ch->dma->dmatag, PAGE_SIZE, PAGE_SIZE,
 			   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
-			   NULL, NULL, MAXTABSZ, 1, MAXTABSZ, BUS_DMA_ALLOCNOW,
-			   NULL, NULL, &ch->dma->cdmatag))
+			   NULL, NULL, MAXTABSZ, 1, MAXTABSZ,
+			   BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->cdmatag))
 	goto error;
 
-    if (bus_dma_tag_create(ch->dma->dmatag, ch->dma->alignment, 0,
+    if (bus_dma_tag_create(ch->dma->dmatag, ch->dma->alignment, 64*1024,
 			   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
 			   NULL, NULL, MAXPHYS, ATA_DMA_ENTRIES, MAXSEGSZ,
 			   BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->ddmatag))

==== //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#6 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.17 2003/10/01 09:58:19 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.18 2003/10/07 13:45:56 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -91,7 +91,7 @@
 			    request->u.ata.feature)) {
 		ata_prtdev(request->device, "error issueing PIO command\n");
 		request->result = EIO;
-		return ATA_OP_FINISHED;
+		break;
 	    }
 
 	    /* if write command output the data */
@@ -100,7 +100,7 @@
 			     (ATA_S_READY | ATA_S_DSC | ATA_S_DRQ)) < 0) {
 		    ata_prtdev(request->device,"timeout waiting for write DRQ");
 		    request->result = EIO;
-		    return ATA_OP_FINISHED;
+		    break;
 		}
 		ata_pio_write(request, request->transfersize);
 	    }
@@ -116,7 +116,7 @@
 						 request->bytecount)) {
 	    ata_prtdev(request->device, "setting up DMA failed\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* issue command */
@@ -125,7 +125,7 @@
 			request->u.ata.feature)) {
 	    ata_prtdev(request->device, "error issuing DMA command\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* start DMA engine */
@@ -133,8 +133,9 @@
 						 request->data,
 						 request->bytecount,
 						 request->flags & ATA_R_READ)) {
+	    ata_prtdev(request->device, "error starting DMA\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 	/* return and wait for interrupt */
 	return ATA_OP_CONTINUES;
@@ -148,7 +149,7 @@
 	    DELAY(10);
 	    if (!(ATA_IDX_INB(request->device->channel, ATA_ALTSTAT)&ATA_S_DSC))
 		request->result = EBUSY;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* start ATAPI operation */
@@ -156,7 +157,7 @@
 			request->transfersize << 8, 0, 0)) {
 	    ata_prtdev(request->device, "error issuing ATA PACKET command\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* command interrupt device ? just return and wait for interrupt */
@@ -179,7 +180,7 @@
 		ata_prtdev(request->device,
 			   "timeout waiting for ATAPI ready\n");
 		request->result = EIO;
-		return ATA_OP_FINISHED;
+		break;
 	    }
 	}
 
@@ -203,7 +204,7 @@
 	    DELAY(10);
 	    if (!(ATA_IDX_INB(request->device->channel, ATA_ALTSTAT)&ATA_S_DSC))
 		request->result = EBUSY;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* check sanity and setup DMA engine */
@@ -212,14 +213,14 @@
 						 request->bytecount)) {
 	    ata_prtdev(request->device, "setting up DMA failed\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* start ATAPI operation */
 	if (ata_command(request->device, ATA_PACKET_CMD, 0, 0, ATA_F_DMA)) {
 	    ata_prtdev(request->device, "error issuing ATAPI packet command\n");
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* wait for ready to write ATAPI command block */
@@ -235,10 +236,9 @@
 		DELAY(20);
 	    }
 	    if (timeout <= 0) {
-		ata_prtdev(request->device,
-			   "timeout waiting for ATAPI ready\n");
+		ata_prtdev(request->device,"timeout waiting for ATAPI ready\n");
 		request->result = EIO;
-		return ATA_OP_FINISHED;
+		break;
 	    }
 	}
 
@@ -257,12 +257,16 @@
 						 request->bytecount,
 						 request->flags & ATA_R_READ)) {
 	    request->result = EIO;
-	    return ATA_OP_FINISHED;
+	    break;
 	}
 
 	/* return and wait for interrupt */
 	return ATA_OP_CONTINUES;
     }
+
+    /* request finish here */
+    request->device->channel->running = NULL;
+    return ATA_OP_FINISHED;
 }
 
 static void

==== //depot/projects/netperf/sys/dev/ata/ata-queue.c#4 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.6 2003/09/19 12:46:12 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.7 2003/10/07 13:47:40 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -316,7 +316,7 @@
 {
     /* clear timeout etc */
     request->timeout_handle.callout = NULL;
-
+#if 0
     /* call interrupt to try finish up the command */
     request->device->channel->hw.interrupt(request->device->channel);
 
@@ -327,6 +327,7 @@
 		       ata_cmd2str(request));
 	return;
     }
+#endif
 
     /* if this was a DMA request stop the engine to be on the safe side */
     if (request->flags & ATA_R_DMA) {
@@ -334,22 +335,37 @@
 	    request->device->channel->dma->stop(request->device->channel);
     }
 
+    /* report that we timed out */
+    if (request->retries > 0 && !(request->flags & ATA_R_QUIET))
+	ata_prtdev(request->device,
+		   "TIMEOUT - %s retrying (%d retr%s left)\n",
+		   ata_cmd2str(request), request->retries,
+		   request->retries == 1 ? "y" : "ies");
+
     /* try to adjust HW's attitude towards work */
     ata_reinit(request->device->channel);
 
+    /* if device disappeared nothing more to do here */
+    if (!request->device->softc) {
+	if (!(request->flags & ATA_R_QUIET))
+	    ata_prtdev(request->device,
+		       "FAILURE - %s device lockup/removed\n",
+		       ata_cmd2str(request));
+	return;
+    }
+
     /* if retries still permit, reinject this request */
     if (request->retries-- > 0) {
-	if (!(request->flags & ATA_R_QUIET))
-	    ata_prtdev(request->device,
-		       "TIMEOUT - %s retrying (%d retr%s left)\n",
-		       ata_cmd2str(request), request->retries,
-		       request->retries == 1 ? "y" : "ies");
 	request->flags |= (ATA_R_AT_HEAD | ATA_R_REQUEUE);
 	request->flags &= ~ATA_R_SKIPSTART;
 	ata_queue_request(request);
     }
     /* otherwise just schedule finish with error */
     else {
+	if (!(request->flags & ATA_R_QUIET))
+	    ata_prtdev(request->device,
+		       "FAILURE - %s timed out\n",
+		       ata_cmd2str(request));
 	request->status = ATA_S_ERROR;
 	TASK_INIT(&request->task, 0, ata_completed, request);
 	taskqueue_enqueue(taskqueue_swi, &request->task);

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

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.41 2003/10/06 15:56:29 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.44 2003/10/07 03:40:17 imp Exp $");
 
 /*
  * CIS Handling for the Cardbus Bus
@@ -49,12 +49,13 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
+#include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccard_cis.h>
+
 #include <dev/cardbus/cardbusreg.h>
 #include <dev/cardbus/cardbusvar.h>
 #include <dev/cardbus/cardbus_cis.h>
 
-#include <dev/pccard/pccardvar.h>
-
 extern int cardbus_cis_debug;
 
 #define	DPRINTF(a) if (cardbus_cis_debug) printf a
@@ -75,9 +76,6 @@
 static int decode_tuple_generic(device_t cbdev, device_t child, int id,
     int len, uint8_t *tupledata, uint32_t start, uint32_t *off,
     struct tuple_callbacks *info);
-static int decode_tuple_copy(device_t cbdev, device_t child, int id,
-    int len, uint8_t *tupledata, uint32_t start, uint32_t *off,
-    struct tuple_callbacks *info);
 static int decode_tuple_linktarget(device_t cbdev, device_t child, int id,
     int len, uint8_t *tupledata, uint32_t start, uint32_t *off,
     struct tuple_callbacks *info);
@@ -142,18 +140,6 @@
 	"Security"
 };
 
-struct cardbus_quirk {
-	uint32_t devid;	/* Vendor/device of the card */
-	int	type;
-#define	CARDBUS_QUIRK_MAP_REG	1 /* PCI map register in weird place */
-	int	arg1;
-	int	arg2;
-};
-
-struct cardbus_quirk cardbus_quirks[] = {
-	{ 0 }
-};
-
 /*
  * Handler functions for various CIS tuples
  */
@@ -679,12 +665,6 @@
 			return (callbacks[i].func(cbdev, child, tupleid, len,
 			    tupledata, start, off, &callbacks[i]));
 	}
-
-	if (tupleid < CISTPL_CUSTOMSTART) {
-		device_printf(cbdev, "Undefined tuple encountered, "
-		    "CIS parsing terminated\n");
-		return (EINVAL);
-	}
 	return (callbacks[i].func(cbdev, child, tupleid, len,
 	    tupledata, start, off, NULL));
 }
@@ -996,25 +976,15 @@
 cardbus_pickup_maps(device_t cbdev, device_t child)
 {
 	struct cardbus_devinfo *dinfo = device_get_ivars(child);
-	struct cardbus_quirk *q;
 	int reg;
 
 	/*
 	 * Try to pick up any resources that was not specified in CIS.
-	 * Some devices (eg, 3c656) does not list all resources required by
-	 * the driver in its CIS.
-	 * XXX: should we do this or use quirks?
+	 * Maybe this isn't any longer necessary now that we have fixed
+	 * CIS parsing and we should filter things here?  XXX
 	 */
-	for (reg = 0; reg < dinfo->pci.cfg.nummaps; reg++) {
+	for (reg = 0; reg < dinfo->pci.cfg.nummaps; reg++)
 		cardbus_add_map(cbdev, child, PCIR_BAR(reg));
-	}
-
-	for (q = &cardbus_quirks[0]; q->devid; q++) {
-		if (q->devid == ((dinfo->pci.cfg.device << 16) | dinfo->pci.cfg.vendor)
-		    && q->type == CARDBUS_QUIRK_MAP_REG) {
-			cardbus_add_map(cbdev, child, q->arg1);
-		}
-	}
 }
 
 int
@@ -1022,43 +992,17 @@
 {
 	int ret;
 	struct tuple_callbacks init_callbacks[] = {
-		MAKETUPLE(NULL,			generic),
-		MAKETUPLE(DEVICE,		generic),
-		MAKETUPLE(LONG_LINK_CB,		unhandled),
+		MAKETUPLE(LONGLINK_CB,		unhandled),
 		MAKETUPLE(INDIRECT,		unhandled),
-		MAKETUPLE(CONFIG_CB,		generic),
-		MAKETUPLE(CFTABLE_ENTRY_CB,	generic),
 		MAKETUPLE(LONGLINK_MFC,		unhandled),
 		MAKETUPLE(BAR,			bar),
-		MAKETUPLE(PWR_MGMNT,		generic),
-		MAKETUPLE(EXTDEVICE,		generic),
-		MAKETUPLE(CHECKSUM,		generic),
 		MAKETUPLE(LONGLINK_A,		unhandled),
 		MAKETUPLE(LONGLINK_C,		unhandled),
 		MAKETUPLE(LINKTARGET,		linktarget),
-		MAKETUPLE(NO_LINK,		generic),
 		MAKETUPLE(VERS_1,		vers_1),
-		MAKETUPLE(ALTSTR,		generic),
-		MAKETUPLE(DEVICE_A,		generic),
-		MAKETUPLE(JEDEC_C,		generic),
-		MAKETUPLE(JEDEC_A,		generic),
-		MAKETUPLE(CONFIG,		generic),
-		MAKETUPLE(CFTABLE_ENTRY,	generic),
-		MAKETUPLE(DEVICE_OC,		generic),
-		MAKETUPLE(DEVICE_OA,		generic),
-		MAKETUPLE(DEVICE_GEO,		generic),
-		MAKETUPLE(DEVICE_GEO_A,		generic),
 		MAKETUPLE(MANFID,		manfid),
 		MAKETUPLE(FUNCID,		funcid),
 		MAKETUPLE(FUNCE,		funce),
-		MAKETUPLE(SWIL,			generic),
-		MAKETUPLE(VERS_2,		generic),
-		MAKETUPLE(FORMAT,		generic),
-		MAKETUPLE(GEOMETRY,		generic),
-		MAKETUPLE(BYTEORDER,		generic),
-		MAKETUPLE(DATE,			generic),
-		MAKETUPLE(BATTERY,		generic),
-		MAKETUPLE(ORG,			generic),
 		MAKETUPLE(END,			end),
 		MAKETUPLE(GENERIC,		generic),
 	};

==== //depot/projects/netperf/sys/dev/cardbus/cardbus_cis.h#2 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/cardbus/cardbus_cis.h,v 1.8 2003/01/27 05:47:01 imp Exp $
+ * $FreeBSD: src/sys/dev/cardbus/cardbus_cis.h,v 1.10 2003/10/07 03:33:54 imp Exp $
  */
 
 /*
@@ -35,56 +35,9 @@
 struct cis_tupleinfo;
 
 int	cardbus_do_cis(device_t, device_t);
-int	cardbus_cis_read(device_t, device_t, uint8_t, struct cis_tupleinfo**,
-	    int*);
-void	cardbus_cis_free(device_t, struct cis_tupleinfo*, int*);
 
 #define	MAXTUPLESIZE		0x400
 
-/* CIS TUPLES */
-
-#define	CISTPL_NULL		0x00
-#define	CISTPL_DEVICE		0x01
-#define	CISTPL_LONG_LINK_CB	0x02
-#define	CISTPL_INDIRECT		0x03
-#define	CISTPL_CONFIG_CB	0x04
-#define	CISTPL_CFTABLE_ENTRY_CB	0x05
-#define	CISTPL_LONGLINK_MFC	0x06
-#define	CISTPL_BAR		0x07
-#define	CISTPL_PWR_MGMNT	0x08
-#define	CISTPL_EXTDEVICE	0x09
-#define	CISTPL_CHECKSUM		0x10
-#define	CISTPL_LONGLINK_A	0x11
-#define	CISTPL_LONGLINK_C	0x12
-#define	CISTPL_LINKTARGET	0x13
-#define	CISTPL_NO_LINK		0x14
-#define	CISTPL_VERS_1		0x15
-#define	CISTPL_ALTSTR		0x16
-#define	CISTPL_DEVICE_A		0x17
-#define	CISTPL_JEDEC_C		0x18
-#define	CISTPL_JEDEC_A		0x19
-#define	CISTPL_CONFIG		0x1A
-#define	CISTPL_CFTABLE_ENTRY	0x1B
-#define	CISTPL_DEVICE_OC	0x1C
-#define	CISTPL_DEVICE_OA	0x1D
-#define	CISTPL_DEVICE_GEO	0x1E
-#define	CISTPL_DEVICE_GEO_A	0x1F
-#define	CISTPL_MANFID		0x20
-#define	CISTPL_FUNCID		0x21
-#define	CISTPL_FUNCE		0x22
-#define	CISTPL_SWIL		0x23
-#define	CISTPL_VERS_2		0x40
-#define	CISTPL_FORMAT		0x41
-#define	CISTPL_GEOMETRY		0x42
-#define	CISTPL_BYTEORDER	0x43
-#define	CISTPL_DATE		0x44
-#define	CISTPL_BATTERY		0x45
-#define	CISTPL_ORG		0x46
-#define	CISTPL_CUSTOMSTART	0x80
-#define	CISTPL_END		0xFF
-
-#define	CISTPL_GENERIC		-1	/* catchall */
-
 /* BAR */
 #define	TPL_BAR_REG_ASI_MASK			0x07
 #define	TPL_BAR_REG_AS				0x10

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

@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/exca/exca.c,v 1.14 2003/09/24 22:13:25 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/exca/exca.c,v 1.15 2003/10/07 04:29:04 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -576,7 +576,6 @@
 void
 exca_reset(struct exca_softc *sc, device_t child)
 {
-	int cardtype;
 	int win;
 
 	/* enable socket i/o */
@@ -595,11 +594,8 @@
 	/* disable all address windows */
 	exca_putb(sc, EXCA_ADDRWIN_ENABLE, 0);
 
-	CARD_GET_TYPE(child, &cardtype);
-	exca_setb(sc, EXCA_INTR, (cardtype == PCCARD_IFTYPE_IO) ?
-	    EXCA_INTR_CARDTYPE_IO : EXCA_INTR_CARDTYPE_MEM);
-	DEVPRINTF(sc->dev, "card type is %s\n",
-	    (cardtype == PCCARD_IFTYPE_IO) ? "io" : "mem");
+	exca_setb(sc, EXCA_INTR, EXCA_INTR_CARDTYPE_IO);
+	DEVPRINTF(sc->dev, "card type is io\n");
 
 	/* reinstall all the memory and io mappings */
 	for (win = 0; win < EXCA_MEM_WINS; ++win)

==== //depot/projects/netperf/sys/dev/kbd/atkbd.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/kbd/atkbd.c,v 1.41 2003/08/24 17:49:15 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/kbd/atkbd.c,v 1.42 2003/10/07 09:21:59 fjoe Exp $");
 
 #include "opt_kbd.h"
 #include "opt_atkbd.h"
@@ -679,6 +679,15 @@
 		case 0x5d:	/* menu key */
 	    		keycode = 0x6b;
 	    		break;
+		case 0x5e:	/* power key */
+			keycode = 0x6d;
+			break;
+		case 0x5f:	/* sleep key */
+			keycode = 0x6e;
+			break;
+		case 0x63:	/* wake key */
+			keycode = 0x6f;
+			break;
 		default:	/* ignore everything else */
 	    		goto next_code;
 		}

==== //depot/projects/netperf/sys/dev/pccard/card_if.m#3 (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/dev/pccard/card_if.m,v 1.22 2003/10/06 07:10:40 imp Exp $
+# $FreeBSD: src/sys/dev/pccard/card_if.m,v 1.23 2003/10/07 03:33:53 imp Exp $
 #
 
 #include <sys/bus.h>
@@ -93,14 +93,6 @@
 }
 
 #
-# Returns the type of card this is.  Maybe we don't need this.
-#
-METHOD int get_type {
-	device_t  dev;
-	int	  *type;
-}
-
-#
 # Returns the function number for this device.
 #
 METHOD int get_function {

==== //depot/projects/netperf/sys/dev/pccard/pccard.c#6 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pccard/pccard.c,v 1.84 2003/09/05 03:08:08 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pccard/pccard.c,v 1.85 2003/10/07 03:33:53 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,7 +86,6 @@
 static void	pccard_ccr_write(struct pccard_function *pf, int ccr, int val);
 static int	pccard_attach_card(device_t dev);
 static int	pccard_detach_card(device_t dev);
-static int	pccard_card_gettype(device_t dev, int *type);
 static void	pccard_function_init(struct pccard_function *pf);
 static void	pccard_function_free(struct pccard_function *pf);
 static int	pccard_function_enable(struct pccard_function *pf);
@@ -379,27 +378,6 @@
 	return (NULL);
 }
 
-static int
-pccard_card_gettype(device_t dev, int *type)
-{
-	struct pccard_softc *sc = PCCARD_SOFTC(dev);
-	struct pccard_function *pf;
-
-	/*
-	 * set the iftype to memory if this card has no functions (not yet
-	 * probed), or only one function, and that is not initialized yet or
-	 * that is memory.
-	 */
-	pf = STAILQ_FIRST(&sc->card.pf_head);
-	if (pf == NULL ||
-	    (STAILQ_NEXT(pf, pf_list) == NULL &&
-	    (pf->cfe == NULL || pf->cfe->iftype == PCCARD_IFTYPE_MEMORY)))
-		*type = PCCARD_IFTYPE_MEMORY;
-	else
-		*type = PCCARD_IFTYPE_IO;
-	return (0);
-}
-
 /*
  * Initialize a PCCARD function.  May be called as long as the function is
  * disabled.
@@ -1303,7 +1281,6 @@
 	/* Card Interface */
 	DEVMETHOD(card_set_res_flags,	pccard_set_res_flags),
 	DEVMETHOD(card_set_memory_offset, pccard_set_memory_offset),
-	DEVMETHOD(card_get_type,	pccard_card_gettype),
 	DEVMETHOD(card_attach_card,	pccard_attach_card),
 	DEVMETHOD(card_detach_card,	pccard_detach_card),
 	DEVMETHOD(card_compat_do_probe, pccard_compat_do_probe),

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

@@ -1,5 +1,5 @@
 /* $NetBSD: pcmcia_cis.c,v 1.17 2000/02/10 09:01:52 chopps Exp $ */
-/* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.26 2003/08/20 05:44:55 imp Exp $ */
+/* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.27 2003/10/07 03:33:53 imp Exp $ */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -45,6 +45,7 @@
 
 #include <dev/pccard/pccardreg.h>
 #include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccard_cis.h>
 
 #include "card_if.h"
 
@@ -163,7 +164,7 @@
 			if (tuple.mult * tuple.ptr >= PCCARD_CIS_SIZE - 1
 			    - 32 /* ad hoc value */ ) {
 				printf("CIS is too long -- truncating\n");
-				tuple.code = PCCARD_CISTPL_END;
+				tuple.code = CISTPL_END;
 			} else {
 				/* get the tuple code */
 				tuple.code = pccard_cis_read_1(&tuple, tuple.ptr);
@@ -171,7 +172,7 @@
 
 			/* two special-case tuples */
 
-			if (tuple.code == PCCARD_CISTPL_NULL) {
+			if (tuple.code == CISTPL_NULL) {
 #ifdef PCCARDCISDEBUG
 				if (cis_none_cnt > 0)
 					DPRINTF(("CISTPL_NONE\n 00\n"));
@@ -181,7 +182,7 @@
 #endif
 				tuple.ptr++;
 				continue;
-			} else if (tuple.code == PCCARD_CISTPL_END) {
+			} else if (tuple.code == CISTPL_END) {
 				DPRINTF(("CISTPL_END\n ff\n"));
 				/* Call the function for the END tuple, since
 				   the CIS semantics depend on it */
@@ -196,8 +197,8 @@
 
 			tuple.length = pccard_cis_read_1(&tuple, tuple.ptr + 1);
 			switch (tuple.code) {
-			case PCCARD_CISTPL_LONGLINK_A:
-			case PCCARD_CISTPL_LONGLINK_C:
+			case CISTPL_LONGLINK_A:
+			case CISTPL_LONGLINK_C:
 				if (tuple.length < 4) {
 					DPRINTF(("CISTPL_LONGLINK_%s too "
 					    "short %d\n",
@@ -207,17 +208,17 @@
 				}
 				longlink_present = 1;
 				longlink_common = (tuple.code ==
-				    PCCARD_CISTPL_LONGLINK_C) ? 1 : 0;
+				    CISTPL_LONGLINK_C) ? 1 : 0;
 				longlink_addr = pccard_tuple_read_4(&tuple, 0);
 				DPRINTF(("CISTPL_LONGLINK_%s %lx\n",
 				    longlink_common ? "C" : "A",
 				    longlink_addr));
 				break;
-			case PCCARD_CISTPL_NO_LINK:
+			case CISTPL_NO_LINK:
 				longlink_present = 0;
 				DPRINTF(("CISTPL_NO_LINK\n"));
 				break;
-			case PCCARD_CISTPL_CHECKSUM:
+			case CISTPL_CHECKSUM:
 				if (tuple.length < 5) {
 					DPRINTF(("CISTPL_CHECKSUM too "
 					    "short %d\n", tuple.length));
@@ -273,7 +274,7 @@
 					}
 				}
 				break;
-			case PCCARD_CISTPL_LONGLINK_MFC:
+			case CISTPL_LONGLINK_MFC:
 				if (tuple.length < 1) {
 					DPRINTF(("CISTPL_LONGLINK_MFC too "
 					    "short %d\n", tuple.length));
@@ -410,7 +411,7 @@
 
 			/* make sure that the link is valid */
 			tuple.code = pccard_cis_read_1(&tuple, tuple.ptr);
-			if (tuple.code != PCCARD_CISTPL_LINKTARGET) {
+			if (tuple.code != CISTPL_LINKTARGET) {
 				DPRINTF(("CISTPL_LINKTARGET expected, "
 				    "code %02x observed\n", tuple.code));
 				continue;
@@ -620,7 +621,7 @@
 	struct cis_state *state = arg;
 
 	switch (tuple->code) {
-	case PCCARD_CISTPL_END:
+	case CISTPL_END:
 		/* if we've seen a LONGLINK_MFC, and this is the first
 		 * END after it, reset the function list.  
 		 *
@@ -647,7 +648,7 @@
 			state->pf = NULL;
 		}
 		break;
-	case PCCARD_CISTPL_LONGLINK_MFC:
+	case CISTPL_LONGLINK_MFC:
 		/*
 		 * this tuple's structure was dealt with in scan_cis.  here,
 		 * record the fact that the MFC tuple was seen, so that
@@ -657,8 +658,8 @@
 		state->gotmfc = 1;
 		break;
 #ifdef PCCARDCISDEBUG
-	case PCCARD_CISTPL_DEVICE:
-	case PCCARD_CISTPL_DEVICE_A:
+	case CISTPL_DEVICE:
+	case CISTPL_DEVICE_A:
 		{
 			u_int reg, dtype, dspeed;
 
@@ -667,7 +668,7 @@
 			dspeed = reg & PCCARD_DSPEED_MASK;
 
 			DPRINTF(("CISTPL_DEVICE%s type=",
-			(tuple->code == PCCARD_CISTPL_DEVICE) ? "" : "_A"));
+			(tuple->code == CISTPL_DEVICE) ? "" : "_A"));
 			switch (dtype) {
 			case PCCARD_DTYPE_NULL:
 				DPRINTF(("null"));
@@ -731,7 +732,7 @@
 		DPRINTF(("\n"));

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



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