Mac Developer Library

Developer

IOMbufNaturalMemoryCursor Class Reference

Options
Deployment Target:

On This Page

IOMbufNaturalMemoryCursor

An IOMbufMemoryCursor subclass that outputs a vector of IOPhysicalSegments in the natural byte orientation for the cpu.

The IOMbufNaturalMemoryCursor would be used when it is too difficult to implement an OutputSegmentFunc that is more appropriate for your hardware. This cursor just outputs an array of IOPhysicalSegments.

  • Generates a cpu natural physical scatter/gather list from a given mbuf.

    Declaration

    UInt32 getPhysicalSegments( mbuf_t packet, struct IOMemoryCursor::PhysicalSegment *vector, UInt32 numVectorSegments = 0);

    Parameters

    packet

    The mbuf packet.

    vector

    Pointer to an array of IOPhysicalSegments for the output physical scatter/gather list.

    numVectorSegments

    Maximum number of IOPhysicalSegments accepted.

    Return Value

    Returns the number of segments that were filled in, or 0 if an error occurred.

  • Generates a cpu natural physical scatter/gather list from a given mbuf.

    Declaration

    UInt32 getPhysicalSegmentsWithCoalesce( mbuf_t packet, struct IOMemoryCursor::PhysicalSegment *vector, UInt32 numVectorSegments = 0);

    Parameters

    packet

    The mbuf packet.

    vector

    Pointer to an array of IOPhysicalSegments for the output physical scatter/gather list.

    numVectorSegments

    Maximum number of IOPhysicalSegments accepted.

    Return Value

    Returns the number of segments that were filled in, or 0 if an error occurred.

    Discussion

    Generate a cpu natural physical scatter/gather list from a given mbuf. Coalesce mbuf chain when the number of segments in the scatter/gather list exceeds numVectorSegments.

  • Factory function that creates and initializes an IOMbufNaturalMemoryCursor in one operation.

    Declaration

    static IOMbufNaturalMemoryCursor * withSpecification( UInt32 maxSegmentSize, UInt32 maxNumSegments);

    Parameters

    maxSegmentSize

    Maximum allowable size for one segment.

    maxNumSegments

    Maximum number of segments.

    Return Value

    Returns a new mbuf cursor if successfully created and initialized, 0 otherwise.

    Discussion

    See also IOMbufMemoryCursor::initWithSpecification.