Changeset c24c157d in mainline for uspace/lib/usbdev/src


Ignore:
Timestamp:
2011-12-12T11:59:35Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1a38701
Parents:
899f1a9
Message:

libusb, libusbdev: Provide generic usb_get_info_by_handle function.

Add separate wrappers for host controller handle, address and interface number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devdrv.c

    r899f1a9 rc24c157d  
    484484        usb_dev->pipes = NULL;
    485485
     486        /* Get assigned params */
     487        devman_handle_t hc_handle;
     488        usb_address_t address;
     489
     490        int rc = usb_get_info_by_handle(ddf_dev->handle,
     491            &hc_handle, &address, &usb_dev->interface_no);
     492        if (rc != EOK) {
     493                *errstr_ptr = "device parameters retrieval";
     494                return rc;
     495        }
     496
    486497        /* Initialize hc connection. */
    487         usb_hc_connection_initialize_from_device(&usb_dev->hc_conn, ddf_dev);
    488         const usb_address_t address =
    489             usb_get_address_by_handle(ddf_dev->handle);
     498        usb_hc_connection_initialize(&usb_dev->hc_conn, hc_handle);
    490499
    491500        /* Initialize backing wire and control pipe. */
    492         int rc = usb_device_connection_initialize(
     501        rc = usb_device_connection_initialize(
    493502            &usb_dev->wire, &usb_dev->hc_conn, address);
    494503        if (rc != EOK) {
     
    512521        }
    513522
    514         /* Get our interface. */
    515         usb_dev->interface_no = usb_device_get_assigned_interface(ddf_dev);
    516523        /* Retrieve standard descriptors. */
    517524        rc = usb_device_retrieve_descriptors(
Note: See TracChangeset for help on using the changeset viewer.