Changeset 89a0485a in mainline for uspace/drv/uhci/callback.h
- Timestamp:
- 2011-01-25T20:44:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b00163f
- Parents:
- 7977fa1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/callback.h
r7977fa1 r89a0485a 53 53 54 54 55 static inlineint callback_init(callback_t *instance, device_t *dev,55 int callback_init(callback_t *instance, device_t *dev, 56 56 void *buffer, size_t size, usbhc_iface_transfer_in_callback_t func_in, 57 usbhc_iface_transfer_out_callback_t func_out, void *arg) 58 { 59 assert(instance); 60 assert(func_in == NULL || func_out == NULL); 61 instance->new_buffer = trans_malloc(size); 62 if (!instance->new_buffer) { 63 uhci_print_error("Failed to allocate device acessible buffer.\n"); 64 return ENOMEM; 65 } 57 usbhc_iface_transfer_out_callback_t func_out, void *arg); 66 58 67 if (func_out)68 memcpy(instance->new_buffer, buffer, size);69 70 instance->callback_out = func_out;71 instance->callback_in = func_in;72 instance->old_buffer = buffer;73 instance->buffer_size = size;74 instance->dev = dev;75 return EOK;76 }77 59 #define callback_in_init(instance, dev, buffer, size, func, arg) \ 78 60 callback_init(instance, dev, buffer, size, func, NULL, arg)
Note:
See TracChangeset
for help on using the changeset viewer.