Lines Matching refs:tcb
349 struct tcb {
350 struct tcb *next; /* Next entry in ring */
361 struct tcb *tcb_ring;
364 struct tcb *tcb_qhead;
365 struct tcb *tcb_qtail;
368 struct tcb *send_head;
369 struct tcb *send_tail;
459 spinlock_t tcb_send_qlock; /* protects the tx_ring send tcb list */
460 spinlock_t tcb_ready_qlock; /* protects the tx_ring ready tcb list */
1753 struct tcb *tcb = tx_ring->tcb_ring;
1755 tx_ring->tcb_qhead = tcb;
1757 memset(tcb, 0, sizeof(struct tcb) * NUM_TCB);
1760 tcb->next = tcb + 1;
1761 tcb++;
1764 tcb--;
1765 tx_ring->tcb_qtail = tcb;
1766 tcb->next = NULL;
2360 tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),
2412 /* Free the memory for the tcb structures */
2417 static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb)
2423 struct sk_buff *skb = tcb->skb;
2515 tcb->index_start = tx_ring->send_idx;
2516 tcb->stale = 0;
2549 tcb->index = NUM_DESC_PER_RING_TX - 1;
2551 tcb->index = ET_DMA10_WRAP|(NUM_DESC_PER_RING_TX - 1);
2553 tcb->index = tx_ring->send_idx - 1;
2559 tx_ring->send_tail->next = tcb;
2561 tx_ring->send_head = tcb;
2563 tx_ring->send_tail = tcb;
2565 WARN_ON(tcb->next != NULL);
2587 struct tcb *tcb;
2597 tcb = tx_ring->tcb_qhead;
2599 if (tcb == NULL) {
2604 tx_ring->tcb_qhead = tcb->next;
2611 tcb->skb = skb;
2612 tcb->next = NULL;
2614 status = nic_send_packet(adapter, tcb);
2620 tx_ring->tcb_qtail->next = tcb;
2623 tx_ring->tcb_qhead = tcb;
2625 tx_ring->tcb_qtail = tcb;
2633 /* free_send_packet - Recycle a struct tcb */
2635 struct tcb *tcb)
2643 if (tcb->skb) {
2644 stats->tx_bytes += tcb->skb->len;
2652 INDEX10(tcb->index_start);
2661 add_10bit(&tcb->index_start, 1);
2662 if (INDEX10(tcb->index_start) >=
2664 tcb->index_start &= ~ET_DMA10_MASK;
2665 tcb->index_start ^= ET_DMA10_WRAP;
2667 } while (desc != tx_ring->tx_desc_ring + INDEX10(tcb->index));
2669 dev_kfree_skb_any(tcb->skb);
2672 memset(tcb, 0, sizeof(struct tcb));
2680 tx_ring->tcb_qtail->next = tcb;
2682 tx_ring->tcb_qhead = tcb;
2684 tx_ring->tcb_qtail = tcb;
2693 struct tcb *tcb;
2701 tcb = tx_ring->send_head;
2703 while (tcb != NULL && freed < NUM_TCB) {
2704 struct tcb *next = tcb->next;
2716 free_send_packet(adapter, tcb);
2720 tcb = tx_ring->send_head;
2739 struct tcb *tcb;
2751 tcb = tx_ring->send_head;
2753 while (tcb &&
2754 ((serviced ^ tcb->index) & ET_DMA10_WRAP) &&
2755 index < INDEX10(tcb->index)) {
2757 tx_ring->send_head = tcb->next;
2758 if (tcb->next == NULL)
2762 free_send_packet(adapter, tcb);
2766 tcb = tx_ring->send_head;
2768 while (tcb &&
2769 !((serviced ^ tcb->index) & ET_DMA10_WRAP) &&
2770 index > (tcb->index & ET_DMA10_MASK)) {
2772 tx_ring->send_head = tcb->next;
2773 if (tcb->next == NULL)
2777 free_send_packet(adapter, tcb);
2781 tcb = tx_ring->send_head;
3392 struct tcb *tcb = tx_ring->send_head;
3394 if (tcb)
3395 if (++tcb->stale > 1)
3400 else if (tcb == NULL)
3801 struct tcb *tcb;
3822 tcb = tx_ring->send_head;
3825 if (tcb) {
3826 tcb->count++;
3828 if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
3830 "Send stuck - reset. tcb->WrIndex %x\n",
3831 tcb->index);