Changes in / [4046c1ea:b3258ad] in mainline


Ignore:
Location:
uspace/drv/uhci
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/callback.c

    r4046c1ea rb3258ad  
    99        assert(instance);
    1010        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;
    2115        }
    2216
     17        if (func_out)
     18                memcpy(instance->new_buffer, buffer, size);
    2319
    2420        instance->callback_out = func_out;
  • uspace/drv/uhci/root_hub/port.c

    r4046c1ea rb3258ad  
    4444                        if (port_status & STATUS_CONNECTED) {
    4545                                /* 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);
    4653                                uhci_port_new_device(port_instance);
    4754                        } else {
     
    7279                return usb_address;
    7380        }
    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);
    7981
    8082        /* enable port */
    8183        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);
    9584
    9685        /* assign address to device */
  • uspace/drv/uhci/uhci.c

    r4046c1ea rb3258ad  
    175175        assert(instance);
    176176
    177         uhci_print_verbose("Appending a new transfer to queue.\n");
    178177        ret = transfer_list_append(&instance->transfers[transfer_type], td);
    179178        CHECK_RET_TRANS_FREE_JOB_TD("Failed to append transfer descriptor.\n");
     
    228227                uint16_t reg;
    229228                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);
    231230
    232231                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",
    234233                    reg,
    235234                    UHCI_GET_STR_FLAG(reg, UHCI_STATUS_HALTED, "halted", "-"),
  • uspace/drv/uhci/uhci_struct/transfer_descriptor.c

    r4046c1ea rb3258ad  
    5252        uhci_print_verbose("Creating device field: %x.\n", instance->device);
    5353
     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
    5459        char buffer_dump[BUFFER_LEN];
    5560        buffer_to_str(buffer_dump, BUFFER_LEN, buffer, size);
    5661        uhci_print_verbose("Buffer dump (%zuB): %s.\n", size, buffer_dump);
    5762
    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 
    6863        instance->next_va = NULL;
    6964        instance->callback = NULL;
    70         uhci_print_info("Created a new TD.\n");
    7165}
    7266
     
    10498        callback_run(instance->callback,
    10599                convert_outcome(instance->status),
    106                 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK
     100                instance->status >> TD_STATUS_ACTLEN_POS & TD_STATUS_ACTLEN_MASK
    107101        );
    108102}
Note: See TracChangeset for help on using the changeset viewer.