Lines Matching refs:udev
359 static void giveback_first_trb(struct usb_device *udev, int ep_index, in giveback_first_trb() argument
363 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in giveback_first_trb()
377 xhci_writel(&ctrl->dba->doorbell[udev->slot_id], in giveback_first_trb()
481 static void reset_ep(struct usb_device *udev, int ep_index) in reset_ep() argument
483 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in reset_ep()
484 struct xhci_ring *ring = ctrl->devs[udev->slot_id]->eps[ep_index].ring; in reset_ep()
489 xhci_queue_command(ctrl, NULL, udev->slot_id, ep_index, TRB_RESET_EP); in reset_ep()
495 BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); in reset_ep()
499 ring->cycle_state), udev->slot_id, ep_index, TRB_SET_DEQ); in reset_ep()
505 != udev->slot_id || GET_COMP_CODE(le32_to_cpu( in reset_ep()
518 static void abort_td(struct usb_device *udev, int ep_index) in abort_td() argument
520 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in abort_td()
521 struct xhci_ring *ring = ctrl->devs[udev->slot_id]->eps[ep_index].ring; in abort_td()
525 xhci_queue_command(ctrl, NULL, udev->slot_id, ep_index, TRB_STOP_RING); in abort_td()
532 BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); in abort_td()
543 != udev->slot_id || GET_COMP_CODE(le32_to_cpu( in abort_td()
548 ring->cycle_state), udev->slot_id, ep_index, TRB_SET_DEQ); in abort_td()
554 != udev->slot_id || GET_COMP_CODE(le32_to_cpu( in abort_td()
559 static void record_transfer_result(struct usb_device *udev, in record_transfer_result() argument
562 udev->act_len = min(length, length - in record_transfer_result()
567 BUG_ON(udev->act_len != length); in record_transfer_result()
570 udev->status = 0; in record_transfer_result()
573 udev->status = USB_ST_STALLED; in record_transfer_result()
577 udev->status = USB_ST_BUF_ERR; in record_transfer_result()
580 udev->status = USB_ST_BABBLE_DET; in record_transfer_result()
583 udev->status = 0x80; /* USB_ST_TOO_LAZY_TO_MAKE_A_NEW_MACRO */ in record_transfer_result()
597 int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, in xhci_bulk_tx() argument
606 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_bulk_tx()
607 int slot_id = udev->slot_id; in xhci_bulk_tx()
623 udev, pipe, buffer, length); in xhci_bulk_tx()
677 maxpacketsize = usb_maxpacket(udev, pipe); in xhci_bulk_tx()
755 giveback_first_trb(udev, ep_index, start_cycle, start_trb); in xhci_bulk_tx()
760 abort_td(udev, ep_index); in xhci_bulk_tx()
761 udev->status = USB_ST_NAK_REC; /* closest thing to a timeout */ in xhci_bulk_tx()
762 udev->act_len = 0; in xhci_bulk_tx()
772 record_transfer_result(udev, event, length); in xhci_bulk_tx()
776 return (udev->status != USB_ST_NOT_PROC) ? 0 : -1; in xhci_bulk_tx()
789 int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, in xhci_ctrl_tx() argument
800 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_ctrl_tx()
801 int slot_id = udev->slot_id; in xhci_ctrl_tx()
822 if (udev->speed == USB_SPEED_FULL) { in xhci_ctrl_tx()
823 ret = xhci_check_maxpacket(udev); in xhci_ctrl_tx()
952 giveback_first_trb(udev, ep_index, start_cycle, start_trb); in xhci_ctrl_tx()
962 record_transfer_result(udev, event, length); in xhci_ctrl_tx()
964 if (udev->status == USB_ST_STALLED) { in xhci_ctrl_tx()
965 reset_ep(udev, ep_index); in xhci_ctrl_tx()
984 return (udev->status != USB_ST_NOT_PROC) ? 0 : -1; in xhci_ctrl_tx()
988 abort_td(udev, ep_index); in xhci_ctrl_tx()
989 udev->status = USB_ST_NAK_REC; in xhci_ctrl_tx()
990 udev->act_len = 0; in xhci_ctrl_tx()