Changes in / [4046c1ea:b3258ad] in mainline
- Location:
- uspace/drv/uhci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/callback.c
r4046c1ea rb3258ad 9 9 assert(instance); 10 10 assert(func_in == NULL || func_out == NULL); 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; 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; 21 15 } 22 16 17 if (func_out) 18 memcpy(instance->new_buffer, buffer, size); 23 19 24 20 instance->callback_out = func_out; -
uspace/drv/uhci/root_hub/port.c
r4046c1ea rb3258ad 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); 46 53 uhci_port_new_device(port_instance); 47 54 } else { … … 72 79 return usb_address; 73 80 } 74 /*75 * the host then waits for at least 100 ms to allow completion of76 * an insertion process and for power at the device to become stable.77 */78 async_usleep(100000);79 81 80 82 /* enable port */ 81 83 uhci_port_set_enabled(port, true); 82 83 /* The hub maintains the reset signal to that port for 10 ms84 * (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);95 84 96 85 /* assign address to device */ -
uspace/drv/uhci/uhci.c
r4046c1ea rb3258ad 175 175 assert(instance); 176 176 177 uhci_print_verbose("Appending a new transfer to queue.\n");178 177 ret = transfer_list_append(&instance->transfers[transfer_type], td); 179 178 CHECK_RET_TRANS_FREE_JOB_TD("Failed to append transfer descriptor.\n"); … … 228 227 uint16_t reg; 229 228 reg = pio_read_16(&instance->registers->usbcmd); 230 uhci_print_ info("Command register: %X\n", reg);229 uhci_print_verbose("Command register: %X\n", reg); 231 230 232 231 reg = pio_read_16(&instance->registers->usbsts); 233 uhci_print_ info("Status register: %X (%s,%s,%s,%s,%s,%s)\n",232 uhci_print_verbose("Status register: %X (%s,%s,%s,%s,%s,%s)\n", 234 233 reg, 235 234 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_HALTED, "halted", "-"), -
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
r4046c1ea rb3258ad 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 54 59 char buffer_dump[BUFFER_LEN]; 55 60 buffer_to_str(buffer_dump, BUFFER_LEN, buffer, size); 56 61 uhci_print_verbose("Buffer dump (%zuB): %s.\n", size, buffer_dump); 57 62 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 68 63 instance->next_va = NULL; 69 64 instance->callback = NULL; 70 uhci_print_info("Created a new TD.\n");71 65 } 72 66 … … 104 98 callback_run(instance->callback, 105 99 convert_outcome(instance->status), 106 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1)& TD_STATUS_ACTLEN_MASK100 instance->status >> TD_STATUS_ACTLEN_POS & TD_STATUS_ACTLEN_MASK 107 101 ); 108 102 }
Note:
See TracChangeset
for help on using the changeset viewer.