FOR FAQ RE: NDIS Receive Data

Bhanu,
Are you developing NDIS IM driver or Protocol driver? If you are
doing either of them and you are supporting ProtocolReceivePacket
function (Which is optional) I believe ProtocolReceivePacket function is
being called.
If you are supporting both ProtocolReceivePacket and
ProtocolReceive paths which function is called depends on your miniport
driver. Try disabling ProtocolReceivePacket function and this should
make ProtocolReceive path the active path for testing.

-Srin.

-----Original Message-----
From: Bhanu Gogineni [mailto:xxxxx@hotmail.com]
Sent: Tuesday, July 22, 2003 10:26 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] NDIS Receive Data

Hello,
ProtocolReceive Handler in my NDIS driver is not getting called
eventhough the Ethernet packets are received by the underlying netcard
driver. My NDIS driver couldnt be able to recieve ethernet packets
through the NDIS ProtocolReceive Handler. it will be really helpful
if some one could be able to tell me the solution for this problem.

Bhanu Gogineni.


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

You need to set the packet filter via
NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.

Bryan S. Burgin
xxxxx@microsoft.com

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bhanu Gogineni
Sent: Tuesday, July 22, 2003 10:26 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] NDIS Receive Data

Hello,
ProtocolReceive Handler in my NDIS driver is not getting called
eventhough the Ethernet packets are received by the underlying netcard
driver. My NDIS driver couldnt be able to recieve ethernet packets
through the NDIS ProtocolReceive Handler. it will be really helpful
if some one could be able to tell me the solution for this problem.

Bhanu Gogineni.


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Bryan,

Thank You very much for your help.
could you please tell me how to allocate memory for receiving packets
in the Protocol Receive handler ?

what type of memory allocattions can we use to allocate memory ?

how can I read those packet in the Read (MJ_READ) Handler of the driver from
ReadFile (Win32 API)
how to copy the contents in the kernel space memory to user scape memory
passed as an
argument int ReadFile API.

Regards,

Bhanu Gogineni.

From: “Bryan Burgin”
>Reply-To: “Windows System Software Developers Interest List”
>
>To: “Windows System Software Developers Interest List”
>
>CC:
>Subject: [ntdev] RE: NDIS Receive Data
>Date: Tue, 22 Jul 2003 11:00:49 -0700
>
>You need to set the packet filter via
>NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.
>
>Bryan S. Burgin
>xxxxx@microsoft.com
>
>This posting is provided “AS IS” with no warranties, and confers no
>rights.
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Bhanu Gogineni
>Sent: Tuesday, July 22, 2003 10:26 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] NDIS Receive Data
>
>Hello,
> ProtocolReceive Handler in my NDIS driver is not getting called
>eventhough the Ethernet packets are received by the underlying netcard
>driver. My NDIS driver couldnt be able to recieve ethernet packets
>through the NDIS ProtocolReceive Handler. it will be really helpful
>if some one could be able to tell me the solution for this problem.
>
>Bhanu Gogineni.
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@microsoft.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Travel plans? Click here. http://www.msn.co.in/Travel Sit back & relax!

Hi Bryan,

Thank You very much for your help.
could you please tell me how to allocate memory for receiving packets
in the Protocol Receive handler ?

what type of memory allocation functions can we use to allocate memory ?

how can I read those packet in the Read (MJ_READ) Handler of the driver from
ReadFile (Win32 API)
how to copy the contents in the kernel space memory to user scape memory
passed as an
argument int ReadFile API.

Regards,

Bhanu Gogineni.

From: “Bryan Burgin”
>Reply-To: “Windows System Software Developers Interest List”
>
>To: “Windows System Software Developers Interest List”
>
>CC:
>Subject: [ntdev] RE: NDIS Receive Data
>Date: Tue, 22 Jul 2003 11:00:49 -0700
>
>You need to set the packet filter via
>NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.
>
>Bryan S. Burgin
>xxxxx@microsoft.com
>
>This posting is provided “AS IS” with no warranties, and confers no
>rights.
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Bhanu Gogineni
>Sent: Tuesday, July 22, 2003 10:26 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] NDIS Receive Data
>
>Hello,
> ProtocolReceive Handler in my NDIS driver is not getting called
>eventhough the Ethernet packets are received by the underlying netcard
>driver. My NDIS driver couldnt be able to recieve ethernet packets
>through the NDIS ProtocolReceive Handler. it will be really helpful
>if some one could be able to tell me the solution for this problem.
>
>Bhanu Gogineni.
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@microsoft.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Are you Unmarried? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?4d
Register in India’s No 1 Matrimony.

I’m puzzled by this. I have an NDIS IM driver based on passthru, and
neither it nor passthru does this (at least, neither set of code contains
that symbolic reference).

Might the problem be that the packets are being presented in the
ProtocolReceivePackets callback?

Bryan Burgin wrote:

You need to set the packet filter via
NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

Review the NDISPROT (formally NDISUIO) sample in the DDK.

Bryan S. Burgin
xxxxx@microsoft.com

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Bhanu Gogineni [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 24, 2003 2:56 PM
To: xxxxx@lists.osr.com
Subject: Re: [ntdev] RE: NDIS Receive Data

Hi Bryan,

Thank You very much for your help.
could you please tell me how to allocate memory for receiving packets
in the Protocol Receive handler ?

what type of memory allocattions can we use to allocate memory ?

how can I read those packet in the Read (MJ_READ) Handler of the driver
from
ReadFile (Win32 API)
how to copy the contents in the kernel space memory to user scape memory

passed as an
argument int ReadFile API.

Regards,

Bhanu Gogineni.

From: “Bryan Burgin”
>Reply-To: “Windows System Software Developers Interest List”
>
>To: “Windows System Software Developers Interest List”
>
>CC:
>Subject: [ntdev] RE: NDIS Receive Data
>Date: Tue, 22 Jul 2003 11:00:49 -0700
>
>You need to set the packet filter via
>NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.
>
>Bryan S. Burgin
>xxxxx@microsoft.com
>
>This posting is provided “AS IS” with no warranties, and confers no
>rights.
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Bhanu Gogineni
>Sent: Tuesday, July 22, 2003 10:26 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] NDIS Receive Data
>
>Hello,
> ProtocolReceive Handler in my NDIS driver is not getting called
>eventhough the Ethernet packets are received by the underlying netcard
>driver. My NDIS driver couldnt be able to recieve ethernet packets
>through the NDIS ProtocolReceive Handler. it will be really helpful
>if some one could be able to tell me the solution for this problem.
>
>Bhanu Gogineni.
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@microsoft.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Travel plans? Click here. http://www.msn.co.in/Travel Sit back & relax!

I take it you want to copy incoming packets into user space.

I would take the approach of a separate driver to do copying from a kernel-space
buffer to user space when asked by a user-space app. This separate driver would
allocate some non-paged kernel-space buffers, chained off its device-object
extension, perhaps. The ProtocolReceivePacket or ProtocolReceive callback would
copy the incoming packet’s payload into one of those buffers, and perhaps it
would signal the other driver; or maybe the other driver would wake up
periodically and see if any buffers have been filled. However done, coordination
between the 2 drivers would be essential in regard to using empty buffers (NDIS
IM) and recycling used buffers (the other driver).

Note that ProtocolReceive is not guaranteed to get a full packet. You would have
to take that into account, eg, use NdisTransferData in conjunction with a
ProtocoTransferDataComplete routine (NdisTransferData can function
asynchronously).

Bhanu Gogineni wrote:

could you please tell me how to allocate memory for receiving packets
in the Protocol Receive handler ?

what type of memory allocattions can we use to allocate memory ?

how can I read those packet in the Read (MJ_READ) Handler of the driver from
ReadFile (Win32 API)
how to copy the contents in the kernel space memory to user scape memory
passed as an
argument int ReadFile API.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

For IM driver it is unnecessary because above layered protocol driver does
it and IM driver passes OID to below driver. It is necessary for protocol
driver and I’m not sure what was original question about.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From:
xxxxx@mindspring.nospam.com[SMTP:xxxxx@mindspring.nospam.com]
Reply To: xxxxx@lists.osr.com
Sent: Friday, July 25, 2003 12:23 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Re: NDIS Receive Data

I’m puzzled by this. I have an NDIS IM driver based on passthru, and
neither it nor passthru does this (at least, neither set of code contains
that symbolic reference).

Might the problem be that the packets are being presented in the
ProtocolReceivePackets callback?

Bryan Burgin wrote:

> You need to set the packet filter via
> NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP


You are currently subscribed to ntdev as: michal.vodicka@st.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

James,
I believe this is needed for protocol drivers not IM drivers. If
you look at the ndisprot sample it does this.

-Srin.

-----Original Message-----
From: James Antognini [mailto:xxxxx@mindspring.nospam.com]
Sent: Thursday, July 24, 2003 3:24 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: NDIS Receive Data

I’m puzzled by this. I have an NDIS IM driver based on passthru, and
neither it nor passthru does this (at least, neither set of code
contains
that symbolic reference).

Might the problem be that the packets are being presented in the
ProtocolReceivePackets callback?

Bryan Burgin wrote:

> You need to set the packet filter via
> NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> what type of memory allocattions can we use to allocate memory ?

Nonpaged.

how can I read those packet in the Read (MJ_READ) Handler

Maintain the queue of packets, the queue of read IRPs (only 1 of them will be
non-empty at any moment) and match them together to satisfy reads.

Max

Filters must not do this explicitly, since the upper protocol will do this,
and the filter will just pass the request down.
Protocol drivers, though, must do this, or otherwise they will receive
nothing.

Max

----- Original Message -----
From: “James Antognini”
Newsgroups: ntdev
To: “Windows System Software Developers Interest List”
Sent: Friday, July 25, 2003 2:23 AM
Subject: [ntdev] Re: NDIS Receive Data

> I’m puzzled by this. I have an NDIS IM driver based on passthru, and
> neither it nor passthru does this (at least, neither set of code contains
> that symbolic reference).
>
> Might the problem be that the packets are being presented in the
> ProtocolReceivePackets callback?
>
> Bryan Burgin wrote:
>
> > You need to set the packet filter via
> > NdisRequest/Set/OID_GEN_CURRENT_PACKET_FILTER.
>
> –
> If replying by e-mail, please remove “nospam.” from the address.
>
> James Antognini
> Windows DDK MVP
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com