Lines Matching refs:td
42 struct td *td; in fhci_transaction_confirm() local
48 td = fhci_remove_td_from_frame(usb->actual_frame); in fhci_transaction_confirm()
49 td_pkt = td->pkt; 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()
61 ed = td->ed; in fhci_transaction_confirm()
64 struct td *td_next = in fhci_transaction_confirm()
65 list_entry(ed->td_list.next->next, struct td, 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()
86 if (td->status & USB_TD_RX_DATA_UNDERUN) { in fhci_transaction_confirm()
88 td->toggle = !td->toggle; in fhci_transaction_confirm()
89 td->actual_len += trans_len; 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()
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()
129 struct td *td; in fhci_flush_all_transmissions() local
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()
155 static int add_packet(struct fhci_usb *usb, struct ed *ed, struct td *td) in add_packet() argument
162 if (td->toggle == USB_TD_TOGGLE_CARRY) in add_packet()
163 td->toggle = ed->toggle_carry; 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()
217 td->pkt = pkt; in add_packet()
229 td->status = USB_TD_INPROGRESS; in add_packet()
232 fhci_add_td_to_frame(usb->actual_frame, td); 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()
280 struct td *td; in scan_ed_list() local
285 td = ed->td_head; in scan_ed_list()
287 if (!td || td->status == USB_TD_INPROGRESS) in scan_ed_list()
292 td->status = USB_TD_OK; in scan_ed_list()
305 td->start_frame) & 0x7ff) < td->interval)) in scan_ed_list()
308 if (add_packet(usb, ed, td) < 0) in scan_ed_list()
312 td->start_frame = usb->actual_frame->frame_num; in scan_ed_list()
635 struct td *td; in process_done_list() local
643 td = fhci_remove_td_from_done_list(fhci->hc_list); in process_done_list()
644 while (td != NULL) { in process_done_list()
645 urb = td->urb; in process_done_list()
647 ed = td->ed; in process_done_list()
650 fhci_done_td(urb, td); in process_done_list()
672 td = fhci_remove_td_from_done_list(fhci->hc_list); in process_done_list()