Changeset 7aaed09 in mainline for uspace/drv/bus/usb/ohci/hc.c
- Timestamp:
- 2011-12-18T14:02:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c868e2d
- Parents:
- 3b71e84d (diff), 1761268 (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/drv/bus/usb/ohci/hc.c
r3b71e84d r7aaed09 127 127 assert(hub_fun); 128 128 129 const usb_address_t hub_address = 130 usb_device_manager_get_free_address( 131 &instance->generic.dev_manager, USB_SPEED_FULL); 132 if (hub_address <= 0) { 129 /* Try to get address 1 for root hub. */ 130 instance->rh.address = 1; 131 int ret = usb_device_manager_request_address( 132 &instance->generic.dev_manager, &instance->rh.address, false, 133 USB_SPEED_FULL); 134 if (ret != EOK) { 133 135 usb_log_error("Failed to get OHCI root hub address: %s\n", 134 str_error(hub_address)); 135 return hub_address; 136 } 137 instance->rh.address = hub_address; 138 usb_device_manager_bind( 139 &instance->generic.dev_manager, hub_address, hub_fun->handle); 136 str_error(ret)); 137 return ret; 138 } 139 usb_device_manager_bind_address(&instance->generic.dev_manager, 140 instance->rh.address, hub_fun->handle); 140 141 141 142 #define CHECK_RET_UNREG_RETURN(ret, message...) \ … … 143 144 usb_log_error(message); \ 144 145 usb_endpoint_manager_remove_ep( \ 145 &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH, \146 NULL, NULL);\147 usb_device_manager_release ( \148 &instance->generic.dev_manager, hub_address); \146 &instance->generic.ep_manager, instance->rh.address, 0, \ 147 USB_DIRECTION_BOTH, NULL, NULL); \ 148 usb_device_manager_release_address( \ 149 &instance->generic.dev_manager, instance->rh.address); \ 149 150 return ret; \ 150 151 } else (void)0 151 int ret = usb_endpoint_manager_add_ep( 152 &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH, 153 USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 0, NULL, NULL); 152 ret = usb_endpoint_manager_add_ep( 153 &instance->generic.ep_manager, instance->rh.address, 0, 154 USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 155 0, NULL, NULL); 154 156 CHECK_RET_UNREG_RETURN(ret, 155 157 "Failed to register root hub control endpoint: %s.\n", … … 193 195 list_initialize(&instance->pending_batches); 194 196 195 hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11,196 bandwidth_count_usb11);197 hcd_init(&instance->generic, USB_SPEED_FULL, 198 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 197 199 instance->generic.private_data = instance; 198 200 instance->generic.schedule = hc_schedule;
Note:
See TracChangeset
for help on using the changeset viewer.