Changeset 918e1e84 in mainline for uspace/app/usbinfo/list.c
- Timestamp:
- 2013-01-15T20:01:29Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef4e8eb
- Parents:
- 16b64b8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/list.c
r16b64b8 r918e1e84 44 44 #include <devman.h> 45 45 #include <loc.h> 46 #include <usb/dev/hub.h>47 #include <usb/hc.h>48 46 #include <usb_iface.h> 49 47 … … 60 58 { 61 59 printf(" Device %02d: %s\n", addr, path); 62 }63 64 static void print_hc_devices(devman_handle_t hc_handle)65 {66 int rc;67 usb_hc_connection_t conn;68 69 usb_hc_connection_initialize(&conn, hc_handle);70 rc = usb_hc_connection_open(&conn);71 if (rc != EOK) {72 printf(NAME ": failed to connect to HC: %s.\n",73 str_error(rc));74 return;75 }76 usb_address_t addr;77 for (addr = 1; addr < MAX_USB_ADDRESS; addr++) {78 devman_handle_t dev_handle;79 rc = usb_hc_get_handle_by_address(&conn, addr, &dev_handle);80 if (rc != EOK) {81 continue;82 }83 char path[MAX_PATH_LENGTH];84 rc = devman_fun_get_path(dev_handle, path, MAX_PATH_LENGTH);85 if (rc != EOK) {86 continue;87 }88 print_found_dev(addr, path);89 }90 usb_hc_connection_close(&conn);91 60 } 92 61 … … 155 124 for (unsigned i = 0; i < count; ++i) { 156 125 devman_handle_t hc_handle = 0; 157 int rc = usb_ddf_get_hc_handle_by_sid(svcs[i], &hc_handle);126 int rc = devman_fun_sid_to_handle(svcs[i], &hc_handle); 158 127 if (rc != EOK) { 159 128 printf(NAME ": Error resolving handle of HC with SID %" … … 169 138 } 170 139 print_found_hc(svcs[i], path); 171 (void)print_hc_devices;172 140 173 141 // TODO replace this with something sane
Note:
See TracChangeset
for help on using the changeset viewer.