added my responsibility for the `cpm' port
[unix-history] / sys / sys / scsiio.h
CommitLineData
519fb2b7
RG
1
2#ifndef _SYS_SCSIIO_H_
3#define _SYS_SCSIIO_H_
4
5
6#include <sys/types.h>
7#include <sys/ioctl.h>
8
9#define SENSEBUFLEN 48
10
11typedef struct scsireq {
12 u_long flags; /* info about the request status and type */
13 u_long timeout;
14 u_char cmd[16]; /* 12 is actually the max */
15 u_char cmdlen;
16 caddr_t databuf; /* address in user space of buffer */
17 u_long datalen; /* size of user buffer (request) */
18 u_long datalen_used; /* size of user buffer (used)*/
19 u_char sense[SENSEBUFLEN]; /* returned sense will be in here */
20 u_char senselen; /* sensedata request size (MAX of SENSEBUFLEN)*/
21 u_char senselen_used; /* return value only */
22 u_char status; /* what the scsi status was from the adapter */
23 u_char retsts; /* the return status for the command */
24 int error; /* error bits */
25} scsireq_t;
26
27/* bit defintions for flags */
28#define SCCMD_READ 0x00000001
29#define SCCMD_WRITE 0x00000002
30#define SCCMD_IOV 0x00000004
31#define SCCMD_ESCAPE 0x00000010
32#define SCCMD_TARGET 0x00000020
33
34
35/* definitions for the return status (retsts) */
36#define SCCMD_OK 0x00
37#define SCCMD_TIMEOUT 0x01
38#define SCCMD_BUSY 0x02
39#define SCCMD_SENSE 0x03
40#define SCCMD_UNKNOWN 0x04
41
42#define SCIOCCOMMAND _IOWR('Q', 1, scsireq_t)
43
44#define SC_DB_CMDS 0x00000001 /* show all scsi cmds and errors */
45#define SC_DB_FLOW 0x00000002 /* show routines entered */
46#define SC_DB_FLOW2 0x00000004 /* show path INSIDE routines */
47#define SC_DB_DMA 0x00000008 /* show DMA segments etc */
48#define SCIOCDEBUG _IOW('Q', 2, int) /* from 0 to 15 */
49
50struct scsi_addr {
51 int scbus; /* -1 if wildcard */
52 int target; /* -1 if wildcard */
53 int lun; /* -1 if wildcard */
54} ;
55
56#define SCIOCREPROBE _IOW('Q', 3, struct scsi_addr) /* look for new devs */
57#define SCIOCIDENTIFY _IOR('Q', 4, struct scsi_addr) /* where are you? */
58#define SCIOCDECONFIG _IO('Q', 5) /* please dissappear */
59#define SCIOCRECONFIG _IO('Q', 6) /* please check again */
60#define SCIOCRESET _IO('Q', 7) /* reset the device */
61
62
63#endif /* _SYS_SCSIIO_H_ */