When a SCSI miniport calls ScsiPortLogError, ScsiPort allocates an error
log packet and calls the appropriate routine to write to the system event
log. The error log packet is a structure of type IO_ERROR_LOG_PACKET as
defined in the Windows NT DDK file NTDDK.h:
typedef struct _IO_ERROR_LOG_PACKET { // Offset: Length:
UCHAR MajorFunctionCode; // 0x00 1
UCHAR RetryCount; // 0x01 1
USHORT DumpDataSize; // 0x02 2
USHORT NumberOfStrings; // 0x04 2
USHORT StringOffset; // 0x06 2
USHORT EventCategory; // 0x08 2
// 0x0a 2 padding bytes
NTSTATUS ErrorCode; // 0x0c 4
ULONG UniqueErrorValue; // 0x10 4
NTSTATUS FinalStatus; // 0x14 4
ULONG SequenceNumber; // 0x18 4
ULONG IoControlCode; // 0x1c 4
LARGE_INTEGER DeviceOffset; // 0x20 8
ULONG DumpData[1]; // 0x28 SCSIPORT specific
}IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
The DumpData for SCSI miniports is always four ULONG values:
DumpData[0] = PathId
DumpData[1] = TargetId
DumpData[2] = Lun
DumpData[3] = ErrorCode
From the Windows NT DDK documentation and the file SRB.h, there are
currently ten SCSI errors defined. The SCSI miniport calls ScsiPortLogError
and supplies a SCSI error (SP_xxx) as the ErrorCode parameter. The ScsiPort
driver translated the SCSI error into a Windows NT error code (IO_ERR_xxx)
according to the table below:
SCSI error Logged error
-------------------------- -----------------------
SP_BUS_PARITY_ERROR IO_ERR_PARITY
SP_UNEXPECTED_DISCONNECT IO_ERR_CONTROLLER_ERROR
SP_INVALID_RESELECTION IO_ERR_CONTROLLER_ERROR
SP_BUS_TIME_OUT IO_ERR_TIMEOUT
SP_PROTOCOL_ERROR IO_ERR_CONTROLLER_ERROR
SP_INTERNAL_ADAPTER_ERROR IO_ERR_CONTROLLER_ERROR
SP_IRQ_NOT_RESPONDING IO_ERR_INCORRECT_IRQL
SP_BAD_FW_ERROR IO_ERR_BAD_FIRMWARE
SP_BAD_FW_WARNING IO_WRN_BAD_FIRMWARE
SP_REQUEST_TIMEOUT IO_ERR_CONTROLLER_ERROR
Dump data example 1: controller errors
This error is written to the system event log at the request of the SCSI
miniport that is calling ScsiPortLogError. The UniqueErrorValue is
specified by the SCSI miniport, and it means different things to different
SCSI miniport drivers.
Event ID: 11
Source: ScsiDrv
The driver detected a controller error on \Device\ScsiPort0.
Data (bytes):
0000: 0f 00 10 00 01 00 68 00
0008: 00 00 00 00 0b 00 04 c0
0010: 12 00 02 00 00 00 00 00
0018: 95 63 00 00 00 00 00 00
0020: 00 00 00 00 00 00 00 00
0028: 00 00 00 00 04 00 00 00
0030: 00 00 00 00 02 00 00 00
Data (words):
0000: 0010000f 00680001 00000000 c004000b
0010: 00020012 00000000 00006395 00000000
0020: 00000000 00000000 00000000 00000004
0030: 00000000 00000002
Offset Len Value
------ --- -----------
0 1 0x0f MajorFunctionCode 0xf = IRP_MJ_SCSI
1 1 0x00 RetryCount
2 2 0x0010 DumpDataSize 0x10 (16) bytes
4 2 0x0001 NumberOfStrings
6 2 0x0068 StringOffset
8 2 0x0000 EventCategory
a 2 0x0000 padding
c 4 0xc004000b ErrorCode (IO_ERR_xxx) IO_ERR_CONTROLLER_ERROR
10 4 0x00020012 UniqueErrorValue Unique miniport value
14 4 0x00000000 FinalStatus
18 4 0x00006395 SequenceNumber
1c 4 0x00000000 IoControlCode
20 8 0x00000000 DeviceOffset
0x00000000
28 4 0x00000000 PathId Path 0
2c 4 0x00000004 TargetId Target 4
30 4 0x00000000 Lun Lun 0
34 4 0x00000002 ErrorCode (SP_xxx) SP_UNEXPECTED_DISCONNECT
Dump data example 2: timeout errors
This particular error is not logged by the SCSI miniport directly. The
error is logged by ScsiPort when ScsiPortTickHandler determines that a
timeout has occurred. There are two primary types of timeouts (there may be
others that are not described in this document). The two types of timeouts
are distinguished by the presence (or absence) of the ASCII character "P"
in offset 0x13 of the byte data.
The first type of timeout is one in which the I/O did not complete in the
allotted time frame. Within the SRB for each I/O is a TimeOutValue, in
seconds, which is longer for larger data transfers and shorter for smaller
data transfers. This type of timeout is indicated by a UniqueErrorValue
equal to 0x00000100 in the event log. This timeout indicates that an I/O
did not complete in the allotted time.
Event ID: 9
Source: ScsiDrv
The device, \Device\ScsiPort0, did not respond within the timeout
period.
Data (bytes):
0000: 0f 00 10 00 01 00 68 00 ......h.
0008: 00 00 00 00 09 00 04 c0 ........
0010: 00 01 00 00 00 00 00 00 ........
0018: 1b 62 0a 00 00 00 00 00 .b......
0020: 00 00 00 00 00 00 00 00 ........
0028: 00 00 00 00 05 00 00 00 ........
0030: 00 00 00 00 07 00 00 00 ........
Data (words):
0000: 0010000f 00680001 00000000 c0040009
0010: 00000100 00000000 000a621b 00000000
0020: 00000000 00000000 00000000 00000005
0030: 00000000 00000007
Offset Len Value
------ --- -----------
0 1 0x0f MajorFunctionCode 0xf = IRP_MJ_SCSI
1 1 0x00 RetryCount
2 2 0x0010 DumpDataSize 0x10 (16) bytes
4 2 0x0001 NumberOfStrings
6 2 0x0068 StringOffset
8 2 0x0000 EventCategory
a 2 0x0000 padding
c 4 0xc0040009 ErrorCode (IO_ERR_xxx) IO_ERR_TIMEOUT
10 4 0x00000100 UniqueErrorValue low word 256 (0x100)
14 4 0x00000000 FinalStatus
18 4 0x000a621b SequenceNumber
1c 4 0x00000000 IoControlCode
20 8 0x00000000 DeviceOffset
0x00000000
28 4 0x00000000 PathId Path 0
2c 4 0x00000005 TargetId Target 5
30 4 0x00000000 Lun Lun 0
34 4 0x00000007 ErrorCode (SP_xxx) SP_REQUEST_TIMEOUT
The second type of timeout is one in which the SCSI adapter (HBA) did not
respond to the system after an I/O has been issued. This type of timeout is
indicated when UniqueErrorValue equals 0x50000101, which is an ASCII "P" in
the high byte and a 0x0101 in the low word. This timeout indicates that the
adapter is not responding.
Event ID: 9
Source: ScsiDrv
The device, \Device\ScsiPort0, did not respond within the timeout
period.
Data (bytes):
0000: 0f 00 10 00 01 00 68 00 ......h.
0008: 00 00 00 00 09 00 04 c0 ........
0010: 01 01 00 50 00 00 00 00 ...P....
0018: 73 62 0a 00 00 00 00 00 sb......
0020: 00 00 00 00 00 00 00 00 ........
0028: 00 00 00 00 05 00 00 00 ........
0030: 00 00 00 00 07 00 00 00 ........
Data (words):
0000: 0010000f 00680001 00000000 c0040009
0010: 50000101 00000000 000a6273 00000000
0020: 00000000 00000000 00000000 00000005
0030: 00000000 00000007
Offset Len Value
------ --- -----------
0 1 0x0f MajorFunctionCode 0xf = IRP_MJ_SCSI
1 1 0x00 RetryCount
2 2 0x0010 DumpDataSize 0x10 (16) bytes
4 2 0x0001 NumberOfStrings
6 2 0x0068 StringOffset
8 2 0x0000 EventCategory
a 2 0x0000 padding
c 4 0xc0040009 ErrorCode (IO_ERR_xxx) IO_ERR_TIMEOUT
10 4 0x50000101 UniqueErrorValue
0x50 ASCSII "P"
0x00
0x0101 257
14 4 0x00000000 FinalStatus
18 4 0x000a6273 SequenceNumber
1c 4 0x00000000 IoControlCode
20 8 0x00000000 DeviceOffset
0x00000000
28 4 0x00000000 PathId Path 0
2c 4 0x00000005 TargetId Target 5
30 4 0x00000000 Lun Lun 0
34 4 0x00000007 ErrorCode (SP_xxx) SP_REQUEST_TIMEOUT