/* Reclaims n TX descriptors and frees the buffers associated with them.  */
static void free_cmdQ_buffers(struct sge *sge, struct cmdQ *q, unsigned int n)
/* Reclaims n TX descriptors and frees the buffers associated with them.  */
static void free_cmdQ_buffers(struct sge *sge, struct cmdQ *q, unsigned int n)
{
	struct cmdQ_ce *ce;
	struct pci_dev *pdev = sge->adapter->pdev;
	unsigned int cidx = q->cidx;
	q->in_use -= n;
	ce = &q->centries[cidx];
	while (n--) {
		if (likely(pci_unmap_len(ce, dma_len))) {
			pci_unmap_single(pdev, pci_unmap_addr(ce, dma_addr),
					 pci_unmap_len(ce, dma_len),
					 PCI_DMA_TODEVICE);
			if (q->sop)
				q->sop = 0;
		}
		if (ce->skb) {
			dev_kfree_skb_any(ce->skb);
			q->sop = 1;
		}
		ce++;
		if (++cidx == q->size) {
			cidx = 0;
			ce = q->centries;
		}
	}
	q->cidx = cidx;
}