/* Get the packet wait bound timer for this driver/device. The packet wait bound is used during interrupt coalescing to trigger an interrupt when not enough packets have been received to reach the packet count threshold. A packet is a generic term used by the scatter-gather DMA engine, and is equivalent to an Ethernet frame in our case. The timer is in milliseconds. */
XStatus XEmac_GetPktWaitBound(XEmac *InstancePtr, u32 Direction, u32 *WaitPtr)
/* Get the packet wait bound timer for this driver/device. The packet wait bound is used during interrupt coalescing to trigger an interrupt when not enough packets have been received to reach the packet count threshold. A packet is a generic term used by the scatter-gather DMA engine, and is equivalent to an Ethernet frame in our case. The timer is in milliseconds. */
XStatus XEmac_GetPktWaitBound(XEmac *InstancePtr, u32 Direction, u32 *WaitPtr)
{
	XASSERT_NONVOID(InstancePtr != NULL);
	XASSERT_NONVOID(Direction == XEM_SEND || Direction == XEM_RECV);
	XASSERT_NONVOID(WaitPtr != NULL);
	XASSERT_NONVOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);
	if (!XEmac_mIsSgDma(InstancePtr)) {
		return XST_NOT_SGDMA;
	}
	switch (Direction) {
	case XEM_SEND:
		*WaitPtr =
		    XDmaChannel_GetPktWaitBound(&InstancePtr->SendChannel);
		break;
	case XEM_RECV:
		*WaitPtr =
		    XDmaChannel_GetPktWaitBound(&InstancePtr->RecvChannel);
		break;
	default:
		return XST_INVALID_PARAM;
	}
	return XST_SUCCESS;
}