Ignore:
File:
1 edited

Legend:

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

    r5f94a0c r160b75e  
    2727 */
    2828
    29 /** @addtogroup libusb
     29/** @addtogroup libusbdev
    3030 * @{
    3131 */
     
    3333 * Functions needed by hub drivers.
    3434 */
    35 #include <usb/hub.h>
    36 #include <usb/pipes.h>
    37 #include <usb/request.h>
    38 #include <usb/recognise.h>
     35#include <usb/dev/hub.h>
     36#include <usb/dev/pipes.h>
     37#include <usb/dev/request.h>
     38#include <usb/dev/recognise.h>
    3939#include <usbhc_iface.h>
    4040#include <errno.h>
    4141#include <assert.h>
    4242#include <usb/debug.h>
    43 #include <time.h>
    4443
    4544/** How much time to wait between attempts to register endpoint 0:0.
     
    219218
    220219        int rc;
    221         struct timeval start_time;
    222 
    223         rc = gettimeofday(&start_time, NULL);
    224         if (rc != EOK) {
    225                 return rc;
    226         }
    227220
    228221        rc = usb_hc_connection_open(&hc_conn);
     
    271264                }
    272265        } while (rc != EOK);
    273         struct timeval end_time;
    274 
    275         rc = gettimeofday(&end_time, NULL);
    276         if (rc != EOK) {
    277                 goto leave_release_default_address;
    278         }
    279 
    280         /* According to the USB spec part 9.1.2 host allows 100ms time for
    281          * the insertion process to complete. According to 7.1.7.1 this is the
    282          * time between attach detected and port reset. However, the setup done
    283          * above might use much of this time so we should only wait to fill
    284          * up the 100ms quota*/
    285         suseconds_t elapsed = tv_sub(&end_time, &start_time);
    286         if (elapsed < 100000) {
    287                 async_usleep(100000 - elapsed);
    288         }
    289266
    290267        /*
     
    296273                goto leave_release_default_address;
    297274        }
    298         /* USB spec 7.1.7.1: The USB System Software guarantees a minimum of
    299          * 10ms for reset recovery. Device response to any bus transactions
    300          * addressed to the default device address during the reset recovery
    301          * time is undefined.
    302          */
    303         async_usleep(10000);
    304275
    305276        rc = usb_pipe_probe_default_control(&ctrl_pipe);
Note: See TracChangeset for help on using the changeset viewer.