Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 34586183 in mainline for uspace/lib/usb/hcd.h


Ignore:
Timestamp:
2010-10-22T12:38:50Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
master
Children:
b791e3e
Parents:
6c741e1d
Message:

Add transfer-type methods to libusb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/hcd.h

    r6c741e1d r34586183  
    5656} usb_transaction_outcome_t;
    5757
     58/** USB packet identifier. */
     59typedef enum {
     60#define _MAKE_PID_NIBBLE(tag, type) \
     61        ((uint8_t)(((tag) << 2) | (type)))
     62#define _MAKE_PID(tag, type) \
     63        ( \
     64            _MAKE_PID_NIBBLE(tag, type) \
     65            | ((~_MAKE_PID_NIBBLE(tag, type)) << 4) \
     66        )
     67        USB_PID_OUT = _MAKE_PID(0, 1),
     68        USB_PID_IN = _MAKE_PID(2, 1),
     69        USB_PID_SOF = _MAKE_PID(1, 1),
     70        USB_PID_SETUP = _MAKE_PID(3, 1),
     71       
     72        USB_PID_DATA0 = _MAKE_PID(0 ,3),
     73        USB_PID_DATA1 = _MAKE_PID(2 ,3),
     74       
     75        USB_PID_ACK = _MAKE_PID(0 ,2),
     76        USB_PID_NAK = _MAKE_PID(2 ,2),
     77        USB_PID_STALL = _MAKE_PID(3 ,2),
     78       
     79        USB_PID_PRE = _MAKE_PID(3 ,0),
     80        /* USB_PID_ = _MAKE_PID( ,), */
     81#undef _MAKE_PID
     82#undef _MAKE_PID_NIBBLE
     83} usb_packet_id;
     84
    5885const char * usb_str_transaction_outcome(usb_transaction_outcome_t o);
    5986
     
    116143         * - buffer size (in bytes):
    117144         */
    118         IPC_M_USB_HCD_TRANSACTION_SIZE
     145        IPC_M_USB_HCD_TRANSACTION_SIZE,
     146       
     147       
     148        IPC_M_USB_HCD_INTERRUPT_OUT,
     149        IPC_M_USB_HCD_INTERRUPT_IN,
     150       
     151        IPC_M_USB_HCD_CONTROL_WRITE_SETUP,
     152        IPC_M_USB_HCD_CONTROL_WRITE_DATA,
     153        IPC_M_USB_HCD_CONTROL_WRITE_STATUS,
     154       
     155        IPC_M_USB_HCD_CONTROL_READ_SETUP,
     156        IPC_M_USB_HCD_CONTROL_READ_DATA,
     157        IPC_M_USB_HCD_CONTROL_READ_STATUS,
     158        /* IPC_M_USB_HCD_ */
    119159} usb_hcd_method_t;
    120160
     
    143183        /** Notification about a serious trouble with HC.
    144184         */
    145         IPC_M_USB_HCD_CONTROLLER_FAILURE
     185        IPC_M_USB_HCD_CONTROLLER_FAILURE,
     186       
     187       
     188        IPC_M_USB_HCD_INTERRUPT_OUT_DONE,
     189        IPC_M_USB_HCD_INTERRUPT_IN_DONE,
     190       
     191        IPC_M_USB_HCD_CONTROL_WRITE_SETUP_DONE,
     192        IPC_M_USB_HCD_CONTROL_WRITE_DATA_DONE,
     193        IPC_M_USB_HCD_CONTROL_WRITE_STATUS_DONE,
     194       
     195        IPC_M_USB_HCD_CONTROL_READ_SETUP_DONE,
     196        IPC_M_USB_HCD_CONTROL_READ_DATA_DONE,
     197        IPC_M_USB_HCD_CONTROL_READ_STATUS_DONE,
     198       
     199        /* IPC_M_USB_HCD_ */
    146200} usb_hcd_callback_method_t;
    147201
     
    152206int usb_hcd_prepare_data_reception(int, usb_target_t, usb_transfer_type_t,
    153207    size_t, usb_transaction_handle_t *);
     208
     209
     210int usb_hcd_transfer_interrupt_out(int, usb_target_t,
     211    void *, size_t, usb_transaction_handle_t *);
     212int usb_hcd_transfer_interrupt_in(int, usb_target_t,
     213    size_t, usb_transaction_handle_t *);
     214
     215int usb_hcd_transfer_control_write_setup(int, usb_target_t,
     216    void *, size_t, usb_transaction_handle_t *);
     217int usb_hcd_transfer_control_write_data(int, usb_target_t,
     218    void *, size_t, usb_transaction_handle_t *);
     219int usb_hcd_transfer_control_write_status(int, usb_target_t,
     220    usb_transaction_handle_t *);
     221
     222int usb_hcd_transfer_control_read_setup(int, usb_target_t,
     223    void *, size_t, usb_transaction_handle_t *);
     224int usb_hcd_transfer_control_read_data(int, usb_target_t,
     225    size_t, usb_transaction_handle_t *);
     226int usb_hcd_transfer_control_read_status(int, usb_target_t,
     227    usb_transaction_handle_t *);
    154228
    155229#endif
Note: See TracChangeset for help on using the changeset viewer.