Changeset f126c87 in mainline for uspace/lib
- Timestamp:
- 2016-09-01T16:46:27Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a2fbc8
- Parents:
- 9befb0d (diff), bdfdc51c (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. - Location:
- uspace/lib
- Files:
-
- 60 edited
-
c/arch/amd64/src/stacktrace_asm.S (modified) (1 diff)
-
c/arch/arm32/src/eabi.S (modified) (1 diff)
-
c/arch/arm32/src/stacktrace_asm.S (modified) (1 diff)
-
c/arch/ia32/src/rtld/reloc.c (modified) (3 diffs)
-
c/arch/ia32/src/syscall.S (modified) (1 diff)
-
c/arch/ia64/src/fibril.S (modified) (1 diff)
-
c/arch/ia64/src/stacktrace_asm.S (modified) (1 diff)
-
c/arch/ia64/src/syscall.S (modified) (1 diff)
-
c/arch/mips32/src/entryjmp.S (modified) (1 diff)
-
c/generic/async.c (modified) (3 diffs)
-
c/generic/dnsr.c (modified) (1 diff)
-
c/generic/rtld/module.c (modified) (5 diffs)
-
c/generic/tls.c (modified) (3 diffs)
-
c/include/fibril.h (modified) (1 diff)
-
drv/generic/driver.c (modified) (2 diffs)
-
drv/generic/remote_ahci.c (modified) (2 diffs)
-
drv/generic/remote_usb.c (modified) (4 diffs)
-
drv/include/usb_iface.h (modified) (1 diff)
-
drv/include/usbhc_iface.h (modified) (1 diff)
-
gui/button.c (modified) (3 diffs)
-
gui/button.h (modified) (1 diff)
-
gui/canvas.c (modified) (3 diffs)
-
gui/canvas.h (modified) (1 diff)
-
gui/connection.c (modified) (2 diffs)
-
gui/grid.c (modified) (4 diffs)
-
gui/grid.h (modified) (1 diff)
-
gui/label.c (modified) (3 diffs)
-
gui/label.h (modified) (1 diff)
-
gui/minimal.c (modified) (3 diffs)
-
gui/minimal.h (modified) (2 diffs)
-
gui/terminal.c (modified) (3 diffs)
-
gui/terminal.h (modified) (1 diff)
-
gui/widget.c (modified) (4 diffs)
-
gui/widget.h (modified) (2 diffs)
-
gui/window.c (modified) (2 diffs)
-
gui/window.h (modified) (1 diff)
-
math/arch/amd64/src/sin.S (modified) (1 diff)
-
math/arch/ia32/src/cos.S (modified) (1 diff)
-
math/arch/ia32/src/sin.S (modified) (1 diff)
-
math/arch/ia32/src/trunc.S (modified) (1 diff)
-
uri/Makefile (modified) (1 diff)
-
usb/include/usb/classes/hub.h (modified) (2 diffs)
-
usb/include/usb/debug.h (modified) (1 diff)
-
usb/include/usb/descriptor.h (modified) (3 diffs)
-
usb/include/usb/dev.h (modified) (2 diffs)
-
usb/include/usb/usb.h (modified) (5 diffs)
-
usb/src/usb.c (modified) (1 diff)
-
usbdev/include/usb/dev/poll.h (modified) (1 diff)
-
usbdev/include/usb/dev/recognise.h (modified) (1 diff)
-
usbdev/src/devdrv.c (modified) (8 diffs)
-
usbdev/src/devpoll.c (modified) (4 diffs)
-
usbdev/src/pipes.c (modified) (1 diff)
-
usbdev/src/pipesinit.c (modified) (1 diff)
-
usbdev/src/recognise.c (modified) (2 diffs)
-
usbdev/src/request.c (modified) (5 diffs)
-
usbhost/include/usb/host/endpoint.h (modified) (2 diffs)
-
usbhost/include/usb/host/hcd.h (modified) (3 diffs)
-
usbhost/src/usb_transfer_batch.c (modified) (1 diff)
-
usbvirt/include/usbvirt/device.h (modified) (2 diffs)
-
usbvirt/src/ctrltransfer.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/amd64/src/stacktrace_asm.S
r9befb0d rf126c87 44 44 ret 45 45 FUNCTION_END(stacktrace_pc_get) 46 -
uspace/lib/c/arch/arm32/src/eabi.S
r9befb0d rf126c87 95 95 mov pc, lr 96 96 FUNCTION_END(__aeabi_uldivmod) 97 -
uspace/lib/c/arch/arm32/src/stacktrace_asm.S
r9befb0d rf126c87 44 44 mov pc, lr 45 45 FUNCTION_END(stacktrace_pc_get) 46 -
uspace/lib/c/arch/ia32/src/rtld/reloc.c
r9befb0d rf126c87 69 69 uint32_t sym_size; 70 70 char *str_tab; 71 71 72 72 elf_symbol_t *sym_def; 73 73 module_t *dest; … … 80 80 81 81 DPRINTF("address: 0x%x, entries: %d\n", (uintptr_t)rt, rt_entries); 82 82 83 83 for (i = 0; i < rt_entries; ++i) { 84 84 // DPRINTF("symbol %d: ", i); … … 171 171 memcpy(r_ptr, (const void *)sym_addr, sym_size); 172 172 break; 173 173 174 174 case R_386_RELATIVE: 175 175 DPRINTF("fixup R_386_RELATIVE (b+a)\n"); -
uspace/lib/c/arch/ia32/src/syscall.S
r9befb0d rf126c87 63 63 FUNCTION_END(__syscall_slow) 64 64 65 66 65 /** Syscall wrapper - SYSENTER version. 67 66 * -
uspace/lib/c/arch/ia64/src/fibril.S
r9befb0d rf126c87 338 338 br.ret.sptk.many b0 339 339 FUNCTION_END(context_restore) 340 -
uspace/lib/c/arch/ia64/src/stacktrace_asm.S
r9befb0d rf126c87 41 41 FUNCTION_END(stacktrace_fp_get) 42 42 FUNCTION_END(stacktrace_pc_get) 43 -
uspace/lib/c/arch/ia64/src/syscall.S
r9befb0d rf126c87 45 45 br.ret.sptk.many b0 46 46 FUNCTION_END(__syscall) 47 -
uspace/lib/c/arch/mips32/src/entryjmp.S
r9befb0d rf126c87 51 51 addiu $sp, ABI_STACK_FRAME 52 52 FUNCTION_END(entry_point_jmp) 53 -
uspace/lib/c/generic/async.c
r9befb0d rf126c87 992 992 * @param callid Hash of the incoming call. 993 993 * @param call Data of the incoming call. 994 * 994 995 */ 995 996 static void process_notification(ipc_callid_t callid, ipc_call_t *call) … … 1317 1318 fibril_t *fibril = (fibril_t *) __tcb_get()->fibril_data; 1318 1319 unsigned oldsw = fibril->switches; 1319 1320 1320 1321 process_notification(callid, call); 1321 1322 1322 1323 if (oldsw != fibril->switches) { 1323 1324 /* … … 1335 1336 fibril_switch(FIBRIL_FROM_DEAD); 1336 1337 } 1338 1337 1339 return; 1338 1340 } -
uspace/lib/c/generic/dnsr.c
r9befb0d rf126c87 124 124 return (int) retval; 125 125 } 126 126 127 127 size_t act_size = IPC_GET_ARG2(answer_cname); 128 128 assert(act_size <= DNSR_NAME_MAX_SIZE); 129 129 130 130 cname_buf[act_size] = '\0'; 131 131 132 132 info->cname = str_dup(cname_buf); 133 133 134 134 if (info->cname == NULL) { 135 135 free(info); -
uspace/lib/c/generic/rtld/module.c
r9befb0d rf126c87 151 151 } 152 152 } 153 153 154 154 return NULL; /* Not found */ 155 155 } … … 167 167 module_t *m; 168 168 int rc; 169 169 170 170 m = calloc(1, sizeof(module_t)); 171 171 if (m == NULL) { … … 173 173 exit(1); 174 174 } 175 175 176 176 m->rtld = rtld; 177 177 m->id = rtld_get_next_id(rtld); … … 217 217 /* Insert into the list of loaded modules */ 218 218 list_append(&m->modules_link, &rtld->modules); 219 219 220 220 /* Copy TLS info */ 221 221 m->tdata = info.tls.tdata; … … 223 223 m->tbss_size = info.tls.tbss_size; 224 224 m->tls_align = info.tls.tls_align; 225 225 226 226 DPRINTF("tdata at %p size %zu, tbss size %zu\n", 227 227 m->tdata, m->tdata_size, m->tbss_size); -
uspace/lib/c/generic/tls.c
r9befb0d rf126c87 74 74 tcb_t *tcb; 75 75 size_t tls_size = &_tbss_end - &_tdata_start; 76 76 77 77 #ifdef CONFIG_RTLD 78 78 if (runtime_env != NULL) 79 79 return rtld_tls_make(runtime_env); 80 80 #endif 81 81 82 tcb = tls_alloc_arch(&data, tls_size); 82 83 if (!tcb) 83 84 return NULL; 84 85 85 86 /* 86 87 * Copy thread local data from the initialization image. … … 118 119 if (!tcb) 119 120 return NULL; 120 *data = ((void *)tcb) + sizeof(tcb_t); 121 122 *data = ((void *) tcb) + sizeof(tcb_t); 121 123 #ifdef CONFIG_RTLD 122 124 tcb->dtv = NULL; … … 148 150 { 149 151 tcb_t *tcb; 150 152 151 153 size = ALIGN_UP(size, &_tls_alignment); 152 154 *data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size); -
uspace/lib/c/include/fibril.h
r9befb0d rf126c87 79 79 fibril_owner_info_t *waits_for; 80 80 81 unsigned switches;81 unsigned int switches; 82 82 } fibril_t; 83 83 -
uspace/lib/drv/generic/driver.c
r9befb0d rf126c87 126 126 return; 127 127 } 128 128 129 129 ddf_dev_t *dev = create_device(); 130 130 if (!dev) { … … 133 133 return; 134 134 } 135 135 136 136 /* Add one reference that will be dropped by driver_dev_remove() */ 137 137 dev_add_ref(dev); -
uspace/lib/drv/generic/remote_ahci.c
r9befb0d rf126c87 226 226 return; 227 227 } 228 228 229 229 const int ret = ahci_iface->get_sata_device_name(fun, 230 230 sata_dev_name_length, sata_dev_name); … … 235 235 (real_size == sata_dev_name_length)) 236 236 async_data_read_finalize(cid, sata_dev_name, sata_dev_name_length); 237 237 238 238 free(sata_dev_name); 239 239 async_answer_0(callid, ret); -
uspace/lib/drv/generic/remote_usb.c
r9befb0d rf126c87 91 91 92 92 /** Tell devman handle of the usb device function. 93 * @param[in] exch IPC communication exchange 93 * 94 * @param[in] exch IPC communication exchange 94 95 * @param[out] handle devman handle of the HC used by the target device. 96 * 95 97 * @return Error code. 98 * 96 99 */ 97 100 int usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle) … … 119 122 120 123 /** Release default USB address. 124 * 121 125 * @param[in] exch IPC communication exchange 126 * 122 127 * @return Error code. 128 * 123 129 */ 124 130 int usb_release_default_address(async_exch_t *exch) … … 131 137 132 138 /** Trigger USB device enumeration 133 * @param[in] exch IPC communication exchange 139 * 140 * @param[in] exch IPC communication exchange 134 141 * @param[out] handle Identifier of the newly added device (if successful) 142 * 135 143 * @return Error code. 144 * 136 145 */ 137 146 int usb_device_enumerate(async_exch_t *exch, unsigned port) … … 145 154 146 155 /** Trigger USB device enumeration 147 * @param[in] exch IPC communication exchange 156 * 157 * @param[in] exch IPC communication exchange 148 158 * @param[in] handle Identifier of the device 159 * 149 160 * @return Error code. 161 * 150 162 */ 151 163 int usb_device_remove(async_exch_t *exch, unsigned port) -
uspace/lib/drv/include/usb_iface.h
r9befb0d rf126c87 44 44 typedef async_sess_t usb_dev_session_t; 45 45 46 usb_dev_session_t *usb_dev_connect(devman_handle_t);47 usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *);48 void usb_dev_disconnect(usb_dev_session_t *);46 extern usb_dev_session_t *usb_dev_connect(devman_handle_t); 47 extern usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *); 48 extern void usb_dev_disconnect(usb_dev_session_t *); 49 49 50 int usb_get_my_interface(async_exch_t *, int *);51 int usb_get_my_device_handle(async_exch_t *, devman_handle_t *);50 extern int usb_get_my_interface(async_exch_t *, int *); 51 extern int usb_get_my_device_handle(async_exch_t *, devman_handle_t *); 52 52 53 int usb_reserve_default_address(async_exch_t *, usb_speed_t);54 int usb_release_default_address(async_exch_t *);53 extern int usb_reserve_default_address(async_exch_t *, usb_speed_t); 54 extern int usb_release_default_address(async_exch_t *); 55 55 56 int usb_device_enumerate(async_exch_t *, unsigned port);57 int usb_device_remove(async_exch_t *, unsigned port);56 extern int usb_device_enumerate(async_exch_t *, unsigned port); 57 extern int usb_device_remove(async_exch_t *, unsigned port); 58 58 59 int usb_register_endpoint(async_exch_t *, usb_endpoint_t, usb_transfer_type_t, 60 usb_direction_t, size_t, unsigned, unsigned); 61 int usb_unregister_endpoint(async_exch_t *, usb_endpoint_t, usb_direction_t); 62 int usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t, size_t *); 63 int usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *, size_t); 59 extern int usb_register_endpoint(async_exch_t *, usb_endpoint_t, 60 usb_transfer_type_t, usb_direction_t, size_t, unsigned, unsigned); 61 extern int usb_unregister_endpoint(async_exch_t *, usb_endpoint_t, 62 usb_direction_t); 63 extern int usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t, 64 size_t *); 65 extern int usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *, 66 size_t); 64 67 65 68 /** Callback for outgoing transfer. */ -
uspace/lib/drv/include/usbhc_iface.h
r9befb0d rf126c87 44 44 #include <stdbool.h> 45 45 46 int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,46 extern int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t, 47 47 uint64_t, void *, size_t, size_t *); 48 int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,48 extern int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t, 49 49 uint64_t, const void *, size_t); 50 50 -
uspace/lib/gui/button.c
r9befb0d rf126c87 147 147 } 148 148 149 bool init_button(button_t *btn, widget_t *parent, const char *caption, 150 uint16_t points, pixel_t background, pixel_t foreground, pixel_t text) 151 { 152 widget_init(&btn->widget, parent); 149 bool init_button(button_t *btn, widget_t *parent, const void *data, 150 const char *caption, uint16_t points, pixel_t background, 151 pixel_t foreground, pixel_t text) 152 { 153 widget_init(&btn->widget, parent, data); 153 154 154 155 btn->widget.destroy = button_destroy; … … 191 192 } 192 193 193 button_t *create_button(widget_t *parent, const char *caption, uint16_t points,194 pixel_t background, pixel_t foreground, pixel_t text)194 button_t *create_button(widget_t *parent, const void *data, const char *caption, 195 uint16_t points, pixel_t background, pixel_t foreground, pixel_t text) 195 196 { 196 197 button_t *btn = (button_t *) malloc(sizeof(button_t)); … … 198 199 return NULL; 199 200 200 if (init_button(btn, parent, caption, points, background, foreground,201 if (init_button(btn, parent, data, caption, points, background, foreground, 201 202 text)) 202 203 return btn; -
uspace/lib/gui/button.h
r9befb0d rf126c87 56 56 } button_t; 57 57 58 extern bool init_button(button_t *, widget_t *, const char *, uint16_t, pixel_t,59 pixel_t, pixel_t);60 extern button_t *create_button(widget_t *, const char *, uint16_t, pixel_t,61 pixel_t, pixel_t );58 extern bool init_button(button_t *, widget_t *, const void *, const char *, 59 uint16_t, pixel_t, pixel_t, pixel_t); 60 extern button_t *create_button(widget_t *, const void *, const char *, uint16_t, 61 pixel_t, pixel_t, pixel_t); 62 62 extern void deinit_button(button_t *); 63 63 -
uspace/lib/gui/canvas.c
r9befb0d rf126c87 123 123 } 124 124 125 bool init_canvas(canvas_t *canvas, widget_t *parent, sysarg_t width,126 sysarg_t height, surface_t *surface)125 bool init_canvas(canvas_t *canvas, widget_t *parent, const void *data, 126 sysarg_t width, sysarg_t height, surface_t *surface) 127 127 { 128 widget_init(&canvas->widget, parent );128 widget_init(&canvas->widget, parent, data); 129 129 130 130 canvas->widget.width = width; … … 161 161 } 162 162 163 canvas_t *create_canvas(widget_t *parent, sysarg_t width, sysarg_t height,164 s urface_t *surface)163 canvas_t *create_canvas(widget_t *parent, const void *data, sysarg_t width, 164 sysarg_t height, surface_t *surface) 165 165 { 166 166 canvas_t *canvas = (canvas_t *) malloc(sizeof(canvas_t)); … … 168 168 return NULL; 169 169 170 if (init_canvas(canvas, parent, width, height, surface))170 if (init_canvas(canvas, parent, data, width, height, surface)) 171 171 return canvas; 172 172 -
uspace/lib/gui/canvas.h
r9befb0d rf126c87 53 53 } canvas_t; 54 54 55 extern bool init_canvas(canvas_t *, widget_t *, sysarg_t, sysarg_t, 55 extern bool init_canvas(canvas_t *, widget_t *, const void *, sysarg_t, 56 sysarg_t, surface_t *); 57 extern canvas_t *create_canvas(widget_t *, const void *, sysarg_t, sysarg_t, 56 58 surface_t *); 57 extern canvas_t *create_canvas(widget_t *, sysarg_t, sysarg_t, surface_t *);58 59 extern bool update_canvas(canvas_t *, surface_t *); 59 60 extern void deinit_canvas(canvas_t *); -
uspace/lib/gui/connection.c
r9befb0d rf126c87 198 198 list_foreach(sig_node->slots, link, slot_node_t, cur) { 199 199 void *data_copy = NULL; 200 if (data != NULL) {200 if (data != NULL) 201 201 data_copy = malloc(data_size); 202 }203 if (data_copy != NULL) {202 203 if (data_copy != NULL) 204 204 memcpy(data_copy, data, data_size); 205 }205 206 206 window_event_t *event = 207 (window_event_t *) malloc(sizeof(window_event_t));208 207 (window_event_t *) malloc(sizeof(window_event_t)); 208 209 209 if (event) { 210 210 link_initialize(&event->link); … … 215 215 prodcons_produce(&cur->widget->window->events, &event->link); 216 216 } else { 217 if (data_copy != NULL) {217 if (data_copy != NULL) 218 218 free(data_copy); 219 }220 219 } 221 220 } -
uspace/lib/gui/grid.c
r9befb0d rf126c87 363 363 } 364 364 365 bool init_grid(grid_t *grid, widget_t *parent, size_t cols, size_t rows,366 pixel_t background)365 bool init_grid(grid_t *grid, widget_t *parent, const void *data, size_t cols, 366 size_t rows, pixel_t background) 367 367 { 368 368 if ((cols == 0) || (rows == 0)) … … 376 376 memset(grid->layout, 0, cols * rows * sizeof(grid_cell_t)); 377 377 378 widget_init(&grid->widget, parent );378 widget_init(&grid->widget, parent, data); 379 379 380 380 grid->widget.destroy = grid_destroy; … … 393 393 } 394 394 395 grid_t *create_grid(widget_t *parent, size_t cols, size_t rows, pixel_t background) 395 grid_t *create_grid(widget_t *parent, const void *data, size_t cols, 396 size_t rows, pixel_t background) 396 397 { 397 398 grid_t *grid = (grid_t *) malloc(sizeof(grid_t)); … … 399 400 return NULL; 400 401 401 if (init_grid(grid, parent, cols, rows, background))402 if (init_grid(grid, parent, data, cols, rows, background)) 402 403 return grid; 403 404 -
uspace/lib/gui/grid.h
r9befb0d rf126c87 56 56 } grid_t; 57 57 58 extern bool init_grid(grid_t *, widget_t *, size_t, size_t, pixel_t); 59 extern grid_t *create_grid(widget_t *, size_t, size_t, pixel_t); 58 extern bool init_grid(grid_t *, widget_t *, const void *, size_t, size_t, 59 pixel_t); 60 extern grid_t *create_grid(widget_t *, const void *, size_t, size_t, pixel_t); 60 61 extern void deinit_grid(grid_t *); 61 62 -
uspace/lib/gui/label.c
r9befb0d rf126c87 140 140 } 141 141 142 bool init_label(label_t *lbl, widget_t *parent, const char *caption,143 uint16_t points, pixel_t background, pixel_t text)144 { 145 widget_init(&lbl->widget, parent );142 bool init_label(label_t *lbl, widget_t *parent, const void *data, 143 const char *caption, uint16_t points, pixel_t background, pixel_t text) 144 { 145 widget_init(&lbl->widget, parent, data); 146 146 147 147 lbl->widget.destroy = label_destroy; … … 184 184 } 185 185 186 label_t *create_label(widget_t *parent, const char *caption, uint16_t points,187 pixel_t background, pixel_t text)186 label_t *create_label(widget_t *parent, const void *data, const char *caption, 187 uint16_t points, pixel_t background, pixel_t text) 188 188 { 189 189 label_t *lbl = (label_t *) malloc(sizeof(label_t)); … … 191 191 return NULL; 192 192 193 if (init_label(lbl, parent, caption, points, background, text))193 if (init_label(lbl, parent, data, caption, points, background, text)) 194 194 return lbl; 195 195 -
uspace/lib/gui/label.h
r9befb0d rf126c87 55 55 } label_t; 56 56 57 extern bool init_label(label_t *, widget_t *, const char *, uint16_t, pixel_t,58 pixel_t);59 extern label_t *create_label(widget_t *, const char *, uint16_t, pixel_t,60 pixel_t );57 extern bool init_label(label_t *, widget_t *, const void *, const char *, 58 uint16_t, pixel_t, pixel_t); 59 extern label_t *create_label(widget_t *, const void *, const char *, uint16_t, 60 pixel_t, pixel_t); 61 61 extern void deinit_label(label_t *); 62 62 -
uspace/lib/gui/minimal.c
r9befb0d rf126c87 112 112 } 113 113 114 bool init_minimal(minimal_t *min, widget_t *parent, pixel_t a, pixel_t b) 114 bool init_minimal(minimal_t *min, widget_t *parent, const void *data, pixel_t a, 115 pixel_t b) 115 116 { 116 widget_init(&min->widget, parent );117 widget_init(&min->widget, parent, data); 117 118 118 119 min->widget.destroy = minimal_destroy; … … 129 130 } 130 131 131 minimal_t *create_minimal(widget_t *parent, pixel_t a, pixel_t b) 132 minimal_t *create_minimal(widget_t *parent, const void *data, pixel_t a, 133 pixel_t b) 132 134 { 133 135 minimal_t *min = (minimal_t *) malloc(sizeof(minimal_t)); … … 136 138 } 137 139 138 if (init_minimal(min, parent, a, b)) {140 if (init_minimal(min, parent, data, a, b)) { 139 141 return min; 140 142 } else { -
uspace/lib/gui/minimal.h
r9befb0d rf126c87 49 49 } minimal_t; 50 50 51 extern bool init_minimal(minimal_t *, widget_t *, pixel_t, pixel_t); 52 extern minimal_t *create_minimal(widget_t *, pixel_t, pixel_t); 51 extern bool init_minimal(minimal_t *, widget_t *, const void *, pixel_t, 52 pixel_t); 53 extern minimal_t *create_minimal(widget_t *, const void *, pixel_t, pixel_t); 53 54 extern void deinit_minimal(minimal_t *); 54 55 … … 57 58 /** @} 58 59 */ 59 -
uspace/lib/gui/terminal.c
r9befb0d rf126c87 696 696 } 697 697 698 bool init_terminal(terminal_t *term, widget_t *parent, sysarg_t width,699 sysarg_t height)700 { 701 widget_init(&term->widget, parent );698 bool init_terminal(terminal_t *term, widget_t *parent, const void *data, 699 sysarg_t width, sysarg_t height) 700 { 701 widget_init(&term->widget, parent, data); 702 702 703 703 link_initialize(&term->link); … … 771 771 } 772 772 773 terminal_t *create_terminal(widget_t *parent, sysarg_t width, sysarg_t height) 773 terminal_t *create_terminal(widget_t *parent, const void *data, sysarg_t width, 774 sysarg_t height) 774 775 { 775 776 terminal_t *term = (terminal_t *) malloc(sizeof(terminal_t)); … … 777 778 return NULL; 778 779 779 bool ret = init_terminal(term, parent, width, height);780 bool ret = init_terminal(term, parent, data, width, height); 780 781 if (!ret) { 781 782 free(term); -
uspace/lib/gui/terminal.h
r9befb0d rf126c87 70 70 } terminal_t; 71 71 72 extern bool init_terminal(terminal_t *, widget_t *, sysarg_t, sysarg_t); 73 extern terminal_t *create_terminal(widget_t *, sysarg_t, sysarg_t); 72 extern bool init_terminal(terminal_t *, widget_t *, const void *, sysarg_t, 73 sysarg_t); 74 extern terminal_t *create_terminal(widget_t *, const void *, sysarg_t, 75 sysarg_t); 74 76 extern void deinit_terminal(terminal_t *); 75 77 -
uspace/lib/gui/widget.c
r9befb0d rf126c87 36 36 #include "widget.h" 37 37 38 void widget_init(widget_t *widget, widget_t *parent) 38 /** Link widget with parent and initialize default position and size. */ 39 void widget_init(widget_t *widget, widget_t *parent, const void *data) 39 40 { 40 41 link_initialize(&widget->link); 41 42 list_initialize(&widget->children); 43 42 44 if (parent) { 43 45 widget->parent = parent; … … 48 50 widget->window = NULL; 49 51 } 50 52 53 widget->data = data; 54 51 55 widget->hpos = 0; 52 56 widget->vpos = 0; 53 57 widget->width = 0; 54 58 widget->height = 0; 55 59 56 60 widget->width_min = 0; 57 61 widget->height_min = 0; … … 62 66 } 63 67 68 /** Change position and size of the widget. */ 64 69 void widget_modify(widget_t *widget, sysarg_t hpos, sysarg_t vpos, 65 70 sysarg_t width, sysarg_t height) … … 71 76 } 72 77 78 /** Get custom client data */ 79 const void *widget_get_data(widget_t *widget) 80 { 81 return widget->data; 82 } 83 84 /** Unlink widget from its parent. */ 73 85 void widget_deinit(widget_t *widget) 74 86 { 75 if (widget->parent) {87 if (widget->parent) 76 88 list_remove(&widget->link); 77 }78 89 } 79 90 -
uspace/lib/gui/widget.h
r9befb0d rf126c87 53 53 struct widget { 54 54 link_t link; 55 widget_t *parent; /**< Parent widget of this widget. NULL for root widget. */ 56 list_t children; /**< Children widgets of this widget. */ 57 window_t *window; /**< Window into which this widget belongs. */ 58 55 widget_t *parent; /**< Parent widget of this widget. NULL for root widget. */ 56 list_t children; /**< Children widgets of this widget. */ 57 window_t *window; /**< Window into which this widget belongs. */ 58 const void *data; /**< Custom client data. */ 59 59 60 sysarg_t hpos; /**< Horizontal position in window coordinates. */ 60 61 sysarg_t vpos; /**< Vertical position in window coordinates. */ … … 128 129 */ 129 130 130 /** Link widget with parent and initialize default position and size. */ 131 extern void widget_init(widget_t *, widget_t *); 132 /** Just convenience function to change position and size of the widget. */ 131 extern void widget_init(widget_t *, widget_t *, const void *); 133 132 extern void widget_modify(widget_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t); 134 /** Unlink widget from its parent. */ 133 extern const void *widget_get_data(widget_t *); 135 134 extern void widget_deinit(widget_t *); 136 135 -
uspace/lib/gui/window.c
r9befb0d rf126c87 591 591 } 592 592 593 window_t *window_open(const char *winreg, window_flags_t flags,594 const char *caption)593 window_t *window_open(const char *winreg, const void *data, 594 window_flags_t flags, const char *caption) 595 595 { 596 596 window_t *win = (window_t *) malloc(sizeof(window_t)); … … 604 604 fibril_mutex_initialize(&win->guard); 605 605 606 widget_init(&win->root, NULL );606 widget_init(&win->root, NULL, data); 607 607 win->root.window = win; 608 608 win->root.destroy = root_destroy; -
uspace/lib/gui/window.h
r9befb0d rf126c87 67 67 * whole application. Note that opened window does not have any surface yet. 68 68 */ 69 extern window_t *window_open(const char *, window_flags_t, const char *); 69 extern window_t *window_open(const char *, const void *, window_flags_t, 70 const char *); 70 71 71 72 /** -
uspace/lib/math/arch/amd64/src/sin.S
r9befb0d rf126c87 77 77 retq 78 78 FUNCTION_END(sin_f64) 79 -
uspace/lib/math/arch/ia32/src/cos.S
r9befb0d rf126c87 64 64 ret 65 65 FUNCTION_END(cos_f64) 66 -
uspace/lib/math/arch/ia32/src/sin.S
r9befb0d rf126c87 64 64 ret 65 65 FUNCTION_END(sin_f64) 66 -
uspace/lib/math/arch/ia32/src/trunc.S
r9befb0d rf126c87 61 61 ret 62 62 FUNCTION_END(trunc_f64) 63 -
uspace/lib/uri/Makefile
r9befb0d rf126c87 31 31 SLIBRARY = liburi.so.0.0 32 32 LSONAME = liburi.so.0 33 #EXTRA_CFLAGS +=34 33 35 34 SOURCES = \ -
uspace/lib/usb/include/usb/classes/hub.h
r9befb0d rf126c87 110 110 */ 111 111 uint8_t characteristics; 112 112 113 #define HUB_CHAR_POWER_PER_PORT_FLAG (1 << 0) 113 114 #define HUB_CHAR_NO_POWER_SWITCH_FLAG (1 << 1) … … 196 197 */ 197 198 /* 7 (basic size) + 2*32 (port bitmasks) */ 198 #define USB_HUB_MAX_DESCRIPTOR_SIZE (7 + 2 * 32)199 #define USB_HUB_MAX_DESCRIPTOR_SIZE (7 + 2 * 32) 199 200 200 201 #endif -
uspace/lib/usb/include/usb/debug.h
r9befb0d rf126c87 38 38 #include <sys/types.h> 39 39 #include <io/log.h> 40 41 40 42 41 void usb_dump_standard_descriptor(FILE *, const char *, const char *, -
uspace/lib/usb/include/usb/descriptor.h
r9befb0d rf126c87 45 45 USB_DESCTYPE_INTERFACE = 4, 46 46 USB_DESCTYPE_ENDPOINT = 5, 47 /* New in USB 2.0 */47 /* New in USB 2.0 */ 48 48 USB_DESCTYPE_DEVICE_QUALIFIER = 6, 49 49 USB_DESCTYPE_OTHER_SPEED_CONFIGURATION = 7, … … 202 202 * HS INT and ISO transfers. */ 203 203 uint16_t max_packet_size; 204 204 205 #define ED_MPS_PACKET_SIZE_MASK 0x3ff 205 206 #define ED_MPS_PACKET_SIZE_GET(value) \ … … 207 208 #define ED_MPS_TRANS_OPPORTUNITIES_GET(value) \ 208 209 ((((value) >> 10) & 0x3) + 1) 210 209 211 /** Polling interval in milliseconds. 210 212 * Ignored for bulk and control endpoints. -
uspace/lib/usb/include/usb/dev.h
r9befb0d rf126c87 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup libusb 29 30 * @{ 30 31 */ 32 31 33 /** @file 32 34 * Common USB types and functions. 33 35 */ 36 34 37 #ifndef LIBUSB_DEV_H_ 35 38 #define LIBUSB_DEV_H_ … … 37 40 #include <devman.h> 38 41 39 int usb_resolve_device_handle(const char *, devman_handle_t *); 42 extern int usb_resolve_device_handle(const char *, devman_handle_t *); 43 40 44 #endif 45 41 46 /** 42 47 * @} -
uspace/lib/usb/include/usb/usb.h
r9befb0d rf126c87 114 114 /** Default USB address. */ 115 115 #define USB_ADDRESS_DEFAULT 0 116 116 117 /** Maximum address number in USB 1.1. */ 117 118 #define USB11_ADDRESS_MAX 127 … … 121 122 * 122 123 * @param ep USB address. 124 * 123 125 * @return True, if value is wihtin limits, false otherwise. 126 * 124 127 */ 125 128 static inline bool usb_address_is_valid(usb_address_t a) … … 135 138 /** Default control endpoint */ 136 139 #define USB_ENDPOINT_DEFAULT_CONTROL 0 140 137 141 /** Maximum endpoint number in USB 1.1. */ 138 142 #define USB11_ENDPOINT_MAX 16 … … 141 145 * 142 146 * @param ep USB endpoint number. 147 * 143 148 * @return True, if value is wihtin limits, false otherwise. 149 * 144 150 */ 145 151 static inline bool usb_endpoint_is_valid(usb_endpoint_t ep) … … 160 166 uint32_t packed; 161 167 } usb_target_t; 162 163 168 164 169 /** Check USB target for allowed values (address and endpoint). -
uspace/lib/usb/src/usb.c
r9befb0d rf126c87 121 121 * 122 122 * @param[in] requst Setup requst data. 123 * 123 124 * @retval -1 No endpoints need reset. 124 125 * @retval 0 All endpoints need reset. 125 126 * @retval >0 Specified endpoint needs reset. 127 * 126 128 */ 127 129 int usb_request_needs_toggle_reset( -
uspace/lib/usbdev/include/usb/dev/poll.h
r9befb0d rf126c87 94 94 typedef void (*usb_polling_terminted_callback_t)(usb_device_t *, bool, void *); 95 95 96 int usb_device_auto_polling(usb_device_t *, usb_endpoint_t,96 extern int usb_device_auto_polling(usb_device_t *, usb_endpoint_t, 97 97 const usb_device_auto_polling_t *, size_t); 98 98 99 int usb_device_auto_poll(usb_device_t *, usb_endpoint_t,99 extern int usb_device_auto_poll(usb_device_t *, usb_endpoint_t, 100 100 usb_polling_callback_t, size_t, int, usb_polling_terminted_callback_t, void *); 101 101 102 int usb_device_auto_polling_desc(usb_device_t *,102 extern int usb_device_auto_polling_desc(usb_device_t *, 103 103 const usb_endpoint_description_t *, const usb_device_auto_polling_t *, 104 104 size_t); 105 105 106 int usb_device_auto_poll_desc(usb_device_t *,106 extern int usb_device_auto_poll_desc(usb_device_t *, 107 107 const usb_endpoint_description_t *, usb_polling_callback_t, size_t, int, 108 108 usb_polling_terminted_callback_t, void *); -
uspace/lib/usbdev/include/usb/dev/recognise.h
r9befb0d rf126c87 50 50 51 51 extern int usb_device_create_match_ids(usb_pipe_t *, match_id_list_t *); 52 52 53 #endif 53 54 -
uspace/lib/usbdev/src/devdrv.c
r9befb0d rf126c87 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup libusbdev 30 31 * @{ … … 55 56 /** Connection to device on USB bus */ 56 57 usb_dev_session_t *bus_session; 58 57 59 /** devman handle */ 58 60 devman_handle_t handle; 61 59 62 /** The default control pipe. */ 60 63 usb_pipe_t ctrl_pipe; 61 64 62 65 /** Other endpoint pipes. 66 * 63 67 * This is an array of other endpoint pipes in the same order as 64 68 * in usb_driver_t. 65 69 */ 66 70 usb_endpoint_mapping_t *pipes; 71 67 72 /** Number of other endpoint pipes. */ 68 73 size_t pipes_count; 74 69 75 /** Current interface. 76 * 70 77 * Usually, drivers operate on single interface only. 71 78 * This item contains the value of the interface or -1 for any. 72 79 */ 73 80 int interface_no; 81 74 82 /** Alternative interfaces. */ 75 83 usb_alternate_interfaces_t alternate_interfaces; 84 76 85 /** Some useful descriptors for USB device. */ 77 86 usb_device_descriptors_t descriptors; 87 78 88 /** Generic DDF device backing this one. DO NOT TOUCH! */ 79 89 ddf_dev_t *ddf_dev; 90 80 91 /** Custom driver data. 92 * 81 93 * Do not use the entry in generic device, that is already used 82 94 * by the framework. 83 95 */ 84 96 void *driver_data; 85 86 97 } usb_device_t; 87 98 … … 135 146 return rc; 136 147 } 137 148 138 149 /* Change current alternative */ 139 150 usb_dev->alternate_interfaces.current = alternate_setting; … … 279 290 * 280 291 * @param[in] usb_dev USB device. 292 * 281 293 */ 282 294 void usb_device_destroy_pipes(usb_device_t *usb_dev) … … 284 296 assert(usb_dev); 285 297 assert(usb_dev->pipes || usb_dev->pipes_count == 0); 298 286 299 /* Destroy the pipes. */ 287 300 for (size_t i = 0; i < usb_dev->pipes_count; ++i) { … … 291 304 usb_pipe_unregister(&usb_dev->pipes[i].pipe); 292 305 } 306 293 307 free(usb_dev->pipes); 294 308 usb_dev->pipes = NULL; … … 448 462 assert(handle); 449 463 assert(iface_no); 464 450 465 async_exch_t *exch = async_exchange_begin(sess); 451 466 if (!exch) 452 467 return EPARTY; 468 453 469 int ret = usb_get_my_device_handle(exch, handle); 454 470 if (ret == EOK) { … … 459 475 } 460 476 } 477 461 478 async_exchange_end(exch); 462 479 return ret; -
uspace/lib/usbdev/src/devpoll.c
r9befb0d rf126c87 33 33 * USB device driver framework - automatic interrupt polling. 34 34 */ 35 35 36 #include <usb/dev/device.h> 36 37 #include <usb/dev/pipes.h> … … 85 86 86 87 if (params->debug > 0) { 87 const usb_endpoint_mapping_t *mapping 88 =data->polling_mapping;88 const usb_endpoint_mapping_t *mapping = 89 data->polling_mapping; 89 90 usb_log_debug("Poll (%p): started polling of `%s' - " \ 90 91 "interface %d (%s,%d,%d), %zuB/%zu.\n", … … 154 155 155 156 /* Take a rest before next request. */ 156 //TODO: This is broken, the time is in ms not us. 157 158 // FIXME TODO: This is broken, the time is in ms not us. 157 159 // but first we need to fix drivers to actually stop using this, 158 // since polling de aly should be implemented in HC schedule160 // since polling delay should be implemented in HC schedule 159 161 async_usleep(params->delay); 160 162 } … … 213 215 if (request_size == 0) 214 216 return EINVAL; 215 217 216 218 if (!epm || (epm->pipe.transfer_type != USB_TRANSFER_INTERRUPT) || 217 219 (epm->pipe.direction != USB_DIRECTION_IN)) 218 220 return EINVAL; 219 221 220 222 221 223 polling_data_t *polling_data = malloc(sizeof(polling_data_t)); -
uspace/lib/usbdev/src/pipes.c
r9befb0d rf126c87 98 98 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 99 99 size_t act_size = 0; 100 const int rc = usb_read(exch, 101 pipe->endpoint_no, setup_packet, buffer,buffer_size, &act_size);100 const int rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer, 101 buffer_size, &act_size); 102 102 async_exchange_end(exch); 103 103 -
uspace/lib/usbdev/src/pipesinit.c
r9befb0d rf126c87 286 286 usb_dev_session_t *bus_session) 287 287 { 288 289 if (config_descriptor == NULL) { 288 if (config_descriptor == NULL) 290 289 return EBADMEM; 291 }292 if (config_descriptor_size 293 <sizeof(usb_standard_configuration_descriptor_t)) {290 291 if (config_descriptor_size < 292 sizeof(usb_standard_configuration_descriptor_t)) { 294 293 return ERANGE; 295 294 } -
uspace/lib/usbdev/src/recognise.c
r9befb0d rf126c87 234 234 (int) device_descriptor->product_id, 235 235 BCD_ARGS(device_descriptor->device_version)); 236 236 237 237 /* Next, without release number. */ 238 238 ADD_MATCHID_OR_RETURN(matches, 90, … … 245 245 ADD_MATCHID_OR_RETURN(matches, 50, "usb&class=%s", 246 246 usb_str_class(device_descriptor->device_class)); 247 247 248 248 /* As a last resort, try fallback driver. */ 249 249 ADD_MATCHID_OR_RETURN(matches, 10, "usb&fallback"); -
uspace/lib/usbdev/src/request.c
r9befb0d rf126c87 50 50 * @see usb_pipe_control_write 51 51 * 52 * @param pipe Pipe used for the communication.52 * @param pipe Pipe used for the communication. 53 53 * @param request_type Request type (standard/class/vendor). 54 * @param recipient Request recipient (e.g. device or endpoint). 55 * @param request Actual request (e.g. GET_DESCRIPTOR). 56 * @param value Value of @c wValue field of setup packet 57 * (must be in USB endianness). 58 * @param index Value of @c wIndex field of setup packet 59 * (must be in USB endianness). 60 * @param data Data to be sent during DATA stage 61 * (expected to be in USB endianness). 62 * @param data_size Size of the @p data buffer (in native endianness). 54 * @param recipient Request recipient (e.g. device or endpoint). 55 * @param request Actual request (e.g. GET_DESCRIPTOR). 56 * @param value Value of @c wValue field of setup packet 57 * (must be in USB endianness). 58 * @param index Value of @c wIndex field of setup packet 59 * (must be in USB endianness). 60 * @param data Data to be sent during DATA stage 61 * (expected to be in USB endianness). 62 * @param data_size Size of the @p data buffer (in native endianness). 63 * 63 64 * @return Error code. 64 65 * @retval EBADMEM @p pipe is NULL. 65 66 * @retval EBADMEM @p data is NULL and @p data_size is not zero. 66 67 * @retval ERANGE Data buffer too large. 68 * 67 69 */ 68 70 int usb_control_request_set(usb_pipe_t *pipe, … … 100 102 } 101 103 102 /** Generic wrapper for GET requests using standard control request format. 103 * 104 * @see usb_pipe_control_read 105 * 106 * @param pipe Pipe used for the communication. 107 * @param request_type Request type (standard/class/vendor). 108 * @param recipient Request recipient (e.g. device or endpoint). 109 * @param request Actual request (e.g. GET_DESCRIPTOR). 110 * @param value Value of @c wValue field of setup packet 111 * (must be in USB endianness). 112 * @param index Value of @c wIndex field of setup packet 113 * (must be in USB endianness). 114 * @param data Buffer where to store data accepted during the DATA stage. 115 * (they will come in USB endianness). 116 * @param data_size Size of the @p data buffer 117 * (in native endianness). 118 * @param actual_data_size Actual size of transfered data 119 * (in native endianness). 120 * @return Error code. 121 * @retval EBADMEM @p pipe is NULL. 122 * @retval EBADMEM @p data is NULL and @p data_size is not zero. 123 * @retval ERANGE Data buffer too large. 124 */ 104 /** Generic wrapper for GET requests using standard control request format. 105 * 106 * @see usb_pipe_control_read 107 * 108 * @param pipe Pipe used for the communication. 109 * @param request_type Request type (standard/class/vendor). 110 * @param recipient Request recipient (e.g. device or endpoint). 111 * @param request Actual request (e.g. GET_DESCRIPTOR). 112 * @param value Value of @c wValue field of setup packet 113 * (must be in USB endianness). 114 * @param index Value of @c wIndex field of setup packet 115 * (must be in USB endianness). 116 * @param data Buffer where to store data accepted during 117 * the DATA stage (they will come in USB endianness). 118 * @param data_size Size of the @p data buffer 119 * (in native endianness). 120 * @param actual_data_size Actual size of transfered data 121 * (in native endianness). 122 * 123 * @return Error code. 124 * @retval EBADMEM @p pipe is NULL. 125 * @retval EBADMEM @p data is NULL and @p data_size is not zero. 126 * @retval ERANGE Data buffer too large. 127 * 128 */ 125 129 int usb_control_request_get(usb_pipe_t *pipe, 126 130 usb_request_type_t request_type, usb_request_recipient_t recipient, … … 209 213 { 210 214 if (request_type == USB_REQUEST_TYPE_STANDARD) { 211 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) 212 { 215 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) { 213 216 return EINVAL; 214 217 } … … 234 237 { 235 238 if (request_type == USB_REQUEST_TYPE_STANDARD) { 236 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) 237 { 239 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) { 238 240 return EINVAL; 239 241 } … … 271 273 } 272 274 273 /* The wValue field specifies the descriptor type in the high byte 275 /* 276 * The wValue field specifies the descriptor type in the high byte 274 277 * and the descriptor index in the low byte. USB 1.1 spec p. 189 275 278 */ -
uspace/lib/usbhost/include/usb/host/endpoint.h
r9befb0d rf126c87 88 88 } endpoint_t; 89 89 90 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 91 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 92 size_t max_packet_size, unsigned packets, size_t bw, 93 usb_address_t tt_address, unsigned tt_port); 94 void endpoint_destroy(endpoint_t *instance); 90 extern endpoint_t *endpoint_create(usb_address_t, usb_endpoint_t, 91 usb_direction_t, usb_transfer_type_t, usb_speed_t, size_t, unsigned int, 92 size_t, usb_address_t, unsigned int); 93 extern void endpoint_destroy(endpoint_t *); 95 94 96 void endpoint_add_ref(endpoint_t *instance);97 void endpoint_del_ref(endpoint_t *instance);95 extern void endpoint_add_ref(endpoint_t *); 96 extern void endpoint_del_ref(endpoint_t *); 98 97 99 void endpoint_set_hc_data(endpoint_t *instance,100 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int));101 void endpoint_clear_hc_data(endpoint_t *instance);98 extern void endpoint_set_hc_data(endpoint_t *, void *, int (*)(void *), 99 void (*)(void *, int)); 100 extern void endpoint_clear_hc_data(endpoint_t *); 102 101 103 void endpoint_use(endpoint_t *instance);104 void endpoint_release(endpoint_t *instance);102 extern void endpoint_use(endpoint_t *); 103 extern void endpoint_release(endpoint_t *); 105 104 106 int endpoint_toggle_get(endpoint_t *instance);107 void endpoint_toggle_set(endpoint_t *instance, int toggle);105 extern int endpoint_toggle_get(endpoint_t *); 106 extern void endpoint_toggle_set(endpoint_t *, int); 108 107 109 108 /** list_get_instance wrapper. 109 * 110 110 * @param item Pointer to link member. 111 * 111 112 * @return Pointer to endpoint_t structure. 113 * 112 114 */ 113 115 static inline endpoint_t * endpoint_get_instance(link_t *item) … … 116 118 } 117 119 #endif 120 118 121 /** 119 122 * @} -
uspace/lib/usbhost/include/usb/host/hcd.h
r9befb0d rf126c87 81 81 }; 82 82 83 void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth, 84 bw_count_func_t bw_count); 83 extern void hcd_init(hcd_t *, usb_speed_t, size_t, bw_count_func_t); 85 84 86 85 static inline void hcd_set_implementation(hcd_t *hcd, void *data, … … 102 101 } 103 102 104 usb_address_t hcd_request_address(hcd_t *hcd, usb_speed_t speed);103 extern usb_address_t hcd_request_address(hcd_t *, usb_speed_t); 105 104 106 int hcd_release_address(hcd_t *hcd, usb_address_t address);105 extern int hcd_release_address(hcd_t *, usb_address_t); 107 106 108 int hcd_reserve_default_address(hcd_t *hcd, usb_speed_t speed);107 extern int hcd_reserve_default_address(hcd_t *, usb_speed_t); 109 108 110 109 static inline int hcd_release_default_address(hcd_t *hcd) … … 113 112 } 114 113 115 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,116 usb_transfer_type_t type, size_t max_packet_size, unsigned packets,117 size_t size, usb_address_t tt_address, unsigned tt_port);114 extern int hcd_add_ep(hcd_t *, usb_target_t, usb_direction_t, 115 usb_transfer_type_t, size_t, unsigned int, size_t, usb_address_t, 116 unsigned int); 118 117 119 int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir);118 extern int hcd_remove_ep(hcd_t *, usb_target_t, usb_direction_t); 120 119 121 int hcd_send_batch(hcd_t *hcd, usb_target_t target, usb_direction_t direction, 122 void *data, size_t size, uint64_t setup_data, 123 usbhc_iface_transfer_in_callback_t in, 124 usbhc_iface_transfer_out_callback_t out, void *arg, const char* name); 120 extern int hcd_send_batch(hcd_t *, usb_target_t, usb_direction_t, void *, 121 size_t, uint64_t, usbhc_iface_transfer_in_callback_t, 122 usbhc_iface_transfer_out_callback_t, void *, const char *); 125 123 126 ssize_t hcd_send_batch_sync(hcd_t *hcd, usb_target_t target, 127 usb_direction_t dir, void *data, size_t size, uint64_t setup_data, 128 const char* name); 124 extern ssize_t hcd_send_batch_sync(hcd_t *, usb_target_t, usb_direction_t, 125 void *, size_t, uint64_t, const char *); 129 126 130 127 #endif 128 131 129 /** 132 130 * @} -
uspace/lib/usbhost/src/usb_transfer_batch.c
r9befb0d rf126c87 56 56 * @return Pointer to valid usb_transfer_batch_t structure, NULL on failure. 57 57 */ 58 usb_transfer_batch_t * usb_transfer_batch_create( 59 endpoint_t *ep, 60 char *buffer, 58 usb_transfer_batch_t *usb_transfer_batch_create(endpoint_t *ep, char *buffer, 61 59 size_t buffer_size, 62 60 uint64_t setup_buffer, 63 61 usbhc_iface_transfer_in_callback_t func_in, 64 62 usbhc_iface_transfer_out_callback_t func_out, 65 void *arg 66 ) 63 void *arg) 67 64 { 68 65 if (func_in == NULL && func_out == NULL) -
uspace/lib/usbvirt/include/usbvirt/device.h
r9befb0d rf126c87 41 41 #include <async.h> 42 42 #include <errno.h> 43 44 43 45 44 /** Maximum number of endpoints supported by virtual USB. */ … … 240 239 }; 241 240 242 243 int req_nop(usbvirt_device_t *device, 241 extern int req_nop(usbvirt_device_t *device, 244 242 const usb_device_request_setup_packet_t *setup_packet, 245 243 uint8_t *data, size_t *act_size); 246 244 247 int usbvirt_device_plug(usbvirt_device_t *, const char *); 248 void usbvirt_device_unplug(usbvirt_device_t *); 249 250 void usbvirt_control_reply_helper(const usb_device_request_setup_packet_t *, 251 uint8_t *, size_t *, const void *, size_t); 252 253 int usbvirt_control_write(usbvirt_device_t *, const void *, size_t, void *, size_t); 254 int usbvirt_control_read(usbvirt_device_t *, const void *, size_t, void *, size_t, size_t *); 255 int usbvirt_data_out(usbvirt_device_t *, usb_transfer_type_t, usb_endpoint_t, 245 extern int usbvirt_device_plug(usbvirt_device_t *, const char *); 246 extern void usbvirt_device_unplug(usbvirt_device_t *); 247 248 extern void usbvirt_control_reply_helper( 249 const usb_device_request_setup_packet_t *, uint8_t *, size_t *, 256 250 const void *, size_t); 257 int usbvirt_data_in(usbvirt_device_t *, usb_transfer_type_t, usb_endpoint_t, 251 252 extern int usbvirt_control_write(usbvirt_device_t *, const void *, size_t, 253 void *, size_t); 254 extern int usbvirt_control_read(usbvirt_device_t *, const void *, size_t, 258 255 void *, size_t, size_t *); 256 extern int usbvirt_data_out(usbvirt_device_t *, usb_transfer_type_t, 257 usb_endpoint_t, const void *, size_t); 258 extern int usbvirt_data_in(usbvirt_device_t *, usb_transfer_type_t, 259 usb_endpoint_t, void *, size_t, size_t *); 259 260 260 261 #endif -
uspace/lib/usbvirt/src/ctrltransfer.c
r9befb0d rf126c87 60 60 return EFORWARD; 61 61 } 62 62 63 const usbvirt_control_request_handler_t *handler = control_handlers; 63 64 for (;handler->callback != NULL; ++handler) {
Note:
See TracChangeset
for help on using the changeset viewer.
