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


Ignore:
Timestamp:
2011-02-23T15:38:53Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
233e68d, a80849c
Parents:
eb1a2f4 (diff), d3880aa (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:

Merged small fixes and improvements

Fixed "usbinfo -t uhci" problem.

UHCI root hub prints less messages.

USB MID driver creates exposed "ctl" function (to provide at least
one function when interface drivers are not available).

File:
1 edited

Legend:

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

    reb1a2f4 ra9c674e0  
    200200        assert(pipe);
    201201
    202         if (pipe->hc_phone >= 0) {
     202        if (usb_endpoint_pipe_is_session_started(pipe)) {
    203203                return EBUSY;
    204204        }
     
    226226        assert(pipe);
    227227
    228         if (pipe->hc_phone < 0) {
     228        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    229229                return ENOENT;
    230230        }
     
    238238
    239239        return EOK;
     240}
     241
     242/** Tell whether a session is started (open) on the endpoint pipe.
     243 *
     244 * The expected usage of this function is in assertions for some
     245 * nested functions.
     246 *
     247 * @param pipe Endpoint pipe in question.
     248 * @return Whether @p pipe has opened a session.
     249 */
     250bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *pipe)
     251{
     252        return (pipe->hc_phone >= 0);
    240253}
    241254
Note: See TracChangeset for help on using the changeset viewer.