|char * tfGetCacheSafeDrvBuf||(|
This function allocates a "cache safe" (i.e., invalidated) packet buffer to be used by a device driver. The returned data pointer will be aligned according to the alignment parameter. If possible, the data pointer will also be automatically adjusted to allow the IP header to start on a 4-byte-aligned memory address. This function will only work correctly on interfaces which have a "cache invalidate" callback registered via tfUseInterfaceCacheInvalFunc().
- Handle to the interface to use this callback on.
- Pointer to a ttUserBuffer structure. The function will store a buffer handle in this variable. The buffer handle must later be provided back to the stack in the driver's receive function.
- Requested buffer length
- Requested buffer alignment. It is common for network hardware that supports DMA to require pre-allocated receive buffers to be memory-aligned. Such alignment requirements can be specified here, and used by the stack when setting the start of the data buffer.
- Must be set to TM_DEV_CALLED_FROM_APP if called from the application. If called from a device driver function, this parameter should be set to 0.
- Error: unable to allocate a new buffer.
- Valid Pointer
- Pointer to the new data buffer.