From: Zach Brown <zach.brown@ni.com>
To: David Miller <davem@davemloft.net>
Cc: f.fainelli@gmail.com, mlindner@marvell.com,
stephen@networkplumber.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
florian.c.schilhabel@googlemail.com, Larry.Finger@lwfinger.net,
gregkh@linuxfoundation.org, rpurdie@rpsys.net,
j.anaszewski@samsung.com, linux-leds@vger.kernel.org,
andrew@lunn.ch
Subject: Re: [PATCH v4 3/3] net: phy: leds: add support for led triggers on phy link state change
Date: Thu, 13 Oct 2016 10:42:46 -0500 [thread overview]
Message-ID: <20161013154246.GA17387@zach-desktop> (raw)
In-Reply-To: <20161013.104634.2079376697690971907.davem@davemloft.net>
On Thu, Oct 13, 2016 at 10:46:34AM -0400, David Miller wrote:
> From: Zach Brown <zach.brown@ni.com>
> Date: Tue, 11 Oct 2016 15:26:20 -0500
>
> > From: Josh Cartwright <josh.cartwright@ni.com>
> >
> > Create an option CONFIG_LED_TRIGGER_PHY (default n), which will
> > create a set of led triggers for each instantiated PHY device. There is
> > one LED trigger per link-speed, per-phy.
> >
> > This allows for a user to configure their system to allow a set of LEDs
> > to represent link state changes on the phy.
> >
> > Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
> > Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
> > Signed-off-by: Zach Brown <zach.brown@ni.com>
> ...
> > + static const char * const name_suffix[] = {
> > + "10Mbps",
> > + "100Mbps",
> > + "1Gbps",
> > + "2.5Gbps",
> > + "10Gbps",
>
> This choice of both the array size and the speeds to support seems
> entirely arbitrary and is inappropriate for a generic driver of this
> kind.
>
> This seems to be hard coding this to support the list of speeds
> supported by whatever driver you want to use with this new LED
> facility, and sorry that's not how we build nice generic pieces of
> infrastructure.
>
> Thanks.
The speeds listed are the speeds found in the phy_speed_to_str function in phy.c.
They are also the speeds found in the struct phy_setting settings array,
which is commented with
"/* A mapping of all SUPPORTED settings to speed/duplex */"
We believed they represented the commonly supported speeds of phys.
Do you have suggestions on how to better handle the choice of the array size
and the speeds?
Thanks.
next prev parent reply other threads:[~2016-10-13 16:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 20:26 [PATCH v4 0/3] Add support for led triggers on phy link state change Zach Brown
2016-10-11 20:26 ` [PATCH v4 1/3] skge: Rename LED_OFF and LED_ON in marvel skge driver to avoid conflicts with leds namespace Zach Brown
2016-10-11 21:14 ` Stephen Hemminger
2016-10-11 21:29 ` Zach Brown
2016-10-11 20:26 ` [PATCH v4 2/3] net: phy: Encapsulate actions performed during link state changes into function phy_adjust_link Zach Brown
2016-10-11 20:26 ` [PATCH v4 3/3] net: phy: leds: add support for led triggers on phy link state change Zach Brown
2016-10-13 14:46 ` David Miller
2016-10-13 15:42 ` Zach Brown [this message]
2016-10-13 15:59 ` David Miller
2016-10-13 16:40 ` Andrew Lunn
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=20161013154246.GA17387@zach-desktop \
--to=zach.brown@ni.com \
--cc=Larry.Finger@lwfinger.net \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=f.fainelli@gmail.com \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=j.anaszewski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mlindner@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).