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


Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (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:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

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

    r4837092 r92574f4  
    3838#define LIBDRV_USBHC_IFACE_H_
    3939
    40 #include "driver.h"
     40#include "ddf/driver.h"
    4141#include <usb/usb.h>
     42#include <bool.h>
    4243
    4344
     
    5253 *   - argument #1 is target address
    5354 *   - argument #2 is target endpoint
    54  *   - argument #3 is buffer size
     55 *   - argument #3 is max packet size of the endpoint
    5556 * - this call is immediately followed by IPC data write (from caller)
    5657 * - the initial call (and the whole transaction) is answer after the
     
    6566 *   - argument #1 is target address
    6667 *   - argument #2 is target endpoint
    67  *   - argument #3 is buffer size
     68 *   - argument #3 is max packet size of the endpoint
     69 * - this call is immediately followed by IPC data read (async version)
    6870 * - the call is not answered until the device returns some data (or until
    6971 *   error occurs)
    70  * - if the call is answered with EOK, first argument of the answer is buffer
    71  *   hash that could be used to retrieve the actual data
    7272 *
    7373 * Some special methods (NO-DATA transactions) do not send any data. These
    7474 * might behave as both OUT or IN transactions because communication parts
    7575 * where actual buffers are exchanged are omitted.
    76  *
    77  * The mentioned data retrieval can be done any time after receiving EOK
    78  * answer to IN method.
    79  * This retrieval is done using the IPC_M_USBHC_GET_BUFFER where
    80  * the first argument is buffer hash from call answer.
    81  * This call must be immediately followed by data read-in and after the
    82  * data are transferred, the initial call (IPC_M_USBHC_GET_BUFFER)
    83  * is answered. Each buffer can be retrieved only once.
    84  *
     76 **
    8577 * For all these methods, wrap functions exists. Important rule: functions
    8678 * for IN transactions have (as parameters) buffers where retrieved data
     
    9385 */
    9486typedef enum {
    95         /** Tell USB address assigned to device.
    96          * Parameters:
    97          * - devman handle id
    98          * Answer:
    99          * - EINVAL - unknown handle or handle not managed by this driver
    100          * - ENOTSUP - operation not supported by HC (shall not happen)
    101          * - arbitrary error code if returned by remote implementation
    102          * - EOK - handle found, first parameter contains the USB address
    103          */
    104         IPC_M_USBHC_GET_ADDRESS,
    105 
    106         /** Asks for data buffer.
    107          * See explanation at usb_iface_funcs_t.
    108          * This function does not have counter part in functional interface
    109          * as it is handled by the remote part itself.
    110          */
    111         IPC_M_USBHC_GET_BUFFER,
    112 
    113 
    11487        /** Reserve usage of default address.
    11588         * This call informs the host controller that the caller will be
     
    168141        IPC_M_USBHC_INTERRUPT_IN,
    169142
    170 
    171         /** Start WRITE control transfer.
     143        /** Send bulk data to device.
    172144         * See explanation at usb_iface_funcs_t (OUT transaction).
    173145         */
    174         IPC_M_USBHC_CONTROL_WRITE_SETUP,
    175 
    176         /** Send control-transfer data to device.
    177          * See explanation at usb_iface_funcs_t (OUT transaction).
    178          */
    179         IPC_M_USBHC_CONTROL_WRITE_DATA,
    180 
    181         /** Terminate WRITE control transfer.
    182          * See explanation at usb_iface_funcs_t (NO-DATA transaction).
    183          */
    184         IPC_M_USBHC_CONTROL_WRITE_STATUS,
    185 
    186 
    187 
    188         /** Start READ control transfer.
    189          * See explanation at usb_iface_funcs_t (OUT transaction).
    190          */
    191         IPC_M_USBHC_CONTROL_READ_SETUP,
    192 
    193         /** Get control-transfer data from device.
     146        IPC_M_USBHC_BULK_OUT,
     147
     148        /** Get bulk data from device.
    194149         * See explanation at usb_iface_funcs_t (IN transaction).
    195150         */
    196         IPC_M_USBHC_CONTROL_READ_DATA,
    197 
    198         /** Terminate READ control transfer.
    199          * See explanation at usb_iface_funcs_t (NO-DATA transaction).
    200          */
    201         IPC_M_USBHC_CONTROL_READ_STATUS,
     151        IPC_M_USBHC_BULK_IN,
    202152
    203153        /** Issue control WRITE transfer.
     
    209159        IPC_M_USBHC_CONTROL_WRITE,
    210160
    211         /** Issue control WRITE transfer.
     161        /** Issue control READ transfer.
    212162         * See explanation at usb_iface_funcs_t (IN transaction) for
    213163         * call parameters.
    214          * This call is immediately followed by IPC data read from the caller
    215          * (setup packet).
    216          * Actual data are retrieved through IPC_M_USBHC_GET_BUFFER.
     164         * This call is immediately followed by IPC data write from the caller
     165         * (setup packet) and IPC data read (buffer that was read).
    217166         */
    218167        IPC_M_USBHC_CONTROL_READ,
     
    222171
    223172/** Callback for outgoing transfer. */
    224 typedef void (*usbhc_iface_transfer_out_callback_t)(device_t *,
    225     usb_transaction_outcome_t, void *);
     173typedef void (*usbhc_iface_transfer_out_callback_t)(ddf_fun_t *,
     174    int, void *);
    226175
    227176/** Callback for incoming transfer. */
    228 typedef void (*usbhc_iface_transfer_in_callback_t)(device_t *,
    229     usb_transaction_outcome_t, size_t, void *);
     177typedef void (*usbhc_iface_transfer_in_callback_t)(ddf_fun_t *,
     178    int, size_t, void *);
    230179
    231180
    232181/** Out transfer processing function prototype. */
    233 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t,
     182typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t, size_t,
    234183    void *, size_t,
    235184    usbhc_iface_transfer_out_callback_t, void *);
    236185
    237 /** Setup transfer processing function prototype. */
     186/** Setup transfer processing function prototype. @deprecated */
    238187typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t;
    239188
    240189/** In transfer processing function prototype. */
    241 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t,
     190typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t, size_t,
    242191    void *, size_t,
    243192    usbhc_iface_transfer_in_callback_t, void *);
     
    245194/** USB host controller communication interface. */
    246195typedef struct {
    247         int (*tell_address)(device_t *, devman_handle_t, usb_address_t *);
    248 
    249         int (*reserve_default_address)(device_t *);
    250         int (*release_default_address)(device_t *);
    251         int (*request_address)(device_t *, usb_address_t *);
    252         int (*bind_address)(device_t *, usb_address_t, devman_handle_t);
    253         int (*release_address)(device_t *, usb_address_t);
     196        int (*reserve_default_address)(ddf_fun_t *, usb_speed_t);
     197        int (*release_default_address)(ddf_fun_t *);
     198        int (*request_address)(ddf_fun_t *, usb_speed_t, usb_address_t *);
     199        int (*bind_address)(ddf_fun_t *, usb_address_t, devman_handle_t);
     200        int (*release_address)(ddf_fun_t *, usb_address_t);
    254201
    255202        usbhc_iface_transfer_out_t interrupt_out;
    256203        usbhc_iface_transfer_in_t interrupt_in;
    257204
    258         usbhc_iface_transfer_setup_t control_write_setup;
    259         usbhc_iface_transfer_out_t control_write_data;
    260         int (*control_write_status)(device_t *, usb_target_t,
    261             usbhc_iface_transfer_in_callback_t, void *);
    262 
    263         usbhc_iface_transfer_setup_t control_read_setup;
    264         usbhc_iface_transfer_in_t control_read_data;
    265         int (*control_read_status)(device_t *, usb_target_t,
    266             usbhc_iface_transfer_out_callback_t, void *);
    267 
    268         int (*control_write)(device_t *, usb_target_t,
     205        usbhc_iface_transfer_out_t bulk_out;
     206        usbhc_iface_transfer_in_t bulk_in;
     207
     208        int (*control_write)(ddf_fun_t *, usb_target_t,
     209            size_t,
    269210            void *, size_t, void *, size_t,
    270211            usbhc_iface_transfer_out_callback_t, void *);
    271212
    272         int (*control_read)(device_t *, usb_target_t,
     213        int (*control_read)(ddf_fun_t *, usb_target_t,
     214            size_t,
    273215            void *, size_t, void *, size_t,
    274216            usbhc_iface_transfer_in_callback_t, void *);
Note: See TracChangeset for help on using the changeset viewer.