/* Return the number of TX buffer waiting for transfer.  */
uint32_t gmac_dev_tx_buf_used(gmac_device_t *p_gmac_dev, gmac_quelist_t queue_idx)
/* Return the number of TX buffer waiting for transfer.  */
uint32_t gmac_dev_tx_buf_used(gmac_device_t *p_gmac_dev, gmac_quelist_t queue_idx)
{
	uint32_t used = 0;
	for (uint32_t i = 0; i < p_gmac_dev->gmac_queue_list[queue_idx].us_tx_list_size; ++i) {
		if ((p_gmac_dev->gmac_queue_list[queue_idx].p_tx_dscr[i].status.val & GMAC_TXD_USED) == 0)
			used += 1;
	}
	return used;
}