Changeset 652f484 in mainline
- Timestamp:
- 2011-05-07T13:59:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05e21ffc
- Parents:
- 4d20ef7 (diff), 7205209 (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. - Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r4d20ef7 r652f484 49 49 ./uspace/app/killall/killall 50 50 ./uspace/app/klog/klog 51 ./uspace/app/lsusb/lsusb 51 52 ./uspace/app/mkfat/mkfat 52 53 ./uspace/app/netstart/netstart -
boot/Makefile.common
r4d20ef7 r652f484 128 128 $(USPACE_PATH)/app/killall/killall \ 129 129 $(USPACE_PATH)/app/mkfat/mkfat \ 130 $(USPACE_PATH)/app/lsusb/lsusb \ 130 131 $(USPACE_PATH)/app/sbi/sbi \ 131 132 $(USPACE_PATH)/app/redir/redir \ -
uspace/Makefile
r4d20ef7 r652f484 41 41 app/killall \ 42 42 app/klog \ 43 app/lsusb \ 43 44 app/mkfat \ 44 45 app/redir \ -
uspace/app/usbinfo/main.c
r4d20ef7 r652f484 45 45 #include <usb/usbdevice.h> 46 46 #include <usb/pipes.h> 47 #include <usb/host.h> 47 48 #include "usbinfo.h" 49 50 static bool try_parse_class_and_address(const char *path, 51 devman_handle_t *out_hc_handle, usb_address_t *out_device_address) 52 { 53 size_t class_index; 54 size_t address; 55 int rc; 56 char *ptr; 57 58 rc = str_size_t(path, &ptr, 10, false, &class_index); 59 if (rc != EOK) { 60 return false; 61 } 62 if ((*ptr == ':') || (*ptr == '.')) { 63 ptr++; 64 } else { 65 return false; 66 } 67 rc = str_size_t(ptr, NULL, 10, true, &address); 68 if (rc != EOK) { 69 return false; 70 } 71 rc = usb_ddf_get_hc_handle_by_class(class_index, out_hc_handle); 72 if (rc != EOK) { 73 return false; 74 } 75 if (out_device_address != NULL) { 76 *out_device_address = (usb_address_t) address; 77 } 78 return true; 79 } 48 80 49 81 static bool resolve_hc_handle_and_dev_addr(const char *devpath, … … 60 92 if (str_cmp(devpath, "virt") == 0) { 61 93 devpath = "/virt/usbhc/usb00_a1/usb00_a2"; 94 } 95 96 if (try_parse_class_and_address(devpath, 97 out_hc_handle, out_device_address)) { 98 return true; 62 99 } 63 100 -
uspace/doc/doxygroups.h
r4d20ef7 r652f484 220 220 221 221 /** 222 * @defgroup lsusb HelenOS version of lsusb command 223 * @ingroup usb 224 * @brief Application for listing USB host controllers. 225 * @details 226 * List all found host controllers. 227 */ 228 229 /** 222 230 * @defgroup drvusbmid USB multi interface device driver 223 231 * @ingroup usb -
uspace/drv/ehci-hcd/main.c
r4d20ef7 r652f484 97 97 } 98 98 hc_fun->ops = &hc_ops; 99 99 100 ret = ddf_fun_bind(hc_fun); 100 101 101 CHECK_RET_RETURN(ret, 102 102 "Failed to bind EHCI function: %s.\n", 103 str_error(ret)); 104 ret = ddf_fun_add_to_class(hc_fun, USB_HC_DDF_CLASS_NAME); 105 CHECK_RET_RETURN(ret, 106 "Failed to add EHCI to HC class: %s.\n", 103 107 str_error(ret)); 104 108 -
uspace/drv/ohci/ohci.c
r4d20ef7 r652f484 185 185 "Failed(%d) to bind OHCI device function: %s.\n", 186 186 ret, str_error(ret)); 187 ret = ddf_fun_add_to_class(instance->hc_fun, USB_HC_DDF_CLASS_NAME); 188 CHECK_RET_DEST_FUN_RETURN(ret, 189 "Failed to add OHCI to HC class: %s.\n", str_error(ret)); 190 187 191 #undef CHECK_RET_HC_RETURN 188 192 -
uspace/drv/uhci-hcd/uhci.c
r4d20ef7 r652f484 210 210 "Failed(%d) to bind UHCI device function: %s.\n", 211 211 ret, str_error(ret)); 212 ret = ddf_fun_add_to_class(instance->hc_fun, USB_HC_DDF_CLASS_NAME); 213 CHECK_RET_DEST_FUN_RETURN(ret, 214 "Failed to add UHCI to HC class: %s.\n", str_error(ret)); 215 212 216 #undef CHECK_RET_HC_RETURN 213 217 -
uspace/drv/vhc/main.c
r4d20ef7 r652f484 104 104 } 105 105 106 ddf_fun_add_to_class(hc, "usbhc"); 106 rc = ddf_fun_add_to_class(hc, USB_HC_DDF_CLASS_NAME); 107 if (rc != EOK) { 108 usb_log_fatal("Failed to add function to HC class: %s.\n", 109 str_error(rc)); 110 free(data); 111 return rc; 112 } 107 113 108 114 virtual_hub_device_init(hc); -
uspace/lib/c/generic/devman.c
r4d20ef7 r652f484 374 374 } 375 375 376 int devman_get_device_path(devman_handle_t handle, char *path, size_t path_size) 377 { 378 int phone = devman_get_phone(DEVMAN_CLIENT, 0); 379 380 if (phone < 0) 381 return phone; 382 383 async_serialize_start(); 384 385 ipc_call_t answer; 386 aid_t req = async_send_1(phone, DEVMAN_DEVICE_GET_DEVICE_PATH, 387 handle, &answer); 388 389 ipc_call_t data_request_call; 390 aid_t data_request = async_data_read(phone, path, path_size, 391 &data_request_call); 392 if (data_request == 0) { 393 async_wait_for(req, NULL); 394 async_serialize_end(); 395 return ENOMEM; 396 } 397 398 sysarg_t data_request_rc; 399 sysarg_t opening_request_rc; 400 async_wait_for(data_request, &data_request_rc); 401 async_wait_for(req, &opening_request_rc); 402 403 async_serialize_end(); 404 405 if (data_request_rc != EOK) { 406 /* Prefer the return code of the opening request. */ 407 if (opening_request_rc != EOK) { 408 return (int) opening_request_rc; 409 } else { 410 return (int) data_request_rc; 411 } 412 } 413 if (opening_request_rc != EOK) { 414 return (int) opening_request_rc; 415 } 416 417 path[path_size - 1] = 0; 418 419 if (IPC_GET_ARG2(data_request_call) >= path_size) { 420 return ELIMIT; 421 } 422 423 return EOK; 424 } 425 376 426 377 427 /** @} -
uspace/lib/c/include/devman.h
r4d20ef7 r652f484 55 55 extern int devman_device_get_handle_by_class(const char *, const char *, 56 56 devman_handle_t *, unsigned int); 57 extern int devman_get_device_path(devman_handle_t, char *, size_t); 57 58 58 59 extern int devman_add_device_to_class(devman_handle_t, const char *); -
uspace/lib/c/include/ipc/devman.h
r4d20ef7 r652f484 149 149 typedef enum { 150 150 DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD, 151 DEVMAN_DEVICE_GET_HANDLE_BY_CLASS 151 DEVMAN_DEVICE_GET_HANDLE_BY_CLASS, 152 DEVMAN_DEVICE_GET_DEVICE_PATH 152 153 } client_to_devman_t; 153 154 -
uspace/lib/usb/Makefile
r4d20ef7 r652f484 46 46 src/hidparser.c \ 47 47 src/hiddescriptor.c \ 48 src/host.c \ 48 49 src/hub.c \ 49 50 src/pipepriv.c \ -
uspace/lib/usb/include/usb/usb.h
r4d20ef7 r652f484 172 172 } usb_packet_id; 173 173 174 /** Class name for USB host controllers. */ 175 #define USB_HC_DDF_CLASS_NAME "usbhc" 176 174 177 #endif 175 178 /** -
uspace/srv/devman/main.c
r4d20ef7 r652f484 515 515 } 516 516 517 /** Find device path by its handle. */ 518 static void devman_get_device_path_by_handle(ipc_callid_t iid, 519 ipc_call_t *icall) 520 { 521 devman_handle_t handle = IPC_GET_ARG1(*icall); 522 523 fun_node_t *fun = find_fun_node(&device_tree, handle); 524 if (fun == NULL) { 525 async_answer_0(iid, ENOMEM); 526 return; 527 } 528 529 ipc_callid_t data_callid; 530 size_t data_len; 531 if (!async_data_read_receive(&data_callid, &data_len)) { 532 async_answer_0(iid, EINVAL); 533 return; 534 } 535 536 void *buffer = malloc(data_len); 537 if (buffer == NULL) { 538 async_answer_0(data_callid, ENOMEM); 539 async_answer_0(iid, ENOMEM); 540 return; 541 } 542 543 size_t sent_length = str_size(fun->pathname); 544 if (sent_length > data_len) { 545 sent_length = data_len; 546 } 547 548 async_data_read_finalize(data_callid, fun->pathname, sent_length); 549 async_answer_0(iid, EOK); 550 551 free(buffer); 552 } 553 517 554 518 555 /** Function for handling connections from a client to the device manager. */ … … 536 573 case DEVMAN_DEVICE_GET_HANDLE_BY_CLASS: 537 574 devman_function_get_handle_by_class(callid, &call); 575 break; 576 case DEVMAN_DEVICE_GET_DEVICE_PATH: 577 devman_get_device_path_by_handle(callid, &call); 538 578 break; 539 579 default:
Note:
See TracChangeset
for help on using the changeset viewer.