Changeset 86c2ccd in mainline
- Timestamp:
- 2011-02-26T01:25:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb292a0
- Parents:
- c3ae877
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
rc3ae877 r86c2ccd 33 33 */ 34 34 #include <errno.h> 35 #include <str_error.h> 35 36 36 37 #include <usb/debug.h> … … 194 195 195 196 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; 197 usb_log_debug("Control write last TD status: %x.\n", 198 instance->tds[i].status); 196 199 197 200 instance->next_step = batch_call_out_and_dispose; … … 228 231 229 232 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; 233 usb_log_debug("Control read last TD status: %x.\n", 234 instance->tds[i].status); 230 235 231 236 instance->next_step = batch_call_in_and_dispose; … … 293 298 294 299 int err = instance->error; 295 usb_log_info("Callback IN(%d): % d, %zu.\n", instance->transfer_type,296 err, instance->transfered_size);300 usb_log_info("Callback IN(%d): %s(%d), %zu.\n", instance->transfer_type, 301 str_error(err), err, instance->transfered_size); 297 302 298 303 instance->callback_in(instance->fun, -
uspace/drv/uhci-hcd/pci.c
rc3ae877 r86c2ccd 90 90 io_address = res->res.io_range.address; 91 91 io_size = res->res.io_range.size; 92 usb_log_debug("Found io: % x %d.\n",93 res->res.io_range.address, res->res.io_range.size );92 usb_log_debug("Found io: %llx %zu %zu.\n", 93 res->res.io_range.address, res->res.io_range.size, io_size); 94 94 io_found = true; 95 95 break; … … 125 125 IPC_FLAG_BLOCKING); 126 126 bool enabled = hw_res_enable_interrupt(parent_phone); 127 async_hangup(parent_phone); 127 128 return enabled ? EOK : EIO; 128 129 } -
uspace/drv/uhci-hcd/transfer_list.c
rc3ae877 r86c2ccd 70 70 assert(instance); 71 71 assert(batch); 72 usb_log_debug("Adding batch(%p) to queue %s.\n", batch, instance->name); 72 73 73 74 uint32_t pa = (uintptr_t)addr_to_phys(batch->qh); … … 123 124 } 124 125 /*----------------------------------------------------------------------------*/ 125 void transfer_list_ check(transfer_list_t *instance)126 void transfer_list_remove_finished(transfer_list_t *instance) 126 127 { 127 128 assert(instance); 129 130 LIST_INITIALIZE(done); 131 128 132 fibril_mutex_lock(&instance->guard); 129 133 link_t *current = instance->batch_list.next; … … 134 138 if (batch_is_complete(batch)) { 135 139 transfer_list_remove_batch(instance, batch); 136 batch->next_step(batch);140 list_append(current, &done); 137 141 } 138 142 current = next; 139 143 } 140 144 fibril_mutex_unlock(&instance->guard); 145 146 while (!list_empty(&done)) { 147 link_t *item = done.next; 148 list_remove(item); 149 batch_t *batch = list_get_instance(item, batch_t, link); 150 batch->next_step(batch); 151 } 141 152 } 142 153 /** -
uspace/drv/uhci-hcd/transfer_list.h
rc3ae877 r86c2ccd 60 60 queue_head_dispose(instance->queue_head); 61 61 } 62 void transfer_list_ check(transfer_list_t *instance);62 void transfer_list_remove_finished(transfer_list_t *instance); 63 63 64 64 void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch); -
uspace/drv/uhci-hcd/uhci.c
rc3ae877 r86c2ccd 285 285 return; 286 286 usb_log_debug("UHCI interrupt: %X.\n", status); 287 transfer_list_ check(&instance->transfers_interrupt);288 transfer_list_ check(&instance->transfers_control_slow);289 transfer_list_ check(&instance->transfers_control_full);290 transfer_list_ check(&instance->transfers_bulk_full);287 transfer_list_remove_finished(&instance->transfers_interrupt); 288 transfer_list_remove_finished(&instance->transfers_control_slow); 289 transfer_list_remove_finished(&instance->transfers_control_full); 290 transfer_list_remove_finished(&instance->transfers_bulk_full); 291 291 } 292 292 /*----------------------------------------------------------------------------*/ … … 297 297 assert(instance); 298 298 299 while (1) {299 while (1) { 300 300 uint16_t status = pio_read_16(&instance->registers->usbsts); 301 301 usb_log_debug("UHCI status: %x.\n", status); … … 303 303 uhci_interrupt(instance, status); 304 304 pio_write_16(&instance->registers->usbsts, 0x1f); 305 async_usleep(UHCI_CLEANER_TIMEOUT * 1000);305 async_usleep(UHCI_CLEANER_TIMEOUT * 5); 306 306 } 307 307 return EOK; -
uspace/drv/uhci-hcd/utils/device_keeper.c
rc3ae877 r86c2ccd 136 136 return address; 137 137 } 138 ++address; 138 139 } 139 140 fibril_mutex_unlock(&instance->guard); … … 147 148 assert(address >= 0); 148 149 assert(address <= USB11_ADDRESS_MAX); 149 assert(instance->devices[address].occupied);150 150 return instance->devices[address].speed; 151 151 }
Note:
See TracChangeset
for help on using the changeset viewer.