Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/transfers.c
- Timestamp:
- 2018-01-23T12:41:22Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7e1fd3
- Parents:
- e546142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/transfers.c
re546142 r8033f89 151 151 TRB_CTRL_SET_IDT(*trb_setup, 1); 152 152 TRB_CTRL_SET_TRB_TYPE(*trb_setup, XHCI_TRB_TYPE_SETUP_STAGE); 153 TRB_CTRL_SET_TRT(*trb_setup, get_transfer_type(trb_setup, setup->request_type, setup->length)); 153 TRB_CTRL_SET_TRT(*trb_setup, 154 get_transfer_type(trb_setup, setup->request_type, setup->length)); 154 155 155 156 /* Data stage */ … … 178 179 xhci_trb_clean(trb_status); 179 180 180 // FIXME: Evaluate next TRB? 4.12.3181 // TRB_CTRL_SET_ENT(*trb_status, 1);182 183 181 TRB_CTRL_SET_IOC(*trb_status, 1); 184 182 TRB_CTRL_SET_TRB_TYPE(*trb_status, XHCI_TRB_TYPE_STATUS_STAGE); 185 TRB_CTRL_SET_DIR(*trb_status, get_status_direction_flag(trb_setup, setup->request_type, setup->length)); 183 TRB_CTRL_SET_DIR(*trb_status, get_status_direction_flag(trb_setup, 184 setup->request_type, setup->length)); 186 185 187 186 // Issue a Configure Endpoint command, if needed. … … 192 191 } 193 192 194 return xhci_trb_ring_enqueue_multiple(get_ring(transfer), trbs, trbs_used, &transfer->interrupt_trb_phys); 193 return xhci_trb_ring_enqueue_multiple(get_ring(transfer), trbs, 194 trbs_used, &transfer->interrupt_trb_phys); 195 195 } 196 196 … … 303 303 /* We are received transfer pointer instead - work with that */ 304 304 transfer = (xhci_transfer_t *) addr; 305 xhci_trb_ring_update_dequeue(get_ring(transfer), transfer->interrupt_trb_phys); 305 xhci_trb_ring_update_dequeue(get_ring(transfer), 306 transfer->interrupt_trb_phys); 306 307 batch = &transfer->batch; 307 308 … … 453 454 * the Reset Endpoint command. 454 455 */ 455 if (batch->ep->transfer_type == USB_TRANSFER_CONTROL && batch->dir == USB_DIRECTION_OUT) { 456 if (batch->ep->transfer_type == USB_TRANSFER_CONTROL 457 && batch->dir == USB_DIRECTION_OUT) { 456 458 const usb_device_request_setup_packet_t *request = &batch->setup.packet; 457 459 if (request->request == USB_DEVREQ_CLEAR_FEATURE … … 460 462 const uint16_t index = uint16_usb2host(request->index); 461 463 const usb_endpoint_t ep_num = index & 0xf; 462 const usb_direction_t dir = (index >> 7) ? USB_DIRECTION_IN : USB_DIRECTION_OUT; 464 const usb_direction_t dir = (index >> 7) 465 ? USB_DIRECTION_IN 466 : USB_DIRECTION_OUT; 463 467 endpoint_t *halted_ep = bus_find_endpoint(&xhci_dev->base, ep_num, dir); 464 468 if (halted_ep) { 465 469 /* 466 * TODO: Find out how to come up with stream_id. It 467 * might bepossible that we have to clear all of them.470 * TODO: Find out how to come up with stream_id. It might be 471 * possible that we have to clear all of them. 468 472 */ 469 473 xhci_endpoint_clear_halt(xhci_endpoint_get(halted_ep), 0); 470 474 endpoint_del_ref(halted_ep); 471 475 } else { 472 usb_log_warning("Device(%u): Resetting unregistered endpoint %u %s.", xhci_dev->base.address, ep_num, usb_str_direction(dir)); 476 usb_log_warning("Device(%u): Resetting unregistered endpoint" 477 " %u %s.", xhci_dev->base.address, ep_num, 478 usb_str_direction(dir)); 473 479 } 474 480 } … … 487 493 488 494 hc_ring_ep_doorbell(xhci_ep, batch->target.stream); 489 490 /* After the critical section, the transfer can already be finished or aborted. */491 transfer = NULL; batch = NULL;492 495 fibril_mutex_unlock(&ep->guard); 493 496 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.