Changeset fa2a361 in mainline for uspace/lib/usb/hcd.c


Ignore:
Timestamp:
2010-10-26T21:38:59Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aab02fb
Parents:
56cb9bd
Message:

Add missing comments

File:
1 edited

Legend:

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

    r56cb9bd rfa2a361  
    4040#include <errno.h>
    4141
     42/** Information about pending transaction on HC. */
    4243typedef struct {
     44        /** Phone to host controller driver. */
    4345        int phone;
     46        /** Data buffer. */
    4447        void *buffer;
     48        /** Buffer size. */
    4549        size_t size;
     50        /** Storage for actual number of bytes transferred. */
    4651        size_t *size_transferred;
     52        /** Initial call replay data. */
    4753        ipc_call_t reply;
     54        /** Initial call identifier. */
    4855        aid_t request;
    4956} transfer_info_t;
     
    355362 * =================
    356363 */
    357  
     364
     365/** Send data to HCD.
     366 *
     367 * @param phone Opened phone to HCD.
     368 * @param method Method used for calling.
     369 * @param target Target device.
     370 * @param buffer Data buffer (NULL to skip data transfer phase).
     371 * @param size Buffer size (must be zero when @p buffer is NULL).
     372 * @param handle Storage for transaction handle (cannot be NULL).
     373 * @return Error status.
     374 * @retval EINVAL Invalid parameter.
     375 * @retval ENOMEM Not enough memory to complete the operation.
     376 */
    358377static int async_send_buffer(int phone, int method,
    359378    usb_target_t target,
     
    405424}
    406425
     426/** Prepare data retrieval.
     427 *
     428 * @param phone Opened phone to HCD.
     429 * @param method Method used for calling.
     430 * @param target Target device.
     431 * @param buffer Buffer where to store retrieved data
     432 *      (NULL to skip data transfer phase).
     433 * @param size Buffer size (must be zero when @p buffer is NULL).
     434 * @param actual_size Storage where actual number of bytes transferred will
     435 *      be stored.
     436 * @param handle Storage for transaction handle (cannot be NULL).
     437 * @return Error status.
     438 * @retval EINVAL Invalid parameter.
     439 * @retval ENOMEM Not enough memory to complete the operation.
     440 */
    407441static int async_recv_buffer(int phone, int method,
    408442    usb_target_t target,
     
    444478}
    445479
     480/** Read buffer from HCD.
     481 *
     482 * @param phone Opened phone to HCD.
     483 * @param hash Buffer hash (obtained after completing IN transaction).
     484 * @param buffer Buffer where to store data data.
     485 * @param size Buffer size.
     486 * @param actual_size Storage where actual number of bytes transferred will
     487 *      be stored.
     488 * @return Error status.
     489 */
    446490static int read_buffer_in(int phone, ipcarg_t hash,
    447491    void *buffer, size_t size, size_t *actual_size)
     
    475519}
    476520
    477 
     521/** Blocks caller until given USB transaction is finished.
     522 * After the transaction is finished, the user can access all output data
     523 * given to initial call function.
     524 *
     525 * @param handle Transaction handle.
     526 * @return Error status.
     527 * @retval EOK No error.
     528 * @retval EBADMEM Invalid handle.
     529 * @retval ENOENT Data buffer associated with transaction does not exist.
     530 */
    478531int usb_hcd_async_wait_for(usb_handle_t handle)
    479532{
     
    528581}
    529582
     583/** Send interrupt data to device. */
    530584int usb_hcd_async_transfer_interrupt_out(int hcd_phone,
    531585    usb_target_t target,
     
    540594}
    541595
     596/** Request interrupt data from device. */
    542597int usb_hcd_async_transfer_interrupt_in(int hcd_phone,
    543598    usb_target_t target,
     
    552607}
    553608
     609/** Start WRITE control transfer. */
    554610int usb_hcd_async_transfer_control_write_setup(int hcd_phone,
    555611    usb_target_t target,
     
    564620}
    565621
     622/** Send data during WRITE control transfer. */
    566623int usb_hcd_async_transfer_control_write_data(int hcd_phone,
    567624    usb_target_t target,
     
    576633}
    577634
     635/** Terminate WRITE control transfer. */
    578636int usb_hcd_async_transfer_control_write_status(int hcd_phone,
    579637    usb_target_t target,
     
    587645}
    588646
     647/** Start READ control transfer. */
    589648int usb_hcd_async_transfer_control_read_setup(int hcd_phone,
    590649    usb_target_t target,
     
    599658}
    600659
     660/** Request data during READ control transfer. */
    601661int usb_hcd_async_transfer_control_read_data(int hcd_phone,
    602662    usb_target_t target,
     
    611671}
    612672
     673/** Terminate READ control transfer. */
    613674int usb_hcd_async_transfer_control_read_status(int hcd_phone,
    614675    usb_target_t target,
Note: See TracChangeset for help on using the changeset viewer.