Utility to convert between Unix and Windows paths at the command
[wine/multimedia.git] / dlls / winaspi / winescsi.h
blob6d7efbbd77e5ba3efb400e0bd7dbd311e45f597b
1 /*
2 * Copyright (C) 2000 David Elliott <dfe@infinite-internet.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINESCSI_H__
20 #define __WINESCSI_H__
22 #ifdef linux
23 /* Copy of info from 2.2.x kernel */
24 #define SG_MAX_SENSE 16 /* too little, unlikely to change in 2.2.x */
26 #define SG_NEXT_CMD_LEN 0x2283 /* override SCSI command length with given
27 number on the next write() on this file descriptor */
29 /* This is what the linux kernel thinks.... */
30 static const unsigned char scsi_command_size[8] =
32 6, 10, 10, 12,
33 12, 12, 10, 10
36 struct sg_header
38 int pack_len; /* [o] reply_len (ie useless), ignored as input */
39 int reply_len; /* [i] max length of expected reply (inc. sg_header) */
40 int pack_id; /* [io] id number of packet (use ints >= 0) */
41 int result; /* [o] 0==ok, else (+ve) Unix errno (best ignored) */
42 unsigned int twelve_byte:1;
43 /* [i] Force 12 byte command length for group 6 & 7 commands */
44 unsigned int target_status:5; /* [o] scsi status from target */
45 unsigned int host_status:8; /* [o] host status (see "DID" codes) */
46 unsigned int driver_status:8; /* [o] driver status+suggestion */
47 unsigned int other_flags:10; /* unused */
48 unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases:
49 when target_status is CHECK_CONDITION or
50 when target_status is COMMAND_TERMINATED or
51 when (driver_status & DRIVER_SENSE) is true. */
52 }; /* This structure is 36 bytes long on i386 */
54 #define SCSI_OFF sizeof(struct sg_header)
56 #define SG_SET_TIMEOUT 0x2201
57 #define SG_GET_TIMEOUT 0x2202
58 #define SCSI_DEFAULT_TIMEOUT 6000*5 /* 5 minutes */
59 #endif
62 /* RegKey used for SCSI info under HKEY_DYN_DATA */
63 #define KEYNAME_SCSI "WineScsi"
64 #define KEYNAME_SCSI_CONTROLLERMAP "ControllerMap"
66 /* Function prototypes from dlls/wnaspi32/aspi.c */
67 void
68 SCSI_Init();
70 int
71 ASPI_GetNumControllers();
73 int
74 SCSI_OpenDevice( int h, int c, int t, int d );
76 int
77 SCSI_LinuxSetTimeout( int fd, int timeout );
79 #ifdef linux
80 BOOL
81 SCSI_LinuxDeviceIo( int fd,
82 struct sg_header * lpvInBuffer, DWORD cbInBuffer,
83 struct sg_header * lpvOutBuffer, DWORD cbOutBuffer,
84 LPDWORD lpcbBytesReturned );
86 void
87 SCSI_Fix_CMD_LEN( int fd, int cmd, int len );
88 #endif
90 BOOL
91 SCSI_GetDeviceName(int h, int c, int t, int d, LPSTR devstr, LPDWORD lpcbData);
93 DWORD
94 ASPI_GetHCforController( int controller );
96 /*** This is where we throw some miscellaneous crap ***/
98 #define ASPI_POSTING(prb) (prb->SRB_Flags & 0x1)
100 /* WNASPI32/WINASPI defs */
101 #define HOST_TO_TARGET(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x2)
102 #define TARGET_TO_HOST(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x1)
103 #define NO_DATA_TRANSFERED(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x3)
106 #define INQUIRY_VENDOR 8
108 #define MUSTEK_SCSI_AREA_AND_WINDOWS 0x04
109 #define MUSTEK_SCSI_READ_SCANNED_DATA 0x08
110 #define MUSTEK_SCSI_GET_IMAGE_STATUS 0x0f
111 #define MUSTEK_SCSI_ADF_AND_BACKTRACE 0x10
112 #define MUSTEK_SCSI_CCD_DISTANCE 0x11
113 #define MUSTEK_SCSI_START_STOP 0x1b
116 #define INQURIY_CMDLEN 6
117 #define INQURIY_REPLY_LEN 96
118 #define INQUIRY_VENDOR 8
120 #define SENSE_BUFFER(prb) (&prb->CDBByte[prb->SRB_CDBLen])
122 /* Just a container for seeing what devices are open */
123 struct ASPI_DEVICE_INFO {
124 struct ASPI_DEVICE_INFO * next;
125 int fd;
126 int hostId;
127 int target;
128 int lun;
131 typedef struct ASPI_DEVICE_INFO ASPI_DEVICE_INFO;
133 /*** End Miscellaneous crap ***/
135 #endif /* #ifndef __WINESCSI_H */