Changes in / [ae1f70e:3d5e190] in mainline
- Files:
-
- 96 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
rae1f70e r3d5e190 547 547 548 548 % Launch (devman) test drivers 549 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS ( n/y)550 549 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (y/n) 550 -
Makefile
rae1f70e r3d5e190 92 92 $(MAKE) -C uspace clean 93 93 $(MAKE) -C boot clean 94 95 -include Makefile.local -
boot/Makefile.common
rae1f70e r3d5e190 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 \102 101 $(USPACE_PATH)/srv/net/netif/lo/lo \ 103 102 $(USPACE_PATH)/srv/net/nil/eth/eth \ … … 142 141 $(USPACE_PATH)/app/ping/ping \ 143 142 $(USPACE_PATH)/app/stats/stats \ 144 $(USPACE_PATH)/app/sysinfo/sysinfo \145 143 $(USPACE_PATH)/app/tasks/tasks \ 146 144 $(USPACE_PATH)/app/top/top \ 147 $(USPACE_PATH)/app/usbinfo/usbinfo \ 148 $(USPACE_PATH)/app/virtusbkbd/vuk \ 145 $(USPACE_PATH)/app/sysinfo/sysinfo \ 149 146 $(USPACE_PATH)/app/websrv/websrv 150 147 -
boot/arch/amd64/Makefile.inc
rae1f70e r3d5e190 40 40 pciintel \ 41 41 isa \ 42 ns8250 \ 43 uhci \ 44 usbhub \ 45 usbkbd \ 46 vhc 42 ns8250 47 43 48 44 RD_DRV_CFG += \ -
uspace/Makefile
rae1f70e r3d5e190 51 51 app/trace \ 52 52 app/top \ 53 app/usbinfo \54 app/virtusbkbd \55 53 app/netecho \ 56 54 app/nettest1 \ … … 114 112 DIRS += drv/isa 115 113 DIRS += drv/ns8250 116 DIRS += drv/uhci117 DIRS += drv/usbhub118 DIRS += drv/usbkbd119 DIRS += drv/vhc120 114 endif 121 115 … … 125 119 DIRS += drv/isa 126 120 DIRS += drv/ns8250 127 DIRS += drv/uhci128 DIRS += drv/usbhub129 DIRS += drv/usbkbd130 DIRS += drv/vhc131 121 endif 132 122 … … 154 144 lib/packet \ 155 145 lib/net 156 157 ifeq ($(UARCH),amd64)158 LIBS += lib/usb159 LIBS += lib/usbvirt160 endif161 162 ifeq ($(UARCH),ia32)163 LIBS += lib/usb164 LIBS += lib/usbvirt165 endif166 146 167 147 LIBC_BUILD = $(addsuffix .build,$(LIBC)) -
uspace/Makefile.common
rae1f70e r3d5e190 86 86 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 87 87 88 89 LIBUSB_PREFIX = $(LIB_PREFIX)/usb90 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt91 88 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 92 89 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet -
uspace/app/init/init.c
rae1f70e r3d5e190 312 312 getterm("term/vc5", "/app/bdsh", false); 313 313 getterm("term/vc6", "/app/klog", false); 314 getterm("term/vc7", "/srv/devman", false);315 314 316 315 return 0; -
uspace/app/tester/Makefile
rae1f70e r3d5e190 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
rae1f70e r3d5e190 63 63 #include "mm/malloc1.def" 64 64 #include "hw/serial/serial1.def" 65 #include "adt/usbaddrkeep.def"66 65 #include "hw/misc/virtchar1.def" 67 66 {NULL, NULL, NULL, false} -
uspace/app/tester/tester.h
rae1f70e r3d5e190 80 80 extern const char *test_malloc1(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 -
uspace/doc/doxygroups.h
rae1f70e r3d5e190 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 USB175 * @ingroup uspace176 * @brief USB support for HelenOS.177 */178 /**179 * @defgroup libusb USB library180 * @ingroup usb181 * @brief Library for creating USB devices drivers.182 */ -
uspace/drv/root/root.c
rae1f70e r3d5e190 88 88 89 89 int res = child_device_register_wrapper(parent, VIRTUAL_DEVICE_NAME, 90 VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE, 91 NULL); 90 VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE); 92 91 93 92 return res; … … 137 136 138 137 res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME, 139 match_id, PLATFORM_DEVICE_MATCH_SCORE , NULL);138 match_id, PLATFORM_DEVICE_MATCH_SCORE); 140 139 141 140 return res; -
uspace/drv/rootvirt/devices.def
rae1f70e r3d5e190 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
rae1f70e r3d5e190 84 84 85 85 int rc = child_device_register_wrapper(parent, virt_dev->name, 86 virt_dev->match_id, 10 , NULL);86 virt_dev->match_id, 10); 87 87 88 88 if (rc == EOK) { -
uspace/drv/test1/test1.c
rae1f70e r3d5e190 62 62 63 63 int rc = child_device_register_wrapper(parent, name, 64 match_id, match_score , NULL);64 match_id, match_score); 65 65 66 66 if (rc == EOK) { -
uspace/drv/test2/test2.c
rae1f70e r3d5e190 64 64 65 65 int rc = child_device_register_wrapper(parent, name, 66 match_id, match_score , NULL);66 match_id, match_score); 67 67 68 68 if (rc == EOK) { -
uspace/lib/c/generic/devman.c
rae1f70e r3d5e190 230 230 231 231 if (flags & IPC_FLAG_BLOCKING) { 232 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,232 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN, 233 233 DEVMAN_CONNECT_TO_DEVICE, handle); 234 234 } else { 235 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN,235 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN, 236 236 DEVMAN_CONNECT_TO_DEVICE, handle); 237 237 } -
uspace/lib/c/include/ipc/dev_iface.h
rae1f70e r3d5e190 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 44 40 // TODO add more interfaces 45 41 DEV_IFACE_MAX … … 54 50 DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX) 55 51 56 /*57 * The first argument is actually method (as the "real" method is used58 * 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 66 52 67 53 #endif -
uspace/lib/c/include/ipc/kbd.h
rae1f70e r3d5e190 39 39 40 40 #include <ipc/ipc.h> 41 #include <ipc/dev_iface.h>42 41 43 42 typedef enum { 44 KBD_YIELD = DEV_FIRST_CUSTOM_METHOD,43 KBD_YIELD = IPC_FIRST_USER_METHOD, 45 44 KBD_RECLAIM 46 45 } kbd_request_t; -
uspace/lib/drv/Makefile
rae1f70e r3d5e190 29 29 30 30 USPACE_PREFIX = ../.. 31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include31 EXTRA_CFLAGS = -Iinclude 32 32 LIBRARY = libdrv 33 33 … … 36 36 generic/dev_iface.c \ 37 37 generic/remote_res.c \ 38 generic/remote_usbhc.c \39 38 generic/remote_char.c 40 39 -
uspace/lib/drv/generic/dev_iface.c
rae1f70e r3d5e190 39 39 #include "remote_res.h" 40 40 #include "remote_char.h" 41 #include "remote_usbhc.h"42 41 43 42 static iface_dipatch_table_t remote_ifaces = { 44 43 .ifaces = { 45 44 &remote_res_iface, 46 &remote_char_iface, 47 &remote_usbhc_iface 45 &remote_char_iface 48 46 } 49 47 }; -
uspace/lib/drv/generic/driver.c
rae1f70e r3d5e190 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, 393 devman_handle_t *child_handle) 392 const char *child_match_id, int child_match_score) 394 393 { 395 394 device_t *child = NULL; … … 419 418 goto failure; 420 419 421 if (child_handle != NULL) {422 *child_handle = child->handle;423 }424 420 return EOK; 425 421 -
uspace/lib/drv/include/driver.h
rae1f70e r3d5e190 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, 202 devman_handle_t *); 201 int child_device_register_wrapper(device_t *, const char *, const char *, int); 203 202 204 203 -
uspace/srv/devman/devman.c
rae1f70e r3d5e190 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");143 135 } 144 136 -
uspace/srv/hid/console/console.c
rae1f70e r3d5e190 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 }322 321 323 322 fb_pending_flush(); … … 459 458 if (IPC_GET_ARG1(call) == 1) { 460 459 int newcon = gcons_mouse_btn((bool) IPC_GET_ARG2(call)); 461 if (newcon != -1) {460 if (newcon != -1) 462 461 change_console(&consoles[newcon]); 463 }464 462 } 465 463 retval = 0; … … 712 710 } 713 711 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) { 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) { 723 723 printf(NAME ": Failed to connect to input device\n"); 724 return phone;724 return false; 725 725 } 726 726 727 727 /* NB: The callback connection is slotted for removal */ 728 728 sysarg_t phonehash; 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) { 729 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { 732 730 printf(NAME ": Failed to create callback from input device\n"); 733 return rc;731 return false; 734 732 } 735 733 736 734 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 /** Try to connect to given keyboard, bypassing provided libc routines. 744 * 745 * @param devmap_path Path to keyboard without /dev prefix. 746 * @return Phone or error code. 747 */ 748 static int connect_keyboard_bypass(char *devmap_path) 749 { 750 int devmap_phone = async_connect_me_to_blocking(PHONE_NS, 751 SERVICE_DEVMAP, DEVMAP_CLIENT, 0); 752 if (devmap_phone < 0) { 753 return devmap_phone; 754 } 755 ipc_call_t answer; 756 aid_t req = async_send_2(devmap_phone, DEVMAP_DEVICE_GET_HANDLE, 757 0, 0, &answer); 758 759 sysarg_t retval = async_data_write_start(devmap_phone, 760 devmap_path, str_size(devmap_path)); 761 if (retval != EOK) { 762 async_wait_for(req, NULL); 763 ipc_hangup(devmap_phone); 764 return retval; 765 } 766 767 async_wait_for(req, &retval); 768 769 if (retval != EOK) { 770 ipc_hangup(devmap_phone); 771 return retval; 772 } 773 774 devmap_handle_t handle = (devmap_handle_t) IPC_GET_ARG1(answer); 775 776 ipc_hangup(devmap_phone); 777 778 int phone = async_connect_me_to(PHONE_NS, 779 SERVICE_DEVMAP, DEVMAP_CONNECT_TO_DEVICE, handle); 780 if (phone < 0) { 781 return phone; 782 } 783 784 /* NB: The callback connection is slotted for removal */ 785 sysarg_t phonehash; 786 int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, SERVICE_CONSOLE, 787 0, 0, NULL, NULL, NULL, NULL, &phonehash); 788 if (rc != EOK) { 789 printf(NAME ": Failed to create callback from input device\n"); 790 return rc; 791 } 792 793 async_new_connection(phonehash, 0, NULL, keyboard_events); 794 795 printf(NAME ": we got a hit (new keyboard \"/dev/%s\").\n", 796 devmap_path); 797 798 return phone; 799 } 800 801 802 static int check_new_keyboards(void *arg) 803 { 804 char *class_name = (char *) arg; 805 806 int index = 1; 807 808 while (true) { 809 async_usleep(1 * 500 * 1000); 810 char *path; 811 int rc = asprintf(&path, "class/%s\\%d", class_name, index); 812 if (rc < 0) { 813 continue; 814 } 815 rc = 0; 816 rc = connect_keyboard_bypass(path); 817 if (rc > 0) { 818 /* We do not allow unplug. */ 819 index++; 820 } 821 822 free(path); 823 } 824 825 return EOK; 826 } 827 828 829 /** Start a fibril monitoring hot-plugged keyboards. 830 */ 831 static void check_new_keyboards_in_background() 832 { 833 fid_t fid = fibril_create(check_new_keyboards, (void *)"keyboard"); 834 if (!fid) { 835 printf(NAME ": failed to create hot-plug-watch fibril.\n"); 836 return; 837 } 838 fibril_add_ready(fid); 839 } 840 841 static bool console_init(char *input) 842 { 843 /* Connect to input device */ 844 kbd_phone = connect_keyboard(input); 845 if (kbd_phone < 0) { 846 return false; 847 } 848 735 849 736 /* Connect to mouse device */ 850 737 mouse_phone = -1; … … 862 749 } 863 750 864 sysarg_t phonehash;865 751 if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { 866 752 printf(NAME ": Failed to create callback from mouse device\n"); … … 955 841 async_set_interrupt_received(interrupt_received); 956 842 957 /* Start fibril for checking on hot-plugged keyboards. */958 check_new_keyboards_in_background();959 960 843 return true; 961 844 } … … 977 860 if (!console_init(argv[1])) 978 861 return -1; 979 862 980 863 printf(NAME ": Accepting connections\n"); 981 864 async_manager(); -
uspace/srv/net/tl/udp/udp.c
rae1f70e r3d5e190 711 711 int socket_id; 712 712 size_t addrlen; 713 size_t size = 0;713 size_t size; 714 714 ipc_call_t answer; 715 715 int answer_count;
Note:
See TracChangeset
for help on using the changeset viewer.