Actually, I bet this driver does NOT work “perfectly fine” in 32-bit
windows - ever tried it on PAE systems with > 4GB of memory? If you
didn’t support 64-bit DMA in 32-bit Windows, why would a change to the
virtual address (which has no impact on the physical address space of
the box) have anything to do with your ability to access different
physical addresses?
Remember: 32-bit Windows runs on 36-bit physical systems. 64-bit
Windows runs on 48-bit physical systems (currently). The ability of
your device to support scatter/gather, bus mastering, and > 32-bit
physical addresses is an attribute of the device, not of the version of
Windows on which you are running. So you need to set these values based
upon what your device supports, not on what Windows version you are
running - if you find yourself changing fields
Given what you’ve shown thus far, the failure appears to be related to
the fact that the allocation of the DMA adapter object for your device
was not done (or failed) for some reason. Thus, the real problem occurs
long before that check is done.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com http:</http:>
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Karthik M
Sent: Thursday, September 01, 2005 5:30 AM
To: ntdev redirect
Subject: Re: [ntdev] ScsiPortGetPhysicalAddress returns length 0 in 64
-bit windows 2003 standard sever with SP1
Driver requires to access data buffers that’s the reason for setting the
MapBuffers as TRUE. This driver works perfectly fine in the 32-bit
windows, the whole issue arises during porting it to 64-bit windows.
The changes made to the miniport driver for 64 bit version are is that
in the find adaptor callback, I am setting these following values in
64-bit mode
ConfigInfo->Master = TRUE;
ConfigInfo->Dma32BitAddresses = FALSE; // IN 32 bit version this was
true
ConfigInfo->MapBuffers = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma64BitAddresses |= SCSI_DMA64_MINIPORT_SUPPORTED; // in 32
bit version this field was not there.
ConfigInfo->DmaWidth = Width32Bits;
ConfigInfo->BufferAccessScsiPortControlled = TRUE;
This is the code segment which is failing.
pvDevExt is the HwDeviceExtension pointer from the findadaptor call
Srb is the Srb pointer and length is local variable.
BufferVa = Srb->DataBuffer;
physAddr= ScsiPortGetPhysicalAddress(pvDevExt, Srb, BufferVa, &length);
I also traced the disassembly of ScsiPortGetPhysicalAddress() function.
and found that its checking for a flag in the following location
This is the path taken within ScsiPortGetPhysicalAddress.
mov r10, [rcx-0x8] ( where rcx was the PDevExt)
.
.
.
cmp byte ptr [r10 + 0x48a],0x0
And this cmp is zero and hence its assigning 0xffffffff to the physical
address low part and ScsiPortGetPhysicalAddress function returns without
mapping the physical address of the virtual address.
All I could understand is there is some flag which is not set because of
which this failure and I don’t know what is that flag.
Any pointer on this is highly appreciated.
Karthik
xxxxx@attotech.com wrote:
Why are you setting MapBuffers = TRUE? Have you tried to set it
to FALSE?
I don’t know why this should make a difference in this case, but
I’d try
it anyway. And setting this to TRUE is not a good idea from the
performance perspective.
If this fails, paste your exact call to
ScsiPortGetPhysicalAddress. Are
you possibly not passing in the SRB address on this particular
call?
Jerry.
xxxxx@lists.osr.com wrote on 08/31/2005 07:05:57
AM:
Hi All,
> I am facing a problem while porting SCSI miniport to windows
2003
> AMD 64-bit. Scsiport behavior looks very strange.
>
> In order to build the scatter gather list I am calling the
> ScsiPortGetPhysicalAddress and passing the srb->databuffer.
> ScsiPortGetPhysicalAddress call always fails by returning the
length
> field as zero. This behavior is only for the databuffer field
when I
> pass the address of SenseInfoBuffer for
ScsiPortGetPhysicalAddress
> its returning a physical address and valid length.
> As per the DDK documentation I am setting the following
parameters
> in the findadaptor but still I couldn?t figure out why it?s
failing.
>
> These are the parameters values set in the findadaptor
callback.
> ConfigInfo->Dma32BitAddresses = FALSE;
> ConfigInfo->MapBuffers = TRUE;
> ConfigInfo->NeedPhysicalAddresses = TRUE;
> ConfigInfo->Dma64BitAddresses |=
SCSI_DMA64_MINIPORT_SUPPORTED;
> ConfigInfo->DmaWidth = Width32Bits;
> I am clueless on what could be the problem. Any help on
debugging
> this is highly appreciated.
> Any help on what other configurable variables affect the
> ScsiPortGetPhysicalAddress behavior will be helpful.
> Thanks,
> Karthik
>
> Yahoo! India Matrimony: Find your partner online.
> Go to http://yahoo.shaadi.com — Questions? First check the
Kernel
> Driver FAQ at http://www.osronline.com/article.cfm?id=256 You
are
> currently subscribed to ntdev as: xxxxx@attotech.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com — Questions? First check the Kernel
Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are
currently subscribed to ntdev as: xxxxx@osr.com To unsubscribe send a
blank email to xxxxx@lists.osr.com