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 */
2419 static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb)
2425 struct sk_buff *skb = tcb->skb;
2514 tcb->index_start = tx_ring->send_idx;
2515 tcb->stale = 0;
2548 tcb->index = NUM_DESC_PER_RING_TX - 1;
2550 tcb->index = ET_DMA10_WRAP|(NUM_DESC_PER_RING_TX - 1);
2552 tcb->index = tx_ring->send_idx - 1;
2558 tx_ring->send_tail->next = tcb;
2560 tx_ring->send_head = tcb;
2562 tx_ring->send_tail = tcb;
2564 WARN_ON(tcb->next != NULL);
2586 struct tcb *tcb;
2596 tcb = tx_ring->tcb_qhead;
2598 if (tcb == NULL) {
2603 tx_ring->tcb_qhead = tcb->next;
2610 tcb->skb = skb;
2611 tcb->next = NULL;
2613 status = nic_send_packet(adapter, tcb);
2619 tx_ring->tcb_qtail->next = tcb;
2622 tx_ring->tcb_qhead = tcb;
2624 tx_ring->tcb_qtail = tcb;
2632 /* free_send_packet - Recycle a struct tcb */
2634 struct tcb *tcb)
2642 if (tcb->skb) {
2643 stats->tx_bytes += tcb->skb->len;
2651 INDEX10(tcb->index_start);
2660 add_10bit(&tcb->index_start, 1);
2661 if (INDEX10(tcb->index_start) >=
2663 tcb->index_start &= ~ET_DMA10_MASK;
2664 tcb->index_start ^= ET_DMA10_WRAP;
2666 } while (desc != tx_ring->tx_desc_ring + INDEX10(tcb->index));
2668 dev_kfree_skb_any(tcb->skb);
2671 memset(tcb, 0, sizeof(struct tcb));
2679 tx_ring->tcb_qtail->next = tcb;
2681 tx_ring->tcb_qhead = tcb;
2683 tx_ring->tcb_qtail = tcb;
2692 struct tcb *tcb;
2700 tcb = tx_ring->send_head;
2702 while (tcb != NULL && freed < NUM_TCB) {
2703 struct tcb *next = tcb->next;
2715 free_send_packet(adapter, tcb);
2719 tcb = tx_ring->send_head;
2738 struct tcb *tcb;
2750 tcb = tx_ring->send_head;
2752 while (tcb &&
2753 ((serviced ^ tcb->index) & ET_DMA10_WRAP) &&
2754 index < INDEX10(tcb->index)) {
2756 tx_ring->send_head = tcb->next;
2757 if (tcb->next == NULL)
2761 free_send_packet(adapter, tcb);
2765 tcb = tx_ring->send_head;
2767 while (tcb &&
2768 !((serviced ^ tcb->index) & ET_DMA10_WRAP) &&
2769 index > (tcb->index & ET_DMA10_MASK)) {
2771 tx_ring->send_head = tcb->next;
2772 if (tcb->next == NULL)
2776 free_send_packet(adapter, tcb);
2780 tcb = tx_ring->send_head;
3391 struct tcb *tcb = tx_ring->send_head;
3393 if (tcb)
3394 if (++tcb->stale > 1)
3399 else if (tcb == NULL)
3807 struct tcb *tcb;
3828 tcb = tx_ring->send_head;
3831 if (tcb) {
3832 tcb->count++;
3834 if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
3836 "Send stuck - reset. tcb->WrIndex %x\n",
3837 tcb->index);