From: MD Danish Anwar <danishanwar@ti.com>
To: Dong Yibo <dong100@mucse.com>, <andrew+netdev@lunn.ch>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <horms@kernel.org>, <corbet@lwn.net>,
<gur.stavi@huawei.com>, <maddy@linux.ibm.com>,
<mpe@ellerman.id.au>, <lee@trager.us>, <gongfan1@huawei.com>,
<lorenzo@kernel.org>, <geert+renesas@glider.be>,
<Parthiban.Veerasooran@microchip.com>, <lukas.bulwahn@redhat.com>,
<alexanderduyck@fb.com>, <richardcochran@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 5/5] net: rnpgbe: Add register_netdev
Date: Thu, 14 Aug 2025 17:44:51 +0530 [thread overview]
Message-ID: <dd6ece66-ae4b-424a-aa09-872ac15e1549@ti.com> (raw)
In-Reply-To: <20250814073855.1060601-6-dong100@mucse.com>
On 14/08/25 1:08 pm, Dong Yibo wrote:
> Initialize get mac from hw, register the netdev.
>
> Signed-off-by: Dong Yibo <dong100@mucse.com>
> ---
> drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h | 18 +++++
> .../net/ethernet/mucse/rnpgbe/rnpgbe_chip.c | 73 ++++++++++++++++++
> drivers/net/ethernet/mucse/rnpgbe/rnpgbe_hw.h | 1 +
> .../net/ethernet/mucse/rnpgbe/rnpgbe_main.c | 75 +++++++++++++++++++
> 4 files changed, 167 insertions(+)
>
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> index 7ab1cbb432f6..7e51a8871b71 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
> @@ -6,6 +6,7 @@
>
> #include <linux/types.h>
> #include <linux/mutex.h>
> +#include <linux/netdevice.h>
>
> extern const struct rnpgbe_info rnpgbe_n500_info;
> extern const struct rnpgbe_info rnpgbe_n210_info;
> @@ -82,6 +83,15 @@ struct mucse_mbx_info {
> u32 fw2pf_mbox_vec;
> };
>
> +struct mucse_hw_operations {
> + int (*reset_hw)(struct mucse_hw *hw);
> + void (*driver_status)(struct mucse_hw *hw, bool enable, int mode);
> +};
> +
> +enum {
> + mucse_driver_insmod,
> +};
> +
> struct mucse_hw {
> u8 pfvfnum;
> void __iomem *hw_addr;
> @@ -91,12 +101,17 @@ struct mucse_hw {
> u32 axi_mhz;
> u32 bd_uid;
> enum rnpgbe_hw_type hw_type;
> + const struct mucse_hw_operations *ops;
> struct mucse_dma_info dma;
> struct mucse_eth_info eth;
> struct mucse_mac_info mac;
> struct mucse_mbx_info mbx;
> + u32 flags;
> +#define M_FLAGS_INIT_MAC_ADDRESS BIT(0)
> u32 driver_version;
> u16 usecstocount;
> + int lane;
> + u8 perm_addr[ETH_ALEN];
> };
>
> struct mucse {
> @@ -117,4 +132,7 @@ struct rnpgbe_info {
> #define PCI_DEVICE_ID_N500_DUAL_PORT 0x8318
> #define PCI_DEVICE_ID_N210 0x8208
> #define PCI_DEVICE_ID_N210L 0x820a
> +
> +#define dma_wr32(dma, reg, val) writel((val), (dma)->dma_base_addr + (reg))
> +#define dma_rd32(dma, reg) readl((dma)->dma_base_addr + (reg))
These macros could collide with other definitions. Consider prefixing
them with the driver name (rnpgbe_dma_wr32).
I don't see these macros getting used anywhere in this series. They
should be introduced when they are used.
> #endif /* _RNPGBE_H */
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> index e0c6f47efd4c..aba44b31eae3 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> @@ -1,11 +1,83 @@
> // SPDX-License-Identifier: GPL-2.0
> /* Copyright(c) 2020 - 2025 Mucse Corporation. */
>
> +#include <linux/pci.h>
> #include <linux/string.h>
> +#include <linux/etherdevice.h>
>
> #include "rnpgbe.h"
> #include "rnpgbe_hw.h"
> #include "rnpgbe_mbx.h"
> +#include "rnpgbe_mbx_fw.h"
> +/**
> + * rnpgbe_xmit_frame - Send a skb to driver
> + * @skb: skb structure to be sent
> + * @netdev: network interface device structure
> + *
> + * @return: NETDEV_TX_OK or NETDEV_TX_BUSY
> + **/
> +static netdev_tx_t rnpgbe_xmit_frame(struct sk_buff *skb,
> + struct net_device *netdev)
> +{
> + dev_kfree_skb_any(skb);
> + netdev->stats.tx_dropped++;
> + return NETDEV_TX_OK;
> +}
You didn't fix this extra indentation. This was present in v3 as well
https://lore.kernel.org/all/94eeae65-0e4b-45ef-a9c0-6bc8d37ae789@ti.com/#:~:text=skb)%3B%0A%3E%20%2B%09%09return%20NETDEV_TX_OK%3B%0A%3E%20%2B-,%7D,-Extra%20indentation%20on
> +
> +static const struct net_device_ops rnpgbe_netdev_ops = {
> + .ndo_open = rnpgbe_open,
> + .ndo_stop = rnpgbe_close,
--
Thanks and Regards,
Danish
next prev parent reply other threads:[~2025-08-14 12:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 7:38 [PATCH v4 0/5] Add driver for 1Gbe network chips from MUCSE Dong Yibo
2025-08-14 7:38 ` [PATCH v4 1/5] net: rnpgbe: Add build support for rnpgbe Dong Yibo
2025-08-15 1:58 ` Andrew Lunn
2025-08-14 7:38 ` [PATCH v4 2/5] net: rnpgbe: Add n500/n210 chip support Dong Yibo
2025-08-14 12:07 ` MD Danish Anwar
2025-08-14 13:52 ` Yibo Dong
2025-08-15 2:07 ` Andrew Lunn
2025-08-15 2:05 ` Andrew Lunn
2025-08-15 2:38 ` Yibo Dong
2025-08-15 3:56 ` Andrew Lunn
2025-08-15 7:21 ` Yibo Dong
2025-08-15 13:36 ` Andrew Lunn
2025-08-18 1:14 ` Yibo Dong
2025-08-14 7:38 ` [PATCH v4 3/5] net: rnpgbe: Add basic mbx ops support Dong Yibo
2025-08-15 2:13 ` Andrew Lunn
2025-08-15 2:43 ` Yibo Dong
2025-08-15 3:59 ` Andrew Lunn
2025-08-15 7:22 ` Yibo Dong
2025-08-15 2:29 ` Andrew Lunn
2025-08-15 3:15 ` Yibo Dong
2025-08-14 7:38 ` [PATCH v4 4/5] net: rnpgbe: Add basic mbx_fw support Dong Yibo
2025-08-14 12:10 ` MD Danish Anwar
2025-08-14 13:54 ` Yibo Dong
2025-08-15 3:27 ` Andrew Lunn
2025-08-15 6:36 ` Yibo Dong
2025-08-15 13:21 ` Andrew Lunn
2025-08-18 2:14 ` Yibo Dong
2025-08-14 7:38 ` [PATCH v4 5/5] net: rnpgbe: Add register_netdev Dong Yibo
2025-08-14 12:14 ` MD Danish Anwar [this message]
2025-08-14 13:59 ` Yibo Dong
2025-08-15 2:28 ` Yibo Dong
2025-08-15 3:42 ` Andrew Lunn
2025-08-15 6:44 ` Yibo Dong
2025-08-15 18:06 ` Andrew Lunn
2025-08-18 1:21 ` Yibo Dong
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=dd6ece66-ae4b-424a-aa09-872ac15e1549@ti.com \
--to=danishanwar@ti.com \
--cc=Parthiban.Veerasooran@microchip.com \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dong100@mucse.com \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=gongfan1@huawei.com \
--cc=gur.stavi@huawei.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@trager.us \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).