Ignore:
File:
1 edited

Legend:

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

    ra9f91cd ra7e2f0d  
    4040#include "batch.h"
    4141#include "transfer_list.h"
    42 #include "uhci_hc.h"
     42#include "uhci.h"
    4343#include "utils/malloc32.h"
    4444
     
    100100        bzero(instance, sizeof(batch_t));
    101101
    102         instance->qh = malloc32(sizeof(qh_t));
     102        instance->qh = malloc32(sizeof(queue_head_t));
    103103        CHECK_NULL_DISPOSE_RETURN(instance->qh,
    104104            "Failed to allocate batch queue head.\n");
    105         qh_init(instance->qh);
     105        queue_head_init(instance->qh);
    106106
    107107        instance->packets = (size + max_packet_size - 1) / max_packet_size;
     
    114114            instance->tds, "Failed to allocate transfer descriptors.\n");
    115115        bzero(instance->tds, sizeof(td_t) * instance->packets);
     116
     117//      const size_t transport_size = max_packet_size * instance->packets;
    116118
    117119        if (size > 0) {
     
    141143        instance->speed = speed;
    142144        instance->manager = manager;
    143         instance->callback_out = func_out;
    144         instance->callback_in = func_in;
    145 
    146         qh_set_element_td(instance->qh, addr_to_phys(instance->tds));
     145
     146        if (func_out)
     147                instance->callback_out = func_out;
     148        if (func_in)
     149                instance->callback_in = func_in;
     150
     151        queue_head_set_element_td(instance->qh, addr_to_phys(instance->tds));
    147152
    148153        usb_log_debug("Batch(%p) %d:%d memory structures ready.\n",
     
    172177                        usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
    173178                            instance, i, instance->tds[i].status);
    174                         td_print_status(&instance->tds[i]);
    175179
    176180                        device_keeper_set_toggle(instance->manager,
     
    314318                ++packet;
    315319        }
    316         td_set_ioc(&instance->tds[packet - 1]);
    317320        device_keeper_set_toggle(instance->manager, instance->target, toggle);
    318321}
     
    366369            0, 1, false, low_speed, instance->target, status_stage, NULL, NULL);
    367370
    368         td_set_ioc(&instance->tds[packet]);
     371
     372        instance->tds[packet].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
    369373        usb_log_debug2("Control last TD status: %x.\n",
    370374            instance->tds[packet].status);
     
    450454{
    451455        assert(instance);
    452         uhci_hc_t *hc = fun_to_uhci_hc(instance->fun);
     456        uhci_t *hc = fun_to_uhci(instance->fun);
    453457        assert(hc);
    454         return uhci_hc_schedule(hc, instance);
     458        return uhci_schedule(hc, instance);
    455459}
    456460/**
Note: See TracChangeset for help on using the changeset viewer.