From 0df9d3ad860ecd78f1bf8ad6bd5ceccaf40a9e07 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 22 Nov 2022 15:34:22 +0000 Subject: 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 Signed-off-by: Daniel Scally Signed-off-by: Kieran Bingham --- lib/uvc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/uvc.c b/lib/uvc.c index be10344..747cd65 100644 --- a/lib/uvc.c +++ b/lib/uvc.c @@ -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); } -- cgit v1.2.3