diff options
author | Daniel Scally <dan.scally@ideasonboard.com> | 2022-11-22 15:34:22 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-11-22 16:08:30 +0000 |
commit | 0df9d3ad860ecd78f1bf8ad6bd5ceccaf40a9e07 (patch) | |
tree | 2d23a14258ca4d6f7dfb994ea2a44e6e02b9f3c1 | |
parent | 70d68062373502d159771b53b3e6d94c0557a0da (diff) |
lib: uvc: Respond to control requests with dummy values
Without a response, the host will assume there has been an error and
throw a bunch of errors. The noise of those errors makes it difficult
to see what's going on properly, so return a dummy response that
silences the errors until the functionality is properly implemented.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r-- | lib/uvc.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -191,12 +191,18 @@ uvc_events_process_standard(struct uvc_device *dev, } static void -uvc_events_process_control(struct uvc_device *dev, uint8_t req, uint8_t cs, +uvc_events_process_control(struct uvc_device *dev, uint8_t req, uint8_t cs, uint8_t len, struct uvc_request_data *resp) { printf("control request (req %s cs %s)\n", uvc_request_name(req), pu_control_name(cs)); (void)dev; - (void)resp; + + /* + * Responding to controls is not currently implemented. As an interim + * measure respond to say that both get and set operations are permitted. + */ + resp->data[0] = 0x03; + resp->length = len; } static void @@ -263,7 +269,7 @@ uvc_events_process_class(struct uvc_device *dev, return; if (interface == dev->fc->control.intf.bInterfaceNumber) - uvc_events_process_control(dev, ctrl->bRequest, ctrl->wValue >> 8, resp); + uvc_events_process_control(dev, ctrl->bRequest, ctrl->wValue >> 8, ctrl->wLength, resp); else if (interface == dev->fc->streaming.intf.bInterfaceNumber) uvc_events_process_streaming(dev, ctrl->bRequest, ctrl->wValue >> 8, resp); } |