Lines Matching refs:bd

63 	struct cppi_descriptor	*bd = c->freelist;  in cppi_bd_alloc()  local
65 if (bd) in cppi_bd_alloc()
66 c->freelist = bd->next; in cppi_bd_alloc()
67 return bd; in cppi_bd_alloc()
71 cppi_bd_free(struct cppi_channel *c, struct cppi_descriptor *bd) in cppi_bd_free() argument
73 if (!bd) in cppi_bd_free()
75 bd->next = c->freelist; in cppi_bd_free()
76 c->freelist = bd; in cppi_bd_free()
125 struct cppi_descriptor *bd; in cppi_pool_init() local
128 bd = dma_pool_alloc(cppi->pool, GFP_KERNEL, &dma); in cppi_pool_init()
129 bd->dma = dma; in cppi_pool_init()
130 cppi_bd_free(c, bd); in cppi_pool_init()
139 struct cppi_descriptor *bd; in cppi_pool_free() local
146 bd = c->last_processed; in cppi_pool_free()
148 if (bd) in cppi_pool_free()
149 dma_pool_free(cppi->pool, bd, bd->dma); in cppi_pool_free()
150 bd = cppi_bd_alloc(c); in cppi_pool_free()
151 } 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
609 bd = tx->freelist; in cppi_next_tx_segment()
610 tx->head = bd; in cppi_next_tx_segment()
622 if (++i < n_bds && bd->next) in cppi_next_tx_segment()
623 bd->hw_next = bd->next->dma; in cppi_next_tx_segment()
625 bd->hw_next = 0; in cppi_next_tx_segment()
627 bd->hw_bufp = tx->buf_dma + tx->offset; in cppi_next_tx_segment()
634 bd->hw_off_len = maxpacket; in cppi_next_tx_segment()
635 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
643 bd->hw_off_len = partial_len; in cppi_next_tx_segment()
645 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
648 bd->hw_options |= CPPI_ZERO_SET; in cppi_next_tx_segment()
652 bd, bd->hw_next, bd->hw_bufp, in cppi_next_tx_segment()
653 bd->hw_off_len, bd->hw_options); in cppi_next_tx_segment()
656 tx->tail = bd; in cppi_next_tx_segment()
657 bd = bd->next; in cppi_next_tx_segment()
767 struct cppi_descriptor *bd, *tail; in cppi_next_rx_segment() local
831 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
832 rx->head = bd; in cppi_next_rx_segment()
835 for (i = 0, tail = NULL; bd && i < n_bds; i++, tail = bd) { in cppi_next_rx_segment()
839 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
840 if (!bd) in cppi_next_rx_segment()
842 tail->next = bd; in cppi_next_rx_segment()
843 tail->hw_next = bd->dma; in cppi_next_rx_segment()
845 bd->hw_next = 0; in cppi_next_rx_segment()
853 bd->hw_bufp = addr; in cppi_next_rx_segment()
857 bd->hw_off_len = (0 /*offset*/ << 16) + bd_len; in cppi_next_rx_segment()
858 bd->buflen = bd_len; in cppi_next_rx_segment()
860 bd->hw_options = CPPI_OWN_SET | (i == 0 ? length : 0); in cppi_next_rx_segment()
874 bd = rx->head; in cppi_next_rx_segment()
882 bd->hw_options |= CPPI_SOP_SET; in cppi_next_rx_segment()
891 tail->next = bd; in cppi_next_rx_segment()
892 tail->hw_next = bd->dma; in cppi_next_rx_segment()
903 musb_writel(&rx_ram->rx_head, 0, bd->dma); in cppi_next_rx_segment()
1005 struct cppi_descriptor *bd; in cppi_rx_scan() local
1016 bd = last ? last->next : rx->head; in cppi_rx_scan()
1017 if (!bd) in cppi_rx_scan()
1022 (safe2ack || completed) && bd && i < NUM_RXCHAN_BD; in cppi_rx_scan()
1023 i++, bd = bd->next) { in cppi_rx_scan()
1028 if (!completed && (bd->hw_options & CPPI_OWN_SET)) in cppi_rx_scan()
1033 (unsigned long long)bd->dma, bd->hw_next, bd->hw_bufp, in cppi_rx_scan()
1034 bd->hw_off_len, bd->hw_options, in cppi_rx_scan()
1038 if ((bd->hw_options & CPPI_SOP_SET) && !completed) in cppi_rx_scan()
1039 len = bd->hw_off_len & CPPI_RECV_PKTLEN_MASK; in cppi_rx_scan()
1043 if (bd->hw_options & CPPI_EOQ_MASK) in cppi_rx_scan()
1046 if (!completed && len < bd->buflen) { in cppi_rx_scan()
1054 len, bd->buflen, in cppi_rx_scan()
1066 if (bd->dma == safe2ack) { in cppi_rx_scan()
1070 if (bd->dma == safe2ack) in cppi_rx_scan()
1077 last = bd; in cppi_rx_scan()
1080 if (bd->hw_next == 0) in cppi_rx_scan()
1118 rx->head = bd; in cppi_rx_scan()
1125 && bd in cppi_rx_scan()
1173 struct cppi_descriptor *bd; in cppi_interrupt() local
1187 bd = tx_ch->head; in cppi_interrupt()
1193 if (NULL == bd) { in cppi_interrupt()
1200 for (i = 0; !completed && bd && i < NUM_TXCHAN_BD; in cppi_interrupt()
1201 i++, bd = bd->next) { in cppi_interrupt()
1206 if (bd->hw_options & CPPI_OWN_SET) in cppi_interrupt()
1210 bd, bd->hw_next, bd->hw_bufp, in cppi_interrupt()
1211 bd->hw_off_len, bd->hw_options); in cppi_interrupt()
1213 len = bd->hw_off_len & CPPI_BUFFER_LEN_MASK; in cppi_interrupt()
1216 tx_ch->last_processed = bd; in cppi_interrupt()
1227 musb_writel(&tx_ram->tx_complete, 0, bd->dma); in cppi_interrupt()
1230 if (bd->hw_next == 0) in cppi_interrupt()
1255 tx_ch->head = bd; in cppi_interrupt()