Ignore:
File:
1 edited

Legend:

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

    r41df71f9 rd4da860  
    11/*
    22 * Copyright (c) 2010 Vojtech Horky
    3  * Copyright (c) 2017 Ondrej Hlavaty
     3 * Copyright (c) 2011 Jan Vesely
    44 * All rights reserved.
    55 *
     
    3232 * @{
    3333 */
     34
    3435/** @file
    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.
     36 * @brief USB host controller interface definition.
    3737 */
    3838
     
    4141
    4242#include "ddf/driver.h"
    43 #include <async.h>
    44 #include <usb/usb.h>
     43#include <usb_iface.h>
     44#include <stdbool.h>
    4545
    46 extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t);
    47 extern int usbhc_release_default_address(async_exch_t *);
     46extern int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
     47    uint64_t, void *, size_t, size_t *);
     48extern int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
     49    uint64_t, const void *, size_t);
    4850
    49 extern int usbhc_device_enumerate(async_exch_t *, unsigned port);
    50 extern int usbhc_device_remove(async_exch_t *, unsigned port);
     51/** Callback for outgoing transfer. */
     52typedef void (*usbhc_iface_transfer_out_callback_t)(int, void *);
    5153
    52 extern int usbhc_register_endpoint(async_exch_t *, usb_endpoint_desc_t *);
    53 extern int usbhc_unregister_endpoint(async_exch_t *, usb_endpoint_desc_t *);
    54 extern int usbhc_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
    55     size_t *);
    56 extern int usbhc_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *,
    57     size_t);
     54/** Callback for incoming transfer. */
     55typedef void (*usbhc_iface_transfer_in_callback_t)(int, size_t, void *);
    5856
    59 /** Defined in usb/host/usb_transfer_batch.h */
    60 typedef struct usb_transfer_batch usb_transfer_batch_t;
     57/** USB host controller communication interface. */
     58typedef 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 *);
     63} usbhc_iface_t;
    6164
    62 /** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */
    63 typedef int (*usbhc_iface_transfer_callback_t)(usb_transfer_batch_t *);
    64 
    65 /** USB device communication interface. */
    66 typedef struct {
    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 *);
    82 } usbhc_iface_t;
    8365
    8466#endif
Note: See TracChangeset for help on using the changeset viewer.