Changeset a9d67aa in mainline for uspace/lib/drv/include/usbhc_iface.h


Ignore:
Timestamp:
2011-04-09T17:15:28Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
97e7e8a
Parents:
5410c04 (diff), 77223f8 (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:

Refactoring: libusb, USBHC interface protocol

Highlights:

  • refactoring of libusb (not complete)
  • max packet size is not send during each transfer
  • reserving of default address is possible via endpoint registration
  • endpoint registration can send speed as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/usbhc_iface.h

    r5410c04 ra9d67aa  
    6666 *   - argument #1 is target address
    6767 *   - argument #2 is target endpoint
    68  *   - argument #3 is max packet size of the endpoint
    6968 * - this call is immediately followed by IPC data read (async version)
    7069 * - the call is not answered until the device returns some data (or until
     
    169168        /** Register endpoint attributes at host controller.
    170169         * This is used to reserve portion of USB bandwidth.
     170         * When speed is invalid, speed of the device is used.
    171171         * Parameters:
    172          * - USB address + endpoint number (ADDR * 256 + EP)
    173          * - transfer type + direction (TYPE * 256 + DIR)
    174          * - maximum packet size
    175          * - interval (in milliseconds)
     172         * - USB address + endpoint number
     173         *   - packed as ADDR << 16 + EP
     174         * - speed + transfer type + direction
     175         *   - packed as ( SPEED << 8 + TYPE ) << 8 + DIR
     176         * - maximum packet size + interval (in milliseconds)
     177         *   - packed as MPS << 16 + INT
    176178         * Answer:
    177179         * - EOK - reservation successful
     
    202204
    203205/** Out transfer processing function prototype. */
    204 typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t, size_t,
     206typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t,
    205207    void *, size_t,
    206208    usbhc_iface_transfer_out_callback_t, void *);
     
    210212
    211213/** In transfer processing function prototype. */
    212 typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t, size_t,
     214typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t,
    213215    void *, size_t,
    214216    usbhc_iface_transfer_in_callback_t, void *);
     
    222224        int (*release_address)(ddf_fun_t *, usb_address_t);
    223225
    224         int (*register_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t,
     226        int (*register_endpoint)(ddf_fun_t *,
     227            usb_address_t, usb_speed_t, usb_endpoint_t,
    225228            usb_transfer_type_t, usb_direction_t, size_t, unsigned int);
    226229        int (*unregister_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t,
     
    234237
    235238        int (*control_write)(ddf_fun_t *, usb_target_t,
    236             size_t,
    237239            void *, size_t, void *, size_t,
    238240            usbhc_iface_transfer_out_callback_t, void *);
    239241
    240242        int (*control_read)(ddf_fun_t *, usb_target_t,
    241             size_t,
    242243            void *, size_t, void *, size_t,
    243244            usbhc_iface_transfer_in_callback_t, void *);
Note: See TracChangeset for help on using the changeset viewer.