Received: by 10.213.65.68 with SMTP id h4csp822838imn; Fri, 23 Mar 2018 17:51:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELsWYuYzZAFHGy59EZuV3eyx92ytqpgbiJzvD5hZiXF5+QLqG91MZX+o1GgAB6XCfsSwARek X-Received: by 2002:a17:902:8492:: with SMTP id c18-v6mr31039487plo.40.1521852688724; Fri, 23 Mar 2018 17:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521852688; cv=none; d=google.com; s=arc-20160816; b=fwuzOdo/3OcDeNhVqrEYu+20+DwR2RHwnsM+YULTQo1M44tjye37omOgRmTWEWKEfV vqKU/4nXZ4mPQ51KC9Tjc3HgJbnsxU/AXqA2Wkilx3JZBnIjyldRbZFE9dpiMmlJ8Rt3 /Gf3mWs9InAHT4YSEX2WqEHy6VmdvSqH1fVrna0Y9HkxB6ge7fW8qrlCkwhv1rY9KuJg 70TMsezAHhXTZ3khHkdwhKGSaI76nxax6zND53RI/JCoJ9jYW8XHh5Kr1vP/eDPb+6F0 SezUUIMdHKEmb2ofgU+OKyWuuE/CLdmQ17ezUw2WaYHElN3QGlz89brEZljrtPH6fvrW L5TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=CdPWoatdafxOsHY14GuvVkaqUwe/HZqeCbVXTmaYraA=; b=u3ejaZjwuhnRxL86IzJ0bN4tLBesaSqtmm0ZmIbdxnHGm8JrlY6r6xlJtT5x2R3bi7 kak3US80bzbY6qCN7uUUrXSDMoHsmumoYwfWf9HhT/Ues3gmGLCmNJ+nXL6KsKhZppOK caqrtvpGYweW3SDAnP3kq0+3SrRmauR00hync8qiGdcXdguwKIM1h1b9VQngjLa5l8F+ 4JqYBR2wqChy5UoF4hu39p67ArJ6+2RuV/ENUVP2tRjlh+iTn08Pa6mGXMYIyHj4w75e DzoMjW5PT+blb+AlRhuIE/eLmV5ZxZ0vqQoGv8x7/elgK+uR91I++Una5xooOqrjkLCs gxvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gYO4GWV+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65-v6si9591577plb.573.2018.03.23.17.51.14; Fri, 23 Mar 2018 17:51:28 -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=@google.com header.s=20161025 header.b=gYO4GWV+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751981AbeCXAtU (ORCPT + 99 others); Fri, 23 Mar 2018 20:49:20 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:40195 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751600AbeCXAtS (ORCPT ); Fri, 23 Mar 2018 20:49:18 -0400 Received: by mail-yw0-f194.google.com with SMTP id r145so4533851ywe.7 for ; Fri, 23 Mar 2018 17:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CdPWoatdafxOsHY14GuvVkaqUwe/HZqeCbVXTmaYraA=; b=gYO4GWV+ccPEj/JT5Qzc5gJv2m37uJZGosWI8oYWvi0nL6gYpk491cb4lm8J8Q3eFk fdjsXFIsshmILhLzZ42MVFt87tq3lIxACRlK7ceI5gVaJgmxdPZsMY10wAdWzYhsh+/F +hNTu/4QjXoF/fJGVSTMO5W43/oog0RcRbiGLBbDhwp/IOzMY1ug8bGoaRGEI9tc1xFp YVJq3oCa4IKqDljpIOffd1WvgyW0YwgL06fw6BUuau9SAKne1ZoHd44bZa3ZkeUUaCWV r/6gHS4Bb/p/t5meUCLr9HSJhorJvD28ZnhTPFLmiGex1xG+wmHZNuoeQ2f7S8sQEv+y YJ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CdPWoatdafxOsHY14GuvVkaqUwe/HZqeCbVXTmaYraA=; b=ufHadUyNdrRFJ2jmmsKh0nWYOOVQOmIvaF1Nf4zB0UpQnUFPyAwR/40NV1BbQM9bFR SWjoGGx3DDyPErPuv9+c/IC6bKe2bfAfyZl8cGscw9iMybZMs2t6P0lfX/jlr8asJo/q csTLP5l/EhNvQ3fLuqL3htAgfVa3AdfomneyO9sO1+JVsTvfLbj931qzTwzr8aTIa35G swuaewpK4sRPJn8C7TDFl7t8/CEbpykxs6G4RL9bi+vxbpEI/igUVvOcTzfOktvAhR32 23qITCFnYPqoEwnK6KXt+c/5AVisFkCQQBOIzYcpL2ZWPYBWekq6xEc6UTAZ0LrQD5WN kCHQ== X-Gm-Message-State: AElRT7HYcSfKTcjyvPz4kwH23WYNL0o9VKtwB75r1WFvytGVLMHUHaDl WXH4Yb4lX/oZOhw4cl1VB/yyS+TD0AdKnILu+9zViQ== X-Received: by 10.129.131.137 with SMTP id t131mr511323ywf.168.1521852557650; Fri, 23 Mar 2018 17:49:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:6a41:0:0:0:0:0 with HTTP; Fri, 23 Mar 2018 17:48:37 -0700 (PDT) In-Reply-To: <20180324003330.180726-1-bleung@chromium.org> References: <20180324003330.180726-1-bleung@chromium.org> From: Andrew Chant Date: Fri, 23 Mar 2018 17:48:37 -0700 Message-ID: Subject: Re: [PATCH] USB: announce bcdDevice as well as idVendor, idProduct. To: Benson Leung Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Benson Leung Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 5:33 PM, Benson Leung wrote: > 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. > > Signed-off-by: Benson Leung > --- > drivers/usb/core/hub.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index aaeef03c0d83..739d599814b6 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2192,14 +2192,16 @@ 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)); > 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 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.bcdDevice)); > + dev_info(&udev->dev, > + "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 > > + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%04x\n", Can you please decode bcdDevice into a decimal string? lsusb -v does this (bcdDevice: 0.03 for example) and in my experience it has generally matched up with how hardware manufacturers refer to their firmware.