Changeset a7e2f0d in mainline for uspace/drv/uhci-hcd/batch.c


Ignore:
Timestamp:
2011-03-07T18:57:00Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
18e9eeb
Parents:
0d3167e
Message:

Doxygen and other comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/batch.c

    r0d3167e ra7e2f0d  
    5757
    5858
     59/** Allocates memory and initializes internal data structures.
     60 *
     61 * @param[in] fun DDF function to pass to callback.
     62 * @param[in] target Device and endpoint target of the transaction.
     63 * @param[in] transfer_type Interrupt, Control or Bulk.
     64 * @param[in] max_packet_size maximum allowed size of data packets.
     65 * @param[in] speed Speed of the transaction.
     66 * @param[in] buffer Data source/destination.
     67 * @param[in] size Size of the buffer.
     68 * @param[in] setup_buffer Setup data source (if not NULL)
     69 * @param[in] setup_size Size of setup_buffer (should be always 8)
     70 * @param[in] func_in function to call on inbound transaction completion
     71 * @param[in] func_out function to call on outbound transaction completion
     72 * @param[in] arg additional parameter to func_in or func_out
     73 * @param[in] manager Pointer to toggle management structure.
     74 * @return False, if there is an active TD, true otherwise.
     75 */
    5976batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
    6077    usb_transfer_type_t transfer_type, size_t max_packet_size,
     
    139156}
    140157/*----------------------------------------------------------------------------*/
     158/** Checks batch TDs for activity.
     159 *
     160 * @param[in] instance Batch structure to use.
     161 * @return False, if there is an active TD, true otherwise.
     162 */
    141163bool batch_is_complete(batch_t *instance)
    142164{
     
    172194}
    173195/*----------------------------------------------------------------------------*/
     196/** Prepares control write transaction.
     197 *
     198 * @param[in] instance Batch structure to use.
     199 */
    174200void batch_control_write(batch_t *instance)
    175201{
    176202        assert(instance);
    177203        /* we are data out, we are supposed to provide data */
    178         memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size);
     204        memcpy(instance->transport_buffer, instance->buffer,
     205            instance->buffer_size);
    179206        batch_control(instance, USB_PID_OUT, USB_PID_IN);
    180207        instance->next_step = batch_call_out_and_dispose;
     
    183210}
    184211/*----------------------------------------------------------------------------*/
     212/** Prepares control read transaction.
     213 *
     214 * @param[in] instance Batch structure to use.
     215 */
    185216void batch_control_read(batch_t *instance)
    186217{
     
    192223}
    193224/*----------------------------------------------------------------------------*/
     225/** Prepares interrupt in transaction.
     226 *
     227 * @param[in] instance Batch structure to use.
     228 */
    194229void batch_interrupt_in(batch_t *instance)
    195230{
     
    201236}
    202237/*----------------------------------------------------------------------------*/
     238/** Prepares interrupt out transaction.
     239 *
     240 * @param[in] instance Batch structure to use.
     241 */
    203242void batch_interrupt_out(batch_t *instance)
    204243{
     
    212251}
    213252/*----------------------------------------------------------------------------*/
     253/** Prepares bulk in transaction.
     254 *
     255 * @param[in] instance Batch structure to use.
     256 */
    214257void batch_bulk_in(batch_t *instance)
    215258{
     
    221264}
    222265/*----------------------------------------------------------------------------*/
     266/** Prepares bulk out transaction.
     267 *
     268 * @param[in] instance Batch structure to use.
     269 */
    223270void batch_bulk_out(batch_t *instance)
    224271{
     
    231278}
    232279/*----------------------------------------------------------------------------*/
     280/** Prepares generic data transaction
     281 *
     282 * @param[in] instance Batch structure to use.
     283 * @param[in] pid to use for data packets.
     284 */
    233285void batch_data(batch_t *instance, usb_packet_id pid)
    234286{
     
    269321}
    270322/*----------------------------------------------------------------------------*/
     323/** Prepares generic control transaction
     324 *
     325 * @param[in] instance Batch structure to use.
     326 * @param[in] data_stage to use for data packets.
     327 * @param[in] status_stage to use for data packets.
     328 */
    271329void batch_control(batch_t *instance,
    272330   usb_packet_id data_stage, usb_packet_id status_stage)
     
    317375}
    318376/*----------------------------------------------------------------------------*/
     377/** Prepares data, gets error status and calls callback in.
     378 *
     379 * @param[in] instance Batch structure to use.
     380 */
    319381void batch_call_in(batch_t *instance)
    320382{
     
    323385
    324386        /* we are data in, we need data */
    325         memcpy(instance->buffer, instance->transport_buffer, instance->buffer_size);
     387        memcpy(instance->buffer, instance->transport_buffer,
     388            instance->buffer_size);
    326389
    327390        int err = instance->error;
     
    334397}
    335398/*----------------------------------------------------------------------------*/
     399/** Gets error status and calls callback out.
     400 *
     401 * @param[in] instance Batch structure to use.
     402 */
    336403void batch_call_out(batch_t *instance)
    337404{
     
    346413}
    347414/*----------------------------------------------------------------------------*/
     415/** Prepares data, gets error status, calls callback in and dispose.
     416 *
     417 * @param[in] instance Batch structure to use.
     418 */
    348419void batch_call_in_and_dispose(batch_t *instance)
    349420{
     
    353424}
    354425/*----------------------------------------------------------------------------*/
     426/** Gets error status, calls callback out and dispose.
     427 *
     428 * @param[in] instance Batch structure to use.
     429 */
    355430void batch_call_out_and_dispose(batch_t *instance)
    356431{
     
    360435}
    361436/*----------------------------------------------------------------------------*/
     437/** Correctly disposes all used data structures.
     438 *
     439 * @param[in] instance Batch structure to use.
     440 */
    362441void batch_dispose(batch_t *instance)
    363442{
Note: See TracChangeset for help on using the changeset viewer.