This source file includes following definitions.
- scsireq_t
1
2
3
4 #ifndef _SYS_SCSIIO_H_
5 #define _SYS_SCSIIO_H_
6
7
8 #include <sys/types.h>
9 #include <sys/ioctl.h>
10
11 #define SENSEBUFLEN 48
12
13 typedef struct scsireq {
14 u_long flags;
15 u_long timeout;
16 u_char cmd[16];
17 u_char cmdlen;
18 caddr_t databuf;
19 u_long datalen;
20 u_long datalen_used;
21 u_char sense[SENSEBUFLEN];
22 u_char senselen;
23 u_char senselen_used;
24 u_char status;
25 u_char retsts;
26 int error;
27 } scsireq_t;
28
29
30 #define SCCMD_READ 0x00000001
31 #define SCCMD_WRITE 0x00000002
32 #define SCCMD_IOV 0x00000004
33 #define SCCMD_ESCAPE 0x00000010
34 #define SCCMD_TARGET 0x00000020
35
36
37
38 #define SCCMD_OK 0x00
39 #define SCCMD_TIMEOUT 0x01
40 #define SCCMD_BUSY 0x02
41 #define SCCMD_SENSE 0x03
42 #define SCCMD_UNKNOWN 0x04
43
44 #define SCIOCCOMMAND _IOWR('Q', 1, scsireq_t)
45
46 #define SC_DB_CMDS 0x00000001
47 #define SC_DB_FLOW 0x00000002
48 #define SC_DB_FLOW2 0x00000004
49 #define SC_DB_DMA 0x00000008
50 #define SCIOCDEBUG _IOW('Q', 2, int)
51
52 struct oscsi_addr {
53 int scbus;
54 int target;
55 int lun;
56 } ;
57
58 struct scsi_addr {
59 int type;
60 #define TYPE_SCSI 0
61 #define TYPE_ATAPI 1
62 int scbus;
63 int target;
64 int lun;
65 };
66
67 #define SCIOCRESET _IO('Q', 7)
68 #define SCIOCIDENTIFY _IOR('Q', 9, struct scsi_addr)
69
70 struct sbioc_device {
71 void *sd_cookie;
72 int sd_target;
73 int sd_lun;
74 };
75
76 #define SBIOCPROBE _IOWR('Q', 127, struct sbioc_device)
77 #define SBIOCDETACH _IOWR('Q', 128, struct sbioc_device)
78
79 #endif