2 * Copyright (c) 2016 Spectra Logic Corporation
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions, and the following disclaimer,
10 * without modification.
11 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12 * substantially similar to the "NO WARRANTY" disclaimer below
13 * ("Disclaimer") and any redistribution must be conditioned upon
14 * including a substantially similar Disclaimer requirement for further
15 * binary redistribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGES.
30 * Authors: Ken Merry (Spectra Logic Corporation)
33 * ATA Extended Power Conditions (EPC) support
36 #include <sys/cdefs.h>
37 #include <sys/ioctl.h>
38 #include <sys/stdint.h>
39 #include <sys/types.h>
40 #include <sys/endian.h>
42 #include <sys/queue.h>
58 #include <cam/cam_debug.h>
59 #include <cam/cam_ccb.h>
60 #include <cam/scsi/scsi_all.h>
61 #include <cam/scsi/scsi_da.h>
62 #include <cam/scsi/scsi_pass.h>
63 #include <cam/scsi/scsi_message.h>
65 #include "camcontrol.h"
68 EPC_ACTION_NONE = 0x00,
69 EPC_ACTION_LIST = 0x01,
70 EPC_ACTION_TIMER_SET = 0x02,
71 EPC_ACTION_IMMEDIATE = 0x03,
72 EPC_ACTION_GETMODE = 0x04
75 static struct scsi_nv epc_flags[] = {
76 { "Supported", ATA_PCL_COND_SUPPORTED },
77 { "Saveable", ATA_PCL_COND_SUPPORTED },
78 { "Changeable", ATA_PCL_COND_CHANGEABLE },
79 { "Default Timer Enabled", ATA_PCL_DEFAULT_TIMER_EN },
80 { "Saved Timer Enabled", ATA_PCL_SAVED_TIMER_EN },
81 { "Current Timer Enabled", ATA_PCL_CURRENT_TIMER_EN },
82 { "Hold Power Condition Not Supported", ATA_PCL_HOLD_PC_NOT_SUP }
85 static struct scsi_nv epc_power_cond_map[] = {
86 { "Standby_z", ATA_EPC_STANDBY_Z },
87 { "z", ATA_EPC_STANDBY_Z },
88 { "Standby_y", ATA_EPC_STANDBY_Y },
89 { "y", ATA_EPC_STANDBY_Y },
90 { "Idle_a", ATA_EPC_IDLE_A },
91 { "a", ATA_EPC_IDLE_A },
92 { "Idle_b", ATA_EPC_IDLE_B },
93 { "b", ATA_EPC_IDLE_B },
94 { "Idle_c", ATA_EPC_IDLE_C },
95 { "c", ATA_EPC_IDLE_C }
98 static struct scsi_nv epc_rst_val[] = {
99 { "default", ATA_SF_EPC_RST_DFLT },
103 static struct scsi_nv epc_ps_map[] = {
104 { "unknown", ATA_SF_EPC_SRC_UNKNOWN },
105 { "battery", ATA_SF_EPC_SRC_BAT },
106 { "notbattery", ATA_SF_EPC_SRC_NOT_BAT }
110 * These aren't subcommands of the EPC SET FEATURES subcommand, but rather
111 * commands that determine the current capabilities and status of the drive.
112 * The EPC subcommands are limited to 4 bits, so we won't collide with any
115 #define CCTL_EPC_GET_STATUS 0x8001
116 #define CCTL_EPC_LIST 0x8002
118 static struct scsi_nv epc_cmd_map[] = {
119 { "restore", ATA_SF_EPC_RESTORE },
120 { "goto", ATA_SF_EPC_GOTO },
121 { "timer", ATA_SF_EPC_SET_TIMER },
122 { "state", ATA_SF_EPC_SET_STATE },
123 { "enable", ATA_SF_EPC_ENABLE },
124 { "disable", ATA_SF_EPC_DISABLE },
125 { "source", ATA_SF_EPC_SET_SOURCE },
126 { "status", CCTL_EPC_GET_STATUS },
127 { "list", CCTL_EPC_LIST }
130 static int epc_list(struct cam_device *device, camcontrol_devtype devtype,
131 union ccb *ccb, int retry_count, int timeout);
132 static void epc_print_pcl_desc(struct ata_power_cond_log_desc *desc,
134 static int epc_getmode(struct cam_device *device, camcontrol_devtype devtype,
135 union ccb *ccb, int retry_count, int timeout,
137 static int epc_set_features(struct cam_device *device,
138 camcontrol_devtype devtype, union ccb *ccb,
139 int retry_count, int timeout, int action,
140 int power_cond, int timer, int enable, int save,
141 int delayed_entry, int hold, int power_src,
145 epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, const char *prefix)
148 unsigned int i, num_printed, max_chars;
153 num_printed = printf("%sFlags: ", prefix);
154 for (i = 0; i < (sizeof(epc_flags) / sizeof(epc_flags[0])); i++) {
155 if ((desc->flags & epc_flags[i].value) == 0)
158 num_printed += printf(", ");
160 if ((num_printed + strlen(epc_flags[i].name)) > max_chars) {
162 num_printed = printf("%s ", prefix);
164 num_printed += printf("%s", epc_flags[i].name);
171 printf("%sDefault timer setting: %.1f sec\n", prefix,
172 (double)(le32dec(desc->default_timer) / 10));
173 printf("%sSaved timer setting: %.1f sec\n", prefix,
174 (double)(le32dec(desc->saved_timer) / 10));
175 printf("%sCurrent timer setting: %.1f sec\n", prefix,
176 (double)(le32dec(desc->current_timer) / 10));
177 printf("%sNominal time to active: %.1f sec\n", prefix,
178 (double)(le32dec(desc->nom_time_to_active) / 10));
179 printf("%sMinimum timer: %.1f sec\n", prefix,
180 (double)(le32dec(desc->min_timer) / 10));
181 printf("%sMaximum timer: %.1f sec\n", prefix,
182 (double)(le32dec(desc->max_timer) / 10));
183 printf("%sNumber of transitions to power condition: %u\n", prefix,
184 le32dec(desc->num_transitions_to_pc));
185 printf("%sHours in power condition: %u\n", prefix,
186 le32dec(desc->hours_in_pc));
190 epc_list(struct cam_device *device, camcontrol_devtype devtype, union ccb *ccb,
191 int retry_count, int timeout)
193 struct ata_power_cond_log_idle *idle_log;
194 struct ata_power_cond_log_standby *standby_log;
195 uint8_t log_buf[sizeof(*idle_log) + sizeof(*standby_log)];
196 uint16_t log_addr = ATA_POWER_COND_LOG;
197 uint16_t page_number = ATA_PCL_IDLE;
201 lba = (((uint64_t)page_number & 0xff00) << 32) |
202 ((page_number & 0x00ff) << 8) |
205 error = build_ata_cmd(ccb,
206 /*retry_count*/ retry_count,
207 /*flags*/ CAM_DIR_IN | CAM_DEV_QFRZDIS,
208 /*tag_action*/ MSG_SIMPLE_Q_TAG,
209 /*protocol*/ AP_PROTO_DMA | AP_EXTEND,
210 /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS |
211 AP_FLAG_TLEN_SECT_CNT |
212 AP_FLAG_TDIR_FROM_DEV,
216 /*command*/ ATA_READ_LOG_DMA_EXT,
218 /*data_ptr*/ log_buf,
219 /*dxfer_len*/ sizeof(log_buf),
220 /*cdb_storage*/ NULL,
221 /*cdb_storage_len*/ 0,
222 /*sense_len*/ SSD_FULL_SIZE,
223 /*timeout*/ timeout ? timeout : 60000,
225 /*devtype*/ devtype);
228 warnx("%s: build_ata_cmd() failed, likely programmer error",
234 ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
236 error = cam_send_ccb(device, ccb);
238 warn("error sending ATA READ LOG EXT CCB");
243 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
244 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL,stderr);
249 idle_log = (struct ata_power_cond_log_idle *)log_buf;
251 (struct ata_power_cond_log_standby *)&log_buf[sizeof(*idle_log)];
253 printf("ATA Power Conditions Log:\n");
254 printf(" Idle power conditions page:\n");
255 printf(" Idle A condition:\n");
256 epc_print_pcl_desc(&idle_log->idle_a_desc, " ");
257 printf(" Idle B condition:\n");
258 epc_print_pcl_desc(&idle_log->idle_b_desc, " ");
259 printf(" Idle C condition:\n");
260 epc_print_pcl_desc(&idle_log->idle_c_desc, " ");
261 printf(" Standby power conditions page:\n");
262 printf(" Standby Y condition:\n");
263 epc_print_pcl_desc(&standby_log->standby_y_desc, " ");
264 printf(" Standby Z condition:\n");
265 epc_print_pcl_desc(&standby_log->standby_z_desc, " ");
271 epc_getmode(struct cam_device *device, camcontrol_devtype devtype,
272 union ccb *ccb, int retry_count, int timeout, int power_only)
274 struct ata_params *ident = NULL;
275 struct ata_identify_log_sup_cap sup_cap;
276 const char *mode_name = NULL;
277 uint8_t error = 0, ata_device = 0, status = 0;
280 uint32_t page_number, log_address;
283 int res_available = 0;
289 goto check_power_mode;
292 * Get standard ATA Identify data.
294 retval = ata_do_identify(device, retry_count, timeout, ccb, &ident);
296 warnx("Couldn't get identify data");
301 * Get the ATA Identify Data Log (0x30),
302 * Supported Capabilities Page (0x03).
304 log_address = ATA_IDENTIFY_DATA_LOG;
305 page_number = ATA_IDL_SUP_CAP;
306 lba = (((uint64_t)page_number & 0xff00) << 32) |
307 ((page_number & 0x00ff) << 8) |
308 (log_address & 0xff);
310 bzero(&sup_cap, sizeof(sup_cap));
312 * XXX KDM check the supported protocol.
314 retval = build_ata_cmd(ccb,
315 /*retry_count*/ retry_count,
316 /*flags*/ CAM_DIR_IN | CAM_DEV_QFRZDIS,
317 /*tag_action*/ MSG_SIMPLE_Q_TAG,
318 /*protocol*/ AP_PROTO_DMA |
320 /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS |
321 AP_FLAG_TLEN_SECT_CNT |
322 AP_FLAG_TDIR_FROM_DEV,
326 /*command*/ ATA_READ_LOG_DMA_EXT,
328 /*data_ptr*/ (uint8_t *)&sup_cap,
329 /*dxfer_len*/ sizeof(sup_cap),
330 /*cdb_storage*/ NULL,
331 /*cdb_storage_len*/ 0,
332 /*sense_len*/ SSD_FULL_SIZE,
333 /*timeout*/ timeout ? timeout : 60000,
335 /*devtype*/ devtype);
338 warnx("%s: build_ata_cmd() failed, likely a programmer error",
344 ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
346 retval = cam_send_ccb(device, ccb);
348 warn("error sending ATA READ LOG CCB");
353 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
354 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL,stderr);
359 if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
360 avail_bytes = ccb->csio.dxfer_len - ccb->csio.resid;
362 avail_bytes = ccb->ataio.dxfer_len - ccb->ataio.resid;
364 if (avail_bytes < (int)sizeof(sup_cap)) {
365 warnx("Couldn't get enough of the ATA Supported "
366 "Capabilities log, %d bytes returned", avail_bytes);
370 caps = le64dec(sup_cap.sup_cap);
371 if ((caps & ATA_SUP_CAP_VALID) == 0) {
372 warnx("Supported capabilities bits are not valid");
377 printf("APM: %sSupported, %sEnabled\n",
378 (ident->support.command2 & ATA_SUPPORT_APM) ? "" : "NOT ",
379 (ident->enabled.command2 & ATA_SUPPORT_APM) ? "" : "NOT ");
380 printf("EPC: %sSupported, %sEnabled\n",
381 (ident->support2 & ATA_SUPPORT_EPC) ? "" : "NOT ",
382 (ident->enabled2 & ATA_ENABLED_EPC) ? "" : "NOT ");
383 printf("Low Power Standby %sSupported\n",
384 (caps & ATA_SC_LP_STANDBY_SUP) ? "" : "NOT ");
385 printf("Set EPC Power Source %sSupported\n",
386 (caps & ATA_SC_SET_EPC_PS_SUP) ? "" : "NOT ");
391 retval = build_ata_cmd(ccb,
392 /*retry_count*/ retry_count,
393 /*flags*/ CAM_DIR_NONE | CAM_DEV_QFRZDIS,
394 /*tag_action*/ MSG_SIMPLE_Q_TAG,
395 /*protocol*/ AP_PROTO_NON_DATA |
397 /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS |
398 AP_FLAG_TLEN_NO_DATA |
400 /*features*/ ATA_SF_EPC,
403 /*command*/ ATA_CHECK_POWER_MODE,
407 /*cdb_storage*/ NULL,
408 /*cdb_storage_len*/ 0,
409 /*sense_len*/ SSD_FULL_SIZE,
410 /*timeout*/ timeout ? timeout : 60000,
412 /*devtype*/ devtype);
415 warnx("%s: build_ata_cmd() failed, likely a programmer error",
421 ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
423 retval = cam_send_ccb(device, ccb);
425 warn("error sending ATA CHECK POWER MODE CCB");
431 * Check to see whether we got the requested ATA result if this
432 * is an SCSI ATA PASS-THROUGH command.
434 if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR)
435 && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND)) {
436 int error_code, sense_key, asc, ascq;
438 retval = scsi_extract_sense_ccb(ccb, &error_code,
439 &sense_key, &asc, &ascq);
441 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL,
446 if ((sense_key == SSD_KEY_RECOVERED_ERROR)
453 if (((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
454 && (res_available == 0)) {
455 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL,stderr);
460 retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device,
463 warnx("Unable to get ATA CHECK POWER MODE result");
468 mode_name = scsi_nv_to_str(epc_power_cond_map,
469 sizeof(epc_power_cond_map) / sizeof(epc_power_cond_map[0]), count);
470 printf("Current power state: ");
471 /* Note: ident can be null in power_only mode */
473 || (ident->enabled2 & ATA_ENABLED_EPC)) {
474 if (mode_name != NULL)
475 printf("%s", mode_name);
476 else if (count == ATA_PM_ACTIVE_IDLE) {
477 printf("PM0:Active or PM1:Idle");
482 printf("PM2:Standby");
487 case ATA_PM_ACTIVE_IDLE:
488 printf("PM0:Active or PM1:Idle");
492 printf("(0x%02x)\n", count);
497 if (caps & ATA_SC_LP_STANDBY_SUP) {
500 wait_mode = (lba >> 20) & 0xff;
501 if (wait_mode == 0xff) {
502 printf("Device not waiting to enter lower power "
505 mode_name = scsi_nv_to_str(epc_power_cond_map,
506 sizeof(epc_power_cond_map) /
507 sizeof(epc_power_cond_map[0]), wait_mode);
508 printf("Device waiting to enter mode %s (0x%02x)\n",
509 (mode_name != NULL) ? mode_name : "Unknown",
512 printf("Device is %sheld in the current power condition\n",
513 (lba & 0x80000) ? "" : "NOT ");
521 epc_set_features(struct cam_device *device, camcontrol_devtype devtype,
522 union ccb *ccb, int retry_count, int timeout, int action,
523 int power_cond, int timer, int enable, int save,
524 int delayed_entry, int hold, int power_src, int restore_src)
535 case ATA_SF_EPC_SET_TIMER:
536 lba |= ((timer << ATA_SF_EPC_TIMER_SHIFT) &
537 ATA_SF_EPC_TIMER_MASK);
539 case ATA_SF_EPC_SET_STATE:
540 lba |= (enable ? ATA_SF_EPC_TIMER_EN : 0) |
541 (save ? ATA_SF_EPC_TIMER_SAVE : 0);
544 case ATA_SF_EPC_GOTO:
546 lba |= (delayed_entry ? ATA_SF_EPC_GOTO_DELAY : 0) |
547 (hold ? ATA_SF_EPC_GOTO_HOLD : 0);
549 case ATA_SF_EPC_RESTORE:
551 (save ? ATA_SF_EPC_RST_SAVE : 0);
553 case ATA_SF_EPC_ENABLE:
554 case ATA_SF_EPC_DISABLE:
556 case ATA_SF_EPC_SET_SOURCE:
561 error = build_ata_cmd(ccb,
562 /*retry_count*/ retry_count,
563 /*flags*/ CAM_DIR_NONE | CAM_DEV_QFRZDIS,
564 /*tag_action*/ MSG_SIMPLE_Q_TAG,
565 /*protocol*/ AP_PROTO_NON_DATA | AP_EXTEND,
566 /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS |
567 AP_FLAG_TLEN_NO_DATA |
568 AP_FLAG_TDIR_FROM_DEV,
569 /*features*/ ATA_SF_EPC,
570 /*sector_count*/ count,
572 /*command*/ ATA_SETFEATURES,
576 /*cdb_storage*/ NULL,
577 /*cdb_storage_len*/ 0,
578 /*sense_len*/ SSD_FULL_SIZE,
579 /*timeout*/ timeout ? timeout : 60000,
581 /*devtype*/ devtype);
584 warnx("%s: build_ata_cmd() failed, likely a programmer error",
590 ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
592 error = cam_send_ccb(device, ccb);
594 warn("error sending ATA SET FEATURES CCB");
599 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
600 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL,stderr);
610 epc(struct cam_device *device, int argc, char **argv, char *combinedopt,
611 int retry_count, int timeout, int verbosemode __unused)
613 union ccb *ccb = NULL;
617 camcontrol_devtype devtype;
618 double timer_val = -1;
619 int timer_tenths = 0, power_cond = -1;
620 int delayed_entry = 0, hold = 0;
621 int enable = -1, save = 0;
622 int restore_src = -1;
627 ccb = cam_getccb(device);
629 warnx("%s: error allocating CCB", __func__);
634 while ((c = getopt(argc, argv, combinedopt)) != -1) {
637 scsi_nv_status status;
640 status = scsi_get_nv(epc_cmd_map,
641 (sizeof(epc_cmd_map) / sizeof(epc_cmd_map[0])),
642 optarg, &entry_num, SCSI_NV_FLAG_IG_CASE);
643 if (status == SCSI_NV_FOUND)
644 action = epc_cmd_map[entry_num].value;
646 warnx("%s: %s: %s option %s", __func__,
647 (status == SCSI_NV_AMBIGUOUS) ?
648 "ambiguous" : "invalid", "epc command",
668 scsi_nv_status status;
671 status = scsi_get_nv(epc_power_cond_map,
672 (sizeof(epc_power_cond_map) /
673 sizeof(epc_power_cond_map[0])), optarg,
674 &entry_num, SCSI_NV_FLAG_IG_CASE);
675 if (status == SCSI_NV_FOUND)
676 power_cond =epc_power_cond_map[entry_num].value;
678 warnx("%s: %s: %s option %s", __func__,
679 (status == SCSI_NV_AMBIGUOUS) ?
680 "ambiguous" : "invalid", "power condition",
691 scsi_nv_status status;
694 status = scsi_get_nv(epc_rst_val,
695 (sizeof(epc_rst_val) /
696 sizeof(epc_rst_val[0])), optarg,
697 &entry_num, SCSI_NV_FLAG_IG_CASE);
698 if (status == SCSI_NV_FOUND)
699 restore_src = epc_rst_val[entry_num].value;
701 warnx("%s: %s: %s option %s", __func__,
702 (status == SCSI_NV_AMBIGUOUS) ?
703 "ambiguous" : "invalid",
704 "restore value source", optarg);
714 scsi_nv_status status;
717 status = scsi_get_nv(epc_ps_map,
718 (sizeof(epc_ps_map) / sizeof(epc_ps_map[0])),
719 optarg, &entry_num, SCSI_NV_FLAG_IG_CASE);
720 if (status == SCSI_NV_FOUND)
721 power_src = epc_ps_map[entry_num].value;
723 warnx("%s: %s: %s option %s", __func__,
724 (status == SCSI_NV_AMBIGUOUS) ?
725 "ambiguous" : "invalid", "power source",
735 timer_val = strtod(optarg, &endptr);
737 warnx("Invalid timer value %f", timer_val);
740 } else if (*endptr != '\0') {
741 warnx("Invalid timer value %s", optarg);
745 timer_tenths = timer_val * 10;
754 warnx("Must specify an action");
759 error = get_device_type(device, retry_count, timeout,
760 /*printerrors*/ 1, &devtype);
762 errx(1, "Unable to determine device type");
769 warnx("The epc subcommand only works with ATA protocol "
773 break; /*NOTREACHED*/
777 case ATA_SF_EPC_SET_TIMER:
778 if (timer_val == -1) {
779 warnx("Must specify a timer value (-T time)");
783 case ATA_SF_EPC_SET_STATE:
785 warnx("Must specify enable (-e) or disable (-d)");
789 case ATA_SF_EPC_GOTO:
790 if (power_cond == -1) {
791 warnx("Must specify a power condition with -p");
797 case ATA_SF_EPC_SET_SOURCE:
798 if (power_src == -1) {
799 warnx("Must specify a power source (-S battery or "
800 "-S notbattery) value");
805 case ATA_SF_EPC_RESTORE:
806 if (restore_src == -1) {
807 warnx("Must specify a source for restored value, "
808 "-r default or -r saved");
813 case ATA_SF_EPC_ENABLE:
814 case ATA_SF_EPC_DISABLE:
815 case CCTL_EPC_GET_STATUS:
822 case CCTL_EPC_GET_STATUS:
823 error = epc_getmode(device, devtype, ccb, retry_count, timeout,
827 error = epc_list(device, devtype, ccb, retry_count, timeout);
829 case ATA_SF_EPC_RESTORE:
830 case ATA_SF_EPC_GOTO:
831 case ATA_SF_EPC_SET_TIMER:
832 case ATA_SF_EPC_SET_STATE:
833 case ATA_SF_EPC_ENABLE:
834 case ATA_SF_EPC_DISABLE:
835 case ATA_SF_EPC_SET_SOURCE:
836 error = epc_set_features(device, devtype, ccb, retry_count,
837 timeout, action, power_cond, timer_tenths, enable, save,
838 delayed_entry, hold, power_src, restore_src);
841 warnx("Not implemented yet");