Hi,
I am writing a AVStream driver for a PCI device, in the AVStrMiniDeviceStart function i am able to get the address of the memory for the resource type CmResourceTypeMemory but the length field was always zero , hence i could not do any memory mappings for furthur processing of data ( rad/write registry), Any sujjestion will be of great help
Thanks
Kesav
xxxxx@wipro.com wrote:
Hi,
I am writing a AVStream driver for a PCI device, in the
AVStrMiniDeviceStart function i am able to get the address of the
memory for the resource type CmResourceTypeMemory but the length field
was always zero ,
Are you sure your device is setting up its PCI configuration space
properly? What do you expect the BARs to look like? How do you know
the length is zero? Note that here is one very common way to fool yourself:
case CmResourceTypeMemory:
KdPrint((" start %8x length %8x\n",
resource->u.Port.Start.QuadPart,
resource->u.Port.Length));
break;
The “Start” address is a 64-bit address, but the %8x qualifier only
expects a 32-bit address. The high-order part of the address will be
left on the stack and used for the second %8x. Since the high-half is
always 0 on a 32-bit machine, you can guess the result.
If you want to print out the starting address, make sure you use %8I64x.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Hi Tim,
Thanks for the response, The device is setting up the PCI configuration properly, I had tested it using a WDM driver, where able to get he BAR and the Length correctly, but when the same is done using the AVStream driver the partial resource descriptor gives me the Correct Start address ,but the worry is that it gives the Length as zero which i am not sure of why.
Thanks
Kesav
xxxxx@wipro.com wrote:
Thanks for the response, The device is setting up the PCI configuration properly, I had tested it using a WDM driver, where able to get he BAR and the Length correctly, but when the same is done using the AVStream driver the partial resource descriptor gives me the Correct Start address ,but the worry is that it gives the Length as zero which i am not sure of why.
You’re looking at the translated list – not the raw list – right?
Perhaps you should post the code. I know this works, because I’ve done it.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.