Changeset 0cc32f2 in mainline for uspace/app
- Timestamp:
- 2011-08-18T18:47:54Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f44b056, d7427a7e
- Parents:
- 1d2a1a9 (diff), f55b12b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/app
- Files:
-
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/main.c
r1d2a1a9 r0cc32f2 50 50 51 51 #define MAX_USB_ADDRESS USB11_ADDRESS_MAX 52 #define MAX_FAILED_ATTEMPTS 1053 52 #define MAX_PATH_LENGTH 1024 54 53 55 static void print_found_hc(s ize_t class_index, const char *path)54 static void print_found_hc(service_id_t sid, const char *path) 56 55 { 57 // printf(NAME ": host controller %zu is `%s'.\n", class_index, path); 58 printf("Bus %02zu: %s\n", class_index, path); 56 printf("Bus %" PRIun ": %s\n", sid, path); 59 57 } 60 58 static void print_found_dev(usb_address_t addr, const char *path) 61 59 { 62 // printf(NAME ": device with address %d is `%s'.\n", addr, path);63 60 printf(" Device %02d: %s\n", addr, path); 64 61 } … … 95 92 int main(int argc, char *argv[]) 96 93 { 97 size_t class_index = 0; 98 size_t failed_attempts = 0; 94 category_id_t usbhc_cat; 95 service_id_t *svcs; 96 size_t count; 97 size_t i; 98 int rc; 99 99 100 while (failed_attempts < MAX_FAILED_ATTEMPTS) { 101 class_index++; 100 rc = loc_category_get_id(USB_HC_CATEGORY, &usbhc_cat, 0); 101 if (rc != EOK) { 102 printf(NAME ": Error resolving category '%s'", 103 USB_HC_CATEGORY); 104 return 1; 105 } 106 107 rc = loc_category_get_svcs(usbhc_cat, &svcs, &count); 108 if (rc != EOK) { 109 printf(NAME ": Error getting list of host controllers.\n"); 110 return 1; 111 } 112 113 for (i = 0; i < count; i++) { 102 114 devman_handle_t hc_handle = 0; 103 int rc = usb_ddf_get_hc_handle_by_ class(class_index, &hc_handle);115 int rc = usb_ddf_get_hc_handle_by_sid(svcs[i], &hc_handle); 104 116 if (rc != EOK) { 105 failed_attempts++; 117 printf(NAME ": Error resolving handle of HC with SID %" 118 PRIun ", skipping.\n", svcs[i]); 106 119 continue; 107 120 } … … 109 122 rc = devman_get_device_path(hc_handle, path, MAX_PATH_LENGTH); 110 123 if (rc != EOK) { 124 printf(NAME ": Error resolving path of HC with SID %" 125 PRIun ", skipping.\n", svcs[i]); 111 126 continue; 112 127 } 113 print_found_hc( class_index, path);128 print_found_hc(svcs[i], path); 114 129 print_hc_devices(hc_handle); 115 130 } 131 132 free(svcs); 116 133 117 134 return 0; -
uspace/app/tester/Makefile
r1d2a1a9 r0cc32f2 56 56 mm/malloc3.c \ 57 57 mm/mapping1.c \ 58 devs/devman1.c \59 devs/devman2.c \60 58 hw/misc/virtchar1.c \ 61 59 hw/serial/serial1.c \ -
uspace/app/tester/hw/misc/virtchar1.c
r1d2a1a9 r0cc32f2 49 49 50 50 #define DEVICE_PATH_NORMAL "/loc/devices/\\virt\\null\\a" 51 #define DEVICE_PATH_CLASSES "/loc/class/virt-null\\1"52 51 #define BUFFER_SIZE 64 53 52 … … 105 104 } 106 105 107 res = test_virtchar1_internal(DEVICE_PATH_CLASSES);108 if (res != NULL) {109 return res;110 }111 112 106 return NULL; 113 107 } -
uspace/app/tester/tester.c
r1d2a1a9 r0cc32f2 68 68 #include "hw/misc/virtchar1.def" 69 69 #include "libext2/libext2_1.def" 70 #include "devs/devman1.def"71 #include "devs/devman2.def"72 70 {NULL, NULL, NULL, false} 73 71 };
Note:
See TracChangeset
for help on using the changeset viewer.