Newbie doubts on NdisMQueryAdapterResources and NdisMGetDeviceProperty

Hi all,

I am trying to develop a miniport driver for Realtek RTL 8139 by modifying
DDK sample E100BEX. Now i am learning MiniportInitialize routine.

I have used NdisMQueryAdapterResources and the same switch case to assign
port, Interrupt and memory. Both Iobase address and Interrupt values are
assigning correctly. But in the Memory assignment i get a valid physical
address start and length value. But when i use DbgPrint to print the values
of functions

NdisGetPhysicalAddressLow(Adapter->MemPhysAddress) gives me 0xe7101000
pResDesc->u.Memory.Length gives me 0x100 then why
NdisGetPhysicalAddressHigh(Adapter->MemPhysAddress) shows a 0X0 value.

From _CM_PARTIAL_RESOURCE_DESCRIPTOR structure and its member structure
memory i under stood these values which i get is a valid (64 bit physical
addresses???). And as per reference NdisGetPhysicalAddressHigh should return
me the high-order part of a given physical address. Where i went wrong
please correct me.

Also in the msdn documents i saw that “Alternatively Miniport drivers can
call NdisMGetDeviceProperty to retrieve pointers to Raw and Translated
resources”. Where we should use this function?

Thanks in advance

vimal

Reply inline.

Calvin Guan (DDK MVP) Sr. Staff Engineer

NetXtreme Vista/Longhorn Server Miniport

Broadcom Corporation, Irvine CA 92618

Connecting Everything(r)


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of vimalraj s
Sent: Wednesday, September 20, 2006 1:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Newbie doubts on NdisMQueryAdapterResources and
NdisMGetDeviceProperty

Hi all,

I am trying to develop a miniport driver for Realtek RTL 8139 by
modifying DDK sample E100BEX. Now i am learning MiniportInitialize
routine.

[CG] 8139 is a simple MAC, good for learning purpose.

I have used NdisMQueryAdapterResources and the same switch case to
assign port, Interrupt and memory. Both Iobase address and Interrupt
values are assigning correctly. But in the Memory assignment i get a
valid physical address start and length value. But when i use DbgPrint
to print the values of functions

NdisGetPhysicalAddressLow(Adapter->MemPhysAddress) gives me 0xe7101000
pResDesc->u.Memory.Length gives me 0x100 then why
NdisGetPhysicalAddressHigh(Adapter->MemPhysAddress) shows a 0X0 value.

[CG] that means the BAR is mapped to lower 4G physical address which is
perfectly fine.

From _CM_PARTIAL_RESOURCE_DESCRIPTOR structure and its member structure
memory i under stood these values which i get is a valid (64 bit
physical addresses???). And as per reference NdisGetPhysicalAddressHigh
should return me the high-order part of a given physical address. Where
i went wrong please correct me.

[CG] Nothing’s wrong.0x00000000deadbeef is a valid 64-bit address, isn’t
it? On the other hand, if you were assigned a physical address>4G, you
need to pay attention since your card must support 64bit BAR.

Also in the msdn documents i saw that “Alternatively Miniport drivers
can call NdisMGetDeviceProperty to retrieve pointers to Raw and
Translated resources”. Where we should use this function?

[CG] if you want to get the raw (untranslated address).

Thanks in advance

vimal

— 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