Set the DMA SGL length correctly if the DMA request must be chained because

it is too large to fit in one SGL.
Fix from HITOSHI Osada <QFH02545 (at) nifty.com> in response to PR kern/24967.
This commit is contained in:
briggs 2004-04-10 01:59:19 +00:00
parent 85611189b6
commit d2074a867d
1 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpt_netbsd.c,v 1.7 2003/07/14 15:47:11 lukem Exp $ */
/* $NetBSD: mpt_netbsd.c,v 1.8 2004/04/10 01:59:19 briggs Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.7 2003/07/14 15:47:11 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.8 2004/04/10 01:59:19 briggs Exp $");
#include <dev/ic/mpt.h> /* pulls in all headers */
@ -828,11 +828,14 @@ mpt_run_xfer(mpt_softc_t *mpt, struct scsipi_xfer *xs)
ntodo = MPT_NSGL(mpt) - 1;
ce->NextChainOffset = (MPT_RQSL(mpt) -
sizeof(SGE_SIMPLE32)) >> 2;
ce->Length = MPT_NSGL(mpt)
* sizeof(SGE_SIMPLE32);
} else {
ntodo = nleft;
ce->NextChainOffset = 0;
ce->Length = ntodo
* sizeof(SGE_SIMPLE32);
}
ce->Length = ntodo * sizeof(SGE_SIMPLE32);
ce->Address = req->req_pbuf +
((char *)se - (char *)mpt_req);
ce->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT;