hello,
i am developing a ndis miniport driver.
my hardware is pci cardbus. i am developing miniport driver as the
middle layer.
currently i am getting the data from the protocol driver layer. but
whatever data i am sending to the upper layer (recv path) is not
recognizing.
1). can anyone tell me how to make proper packet and send it to the
upper layer.
2). do i need to send the ethernet header also (14 bytes) in my data
frame while calling NdisMReceiveIndicate(). ?
3). What are the main parameters need to be checked while creating a
fresh packet and send it to upper layer,?
thanks

Re: NDIS driver. by Stephan

Stephan
Fri Oct 06 09:29:34 CDT 2006

hitesh wrote:
> 1). can anyone tell me how to make proper packet and send it to the
> upper layer.

A valid frame consists of a MAC header plus payload data.

> 2). do i need to send the ethernet header also (14 bytes) in my data
> frame while calling NdisMReceiveIndicate(). ?

If your medium is Ethernet, then yes, you need to include the Ethernet
MAC header.

The name of the function is NdisMIndicateReceivePacket().

> 3). What are the main parameters need to be checked while creating a
> fresh packet and send it to upper layer,?

- Adjust the NDIS_BUFFER length accordingly using
NdisAdjustBufferLength().
- Call NdisRecalculatePacketCounts().
- Set the packet status accordingly using NDIS_SET_PACKET_STATUS().
- RTFM on NdisMIndicateReceivePacket().

Also, run NDISTest against your miniport. It will (!) find lots of
problems, see e.g.

http://www.microsoft.com/whdc/DevTools/tools/NDIStest.mspx
http://www.wd-3.com/archive/NDISTest.htm

Stephan


Re: NDIS driver. by Maxim

Maxim
Wed Oct 11 00:50:45 CDT 2006

> - Set the packet status accordingly using NDIS_SET_PACKET_STATUS().

IIRC there was also the NDIS_SET_PACKET_HEADER_LENGTH macro or such, must be
called with Ethernet MAC header size.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com