Changeset 48ae3ef in mainline for uspace/drv/bus
- Timestamp:
- 2011-10-28T21:52:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57e06ef
- Parents:
- 7265558
- Location:
- uspace/drv/bus/usb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r7265558 r48ae3ef 142 142 if (ret != EOK) { \ 143 143 usb_log_error(message); \ 144 usb_endpoint_manager_unregister_ep( \ 145 &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH);\ 144 usb_endpoint_manager_remove_ep( \ 145 &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH, \ 146 NULL, NULL);\ 146 147 usb_device_manager_release( \ 147 148 &instance->generic.dev_manager, hub_address); \ … … 150 151 int ret = usb_endpoint_manager_add_ep( 151 152 &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH, 152 USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 0 );153 USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 0, NULL, NULL); 153 154 CHECK_RET_UNREG_RETURN(ret, 154 155 "Failed to register root hub control endpoint: %s.\n", … … 197 198 instance->generic.schedule = hc_schedule; 198 199 instance->generic.ep_add_hook = ohci_endpoint_init; 200 instance->generic.ep_remove_hook = ohci_endpoint_fini; 199 201 200 202 ret = hc_init_memory(instance); -
uspace/drv/bus/usb/ohci/ohci_endpoint.c
r7265558 r48ae3ef 62 62 } 63 63 /*----------------------------------------------------------------------------*/ 64 /** Disposes hcd endpoint structure65 *66 * @param[in] hcd_ep endpoint structure67 */68 static void ohci_endpoint_fini(endpoint_t *ep)69 {70 ohci_endpoint_t *instance = ep->hc_data.data;71 hc_dequeue_endpoint(instance->hcd->private_data, ep);72 if (instance) {73 free32(instance->ed);74 free32(instance->td);75 free(instance);76 }77 }78 /*----------------------------------------------------------------------------*/79 64 /** Creates new hcd endpoint representation. 80 65 * … … 104 89 ed_init(ohci_ep->ed, ep, ohci_ep->td); 105 90 endpoint_set_hc_data( 106 ep, ohci_ep, ohci_e ndpoint_fini, ohci_ep_toggle_get, ohci_ep_toggle_set);91 ep, ohci_ep, ohci_ep_toggle_get, ohci_ep_toggle_set); 107 92 ohci_ep->hcd = hcd; 108 93 hc_enqueue_endpoint(hcd->private_data, ep); 109 94 return EOK; 110 95 } 96 /*----------------------------------------------------------------------------*/ 97 /** Disposes hcd endpoint structure 98 * 99 * @param[in] hcd_ep endpoint structure 100 */ 101 void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep) 102 { 103 assert(hcd); 104 assert(ep); 105 ohci_endpoint_t *instance = ohci_endpoint_get(ep); 106 hc_dequeue_endpoint(hcd->private_data, ep); 107 if (instance) { 108 free32(instance->ed); 109 free32(instance->td); 110 free(instance); 111 } 112 endpoint_clear_hc_data(ep); 113 } 111 114 /** 112 115 * @} -
uspace/drv/bus/usb/ohci/ohci_endpoint.h
r7265558 r48ae3ef 56 56 57 57 int ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep); 58 void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep); 58 59 59 60 /** Get and convert assigned ohci_endpoint_t structure -
uspace/drv/bus/usb/vhc/connhost.c
r7265558 r48ae3ef 140 140 size_t max_packet_size, unsigned int interval) 141 141 { 142 /* TODO: Use usb_endpoint_manager_add_ep */ 143 VHC_DATA(vhc, fun); 144 145 endpoint_t *ep = endpoint_create( 146 address, endpoint, direction, transfer_type, USB_SPEED_FULL, 1, 0); 147 if (ep == NULL) { 148 return ENOMEM; 149 } 150 151 int rc = usb_endpoint_manager_register_ep(&vhc->ep_manager, ep, 1); 152 if (rc != EOK) { 153 endpoint_destroy(ep); 154 return rc; 155 } 156 157 return EOK; 142 VHC_DATA(vhc, fun); 143 144 return usb_endpoint_manager_add_ep(&vhc->ep_manager, 145 address, endpoint, direction, transfer_type, USB_SPEED_FULL, 1, 0, 146 NULL, NULL); 147 158 148 } 159 149 … … 171 161 VHC_DATA(vhc, fun); 172 162 173 int rc = usb_endpoint_manager_ unregister_ep(&vhc->ep_manager,174 address, endpoint, direction );163 int rc = usb_endpoint_manager_remove_ep(&vhc->ep_manager, 164 address, endpoint, direction, NULL, NULL); 175 165 176 166 return rc; … … 413 403 VHC_DATA(vhc, fun); 414 404 415 endpoint_t *ep = usb_endpoint_manager_ get_ep(&vhc->ep_manager,405 endpoint_t *ep = usb_endpoint_manager_find_ep(&vhc->ep_manager, 416 406 target.address, target.endpoint, USB_DIRECTION_IN); 417 407 if (ep == NULL) { … … 455 445 VHC_DATA(vhc, fun); 456 446 457 endpoint_t *ep = usb_endpoint_manager_ get_ep(&vhc->ep_manager,447 endpoint_t *ep = usb_endpoint_manager_find_ep(&vhc->ep_manager, 458 448 target.address, target.endpoint, USB_DIRECTION_OUT); 459 449 if (ep == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.