Changes in uspace/app/usbinfo/main.c [3e4f2e0:c82135a8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/main.c
r3e4f2e0 rc82135a8 45 45 #include <usb/usbdevice.h> 46 46 #include <usb/pipes.h> 47 #include <usb/host.h>48 #include <usb/driver.h>49 47 #include "usbinfo.h" 50 51 static bool try_parse_class_and_address(const char *path,52 devman_handle_t *out_hc_handle, usb_address_t *out_device_address)53 {54 size_t class_index;55 size_t address;56 int rc;57 char *ptr;58 59 rc = str_size_t(path, &ptr, 10, false, &class_index);60 if (rc != EOK) {61 return false;62 }63 if ((*ptr == ':') || (*ptr == '.')) {64 ptr++;65 } else {66 return false;67 }68 rc = str_size_t(ptr, NULL, 10, true, &address);69 if (rc != EOK) {70 return false;71 }72 rc = usb_ddf_get_hc_handle_by_class(class_index, out_hc_handle);73 if (rc != EOK) {74 return false;75 }76 if (out_device_address != NULL) {77 *out_device_address = (usb_address_t) address;78 }79 return true;80 }81 48 82 49 static bool resolve_hc_handle_and_dev_addr(const char *devpath, … … 93 60 if (str_cmp(devpath, "virt") == 0) { 94 61 devpath = "/virt/usbhc/usb00_a1/usb00_a2"; 95 }96 97 if (try_parse_class_and_address(devpath,98 out_hc_handle, out_device_address)) {99 return true;100 62 } 101 63 … … 309 271 } 310 272 311 usbinfo_device_t *dev = prepare_device(devpath, 312 hc_handle, dev_addr); 273 usbinfo_device_t *dev = prepare_device(hc_handle, dev_addr); 313 274 if (dev == NULL) { 314 275 continue;
Note:
See TracChangeset
for help on using the changeset viewer.