diff options
| author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-23 16:23:34 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-01-18 04:53:14 -0500 |
| commit | 0c30f421a7dba0a7ca9a3f67dad15d84d4d61e01 (patch) | |
| tree | fa5aad7ae66f5be460f18352de357d5c6c8bfff0 | |
| parent | 56dac14cd25259fc567c5c4726a8f30f0ea407ce (diff) | |
target/spc: Expose ATO bit in control mode page
This patch updates spc_modesense_control() to set the Application
Tag Owner (ATO) bit when when DIF emulation is enabled by the
backend device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
| -rw-r--r-- | drivers/target/target_core_spc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 73fdff58d88d..43c5ca9878bc 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
| @@ -858,6 +858,19 @@ static int spc_modesense_control(struct se_device *dev, u8 pc, u8 *p) | |||
| 858 | * status (see SAM-4). | 858 | * status (see SAM-4). |
| 859 | */ | 859 | */ |
| 860 | p[5] = (dev->dev_attrib.emulate_tas) ? 0x40 : 0x00; | 860 | p[5] = (dev->dev_attrib.emulate_tas) ? 0x40 : 0x00; |
| 861 | /* | ||
| 862 | * From spc4r30, section 7.5.7 Control mode page | ||
| 863 | * | ||
| 864 | * Application Tag Owner (ATO) bit set to one. | ||
| 865 | * | ||
| 866 | * If the ATO bit is set to one the device server shall not modify the | ||
| 867 | * LOGICAL BLOCK APPLICATION TAG field and, depending on the protection | ||
| 868 | * type, shall not modify the contents of the LOGICAL BLOCK REFERENCE | ||
| 869 | * TAG field. | ||
| 870 | */ | ||
| 871 | if (dev->dev_attrib.pi_prot_type) | ||
| 872 | p[5] |= 0x80; | ||
| 873 | |||
| 861 | p[8] = 0xff; | 874 | p[8] = 0xff; |
| 862 | p[9] = 0xff; | 875 | p[9] = 0xff; |
| 863 | p[11] = 30; | 876 | p[11] = 30; |
