I need to implement uvc1.5 spec in my device, I choose linux3.4 as my kernel, and I want to use the drivers/usb/gadget/webcam.c
as my function driver. But it doesn't function properly.
According to the signals captured by wireshark, when the host sends the GET_DEF
request to the device, my device answer -ENOENT
which results in a failure to the enumeration.
I find out that when the composite.c
receives this kind of requests, it will forward them to f->set_up
to continue.
The main part of f->set_up
is:
uvc->event_setup_out = !(ctrl->bRequestType & USB_DIR_IN);
uvc->event_length = le16_to_cpu(ctrl->wLength);
memset(&v4l2_event, 0, sizeof(v4l2_event));
v4l2_event.type = UVC_EVENT_SETUP;
memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req));
v4l2_event_queue(&uvc->vdev, &v4l2_event);
The call of v4l2_event_queue
is what puzzles me: who will handle this event?
I didn't see any code doing such event related initialization work.....
And my question is how to handle this event properly, so I can answer the GET_DEF
request ?