Changeset 1b17e37 in mainline


Ignore:
Timestamp:
2011-10-31T16:15:01Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
062165f
Parents:
67f55e7b
Message:

libusbhost: Require all EP to have their address occupied before registering.

Including 0:0

Location:
uspace/lib/usbhost/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/iface.c

    r67f55e7b r1b17e37  
    190190        assert(hcd);
    191191        const size_t size = max_packet_size;
    192         /* Default address is not bound or registered,
    193          * thus it does not provide speed info. */
    194         usb_speed_t speed = ep_speed;
    195         /* NOTE The function will return EINVAL and won't
    196          * touch speed variable for default address */
    197         usb_device_manager_get_info_by_address(
     192        usb_speed_t speed = USB_SPEED_MAX;
     193        const int ret = usb_device_manager_get_info_by_address(
    198194            &hcd->dev_manager, address, NULL, &speed);
     195        if (ret != EOK) {
     196                return ret;
     197        }
    199198
    200199        usb_log_debug("Register endpoint %d:%d %s-%s %s %zuB %ums.\n",
  • uspace/lib/usbhost/src/usb_device_manager.c

    r67f55e7b r1b17e37  
    219219{
    220220        assert(instance);
    221         if ((address <= 0) || (address >= USB_ADDRESS_COUNT)) {
     221        if ((address < 0) || (address >= USB_ADDRESS_COUNT)) {
    222222                return EINVAL;
    223223        }
Note: See TracChangeset for help on using the changeset viewer.