Changeset 90dd59d in mainline for uspace/drv/bus/usb/ohci/batch.c


Ignore:
Timestamp:
2011-08-25T13:04:59Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
23b0fe8
Parents:
4f0e510
Message:

ohci: implement schedule function, finish batch initialization

File:
1 edited

Legend:

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

    r4f0e510 r90dd59d  
    4343#include "hw_struct/endpoint_descriptor.h"
    4444#include "hw_struct/transfer_descriptor.h"
     45/*
     46static void batch_control_write(usb_transfer_batch_t *instance);
     47static void batch_control_read(usb_transfer_batch_t *instance);
     48
     49static void batch_interrupt_in(usb_transfer_batch_t *instance);
     50static void batch_interrupt_out(usb_transfer_batch_t *instance);
     51
     52static void batch_bulk_in(usb_transfer_batch_t *instance);
     53static void batch_bulk_out(usb_transfer_batch_t *instance);
     54*/
     55static void batch_setup_control(usb_transfer_batch_t *batch)
     56{
     57        // TODO Find a better way to do this
     58        if (batch->setup_buffer[0] & (1 << 7))
     59                batch_control_read(batch);
     60        else
     61                batch_control_write(batch);
     62}
     63
     64void (*batch_setup[4][3])(usb_transfer_batch_t*) =
     65{
     66        { NULL, NULL, batch_setup_control },
     67        { NULL, NULL, NULL },
     68        { batch_bulk_in, batch_bulk_out, NULL },
     69        { batch_interrupt_in, batch_interrupt_out, NULL },
     70};
     71
    4572
    4673/** OHCI specific data required for USB transfer */
     
    140167                batch->data_buffer = data->device_buffer + batch->setup_size;
    141168        }
     169
     170        assert(batch_setup[batch->ep->transfer_type][batch->ep->direction]);
     171        batch_setup[batch->ep->transfer_type][batch->ep->direction](batch);
    142172
    143173        return EOK;
Note: See TracChangeset for help on using the changeset viewer.