Changeset 889146e in mainline for uspace/drv/bus/usb/xhci/commands.h
- Timestamp:
- 2017-12-10T21:49:12Z (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.h
r6ef407b r889146e 42 42 #include <usb/host/dma_buffer.h> 43 43 #include "hw_struct/trb.h" 44 #include "trb_ring.h" 44 45 45 #define XHCI_ DEFAULT_TIMEOUT 100000046 #define XHCI_ BLOCK_INDEFINITELY046 #define XHCI_COMMAND_TIMEOUT 10000 47 #define XHCI_CR_ABORT_TIMEOUT 5000 47 48 48 49 typedef struct xhci_hc xhci_hc_t; … … 68 69 } xhci_cmd_type_t; 69 70 71 typedef enum { 72 XHCI_CR_STATE_CLOSED, /**< Commands are rejected with ENAK. */ 73 XHCI_CR_STATE_OPEN, /**< Commands are enqueued normally. */ 74 XHCI_CR_STATE_CHANGING, /**< Commands wait until state changes. */ 75 } xhci_cr_state; 76 77 typedef struct xhci_command_ring { 78 xhci_trb_ring_t trb_ring; 79 80 fibril_mutex_t guard; /**< Guard access to this structure. */ 81 list_t cmd_list; 82 83 xhci_cr_state state; /**< Whether commands are allowed to be 84 added. */ 85 fibril_condvar_t state_cv; /**< For waiting on CR state change. */ 86 87 fibril_condvar_t stopped_cv; /**< For waiting on CR stopped event. */ 88 } xhci_cmd_ring_t; 89 70 90 typedef struct xhci_command { 71 91 /** Internal fields used for bookkeeping. Need not worry about these. */ … … 74 94 75 95 xhci_cmd_type_t cmd; 76 suseconds_t timeout;77 96 78 97 xhci_trb_t trb; … … 130 149 fibril_condvar_initialize(&cmd._header.completed_cv); 131 150 132 if (!cmd._header.timeout) {133 cmd._header.timeout = XHCI_DEFAULT_TIMEOUT;134 }135 136 151 /* Issue the command */ 137 152 const int err = xhci_cmd_sync(hc, &cmd);
Note:
See TracChangeset
for help on using the changeset viewer.