Changes in / [196ef08:dffabf0] in mainline
- Files:
-
- 96 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r196ef08 rdffabf0 547 547 548 548 % Launch (devman) test drivers 549 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS ( y/n)550 549 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (n/y) 550 -
Makefile
r196ef08 rdffabf0 92 92 $(MAKE) -C uspace clean 93 93 $(MAKE) -C boot clean 94 95 -include Makefile.local -
boot/Makefile.common
r196ef08 rdffabf0 99 99 $(USPACE_PATH)/srv/taskmon/taskmon \ 100 100 $(USPACE_PATH)/srv/hw/netif/dp8390/dp8390 \ 101 $(USPACE_PATH)/srv/hw/bus/usb/hcd/virtual/vhcd \ 101 102 $(USPACE_PATH)/srv/net/netif/lo/lo \ 102 103 $(USPACE_PATH)/srv/net/nil/eth/eth \ … … 141 142 $(USPACE_PATH)/app/ping/ping \ 142 143 $(USPACE_PATH)/app/stats/stats \ 144 $(USPACE_PATH)/app/sysinfo/sysinfo \ 143 145 $(USPACE_PATH)/app/tasks/tasks \ 144 146 $(USPACE_PATH)/app/top/top \ 145 $(USPACE_PATH)/app/sysinfo/sysinfo \ 147 $(USPACE_PATH)/app/usbinfo/usbinfo \ 148 $(USPACE_PATH)/app/virtusbkbd/vuk \ 146 149 $(USPACE_PATH)/app/websrv/websrv 147 150 -
boot/arch/amd64/Makefile.inc
r196ef08 rdffabf0 40 40 pciintel \ 41 41 isa \ 42 ns8250 42 ns8250 \ 43 uhci \ 44 usbhub \ 45 usbkbd \ 46 vhc 43 47 44 48 RD_DRV_CFG += \ -
uspace/Makefile
r196ef08 rdffabf0 51 51 app/trace \ 52 52 app/top \ 53 app/usbinfo \ 54 app/virtusbkbd \ 53 55 app/netecho \ 54 56 app/nettest1 \ … … 113 115 DIRS += drv/isa 114 116 DIRS += drv/ns8250 117 DIRS += drv/uhci 118 DIRS += drv/usbhub 119 DIRS += drv/usbkbd 120 DIRS += drv/vhc 115 121 endif 116 122 … … 120 126 DIRS += drv/isa 121 127 DIRS += drv/ns8250 128 DIRS += drv/uhci 129 DIRS += drv/usbhub 130 DIRS += drv/usbkbd 131 DIRS += drv/vhc 122 132 endif 123 133 … … 145 155 lib/packet \ 146 156 lib/net 157 158 ifeq ($(UARCH),amd64) 159 LIBS += lib/usb 160 LIBS += lib/usbvirt 161 endif 162 163 ifeq ($(UARCH),ia32) 164 LIBS += lib/usb 165 LIBS += lib/usbvirt 166 endif 147 167 148 168 LIBC_BUILD = $(addsuffix .build,$(LIBC)) -
uspace/Makefile.common
r196ef08 rdffabf0 86 86 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 87 87 88 89 LIBUSB_PREFIX = $(LIB_PREFIX)/usb 90 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt 88 91 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 89 92 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet -
uspace/app/init/init.c
r196ef08 rdffabf0 312 312 getterm("term/vc5", "/app/bdsh", false); 313 313 getterm("term/vc6", "/app/klog", false); 314 getterm("term/vc7", "/srv/devman", false); 314 315 315 316 return 0; -
uspace/app/tester/Makefile
r196ef08 rdffabf0 31 31 BINARY = tester 32 32 33 LIBS += $(LIBUSB_PREFIX)/libusb.a 34 EXTRA_CFLAGS += -I$(LIBUSB_PREFIX)/include 35 33 36 SOURCES = \ 34 37 tester.c \ 38 adt/usbaddrkeep.c \ 35 39 thread/thread1.c \ 36 40 print/print1.c \ -
uspace/app/tester/tester.c
r196ef08 rdffabf0 63 63 #include "mm/malloc1.def" 64 64 #include "hw/serial/serial1.def" 65 #include "adt/usbaddrkeep.def" 65 66 #include "hw/misc/virtchar1.def" 66 67 {NULL, NULL, NULL, false} -
uspace/app/tester/tester.h
r196ef08 rdffabf0 80 80 extern const char *test_malloc1(void); 81 81 extern const char *test_serial1(void); 82 extern const char *test_usbaddrkeep(void); 82 83 extern const char *test_virtchar1(void); 83 84 -
uspace/doc/doxygroups.h
r196ef08 rdffabf0 155 155 * @endcond 156 156 */ 157 157 158 158 /** 159 159 * @defgroup emul Emulation Libraries … … 170 170 * @ingroup emul 171 171 */ 172 173 /** 174 * @defgroup usb USB 175 * @ingroup uspace 176 * @brief USB support for HelenOS. 177 */ 178 /** 179 * @defgroup libusb USB library 180 * @ingroup usb 181 * @brief Library for creating USB devices drivers. 182 */ -
uspace/drv/root/root.c
r196ef08 rdffabf0 88 88 89 89 int res = child_device_register_wrapper(parent, VIRTUAL_DEVICE_NAME, 90 VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE); 90 VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE, 91 NULL); 91 92 92 93 return res; … … 136 137 137 138 res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME, 138 match_id, PLATFORM_DEVICE_MATCH_SCORE );139 match_id, PLATFORM_DEVICE_MATCH_SCORE, NULL); 139 140 140 141 return res; -
uspace/drv/rootvirt/devices.def
r196ef08 rdffabf0 22 22 }, 23 23 #endif 24 /* Virtual USB host controller. */ 25 { 26 .name = "usbhc", 27 .match_id = "usb&hc=vhc" 28 }, -
uspace/drv/rootvirt/rootvirt.c
r196ef08 rdffabf0 84 84 85 85 int rc = child_device_register_wrapper(parent, virt_dev->name, 86 virt_dev->match_id, 10 );86 virt_dev->match_id, 10, NULL); 87 87 88 88 if (rc == EOK) { -
uspace/drv/test1/test1.c
r196ef08 rdffabf0 62 62 63 63 int rc = child_device_register_wrapper(parent, name, 64 match_id, match_score );64 match_id, match_score, NULL); 65 65 66 66 if (rc == EOK) { -
uspace/drv/test2/test2.c
r196ef08 rdffabf0 64 64 65 65 int rc = child_device_register_wrapper(parent, name, 66 match_id, match_score );66 match_id, match_score, NULL); 67 67 68 68 if (rc == EOK) { -
uspace/lib/c/generic/devman.c
r196ef08 rdffabf0 230 230 231 231 if (flags & IPC_FLAG_BLOCKING) { 232 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,232 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN, 233 233 DEVMAN_CONNECT_TO_DEVICE, handle); 234 234 } else { 235 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN,235 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN, 236 236 DEVMAN_CONNECT_TO_DEVICE, handle); 237 237 } -
uspace/lib/c/include/ipc/dev_iface.h
r196ef08 rdffabf0 38 38 HW_RES_DEV_IFACE = 0, 39 39 CHAR_DEV_IFACE, 40 41 /** Interface provided by USB host controller. */ 42 USBHC_DEV_IFACE, 43 40 44 // TODO add more interfaces 41 45 DEV_IFACE_MAX … … 50 54 DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX) 51 55 56 /* 57 * The first argument is actually method (as the "real" method is used 58 * for indexing into interfaces. 59 */ 60 61 #define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call)) 62 #define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call)) 63 #define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call)) 64 #define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call)) 65 52 66 53 67 #endif -
uspace/lib/c/include/ipc/kbd.h
r196ef08 rdffabf0 39 39 40 40 #include <ipc/ipc.h> 41 #include <ipc/dev_iface.h> 41 42 42 43 typedef enum { 43 KBD_YIELD = IPC_FIRST_USER_METHOD,44 KBD_YIELD = DEV_FIRST_CUSTOM_METHOD, 44 45 KBD_RECLAIM 45 46 } kbd_request_t; -
uspace/lib/drv/Makefile
r196ef08 rdffabf0 29 29 30 30 USPACE_PREFIX = ../.. 31 EXTRA_CFLAGS = -Iinclude 31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include 32 32 LIBRARY = libdrv 33 33 … … 36 36 generic/dev_iface.c \ 37 37 generic/remote_res.c \ 38 generic/remote_usbhc.c \ 38 39 generic/remote_char.c 39 40 -
uspace/lib/drv/generic/dev_iface.c
r196ef08 rdffabf0 39 39 #include "remote_res.h" 40 40 #include "remote_char.h" 41 #include "remote_usbhc.h" 41 42 42 43 static iface_dipatch_table_t remote_ifaces = { 43 44 .ifaces = { 44 45 &remote_res_iface, 45 &remote_char_iface 46 &remote_char_iface, 47 &remote_usbhc_iface 46 48 } 47 49 }; -
uspace/lib/drv/generic/driver.c
r196ef08 rdffabf0 390 390 */ 391 391 int child_device_register_wrapper(device_t *parent, const char *child_name, 392 const char *child_match_id, int child_match_score) 392 const char *child_match_id, int child_match_score, 393 devman_handle_t *child_handle) 393 394 { 394 395 device_t *child = NULL; … … 418 419 goto failure; 419 420 421 if (child_handle != NULL) { 422 *child_handle = child->handle; 423 } 420 424 return EOK; 421 425 -
uspace/lib/drv/include/driver.h
r196ef08 rdffabf0 199 199 200 200 int child_device_register(device_t *, device_t *); 201 int child_device_register_wrapper(device_t *, const char *, const char *, int); 201 int child_device_register_wrapper(device_t *, const char *, const char *, int, 202 devman_handle_t *); 202 203 203 204 -
uspace/srv/devman/devman.c
r196ef08 rdffabf0 133 133 printf(NAME": the '%s' driver was added to the list of available " 134 134 "drivers.\n", drv->name); 135 136 printf(NAME ": match ids:"); 137 link_t *cur; 138 for (cur = drv->match_ids.ids.next; cur != &drv->match_ids.ids; cur = cur->next) { 139 match_id_t *match_id = list_get_instance(cur, match_id_t, link); 140 printf(" %d:%s", match_id->score, match_id->id); 141 } 142 printf("\n"); 135 143 } 136 144 -
uspace/srv/hid/console/console.c
r196ef08 rdffabf0 317 317 static void change_console(console_t *cons) 318 318 { 319 if (cons == active_console) 319 if (cons == active_console) { 320 320 return; 321 } 321 322 322 323 fb_pending_flush(); … … 458 459 if (IPC_GET_ARG1(call) == 1) { 459 460 int newcon = gcons_mouse_btn((bool) IPC_GET_ARG2(call)); 460 if (newcon != -1) 461 if (newcon != -1) { 461 462 change_console(&consoles[newcon]); 463 } 462 464 } 463 465 retval = 0; … … 710 712 } 711 713 712 static bool console_init(char *input) 713 { 714 /* Connect to input device */ 715 int input_fd = open(input, O_RDONLY); 716 if (input_fd < 0) { 717 printf(NAME ": Failed opening %s\n", input); 718 return false; 719 } 720 721 kbd_phone = fd_phone(input_fd); 722 if (kbd_phone < 0) { 714 static int connect_keyboard(char *path) 715 { 716 int fd = open(path, O_RDONLY); 717 if (fd < 0) { 718 return fd; 719 } 720 721 int phone = fd_phone(fd); 722 if (phone < 0) { 723 723 printf(NAME ": Failed to connect to input device\n"); 724 return false;724 return phone; 725 725 } 726 726 727 727 /* NB: The callback connection is slotted for removal */ 728 728 sysarg_t phonehash; 729 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { 729 int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, SERVICE_CONSOLE, 730 0, 0, NULL, NULL, NULL, NULL, &phonehash); 731 if (rc != EOK) { 730 732 printf(NAME ": Failed to create callback from input device\n"); 733 return rc; 734 } 735 736 async_new_connection(phonehash, 0, NULL, keyboard_events); 737 738 printf(NAME ": we got a hit (new keyboard \"%s\").\n", path); 739 740 return phone; 741 } 742 743 744 static int check_new_keyboards(void *arg) 745 { 746 char *class_name = (char *) arg; 747 748 int index = 1; 749 750 while (true) { 751 async_usleep(1 * 500 * 1000); 752 char *path; 753 int rc = asprintf(&path, "/dev/class/%s\\%d", class_name, index); 754 if (rc < 0) { 755 continue; 756 } 757 rc = 0; 758 rc = connect_keyboard(path); 759 if (rc > 0) { 760 /* We do not allow unplug. */ 761 index++; 762 } 763 764 free(path); 765 } 766 767 return EOK; 768 } 769 770 771 /** Start a fibril monitoring hot-plugged keyboards. 772 */ 773 static void check_new_keyboards_in_background() 774 { 775 fid_t fid = fibril_create(check_new_keyboards, (void *)"keyboard"); 776 if (!fid) { 777 printf(NAME ": failed to create hot-plug-watch fibril.\n"); 778 return; 779 } 780 fibril_add_ready(fid); 781 } 782 783 static bool console_init(char *input) 784 { 785 /* Connect to input device */ 786 kbd_phone = connect_keyboard(input); 787 if (kbd_phone < 0) { 731 788 return false; 732 789 } 733 734 async_new_connection(phonehash, 0, NULL, keyboard_events); 735 790 736 791 /* Connect to mouse device */ 737 792 mouse_phone = -1; … … 749 804 } 750 805 806 sysarg_t phonehash; 751 807 if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { 752 808 printf(NAME ": Failed to create callback from mouse device\n"); … … 841 897 async_set_interrupt_received(interrupt_received); 842 898 899 /* Start fibril for checking on hot-plugged keyboards. */ 900 check_new_keyboards_in_background(); 901 843 902 return true; 844 903 } … … 860 919 if (!console_init(argv[1])) 861 920 return -1; 862 921 863 922 printf(NAME ": Accepting connections\n"); 864 923 async_manager(); -
uspace/srv/net/tl/udp/udp.c
r196ef08 rdffabf0 711 711 int socket_id; 712 712 size_t addrlen; 713 size_t size ;713 size_t size = 0; 714 714 ipc_call_t answer; 715 715 int answer_count;
Note:
See TracChangeset
for help on using the changeset viewer.