#ifndef LIBTIO_IO_SCSI_H # define LIBTIO_IO_SCSI_H 20190429 # include "../cdefs.h" TIO_BEGIN_NAMESPACE /* An SCSI stream serves for interacting with an SCSI-enabled device. * Using such a stream, you can send an SCSI request and receive the answer. * * An SCSI request can be followed with data in two directions: to the * device and from the device: * `TIO_SCSI_DIREC_NONE`: no data. * `TIO_SCSI_DIREC_TO_DEV`: outgoing data. * `TIO_SCSI_DIREC_FROM_DEV`: incoming data. */ # define TIO_SCSI_DIREC_NONE 0 # define TIO_SCSI_DIREC_TO_DEV 1 # define TIO_SCSI_DIREC_FROM_DEV 2 /* Here is the request structure: * * `cmd`: the raw command buffer (of 6, 10, 12 or 16 bytes). * `cmd_len`: the command length (in bytes). * `direction` the data transfer direction. * `data`: the data to transfer (send or receive buffer). * `data_len`: the data length. * `status`: the status byte returned by the device. */ TIO_STRUCT(tio_scsi_request, tio_scsi_request_t) struct tio_scsi_request { void *tio_scsi_request_cmd; size_t tio_scsi_request_cmd_len; int tio_scsi_request_direction; void *tio_scsi_request_data; size_t tio_scsi_request_data_len; int tio_scsi_request_status; }; TIO_END_NAMESPACE #endif /* LIBTIO_IO_SCSI_H */