Changeset d03ade7 in mainline
- Timestamp:
- 2011-01-25T21:25:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ee87f6
- Parents:
- b00163f
- Location:
- uspace/drv/uhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/transfer_list.c
rb00163f rd03ade7 23 23 transfer_list_t *instance, transfer_descriptor_t *transfer) 24 24 { 25 assert(instance); 26 assert(transfer); 27 28 uint32_t pa = (uintptr_t)addr_to_phys(transfer); 29 assert((pa & LINK_POINTER_ADDRESS_MASK) == pa); 30 31 /* empty list */ 32 if (instance->first == NULL) { 33 assert(instance->last == NULL); 34 instance->first = instance->last = transfer; 35 } else { 36 assert(instance->last); 37 instance->last->next_va = transfer; 38 39 assert(instance->last->next & LINK_POINTER_TERMINATE_FLAG); 40 instance->last->next = (pa & LINK_POINTER_ADDRESS_MASK); 41 instance->last = transfer; 42 } 43 44 assert(instance->queue_head); 45 if (instance->queue_head->element & LINK_POINTER_TERMINATE_FLAG) { 46 instance->queue_head->element = (pa & LINK_POINTER_ADDRESS_MASK); 47 } 48 uhci_print_info("Successfully added transfer to the hc queue.\n"); 25 49 return EOK; 26 50 } -
uspace/drv/uhci/uhci.c
rb00163f rd03ade7 13 13 static inline int uhci_add_transfer( 14 14 device_t *dev, 15 16 usb_transfer_type_t transfer_type, 17 15 usb_target_t target, 16 usb_transfer_type_t transfer_type, 17 usb_packet_id pid, 18 18 void *buffer, size_t size, 19 19 usbhc_iface_transfer_out_callback_t callback_out, 20 20 usbhc_iface_transfer_in_callback_t callback_in, 21 21 void *arg ); 22 22 23 23 int uhci_init(device_t *device, void *regs) … … 164 164 static inline int uhci_add_transfer( 165 165 device_t *dev, 166 167 usb_transfer_type_t transfer_type, 168 166 usb_target_t target, 167 usb_transfer_type_t transfer_type, 168 usb_packet_id pid, 169 169 void *buffer, size_t size, 170 170 usbhc_iface_transfer_out_callback_t callback_out, 171 171 usbhc_iface_transfer_in_callback_t callback_in, 172 172 void *arg ) 173 173 { 174 174 // TODO: Add support for isochronous transfers … … 203 203 204 204 td = trans_malloc(sizeof(transfer_descriptor_t)); 205 ret = td ? E NOMEM : EOK;206 CHECK_RET_TRANS_FREE_JOB_TD("Failed to allocate tran fer descriptor.\n");205 ret = td ? EOK : ENOMEM; 206 CHECK_RET_TRANS_FREE_JOB_TD("Failed to allocate transfer descriptor.\n"); 207 207 208 208 ret = transfer_descriptor_init(td, 3, size, false, target, pid);
Note:
See TracChangeset
for help on using the changeset viewer.