Changes in / [652f484:4d20ef7] in mainline
- Files:
-
- 4 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r652f484 r4d20ef7 49 49 ./uspace/app/killall/killall 50 50 ./uspace/app/klog/klog 51 ./uspace/app/lsusb/lsusb52 51 ./uspace/app/mkfat/mkfat 53 52 ./uspace/app/netstart/netstart -
boot/Makefile.common
r652f484 r4d20ef7 128 128 $(USPACE_PATH)/app/killall/killall \ 129 129 $(USPACE_PATH)/app/mkfat/mkfat \ 130 $(USPACE_PATH)/app/lsusb/lsusb \131 130 $(USPACE_PATH)/app/sbi/sbi \ 132 131 $(USPACE_PATH)/app/redir/redir \ -
uspace/Makefile
r652f484 r4d20ef7 41 41 app/killall \ 42 42 app/klog \ 43 app/lsusb \44 43 app/mkfat \ 45 44 app/redir \ -
uspace/app/usbinfo/main.c
r652f484 r4d20ef7 45 45 #include <usb/usbdevice.h> 46 46 #include <usb/pipes.h> 47 #include <usb/host.h>48 47 #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 }80 48 81 49 static bool resolve_hc_handle_and_dev_addr(const char *devpath, … … 92 60 if (str_cmp(devpath, "virt") == 0) { 93 61 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;99 62 } 100 63 -
uspace/doc/doxygroups.h
r652f484 r4d20ef7 220 220 221 221 /** 222 * @defgroup lsusb HelenOS version of lsusb command223 * @ingroup usb224 * @brief Application for listing USB host controllers.225 * @details226 * List all found host controllers.227 */228 229 /**230 222 * @defgroup drvusbmid USB multi interface device driver 231 223 * @ingroup usb -
uspace/drv/ehci-hcd/main.c
r652f484 r4d20ef7 97 97 } 98 98 hc_fun->ops = &hc_ops; 99 ret = ddf_fun_bind(hc_fun); 99 100 100 ret = ddf_fun_bind(hc_fun);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",107 103 str_error(ret)); 108 104 -
uspace/drv/ohci/ohci.c
r652f484 r4d20ef7 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 191 187 #undef CHECK_RET_HC_RETURN 192 188 -
uspace/drv/uhci-hcd/uhci.c
r652f484 r4d20ef7 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 216 212 #undef CHECK_RET_HC_RETURN 217 213 -
uspace/drv/vhc/main.c
r652f484 r4d20ef7 104 104 } 105 105 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 } 106 ddf_fun_add_to_class(hc, "usbhc"); 113 107 114 108 virtual_hub_device_init(hc); -
uspace/lib/c/generic/devman.c
r652f484 r4d20ef7 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 426 376 427 377 /** @} -
uspace/lib/c/include/devman.h
r652f484 r4d20ef7 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);58 57 59 58 extern int devman_add_device_to_class(devman_handle_t, const char *); -
uspace/lib/c/include/ipc/devman.h
r652f484 r4d20ef7 149 149 typedef enum { 150 150 DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD, 151 DEVMAN_DEVICE_GET_HANDLE_BY_CLASS, 152 DEVMAN_DEVICE_GET_DEVICE_PATH 151 DEVMAN_DEVICE_GET_HANDLE_BY_CLASS 153 152 } client_to_devman_t; 154 153 -
uspace/lib/usb/Makefile
r652f484 r4d20ef7 46 46 src/hidparser.c \ 47 47 src/hiddescriptor.c \ 48 src/host.c \49 48 src/hub.c \ 50 49 src/pipepriv.c \ -
uspace/lib/usb/include/usb/usb.h
r652f484 r4d20ef7 172 172 } usb_packet_id; 173 173 174 /** Class name for USB host controllers. */175 #define USB_HC_DDF_CLASS_NAME "usbhc"176 177 174 #endif 178 175 /** -
uspace/srv/devman/main.c
r652f484 r4d20ef7 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 554 517 555 518 /** Function for handling connections from a client to the device manager. */ … … 573 536 case DEVMAN_DEVICE_GET_HANDLE_BY_CLASS: 574 537 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);578 538 break; 579 539 default:
Note:
See TracChangeset
for help on using the changeset viewer.