Changes in / [6991188:1a46610] in mainline


Ignore:
Location:
uspace/drv/ohci
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/batch.c

    r6991188 r1a46610  
    145145                    data->tds[i].status, data->tds[i].cbp, data->tds[i].next,
    146146                    data->tds[i].be);
    147                 if (!td_is_finished(&data->tds[i])) {
     147                if (!td_is_finished(&data->tds[i]))
    148148                        return false;
    149                 }
    150149                instance->error = td_error(&data->tds[i]);
    151150                /* FIXME: calculate real transfered size */
     
    288287
    289288        /* data stage */
    290         size_t td_current = 0;
     289        size_t td_current = 1;
    291290        size_t remain_size = instance->buffer_size;
    292291        char *transfer_buffer = instance->transport_buffer;
  • uspace/drv/ohci/hc.c

    r6991188 r1a46610  
    113113            ret, str_error(ret));
    114114        hc_init_hw(instance);
    115         fibril_mutex_initialize(&instance->guard);
    116115
    117116        rh_init(&instance->rh, dev, instance->registers);
     
    136135        }
    137136
    138         fibril_mutex_lock(&instance->guard);
    139137        switch (batch->transfer_type) {
    140138        case USB_TRANSFER_CONTROL:
     
    159157        case USB_TRANSFER_INTERRUPT:
    160158        case USB_TRANSFER_ISOCHRONOUS:
    161                 instance->registers->control &= (~C_PLE & ~C_IE);
     159                instance->registers->control &= ~C_PLE;
    162160                transfer_list_add_batch(
    163161                    instance->transfers[batch->transfer_type], batch);
    164                 instance->registers->control |= C_PLE | C_IE;
    165                 usb_log_debug2("Added periodic transfer: %x.\n",
    166                     instance->registers->periodic_current);
     162                instance->registers->control |= C_PLE;
    167163                break;
    168164        default:
    169165                break;
    170166        }
    171         fibril_mutex_unlock(&instance->guard);
    172167        return EOK;
    173168}
     
    183178        usb_log_debug("OHCI interrupt: %x.\n", status);
    184179
     180
    185181        if (status & IS_WDH) {
    186                 fibril_mutex_lock(&instance->guard);
    187                 usb_log_debug2("HCCA: %p-%p(%p).\n", instance->hcca,
    188                     instance->registers->hcca, addr_to_phys(instance->hcca));
    189                 usb_log_debug2("Periodic current: %p.\n",
    190                     instance->registers->periodic_current);
    191182                LIST_INITIALIZE(done);
    192183                transfer_list_remove_finished(
     
    206197                        usb_transfer_batch_finish(batch);
    207198                }
    208                 fibril_mutex_unlock(&instance->guard);
    209199        }
    210200}
     
    218208                instance->registers->interrupt_status = status;
    219209                hc_interrupt(instance, status);
    220                 async_usleep(50000);
     210                async_usleep(10000);
    221211        }
    222212        return EOK;
     
    355345        SETUP_TRANSFER_LIST(transfers_control, "CONTROL");
    356346        SETUP_TRANSFER_LIST(transfers_bulk, "BULK");
    357 #undef SETUP_TRANSFER_LIST
     347
    358348        transfer_list_set_next(&instance->transfers_interrupt,
    359349            &instance->transfers_isochronous);
     
    370360
    371361        return EOK;
     362#undef CHECK_RET_CLEAR_RETURN
    372363}
    373364/*----------------------------------------------------------------------------*/
  • uspace/drv/ohci/hc.h

    r6991188 r1a46610  
    6969        usb_endpoint_manager_t ep_manager;
    7070        fid_t interrupt_emulator;
    71         fibril_mutex_t guard;
    7271} hc_t;
    7372
  • uspace/drv/ohci/hw_struct/hcca.h

    r6991188 r1a46610  
    4343        uint32_t done_head;
    4444        uint32_t reserved[29];
    45 } __attribute__((packed, aligned)) hcca_t;
     45} __attribute__((packed)) hcca_t;
    4646
    4747#endif
  • uspace/drv/ohci/hw_struct/transfer_descriptor.c

    r6991188 r1a46610  
    5353        }
    5454        if (buffer != NULL) {
    55                 assert(size != 0);
    5655                instance->cbp = addr_to_phys(buffer);
    5756                instance->be = addr_to_phys(buffer + size - 1);
  • uspace/drv/ohci/hw_struct/transfer_descriptor.h

    r6991188 r1a46610  
    8686        int cc = (instance->status >> TD_STATUS_CC_SHIFT) & TD_STATUS_CC_MASK;
    8787        /* something went wrong, error code is set */
    88         if (cc != CC_NOACCESS1 && cc != CC_NOACCESS2) {
     88        if (cc != CC_NOACCESS1 && cc != CC_NOACCESS2 && cc != CC_NOERROR) {
    8989                return true;
    9090        }
  • uspace/drv/ohci/main.c

    r6991188 r1a46610  
    9292int main(int argc, char *argv[])
    9393{
    94         usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
     94        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    9595        sleep(5);
    9696        return ddf_driver_main(&ohci_driver);
  • uspace/drv/ohci/ohci_regs.h

    r6991188 r1a46610  
    100100#define HCCA_PTR_MASK 0xffffff00 /* HCCA is 256B aligned */
    101101
    102         /** Currently executed periodic endpoint */
    103         const volatile uint32_t periodic_current;
     102        /** Currently executed period endpoint */
     103        const volatile uint32_t period_current;
    104104
    105105        /** The first control endpoint */
  • uspace/drv/ohci/transfer_list.c

    r6991188 r1a46610  
    7979        assert(instance);
    8080        assert(next);
     81        /* Set both queue_head.next to point to the follower */
    8182        ed_append_ed(instance->list_head, next->list_head);
    8283}
     
    124125                batch, instance->name, first, batch_ed(first));
    125126        if (last_ed == instance->list_head) {
    126                 usb_log_debug2("%s head ED(%p-%p): %x:%x:%x:%x.\n",
    127                     instance->name, last_ed, instance->list_head_pa,
    128                     last_ed->status, last_ed->td_tail, last_ed->td_head,
    129                     last_ed->next);
     127                usb_log_debug2("%s head ED: %x:%x:%x:%x.\n", instance->name,
     128                        last_ed->status, last_ed->td_tail, last_ed->td_head,
     129                        last_ed->next);
    130130        }
    131131        fibril_mutex_unlock(&instance->guard);
  • uspace/drv/ohci/utils/malloc32.h

    r6991188 r1a46610  
    4141#include <as.h>
    4242
     43#define UHCI_STRCUTURES_ALIGNMENT 16
    4344#define UHCI_REQUIRED_PAGE_SIZE 4096
    4445
     
    6465 */
    6566static inline void * malloc32(size_t size)
    66         { return memalign(size, size); }
     67        { return memalign(UHCI_STRCUTURES_ALIGNMENT, size); }
    6768/*----------------------------------------------------------------------------*/
    6869/** Physical mallocator simulator
Note: See TracChangeset for help on using the changeset viewer.