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