Changeset 0ef03d7 in mainline for uspace/lib


Ignore:
Timestamp:
2012-12-21T11:19:18Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
daf59d1
Parents:
53332b5b
Message:

libusbhost: Add speed and bw parameters to hcd_ddf_setup_device.

Location:
uspace/lib/usbhost
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/ddf_helpers.h

    r53332b5b r0ef03d7  
    4343    usb_address_t address, usb_speed_t speed, const char *name,
    4444    const match_id_list_t *mids);
    45 int hcd_ddf_setup_device(ddf_dev_t *device, ddf_fun_t **fun);
     45int hcd_ddf_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun,
     46    usb_speed_t max_speed, size_t bw, bw_count_func_t bw_count);
    4647int hcd_ddf_setup_hub(hcd_t *instance, usb_address_t *address, ddf_dev_t *dev);
    4748
  • uspace/lib/usbhost/src/ddf_helpers.c

    r53332b5b r0ef03d7  
    176176        assert(device);
    177177
     178        const usb_speed_t speed = instance->dev_manager.max_speed;
     179
    178180        int ret = usb_device_manager_request_address(&instance->dev_manager,
    179             address, false, USB_SPEED_FULL);
     181            address, false, speed);
    180182        if (ret != EOK) {
    181183                usb_log_error("Failed to get root hub address: %s\n",
     
    197199        ret = usb_endpoint_manager_add_ep(
    198200            &instance->ep_manager, *address, 0,
    199             USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64,
     201            USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, speed, 64,
    200202            0, NULL, NULL);
    201203        CHECK_RET_UNREG_RETURN(ret,
     
    209211
    210212        ret = hcd_ddf_add_device(
    211             instance, device, *address, USB_SPEED_FULL, "rh", &mid_list);
     213            instance, device, *address, speed, "rh", &mid_list);
    212214        CHECK_RET_UNREG_RETURN(ret,
    213215            "Failed to add hcd device: %s.\n", str_error(ret));
     
    227229 *  - registers interrupt handler
    228230 */
    229 int hcd_ddf_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun)
     231int hcd_ddf_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun,
     232    usb_speed_t max_speed, size_t bw, bw_count_func_t bw_count)
    230233{
    231234        if (device == NULL)
     
    257260            "Failed to allocate HCD structure: %s.\n", str_error(ret));
    258261
    259         hcd_init(hcd, USB_SPEED_FULL, BANDWIDTH_AVAILABLE_USB11,
    260             bandwidth_count_usb11);
     262        hcd_init(hcd, max_speed, bw, bw_count);
    261263
    262264        ret = ddf_fun_bind(instance->hc_fun);
Note: See TracChangeset for help on using the changeset viewer.