From: Paul Bolle <pebolle@tiscali.nl>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: also announce bcdDevice
Date: Sat, 05 May 2012 13:51:59 +0200 [thread overview]
Message-ID: <1336218719.8450.19.camel@x61.thuisdomein> (raw)
Currently announce_device() does print the idVendor and idProduct values
but does not print the bcdDevice value. USB devices are accurately
identified by all three values. See, for instance, the USB storage
quirks which will only apply for a certain (range of) bcdDevice
value(s). So it seems useful to also print bcdDevice when announcing USB
devices.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) This is something I ran into while trying to track down the log
errors generated by each of the USB sticks I happen to have lying
around. Of course, there are other ways to track down the bcdDevice
value of a specific device ("lusb -v -d $vendorid:$productid | grep
bcdDevice" or "usb-devices | grep $vendorid.*$productid" come to mind).
But since idVendor and idProduct are already printed by this debugging
aid I think adding bcdDevice makes sense too. But is this all worth the
small bit of additional noise?
1) The patch generates a checkpatch warning: "quoted string split across
lines". But since it is hard to grep for this entire string without
knowing the printk "conversion specifications" in the string beforehand,
I think the warning can be ignored here. Note that I actually found this
string by git grepping for just "New USB device found".
drivers/usb/core/Kconfig | 4 ++--
drivers/usb/core/hub.c | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 18d02e3..85f795b 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -14,8 +14,8 @@ config USB_ANNOUNCE_NEW_DEVICES
depends on USB
default N
help
- Say Y here if you want the USB core to always announce the
- idVendor, idProduct, Manufacturer, Product, and SerialNumber
+ Say Y here if you want the USB core to always announce the idVendor,
+ idProduct, bcdDevice, Manufacturer, Product, and SerialNumber
strings for every new USB device to the syslog. This option is
usually used by distro vendors to help with debugging and to
let users know what specific device was added to the machine
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index ec6c97d..6e1bfaea 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1726,9 +1726,11 @@ static void show_string(struct usb_device *udev, char *id, char *string)
static void announce_device(struct usb_device *udev)
{
- dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n",
+ dev_info(&udev->dev, "New USB device found, idVendor=%04x, "
+ "idProduct=%04x, bcdDevice=%04x\n",
le16_to_cpu(udev->descriptor.idVendor),
- le16_to_cpu(udev->descriptor.idProduct));
+ le16_to_cpu(udev->descriptor.idProduct),
+ le16_to_cpu(udev->descriptor.bcdDevice));
dev_info(&udev->dev,
"New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
udev->descriptor.iManufacturer,
--
1.7.7.6
next reply other threads:[~2012-05-05 11:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-05 11:51 Paul Bolle [this message]
2012-05-05 12:14 ` Martin Mokrejs
2012-05-05 14:52 ` Greg Kroah-Hartman
2012-05-05 15:09 ` Martin Mokrejs
2012-05-05 15:28 ` Alan Stern
2012-05-05 17:49 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336218719.8450.19.camel@x61.thuisdomein \
--to=pebolle@tiscali.nl \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®