Changeset 4a7a8d4 in mainline for uspace/app
- Timestamp:
- 2011-05-13T10:31:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aca3489
- Parents:
- 05e21ffc (diff), c372e03 (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:
-
- 1 deleted
- 11 edited
-
lsusb/Makefile (modified) (1 diff)
-
lsusb/main.c (modified) (2 diffs)
-
tester/Makefile (modified) (1 diff)
-
tester/adt/usbaddrkeep.def (deleted)
-
tester/tester.c (modified) (1 diff)
-
tester/tester.h (modified) (1 diff)
-
usbinfo/Makefile (modified) (1 diff)
-
usbinfo/dev.c (modified) (6 diffs)
-
usbinfo/info.c (modified) (1 diff)
-
usbinfo/main.c (modified) (2 diffs)
-
usbinfo/usbinfo.h (modified) (1 diff)
-
vuhid/Makefile (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/Makefile
r05e21ffc r4a7a8d4 30 30 BINARY = lsusb 31 31 32 LIBS = $(LIBUSB_PREFIX)/libusb.a $(LIBDRV_PREFIX)/libdrv.a 33 EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -I$(LIBDRV_PREFIX)/include 32 LIBS = \ 33 $(LIBUSBDEV_PREFIX)/libusbdev.a \ 34 $(LIBUSB_PREFIX)/libusb.a \ 35 $(LIBDRV_PREFIX)/libdrv.a 36 EXTRA_CFLAGS = \ 37 -I$(LIBUSB_PREFIX)/include \ 38 -I$(LIBUSBDEV_PREFIX)/include \ 39 -I$(LIBDRV_PREFIX)/include 34 40 35 41 SOURCES = \ -
uspace/app/lsusb/main.c
r05e21ffc r4a7a8d4 44 44 #include <devman.h> 45 45 #include <devmap.h> 46 #include <usb/hub.h> 46 47 #include <usb/host.h> 47 48 48 49 #define NAME "lsusb" 49 50 50 #define MAX_FAILED_ATTEMPTS 451 #define MAX_FAILED_ATTEMPTS 10 51 52 #define MAX_PATH_LENGTH 1024 53 54 static void print_found_hc(size_t class_index, const char *path) 55 { 56 // printf(NAME ": host controller %zu is `%s'.\n", class_index, path); 57 printf("Bus %02zu: %s\n", class_index, path); 58 } 59 static void print_found_dev(usb_address_t addr, const char *path) 60 { 61 // printf(NAME ": device with address %d is `%s'.\n", addr, path); 62 printf(" Device %02d: %s\n", addr, path); 63 } 64 65 static void print_hc_devices(devman_handle_t hc_handle) 66 { 67 int rc; 68 usb_hc_connection_t conn; 69 70 usb_hc_connection_initialize(&conn, hc_handle); 71 rc = usb_hc_connection_open(&conn); 72 if (rc != EOK) { 73 printf(NAME ": failed to connect to HC: %s.\n", 74 str_error(rc)); 75 return; 76 } 77 usb_address_t addr; 78 for (addr = 1; addr < 5; addr++) { 79 devman_handle_t dev_handle; 80 rc = usb_hc_get_handle_by_address(&conn, addr, &dev_handle); 81 if (rc != EOK) { 82 continue; 83 } 84 char path[MAX_PATH_LENGTH]; 85 rc = devman_get_device_path(dev_handle, path, MAX_PATH_LENGTH); 86 if (rc != EOK) { 87 continue; 88 } 89 print_found_dev(addr, path); 90 } 91 usb_hc_connection_close(&conn); 92 } 52 93 53 94 int main(int argc, char *argv[]) … … 69 110 continue; 70 111 } 71 print f(NAME ": host controller %zu is `%s'.\n",72 class_index, path);112 print_found_hc(class_index, path); 113 print_hc_devices(hc_handle); 73 114 } 74 115 -
uspace/app/tester/Makefile
r05e21ffc r4a7a8d4 31 31 BINARY = tester 32 32 33 LIBS += $(LIBUSB_PREFIX)/libusb.a34 EXTRA_CFLAGS += -I$(LIBUSB_PREFIX)/include35 36 33 SOURCES = \ 37 34 tester.c \ 38 adt/usbaddrkeep.c \39 35 thread/thread1.c \ 40 36 print/print1.c \ -
uspace/app/tester/tester.c
r05e21ffc r4a7a8d4 64 64 #include "mm/mapping1.def" 65 65 #include "hw/serial/serial1.def" 66 #include "adt/usbaddrkeep.def"67 66 #include "hw/misc/virtchar1.def" 68 67 #include "devs/devman1.def" -
uspace/app/tester/tester.h
r05e21ffc r4a7a8d4 80 80 extern const char *test_mapping1(void); 81 81 extern const char *test_serial1(void); 82 extern const char *test_usbaddrkeep(void);83 82 extern const char *test_virtchar1(void); 84 83 extern const char *test_devman1(void); -
uspace/app/usbinfo/Makefile
r05e21ffc r4a7a8d4 30 30 BINARY = usbinfo 31 31 32 LIBS = $(LIBUSB_PREFIX)/libusb.a $(LIBDRV_PREFIX)/libdrv.a 33 EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -I$(LIBDRV_PREFIX)/include 32 LIBS = \ 33 $(LIBUSBDEV_PREFIX)/libusbdev.a \ 34 $(LIBUSB_PREFIX)/libusb.a \ 35 $(LIBDRV_PREFIX)/libdrv.a 36 EXTRA_CFLAGS = \ 37 -I$(LIBUSB_PREFIX)/include \ 38 -I$(LIBUSBDEV_PREFIX)/include \ 39 -I$(LIBDRV_PREFIX)/include 34 40 35 41 SOURCES = \ -
uspace/app/usbinfo/dev.c
r05e21ffc r4a7a8d4 40 40 #include "usbinfo.h" 41 41 42 usbinfo_device_t *prepare_device( devman_handle_t hc_handle,43 usb_address_t dev_addr)42 usbinfo_device_t *prepare_device(const char *name, 43 devman_handle_t hc_handle, usb_address_t dev_addr) 44 44 { 45 45 usbinfo_device_t *dev = malloc(sizeof(usbinfo_device_t)); … … 55 55 if (rc != EOK) { 56 56 fprintf(stderr, 57 NAME ": failed to create connection to the device: %s.\n",58 str_error(rc));57 NAME ": failed to create connection to device %s: %s.\n", 58 name, str_error(rc)); 59 59 goto leave; 60 60 } … … 64 64 if (rc != EOK) { 65 65 fprintf(stderr, 66 NAME ": failed to create default control pipe : %s.\n",67 str_error(rc));66 NAME ": failed to create default control pipe to %s: %s.\n", 67 name, str_error(rc)); 68 68 goto leave; 69 69 } … … 71 71 rc = usb_pipe_probe_default_control(&dev->ctrl_pipe); 72 72 if (rc != EOK) { 73 fprintf(stderr, 74 NAME ": probing default control pipe failed: %s.\n", 75 str_error(rc)); 73 if (rc == ENOENT) { 74 fprintf(stderr, NAME ": " \ 75 "device %s not present or malfunctioning.\n", 76 name); 77 } else { 78 fprintf(stderr, NAME ": " \ 79 "probing default control pipe of %s failed: %s.\n", 80 name, str_error(rc)); 81 } 76 82 goto leave; 77 83 } … … 84 90 if (rc != EOK) { 85 91 fprintf(stderr, 86 NAME ": failed to retrieve device descriptor : %s.\n",87 str_error(rc));92 NAME ": failed to retrieve device descriptor of %s: %s.\n", 93 name, str_error(rc)); 88 94 goto leave; 89 95 } … … 93 99 &dev->full_configuration_descriptor_size); 94 100 if (rc != EOK) { 95 fprintf(stderr, 96 NAME ": failed to retrieve configuration descriptor: %s.\n",97 str_error(rc));101 fprintf(stderr, NAME ": " \ 102 "failed to retrieve configuration descriptor of %s: %s.\n", 103 name, str_error(rc)); 98 104 goto leave; 99 105 } -
uspace/app/usbinfo/info.c
r05e21ffc r4a7a8d4 41 41 #include <usb/request.h> 42 42 #include <usb/classes/classes.h> 43 #include <usb/classes/hid.h>44 43 #include <usb/classes/hub.h> 45 44 #include "usbinfo.h" -
uspace/app/usbinfo/main.c
r05e21ffc r4a7a8d4 46 46 #include <usb/pipes.h> 47 47 #include <usb/host.h> 48 #include <usb/driver.h> 48 49 #include "usbinfo.h" 49 50 … … 308 309 } 309 310 310 usbinfo_device_t *dev = prepare_device(hc_handle, dev_addr); 311 usbinfo_device_t *dev = prepare_device(devpath, 312 hc_handle, dev_addr); 311 313 if (dev == NULL) { 312 314 continue; -
uspace/app/usbinfo/usbinfo.h
r05e21ffc r4a7a8d4 71 71 } 72 72 73 usbinfo_device_t *prepare_device( devman_handle_t, usb_address_t);73 usbinfo_device_t *prepare_device(const char *, devman_handle_t, usb_address_t); 74 74 void destroy_device(usbinfo_device_t *); 75 75 -
uspace/app/vuhid/Makefile
r05e21ffc r4a7a8d4 34 34 LIBS = \ 35 35 $(LIBUSBVIRT_PREFIX)/libusbvirt.a \ 36 $(LIBUSBHID_PREFIX)/libusbhid.a \ 37 $(LIBUSBDEV_PREFIX)/libusbdev.a \ 36 38 $(LIBUSB_PREFIX)/libusb.a 37 39 EXTRA_CFLAGS = \ 38 40 -I$(LIBUSB_PREFIX)/include \ 41 -I$(LIBUSBDEV_PREFIX)/include \ 42 -I$(LIBUSBHID_PREFIX)/include \ 39 43 -I$(LIBUSBVIRT_PREFIX)/include \ 40 44 -I$(LIBDRV_PREFIX)/include
Note:
See TracChangeset
for help on using the changeset viewer.
