Ignore:
File:
1 edited

Legend:

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

    ra7e2f0d ra9f91cd  
    4040#include "batch.h"
    4141#include "transfer_list.h"
    42 #include "uhci.h"
     42#include "uhci_hc.h"
    4343#include "utils/malloc32.h"
    4444
     
    100100        bzero(instance, sizeof(batch_t));
    101101
    102         instance->qh = malloc32(sizeof(queue_head_t));
     102        instance->qh = malloc32(sizeof(qh_t));
    103103        CHECK_NULL_DISPOSE_RETURN(instance->qh,
    104104            "Failed to allocate batch queue head.\n");
    105         queue_head_init(instance->qh);
     105        qh_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;
    118116
    119117        if (size > 0) {
     
    143141        instance->speed = speed;
    144142        instance->manager = manager;
    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));
     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));
    152147
    153148        usb_log_debug("Batch(%p) %d:%d memory structures ready.\n",
     
    177172                        usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
    178173                            instance, i, instance->tds[i].status);
     174                        td_print_status(&instance->tds[i]);
    179175
    180176                        device_keeper_set_toggle(instance->manager,
     
    318314                ++packet;
    319315        }
     316        td_set_ioc(&instance->tds[packet - 1]);
    320317        device_keeper_set_toggle(instance->manager, instance->target, toggle);
    321318}
     
    369366            0, 1, false, low_speed, instance->target, status_stage, NULL, NULL);
    370367
    371 
    372         instance->tds[packet].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
     368        td_set_ioc(&instance->tds[packet]);
    373369        usb_log_debug2("Control last TD status: %x.\n",
    374370            instance->tds[packet].status);
     
    454450{
    455451        assert(instance);
    456         uhci_t *hc = fun_to_uhci(instance->fun);
     452        uhci_hc_t *hc = fun_to_uhci_hc(instance->fun);
    457453        assert(hc);
    458         return uhci_schedule(hc, instance);
     454        return uhci_hc_schedule(hc, instance);
    459455}
    460456/**
Note: See TracChangeset for help on using the changeset viewer.