Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/usbhc_iface.h

    rd4da860 r41df71f9  
    11/*
    22 * Copyright (c) 2010 Vojtech Horky
    3  * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2017 Ondrej Hlavaty
    44 * All rights reserved.
    55 *
     
    3232 * @{
    3333 */
    34 
    3534/** @file
    36  * @brief USB host controller interface definition.
     35 * @brief USB host controler interface definition. This is the interface of
     36 * USB host controller function, which can be used by usb device drivers.
    3737 */
    3838
     
    4141
    4242#include "ddf/driver.h"
    43 #include <usb_iface.h>
    44 #include <stdbool.h>
     43#include <async.h>
     44#include <usb/usb.h>
    4545
    46 extern int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
    47     uint64_t, void *, size_t, size_t *);
    48 extern int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
    49     uint64_t, const void *, size_t);
     46extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t);
     47extern int usbhc_release_default_address(async_exch_t *);
    5048
    51 /** Callback for outgoing transfer. */
    52 typedef void (*usbhc_iface_transfer_out_callback_t)(int, void *);
     49extern int usbhc_device_enumerate(async_exch_t *, unsigned port);
     50extern int usbhc_device_remove(async_exch_t *, unsigned port);
    5351
    54 /** Callback for incoming transfer. */
    55 typedef void (*usbhc_iface_transfer_in_callback_t)(int, size_t, void *);
     52extern int usbhc_register_endpoint(async_exch_t *, usb_endpoint_desc_t *);
     53extern int usbhc_unregister_endpoint(async_exch_t *, usb_endpoint_desc_t *);
     54extern int usbhc_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
     55    size_t *);
     56extern int usbhc_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *,
     57    size_t);
    5658
    57 /** USB host controller communication interface. */
     59/** Defined in usb/host/usb_transfer_batch.h */
     60typedef struct usb_transfer_batch usb_transfer_batch_t;
     61
     62/** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */
     63typedef int (*usbhc_iface_transfer_callback_t)(usb_transfer_batch_t *);
     64
     65/** USB device communication interface. */
    5866typedef struct {
    59         int (*read)(ddf_fun_t *, usb_target_t, uint64_t, uint8_t *, size_t,
    60             usbhc_iface_transfer_in_callback_t, void *);
    61         int (*write)(ddf_fun_t *, usb_target_t, uint64_t, const uint8_t *,
    62             size_t, usbhc_iface_transfer_out_callback_t, void *);
     67        int (*reserve_default_address)(ddf_fun_t *, usb_speed_t);
     68        int (*release_default_address)(ddf_fun_t *);
     69
     70        int (*device_enumerate)(ddf_fun_t *, unsigned);
     71        int (*device_remove)(ddf_fun_t *, unsigned);
     72
     73        int (*register_endpoint)(ddf_fun_t *, usb_endpoint_desc_t *);
     74        int (*unregister_endpoint)(ddf_fun_t *, usb_endpoint_desc_t *);
     75
     76        int (*read)(ddf_fun_t *, usb_target_t,
     77                uint64_t, char *, size_t,
     78                usbhc_iface_transfer_callback_t, void *);
     79        int (*write)(ddf_fun_t *, usb_target_t,
     80                uint64_t, const char *, size_t,
     81                usbhc_iface_transfer_callback_t, void *);
    6382} usbhc_iface_t;
    64 
    6583
    6684#endif
Note: See TracChangeset for help on using the changeset viewer.