Lines Matching refs:crq
1199 static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq) in feature_is_dev_remote_wakeup() argument
1201 if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP)) in feature_is_dev_remote_wakeup()
1206 static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq) in feature_is_dev_test_mode() argument
1208 if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE)) in feature_is_dev_test_mode()
1213 static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq) in feature_is_ep_halt() argument
1215 if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT)) in feature_is_ep_halt()
1221 struct usb_ctrlrequest *crq) in handle_ep0_setup() argument
1225 switch (crq->bRequest) { in handle_ep0_setup()
1229 if (crq->bRequestType == (USB_DIR_IN | USB_RECIP_DEVICE)) { in handle_ep0_setup()
1231 } else if (crq->bRequestType in handle_ep0_setup()
1234 } else if (crq->bRequestType in handle_ep0_setup()
1238 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1249 if (crq->wLength != cpu_to_le16(sizeof(status))) in handle_ep0_setup()
1258 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
1259 if (feature_is_dev_remote_wakeup(crq)) in handle_ep0_setup()
1265 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
1268 if (crq->wLength != cpu_to_le16(0) in handle_ep0_setup()
1269 || !feature_is_ep_halt(crq)) in handle_ep0_setup()
1271 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1288 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
1289 if (feature_is_dev_test_mode(crq)) { in handle_ep0_setup()
1292 udc->test_mode = le16_to_cpu(crq->wIndex); in handle_ep0_setup()
1294 } else if (feature_is_dev_remote_wakeup(crq)) { in handle_ep0_setup()
1299 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
1302 if (crq->wLength != cpu_to_le16(0) in handle_ep0_setup()
1303 || !feature_is_ep_halt(crq)) in handle_ep0_setup()
1306 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1319 if (crq->bRequestType != (USB_DIR_OUT | USB_RECIP_DEVICE)) in handle_ep0_setup()
1322 set_address(udc, le16_to_cpu(crq->wValue)); in handle_ep0_setup()
1330 retval = udc->driver->setup(&udc->gadget, crq); in handle_ep0_setup()
1339 ep->ep.name, crq->bRequestType, crq->bRequest, in handle_ep0_setup()
1340 le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), in handle_ep0_setup()
1341 le16_to_cpu(crq->wLength)); in handle_ep0_setup()
1448 struct usb_ctrlrequest crq; in usba_control_irq() member
1450 } crq; in usba_control_irq() local
1481 if (pkt_len != sizeof(crq)) { in usba_control_irq()
1483 "(expected %zu)\n", pkt_len, sizeof(crq)); in usba_control_irq()
1489 memcpy_fromio(crq.data, ep->fifo, sizeof(crq)); in usba_control_irq()
1499 if (crq.crq.bRequestType & USB_DIR_IN) { in usba_control_irq()
1508 if (crq.crq.wLength != cpu_to_le16(0)) in usba_control_irq()
1516 ret = handle_ep0_setup(udc, ep, &crq.crq); in usba_control_irq()
1519 ret = udc->driver->setup(&udc->gadget, &crq.crq); in usba_control_irq()
1524 crq.crq.bRequestType, crq.crq.bRequest, in usba_control_irq()
1525 le16_to_cpu(crq.crq.wLength), ep->state, ret); in usba_control_irq()