Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2006 05:56:14 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 92517 for review
Message-ID:  <200602280556.k1S5uEIG096767@repoman.freebsd.org>

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

Change 92517 by imp@imp_harmony on 2006/02/28 05:56:05

	IFC @92515

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#11 integrate
.. //depot/projects/arm/src/sys/coda/coda.h#2 integrate
.. //depot/projects/arm/src/sys/conf/files#20 integrate
.. //depot/projects/arm/src/sys/dev/ata/ata-all.c#7 integrate
.. //depot/projects/arm/src/sys/dev/ata/ata-queue.c#8 integrate
.. //depot/projects/arm/src/sys/dev/ath/if_ath.c#8 integrate
.. //depot/projects/arm/src/sys/dev/ath/if_athvar.h#7 integrate
.. //depot/projects/arm/src/sys/dev/de/dc21040reg.h#1 branch
.. //depot/projects/arm/src/sys/dev/de/if_de.c#1 branch
.. //depot/projects/arm/src/sys/dev/de/if_devar.h#1 branch
.. //depot/projects/arm/src/sys/dev/isp/isp_freebsd.c#6 integrate
.. //depot/projects/arm/src/sys/dev/kbdmux/kbdmux.c#2 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_type.h#6 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt.c#5 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#6 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_debug.c#6 integrate
.. //depot/projects/arm/src/sys/dev/usb/ehci.c#6 integrate
.. //depot/projects/arm/src/sys/dev/usb/ohci.c#9 integrate
.. //depot/projects/arm/src/sys/dev/usb/uhci.c#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/ukbd.c#3 integrate
.. //depot/projects/arm/src/sys/dev/usb/uplcom.c#5 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb_port.h#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb_quirks.c#8 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb_subr.c#7 integrate
.. //depot/projects/arm/src/sys/dev/usb/usbdevs#13 integrate
.. //depot/projects/arm/src/sys/dev/usb/usbdivar.h#2 integrate
.. //depot/projects/arm/src/sys/dev/vkbd/vkbd.c#4 integrate
.. //depot/projects/arm/src/sys/fs/fdescfs/fdesc_vnops.c#4 integrate
.. //depot/projects/arm/src/sys/kern/kern_mbuf.c#7 integrate
.. //depot/projects/arm/src/sys/kern/vfs_aio.c#5 integrate
.. //depot/projects/arm/src/sys/modules/Makefile#14 integrate
.. //depot/projects/arm/src/sys/modules/coda5/Makefile#4 integrate
.. //depot/projects/arm/src/sys/modules/crypto/Makefile#3 integrate
.. //depot/projects/arm/src/sys/modules/de/Makefile#3 integrate
.. //depot/projects/arm/src/sys/modules/if_ppp/Makefile#3 integrate
.. //depot/projects/arm/src/sys/net/bridgestp.c#3 integrate
.. //depot/projects/arm/src/sys/net/ppp_deflate.c#2 integrate
.. //depot/projects/arm/src/sys/opencrypto/cryptodev.c#4 integrate
.. //depot/projects/arm/src/sys/pci/dc21040reg.h#2 delete
.. //depot/projects/arm/src/sys/pci/if_de.c#7 delete
.. //depot/projects/arm/src/sys/pci/if_devar.h#6 delete

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#11 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_usart_at91rm92.c,v 1.2 2005/01/05 21:58:48 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.2 2006/02/27 23:19:13 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -359,9 +359,9 @@
 	   
 	mtx_lock_spin(&sc->sc_hwmtx);
 	if (csr & USART_CSR_TXRDY && sc->sc_txbusy)
-		ipend |= UART_IPEND_TXIDLE;
+		ipend |= SER_INT_TXIDLE;
 	if (csr & USART_CSR_RXRDY)
-		ipend |= UART_IPEND_RXREADY;
+		ipend |= SER_INT_RXREADY;
 	mtx_unlock_spin(&sc->sc_hwmtx);
 	return (ipend);
 }
@@ -388,7 +388,7 @@
 		sig |= SER_DSR;
 	if (csr & USART_CSR_RI)
 		sig |= SER_RI;
-	new = sig & ~UART_SIGMASK_DELTA;
+	new = sig & ~SER_MASK_DELTA;
 	sc->sc_hwsig = new;
 	mtx_unlock_spin(&sc->sc_hwmtx);
 	return (sig);

==== //depot/projects/arm/src/sys/coda/coda.h#2 (text+ko) ====

@@ -27,7 +27,7 @@
  * Mellon the rights to redistribute these changes without encumbrance.
  * 
  * 	@(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ 
- * $FreeBSD: src/sys/coda/coda.h,v 1.13 2005/01/05 23:35:00 imp Exp $
+ * $FreeBSD: src/sys/coda/coda.h,v 1.14 2006/02/27 12:04:12 yar Exp $
  * 
  */
 
@@ -41,7 +41,12 @@
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-#include "opt_coda.h"	/* for COMPAT_CODA_5 option */
+#include "opt_coda.h"	/* for CODA_COMPAT_5 option */
+
+/* Avoid CODA_COMPAT_5 redefinition in coda5 module */
+#if defined (CODA5_MODULE) && !defined(CODA_COMPAT_5)
+#define CODA_COMPAT_5
+#endif
 
 /* Catch new _KERNEL defn for NetBSD */
 #ifdef __NetBSD__

==== //depot/projects/arm/src/sys/conf/files#20 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1096 2006/02/07 18:41:56 imp Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1097 2006/02/26 17:54:04 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -507,6 +507,7 @@
 dev/dcons/dcons.c		optional dcons
 dev/dcons/dcons_crom.c		optional dcons_crom
 dev/dcons/dcons_os.c		optional dcons
+dev/de/if_de.c			optional de pci
 dev/digi/CX.c			optional digi_CX
 dev/digi/CX_PCI.c		optional digi_CX_PCI
 dev/digi/EPCX.c			optional digi_EPCX
@@ -1812,7 +1813,6 @@
 pci/alpm.c			optional alpm pci
 pci/amdpm.c			optional amdpm pci | nfpm pci
 pci/amdsmb.c			optional amdsmb pci
-pci/if_de.c			optional de pci
 pci/if_mn.c			optional mn pci
 pci/if_pcn.c			optional pcn pci
 pci/if_rl.c			optional rl pci

==== //depot/projects/arm/src/sys/dev/ata/ata-all.c#7 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.264 2006/02/09 20:54:42 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.265 2006/02/25 17:27:32 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -160,6 +160,11 @@
     if (!ch->r_irq)
 	return ENXIO;
 
+    /* grap the channel lock so no new requests gets launched */
+    mtx_lock(&ch->state_mtx);
+    ch->state |= ATA_STALL_QUEUE;
+    mtx_unlock(&ch->state_mtx);
+
     /* detach & delete all children */
     if (!device_get_children(dev, &children, &nchildren)) {
 	for (i = 0; i < nchildren; i++)
@@ -196,9 +201,14 @@
     while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
 	tsleep(&dev, PRIBIO, "atarini", 1);
 
+    /* catch eventual request in ch->running */
+    mtx_lock(&ch->state_mtx);
+    if ((request = ch->running))
+	callout_stop(&request->callout);
+    ch->running = NULL;
+
     /* unconditionally grap the channel lock */
-    mtx_lock(&ch->state_mtx);
-    ch->state = ATA_STALL_QUEUE;
+    ch->state |= ATA_STALL_QUEUE;
     mtx_unlock(&ch->state_mtx);
 
     /* reset the controller HW, the channel and device(s) */
@@ -208,48 +218,32 @@
     if (!device_get_children(dev, &children, &nchildren)) {
 	mtx_lock(&Giant);       /* newbus suckage it needs Giant */
 	for (i = 0; i < nchildren; i++) {
-	    if (children[i] && device_is_attached(children[i]))
-		if (ATA_REINIT(children[i])) {
-		    /*
-		     * if we have a running request and its device matches
-		     * this child we need to inform the request that the 
-		     * device is gone and remove it from ch->running
-		     */
-		    mtx_lock(&ch->state_mtx);
-		    if (ch->running && ch->running->dev == children[i]) {
-			callout_stop(&ch->running->callout);
-			request = ch->running;
-			ch->running = NULL;
-		    }
-		    else
-			request = NULL;
-		    mtx_unlock(&ch->state_mtx);
+	    /* did any children go missing ? */
+	    if (children[i] && device_is_attached(children[i]) &&
+		ATA_REINIT(children[i])) {
+		/*
+		 * if we had a running request and its device matches
+		 * this child we need to inform the request that the 
+		 * device is gone.
+		 */
+		if (request && request->dev == children[i]) {
+		    request->result = ENXIO;
+		    device_printf(request->dev, "FAILURE - device detached\n");
 
-		    if (request) {
-			request->result = ENXIO;
-			device_printf(request->dev,
-				      "FAILURE - device detached\n");
-
-			/* if not timeout finish request here */
-			if (!(request->flags & ATA_R_TIMEOUT))
+		    /* if not timeout finish request here */
+		    if (!(request->flags & ATA_R_TIMEOUT))
 			    ata_finish(request);
-		    }
-		    device_delete_child(dev, children[i]);
+		    request = NULL;
 		}
+		device_delete_child(dev, children[i]);
+	    }
 	}
 	free(children, M_TEMP);
 	mtx_unlock(&Giant);     /* newbus suckage dealt with, release Giant */
     }
 
-    /* catch request in ch->running if we havn't already */
-    mtx_lock(&ch->state_mtx);
-    if ((request = ch->running))
-	callout_stop(&request->callout);
-    ch->running = NULL;
-    mtx_unlock(&ch->state_mtx);
-
-    /* if we got one put it on the queue again */
-    if (request) {
+    /* if we still have a good request put it on the queue again */
+    if (request && !(request->flags & ATA_R_TIMEOUT)) {
 	device_printf(request->dev,
 		      "WARNING - %s requeued due to channel reset",
 		      ata_cmd2str(request));
@@ -335,7 +329,7 @@
 	ATA_DEBUG_RQ(request, "interrupt");
 
 	/* safetycheck for the right state */
-	if (ch->state != ATA_ACTIVE && ch->state != ATA_STALL_QUEUE) {
+	if (ch->state == ATA_IDLE) {
 	    device_printf(request->dev, "interrupt on idle channel ignored\n");
 	    break;
 	}

==== //depot/projects/arm/src/sys/dev/ata/ata-queue.c#8 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.56 2006/02/23 20:15:22 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.57 2006/02/25 17:27:33 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -61,7 +61,7 @@
     if (!request->callback && !(request->flags & ATA_R_REQUEUE))
 	sema_init(&request->done, 0, "ATA request done");
 
-    /* in ATA_STALL_QUEUE state we call HW directly (used only during reinit) */
+    /* in ATA_STALL_QUEUE state we call HW directly */
     if ((ch->state & ATA_STALL_QUEUE) && (request->flags & ATA_R_CONTROL)) {
 	mtx_lock(&ch->state_mtx);
 	ch->running = request;
@@ -505,7 +505,6 @@
     if ((request = ch->running) && (!dev || request->dev == dev)) {
 	callout_stop(&request->callout);
 	ch->running = NULL;
-	ch->state = ATA_IDLE;
 	request->result = ENXIO;
 	TAILQ_INSERT_TAIL(&fail_requests, request, chain);
     }
@@ -527,9 +526,6 @@
         TAILQ_REMOVE(&fail_requests, request, chain);
         ata_finish(request);
     }
-
-    /* we might have work for the other device on this channel */
-    ata_start(ch->dev);
 }
 
 static u_int64_t

==== //depot/projects/arm/src/sys/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.136 2006/02/24 23:10:08 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.137 2006/02/27 17:20:23 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -1155,16 +1155,12 @@
 		 */
 		ATH_TXBUF_LOCK(sc);
 		bf = STAILQ_FIRST(&sc->sc_txbuf);
-		if (bf != NULL) {
-			if (bf->bf_flags & ATH_FLAG_BUSY)
-				bf = NULL;
-			else
-				STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
-		}
+		if (bf != NULL)
+			STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
 		ATH_TXBUF_UNLOCK(sc);
 		if (bf == NULL) {
-			DPRINTF(sc, ATH_DEBUG_XMIT,
-			    "%s: no available xmit buffers\n", __func__);
+			DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of xmit buffers\n",
+				__func__);
 			sc->sc_stats.ast_tx_qstop++;
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
@@ -1185,14 +1181,14 @@
 				    ieee80211_state_name[ic->ic_state]);
 				sc->sc_stats.ast_tx_discard++;
 				ATH_TXBUF_LOCK(sc);
-				STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list);
+				STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
 				ATH_TXBUF_UNLOCK(sc);
 				break;
 			}
 			IFQ_DRV_DEQUEUE(&ifp->if_snd, m);	/* XXX: LOCK */
 			if (m == NULL) {
 				ATH_TXBUF_LOCK(sc);
-				STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list);
+				STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
 				ATH_TXBUF_UNLOCK(sc);
 				break;
 			}
@@ -1279,7 +1275,7 @@
 			ifp->if_oerrors++;
 	reclaim:
 			ATH_TXBUF_LOCK(sc);
-			STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list);
+			STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
 			ATH_TXBUF_UNLOCK(sc);
 			if (ni != NULL)
 				ieee80211_free_node(ni);
@@ -2415,7 +2411,7 @@
 	    __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len,
 	    (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len);
 
-	/* allocate buffers */
+	/* allocate rx buffers */
 	bsize = sizeof(struct ath_buf) * nbuf;
 	bf = malloc(bsize, M_ATHDEV, M_NOWAIT | M_ZERO);
 	if (bf == NULL) {
@@ -3691,7 +3687,7 @@
 		, ctsrate		/* rts/cts rate */
 		, ctsduration		/* rts/cts duration */
 	);
-	bf->bf_txflags = flags;
+	bf->bf_flags = flags;
 	/*
 	 * Setup the multi-rate retry state only when we're
 	 * going to use it.  This assumes ath_hal_setuptxdesc
@@ -3762,7 +3758,7 @@
 {
 	struct ath_hal *ah = sc->sc_ah;
 	struct ieee80211com *ic = &sc->sc_ic;
-	struct ath_buf *bf, *last;
+	struct ath_buf *bf;
 	struct ath_desc *ds, *ds0;
 	struct ieee80211_node *ni;
 	struct ath_node *an;
@@ -3794,14 +3790,7 @@
 			break;
 		}
 		ATH_TXQ_REMOVE_HEAD(txq, bf_list);
-		if (txq->axq_depth > 0) {
-			/*
-			 * More frames follow.  Mark the buffer busy
-			 * so it's not re-used while the hardware may
-			 * still re-read the link field.
-			 */
-			bf->bf_flags |= ATH_FLAG_BUSY;
-		} else
+		if (txq->axq_depth == 0)
 			txq->axq_link = NULL;
 		ATH_TXQ_UNLOCK(txq);
 
@@ -3838,7 +3827,7 @@
 			 * Hand the descriptor to the rate control algorithm.
 			 */
 			if ((ds->ds_txstat.ts_status & HAL_TXERR_FILT) == 0 &&
-			    (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) {
+			    (bf->bf_flags & HAL_TXDESC_NOACK) == 0) {
 				/*
 				 * If frame was ack'd update the last rx time
 				 * used to workaround phantom bmiss interrupts.
@@ -3864,9 +3853,6 @@
 		bf->bf_node = NULL;
 
 		ATH_TXBUF_LOCK(sc);
-		last = STAILQ_LAST(&sc->sc_txbuf, ath_buf, bf_list);
-		if (last != NULL)
-			last->bf_flags &= ~ATH_FLAG_BUSY;
 		STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
 		ATH_TXBUF_UNLOCK(sc);
 	}
@@ -3982,18 +3968,17 @@
 
 	/*
 	 * NB: this assumes output has been stopped and
-	 *     we do not need to block ath_tx_proc
+	 *     we do not need to block ath_tx_tasklet
 	 */
 	for (ix = 0;; ix++) {
 		ATH_TXQ_LOCK(txq);
 		bf = STAILQ_FIRST(&txq->axq_q);
 		if (bf == NULL) {
+			txq->axq_link = NULL;
 			ATH_TXQ_UNLOCK(txq);
 			break;
 		}
 		ATH_TXQ_REMOVE_HEAD(txq, bf_list);
-		if (txq->axq_depth == 0)
-			txq->axq_link = NULL;
 		ATH_TXQ_UNLOCK(txq);
 #ifdef AR_DEBUG
 		if (sc->sc_debug & ATH_DEBUG_RESET)
@@ -4011,16 +3996,10 @@
 			 */
 			ieee80211_free_node(ni);
 		}
-		bf->bf_flags &= ~ATH_FLAG_BUSY;
 		ATH_TXBUF_LOCK(sc);
 		STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
 		ATH_TXBUF_UNLOCK(sc);
 	}
-	ATH_TXBUF_LOCK(sc);
-	bf = STAILQ_FIRST(&sc->sc_txbuf);
-	if (bf != NULL)
-		bf->bf_flags &= ~ATH_FLAG_BUSY;
-	ATH_TXBUF_UNLOCK(sc);
 }
 
 static void
@@ -4898,10 +4877,10 @@
 
 	printf("Q%u[%3u]", qnum, ix);
 	for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) {
-		printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%x TF:%04x%s\n"
+		printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:04%x%s\n"
 		       "        %08x %08x %08x %08x %08x %08x\n",
 		    ds, (struct ath_desc *)bf->bf_daddr + i,
-		    ds->ds_link, ds->ds_data, bf->bf_flags, bf->bf_txflags,
+		    ds->ds_link, ds->ds_data, bf->bf_flags,
 		    !done ? "" : (ds->ds_txstat.ts_status == 0) ? " *" : " !",
 		    ds->ds_ctl0, ds->ds_ctl1,
 		    ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]);

==== //depot/projects/arm/src/sys/dev/ath/if_athvar.h#7 (text+ko) ====

@@ -33,7 +33,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.46 2006/02/24 23:10:08 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.47 2006/02/27 17:20:23 sam Exp $
  */
 
 /*
@@ -100,8 +100,7 @@
 struct ath_buf {
 	STAILQ_ENTRY(ath_buf)	bf_list;
 	int			bf_nseg;
-	u_int16_t		bf_txflags;	/* tx descriptor flags */
-	u_int16_t		bf_flags;	/* see below */
+	int			bf_flags;	/* tx descriptor flags */
 	struct ath_desc		*bf_desc;	/* virtual addr of desc */
 	bus_addr_t		bf_daddr;	/* physical addr of desc */
 	bus_dmamap_t		bf_dmamap;	/* DMA map for mbuf chain */
@@ -113,8 +112,6 @@
 };
 typedef STAILQ_HEAD(, ath_buf) ath_bufhead;
 
-#define	ATH_FLAG_BUSY		0x0001		/* tx descriptor owned by h/w */
-
 /*
  * DMA state for tx/rx descriptors.
  */
@@ -140,7 +137,7 @@
  */
 struct ath_txq {
 	u_int			axq_qnum;	/* hardware q number */
-	int			axq_depth;	/* queue depth (stat only) */
+	u_int			axq_depth;	/* queue depth (stat only) */
 	u_int			axq_intrcnt;	/* interrupt count */
 	u_int32_t		*axq_link;	/* link ptr in last TX desc */
 	STAILQ_HEAD(, ath_buf)	axq_q;		/* transmit queue */

==== //depot/projects/arm/src/sys/dev/isp/isp_freebsd.c#6 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.110 2006/02/15 00:31:48 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.111 2006/02/26 22:40:56 mjacob Exp $");
 
 #include <dev/isp/isp_freebsd.h>
 #include <sys/unistd.h>
@@ -351,6 +351,7 @@
 		ISP_LOCK(isp);
 		lp = &FCPARAM(isp)->portdb[ifc->loopid];
 		if (lp->valid) {
+			ifc->role = lp->roles;
 			ifc->loopid = lp->loopid;
 			ifc->portid = lp->portid;
 			ifc->node_wwn = lp->node_wwn;

==== //depot/projects/arm/src/sys/dev/kbdmux/kbdmux.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  * $Id: kbdmux.c,v 1.4 2005/07/14 17:38:35 max Exp $
- * $FreeBSD: src/sys/dev/kbdmux/kbdmux.c,v 1.3 2005/10/18 06:38:14 yar Exp $
+ * $FreeBSD: src/sys/dev/kbdmux/kbdmux.c,v 1.6 2006/02/27 21:47:38 emax Exp $
  */
 
 #include "opt_kbd.h"
@@ -246,11 +246,20 @@
 
 		KBDMUX_LOCK(state);
 
-		/* read all chars from the keyboard */
+		/*
+		 * Read all chars from the keyboard
+		 *
+		 * Turns out that atkbd(4) check_char() method may return
+		 * "true" while read_char() method returns NOKEY. If this
+		 * happens we could stuck in the loop below. Avoid this
+		 * by breaking out of the loop if read_char() method returns
+		 * NOKEY.
+		 */
+
 		while (KBDMUX_CHECK_CHAR(kbd)) {
 			c = KBDMUX_READ_CHAR(kbd, 0);
 			if (c == NOKEY)
-				continue;
+				break;
 			if (c == ERRKEY)
 				continue; /* XXX ring bell */
 			if (!KBD_IS_BUSY(kbd))
@@ -513,6 +522,10 @@
 	KBDMUX_LOCK_DESTROY(state);
 	bzero(state, sizeof(*state));
 	free(state, M_KBDMUX);
+
+	free(kbd->kb_keymap, M_KBDMUX);
+	free(kbd->kb_accentmap, M_KBDMUX);
+	free(kbd->kb_fkeytab, M_KBDMUX);
 	free(kbd, M_KBDMUX);
 
 	return (0);
@@ -1128,8 +1141,8 @@
 		break;
 
 	case PIO_KEYMAP:	/* set keyboard translation table */
-        case PIO_KEYMAPENT:	/* set keyboard translation table entry */
-        case PIO_DEADKEYMAP:	/* set accent key translation table */
+	case PIO_KEYMAPENT:	/* set keyboard translation table entry */
+	case PIO_DEADKEYMAP:	/* set accent key translation table */
 		KBDMUX_LOCK(state);
                 state->ks_accents = 0;
 

==== //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_type.h#6 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_type.h,v 1.9 2006/02/25 07:45:54 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_type.h,v 1.10 2006/02/26 22:50:14 mjacob Exp $ */
 /*
  * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors.
  * All rights reserved.
@@ -77,7 +77,13 @@
 typedef signed   short  S16;
 typedef unsigned short  U16;
 
+#ifdef	__FreeBSD__
 
+typedef int32_t  S32;
+typedef uint32_t U32;
+
+#else
+
 #if defined(unix) || defined(__arm) || defined(ALPHA) || defined(__PPC__) || defined(__ppc)
 
     typedef signed   int   S32;
@@ -89,6 +95,7 @@
     typedef unsigned long  U32;
 
 #endif
+#endif
 
 
 typedef struct _S64

==== //depot/projects/arm/src/sys/dev/mpt/mpt.c#5 (text+ko) ====

@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.16 2006/02/25 07:45:54 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.17 2006/02/26 07:44:31 mjacob Exp $");
 
 #include <dev/mpt/mpt.h>
 #include <dev/mpt/mpt_cam.h> /* XXX For static handler registration */
@@ -1308,9 +1308,6 @@
 	init.HeaderVersion = htole16(MPI_HEADER_VERSION);
 	init.ReplyFrameSize = htole16(MPT_REPLY_SIZE);
 	init.MsgContext = htole32(MPT_REPLY_HANDLER_HANDSHAKE);
-	if (mpt->ioc_facts_flags & MPI_IOCFACTS_FLAGS_REPLY_FIFO_HOST_SIGNAL) {
-		init.Flags |= MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL;
-	}
 
 	if ((error = mpt_send_handshake_cmd(mpt, sizeof init, &init)) != 0) {
 		return(error);
@@ -1886,7 +1883,8 @@
 
 	mpt_send_cmd(mpt, req);
 	error = mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE,
-	    /*sleep_ok*/FALSE, /*time_ms*/mpt->is_sas? 30000 : 3000);
+	    /*sleep_ok*/FALSE,
+	    /*time_ms*/(mpt->is_sas || mpt->is_fc)? 30000 : 3000);
 	if (error != 0) {
 		mpt_prt(mpt, "port enable timed out\n");
 		return (-1);

==== //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#6 (text+ko) ====

@@ -91,7 +91,7 @@
  * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.6 2006/02/25 07:45:54 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.8 2006/02/26 22:50:13 mjacob Exp $");
 
 #include <dev/mpt/mpt.h>
 #include <dev/mpt/mpt_cam.h>
@@ -974,7 +974,7 @@
 				if ((msg->Data[0] & 0xff) == 0xF7) {
 					printf("Device needs AL_PA\n");
 				} else {
-					printf("Device %02lx doesn't like "
+					printf("Device %02x doesn't like "
 					    "FC performance\n",
 					    msg->Data[0] & 0xFF);
 				}
@@ -985,14 +985,14 @@
 					    "receiver prior to acquiring "
 					    "AL_PA\n");
 				} else {
-					printf("Device %02lx detected loop "
+					printf("Device %02x detected loop "
 					    "failure at its receiver\n", 
 					    msg->Data[0] & 0xFF);
 				}
 				break;
 			default:
-				printf("Device %02lx requests that device "
-				    "%02lx reset itself\n", 
+				printf("Device %02x requests that device "
+				    "%02x reset itself\n", 
 				    msg->Data[0] & 0xFF,
 				    (msg->Data[0] >> 8) & 0xFF);
 				break;
@@ -2038,10 +2038,17 @@
 	int		    error;
 
 	MPT_LOCK(mpt);
+	if (TAILQ_EMPTY(&mpt->request_timeout_list) != 0) {
+		/*
+		 * No work to do- leave.
+		 */
+		mpt_prt(mpt, "mpt_recover_commands: no requests.\n");
+                MPT_UNLOCK(mpt);
+		return;
+	}
 
 	/*
-	 * Flush any commands whose completion coincides
-	 * with their timeout.
+	 * Flush any commands whose completion coincides with their timeout.
 	 */
 	mpt_intr(mpt);
 
@@ -2088,7 +2095,7 @@
 		}
 
 		error = mpt_wait_req(mpt, mpt->tmf_req, REQ_STATE_DONE,
-		    REQ_STATE_DONE, /*sleep_ok*/TRUE, /*time_ms*/5000);
+		    REQ_STATE_DONE, /*sleep_ok*/TRUE, /*time_ms*/500);
 
 		status = mpt->tmf_req->IOCStatus;
 		if (error != 0) {
@@ -2097,7 +2104,7 @@
 			 * If we've errored out and the transaction is still
 			 * pending, reset the controller.
 			 */
-			mpt_prt(mpt, "mpt_recover_commands: Abort timed-out."
+			mpt_prt(mpt, "mpt_recover_commands: Abort timed-out. "
 				"Resetting controller\n");
 			mpt_reset(mpt, /*reinit*/TRUE);
 			continue;

==== //depot/projects/arm/src/sys/dev/mpt/mpt_debug.c#6 (text+ko) ====

@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_debug.c,v 1.11 2006/02/25 07:45:54 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_debug.c,v 1.12 2006/02/26 22:50:13 mjacob Exp $");
 
 #include <dev/mpt/mpt.h>
 
@@ -353,10 +353,10 @@
 {
 	printf("%s Reply @ %p\n", mpt_ioc_function(msg->Function), msg);
 	printf("\tIOC Status    %s\n", mpt_ioc_status(msg->IOCStatus));
-	printf("\tIOCLogInfo    0x%08lx\n", msg->IOCLogInfo);
+	printf("\tIOCLogInfo    0x%08x\n", msg->IOCLogInfo);
 	printf("\tMsgLength     0x%02x\n", msg->MsgLength);
 	printf("\tMsgFlags      0x%02x\n", msg->MsgFlags);
-	printf("\tMsgContext    0x%08lx\n", msg->MsgContext);
+	printf("\tMsgContext    0x%08x\n", msg->MsgContext);
 }
 
 static void
@@ -379,18 +379,18 @@
 	printf("\tFlags         %d\n",		msg->Flags);
 	printf("\tReplyQueueDepth %d\n",	msg->ReplyQueueDepth);
 	printf("\tReqFrameSize  0x%04x\n",	msg->RequestFrameSize);
-	printf("\tFW Version    0x%08lx\n",	msg->FWVersion.Word);
+	printf("\tFW Version    0x%08x\n",	msg->FWVersion.Word);
 	printf("\tProduct ID    0x%04x\n",	msg->ProductID);
 	printf("\tCredits       0x%04x\n",	msg->GlobalCredits);
 	printf("\tPorts         %d\n",		msg->NumberOfPorts);
 	printf("\tEventState    0x%02x\n",	msg->EventState);
-	printf("\tHostMFA_HA    0x%08lx\n",	msg->CurrentHostMfaHighAddr);
-	printf("\tSenseBuf_HA   0x%08lx\n",
+	printf("\tHostMFA_HA    0x%08x\n",	msg->CurrentHostMfaHighAddr);
+	printf("\tSenseBuf_HA   0x%08x\n",
 	    msg->CurrentSenseBufferHighAddr);
 	printf("\tRepFrameSize  0x%04x\n",	msg->CurReplyFrameSize);
 	printf("\tMaxDevices    0x%02x\n",	msg->MaxDevices);
 	printf("\tMaxBuses      0x%02x\n",	msg->MaxBuses);
-	printf("\tFWImageSize   0x%04lx\n",	msg->FWImageSize);
+	printf("\tFWImageSize   0x%04x\n",	msg->FWImageSize);
 }
 
 static void
@@ -409,9 +409,9 @@
 	printf("\tCDBLength     %d\n", msg->CDBLength);
 	printf("\tSCSI Status:  %s\n", mpt_scsi_status(msg->SCSIStatus));
 	printf("\tSCSI State:   %s\n", mpt_scsi_state(msg->SCSIState));
-	printf("\tTransferCnt   0x%04lx\n", msg->TransferCount);
-	printf("\tSenseCnt      0x%04lx\n", msg->SenseCount);
-	printf("\tResponseInfo  0x%08lx\n", msg->ResponseInfo);
+	printf("\tTransferCnt   0x%04x\n", msg->TransferCount);
+	printf("\tSenseCnt      0x%04x\n", msg->SenseCount);
+	printf("\tResponseInfo  0x%08x\n", msg->ResponseInfo);
 }
 
 
@@ -421,41 +421,51 @@
 {
 	mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg);
 	printf("\tEvent:        %s\n", mpt_ioc_event(msg->Event));
-	printf("\tEventContext  0x%04lx\n", msg->EventContext);
+	printf("\tEventContext  0x%04x\n", msg->EventContext);
 	printf("\tAckRequired     %d\n", msg->AckRequired);
 	printf("\tEventDataLength %d\n", msg->EventDataLength);
 	printf("\tContinuation    %d\n", msg->MsgFlags & 0x80);
 	switch(msg->Event) {
 	case MPI_EVENT_LOG_DATA:
-		printf("\tEvtLogData:   0x%04lx\n", msg->Data[0]);
+		printf("\tEvtLogData:   0x%04x\n", msg->Data[0]);
 		break;
 
 	case MPI_EVENT_UNIT_ATTENTION:
-		printf("\tTargetID:     0x%04lx\n", msg->Data[0] & 0xff);
-		printf("\tBus:          0x%04lx\n", (msg->Data[0] >> 8) & 0xff);
+		printf("\tTargetID:     0x%04x\n",
+			msg->Data[0] & 0xff);
+		printf("\tBus:          0x%04x\n",
+			(msg->Data[0] >> 8) & 0xff);
 		break;
 
 	case MPI_EVENT_IOC_BUS_RESET:
 	case MPI_EVENT_EXT_BUS_RESET:
 	case MPI_EVENT_RESCAN:
-		printf("\tPort:           %ld\n", (msg->Data[0] >> 8) & 0xff);
+		printf("\tPort:           %d\n",
+			(msg->Data[0] >> 8) & 0xff);
 		break;
 
 	case MPI_EVENT_LINK_STATUS_CHANGE:
-		printf("\tLinkState:    %ld\n", msg->Data[0] & 0xff);
-		printf("\tPort:         %ld\n", (msg->Data[1] >> 8) & 0xff);
+		printf("\tLinkState:    %d\n",
+			msg->Data[0] & 0xff);
+		printf("\tPort:         %d\n",
+			(msg->Data[1] >> 8) & 0xff);
 		break;
 
 	case MPI_EVENT_LOOP_STATE_CHANGE:
-		printf("\tType:         %ld\n", (msg->Data[0] >> 16) & 0xff);
-		printf("\tChar3:      0x%02lx\n", (msg->Data[0] >> 8) & 0xff);
-		printf("\tChar4:      0x%02lx\n", (msg->Data[0]     ) & 0xff);
-		printf("\tPort:         %ld\n", (msg->Data[1] >> 8) & 0xff);
+		printf("\tType:         %d\n",
+			(msg->Data[0] >> 16) & 0xff);
+		printf("\tChar3:      0x%02x\n",
+			(msg->Data[0] >> 8) & 0xff);
+		printf("\tChar4:      0x%02x\n",
+			(msg->Data[0]     ) & 0xff);
+		printf("\tPort:         %d\n",
+			(msg->Data[1] >> 8) & 0xff);
 		break;
 
 	case MPI_EVENT_LOGOUT:
-		printf("\tN_PortId:   0x%04lx\n", msg->Data[0]);
-		printf("\tPort:         %ld\n", (msg->Data[1] >> 8) & 0xff);
+		printf("\tN_PortId:   0x%04x\n", msg->Data[0]);
+		printf("\tPort:         %d\n",
+			(msg->Data[1] >> 8) & 0xff);
 		break;
 	}
 
@@ -497,7 +507,7 @@
 	printf("%s @ %p\n", mpt_ioc_function(req->Function), req);
 	printf("\tChain Offset  0x%02x\n", req->ChainOffset);
 	printf("\tMsgFlags      0x%02x\n", req->MsgFlags);
-	printf("\tMsgContext    0x%08lx\n", req->MsgContext);
+	printf("\tMsgContext    0x%08x\n", req->MsgContext);
 }
 
 void
@@ -512,7 +522,7 @@
 	printf("\tTargetID            %d\n", msg->TargetID);
 	printf("\tSenseBufferLength   %d\n", msg->SenseBufferLength);
 	printf("\tLUN:              0x%0x\n", msg->LUN[1]);
-	printf("\tControl           0x%08lx ", msg->Control);
+	printf("\tControl           0x%08x ", msg->Control);
 #define MPI_PRINT_FIELD(x)						\
 	case MPI_SCSIIO_CONTROL_ ## x :					\
 		printf(" " #x " ");					\
@@ -541,8 +551,8 @@
 	printf("\n");
 #undef MPI_PRINT_FIELD
 
-	printf("\tDataLength\t0x%08lx\n", msg->DataLength);
-	printf("\tSenseBufAddr\t0x%08lx\n", msg->SenseBufferLowAddr);
+	printf("\tDataLength\t0x%08x\n", msg->DataLength);
+	printf("\tSenseBufAddr\t0x%08x\n", msg->SenseBufferLowAddr);
 	printf("\tCDB[0:%d]\t", msg->CDBLength);
 	for (i = 0; i < msg->CDBLength; i++)
 		printf("%02x ", msg->CDB[i]);
@@ -561,7 +571,7 @@
 	mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg);
 	printf("\tLun             0x%02x\n", msg->LUN[1]);
 	printf("\tTaskType        %s\n", mpt_scsi_tm_type(msg->TaskType));
-	printf("\tTaskMsgContext  0x%08lx\n", msg->TaskMsgContext);
+	printf("\tTaskMsgContext  0x%08x\n", msg->TaskMsgContext);
 }
 
 void
@@ -686,12 +696,12 @@
 		case MPI_SGE_FLAGS_SIMPLE_ELEMENT:
 			if (flags & MPI_SGE_FLAGS_64_BIT_ADDRESSING) {
 				SGE_SIMPLE64 *se64 = (SGE_SIMPLE64 *)se;
-				printf("SE64 %p: Addr=0x%08lx%08lx FlagsLength"
-				    "=0x%lx\n", se64, se64->Address.High,
+				printf("SE64 %p: Addr=0x%08x%08x FlagsLength"
+				    "=0x%0x\n", se64, se64->Address.High,
 				    se64->Address.Low, se64->FlagsLength);
 				nxtaddr = se64 + 1;
 			} else {
-				printf("SE32 %p: Addr=0x%08lx FlagsLength=0x%lx"
+				printf("SE32 %p: Addr=0x%0x FlagsLength=0x%0x"
 	                            "\n", se, se->Address, se->FlagsLength);
 			}
 			printf(" ");
@@ -699,16 +709,16 @@
 		case MPI_SGE_FLAGS_CHAIN_ELEMENT:
 			if (flags & MPI_SGE_FLAGS_64_BIT_ADDRESSING) {
 				SGE_CHAIN64 *ce64 = (SGE_CHAIN64 *) se;
-				printf("CE64 %p: Addr=0x%08lx%08lx NxtChnO="
-				    "0x%x Flgs=0x%x Len=0x%x\n", ce64,
+				printf("CE64 %p: Addr=0x%08x%08x NxtChnO=0x%x "
+				    "Flgs=0x%x Len=0x%0x\n", ce64,
 				    ce64->Address.High, ce64->Address.Low,
 				    ce64->NextChainOffset,
 				    ce64->Flags, ce64->Length);
 				nxtaddr = ce64 + 1;
 			} else {
 				SGE_CHAIN32 *ce = (SGE_CHAIN32 *) se;
-				printf("CE32 %p: Addr=0x%08lx NxtChnO=0x%x "
-				    " Flgs=0x%x Len=0x%x\n", ce, ce->Address,
+				printf("CE32 %p: Addr=0x%0x NxtChnO=0x%x "
+				    " Flgs=0x%x Len=0x%0x\n", ce, ce->Address,
 				    ce->NextChainOffset, ce->Flags, ce->Length);
 			}
 			flags = 0;

==== //depot/projects/arm/src/sys/dev/usb/ehci.c#6 (text+ko) ====

@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.40 2006/01/16 19:23:59 ariff Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.41 2006/02/26 02:57:57 iedowse Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1390,7 +1390,7 @@
 	if (sc->sc_dying)
 		return (USBD_IOERROR);
 
-	epipe->nexttoggle = 0;
+	epipe->nexttoggle = pipe->endpoint->savedtoggle;
 
 	if (addr == sc->sc_addr) {
 		switch (ed->bEndpointAddress) {
@@ -2479,6 +2479,8 @@
 	ehci_rem_qh(sc, sqh, head);
 	splx(s);
 	ehci_free_sqh(sc, epipe->sqh);
+
+	pipe->endpoint->savedtoggle = epipe->nexttoggle;
 }
 
 /*

==== //depot/projects/arm/src/sys/dev/usb/ohci.c#9 (text+ko) ====

@@ -13,7 +13,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ohci.c,v 1.157 2006/02/11 03:29:02 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ohci.c,v 1.159 2006/02/26 02:57:57 iedowse Exp $");
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -2161,7 +2161,9 @@
 			(dev->speed == USB_SPEED_LOW ? OHCI_ED_SPEED : 0) |
 			fmt |
 			OHCI_ED_SET_MAXP(UGETW(ed->wMaxPacketSize)));
-		sed->ed.ed_headp = sed->ed.ed_tailp = htole32(tdphys);
+		sed->ed.ed_headp = htole32(tdphys |
+		    (pipe->endpoint->savedtoggle ? OHCI_TOGGLECARRY : 0));
+		sed->ed.ed_tailp = htole32(tdphys);
 
 		switch (xfertype) {
 		case UE_CONTROL:
@@ -2247,6 +2249,8 @@
 	/* Make sure the host controller is not touching this ED */
 	usb_delay_ms(&sc->sc_bus, 1);
 	splx(s);
+	pipe->endpoint->savedtoggle =
+	    (le32toh(sed->ed.ed_headp) & OHCI_TOGGLECARRY) ? 1 : 0;
 	ohci_free_sed(sc, opipe->sed);
 }
 
@@ -3049,6 +3053,9 @@
 
 	splx(s);
 
+	if (sc->sc_bus.use_polling)
+		ohci_waitintr(sc, xfer);
+
 	return (USBD_IN_PROGRESS);
 }
 

==== //depot/projects/arm/src/sys/dev/usb/uhci.c#4 (text+ko) ====

@@ -11,7 +11,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/uhci.c,v 1.163 2006/01/15 20:41:04 iedowse Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/uhci.c,v 1.164 2006/02/26 02:57:57 iedowse Exp $");

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



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