Changeset 5fd9c30 in mainline for uspace/drv/bus/usb/xhci/transfers.h


Ignore:
Timestamp:
2017-10-21T20:52:56Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
766043c
Parents:
74b852b
Message:

usbhost refactoring: let transfer_batch be initialized by bus

Currently makes older HCs fail, work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/transfers.h

    r74b852b r5fd9c30  
    3434 */
    3535
     36#ifndef XHCI_TRANSFERS_H
     37#define XHCI_TRANSFERS_H
     38
     39#include <usb/host/usb_transfer_batch.h>
     40
    3641#include "hc.h"
    3742#include "trb_ring.h"
    3843
    3944typedef struct {
     45        usb_transfer_batch_t batch;
    4046        link_t link;
    4147
    42         uintptr_t interrupt_trb_phys;
    4348        uint8_t direction;
    4449
    45         usb_transfer_batch_t* batch;
     50        void* hc_buffer;                    /* Virtual address of the buffer start. */
     51        uintptr_t hc_buffer_phys;
    4652
    47         void* hc_buffer;                    /* Virtual address of the buffer start. */
     53        uintptr_t interrupt_trb_phys;
    4854} xhci_transfer_t;
    4955
     
    5157void xhci_fini_transfers(xhci_hc_t*);
    5258
    53 xhci_transfer_t* xhci_transfer_alloc(usb_transfer_batch_t*);
    54 void xhci_transfer_fini(xhci_transfer_t*);
     59xhci_transfer_t* xhci_transfer_create(endpoint_t *);
     60int xhci_transfer_schedule(xhci_hc_t*, usb_transfer_batch_t *);
     61int xhci_handle_transfer_event(xhci_hc_t*, xhci_trb_t*);
     62void xhci_transfer_destroy(xhci_transfer_t*);
    5563
    56 int xhci_handle_transfer_event(xhci_hc_t*, xhci_trb_t*);
     64static inline xhci_transfer_t *xhci_transfer_from_batch(usb_transfer_batch_t *batch)
     65{
     66        assert(batch);
     67        return (xhci_transfer_t *) batch;
     68}
    5769
    58 int xhci_schedule_control_transfer(xhci_hc_t*, usb_transfer_batch_t*);
    59 int xhci_schedule_bulk_transfer(xhci_hc_t*, usb_transfer_batch_t*);
    60 int xhci_schedule_interrupt_transfer(xhci_hc_t*, usb_transfer_batch_t*);
    61 int xhci_schedule_isochronous_transfer(xhci_hc_t* , usb_transfer_batch_t* );
     70/**
     71 * @}
     72 */
     73#endif
Note: See TracChangeset for help on using the changeset viewer.