Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ndis passthru question

0 views
Skip to first unread message

Joey

unread,
Jun 4, 2008, 3:33:16 PM6/4/08
to
Hi wish to ask a simple question, pls bear with me I'm still trying to
understand the ddk docs and the code.

I'm confused about the MpSendPackets and MpSend functions.
Is it correct to think that

the above protocol calls ndisSend which calls passthru's MpSend or
MpSendPackets
which in turn call ndisSend again which calls the underlying
miniport's MpSend or MpSendPackets
which call NdisMsendComplete which propagates a protocolSendComplete
back up


why does MpSendPackets call NdisMSendComplete from within itself while
MpSend doesn't ?
does it mean that ptSendComplete is not called when MpSendPackets is
called?
or
does calling NdisMSendComplete from MpSendPackets perform a different
function?

"NDIS assumes that a subsequent call to NdisMSendResourcesAvailable or
NdisMSendComplete, whichever occurs first, indicates that such a
driver's MiniportSendPackets function is ready to accept more packets
for transmission."

does this mean ndis will perform different functions when
NdisMSendComplete is called from ptSendComplete and NdisMSendComplete
in MpSendPackets ?

Thanks very much in advance,
Joey


Angie

unread,
Jun 4, 2008, 4:30:56 PM6/4/08
to
MpSendPackets:callback from lower layer driver(Miniport driver)
MpSend :callback from upper layer driver.(protocol driver)

In the DDK document, it does tell you when the above functions are called.


"Joey" <oinks...@gmail.com> wrote in message
news:f0566cf1-9227-414a...@q24g2000prf.googlegroups.com...

PCAUSA

unread,
Jun 4, 2008, 8:48:59 PM6/4/08
to
On Jun 4, 4:30 pm, "Angie" <kimojo...@yahoo.com> wrote:
> MpSendPackets:callback from lower layer driver(Miniport driver)
> MpSend :callback from upper layer driver.(protocol driver)
>
> In the DDK document, it does tell you when the above functions are called.
>
> "Joey" <oinkshan...@gmail.com> wrote in message

???Don't think so!!!


MpSendPackets:callback from lower layer driver(Miniport driver)
MpSend :callback from upper layer driver.(protocol driver)

Both are called by NDIS to send packets in response to a higher-level
protocol or filter calling NdisSend of NdisSendPackets.

If MSPsendPackets handler is registered, then it will be called in
preference to MPSend. Must have MPSendPackets _or_ MPSend. If you have
both, then MPSend will actually never be called.

Thomas F. Divine

Joey

unread,
Jun 4, 2008, 10:37:58 PM6/4/08
to
Thanks for the replies,

I think I'm confused because of this:

"If the MiniportSend(Packets) function of a serialized driver returns
a status other than NDIS_STATUS_PENDING for a given packet, the
miniport driver never calls NdisMSendComplete with that packet. The
return from MiniportSend(Packets) releases ownership of such a packet.
Consequently, a serialized miniport driver must not call
NdisMSendComplete with any packet for which its MiniportSend(Packets)
function did not return NDIS_STATUS_PENDING. Any send packet for which
a serialized NIC driver returns something other than
NDIS_STATUS_PENDING should be considered inaccessible by that miniport
driver as soon as its MiniportSend(Packets) function returns control.
"

I don't understand why does the passthru call NdisMSendComplete from
within MpSend even though the status returned !=pending. Is it
pretending that the send was completed? What happens if the packet is
inaccessible and passthru doesn't call NdisMSendComplete?

if (Status != NDIS_STATUS_PENDING)
{
NdisMSendComplete(ADAPT_MINIPORT_HANDLE(pAdapt),
Packet,
Status);
}

Thanks,
Joey

PCAUSA

unread,
Jun 5, 2008, 9:56:15 AM6/5/08
to

When NDIS_STATUS_PENDING is returned from MPSend that status really
means "NDIS will call the send complete callback. It may actually have
called it already or it may call it later. But NDIS will call it".

If any other status is returned, then NDIS will _not_ call the send
complete handler.

Thomas F. Divine
http://www.pcausa.com

0 new messages