Changeset cf2ccd4 in mainline for uspace/lib/usb/src/pipepriv.c


Ignore:
Timestamp:
2011-04-22T09:26:50Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7304663
Parents:
1553cbf (diff), 1775ebc (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:

new report structure and usbhid merge

File:
1 edited

Legend:

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

    r1553cbf rcf2ccd4  
    7777 *
    7878 * @param pipe The USB pipe.
     79 * @param hide_failure Whether to hide failure when adding reference
     80 *      (use soft refcount).
    7981 * @return Error code.
    8082 * @retval EOK Currently always.
    8183 */
    82 int pipe_add_ref(usb_pipe_t *pipe)
     84int pipe_add_ref(usb_pipe_t *pipe, bool hide_failure)
    8385{
    84 another_try:
    8586        pipe_acquire(pipe);
    8687
     
    8990                int phone = devman_device_connect(pipe->wire->hc_handle, 0);
    9091                if (phone < 0) {
    91                         // TODO: treat some error as non-recoverable
    92                         // and return error from here
     92                        if (hide_failure) {
     93                                pipe->refcount_soft++;
     94                                phone = EOK;
     95                        }
    9396                        pipe_release(pipe);
    94                         goto another_try;
     97                        return phone;
    9598                }
    9699                /*
     
    114117{
    115118        pipe_acquire(pipe);
     119        if (pipe->refcount_soft > 0) {
     120                pipe->refcount_soft--;
     121                pipe_release(pipe);
     122                return;
     123        }
    116124        assert(pipe->refcount > 0);
    117125        pipe->refcount--;
Note: See TracChangeset for help on using the changeset viewer.