Contents

inputPacket

For drivers to submit a received packet to the network stack.

Declaration

virtual UInt32 inputPacket( 
 mbuf_t packet, 
 UInt32 length = 0, 
 IOOptionBits options = 0, 
 void *param = 0 );

Parameters

  • mbuf_t:

    The mbuf containing the received packet.

  • length:

    Specify the size of the received packet in the mbuf. The mbuf length fields are updated with this value. If zero, then the mbuf length fields are not updated.

  • options:

    Pass kInputOptionQueuePacket to enqueue the input packet. Pass zero to bypass the input queue, and immediately submit the packet to the network stack.

  • param:

    A parameter provided by the driver. Not used.

Return Value

Returns the number of packets that were submitted to the network stack, or zero if the packet was enqueued.

Overview

The packet provided to this method may be added to an input queue managed by the interface object, which the driver can use to postpone the packet handoff to the network stack, until all received packets have been added to the input queue. A subsequent call to flushInputQueue(), will transfer the entire contents of the input queue to the network stack. This input queue is not protected by a lock. Drivers that leverage this input queue must either access the queue from a single thread, or enforce serialized access.

See Also

Miscellaneous