Changeset 69ac0fd in mainline
- Timestamp:
- 2011-05-07T11:36:17Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df0bbe1
- Parents:
- e5165a3
- Location:
- uspace
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/main.c
re5165a3 r69ac0fd 44 44 #include <devman.h> 45 45 #include <devmap.h> 46 #include <usb/host.h> 46 47 47 48 #define NAME "lsusb" … … 49 50 #define MAX_FAILED_ATTEMPTS 4 50 51 #define MAX_PATH_LENGTH 1024 51 52 static int get_hc_handle(size_t class_index, devman_handle_t *hc_handle)53 {54 char *class_index_str;55 devman_handle_t hc_handle_tmp;56 int rc;57 58 rc = asprintf(&class_index_str, "%zu", class_index);59 if (rc < 0) {60 return ENOMEM;61 }62 rc = devman_device_get_handle_by_class("usbhc", class_index_str,63 &hc_handle_tmp, 0);64 free(class_index_str);65 if (rc != EOK) {66 return rc;67 }68 69 if (hc_handle != NULL) {70 *hc_handle = hc_handle_tmp;71 }72 73 return EOK;74 }75 52 76 53 int main(int argc, char *argv[]) … … 82 59 class_index++; 83 60 devman_handle_t hc_handle = 0; 84 int rc = get_hc_handle(class_index, &hc_handle);61 int rc = usb_ddf_get_hc_handle_by_class(class_index, &hc_handle); 85 62 if (rc != EOK) { 86 63 failed_attempts++; -
uspace/lib/usb/Makefile
re5165a3 r69ac0fd 46 46 src/hidparser.c \ 47 47 src/hiddescriptor.c \ 48 src/host.c \ 48 49 src/hub.c \ 49 50 src/pipepriv.c \
Note:
See TracChangeset
for help on using the changeset viewer.