From: Heiner Kallweit <hkallweit1@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
Wei Fang <wei.fang@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew@lunn.ch>,
Russell King <linux@armlinux.org.uk>
Cc: Russell King <rmk+kernel@armlinux.org.uk>,
Florian Fainelli <florian.fainelli@broadcom.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, Shenwei Wang <shenwei.wang@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
NXP Linux Team <linux-imx@nxp.com>
Subject: Re: [PATCH net-next v8 1/8] net: add helpers for EEE configuration
Date: Fri, 1 Mar 2024 23:38:24 +0100 [thread overview]
Message-ID: <99a4fbb3-0204-4a96-bc38-9a76817a326a@gmail.com> (raw)
In-Reply-To: <20240301100153.927743-2-o.rempel@pengutronix.de>
On 01.03.2024 11:01, Oleksij Rempel wrote:
> From: Russell King <rmk+kernel@armlinux.org.uk>
>
> Add helpers that phylib and phylink can use to manage EEE configuration
> and determine whether the MAC should be permitted to use LPI based on
> that configuration.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> include/net/eee.h | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 include/net/eee.h
>
> diff --git a/include/net/eee.h b/include/net/eee.h
> new file mode 100644
> index 0000000000000..1232658b32f40
> --- /dev/null
> +++ b/include/net/eee.h
> @@ -0,0 +1,38 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef _EEE_H
> +#define _EEE_H
> +
> +#include <linux/types.h>
> +
> +struct eee_config {
> + u32 tx_lpi_timer;
> + bool tx_lpi_enabled;
> + bool eee_enabled;
> +};
> +
> +static inline bool eeecfg_mac_can_tx_lpi(const struct eee_config *eeecfg)
> +{
> + /* eee_enabled is the master on/off */
> + if (!eeecfg->eee_enabled || !eeecfg->tx_lpi_enabled)
> + return false;
> +
> + return true;
> +}
> +
> +static inline void eeecfg_to_eee(const struct eee_config *eeecfg,
> + struct ethtool_keee *eee)
> +{
Typically the argument order is f(dst, src), like for string functions.
Any specific reason handle it differently here?
> + eee->tx_lpi_timer = eeecfg->tx_lpi_timer;
> + eee->tx_lpi_enabled = eeecfg->tx_lpi_enabled;
> + eee->eee_enabled = eeecfg->eee_enabled;
> +}
> +
> +static inline void eee_to_eeecfg(const struct ethtool_keee *eee,
> + struct eee_config *eeecfg)
> +{
> + eeecfg->tx_lpi_timer = eee->tx_lpi_timer;
> + eeecfg->tx_lpi_enabled = eee->tx_lpi_enabled;
> + eeecfg->eee_enabled = eee->eee_enabled;
> +}
> +
> +#endif
next prev parent reply other threads:[~2024-03-01 22:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 10:01 [PATCH net-next v7 0/8] net: ethernet: Rework EEE Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 1/8] net: add helpers for EEE configuration Oleksij Rempel
2024-03-01 22:38 ` Heiner Kallweit [this message]
2024-03-01 10:01 ` [PATCH net-next v8 2/8] net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 3/8] net: phy: Add helper to set EEE Clock stop enable bit Oleksij Rempel
2024-03-02 17:16 ` Heiner Kallweit
2024-03-02 17:25 ` Russell King (Oracle)
2024-03-02 18:38 ` Andrew Lunn
2024-03-02 18:44 ` Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 4/8] net: phy: Keep track of EEE configuration Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Oleksij Rempel
2024-03-01 22:38 ` Andrew Lunn
2024-03-01 10:01 ` [PATCH net-next v8 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 7/8] net: fec: Move fec_enet_eee_mode_set() and helper earlier Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 8/8] net: fec: Fixup EEE Oleksij Rempel
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=99a4fbb3-0204-4a96-bc38-9a76817a326a@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.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).