From: Leon Romanovsky <leon@kernel.org>
To: Mengyuan Lou <mengyuanlou@net-swift.com>
Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com
Subject: Re: [PATCH net-next] net: wangxun: Add base ethtool ops.
Date: Mon, 13 Feb 2023 10:22:48 +0200 [thread overview]
Message-ID: <Y+nzWMEBJ+3bqAci@unreal> (raw)
In-Reply-To: <20230213080949.52370-1-mengyuanlou@net-swift.com>
On Mon, Feb 13, 2023 at 04:09:49PM +0800, Mengyuan Lou wrote:
> Add base ethtool ops get_drvinfo for ngbe and txgbe.
>
> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> ---
> drivers/net/ethernet/wangxun/libwx/Makefile | 2 +-
> .../net/ethernet/wangxun/libwx/wx_ethtool.c | 29 +++++++++++++++++++
> .../net/ethernet/wangxun/libwx/wx_ethtool.h | 9 ++++++
> drivers/net/ethernet/wangxun/libwx/wx_type.h | 1 +
> drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 5 ++++
> .../net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++
> 6 files changed, 48 insertions(+), 1 deletion(-)
> create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_ethtool.h
Please remove dot in the patch subject.
>
> diff --git a/drivers/net/ethernet/wangxun/libwx/Makefile b/drivers/net/ethernet/wangxun/libwx/Makefile
> index 850d1615cd18..42ccd6e4052e 100644
> --- a/drivers/net/ethernet/wangxun/libwx/Makefile
> +++ b/drivers/net/ethernet/wangxun/libwx/Makefile
> @@ -4,4 +4,4 @@
>
> obj-$(CONFIG_LIBWX) += libwx.o
>
> -libwx-objs := wx_hw.o wx_lib.o
> +libwx-objs := wx_hw.o wx_lib.o wx_ethtool.o
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> new file mode 100644
> index 000000000000..e83235aa6ff2
> --- /dev/null
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> @@ -0,0 +1,29 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2015 - 2023 Beijing WangXun Technology Co., Ltd. */
> +
> +#include <linux/pci.h>
> +#include <linux/phy.h>
> +
> +#include "wx_type.h"
> +#include "wx_ethtool.h"
> +
> +static void wx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
> +{
> + struct wx *wx = netdev_priv(netdev);
> +
> + strscpy(info->driver, wx->driver_name, sizeof(info->driver));
> + strscpy(info->fw_version, wx->eeprom_id, sizeof(info->fw_version));
> + strscpy(info->bus_info, pci_name(wx->pdev), sizeof(info->bus_info));
> +}
> +
> +static const struct ethtool_ops wx_ethtool_ops = {
> + .get_drvinfo = wx_get_drvinfo,
> +};
> +
> +void wx_set_ethtool_ops(struct net_device *netdev)
> +{
> + netdev->ethtool_ops = &wx_ethtool_ops;
> +}
> +EXPORT_SYMBOL(wx_set_ethtool_ops);
> +
> +MODULE_LICENSE("GPL");
You don't need to put MODULE_LICENSE() in every libwx/*.c file.
Thanks
next prev parent reply other threads:[~2023-02-13 8:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 8:09 [PATCH net-next] net: wangxun: Add base ethtool ops Mengyuan Lou
2023-02-13 8:22 ` Leon Romanovsky [this message]
2023-02-13 13:48 ` Andrew Lunn
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=Y+nzWMEBJ+3bqAci@unreal \
--to=leon@kernel.org \
--cc=jiawenwu@trustnetic.com \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@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