Changeset 1ab8539 in mainline for uspace/lib/usbdev/src/hub.c


Ignore:
Timestamp:
2014-11-14T19:16:23Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5042706
Parents:
9696b01
Message:

remove system.uptime sysinfo entry since it is redundant
cleanup the time handling routines

  • still more cleanup is needed here, the code is a wild combination of quasi-POSIX API (with all the brain-dead types, etc.) and HelenOS API
File:
1 edited

Legend:

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

    r9696b01 r1ab8539  
    162162        if (hc_conn == NULL)
    163163                return EINVAL;
    164 
    165         int rc;
     164       
    166165        struct timeval start_time;
    167 
    168         rc = gettimeofday(&start_time, NULL);
    169         if (rc != EOK) {
     166        gettimeofday(&start_time, NULL);
     167       
     168        /* We are gona do a lot of communication better open it in advance. */
     169        int rc = usb_hc_connection_open(hc_conn);
     170        if (rc != EOK)
    170171                return rc;
    171         }
    172 
    173         /* We are gona do a lot of communication better open it in advance. */
    174         rc = usb_hc_connection_open(hc_conn);
    175         if (rc != EOK) {
    176                 return rc;
    177         }
    178 
     172       
    179173        /* Request a new address. */
    180174        usb_address_t dev_addr =
     
    226220                goto leave_release_default_address;
    227221        }
    228 
     222       
    229223        struct timeval end_time;
    230         rc = gettimeofday(&end_time, NULL);
    231         if (rc != EOK) {
    232                 goto leave_release_default_address;
    233         }
    234 
     224        gettimeofday(&end_time, NULL);
     225       
    235226        /* According to the USB spec part 9.1.2 host allows 100ms time for
    236227         * the insertion process to complete. According to 7.1.7.1 this is the
Note: See TracChangeset for help on using the changeset viewer.