Lines Matching refs:crq
693 static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq) in feature_is_dev_remote_wakeup() argument
695 if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP)) in feature_is_dev_remote_wakeup()
700 static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq) in feature_is_dev_test_mode() argument
702 if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE)) in feature_is_dev_test_mode()
707 static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq) in feature_is_ep_halt() argument
709 if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT)) in feature_is_ep_halt()
715 struct usb_ctrlrequest *crq) in handle_ep0_setup() argument
719 switch (crq->bRequest) { in handle_ep0_setup()
723 if (crq->bRequestType == (USB_DIR_IN | USB_RECIP_DEVICE)) { in handle_ep0_setup()
725 } else if (crq->bRequestType in handle_ep0_setup()
728 } else if (crq->bRequestType in handle_ep0_setup()
732 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
744 if (crq->wLength != cpu_to_le16(sizeof(status))) in handle_ep0_setup()
753 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
754 if (feature_is_dev_remote_wakeup(crq)) in handle_ep0_setup()
760 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
763 if (crq->wLength != cpu_to_le16(0) || in handle_ep0_setup()
764 !feature_is_ep_halt(crq)) in handle_ep0_setup()
766 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
783 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
784 if (feature_is_dev_test_mode(crq)) { in handle_ep0_setup()
787 udc->test_mode = le16_to_cpu(crq->wIndex); in handle_ep0_setup()
789 } else if (feature_is_dev_remote_wakeup(crq)) { in handle_ep0_setup()
794 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
797 if (crq->wLength != cpu_to_le16(0) || in handle_ep0_setup()
798 !feature_is_ep_halt(crq)) in handle_ep0_setup()
801 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
815 if (crq->bRequestType != (USB_DIR_OUT | USB_RECIP_DEVICE)) in handle_ep0_setup()
818 set_address(udc, le16_to_cpu(crq->wValue)); in handle_ep0_setup()
826 retval = udc->driver->setup(&udc->gadget, crq); in handle_ep0_setup()
834 ep->ep.name, crq->bRequestType, crq->bRequest, in handle_ep0_setup()
835 le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), in handle_ep0_setup()
836 le16_to_cpu(crq->wLength)); in handle_ep0_setup()
942 struct usb_ctrlrequest crq; in usba_control_irq() member
944 } crq; in usba_control_irq() local
975 if (pkt_len != sizeof(crq)) { in usba_control_irq()
977 pkt_len, sizeof(crq)); in usba_control_irq()
983 memcpy(crq.data, ep->fifo, sizeof(crq)); in usba_control_irq()
989 if (crq.crq.bRequestType & USB_DIR_IN) { in usba_control_irq()
998 if (crq.crq.wLength != cpu_to_le16(0)) in usba_control_irq()
1006 ret = handle_ep0_setup(udc, ep, &crq.crq); in usba_control_irq()
1009 ret = udc->driver->setup(&udc->gadget, &crq.crq); in usba_control_irq()
1014 crq.crq.bRequestType, crq.crq.bRequest, in usba_control_irq()
1015 le16_to_cpu(crq.crq.wLength), ep->state, ret); in usba_control_irq()