<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_uvc.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-01-18T10:40:47Z</updated>
<entry>
<title>usb: gadget: uvc: Prevent buffer overflow in setup handler</title>
<updated>2023-01-18T10:40:47Z</updated>
<author>
<name>Szymon Heidrich</name>
</author>
<published>2022-12-06T14:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8fb1cba934ea122b50f13a4f9d6fc4fdc43d2be'/>
<id>urn:sha1:b8fb1cba934ea122b50f13a4f9d6fc4fdc43d2be</id>
<content type='text'>
commit 4c92670b16727365699fe4b19ed32013bab2c107 upstream.

Setup function uvc_function_setup permits control transfer
requests with up to 64 bytes of payload (UVC_MAX_REQUEST_SIZE),
data stage handler for OUT transfer uses memcpy to copy req-&gt;actual
bytes to uvc_event-&gt;data.data array of size 60. This may result
in an overflow of 4 bytes.

Fixes: cdda479f15cd ("USB gadget: video class function driver")
Cc: stable &lt;stable@kernel.org&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Daniel Scally &lt;dan.scally@ideasonboard.com&gt;
Signed-off-by: Szymon Heidrich &lt;szymon.heidrich@gmail.com&gt;
Link: https://lore.kernel.org/r/20221206141301.51305-1-szymon.heidrich@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: webcam: Invalid size of Processing Unit Descriptor</title>
<updated>2021-05-11T12:04:05Z</updated>
<author>
<name>Pawel Laszczak</name>
</author>
<published>2021-03-15T07:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b2207a1966430faa1101b45b7e904e62efdec50'/>
<id>urn:sha1:1b2207a1966430faa1101b45b7e904e62efdec50</id>
<content type='text'>
[ Upstream commit 6a154ec9ef6762c774cd2b50215c7a8f0f08a862 ]

According with USB Device Class Definition for Video Device the
Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
but it has 11.

Invalid length caused that Processing Unit Descriptor Test Video form
CV tool failed. To fix this issue patch adds bmVideoStandards into
uvc_processing_unit_descriptor structure.

The bmVideoStandards field was added in UVC 1.1 and it wasn't part of
UVC 1.0a.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Link: https://lore.kernel.org/r/20210315071748.29706-1-pawell@gli-login.cadence.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: add bInterval checking for HS mode</title>
<updated>2021-05-11T12:04:05Z</updated>
<author>
<name>Pawel Laszczak</name>
</author>
<published>2021-03-08T12:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4cc65c749d582b683e5eefa085c638737d90004a'/>
<id>urn:sha1:4cc65c749d582b683e5eefa085c638737d90004a</id>
<content type='text'>
[ Upstream commit 26adde04acdff14a1f28d4a5dce46a8513a3038b ]

Patch adds extra checking for bInterval passed by configfs.
The 5.6.4 chapter of USB Specification (rev. 2.0) say:
"A high-bandwidth endpoint must specify a period of 1x125 µs
(i.e., a bInterval value of 1)."

The issue was observed during testing UVC class on CV.
I treat this change as improvement because we can control
bInterval by configfs.

Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Link: https://lore.kernel.org/r/20210308125338.4824-1-pawell@gli-login.cadence.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: usb/gadget/f_uvc: set device_caps in struct video_device</title>
<updated>2019-06-05T12:47:44Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2019-06-04T11:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1397e3ec0cff0110a1d9c1b1d5fd2c79bfe72fc9'/>
<id>urn:sha1:1397e3ec0cff0110a1d9c1b1d5fd2c79bfe72fc9</id>
<content type='text'>
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

But this only really works if all drivers use this, so convert
this UVC gadget driver.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Remove uvc_set_trace_param() function</title>
<updated>2018-09-25T15:48:07Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-09-18T11:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d865d00db9e69eb2e6f7c4166e33e5047de497bc'/>
<id>urn:sha1:d865d00db9e69eb2e6f7c4166e33e5047de497bc</id>
<content type='text'>
The function is never called, remove it.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Replace plain printk() with dev_*()</title>
<updated>2018-09-25T15:41:00Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-08-10T12:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc0f755b421d5aac9052f43c9d0e7285607d446c'/>
<id>urn:sha1:dc0f755b421d5aac9052f43c9d0e7285607d446c</id>
<content type='text'>
Adding device context to the kernel log messages make them more useful.
Add new uvcg_* macros based on dev_*() that print both the gadget device
name and the function name.

While at it, remove a commented out printk statement and an unused
printk-based macro.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Tested-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: configfs: Add interface number attributes</title>
<updated>2018-09-24T15:54:26Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-05-23T15:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf71544883a1ccb20021eb5139475496dbd8abd9'/>
<id>urn:sha1:bf71544883a1ccb20021eb5139475496dbd8abd9</id>
<content type='text'>
The video control and video streaming interface numbers are needed in
the UVC gadget userspace stack to reply to UVC requests. They are
hardcoded to fixed values at the moment, preventing configurations with
multiple functions.

To fix this, make them dynamically discoverable by userspace through
read-only configfs attributes in &lt;function&gt;/control/bInterfaceNumber and
&lt;function&gt;/streaming/bInterfaceNumber respectively.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: configfs: Allocate groups dynamically</title>
<updated>2018-09-24T15:54:23Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-05-24T14:49:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=efbf0af70b4f7ee6ed1533ed0d905255c0545e08'/>
<id>urn:sha1:efbf0af70b4f7ee6ed1533ed0d905255c0545e08</id>
<content type='text'>
The UVC configfs implementation creates all groups as global static
variables. This prevents creation of multiple UVC function instances,
as they would all require their own configfs group instances.

Fix this by allocating all groups dynamically. To avoid duplicating code
around, extend the config_item_type structure with group name and
children, and implement helper functions to create children
automatically for most groups.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Expose configuration name through video node</title>
<updated>2018-07-26T10:43:18Z</updated>
<author>
<name>Kieran Bingham</name>
</author>
<published>2018-05-24T16:16:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7af78b9245545908c90bce2206f200a4250b5db'/>
<id>urn:sha1:d7af78b9245545908c90bce2206f200a4250b5db</id>
<content type='text'>
When utilising multiple instantiations of a UVC gadget on a composite
device, there is no clear method to link a particular configuration to
its respective video node.

Provide a means for identifying the correct video node by exposing the
name of the function configuration through sysfs.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Move trace parameter to function module</title>
<updated>2018-07-26T10:33:48Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-05-21T08:28:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20970d823a17f87aa4105febc181e5ee823dbe25'/>
<id>urn:sha1:20970d823a17f87aa4105febc181e5ee823dbe25</id>
<content type='text'>
The trace module parameter controls output of debugging messages in the
UVC function driver. Move it from the webcam module to the UVC function
module where it belongs. This allows ConfigFS-based UVC gadgets to
control tracing.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
</feed>
