SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The
driver is not fully done as yet but I can detect the drives, let windows
create a volume and also format the drives with the NTFS file system.
When I reactivate the drives - i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that
I was occasionally getting a Write(10) SCSI Command - 0x2Ah with
DataBuffer pointer in the SRB set to NULL but the DataBufferLength set
to a non zero value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes
successfully Windows does not complain about Delayed Write Failures at
all. I can also do some write and reads from the drives and I don’t see
the bubble popping up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length
DataBufferLength from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I
should be looking at to better understand this issue or direct me
towards any documentation which I should probably read up.

Thanks in advance for your explanations.

-Amit

Following is the CDB for the request and SRB members - DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

Amit,

Since nobody else has replied, I will.

These are delayed writes flushing modified pages. The pages are not
necessarily associated with a user or system buffer and may not be mapped
into either system or user space. The DataBuffer pointer value is
meaningless - you just successively pass this as a walking “pointer” to
the call ScsiPortGetPhysicalAddress along with the Srb pointer until you
have the full scatter/gather list required to perform your I/O.

The bottom line - just don’t pay any attention to the value of the
DataBuffer pointer.

Jerry.

“Amit Nadgar”
Sent by: xxxxx@lists.osr.com
11/01/2006 09:49 PM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
[ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The driver
is not fully done as yet but I can detect the drives, let windows create a
volume and also format the drives with the NTFS file system. When I
reactivate the drives ? i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that I
was occasionally getting a Write(10) SCSI Command ? 0x2Ah with DataBuffer
pointer in the SRB set to NULL but the DataBufferLength set to a non zero
value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes successfully
Windows does not complain about Delayed Write Failures at all. I can also
do some write and reads from the drives and I don?t see the bubble popping
up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length DataBufferLength
from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I should
be looking at to better understand this issue or direct me towards any
documentation which I should probably read up.

Thanks in advance for your explanations.
-Amit

Following is the CDB for the request and SRB members ? DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength =
4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength =
1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

What is the value that you are setting for MapBuffers Field of port
Config Info ??

  • Aji

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Amit Nadgar
Sent: Wednesday, November 01, 2006 6:49 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The
driver is not fully done as yet but I can detect the drives, let windows
create a volume and also format the drives with the NTFS file system.
When I reactivate the drives - i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that
I was occasionally getting a Write(10) SCSI Command - 0x2Ah with
DataBuffer pointer in the SRB set to NULL but the DataBufferLength set
to a non zero value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes
successfully Windows does not complain about Delayed Write Failures at
all. I can also do some write and reads from the drives and I don’t see
the bubble popping up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length
DataBufferLength from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I
should be looking at to better understand this issue or direct me
towards any documentation which I should probably read up.

Thanks in advance for your explanations.

-Amit

Following is the CDB for the request and SRB members - DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Jerry,

Thank you for answering my question. You explanation was very helpful
and I have modified my driver correspondingly.

Thanks,

Amit


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@attotech.com
Sent: Thursday, November 02, 2006 8:09 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah
Question

Amit,

Since nobody else has replied, I will.

These are delayed writes flushing modified pages. The pages are not
necessarily associated with a user or system buffer and may not be
mapped into either system or user space. The DataBuffer pointer value
is meaningless - you just successively pass this as a walking “pointer”
to the call ScsiPortGetPhysicalAddress along with the Srb pointer until
you have the full scatter/gather list required to perform your I/O.

The bottom line - just don’t pay any attention to the value of the
DataBuffer pointer.

Jerry.

“Amit Nadgar”
Sent by: xxxxx@lists.osr.com

11/01/2006 09:49 PM

Please respond to
“Windows System Software Devs Interest List”

To

“Windows System Software Devs Interest List”

cc

Subject

[ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The
driver is not fully done as yet but I can detect the drives, let windows
create a volume and also format the drives with the NTFS file system.
When I reactivate the drives - i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that
I was occasionally getting a Write(10) SCSI Command - 0x2Ah with
DataBuffer pointer in the SRB set to NULL but the DataBufferLength set
to a non zero value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes
successfully Windows does not complain about Delayed Write Failures at
all. I can also do some write and reads from the drives and I don’t see
the bubble popping up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length
DataBufferLength from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I
should be looking at to better understand this issue or direct me
towards any documentation which I should probably read up.

Thanks in advance for your explanations.
-Amit

Following is the CDB for the request and SRB members - DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Aji,

I set the MapBuffers field to FALSE and the NeedPhysicalAddresses field
to TRUE.

-Amit


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ajitabh Saxena
Sent: Thursday, November 02, 2006 1:43 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah
Question

What is the value that you are setting for MapBuffers Field of port
Config Info ??

  • Aji

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Amit Nadgar
Sent: Wednesday, November 01, 2006 6:49 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The
driver is not fully done as yet but I can detect the drives, let windows
create a volume and also format the drives with the NTFS file system.
When I reactivate the drives - i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that
I was occasionally getting a Write(10) SCSI Command - 0x2Ah with
DataBuffer pointer in the SRB set to NULL but the DataBufferLength set
to a non zero value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes
successfully Windows does not complain about Delayed Write Failures at
all. I can also do some write and reads from the drives and I don't see
the bubble popping up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length
DataBufferLength from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I
should be looking at to better understand this issue or direct me
towards any documentation which I should probably read up.

Thanks in advance for your explanations.

-Amit

Following is the CDB for the request and SRB members - DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
ListServer/Forum

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at

That is the reason why you are getting the DataBuffer Pointer as NULL.
If you make MapBuffers as TRUE you will be able to get the valid pointer
in that field. But the Mapbuffers is a expesive operation.
I personally set the MAPBuffers always to TRUE for SCSI Miniport but in
StorPort Micorosoft does not Map all the buffers and you will get NULL
pointer for Read/Write IO Operations.
I think if you could ignore the DataBuffer pointer and you will be able
to make your driver work.

  • Ajitabh.

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Amit Nadgar
Sent: Thursday, November 02, 2006 4:57 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah
Question

Aji,

I set the MapBuffers field to FALSE and the NeedPhysicalAddresses field
to TRUE.

-Amit


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ajitabh Saxena
Sent: Thursday, November 02, 2006 1:43 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah
Question

What is the value that you are setting for MapBuffers Field of port
Config Info ??

  • Aji

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Amit Nadgar
Sent: Wednesday, November 01, 2006 6:49 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SCSI Miniport Driver - Write(10) Cmd # 0x2ah Question

Hi all,

I have written a SCSI Miniport Driver for a Fibre Channel card. The
driver is not fully done as yet but I can detect the drives, let windows
create a volume and also format the drives with the NTFS file system.
When I reactivate the drives - i.e., through windows (Control
Panel/Administrative Tools/Computer Management/Storage), I observed that
I was occasionally getting a Write(10) SCSI Command - 0x2Ah with
DataBuffer pointer in the SRB set to NULL but the DataBufferLength set
to a non zero value.

If I complete such a request with STATUS_SRB_INVALID_REQUEST Windows
complains about Delayed Write Failed. If I complete the request without
success windows complains about Delayed Write Failures. However, if I
allow the driver to go ahead with the request which completes
successfully Windows does not complain about Delayed Write Failures at
all. I can also do some write and reads from the drives and I don't see
the bubble popping up.

I am confused about this request, as letting the driver to go ahead with
the request causes the DMA engine to read data of length
DataBufferLength from 0x00000000 address location.

At this point, I am unsure whether it is correct to assume that the
request is correct and I should just continue as it is, or whether
something is seriously wrong in the driver, or whether I should just
complete the request successfully without actually acting on it.

I would be grateful if someone could provide some advice on what I
should be looking at to better understand this issue or direct me
towards any documentation which I should probably read up.

Thanks in advance for your explanations.

-Amit

Following is the CDB for the request and SRB members - DataBuffer,
DataTransferLength

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 4096
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 228 [5] = 63 [6] = 0 [7] = 0
[8] = 8 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0

pSrb = 0x85b34fbc TgtId = 14 Cmd = 42 DataBuffer = 0x00000000 DataLength
= 1024
SRB = 0x85b34fbc TgtId = 14 Lun = 0 CDB Bytes:
[0] = 42 [1] = 0 [2] = 0 [3] = 129
[4] = 230 [5] = 63 [6] = 0 [7] = 0
[8] = 2 [9] = 0 [10] = 0 [11] = 0
[12] = 0 [13] = 0 [14] = 0 [15] = 0


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
ListServer/Forum

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at