Re: Ndis Miniport Driver Problem

NdisAllocateBuffer does not allocate the buffer data, it simply allocates a
buffer descriptor which describes a data buffer of a given length. You use
NdisMAllocateSharedMemory to get memory to be used by DMA hardware. Thus
the name Shared. You first allocate a BufferPool, then you allocate buffers
and then you allocate the buffer descriptors from your buffer pool. You
should read the DDK Help. It sort of describes this all for you.

The maximum packet size is defined by the OID_GEN_MAXIMUM_FRAME_SIZE and
OID_GEN_MAXIMUM_TOTAL_SIZE. These OIDs are queried when your miniport
starts and are recorded by NDIS. However, even with these numbers, you can
still use NdisMPacketIndicate with larger sizes than the responses to these
OIDs. Basically, the frame size is limited by the upper layer protocols
which process frames and that is protocol dependent.

Why have multiple buffers? Because sometimes when you receive packet data,
your hardware may have what is known as scatter gather which means that a
packet is received in several discontiguous data buffers. For example, I
have written an adapter driver for ATM where the buffer pools available to
ATM connection hardware were 256 bytes each. When data is received at
several connections at a time, the hardware gets buffers in 256 chunks to
fill in the received data. When the packets are completetly received, some
packets are short (64-200 bytes), and some are long (1000-1500 bytes).
Therefore in the case where the packet is short, the packet is only in one
buffer. However, when the packet is long, then there are several buffers
per packet.

It does not say that you have to make all packets

----- Original Message -----
From: “encarta”
To: “NT Developers Interest List”
Sent: Friday, March 10, 2000 3:53 AM
Subject: [ntdev] Ndis Miniport Driver Problem

> Hi!
> I’m writing a Windows2000 Ndis Connection-Oriented Miniport Driver. I
have three
> question:
> 1.What’s the maximum buffer size that the NdisAllocateBuffer()
function can get?
> 2.What’s the maximum packet size that one ndis packet can have?
> 3.If the maximum buffer size can be very large, why a packet have more
than one
> buffer?
> Maybe these question are very strange and simple, but I really don’t
> Thank you for your help.
> Regards!
> encarta
> ____________________________
> Free Email/SMTP/POP,, Hosting
> —
> You are currently subscribed to ntdev as:
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)