Changes in / [818dc00:aca85e4] in mainline
- Files:
-
- 7 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r818dc00 raca85e4 62 62 ./uspace/app/trace/trace 63 63 ./uspace/app/usb/usb 64 ./uspace/app/usbinfo/usbinfo65 64 ./uspace/app/virtusbkbd/vuk 66 ./uspace/dist/app/* 65 ./uspace/dist/app/bdsh 66 ./uspace/dist/app/edit 67 ./uspace/dist/app/getterm 68 ./uspace/dist/app/klog 69 ./uspace/dist/app/mkfat 70 ./uspace/dist/app/netecho 71 ./uspace/dist/app/netstart 72 ./uspace/dist/app/nettest1 73 ./uspace/dist/app/nettest2 74 ./uspace/dist/app/ping 75 ./uspace/dist/app/redir 76 ./uspace/dist/app/sbi 77 ./uspace/dist/app/stats 78 ./uspace/dist/app/taskdump 79 ./uspace/dist/app/tasks 80 ./uspace/dist/app/tester 81 ./uspace/dist/app/test_serial 82 ./uspace/dist/app/tetris 83 ./uspace/dist/app/top 84 ./uspace/dist/app/trace 85 ./uspace/dist/app/usb 86 ./uspace/dist/app/vuk 67 87 ./uspace/dist/cfg/net/general 68 88 ./uspace/dist/cfg/net/lo -
boot/Makefile.common
r818dc00 raca85e4 142 142 $(USPACE_PATH)/app/ping/ping \ 143 143 $(USPACE_PATH)/app/stats/stats \ 144 $(USPACE_PATH)/app/virtusbkbd/vuk \ 144 145 $(USPACE_PATH)/app/tasks/tasks \ 145 $(USPACE_PATH)/app/top/top \ 146 $(USPACE_PATH)/app/usbinfo/usbinfo \ 147 $(USPACE_PATH)/app/virtusbkbd/vuk 146 $(USPACE_PATH)/app/top/top 148 147 149 148 ifneq ($(CONFIG_BAREBONE),y) -
uspace/Makefile
r818dc00 raca85e4 49 49 app/trace \ 50 50 app/top \ 51 app/usbinfo \52 51 app/virtusbkbd \ 53 52 app/netecho \ -
uspace/drv/uhci/main.c
r818dc00 raca85e4 27 27 */ 28 28 #include <usb/hcdhubd.h> 29 #include <usb/debug.h>30 29 #include <errno.h> 31 30 #include "uhci.h" … … 37 36 static int uhci_add_device(device_t *device) 38 37 { 39 usb_dprintf(NAME, 1, "uhci_add_device() called\n");40 38 device->ops = &uhci_ops; 41 39 … … 43 41 * We need to announce the presence of our root hub. 44 42 */ 45 usb_dprintf(NAME, 2, "adding root hub\n");46 43 usb_hcd_add_root_hub(device); 47 44 … … 64 61 */ 65 62 sleep(5); 66 usb_dprintf_enable(NAME, 5);67 63 68 64 return driver_main(&uhci_driver); -
uspace/drv/vhc/connhost.c
r818dc00 raca85e4 58 58 case USB_DIRECTION_IN: 59 59 transfer->in_callback(transfer->dev, 60 outcome, size,60 size, outcome, 61 61 transfer->arg); 62 62 break; -
uspace/drv/vhc/debug.c
r818dc00 raca85e4 35 35 #include <stdio.h> 36 36 #include <ipc/ipc.h> 37 #include <usb/debug.h>38 37 39 38 #include "vhcd.h" 40 39 40 /** Current debug level. */ 41 int debug_level = 0; 42 43 /** Debugging printf. 44 * This function is intended for single-line messages as it 45 * automatically prints debugging prefix at the beginning of the 46 * line. 47 * 48 * @see printf 49 * @param level Debugging level. 50 */ 51 void dprintf(int level, const char *format, ...) 52 { 53 if (level > debug_level) { 54 return; 55 } 56 57 printf("%s(%d): ", NAME, level); 58 va_list args; 59 va_start(args, format); 60 vprintf(format, args); 61 va_end(args); 62 printf("\n"); 63 } 41 64 42 65 /** Debug print informing of invalid call. -
uspace/drv/vhc/hcd.c
r818dc00 raca85e4 111 111 printf("%s: virtual USB host controller driver.\n", NAME); 112 112 113 usb_dprintf_enable(NAME, 10);113 debug_level = 10; 114 114 115 115 fid_t fid = fibril_create(hc_manager_fibril, NULL); -
uspace/drv/vhc/vhcd.h
r818dc00 raca85e4 36 36 #define VHCD_VHCD_H_ 37 37 38 #include <usb/debug.h>39 40 38 #define NAME "vhc" 41 39 #define NAME_DEV "hcd-virt-dev" … … 45 43 #define DEVMAP_PATH_DEV NAMESPACE "/" NAME_DEV 46 44 47 #define dprintf(level, format, ...) \ 48 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 45 extern int debug_level; 46 void dprintf(int, const char *, ...); 49 47 void dprintf_inval_call(int, ipc_call_t, ipcarg_t); 50 48 -
uspace/lib/c/include/ipc/dev_iface.h
r818dc00 raca85e4 54 54 DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX) 55 55 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 56 67 57 #endif -
uspace/lib/drv/generic/remote_usbhc.c
r818dc00 raca85e4 108 108 } 109 109 110 devman_handle_t handle = DEV_IPC_GET_ARG1(*call);110 devman_handle_t handle = IPC_GET_ARG1(*call); 111 111 112 112 usb_address_t address; … … 122 122 ipc_callid_t callid, ipc_call_t *call) 123 123 { 124 ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);124 ipcarg_t buffer_hash = IPC_GET_ARG1(*call); 125 125 async_transaction_t * trans = (async_transaction_t *)buffer_hash; 126 126 if (trans == NULL) { … … 144 144 accepted_size = trans->size; 145 145 } 146 async_data_read_finalize(c id, trans->buffer, accepted_size);146 async_data_read_finalize(callid, trans->buffer, accepted_size); 147 147 148 148 ipc_answer_1(callid, EOK, accepted_size); … … 211 211 } 212 212 213 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);214 devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call);213 usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call); 214 devman_handle_t handle = (devman_handle_t) IPC_GET_ARG2(*call); 215 215 216 216 int rc = usb_iface->bind_address(device, address, handle); … … 229 229 } 230 230 231 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);231 usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call); 232 232 233 233 int rc = usb_iface->release_address(device, address); … … 275 275 } 276 276 277 size_t expected_len = DEV_IPC_GET_ARG3(*call);277 size_t expected_len = IPC_GET_ARG3(*call); 278 278 usb_target_t target = { 279 .address = DEV_IPC_GET_ARG1(*call),280 .endpoint = DEV_IPC_GET_ARG2(*call)279 .address = IPC_GET_ARG1(*call), 280 .endpoint = IPC_GET_ARG2(*call) 281 281 }; 282 282 … … 327 327 } 328 328 329 size_t len = DEV_IPC_GET_ARG3(*call);329 size_t len = IPC_GET_ARG3(*call); 330 330 usb_target_t target = { 331 .address = DEV_IPC_GET_ARG1(*call),332 .endpoint = DEV_IPC_GET_ARG2(*call)331 .address = IPC_GET_ARG1(*call), 332 .endpoint = IPC_GET_ARG2(*call) 333 333 }; 334 334 … … 384 384 385 385 usb_target_t target = { 386 .address = DEV_IPC_GET_ARG1(*call),387 .endpoint = DEV_IPC_GET_ARG2(*call)386 .address = IPC_GET_ARG1(*call), 387 .endpoint = IPC_GET_ARG2(*call) 388 388 }; 389 389 -
uspace/lib/usb/Makefile
r818dc00 raca85e4 34 34 SOURCES = \ 35 35 src/addrkeep.c \ 36 src/debug.c \37 src/drvpsync.c \38 36 src/hcdhubd.c \ 39 37 src/hcdrv.c \ -
uspace/lib/usb/include/usb/usb.h
r818dc00 raca85e4 71 71 /** Default USB address. */ 72 72 #define USB_ADDRESS_DEFAULT 0 73 /** Maximum address number in USB 1.1. */74 #define USB11_ADDRESS_MAX 12875 73 76 74 /** USB endpoint number type. -
uspace/lib/usb/include/usb/usbdrv.h
r818dc00 raca85e4 38 38 #include <usb/usb.h> 39 39 #include <driver.h> 40 #include <usb/devreq.h>41 #include <usb/descriptor.h>42 40 43 41 int usb_drv_hc_connect(device_t *, unsigned int); … … 56 54 void *, size_t, size_t *, usb_handle_t *); 57 55 58 int usb_drv_psync_interrupt_out(int, usb_target_t, void *, size_t);59 int usb_drv_psync_interrupt_in(int, usb_target_t, void *, size_t, size_t *);60 61 62 63 56 int usb_drv_async_control_write_setup(int, usb_target_t, 64 57 void *, size_t, usb_handle_t *); … … 67 60 int usb_drv_async_control_write_status(int, usb_target_t, 68 61 usb_handle_t *); 69 70 int usb_drv_psync_control_write_setup(int, usb_target_t, void *, size_t);71 int usb_drv_psync_control_write_data(int, usb_target_t, void *, size_t);72 int usb_drv_psync_control_write_status(int, usb_target_t);73 74 62 75 63 int usb_drv_async_control_read_setup(int, usb_target_t, … … 80 68 usb_handle_t *); 81 69 82 int usb_drv_psync_control_read_setup(int, usb_target_t, void *, size_t);83 int usb_drv_psync_control_read_data(int, usb_target_t, void *, size_t, size_t *);84 int usb_drv_psync_control_read_status(int, usb_target_t);85 86 87 70 int usb_drv_async_wait_for(usb_handle_t); 88 71 89 72 90 73 int usb_drv_req_set_address(int, usb_address_t, usb_address_t); 91 int usb_drv_req_get_device_descriptor(int, usb_address_t,92 usb_standard_device_descriptor_t *);93 74 94 75 #endif -
uspace/lib/usb/src/usbdrvreq.c
r818dc00 raca85e4 34 34 */ 35 35 #include <usb/usbdrv.h> 36 #include <usb/devreq.h> 36 37 #include <errno.h> 37 38 … … 94 95 } 95 96 96 /** Retrieve device descriptor of connected USB device.97 *98 * @param[in] phone Open phone to HC driver.99 * @param[in] address Device USB address.100 * @param[out] descriptor Storage for the device descriptor.101 * @return Error code.102 * @retval EBADMEM @p descriptor is NULL.103 */104 int usb_drv_req_get_device_descriptor(int phone, usb_address_t address,105 usb_standard_device_descriptor_t *descriptor)106 {107 if (descriptor == NULL) {108 return EBADMEM;109 }110 111 /* Prepare the target. */112 usb_target_t target = {113 .address = address,114 .endpoint = 0115 };116 117 /* Prepare the setup packet. */118 usb_device_request_setup_packet_t setup_packet = {119 .request_type = 128,120 .request = USB_DEVREQ_GET_DESCRIPTOR,121 .index = 0,122 .length = sizeof(usb_standard_device_descriptor_t)123 };124 setup_packet.value_high = USB_DESCTYPE_DEVICE;125 setup_packet.value_low = 0;126 127 usb_handle_t handle;128 int rc;129 130 /* Start the control read transfer. */131 rc = usb_drv_async_control_read_setup(phone, target,132 &setup_packet, sizeof(usb_device_request_setup_packet_t), &handle);133 if (rc != EOK) {134 return rc;135 }136 rc = usb_drv_async_wait_for(handle);137 if (rc != EOK) {138 return rc;139 }140 141 /* Retrieve the descriptor. */142 size_t actually_transferred = 0;143 usb_standard_device_descriptor_t descriptor_tmp;144 rc = usb_drv_async_control_read_data(phone, target,145 &descriptor_tmp, sizeof(usb_standard_device_descriptor_t),146 &actually_transferred, &handle);147 if (rc != EOK) {148 return rc;149 }150 rc = usb_drv_async_wait_for(handle);151 if (rc != EOK) {152 return rc;153 }154 155 /* Finish the control read transfer. */156 rc = usb_drv_async_control_read_status(phone, target, &handle);157 if (rc != EOK) {158 return rc;159 }160 rc = usb_drv_async_wait_for(handle);161 if (rc != EOK) {162 return rc;163 }164 165 if (actually_transferred < sizeof(usb_standard_device_descriptor_t)) {166 return ELIMIT;167 }168 169 /*170 * Everything is okay, copy the descriptor.171 */172 memcpy(descriptor, &descriptor_tmp,173 sizeof(usb_standard_device_descriptor_t));174 175 return EOK;176 }177 178 179 180 97 /** 181 98 * @}
Note:
See TracChangeset
for help on using the changeset viewer.