Allocate a ring of pre-allocated device driver receive buffers so that the device driver can get a pre-allocated buffer from this recv pool during an ISR. The user can specify a number of maximum size packets and a number of small size packets. For Ethernet device driver the maximum size packet (fullBufferSize parameter) should be TM_ETHER_MAX_PACKET_CRC. This function should be called from the device driver open function, and the device driver should only get a buffer from this pool during an ISR.
|Note:|| The user must periodically replinish the Treck ISR recv pool as follows:
errorCode=tfIoctlInterface(interfaceHandle, TM_DEV_IOCTL_REFILL_POOL_FLAG, (void *)0, 0);
- Interface handle as given in the first parameter of the driver open function, or as returned by tfAddInterface().
- The number of full size buffers to pre-allocate in the ring.
- The number of small size buffers to pre-allocate in the ring.
- The maximum buffer size (TM_ETHER_MAX_PACKET_CRC for Ethernet).
- The small buffer size (for example 128 bytes).
- Specify data pointer alignment for pre-allocated receive buffers.
- Indicates whether buffers should be reallocated in line when the tfPoolReceive() function is called (in the context of the recv task). 0 means no in-line reallocation. TM_POOL_REFILL_IN_LINE means in-line reallocation.
- One of the follwing:
- numberFullSizeBuffers parameter is less or equal to zero
- fullBufferSize parameter is less or equal to zero
- fullBufferSize is less than TM_ETHER_MAX_PACKET_CRC on Ethernet
- numberSmallSizeBuffers is negative
- smallBufferSize is negative
- smallBufferSize is zero and numberSmallSizeBuffers is not zero
- alignment is negative
- alignment is bigger than 64
- flag is neither 0 nor TM_POOL_REFILL_IN_LINE
- Function not called from the device driver open function.
- Pool already created on that interface.
- Not enough memory to allocate the recv pool.