Changeset 0e7380f in mainline for uspace/drv/bus/usb/xhci/hw_struct/common.h
- Timestamp:
- 2018-01-13T00:18:28Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 94e9c29
- Parents:
- fb154e13
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hw_struct/common.h
rfb154e13 r0e7380f 42 42 #include <assert.h> 43 43 #include <bitops.h> 44 #include <byteorder.h> 44 45 #include <ddi.h> 45 #include < byteorder.h>46 #include <errno.h> 46 47 47 48 #define host2xhci(size, val) host2uint##size##_t_le((val)) … … 88 89 } 89 90 91 static inline int xhci_reg_wait(xhci_dword_t *reg, uint32_t mask, uint32_t expected) 92 { 93 mask = host2xhci(32, mask); 94 expected = host2xhci(32, expected); 95 96 unsigned retries = 100; 97 uint32_t value = *reg & mask; 98 99 for (; retries > 0 && value != expected; --retries) { 100 async_usleep(10000); 101 value = *reg & mask; 102 } 103 104 return value == expected ? EOK : ETIMEOUT; 105 } 106 90 107 #endif 91 108
Note:
See TracChangeset
for help on using the changeset viewer.