All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Popple <alistair@popple.id.au>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 3/7] IBM Akebono: Add support for a new PHY to the IBM emac driver
Date: Wed, 06 Nov 2013 11:08:35 +1100	[thread overview]
Message-ID: <81419762.0SyAdYsUqu@mexican> (raw)
In-Reply-To: <CAGVrzcZQ26kbim2piOwrvpyOcSaTET5da7Yh4GWv+erfuOBDhQ@mail.gmail.com>

On Tue, 5 Nov 2013 10:47:22 Florian Fainelli wrote:
> [snip]
> 
> > +/* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */
> > +static inline int rgmii_valid_mode(int phy_mode)
> > +{
> > +       return  phy_mode == PHY_MODE_GMII ||
> > +               phy_mode == PHY_MODE_MII ||
> > +               phy_mode == PHY_MODE_RGMII ||
> > +               phy_mode == PHY_MODE_TBI ||
> > +               phy_mode == PHY_MODE_RTBI;
> > +}
> > +
> > +static inline const char *rgmii_mode_name(int mode)
> > +{
> > +       switch (mode) {
> > +       case PHY_MODE_RGMII:
> > +               return "RGMII";
> > +       case PHY_MODE_TBI:
> > +               return "TBI";
> > +       case PHY_MODE_GMII:
> > +               return "GMII";
> > +       case PHY_MODE_MII:
> > +               return "MII";
> > +       case PHY_MODE_RTBI:
> > +               return "RTBI";
> > +       default:
> > +               BUG();
> > +       }
> 
> Any reasons why you are duplicating what is available in
> drivers/of/of_net.c ::of_get_phy_mode()?

Unless I'm missing something of_get_phy_mode() is going the other way. 
rgmii_mode_name() is converting PHY_MODE_* into a human-readable string. I 
couldn't find any obvious kernel method to do this but maybe I missed it?

Regards,

Alistair

WARNING: multiple messages have this Message-ID (diff)
From: Alistair Popple <alistair@popple.id.au>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 3/7] IBM Akebono: Add support for a new PHY to the IBM emac driver
Date: Wed, 06 Nov 2013 11:08:35 +1100	[thread overview]
Message-ID: <81419762.0SyAdYsUqu@mexican> (raw)
In-Reply-To: <CAGVrzcZQ26kbim2piOwrvpyOcSaTET5da7Yh4GWv+erfuOBDhQ@mail.gmail.com>

On Tue, 5 Nov 2013 10:47:22 Florian Fainelli wrote:
> [snip]
> 
> > +/* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */
> > +static inline int rgmii_valid_mode(int phy_mode)
> > +{
> > +       return  phy_mode == PHY_MODE_GMII ||
> > +               phy_mode == PHY_MODE_MII ||
> > +               phy_mode == PHY_MODE_RGMII ||
> > +               phy_mode == PHY_MODE_TBI ||
> > +               phy_mode == PHY_MODE_RTBI;
> > +}
> > +
> > +static inline const char *rgmii_mode_name(int mode)
> > +{
> > +       switch (mode) {
> > +       case PHY_MODE_RGMII:
> > +               return "RGMII";
> > +       case PHY_MODE_TBI:
> > +               return "TBI";
> > +       case PHY_MODE_GMII:
> > +               return "GMII";
> > +       case PHY_MODE_MII:
> > +               return "MII";
> > +       case PHY_MODE_RTBI:
> > +               return "RTBI";
> > +       default:
> > +               BUG();
> > +       }
> 
> Any reasons why you are duplicating what is available in
> drivers/of/of_net.c ::of_get_phy_mode()?

Unless I'm missing something of_get_phy_mode() is going the other way. 
rgmii_mode_name() is converting PHY_MODE_* into a human-readable string. I 
couldn't find any obvious kernel method to do this but maybe I missed it?

Regards,

Alistair

  reply	other threads:[~2013-11-06  0:08 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  5:31 [PATCH 1/7] IBM Akebono: Add support to AHCI platform driver Alistair Popple
2013-11-05  5:31 ` [PATCH 2/7] IBM Akebono: Add a SDHCI " Alistair Popple
2013-11-05  5:31 ` [PATCH 3/7] IBM Akebono: Add support for a new PHY to the IBM emac driver Alistair Popple
2013-11-05 18:16   ` Ben Hutchings
2013-11-05 18:16     ` Ben Hutchings
2013-11-05 19:54     ` Benjamin Herrenschmidt
2013-11-05 19:54       ` Benjamin Herrenschmidt
2013-11-05 23:11       ` Ben Hutchings
2013-11-05 23:11         ` Ben Hutchings
2013-11-06  1:34         ` Alistair Popple
2013-11-06  1:34           ` Alistair Popple
2013-11-06 16:40           ` Ben Hutchings
2013-11-06 16:40             ` Ben Hutchings
2013-11-07  2:39             ` Alistair Popple
2013-11-07  2:39               ` Alistair Popple
2013-11-05 18:47   ` Florian Fainelli
2013-11-05 18:47     ` Florian Fainelli
2013-11-06  0:08     ` Alistair Popple [this message]
2013-11-06  0:08       ` Alistair Popple
2013-11-06  0:16       ` Florian Fainelli
2013-11-06  0:16         ` Florian Fainelli
2013-11-06  1:38         ` Alistair Popple
2013-11-06  1:38           ` Alistair Popple
2013-11-06  2:17           ` Benjamin Herrenschmidt
2013-11-06  2:17             ` Benjamin Herrenschmidt
2013-11-06  2:23             ` Florian Fainelli
2013-11-06  2:23               ` Florian Fainelli
2013-11-05  5:31 ` [PATCH 4/7] IBM Akebono: Add support to the OHCI platform driver for Akebono Alistair Popple
2013-11-05 15:04   ` Alan Stern
2013-11-07  3:34     ` Alistair Popple
2013-11-07  4:55       ` Benjamin Herrenschmidt
2013-11-07 15:04       ` Alan Stern
2013-11-05  5:31 ` [PATCH 5/7] IBM Akebono: Add support to the EHCI " Alistair Popple
2013-11-05 15:04   ` Alan Stern
2013-11-05 19:52     ` Benjamin Herrenschmidt
2013-11-06  3:50       ` Alistair Popple
2013-11-06  3:58         ` Benjamin Herrenschmidt
2013-11-06  7:39           ` [RFC PATCH] ehci-platform: Merge ppc-of EHCI driver into the ehci-platform driver Alistair Popple
2013-11-06 16:14             ` Alan Stern
2013-11-07  2:34               ` Alistair Popple
2013-11-06 19:57             ` Benjamin Herrenschmidt
2013-11-07  2:35               ` Alistair Popple
2013-11-05  5:31 ` [PATCH 6/7] IBM Currituck: Clean up board specific code before adding Akebono code Alistair Popple
2013-11-05  5:31 ` [PATCH 7/7] IBM Akebono: Add the Akebono platform Alistair Popple

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=81419762.0SyAdYsUqu@mexican \
    --to=alistair@popple.id.au \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.