• Home
  • Raw
  • Download

Lines Matching refs:bd

58 	struct cppi_descriptor	*bd = c->freelist;  in cppi_bd_alloc()  local
60 if (bd) in cppi_bd_alloc()
61 c->freelist = bd->next; in cppi_bd_alloc()
62 return bd; in cppi_bd_alloc()
66 cppi_bd_free(struct cppi_channel *c, struct cppi_descriptor *bd) in cppi_bd_free() argument
68 if (!bd) in cppi_bd_free()
70 bd->next = c->freelist; in cppi_bd_free()
71 c->freelist = bd; in cppi_bd_free()
120 struct cppi_descriptor *bd; in cppi_pool_init() local
123 bd = dma_pool_alloc(cppi->pool, GFP_KERNEL, &dma); in cppi_pool_init()
124 bd->dma = dma; in cppi_pool_init()
125 cppi_bd_free(c, bd); in cppi_pool_init()
134 struct cppi_descriptor *bd; in cppi_pool_free() local
141 bd = c->last_processed; in cppi_pool_free()
143 if (bd) in cppi_pool_free()
144 dma_pool_free(cppi->pool, bd, bd->dma); in cppi_pool_free()
145 bd = cppi_bd_alloc(c); in cppi_pool_free()
146 } while (bd); in cppi_pool_free()
428 static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) in cppi_dump_rxbd() argument
432 tag, bd->dma, in cppi_dump_rxbd()
433 bd->hw_next, bd->hw_bufp, bd->hw_off_len, in cppi_dump_rxbd()
434 bd->hw_options); in cppi_dump_rxbd()
441 struct cppi_descriptor *bd; in cppi_dump_rxq() local
448 for (bd = rx->head; bd; bd = bd->next) in cppi_dump_rxq()
449 cppi_dump_rxbd("active", bd); in cppi_dump_rxq()
570 struct cppi_descriptor *bd; in cppi_next_tx_segment() local
611 bd = tx->freelist; in cppi_next_tx_segment()
612 tx->head = bd; in cppi_next_tx_segment()
624 if (++i < n_bds && bd->next) in cppi_next_tx_segment()
625 bd->hw_next = bd->next->dma; in cppi_next_tx_segment()
627 bd->hw_next = 0; in cppi_next_tx_segment()
629 bd->hw_bufp = tx->buf_dma + tx->offset; in cppi_next_tx_segment()
636 bd->hw_off_len = maxpacket; in cppi_next_tx_segment()
637 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
645 bd->hw_off_len = partial_len; in cppi_next_tx_segment()
647 bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET in cppi_next_tx_segment()
650 bd->hw_options |= CPPI_ZERO_SET; in cppi_next_tx_segment()
654 bd, bd->hw_next, bd->hw_bufp, in cppi_next_tx_segment()
655 bd->hw_off_len, bd->hw_options); in cppi_next_tx_segment()
658 tx->tail = bd; in cppi_next_tx_segment()
659 bd = bd->next; in cppi_next_tx_segment()
769 struct cppi_descriptor *bd, *tail; in cppi_next_rx_segment() local
833 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
834 rx->head = bd; in cppi_next_rx_segment()
837 for (i = 0, tail = NULL; bd && i < n_bds; i++, tail = bd) { in cppi_next_rx_segment()
841 bd = cppi_bd_alloc(rx); in cppi_next_rx_segment()
842 if (!bd) in cppi_next_rx_segment()
844 tail->next = bd; in cppi_next_rx_segment()
845 tail->hw_next = bd->dma; in cppi_next_rx_segment()
847 bd->hw_next = 0; in cppi_next_rx_segment()
855 bd->hw_bufp = addr; in cppi_next_rx_segment()
859 bd->hw_off_len = (0 /*offset*/ << 16) + bd_len; in cppi_next_rx_segment()
860 bd->buflen = bd_len; in cppi_next_rx_segment()
862 bd->hw_options = CPPI_OWN_SET | (i == 0 ? length : 0); in cppi_next_rx_segment()
876 bd = rx->head; in cppi_next_rx_segment()
884 bd->hw_options |= CPPI_SOP_SET; in cppi_next_rx_segment()
899 tail->next = bd; in cppi_next_rx_segment()
900 tail->hw_next = bd->dma; in cppi_next_rx_segment()
911 musb_writel(&rx_ram->rx_head, 0, bd->dma); in cppi_next_rx_segment()
1013 struct cppi_descriptor *bd; in cppi_rx_scan() local
1023 bd = last ? last->next : rx->head; in cppi_rx_scan()
1024 if (!bd) in cppi_rx_scan()
1029 (safe2ack || completed) && bd && i < NUM_RXCHAN_BD; in cppi_rx_scan()
1030 i++, bd = bd->next) { in cppi_rx_scan()
1035 if (!completed && (bd->hw_options & CPPI_OWN_SET)) in cppi_rx_scan()
1040 bd->dma, bd->hw_next, bd->hw_bufp, in cppi_rx_scan()
1041 bd->hw_off_len, bd->hw_options, in cppi_rx_scan()
1045 if ((bd->hw_options & CPPI_SOP_SET) && !completed) in cppi_rx_scan()
1046 len = bd->hw_off_len & CPPI_RECV_PKTLEN_MASK; in cppi_rx_scan()
1050 if (bd->hw_options & CPPI_EOQ_MASK) in cppi_rx_scan()
1053 if (!completed && len < bd->buflen) { in cppi_rx_scan()
1061 len, bd->buflen, in cppi_rx_scan()
1073 if (bd->dma == safe2ack) { in cppi_rx_scan()
1077 if (bd->dma == safe2ack) in cppi_rx_scan()
1084 last = bd; in cppi_rx_scan()
1087 if (bd->hw_next == 0) in cppi_rx_scan()
1124 rx->head = bd; in cppi_rx_scan()
1131 && bd in cppi_rx_scan()
1163 struct cppi_descriptor *bd; in cppi_completion() local
1177 bd = tx_ch->head; in cppi_completion()
1179 if (NULL == bd) { in cppi_completion()
1185 for (i = 0; !completed && bd && i < NUM_TXCHAN_BD; in cppi_completion()
1186 i++, bd = bd->next) { in cppi_completion()
1191 if (bd->hw_options & CPPI_OWN_SET) in cppi_completion()
1195 bd, bd->hw_next, bd->hw_bufp, in cppi_completion()
1196 bd->hw_off_len, bd->hw_options); in cppi_completion()
1198 len = bd->hw_off_len & CPPI_BUFFER_LEN_MASK; in cppi_completion()
1201 tx_ch->last_processed = bd; in cppi_completion()
1212 musb_writel(&tx_ram->tx_complete, 0, bd->dma); in cppi_completion()
1215 if (bd->hw_next == 0) in cppi_completion()
1260 tx_ch->head = bd; in cppi_completion()