Changeset 74b852b in mainline for uspace/drv/bus/usb/xhci/commands.c
- Timestamp:
- 2017-10-21T19:33:09Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5fd9c30
- Parents:
- f45c78f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
rf45c78f r74b852b 67 67 68 68 list_initialize(&hc->commands); 69 70 fibril_mutex_initialize(&hc->commands_mtx); 71 69 72 return EOK; 70 73 } … … 126 129 static inline xhci_cmd_t *get_command(xhci_hc_t *hc, uint64_t phys) 127 130 { 131 fibril_mutex_lock(&hc->commands_mtx); 132 128 133 link_t *cmd_link = list_first(&hc->commands); 129 134 … … 139 144 if (cmd_link != NULL) { 140 145 list_remove(cmd_link); 146 fibril_mutex_unlock(&hc->commands_mtx); 141 147 142 148 return list_get_instance(cmd_link, xhci_cmd_t, link); 143 149 } 144 150 151 fibril_mutex_unlock(&hc->commands_mtx); 145 152 return NULL; 146 153 } … … 151 158 assert(cmd); 152 159 160 fibril_mutex_lock(&hc->commands_mtx); 153 161 list_append(&cmd->link, &hc->commands); 162 fibril_mutex_unlock(&hc->commands_mtx); 154 163 155 164 xhci_trb_ring_enqueue(&hc->command_ring, &cmd->trb, &cmd->trb_phys);
Note:
See TracChangeset
for help on using the changeset viewer.