[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f84ad3c2-ef22-47b6-bc10-b7e8fdfb1ca0@lunn.ch>
Date: Mon, 9 Dec 2024 14:55:59 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Tian Xin <tianx@...silicon.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, weihg@...silicon.com
Subject: Re: [PATCH 15/16] net-next/yunsilicon: Add ndo_set_mac_address
On Mon, Dec 09, 2024 at 03:11:00PM +0800, Tian Xin wrote:
> From: Xin Tian <tianx@...silicon.com>
>
> Add ndo_set_mac_address
>
> Signed-off-by: Xin Tian <tianx@...silicon.com>
> Signed-off-by: Honggang Wei <weihg@...silicon.com>
> Signed-off-by: Lei Yan <jacky@...silicon.com>
> ---
> .../ethernet/yunsilicon/xsc/common/xsc_core.h | 4 +
> .../net/ethernet/yunsilicon/xsc/net/main.c | 48 ++++-----
> .../net/ethernet/yunsilicon/xsc/pci/Makefile | 2 +-
> .../net/ethernet/yunsilicon/xsc/pci/vport.c | 102 ++++++++++++++++++
> 4 files changed, 130 insertions(+), 26 deletions(-)
> create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/vport.c
>
> diff --git a/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h b/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h
> index 979e3b150..8da471f02 100644
> --- a/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h
> +++ b/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h
> @@ -613,6 +613,10 @@ void xsc_core_frag_buf_free(struct xsc_core_device *xdev, struct xsc_frag_buf *b
> int xsc_register_interface(struct xsc_interface *intf);
> void xsc_unregister_interface(struct xsc_interface *intf);
>
> +u8 xsc_core_query_vport_state(struct xsc_core_device *dev, u16 vport);
> +int xsc_core_modify_nic_vport_mac_address(struct xsc_core_device *dev,
> + u16 vport, u8 *addr, bool perm_mac);
> +
> static inline void *xsc_buf_offset(struct xsc_buf *buf, int offset)
> {
> if (likely(BITS_PER_LONG == 64 || buf->nbufs == 1))
> diff --git a/drivers/net/ethernet/yunsilicon/xsc/net/main.c b/drivers/net/ethernet/yunsilicon/xsc/net/main.c
> index a3b557cc5..1861b10a8 100644
> --- a/drivers/net/ethernet/yunsilicon/xsc/net/main.c
> +++ b/drivers/net/ethernet/yunsilicon/xsc/net/main.c
> @@ -1349,37 +1349,13 @@ static void xsc_eth_sw_deinit(struct xsc_adapter *adapter)
> return xsc_eth_close_channels(adapter);
> }
>
> -static int _xsc_query_vport_state(struct xsc_core_device *dev, u16 opmod,
> - u16 vport, void *out, int outlen)
> -{
> - struct xsc_query_vport_state_in in;
> -
> - memset(&in, 0, sizeof(in));
> - in.hdr.opcode = cpu_to_be16(XSC_CMD_OP_QUERY_VPORT_STATE);
> - in.vport_number = cpu_to_be16(vport);
> - if (vport)
> - in.other_vport = 1;
> -
> - return xsc_cmd_exec(dev, &in, sizeof(in), out, outlen);
> -}
> -
> -static u8 xsc_query_vport_state(struct xsc_core_device *dev, u16 opmod, u16 vport)
> -{
> - struct xsc_query_vport_state_out out;
> -
> - memset(&out, 0, sizeof(out));
> - _xsc_query_vport_state(dev, opmod, vport, &out, sizeof(out));
> -
> - return out.state;
> -}
> -
More code which appears to of been added in the wrong place to start
with, and now gets moved.
Andrew
Powered by blists - more mailing lists