Changes in uspace/drv/bus/usb/ohci/hc.c [7de1988c:b5111c46] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r7de1988c rb5111c46 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 node 259 260 * @param[in] regs Device's I/O registers range. 260 261 * @param[in] interrupts True if w interrupts should be used 261 262 * @return Error code 262 263 */ 263 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts)264 int hc_init(hc_t *instance, ddf_fun_t *fun, addr_range_t *regs, bool interrupts) 264 265 { 265 266 assert(instance); … … 274 275 list_initialize(&instance->pending_batches); 275 276 276 hcd_init(&instance->generic, USB_SPEED_FULL, 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, 277 284 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 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;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; 282 289 283 290 rc = hc_init_memory(instance);
Note:
See TracChangeset
for help on using the changeset viewer.