Changes in uspace/lib/drv/include/usbhc_iface.h [41df71f9:d4da860] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/include/usbhc_iface.h
r41df71f9 rd4da860 1 1 /* 2 2 * Copyright (c) 2010 Vojtech Horky 3 * Copyright (c) 201 7 Ondrej Hlavaty3 * Copyright (c) 2011 Jan Vesely 4 4 * All rights reserved. 5 5 * … … 32 32 * @{ 33 33 */ 34 34 35 /** @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. 37 37 */ 38 38 … … 41 41 42 42 #include "ddf/driver.h" 43 #include < async.h>44 #include < usb/usb.h>43 #include <usb_iface.h> 44 #include <stdbool.h> 45 45 46 extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t); 47 extern int usbhc_release_default_address(async_exch_t *); 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); 48 50 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. */ 52 typedef void (*usbhc_iface_transfer_out_callback_t)(int, void *); 51 53 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. */ 55 typedef void (*usbhc_iface_transfer_in_callback_t)(int, size_t, void *); 58 56 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. */ 58 typedef 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; 61 64 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;83 65 84 66 #endif
Note:
See TracChangeset
for help on using the changeset viewer.