diff options
-rw-r--r-- | drivers/ata/libata-core.c | 4 | ||||
-rw-r--r-- | include/linux/ata.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4dc6befa5760..24b3bd63621f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2304,6 +2304,10 @@ int ata_dev_configure(struct ata_device *dev) | |||
2304 | dev->max_sectors = ATA_MAX_SECTORS; | 2304 | dev->max_sectors = ATA_MAX_SECTORS; |
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | if ((dev->class == ATA_DEV_ATAPI) && | ||
2308 | (atapi_command_packet_set(id) == TYPE_TAPE)) | ||
2309 | dev->max_sectors = ATA_MAX_SECTORS_TAPE; | ||
2310 | |||
2307 | if (dev->horkage & ATA_HORKAGE_MAX_SEC_128) | 2311 | if (dev->horkage & ATA_HORKAGE_MAX_SEC_128) |
2308 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, | 2312 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, |
2309 | dev->max_sectors); | 2313 | dev->max_sectors); |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 128dc7ad4901..61535e72834d 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -43,6 +43,7 @@ enum { | |||
43 | ATA_MAX_SECTORS_128 = 128, | 43 | ATA_MAX_SECTORS_128 = 128, |
44 | ATA_MAX_SECTORS = 256, | 44 | ATA_MAX_SECTORS = 256, |
45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | 45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ |
46 | ATA_MAX_SECTORS_TAPE = 65535, | ||
46 | 47 | ||
47 | ATA_ID_WORDS = 256, | 48 | ATA_ID_WORDS = 256, |
48 | ATA_ID_SERNO = 10, | 49 | ATA_ID_SERNO = 10, |
@@ -544,6 +545,11 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
544 | } | 545 | } |
545 | } | 546 | } |
546 | 547 | ||
548 | static inline int atapi_command_packet_set(const u16 *dev_id) | ||
549 | { | ||
550 | return (dev_id[0] >> 8) & 0x1f; | ||
551 | } | ||
552 | |||
547 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) | 553 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) |
548 | { | 554 | { |
549 | return (tf->protocol == ATA_PROT_ATAPI) || | 555 | return (tf->protocol == ATA_PROT_ATAPI) || |