Changeset 41924f30 in mainline for uspace/lib/usbhost/include/usb/host/endpoint.h
- Timestamp:
- 2017-10-12T14:07:27Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5976973
- Parents:
- 7e74911
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
Note:
See TracChangeset
for help on using the changeset viewer.