Changeset 4046c1ea in mainline
- Timestamp:
- 2011-01-29T00:14:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1431e8f
- Parents:
- b3258ad (diff), 44d8853 (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
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/callback.c
rb3258ad r4046c1ea 9 9 assert(instance); 10 10 assert(func_in == NULL || func_out == NULL); 11 instance->new_buffer = malloc32(size); 12 if (!instance->new_buffer) { 13 uhci_print_error("Failed to allocate device acessible buffer.\n"); 14 return ENOMEM; 11 if (size > 0) { 12 instance->new_buffer = malloc32(size); 13 if (!instance->new_buffer) { 14 uhci_print_error("Failed to allocate device acessible buffer.\n"); 15 return ENOMEM; 16 } 17 if (func_out) 18 memcpy(instance->new_buffer, buffer, size); 19 } else { 20 instance->new_buffer = NULL; 15 21 } 16 22 17 if (func_out)18 memcpy(instance->new_buffer, buffer, size);19 23 20 24 instance->callback_out = func_out; -
uspace/drv/uhci/root_hub/port.c
rb3258ad r4046c1ea 44 44 if (port_status & STATUS_CONNECTED) { 45 45 /* new device */ 46 port_status |= STATUS_IN_RESET;47 port_status_write(port_instance->address, port_status);48 async_usleep(1000);49 port_status =50 port_status_read(port_instance->address);51 port_status &= ~STATUS_IN_RESET;52 port_status_write(port_instance->address, port_status);53 46 uhci_port_new_device(port_instance); 54 47 } else { … … 79 72 return usb_address; 80 73 } 74 /* 75 * the host then waits for at least 100 ms to allow completion of 76 * an insertion process and for power at the device to become stable. 77 */ 78 async_usleep(100000); 81 79 82 80 /* enable port */ 83 81 uhci_port_set_enabled(port, true); 82 83 /* The hub maintains the reset signal to that port for 10 ms 84 * (See Section 11.5.1.5) 85 */ 86 port_status_t port_status = 87 port_status_read(port->address); 88 port_status |= STATUS_IN_RESET; 89 port_status_write(port->address, port_status); 90 async_usleep(10000); 91 port_status = 92 port_status_read(port->address); 93 port_status &= ~STATUS_IN_RESET; 94 port_status_write(port->address, port_status); 84 95 85 96 /* assign address to device */ -
uspace/drv/uhci/uhci.c
rb3258ad r4046c1ea 175 175 assert(instance); 176 176 177 uhci_print_verbose("Appending a new transfer to queue.\n"); 177 178 ret = transfer_list_append(&instance->transfers[transfer_type], td); 178 179 CHECK_RET_TRANS_FREE_JOB_TD("Failed to append transfer descriptor.\n"); … … 227 228 uint16_t reg; 228 229 reg = pio_read_16(&instance->registers->usbcmd); 229 uhci_print_ verbose("Command register: %X\n", reg);230 uhci_print_info("Command register: %X\n", reg); 230 231 231 232 reg = pio_read_16(&instance->registers->usbsts); 232 uhci_print_ verbose("Status register: %X (%s,%s,%s,%s,%s,%s)\n",233 uhci_print_info("Status register: %X (%s,%s,%s,%s,%s,%s)\n", 233 234 reg, 234 235 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_HALTED, "halted", "-"), -
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
rb3258ad r4046c1ea 52 52 uhci_print_verbose("Creating device field: %x.\n", instance->device); 53 53 54 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer);55 56 uhci_print_verbose("Creating buffer field: %p(%p).\n",57 buffer, instance->buffer_ptr);58 59 54 char buffer_dump[BUFFER_LEN]; 60 55 buffer_to_str(buffer_dump, BUFFER_LEN, buffer, size); 61 56 uhci_print_verbose("Buffer dump (%zuB): %s.\n", size, buffer_dump); 62 57 58 if (size) { 59 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 60 61 uhci_print_verbose("Creating buffer field: %p(%p).\n", 62 buffer, instance->buffer_ptr); 63 } else { 64 instance->buffer_ptr = 0; 65 } 66 67 63 68 instance->next_va = NULL; 64 69 instance->callback = NULL; 70 uhci_print_info("Created a new TD.\n"); 65 71 } 66 72 … … 98 104 callback_run(instance->callback, 99 105 convert_outcome(instance->status), 100 instance->status >> TD_STATUS_ACTLEN_POS& TD_STATUS_ACTLEN_MASK106 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK 101 107 ); 102 108 }
Note:
See TracChangeset
for help on using the changeset viewer.