Changes in uspace/lib/usbhost/src/endpoint.c [8d2e251:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r8d2e251 r9d58539 33 33 */ 34 34 35 #include <usb/host/endpoint.h>36 37 35 #include <assert.h> 38 36 #include <stdlib.h> 37 #include <errno.h> 38 #include <usb/host/endpoint.h> 39 39 40 40 /** Allocate ad initialize endpoint_t structure. … … 50 50 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 51 51 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 52 size_t max_packet_size, size_t bw , usb_address_t tt_address, unsigned tt_p)52 size_t max_packet_size, size_t bw) 53 53 { 54 54 endpoint_t *instance = malloc(sizeof(endpoint_t)); … … 63 63 instance->toggle = 0; 64 64 instance->active = false; 65 instance->tt.address = tt_address;66 instance->tt.port = tt_p;67 65 instance->hc_data.data = NULL; 68 66 instance->hc_data.toggle_get = NULL; … … 74 72 return instance; 75 73 } 76 74 /*----------------------------------------------------------------------------*/ 77 75 /** Properly dispose of endpoint_t structure. 78 76 * @param instance endpoint_t structure. … … 86 84 free(instance); 87 85 } 88 86 /*----------------------------------------------------------------------------*/ 89 87 /** Set device specific data and hooks. 90 88 * @param instance endpoint_t structure. … … 103 101 fibril_mutex_unlock(&instance->guard); 104 102 } 105 103 /*----------------------------------------------------------------------------*/ 106 104 /** Clear device specific data and hooks. 107 105 * @param instance endpoint_t structure. … … 111 109 { 112 110 assert(instance); 113 endpoint_set_hc_data(instance, NULL, NULL, NULL); 111 fibril_mutex_lock(&instance->guard); 112 instance->hc_data.data = NULL; 113 instance->hc_data.toggle_get = NULL; 114 instance->hc_data.toggle_set = NULL; 115 fibril_mutex_unlock(&instance->guard); 114 116 } 115 117 /*----------------------------------------------------------------------------*/ 116 118 /** Mark the endpoint as active and block access for further fibrils. 117 119 * @param instance endpoint_t structure. … … 126 128 fibril_mutex_unlock(&instance->guard); 127 129 } 128 130 /*----------------------------------------------------------------------------*/ 129 131 /** Mark the endpoint as inactive and allow access for further fibrils. 130 132 * @param instance endpoint_t structure. … … 138 140 fibril_condvar_signal(&instance->avail); 139 141 } 140 142 /*----------------------------------------------------------------------------*/ 141 143 /** Get the value of toggle bit. 142 144 * @param instance endpoint_t structure. … … 154 156 return ret; 155 157 } 156 158 /*----------------------------------------------------------------------------*/ 157 159 /** Set the value of toggle bit. 158 160 * @param instance endpoint_t structure.
Note:
See TracChangeset
for help on using the changeset viewer.