Changeset 327f147 in mainline for uspace/lib/usbhost/include


Ignore:
Timestamp:
2017-10-23T19:03:37Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b724494
Parents:
e160bfe8
Message:

usbhost: change parameters of methods

Pass (device_t, usb_target_t) to read and write, which finally allows to drop hash tables and access device right away. Then, all callbacks to complete transfer now uses usb_transfer_batch. This requires libdrv to include libusbhost, but it is not linked against it - it is there only to share definition of usb_transfer_batch_t.

Location:
uspace/lib/usbhost/include/usb/host
Files:
4 edited

Legend:

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

    re160bfe8 r327f147  
    8585        int (*register_endpoint)(bus_t *, endpoint_t *);
    8686        int (*unregister_endpoint)(bus_t *, endpoint_t *);
    87         endpoint_t *(*find_endpoint)(bus_t *, usb_target_t, usb_direction_t);
     87        endpoint_t *(*find_endpoint)(bus_t *, device_t*, usb_target_t, usb_direction_t);
    8888        void (*destroy_endpoint)(endpoint_t *);                 /**< Optional */
    8989        bool (*endpoint_get_toggle)(endpoint_t *);              /**< Optional */
     
    120120    usb_direction_t dir, usb_transfer_type_t type, size_t max_packet_size,
    121121    unsigned packets, size_t size);
    122 extern int bus_remove_ep(bus_t *bus, usb_target_t target, usb_direction_t dir);
     122extern int bus_remove_ep(bus_t *, device_t *, usb_target_t, usb_direction_t);
    123123
    124124int device_set_default_name(device_t *);
     
    130130int bus_register_endpoint(bus_t *, endpoint_t *);
    131131int bus_unregister_endpoint(bus_t *, endpoint_t *);
    132 endpoint_t *bus_find_endpoint(bus_t *, usb_target_t, usb_direction_t);
     132endpoint_t *bus_find_endpoint(bus_t *, device_t *, usb_target_t, usb_direction_t);
    133133
    134134size_t bus_count_bw(endpoint_t *, size_t);
  • uspace/lib/usbhost/include/usb/host/hcd.h

    re160bfe8 r327f147  
    108108extern int hcd_remove_ep(hcd_t *, usb_target_t, usb_direction_t);
    109109
    110 extern int hcd_send_batch(hcd_t *, usb_target_t, usb_direction_t, void *,
    111     size_t, uint64_t, usbhc_iface_transfer_in_callback_t,
    112     usbhc_iface_transfer_out_callback_t, void *, const char *);
     110extern int hcd_send_batch(hcd_t *, device_t *, usb_target_t,
     111    usb_direction_t direction, char *, size_t, uint64_t,
     112    usb_transfer_batch_callback_t, void *, const char *);
    113113
    114 extern ssize_t hcd_send_batch_sync(hcd_t *, usb_target_t, usb_direction_t,
    115     void *, size_t, uint64_t, const char *);
     114extern ssize_t hcd_send_batch_sync(hcd_t *, device_t *, usb_target_t,
     115    usb_direction_t direction, char *, size_t, uint64_t,
     116    const char *);
    116117
    117118#endif
  • uspace/lib/usbhost/include/usb/host/usb2_bus.h

    re160bfe8 r327f147  
    5656                usb_speed_t speed;      /**< Device speed */
    5757                bool occupied;          /**< The address is in use. */
     58                // TODO: This can be stored in usb2_bus-specific device_t
    5859                list_t endpoint_list;   /**< Store endpoint_t instances */
    5960        } devices[USB_ADDRESS_COUNT];
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    re160bfe8 r327f147  
    108108void usb_transfer_batch_destroy(usb_transfer_batch_t *);
    109109
    110 /** Provided to ease the transition. Wraps old-style handlers into a new one.
    111  */
    112 extern void usb_transfer_batch_set_old_handlers(usb_transfer_batch_t *,
    113         usbhc_iface_transfer_in_callback_t,
    114         usbhc_iface_transfer_out_callback_t, void *);
    115 
    116110#endif
    117111
Note: See TracChangeset for help on using the changeset viewer.