Ignore:
Timestamp:
2018-01-11T04:14:37Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9848c77
Parents:
bad4a05
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-11 03:59:03)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-11 04:14:37)
Message:

usbhost: device removal and off/onlining moved into the library

Also, it is just not possible to make generic transfer abortion. So the
current semantics of endpoint unregistering is also aborting the pending
transfer. As it is not yet implemented in XHCI, and the stub in UHCI is
missing the magic, it breaks offlining interrupt devices, such as mouse.

When finishing this commit, I came across the fact we need some more
synchronization above device. Guard can protect internal structures, but
it cannot synchronize multiple calls to offline, or offline & removal
between each other - they both need to allow driver to unregister
endpoints, and as such must release the guard.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/endpoint.h

    rbad4a05 r0892663a  
    4444#include <fibril_synch.h>
    4545#include <stdbool.h>
     46#include <sys/time.h>
    4647#include <usb/usb.h>
    4748#include <usb/host/bus.h>
     
    9394extern void endpoint_del_ref(endpoint_t *);
    9495
    95 /* Pay atention to synchronization of batch access wrt to aborting & finishing from another fibril. */
    96 
    97 /* Set currently active batch. The common case is to activate in the same
    98  * critical section as scheduling to HW.
    99  */
     96extern void endpoint_wait_timeout_locked(endpoint_t *ep, suseconds_t);
    10097extern void endpoint_activate_locked(endpoint_t *, usb_transfer_batch_t *);
    101 
    102 /* Deactivate the endpoint, allowing others to activate it again. Batch shall
    103  * already have an error set. */
    10498extern void endpoint_deactivate_locked(endpoint_t *);
    105 
    106 /* Abort the currenty active batch. */
    107 void endpoint_abort(endpoint_t *);
    10899
    109100/* Calculate bandwidth */
Note: See TracChangeset for help on using the changeset viewer.