Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Corcodel Marian <asd@marian1000.go.ro>
Cc: netdev@vger.kernel.org, Francois Romieu <romieu@fr.zoreil.com>
Subject: Re: [PATCH net-next v3.16]r8169:  Add support for half duplex on MDI
Date: Fri, 25 Mar 2016 16:50:48 +0100	[thread overview]
Message-ID: <20160325155048.GA11491@lunn.ch> (raw)
In-Reply-To: <1458916193-32521-1-git-send-email-asd@marian1000.go.ro>

On Fri, Mar 25, 2016 at 04:29:52PM +0200, Corcodel Marian wrote:
>  This patch add support for half duplex on MDI chips.
> 
> Signed-off-by: Corcodel Marian <asd@marian1000.go.ro>
> ---
>  drivers/net/ethernet/realtek/r8169.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 77c5efb..7f6fb1f 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -1713,8 +1713,13 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
>  		else
>  			goto out;
>  
> -		if (duplex == DUPLEX_FULL)
> +		if (duplex == DUPLEX_FULL) {
>  			bmcr |= BMCR_FULLDPLX;
> +		} else if (duplex == DUPLEX_HALF) {
> +				bmcr |= ~BMCR_FULLDPLX;
> +		} else {
> +			goto out;
> +		 }


Hi Corcodel

What PHY is actually being used? One that is supported by
drivers/net/phy/realtek.c?

It looks like the bugs you are finding are all handling stuff which is
generic, and well tested code in drivers/net/phy/phy_device.c would do
for you, with less bugs.

Maybe you want to consider throwing away the PHY code in r8169 and
just implement an standard mdio bus, use phylib and the realtek.c phy
driver?

	Andrew

      reply	other threads:[~2016-03-25 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 14:29 [PATCH net-next v3.16]r8169: Add support for half duplex on MDI Corcodel Marian
2016-03-25 15:50 ` Andrew Lunn [this message]

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=20160325155048.GA11491@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=asd@marian1000.go.ro \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.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