Changeset 889146e in mainline for uspace/drv/bus/usb/xhci/hc.h


Ignore:
Timestamp:
2017-12-10T21:49:12Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
53db806
Parents:
6ef407b
git-author:
Ondřej Hlavatý <aearsis@…> (2017-12-10 21:43:47)
git-committer:
Ondřej Hlavatý <aearsis@…> (2017-12-10 21:49:12)
Message:

xhci: commands shall not just timeout

Previous behavior was breaking semantic: if a command was successful,
but just took too long to complete, we returned an error, and the caller
had no way to know if the command's effect has taken place.

This commit implements command aborting. The wait_for_command now cannot
just timeout - instead it aborts currently running (probably blocked)
command, and then gets back to waiting. So now, if command_sync returns
an error, it means the command was really unsuccessful.

If aborting the command takes too long, we should reset the whole HC.
This is not yet implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.h

    r6ef407b r889146e  
    4545
    4646#include "rh.h"
     47#include "commands.h"
    4748#include "bus.h"
     49
     50typedef struct xhci_command xhci_cmd_t;
    4851
    4952typedef struct xhci_hc {
     
    6164
    6265        /* Structures in allocated memory */
    63         xhci_trb_ring_t command_ring;
    6466        xhci_event_ring_t event_ring;
    6567        uint64_t *dcbaa;
     
    6769        dma_buffer_t scratchpad_array;
    6870        dma_buffer_t *scratchpad_buffers;
     71
     72        /* Command ring management */
     73        xhci_cmd_ring_t cr;
    6974
    7075        /* Root hub emulation */
     
    8186        xhci_port_speed_t speeds [16];
    8287        uint8_t speed_to_psiv [USB_SPEED_MAX];
    83 
    84         /* Command list */
    85         list_t commands;
    86         fibril_mutex_t commands_mtx;
    8788
    8889        /* TODO: Hack. Figure out a better way. */
Note: See TracChangeset for help on using the changeset viewer.