Changeset b01995b in mainline for uspace/drv/uhci-hcd/hw_struct
- Timestamp:
- 2011-03-21T23:42:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11dd29b, 62f4212
- Parents:
- 31b568e (diff), 87644b4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/drv/uhci-hcd/hw_struct
- Files:
-
- 4 moved
-
link_pointer.h (moved) (moved from uspace/drv/uhci-hcd/uhci_struct/link_pointer.h ) (1 diff)
-
queue_head.h (moved) (moved from uspace/drv/uhci-hcd/uhci_struct/queue_head.h ) (3 diffs)
-
transfer_descriptor.c (moved) (moved from uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c ) (3 diffs)
-
transfer_descriptor.h (moved) (moved from uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h )
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hw_struct/link_pointer.h
r31b568e rb01995b 49 49 ((address & LINK_POINTER_ADDRESS_MASK) | LINK_POINTER_QUEUE_HEAD_FLAG) 50 50 51 #define LINK_POINTER_TD(address) \ 52 (address & LINK_POINTER_ADDRESS_MASK) 53 54 #define LINK_POINTER_TERM \ 55 ((link_pointer_t)LINK_POINTER_TERMINATE_FLAG) 56 51 57 #endif 52 58 /** -
uspace/drv/uhci-hcd/hw_struct/queue_head.h
r31b568e rb01995b 72 72 /* Address is valid and not terminal */ 73 73 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 74 instance->next = (pa & LINK_POINTER_ADDRESS_MASK) 75 | LINK_POINTER_QUEUE_HEAD_FLAG; 74 instance->next = LINK_POINTER_QH(pa); 76 75 } else { 77 instance->next = 0 | LINK_POINTER_TERMINATE_FLAG;76 instance->next = LINK_POINTER_TERM; 78 77 } 79 78 } … … 91 90 /* Address is valid and not terminal */ 92 91 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 93 instance->element = (pa & LINK_POINTER_ADDRESS_MASK) 94 | LINK_POINTER_QUEUE_HEAD_FLAG; 92 instance->element = LINK_POINTER_QH(pa); 95 93 } else { 96 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG;94 instance->element = LINK_POINTER_TERM; 97 95 } 98 96 } … … 109 107 { 110 108 if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) { 111 instance->element = (pa & LINK_POINTER_ADDRESS_MASK);109 instance->element = LINK_POINTER_TD(pa); 112 110 } else { 113 instance->element = 0 | LINK_POINTER_TERMINATE_FLAG;111 instance->element = LINK_POINTER_TERM; 114 112 } 115 113 } -
uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.c
r31b568e rb01995b 69 69 || (pid == USB_PID_OUT)); 70 70 71 const uint32_t next_pa = addr_to_phys(next); 72 assert((next_pa & LINK_POINTER_ADDRESS_MASK) == next_pa); 73 71 74 instance->next = 0 72 75 | LINK_POINTER_VERTICAL_FLAG 73 | ( (next != NULL) ? addr_to_phys(next): LINK_POINTER_TERMINATE_FLAG);76 | (next_pa ? next_pa : LINK_POINTER_TERMINATE_FLAG); 74 77 75 78 instance->status = 0 … … 90 93 | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS); 91 94 92 instance->buffer_ptr = 0; 93 94 if (size) { 95 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 96 } 95 instance->buffer_ptr = addr_to_phys(buffer); 97 96 98 97 usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p).\n", … … 115 114 assert(instance); 116 115 117 if ((instance->status & TD_STATUS_ERROR_STALLED) != 0) 118 return ESTALL; 116 /* this is hc internal error it should never be reported */ 117 if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0) 118 return EAGAIN; 119 119 120 /* CRC or timeout error, like device not present or bad data, 121 * it won't be reported unless err count reached zero */ 120 122 if ((instance->status & TD_STATUS_ERROR_CRC) != 0) 121 123 return EBADCHECKSUM; 122 124 123 if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0) 125 /* hc does not end transaction on these, it should never be reported */ 126 if ((instance->status & TD_STATUS_ERROR_NAK) != 0) 124 127 return EAGAIN; 125 128 129 /* buffer overrun or underrun */ 130 if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0) 131 return ERANGE; 132 133 /* device babble is something serious */ 126 134 if ((instance->status & TD_STATUS_ERROR_BABBLE) != 0) 127 135 return EIO; 128 136 129 if ((instance->status & TD_STATUS_ERROR_NAK) != 0) 130 return EAGAIN; 131 132 if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0) 133 return EAGAIN; 137 /* stall might represent err count reaching zero or stall response from 138 * the device, is err count reached zero, one of the above is reported*/ 139 if ((instance->status & TD_STATUS_ERROR_STALLED) != 0) 140 return ESTALL; 134 141 135 142 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
