From owner-p4-projects@FreeBSD.ORG Sun May 28 11:46:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E26FF16A6F9; Sun, 28 May 2006 11:46:52 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5899616A5DD for ; Sun, 28 May 2006 11:46:52 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0399643D46 for ; Sun, 28 May 2006 11:46:52 +0000 (GMT) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4SBjhbI019356 for ; Sun, 28 May 2006 11:45:43 GMT (envelope-from netchild@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4SBjeuf019350 for perforce@freebsd.org; Sun, 28 May 2006 11:45:40 GMT (envelope-from netchild@freebsd.org) Date: Sun, 28 May 2006 11:45:40 GMT Message-Id: <200605281145.k4SBjeuf019350@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to netchild@freebsd.org using -f From: Alexander Leidinger To: Perforce Change Reviews Cc: Subject: PERFORCE change 98007 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2006 11:46:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=98007 Change 98007 by netchild@netchild_magellan on 2006/05/28 11:44:52 Integrate changes from the parent branch, the sound stuff changed (midi). Affected files ... .. //depot/projects/soc2006/rbeasley_sound/sys/conf/files#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/conf/kmod.mk#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_cam.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_pci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_raid.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_raid.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/midi.c#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/midi.h#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/midiq.h#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/mpu401.c#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/mpu401.h#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/mpu_if.m#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/mpufoi_if.m#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/sequencer.c#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/sequencer.h#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/midi/synth_if.m#1 branch .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pci/cmi.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pci/emu10k1.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ehci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ehci_pci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/if_axe.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/if_axereg.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ohci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ohci_pci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ohcireg.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ohcivar.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/sl811hs.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/sl811hsvar.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/uhci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/uhci_pci.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/uhcivar.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/usb_mem.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/usbdi.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/usbdivar.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/i386/i386/machdep.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/i386/i386/ptrace_machdep.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/i386/i386/vm_machdep.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/i386/include/npx.h#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/i386/isa/npx.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/ia64/ia64/ssc.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/kern/kern_exec.c#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/kern/vnode_if.src#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/modules/sound/driver/cmi/Makefile#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/modules/sound/driver/emu10k1/Makefile#2 integrate .. //depot/projects/soc2006/rbeasley_sound/sys/modules/sound/sound/Makefile#2 integrate Differences ... ==== //depot/projects/soc2006/rbeasley_sound/sys/conf/files#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1118 2006/05/18 23:30:47 ambrisko Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1119 2006/05/27 16:32:05 netchild Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -905,6 +905,12 @@ #dev/sound/usb/upcm.c optional snd_upcm usb dev/sound/usb/uaudio.c optional snd_uaudio usb dev/sound/usb/uaudio_pcm.c optional snd_uaudio usb +dev/sound/midi/midi.c optional sound +dev/sound/midi/mpu401.c optional sound +dev/sound/midi/mpu_if.m optional sound +dev/sound/midi/mpufoi_if.m optional sound +dev/sound/midi/sequencer.c optional sound +dev/sound/midi/synth_if.m optional sound dev/sr/if_sr.c optional sr dev/sr/if_sr_pci.c optional sr pci dev/stg/tmc18c30.c optional stg ==== //depot/projects/soc2006/rbeasley_sound/sys/conf/kmod.mk#2 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.207 2006/04/28 21:21:51 marcel Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.208 2006/05/27 16:32:05 netchild Exp $ # # The include file handles building and installing loadable # kernel modules. @@ -321,8 +321,9 @@ 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/usb/usb_if.m isa/isa_if.m kern/bus_if.m kern/cpufreq_if.m \ - kern/device_if.m kern/serdev_if.m \ + dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \ + dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \ + kern/bus_if.m kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \ libkern/iconv_converter_if.m opencrypto/crypto_if.m \ pc98/pc98/canbus_if.m pci/agp_if.m ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt.c#2 (text+ko) ==== @@ -92,7 +92,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.28 2006/05/26 05:41:14 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.29 2006/05/27 17:26:57 mjacob Exp $"); #include #include /* XXX For static handler registration */ @@ -1206,7 +1206,7 @@ void mpt_send_cmd(struct mpt_softc *mpt, request_t *req) { - if (mpt->verbose > MPT_PRT_TRACE) { + if (mpt->verbose > MPT_PRT_DEBUG2) { mpt_dump_request(mpt, req); } bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, @@ -1685,15 +1685,16 @@ size_t len; rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_IOC, - /*PageNumber*/2, /*PageAddress*/0, &hdr, - /*sleep_ok*/FALSE, /*timeout_ms*/5000); + 2, 0, &hdr, FALSE, 5000); /* * If it's an invalid page, so what? Not a supported function.... */ - if (rv == EINVAL) + if (rv == EINVAL) { return (0); - if (rv) + } + if (rv) { return (rv); + } #if __FreeBSD_version >= 500000 mpt_lprt(mpt, MPT_PRT_DEBUG, "IOC Page 2 Header: ver %x, len %zx, " @@ -1709,22 +1710,28 @@ len = hdr.PageLength * sizeof(uint32_t); mpt->ioc_page2 = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); - if (mpt->ioc_page2 == NULL) + if (mpt->ioc_page2 == NULL) { + mpt_prt(mpt, "unable to allocate memory for IOC page 2\n"); + mpt_raid_free_mem(mpt); return (ENOMEM); + } memcpy(&mpt->ioc_page2->Header, &hdr, sizeof(hdr)); - rv = mpt_read_cur_cfg_page(mpt, /*PageAddress*/0, - &mpt->ioc_page2->Header, len, - /*sleep_ok*/FALSE, /*timeout_ms*/5000); + rv = mpt_read_cur_cfg_page(mpt, 0, + &mpt->ioc_page2->Header, len, FALSE, 5000); if (rv) { mpt_prt(mpt, "failed to read IOC Page 2\n"); - } else if (mpt->ioc_page2->CapabilitiesFlags != 0) { + mpt_raid_free_mem(mpt); + return (EIO); + } + + if (mpt->ioc_page2->CapabilitiesFlags != 0) { uint32_t mask; mpt_prt(mpt, "Capabilities: ("); for (mask = 1; mask != 0; mask <<= 1) { - if ((mpt->ioc_page2->CapabilitiesFlags & mask) == 0) + if ((mpt->ioc_page2->CapabilitiesFlags & mask) == 0) { continue; - + } switch (mask) { case MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT: mpt_prtc(mpt, " RAID-0"); @@ -1766,11 +1773,11 @@ } len = mpt->ioc_page2->MaxVolumes * sizeof(struct mpt_raid_volume); - mpt->raid_volumes = malloc(len, M_DEVBUF, M_NOWAIT); + mpt->raid_volumes = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); if (mpt->raid_volumes == NULL) { mpt_prt(mpt, "Could not allocate RAID volume data\n"); - } else { - memset(mpt->raid_volumes, 0, len); + mpt_raid_free_mem(mpt); + return (ENOMEM); } /* @@ -1780,54 +1787,57 @@ */ mpt->raid_max_volumes = mpt->ioc_page2->MaxVolumes; - len = sizeof(*mpt->raid_volumes->config_page) - + (sizeof(RAID_VOL0_PHYS_DISK)*(mpt->ioc_page2->MaxPhysDisks - 1)); + len = sizeof(*mpt->raid_volumes->config_page) + + (sizeof (RAID_VOL0_PHYS_DISK) * (mpt->ioc_page2->MaxPhysDisks - 1)); for (i = 0; i < mpt->ioc_page2->MaxVolumes; i++) { mpt_raid = &mpt->raid_volumes[i]; - mpt_raid->config_page = malloc(len, M_DEVBUF, M_NOWAIT); + mpt_raid->config_page = + malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); if (mpt_raid->config_page == NULL) { mpt_prt(mpt, "Could not allocate RAID page data\n"); - break; + mpt_raid_free_mem(mpt); + return (ENOMEM); } - memset(mpt_raid->config_page, 0, len); } mpt->raid_page0_len = len; len = mpt->ioc_page2->MaxPhysDisks * sizeof(struct mpt_raid_disk); - mpt->raid_disks = malloc(len, M_DEVBUF, M_NOWAIT); + mpt->raid_disks = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); if (mpt->raid_disks == NULL) { mpt_prt(mpt, "Could not allocate RAID disk data\n"); - } else { - memset(mpt->raid_disks, 0, len); + mpt_raid_free_mem(mpt); + return (ENOMEM); } - mpt->raid_max_disks = mpt->ioc_page2->MaxPhysDisks; + /* + * Load page 3. + */ rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_IOC, - /*PageNumber*/3, /*PageAddress*/0, &hdr, - /*sleep_ok*/FALSE, /*timeout_ms*/5000); - if (rv) + 3, 0, &hdr, FALSE, 5000); + if (rv) { + mpt_raid_free_mem(mpt); return (EIO); + } mpt_lprt(mpt, MPT_PRT_DEBUG, "IOC Page 3 Header: %x %x %x %x\n", - hdr.PageVersion, hdr.PageLength, hdr.PageNumber, hdr.PageType); + hdr.PageVersion, hdr.PageLength, hdr.PageNumber, hdr.PageType); - if (mpt->ioc_page3 != NULL) - free(mpt->ioc_page3, M_DEVBUF); len = hdr.PageLength * sizeof(uint32_t); mpt->ioc_page3 = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); - if (mpt->ioc_page3 == NULL) - return (-1); + if (mpt->ioc_page3 == NULL) { + mpt_prt(mpt, "unable to allocate memory for IOC page 3\n"); + mpt_raid_free_mem(mpt); + return (ENOMEM); + } memcpy(&mpt->ioc_page3->Header, &hdr, sizeof(hdr)); - rv = mpt_read_cur_cfg_page(mpt, /*PageAddress*/0, - &mpt->ioc_page3->Header, len, - /*sleep_ok*/FALSE, /*timeout_ms*/5000); + rv = mpt_read_cur_cfg_page(mpt, 0, + &mpt->ioc_page3->Header, len, FALSE, 5000); if (rv) { - mpt_prt(mpt, "failed to read IOC Page 3\n"); + mpt_raid_free_mem(mpt); + return (EIO); } - mpt_raid_wakeup(mpt); - return (0); } @@ -2458,6 +2468,9 @@ /* * Read IOC configuration information. + * + * We need this to determine whether or not we have certain + * settings for Integrated Mirroring (e.g.). */ mpt_read_config_info_ioc(mpt); ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.19 2006/05/26 05:54:21 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.20 2006/05/27 17:26:57 mjacob Exp $ */ /*- * Generic defines for LSI '909 FC adapters. * FreeBSD Version. @@ -491,7 +491,8 @@ twildcard : 1, tenabled : 1, role : 2, /* none, ini, target, both */ - : 2, + : 1, + raid_enabled : 1, raid_mwce_set : 1, getreqwaiter : 1, shutdwn_raid : 1, @@ -549,7 +550,7 @@ } fc; } cfg; - /* Controller Info */ + /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; CONFIG_PAGE_IOC_3 * ioc_page3; @@ -871,7 +872,7 @@ #define MPT_DUMP_REPLY_FRAME(mpt, reply_frame) \ do { \ - if (mpt->verbose >= MPT_PRT_DEBUG) \ + if (mpt->verbose > MPT_PRT_DEBUG) \ mpt_dump_reply_frame(mpt, reply_frame); \ } while(0) ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_cam.c#2 (text+ko) ==== @@ -91,7 +91,7 @@ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.18 2006/05/26 05:54:21 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.19 2006/05/27 17:26:57 mjacob Exp $"); #include #include @@ -1184,7 +1184,7 @@ } else { callout_handle_init(&ccb->ccb_h.timeout_ch); } - if (mpt->verbose >= MPT_PRT_DEBUG) { + if (mpt->verbose > MPT_PRT_DEBUG) { int nc = 0; mpt_print_request(req->req_vbuf); for (trq = req->chain; trq; trq = trq->chain) { @@ -1192,6 +1192,7 @@ mpt_dump_sgl(trq->req_vbuf, 0); } } + if (hdrp->Function == MPI_FUNCTION_TARGET_ASSIST) { request_t *cmd_req = MPT_TAG_2_REQ(mpt, ccb->csio.tag_id); mpt_tgt_state_t *tgt = MPT_TGT_STATE(mpt, cmd_req); @@ -1567,7 +1568,7 @@ } else { callout_handle_init(&ccb->ccb_h.timeout_ch); } - if (mpt->verbose >= MPT_PRT_DEBUG) { + if (mpt->verbose > MPT_PRT_DEBUG) { int nc = 0; mpt_print_request(req->req_vbuf); for (trq = req->chain; trq; trq = trq->chain) { @@ -1603,6 +1604,7 @@ struct ccb_scsiio *csio = &ccb->csio; struct ccb_hdr *ccbh = &ccb->ccb_h; bus_dmamap_callback_t *cb; + target_id_t tgt; int raid_passthru; /* Get the pointer for the physical addapter */ @@ -1647,8 +1649,21 @@ mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; + CAMLOCK_2_MPTLOCK(mpt); + if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { + MPTLOCK_2_CAMLOCK(mpt); + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); + xpt_done(ccb); + return; + } + MPTLOCK_2_CAMLOCK(mpt); + mpt_req->Bus = 0; /* we never set bus here */ + } else { + tgt = ccb->ccb_h.target_id; + mpt_req->Bus = 0; /* XXX */ + } - mpt_req->Bus = 0; /* we don't have multiport devices yet */ mpt_req->SenseBufferLength = (csio->sense_len < MPT_SENSE_SIZE) ? csio->sense_len : MPT_SENSE_SIZE; @@ -1660,7 +1675,7 @@ mpt_req->MsgContext = htole32(req->index | scsi_io_handler_id); /* Which physical device to do the I/O on */ - mpt_req->TargetID = ccb->ccb_h.target_id; + mpt_req->TargetID = tgt; /* We assume a single level LUN type */ if (ccb->ccb_h.target_lun >= 256) { @@ -1722,9 +1737,25 @@ mpt_req->SenseBufferLowAddr = req->sense_pbuf; /* + * Do a *short* print here if we're set to MPT_PRT_DEBUG + */ + if (mpt->verbose == MPT_PRT_DEBUG) { + mpt_prt(mpt, "mpt_start: %s op 0x%x ", + (mpt_req->Function == MPI_FUNCTION_SCSI_IO_REQUEST)? + "SCSI_IO_REQUEST" : "SCSI_IO_PASSTHRU", mpt_req->CDB[0]); + if (mpt_req->Control != MPI_SCSIIO_CONTROL_NODATATRANSFER) { + mpt_prtc(mpt, "(%s %u byte%s ", + (mpt_req->Control == MPI_SCSIIO_CONTROL_READ)? + "read" : "write", csio->dxfer_len, + (csio->dxfer_len == 1)? ")" : "s)"); + } + mpt_prtc(mpt, "tgt %u lun %u req %p:%u\n", tgt, + ccb->ccb_h.target_lun, req, req->serno); + } + + /* * If we have any data to send with this command map it into bus space. */ - if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE) { if ((ccbh->flags & CAM_SCATTER_VALID) == 0) { /* @@ -2061,6 +2092,10 @@ inq->device &= ~0x1F; inq->device |= T_NODEVICE; } + if (mpt->verbose == MPT_PRT_DEBUG) { + mpt_prt(mpt, "mpt_scsi_reply_handler: %p:%u complete\n", + req, req->serno); + } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); MPTLOCK_2_CAMLOCK(mpt); @@ -2631,7 +2666,7 @@ { struct mpt_softc *mpt; struct ccb_trans_settings *cts; - u_int tgt; + target_id_t tgt; int raid_passthru; CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mpt_action\n")); @@ -2681,11 +2716,11 @@ case XPT_RESET_BUS: mpt_lprt(mpt, MPT_PRT_DEBUG, "XPT_RESET_BUS\n"); - if (raid_passthru == 0) { - CAMLOCK_2_MPTLOCK(mpt); - (void)mpt_bus_reset(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); - } + + CAMLOCK_2_MPTLOCK(mpt); + (void) mpt_bus_reset(mpt, FALSE); + MPTLOCK_2_CAMLOCK(mpt); + /* * mpt_bus_reset is always successful in that it * will fall back to a hard reset should a bus @@ -2760,11 +2795,20 @@ break; } + if (mpt->ioc_page2 && mpt->ioc_page2->MaxPhysDisks != 0 && + raid_passthru == 0) { + mpt_set_ccb_status(ccb, CAM_REQ_CMP); + break; + } + m = mpt->mpt_port_page2.PortSettings; if ((m & MPI_SCSIPORTPAGE2_PORT_MASK_NEGO_MASTER_SETTINGS) == MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS) { +mpt_prt(mpt, "master settings\n"); +if (raid_passthru == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; +} } dval = 0; @@ -2962,7 +3006,8 @@ cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; } if (raid_passthru) { - cpi->max_target = mpt->ioc_page2->MaxPhysDisks; + cpi->max_lun = 0; + cpi->hba_misc = PIM_NOBUSRESET; cpi->initiator_id = cpi->max_target+1; } @@ -3057,17 +3102,38 @@ mpt_get_spi_settings(struct mpt_softc *mpt, struct ccb_trans_settings *cts) { #ifdef CAM_NEW_TRAN_CODE - struct ccb_trans_settings_scsi *scsi = - &cts->proto_specific.scsi; - struct ccb_trans_settings_spi *spi = - &cts->xport_specific.spi; + struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; + struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; #endif - int tgt; + target_id_t tgt; uint8_t dval, pval, oval; int rv; + /* + * Check to see if this is an Integrated Raid card. + * + * If it is, and we're the RAID bus side, both current + * and goal settings are synthesized as we only look at + * or change actual settings for the physical disk side. + * + * NB: In the future we can just do this on the blacked out + * NB: portion that the RAID volume covers- there may be + * NB: other entities on this bus as well. + */ + + if (mpt->phydisk_sim) { + if (xpt_path_sim(cts->ccb_h.path) != mpt->phydisk_sim) { + dval = DP_WIDE|DP_DISC|DP_TQING; + oval = (mpt->mpt_port_page0.Capabilities >> 16); + pval = (mpt->mpt_port_page0.Capabilities >> 8); + tgt = cts->ccb_h.target_id; + goto skip; + } + } - tgt = cts->ccb_h.target_id; + if (mpt_map_physdisk(mpt, (union ccb *)cts, &tgt) != 0) { + return (-1); + } /* * We aren't going off of Port PAGE2 params for @@ -3115,6 +3181,7 @@ oval = (mpt->mpt_port_page0.Capabilities >> 16); pval = (mpt->mpt_port_page0.Capabilities >> 8); } + skip: #ifndef CAM_NEW_TRAN_CODE cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB); if (dval & DP_DISC_ENABLE) { ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_pci.c#2 (text+ko) ==== @@ -96,7 +96,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.28 2006/05/04 02:35:04 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.29 2006/05/27 17:26:57 mjacob Exp $"); #include #include @@ -600,27 +600,10 @@ mpt_reset(mpt, /*reinit*/FALSE); mpt_dma_mem_free(mpt); mpt_free_bus_resources(mpt); - if (mpt->raid_volumes != NULL && mpt->ioc_page2 != NULL) { - int i; - for (i = 0; i < mpt->ioc_page2->MaxVolumes; i++) { - struct mpt_raid_volume *mpt_vol; - - mpt_vol = &mpt->raid_volumes[i]; - if (mpt_vol->config_page) { - free(mpt_vol->config_page, M_DEVBUF); - } - } + mpt_raid_free_mem(mpt); + if (mpt->eh != NULL) { + EVENTHANDLER_DEREGISTER(shutdown_final, mpt->eh); } - if (mpt->ioc_page2 != NULL) - free(mpt->ioc_page2, M_DEVBUF); - if (mpt->ioc_page3 != NULL) - free(mpt->ioc_page3, M_DEVBUF); - if (mpt->raid_volumes != NULL) - free(mpt->raid_volumes, M_DEVBUF); - if (mpt->raid_disks != NULL) - free(mpt->raid_disks, M_DEVBUF); - if (mpt->eh != NULL) - EVENTHANDLER_DEREGISTER(shutdown_final, mpt->eh); MPT_UNLOCK(mpt); } return(0); ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_raid.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_raid.c,v 1.7 2006/05/26 05:54:21 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_raid.c,v 1.8 2006/05/27 17:26:57 mjacob Exp $"); #include #include @@ -1494,6 +1494,39 @@ mpt_raid_timer, mpt); } +void +mpt_raid_free_mem(struct mpt_softc *mpt) +{ + + if (mpt->raid_volumes) { + struct mpt_raid_volume *mpt_raid; + int i; + for (i = 0; i < mpt->raid_max_volumes; i++) { + mpt_raid = &mpt->raid_volumes[i]; + if (mpt_raid->config_page) { + free(mpt_raid->config_page, M_DEVBUF); + mpt_raid->config_page = NULL; + } + } + free(mpt->raid_volumes, M_DEVBUF); + mpt->raid_volumes = NULL; + } + if (mpt->raid_disks) { + free(mpt->raid_disks, M_DEVBUF); + mpt->raid_disks = NULL; + } + if (mpt->ioc_page2) { + free(mpt->ioc_page2, M_DEVBUF); + mpt->ioc_page2 = NULL; + } + if (mpt->ioc_page3) { + free(mpt->ioc_page3, M_DEVBUF); + mpt->ioc_page3 = NULL; + } + mpt->raid_max_volumes = 0; + mpt->raid_max_disks = 0; +} + static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/mpt/mpt_raid.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpt_raid.h,v 1.3 2006/05/26 05:43:14 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpt_raid.h,v 1.4 2006/05/27 17:26:57 mjacob Exp $ */ /*- * Definitions for the integrated RAID features LSI MPT Fusion adapters. * @@ -59,12 +59,13 @@ bus_size_t, int, int); cam_status -mpt_map_physdisk(struct mpt_softc *, union ccb *, u_int *); +mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); cam_status mpt_raid_quiesce_disk(struct mpt_softc *, struct mpt_raid_disk *, request_t *); int mpt_refresh_raid_data(struct mpt_softc *); void mpt_schedule_raid_refresh(struct mpt_softc *); +void mpt_raid_free_mem(struct mpt_softc *); static __inline void mpt_raid_wakeup(struct mpt_softc *mpt) ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pci/cmi.c#2 (text+ko) ==== @@ -48,10 +48,12 @@ #include #include +#include #include "mixer_if.h" +#include "mpufoi_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.34 2006/01/21 09:05:12 joel Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.35 2006/05/27 16:51:37 netchild Exp $"); /* Supported chip ID's */ #define CMI8338A_PCI_ID 0x010013f6 @@ -112,6 +114,13 @@ int spdif_enabled; unsigned int bufsz; struct sc_chinfo pch, rch; + + struct mpu401 *mpu; + mpu401_intr_t *mpu_intr; + struct resource *mpu_reg; + int mpu_regid; + bus_space_tag_t mpu_bt; + bus_space_handle_t mpu_bh; }; /* Channel caps */ @@ -551,6 +560,9 @@ } } + if(sc->mpu_intr) { + (sc->mpu_intr)(sc->mpu); + } snd_mtxunlock(sc->lock); return; } @@ -747,6 +759,74 @@ }; MIXER_DECLARE(cmi_mixer); +/* + * mpu401 functions + */ + +static unsigned char +cmi_mread(void *arg, struct sc_info *sc, int reg) +{ + unsigned int d; + + d = bus_space_read_1(0,0, 0x330 + reg); + /* printf("cmi_mread: reg %x %x\n",reg, d); + */ + return d; +} + +static void +cmi_mwrite(void *arg, struct sc_info *sc, int reg, unsigned char b) +{ + + bus_space_write_1(0,0,0x330 + reg , b); +} + +static int +cmi_muninit(void *arg, struct sc_info *sc) +{ + + snd_mtxlock(sc->lock); + sc->mpu_intr = 0; + sc->mpu = 0; + snd_mtxunlock(sc->lock); + + return 0; +} + +static kobj_method_t cmi_mpu_methods[] = { + KOBJMETHOD(mpufoi_read, cmi_mread), + KOBJMETHOD(mpufoi_write, cmi_mwrite), + KOBJMETHOD(mpufoi_uninit, cmi_muninit), + { 0, 0 } +}; + +DEFINE_CLASS(cmi_mpu, cmi_mpu_methods, 0); + +static void +cmi_midiattach(struct sc_info *sc) { +/* + const struct { + int port,bits; + } *p, ports[] = { + {0x330,0}, + {0x320,1}, + {0x310,2}, + {0x300,3}, + {0,0} } ; + Notes, CMPCI_REG_VMPUSEL sets the io port for the mpu. Does + anyone know how to bus_space tag? +*/ + cmi_clr4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_UART_ENABLE); + cmi_clr4(sc, CMPCI_REG_LEGACY_CTRL, + CMPCI_REG_VMPUSEL_MASK << CMPCI_REG_VMPUSEL_SHIFT); + cmi_set4(sc, CMPCI_REG_LEGACY_CTRL, + 0 << CMPCI_REG_VMPUSEL_SHIFT ); + cmi_set4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_UART_ENABLE); + sc->mpu = mpu401_init(&cmi_mpu_class, sc, cmi_intr, &sc->mpu_intr); +} + + + /* ------------------------------------------------------------------------- */ /* Power and reset */ @@ -802,6 +882,10 @@ CMPCI_REG_TDMA_INTR_ENABLE); cmi_clr4(sc, CMPCI_REG_FUNC_0, CMPCI_REG_CH0_ENABLE | CMPCI_REG_CH1_ENABLE); + cmi_clr4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_UART_ENABLE); + + if( sc->mpu ) + sc->mpu_intr = 0; } /* ------------------------------------------------------------------------- */ @@ -857,6 +941,8 @@ sc->st = rman_get_bustag(sc->reg); sc->sh = rman_get_bushandle(sc->reg); + cmi_midiattach(sc); + sc->irqid = 0; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, RF_ACTIVE | RF_SHAREABLE); @@ -936,7 +1022,12 @@ bus_dma_tag_destroy(sc->parent_dmat); bus_teardown_intr(dev, sc->irq, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq); + if(sc->mpu) + mpu401_uninit(sc->mpu); bus_release_resource(dev, SYS_RES_IOPORT, sc->regid, sc->reg); + if (sc->mpu_reg) + bus_release_resource(dev, SYS_RES_IOPORT, sc->mpu_regid, sc->mpu_reg); + snd_mtxfree(sc->lock); free(sc, M_DEVBUF); @@ -1007,4 +1098,5 @@ DRIVER_MODULE(snd_cmi, pci, cmi_driver, pcm_devclass, 0, 0); MODULE_DEPEND(snd_cmi, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_DEPEND(snd_cmi, midi, 1,1,1); MODULE_VERSION(snd_cmi, 1); ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pci/emu10k1.c#2 (text+ko) ==== @@ -35,7 +35,10 @@ #include #include -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.58 2006/01/21 16:21:06 netchild Exp $"); +#include +#include "mpufoi_if.h" + +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.59 2006/05/27 16:51:37 netchild Exp $"); /* -------------------------------------------------------------------- */ @@ -137,6 +140,9 @@ struct emu_voice voice[64]; struct sc_pchinfo pch[EMU_MAX_CHANS]; struct sc_rchinfo rch[3]; + struct mpu401 *mpu; + mpu401_intr_t *mpu_intr; + int mputx; }; /* -------------------------------------------------------------------- */ @@ -1059,8 +1065,65 @@ }; CHANNEL_DECLARE(emurchan); +static unsigned char +emu_mread(void *arg, struct sc_info *sc, int reg) +{ + unsigned int d; + + d = emu_rd(sc, 0x18 + reg, 1); + return d; +} + +static void +emu_mwrite(void *arg, struct sc_info *sc, int reg, unsigned char b) +{ + + emu_wr(sc, 0x18 + reg, b, 1); +} + +static int +emu_muninit(void *arg, struct sc_info *sc) +{ + + snd_mtxlock(sc->lock); + sc->mpu_intr = 0; + snd_mtxunlock(sc->lock); + + return 0; +} + +static kobj_method_t emu_mpu_methods[] = { + KOBJMETHOD(mpufoi_read, emu_mread), + KOBJMETHOD(mpufoi_write, emu_mwrite), + KOBJMETHOD(mpufoi_uninit, emu_muninit), + { 0, 0 } +}; + +DEFINE_CLASS(emu_mpu, emu_mpu_methods, 0); + +static void +emu_intr2(void *p) +{ + struct sc_info *sc = (struct sc_info *)p; + + if (sc->mpu_intr) + (sc->mpu_intr)(sc->mpu); +} + +static void +emu_midiattach(struct sc_info *sc) +{ + int i; + + i = emu_rd(sc, INTE, 4); + i |= INTE_MIDIRXENABLE; + emu_wr(sc, INTE, i, 4); + + sc->mpu = mpu401_init(&emu_mpu_class, sc, emu_intr2, &sc->mpu_intr); +} /* -------------------------------------------------------------------- */ /* The interrupt handler */ + static void emu_intr(void *data) { @@ -1100,6 +1163,11 @@ #endif } + if (stat & IPR_MIDIRECVBUFEMPTY) + if (sc->mpu_intr) { + (sc->mpu_intr)(sc->mpu); + ack |= IPR_MIDIRECVBUFEMPTY | IPR_MIDITRANSBUFEMPTY; + } if (stat & ~ack) device_printf(sc->dev, "dodgy irq: %x (harmless)\n", stat & ~ack); @@ -1871,6 +1939,8 @@ emu_free(sc, sc->mem.ptb_pages); emu_free(sc, sc->mem.silent_page); + if(sc->mpu) + mpu401_uninit(sc->mpu); return 0; } @@ -1963,6 +2033,8 @@ gotmic = (ac97_getcaps(codec) & AC97_CAP_MICCHANNEL) ? 1 : 0; if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad; + emu_midiattach(sc); + i = 0; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); @@ -2041,6 +2113,7 @@ DRIVER_MODULE(snd_emu10k1, cardbus, emu_driver, pcm_devclass, 0, 0); MODULE_DEPEND(snd_emu10k1, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_emu10k1, 1); +MODULE_DEPEND(snd_emu10k1, midi, 1, 1, 1); /* dummy driver to silence the joystick device */ static int ==== //depot/projects/soc2006/rbeasley_sound/sys/dev/usb/ehci.c#2 (text+ko) ==== @@ -59,7 +59,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.45 2006/05/24 03:04:11 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.46 2006/05/28 05:27:08 iedowse Exp $"); #include #include @@ -654,7 +654,7 @@ pipe = xfer->pipe; - p = KERNADDR(&xfer->dmabuf, 0); + p = xfer->buffer; m = min(sc->sc_noport, xfer->length * 8 - 1); memset(p, 0, xfer->length); for (i = 1; i <= m; i++) { @@ -1742,7 +1742,7 @@ index = UGETW(req->wIndex); if (len != 0) - buf = KERNADDR(&xfer->dmabuf, 0); + buf = xfer->buffer; #define C(x,y) ((x) | ((y) << 8)) switch(C(req->bRequest, req->bmRequestType)) { @@ -2335,11 +2335,11 @@ ehci_soft_qtd_t *newinactive, ehci_soft_qtd_t **sp, ehci_soft_qtd_t **ep) { ehci_soft_qtd_t *next, *cur; - ehci_physaddr_t dataphys, dataphyspage, dataphyslastpage, nextphys; + ehci_physaddr_t dataphys, nextphys; u_int32_t qtdstatus; - int len, curlen, mps, offset; - int i, iscontrol; - usb_dma_t *dma = &xfer->dmabuf; + int adj, len, curlen, mps, offset, pagelen, seg, segoff; + int i, iscontrol, forceshort; + struct usb_dma_mapping *dma = &xfer->dmamap; DPRINTFN(alen<4*4096,("ehci_alloc_sqtd_chain: start len=%d\n", alen)); @@ -2347,8 +2347,6 @@ len = alen; iscontrol = (epipe->pipe.endpoint->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL; - dataphys = DMAADDR(dma, 0); >>> TRUNCATED FOR MAIL (1000 lines) <<<