Lines Matching refs:bd
61 struct cppi_descriptor *bd = c->freelist; in cppi_bd_alloc() local
63 if (bd) in cppi_bd_alloc()
64 c->freelist = bd->next; in cppi_bd_alloc()
65 return bd; in cppi_bd_alloc()
69 cppi_bd_free(struct cppi_channel *c, struct cppi_descriptor *bd) in cppi_bd_free() argument
71 if (!bd) in cppi_bd_free()
73 bd->next = c->freelist; in cppi_bd_free()
74 c->freelist = bd; in cppi_bd_free()
123 struct cppi_descriptor *bd; in cppi_pool_init() local
126 bd = dma_pool_alloc(cppi->pool, GFP_KERNEL, &dma); in cppi_pool_init()
127 bd->dma = dma; in cppi_pool_init()
128 cppi_bd_free(c, bd); in cppi_pool_init()
137 struct cppi_descriptor *bd; in cppi_pool_free() local
144 bd = c->last_processed; in cppi_pool_free()
146 if (bd) in cppi_pool_free()
147 dma_pool_free(cppi->pool, bd, bd->dma); in cppi_pool_free()
148 bd = cppi_bd_alloc(c); in cppi_pool_free()
149 } while (bd); in cppi_pool_free()
429 static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) in cppi_dump_rxbd() argument
433 tag, bd->dma, in cppi_dump_rxbd()
434 bd->hw_next, bd->hw_bufp, bd->hw_off_len, in cppi_dump_rxbd()
435 bd->hw_options); in cppi_dump_rxbd()
440 struct cppi_descriptor *bd; in cppi_dump_rxq() local
445 for (bd = rx->head; bd; bd = bd->next) in cppi_dump_rxq()
446 cppi_dump_rxbd("active", bd); in cppi_dump_rxq()
566 struct cppi_descriptor *bd; in cppi_next_tx_segment() local
608 bd = tx->freelist; in cppi_next_tx_segment()
609 tx->head = bd; in cppi_next_tx_segment()
621 if (++i < n_bds && bd->next) in cppi_next_tx_segment()
622 bd->hw_next = bd->next->dma; in cppi_next_tx_segment()
624 bd->hw_next = 0; in cppi_next_tx_segment()
626 bd->hw_bufp = tx->buf_dma + tx->offset; in cppi_next_tx_segment()
633 bd->hw_off_len = maxpacket; in cppi_next_tx_segment()
634 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
642 bd->hw_off_len = partial_len; in cppi_next_tx_segment()
644 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
647 bd->hw_options |= CPPI_ZERO_SET; in cppi_next_tx_segment()
651 bd, bd->hw_next, bd->hw_bufp, in cppi_next_tx_segment()
652 bd->hw_off_len, bd->hw_options); in cppi_next_tx_segment()
655 tx->tail = bd; in cppi_next_tx_segment()
656 bd = bd->next; in cppi_next_tx_segment()
766 struct cppi_descriptor *bd, *tail; in cppi_next_rx_segment() local
832 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
833 rx->head = bd; in cppi_next_rx_segment()
836 for (i = 0, tail = NULL; bd && i < n_bds; i++, tail = bd) { in cppi_next_rx_segment()
840 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
841 if (!bd) in cppi_next_rx_segment()
843 tail->next = bd; in cppi_next_rx_segment()
844 tail->hw_next = bd->dma; in cppi_next_rx_segment()
846 bd->hw_next = 0; in cppi_next_rx_segment()
854 bd->hw_bufp = addr; in cppi_next_rx_segment()
858 bd->hw_off_len = (0 /*offset*/ << 16) + bd_len; in cppi_next_rx_segment()
859 bd->buflen = bd_len; in cppi_next_rx_segment()
861 bd->hw_options = CPPI_OWN_SET | (i == 0 ? length : 0); in cppi_next_rx_segment()
875 bd = rx->head; in cppi_next_rx_segment()
883 bd->hw_options |= CPPI_SOP_SET; in cppi_next_rx_segment()
892 tail->next = bd; in cppi_next_rx_segment()
893 tail->hw_next = bd->dma; in cppi_next_rx_segment()
904 musb_writel(&rx_ram->rx_head, 0, bd->dma); in cppi_next_rx_segment()
1006 struct cppi_descriptor *bd; in cppi_rx_scan() local
1017 bd = last ? last->next : rx->head; in cppi_rx_scan()
1018 if (!bd) in cppi_rx_scan()
1023 (safe2ack || completed) && bd && i < NUM_RXCHAN_BD; in cppi_rx_scan()
1024 i++, bd = bd->next) { in cppi_rx_scan()
1029 if (!completed && (bd->hw_options & CPPI_OWN_SET)) in cppi_rx_scan()
1034 (unsigned long long)bd->dma, bd->hw_next, bd->hw_bufp, in cppi_rx_scan()
1035 bd->hw_off_len, bd->hw_options, in cppi_rx_scan()
1039 if ((bd->hw_options & CPPI_SOP_SET) && !completed) in cppi_rx_scan()
1040 len = bd->hw_off_len & CPPI_RECV_PKTLEN_MASK; in cppi_rx_scan()
1044 if (bd->hw_options & CPPI_EOQ_MASK) in cppi_rx_scan()
1047 if (!completed && len < bd->buflen) { in cppi_rx_scan()
1055 len, bd->buflen, in cppi_rx_scan()
1067 if (bd->dma == safe2ack) { in cppi_rx_scan()
1071 if (bd->dma == safe2ack) in cppi_rx_scan()
1078 last = bd; in cppi_rx_scan()
1081 if (bd->hw_next == 0) in cppi_rx_scan()
1119 rx->head = bd; in cppi_rx_scan()
1126 && bd in cppi_rx_scan()
1174 struct cppi_descriptor *bd; in cppi_interrupt() local
1188 bd = tx_ch->head; in cppi_interrupt()
1194 if (NULL == bd) { in cppi_interrupt()
1201 for (i = 0; !completed && bd && i < NUM_TXCHAN_BD; in cppi_interrupt()
1202 i++, bd = bd->next) { in cppi_interrupt()
1207 if (bd->hw_options & CPPI_OWN_SET) in cppi_interrupt()
1211 bd, bd->hw_next, bd->hw_bufp, in cppi_interrupt()
1212 bd->hw_off_len, bd->hw_options); in cppi_interrupt()
1214 len = bd->hw_off_len & CPPI_BUFFER_LEN_MASK; in cppi_interrupt()
1217 tx_ch->last_processed = bd; in cppi_interrupt()
1228 musb_writel(&tx_ram->tx_complete, 0, bd->dma); in cppi_interrupt()
1231 if (bd->hw_next == 0) in cppi_interrupt()
1256 tx_ch->head = bd; in cppi_interrupt()