Lines Matching refs:crq
1198 static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq) in feature_is_dev_remote_wakeup() argument
1200 if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP)) in feature_is_dev_remote_wakeup()
1205 static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq) in feature_is_dev_test_mode() argument
1207 if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE)) in feature_is_dev_test_mode()
1212 static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq) in feature_is_ep_halt() argument
1214 if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT)) in feature_is_ep_halt()
1220 struct usb_ctrlrequest *crq) in handle_ep0_setup() argument
1224 switch (crq->bRequest) { in handle_ep0_setup()
1228 if (crq->bRequestType == (USB_DIR_IN | USB_RECIP_DEVICE)) { in handle_ep0_setup()
1230 } else if (crq->bRequestType in handle_ep0_setup()
1233 } else if (crq->bRequestType in handle_ep0_setup()
1237 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1248 if (crq->wLength != cpu_to_le16(sizeof(status))) in handle_ep0_setup()
1257 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
1258 if (feature_is_dev_remote_wakeup(crq)) in handle_ep0_setup()
1264 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
1267 if (crq->wLength != cpu_to_le16(0) in handle_ep0_setup()
1268 || !feature_is_ep_halt(crq)) in handle_ep0_setup()
1270 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1287 if (crq->bRequestType == USB_RECIP_DEVICE) { in handle_ep0_setup()
1288 if (feature_is_dev_test_mode(crq)) { in handle_ep0_setup()
1291 udc->test_mode = le16_to_cpu(crq->wIndex); in handle_ep0_setup()
1293 } else if (feature_is_dev_remote_wakeup(crq)) { in handle_ep0_setup()
1298 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { in handle_ep0_setup()
1301 if (crq->wLength != cpu_to_le16(0) in handle_ep0_setup()
1302 || !feature_is_ep_halt(crq)) in handle_ep0_setup()
1305 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); in handle_ep0_setup()
1318 if (crq->bRequestType != (USB_DIR_OUT | USB_RECIP_DEVICE)) in handle_ep0_setup()
1321 set_address(udc, le16_to_cpu(crq->wValue)); in handle_ep0_setup()
1329 retval = udc->driver->setup(&udc->gadget, crq); in handle_ep0_setup()
1338 ep->ep.name, crq->bRequestType, crq->bRequest, in handle_ep0_setup()
1339 le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), in handle_ep0_setup()
1340 le16_to_cpu(crq->wLength)); in handle_ep0_setup()
1447 struct usb_ctrlrequest crq; in usba_control_irq() member
1449 } crq; in usba_control_irq() local
1480 if (pkt_len != sizeof(crq)) { in usba_control_irq()
1482 "(expected %zu)\n", pkt_len, sizeof(crq)); in usba_control_irq()
1488 memcpy_fromio(crq.data, ep->fifo, sizeof(crq)); in usba_control_irq()
1498 if (crq.crq.bRequestType & USB_DIR_IN) { in usba_control_irq()
1507 if (crq.crq.wLength != cpu_to_le16(0)) in usba_control_irq()
1515 ret = handle_ep0_setup(udc, ep, &crq.crq); in usba_control_irq()
1518 ret = udc->driver->setup(&udc->gadget, &crq.crq); in usba_control_irq()
1523 crq.crq.bRequestType, crq.crq.bRequest, in usba_control_irq()
1524 le16_to_cpu(crq.crq.wLength), ep->state, ret); in usba_control_irq()