Changeset 84a04dd in mainline for uspace/lib/usb/src/pipes.c


Ignore:
Timestamp:
2011-04-18T20:21:58Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
44b1674, c7d19d84, da1dd48, e3f1987
Parents:
8595577b (diff), 4125b7d (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:

C-style, more IPC hiding (#196, #187)

Removed obsoleted usb_pipe_start_session() and
usb_pipe_end_session().

Printf-like functions produces warning with bad modifiers.

usb_pipe_start_long_transfer() is of type void to save-up checks
that would rarely fail (failure is received upon trying to communicate
over such pipe).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/pipes.c

    r8595577b r84a04dd  
    229229}
    230230
    231 
    232 /** Start a session on the endpoint pipe.
    233  *
    234  * A session is something inside what any communication occurs.
    235  * It is expected that sessions would be started right before the transfer
    236  * and ended - see usb_pipe_end_session() - after the last
    237  * transfer.
    238  * The reason for this is that session actually opens some communication
    239  * channel to the host controller (or to the physical hardware if you
    240  * wish) and thus it involves acquiring kernel resources.
    241  * Since they are limited, sessions shall not be longer than strictly
    242  * necessary.
    243  *
    244  * @deprecated
    245  * Obsoleted with introduction of usb_pipe_start_long_transfer
    246  *
    247  * @param pipe Endpoint pipe to start the session on.
    248  * @return Error code.
    249  */
    250 int usb_pipe_start_session(usb_pipe_t *pipe)
    251 {
    252         usb_log_warning("usb_pipe_start_session() was deprecated.\n");
    253         return EOK;
    254 }
    255 
    256 
    257 /** Ends a session on the endpoint pipe.
    258  *
    259  * @deprecated
    260  * Obsoleted with introduction of usb_pipe_end_long_transfer
    261  *
    262  * @see usb_pipe_start_session
    263  *
    264  * @param pipe Endpoint pipe to end the session on.
    265  * @return Error code.
    266  */
    267 int usb_pipe_end_session(usb_pipe_t *pipe)
    268 {
    269         usb_log_warning("usb_pipe_end_session() was deprecated.\n");
    270         return EOK;
    271 }
    272 
    273 /** Tell whether a session is started (open) on the endpoint pipe.
    274  *
    275  * The expected usage of this function is in assertions for some
    276  * nested functions.
    277  *
    278  * @param pipe Endpoint pipe in question.
    279  * @return Whether @p pipe has opened a session.
    280  */
    281 bool usb_pipe_is_session_started(usb_pipe_t *pipe)
    282 {
    283         pipe_acquire(pipe);
    284         bool started = pipe->refcount > 0;
    285         pipe_release(pipe);
    286         return started;
    287 }
    288 
    289231/** Prepare pipe for a long transfer.
    290232 *
     
    297239 * @return Error code.
    298240 */
    299 int usb_pipe_start_long_transfer(usb_pipe_t *pipe)
    300 {
    301         return pipe_add_ref(pipe);
     241void usb_pipe_start_long_transfer(usb_pipe_t *pipe)
     242{
     243        (void) pipe_add_ref(pipe, true);
    302244}
    303245
Note: See TracChangeset for help on using the changeset viewer.