#ifndef _SYS_SCSIIO_H_
#define _SYS_SCSIIO_H_
#include <sys/types.h>
#include <sys/ioctl.h>
#define SENSEBUFLEN 48
typedef struct scsireq {
u_long flags;
u_long timeout;
u_char cmd[16];
u_char cmdlen;
void * databuf;
u_long datalen;
u_long datalen_used;
u_char sense[SENSEBUFLEN];
u_char senselen;
u_char senselen_used;
u_char status;
u_char retsts;
int error;
} scsireq_t;
#define SCCMD_READ 0x00000001
#define SCCMD_WRITE 0x00000002
#define SCCMD_IOV 0x00000004
#define SCCMD_ESCAPE 0x00000010
#define SCCMD_TARGET 0x00000020
#define SCCMD_OK 0x00
#define SCCMD_TIMEOUT 0x01
#define SCCMD_BUSY 0x02
#define SCCMD_SENSE 0x03
#define SCCMD_UNKNOWN 0x04
#define SCIOCCOMMAND _IOWR('Q', 1, scsireq_t)
#define SC_DB_CMDS 0x00000001
#define SC_DB_FLOW 0x00000002
#define SC_DB_FLOW2 0x00000004
#define SC_DB_DMA 0x00000008
#define SCIOCDEBUG _IOW('Q', 2, int)
struct oscsi_addr {
int scbus;
int target;
int lun;
};
struct scsi_addr {
int type;
#define TYPE_SCSI 0
#define TYPE_ATAPI 1
union {
struct oscsi_addr scsi;
struct _atapi {
int atbus;
int drive;
} atapi;
} addr;
};
#define SCIOCIDENTIFY _IOR('Q', 4, struct scsi_addr)
#define OSCIOCIDENTIFY _IOR('Q', 4, struct oscsi_addr)
#define SCIOCDECONFIG _IO('Q', 5)
#define SCIOCRECONFIG _IO('Q', 6)
#define SCIOCRESET _IO('Q', 7)
struct scbusioscan_args {
int sa_target;
int sa_lun;
};
#define SCBUSIOSCAN _IOW('U', 0, struct scbusioscan_args)
#define SCBUSIORESET _IO('U', 1)
struct scbusiodetach_args {
int sa_target;
int sa_lun;
};
#define SCBUSIODETACH _IOW('U', 2, struct scbusiodetach_args)
struct scbusaccel_args {
int sa_target;
int sa_lun;
int sa_flags;
};
#define SC_ACCEL_SYNC 0x01
#define SC_ACCEL_WIDE 0x02
#define SC_ACCEL_TAGS 0x04
#define SCBUSACCEL _IOW('U', 2, struct scbusaccel_args)
#define SCBUSIOLLSCAN _IO('U', 3)
#endif