Changeset 89a0485a in mainline for uspace/drv/uhci/callback.h


Ignore:
Timestamp:
2011-01-25T20:44:28Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b00163f
Parents:
7977fa1
Message:

Move function implementations to .c files

Unify error reporting in uhci_in()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/callback.h

    r7977fa1 r89a0485a  
    5353
    5454
    55 static inline int callback_init(callback_t *instance, device_t *dev,
     55int callback_init(callback_t *instance, device_t *dev,
    5656  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);
    6658
    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 }
    7759#define callback_in_init(instance, dev, buffer, size, func, arg) \
    7860        callback_init(instance, dev, buffer, size, func, NULL, arg)
Note: See TracChangeset for help on using the changeset viewer.