Received: by 10.213.65.68 with SMTP id h4csp842305imn; Fri, 23 Mar 2018 18:33:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELvLzpnc9/aLs/8P5CnV69tuPAiqtGI8nlIDb6wi7vIYWv4xZdx6nC4wXanSBO2HMFmVzTip X-Received: by 2002:a17:902:bb81:: with SMTP id m1-v6mr30891709pls.71.1521855196625; Fri, 23 Mar 2018 18:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521855196; cv=none; d=google.com; s=arc-20160816; b=LkzVy8I7sqvNN6rijjZ2Kvz5shpgYLQy+OUUYSUoWDkaaGG3TXi9BIQzmwhLeP/UE2 54S48fytc6enwej5Q1zPfjNGYeJr+nsCPTt+hHRW9mXPuqGKLvsF8TVgUf8amh6LCOgv vM6jGzzpzoEGmrMvTDPacOeOVQbLgVAl7we7bAqjcmcUvvvMn3QY+r4GfRLPOBsXrTOH pP9Qg7rcSZTRHEWFFOYTcIHjqEiB+hx1yVyw0aUKixXLzliHbLbLFD7G7EdAF8+XqG3A US5wXNPOB+rimnvBSN3jzlBznOUsHmFRx980jsxaTDDa6iVE719xsReR23nN2xuG9/LY 8zNg== 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=3HLmTn7Tbr13Nie41wHJLiRp4ErzZd2gZlzqipyYdFk=; b=p50l0jGyGtATR/zilyj4ctqHj/bhAuKE6gmyeH4LeX+tNi6bjzLFdEhG8NZuUsL6Rs CvXCX0mFwjJ/dpR4pp+bkp3yPUGsYXJg+Z7kzlvvLq6dLXJnEhro3/3X9q7cmka3r+cz althiSYguK6BrEFvN/TreS9gpEne+hyzyWPKTuYdLB+B7NL403wUollIu6FL/jKPEgLk OONKlKpZKcVvx58zJJpltduOf1v1O4zsI9C3edy+dhJPL+MXDGoB1zrAOcvO2OJacVps B4MKI7RHLKFJjmgDYNwwwNgrW7GEl03UthgbypjPCckPzWxUpNrhUZAYTK8hSpnkNce3 Gbug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WYKb0I52; 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 w16-v6si3346357plp.165.2018.03.23.18.33.02; Fri, 23 Mar 2018 18:33:16 -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=WYKb0I52; 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 S1751997AbeCXBcH (ORCPT + 99 others); Fri, 23 Mar 2018 21:32:07 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:43570 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeCXBcF (ORCPT ); Fri, 23 Mar 2018 21:32:05 -0400 Received: by mail-pf0-f195.google.com with SMTP id j2so5384009pff.10 for ; Fri, 23 Mar 2018 18:32:05 -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=3HLmTn7Tbr13Nie41wHJLiRp4ErzZd2gZlzqipyYdFk=; b=WYKb0I52jdOAg5qKVcBOvhGDF4trSvAD8P318bj1XyPRxiCmolLxoo1AfPTytAjLFH JTVL4BBu2KlbRIwizTJJQxnecPJKI36tgVHEb4B0+poMsncve4Jjg0f4g5cT1f8bHDOa T4LSd73oNZsUslH15tkYKUqdoK0DEMfFkz0mk= 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=3HLmTn7Tbr13Nie41wHJLiRp4ErzZd2gZlzqipyYdFk=; b=NLwK+dOJbSU4esuMpDOiklBGK3UW/79k00YyuT7LDafzVWzJKirWp8eM492VQsqYUh i/SEwJ14BjWHJscQj5015WCh74hcLK28g4FrFOSawLpLBYnz5grROGsjXrOmhSecyxzA N9QeAkkt4aLQzuFHwXU+eHTg2qKRnJe8UoUT0nIHrNfgqkG9JgglUI/u5BuId6nuFM6o CIjLqq+TNzsqjCEk2TIOtyg/Y1eZNroIC9Kqzi/GfdBgqY9uGPdW5CzwwlUkwRA8evRv 3gUXYr2wnPaCVPoUmIbMT+1DCgOAi6xo8ukKgktMiU6t6IaaB3dufIP6B9rAM4+YrHKc u0UQ== X-Gm-Message-State: AElRT7HkjfsHe0GEduCTKLywCjxVMw8pUqrjUVnoG19lQiUPscQRiqdx Q8TDnyTagpYsTE7ojFZc4ms2xg== X-Received: by 10.98.53.195 with SMTP id c186mr25885296pfa.199.1521855125451; Fri, 23 Mar 2018 18:32:05 -0700 (PDT) Received: from decatoncale.mtv.corp.google.com ([2620:0:1000:1501:e4e8:e3c6:19f1:ae51]) by smtp.gmail.com with ESMTPSA id q62sm21905775pfd.61.2018.03.23.18.32.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 18:32:04 -0700 (PDT) From: Benson Leung To: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: achant@google.com, bleung@google.com, Benson Leung Subject: [PATCH v2] USB: announce bcdDevice as well as idVendor, idProduct. Date: Fri, 23 Mar 2018 18:31:54 -0700 Message-Id: <20180324013154.230119-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 -- v2: Format for decimal output. --- drivers/usb/core/hub.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index aaeef03c0d83..624cde7ffcea 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2192,14 +2192,19 @@ 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", - le16_to_cpu(udev->descriptor.idVendor), - le16_to_cpu(udev->descriptor.idProduct)); + u16 bcdDevice; + + 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), + bcdDevice >> 8, bcdDevice & 0xff); dev_info(&udev->dev, - "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", - udev->descriptor.iManufacturer, - udev->descriptor.iProduct, - udev->descriptor.iSerialNumber); + "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", + udev->descriptor.iManufacturer, + udev->descriptor.iProduct, + udev->descriptor.iSerialNumber); show_string(udev, "Product", udev->product); show_string(udev, "Manufacturer", udev->manufacturer); show_string(udev, "SerialNumber", udev->serial); -- 2.17.0.rc0.231.g781580f067-goog