Abey George (of Macadamian/Corel)
[wine.git] / dlls / winaspi / winescsi.h
blob0ef40ed5c510a9ba9887fcac8bc71e638c5de1de
1 #ifndef __WINESCSI_H__
2 #define __WINESCSI_H__
4 #ifdef linux
5 /* Copy of info from 2.2.x kernel */
6 #define SG_MAX_SENSE 16 /* too little, unlikely to change in 2.2.x */
8 struct sg_header
10 int pack_len; /* [o] reply_len (ie useless), ignored as input */
11 int reply_len; /* [i] max length of expected reply (inc. sg_header) */
12 int pack_id; /* [io] id number of packet (use ints >= 0) */
13 int result; /* [o] 0==ok, else (+ve) Unix errno (best ignored) */
14 unsigned int twelve_byte:1;
15 /* [i] Force 12 byte command length for group 6 & 7 commands */
16 unsigned int target_status:5; /* [o] scsi status from target */
17 unsigned int host_status:8; /* [o] host status (see "DID" codes) */
18 unsigned int driver_status:8; /* [o] driver status+suggestion */
19 unsigned int other_flags:10; /* unused */
20 unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases:
21 when target_status is CHECK_CONDITION or
22 when target_status is COMMAND_TERMINATED or
23 when (driver_status & DRIVER_SENSE) is true. */
24 }; /* This structure is 36 bytes long on i386 */
26 #define SCSI_OFF sizeof(struct sg_header)
28 #define SG_SET_TIMEOUT 0x2201
29 #define SG_GET_TIMEOUT 0x2202
30 #define SCSI_DEFAULT_TIMEOUT 6000*5 /* 5 minutes */
31 #endif
34 /* RegKey used for SCSI info under HKEY_DYN_DATA */
35 #define KEYNAME_SCSI "WineScsi"
37 /* Function prototypes from dlls/wnaspi32/aspi.c */
38 void
39 SCSI_Init();
41 int
42 ASPI_GetNumControllers();
44 int
45 SCSI_OpenDevice( int h, int c, int t, int d );
47 int
48 SCSI_LinuxSetTimeout( int fd, int timeout );
50 #ifdef linux
51 BOOL
52 SCSI_LinuxDeviceIo( int fd,
53 struct sg_header * lpvInBuffer, DWORD cbInBuffer,
54 struct sg_header * lpvOutBuffer, DWORD cbOutBuffer,
55 LPDWORD lpcbBytesReturned );
56 #endif
58 BOOL
59 SCSI_GetDeviceName(int h, int c, int t, int d, LPSTR devstr, LPDWORD lpcbData);
61 DWORD
62 ASPI_GetHCforController( int controller );
64 /*** This is where we throw some miscellaneous crap ***/
66 #define ASPI_POSTING(prb) (prb->SRB_Flags & 0x1)
68 /* WNASPI32/WINASPI defs */
69 #define HOST_TO_TARGET(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x2)
70 #define TARGET_TO_HOST(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x1)
71 #define NO_DATA_TRANSFERED(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x3)
74 #define INQUIRY_VENDOR 8
76 #define MUSTEK_SCSI_AREA_AND_WINDOWS 0x04
77 #define MUSTEK_SCSI_READ_SCANNED_DATA 0x08
78 #define MUSTEK_SCSI_GET_IMAGE_STATUS 0x0f
79 #define MUSTEK_SCSI_ADF_AND_BACKTRACE 0x10
80 #define MUSTEK_SCSI_CCD_DISTANCE 0x11
81 #define MUSTEK_SCSI_START_STOP 0x1b
84 #define INQURIY_CMDLEN 6
85 #define INQURIY_REPLY_LEN 96
86 #define INQUIRY_VENDOR 8
88 #define SENSE_BUFFER(prb) (&prb->CDBByte[prb->SRB_CDBLen])
90 /* Just a container for seeing what devices are open */
91 struct ASPI_DEVICE_INFO {
92 struct ASPI_DEVICE_INFO * next;
93 int fd;
94 int hostId;
95 int target;
96 int lun;
99 typedef struct ASPI_DEVICE_INFO ASPI_DEVICE_INFO;
101 /*** End Miscellaneous crap ***/
103 #endif /* #ifndef __WINESCSI_H */