Ignore:
Timestamp:
2011-10-31T06:52:54Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c25e39b
Parents:
e8ab32f (diff), 3ce78580 (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.
Message:

Merge with mainline

File:
1 edited

Legend:

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

    re8ab32f rc83a55c  
    3636#define LIBUSBHOST_HOST_ENDPOINT_H
    3737
    38 #include <assert.h>
    3938#include <bool.h>
    4039#include <adt/list.h>
    4140#include <fibril_synch.h>
    42 
    4341#include <usb/usb.h>
    4442
     43/** Host controller side endpoint structure. */
    4544typedef struct endpoint {
     45        /** Part of linked list. */
     46        link_t link;
     47        /** USB address. */
    4648        usb_address_t address;
     49        /** USB endpoint number. */
    4750        usb_endpoint_t endpoint;
     51        /** Communication direction. */
    4852        usb_direction_t direction;
     53        /** USB transfer type. */
    4954        usb_transfer_type_t transfer_type;
     55        /** Communication speed. */
    5056        usb_speed_t speed;
     57        /** Maximum size of data packets. */
    5158        size_t max_packet_size;
     59        /** Necessary bandwidth. */
     60        size_t bandwidth;
     61        /** Value of the toggle bit. */
    5262        unsigned toggle:1;
     63        /** True if there is a batch using this scheduled for this endpoint. */
     64        volatile bool active;
     65        /** Protects resources and active status changes. */
    5366        fibril_mutex_t guard;
     67        /** Signals change of active status. */
    5468        fibril_condvar_t avail;
    55         volatile bool active;
    56         void (*destroy_hook)(struct endpoint *);
     69        /** Optional device specific data. */
    5770        struct {
     71                /** Device specific data. */
    5872                void *data;
     73                /** Callback to get the value of toggle bit. */
    5974                int (*toggle_get)(void *);
     75                /** Callback to set the value of toggle bit. */
    6076                void (*toggle_set)(void *, int);
    6177        } hc_data;
    6278} endpoint_t;
    6379
    64 endpoint_t * endpoint_get(usb_address_t address, usb_endpoint_t endpoint,
     80endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    6581    usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    66     size_t max_packet_size);
    67 
     82    size_t max_packet_size, size_t bw);
    6883void endpoint_destroy(endpoint_t *instance);
    6984
    7085void endpoint_set_hc_data(endpoint_t *instance,
    71     void *data, void (*destroy_hook)(endpoint_t *),
    72     int (*toggle_get)(void *), void (*toggle_set)(void *, int));
    73 
     86    void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int));
    7487void endpoint_clear_hc_data(endpoint_t *instance);
    7588
    7689void endpoint_use(endpoint_t *instance);
    77 
    7890void endpoint_release(endpoint_t *instance);
    7991
    8092int endpoint_toggle_get(endpoint_t *instance);
    81 
    8293void endpoint_toggle_set(endpoint_t *instance, int toggle);
    8394
    84 void endpoint_toggle_reset_filtered(endpoint_t *instance, usb_target_t target);
     95/** list_get_instance wrapper.
     96 * @param item Pointer to link member.
     97 * @return Pointer to enpoint_t structure.
     98 */
     99static inline endpoint_t * endpoint_get_instance(link_t *item)
     100{
     101        return list_get_instance(item, endpoint_t, link);
     102}
    85103#endif
    86104/**
Note: See TracChangeset for help on using the changeset viewer.