Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hc.c

    ra5b3de6 r8d2dd7f2  
    4747#include <usb/usb.h>
    4848
    49 #include "ohci_bus.h"
     49#include "ohci_endpoint.h"
    5050#include "ohci_batch.h"
    5151
     
    8989};
    9090
     91static void hc_gain_control(hc_t *instance);
     92static void hc_start(hc_t *instance);
    9193static int hc_init_transfer_lists(hc_t *instance);
    9294static int hc_init_memory(hc_t *instance);
     
    101103 * @return Error code.
    102104 */
    103 int ohci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
     105int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)
    104106{
    105107        assert(code);
     
    149151 * @return Error code
    150152 */
    151 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res)
     153int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts)
    152154{
    153155        assert(instance);
     
    170172        list_initialize(&instance->pending_batches);
    171173        fibril_mutex_initialize(&instance->guard);
     174        instance->hw_interrupts = interrupts;
    172175
    173176        ret = hc_init_memory(instance);
     
    178181                return ret;
    179182        }
     183
     184        hc_gain_control(instance);
     185
     186        ohci_rh_init(&instance->rh, instance->registers, "ohci rh");
     187        hc_start(instance);
    180188
    181189        return EOK;
     
    287295
    288296        /* Check for root hub communication */
    289         if (batch->target.address == ohci_rh_get_address(&instance->rh)) {
     297        if (batch->ep->address == ohci_rh_get_address(&instance->rh)) {
    290298                usb_log_debug("OHCI root hub request.\n");
    291299                return ohci_rh_schedule(&instance->rh, batch);
     
    294302        if (!ohci_batch)
    295303                return ENOMEM;
    296 
    297         const int err = ohci_transfer_batch_prepare(ohci_batch);
    298         if (err)
    299                 return err;
    300304
    301305        fibril_mutex_lock(&instance->guard);
     
    350354                            ohci_transfer_batch_from_link(current);
    351355
    352                         if (ohci_transfer_batch_check_completed(batch)) {
     356                        if (ohci_transfer_batch_is_complete(batch)) {
    353357                                list_remove(current);
    354                                 usb_transfer_batch_finish(&batch->base);
     358                                ohci_transfer_batch_finish_dispose(batch);
    355359                        }
    356360
     
    439443void hc_start(hc_t *instance)
    440444{
    441         ohci_rh_init(&instance->rh, instance->registers, "ohci rh");
    442 
    443445        /* OHCI guide page 42 */
    444446        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.