Changeset d8b275d in mainline for uspace/lib/usb/src/host/endpoint.c
- Timestamp:
- 2011-04-14T08:24:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5e07e2b5
- Parents:
- 3f2af64 (diff), 34e8bab (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/host/endpoint.c
r3f2af64 rd8b275d 53 53 fibril_mutex_initialize(&instance->guard); 54 54 fibril_condvar_initialize(&instance->avail); 55 endpoint_clear_hc_data(instance); 55 56 return EOK; 56 57 } … … 61 62 assert(!instance->active); 62 63 free(instance); 64 } 65 /*----------------------------------------------------------------------------*/ 66 void endpoint_set_hc_data(endpoint_t *instance, 67 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 68 { 69 assert(instance); 70 instance->hc_data.data = data; 71 instance->hc_data.toggle_get = toggle_get; 72 instance->hc_data.toggle_set = toggle_set; 73 } 74 /*----------------------------------------------------------------------------*/ 75 void endpoint_clear_hc_data(endpoint_t *instance) 76 { 77 assert(instance); 78 instance->hc_data.data = NULL; 79 instance->hc_data.toggle_get = NULL; 80 instance->hc_data.toggle_set = NULL; 63 81 } 64 82 /*----------------------------------------------------------------------------*/ … … 85 103 { 86 104 assert(instance); 105 if (instance->hc_data.toggle_get) 106 instance->toggle = 107 instance->hc_data.toggle_get(instance->hc_data.data); 87 108 return (int)instance->toggle; 88 109 } … … 92 113 assert(instance); 93 114 assert(toggle == 0 || toggle == 1); 115 if (instance->hc_data.toggle_set) 116 instance->hc_data.toggle_set(instance->hc_data.data, toggle); 94 117 instance->toggle = toggle; 95 118 } … … 99 122 assert(instance); 100 123 if (instance->address == target.address && 101 instance->endpoint == target.endpoint)124 (instance->endpoint == target.endpoint || target.endpoint == 0)) 102 125 instance->toggle = 0; 103 126 }
Note:
See TracChangeset
for help on using the changeset viewer.