Lines Matching refs:td

109 	struct uhci_td *td;  in uhci_alloc_td()  local
111 td = dma_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle); in uhci_alloc_td()
112 if (!td) in uhci_alloc_td()
115 td->dma_handle = dma_handle; in uhci_alloc_td()
116 td->frame = -1; in uhci_alloc_td()
118 INIT_LIST_HEAD(&td->list); in uhci_alloc_td()
119 INIT_LIST_HEAD(&td->fl_list); in uhci_alloc_td()
121 return td; in uhci_alloc_td()
124 static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td) in uhci_free_td() argument
126 if (!list_empty(&td->list)) in uhci_free_td()
127 dev_WARN(uhci_dev(uhci), "td %p still in list!\n", td); in uhci_free_td()
128 if (!list_empty(&td->fl_list)) in uhci_free_td()
129 dev_WARN(uhci_dev(uhci), "td %p still in fl_list!\n", td); in uhci_free_td()
131 dma_pool_free(uhci->td_pool, td, td->dma_handle); in uhci_free_td()
134 static inline void uhci_fill_td(struct uhci_hcd *uhci, struct uhci_td *td, in uhci_fill_td() argument
137 td->status = cpu_to_hc32(uhci, status); in uhci_fill_td()
138 td->token = cpu_to_hc32(uhci, token); in uhci_fill_td()
139 td->buffer = cpu_to_hc32(uhci, buffer); in uhci_fill_td()
142 static void uhci_add_td_to_urbp(struct uhci_td *td, struct urb_priv *urbp) in uhci_add_td_to_urbp() argument
144 list_add_tail(&td->list, &urbp->td_list); in uhci_add_td_to_urbp()
147 static void uhci_remove_td_from_urbp(struct uhci_td *td) in uhci_remove_td_from_urbp() argument
149 list_del_init(&td->list); in uhci_remove_td_from_urbp()
156 struct uhci_td *td, unsigned framenum) in uhci_insert_td_in_frame_list() argument
160 td->frame = framenum; in uhci_insert_td_in_frame_list()
169 list_add_tail(&td->fl_list, &ftd->fl_list); in uhci_insert_td_in_frame_list()
171 td->link = ltd->link; in uhci_insert_td_in_frame_list()
173 ltd->link = LINK_TO_TD(uhci, td); in uhci_insert_td_in_frame_list()
175 td->link = uhci->frame[framenum]; in uhci_insert_td_in_frame_list()
177 uhci->frame[framenum] = LINK_TO_TD(uhci, td); in uhci_insert_td_in_frame_list()
178 uhci->frame_cpu[framenum] = td; in uhci_insert_td_in_frame_list()
183 struct uhci_td *td) in uhci_remove_td_from_frame_list() argument
186 if (td->frame == -1) { in uhci_remove_td_from_frame_list()
187 WARN_ON(!list_empty(&td->fl_list)); in uhci_remove_td_from_frame_list()
191 if (uhci->frame_cpu[td->frame] == td) { in uhci_remove_td_from_frame_list()
192 if (list_empty(&td->fl_list)) { in uhci_remove_td_from_frame_list()
193 uhci->frame[td->frame] = td->link; in uhci_remove_td_from_frame_list()
194 uhci->frame_cpu[td->frame] = NULL; in uhci_remove_td_from_frame_list()
198 ntd = list_entry(td->fl_list.next, in uhci_remove_td_from_frame_list()
201 uhci->frame[td->frame] = LINK_TO_TD(uhci, ntd); in uhci_remove_td_from_frame_list()
202 uhci->frame_cpu[td->frame] = ntd; in uhci_remove_td_from_frame_list()
207 ptd = list_entry(td->fl_list.prev, struct uhci_td, fl_list); in uhci_remove_td_from_frame_list()
208 ptd->link = td->link; in uhci_remove_td_from_frame_list()
211 list_del_init(&td->fl_list); in uhci_remove_td_from_frame_list()
212 td->frame = -1; in uhci_remove_td_from_frame_list()
239 struct uhci_td *td; in uhci_unlink_isochronous_tds() local
241 list_for_each_entry(td, &urbp->td_list, list) in uhci_unlink_isochronous_tds()
242 uhci_remove_td_from_frame_list(uhci, td); in uhci_unlink_isochronous_tds()
318 struct uhci_td *td; in uhci_cleanup_queue() local
342 td = list_entry(urbp->td_list.prev, struct uhci_td, in uhci_cleanup_queue()
344 ptd->link = td->link; in uhci_cleanup_queue()
360 td = list_entry(urbp->td_list.next, struct uhci_td, list); in uhci_cleanup_queue()
362 qh->initial_toggle = uhci_toggle(td_token(uhci, td)); in uhci_cleanup_queue()
376 struct uhci_td *td; in uhci_fixup_toggles() local
398 td = list_entry(urbp->td_list.next, struct uhci_td, list); in uhci_fixup_toggles()
399 if (toggle > 1 || uhci_toggle(td_token(uhci, td)) == toggle) { in uhci_fixup_toggles()
400 td = list_entry(urbp->td_list.prev, struct uhci_td, in uhci_fixup_toggles()
402 toggle = uhci_toggle(td_token(uhci, td)) ^ 1; in uhci_fixup_toggles()
406 list_for_each_entry(td, &urbp->td_list, list) { in uhci_fixup_toggles()
407 td->token ^= cpu_to_hc32(uhci, in uhci_fixup_toggles()
489 struct uhci_td *td = list_entry(urbp->td_list.next, in uhci_activate_qh() local
492 qh->element = LINK_TO_TD(uhci, td); in uhci_activate_qh()
743 struct uhci_td *td, *tmp; in uhci_free_urb_priv() local
749 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { in uhci_free_urb_priv()
750 uhci_remove_td_from_urbp(td); in uhci_free_urb_priv()
751 uhci_free_td(uhci, td); in uhci_free_urb_priv()
792 struct uhci_td *td; in uhci_submit_control() local
812 td = qh->dummy_td; in uhci_submit_control()
813 uhci_add_td_to_urbp(td, urbp); in uhci_submit_control()
814 uhci_fill_td(uhci, td, status, destination | uhci_explen(8), in uhci_submit_control()
816 plink = &td->link; in uhci_submit_control()
844 td = uhci_alloc_td(uhci); in uhci_submit_control()
845 if (!td) in uhci_submit_control()
847 *plink = LINK_TO_TD(uhci, td); in uhci_submit_control()
852 uhci_add_td_to_urbp(td, urbp); in uhci_submit_control()
853 uhci_fill_td(uhci, td, status, in uhci_submit_control()
855 plink = &td->link; in uhci_submit_control()
864 td = uhci_alloc_td(uhci); in uhci_submit_control()
865 if (!td) in uhci_submit_control()
867 *plink = LINK_TO_TD(uhci, td); in uhci_submit_control()
873 uhci_add_td_to_urbp(td, urbp); in uhci_submit_control()
874 uhci_fill_td(uhci, td, status | TD_CTRL_IOC, in uhci_submit_control()
876 plink = &td->link; in uhci_submit_control()
881 td = uhci_alloc_td(uhci); in uhci_submit_control()
882 if (!td) in uhci_submit_control()
884 *plink = LINK_TO_TD(uhci, td); in uhci_submit_control()
886 uhci_fill_td(uhci, td, 0, USB_PID_OUT | uhci_explen(0), 0); in uhci_submit_control()
889 qh->dummy_td = td; in uhci_submit_control()
918 struct uhci_td *td; in uhci_submit_common() local
963 td = qh->dummy_td; in uhci_submit_common()
974 td = uhci_alloc_td(uhci); in uhci_submit_common()
975 if (!td) in uhci_submit_common()
977 *plink = LINK_TO_TD(uhci, td); in uhci_submit_common()
979 uhci_add_td_to_urbp(td, urbp); in uhci_submit_common()
980 uhci_fill_td(uhci, td, status, in uhci_submit_common()
984 plink = &td->link; in uhci_submit_common()
1010 td = uhci_alloc_td(uhci); in uhci_submit_common()
1011 if (!td) in uhci_submit_common()
1013 *plink = LINK_TO_TD(uhci, td); in uhci_submit_common()
1015 uhci_add_td_to_urbp(td, urbp); in uhci_submit_common()
1016 uhci_fill_td(uhci, td, status, in uhci_submit_common()
1020 plink = &td->link; in uhci_submit_common()
1031 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); in uhci_submit_common()
1036 td = uhci_alloc_td(uhci); in uhci_submit_common()
1037 if (!td) in uhci_submit_common()
1039 *plink = LINK_TO_TD(uhci, td); in uhci_submit_common()
1041 uhci_fill_td(uhci, td, 0, USB_PID_OUT | uhci_explen(0), 0); in uhci_submit_common()
1044 qh->dummy_td = td; in uhci_submit_common()
1125 struct uhci_td *td; in uhci_fixup_short_transfer() local
1129 td = list_entry(urbp->td_list.prev, struct uhci_td, list); in uhci_fixup_short_transfer()
1136 qh->element = LINK_TO_TD(uhci, td); in uhci_fixup_short_transfer()
1137 tmp = td->list.prev; in uhci_fixup_short_transfer()
1150 td = qh->post_td; in uhci_fixup_short_transfer()
1151 qh->element = td->link; in uhci_fixup_short_transfer()
1158 td = list_entry(tmp, struct uhci_td, list); in uhci_fixup_short_transfer()
1161 uhci_remove_td_from_urbp(td); in uhci_fixup_short_transfer()
1162 uhci_free_td(uhci, td); in uhci_fixup_short_transfer()
1174 struct uhci_td *td, *tmp; in uhci_result_common() local
1178 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { in uhci_result_common()
1182 ctrlstat = td_status(uhci, td); in uhci_result_common()
1192 uhci_packetout(td_token(uhci, td))); in uhci_result_common()
1208 } else if (len < uhci_expected_length(td_token(uhci, td))) { in uhci_result_common()
1213 if (td->list.next != urbp->td_list.prev) in uhci_result_common()
1222 else if (&td->list != urbp->td_list.prev) in uhci_result_common()
1226 uhci_remove_td_from_urbp(td); in uhci_result_common()
1229 qh->post_td = td; in uhci_result_common()
1243 qh->initial_toggle = uhci_toggle(td_token(uhci, td)) ^ in uhci_result_common()
1257 struct uhci_td *td = NULL; /* Since urb->number_of_packets > 0 */ in uhci_submit_isochronous() local
1337 td = uhci_alloc_td(uhci); in uhci_submit_isochronous()
1338 if (!td) in uhci_submit_isochronous()
1341 uhci_add_td_to_urbp(td, urbp); in uhci_submit_isochronous()
1342 uhci_fill_td(uhci, td, status, destination | in uhci_submit_isochronous()
1349 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); in uhci_submit_isochronous()
1353 list_for_each_entry(td, &urbp->td_list, list) { in uhci_submit_isochronous()
1354 uhci_insert_td_in_frame_list(uhci, td, frame); in uhci_submit_isochronous()
1371 struct uhci_td *td, *tmp; in uhci_result_isochronous() local
1375 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { in uhci_result_isochronous()
1385 ctrlstat = td_status(uhci, td); in uhci_result_isochronous()
1400 uhci_remove_td_from_urbp(td); in uhci_result_isochronous()
1401 uhci_free_td(uhci, td); in uhci_result_isochronous()
1643 struct uhci_td *td = list_entry(urbp->td_list.next, in uhci_scan_qh() local
1646 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); in uhci_scan_qh()
1671 struct uhci_td *td; in uhci_advance_check() local
1692 td = list_entry(urbp->td_list.next, struct uhci_td, list); in uhci_advance_check()
1693 status = td_status(uhci, td); in uhci_advance_check()