Virtual addr for scatter-gather fragments.

Hi,
I have a NDIS miniport which gets the scatter-gather list for a packet.
This contains the physcial addresses for the frgaments in each packet. I
need to look at/modify the packet contents. How can I get the virtual
address from this physical address? NDIS does not seem to provide a call
to convert virtual-to-physical addresses for the fragments.

Regards.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I have a NDIS miniport which gets the scatter-gather list for a packet.

This contains the physcial addresses for the frgaments in each packet. I

This also contains the virtual addresses for each fragment.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

On 08/11/01, ““Maxim S. Shatskih” ” wrote:
> > I have a NDIS miniport which gets the scatter-gather list for a packet.
> > This contains the physcial addresses for the frgaments in each packet. I
>
> This also contains the virtual addresses for each fragment.
>

No, it doesn’t. The description of SCATTER_GATHER_ELEMENT in the (Win2K)
DDK says that it contains a PHYSICAL_ADDRESS, the Length, and a Reserved
field. This guy is talking about the “new” Scatter/Gather DMA model for
NDIS 5, using NdisMInitializeScatterGatherDma, where you don’t need to jump
through all the hoops of allocating Map Registers, Querying the
Packet/Buffer, etc… This is a problem for NIC drivers that need (for
various reasons) to crack the NDIS packet before sending it to the
adapter.

My best guess it that he’ll need to call NdisQueryPacket() and
NdisQueryBufferSafe() to get at the data. You know, if any Microsofties
are reading this, an ability to get the VA for a particular
SCATTER_GATHER_ELEMENT in the SCATTER_GATHER_LIST would be nice.

In the meantime, if anyone has a better solution than the dual
NdisQueryXXX, I’d love to hear it.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> My best guess it that he’ll need to call NdisQueryPacket() and

NdisQueryBufferSafe() to get at the data.

Yes that is the issue I am facing. However I am not sure wether your
solution is possible. NdisQueryBufferSafe requires PNDIS_BUFFER & the
fragment isnt one. Do let me know if you have any other options.

Regards.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> > > This contains the physcial addresses for the frgaments in each packet.
I

>
> This also contains the virtual addresses for each fragment.
>

No, it doesn’t. The description of SCATTER_GATHER_ELEMENT in the (Win2K)

Sorry, I’m speaking on NDIS_PACKET, not on scatter-gather list.
NDIS_PACKET is a list of MDLs - you can easily take a virtual address of any
of them.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The NDIS_PACKET contains a list of NDIS_BUFFERs (and an NDIS_BUFFER is
simply an MDL).

Akaul, use NdisQueryPacket to get the PNDIS_BUFFER and then NdisQueryBuffer
to get the V.A. Those routines are either macros, or should be very
simple/short routines that grab the MDL (NDIS_BUFFER)out of the NDIS_PACKET
and get the V.A. from the NDIS_BUFFER.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com