From patchwork Sat Nov 26 16:22:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 628863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AECC6C4167B for ; Sat, 26 Nov 2022 16:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbiKZQWm (ORCPT ); Sat, 26 Nov 2022 11:22:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbiKZQWi (ORCPT ); Sat, 26 Nov 2022 11:22:38 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251F5E02C; Sat, 26 Nov 2022 08:22:37 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id f9so6266574pgf.7; Sat, 26 Nov 2022 08:22:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=vkA/imn3R47+/xWfnmkBBzHVEaOv5ORTLT0XDNYcHEQ=; b=ON/gRuzSyPH7S6hT2zLZ5P/N1rDVq2AAs/J1IG1Q4wK//8xSZJmYCo3ea9cghVmONi AkbwjnPARZ+CkiUZ1LcufjhMuu5TCWGFytab6j4pCw09Pe+EsD0sklq1HTHm7PBws6Iz +ugY8jxmIC6aMemQ0OQnE0iQaY7+iFXo8633ASE+Oq3HJ2I88uE+/E05poH811GWXP1P TPO56OLkdAIcW1kRz/IcXL4WtzrQrIzs1NTFxpiXF/m1QfGdHdMrDmTGW2vtdskJx4WF bFEM0wwUHW5zPbQ24ozWVwi8RORyqG2XoP6tWmb7GLESbClu5TvNTvz4EV0fnivfvbJ7 wyDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vkA/imn3R47+/xWfnmkBBzHVEaOv5ORTLT0XDNYcHEQ=; b=QizfY/Mr4EAamKhov6itfyASzG37bg+1l4kBJ6BxM+xljSuuRSxf2/TefHgc4evp+9 iJSwS46q6U8+N1hA0A2mlrGybZbOGmc79inHlyf24VHRsHbZqK+RJ7LopgKaIXxi03Qv /AH4sOgDGOg47scG4A1wyZtpD4oWi6nkkq3bbtioWIyMHLq70qTi743C1ovsGTRa8KzW 7oo7JHkFr603ZBMwwDIsEU1BDNqCG8okDrXCHQJg/X+EQ26uJQ7Wi0yT/RHiZx4qxtuV fWGbVEm9tUD6qYKxyabdb/NYJQoSQ5Ss5sGCGnz+vEVANOfE67tPzIPxDL8+xHvWfxqQ US9Q== X-Gm-Message-State: ANoB5pkjOJ8/B8lFlostNkH8kjbqr7Gn06K1uQ6a4r8T8meJ+RPBmJlO mZE7fc81KCp1ce5iflJxG2xooIiNb6QfRA== X-Google-Smtp-Source: AA0mqf7fmuTWhI65nOvLLpZtsmkmtKCw1vpCYxAHCFZqF3ekFRZw15D0ehZglhBEjFK5l6ObgCydrg== X-Received: by 2002:a65:4948:0:b0:46e:be03:d9b5 with SMTP id q8-20020a654948000000b0046ebe03d9b5mr19928275pgs.495.1669479756374; Sat, 26 Nov 2022 08:22:36 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id y14-20020a63e24e000000b00460ea630c1bsm4169601pgj.46.2022.11.26.08.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:22:36 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Andrew Lunn , Jiri Pirko , Lukas Magel , Vincent Mailhol Subject: [PATCH v4 1/6] USB: core: export usb_cache_string() Date: Sun, 27 Nov 2022 01:22:06 +0900 Message-Id: <20221126162211.93322-2-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org usb_cache_string() can also be useful for the drivers so export it. Signed-off-by: Vincent Mailhol Acked-by: Greg Kroah-Hartman --- For reference, acked by Greg here: https://lore.kernel.org/linux-usb/Y3zyCz5HbGdsxmRT@kroah.com/ --- drivers/usb/core/message.c | 1 + drivers/usb/core/usb.h | 1 - include/linux/usb.h | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 4d59d927ae3e..127fac1af676 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1037,6 +1037,7 @@ char *usb_cache_string(struct usb_device *udev, int index) } return smallbuf; } +EXPORT_SYMBOL_GPL(usb_cache_string); /* * usb_get_device_descriptor - (re)reads the device descriptor (usbcore) diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 82538daac8b8..0eac7d4285d1 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -47,7 +47,6 @@ extern int usb_get_device_descriptor(struct usb_device *dev, extern int usb_set_isoch_delay(struct usb_device *dev); extern int usb_get_bos_descriptor(struct usb_device *dev); extern void usb_release_bos_descriptor(struct usb_device *dev); -extern char *usb_cache_string(struct usb_device *udev, int index); extern int usb_set_configuration(struct usb_device *dev, int configuration); extern int usb_choose_configuration(struct usb_device *udev); extern int usb_generic_driver_probe(struct usb_device *udev); diff --git a/include/linux/usb.h b/include/linux/usb.h index 9ff1ad4dfad1..d2d2f41052c0 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1829,6 +1829,7 @@ static inline int usb_get_ptm_status(struct usb_device *dev, void *data) extern int usb_string(struct usb_device *dev, int index, char *buf, size_t size); +extern char *usb_cache_string(struct usb_device *udev, int index); /* wrappers that also update important state inside usbcore */ extern int usb_clear_halt(struct usb_device *dev, int pipe); From patchwork Sat Nov 26 16:22:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 628970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37976C46467 for ; Sat, 26 Nov 2022 16:22:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbiKZQWp (ORCPT ); Sat, 26 Nov 2022 11:22:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiKZQWl (ORCPT ); Sat, 26 Nov 2022 11:22:41 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5017D133; Sat, 26 Nov 2022 08:22:39 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id z17so1849424pff.1; Sat, 26 Nov 2022 08:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=FmB9Jwaiin8tKBRiu/35E9rAp2jafIlqnhIKGIJ7dMk=; b=khULKVn7mhBorIgJ9/uSv1GtI9gWeAf7IdoCqRohNUR3WBjwfEG8IRQpjhUFMcy/pF bZUfl5luaKyGxgWulR/VhNJE06b6pbsTiAcTuWh2zfW7cBzfeQBnyllksrnct6RuRZbs 4YejzBFsRwKBoUC8ir9dG4ru0k8JluVmTAqU/ZbCPGwzdPGccBSn+wZNcxsDGhM7lQZG k+PbJtI0sAUGEBZsMCTP6WaSfg7Vbkl4umo6qg8T7mEz9QkwpvT1PWDyfkwycKKLOTh/ MjJqiibil70zUkopTYedSZ7NMce7bCMAFfPTkiA7JQ4guX5sFdEcB4GQ/kspK0PkWaZ5 JwvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FmB9Jwaiin8tKBRiu/35E9rAp2jafIlqnhIKGIJ7dMk=; b=1EOziRpsfVc7Cr3G+akDuRslHTKyyYDmQYrYgzu2OY3c3PbZVuQ8ma4SUgiD1c5A3i lRU4gMFmmtAM4m5k52FF6Yn/wZxJHlrNTn9mixzLJ6yr8zN8d4bYIHQUs1dt1nKlO71b v8B7C65XknCtOQHPu1WMd45aCDY2Z/11vMiImElDd4JdLHmH4qibnarqZBgDczgSjQ/V s3+9IzgLDiL4bTMv5MCAUJEGhD8ft21z99VDZQzVjW931o3CBE3xrzk4QWa9RypbC9Xq AbPjY0SFuE06PRNQShLL5KrbBPFTwi+XzdhpNmFUzmTxAORVMULFSFcOrvY4aHEVE4bS okUA== X-Gm-Message-State: ANoB5pl6voL9R3Z7EW5stRWpdivMddQlOrmQCGlxs3Zaepq/zjf3adEI WGCrP5dSA/3w0i1eISZ9ayQvjDGOF+REdw== X-Google-Smtp-Source: AA0mqf7akjIjMCphTmSxxnnBmxi9wciY15SqpAYixyIBB/XT6sXM2NQhkloK/fTYG/BtfblF55IISw== X-Received: by 2002:a63:1f63:0:b0:460:ec46:3645 with SMTP id q35-20020a631f63000000b00460ec463645mr40054183pgm.92.1669479758992; Sat, 26 Nov 2022 08:22:38 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id y14-20020a63e24e000000b00460ea630c1bsm4169601pgj.46.2022.11.26.08.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:22:38 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Andrew Lunn , Jiri Pirko , Lukas Magel , Vincent Mailhol Subject: [PATCH v4 2/6] can: etas_es58x: add devlink support Date: Sun, 27 Nov 2022 01:22:07 +0900 Message-Id: <20221126162211.93322-3-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add basic support for devlink. The callbacks of struct devlink_ops will be implemented next. Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/Kconfig | 1 + drivers/net/can/usb/etas_es58x/Makefile | 2 +- drivers/net/can/usb/etas_es58x/es58x_core.c | 13 ++++++++++--- drivers/net/can/usb/etas_es58x/es58x_core.h | 6 ++++++ drivers/net/can/usb/etas_es58x/es58x_devlink.c | 13 +++++++++++++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 drivers/net/can/usb/etas_es58x/es58x_devlink.c diff --git a/drivers/net/can/usb/Kconfig b/drivers/net/can/usb/Kconfig index 8c6fea661530..445504ababce 100644 --- a/drivers/net/can/usb/Kconfig +++ b/drivers/net/can/usb/Kconfig @@ -30,6 +30,7 @@ config CAN_ESD_USB config CAN_ETAS_ES58X tristate "ETAS ES58X CAN/USB interfaces" select CRC16 + select NET_DEVLINK help This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from ETAS GmbH (https://www.etas.com/en/products/es58x.php). diff --git a/drivers/net/can/usb/etas_es58x/Makefile b/drivers/net/can/usb/etas_es58x/Makefile index a129b4aa0215..d6667ebe259f 100644 --- a/drivers/net/can/usb/etas_es58x/Makefile +++ b/drivers/net/can/usb/etas_es58x/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_CAN_ETAS_ES58X) += etas_es58x.o -etas_es58x-y = es58x_core.o es581_4.o es58x_fd.o +etas_es58x-y = es58x_core.o es58x_devlink.o es581_4.o es58x_fd.o diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c index 4c97102202bf..c6e598e4800c 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "es58x_core.h" @@ -2174,6 +2175,7 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, { struct device *dev = &intf->dev; struct es58x_device *es58x_dev; + struct devlink *devlink; const struct es58x_parameters *param; const struct es58x_operators *ops; struct usb_device *udev = interface_to_usbdev(intf); @@ -2196,11 +2198,12 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, ops = &es581_4_ops; } - es58x_dev = devm_kzalloc(dev, es58x_sizeof_es58x_device(param), - GFP_KERNEL); - if (!es58x_dev) + devlink = devlink_alloc(&es58x_dl_ops, es58x_sizeof_es58x_device(param), + dev); + if (!devlink) return ERR_PTR(-ENOMEM); + es58x_dev = devlink_priv(devlink); es58x_dev->param = param; es58x_dev->ops = ops; es58x_dev->dev = dev; @@ -2247,6 +2250,8 @@ static int es58x_probe(struct usb_interface *intf, if (ret) return ret; + devlink_register(priv_to_devlink(es58x_dev)); + for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) { ret = es58x_init_netdev(es58x_dev, ch_idx); if (ret) { @@ -2272,8 +2277,10 @@ static void es58x_disconnect(struct usb_interface *intf) dev_info(&intf->dev, "Disconnecting %s %s\n", es58x_dev->udev->manufacturer, es58x_dev->udev->product); + devlink_unregister(priv_to_devlink(es58x_dev)); es58x_free_netdevs(es58x_dev); es58x_free_urbs(es58x_dev); + devlink_free(priv_to_devlink(es58x_dev)); usb_set_intfdata(intf, NULL); } diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.h b/drivers/net/can/usb/etas_es58x/es58x_core.h index 4a082fd69e6f..bf24375580e5 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.h +++ b/drivers/net/can/usb/etas_es58x/es58x_core.h @@ -674,6 +674,7 @@ static inline enum es58x_flag es58x_get_flags(const struct sk_buff *skb) return es58x_flags; } +/* es58x_core.c. */ int es58x_can_get_echo_skb(struct net_device *netdev, u32 packet_idx, u64 *tstamps, unsigned int pkts); int es58x_tx_ack_msg(struct net_device *netdev, u16 tx_free_entries, @@ -691,9 +692,14 @@ int es58x_rx_cmd_ret_u32(struct net_device *netdev, int es58x_send_msg(struct es58x_device *es58x_dev, u8 cmd_type, u8 cmd_id, const void *msg, u16 cmd_len, int channel_idx); +/* es58x_devlink.c. */ +extern const struct devlink_ops es58x_dl_ops; + +/* es581_4.c. */ extern const struct es58x_parameters es581_4_param; extern const struct es58x_operators es581_4_ops; +/* es58x_fd.c. */ extern const struct es58x_parameters es58x_fd_param; extern const struct es58x_operators es58x_fd_ops; diff --git a/drivers/net/can/usb/etas_es58x/es58x_devlink.c b/drivers/net/can/usb/etas_es58x/es58x_devlink.c new file mode 100644 index 000000000000..af6ca7ada23f --- /dev/null +++ b/drivers/net/can/usb/etas_es58x/es58x_devlink.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* Driver for ETAS GmbH ES58X USB CAN(-FD) Bus Interfaces. + * + * File es58x_devlink.c: report the product information using devlink. + * + * Copyright (c) 2022 Vincent Mailhol + */ + +#include + +const struct devlink_ops es58x_dl_ops = { +}; From patchwork Sat Nov 26 16:22:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 628862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB99FC4167B for ; Sat, 26 Nov 2022 16:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbiKZQWs (ORCPT ); Sat, 26 Nov 2022 11:22:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKZQWn (ORCPT ); Sat, 26 Nov 2022 11:22:43 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BCD326A; Sat, 26 Nov 2022 08:22:42 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id 9so6637602pfx.11; Sat, 26 Nov 2022 08:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=xN3ydGNmt/NIkyDnxS01qJwZNhn0e4E8fz0G/KiL0Cs=; b=mMFp9jNqoQmZDOo5IFAg0tIYHe/kgkCWuwfLlikHbCI7u+xPrH3Y8ZwQrsuYgJC7D8 0aNVwrTKqV/ZT1k5ebhirDDgAePTk6t4BaGGGoHbHeUmli58hf3jhB64AbSs9IYLsLXq BAAlmTZ8fGPPmHBqIOPxb7WGvtfITVb7UhkOBRVMX6CKLIIJxHz8wNQmMYF+rHGol/qs fZ+W+GuoO8hAD/04WErVZ37dlMYmIre/0TMkr7ULtWBDh7wd/lyfKxiKqvIoxy/VSdR6 JV4Ctvs9MfazyvUQrPvzF/iToznlIFHAzTwkn//xvV6IyemqIOsXZQtmXxzCy9k4OiLK fxBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xN3ydGNmt/NIkyDnxS01qJwZNhn0e4E8fz0G/KiL0Cs=; b=zhZcrL2uSvaH66CnHGingTlca7CMXw2RNyDOyXMwXePIf8ANuz2YG5lgdOCPjwlcdw JheichDHtIZW0EwN4GzrtUjx1au740Q9ZKaYO9bRQDuVfJoWb0OCHgLEFubqutCTcPj8 r2/8eQzu9WYYiIk0Ujxjfa7sEbt2JU2nSxFgkpe33ubHBt1a9q3XMxa+l2Ur9jXfb/gm Zc9YLOmFVAjAOZISKV3ayEdSLnCuzDCYWDO53Mf8wZ2B6LQ1B5qCBRfuEWK+cHRHMB2e tv9Smnf+u+0bbor9qpfz/hGjBH17sBirNnr3ZDoxfxhv/2borJPQcwWAzirtndrtRB3v HOaA== X-Gm-Message-State: ANoB5pnCHuNAYyIHzzeMTAqehugzsRH20sM8BEM3fx0zyxLNtVgs/U2X wmvWuENtOXvY2pf5WjwK4Bt/6Qhbhwecpw== X-Google-Smtp-Source: AA0mqf4ycb3jBH52eDbJbmnV6m77cSgMHGAdmTjWqprSRStUdTi+JQIs39EeVWUNLWM/PxH88+7Zig== X-Received: by 2002:a63:2310:0:b0:457:a1a5:3ce with SMTP id j16-20020a632310000000b00457a1a503cemr20611837pgj.416.1669479761623; Sat, 26 Nov 2022 08:22:41 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id y14-20020a63e24e000000b00460ea630c1bsm4169601pgj.46.2022.11.26.08.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:22:41 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Andrew Lunn , Jiri Pirko , Lukas Magel , Vincent Mailhol Subject: [PATCH v4 3/6] can: etas_es58x: export product information through devlink_ops::info_get() Date: Sun, 27 Nov 2022 01:22:08 +0900 Message-Id: <20221126162211.93322-4-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org ES58x devices report below product information through a custom usb string: * the firmware version * the bootloader version * the hardware revision Parse this string, store the results in struct es58x_dev, export the firmware version through devlink's "fw" name and the hardware revision through devlink's "board.rev" name. devlink does not yet have a name suited for the bootloader and so this last piece of information is exposed to the userland for through a custom name: "bl". Those devlink entries are not critical to use the device, if parsing fails, print an informative log message and continue to probe the device. In addition to that, report the device serial number which is available in usb_device::serial. Signed-off-by: Vincent Mailhol Reviewed-by: Andrew Lunn --- drivers/net/can/usb/etas_es58x/es58x_core.c | 1 + drivers/net/can/usb/etas_es58x/es58x_core.h | 67 ++++++ .../net/can/usb/etas_es58x/es58x_devlink.c | 194 ++++++++++++++++++ 3 files changed, 262 insertions(+) diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c index c6e598e4800c..d29c1bf90d73 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -2250,6 +2250,7 @@ static int es58x_probe(struct usb_interface *intf, if (ret) return ret; + es58x_parse_product_info(es58x_dev); devlink_register(priv_to_devlink(es58x_dev)); for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) { diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.h b/drivers/net/can/usb/etas_es58x/es58x_core.h index bf24375580e5..9481f0764131 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.h +++ b/drivers/net/can/usb/etas_es58x/es58x_core.h @@ -356,6 +356,39 @@ struct es58x_operators { int (*get_timestamp)(struct es58x_device *es58x_dev); }; +/** + * struct es58x_sw_version - Version number of the firmware or the + * bootloader. + * @major: Version major number, represented on two digits. + * @minor: Version minor number, represented on two digits. + * @revision: Version revision number, represented on two digits. + * + * The firmware and the bootloader share the same format: "xx.xx.xx" + * where 'x' is a digit. Both can be retrieved from the product + * information string. + */ +struct es58x_sw_version { + u8 major; + u8 minor; + u8 revision; +}; + +/** + * struct es58x_hw_revision - Hardware revision number. + * @letter: Revision letter. + * @major: Version major number, represented on three digits. + * @minor: Version minor number, represented on three digits. + * + * The hardware revision uses its own format: "axxx/xxx" where 'a' is + * a letter and 'x' a digit. It can be retrieved from the product + * information string. + */ +struct es58x_hw_revision { + char letter; + u16 major; + u16 minor; +}; + /** * struct es58x_device - All information specific to an ES58X device. * @dev: Device information. @@ -373,6 +406,9 @@ struct es58x_operators { * queue wake/stop logic should prevent this URB from getting * empty. Please refer to es58x_get_tx_urb() for more details. * @tx_urbs_idle_cnt: number of urbs in @tx_urbs_idle. + * @firmware_version: The firmware version number. + * @bootloader_version: The bootloader version number. + * @hardware_revision: The hardware revision number. * @ktime_req_ns: kernel timestamp when es58x_set_realtime_diff_ns() * was called. * @realtime_diff_ns: difference in nanoseconds between the clocks of @@ -408,6 +444,10 @@ struct es58x_device { struct usb_anchor tx_urbs_idle; atomic_t tx_urbs_idle_cnt; + struct es58x_sw_version firmware_version; + struct es58x_sw_version bootloader_version; + struct es58x_hw_revision hardware_revision; + u64 ktime_req_ns; s64 realtime_diff_ns; @@ -420,6 +460,32 @@ struct es58x_device { union es58x_urb_cmd rx_cmd_buf; }; +/** + * es58x_sw_version_is_set() - Check if the version is a valid number. + * @sw_ver: Version number of either the firmware or the bootloader. + * + * If &es58x_sw_version.major, &es58x_sw_version.minor and + * &es58x_sw_version.revision are all zero, the product string could + * not be parsed and the version number is invalid. + */ +static inline bool es58x_sw_version_is_set(struct es58x_sw_version *sw_ver) +{ + return sw_ver->major || sw_ver->minor || sw_ver->revision; +} + +/** + * es58x_hw_revision_is_set() - Check if the revision is a valid number. + * @hw_rev: Revision number of the hardware. + * + * If &es58x_hw_revision.letter, &es58x_hw_revision.major and + * &es58x_hw_revision.minor are all zero, the product string could not + * be parsed and the hardware revision number is invalid. + */ +static inline bool es58x_hw_revision_is_set(struct es58x_hw_revision *hw_rev) +{ + return hw_rev->letter || hw_rev->major || hw_rev->minor; +} + /** * es58x_sizeof_es58x_device() - Calculate the maximum length of * struct es58x_device. @@ -693,6 +759,7 @@ int es58x_send_msg(struct es58x_device *es58x_dev, u8 cmd_type, u8 cmd_id, const void *msg, u16 cmd_len, int channel_idx); /* es58x_devlink.c. */ +void es58x_parse_product_info(struct es58x_device *es58x_dev); extern const struct devlink_ops es58x_dl_ops; /* es581_4.c. */ diff --git a/drivers/net/can/usb/etas_es58x/es58x_devlink.c b/drivers/net/can/usb/etas_es58x/es58x_devlink.c index af6ca7ada23f..7b67682b952e 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_devlink.c +++ b/drivers/net/can/usb/etas_es58x/es58x_devlink.c @@ -7,7 +7,201 @@ * Copyright (c) 2022 Vincent Mailhol */ +#include +#include +#include #include +#include "es58x_core.h" + +/* USB descriptor index containing the product information string. */ +#define ES58X_PROD_INFO_IDX 6 + +/** + * es58x_parse_sw_version() - Extract boot loader or firmware version. + * @es58x_dev: ES58X device. + * @prod_info: USB custom string returned by the device. + * @prefix: Select which information should be parsed. Set it to "FW" + * to parse the firmware version or to "BL" to parse the + * bootloader version. + * + * The @prod_info string contains the firmware and the bootloader + * version number all prefixed by a magic string and concatenated with + * other numbers. Depending on the device, the firmware (bootloader) + * format is either "FW_Vxx.xx.xx" ("BL_Vxx.xx.xx") or "FW:xx.xx.xx" + * ("BL:xx.xx.xx") where 'x' represents a digit. @prod_info must + * contains the common part of those prefixes: "FW" or "BL". + * + * Parse @prod_info and store the version number in + * &es58x_dev.firmware_version or &es58x_dev.bootloader_version + * according to @prefix value. + * + * Return: zero on success, -EINVAL if @prefix contains an invalid + * value and -EBADMSG if @prod_info could not be parsed. + */ +static int es58x_parse_sw_version(struct es58x_device *es58x_dev, + const char *prod_info, const char *prefix) +{ + struct es58x_sw_version *version; + int major, minor, revision; + + if (!strcmp(prefix, "FW")) + version = &es58x_dev->firmware_version; + else if (!strcmp(prefix, "BL")) + version = &es58x_dev->bootloader_version; + else + return -EINVAL; + + /* Go to prefix */ + prod_info = strstr(prod_info, prefix); + if (!prod_info) + return -EBADMSG; + /* Go to beginning of the version number */ + while (!isdigit(*prod_info)) { + prod_info++; + if (!*prod_info) + return -EBADMSG; + } + + if (sscanf(prod_info, "%2u.%2u.%2u", &major, &minor, &revision) != 3) + return -EBADMSG; + + version->major = major; + version->minor = minor; + version->revision = revision; + + return 0; +} + +/** + * es58x_parse_hw_rev() - Extract hardware revision number. + * @es58x_dev: ES58X device. + * @prod_info: USB custom string returned by the device. + * + * @prod_info contains the hardware revision prefixed by a magic + * string and conquenated together with other numbers. Depending on + * the device, the hardware revision format is either + * "HW_VER:axxx/xxx" or "HR:axxx/xxx" where 'a' represents a letter + * and 'x' a digit. + * + * Parse @prod_info and store the hardware revision number in + * &es58x_dev.hardware_revision. + * + * Return: zero on success, -EBADMSG if @prod_info could not be + * parsed. + */ +static int es58x_parse_hw_rev(struct es58x_device *es58x_dev, + const char *prod_info) +{ + char letter; + int major, minor; + + /* The only occurrence of 'H' is in the hardware revision prefix. */ + prod_info = strchr(prod_info, 'H'); + if (!prod_info) + return -EBADMSG; + /* Go to beginning of the hardware revision */ + prod_info = strchr(prod_info, ':'); + if (!prod_info) + return -EBADMSG; + prod_info++; + + if (sscanf(prod_info, "%c%3u/%3u", &letter, &major, &minor) != 3) + return -EBADMSG; + + es58x_dev->hardware_revision.letter = letter; + es58x_dev->hardware_revision.major = major; + es58x_dev->hardware_revision.minor = minor; + + return 0; +} + +/** + * es58x_parse_product_info() - Parse the ES58x product information + * string. + * @es58x_dev: ES58X device. + * + * Retrieve the product information string and parse it to extract the + * firmware version, the bootloader version and the hardware + * revision. + * + * If the function fails, simply emit a log message and continue + * because product information is not critical for the driver to + * operate. + */ +void es58x_parse_product_info(struct es58x_device *es58x_dev) +{ + char *prod_info; + + prod_info = usb_cache_string(es58x_dev->udev, ES58X_PROD_INFO_IDX); + if (!prod_info) { + dev_warn(es58x_dev->dev, + "could not retrieve the product info string\n"); + return; + } + + if (es58x_parse_sw_version(es58x_dev, prod_info, "FW") || + es58x_parse_sw_version(es58x_dev, prod_info, "BL") || + es58x_parse_hw_rev(es58x_dev, prod_info)) + dev_info(es58x_dev->dev, + "could not parse product info: '%s'\n", prod_info); + + kfree(prod_info); +} + +/** + * es58x_devlink_info_get() - Report the product information. + * @devlink: Devlink. + * @req: skb wrapper where to put requested information. + * @extack: Unused. + * + * Report the firmware version, the bootloader version, the hardware + * revision and the serial number through netlink. + * + * Return: zero on success, errno when any error occurs. + */ +static int es58x_devlink_info_get(struct devlink *devlink, + struct devlink_info_req *req, + struct netlink_ext_ack *extack) +{ + struct es58x_device *es58x_dev = devlink_priv(devlink); + struct es58x_sw_version *fw_ver = &es58x_dev->firmware_version; + struct es58x_sw_version *bl_ver = &es58x_dev->bootloader_version; + struct es58x_hw_revision *hw_rev = &es58x_dev->hardware_revision; + char buf[max(sizeof("xx.xx.xx"), sizeof("axxx/xxx"))]; + int ret = 0; + + if (es58x_sw_version_is_set(fw_ver)) { + snprintf(buf, sizeof(buf), "%02u.%02u.%02u", + fw_ver->major, fw_ver->minor, fw_ver->revision); + ret = devlink_info_version_running_put(req, + DEVLINK_INFO_VERSION_GENERIC_FW, + buf); + if (ret) + return ret; + } + + if (es58x_sw_version_is_set(bl_ver)) { + snprintf(buf, sizeof(buf), "%02u.%02u.%02u", + bl_ver->major, bl_ver->minor, bl_ver->revision); + ret = devlink_info_version_running_put(req, "bl", buf); + if (ret) + return ret; + } + + if (es58x_hw_revision_is_set(hw_rev)) { + snprintf(buf, sizeof(buf), "%c%03u/%03u", + hw_rev->letter, hw_rev->major, hw_rev->minor); + ret = devlink_info_version_fixed_put(req, + DEVLINK_INFO_VERSION_GENERIC_BOARD_REV, + buf); + if (ret) + return ret; + } + + return devlink_info_serial_number_put(req, es58x_dev->udev->serial); +} + const struct devlink_ops es58x_dl_ops = { + .info_get = es58x_devlink_info_get, }; From patchwork Sat Nov 26 16:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 628969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0E9FC47088 for ; Sat, 26 Nov 2022 16:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbiKZQWy (ORCPT ); Sat, 26 Nov 2022 11:22:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiKZQWq (ORCPT ); Sat, 26 Nov 2022 11:22:46 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A0813D25; Sat, 26 Nov 2022 08:22:44 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so5472142pjo.3; Sat, 26 Nov 2022 08:22:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=FqxbdWmkDaYh64fn5vJKWcy9PbC9sFK7pSd5yFtHB2A=; b=Vbr686uQefXtARICYQMOWq68c10KROWIUykAqWE3v/K6+O3EKosQse7pUL4xetrAXJ miZraXXF9B+zQkT/2QY5dbRShtbaJ2KD0F9FYYlGjzvI95DULAKbw9edrf36TrQ80dT7 xBgJ/K2iYOBtPHqOtckAUfKSoU6iRClkcJBoFrkKvCCKzB4KFlUPwvHADR8yQYkhVWl9 7EmGQzaeN5QXnbxbhJORYWFcq8hk4beQ5fiCQfXFsFlAWMFagyWpT1i34IWM1kK6T76c B9aGkenxsIgmOtY6895/RgKu4+5IDXFV8ZVYYtQFeEy3emyqbFNTCxvl48oPiWj+Jy5m v+KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FqxbdWmkDaYh64fn5vJKWcy9PbC9sFK7pSd5yFtHB2A=; b=IXxA1vyGr0TnXRnz0P56ISx1Q0mG/q+xpinDWmEtdBf94+sTMQcX8IUW4/pwVHRXIj +2iLr9Cqni/W5qNA0jdGnB1gj/+dgx5kjtp7tuGD3l2Oj1+ewuYmCIE2YIsTgZi5VxCp iQ632qOG6kK8opXLFuBkQTzqn9KjC+DU2v5X6VDufciJAhfWaCrW7X36LSRt60DUDaV1 I0TO876hmoyjO2Uky8BJqL5bp+ftHibkrW01PJxILWmM6xyUkxld7wbgMlMuefnoLqUP WrRLl1QYiu+SZLtV5fHxSaUrU7HBn9fzHuIcjOxad63Hz/AMckD1WkQE9le9SbNejvp3 tNkw== X-Gm-Message-State: ANoB5pkdo/pJ/1pVrDePbOVWfw2PVuATNloa2p6RnDhel6JIS4Y2kITX PvkWxo/GGiFydvp4jvWVXHXNaHypZx+6Kw== X-Google-Smtp-Source: AA0mqf4mX1qFUWuATPxlMlDaQjawAqjHlT/TdpUe9PSGgYe5cqivO4RhUHoaHg8iREh2zPwX7nqjdQ== X-Received: by 2002:a17:902:9881:b0:188:62b8:2278 with SMTP id s1-20020a170902988100b0018862b82278mr29895394plp.96.1669479764254; Sat, 26 Nov 2022 08:22:44 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id y14-20020a63e24e000000b00460ea630c1bsm4169601pgj.46.2022.11.26.08.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:22:44 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Andrew Lunn , Jiri Pirko , Lukas Magel , Vincent Mailhol Subject: [PATCH v4 4/6] can: etas_es58x: remove es58x_get_product_info() Date: Sun, 27 Nov 2022 01:22:09 +0900 Message-Id: <20221126162211.93322-5-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Now that the product information is available under devlink, no more need to print them in the kernel log. Remove es58x_get_product_info(). Signed-off-by: Vincent Mailhol Reviewed-by: Andrew Lunn --- drivers/net/can/usb/etas_es58x/es58x_core.c | 52 ++------------------- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c index d29c1bf90d73..e81ef23d8698 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -2120,48 +2120,6 @@ static void es58x_free_netdevs(struct es58x_device *es58x_dev) } } -/** - * es58x_get_product_info() - Get the product information and print them. - * @es58x_dev: ES58X device. - * - * Do a synchronous call to get the product information. - * - * Return: zero on success, errno when any error occurs. - */ -static int es58x_get_product_info(struct es58x_device *es58x_dev) -{ - struct usb_device *udev = es58x_dev->udev; - const int es58x_prod_info_idx = 6; - /* Empirical tests show a prod_info length of maximum 83, - * below should be more than enough. - */ - const size_t prod_info_len = 127; - char *prod_info; - int ret; - - prod_info = kmalloc(prod_info_len, GFP_KERNEL); - if (!prod_info) - return -ENOMEM; - - ret = usb_string(udev, es58x_prod_info_idx, prod_info, prod_info_len); - if (ret < 0) { - dev_err(es58x_dev->dev, - "%s: Could not read the product info: %pe\n", - __func__, ERR_PTR(ret)); - goto out_free; - } - if (ret >= prod_info_len - 1) { - dev_warn(es58x_dev->dev, - "%s: Buffer is too small, result might be truncated\n", - __func__); - } - dev_info(es58x_dev->dev, "Product info: %s\n", prod_info); - - out_free: - kfree(prod_info); - return ret < 0 ? ret : 0; -} - /** * es58x_init_es58x_dev() - Initialize the ES58X device. * @intf: USB interface. @@ -2240,28 +2198,24 @@ static int es58x_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct es58x_device *es58x_dev; - int ch_idx, ret; + int ch_idx; es58x_dev = es58x_init_es58x_dev(intf, id->driver_info); if (IS_ERR(es58x_dev)) return PTR_ERR(es58x_dev); - ret = es58x_get_product_info(es58x_dev); - if (ret) - return ret; - es58x_parse_product_info(es58x_dev); devlink_register(priv_to_devlink(es58x_dev)); for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) { - ret = es58x_init_netdev(es58x_dev, ch_idx); + int ret = es58x_init_netdev(es58x_dev, ch_idx); if (ret) { es58x_free_netdevs(es58x_dev); return ret; } } - return ret; + return 0; } /** From patchwork Sat Nov 26 16:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 628968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B043C47089 for ; Sat, 26 Nov 2022 16:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiKZQXV (ORCPT ); Sat, 26 Nov 2022 11:23:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiKZQXM (ORCPT ); Sat, 26 Nov 2022 11:23:12 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE92167D3; Sat, 26 Nov 2022 08:22:50 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id w79so6670287pfc.2; Sat, 26 Nov 2022 08:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Vp+9zaIiM6o3AbLJPzloleeAqXF3PPreHB77EhGVkH4=; b=jJzS/vl3K9wBJJWaAASEZ3VJpJbW41iogkAB78k8y3rZDNrO95YRSR6teWO4S6INPI hAqkUqoINYo6VJ2+xfNyyDSDi4Seb1cOkiFIizhP/kzkyMSTyrY/gpQCwNFs1Ao7ARjR 33v5YAET2nyB/AuntWUIFM0TNygUSDU5YH2pKoZJWtFNc60U+q3lAfPX+p3lanXz6L+/ H4Z6Opw0/95H2FUUCwLTvoVmaYnMAqqUm9DsGa66nEawNVZ6UjbF6y9KVm8sRqo2SrEx 0i9JVwA4BWl1i5mXq/t0tB9Kckd2VEtzsh+QzHAonCd9H8yV7Nx9h1hwo4YoYV3DqilO mwGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Vp+9zaIiM6o3AbLJPzloleeAqXF3PPreHB77EhGVkH4=; b=pok2hTFbbGKzyqi346K2KEpZ1bCCIuoGxJQCI0Bf3Ns911vFWBQxKn26GYn/bCSqb1 6nZn2c+EvIaVtcwhadaiGwmzYuDOG4E4NlAktINVd8DywcrqCa0lsZJaIW9ETifzgHbt qklt9ApFfi6O2d9Gx/fPXITeU0PTHtLESYCWw9jpywn9NloJYPTFjLN1TUijVOx2z8fH 4PvqqmU8zzDLYTBHYVyjY2o0A1iYtCg/QjmgoGZSyLIO28ZMKZ8f3kyakNeNt1AQuHa7 QJ0J+VzFYuvwLE1v9eERV6SgEPRPCZ1I+ymczx+lT81mUis3nrClYIxc/6Q7GiUJFpxR RDEA== X-Gm-Message-State: ANoB5pkLco4xXIB7wuv5YEZ2vE2bxW3IwUCGrVb5Jo476oM4aitArDHF vylX/pg369ZMV9EGk/A/BTxu/dZ5VGcFkg== X-Google-Smtp-Source: AA0mqf4LP6zXi8g3B37g6l8jS1EUU+w57isv5IxyiwIefaSjnWCcO6NuZ37SOesqZ4uuil52AzNvdw== X-Received: by 2002:a62:e80f:0:b0:574:cc3d:a23f with SMTP id c15-20020a62e80f000000b00574cc3da23fmr6887091pfi.53.1669479769553; Sat, 26 Nov 2022 08:22:49 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id y14-20020a63e24e000000b00460ea630c1bsm4169601pgj.46.2022.11.26.08.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:22:49 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Andrew Lunn , Jiri Pirko , Lukas Magel , Vincent Mailhol Subject: [PATCH v4 6/6] Documentation: devlink: add devlink documentation for the etas_es58x driver Date: Sun, 27 Nov 2022 01:22:11 +0900 Message-Id: <20221126162211.93322-7-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org List all the version information reported by the etas_es58x driver. Also, update MAINTAINERS with the newly created file. Signed-off-by: Vincent Mailhol --- .../networking/devlink/etas_es58x.rst | 33 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 34 insertions(+) create mode 100644 Documentation/networking/devlink/etas_es58x.rst diff --git a/Documentation/networking/devlink/etas_es58x.rst b/Documentation/networking/devlink/etas_es58x.rst new file mode 100644 index 000000000000..83f59713eed5 --- /dev/null +++ b/Documentation/networking/devlink/etas_es58x.rst @@ -0,0 +1,33 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================== +etas_es58x devlink support +========================== + +This document describes the devlink features implemented by the +``etas_es58x`` device driver. + +Info versions +============= + +The ``etas_es58x`` driver reports the following versions + +.. list-table:: devlink info versions implemented + :widths: 5 5 90 + + * - Name + - Type + - Description + * - ``fw`` + - running + - Version of firmware running on the device. Also available + through ``ethtool -i``. + * - ``bl`` + - running + - Version of the bootloader running on the device. + * - ``board.rev`` + - fixed + - The hardware revision of the device. + * - ``serial_number`` + - fixed + - The USB serial number. Also available through ``lsusb -v``. diff --git a/MAINTAINERS b/MAINTAINERS index 61fe86968111..d95642683fc4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7686,6 +7686,7 @@ ETAS ES58X CAN/USB DRIVER M: Vincent Mailhol L: linux-can@vger.kernel.org S: Maintained +F: Documentation/networking/devlink/etas_es58x.rst F: drivers/net/can/usb/etas_es58x/ ETHERNET BRIDGE