Changes in uspace/lib/usbdev/src/hub.c [5f94a0c:160b75e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/hub.c
r5f94a0c r160b75e 27 27 */ 28 28 29 /** @addtogroup libusb 29 /** @addtogroup libusbdev 30 30 * @{ 31 31 */ … … 33 33 * Functions needed by hub drivers. 34 34 */ 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> 39 39 #include <usbhc_iface.h> 40 40 #include <errno.h> 41 41 #include <assert.h> 42 42 #include <usb/debug.h> 43 #include <time.h>44 43 45 44 /** How much time to wait between attempts to register endpoint 0:0. … … 219 218 220 219 int rc; 221 struct timeval start_time;222 223 rc = gettimeofday(&start_time, NULL);224 if (rc != EOK) {225 return rc;226 }227 220 228 221 rc = usb_hc_connection_open(&hc_conn); … … 271 264 } 272 265 } 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 for281 * the insertion process to complete. According to 7.1.7.1 this is the282 * time between attach detected and port reset. However, the setup done283 * above might use much of this time so we should only wait to fill284 * up the 100ms quota*/285 suseconds_t elapsed = tv_sub(&end_time, &start_time);286 if (elapsed < 100000) {287 async_usleep(100000 - elapsed);288 }289 266 290 267 /* … … 296 273 goto leave_release_default_address; 297 274 } 298 /* USB spec 7.1.7.1: The USB System Software guarantees a minimum of299 * 10ms for reset recovery. Device response to any bus transactions300 * addressed to the default device address during the reset recovery301 * time is undefined.302 */303 async_usleep(10000);304 275 305 276 rc = usb_pipe_probe_default_control(&ctrl_pipe);
Note:
See TracChangeset
for help on using the changeset viewer.