Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hc.h

    r8b54fe6 r1ef93fa  
    4141
    4242#include <usb/usb.h>
    43 #include <usb/host/hcd.h>
     43#include <usb/host/device_keeper.h>
     44#include <usb/host/usb_endpoint_manager.h>
     45#include <usbhc_iface.h>
    4446
    45 #include "ohci_batch.h"
     47#include "batch.h"
    4648#include "ohci_regs.h"
    4749#include "root_hub.h"
     
    5153/** Main OHCI driver structure */
    5254typedef struct hc {
    53         /** Generic USB hc driver */
    54         hcd_t generic;
     55        /** USB bus driver, devices and addresses */
     56        usb_device_keeper_t manager;
     57        /** USB bus driver, endpoints */
     58        usb_endpoint_manager_t ep_manager;
    5559
    5660        /** Memory mapped I/O registers area */
     
    7781int hc_get_irq_commands(
    7882    irq_cmd_t cmds[], size_t cmd_size, uintptr_t regs, size_t reg_size);
     83int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts);
    7984int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);
    80 int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts);
    8185
    8286/** Safely dispose host controller internal structures
     
    8488 * @param[in] instance Host controller structure to use.
    8589 */
    86 static inline void hc_fini(hc_t *instance) { /* TODO: implement*/ };
     90static inline void hc_fini(hc_t *instance)
     91        { /* TODO: implement*/ };
    8792
    88 void hc_enqueue_endpoint(hc_t *instance, endpoint_t *ep);
    89 void hc_dequeue_endpoint(hc_t *instance, endpoint_t *ep);
     93int hc_add_endpoint(hc_t *instance, usb_address_t address, usb_endpoint_t ep,
     94    usb_speed_t speed, usb_transfer_type_t type, usb_direction_t direction,
     95    size_t max_packet_size, size_t size, unsigned interval);
     96int hc_remove_endpoint(hc_t *instance, usb_address_t address,
     97    usb_endpoint_t endpoint, usb_direction_t direction);
     98endpoint_t * hc_get_endpoint(hc_t *instance, usb_address_t address,
     99    usb_endpoint_t endpoint, usb_direction_t direction, size_t *bw);
    90100
     101int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch);
    91102void hc_interrupt(hc_t *instance, uint32_t status);
     103
     104/** Get and cast pointer to the driver data
     105 *
     106 * @param[in] fun DDF function pointer
     107 * @return cast pointer to driver_data
     108 */
     109static inline hc_t * fun_to_hc(ddf_fun_t *fun)
     110        { return fun->driver_data; }
    92111#endif
    93112/**
Note: See TracChangeset for help on using the changeset viewer.