ide: Reject ATA commands specific to drive kinds

ACS-2 Table B.2 explicitly prohibits ATAPI devices from implementing
WIN_RECAL, WIN_READ_EXT, WIN_READDMA_EXT, WIN_READ_NATIVE_MAX,
WIN_MULTREAD_EXT, WIN_WRITE, WIN_WRITE_ONCE, WIN_WRITE_EXT,
WIN_WRITEDMA_EXT, WIN_MULTWRITE_EXT, WIN_WRITE_VERIFY, WIN_VERIFY,
WIN_VERIFY_ONCE, WIN_VERIFY_EXT, WIN_SPECIFY, WIN_MULTREAD,
WIN_MULTWRITE, WIN_SETMULT, WIN_READDMA, WIN_READDMA_ONCE,
WIN_WRITEDMA, WIN_WRITEDMA_ONCE, WIN_FLUSH_CACHE_EXT.  Restrict them
to IDE_HD and IDE_CFATA.

Same for CFA_WRITE_SECT_WO_ERASE, CFA_WRITE_MULTI_WO_ERASE.  Restrict
them to IDE_CFATA, like the other CFA_ commands.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2011-09-06 18:58:36 +02:00 committed by Kevin Wolf
parent 844505b12e
commit 3cfc22692e
1 changed files with 25 additions and 25 deletions

View File

@ -913,27 +913,27 @@ static const uint8_t ide_cmd_table[0x100] = {
[CFA_REQ_EXT_ERROR_CODE] = CFA_OK,
[WIN_DSM] = ALL_OK,
[WIN_DEVICE_RESET] = CD_OK,
[WIN_RECAL] = ALL_OK,
[WIN_RECAL] = HD_CFA_OK,
[WIN_READ] = ALL_OK,
[WIN_READ_ONCE] = ALL_OK,
[WIN_READ_EXT] = ALL_OK,
[WIN_READDMA_EXT] = ALL_OK,
[WIN_READ_NATIVE_MAX_EXT] = ALL_OK,
[WIN_MULTREAD_EXT] = ALL_OK,
[WIN_WRITE] = ALL_OK,
[WIN_WRITE_ONCE] = ALL_OK,
[WIN_WRITE_EXT] = ALL_OK,
[WIN_WRITEDMA_EXT] = ALL_OK,
[CFA_WRITE_SECT_WO_ERASE] = ALL_OK,
[WIN_MULTWRITE_EXT] = ALL_OK,
[WIN_WRITE_VERIFY] = ALL_OK,
[WIN_VERIFY] = ALL_OK,
[WIN_VERIFY_ONCE] = ALL_OK,
[WIN_VERIFY_EXT] = ALL_OK,
[WIN_READ_EXT] = HD_CFA_OK,
[WIN_READDMA_EXT] = HD_CFA_OK,
[WIN_READ_NATIVE_MAX_EXT] = HD_CFA_OK,
[WIN_MULTREAD_EXT] = HD_CFA_OK,
[WIN_WRITE] = HD_CFA_OK,
[WIN_WRITE_ONCE] = HD_CFA_OK,
[WIN_WRITE_EXT] = HD_CFA_OK,
[WIN_WRITEDMA_EXT] = HD_CFA_OK,
[CFA_WRITE_SECT_WO_ERASE] = CFA_OK,
[WIN_MULTWRITE_EXT] = HD_CFA_OK,
[WIN_WRITE_VERIFY] = HD_CFA_OK,
[WIN_VERIFY] = HD_CFA_OK,
[WIN_VERIFY_ONCE] = HD_CFA_OK,
[WIN_VERIFY_EXT] = HD_CFA_OK,
[WIN_SEEK] = HD_CFA_OK,
[CFA_TRANSLATE_SECTOR] = CFA_OK,
[WIN_DIAGNOSE] = ALL_OK,
[WIN_SPECIFY] = ALL_OK,
[WIN_SPECIFY] = HD_CFA_OK,
[WIN_STANDBYNOW2] = ALL_OK,
[WIN_IDLEIMMEDIATE2] = ALL_OK,
[WIN_STANDBY2] = ALL_OK,
@ -945,14 +945,14 @@ static const uint8_t ide_cmd_table[0x100] = {
[WIN_SMART] = HD_CFA_OK,
[CFA_ACCESS_METADATA_STORAGE] = CFA_OK,
[CFA_ERASE_SECTORS] = CFA_OK,
[WIN_MULTREAD] = ALL_OK,
[WIN_MULTWRITE] = ALL_OK,
[WIN_SETMULT] = ALL_OK,
[WIN_READDMA] = ALL_OK,
[WIN_READDMA_ONCE] = ALL_OK,
[WIN_WRITEDMA] = ALL_OK,
[WIN_WRITEDMA_ONCE] = ALL_OK,
[CFA_WRITE_MULTI_WO_ERASE] = ALL_OK,
[WIN_MULTREAD] = HD_CFA_OK,
[WIN_MULTWRITE] = HD_CFA_OK,
[WIN_SETMULT] = HD_CFA_OK,
[WIN_READDMA] = HD_CFA_OK,
[WIN_READDMA_ONCE] = HD_CFA_OK,
[WIN_WRITEDMA] = HD_CFA_OK,
[WIN_WRITEDMA_ONCE] = HD_CFA_OK,
[CFA_WRITE_MULTI_WO_ERASE] = CFA_OK,
[WIN_STANDBYNOW1] = ALL_OK,
[WIN_IDLEIMMEDIATE] = ALL_OK,
[WIN_STANDBY] = ALL_OK,
@ -960,7 +960,7 @@ static const uint8_t ide_cmd_table[0x100] = {
[WIN_CHECKPOWERMODE1] = ALL_OK,
[WIN_SLEEPNOW1] = ALL_OK,
[WIN_FLUSH_CACHE] = ALL_OK,
[WIN_FLUSH_CACHE_EXT] = ALL_OK,
[WIN_FLUSH_CACHE_EXT] = HD_CFA_OK,
[WIN_IDENTIFY] = ALL_OK,
[WIN_SETFEATURES] = ALL_OK,
[IBM_SENSE_CONDITION] = CFA_OK,