From: Andrew Lunn <andrew@lunn.ch>
To: "Kamil Horák - 2N" <kamilh@axis.com>
Cc: florian.fainelli@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, hkallweit1@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes
Date: Mon, 6 May 2024 21:35:09 +0200 [thread overview]
Message-ID: <efaf2c2c-45a9-4b22-8f71-c8e41d680912@lunn.ch> (raw)
In-Reply-To: <20240506144015.2409715-4-kamilh@axis.com>
On Mon, May 06, 2024 at 04:40:15PM +0200, Kamil Horák - 2N wrote:
> Implement single-pair BroadR-Reach modes on bcm5481x PHY by Broadcom.
> Create set of functions alternative to IEEE 802.3 to handle configuration
> of these modes on compatible Broadcom PHYs.
>
> Signed-off-by: Kamil Horák - 2N <kamilh@axis.com>
> ---
> drivers/net/phy/bcm-phy-lib.c | 122 ++++++++++++
> drivers/net/phy/bcm-phy-lib.h | 4 +
> drivers/net/phy/broadcom.c | 338 ++++++++++++++++++++++++++++++++--
> 3 files changed, 449 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
> index 876f28fd8256..9fa2a20e641f 100644
> --- a/drivers/net/phy/bcm-phy-lib.c
> +++ b/drivers/net/phy/bcm-phy-lib.c
> @@ -794,6 +794,46 @@ static int _bcm_phy_cable_test_get_status(struct phy_device *phydev,
> return ret;
> }
>
> +static int bcm_setup_forced(struct phy_device *phydev)
> +{
> + u16 ctl = 0;
> +
> + phydev->pause = 0;
> + phydev->asym_pause = 0;
> +
> + if (phydev->speed == SPEED_100)
> + ctl |= LRECR_SPEED100;
> +
> + if (phydev->duplex != DUPLEX_FULL)
> + return -EOPNOTSUPP;
Is this even possible? I don't actually known, but you don't define a
HALF link mode, so how is this requested?
> +/**
> + * bcm_linkmode_adv_to_mii_adv_t
> + * @advertising: the linkmode advertisement settings
> + *
> + * A small helper function that translates linkmode advertisement
> + * settings to phy autonegotiation advertisements for the
> + * MII_BCM54XX_LREANAA register.
> + */
> +static inline u32 bcm_linkmode_adv_to_mii_adv_t(unsigned long *advertising)
No inline functions in .c files please, let the compiler decide.
> +int bcm_setup_master_slave(struct phy_device *phydev);
> +int bcm_config_aneg(struct phy_device *phydev, bool changed);
> +int bcm_config_advert(struct phy_device *phydev);
These are all BroadReach specific, so i would put something in there
name to indicate this. Otherwise somebody is going to try to use them
when not appropriate.
Andrew
next prev parent reply other threads:[~2024-05-06 19:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 14:40 [PATCH v3 0/3] net: phy: bcm5481x: add support for BroadR-Reach mode Kamil Horák - 2N
2024-05-06 14:40 ` [PATCH v3 1/3] net: phy: bcm54811: New link mode for BroadR-Reach Kamil Horák - 2N
2024-05-06 19:14 ` Andrew Lunn
2024-05-22 7:57 ` Kamil Horák, 2N
2024-05-06 19:27 ` Florian Fainelli
2024-05-06 14:40 ` [PATCH v3 2/3] net: phy: bcm54811: Add LRE registers definitions Kamil Horák - 2N
2024-05-06 19:25 ` Florian Fainelli
2024-05-06 19:26 ` Andrew Lunn
2024-05-06 14:40 ` [PATCH v3 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes Kamil Horák - 2N
2024-05-06 19:35 ` Andrew Lunn [this message]
2024-05-06 20:14 ` Christophe JAILLET
2024-05-08 7:39 ` Simon Horman
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=efaf2c2c-45a9-4b22-8f71-c8e41d680912@lunn.ch \
--to=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=kamilh@axis.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®