Lines Matching refs:crq

692 static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq)  in feature_is_dev_remote_wakeup()  argument
694 if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP)) in feature_is_dev_remote_wakeup()
699 static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq) in feature_is_dev_test_mode() argument
701 if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE)) in feature_is_dev_test_mode()
706 static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq) in feature_is_ep_halt() argument
708 if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT)) in feature_is_ep_halt()
714 struct usb_ctrlrequest *crq) in handle_ep0_setup() argument
718 switch (crq->bRequest) { in handle_ep0_setup()
722 if (crq->bRequestType == (USB_DIR_IN | USB_RECIP_DEVICE)) { in handle_ep0_setup()
724 } else if (crq->bRequestType in handle_ep0_setup()
727 } else if (crq->bRequestType in handle_ep0_setup()
731 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
743 if (crq->wLength != cpu_to_le16(sizeof(status))) in handle_ep0_setup()
752 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
753 if (feature_is_dev_remote_wakeup(crq)) in handle_ep0_setup()
759 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
762 if (crq->wLength != cpu_to_le16(0) || in handle_ep0_setup()
763 !feature_is_ep_halt(crq)) in handle_ep0_setup()
765 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
782 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
783 if (feature_is_dev_test_mode(crq)) { in handle_ep0_setup()
786 udc->test_mode = le16_to_cpu(crq->wIndex); in handle_ep0_setup()
788 } else if (feature_is_dev_remote_wakeup(crq)) { in handle_ep0_setup()
793 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
796 if (crq->wLength != cpu_to_le16(0) || in handle_ep0_setup()
797 !feature_is_ep_halt(crq)) in handle_ep0_setup()
800 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
814 if (crq->bRequestType != (USB_DIR_OUT | USB_RECIP_DEVICE)) in handle_ep0_setup()
817 set_address(udc, le16_to_cpu(crq->wValue)); in handle_ep0_setup()
825 retval = udc->driver->setup(&udc->gadget, crq); in handle_ep0_setup()
833 ep->ep.name, crq->bRequestType, crq->bRequest, in handle_ep0_setup()
834 le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), in handle_ep0_setup()
835 le16_to_cpu(crq->wLength)); in handle_ep0_setup()
941 struct usb_ctrlrequest crq; in usba_control_irq() member
943 } crq; in usba_control_irq() local
974 if (pkt_len != sizeof(crq)) { in usba_control_irq()
976 pkt_len, sizeof(crq)); in usba_control_irq()
982 memcpy(crq.data, ep->fifo, sizeof(crq)); in usba_control_irq()
988 if (crq.crq.bRequestType & USB_DIR_IN) { in usba_control_irq()
997 if (crq.crq.wLength != cpu_to_le16(0)) in usba_control_irq()
1005 ret = handle_ep0_setup(udc, ep, &crq.crq); in usba_control_irq()
1008 ret = udc->driver->setup(&udc->gadget, &crq.crq); in usba_control_irq()
1013 crq.crq.bRequestType, crq.crq.bRequest, in usba_control_irq()
1014 le16_to_cpu(crq.crq.wLength), ep->state, ret); in usba_control_irq()