diff options
Diffstat (limited to 'include/linux/libata.h')
| -rw-r--r-- | include/linux/libata.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 8b8946dd63b9..32f247cb5e9e 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -210,6 +210,7 @@ enum { | |||
| 210 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ | 210 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ |
| 211 | /* (doesn't imply presence) */ | 211 | /* (doesn't imply presence) */ |
| 212 | ATA_FLAG_SATA = (1 << 1), | 212 | ATA_FLAG_SATA = (1 << 1), |
| 213 | ATA_FLAG_NO_LPM = (1 << 2), /* host not happy with LPM */ | ||
| 213 | ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */ | 214 | ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */ |
| 214 | ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ | 215 | ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ |
| 215 | ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ | 216 | ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ |
| @@ -1495,6 +1496,29 @@ static inline bool ata_tag_valid(unsigned int tag) | |||
| 1495 | return tag < ATA_MAX_QUEUE || ata_tag_internal(tag); | 1496 | return tag < ATA_MAX_QUEUE || ata_tag_internal(tag); |
| 1496 | } | 1497 | } |
| 1497 | 1498 | ||
| 1499 | #define __ata_qc_for_each(ap, qc, tag, max_tag, fn) \ | ||
| 1500 | for ((tag) = 0; (tag) < (max_tag) && \ | ||
| 1501 | ({ qc = fn((ap), (tag)); 1; }); (tag)++) \ | ||
| 1502 | |||
| 1503 | /* | ||
| 1504 | * Internal use only, iterate commands ignoring error handling and | ||
| 1505 | * status of 'qc'. | ||
| 1506 | */ | ||
| 1507 | #define ata_qc_for_each_raw(ap, qc, tag) \ | ||
| 1508 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, __ata_qc_from_tag) | ||
| 1509 | |||
| 1510 | /* | ||
| 1511 | * Iterate all potential commands that can be queued | ||
| 1512 | */ | ||
| 1513 | #define ata_qc_for_each(ap, qc, tag) \ | ||
| 1514 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, ata_qc_from_tag) | ||
| 1515 | |||
| 1516 | /* | ||
| 1517 | * Like ata_qc_for_each, but with the internal tag included | ||
| 1518 | */ | ||
| 1519 | #define ata_qc_for_each_with_internal(ap, qc, tag) \ | ||
| 1520 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE + 1, ata_qc_from_tag) | ||
| 1521 | |||
| 1498 | /* | 1522 | /* |
| 1499 | * device helpers | 1523 | * device helpers |
| 1500 | */ | 1524 | */ |
