+ // for dev use 12 bytes cdb, READ_CAPACITY must use the 10 bytes variation.
+ if (port->device->cbd_size == SCSI_CDB12) {
+ struct scsi_cdb12* cdb12 = (struct scsi_cdb12*)cmd_table->atapi_cmd;
+ // ugly tricks to construct 10 byte cdb from 12 byte cdb
+ scsi_create_packet12(cdb12, SCSI_READ_CAPACITY_10, 0, 512 << 8);
+ } else {
+ struct scsi_cdb16* cdb16 = (struct scsi_cdb16*)cmd_table->atapi_cmd;
+ scsi_create_packet16(cdb16, SCSI_READ_CAPACITY_16, 0, 512);
+ cdb16->misc1 = 0x10; // service action
+ }
+