Ignore:
File:
1 edited

Legend:

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

    r27a0012 re936e8e  
    191191        assert(pipe);
    192192
    193         if (pipe->hc_phone >= 0) {
     193        if (usb_endpoint_pipe_is_session_started(pipe)) {
    194194                return EBUSY;
    195195        }
     
    217217        assert(pipe);
    218218
    219         if (pipe->hc_phone < 0) {
     219        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    220220                return ENOENT;
    221221        }
     
    229229
    230230        return EOK;
     231}
     232
     233/** Tell whether a session is started (open) on the endpoint pipe.
     234 *
     235 * The expected usage of this function is in assertions for some
     236 * nested functions.
     237 *
     238 * @param pipe Endpoint pipe in question.
     239 * @return Whether @p pipe has opened a session.
     240 */
     241bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *pipe)
     242{
     243        return (pipe->hc_phone >= 0);
    231244}
    232245
Note: See TracChangeset for help on using the changeset viewer.