Received: by 10.213.65.68 with SMTP id h4csp1365368imn; Sat, 24 Mar 2018 10:41:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELuC0GBJA1Socy+8ly+wt6WQ3sxjw3C2CJ2f0reCeFAR+mxoEL7BnWZOY9qxqt38k+DMaT+S X-Received: by 10.99.191.8 with SMTP id v8mr24167677pgf.1.1521913319892; Sat, 24 Mar 2018 10:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521913319; cv=none; d=google.com; s=arc-20160816; b=vq8Y80aP30khT4eOd+73pu+6dcgCBDmQMP2jxjGXa//T3E7XHgdy/vqb45wC50fH2y L4zoDm85uQlH8Kt0BkoRi19Zuu5VTa/hO4gqoEUdceo0TsL4djSscntw8YoxawQtvMQS ZRfeiz5N2X67w6tVsSb5CGOhVxDWfKIMYs+YXcifNlBLG5zlGPsYf7c+cT9DpXpjVfWv Vfq+7t9IXXbIxgw9Pfmabt7s23CWIFB1AgKcgYr3felf/qp0QJUXek3KJyO01CFt7+m/ TrWzxEpaIk4/ps5u2w43i2A+Sx0EIMEAYobd2zGgCy9sndKkSAkIRSKlV8XQgGLRPyPU 4n0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JF1ATzAMg8HuaWJA7IAuD0xeneByWMNo31MTUdTpoR8=; b=OcsDbsPbhWwWV3ZGQT0ky5rJuNqeHLpK4OkJHxaNMmTz7OWD+wDii/hgaB2rr/LcEa SO5sjyxMzh0HyPGwY1xgCgpYb/tmCbXgFoeCJeu1EqDN0goYKUQ63ltUJOb7mZtTKej5 RzwjmK8phhid503R/x1Y7DZFFUV2Cr+7aMxC1NZIzDrbR+RGt7jqYg11olHD7TYQ028W X3INFFO8YxzAUYa1yhVuk/mrYZ1iuRoMWwKktmZWHvWUJ/4xH2Cacffsr7Qf+4umDNuv JhvYEbELqDuu70Bj6eSrl9h1eQm2E7aJUudRce/e7AFf01MVZRq+Qc8fNHBG0tggf1un /2Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HdNrQ9mZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13-v6si10580392plo.270.2018.03.24.10.41.43; Sat, 24 Mar 2018 10:41:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HdNrQ9mZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752672AbeCXRkq (ORCPT + 99 others); Sat, 24 Mar 2018 13:40:46 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40340 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752597AbeCXRko (ORCPT ); Sat, 24 Mar 2018 13:40:44 -0400 Received: by mail-pg0-f65.google.com with SMTP id g8so5749873pgv.7 for ; Sat, 24 Mar 2018 10:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JF1ATzAMg8HuaWJA7IAuD0xeneByWMNo31MTUdTpoR8=; b=HdNrQ9mZzM+bw8+BGeTF5ZIRjuFHs+MwLaiFO/H1nGcftWtgWsOAs78hKHzLxl61Ey u6p9mak3IQ6gAU83Nv8e5SD/mZC/MVYOvIo2oVM8VZC9rvDwT2w0vEgJY9VZvakYjRM5 eMb6w/wHO0LgDIpRpV1na6tACCfAm4BqWY+fc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JF1ATzAMg8HuaWJA7IAuD0xeneByWMNo31MTUdTpoR8=; b=UDv9m5BZ6TtZciM/KrH6p8v46b2X98BoRBcx4ar/EMC1ajxFB9r8Mhq2/GoHxxjpv+ vZRmb09gDH5JN7qbPR86/AN+gckOukwbOHPGWl5ieZa+SGtMTWeizw5dmisfCgSqArJc d8oNkutGwXjs3A+jzwh2uX3blm7NEUXPspdn2dnGa3kX+vK4KMhZ1aNdFNFXdNtKoJjk Sr0bhe7+Kv9vR4EJp3UQSJCQwKIYzGP7LXVCQvygE8mklcJnJha+OYXl1qnkf0SMgpll 2IilVVNmTBEXMwUZI8ifMn5Ygt7tRrj5rCV8YHnkzIQ6k7WI9lNUSurHOK6uq6inuIsv Poaw== X-Gm-Message-State: AElRT7H7Y2l5HAm+xk9gKIBrQi79kJSo5Lq8Y+L6l49TTdZOy4GIaw49 fgCIge8G1R6K5FMn+FV16m6sQQ== X-Received: by 10.99.155.2 with SMTP id r2mr18544597pgd.450.1521913244237; Sat, 24 Mar 2018 10:40:44 -0700 (PDT) Received: from decatoncale.mtv.corp.google.com ([2620:0:1000:1501:e4e8:e3c6:19f1:ae51]) by smtp.gmail.com with ESMTPSA id s89sm26050933pfk.54.2018.03.24.10.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Mar 2018 10:40:43 -0700 (PDT) From: Benson Leung To: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stern@rowland.harvard.edu Cc: achant@google.com, bleung@google.com, Benson Leung Subject: [PATCH v3] USB: announce bcdDevice as well as idVendor, idProduct. Date: Sat, 24 Mar 2018 10:40:27 -0700 Message-Id: <20180324174027.12522-1-bleung@chromium.org> X-Mailer: git-send-email 2.17.0.rc0.231.g781580f067-goog In-Reply-To: <20180324003330.180726-1-bleung@chromium.org> References: <20180324003330.180726-1-bleung@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Print bcdDevice which is used by vendors to identify different versions of the same product (or different versions of firmware). Adding this to the logs will be useful for support purposes. Match the %2x.%02x formatting that's used by lsusb -v for this same value. Signed-off-by: Benson Leung --- v3: Remove unnecessary whitespace changes. v2: Format for decimal output. drivers/usb/core/hub.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index aaeef03c0d83..779725836cf5 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2192,9 +2192,13 @@ 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", + u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); + + dev_info(&udev->dev, + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%2x.%02x\n", le16_to_cpu(udev->descriptor.idVendor), - le16_to_cpu(udev->descriptor.idProduct)); + le16_to_cpu(udev->descriptor.idProduct), + bcdDevice >> 8, bcdDevice & 0xff); dev_info(&udev->dev, "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", udev->descriptor.iManufacturer, -- 2.17.0.rc0.231.g781580f067-goog