Changeset 32e093e in mainline
- Timestamp:
- 2011-08-25T10:17:06Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b02308e
- Parents:
- 1a02517
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hcd_endpoint.c
r1a02517 r32e093e 88 88 ed_init(hcd_ep->ed, ep); 89 89 ed_set_td(hcd_ep->ed, hcd_ep->td); 90 endpoint_set_hc_data(ep, hcd_ep, hcd_ep_toggle_get, hcd_ep_toggle_set); 90 endpoint_set_hc_data( 91 ep, hcd_ep, NULL, hcd_ep_toggle_get, hcd_ep_toggle_set); 91 92 92 93 return hcd_ep; -
uspace/lib/usbhost/include/usb/host/endpoint.h
r1a02517 r32e093e 56 56 struct { 57 57 void *data; 58 void (*data_dtor)(void*); 58 59 int (*toggle_get)(void *); 59 60 void (*toggle_set)(void *, int); … … 68 69 69 70 void endpoint_set_hc_data(endpoint_t *instance, 70 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)); 71 void *data, void (*data_dtor)(void *), 72 int (*toggle_get)(void *), void (*toggle_set)(void *, int)); 71 73 72 74 void endpoint_clear_hc_data(endpoint_t *instance); -
uspace/lib/usbhost/src/endpoint.c
r1a02517 r32e093e 53 53 instance->toggle = 0; 54 54 instance->active = false; 55 instance->hc_data.data = NULL; 56 instance->hc_data.data_dtor = NULL; 57 instance->hc_data.toggle_get = NULL; 58 instance->hc_data.toggle_set = NULL; 55 59 fibril_mutex_initialize(&instance->guard); 56 60 fibril_condvar_initialize(&instance->avail); … … 64 68 assert(instance); 65 69 assert(!instance->active); 70 if (instance->hc_data.data) { 71 assert(instance->hc_data.data_dtor); 72 instance->hc_data.data_dtor(instance->hc_data.data); 73 } 66 74 free(instance); 67 75 } 68 76 /*----------------------------------------------------------------------------*/ 69 77 void endpoint_set_hc_data(endpoint_t *instance, 70 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 78 void *data, void (*data_dtor)(void *), 79 int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 71 80 { 72 81 assert(instance); 73 82 instance->hc_data.data = data; 83 instance->hc_data.data_dtor = data_dtor; 74 84 instance->hc_data.toggle_get = toggle_get; 75 85 instance->hc_data.toggle_set = toggle_set;
Note:
See TracChangeset
for help on using the changeset viewer.