Changeset 592369ae in mainline
- Timestamp:
- 2011-04-13T13:09:18Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a6fde4
- Parents:
- 5a2c42b
- Location:
- uspace/drv/ohci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
r5a2c42b r592369ae 152 152 hcd_endpoint_t *hcd_ep = hcd_endpoint_assign(ep); 153 153 if (hcd_ep == NULL) { 154 free(ep);154 endpoint_destroy(ep); 155 155 return ENOMEM; 156 156 } … … 158 158 ret = usb_endpoint_manager_register_ep(&instance->ep_manager, ep, size); 159 159 if (ret != EOK) { 160 hcd_endpoint_clear(ep); 160 161 endpoint_destroy(ep); 161 162 return ret; … … 188 189 } 189 190 190 return ret;191 return EOK; 191 192 } 192 193 /*----------------------------------------------------------------------------*/ … … 194 195 usb_endpoint_t endpoint, usb_direction_t direction) 195 196 { 197 assert(instance); 198 fibril_mutex_lock(&instance->guard); 196 199 endpoint_t *ep = usb_endpoint_manager_get_ep(&instance->ep_manager, 197 200 address, endpoint, direction, NULL); 198 201 if (ep == NULL) { 199 usb_log_error("Endpoint unregister failed.\n"); 202 usb_log_error("Endpoint unregister failed: No such EP.\n"); 203 fibril_mutex_unlock(&instance->guard); 200 204 return ENOENT; 201 205 } … … 232 236 usb_log_warning("Endpoint without hcd equivalent structure.\n"); 233 237 } 234 returnusb_endpoint_manager_unregister_ep(&instance->ep_manager,238 int ret = usb_endpoint_manager_unregister_ep(&instance->ep_manager, 235 239 address, endpoint, direction); 240 fibril_mutex_unlock(&instance->guard); 241 return ret; 242 } 243 /*----------------------------------------------------------------------------*/ 244 endpoint_t * hc_get_endpoint(hc_t *instance, usb_address_t address, 245 usb_endpoint_t endpoint, usb_direction_t direction, size_t *bw) 246 { 247 assert(instance); 248 fibril_mutex_lock(&instance->guard); 249 endpoint_t *ep = usb_endpoint_manager_get_ep(&instance->ep_manager, 250 address, endpoint, direction, bw); 251 fibril_mutex_unlock(&instance->guard); 252 return ep; 236 253 } 237 254 /*----------------------------------------------------------------------------*/ -
uspace/drv/ohci/hc.h
r5a2c42b r592369ae 85 85 usb_endpoint_t endpoint, usb_direction_t direction); 86 86 87 endpoint_t * hc_get_endpoint(hc_t *instance, usb_address_t address, 88 usb_endpoint_t endpoint, usb_direction_t direction, size_t *bw); 89 87 90 int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch); 88 91 -
uspace/drv/ohci/iface.c
r5a2c42b r592369ae 55 55 56 56 size_t res_bw; 57 endpoint_t *ep = usb_endpoint_manager_get_ep(&(*hc)->ep_manager,57 endpoint_t *ep = hc_get_endpoint(*hc, 58 58 target.address, target.endpoint, direction, &res_bw); 59 59 if (ep == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.