Annotation of embedaddon/smartmontools/atacmdnames.cpp, revision 1.1.1.2

1.1       misho       1: /*
                      2:  * atacmdnames.cpp
                      3:  *
                      4:  * Home page of code is: http://smartmontools.sourceforge.net
                      5:  *
                      6:  * Copyright (C) 2003-8 Philip Williams
1.1.1.2 ! misho       7:  * Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
1.1       misho       8:  *
                      9:  * This program is free software; you can redistribute it and/or modify
                     10:  * it under the terms of the GNU General Public License as published by
                     11:  * the Free Software Foundation; either version 2, or (at your option)
                     12:  * any later version.
                     13:  *
                     14:  * You should have received a copy of the GNU General Public License
1.1.1.2 ! misho      15:  * (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
1.1       misho      16:  *
                     17:  */
                     18: 
                     19: #include "atacmdnames.h"
                     20: #include <stdlib.h>
                     21: #include <stdio.h>
                     22: 
1.1.1.2 ! misho      23: const char * atacmdnames_cpp_cvsid = "$Id: atacmdnames.cpp 3670 2012-10-31 22:00:50Z chrfranke $"
        !            24:   ATACMDNAMES_H_CVSID;
1.1       misho      25: 
                     26: const char cmd_reserved[]        = "[RESERVED]";
                     27: const char cmd_vendor_specific[] = "[VENDOR SPECIFIC]";
                     28: const char cmd_reserved_sa[]     = "[RESERVED FOR SERIAL ATA]";
                     29: const char cmd_reserved_cf[]     = "[RESERVED FOR COMPACTFLASH ASSOCIATION]";
1.1.1.2 ! misho      30: const char cmd_reserved_mcpt[]   = "[RESERVED FOR MEDIA CARD PASS THROUGH]"; // ACS-3: Reserved
1.1       misho      31: const char cmd_recalibrate_ret4[]= "RECALIBRATE [RET-4]";
                     32: const char cmd_seek_ret4[]       = "SEEK [RET-4]";
                     33: 
1.1.1.2 ! misho      34: // Tables B.3 and B.4 of T13/2161-D (ACS-3) Revision 4, September 4, 2012
        !            35: 
        !            36: const char * const command_table[] = {
1.1       misho      37: /*-------------------------------------------------- 00h-0Fh -----*/
                     38:   "NOP",
                     39:   cmd_reserved,
                     40:   cmd_reserved,
1.1.1.2 ! misho      41:   "CFA REQUEST EXTENDED ERROR",
1.1       misho      42:   cmd_reserved,
                     43:   cmd_reserved,
1.1.1.2 ! misho      44:   "DATA SET MANAGEMENT", // ACS-2
1.1       misho      45:   cmd_reserved,
                     46:   "DEVICE RESET",
                     47:   cmd_reserved,
                     48:   cmd_reserved,
1.1.1.2 ! misho      49:   "REQUEST SENSE DATA EXT", // ACS-2
1.1       misho      50:   cmd_reserved,
                     51:   cmd_reserved,
                     52:   cmd_reserved,
                     53:   cmd_reserved,
                     54: /*-------------------------------------------------- 10h-1Fh -----*/
                     55:   "RECALIBRATE [OBS-4]",
                     56:   cmd_recalibrate_ret4,
                     57:   cmd_recalibrate_ret4,
                     58:   cmd_recalibrate_ret4,
                     59:   cmd_recalibrate_ret4,
                     60:   cmd_recalibrate_ret4,
                     61:   cmd_recalibrate_ret4,
                     62:   cmd_recalibrate_ret4,
                     63:   cmd_recalibrate_ret4,
                     64:   cmd_recalibrate_ret4,
                     65:   cmd_recalibrate_ret4,
                     66:   cmd_recalibrate_ret4,
                     67:   cmd_recalibrate_ret4,
                     68:   cmd_recalibrate_ret4,
                     69:   cmd_recalibrate_ret4,
                     70:   cmd_recalibrate_ret4,
                     71: /*-------------------------------------------------- 20h-2Fh -----*/
                     72:   "READ SECTOR(S)",
                     73:   "READ SECTOR(S) [OBS-5]",
1.1.1.2 ! misho      74:   "READ LONG [OBS-4]",
1.1       misho      75:   "READ LONG (w/o retry) [OBS-4]",
                     76:   "READ SECTOR(S) EXT",
                     77:   "READ DMA EXT",
1.1.1.2 ! misho      78:   "READ DMA QUEUED EXT [OBS-ACS-2]",
        !            79:   "READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]",
1.1       misho      80:   cmd_reserved,
                     81:   "READ MULTIPLE EXT",
                     82:   "READ STREAM DMA",
1.1.1.2 ! misho      83:   "READ STREAM",
1.1       misho      84:   cmd_reserved,
                     85:   cmd_reserved,
                     86:   cmd_reserved,
                     87:   "READ LOG EXT",
                     88: /*-------------------------------------------------- 30h-3Fh -----*/
                     89:   "WRITE SECTOR(S)",
1.1.1.2 ! misho      90:   "WRITE SECTOR(S) (w/o retry) [OBS-5]",
        !            91:   "WRITE LONG [OBS-4]",
        !            92:   "WRITE LONG (w/o retry) [OBS-4]",
1.1       misho      93:   "WRITE SECTORS(S) EXT",
                     94:   "WRITE DMA EXT",
1.1.1.2 ! misho      95:   "WRITE DMA QUEUED EXT [OBS-ACS-2]",
        !            96:   "SET NATIVE MAX ADDRESS EXT [OBS-ACS-3]",
1.1       misho      97:   "CFA WRITE SECTORS WITHOUT ERASE",
                     98:   "WRITE MULTIPLE EXT",
                     99:   "WRITE STREAM DMA",
1.1.1.2 ! misho     100:   "WRITE STREAM",
1.1       misho     101:   "WRITE VERIFY [OBS-4]",
                    102:   "WRITE DMA FUA EXT",
1.1.1.2 ! misho     103:   "WRITE DMA QUEUED FUA EXT [OBS-ACS-2]",
1.1       misho     104:   "WRITE LOG EXT",
                    105: /*-------------------------------------------------- 40h-4Fh -----*/
                    106:   "READ VERIFY SECTOR(S)",
1.1.1.2 ! misho     107:   "READ VERIFY SECTOR(S) (w/o retry) [OBS-5]",
1.1       misho     108:   "READ VERIFY SECTOR(S) EXT",
                    109:   cmd_reserved,
                    110:   cmd_reserved,
1.1.1.2 ! misho     111:   "WRITE UNCORRECTABLE EXT", // ATA-8
1.1       misho     112:   cmd_reserved,
1.1.1.2 ! misho     113:   "READ LOG DMA EXT", // ATA-8
1.1       misho     114:   cmd_reserved,
                    115:   cmd_reserved,
                    116:   cmd_reserved,
                    117:   cmd_reserved,
                    118:   cmd_reserved,
                    119:   cmd_reserved,
                    120:   cmd_reserved,
                    121:   cmd_reserved,
                    122: /*-------------------------------------------------- 50h-5Fh -----*/
                    123:   "FORMAT TRACK [OBS-4]",
                    124:   "CONFIGURE STREAM",
                    125:   cmd_reserved,
                    126:   cmd_reserved,
                    127:   cmd_reserved,
                    128:   cmd_reserved,
                    129:   cmd_reserved,
1.1.1.2 ! misho     130:   "WRITE LOG DMA EXT", // ATA-8
1.1       misho     131:   cmd_reserved,
                    132:   cmd_reserved,
                    133:   cmd_reserved,
1.1.1.2 ! misho     134:   "TRUSTED NON-DATA", // ATA-8
        !           135:   "TRUSTED RECEIVE", // ATA-8
        !           136:   "TRUSTED RECEIVE DMA", // ATA-8
        !           137:   "TRUSTED SEND", // ATA-8
        !           138:   "TRUSTED SEND DMA", // ATA-8
1.1       misho     139: /*-------------------------------------------------- 60h-6Fh -----*/
1.1.1.2 ! misho     140:   "READ FPDMA QUEUED", // ATA-8
        !           141:   "WRITE FPDMA QUEUED", // ATA-8
1.1       misho     142:   cmd_reserved_sa,
1.1.1.2 ! misho     143:   "NCQ QUEUE MANAGEMENT", // ACS-3
        !           144:   "SEND FPDMA QUEUED", // ACS-3
        !           145:   "RECEIVE FPDMA QUEUED", // ACS-3
1.1       misho     146:   cmd_reserved_sa,
                    147:   cmd_reserved_sa,
                    148:   cmd_reserved,
                    149:   cmd_reserved,
                    150:   cmd_reserved,
                    151:   cmd_reserved,
                    152:   cmd_reserved,
                    153:   cmd_reserved,
                    154:   cmd_reserved,
                    155:   cmd_reserved,
                    156: /*-------------------------------------------------- 70h-7Fh -----*/
                    157:   "SEEK [OBS-7]",
                    158:   cmd_seek_ret4,
                    159:   cmd_seek_ret4,
                    160:   cmd_seek_ret4,
                    161:   cmd_seek_ret4,
                    162:   cmd_seek_ret4,
                    163:   cmd_seek_ret4,
1.1.1.2 ! misho     164:   "SET DATE & TIME EXT", // ACS-3
        !           165:   "ACCESSIBLE MAX ADDRESS CONFIGURATION", // ACS-3
1.1       misho     166:   cmd_seek_ret4,
                    167:   cmd_seek_ret4,
                    168:   cmd_seek_ret4,
                    169:   cmd_seek_ret4,
                    170:   cmd_seek_ret4,
                    171:   cmd_seek_ret4,
                    172:   cmd_seek_ret4,
                    173: /*-------------------------------------------------- 80h-8Fh -----*/
                    174:   cmd_vendor_specific,
                    175:   cmd_vendor_specific,
                    176:   cmd_vendor_specific,
                    177:   cmd_vendor_specific,
                    178:   cmd_vendor_specific,
                    179:   cmd_vendor_specific,
                    180:   cmd_vendor_specific,
                    181:   "CFA TRANSLATE SECTOR [VS IF NO CFA]",
                    182:   cmd_vendor_specific,
                    183:   cmd_vendor_specific,
                    184:   cmd_vendor_specific,
                    185:   cmd_vendor_specific,
                    186:   cmd_vendor_specific,
                    187:   cmd_vendor_specific,
                    188:   cmd_vendor_specific,
                    189:   cmd_vendor_specific,
                    190: /*-------------------------------------------------- 90h-9Fh -----*/
                    191:   "EXECUTE DEVICE DIAGNOSTIC",
                    192:   "INITIALIZE DEVICE PARAMETERS [OBS-6]",
                    193:   "DOWNLOAD MICROCODE",
1.1.1.2 ! misho     194:   "DOWNLOAD MICROCODE DMA", // ACS-2
1.1       misho     195:   "STANDBY IMMEDIATE [RET-4]",
                    196:   "IDLE IMMEDIATE [RET-4]",
                    197:   "STANDBY [RET-4]",
                    198:   "IDLE [RET-4]",
                    199:   "CHECK POWER MODE [RET-4]",
                    200:   "SLEEP [RET-4]",
                    201:   cmd_vendor_specific,
                    202:   cmd_reserved,
                    203:   cmd_reserved,
                    204:   cmd_reserved,
                    205:   cmd_reserved,
                    206:   cmd_reserved,
                    207: /*-------------------------------------------------- A0h-AFh -----*/
                    208:   "PACKET",
                    209:   "IDENTIFY PACKET DEVICE",
1.1.1.2 ! misho     210:   "SERVICE [OBS-ACS-2]",
1.1       misho     211:   cmd_reserved,
                    212:   cmd_reserved,
                    213:   cmd_reserved,
                    214:   cmd_reserved,
                    215:   cmd_reserved,
                    216:   cmd_reserved,
                    217:   cmd_reserved,
                    218:   cmd_reserved,
                    219:   cmd_reserved,
                    220:   cmd_reserved,
                    221:   cmd_reserved,
                    222:   cmd_reserved,
                    223:   cmd_reserved,
                    224: /*-------------------------------------------------- B0h-BFh -----*/
                    225:   "SMART",
1.1.1.2 ! misho     226:   "DEVICE CONFIGURATION [OBS-ACS-3]",
1.1       misho     227:   cmd_reserved,
                    228:   cmd_reserved,
1.1.1.2 ! misho     229:   "SANITIZE DEVICE", // ACS-2
1.1       misho     230:   cmd_reserved,
1.1.1.2 ! misho     231:   "NV CACHE [OBS-ACS-3]", // ATA-8
1.1       misho     232:   cmd_reserved_cf,
                    233:   cmd_reserved_cf,
                    234:   cmd_reserved_cf,
                    235:   cmd_reserved_cf,
                    236:   cmd_reserved_cf,
1.1.1.2 ! misho     237:   cmd_reserved,
        !           238:   cmd_reserved,
        !           239:   cmd_reserved,
        !           240:   cmd_reserved,
1.1       misho     241: /*-------------------------------------------------- C0h-CFh -----*/
                    242:   "CFA ERASE SECTORS [VS IF NO CFA]",
                    243:   cmd_vendor_specific,
                    244:   cmd_vendor_specific,
                    245:   cmd_vendor_specific,
                    246:   "READ MULTIPLE",
                    247:   "WRITE MULTIPLE",
                    248:   "SET MULTIPLE MODE",
1.1.1.2 ! misho     249:   "READ DMA QUEUED [OBS-ACS-2]",
1.1       misho     250:   "READ DMA",
1.1.1.2 ! misho     251:   "READ DMA (w/o retry) [OBS-5]",
1.1       misho     252:   "WRITE DMA",
1.1.1.2 ! misho     253:   "WRITE DMA (w/o retry) [OBS-5]",
        !           254:   "WRITE DMA QUEUED [OBS-ACS-2]",
1.1       misho     255:   "CFA WRITE MULTIPLE WITHOUT ERASE",
                    256:   "WRITE MULTIPLE FUA EXT",
                    257:   cmd_reserved,
                    258: /*-------------------------------------------------- D0h-DFh -----*/
                    259:   cmd_reserved,
1.1.1.2 ! misho     260:   "CHECK MEDIA CARD TYPE [OBS-ACS-2]",
1.1       misho     261:   cmd_reserved_mcpt,
                    262:   cmd_reserved_mcpt,
                    263:   cmd_reserved_mcpt,
                    264:   cmd_reserved,
                    265:   cmd_reserved,
                    266:   cmd_reserved,
                    267:   cmd_reserved,
                    268:   cmd_reserved,
1.1.1.2 ! misho     269:   "GET MEDIA STATUS [OBS-8]",
1.1       misho     270:   "ACKNOWLEDGE MEDIA CHANGE [RET-4]",
                    271:   "BOOT POST-BOOT [RET-4]",
                    272:   "BOOT PRE-BOOT [RET-4]",
1.1.1.2 ! misho     273:   "MEDIA LOCK [OBS-8]",
        !           274:   "MEDIA UNLOCK [OBS-8]",
1.1       misho     275: /*-------------------------------------------------- E0h-EFh -----*/
                    276:   "STANDBY IMMEDIATE",
                    277:   "IDLE IMMEDIATE",
                    278:   "STANDBY",
                    279:   "IDLE",
                    280:   "READ BUFFER",
                    281:   "CHECK POWER MODE",
                    282:   "SLEEP",
                    283:   "FLUSH CACHE",
                    284:   "WRITE BUFFER",
1.1.1.2 ! misho     285:   "READ BUFFER DMA", // ACS-2 (was: WRITE SAME [RET-4])
1.1       misho     286:   "FLUSH CACHE EXT",
1.1.1.2 ! misho     287:   "WRITE BUFFER DMA", // ACS-2
1.1       misho     288:   "IDENTIFY DEVICE",
1.1.1.2 ! misho     289:   "MEDIA EJECT [OBS-8]",
1.1       misho     290:   "IDENTIFY DEVICE DMA [OBS-4]",
                    291:   "SET FEATURES",
                    292: /*-------------------------------------------------- F0h-FFh -----*/
                    293:   cmd_vendor_specific,
                    294:   "SECURITY SET PASSWORD",
                    295:   "SECURITY UNLOCK",
                    296:   "SECURITY ERASE PREPARE",
                    297:   "SECURITY ERASE UNIT",
                    298:   "SECURITY FREEZE LOCK",
                    299:   "SECURITY DISABLE PASSWORD",
                    300:   cmd_vendor_specific,
1.1.1.2 ! misho     301:   "READ NATIVE MAX ADDRESS [OBS-ACS-3]",
        !           302:   "SET MAX ADDRESS [OBS-ACS-3]",
1.1       misho     303:   cmd_vendor_specific,
                    304:   cmd_vendor_specific,
                    305:   cmd_vendor_specific,
                    306:   cmd_vendor_specific,
                    307:   cmd_vendor_specific,
                    308:   cmd_vendor_specific
                    309: };
                    310: 
1.1.1.2 ! misho     311: typedef char ASSERT_command_table_size[
        !           312:   sizeof(command_table)/sizeof(command_table[0]) == 256 ? 1 : -1];
        !           313: 
1.1       misho     314: /* Returns the name of the command (and possibly sub-command) with the given
                    315:    command code and feature register values.   For most command codes this
                    316:    simply returns the corresponding entry in the command_table array, but for
                    317:    others the value of the feature register specifies a subcommand or
                    318:    distinguishes commands. */
                    319: const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
                    320: 
                    321:   switch (c_code) {
                    322:   case 0x00:  /* NOP */
                    323:     switch (f_reg) {
                    324:     case 0x00:
                    325:       return "NOP [Abort queued commands]";
                    326:     case 0x01:
1.1.1.2 ! misho     327:       return "NOP [Don't abort queued commands] [OBS-ACS-2]";
1.1       misho     328:     default:
1.1.1.2 ! misho     329:       return "NOP [Reserved subcommand] [OBS-ACS-2]";
1.1       misho     330:     }
                    331:   case 0x92:  /* DOWNLOAD MICROCODE */
                    332:     switch (f_reg) {
                    333:     case 0x01:
1.1.1.2 ! misho     334:       return "DOWNLOAD MICROCODE [Temporary] [OBS-8]";
        !           335:     case 0x03:
        !           336:       return "DOWNLOAD MICROCODE [Save with offsets]"; // ATA-8
1.1       misho     337:     case 0x07:
                    338:       return "DOWNLOAD MICROCODE [Save]";
1.1.1.2 ! misho     339:     case 0x0e:
        !           340:       return "DOWNLOAD MICROCODE [Save for future use]"; // ACS-3
        !           341:     case 0x0f:
        !           342:       return "DOWNLOAD MICROCODE [Activate]"; // ACS-3
1.1       misho     343:     default:
                    344:       return "DOWNLOAD MICROCODE [Reserved subcommand]";
                    345:     }
                    346:   case 0xB0:  /* SMART */
                    347:     switch (f_reg) {
                    348:     case 0xD0:
                    349:       return "SMART READ DATA";
                    350:     case 0xD1:
                    351:       return "SMART READ ATTRIBUTE THRESHOLDS [OBS-4]";
                    352:     case 0xD2:
                    353:       return "SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE";
                    354:     case 0xD3:
                    355:       return "SMART SAVE ATTRIBUTE VALUES [OBS-6]";
                    356:     case 0xD4:
                    357:       return "SMART EXECUTE OFF-LINE IMMEDIATE";
                    358:     case 0xD5:
                    359:       return "SMART READ LOG";
                    360:     case 0xD6:
                    361:       return "SMART WRITE LOG";
                    362:     case 0xD7:
                    363:       return "SMART WRITE ATTRIBUTE THRESHOLDS [NS, OBS-4]";
                    364:     case 0xD8:
                    365:       return "SMART ENABLE OPERATIONS";
                    366:     case 0xD9:
                    367:       return "SMART DISABLE OPERATIONS";
                    368:     case 0xDA:
                    369:       return "SMART RETURN STATUS";
                    370:     case 0xDB:
                    371:       return "SMART EN/DISABLE AUTO OFFLINE [NS (SFF-8035i)]";
                    372:     default:
                    373:         if (f_reg >= 0xE0)
1.1.1.2 ! misho     374:           return "SMART [Vendor specific subcommand]";
1.1       misho     375:         else
1.1.1.2 ! misho     376:           return "SMART [Reserved subcommand]";
1.1       misho     377:     }
                    378:   case 0xB1:  /* DEVICE CONFIGURATION */
                    379:     switch (f_reg) {
                    380:     case 0xC0:
1.1.1.2 ! misho     381:       return "DEVICE CONFIGURATION RESTORE [OBS-ACS-3]";
1.1       misho     382:     case 0xC1:
1.1.1.2 ! misho     383:       return "DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]";
1.1       misho     384:     case 0xC2:
1.1.1.2 ! misho     385:       return "DEVICE CONFIGURATION IDENTIFY [OBS-ACS-3]";
1.1       misho     386:     case 0xC3:
1.1.1.2 ! misho     387:       return "DEVICE CONFIGURATION SET [OBS-ACS-3]";
1.1       misho     388:     default:
1.1.1.2 ! misho     389:       return "DEVICE CONFIGURATION [Reserved subcommand] [OBS-ACS-3]";
1.1       misho     390:     }
                    391:   case 0xEF:  /* SET FEATURES */
                    392:     switch (f_reg) {
                    393:     case 0x01:
1.1.1.2 ! misho     394:       return "SET FEATURES [Enable 8-bit PIO] [OBS-3]"; // Now CFA
1.1       misho     395:     case 0x02:
                    396:       return "SET FEATURES [Enable write cache]";
                    397:     case 0x03:
                    398:       return "SET FEATURES [Set transfer mode]";
                    399:     case 0x04:
                    400:       return "SET FEATURES [Enable auto DR] [OBS-4]";
                    401:     case 0x05:
                    402:       return "SET FEATURES [Enable APM]";
                    403:     case 0x06:
                    404:       return "SET FEATURES [Enable Pwr-Up In Standby]";
                    405:     case 0x07:
                    406:       return "SET FEATURES [Set device spin-up]";
                    407:     case 0x09:
1.1.1.2 ! misho     408:       return "SET FEATURES [Reserved (address offset)] [OPS-ACS-3]";
1.1       misho     409:     case 0x0A:
                    410:       return "SET FEATURES [Enable CFA power mode 1]";
                    411:     case 0x10:
1.1.1.2 ! misho     412:       return "SET FEATURES [Enable SATA feature]"; // ACS-3
1.1       misho     413:     case 0x20:
                    414:       return "SET FEATURES [Set Time-ltd R/W WCT]";
                    415:     case 0x21:
                    416:       return "SET FEATURES [Set Time-ltd R/W EH]";
                    417:     case 0x31:
1.1.1.2 ! misho     418:       return "SET FEATURES [Disable Media Status Notf] [OBS-8]";
1.1       misho     419:     case 0x33:
                    420:       return "SET FEATURES [Disable retry] [OBS-4]";
1.1.1.2 ! misho     421:     case 0x41:
        !           422:       return "SET FEATURES [Enable Free-fall Control]"; // ATA-8
1.1       misho     423:     case 0x42:
1.1.1.2 ! misho     424:       return "SET FEATURES [Enable AAM] [OBS-ACS-2]";
1.1       misho     425:     case 0x43:
                    426:       return "SET FEATURES [Set Max Host I/F S Times]";
                    427:     case 0x44:
                    428:       return "SET FEATURES [Length of VS data] [OBS-4]";
1.1.1.2 ! misho     429:     case 0x4a:
        !           430:       return "SET FEATURES [Ext. Power Conditions]"; // ACS-2
1.1       misho     431:     case 0x54:
                    432:       return "SET FEATURES [Set cache segs] [OBS-4]";
                    433:     case 0x55:
                    434:       return "SET FEATURES [Disable read look-ahead]";
                    435:     case 0x5D:
1.1.1.2 ! misho     436:       return "SET FEATURES [Enable release interrupt] [OBS-ACS-2]";
1.1       misho     437:     case 0x5E:
1.1.1.2 ! misho     438:       return "SET FEATURES [Enable SERVICE interrupt] [OBS-ACS-2]";
1.1       misho     439:     case 0x66:
                    440:       return "SET FEATURES [Disable revert defaults]";
1.1.1.2 ! misho     441:     case 0x69:
        !           442:       return "SET FEATURES [LPS Error Reporting Control]"; // ACS-2
1.1       misho     443:     case 0x77:
                    444:       return "SET FEATURES [Disable ECC] [OBS-4]";
                    445:     case 0x81:
1.1.1.2 ! misho     446:       return "SET FEATURES [Disable 8-bit PIO] [OBS-3]"; // Now CFA
1.1       misho     447:     case 0x82:
                    448:       return "SET FEATURES [Disable write cache]";
                    449:     case 0x84:
                    450:       return "SET FEATURES [Disable auto DR] [OBS-4]";
                    451:     case 0x85:
                    452:       return "SET FEATURES [Disable APM]";
                    453:     case 0x86:
                    454:       return "SET FEATURES [Disable Pwr-Up In Standby]";
                    455:     case 0x88:
                    456:       return "SET FEATURES [Disable ECC] [OBS-4]";
                    457:     case 0x89:
                    458:       return "SET FEATURES [Reserved (address offset)]";
                    459:     case 0x8A:
                    460:       return "SET FEATURES [Disable CFA power mode 1]";
                    461:     case 0x90:
1.1.1.2 ! misho     462:       return "SET FEATURES [Disable SATA feature]"; // ACS-3
1.1       misho     463:     case 0x95:
1.1.1.2 ! misho     464:       return "SET FEATURES [Enable Media Status Notf] [OBS-8]";
1.1       misho     465:     case 0x99:
                    466:       return "SET FEATURES [Enable retries] [OBS-4]";
                    467:     case 0x9A:
                    468:       return "SET FEATURES [Set max avg curr] [OBS-4]";
                    469:     case 0xAA:
                    470:       return "SET FEATURES [Enable read look-ahead]";
                    471:     case 0xAB:
                    472:       return "SET FEATURES [Set max prefetch] [OBS-4]";
                    473:     case 0xBB:
                    474:       return "SET FEATURES [4 bytes VS data] [OBS-4]";
1.1.1.2 ! misho     475:     case 0xC1:
        !           476:       return "SET FEATURES [Disable Free-fall Control]"; // ATA-8
1.1       misho     477:     case 0xC2:
1.1.1.2 ! misho     478:       return "SET FEATURES [Disable AAM] [OBS-ACS-2]";
        !           479:     case 0xC3:
        !           480:       return "SET FEATURES [Sense Data Reporting]"; // ACS-2
1.1       misho     481:     case 0xCC:
                    482:       return "SET FEATURES [Enable revert to defaults]";
                    483:     case 0xDD:
1.1.1.2 ! misho     484:       return "SET FEATURES [Disable release interrupt] [OBS-ACS-2]";
1.1       misho     485:     case 0xDE:
1.1.1.2 ! misho     486:       return "SET FEATURES [Disable SERVICE interrupt] [OBS-ACS-2]";
1.1       misho     487:     case 0xE0:
1.1.1.2 ! misho     488:       return "SET FEATURES [Vendor specific] [OBS-7]";
1.1       misho     489:     default:
                    490:       if (f_reg >= 0xF0)
                    491:         return "SET FEATURES [Reserved for CFA]";
                    492:       else
                    493:         return "SET FEATURES [Reserved subcommand]";
                    494:     }
                    495:   case 0xF9:  /* SET MAX */
                    496:     switch (f_reg) {
                    497:     case 0x00:
                    498:       return "SET MAX ADDRESS [OBS-6]";
                    499:     case 0x01:
1.1.1.2 ! misho     500:       return "SET MAX SET PASSWORD [OBS-ACS-3]";
1.1       misho     501:     case 0x02:
1.1.1.2 ! misho     502:       return "SET MAX LOCK [OBS-ACS-3]";
1.1       misho     503:     case 0x03:
1.1.1.2 ! misho     504:       return "SET MAX UNLOCK [OBS-ACS-3]";
1.1       misho     505:     case 0x04:
1.1.1.2 ! misho     506:       return "SET MAX FREEZE LOCK [OBS-ACS-3]";
1.1       misho     507:     default:
1.1.1.2 ! misho     508:       return "SET MAX [Reserved subcommand] [OBS-ACS-3]";
1.1       misho     509:     }
                    510:   default:
                    511:     return command_table[c_code];
                    512:   }
                    513: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>