Changeset 062165f in mainline for uspace/lib/usbdev/src/hub.c


Ignore:
Timestamp:
2011-10-31T16:15:54Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f37eb84
Parents:
1b17e37
Message:

libusbdev: Ask for default address before registering endpoint 0.

File:
1 edited

Legend:

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

    r1b17e37 r062165f  
    254254
    255255        do {
    256                 rc = usb_pipe_register_with_speed(&ctrl_pipe, dev_speed, 0,
    257                     &hc_conn);
    258                 if (rc != EOK) {
     256                rc = usb_hc_request_address(&hc_conn, USB_ADDRESS_DEFAULT,
     257                    true, dev_speed);
     258                if (rc != USB_ADDRESS_DEFAULT) {
    259259                        /* Do not overheat the CPU ;-). */
    260260                        async_usleep(ENDPOINT_0_0_REGISTER_ATTEMPT_DELAY_USEC);
    261261                }
    262         } while (rc != EOK);
     262        } while (rc == ENOENT);
     263        if (rc != EOK) {
     264                goto leave_release_free_address;
     265        }
     266
     267        rc = usb_pipe_register_with_speed(&ctrl_pipe, dev_speed, 0, &hc_conn);
     268        if (rc != EOK) {
     269                rc = ENOTCONN;
     270                goto leave_release_default_address;
     271        }
     272
    263273        struct timeval end_time;
    264274
Note: See TracChangeset for help on using the changeset viewer.