aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a05f60013642..b064bfeb69ee 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -295,6 +295,7 @@ enum {
295 ATA_EH_SOFTRESET = (1 << 1), 295 ATA_EH_SOFTRESET = (1 << 1),
296 ATA_EH_HARDRESET = (1 << 2), 296 ATA_EH_HARDRESET = (1 << 2),
297 ATA_EH_ENABLE_LINK = (1 << 3), 297 ATA_EH_ENABLE_LINK = (1 << 3),
298 ATA_EH_LPM = (1 << 4), /* link power management action */
298 299
299 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, 300 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
300 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, 301 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
@@ -304,7 +305,6 @@ enum {
304 ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */ 305 ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */
305 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ 306 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */
306 ATA_EHI_QUIET = (1 << 3), /* be quiet */ 307 ATA_EHI_QUIET = (1 << 3), /* be quiet */
307 ATA_EHI_LPM = (1 << 4), /* link power management action */
308 308
309 ATA_EHI_DID_SOFTRESET = (1 << 16), /* already soft-reset this port */ 309 ATA_EHI_DID_SOFTRESET = (1 << 16), /* already soft-reset this port */
310 ATA_EHI_DID_HARDRESET = (1 << 17), /* already soft-reset this port */ 310 ATA_EHI_DID_HARDRESET = (1 << 17), /* already soft-reset this port */
@@ -463,6 +463,7 @@ struct ata_queued_cmd {
463 unsigned int sect_size; 463 unsigned int sect_size;
464 464
465 unsigned int nbytes; 465 unsigned int nbytes;
466 unsigned int extrabytes;
466 unsigned int curbytes; 467 unsigned int curbytes;
467 468
468 struct scatterlist *cursg; 469 struct scatterlist *cursg;
@@ -1336,6 +1337,11 @@ static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap,
1336 return NULL; 1337 return NULL;
1337} 1338}
1338 1339
1340static inline unsigned int ata_qc_raw_nbytes(struct ata_queued_cmd *qc)
1341{
1342 return qc->nbytes - min(qc->extrabytes, qc->nbytes);
1343}
1344
1339static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf) 1345static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
1340{ 1346{
1341 memset(tf, 0, sizeof(*tf)); 1347 memset(tf, 0, sizeof(*tf));
@@ -1354,7 +1360,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1354 qc->flags = 0; 1360 qc->flags = 0;
1355 qc->cursg = NULL; 1361 qc->cursg = NULL;
1356 qc->cursg_ofs = 0; 1362 qc->cursg_ofs = 0;
1357 qc->nbytes = qc->curbytes = 0; 1363 qc->nbytes = qc->extrabytes = qc->curbytes = 0;
1358 qc->n_elem = 0; 1364 qc->n_elem = 0;
1359 qc->err_mask = 0; 1365 qc->err_mask = 0;
1360 qc->sect_size = ATA_SECT_SIZE; 1366 qc->sect_size = ATA_SECT_SIZE;