Ignore:
File:
1 edited

Legend:

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

    r8d2dd7f2 r5fd9c30  
    4747#include <usb/usb.h>
    4848
    49 #include "ohci_endpoint.h"
     49#include "ohci_bus.h"
    5050#include "ohci_batch.h"
    5151
     
    8989};
    9090
    91 static void hc_gain_control(hc_t *instance);
    92 static void hc_start(hc_t *instance);
    9391static int hc_init_transfer_lists(hc_t *instance);
    9492static int hc_init_memory(hc_t *instance);
     
    103101 * @return Error code.
    104102 */
    105 int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)
     103int ohci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
    106104{
    107105        assert(code);
     
    151149 * @return Error code
    152150 */
    153 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts)
     151int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res)
    154152{
    155153        assert(instance);
     
    172170        list_initialize(&instance->pending_batches);
    173171        fibril_mutex_initialize(&instance->guard);
    174         instance->hw_interrupts = interrupts;
    175172
    176173        ret = hc_init_memory(instance);
     
    181178                return ret;
    182179        }
    183 
    184         hc_gain_control(instance);
    185 
    186         ohci_rh_init(&instance->rh, instance->registers, "ohci rh");
    187         hc_start(instance);
    188180
    189181        return EOK;
     
    295287
    296288        /* Check for root hub communication */
    297         if (batch->ep->address == ohci_rh_get_address(&instance->rh)) {
     289        if (batch->ep->target.address == ohci_rh_get_address(&instance->rh)) {
    298290                usb_log_debug("OHCI root hub request.\n");
    299291                return ohci_rh_schedule(&instance->rh, batch);
     
    302294        if (!ohci_batch)
    303295                return ENOMEM;
     296
     297        const int err = ohci_transfer_batch_prepare(ohci_batch);
     298        if (err)
     299                return err;
    304300
    305301        fibril_mutex_lock(&instance->guard);
     
    354350                            ohci_transfer_batch_from_link(current);
    355351
    356                         if (ohci_transfer_batch_is_complete(batch)) {
     352                        if (ohci_transfer_batch_check_completed(batch)) {
    357353                                list_remove(current);
    358                                 ohci_transfer_batch_finish_dispose(batch);
     354                                usb_transfer_batch_finish(&batch->base);
    359355                        }
    360356
     
    443439void hc_start(hc_t *instance)
    444440{
     441        ohci_rh_init(&instance->rh, instance->registers, "ohci rh");
     442
    445443        /* OHCI guide page 42 */
    446444        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.