FreeBSD/Linux Kernel Cross Reference
sys/sys/scsiio.h
1 /*
2 * $FreeBSD: src/sys/sys/scsiio.h,v 1.6.2.1 1999/09/05 08:22:50 peter Exp $
3 */
4 #ifndef _SYS_SCSIIO_H_
5 #define _SYS_SCSIIO_H_
6
7 #ifndef KERNEL
8 #include <sys/types.h>
9 #endif
10 #include <sys/ioccom.h>
11
12 #define SENSEBUFLEN 48
13
14 typedef struct scsireq {
15 u_long flags; /* info about the request status and type */
16 u_long timeout;
17 u_char cmd[16]; /* 12 is actually the max */
18 u_char cmdlen;
19 caddr_t databuf; /* address in user space of buffer */
20 u_long datalen; /* size of user buffer (request) */
21 u_long datalen_used; /* size of user buffer (used)*/
22 u_char sense[SENSEBUFLEN]; /* returned sense will be in here */
23 u_char senselen; /* sensedata request size (MAX of SENSEBUFLEN)*/
24 u_char senselen_used; /* return value only */
25 u_char status; /* what the scsi status was from the adapter */
26 u_char retsts; /* the return status for the command */
27 int error; /* error bits */
28 } scsireq_t;
29
30 /* bit definitions for flags */
31 #define SCCMD_READ 0x00000001
32 #define SCCMD_WRITE 0x00000002
33 #define SCCMD_IOV 0x00000004
34 #define SCCMD_ESCAPE 0x00000010
35 #define SCCMD_TARGET 0x00000020
36
37
38 /* definitions for the return status (retsts) */
39 #define SCCMD_OK 0x00
40 #define SCCMD_TIMEOUT 0x01
41 #define SCCMD_BUSY 0x02
42 #define SCCMD_SENSE 0x03
43 #define SCCMD_UNKNOWN 0x04
44
45 #define SCIOCCOMMAND _IOWR('Q', 1, scsireq_t)
46
47 #define SC_DB_CMDS 0x00000001 /* show all scsi cmds and errors */
48 #define SC_DB_FLOW 0x00000002 /* show routines entered */
49 #define SC_DB_FLOW2 0x00000004 /* show path INSIDE routines */
50 #define SC_DB_DMA 0x00000008 /* show DMA segments etc */
51 #define SCIOCDEBUG _IOW('Q', 2, int) /* from 0 to 15 */
52
53 struct scsi_addr {
54 int scbus; /* -1 if wildcard */
55 int target; /* -1 if wildcard */
56 int lun; /* -1 if wildcard */
57 } ;
58
59 #define SCIOCREPROBE _IOW('Q', 3, struct scsi_addr) /* look for new devs */
60 #define SCIOCIDENTIFY _IOR('Q', 4, struct scsi_addr) /* where are you? */
61 #define SCIOCDECONFIG _IO('Q', 5) /* please disappear */
62 #define SCIOCRECONFIG _IO('Q', 6) /* please check again */
63 #define SCIOCRESET _IO('Q', 7) /* reset the device */
64 #define SCIOCADDR _IOW('Q', 8, struct scsi_addr) /* Change address */
65 #define SCIOCFREEZE _IO('Q', 9) /* Freeze SCSI */
66 #define SCIOCTHAW _IO('Q', 10) /* Thaw SCSI */
67 #define SCIOCFREEZETHAW _IOW('Q', 11, int) /* Freeze SCSI for some seconds */
68 #define SCIOCWAITTHAW _IO('Q', 12) /* Wait for SCSI to thaw */
69
70 #endif /* !_SYS_SCSIIO_H_ */
Cache object: 9f8fc62299b105544780a73a6c496a12
|