/* Clean RX queue, any received data still stored in the buffers is abandoned.  */
static void rx_error_handler(Gmac *gmac, struct gmac_queue *queue)
/* Clean RX queue, any received data still stored in the buffers is abandoned.  */
static void rx_error_handler(Gmac *gmac, struct gmac_queue *queue)
{
	queue->err_rx_flushed_count++;
	gmac->GMAC_NCR &= ~GMAC_NCR_RXEN;
	queue->rx_desc_list.tail = 0U;
	for (int i = 0; i < queue->rx_desc_list.len; i++) {
		queue->rx_desc_list.buf[i].w1 = 0U;
		queue->rx_desc_list.buf[i].w0 &= ~GMAC_RXW0_OWNERSHIP;
	}
	set_receive_buf_queue_pointer(gmac, queue);
	gmac->GMAC_NCR |=  GMAC_NCR_RXEN;
}