Changeset 41924f30 in mainline for uspace/lib/usbhost/include
- Timestamp:
- 2017-10-12T14:07:27Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5976973
- Parents:
- 7e74911
- Location:
- uspace/lib/usbhost/include/usb/host
- Files:
-
- 3 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
r7e74911 r41924f30 38 38 39 39 #include <usb/host/hcd.h> 40 #include <usb/host/ usb_bus.h>40 #include <usb/host/bus.h> 41 41 #include <usb/usb.h> 42 42 … … 76 76 int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver); 77 77 78 int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed, 79 size_t bw, bw_count_func_t bw_count); 78 int hcd_ddf_setup_hc(ddf_dev_t *device); 80 79 void hcd_ddf_clean_hc(ddf_dev_t *device); 81 80 int hcd_ddf_setup_root_hub(ddf_dev_t *device); -
uspace/lib/usbhost/include/usb/host/endpoint.h
r7e74911 r41924f30 32 32 /** @file 33 33 * 34 * Endpoint structure is tightly coupled to the bus. The bus controls the 35 * life-cycle of endpoint. In order to keep endpoints lightweight, operations 36 * on endpoints are part of the bus structure. 37 * 34 38 */ 35 39 #ifndef LIBUSBHOST_HOST_ENDPOINT_H … … 42 46 #include <atomic.h> 43 47 48 typedef struct bus bus_t; 49 44 50 /** Host controller side endpoint structure. */ 45 51 typedef struct endpoint { 52 /** Managing bus */ 53 bus_t *bus; 46 54 /** Reference count. */ 47 55 atomic_t refcnt; … … 49 57 link_t link; 50 58 /** USB address. */ 51 usb_address_t address; 52 /** USB endpoint number. */ 53 usb_endpoint_t endpoint; 59 usb_target_t target; 54 60 /** Communication direction. */ 55 61 usb_direction_t direction; … … 62 68 /** Additional opportunities per uframe */ 63 69 unsigned packets; 64 /** Necessarybandwidth. */70 /** Reserved bandwidth. */ 65 71 size_t bandwidth; 66 72 /** Value of the toggle bit. */ 67 73 unsigned toggle:1; 68 74 /** True if there is a batch using this scheduled for this endpoint. */ 69 volatilebool active;75 bool active; 70 76 /** Protects resources and active status changes. */ 71 77 fibril_mutex_t guard; … … 77 83 unsigned port; 78 84 } tt; 79 /** Optional device specific data. */ 80 struct { 81 /** Device specific data. */ 82 void *data; 83 /** Callback to get the value of toggle bit. */ 84 int (*toggle_get)(void *); 85 /** Callback to set the value of toggle bit. */ 86 void (*toggle_set)(void *, int); 87 /** Device slot id. */ 88 uint8_t slot_id; 89 } hc_data; 85 86 /* This structure is meant to be extended by overriding. */ 90 87 } endpoint_t; 91 88 92 extern endpoint_t *endpoint_create(usb_address_t, usb_endpoint_t, 93 usb_direction_t, usb_transfer_type_t, usb_speed_t, size_t, unsigned int, 94 size_t, usb_address_t, unsigned int); 95 extern void endpoint_destroy(endpoint_t *); 89 extern void endpoint_init(endpoint_t *, bus_t *); 96 90 97 91 extern void endpoint_add_ref(endpoint_t *); 98 92 extern void endpoint_del_ref(endpoint_t *); 99 100 extern void endpoint_set_hc_data(endpoint_t *, void *, int (*)(void *),101 void (*)(void *, int));102 extern void endpoint_clear_hc_data(endpoint_t *);103 93 104 94 extern void endpoint_use(endpoint_t *); … … 106 96 107 97 extern int endpoint_toggle_get(endpoint_t *); 108 extern void endpoint_toggle_set(endpoint_t *, int);98 extern void endpoint_toggle_set(endpoint_t *, unsigned); 109 99 110 100 /** list_get_instance wrapper. -
uspace/lib/usbhost/include/usb/host/hcd.h
r7e74911 r41924f30 38 38 39 39 #include <usb/host/endpoint.h> 40 #include <usb/host/ usb_bus.h>40 #include <usb/host/bus.h> 41 41 #include <usb/host/usb_transfer_batch.h> 42 42 #include <usb/usb.h> … … 71 71 struct hcd { 72 72 /** Endpoint manager. */ 73 usb_bus_tbus;73 bus_t *bus; 74 74 75 75 /** Interrupt replacement fibril */ … … 78 78 /** Driver implementation */ 79 79 hcd_ops_t ops; 80 80 81 /** Device specific driver data. */ 81 82 void * driver_data; 82 83 }; 83 84 84 extern void hcd_init(hcd_t * , usb_speed_t, size_t, bw_count_func_t);85 extern void hcd_init(hcd_t *); 85 86 86 87 static inline void hcd_set_implementation(hcd_t *hcd, void *data, 87 const hcd_ops_t *ops )88 const hcd_ops_t *ops, bus_t *bus) 88 89 { 89 90 assert(hcd); … … 91 92 hcd->driver_data = data; 92 93 hcd->ops = *ops; 94 hcd->bus = bus; 93 95 } else { 94 96 memset(&hcd->ops, 0, sizeof(hcd->ops)); -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r7e74911 r41924f30 90 90 */ 91 91 #define USB_TRANSFER_BATCH_ARGS(batch) \ 92 (batch).ep-> address, (batch).ep->endpoint, \92 (batch).ep->target.address, (batch).ep->target.endpoint, \ 93 93 usb_str_speed((batch).ep->speed), \ 94 94 usb_str_transfer_type_short((batch).ep->transfer_type), \
Note:
See TracChangeset
for help on using the changeset viewer.