Microsoft Windows CE 3.0  

NdisMTrIndicateReceive

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function notifies NDIS that a Token Ring packet, or some initial lookahead portion of the packet, has arrived so NDIS can forward the packet to bound protocols.

VOID NdisMTrIndicateReceive(
IN NDIS_HANDLE
MiniportAdapterHandle
,
IN NDIS_HANDLE
MiniportReceiveContext
,
IN PVOID
HeaderBuffer
,
IN UINT
HeaderBufferSize
,
IN PVOID
LookaheadBuffer
,
IN UINT
LookaheadBufferSize
,
IN UINT
PacketSize
);

Parameters

MiniportAdapterHandle
[in] Specifies the handle originally input to MiniportInitialize.
MiniportReceiveContext
[in] Specifies a context handle supplied by the caller. NDIS returns this handle as an input parameter to the MiniportTransferDatafunction if it is called. The miniport can use the context area designated by this handle to determine which packet is being received on which NIC.
HeaderBuffer
[in] Specifies the base virtual address of the buffered packet header.
HeaderBufferSize
[in] Specifies the size in bytes of the packet header.
LookaheadBuffer
[in] Specifies the base virtual address of a buffer containing the initial LookaheadBufferSizebytes of the data in the packet.
LookaheadBufferSize
[in] Specifies the size in bytes of the lookahead buffer. This value must be at least as large as the smaller of the lookahead size set when MiniportSetInformationcxrefMiniportSetInformation was called with OID_GEN_CURRENT_LOOKAHEADcxtskOID, or the packet itself. When the packet is smaller than the lookahead size, the lookahead buffer contains the entire frame.

A miniport can (and should) set LookaheadBufferSizeto something larger than the minimum required if sufficient received data is available on its NIC.

PacketSize
[in] Specifies the size in bytes of the received packet data. This value does not include the HeaderBufferSize.

When PacketSizeis larger than LookaheadBufferSize, a protocol driver call to NdisTransferDatacauses a subsequent call to the MiniportTransferDatafunction, which transfers the remaining data in the packet.

Return Values

None.

Remarks

A miniport calls NdisMTrIndicateReceiveif it designates its NIC as of type NdisMedium802_5in response to the OID_GEN_MEDIA_IN_USE query, unless the miniport indicates receives with NdisMIndicateReceivePacket.

When a miniport calls NdisMTrIndicateReceive, NDIS passes a pointer to the header of the packet and a pointer to some or all of the data in the packet to the ProtocolReceivefunction of bound protocol drivers. Each protocol that receives the indication can do the following:

  1. Inspect the header and data in the packet to decide whether the indication is of interest to the protocol's clients.
  2. If it is, copy as much of the header or data as is visible into protocol-allocated memory with NdisMoveMemorywceddkNdisMoveMemory.
  3. Get the remaining data, if any, for the indication by allocating a packet descriptor with sufficient chained buffer descriptors and calling NdisTransferData. The call to NdisTransferData causes the NIC driver's MiniportTransferData function to copy the data into the protocol-supplied packet.

    For any protocol driver that receives an indication through NdisMTrIndicateReceive, the HeaderBufferand LookaheadBufferaddresses are valid only during the current call to its ProtocolReceivefunction, and these buffers are read-only. A protocol driver cannot retain a pointer to the indicated packet with these associated buffers nor can it retain any pointers to these buffers for later use. Any data that a protocol driver needs from such a packet must be copied and saved during the receive indication.

    The data in the header is the same as that received on the NIC. A miniport driver need not remove any headers or trailers from the data its NIC receives.

    The transmitting driver adds padding to any packet that is too short for the requirements of the medium. The receiving miniport can include such padding in the data and length it subsequently indicates. Each bound protocol is responsible for detecting any such padding and ignoring it.

    Requirements

    Runs on Versions Defined in Include Link to
    Windows CE OS 3.0 and later   Ndis.h  


     Last updated on Tuesday, July 13, 2004

    © 2004 Microsoft Corporation. All rights reserved.