Changes in / [8c2b3ef:35537a7] in mainline
- Files:
-
- 73 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r8c2b3ef r35537a7 79 79 $(MAKE) -C uspace clean 80 80 $(MAKE) -C boot clean 81 82 -include Makefile.local -
boot/Makefile.common
r8c2b3ef r35537a7 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/il/arp/arp \ … … 109 110 110 111 RD_DRVS = \ 111 root 112 root \ 113 vhc 112 114 113 115 RD_DRV_CFG = … … 140 142 $(USPACE_PATH)/app/ping/ping \ 141 143 $(USPACE_PATH)/app/stats/stats \ 144 $(USPACE_PATH)/app/virtusbkbd/vuk \ 142 145 $(USPACE_PATH)/app/tasks/tasks \ 143 146 $(USPACE_PATH)/app/top/top -
boot/arch/amd64/Makefile.inc
r8c2b3ef r35537a7 40 40 pciintel \ 41 41 isa \ 42 ns8250 42 ns8250 \ 43 uhci \ 44 usbhub \ 45 usbkbd 43 46 44 47 RD_DRV_CFG += \ -
kernel/generic/include/ipc/ipc.h
r8c2b3ef r35537a7 45 45 /** Maximum active async calls per thread */ 46 46 #ifdef CONFIG_DEBUG 47 #define IPC_MAX_ASYNC_CALLS 447 #define IPC_MAX_ASYNC_CALLS 16 48 48 #else 49 49 #define IPC_MAX_ASYNC_CALLS 4000 -
uspace/Makefile
r8c2b3ef r35537a7 49 49 app/trace \ 50 50 app/top \ 51 app/virtusbkbd \ 51 52 app/netecho \ 52 53 app/nettest1 \ … … 85 86 srv/net/tl/tcp \ 86 87 srv/net/net \ 87 drv/root 88 drv/root \ 89 drv/vhc 88 90 89 91 ## Networking … … 115 117 DIRS += drv/isa 116 118 DIRS += drv/ns8250 119 DIRS += drv/uhci 120 DIRS += drv/usbhub 121 DIRS += drv/usbkbd 117 122 endif 118 123 … … 140 145 lib/packet \ 141 146 lib/net 147 148 ifeq ($(UARCH),amd64) 149 LIBS += lib/usb 150 LIBS += lib/usbvirt 151 endif 152 153 ifeq ($(UARCH),ia32) 154 LIBS += lib/usb 155 LIBS += lib/usbvirt 156 endif 142 157 143 158 LIBC_BUILD = $(addsuffix .build,$(LIBC)) -
uspace/Makefile.common
r8c2b3ef r35537a7 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
r8c2b3ef r35537a7 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/doc/doxygroups.h
r8c2b3ef r35537a7 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
r8c2b3ef r35537a7 120 120 } 121 121 122 /** Create virtual USB host controller device. 123 * Note that the virtual HC is actually device and driver in one 124 * task. 125 * 126 * @param parent Parent device. 127 * @return Error code. 128 */ 129 static int add_virtual_usb_host_controller(device_t *parent) 130 { 131 printf(NAME ": adding virtual host contoller.\n"); 132 133 int rc; 134 device_t *vhc = NULL; 135 match_id_t *match_id = NULL; 136 137 vhc = create_device(); 138 if (vhc == NULL) { 139 rc = ENOMEM; 140 goto failure; 141 } 142 143 vhc->name = "vhc"; 144 printf(NAME ": the new device's name is %s.\n", vhc->name); 145 146 /* Initialize match id list. */ 147 match_id = create_match_id(); 148 if (match_id == NULL) { 149 rc = ENOMEM; 150 goto failure; 151 } 152 153 match_id->id = "usb&hc=vhc"; 154 match_id->score = 100; 155 add_match_id(&vhc->match_ids, match_id); 156 157 /* Register child device. */ 158 rc = child_device_register(vhc, parent); 159 if (rc != EOK) 160 goto failure; 161 162 return EOK; 163 164 failure: 165 if (match_id != NULL) 166 match_id->id = NULL; 167 168 if (vhc != NULL) { 169 vhc->name = NULL; 170 delete_device(vhc); 171 } 172 173 return rc; 174 } 175 122 176 /** Get the root device. 123 177 * … … 135 189 printf(NAME ": failed to add child device for platform.\n"); 136 190 191 /* Register virtual USB host controller. */ 192 int rc = add_virtual_usb_host_controller(dev); 193 if (EOK != rc) { 194 printf(NAME ": failed to add child device - virtual USB HC.\n"); 195 } 196 137 197 return res; 138 198 } -
uspace/lib/c/include/ipc/dev_iface.h
r8c2b3ef r35537a7 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 -
uspace/lib/drv/Makefile
r8c2b3ef r35537a7 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
r8c2b3ef r35537a7 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
r8c2b3ef r35537a7 165 165 166 166 devman_handle_t dev_handle = IPC_GET_ARG1(*icall); 167 devman_handle_t parent_dev_handle = IPC_GET_ARG2(*icall); 168 167 169 device_t *dev = create_device(); 168 170 dev->handle = dev_handle; … … 172 174 173 175 add_to_devices_list(dev); 176 dev->parent = driver_get_device(&devices, parent_dev_handle); 177 174 178 res = driver->driver_ops->add_device(dev); 175 179 if (0 == res) { -
uspace/srv/devman/devman.c
r8c2b3ef r35537a7 117 117 printf(NAME": the '%s' driver was added to the list of available " 118 118 "drivers.\n", drv->name); 119 120 printf(NAME ": match ids:"); 121 link_t *cur; 122 for (cur = drv->match_ids.ids.next; cur != &drv->match_ids.ids; cur = cur->next) { 123 match_id_t *match_id = list_get_instance(cur, match_id_t, link); 124 printf(" %d:%s", match_id->score, match_id->id); 125 } 126 printf("\n"); 119 127 } 120 128 … … 643 651 644 652 /* Send the device to the driver. */ 645 aid_t req = async_send_1(phone, DRIVER_ADD_DEVICE, node->handle, 646 &answer); 653 devman_handle_t parent_handle; 654 if (node->parent) { 655 parent_handle = node->parent->handle; 656 } else { 657 parent_handle = 0; 658 } 659 aid_t req = async_send_2(phone, DRIVER_ADD_DEVICE, node->handle, 660 parent_handle, &answer); 647 661 648 662 /* Send the device's name to the driver. */ -
uspace/srv/devman/match.c
r8c2b3ef r35537a7 35 35 #include "devman.h" 36 36 37 /** Compute compound score of driver and device. 38 * 39 * @param driver Match id of the driver. 40 * @param device Match id of the device. 41 * @return Compound score. 42 * @retval 0 No match at all. 43 */ 44 static int compute_match_score(match_id_t *driver, match_id_t *device) 45 { 46 if (str_cmp(driver->id, device->id) == 0) { 47 /* 48 * The strings matches, return their score multiplied. 49 */ 50 return driver->score * device->score; 51 } else { 52 /* 53 * Different strings, return zero. 54 */ 55 return 0; 56 } 57 } 58 37 59 int get_match_score(driver_t *drv, node_t *dev) 38 60 { … … 43 65 return 0; 44 66 67 /* 68 * Go through all pairs, return the highest score obtainetd. 69 */ 70 int highest_score = 0; 71 45 72 link_t *drv_link = drv->match_ids.ids.next; 46 link_t *dev_link = dev->match_ids.ids.next; 47 48 match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link); 49 match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link); 50 51 int score_next_drv = 0; 52 int score_next_dev = 0; 53 54 do { 55 match_id_t *tmp_ma_id; 56 57 if (str_cmp(drv_id->id, dev_id->id) == 0) { 58 /* 59 * We found a match. 60 * Return the score of the match. 61 */ 62 return drv_id->score * dev_id->score; 73 while (drv_link != drv_head) { 74 link_t *dev_link = dev_head->next; 75 while (dev_link != dev_head) { 76 match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link); 77 match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link); 78 79 int score = compute_match_score(drv_id, dev_id); 80 if (score > highest_score) { 81 highest_score = score; 82 } 83 84 dev_link = dev_link->next; 63 85 } 64 86 65 /* 66 * Compute the next score we get, if we advance in the driver's 67 * list of match ids. 68 */ 69 if (drv_link->next != drv_head) { 70 tmp_ma_id = list_get_instance(drv_link->next, 71 match_id_t, link); 72 score_next_drv = dev_id->score * tmp_ma_id->score; 73 } else { 74 score_next_drv = 0; 75 } 76 77 /* 78 * Compute the next score we get, if we advance in the device's 79 * list of match ids. 80 */ 81 if (dev_link->next != dev_head) { 82 tmp_ma_id = list_get_instance(dev_link->next, 83 match_id_t, link); 84 score_next_dev = drv_id->score * tmp_ma_id->score; 85 } else { 86 score_next_dev = 0; 87 } 88 89 /* 90 * Advance in one of the two lists, so we get the next highest 91 * score. 92 */ 93 if (score_next_drv > score_next_dev) { 94 drv_link = drv_link->next; 95 drv_id = list_get_instance(drv_link, match_id_t, link); 96 } else { 97 dev_link = dev_link->next; 98 dev_id = list_get_instance(dev_link, match_id_t, link); 99 } 100 101 } while (drv_link->next != drv_head && dev_link->next != dev_head); 87 drv_link = drv_link->next; 88 } 102 89 103 return 0;90 return highest_score; 104 91 } 105 92 -
uspace/srv/net/tl/udp/udp.c
r8c2b3ef r35537a7 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.