Lines Matching refs:ep

86 void fhci_push_dummy_bd(struct endpoint *ep)  in fhci_push_dummy_bd()  argument
88 if (ep->already_pushed_dummy_bd == false) { in fhci_push_dummy_bd()
89 u16 td_status = in_be16(&ep->empty_td->status); in fhci_push_dummy_bd()
91 out_be32(&ep->empty_td->buf_ptr, DUMMY_BD_BUFFER); in fhci_push_dummy_bd()
93 ep->empty_td = next_bd(ep->td_base, ep->empty_td, td_status); in fhci_push_dummy_bd()
94 ep->already_pushed_dummy_bd = true; in fhci_push_dummy_bd()
101 struct endpoint *ep; in fhci_ep0_free() local
104 ep = usb->ep0; in fhci_ep0_free()
105 if (ep) { in fhci_ep0_free()
106 if (ep->td_base) in fhci_ep0_free()
107 cpm_muram_free(cpm_muram_offset(ep->td_base)); in fhci_ep0_free()
109 if (kfifo_initialized(&ep->conf_frame_Q)) { in fhci_ep0_free()
110 size = cq_howmany(&ep->conf_frame_Q); in fhci_ep0_free()
112 struct packet *pkt = cq_get(&ep->conf_frame_Q); in fhci_ep0_free()
116 cq_delete(&ep->conf_frame_Q); in fhci_ep0_free()
119 if (kfifo_initialized(&ep->empty_frame_Q)) { in fhci_ep0_free()
120 size = cq_howmany(&ep->empty_frame_Q); in fhci_ep0_free()
122 struct packet *pkt = cq_get(&ep->empty_frame_Q); in fhci_ep0_free()
126 cq_delete(&ep->empty_frame_Q); in fhci_ep0_free()
129 if (kfifo_initialized(&ep->dummy_packets_Q)) { in fhci_ep0_free()
130 size = cq_howmany(&ep->dummy_packets_Q); in fhci_ep0_free()
132 u8 *buff = cq_get(&ep->dummy_packets_Q); in fhci_ep0_free()
136 cq_delete(&ep->dummy_packets_Q); in fhci_ep0_free()
139 kfree(ep); in fhci_ep0_free()
155 struct endpoint *ep; in fhci_create_ep() local
168 ep = kzalloc(sizeof(*ep), GFP_KERNEL); in fhci_create_ep()
169 if (!ep) in fhci_create_ep()
176 ep->td_base = cpm_muram_addr(ep_offset); in fhci_create_ep()
179 if (cq_new(&ep->conf_frame_Q, ring_len + 2) || in fhci_create_ep()
180 cq_new(&ep->empty_frame_Q, ring_len + 2) || in fhci_create_ep()
181 cq_new(&ep->dummy_packets_Q, ring_len + 2)) { in fhci_create_ep()
202 cq_put(&ep->empty_frame_Q, pkt); in fhci_create_ep()
203 cq_put(&ep->dummy_packets_Q, buff); in fhci_create_ep()
207 ep->ep_pram_ptr = (void __iomem *)ep->td_base + sizeof(*td) * ring_len; in fhci_create_ep()
209 ep->conf_td = ep->td_base; in fhci_create_ep()
210 ep->empty_td = ep->td_base; in fhci_create_ep()
212 ep->already_pushed_dummy_bd = false; in fhci_create_ep()
215 td = ep->td_base; in fhci_create_ep()
228 usb->ep0 = ep; in fhci_create_ep()
233 kfree(ep); in fhci_create_ep()
246 void fhci_init_ep_registers(struct fhci_usb *usb, struct endpoint *ep, in fhci_init_ep_registers() argument
255 cpm_muram_offset(ep->ep_pram_ptr)); in fhci_init_ep_registers()
262 out_8(&ep->ep_pram_ptr->rx_func_code, rt); in fhci_init_ep_registers()
263 out_8(&ep->ep_pram_ptr->tx_func_code, rt); in fhci_init_ep_registers()
264 out_be16(&ep->ep_pram_ptr->rx_buff_len, 1028); in fhci_init_ep_registers()
265 out_be16(&ep->ep_pram_ptr->rx_base, 0); in fhci_init_ep_registers()
266 out_be16(&ep->ep_pram_ptr->tx_base, cpm_muram_offset(ep->td_base)); in fhci_init_ep_registers()
267 out_be16(&ep->ep_pram_ptr->rx_bd_ptr, 0); in fhci_init_ep_registers()
268 out_be16(&ep->ep_pram_ptr->tx_bd_ptr, cpm_muram_offset(ep->td_base)); in fhci_init_ep_registers()
269 out_be32(&ep->ep_pram_ptr->tx_state, 0); in fhci_init_ep_registers()
283 struct endpoint *ep = usb->ep0; in fhci_td_transaction_confirm() local
297 td = ep->conf_td; in fhci_td_transaction_confirm()
316 ep->conf_td = next_bd(ep->td_base, ep->conf_td, td_status); in fhci_td_transaction_confirm()
322 pkt = cq_get(&ep->conf_frame_Q); in fhci_td_transaction_confirm()
389 struct endpoint *ep = usb->ep0; in fhci_host_transaction() local
396 td = ep->empty_td; in fhci_host_transaction()
406 ep->empty_td = next_bd(ep->td_base, ep->empty_td, td_status); in fhci_host_transaction()
463 cq_put(&ep->conf_frame_Q, pkt); in fhci_host_transaction()
465 if (cq_howmany(&ep->conf_frame_Q) == 1) in fhci_host_transaction()
478 struct endpoint *ep = usb->ep0; in fhci_flush_bds() local
480 td = ep->td_base; in fhci_flush_bds()
501 td = ep->td_base; in fhci_flush_bds()
514 out_be16(&ep->ep_pram_ptr->tx_bd_ptr, in fhci_flush_bds()
515 in_be16(&ep->ep_pram_ptr->tx_base)); in fhci_flush_bds()
516 out_be32(&ep->ep_pram_ptr->tx_state, 0); in fhci_flush_bds()
517 out_be16(&ep->ep_pram_ptr->tx_cnt, 0); in fhci_flush_bds()
518 ep->empty_td = ep->td_base; in fhci_flush_bds()
519 ep->conf_td = ep->td_base; in fhci_flush_bds()
535 struct endpoint *ep = usb->ep0; in fhci_flush_actual_frame() local
541 tb_ptr = in_be16(&ep->ep_pram_ptr->tx_bd_ptr); in fhci_flush_actual_frame()
551 ep->already_pushed_dummy_bd = false; in fhci_flush_actual_frame()
556 td = next_bd(ep->td_base, td, td_status); in fhci_flush_actual_frame()
564 out_be16(&ep->ep_pram_ptr->tx_bd_ptr, in fhci_flush_actual_frame()
565 in_be16(&ep->ep_pram_ptr->tx_base)); in fhci_flush_actual_frame()
566 out_be32(&ep->ep_pram_ptr->tx_state, 0); in fhci_flush_actual_frame()
567 out_be16(&ep->ep_pram_ptr->tx_cnt, 0); in fhci_flush_actual_frame()
568 ep->empty_td = ep->td_base; in fhci_flush_actual_frame()
569 ep->conf_td = ep->td_base; in fhci_flush_actual_frame()
599 struct endpoint *ep = usb->ep0; in fhci_host_transmit_actual_frame() local
601 tb_ptr = in_be16(&ep->ep_pram_ptr->tx_bd_ptr); in fhci_host_transmit_actual_frame()
607 ep->already_pushed_dummy_bd = false; in fhci_host_transmit_actual_frame()
610 td = next_bd(ep->td_base, td, td_status); in fhci_host_transmit_actual_frame()
612 out_be16(&ep->ep_pram_ptr->tx_bd_ptr, tb_ptr); in fhci_host_transmit_actual_frame()
618 if (in_be32(&ep->conf_td->buf_ptr) == DUMMY_BD_BUFFER) { in fhci_host_transmit_actual_frame()
620 ep->conf_td = next_bd(ep->td_base, ep->conf_td, in fhci_host_transmit_actual_frame()