Lines Matching +full:toggle +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0+
7 * Jerry Huang <Chang-Ming.Huang@freescale.com>
30 pkt->data = NULL; in recycle_frame()
31 pkt->len = 0; in recycle_frame()
32 pkt->status = USB_TD_OK; in recycle_frame()
33 pkt->info = 0; in recycle_frame()
34 pkt->priv_data = NULL; in recycle_frame()
36 cq_put(&usb->ep0->empty_frame_Q, pkt); in recycle_frame()
48 td = fhci_remove_td_from_frame(usb->actual_frame); in fhci_transaction_confirm()
49 td_pkt = td->pkt; in fhci_transaction_confirm()
50 trans_len = pkt->len; in fhci_transaction_confirm()
51 td->status = pkt->status; in fhci_transaction_confirm()
52 if (td->type == FHCI_TA_IN && td_pkt->info & PKT_DUMMY_PACKET) { in fhci_transaction_confirm()
53 if ((td->data + td->actual_len) && trans_len) in fhci_transaction_confirm()
54 memcpy(td->data + td->actual_len, pkt->data, in fhci_transaction_confirm()
56 cq_put(&usb->ep0->dummy_packets_Q, pkt->data); in fhci_transaction_confirm()
61 ed = td->ed; in fhci_transaction_confirm()
62 if (ed->mode == FHCI_TF_ISO) { in fhci_transaction_confirm()
63 if (ed->td_list.next->next != &ed->td_list) { in fhci_transaction_confirm()
65 list_entry(ed->td_list.next->next, struct td, in fhci_transaction_confirm()
68 td_next->start_frame = usb->actual_frame->frame_num; in fhci_transaction_confirm()
70 td->actual_len = trans_len; in fhci_transaction_confirm()
72 } else if ((td->status & USB_TD_ERROR) && in fhci_transaction_confirm()
73 !(td->status & USB_TD_TX_ER_NAK)) { in fhci_transaction_confirm()
79 if ((td->status & USB_TD_RX_DATA_UNDERUN) || in fhci_transaction_confirm()
80 (td->status & USB_TD_TX_ER_STALL) || in fhci_transaction_confirm()
81 (td->status & USB_TD_RX_ER_PID) || in fhci_transaction_confirm()
82 (++td->error_cnt >= 3)) { in fhci_transaction_confirm()
83 ed->state = FHCI_ED_HALTED; in fhci_transaction_confirm()
86 if (td->status & USB_TD_RX_DATA_UNDERUN) { in fhci_transaction_confirm()
87 fhci_dbg(usb->fhci, "td err fu\n"); in fhci_transaction_confirm()
88 td->toggle = !td->toggle; in fhci_transaction_confirm()
89 td->actual_len += trans_len; in fhci_transaction_confirm()
91 fhci_dbg(usb->fhci, "td err f!u\n"); in fhci_transaction_confirm()
94 fhci_dbg(usb->fhci, "td err !f\n"); in fhci_transaction_confirm()
95 /* it is not a fatal error -retry this transaction */ in fhci_transaction_confirm()
96 td->nak_cnt = 0; in fhci_transaction_confirm()
97 td->error_cnt++; in fhci_transaction_confirm()
98 td->status = USB_TD_OK; in fhci_transaction_confirm()
100 } else if (td->status & USB_TD_TX_ER_NAK) { in fhci_transaction_confirm()
102 fhci_vdbg(usb->fhci, "td nack\n"); in fhci_transaction_confirm()
103 td->nak_cnt++; in fhci_transaction_confirm()
104 td->error_cnt = 0; in fhci_transaction_confirm()
105 td->status = USB_TD_OK; in fhci_transaction_confirm()
108 td->error_cnt = 0; in fhci_transaction_confirm()
109 td->nak_cnt = 0; in fhci_transaction_confirm()
110 td->toggle = !td->toggle; in fhci_transaction_confirm()
111 td->actual_len += trans_len; in fhci_transaction_confirm()
113 if (td->len == td->actual_len) in fhci_transaction_confirm()
128 u8 mode; in fhci_flush_all_transmissions() local
131 mode = in_8(&usb->fhci->regs->usb_usmod); in fhci_flush_all_transmissions()
132 clrbits8(&usb->fhci->regs->usb_usmod, USB_MODE_EN); in fhci_flush_all_transmissions()
136 while ((td = fhci_peek_td_from_frame(usb->actual_frame)) != NULL) { in fhci_flush_all_transmissions()
137 struct packet *pkt = td->pkt; in fhci_flush_all_transmissions()
139 pkt->status = USB_TD_TX_ER_TIMEOUT; in fhci_flush_all_transmissions()
143 usb->actual_frame->frame_status = FRAME_END_TRANSMISSION; in fhci_flush_all_transmissions()
146 out_be16(&usb->fhci->regs->usb_usber, 0xffff); in fhci_flush_all_transmissions()
148 out_8(&usb->fhci->regs->usb_usmod, mode | USB_MODE_EN); in fhci_flush_all_transmissions()
161 /* calcalate data address,len and toggle and then add the transaction */ in add_packet()
162 if (td->toggle == USB_TD_TOGGLE_CARRY) in add_packet()
163 td->toggle = ed->toggle_carry; in add_packet()
165 switch (ed->mode) { in add_packet()
167 len = td->len; in add_packet()
168 if (td->type != FHCI_TA_IN) in add_packet()
169 data = td->data; in add_packet()
173 len = min(td->len - td->actual_len, ed->max_pkt_size); in add_packet()
174 if (!((td->type == FHCI_TA_IN) && in add_packet()
175 ((len + td->actual_len) == td->len))) in add_packet()
176 data = td->data + td->actual_len; in add_packet()
179 len = min(td->len, ed->max_pkt_size); in add_packet()
180 if (!((td->type == FHCI_TA_IN) && in add_packet()
181 ((td->len + CRC_SIZE) >= ed->max_pkt_size))) in add_packet()
182 data = td->data; in add_packet()
188 if (usb->port_status == FHCI_PORT_FULL) in add_packet()
194 if (usb->actual_frame->total_bytes + len + PROTOCOL_OVERHEAD >= in add_packet()
195 usb->max_bytes_per_frame) { in add_packet()
196 fhci_vdbg(usb->fhci, "not enough space in this frame: " in add_packet()
197 "%d %d %d\n", usb->actual_frame->total_bytes, len, in add_packet()
198 usb->max_bytes_per_frame); in add_packet()
199 return -1; in add_packet()
203 if (usb->actual_frame->frame_status != FRAME_IS_PREPARED && in add_packet()
204 (usb->actual_frame->frame_status & FRAME_END_TRANSMISSION || in add_packet()
205 (fw_transaction_time + usb->sw_transaction_time >= in add_packet()
206 1000 - fhci_get_sof_timer_count(usb)))) { in add_packet()
207 fhci_dbg(usb->fhci, "not enough time in this frame\n"); in add_packet()
208 return -1; in add_packet()
212 pkt = cq_get(&usb->ep0->empty_frame_Q); in add_packet()
214 fhci_dbg(usb->fhci, "there is no empty frame\n"); in add_packet()
215 return -1; in add_packet()
217 td->pkt = pkt; in add_packet()
219 pkt->info = 0; in add_packet()
221 data = cq_get(&usb->ep0->dummy_packets_Q); in add_packet()
223 pkt->info = PKT_DUMMY_PACKET; in add_packet()
225 pkt->data = data; in add_packet()
226 pkt->len = len; in add_packet()
227 pkt->status = USB_TD_OK; in add_packet()
229 td->status = USB_TD_INPROGRESS; in add_packet()
231 usb->actual_frame->total_bytes += (len + PROTOCOL_OVERHEAD); in add_packet()
232 fhci_add_td_to_frame(usb->actual_frame, td); in add_packet()
234 if (usb->port_status != FHCI_PORT_FULL && in add_packet()
235 usb->port_status != FHCI_PORT_LOW) { in add_packet()
236 pkt->status = USB_TD_TX_ER_TIMEOUT; in add_packet()
237 pkt->len = 0; in add_packet()
239 } else if (fhci_host_transaction(usb, pkt, td->type, ed->dev_addr, in add_packet()
240 ed->ep_addr, ed->mode, ed->speed, td->toggle)) { in add_packet()
242 list_del_init(&td->frame_lh); in add_packet()
243 td->status = USB_TD_OK; in add_packet()
244 if (pkt->info & PKT_DUMMY_PACKET) in add_packet()
245 cq_put(&usb->ep0->dummy_packets_Q, pkt->data); in add_packet()
247 usb->actual_frame->total_bytes -= (len + PROTOCOL_OVERHEAD); in add_packet()
248 fhci_err(usb->fhci, "host transaction failed\n"); in add_packet()
249 return -1; in add_packet()
257 struct list_head *node = list->next; in move_head_to_tail()
282 u32 save_transaction_time = usb->sw_transaction_time; in scan_ed_list()
285 td = ed->td_head; in scan_ed_list()
287 if (!td || td->status == USB_TD_INPROGRESS) in scan_ed_list()
290 if (ed->state != FHCI_ED_OPER) { in scan_ed_list()
291 if (ed->state == FHCI_ED_URB_DEL) { in scan_ed_list()
292 td->status = USB_TD_OK; in scan_ed_list()
294 ed->state = FHCI_ED_SKIP; in scan_ed_list()
304 (((usb->actual_frame->frame_num - in scan_ed_list()
305 td->start_frame) & 0x7ff) < td->interval)) in scan_ed_list()
312 td->start_frame = usb->actual_frame->frame_num; in scan_ed_list()
313 usb->sw_transaction_time += save_transaction_time; in scan_ed_list()
315 if (usb->actual_frame->total_bytes >= in scan_ed_list()
316 usb->max_bytes_per_frame) { in scan_ed_list()
317 usb->actual_frame->frame_status = in scan_ed_list()
319 fhci_push_dummy_bd(usb->ep0); in scan_ed_list()
324 if (usb->actual_frame->total_bytes >= frame_part[list_type]) in scan_ed_list()
330 usb->sw_transaction_time = save_transaction_time; in scan_ed_list()
337 struct fhci_hcd *fhci = usb->fhci; in rotate_frames()
339 if (!list_empty(&usb->actual_frame->tds_list)) { in rotate_frames()
340 if ((((in_be16(&fhci->pram->frame_num) & 0x07ff) - in rotate_frames()
341 usb->actual_frame->frame_num) & 0x7ff) > 5) in rotate_frames()
344 return -EINVAL; in rotate_frames()
347 usb->actual_frame->frame_status = FRAME_IS_PREPARED; in rotate_frames()
348 usb->actual_frame->frame_num = in_be16(&fhci->pram->frame_num) & 0x7ff; in rotate_frames()
349 usb->actual_frame->total_bytes = 0; in rotate_frames()
362 if (usb->actual_frame->frame_status & FRAME_END_TRANSMISSION) in fhci_schedule_transactions()
366 if (usb->actual_frame->frame_status & FRAME_END_TRANSMISSION) in fhci_schedule_transactions()
369 if (usb->actual_frame->total_bytes == 0) { in fhci_schedule_transactions()
374 scan_ed_list(usb, &usb->hc_list->iso_list, FHCI_TF_ISO); in fhci_schedule_transactions()
380 scan_ed_list(usb, &usb->hc_list->intr_list, FHCI_TF_INTR); in fhci_schedule_transactions()
386 left = scan_ed_list(usb, &usb->hc_list->ctrl_list, in fhci_schedule_transactions()
395 scan_ed_list(usb, &usb->hc_list->bulk_list, FHCI_TF_BULK); in fhci_schedule_transactions()
401 struct fhci_usb *usb = fhci->usb_lld; in sof_interrupt()
403 if ((usb->port_status == FHCI_PORT_DISABLED) && in sof_interrupt()
404 (usb->vroot_hub->port.wPortStatus & USB_PORT_STAT_CONNECTION) && in sof_interrupt()
405 !(usb->vroot_hub->port.wPortChange & USB_PORT_STAT_C_CONNECTION)) { in sof_interrupt()
406 if (usb->vroot_hub->port.wPortStatus & USB_PORT_STAT_LOW_SPEED) in sof_interrupt()
407 usb->port_status = FHCI_PORT_LOW; in sof_interrupt()
409 usb->port_status = FHCI_PORT_FULL; in sof_interrupt()
411 usb->saved_msk &= ~USB_E_IDLE_MASK; in sof_interrupt()
412 out_be16(&usb->fhci->regs->usb_usbmr, usb->saved_msk); in sof_interrupt()
415 gtm_set_exact_timer16(fhci->timer, usb->max_frame_usage, false); in sof_interrupt()
418 usb->actual_frame->frame_status = FRAME_IS_TRANSMITTED; in sof_interrupt()
426 struct fhci_usb *usb = fhci->usb_lld; in fhci_device_disconnected_interrupt()
428 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_device_disconnected_interrupt()
431 clrbits8(&usb->fhci->regs->usb_usmod, USB_MODE_LSS); in fhci_device_disconnected_interrupt()
432 usb->port_status = FHCI_PORT_DISABLED; in fhci_device_disconnected_interrupt()
437 usb->saved_msk |= USB_E_IDLE_MASK; in fhci_device_disconnected_interrupt()
438 out_be16(&usb->fhci->regs->usb_usbmr, usb->saved_msk); in fhci_device_disconnected_interrupt()
440 usb->vroot_hub->port.wPortStatus &= ~USB_PORT_STAT_CONNECTION; in fhci_device_disconnected_interrupt()
441 usb->vroot_hub->port.wPortChange |= USB_PORT_STAT_C_CONNECTION; in fhci_device_disconnected_interrupt()
442 usb->max_bytes_per_frame = 0; in fhci_device_disconnected_interrupt()
445 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_device_disconnected_interrupt()
452 struct fhci_usb *usb = fhci->usb_lld; in fhci_device_connected_interrupt()
456 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_device_connected_interrupt()
461 /* low-speed device was connected to the USB port */ in fhci_device_connected_interrupt()
463 ret = qe_usb_clock_set(fhci->lowspeed_clk, USB_CLOCK >> 3); in fhci_device_connected_interrupt()
465 fhci_warn(fhci, "Low-Speed device is not supported, " in fhci_device_connected_interrupt()
470 usb->port_status = FHCI_PORT_LOW; in fhci_device_connected_interrupt()
471 setbits8(&usb->fhci->regs->usb_usmod, USB_MODE_LSS); in fhci_device_connected_interrupt()
472 usb->vroot_hub->port.wPortStatus |= in fhci_device_connected_interrupt()
475 usb->vroot_hub->port.wPortChange |= in fhci_device_connected_interrupt()
477 usb->max_bytes_per_frame = in fhci_device_connected_interrupt()
478 (MAX_BYTES_PER_FRAME >> 3) - 7; in fhci_device_connected_interrupt()
481 ret = qe_usb_clock_set(fhci->fullspeed_clk, USB_CLOCK); in fhci_device_connected_interrupt()
483 fhci_warn(fhci, "Full-Speed device is not supported, " in fhci_device_connected_interrupt()
488 usb->port_status = FHCI_PORT_FULL; in fhci_device_connected_interrupt()
489 clrbits8(&usb->fhci->regs->usb_usmod, USB_MODE_LSS); in fhci_device_connected_interrupt()
490 usb->vroot_hub->port.wPortStatus &= in fhci_device_connected_interrupt()
492 usb->vroot_hub->port.wPortStatus |= in fhci_device_connected_interrupt()
494 usb->vroot_hub->port.wPortChange |= in fhci_device_connected_interrupt()
496 usb->max_bytes_per_frame = (MAX_BYTES_PER_FRAME - 15); in fhci_device_connected_interrupt()
501 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_device_connected_interrupt()
508 struct fhci_usb *usb = fhci->usb_lld; in fhci_frame_limit_timer_irq()
510 spin_lock(&fhci->lock); in fhci_frame_limit_timer_irq()
512 gtm_set_exact_timer16(fhci->timer, 1000, false); in fhci_frame_limit_timer_irq()
514 if (usb->actual_frame->frame_status == FRAME_IS_TRANSMITTED) { in fhci_frame_limit_timer_irq()
515 usb->actual_frame->frame_status = FRAME_TIMER_END_TRANSMISSION; in fhci_frame_limit_timer_irq()
516 fhci_push_dummy_bd(usb->ep0); in fhci_frame_limit_timer_irq()
521 spin_unlock(&fhci->lock); in fhci_frame_limit_timer_irq()
529 fhci_dbg(usb->fhci, "-> %s\n", __func__); in abort_transmission()
533 out_8(&usb->fhci->regs->usb_uscom, USB_CMD_FLUSH_FIFO | EP_ZERO); in abort_transmission()
539 fhci_dbg(usb->fhci, "<- %s\n", __func__); in abort_transmission()
549 spin_lock_irqsave(&fhci->lock, flags); in fhci_irq()
551 usb = fhci->usb_lld; in fhci_irq()
553 usb_er |= in_be16(&usb->fhci->regs->usb_usber) & in fhci_irq()
554 in_be16(&usb->fhci->regs->usb_usbmr); in fhci_irq()
557 out_be16(&usb->fhci->regs->usb_usber, usb_er); in fhci_irq()
562 if ((usb->port_status == FHCI_PORT_FULL) || in fhci_irq()
563 (usb->port_status == FHCI_PORT_LOW)) { in fhci_irq()
566 } else if (usb->port_status == FHCI_PORT_WAITING) { in fhci_irq()
567 usb->port_status = FHCI_PORT_DISCONNECTING; in fhci_irq()
570 usb->saved_msk |= USB_E_IDLE_MASK; in fhci_irq()
571 out_be16(&usb->fhci->regs->usb_usber, in fhci_irq()
572 usb->saved_msk); in fhci_irq()
573 } else if (usb->port_status == FHCI_PORT_DISABLED) { in fhci_irq()
581 abort_transmission(fhci->usb_lld); in fhci_irq()
591 fhci_tx_conf_interrupt(fhci->usb_lld); in fhci_irq()
596 fhci_tx_conf_interrupt(fhci->usb_lld); in fhci_irq()
601 if (usb->port_status == FHCI_PORT_DISABLED) { in fhci_irq()
604 } else if (usb->port_status == in fhci_irq()
606 /* XXX usb->port_status = FHCI_PORT_WAITING; */ in fhci_irq()
608 usb->saved_msk &= ~USB_E_IDLE_MASK; in fhci_irq()
609 out_be16(&usb->fhci->regs->usb_usbmr, in fhci_irq()
610 usb->saved_msk); in fhci_irq()
612 fhci_dbg_isr(fhci, -1); in fhci_irq()
618 spin_unlock_irqrestore(&fhci->lock, flags); in fhci_irq()
629 * the (re-reversed) done list as this does.
639 disable_irq(fhci->timer->irq); in process_done_list()
640 disable_irq(fhci_to_hcd(fhci)->irq); in process_done_list()
641 spin_lock(&fhci->lock); in process_done_list()
643 td = fhci_remove_td_from_done_list(fhci->hc_list); in process_done_list()
645 urb = td->urb; in process_done_list()
646 urb_priv = urb->hcpriv; in process_done_list()
647 ed = td->ed; in process_done_list()
651 urb_priv->tds_cnt++; in process_done_list()
659 if (urb_priv->tds_cnt == urb_priv->num_of_tds) { in process_done_list()
661 } else if (urb_priv->state == URB_DEL && in process_done_list()
662 ed->state == FHCI_ED_SKIP) { in process_done_list()
664 ed->state = FHCI_ED_OPER; in process_done_list()
665 } else if (ed->state == FHCI_ED_HALTED) { in process_done_list()
666 urb_priv->state = URB_DEL; in process_done_list()
667 ed->state = FHCI_ED_URB_DEL; in process_done_list()
669 ed->state = FHCI_ED_OPER; in process_done_list()
672 td = fhci_remove_td_from_done_list(fhci->hc_list); in process_done_list()
675 spin_unlock(&fhci->lock); in process_done_list()
676 enable_irq(fhci->timer->irq); in process_done_list()
677 enable_irq(fhci_to_hcd(fhci)->irq); in process_done_list()
685 if (!fhci->process_done_task->state) in fhci_transfer_confirm_callback()
686 tasklet_schedule(fhci->process_done_task); in fhci_transfer_confirm_callback()
699 struct ed *ed = urb->ep->hcpriv; in fhci_queue_urb()
700 struct urb_priv *urb_priv = urb->hcpriv; in fhci_queue_urb()
701 u32 data_len = urb->transfer_buffer_length; in fhci_queue_urb()
703 int toggle = 0; in fhci_queue_urb() local
709 ed->dev_addr = usb_pipedevice(urb->pipe); in fhci_queue_urb()
710 ed->ep_addr = usb_pipeendpoint(urb->pipe); in fhci_queue_urb()
711 switch (usb_pipetype(urb->pipe)) { in fhci_queue_urb()
713 ed->mode = FHCI_TF_CTRL; in fhci_queue_urb()
716 ed->mode = FHCI_TF_BULK; in fhci_queue_urb()
719 ed->mode = FHCI_TF_INTR; in fhci_queue_urb()
722 ed->mode = FHCI_TF_ISO; in fhci_queue_urb()
727 ed->speed = (urb->dev->speed == USB_SPEED_LOW) ? in fhci_queue_urb()
729 ed->max_pkt_size = usb_endpoint_maxp(&urb->ep->desc); in fhci_queue_urb()
730 urb->ep->hcpriv = ed; in fhci_queue_urb()
732 ed->speed, ed->max_pkt_size); in fhci_queue_urb()
736 if (ed->mode == FHCI_TF_ISO) { in fhci_queue_urb()
738 urb->start_frame = ed->td_head ? ed->next_iso : in fhci_queue_urb()
740 ed->next_iso = (urb->start_frame + urb->interval * in fhci_queue_urb()
741 urb->number_of_packets) & 0x07ff; in fhci_queue_urb()
745 * OHCI handles the DATA toggle itself,we just use the USB in fhci_queue_urb()
746 * toggle bits in fhci_queue_urb()
748 if (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), in fhci_queue_urb()
749 usb_pipeout(urb->pipe))) in fhci_queue_urb()
750 toggle = USB_TD_TOGGLE_CARRY; in fhci_queue_urb()
752 toggle = USB_TD_TOGGLE_DATA0; in fhci_queue_urb()
753 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), in fhci_queue_urb()
754 usb_pipeout(urb->pipe), 1); in fhci_queue_urb()
757 urb_priv->tds_cnt = 0; in fhci_queue_urb()
758 urb_priv->ed = ed; in fhci_queue_urb()
760 data = urb->transfer_buffer; in fhci_queue_urb()
764 switch (ed->mode) { in fhci_queue_urb()
766 if (urb->transfer_flags & URB_ZERO_PACKET && in fhci_queue_urb()
767 urb->transfer_buffer_length > 0 && in fhci_queue_urb()
768 ((urb->transfer_buffer_length % in fhci_queue_urb()
769 usb_endpoint_maxp(&urb->ep->desc)) == 0)) in fhci_queue_urb()
773 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : in fhci_queue_urb()
776 toggle, in fhci_queue_urb()
779 data_len -= 4096; in fhci_queue_urb()
784 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : FHCI_TA_IN, in fhci_queue_urb()
785 cnt ? USB_TD_TOGGLE_CARRY : toggle, in fhci_queue_urb()
789 if (urb->transfer_flags & URB_ZERO_PACKET && in fhci_queue_urb()
790 cnt < urb_priv->num_of_tds) { in fhci_queue_urb()
792 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : in fhci_queue_urb()
799 urb->start_frame = get_frame_num(fhci) + 1; in fhci_queue_urb()
801 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : FHCI_TA_IN, in fhci_queue_urb()
803 urb->interval, urb->start_frame, true); in fhci_queue_urb()
806 ed->dev_addr = usb_pipedevice(urb->pipe); in fhci_queue_urb()
807 ed->max_pkt_size = usb_endpoint_maxp(&urb->ep->desc); in fhci_queue_urb()
811 USB_TD_TOGGLE_DATA0, urb->setup_packet, 8, 0, 0, true); in fhci_queue_urb()
816 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : in fhci_queue_urb()
825 (usb_pipeout(urb->pipe) ? FHCI_TA_IN : in fhci_queue_urb()
836 for (cnt = 0; cnt < urb->number_of_packets; cnt++) { in fhci_queue_urb()
837 u16 frame = urb->start_frame; in fhci_queue_urb()
841 * roll-around ... exotic case (and OHCI has in fhci_queue_urb()
844 frame += cnt * urb->interval; in fhci_queue_urb()
847 usb_pipeout(urb->pipe) ? FHCI_TA_OUT : in fhci_queue_urb()
850 data + urb->iso_frame_desc[cnt].offset, in fhci_queue_urb()
851 urb->iso_frame_desc[cnt].length, in fhci_queue_urb()
852 urb->interval, frame, true); in fhci_queue_urb()
861 * control pipe:3 states -- setup,data,status in fhci_queue_urb()
862 * interrupt and bulk pipe:1 state -- data in fhci_queue_urb()
864 urb->pipe &= ~0x1f; in fhci_queue_urb()
865 urb->pipe |= urb_state & 0x1f; in fhci_queue_urb()
867 urb_priv->state = URB_INPROGRESS; in fhci_queue_urb()
869 if (!ed->td_head) { in fhci_queue_urb()
870 ed->state = FHCI_ED_OPER; in fhci_queue_urb()
871 switch (ed->mode) { in fhci_queue_urb()
873 list_add(&ed->node, &fhci->hc_list->ctrl_list); in fhci_queue_urb()
876 list_add(&ed->node, &fhci->hc_list->bulk_list); in fhci_queue_urb()
879 list_add(&ed->node, &fhci->hc_list->intr_list); in fhci_queue_urb()
882 list_add(&ed->node, &fhci->hc_list->iso_list); in fhci_queue_urb()
889 fhci_add_tds_to_ed(ed, urb_priv->tds, urb_priv->num_of_tds); in fhci_queue_urb()
890 fhci->active_urbs++; in fhci_queue_urb()