Changes in uspace/drv/bus/usb/ohci/hc.c [b5111c46:7de1988c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
rb5111c46 r7de1988c 193 193 instance->rh.address = 1; 194 194 rc = usb_device_manager_request_address( 195 &instance->generic ->dev_manager, &instance->rh.address, false,195 &instance->generic.dev_manager, &instance->rh.address, false, 196 196 USB_SPEED_FULL); 197 197 if (rc != EOK) { … … 204 204 205 205 rc = usb_endpoint_manager_add_ep( 206 &instance->generic ->ep_manager, instance->rh.address, 0,206 &instance->generic.ep_manager, instance->rh.address, 0, 207 207 USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 208 208 0, NULL, NULL); … … 231 231 fun_bound = true; 232 232 233 rc = usb_device_manager_bind_address(&instance->generic ->dev_manager,233 rc = usb_device_manager_bind_address(&instance->generic.dev_manager, 234 234 instance->rh.address, ddf_fun_get_handle(hub_fun)); 235 235 if (rc != EOK) { … … 244 244 if (ep_added) { 245 245 usb_endpoint_manager_remove_ep( 246 &instance->generic ->ep_manager, instance->rh.address, 0,246 &instance->generic.ep_manager, instance->rh.address, 0, 247 247 USB_DIRECTION_BOTH, NULL, NULL); 248 248 } 249 249 if (addr_reqd) { 250 250 usb_device_manager_release_address( 251 &instance->generic ->dev_manager, instance->rh.address);251 &instance->generic.dev_manager, instance->rh.address); 252 252 } 253 253 return rc; … … 257 257 * 258 258 * @param[in] instance Memory place for the structure. 259 * @param[in] HC function node260 259 * @param[in] regs Device's I/O registers range. 261 260 * @param[in] interrupts True if w interrupts should be used 262 261 * @return Error code 263 262 */ 264 int hc_init(hc_t *instance, ddf_fun_t *fun,addr_range_t *regs, bool interrupts)263 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts) 265 264 { 266 265 assert(instance); … … 275 274 list_initialize(&instance->pending_batches); 276 275 277 instance->generic = ddf_fun_data_alloc(fun, sizeof(hcd_t)); 278 if (instance->generic == NULL) { 279 usb_log_error("Out of memory.\n"); 280 return ENOMEM; 281 } 282 283 hcd_init(instance->generic, USB_SPEED_FULL, 276 hcd_init(&instance->generic, USB_SPEED_FULL, 284 277 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 285 instance->generic ->private_data = instance;286 instance->generic ->schedule = hc_schedule;287 instance->generic ->ep_add_hook = ohci_endpoint_init;288 instance->generic ->ep_remove_hook = ohci_endpoint_fini;278 instance->generic.private_data = instance; 279 instance->generic.schedule = hc_schedule; 280 instance->generic.ep_add_hook = ohci_endpoint_init; 281 instance->generic.ep_remove_hook = ohci_endpoint_fini; 289 282 290 283 rc = hc_init_memory(instance);
Note:
See TracChangeset
for help on using the changeset viewer.