ata: libata-scsi: improve ata_scsiop_maint_in()
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Thu, 29 Dec 2022 17:00:03 +0000 (18:00 +0100)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 4 Jan 2023 04:41:16 +0000 (13:41 +0900)
Allow translation of REPORT_SUPPORTED_OPERATION_CODES commands using
the command format 0x3, that is, checking support for commands that are
identified using an opcode and a service action.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
drivers/ata/libata-scsi.c

index e1c43f9f6bb2973d956872b523950f005fa76027..46109bde8a04b04e2fab84d4f97b098226ef1d60 100644 (file)
@@ -3266,11 +3266,12 @@ static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf)
        u8 supported = 0;
        unsigned int err = 0;
 
-       if (cdb[2] != 1) {
+       if (cdb[2] != 1 && cdb[2] != 3) {
                ata_dev_warn(dev, "invalid command format %d\n", cdb[2]);
                err = 2;
                goto out;
        }
+
        switch (cdb[3]) {
        case INQUIRY:
        case MODE_SENSE: