- /*
- * ATA Pass-Through 16 byte command, as described in
- *
- * T10 04-262r8 ATA Command Pass-Through
- *
- * from http://www.t10.org/ftp/t10/document.04/04-262r8.pdf
- */
- memset(cdb, 0, sizeof(cdb));
- cdb[0] = 0x85; /* OPERATION CODE: 16 byte pass through */
- cdb[1] = 4 << 1; /* PROTOCOL: PIO Data-in */
- cdb[2] = 0x2e; /* OFF_LINE=0, CK_COND=1, T_DIR=1, BYT_BLOK=1, T_LENGTH=2 */
- cdb[3] = 0; /* FEATURES */
- cdb[4] = 0; /* FEATURES */
- cdb[5] = 0; /* SECTORS */
- cdb[6] = 1; /* SECTORS */
- cdb[7] = 0; /* LBA LOW */
- cdb[8] = 0; /* LBA LOW */
- cdb[9] = 0; /* LBA MID */
- cdb[10] = 0; /* LBA MID */
- cdb[11] = 0; /* LBA HIGH */
- cdb[12] = 0; /* LBA HIGH */
- cdb[13] = 0; /* DEVICE */
- cdb[14] = 0xA1; /* Command: ATA IDENTIFY PACKET DEVICE */;
- cdb[15] = 0; /* CONTROL */
- memset(sense, 0, sizeof(sense));
-
- memset(&io_v4, 0, sizeof(struct sg_io_v4));
- io_v4.guard = 'Q';
- io_v4.protocol = BSG_PROTOCOL_SCSI;
- io_v4.subprotocol = BSG_SUB_PROTOCOL_SCSI_CMD;
- io_v4.request_len = sizeof (cdb);
- io_v4.request = (uintptr_t) cdb;
- io_v4.max_response_len = sizeof (sense);
- io_v4.response = (uintptr_t) sense;
- io_v4.din_xfer_len = buf_len;
- io_v4.din_xferp = (uintptr_t) buf;
- io_v4.timeout = COMMAND_TIMEOUT_MSEC;
-