/* Empty queue by removing and destroying all BD's. Free all buffers. */
static void ipw_queue_tx_free(struct ipw_priv *priv, struct clx2_tx_queue *txq)
/* Empty queue by removing and destroying all BD's. Free all buffers. */
static void ipw_queue_tx_free(struct ipw_priv *priv, struct clx2_tx_queue *txq)
{
	struct clx2_queue *q = &txq->q;
	struct pci_dev *dev = priv->pci_dev;
	if (q->n_bd == 0)
		return;
	for (; q->first_empty != q->last_used;
	     q->last_used = ipw_queue_inc_wrap(q->last_used, q->n_bd)) {
		ipw_queue_tx_free_tfd(priv, txq);
	}
	pci_free_consistent(dev, sizeof(txq->bd[0]) * q->n_bd, txq->bd,
			    q->dma_addr);
	kfree(txq->txb);
	memset(txq, 0, sizeof(*txq));
}