Lines Matching refs:td
459 dma_addr_t addr, struct ohci_td *td) in ohci_read_td() argument
461 return get_dwords(ohci, addr, (uint32_t *)td, sizeof(*td) >> 2); in ohci_read_td()
465 dma_addr_t addr, struct ohci_iso_td *td) in ohci_read_iso_td() argument
467 return get_dwords(ohci, addr, (uint32_t *)td, 4) || in ohci_read_iso_td()
468 get_words(ohci, addr + 16, td->offset, 8); in ohci_read_iso_td()
491 dma_addr_t addr, struct ohci_td *td) in ohci_put_td() argument
493 return put_dwords(ohci, addr, (uint32_t *)td, sizeof(*td) >> 2); in ohci_put_td()
497 dma_addr_t addr, struct ohci_iso_td *td) in ohci_put_iso_td() argument
499 return put_dwords(ohci, addr, (uint32_t *)td, 4) || in ohci_put_iso_td()
500 put_words(ohci, addr + 16, td->offset, 8); in ohci_put_iso_td()
513 static int ohci_copy_td(OHCIState *ohci, struct ohci_td *td, in ohci_copy_td() argument
518 ptr = td->cbp; in ohci_copy_td()
530 ptr = td->be & ~0xfffu; in ohci_copy_td()
884 struct ohci_td td; in ohci_service_td() local
901 if (ohci_read_td(ohci, addr, &td)) { in ohci_service_td()
914 dir = OHCI_BM(td.flags, TD_DP); in ohci_service_td()
931 trace_usb_ohci_td_bad_pid(str, ed->flags, td.flags); in ohci_service_td()
940 if (td.cbp && td.be) { in ohci_service_td()
941 if ((td.cbp & 0xfffff000) != (td.be & 0xfffff000)) { in ohci_service_td()
942 len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff); in ohci_service_td()
944 if (td.cbp - 1 > td.be) { /* rely on td.cbp != 0 */ in ohci_service_td()
945 trace_usb_ohci_td_bad_buf(td.cbp, td.be); in ohci_service_td()
949 len = (td.be - td.cbp) + 1; in ohci_service_td()
963 if (ohci_copy_td(ohci, &td, ohci->usb_buf, pktlen, in ohci_service_td()
971 flag_r = (td.flags & OHCI_TD_R) != 0; in ohci_service_td()
973 flag_r, td.cbp, td.be); in ohci_service_td()
997 OHCI_BM(td.flags, TD_DI) == 0); in ohci_service_td()
1016 if (ohci_copy_td(ohci, &td, ohci->usb_buf, ret, in ohci_service_td()
1030 td.cbp = 0; in ohci_service_td()
1032 if ((td.cbp & 0xfff) + ret > 0xfff) { in ohci_service_td()
1033 td.cbp = (td.be & ~0xfff) + ((td.cbp + ret) & 0xfff); in ohci_service_td()
1035 td.cbp += ret; in ohci_service_td()
1038 td.flags |= OHCI_TD_T1; in ohci_service_td()
1039 td.flags ^= OHCI_TD_T0; in ohci_service_td()
1040 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_NOERROR); in ohci_service_td()
1041 OHCI_SET_BM(td.flags, TD_EC, 0); in ohci_service_td()
1050 if (td.flags & OHCI_TD_T0) { in ohci_service_td()
1056 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DATAUNDERRUN); in ohci_service_td()
1062 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DEVICENOTRESPONDING); in ohci_service_td()
1069 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_STALL); in ohci_service_td()
1073 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DATAOVERRUN); in ohci_service_td()
1077 OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_UNDEXPETEDPID); in ohci_service_td()
1078 OHCI_SET_BM(td.flags, TD_EC, 3); in ohci_service_td()
1092 ed->head |= td.next & OHCI_DPTR_MASK; in ohci_service_td()
1093 td.next = ohci->done; in ohci_service_td()
1095 i = OHCI_BM(td.flags, TD_DI); in ohci_service_td()
1100 if (ohci_put_td(ohci, addr, &td)) { in ohci_service_td()
1104 return OHCI_BM(td.flags, TD_CC) != OHCI_CC_NOERROR; in ohci_service_td()