summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorLandry Breuil <landry@cvs.openbsd.org>2018-04-24 17:22:34 +0000
committerLandry Breuil <landry@cvs.openbsd.org>2018-04-24 17:22:34 +0000
commit45c2b82effa56c3ebf8b9cf77afdf488b13c06a9 (patch)
tree779377efb241e56738feff4cb2aa8ad57ef85932 /sys/dev
parent60312cdcde144260d48770f5a749146c7d8385e7 (diff)
Fill the 'card' member of v4l2_capability struct with the usb product
name coming from usbd_devinfo_vp() instead of the dummy "Generic USB video class device" string, makes it easier to differentiate multiple webcams in firefox's webrtc permission dialog. ok/help mpi@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_subr.c4
-rw-r--r--sys/dev/usb/usbdivar.h4
-rw-r--r--sys/dev/usb/uvideo.c9
3 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 589eb55777e..558e393fa10 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.134 2017/04/08 02:57:25 deraadt Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.135 2018/04/24 17:22:33 landry Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -61,8 +61,6 @@ extern int usbdebug;
usbd_status usbd_set_config(struct usbd_device *, int);
void usbd_devinfo(struct usbd_device *, int, char *, size_t);
-void usbd_devinfo_vp(struct usbd_device *, char *, size_t,
- char *, size_t, int);
char *usbd_get_device_string(struct usbd_device *, uByte);
char *usbd_get_string(struct usbd_device *, int, char *, size_t);
int usbd_getnewaddr(struct usbd_bus *);
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index cc653bc5c28..42f7974e90b 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.73 2018/02/03 13:37:37 mpi Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.74 2018/04/24 17:22:33 landry Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -257,6 +257,8 @@ usbd_status usbd_fill_iface_data(struct usbd_device *, int, int);
usbd_status usb_insert_transfer(struct usbd_xfer *);
void usb_transfer_complete(struct usbd_xfer *);
int usbd_detach(struct usbd_device *, struct device *);
+void usbd_devinfo_vp(struct usbd_device *, char *, size_t,
+ char *, size_t, int);
/* Routines from usb.c */
void usb_needs_explore(struct usbd_device *, int);
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 007a6e92d38..3711ee24949 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.196 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: uvideo.c,v 1.197 2018/04/24 17:22:33 landry Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -2781,11 +2781,14 @@ int
uvideo_querycap(void *v, struct v4l2_capability *caps)
{
struct uvideo_softc *sc = v;
+ char vendor[USB_MAX_STRING_LEN];
+ char product[USB_MAX_STRING_LEN];
bzero(caps, sizeof(*caps));
strlcpy(caps->driver, DEVNAME(sc), sizeof(caps->driver));
- strlcpy(caps->card, "Generic USB video class device",
- sizeof(caps->card));
+ usbd_devinfo_vp(sc->sc_udev, vendor, sizeof (vendor), product,
+ sizeof (product), 0);
+ strlcpy(caps->card, product, sizeof(caps->card));
strlcpy(caps->bus_info, "usb", sizeof(caps->bus_info));
caps->version = 1;