Changeset 620c710 in mainline for uspace/lib/usbhost
- Timestamp:
- 2011-08-25T14:21:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 961c29e8
- Parents:
- e20eaed
- Location:
- uspace/lib/usbhost
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
re20eaed r620c710 54 54 fibril_condvar_t avail; 55 55 volatile bool active; 56 void (*destroy_hook)(struct endpoint *); 56 57 struct { 57 58 void *data; 58 void (*data_dtor)(void*);59 59 int (*toggle_get)(void *); 60 60 void (*toggle_set)(void *, int); … … 69 69 70 70 void endpoint_set_hc_data(endpoint_t *instance, 71 void *data, void (*d ata_dtor)(void*),71 void *data, void (*destroy_hook)(endpoint_t *), 72 72 int (*toggle_get)(void *), void (*toggle_set)(void *, int)); 73 73 -
uspace/lib/usbhost/src/endpoint.c
re20eaed r620c710 53 53 instance->toggle = 0; 54 54 instance->active = false; 55 instance->destroy_hook = NULL; 55 56 instance->hc_data.data = NULL; 56 instance->hc_data.data_dtor = NULL;57 57 instance->hc_data.toggle_get = NULL; 58 58 instance->hc_data.toggle_set = NULL; … … 69 69 assert(!instance->active); 70 70 if (instance->hc_data.data) { 71 assert(instance-> hc_data.data_dtor);72 instance-> hc_data.data_dtor(instance->hc_data.data);71 assert(instance->destroy_hook); 72 instance->destroy_hook(instance); 73 73 } 74 74 free(instance); … … 76 76 /*----------------------------------------------------------------------------*/ 77 77 void endpoint_set_hc_data(endpoint_t *instance, 78 void *data, void (*d ata_dtor)(void*),78 void *data, void (*destroy_hook)(endpoint_t *), 79 79 int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 80 80 { 81 81 assert(instance); 82 instance->destroy_hook = destroy_hook; 82 83 instance->hc_data.data = data; 83 instance->hc_data.data_dtor = data_dtor;84 84 instance->hc_data.toggle_get = toggle_get; 85 85 instance->hc_data.toggle_set = toggle_set;
Note:
See TracChangeset
for help on using the changeset viewer.