Re: [PATCH v2 5/5] ata: libata-scsi: support the all command format for reporting supported commands
Hannes Reinecke <[email protected]>
| Newsgroups | org.kernel.vger.linux-ide |
|---|---|
| Message-ID | <[email protected]> |
On 7/2/26 8:34 AM, Damien Le Moal wrote: > Add support to ata_scsi_report_supported_opcodes() for the all command > format indicated with a reporting option of 0. The function > ata_scsi_report_all_supported_opcodes() is introduced to implement this > support. This function operates by testing all commands of the > ata_supported_cmds array and testing them using > ata_scsi_cmd_is_supported(), filling rbuf as it loops through all the > commands that libata can emulate or translate. > > With this change, sg_opcodes /dev/sdX is able to list all commands > supported by libata and a device. An example below is shown for a SATA > disk also supporting CDL: > > # sg_opcodes /dev/sda > ATA WDC WUH722626AL WZ41 > Peripheral device type: disk > > Opcode Service CDB RWCDLP, Name > (hex) action(h) size CDLP > ----------------------------------------------- > 00 6 0,0 Test Unit Ready > 01 6 0,0 Rezero Unit > 03 6 0,0 Request Sense > 08 6 0,0 Read(6) > 0a 6 0,0 Write(6) > 0b 6 0,0 Seek(6) > 12 6 0,0 Inquiry > 15 6 0,0 Mode select(6) > 1a 6 0,0 Mode sense(6) > 1b 6 0,0 Start stop unit > 1d 6 0,0 Send diagnostic > 25 10 0,0 Read capacity(10) > 28 10 0,0 Read(10) > 2a 10 0,0 Write(10) > 2b 10 0,0 Seek(10) > 2f 10 0,0 Verify(10) > 35 10 0,0 Synchronize cache(10) > 55 10 0,0 Mode select(10) > 5a 10 0,0 Mode sense(10) > 7f 1ff0 32 0,0 ATA pass-through(32) > 85 16 0,0 ATA pass-through(16) > 88 16 1,1 Read(16) > 8a 16 1,2 Write(16) > 8f 16 0,0 Verify(16) > 91 16 0,0 Synchronize cache(16) > 93 16 0,0 Write same(16) > 9e 10 16 0,0 Read capacity(16) > a0 12 0,0 Report luns > a1 12 0,0 ATA pass-through(12) > a3 c 12 0,0 Report supported operation codes > > Signed-off-by: Damien Le Moal <[email protected]> > --- > drivers/ata/libata-scsi.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > Reviewed-by: Hannes Reinecke <[email protected]> Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich