device - usb: why my f_uvc doesn't answer GET_DEF request? -
i need implement uvc1.5 spec in device, choose linux3.4 kernel, , want use drivers/usb/gadget/webcam.c
function driver. doesn't function properly.
according signals captured wireshark, when host sends get_def
request device, device answer -enoent
results in failure enumeration.
i find out when composite.c
receives kind of requests, forward them f->set_up
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
puzzles me: handle event? didn't see code doing such event related initialization work.....
and question how handle event properly, can answer get_def
request ?
it's v4l2 event should deal in place. can receive v4l2 event through
rt = ioctl(dev->fd, vidioc_dqevent,&v4l2_event);
then can parse v4l2_event, maybe get_cur, ger_len,etc. can response requests define.
Comments
Post a Comment