Added the ability to see names of the virtual key codes.
[wine.git] / dlls / winaspi / winescsi.h
blob5f171d7d60328abec213c1124200df7b2b134f22
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 #define SG_NEXT_CMD_LEN 0x2283 /* override SCSI command length with given
9 number on the next write() on this file descriptor */
11 /* This is what the linux kernel thinks.... */
12 static const unsigned char scsi_command_size[8] =
14 6, 10, 10, 12,
15 12, 12, 10, 10
18 struct sg_header
20 int pack_len; /* [o] reply_len (ie useless), ignored as input */
21 int reply_len; /* [i] max length of expected reply (inc. sg_header) */
22 int pack_id; /* [io] id number of packet (use ints >= 0) */
23 int result; /* [o] 0==ok, else (+ve) Unix errno (best ignored) */
24 unsigned int twelve_byte:1;
25 /* [i] Force 12 byte command length for group 6 & 7 commands */
26 unsigned int target_status:5; /* [o] scsi status from target */
27 unsigned int host_status:8; /* [o] host status (see "DID" codes) */
28 unsigned int driver_status:8; /* [o] driver status+suggestion */
29 unsigned int other_flags:10; /* unused */
30 unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases:
31 when target_status is CHECK_CONDITION or
32 when target_status is COMMAND_TERMINATED or
33 when (driver_status & DRIVER_SENSE) is true. */
34 }; /* This structure is 36 bytes long on i386 */
36 #define SCSI_OFF sizeof(struct sg_header)
38 #define SG_SET_TIMEOUT 0x2201
39 #define SG_GET_TIMEOUT 0x2202
40 #define SCSI_DEFAULT_TIMEOUT 6000*5 /* 5 minutes */
41 #endif
44 /* RegKey used for SCSI info under HKEY_DYN_DATA */
45 #define KEYNAME_SCSI "WineScsi"
46 #define KEYNAME_SCSI_CONTROLLERMAP "ControllerMap"
48 /* Function prototypes from dlls/wnaspi32/aspi.c */
49 void
50 SCSI_Init();
52 int
53 ASPI_GetNumControllers();
55 int
56 SCSI_OpenDevice( int h, int c, int t, int d );
58 int
59 SCSI_LinuxSetTimeout( int fd, int timeout );
61 #ifdef linux
62 BOOL
63 SCSI_LinuxDeviceIo( int fd,
64 struct sg_header * lpvInBuffer, DWORD cbInBuffer,
65 struct sg_header * lpvOutBuffer, DWORD cbOutBuffer,
66 LPDWORD lpcbBytesReturned );
68 void
69 SCSI_Fix_CMD_LEN( int fd, int cmd, int len );
70 #endif
72 BOOL
73 SCSI_GetDeviceName(int h, int c, int t, int d, LPSTR devstr, LPDWORD lpcbData);
75 DWORD
76 ASPI_GetHCforController( int controller );
78 /*** This is where we throw some miscellaneous crap ***/
80 #define ASPI_POSTING(prb) (prb->SRB_Flags & 0x1)
82 /* WNASPI32/WINASPI defs */
83 #define HOST_TO_TARGET(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x2)
84 #define TARGET_TO_HOST(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x1)
85 #define NO_DATA_TRANSFERED(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x3)
88 #define INQUIRY_VENDOR 8
90 #define MUSTEK_SCSI_AREA_AND_WINDOWS 0x04
91 #define MUSTEK_SCSI_READ_SCANNED_DATA 0x08
92 #define MUSTEK_SCSI_GET_IMAGE_STATUS 0x0f
93 #define MUSTEK_SCSI_ADF_AND_BACKTRACE 0x10
94 #define MUSTEK_SCSI_CCD_DISTANCE 0x11
95 #define MUSTEK_SCSI_START_STOP 0x1b
98 #define INQURIY_CMDLEN 6
99 #define INQURIY_REPLY_LEN 96
100 #define INQUIRY_VENDOR 8
102 #define SENSE_BUFFER(prb) (&prb->CDBByte[prb->SRB_CDBLen])
104 /* Just a container for seeing what devices are open */
105 struct ASPI_DEVICE_INFO {
106 struct ASPI_DEVICE_INFO * next;
107 int fd;
108 int hostId;
109 int target;
110 int lun;
113 typedef struct ASPI_DEVICE_INFO ASPI_DEVICE_INFO;
115 /*** End Miscellaneous crap ***/
117 #endif /* #ifndef __WINESCSI_H */