- struct pci_dev *pdev = adapter->pdev;
- int i = adapter->tx_ring.next_to_clean;
- struct ixgb_tx_desc *tx_desc = IXGB_TX_DESC(*tx_ring, i);
- while ((tx_desc->status & IXGB_TX_DESC_STATUS_DD)) {
- if (tx_desc->popts
- & (IXGB_TX_DESC_POPTS_TXSM | IXGB_TX_DESC_POPTS_IXSM))
- adapter->hw_csum_tx_good++;
-
- if (tx_ring->buffer_info[i].dma) {
- pci_unmap_page(pdev, tx_ring->buffer_info[i].dma,
- tx_ring->buffer_info[i].length,
- PCI_DMA_TODEVICE);
- tx_ring->buffer_info[i].dma = 0;
- }
-
- if (tx_ring->buffer_info[i].skb) {
- dev_kfree_skb_any(tx_ring->buffer_info[i].skb);
- tx_ring->buffer_info[i].skb = NULL;
- }
-
- *(u32 *) & (tx_desc->status) = 0;
-
- i = (i + 1) % tx_ring->count;
- tx_desc = IXGB_TX_DESC(*tx_ring, i);
- }
-
- tx_ring->next_to_clean = i;
-
- if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev) &&
- (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) {
-
- netif_wake_queue(netdev);
- }
-}
-
-#ifdef CONFIG_IXGB_NAPI
-static int
-ixgb_poll(struct net_device *netdev, int *budget)
-{
- struct ixgb_adapter *adapter = netdev->priv;
- struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
- struct pci_dev *pdev = adapter->pdev;
- struct ixgb_rx_desc *rx_desc;
- struct sk_buff *skb;
- u32 length;
- int i;
- int received = 0;
- int rx_work_limit = *budget;
-
- if (rx_work_limit > netdev->quota)
- rx_work_limit = netdev->quota;
-
- ixgb_process_intr(netdev);