0

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 ?

Pablo
  • 13,271
  • 4
  • 39
  • 59

1 Answers1

-2

It's a V4L2 event you should deal with in another place. You can receive v4l2 event through

rt = ioctl(dev->fd, VIDIOC_DQEVENT,&v4l2_event);

Then you can parse this v4l2_event, it maybe GET_CUR, GER_LEN,etc. So you can response those requests by yourself define.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
tzaumin
  • 1
  • 2