Lines Matching refs:tnapi

206 #define TG3_TX_WAKEUP_THRESH(tnapi)		((tnapi)->tx_pending / 4)  argument
1017 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_enable_ints() local
1019 tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); in tg3_enable_ints()
1021 tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); in tg3_enable_ints()
1023 tp->coal_now |= tnapi->coal_now; in tg3_enable_ints()
1036 static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) in tg3_has_work() argument
1038 struct tg3 *tp = tnapi->tp; in tg3_has_work()
1039 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_has_work()
1049 if (sblk->idx[0].tx_consumer != tnapi->tx_cons) in tg3_has_work()
1053 if (tnapi->rx_rcb_prod_idx && in tg3_has_work()
1054 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) in tg3_has_work()
1065 static void tg3_int_reenable(struct tg3_napi *tnapi) in tg3_int_reenable() argument
1067 struct tg3 *tp = tnapi->tp; in tg3_int_reenable()
1069 tw32_mailbox(tnapi->int_mbox, tnapi->last_tag << 24); in tg3_int_reenable()
1075 if (!tg3_flag(tp, TAGGED_STATUS) && tg3_has_work(tnapi)) in tg3_int_reenable()
1077 HOSTCC_MODE_ENABLE | tnapi->coal_now); in tg3_int_reenable()
6480 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_dump_state() local
6486 tnapi->hw_status->status, in tg3_dump_state()
6487 tnapi->hw_status->status_tag, in tg3_dump_state()
6488 tnapi->hw_status->rx_jumbo_consumer, in tg3_dump_state()
6489 tnapi->hw_status->rx_consumer, in tg3_dump_state()
6490 tnapi->hw_status->rx_mini_consumer, in tg3_dump_state()
6491 tnapi->hw_status->idx[0].rx_producer, in tg3_dump_state()
6492 tnapi->hw_status->idx[0].tx_consumer); in tg3_dump_state()
6497 tnapi->last_tag, tnapi->last_irq_tag, in tg3_dump_state()
6498 tnapi->tx_prod, tnapi->tx_cons, tnapi->tx_pending, in tg3_dump_state()
6499 tnapi->rx_rcb_ptr, in tg3_dump_state()
6500 tnapi->prodring.rx_std_prod_idx, in tg3_dump_state()
6501 tnapi->prodring.rx_std_cons_idx, in tg3_dump_state()
6502 tnapi->prodring.rx_jmb_prod_idx, in tg3_dump_state()
6503 tnapi->prodring.rx_jmb_cons_idx); in tg3_dump_state()
6527 static inline u32 tg3_tx_avail(struct tg3_napi *tnapi) in tg3_tx_avail() argument
6531 return tnapi->tx_pending - in tg3_tx_avail()
6532 ((tnapi->tx_prod - tnapi->tx_cons) & (TG3_TX_RING_SIZE - 1)); in tg3_tx_avail()
6539 static void tg3_tx(struct tg3_napi *tnapi) in tg3_tx() argument
6541 struct tg3 *tp = tnapi->tp; in tg3_tx()
6542 u32 hw_idx = tnapi->hw_status->idx[0].tx_consumer; in tg3_tx()
6543 u32 sw_idx = tnapi->tx_cons; in tg3_tx()
6545 int index = tnapi - tp->napi; in tg3_tx()
6554 struct tg3_tx_ring_info *ri = &tnapi->tx_buffers[sw_idx]; in tg3_tx()
6563 if (tnapi->tx_ring[sw_idx].len_flags & TXD_FLAG_HWTSTAMP) { in tg3_tx()
6583 ri = &tnapi->tx_buffers[sw_idx]; in tg3_tx()
6589 ri = &tnapi->tx_buffers[sw_idx]; in tg3_tx()
6601 ri = &tnapi->tx_buffers[sw_idx]; in tg3_tx()
6620 tnapi->tx_cons = sw_idx; in tg3_tx()
6630 (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)))) { in tg3_tx()
6633 (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))) in tg3_tx()
6742 static void tg3_recycle_rx(struct tg3_napi *tnapi, in tg3_recycle_rx() argument
6747 struct tg3 *tp = tnapi->tp; in tg3_recycle_rx()
6812 static int tg3_rx(struct tg3_napi *tnapi, int budget) in tg3_rx() argument
6814 struct tg3 *tp = tnapi->tp; in tg3_rx()
6817 u32 sw_idx = tnapi->rx_rcb_ptr; in tg3_rx()
6820 struct tg3_rx_prodring_set *tpr = &tnapi->prodring; in tg3_rx()
6822 hw_idx = *(tnapi->rx_rcb_prod_idx); in tg3_rx()
6834 struct tg3_rx_buffer_desc *desc = &tnapi->rx_rcb[sw_idx]; in tg3_rx()
6862 tg3_recycle_rx(tnapi, tpr, opaque_key, in tg3_rx()
6908 tg3_recycle_rx(tnapi, tpr, opaque_key, in tg3_rx()
6951 napi_gro_receive(&tnapi->napi, skb); in tg3_rx()
6973 hw_idx = *(tnapi->rx_rcb_prod_idx); in tg3_rx()
6979 tnapi->rx_rcb_ptr = sw_idx; in tg3_rx()
6980 tw32_rx_mbox(tnapi->consmbox, sw_idx); in tg3_rx()
7008 if (tnapi != &tp->napi[1]) { in tg3_rx()
7167 static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget) in tg3_poll_work() argument
7169 struct tg3 *tp = tnapi->tp; in tg3_poll_work()
7172 if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) { in tg3_poll_work()
7173 tg3_tx(tnapi); in tg3_poll_work()
7178 if (!tnapi->rx_rcb_prod_idx) in tg3_poll_work()
7185 if (*(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) in tg3_poll_work()
7186 work_done += tg3_rx(tnapi, budget - work_done); in tg3_poll_work()
7188 if (tg3_flag(tp, ENABLE_RSS) && tnapi == &tp->napi[1]) { in tg3_poll_work()
7231 struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi); in tg3_poll_msix() local
7232 struct tg3 *tp = tnapi->tp; in tg3_poll_msix()
7234 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_poll_msix()
7237 work_done = tg3_poll_work(tnapi, work_done, budget); in tg3_poll_msix()
7249 tnapi->last_tag = sblk->status_tag; in tg3_poll_msix()
7250 tnapi->last_irq_tag = tnapi->last_tag; in tg3_poll_msix()
7254 if (likely(sblk->idx[0].tx_consumer == tnapi->tx_cons && in tg3_poll_msix()
7255 *(tnapi->rx_rcb_prod_idx) == tnapi->rx_rcb_ptr)) { in tg3_poll_msix()
7260 if (tnapi == &tp->napi[1] && tp->rx_refill) in tg3_poll_msix()
7265 tw32_mailbox(tnapi->int_mbox, tnapi->last_tag << 24); in tg3_poll_msix()
7270 if (unlikely(tnapi == &tp->napi[1] && tp->rx_refill)) { in tg3_poll_msix()
7273 tnapi->coal_now); in tg3_poll_msix()
7325 struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi); in tg3_poll() local
7326 struct tg3 *tp = tnapi->tp; in tg3_poll()
7328 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_poll()
7336 work_done = tg3_poll_work(tnapi, work_done, budget); in tg3_poll()
7349 tnapi->last_tag = sblk->status_tag; in tg3_poll()
7350 tnapi->last_irq_tag = tnapi->last_tag; in tg3_poll()
7355 if (likely(!tg3_has_work(tnapi))) { in tg3_poll()
7357 tg3_int_reenable(tnapi); in tg3_poll()
7473 struct tg3_napi *tnapi = dev_id; in tg3_msi_1shot() local
7474 struct tg3 *tp = tnapi->tp; in tg3_msi_1shot()
7476 prefetch(tnapi->hw_status); in tg3_msi_1shot()
7477 if (tnapi->rx_rcb) in tg3_msi_1shot()
7478 prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); in tg3_msi_1shot()
7481 napi_schedule(&tnapi->napi); in tg3_msi_1shot()
7492 struct tg3_napi *tnapi = dev_id; in tg3_msi() local
7493 struct tg3 *tp = tnapi->tp; in tg3_msi()
7495 prefetch(tnapi->hw_status); in tg3_msi()
7496 if (tnapi->rx_rcb) in tg3_msi()
7497 prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); in tg3_msi()
7505 tw32_mailbox(tnapi->int_mbox, 0x00000001); in tg3_msi()
7507 napi_schedule(&tnapi->napi); in tg3_msi()
7514 struct tg3_napi *tnapi = dev_id; in tg3_interrupt() local
7515 struct tg3 *tp = tnapi->tp; in tg3_interrupt()
7516 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_interrupt()
7547 if (likely(tg3_has_work(tnapi))) { in tg3_interrupt()
7548 prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); in tg3_interrupt()
7549 napi_schedule(&tnapi->napi); in tg3_interrupt()
7563 struct tg3_napi *tnapi = dev_id; in tg3_interrupt_tagged() local
7564 struct tg3 *tp = tnapi->tp; in tg3_interrupt_tagged()
7565 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_interrupt_tagged()
7573 if (unlikely(sblk->status_tag == tnapi->last_irq_tag)) { in tg3_interrupt_tagged()
7600 tnapi->last_irq_tag = sblk->status_tag; in tg3_interrupt_tagged()
7605 prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); in tg3_interrupt_tagged()
7607 napi_schedule(&tnapi->napi); in tg3_interrupt_tagged()
7616 struct tg3_napi *tnapi = dev_id; in tg3_test_isr() local
7617 struct tg3 *tp = tnapi->tp; in tg3_test_isr()
7618 struct tg3_hw_status *sblk = tnapi->hw_status; in tg3_test_isr()
7699 static bool tg3_tx_frag_set(struct tg3_napi *tnapi, u32 *entry, u32 *budget, in tg3_tx_frag_set() argument
7703 struct tg3 *tp = tnapi->tp; in tg3_tx_frag_set()
7731 tnapi->tx_buffers[*entry].fragmented = true; in tg3_tx_frag_set()
7733 tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, in tg3_tx_frag_set()
7744 tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, in tg3_tx_frag_set()
7750 tnapi->tx_buffers[prvidx].fragmented = false; in tg3_tx_frag_set()
7754 tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, in tg3_tx_frag_set()
7762 static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last) in tg3_tx_skb_unmap() argument
7766 struct tg3_tx_ring_info *txb = &tnapi->tx_buffers[entry]; in tg3_tx_skb_unmap()
7771 pci_unmap_single(tnapi->tp->pdev, in tg3_tx_skb_unmap()
7779 txb = &tnapi->tx_buffers[entry]; in tg3_tx_skb_unmap()
7786 txb = &tnapi->tx_buffers[entry]; in tg3_tx_skb_unmap()
7788 pci_unmap_page(tnapi->tp->pdev, in tg3_tx_skb_unmap()
7795 txb = &tnapi->tx_buffers[entry]; in tg3_tx_skb_unmap()
7801 static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, in tigon3_dma_hwbug_workaround() argument
7806 struct tg3 *tp = tnapi->tp; in tigon3_dma_hwbug_workaround()
7836 tnapi->tx_buffers[*entry].skb = new_skb; in tigon3_dma_hwbug_workaround()
7837 dma_unmap_addr_set(&tnapi->tx_buffers[*entry], in tigon3_dma_hwbug_workaround()
7840 if (tg3_tx_frag_set(tnapi, entry, budget, new_addr, in tigon3_dma_hwbug_workaround()
7843 tg3_tx_skb_unmap(tnapi, save_entry, -1); in tigon3_dma_hwbug_workaround()
7855 static bool tg3_tso_bug_gso_check(struct tg3_napi *tnapi, struct sk_buff *skb) in tg3_tso_bug_gso_check() argument
7860 return skb_shinfo(skb)->gso_segs < tnapi->tx_pending / 3; in tg3_tso_bug_gso_check()
7868 static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi, in tg3_tso_bug() argument
7875 if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) { in tg3_tso_bug()
7884 if (tg3_tx_avail(tnapi) <= frag_cnt_est) in tg3_tso_bug()
7914 struct tg3_napi *tnapi; in tg3_start_xmit() local
7923 tnapi = &tp->napi[skb_get_queue_mapping(skb)]; in tg3_start_xmit()
7925 tnapi++; in tg3_start_xmit()
7927 budget = tg3_tx_avail(tnapi); in tg3_start_xmit()
7945 entry = tnapi->tx_prod; in tg3_start_xmit()
7965 if (tg3_tso_bug_gso_check(tnapi, skb)) in tg3_start_xmit()
7966 return tg3_tso_bug(tp, tnapi, txq, skb); in tg3_start_xmit()
7973 if (tg3_tso_bug_gso_check(tnapi, skb)) in tg3_start_xmit()
7974 return tg3_tso_bug(tp, tnapi, txq, skb); in tg3_start_xmit()
8057 tnapi->tx_buffers[entry].skb = skb; in tg3_start_xmit()
8058 dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping); in tg3_start_xmit()
8065 if (tg3_tx_frag_set(tnapi, &entry, &budget, mapping, len, base_flags | in tg3_start_xmit()
8088 tnapi->tx_buffers[entry].skb = NULL; in tg3_start_xmit()
8089 dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, in tg3_start_xmit()
8095 tg3_tx_frag_set(tnapi, &entry, &budget, mapping, in tg3_start_xmit()
8106 tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, i); in tg3_start_xmit()
8108 if (mss && tg3_tso_bug_gso_check(tnapi, skb)) { in tg3_start_xmit()
8117 return tg3_tso_bug(tp, tnapi, txq, skb); in tg3_start_xmit()
8123 entry = tnapi->tx_prod; in tg3_start_xmit()
8124 budget = tg3_tx_avail(tnapi); in tg3_start_xmit()
8125 if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget, in tg3_start_xmit()
8136 tnapi->tx_prod = entry; in tg3_start_xmit()
8137 if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) { in tg3_start_xmit()
8146 if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)) in tg3_start_xmit()
8152 tw32_tx_mbox(tnapi->prodmbox, entry); in tg3_start_xmit()
8158 tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, --i); in tg3_start_xmit()
8159 tnapi->tx_buffers[tnapi->tx_prod].skb = NULL; in tg3_start_xmit()
8545 struct tg3_napi *tnapi = &tp->napi[j]; in tg3_free_rings() local
8547 tg3_rx_prodring_free(tp, &tnapi->prodring); in tg3_free_rings()
8549 if (!tnapi->tx_buffers) in tg3_free_rings()
8553 struct sk_buff *skb = tnapi->tx_buffers[i].skb; in tg3_free_rings()
8558 tg3_tx_skb_unmap(tnapi, i, in tg3_free_rings()
8582 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_init_rings() local
8584 tnapi->last_tag = 0; in tg3_init_rings()
8585 tnapi->last_irq_tag = 0; in tg3_init_rings()
8586 tnapi->hw_status->status = 0; in tg3_init_rings()
8587 tnapi->hw_status->status_tag = 0; in tg3_init_rings()
8588 memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); in tg3_init_rings()
8590 tnapi->tx_prod = 0; in tg3_init_rings()
8591 tnapi->tx_cons = 0; in tg3_init_rings()
8592 if (tnapi->tx_ring) in tg3_init_rings()
8593 memset(tnapi->tx_ring, 0, TG3_TX_RING_BYTES); in tg3_init_rings()
8595 tnapi->rx_rcb_ptr = 0; in tg3_init_rings()
8596 if (tnapi->rx_rcb) in tg3_init_rings()
8597 memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); in tg3_init_rings()
8599 if (tnapi->prodring.rx_std && in tg3_init_rings()
8600 tg3_rx_prodring_alloc(tp, &tnapi->prodring)) { in tg3_init_rings()
8614 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_mem_tx_release() local
8616 if (tnapi->tx_ring) { in tg3_mem_tx_release()
8618 tnapi->tx_ring, tnapi->tx_desc_mapping); in tg3_mem_tx_release()
8619 tnapi->tx_ring = NULL; in tg3_mem_tx_release()
8622 kfree(tnapi->tx_buffers); in tg3_mem_tx_release()
8623 tnapi->tx_buffers = NULL; in tg3_mem_tx_release()
8630 struct tg3_napi *tnapi = &tp->napi[0]; in tg3_mem_tx_acquire() local
8636 tnapi++; in tg3_mem_tx_acquire()
8638 for (i = 0; i < tp->txq_cnt; i++, tnapi++) { in tg3_mem_tx_acquire()
8639 tnapi->tx_buffers = kcalloc(TG3_TX_RING_SIZE, in tg3_mem_tx_acquire()
8642 if (!tnapi->tx_buffers) in tg3_mem_tx_acquire()
8645 tnapi->tx_ring = dma_alloc_coherent(&tp->pdev->dev, in tg3_mem_tx_acquire()
8647 &tnapi->tx_desc_mapping, in tg3_mem_tx_acquire()
8649 if (!tnapi->tx_ring) in tg3_mem_tx_acquire()
8665 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_mem_rx_release() local
8667 tg3_rx_prodring_fini(tp, &tnapi->prodring); in tg3_mem_rx_release()
8669 if (!tnapi->rx_rcb) in tg3_mem_rx_release()
8674 tnapi->rx_rcb, in tg3_mem_rx_release()
8675 tnapi->rx_rcb_mapping); in tg3_mem_rx_release()
8676 tnapi->rx_rcb = NULL; in tg3_mem_rx_release()
8693 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_mem_rx_acquire() local
8695 if (tg3_rx_prodring_init(tp, &tnapi->prodring)) in tg3_mem_rx_acquire()
8705 tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev, in tg3_mem_rx_acquire()
8707 &tnapi->rx_rcb_mapping, in tg3_mem_rx_acquire()
8709 if (!tnapi->rx_rcb) in tg3_mem_rx_acquire()
8729 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_free_consistent() local
8731 if (tnapi->hw_status) { in tg3_free_consistent()
8733 tnapi->hw_status, in tg3_free_consistent()
8734 tnapi->status_mapping); in tg3_free_consistent()
8735 tnapi->hw_status = NULL; in tg3_free_consistent()
8768 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_alloc_consistent() local
8771 tnapi->hw_status = dma_alloc_coherent(&tp->pdev->dev, in tg3_alloc_consistent()
8773 &tnapi->status_mapping, in tg3_alloc_consistent()
8775 if (!tnapi->hw_status) in tg3_alloc_consistent()
8778 sblk = tnapi->hw_status; in tg3_alloc_consistent()
8803 tnapi->rx_rcb_prod_idx = prodptr; in tg3_alloc_consistent()
8805 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; in tg3_alloc_consistent()
8939 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_abort_hw() local
8940 if (tnapi->hw_status) in tg3_abort_hw()
8941 memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); in tg3_abort_hw()
9106 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_chip_reset() local
9107 if (tnapi->hw_status) { in tg3_chip_reset()
9108 tnapi->hw_status->status = 0; in tg3_chip_reset()
9109 tnapi->hw_status->status_tag = 0; in tg3_chip_reset()
9111 tnapi->last_tag = 0; in tg3_chip_reset()
9112 tnapi->last_irq_tag = 0; in tg3_chip_reset()
9542 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_tx_rcbs_init() local
9544 if (!tnapi->tx_ring) in tg3_tx_rcbs_init()
9547 tg3_set_bdinfo(tp, txrcb, tnapi->tx_desc_mapping, in tg3_tx_rcbs_init()
9586 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_rx_ret_rcbs_init() local
9588 if (!tnapi->rx_rcb) in tg3_rx_ret_rcbs_init()
9591 tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping, in tg3_rx_ret_rcbs_init()
9602 struct tg3_napi *tnapi = &tp->napi[0]; in tg3_rings_reset() local
9644 memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); in tg3_rings_reset()
9648 ((u64) tnapi->status_mapping >> 32)); in tg3_rings_reset()
9650 ((u64) tnapi->status_mapping & 0xffffffff)); in tg3_rings_reset()
9654 for (i = 1, tnapi++; i < tp->irq_cnt; i++, tnapi++) { in tg3_rings_reset()
9655 u64 mapping = (u64)tnapi->status_mapping; in tg3_rings_reset()
9661 memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); in tg3_rings_reset()
10962 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_chk_missed_msi() local
10964 if (tg3_has_work(tnapi)) { in tg3_chk_missed_msi()
10965 if (tnapi->last_rx_cons == tnapi->rx_rcb_ptr && in tg3_chk_missed_msi()
10966 tnapi->last_tx_cons == tnapi->tx_cons) { in tg3_chk_missed_msi()
10967 if (tnapi->chk_msi_cnt < 1) { in tg3_chk_missed_msi()
10968 tnapi->chk_msi_cnt++; in tg3_chk_missed_msi()
10971 tg3_msi(0, tnapi); in tg3_chk_missed_msi()
10974 tnapi->chk_msi_cnt = 0; in tg3_chk_missed_msi()
10975 tnapi->last_rx_cons = tnapi->rx_rcb_ptr; in tg3_chk_missed_msi()
10976 tnapi->last_tx_cons = tnapi->tx_cons; in tg3_chk_missed_msi()
11241 struct tg3_napi *tnapi = &tp->napi[irq_num]; in tg3_request_irq() local
11246 name = &tnapi->irq_lbl[0]; in tg3_request_irq()
11247 if (tnapi->tx_buffers && tnapi->rx_rcb) in tg3_request_irq()
11250 else if (tnapi->tx_buffers) in tg3_request_irq()
11253 else if (tnapi->rx_rcb) in tg3_request_irq()
11274 return request_irq(tnapi->irq_vec, fn, flags, name, tnapi); in tg3_request_irq()
11279 struct tg3_napi *tnapi = &tp->napi[0]; in tg3_test_interrupt() local
11289 free_irq(tnapi->irq_vec, tnapi); in tg3_test_interrupt()
11300 err = request_irq(tnapi->irq_vec, tg3_test_isr, in tg3_test_interrupt()
11301 IRQF_SHARED, dev->name, tnapi); in tg3_test_interrupt()
11305 tnapi->hw_status->status &= ~SD_STATUS_UPDATED; in tg3_test_interrupt()
11309 tnapi->coal_now); in tg3_test_interrupt()
11314 int_mbox = tr32_mailbox(tnapi->int_mbox); in tg3_test_interrupt()
11324 tnapi->hw_status->status_tag != tnapi->last_tag) in tg3_test_interrupt()
11325 tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); in tg3_test_interrupt()
11332 free_irq(tnapi->irq_vec, tnapi); in tg3_test_interrupt()
11598 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_start() local
11600 free_irq(tnapi->irq_vec, tnapi); in tg3_start()
11669 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_start() local
11670 free_irq(tnapi->irq_vec, tnapi); in tg3_start()
11708 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_stop() local
11709 free_irq(tnapi->irq_vec, tnapi); in tg3_stop()
13434 struct tg3_napi *tnapi, *rnapi; in tg3_run_loopback() local
13437 tnapi = &tp->napi[0]; in tg3_run_loopback()
13443 tnapi = &tp->napi[1]; in tg3_run_loopback()
13445 coal_now = tnapi->coal_now | rnapi->coal_now; in tg3_run_loopback()
13522 val = tnapi->tx_prod; in tg3_run_loopback()
13523 tnapi->tx_buffers[val].skb = skb; in tg3_run_loopback()
13524 dma_unmap_addr_set(&tnapi->tx_buffers[val], mapping, map); in tg3_run_loopback()
13533 budget = tg3_tx_avail(tnapi); in tg3_run_loopback()
13534 if (tg3_tx_frag_set(tnapi, &val, &budget, map, tx_len, in tg3_run_loopback()
13536 tnapi->tx_buffers[val].skb = NULL; in tg3_run_loopback()
13541 tnapi->tx_prod++; in tg3_run_loopback()
13546 tw32_tx_mbox(tnapi->prodmbox, tnapi->tx_prod); in tg3_run_loopback()
13547 tr32_mailbox(tnapi->prodmbox); in tg3_run_loopback()
13558 tx_idx = tnapi->hw_status->idx[0].tx_consumer; in tg3_run_loopback()
13560 if ((tx_idx == tnapi->tx_prod) && in tg3_run_loopback()
13565 tg3_tx_skb_unmap(tnapi, tnapi->tx_prod - 1, -1); in tg3_run_loopback()
13568 if (tx_idx != tnapi->tx_prod) in tg3_run_loopback()
17865 struct tg3_napi *tnapi = &tp->napi[i]; in tg3_init_one() local
17867 tnapi->tp = tp; in tg3_init_one()
17868 tnapi->tx_pending = TG3_DEF_TX_RING_PENDING; in tg3_init_one()
17870 tnapi->int_mbox = intmbx; in tg3_init_one()
17876 tnapi->consmbox = rcvmbx; in tg3_init_one()
17877 tnapi->prodmbox = sndmbx; in tg3_init_one()
17880 tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1); in tg3_init_one()
17882 tnapi->coal_now = HOSTCC_MODE_NOW; in tg3_init_one()