Changeset c83a55c in mainline for uspace/lib/usbhost/include/usb/host/endpoint.h
- Timestamp:
- 2011-10-31T06:52:54Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c25e39b
- Parents:
- e8ab32f (diff), 3ce78580 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
re8ab32f rc83a55c 36 36 #define LIBUSBHOST_HOST_ENDPOINT_H 37 37 38 #include <assert.h>39 38 #include <bool.h> 40 39 #include <adt/list.h> 41 40 #include <fibril_synch.h> 42 43 41 #include <usb/usb.h> 44 42 43 /** Host controller side endpoint structure. */ 45 44 typedef struct endpoint { 45 /** Part of linked list. */ 46 link_t link; 47 /** USB address. */ 46 48 usb_address_t address; 49 /** USB endpoint number. */ 47 50 usb_endpoint_t endpoint; 51 /** Communication direction. */ 48 52 usb_direction_t direction; 53 /** USB transfer type. */ 49 54 usb_transfer_type_t transfer_type; 55 /** Communication speed. */ 50 56 usb_speed_t speed; 57 /** Maximum size of data packets. */ 51 58 size_t max_packet_size; 59 /** Necessary bandwidth. */ 60 size_t bandwidth; 61 /** Value of the toggle bit. */ 52 62 unsigned toggle:1; 63 /** True if there is a batch using this scheduled for this endpoint. */ 64 volatile bool active; 65 /** Protects resources and active status changes. */ 53 66 fibril_mutex_t guard; 67 /** Signals change of active status. */ 54 68 fibril_condvar_t avail; 55 volatile bool active; 56 void (*destroy_hook)(struct endpoint *); 69 /** Optional device specific data. */ 57 70 struct { 71 /** Device specific data. */ 58 72 void *data; 73 /** Callback to get the value of toggle bit. */ 59 74 int (*toggle_get)(void *); 75 /** Callback to set the value of toggle bit. */ 60 76 void (*toggle_set)(void *, int); 61 77 } hc_data; 62 78 } endpoint_t; 63 79 64 endpoint_t * endpoint_ get(usb_address_t address, usb_endpoint_t endpoint,80 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 65 81 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 66 size_t max_packet_size); 67 82 size_t max_packet_size, size_t bw); 68 83 void endpoint_destroy(endpoint_t *instance); 69 84 70 85 void endpoint_set_hc_data(endpoint_t *instance, 71 void *data, void (*destroy_hook)(endpoint_t *), 72 int (*toggle_get)(void *), void (*toggle_set)(void *, int)); 73 86 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)); 74 87 void endpoint_clear_hc_data(endpoint_t *instance); 75 88 76 89 void endpoint_use(endpoint_t *instance); 77 78 90 void endpoint_release(endpoint_t *instance); 79 91 80 92 int endpoint_toggle_get(endpoint_t *instance); 81 82 93 void endpoint_toggle_set(endpoint_t *instance, int toggle); 83 94 84 void endpoint_toggle_reset_filtered(endpoint_t *instance, usb_target_t target); 95 /** list_get_instance wrapper. 96 * @param item Pointer to link member. 97 * @return Pointer to enpoint_t structure. 98 */ 99 static inline endpoint_t * endpoint_get_instance(link_t *item) 100 { 101 return list_get_instance(item, endpoint_t, link); 102 } 85 103 #endif 86 104 /**
Note:
See TracChangeset
for help on using the changeset viewer.