aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-12-05 02:43:12 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:15 -0500
commit0bcc65ad78ae517de16b2ca07a2891f49d44d156 (patch)
tree87eecc4aec56500f3e29a1e82b631093f950ac85 /include
parentff2aeb1eb64c8a4770a6304f9addbae9f9828646 (diff)
libata: make qc->nbytes include extra buffers
qc->nbytes didn't use to include extra buffers setup by libata core layer and my be odd. This patch makes qc->nbytes include any extra buffers setup by libata core layer and guaranteed to be aligned on 4 byte boundary. This value is to be used to program the host controller. As this represents the actual length of buffer available to the controller and the controller must be able to deal with short transfers for ATAPI commands which can transfer variable length, this shouldn't break any controllers while making problems like rounding-down and controllers choking up on odd transfer bytes much less likely. The unmodified value is stored in new field qc->raw_nbytes. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 162f8b5509ac..7b7c78e42077 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -466,6 +466,7 @@ struct ata_queued_cmd {
466 unsigned int sect_size; 466 unsigned int sect_size;
467 467
468 unsigned int nbytes; 468 unsigned int nbytes;
469 unsigned int raw_nbytes;
469 unsigned int curbytes; 470 unsigned int curbytes;
470 471
471 struct scatterlist *cursg; 472 struct scatterlist *cursg;
@@ -1362,7 +1363,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1362 qc->flags = 0; 1363 qc->flags = 0;
1363 qc->cursg = NULL; 1364 qc->cursg = NULL;
1364 qc->cursg_ofs = 0; 1365 qc->cursg_ofs = 0;
1365 qc->nbytes = qc->curbytes = 0; 1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0;
1366 qc->n_elem = 0; 1367 qc->n_elem = 0;
1367 qc->mapped_n_elem = 0; 1368 qc->mapped_n_elem = 0;
1368 qc->n_iter = 0; 1369 qc->n_iter = 0;