Changeset a19a2d7 in mainline
- Timestamp:
- 2011-04-09T22:10:13Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- edc4c66, f11c288
- Parents:
- ba038f4
- Location:
- uspace/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/iface.c
rba038f4 ra19a2d7 74 74 name, target.address, target.endpoint, size, ep->max_packet_size); 75 75 76 assert(ep->speed == 77 usb_device_keeper_get_speed(&(*hc)->manager, target.address)); 78 // assert(ep->max_packet_size == max_packet_size); 79 // assert(ep->transfer_type == USB_TRANSFER_CONTROL); 80 81 *batch = 82 batch_get(fun, ep, data, size, setup_data, setup_size, 83 in, out, arg); 84 if (!batch) 76 *batch = batch_get( 77 fun, ep, data, size, setup_data, setup_size, in, out, arg); 78 if (!*batch) 85 79 return ENOMEM; 86 return EOK;87 }88 89 90 /** Reserve default address interface function91 *92 * @param[in] fun DDF function that was called.93 * @param[in] speed Speed to associate with the new default address.94 * @return Error code.95 */96 static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)97 {98 assert(fun);99 hc_t *hc = fun_to_hc(fun);100 assert(hc);101 usb_log_debug("Default address request with speed %d.\n", speed);102 usb_device_keeper_reserve_default_address(&hc->manager, speed);103 return EOK;104 #if 0105 endpoint_t *ep = malloc(sizeof(endpoint_t));106 if (ep == NULL)107 return ENOMEM;108 const size_t max_packet_size = speed == USB_SPEED_LOW ? 8 : 64;109 endpoint_init(ep, USB_TRANSFER_CONTROL, speed, max_packet_size);110 int ret;111 try_retgister:112 ret = usb_endpoint_manager_register_ep(&hc->ep_manager,113 USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH, ep, endpoint_destroy, 0);114 if (ret == EEXISTS) {115 async_usleep(1000);116 goto try_retgister;117 }118 if (ret != EOK) {119 endpoint_destroy(ep);120 }121 return ret;122 #endif123 }124 /*----------------------------------------------------------------------------*/125 /** Release default address interface function126 *127 * @param[in] fun DDF function that was called.128 * @return Error code.129 */130 static int release_default_address(ddf_fun_t *fun)131 {132 assert(fun);133 hc_t *hc = fun_to_hc(fun);134 assert(hc);135 usb_log_debug("Default address release.\n");136 // return usb_endpoint_manager_unregister_ep(&hc->ep_manager,137 // USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH);138 usb_device_keeper_release_default_address(&hc->manager);139 80 return EOK; 140 81 } … … 477 418 /*----------------------------------------------------------------------------*/ 478 419 usbhc_iface_t hc_iface = { 479 .reserve_default_address = reserve_default_address,480 .release_default_address = release_default_address,481 420 .request_address = request_address, 482 421 .bind_address = bind_address, -
uspace/drv/uhci-hcd/iface.c
rba038f4 ra19a2d7 74 74 name, target.address, target.endpoint, size, ep->max_packet_size); 75 75 76 // assert(ep->speed == 77 // usb_device_keeper_get_speed(&(*hc)->manager, target.address)); 78 // assert(ep->max_packet_size == max_packet_size); 79 // assert(ep->transfer_type == USB_TRANSFER_CONTROL); 80 81 *batch = 82 batch_get(fun, ep, data, size, setup_data, setup_size, 83 in, out, arg); 84 if (!batch) 76 *batch = batch_get( 77 fun, ep, data, size, setup_data, setup_size, in, out, arg); 78 if (!*batch) 85 79 return ENOMEM; 86 return EOK;87 }88 89 90 /** Reserve default address interface function91 *92 * @param[in] fun DDF function that was called.93 * @param[in] speed Speed to associate with the new default address.94 * @return Error code.95 */96 static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)97 {98 assert(fun);99 hc_t *hc = fun_to_hc(fun);100 assert(hc);101 usb_log_debug("Default address request with speed %d.\n", speed);102 usb_device_keeper_reserve_default_address(&hc->manager, speed);103 return EOK;104 #if 0105 endpoint_t *ep = malloc(sizeof(endpoint_t));106 if (ep == NULL)107 return ENOMEM;108 const size_t max_packet_size = speed == USB_SPEED_LOW ? 8 : 64;109 endpoint_init(ep, USB_TRANSFER_CONTROL, speed, max_packet_size);110 int ret;111 try_retgister:112 ret = usb_endpoint_manager_register_ep(&hc->ep_manager,113 USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH, ep, endpoint_destroy, 0);114 if (ret == EEXISTS) {115 async_usleep(1000);116 goto try_retgister;117 }118 if (ret != EOK) {119 endpoint_destroy(ep);120 }121 return ret;122 #endif123 }124 /*----------------------------------------------------------------------------*/125 /** Release default address interface function126 *127 * @param[in] fun DDF function that was called.128 * @return Error code.129 */130 static int release_default_address(ddf_fun_t *fun)131 {132 assert(fun);133 hc_t *hc = fun_to_hc(fun);134 assert(hc);135 usb_log_debug("Default address release.\n");136 // return usb_endpoint_manager_unregister_ep(&hc->ep_manager,137 // USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH);138 usb_device_keeper_release_default_address(&hc->manager);139 80 return EOK; 140 81 } … … 426 367 /*----------------------------------------------------------------------------*/ 427 368 usbhc_iface_t hc_iface = { 428 .reserve_default_address = reserve_default_address,429 .release_default_address = release_default_address,430 369 .request_address = request_address, 431 370 .bind_address = bind_address,
Note:
See TracChangeset
for help on using the changeset viewer.