Changeset e9ce696 in mainline


Ignore:
Timestamp:
2011-04-09T15:37:36Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4ede178
Parents:
d48fcc0
Message:

Add functions for explicit long transfers

Location:
uspace/lib/usb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/pipes.h

    rd48fcc0 re9ce696  
    160160bool usb_pipe_is_session_started(usb_pipe_t *);
    161161
     162int usb_pipe_start_long_transfer(usb_pipe_t *);
     163void usb_pipe_end_long_transfer(usb_pipe_t *);
     164
    162165int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
    163166int usb_pipe_write(usb_pipe_t *, void *, size_t);
  • uspace/lib/usb/src/pipes.c

    rd48fcc0 re9ce696  
    242242 * necessary.
    243243 *
     244 * @deprecated
     245 * Obsoleted with introduction of usb_pipe_start_long_transfer
     246 *
    244247 * @param pipe Endpoint pipe to start the session on.
    245248 * @return Error code.
     
    247250int usb_pipe_start_session(usb_pipe_t *pipe)
    248251{
    249         return pipe_add_ref(pipe);
     252        usb_log_warning("usb_pipe_start_session() was deprecated.\n");
     253        return EOK;
    250254}
    251255
     
    253257/** Ends a session on the endpoint pipe.
    254258 *
     259 * @deprecated
     260 * Obsoleted with introduction of usb_pipe_end_long_transfer
     261 *
    255262 * @see usb_pipe_start_session
    256263 *
     
    260267int usb_pipe_end_session(usb_pipe_t *pipe)
    261268{
    262         pipe_drop_ref(pipe);
     269        usb_log_warning("usb_pipe_end_session() was deprecated.\n");
    263270        return EOK;
    264271}
     
    280287}
    281288
     289/** Prepare pipe for a long transfer.
     290 *
     291 * By a long transfer is mean transfer consisting of several
     292 * requests to the HC.
     293 * Calling such function is optional and it has positive effect of
     294 * improved performance because IPC session is initiated only once.
     295 *
     296 * @param pipe Pipe over which the transfer will happen.
     297 * @return Error code.
     298 */
     299int usb_pipe_start_long_transfer(usb_pipe_t *pipe)
     300{
     301        return pipe_add_ref(pipe);
     302}
     303
     304/** Terminate a long transfer on a pipe.
     305 *
     306 * @see usb_pipe_start_long_transfer
     307 *
     308 * @param pipe Pipe where to end the long transfer.
     309 */
     310void usb_pipe_end_long_transfer(usb_pipe_t *pipe)
     311{
     312        pipe_drop_ref(pipe);
     313}
     314
    282315/**
    283316 * @}
Note: See TracChangeset for help on using the changeset viewer.