From: "Anwar, Md Danish" <a0501179@ti.com>
To: <Parthiban.Veerasooran@microchip.com>, <danishanwar@ti.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <horms@kernel.org>, <corbet@lwn.net>,
<nm@ti.com>, <vigneshr@ti.com>, <kristo@kernel.org>,
<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<andrew+netdev@lunn.ch>, <mengyuanlou@net-swift.com>,
<quic_luoj@quicinc.com>, <gongfan1@huawei.com>,
<quic_leiwei@quicinc.com>, <mpe@ellerman.id.au>, <lee@trager.us>,
<lorenzo@kernel.org>, <geert+renesas@glider.be>,
<lukas.bulwahn@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>
Subject: Re: [PATCH net-next v3 4/7] net: rpmsg-eth: Add netdev ops
Date: Tue, 9 Sep 2025 19:38:39 +0530 [thread overview]
Message-ID: <3e22a667-bdff-43db-9388-846b2b278d77@ti.com> (raw)
In-Reply-To: <4a69e4f1-06b1-49a1-aab6-baef6c613f0b@microchip.com>
Hi Parthiban
On 9/9/2025 12:08 PM, Parthiban.Veerasooran@microchip.com wrote:
> Hi,
>
> On 08/09/25 2:37 pm, MD Danish Anwar wrote:
>
>> +static int create_request(struct rpmsg_eth_common *common,
>> + enum rpmsg_eth_rpmsg_type rpmsg_type)
>> +{
>> + struct message *msg = &common->send_msg;
>> + int ret = 0;
>> +
>> + msg->msg_hdr.src_id = common->port->port_id;
>> + msg->req_msg.type = rpmsg_type;
>> +
>> + switch (rpmsg_type) {
>> + case RPMSG_ETH_REQ_SHM_INFO:
>> + msg->msg_hdr.msg_type = RPMSG_ETH_REQUEST_MSG;
>> + break;
>> + case RPMSG_ETH_REQ_SET_MAC_ADDR:
>> + msg->msg_hdr.msg_type = RPMSG_ETH_REQUEST_MSG;
>> + ether_addr_copy(msg->req_msg.mac_addr.addr,
>> + common->port->ndev->dev_addr);
>> + break;
>> + case RPMSG_ETH_NOTIFY_PORT_UP:
>> + case RPMSG_ETH_NOTIFY_PORT_DOWN:
>> + msg->msg_hdr.msg_type = RPMSG_ETH_NOTIFY_MSG;
>> + break;
>> + default:
>> + ret = -EINVAL;
>> + dev_err(common->dev, "Invalid RPMSG request\n");
> I don't think you need 'ret' here instead directly return -EINVAL and
> above 'ret' declaration can be removed.
>> + }
>> + return ret;
> can be return 0;
Sure. I will drop ret.
>> +}
>> +
>> +static int rpmsg_eth_create_send_request(struct rpmsg_eth_common *common,
>> + enum rpmsg_eth_rpmsg_type rpmsg_type,
>> + bool wait)
>> +{
>> + unsigned long flags;
>> + int ret = 0;
> No need to initialize.
Sure. Will drop this.
>> +
>> + if (wait)
>> + reinit_completion(&common->sync_msg);
>> +
>> + spin_lock_irqsave(&common->send_msg_lock, flags);
>> +
>> +static int rpmsg_eth_set_mac_address(struct net_device *ndev, void *addr)
>> +{
>> + struct rpmsg_eth_common *common = rpmsg_eth_ndev_to_common(ndev);
>> + int ret;
>> +
>> + ret = eth_mac_addr(ndev, addr);
>> +
>> + if (ret < 0)
>> + return ret;
>> + ret = rpmsg_eth_create_send_request(common, RPMSG_ETH_REQ_SET_MAC_ADDR, false);
> You can directly return from here.
Sure.
>> + return ret;
>> +}
>> +
> Best regards,
> Parthiban V
--
Thanks and Regards,
Md Danish Anwar
next prev parent reply other threads:[~2025-09-09 14:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 9:07 [PATCH net-next v3 0/7] Add RPMSG Ethernet Driver MD Danish Anwar
2025-09-08 9:07 ` [PATCH net-next v3 1/7] net: rpmsg-eth: Add Documentation for RPMSG-ETH Driver MD Danish Anwar
2025-09-08 9:07 ` [PATCH net-next v3 2/7] net: rpmsg-eth: Add basic rpmsg skeleton MD Danish Anwar
2025-09-10 14:22 ` kernel test robot
2025-09-08 9:07 ` [PATCH net-next v3 3/7] net: rpmsg-eth: Register device as netdev MD Danish Anwar
2025-09-08 9:07 ` [PATCH net-next v3 4/7] net: rpmsg-eth: Add netdev ops MD Danish Anwar
2025-09-09 6:38 ` Parthiban.Veerasooran
2025-09-09 14:08 ` Anwar, Md Danish [this message]
2025-09-08 9:07 ` [PATCH net-next v3 5/7] net: rpmsg-eth: Add support for multicast filtering MD Danish Anwar
2025-09-08 9:07 ` [PATCH net-next v3 6/7] MAINTAINERS: Add entry for RPMSG Ethernet driver MD Danish Anwar
2025-09-08 9:07 ` [PATCH net-next v3 7/7] arch: arm64: dts: k3-am64*: Add rpmsg-eth node MD Danish Anwar
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=3e22a667-bdff-43db-9388-846b2b278d77@ti.com \
--to=a0501179@ti.com \
--cc=Parthiban.Veerasooran@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=gongfan1@huawei.com \
--cc=horms@kernel.org \
--cc=kristo@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@trager.us \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=mengyuanlou@net-swift.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=nm@ti.com \
--cc=pabeni@redhat.com \
--cc=quic_leiwei@quicinc.com \
--cc=quic_luoj@quicinc.com \
--cc=robh@kernel.org \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®