From owner-svn-src-all@FreeBSD.ORG Tue Jun 18 14:40:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE545572; Tue, 18 Jun 2013 14:40:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFF5D1DDF; Tue, 18 Jun 2013 14:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IEeMDH088701; Tue, 18 Jun 2013 14:40:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IEeME8088696; Tue, 18 Jun 2013 14:40:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181440.r5IEeME8088696@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 14:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251941 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:40:23 -0000 Author: marius Date: Tue Jun 18 14:40:21 2013 New Revision: 251941 URL: http://svnweb.freebsd.org/changeset/base/251941 Log: MFC: r251116 Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the same support for aacp(4), I'm lacking the necessary hardware for testing, though. Modified: stable/9/sys/dev/aac/aac.c stable/9/sys/dev/aac/aac_disk.c stable/9/sys/dev/aac/aacvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aac.c Tue Jun 18 14:40:21 2013 (r251941) @@ -987,14 +987,18 @@ aac_startio(struct aac_softc *sc) * busdma. */ if (cm->cm_datalen != 0) { - error = bus_dmamap_load(sc->aac_buffer_dmat, - cm->cm_datamap, cm->cm_data, - cm->cm_datalen, - aac_map_command_sg, cm, 0); + if (cm->cm_flags & AAC_REQ_BIO) + error = bus_dmamap_load_bio( + sc->aac_buffer_dmat, cm->cm_datamap, + (struct bio *)cm->cm_private, + aac_map_command_sg, cm, 0); + else + error = bus_dmamap_load(sc->aac_buffer_dmat, + cm->cm_datamap, cm->cm_data, + cm->cm_datalen, aac_map_command_sg, cm, 0); if (error == EINPROGRESS) { fwprintf(sc, HBA_FLAGS_DBG_COMM_B, "freezing queue\n"); sc->flags |= AAC_QUEUE_FRZN; - error = 0; } else if (error != 0) panic("aac_startio: unexpected error %d from " "busdma", error); @@ -1199,9 +1203,9 @@ aac_bio_command(struct aac_softc *sc, st goto fail; /* fill out the command */ - cm->cm_data = (void *)bp->bio_data; cm->cm_datalen = bp->bio_bcount; cm->cm_complete = aac_bio_complete; + cm->cm_flags = AAC_REQ_BIO; cm->cm_private = bp; cm->cm_timestamp = time_uptime; Modified: stable/9/sys/dev/aac/aac_disk.c ============================================================================== --- stable/9/sys/dev/aac/aac_disk.c Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aac_disk.c Tue Jun 18 14:40:21 2013 (r251941) @@ -397,6 +397,7 @@ aac_disk_attach(device_t dev) sc->unit = device_get_unit(dev); sc->ad_disk = disk_alloc(); sc->ad_disk->d_drv1 = sc; + sc->ad_disk->d_flags = DISKFLAG_UNMAPPED_BIO; sc->ad_disk->d_name = "aacd"; sc->ad_disk->d_maxsize = sc->ad_controller->aac_max_sectors << 9; sc->ad_disk->d_open = aac_disk_open; Modified: stable/9/sys/dev/aac/aacvar.h ============================================================================== --- stable/9/sys/dev/aac/aacvar.h Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aacvar.h Tue Jun 18 14:40:21 2013 (r251941) @@ -181,6 +181,8 @@ struct aac_command #define AAC_ON_AACQ_MASK ((1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<10)) #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ +#define AAC_REQ_BIO (1 << 11) +#define AAC_REQ_CCB (1 << 12) void (*cm_complete)(struct aac_command *cm); void *cm_private;