Changeset 56257ba in mainline for uspace/lib/usbhost/include
- Timestamp:
- 2018-01-07T01:01:42Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63431db2
- Parents:
- 9efad54
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:41)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:42)
- Location:
- uspace/lib/usbhost/include/usb/host
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/bus.h
r9efad54 r56257ba 76 76 usb_speed_t speed; 77 77 usb_address_t address; 78 endpoint_t *endpoints [USB_ENDPOINT_MAX]; 78 79 79 80 /* Managing bus */ … … 101 102 int (*reserve_default_address)(bus_t *, usb_speed_t); 102 103 int (*release_default_address)(bus_t *); 103 int (*reset_toggle)(bus_t *, usb_target_t, toggle_reset_mode_t);104 104 105 105 /* Operations on device */ … … 108 108 int (*device_online)(device_t *); /**< Optional */ 109 109 int (*device_offline)(device_t *); /**< Optional */ 110 endpoint_t *(*device_find_endpoint)(device_t*, usb_target_t, usb_direction_t);111 110 endpoint_t *(*endpoint_create)(device_t *, const usb_endpoint_descriptors_t *); 112 111 … … 115 114 int (*endpoint_unregister)(endpoint_t *); 116 115 void (*endpoint_destroy)(endpoint_t *); /**< Optional */ 117 bool (*endpoint_get_toggle)(endpoint_t *); /**< Optional */ 118 void (*endpoint_set_toggle)(endpoint_t *, bool); /**< Optional */ 119 ssize_t (*endpoint_count_bw) (endpoint_t *, size_t); 116 void (*endpoint_toggle_reset)(endpoint_t *); /**< Optional */ 117 ssize_t (*endpoint_count_bw) (endpoint_t *, size_t); /**< Optional */ 120 118 usb_transfer_batch_t *(*batch_create)(endpoint_t *); /**< Optional */ 121 119 … … 164 162 165 163 int bus_endpoint_add(device_t *, const usb_endpoint_descriptors_t *, endpoint_t **); 166 endpoint_t *bus_find_endpoint(device_t *, usb_ target_t, usb_direction_t);164 endpoint_t *bus_find_endpoint(device_t *, usb_endpoint_t); 167 165 int bus_endpoint_remove(endpoint_t *); 168 166 … … 170 168 int bus_release_default_address(bus_t *); 171 169 172 int bus_reset_toggle(bus_t *, usb_target_t, bool);173 174 170 #endif 175 171 /** -
uspace/lib/usbhost/include/usb/host/endpoint.h
r9efad54 r56257ba 62 62 /** Reserved bandwidth. */ 63 63 size_t bandwidth; 64 /** Value of the toggle bit. */64 /** Value of the toggle bit. Untouched by the library. */ 65 65 unsigned toggle:1; 66 66 /** The currently active transfer batch. Write using methods, read under guard. */ … … 107 107 void endpoint_abort(endpoint_t *); 108 108 109 /* Manage the toggle bit */110 extern int endpoint_toggle_get(endpoint_t *);111 extern void endpoint_toggle_set(endpoint_t *, bool);112 113 109 /* Calculate bandwidth */ 114 110 ssize_t endpoint_count_bw(endpoint_t *, size_t); -
uspace/lib/usbhost/include/usb/host/usb2_bus.h
r9efad54 r56257ba 50 50 bus_t base; /**< Inheritance - keep this first */ 51 51 52 /* Device bookkeeping*/53 struct {54 usb_speed_t speed; /**< Device speed */ 55 bool occupied; /**< The address is in use.*/56 // TODO: This can be stored in usb2_bus-specific device_t57 list_t endpoint_list; /**< Store endpoint_t instances */58 } devices[USB_ADDRESS_COUNT];52 /** The speed which reserved default address. Invalid unless reserved. */ 53 usb_speed_t default_address_speed; 54 55 /** Map of occupied addresses */ 56 bool address_occupied [USB_ADDRESS_COUNT]; 57 /** The last reserved address */ 58 usb_address_t last_address; 59 59 60 60 /** Size of the bandwidth pool */ 61 61 size_t free_bw; 62 /** The last reserved address */63 usb_address_t last_address;64 62 } usb2_bus_t; 65 63 -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r9efad54 r56257ba 111 111 void usb_transfer_batch_init(usb_transfer_batch_t *, endpoint_t *); 112 112 113 /** Call after status is known, but before releasing endpoint */114 int usb_transfer_batch_reset_toggle(usb_transfer_batch_t *);115 116 113 /** Batch finalization. */ 117 114 void usb_transfer_batch_abort(usb_transfer_batch_t *);
Note:
See TracChangeset
for help on using the changeset viewer.