Changeset f29931c in mainline


Ignore:
Timestamp:
2012-12-16T14:53:34Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4daee7a
Parents:
2f87aa6
Message:

libusbhost: Use function typedefs.

Location:
uspace/lib/usbhost
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r2f87aa6 rf29931c  
    4646typedef struct hcd hcd_t;
    4747
     48typedef int (*schedule_hook_t)(hcd_t *, usb_transfer_batch_t *);
     49typedef int (*ep_add_hook_t)(hcd_t *, endpoint_t *);
     50typedef void (*ep_remove_hook_t)(hcd_t *, endpoint_t *);
     51
    4852/** Generic host controller driver structure. */
    4953struct hcd {
     
    5660        void *private_data;
    5761        /** Transfer scheduling, implement in device driver. */
    58         int (*schedule)(hcd_t *, usb_transfer_batch_t *);
     62        schedule_hook_t schedule;
    5963        /** Hook called upon registering new endpoint. */
    60         int (*ep_add_hook)(hcd_t *, endpoint_t *);
     64        ep_add_hook_t ep_add_hook;
    6165        /** Hook called upon removing of an endpoint. */
    62         void (*ep_remove_hook)(hcd_t *, endpoint_t *);
     66        ep_remove_hook_t ep_remove_hook;
    6367};
    6468
  • uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h

    r2f87aa6 rf29931c  
    5353#define ENDPOINT_LIST_COUNT 8
    5454
     55typedef size_t (*bw_count_func_t)(usb_speed_t, usb_transfer_type_t, size_t, size_t);
     56typedef void (*ep_remove_callback_t)(endpoint_t *, void *);
     57typedef int (*ep_add_callback_t)(endpoint_t *, void *);
     58
    5559/** Endpoint management structure */
    5660typedef struct usb_endpoint_manager {
     
    6266        size_t free_bw;
    6367        /** Use this function to count bw required by EP */
    64         size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t);
     68        bw_count_func_t bw_count;
    6569} usb_endpoint_manager_t;
     70
    6671
    6772size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type,
     
    6974
    7075int usb_endpoint_manager_init(usb_endpoint_manager_t *instance,
    71     size_t available_bandwidth,
    72     size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t));
     76    size_t available_bandwidth, bw_count_func_t bw_count);
    7377
    7478void usb_endpoint_manager_reset_eps_if_need(usb_endpoint_manager_t *instance,
     
    8589    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    8690    usb_transfer_type_t type, usb_speed_t speed, size_t max_packet_size,
    87     size_t data_size, int (*callback)(endpoint_t *, void *), void *arg);
     91    size_t data_size, ep_add_callback_t callback, void *arg);
    8892
    8993int usb_endpoint_manager_remove_ep(usb_endpoint_manager_t *instance,
    9094    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    91     void (*callback)(endpoint_t *, void *), void *arg);
     95    ep_remove_callback_t callback, void *arg);
    9296
    9397void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance,
    94     usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg);
     98    usb_address_t address, ep_remove_callback_t callback, void *arg);
    9599#endif
    96100/**
  • uspace/lib/usbhost/src/usb_endpoint_manager.c

    r2f87aa6 rf29931c  
    318318    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    319319    usb_transfer_type_t type, usb_speed_t speed, size_t max_packet_size,
    320     size_t data_size, int (*callback)(endpoint_t *, void *), void *arg)
     320    size_t data_size, ep_add_callback_t callback, void *arg)
    321321{
    322322        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.