svn commit: r251888 - stable/9/sys/dev/amd
Scott Long
scottl at FreeBSD.org
Tue Jun 18 03:34:08 UTC 2013
Author: scottl
Date: Tue Jun 18 03:34:08 2013
New Revision: 251888
URL: http://svnweb.freebsd.org/changeset/base/251888
Log:
Catch up to the changes from r251874. This isn't an MFC because the
amd(4) driver no longer exists in FreeBSD 10.
Obtained from: Netflix
Modified:
stable/9/sys/dev/amd/amd.c
Modified: stable/9/sys/dev/amd/amd.c
==============================================================================
--- stable/9/sys/dev/amd/amd.c Tue Jun 18 02:57:56 2013 (r251887)
+++ stable/9/sys/dev/amd/amd.c Tue Jun 18 03:34:08 2013 (r251888)
@@ -428,61 +428,22 @@ amd_action(struct cam_sim * psim, union
pSRB->ScsiCmdLen = pcsio->cdb_len;
bcopy(pcsio->cdb_io.cdb_bytes, pSRB->CmdBlock, pcsio->cdb_len);
if ((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- if ((pccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
+ int error;
+
+ error - bus_dmamap_load_ccb(amd->buffer_dmat,
+ pSRB->dmamap,
+ pccb,
+ amdexecutesrb,
+ pSRB, /*flags*/0);
+ if (error == EINPROGRESS) {
/*
- * We've been given a pointer
- * to a single buffer.
+ * So as to maintain ordering,
+ * freeze the controller queue
+ * until our mapping is
+ * returned.
*/
- if ((pccb->ccb_h.flags & CAM_DATA_PHYS) == 0) {
- int s;
- int error;
-
- s = splsoftvm();
- error =
- bus_dmamap_load(amd->buffer_dmat,
- pSRB->dmamap,
- pcsio->data_ptr,
- pcsio->dxfer_len,
- amdexecutesrb,
- pSRB, /*flags*/0);
- if (error == EINPROGRESS) {
- /*
- * So as to maintain
- * ordering, freeze the
- * controller queue
- * until our mapping is
- * returned.
- */
- xpt_freeze_simq(amd->psim, 1);
- pccb->ccb_h.status |=
- CAM_RELEASE_SIMQ;
- }
- splx(s);
- } else {
- struct bus_dma_segment seg;
-
- /* Pointer to physical buffer */
- seg.ds_addr =
- (bus_addr_t)pcsio->data_ptr;
- seg.ds_len = pcsio->dxfer_len;
- amdexecutesrb(pSRB, &seg, 1, 0);
- }
- } else {
- struct bus_dma_segment *segs;
-
- if ((pccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0
- || (pccb->ccb_h.flags & CAM_DATA_PHYS) != 0) {
- TAILQ_INSERT_HEAD(&amd->free_srbs,
- pSRB, links);
- pccb->ccb_h.status = CAM_PROVIDE_FAIL;
- xpt_done(pccb);
- return;
- }
-
- /* Just use the segments provided */
- segs =
- (struct bus_dma_segment *)pcsio->data_ptr;
- amdexecutesrb(pSRB, segs, pcsio->sglist_cnt, 0);
+ xpt_freeze_simq(sim, 1);
+ pccb->ccb_h.status |= CAM_RELEASE_SIMQ;
}
} else
amdexecutesrb(pSRB, NULL, 0, 0);
More information about the svn-src-all
mailing list