Date: Sat, 25 Feb 2006 17:19:33 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92381 for review Message-ID: <200602251719.k1PHJX7A016980@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92381 Change 92381 by imp@imp_harmony on 2006/02/25 17:18:54 IFC @92379 Affected files ... .. //depot/projects/arm/src/sys/conf/kmod.mk#8 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_linux.c#2 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-all.h#9 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#14 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/arm/src/sys/dev/ath/if_ath.c#7 integrate .. //depot/projects/arm/src/sys/dev/ath/if_athvar.h#6 integrate .. //depot/projects/arm/src/sys/dev/fdc/fdc.c#4 integrate .. //depot/projects/arm/src/sys/dev/ic/z8530.h#2 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi.h#4 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_cnfg.h#4 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_ioc.h#4 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_sas.h#2 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_type.h#5 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt.c#4 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt.h#5 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#5 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_cam.h#2 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_debug.c#5 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_pci.c#5 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_reg.h#2 integrate .. //depot/projects/arm/src/sys/dev/puc/puc_ebus.c#3 integrate .. //depot/projects/arm/src/sys/dev/puc/puc_sbus.c#3 integrate .. //depot/projects/arm/src/sys/dev/sound/pci/atiixp.c#5 integrate .. //depot/projects/arm/src/sys/dev/sound/pcm/feeder.c#5 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_bus.h#3 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_bus_ebus.c#4 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_core.c#6 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_dev_ns8250.c#2 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_dev_sab82532.c#2 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_dev_z8530.c#3 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_kbd_sun.c#3 integrate .. //depot/projects/arm/src/sys/dev/uart/uart_tty.c#4 integrate .. //depot/projects/arm/src/sys/i386/cpufreq/est.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_timeout.c#3 integrate .. //depot/projects/arm/src/sys/kern/subr_prf.c#3 integrate .. //depot/projects/arm/src/sys/modules/if_ef/Makefile#3 integrate .. //depot/projects/arm/src/sys/modules/uart/Makefile#2 integrate .. //depot/projects/arm/src/sys/net/if_vlan.c#8 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_output.c#6 integrate .. //depot/projects/arm/src/sys/netinet/tcp_input.c#7 integrate .. //depot/projects/arm/src/sys/netinet/tcp_output.c#4 integrate .. //depot/projects/arm/src/sys/sys/serial.h#2 integrate Differences ... ==== //depot/projects/arm/src/sys/conf/kmod.mk#8 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.205 2006/02/20 01:08:33 mlaier Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.206 2006/02/24 01:49:36 marcel Exp $ # # The include file <bsd.kmod.mk> handles building and installing loadable # kernel modules. @@ -320,7 +320,7 @@ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ - dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m dev/uart/uart_if.m \ + dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ dev/usb/usb_if.m isa/isa_if.m \ kern/bus_if.m kern/cpufreq_if.m kern/device_if.m \ libkern/iconv_converter_if.m opencrypto/crypto_if.m \ ==== //depot/projects/arm/src/sys/dev/amr/amr_linux.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_linux.c,v 1.1 2006/01/24 21:13:49 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_linux.c,v 1.2 2006/02/23 18:05:38 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -170,13 +170,15 @@ devclass_t devclass; struct amr_softc *sc; struct amr_linux_ioctl ali; - int adapter; + int adapter, error; devclass = devclass_find("amr"); if (devclass == NULL) return (ENOENT); - copyin((caddr_t)args->arg, &ali, sizeof(ali)); + error = copyin((caddr_t)args->arg, &ali, sizeof(ali)); + if (error) + return (error); if (ali.ui.fcs.opcode == 0x82) adapter = 0; else ==== //depot/projects/arm/src/sys/dev/ata/ata-all.h#9 (text+ko) ==== @@ -23,7 +23,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-all.h,v 1.113 2006/02/09 20:54:42 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.114 2006/02/23 20:15:22 sos Exp $ */ /* ATA register defines */ @@ -338,6 +338,7 @@ /* structure used to queue an ATA/ATAPI request */ struct ata_request { device_t dev; /* device handle */ + device_t parent; /* channel handle */ union { struct { u_int8_t command; /* command reg */ ==== //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.159 2006/02/16 17:09:24 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.160 2006/02/23 18:52:15 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -4075,7 +4075,6 @@ /* setup the usual register normal pci style */ if (ata_pci_allocate(dev)) return ENXIO; - ata_pci_allocate(dev); if (ctlr->chip->cfg2 & SIIINTR) ch->hw.status = ata_cmd_status; ==== //depot/projects/arm/src/sys/dev/ata/ata-queue.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.55 2006/01/18 13:10:17 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.56 2006/02/23 20:15:22 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -55,6 +55,7 @@ /* mark request as virgin (this might be a ATA_R_REQUEUE) */ request->result = request->status = request->error = 0; + request->parent = device_get_parent(request->dev); callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); if (!request->callback && !(request->flags & ATA_R_REQUEUE)) @@ -218,7 +219,7 @@ void ata_finish(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); /* * if in ATA_STALL_QUEUE state or request has ATA_R_DIRECT flags set @@ -247,7 +248,7 @@ ata_completed(void *context, int dummy) { struct ata_request *request = (struct ata_request *)context; - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); struct ata_composite *composite; @@ -466,7 +467,7 @@ void ata_timeout(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); //request->flags |= ATA_R_DEBUG; ATA_DEBUG_RQ(request, "timeout"); @@ -479,7 +480,6 @@ */ if (ch->state == ATA_ACTIVE) { request->flags |= ATA_R_TIMEOUT; - ch->running = NULL; mtx_unlock(&ch->state_mtx); ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); @@ -493,34 +493,43 @@ ata_fail_requests(device_t dev) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_request *request; + struct ata_request *request, *tmp; + TAILQ_HEAD(, ata_request) fail_requests; + TAILQ_INIT(&fail_requests); - /* do we have any outstanding request to care about ?*/ + /* grap all channel locks to avoid races */ + mtx_lock(&ch->queue_mtx); mtx_lock(&ch->state_mtx); + + /* do we have any running request to care about ? */ if ((request = ch->running) && (!dev || request->dev == dev)) { callout_stop(&request->callout); ch->running = NULL; - } - else - request = NULL; - mtx_unlock(&ch->state_mtx); - if (request) { + ch->state = ATA_IDLE; request->result = ENXIO; - ata_finish(request); + TAILQ_INSERT_TAIL(&fail_requests, request, chain); } /* fail all requests queued on this channel for device dev if !NULL */ - mtx_lock(&ch->queue_mtx); - while ((request = TAILQ_FIRST(&ch->ata_queue))) { + TAILQ_FOREACH_SAFE(request, &ch->ata_queue, chain, tmp) { if (!dev || request->dev == dev) { TAILQ_REMOVE(&ch->ata_queue, request, chain); - mtx_unlock(&ch->queue_mtx); request->result = ENXIO; - ata_finish(request); - mtx_lock(&ch->queue_mtx); + TAILQ_INSERT_TAIL(&fail_requests, request, chain); } } + + mtx_unlock(&ch->state_mtx); mtx_unlock(&ch->queue_mtx); + + /* finish up all requests collected above */ + TAILQ_FOREACH_SAFE(request, &fail_requests, chain, tmp) { + 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#7 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.135 2006/02/15 18:36:52 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.136 2006/02/24 23:10:08 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -1155,12 +1155,16 @@ */ ATH_TXBUF_LOCK(sc); bf = STAILQ_FIRST(&sc->sc_txbuf); - if (bf != NULL) - STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); + if (bf != NULL) { + if (bf->bf_flags & ATH_FLAG_BUSY) + bf = NULL; + else + STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); + } ATH_TXBUF_UNLOCK(sc); if (bf == NULL) { - DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of xmit buffers\n", - __func__); + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: no available xmit buffers\n", __func__); sc->sc_stats.ast_tx_qstop++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -1181,14 +1185,14 @@ ieee80211_state_name[ic->ic_state]); sc->sc_stats.ast_tx_discard++; ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + STAILQ_INSERT_HEAD(&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_TAIL(&sc->sc_txbuf, bf, bf_list); + STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); break; } @@ -1275,7 +1279,7 @@ ifp->if_oerrors++; reclaim: ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); if (ni != NULL) ieee80211_free_node(ni); @@ -2411,7 +2415,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 rx buffers */ + /* allocate buffers */ bsize = sizeof(struct ath_buf) * nbuf; bf = malloc(bsize, M_ATHDEV, M_NOWAIT | M_ZERO); if (bf == NULL) { @@ -3687,7 +3691,7 @@ , ctsrate /* rts/cts rate */ , ctsduration /* rts/cts duration */ ); - bf->bf_flags = flags; + bf->bf_txflags = flags; /* * Setup the multi-rate retry state only when we're * going to use it. This assumes ath_hal_setuptxdesc @@ -3758,7 +3762,7 @@ { struct ath_hal *ah = sc->sc_ah; struct ieee80211com *ic = &sc->sc_ic; - struct ath_buf *bf; + struct ath_buf *bf, *last; struct ath_desc *ds, *ds0; struct ieee80211_node *ni; struct ath_node *an; @@ -3790,7 +3794,14 @@ break; } ATH_TXQ_REMOVE_HEAD(txq, bf_list); - if (txq->axq_depth == 0) + 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 txq->axq_link = NULL; ATH_TXQ_UNLOCK(txq); @@ -3827,7 +3838,7 @@ * Hand the descriptor to the rate control algorithm. */ if ((ds->ds_txstat.ts_status & HAL_TXERR_FILT) == 0 && - (bf->bf_flags & HAL_TXDESC_NOACK) == 0) { + (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) { /* * If frame was ack'd update the last rx time * used to workaround phantom bmiss interrupts. @@ -3853,6 +3864,9 @@ 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); } @@ -3968,17 +3982,18 @@ /* * NB: this assumes output has been stopped and - * we do not need to block ath_tx_tasklet + * we do not need to block ath_tx_proc */ 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) @@ -3996,10 +4011,16 @@ */ 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 @@ -4877,10 +4898,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:04%x%s\n" + printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%x TF:%04x%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, + ds->ds_link, ds->ds_data, bf->bf_flags, bf->bf_txflags, !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#6 (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.45 2006/02/15 18:23:03 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.46 2006/02/24 23:10:08 sam Exp $ */ /* @@ -100,7 +100,8 @@ struct ath_buf { STAILQ_ENTRY(ath_buf) bf_list; int bf_nseg; - int bf_flags; /* tx descriptor flags */ + u_int16_t bf_txflags; /* tx descriptor flags */ + u_int16_t bf_flags; /* see below */ 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 */ @@ -112,6 +113,8 @@ }; typedef STAILQ_HEAD(, ath_buf) ath_bufhead; +#define ATH_FLAG_BUSY 0x0001 /* tx descriptor owned by h/w */ + /* * DMA state for tx/rx descriptors. */ @@ -137,7 +140,7 @@ */ struct ath_txq { u_int axq_qnum; /* hardware q number */ - u_int axq_depth; /* queue depth (stat only) */ + 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/fdc/fdc.c#4 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.308 2005/08/30 23:12:18 rodrigc Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.309 2006/02/23 19:11:16 jhb Exp $"); #include "opt_fdc.h" @@ -250,7 +250,6 @@ #define FD_NO_TRACK -2 int options; /* FDOPT_* */ struct callout toffhandle; - struct callout tohandle; struct g_geom *fd_geom; struct g_provider *fd_provider; device_t dev; @@ -617,7 +616,7 @@ int once; fd = arg; - mtx_lock(&fd->fdc->fdc_mtx); + mtx_assert(&fd->fdc->fdc_mtx, MA_OWNED); fd->flags &= ~FD_MOTORWAIT; fd->flags |= FD_MOTOR; once = 0; @@ -628,7 +627,6 @@ bioq_disksort(&fd->fdc->head, bp); once = 1; } - mtx_unlock(&fd->fdc->fdc_mtx); if (once) wakeup(&fd->fdc->head); } @@ -647,7 +645,7 @@ fdc->fdout |= (FDO_MOEN0 << fd->fdsu); callout_reset(&fd->toffhandle, hz, fd_turnon, fd); } else { - callout_drain(&fd->toffhandle); + callout_stop(&fd->toffhandle); fd->flags &= ~(FD_MOTOR|FD_MOTORWAIT); fdc->fdout &= ~(FDO_MOEN0 << fd->fdsu); } @@ -659,9 +657,8 @@ { struct fd_data *fd = xfd; - mtx_lock(&fd->fdc->fdc_mtx); + mtx_assert(&fd->fdc->fdc_mtx, MA_OWNED); fd_motor(fd, 0); - mtx_unlock(&fd->fdc->fdc_mtx); } /* @@ -1199,7 +1196,7 @@ mtx_lock(&fdc->fdc_mtx); /* If we go from idle, cancel motor turnoff */ if (fd->fd_iocount++ == 0) - callout_drain(&fd->toffhandle); + callout_stop(&fd->toffhandle); if (fd->flags & FD_MOTOR) { /* The motor is on, send it directly to the controller */ bioq_disksort(&fdc->head, bp); @@ -1939,8 +1936,7 @@ fd->fdc = fdc; fd->fdsu = fdsu; fd->options = 0; - callout_init(&fd->toffhandle, 1); - callout_init(&fd->tohandle, 1); + callout_init_mtx(&fd->toffhandle, &fd->fdc->fdc_mtx, 0); /* initialize densities for subdevices */ fdsettype(fd, fd_native_types[fd->type]); ==== //depot/projects/arm/src/sys/dev/ic/z8530.h#2 (text+ko) ==== @@ -23,7 +23,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/ic/z8530.h,v 1.3 2005/01/06 01:42:44 imp Exp $ + * $FreeBSD: src/sys/dev/ic/z8530.h,v 1.4 2006/02/24 02:03:35 marcel Exp $ */ #ifndef _DEV_IC_Z8530_H_ @@ -34,9 +34,12 @@ * Channel B data: 1 * Channel A control: 2 * Channel A data: 3 - * - * We expect a seperate subregion for each channel. */ + +/* The following apply when using a device-scoped bus handle */ +#define CHAN_A 2 +#define CHAN_B 0 + #define REG_CTRL 0 #define REG_DATA 1 @@ -69,7 +72,7 @@ #define RR_BCL 6 /* Byte Count Low. */ #define RR_BCH 7 /* Byte Count High. */ #define RR_RB 8 /* Receive Buffer. */ -#define RR_RPC 9 /* Receive Parameters and Contro. */ +#define RR_RPC 9 /* Receive Parameters and Control. */ #define RR_MSB 10 /* Miscellaneous Status Bits. */ #define RR_MCB1 11 /* Miscellaneous Control Bits (part 1). */ #define RR_TCL 12 /* BRG Time Constant Low. */ ==== //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi.h,v 1.7 2006/01/21 00:29:51 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi.h,v 1.8 2006/02/25 07:45:54 mjacob Exp $ */ /*- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. * All rights reserved. @@ -33,7 +33,7 @@ * Title: MPI Message independent structures and definitions * Creation Date: July 27, 2000 * - * mpi.h Version: 01.05.09 + * mpi.h Version: 01.05.10 * * Version History * --------------- @@ -102,6 +102,7 @@ * TargetAssistExtended requests. * Added EEDP IOCStatus codes. * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. + * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. * -------------------------------------------------------------------------- */ @@ -132,7 +133,7 @@ /* Note: The major versions of 0xe0 through 0xff are reserved */ /* versioning for this MPI header set */ -#define MPI_HEADER_VERSION_UNIT (0x0B) +#define MPI_HEADER_VERSION_UNIT (0x0C) #define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_SHIFT (8) @@ -739,6 +740,8 @@ #define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D) #define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E) #define MPI_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F) +#define MPI_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT (0x0070) +#define MPI_IOCSTATUS_TARGET_NAK_RECEIVED (0x0071) /****************************************************************************/ /* Additional FCP target values (obsolete) */ ==== //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_cnfg.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_cnfg.h,v 1.7 2006/01/21 00:29:51 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_cnfg.h,v 1.8 2006/02/25 07:45:54 mjacob Exp $ */ /*- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. * All rights reserved. @@ -33,7 +33,7 @@ * Title: MPI Config message, structures, and Pages * Creation Date: July 27, 2000 * - * mpi_cnfg.h Version: 01.05.10 + * mpi_cnfg.h Version: 01.05.11 * * Version History * --------------- @@ -285,6 +285,14 @@ * Added EnclosureHandle field to SAS Expander page 0. * Removed redundant NumTableEntriesProg field from SAS * Expander Page 1. + * 08-30-05 01.05.11 Added DeviceID for FC949E and changed the DeviceID for + * SAS1078. + * Added more defines for Manufacturing Page 4 Flags field. + * Added more defines for IOCSettings and added + * ExpanderSpinup field to Bios Page 1. + * Added postpone SATA Init bit to SAS IO Unit Page 1 + * ControlFlags. + * Changed LogEntry format for Log Page 0. * -------------------------------------------------------------------------- */ @@ -530,7 +538,7 @@ #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) #define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642) #define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640) -#define MPI_MANUFACTPAGE_DEVICEID_FC949ES (0x0646) +#define MPI_MANUFACTPAGE_DEVICEID_FC949E (0x0646) /* SCSI */ #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) @@ -546,7 +554,7 @@ #define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A) #define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054) #define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058) -#define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0060) +#define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0062) typedef struct _CONFIG_PAGE_MANUFACTURING_0 @@ -650,9 +658,14 @@ } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; -#define MPI_MANUFACTURING4_PAGEVERSION (0x02) +#define MPI_MANUFACTURING4_PAGEVERSION (0x03) /* defines for the Flags field */ +#define MPI_MANPAGE4_IME_DISABLE (0x20) +#define MPI_MANPAGE4_IM_DISABLE (0x10) +#define MPI_MANPAGE4_IS_DISABLE (0x08) +#define MPI_MANPAGE4_IR_MODEPAGE8_DISABLE (0x04) +#define MPI_MANPAGE4_IM_RESYNC_CACHE_ENABLE (0x02) #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) @@ -1002,7 +1015,8 @@ U32 Reserved1; /* 0Ch */ U32 DeviceSettings; /* 10h */ U16 NumberOfDevices; /* 14h */ - U16 Reserved2; /* 16h */ + U8 ExpanderSpinup; /* 16h */ + U8 Reserved2; /* 17h */ U16 IOTimeoutBlockDevicesNonRM; /* 18h */ U16 IOTimeoutSequential; /* 1Ah */ U16 IOTimeoutOther; /* 1Ch */ @@ -1010,7 +1024,7 @@ } CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, BIOSPage1_t, MPI_POINTER pBIOSPage1_t; -#define MPI_BIOSPAGE1_PAGEVERSION (0x02) +#define MPI_BIOSPAGE1_PAGEVERSION (0x03) /* values for the BiosOptions field */ #define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) @@ -1019,8 +1033,15 @@ #define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) /* values for the IOCSettings field */ +#define MPI_BIOSPAGE1_IOCSET_MASK_INITIAL_SPINUP_DELAY (0x0F000000) +#define MPI_BIOSPAGE1_IOCSET_SHIFT_INITIAL_SPINUP_DELAY (24) + #define MPI_BIOSPAGE1_IOCSET_MASK_PORT_ENABLE_DELAY (0x00F00000) #define MPI_BIOSPAGE1_IOCSET_SHIFT_PORT_ENABLE_DELAY (20) + +#define MPI_BIOSPAGE1_IOCSET_AUTO_PORT_ENABLE (0x00080000) +#define MPI_BIOSPAGE1_IOCSET_DIRECT_ATTACH_SPINUP_MODE (0x00040000) + #define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) #define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000) #define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000) @@ -1050,6 +1071,11 @@ #define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) #define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001) +/* defines for the ExpanderSpinup field */ +#define MPI_BIOSPAGE1_EXPSPINUP_MASK_MAX_TARGET (0xF0) +#define MPI_BIOSPAGE1_EXPSPINUP_SHIFT_MAX_TARGET (4) +#define MPI_BIOSPAGE1_EXPSPINUP_MASK_DELAY (0x0F) + typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER { U32 Reserved1; /* 00h */ @@ -1267,13 +1293,13 @@ #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD (8) #define MPI_SCSIPORTPAGE0_CAP_GET_MIN_SYNC_PERIOD(Cap) \ - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MIN_SYNC_PERIOD) \ + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK) \ >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD \ ) #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET (16) #define MPI_SCSIPORTPAGE0_CAP_GET_MAX_SYNC_OFFSET(Cap) \ - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \ + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK) \ >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ ) #define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000) @@ -2404,7 +2430,7 @@ } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; -#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x04) +#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x05) /* values for SAS IO Unit Page 1 ControlFlags */ #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000) @@ -2419,6 +2445,7 @@ #define MPI_SAS_IOUNIT1_CONTROL_DEV_SAS_SUPPORT (0x01) #define MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT (0x02) +#define MPI_SAS_IOUNIT1_CONTROL_POSTPONE_SATA_INIT (0x0100) #define MPI_SAS_IOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED (0x0080) #define MPI_SAS_IOUNIT1_CONTROL_SATA_SMART_REQUIRED (0x0040) #define MPI_SAS_IOUNIT1_CONTROL_SATA_NCQ_REQUIRED (0x0020) @@ -2803,16 +2830,15 @@ #define MPI_LOG_0_NUM_LOG_ENTRIES (1) #endif -#define MPI_LOG_0_LOG_DATA_LENGTH (20) +#define MPI_LOG_0_LOG_DATA_LENGTH (0x1C) typedef struct _MPI_LOG_0_ENTRY { - U64 WWID; /* 00h */ - U32 TimeStamp; /* 08h */ - U32 Reserved1; /* 0Ch */ - U16 LogSequence; /* 10h */ - U16 LogEntryQualifier; /* 12h */ - U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 14h */ + U32 TimeStamp; /* 00h */ + U32 Reserved1; /* 04h */ + U16 LogSequence; /* 08h */ + U16 LogEntryQualifier; /* 0Ah */ + U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 0Ch */ } MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY, MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t; @@ -2831,7 +2857,7 @@ } CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0, LogPage0_t, MPI_POINTER pLogPage0_t; -#define MPI_LOG_0_PAGEVERSION (0x00) +#define MPI_LOG_0_PAGEVERSION (0x01) #endif ==== //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_ioc.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_ioc.h,v 1.7 2006/01/21 00:29:51 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_ioc.h,v 1.8 2006/02/25 07:45:54 mjacob Exp $ */ /*- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. * All rights reserved. @@ -34,7 +34,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.09 + * mpi_ioc.h Version: 01.05.10 * * Version History * --------------- @@ -111,6 +111,10 @@ * Removed IOCFacts Reply EEDP Capability bit. * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. * Added Max SATA Targets to SAS Discovery Error event. + * 08-30-05 01.05.10 Added 4 new events and their event data structures. + * Added new ReasonCode value for SAS Device Status Change + * event. + * Added new family code for FC949E. * -------------------------------------------------------------------------- */ @@ -492,6 +496,10 @@ #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) #define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) +#define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) +#define MPI_EVENT_IR2 (0x00000015) +#define MPI_EVENT_SAS_DISCOVERY (0x00000016) +#define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021) /* AckRequired field values */ @@ -508,6 +516,29 @@ } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE, EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t; +/* LogEntryAdded Event data */ + +/* this structure matches MPI_LOG_0_ENTRY in mpi_cnfg.h */ +#define MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH (0x1C) +typedef struct _EVENT_DATA_LOG_ENTRY +{ + U32 TimeStamp; /* 00h */ + U32 Reserved1; /* 04h */ + U16 LogSequence; /* 08h */ + U16 LogEntryQualifier; /* 0Ah */ + U8 LogData[MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH]; /* 0Ch */ +} EVENT_DATA_LOG_ENTRY, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY, + MpiEventDataLogEntry_t, MPI_POINTER pMpiEventDataLogEntry_t; + +typedef struct _EVENT_DATA_LOG_ENTRY_ADDED +{ + U16 LogSequence; /* 00h */ + U16 Reserved1; /* 02h */ + U32 Reserved2; /* 04h */ + EVENT_DATA_LOG_ENTRY LogEntry; /* 08h */ +} EVENT_DATA_LOG_ENTRY_ADDED, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY_ADDED, + MpiEventDataLogEntryAdded_t, MPI_POINTER pMpiEventDataLogEntryAdded_t; + /* SCSI Event data for Port, Bus and Device forms */ typedef struct _EVENT_DATA_SCSI @@ -566,6 +597,7 @@ #define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) #define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) #define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) +#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) /* SCSI Event data for Queue Full event */ @@ -607,6 +639,79 @@ #define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) #define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) + +/* MPI Integrated RAID Resync Update Event data */ + +typedef struct _MPI_EVENT_DATA_IR_RESYNC_UPDATE +{ + U8 VolumeID; /* 00h */ + U8 VolumeBus; /* 01h */ + U8 ResyncComplete; /* 02h */ + U8 Reserved1; /* 03h */ + U32 Reserved2; /* 04h */ +} MPI_EVENT_DATA_IR_RESYNC_UPDATE, + MPI_POINTER PTR_MPI_EVENT_DATA_IR_RESYNC_UPDATE, + MpiEventDataIrResyncUpdate_t, MPI_POINTER pMpiEventDataIrResyncUpdate_t; + +/* MPI IR2 Event data */ + +/* MPI_LD_STATE or MPI_PD_STATE */ +typedef struct _IR2_STATE_CHANGED +{ + U16 PreviousState; /* 00h */ + U16 NewState; /* 02h */ +} IR2_STATE_CHANGED, MPI_POINTER PTR_IR2_STATE_CHANGED; + +typedef struct _IR2_PD_INFO +{ + U16 DeviceHandle; /* 00h */ + U8 TruncEnclosureHandle; /* 02h */ + U8 TruncatedSlot; /* 03h */ +} IR2_PD_INFO, MPI_POINTER PTR_IR2_PD_INFO; + +typedef union _MPI_IR2_RC_EVENT_DATA +{ + IR2_STATE_CHANGED StateChanged; + U32 Lba; + IR2_PD_INFO PdInfo; +} MPI_IR2_RC_EVENT_DATA, MPI_POINTER PTR_MPI_IR2_RC_EVENT_DATA; + +typedef struct _MPI_EVENT_DATA_IR2 +{ + U8 TargetID; /* 00h */ + U8 Bus; /* 01h */ + U8 ReasonCode; /* 02h */ + U8 PhysDiskNum; /* 03h */ + MPI_IR2_RC_EVENT_DATA IR2EventData; /* 04h */ +} MPI_EVENT_DATA_IR2, MPI_POINTER PTR_MPI_EVENT_DATA_IR2, + MpiEventDataIR2_t, MPI_POINTER pMpiEventDataIR2_t; + +/* MPI IR2 Event data ReasonCode values */ +#define MPI_EVENT_IR2_RC_LD_STATE_CHANGED (0x01) +#define MPI_EVENT_IR2_RC_PD_STATE_CHANGED (0x02) +#define MPI_EVENT_IR2_RC_BAD_BLOCK_TABLE_FULL (0x03) +#define MPI_EVENT_IR2_RC_PD_INSERTED (0x04) +#define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) +#define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) +#define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) + +/* defines for logical disk states */ +#define MPI_LD_STATE_OPTIMAL (0x00) +#define MPI_LD_STATE_DEGRADED (0x01) +#define MPI_LD_STATE_FAILED (0x02) +#define MPI_LD_STATE_MISSING (0x03) +#define MPI_LD_STATE_OFFLINE (0x04) + +/* defines for physical disk states */ +#define MPI_PD_STATE_ONLINE (0x00) +#define MPI_PD_STATE_MISSING (0x01) +#define MPI_PD_STATE_NOT_COMPATIBLE (0x02) +#define MPI_PD_STATE_FAILED (0x03) +#define MPI_PD_STATE_INITIALIZING (0x04) +#define MPI_PD_STATE_OFFLINE_AT_HOST_REQUEST (0x05) +#define MPI_PD_STATE_FAILED_AT_HOST_REQUEST (0x06) +#define MPI_PD_STATE_OFFLINE_FOR_ANOTHER_REASON (0xFF) + /* MPI Link Status Change Event data */ typedef struct _EVENT_DATA_LINK_STATUS @@ -688,6 +793,20 @@ #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) #define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09) +/* SAS Discovery Event data */ + +typedef struct _EVENT_DATA_SAS_DISCOVERY +{ + U32 DiscoveryStatus; /* 00h */ + U32 Reserved1; /* 04h */ +} EVENT_DATA_SAS_DISCOVERY, MPI_POINTER PTR_EVENT_DATA_SAS_DISCOVERY, + EventDataSasDiscovery_t, MPI_POINTER pEventDataSasDiscovery_t; + +#define MPI_EVENT_SAS_DSCVRY_COMPLETE (0x00000000) +#define MPI_EVENT_SAS_DSCVRY_IN_PROGRESS (0x00000001) +#define MPI_EVENT_SAS_DSCVRY_PHY_BITS_MASK (0xFFFF0000) +#define MPI_EVENT_SAS_DSCVRY_PHY_BITS_SHIFT (16) + /* SAS Discovery Errror Event data */ typedef struct _EVENT_DATA_DISCOVERY_ERROR @@ -897,6 +1016,7 @@ #define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */ #define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */ #define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) +#define MPI_FW_HEADER_PID_FAMILY_949E_FC (0x0006) /* SAS */ #define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) #define MPI_FW_HEADER_PID_FAMILY_1068_SAS (0x0002) ==== //depot/projects/arm/src/sys/dev/mpt/mpilib/mpi_sas.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_sas.h,v 1.1 2006/01/21 00:29:51 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_sas.h,v 1.2 2006/02/25 07:45:54 mjacob Exp $ */ /*- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. * All rights reserved. @@ -34,7 +34,7 @@ * Title: MPI Serial Attached SCSI structures and definitions * Creation Date: August 19, 2004 * - * mpi_sas.h Version: 01.05.01 >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602251719.k1PHJX7A016980>