Changes in uspace/lib/usbhost/src/endpoint.c [9d58539:4e732f1a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r9d58539 r4e732f1a 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, unsigned packets, size_t bw, 53 usb_address_t tt_address, unsigned tt_p) 53 54 { 54 55 endpoint_t *instance = malloc(sizeof(endpoint_t)); … … 60 61 instance->speed = speed; 61 62 instance->max_packet_size = max_packet_size; 63 instance->packets = packets; 62 64 instance->bandwidth = bw; 63 65 instance->toggle = 0; 64 66 instance->active = false; 67 instance->tt.address = tt_address; 68 instance->tt.port = tt_p; 65 69 instance->hc_data.data = NULL; 66 70 instance->hc_data.toggle_get = NULL; … … 72 76 return instance; 73 77 } 74 /*----------------------------------------------------------------------------*/ 78 75 79 /** Properly dispose of endpoint_t structure. 76 80 * @param instance endpoint_t structure. … … 84 88 free(instance); 85 89 } 86 /*----------------------------------------------------------------------------*/ 90 87 91 /** Set device specific data and hooks. 88 92 * @param instance endpoint_t structure. … … 101 105 fibril_mutex_unlock(&instance->guard); 102 106 } 103 /*----------------------------------------------------------------------------*/ 107 104 108 /** Clear device specific data and hooks. 105 109 * @param instance endpoint_t structure. … … 109 113 { 110 114 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); 115 endpoint_set_hc_data(instance, NULL, NULL, NULL); 116 116 } 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** Mark the endpoint as active and block access for further fibrils. 119 119 * @param instance endpoint_t structure. … … 128 128 fibril_mutex_unlock(&instance->guard); 129 129 } 130 /*----------------------------------------------------------------------------*/ 130 131 131 /** Mark the endpoint as inactive and allow access for further fibrils. 132 132 * @param instance endpoint_t structure. … … 140 140 fibril_condvar_signal(&instance->avail); 141 141 } 142 /*----------------------------------------------------------------------------*/ 142 143 143 /** Get the value of toggle bit. 144 144 * @param instance endpoint_t structure. … … 156 156 return ret; 157 157 } 158 /*----------------------------------------------------------------------------*/ 158 159 159 /** Set the value of toggle bit. 160 160 * @param instance endpoint_t structure.
Note:
See TracChangeset
for help on using the changeset viewer.