4 * SCSI scanner driver interface
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 #pragma GCC system_header
36 #define IOCTL_SCSISCAN_CMD \
37 CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_CMD_CODE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
39 #define IOCTL_SCSISCAN_LOCKDEVICE \
40 CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_LOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
42 #define IOCTL_SCSISCAN_SET_TIMEOUT \
43 CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_SET_TIMEOUT, METHOD_BUFFERED, FILE_ANY_ACCESS)
45 #define IOCTL_SCSISCAN_GET_INFO \
46 CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_GET_INFO, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
48 #define IOCTL_SCSISCAN_UNLOCKDEVICE \
49 CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_UNLOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
52 /* SCSISCAN_CMD.SrbFlags constants */
53 #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
54 #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
55 #define SRB_FLAGS_DATA_IN 0x00000040
56 #define SRB_FLAGS_DATA_OUT 0x00000080
57 #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
59 /* SCSISCAN_CMD.pSrbStatus constants */
60 #define SRB_STATUS_PENDING 0x00
61 #define SRB_STATUS_SUCCESS 0x01
62 #define SRB_STATUS_ABORTED 0x02
63 #define SRB_STATUS_ABORT_FAILED 0x03
64 #define SRB_STATUS_ERROR 0x04
65 #define SRB_STATUS_BUSY 0x05
66 #define SRB_STATUS_INVALID_REQUEST 0x06
67 #define SRB_STATUS_INVALID_PATH_ID 0x07
68 #define SRB_STATUS_NO_DEVICE 0x08
69 #define SRB_STATUS_TIMEOUT 0x09
70 #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
71 #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
72 #define SRB_STATUS_MESSAGE_REJECTED 0x0D
73 #define SRB_STATUS_BUS_RESET 0x0E
74 #define SRB_STATUS_PARITY_ERROR 0x0F
75 #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
76 #define SRB_STATUS_NO_HBA 0x11
77 #define SRB_STATUS_DATA_OVERRUN 0x12
78 #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
79 #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
80 #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
81 #define SRB_STATUS_REQUEST_FLUSHED 0x16
82 #define SRB_STATUS_INVALID_LUN 0x20
83 #define SRB_STATUS_INVALID_TARGET_ID 0x21
84 #define SRB_STATUS_BAD_FUNCTION 0x22
85 #define SRB_STATUS_ERROR_RECOVERY 0x23
86 #define SRB_STATUS_QUEUE_FROZEN 0x40
87 #define SRB_STATUS_AUTOSENSE_VALID 0x80
89 #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
91 typedef struct _SCSISCAN_CMD
{
103 } SCSISCAN_CMD
, *PSCSISCAN_CMD
;
105 #define MAX_STRING 128
107 /* SCSISCAN_INFO.Flags constants */
108 #define SCSISCAN_RESERVED 0x000
109 #define SCSISCAN_CMD_CODE 0x004
110 #define SCSISCAN_LOCKDEVICE 0x005
111 #define SCSISCAN_UNLOCKDEVICE 0x006
112 #define SCSISCAN_SET_TIMEOUT 0x007
113 #define SCSISCAN_GET_INFO 0x008
115 typedef struct _SCSISCAN_INFO
{
122 UCHAR AdapterName
[MAX_STRING
];
124 } SCSISCAN_INFO
, *PSCSISCAN_INFO
;
130 #endif /* __SCSISCAN_H */