aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2010-09-10 01:23:18 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-10-21 20:21:05 -0400
commit02e0a60477d839b8f8f974790192f5230f2371d2 (patch)
tree4efb429536201d93a290a17a8806e269cc59fc38 /drivers/ata
parent9950110cf0f79db91c0103876f3a58c9069243eb (diff)
libata: Signal that our SATL supports WRITE SAME(16) with UNMAP
Until now identifying that a device supports WRITE SAME(16) with the UNMAP bit set has been black magic. Implement support for the SBC-3 Thin Provisioning VPD page and set the TPWS bit. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-scsi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 56f6224fd6e6..d050e073e570 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1972,6 +1972,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
1972 0x89, /* page 0x89, ata info page */ 1972 0x89, /* page 0x89, ata info page */
1973 0xb0, /* page 0xb0, block limits page */ 1973 0xb0, /* page 0xb0, block limits page */
1974 0xb1, /* page 0xb1, block device characteristics page */ 1974 0xb1, /* page 0xb1, block device characteristics page */
1975 0xb2, /* page 0xb2, thin provisioning page */
1975 }; 1976 };
1976 1977
1977 rbuf[3] = sizeof(pages); /* number of supported VPD pages */ 1978 rbuf[3] = sizeof(pages); /* number of supported VPD pages */
@@ -2140,6 +2141,16 @@ static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
2140 return 0; 2141 return 0;
2141} 2142}
2142 2143
2144static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf)
2145{
2146 /* SCSI Thin Provisioning VPD page: SBC-3 rev 22 or later */
2147 rbuf[1] = 0xb2;
2148 rbuf[3] = 0x4;
2149 rbuf[5] = 1 << 6; /* TPWS */
2150
2151 return 0;
2152}
2153
2143/** 2154/**
2144 * ata_scsiop_noop - Command handler that simply returns success. 2155 * ata_scsiop_noop - Command handler that simply returns success.
2145 * @args: device IDENTIFY data / SCSI command of interest. 2156 * @args: device IDENTIFY data / SCSI command of interest.
@@ -3252,6 +3263,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
3252 case 0xb1: 3263 case 0xb1:
3253 ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1); 3264 ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1);
3254 break; 3265 break;
3266 case 0xb2:
3267 ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b2);
3268 break;
3255 default: 3269 default:
3256 ata_scsi_invalid_field(cmd, done); 3270 ata_scsi_invalid_field(cmd, done);
3257 break; 3271 break;