Commit 02e0a604 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by Jeff Garzik

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: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 9950110c
...@@ -1972,6 +1972,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf) ...@@ -1972,6 +1972,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
0x89, /* page 0x89, ata info page */ 0x89, /* page 0x89, ata info page */
0xb0, /* page 0xb0, block limits page */ 0xb0, /* page 0xb0, block limits page */
0xb1, /* page 0xb1, block device characteristics page */ 0xb1, /* page 0xb1, block device characteristics page */
0xb2, /* page 0xb2, thin provisioning page */
}; };
rbuf[3] = sizeof(pages); /* number of supported VPD pages */ 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,6 +2141,16 @@ static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
return 0; return 0;
} }
static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf)
{
/* SCSI Thin Provisioning VPD page: SBC-3 rev 22 or later */
rbuf[1] = 0xb2;
rbuf[3] = 0x4;
rbuf[5] = 1 << 6; /* TPWS */
return 0;
}
/** /**
* ata_scsiop_noop - Command handler that simply returns success. * ata_scsiop_noop - Command handler that simply returns success.
* @args: device IDENTIFY data / SCSI command of interest. * @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,6 +3263,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
case 0xb1: case 0xb1:
ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1); ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1);
break; break;
case 0xb2:
ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b2);
break;
default: default:
ata_scsi_invalid_field(cmd, done); ata_scsi_invalid_field(cmd, done);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment