Changes in / [eedac04:3746bfe] in mainline


Ignore:
Location:
uspace/drv/uhci-hcd
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c

    reedac04 r3746bfe  
    6969            || (pid == USB_PID_OUT));
    7070
    71         const uint32_t next_pa = addr_to_phys(next);
    72         assert((next_pa & LINK_POINTER_ADDRESS_MASK) == next_pa);
    73 
    7471        instance->next = 0
    7572            | LINK_POINTER_VERTICAL_FLAG
    76             | (next_pa ? next_pa : LINK_POINTER_TERMINATE_FLAG);
     73            | ((next != NULL) ? addr_to_phys(next) : LINK_POINTER_TERMINATE_FLAG);
    7774
    7875        instance->status = 0
     
    9390            | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS);
    9491
    95         instance->buffer_ptr = addr_to_phys(buffer);
     92        instance->buffer_ptr = 0;
     93
     94        if (size) {
     95                instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer);
     96        }
    9697
    9798        usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p).\n",
  • uspace/drv/uhci-hcd/utils/device_keeper.c

    reedac04 r3746bfe  
    179179        } else {
    180180                if (toggle) {
    181                         instance->devices[target.address].toggle_status |=
    182                             (1 << target.endpoint);
     181                        instance->devices[target.address].toggle_status |= (1 << target.endpoint);
    183182                } else {
    184                         instance->devices[target.address].toggle_status &=
    185                             ~(1 << target.endpoint);
     183                        instance->devices[target.address].toggle_status &= ~(1 << target.endpoint);
    186184                }
    187185                ret = EOK;
     
    203201        fibril_mutex_lock(&instance->guard);
    204202
    205         usb_address_t new_address = instance->last_address;
    206         do {
    207                 ++new_address;
    208                 if (new_address > USB11_ADDRESS_MAX)
    209                         new_address = 1;
     203        usb_address_t new_address = instance->last_address + 1;
     204        while (instance->devices[new_address].occupied) {
    210205                if (new_address == instance->last_address) {
    211206                        fibril_mutex_unlock(&instance->guard);
    212207                        return ENOSPC;
    213208                }
    214         } while (instance->devices[new_address].occupied);
     209                if (new_address == USB11_ADDRESS_MAX)
     210                        new_address = 1;
     211                ++new_address;
     212        }
    215213
    216214        assert(new_address != USB_ADDRESS_DEFAULT);
  • uspace/drv/uhci-hcd/utils/malloc32.h

    reedac04 r3746bfe  
    5050static inline uintptr_t addr_to_phys(void *addr)
    5151{
    52         if (addr == NULL)
    53                 return 0;
    54 
    5552        uintptr_t result;
    5653        int ret = as_get_physical_mapping(addr, &result);
Note: See TracChangeset for help on using the changeset viewer.