Changeset c7dd69d in mainline for uspace/lib/usb/src/pipesio.c


Ignore:
Timestamp:
2011-04-15T13:19:59Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
da1dd48
Parents:
e3b5129 (diff), 8fd4ba0 (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:

Development changes

File:
1 edited

Legend:

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

    re3b5129 rc7dd69d  
    4949#include <assert.h>
    5050#include <usbhc_iface.h>
     51#include <usb/request.h>
    5152#include "pipepriv.h"
    5253
     
    307308}
    308309
     310/** Try to clear endpoint halt of default control pipe.
     311 *
     312 * @param pipe Pipe for control endpoint zero.
     313 */
     314static void clear_self_endpoint_halt(usb_pipe_t *pipe)
     315{
     316        assert(pipe != NULL);
     317
     318        if (!pipe->auto_reset_halt || (pipe->endpoint_no != 0)) {
     319                return;
     320        }
     321
     322
     323        /* Prevent indefinite recursion. */
     324        pipe->auto_reset_halt = false;
     325        usb_request_clear_endpoint_halt(pipe, 0);
     326        pipe->auto_reset_halt = true;
     327}
     328
    309329
    310330/** Request a control read transfer, no checking of input parameters.
     
    436456            setup_buffer, setup_buffer_size,
    437457            data_buffer, data_buffer_size, &act_size);
     458
     459        if (rc == ESTALL) {
     460                clear_self_endpoint_halt(pipe);
     461        }
    438462
    439463        pipe_drop_ref(pipe);
     
    563587            setup_buffer, setup_buffer_size, data_buffer, data_buffer_size);
    564588
     589        if (rc == ESTALL) {
     590                clear_self_endpoint_halt(pipe);
     591        }
     592
    565593        pipe_drop_ref(pipe);
    566594
Note: See TracChangeset for help on using the changeset viewer.