Changeset 56fd7cf in mainline for uspace/lib/usbdev/src
- Timestamp:
- 2012-08-17T11:37:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d5a540
- Parents:
- be2a38ad
- Location:
- uspace/lib/usbdev/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
rbe2a38ad r56fd7cf 105 105 if (dev == NULL) { 106 106 usb_log_error("USB device `%s' structure allocation failed.\n", 107 gen_dev->name);107 ddf_dev_get_name(gen_dev)); 108 108 return ENOMEM; 109 109 } … … 114 114 if (rc != EOK) { 115 115 usb_log_error("USB device `%s' init failed (%s): %s.\n", 116 gen_dev->name, err_msg, str_error(rc));116 ddf_dev_get_name(gen_dev), err_msg, str_error(rc)); 117 117 return rc; 118 118 } … … 139 139 return ENOTSUP; 140 140 /* Just tell the driver to stop whatever it is doing */ 141 usb_device_t *usb_dev = gen_dev->driver_data;141 usb_device_t *usb_dev = ddf_dev_data_get(gen_dev); 142 142 const int ret = driver->ops->device_rem(usb_dev); 143 143 if (ret != EOK) … … 160 160 if (driver->ops->device_gone == NULL) 161 161 return ENOTSUP; 162 usb_device_t *usb_dev = gen_dev->driver_data;162 usb_device_t *usb_dev = ddf_dev_data_get(gen_dev); 163 163 const int ret = driver->ops->device_gone(usb_dev); 164 164 if (ret == EOK) … … 415 415 usb_address_t address; 416 416 417 int rc = usb_get_info_by_handle(ddf_dev ->handle,417 int rc = usb_get_info_by_handle(ddf_dev_get_handle(ddf_dev), 418 418 &hc_handle, &address, &usb_dev->interface_no); 419 419 if (rc != EOK) { -
uspace/lib/usbdev/src/devpoll.c
rbe2a38ad r56fd7cf 80 80 usb_log_debug("Poll%p: started polling of `%s' - " \ 81 81 "interface %d (%s,%d,%d), %zuB/%zu.\n", 82 data, d ata->dev->ddf_dev->name,82 data, ddf_dev_get_name(data->dev->ddf_dev), 83 83 (int) mapping->interface->interface_number, 84 84 usb_str_class(mapping->interface->interface_class), … … 159 159 if (failed) { 160 160 usb_log_error("Polling of device `%s' terminated: " 161 "recurring failures.\n", data->dev->ddf_dev->name); 161 "recurring failures.\n", ddf_dev_get_name( 162 data->dev->ddf_dev)); 162 163 } else { 163 164 usb_log_debug("Polling of device `%s' terminated: " 164 "driver request.\n", data->dev->ddf_dev->name); 165 "driver request.\n", ddf_dev_get_name( 166 data->dev->ddf_dev)); 165 167 } 166 168 } -
uspace/lib/usbdev/src/hub.c
rbe2a38ad r56fd7cf 63 63 return EBADMEM; 64 64 return usb_hc_bind_address(connection, 65 attached_device->address, attached_device->fun->handle);65 attached_device->address, ddf_fun_get_handle(attached_device->fun)); 66 66 } 67 67 … … 287 287 rc = usb_hub_register_device(hc_conn, &new_device); 288 288 if (rc != EOK) { 289 /* We know nothing about that data. */290 if (new_dev_data)291 child_fun->driver_data = NULL;292 289 /* The child function is already created. */ 293 290 ddf_fun_destroy(child_fun); -
uspace/lib/usbdev/src/recognise.c
rbe2a38ad r56fd7cf 33 33 * Functions for recognition of attached devices. 34 34 */ 35 36 /** XXX Fix this */ 37 #define _DDF_DATA_IMPLANT 35 38 36 39 #include <sys/types.h> … … 352 355 353 356 if (dev_ops != NULL) 354 child->ops = dev_ops;357 ddf_fun_set_ops(child, dev_ops); 355 358 else 356 child->ops = &child_ops; 357 358 child->driver_data = dev_data; 359 ddf_fun_set_ops(child, &child_ops); 360 361 ddf_fun_data_implant(child, dev_data); 362 359 363 /* 360 364 * Store the attached device in fun … … 373 377 } 374 378 375 rc = usb_device_create_match_ids(ctrl_pipe, &child->match_ids); 379 match_id_list_t match_ids; 380 init_match_ids(&match_ids); 381 rc = usb_device_create_match_ids(ctrl_pipe, &match_ids); 376 382 if (rc != EOK) 377 383 goto failure; 384 385 list_foreach(match_ids.ids, id_link) { 386 match_id_t *match_id = list_get_instance(id_link, match_id_t, link); 387 rc = ddf_fun_add_match_id(child, match_id->id, match_id->score); 388 if (rc != EOK) { 389 clean_match_ids(&match_ids); 390 goto failure; 391 } 392 } 393 394 clean_match_ids(&match_ids); 378 395 379 396 rc = ddf_fun_bind(child); … … 386 403 failure: 387 404 if (child != NULL) { 388 /* We know nothing about the data if it came from outside. */389 if (dev_data)390 child->driver_data = NULL;391 392 405 /* This takes care of match_id deallocation as well. */ 393 406 ddf_fun_destroy(child);
Note:
See TracChangeset
for help on using the changeset viewer.