Ignore:
File:
1 edited

Legend:

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

    r17873ac7 r8d2dd7f2  
    5050#include <usb/usb.h>
    5151#include <usb/host/utils/malloc32.h>
    52 #include <usb/host/bandwidth.h>
    5352
    5453#include "uhci_batch.h"
     
    107106 * @return Error code.
    108107 */
    109 int uhci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
     108int uhci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)
    110109{
    111110        assert(code);
     
    177176                        uhci_transfer_batch_t *batch =
    178177                            uhci_transfer_batch_from_link(current);
    179                         usb_transfer_batch_finish(&batch->base);
     178                        uhci_transfer_batch_finish_dispose(batch);
    180179                }
    181180        }
     
    215214 * interrupt fibrils.
    216215 */
    217 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res)
     216int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts)
    218217{
    219218        assert(instance);
     
    223222            return EINVAL;
    224223
     224        instance->hw_interrupts = interrupts;
    225225        instance->hw_failures = 0;
    226226
     
    246246        }
    247247
    248         return EOK;
    249 }
    250 
    251 void hc_start(hc_t *instance)
    252 {
    253248        hc_init_hw(instance);
    254249        (void)hc_debug_checker;
    255250
    256251        uhci_rh_init(&instance->rh, instance->registers->ports, "uhci");
     252
     253        return EOK;
    257254}
    258255
     
    309306}
    310307
    311 static usb_transfer_batch_t *create_transfer_batch(bus_t *bus, endpoint_t *ep)
    312 {
    313         uhci_transfer_batch_t *batch = uhci_transfer_batch_create(ep);
    314         return &batch->base;
    315 }
    316 
    317 static void destroy_transfer_batch(usb_transfer_batch_t *batch)
    318 {
    319         uhci_transfer_batch_destroy(uhci_transfer_batch_get(batch));
    320 }
    321 
    322308/** Initialize UHCI hc memory structures.
    323309 *
     
    332318int hc_init_mem_structures(hc_t *instance)
    333319{
    334         int err;
    335         assert(instance);
    336 
    337         if ((err = usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11)))
    338                 return err;
    339 
    340         instance->bus.base.ops.create_batch = create_transfer_batch;
    341         instance->bus.base.ops.destroy_batch = destroy_transfer_batch;
     320        assert(instance);
    342321
    343322        /* Init USB frame list page */
     
    461440        assert(batch);
    462441
    463         if (batch->target.address == uhci_rh_get_address(&instance->rh))
     442        if (batch->ep->address == uhci_rh_get_address(&instance->rh))
    464443                return uhci_rh_schedule(&instance->rh, batch);
    465444
    466         uhci_transfer_batch_t *uhci_batch = (uhci_transfer_batch_t *) batch;
     445        uhci_transfer_batch_t *uhci_batch = uhci_transfer_batch_get(batch);
    467446        if (!uhci_batch) {
    468447                usb_log_error("Failed to create UHCI transfer structures.\n");
    469448                return ENOMEM;
    470449        }
    471 
    472         const int err = uhci_transfer_batch_prepare(uhci_batch);
    473         if (err)
    474                 return err;
    475450
    476451        transfer_list_t *list =
Note: See TracChangeset for help on using the changeset viewer.