LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Woojung.Huh@microchip.com, netdev@vger.kernel.org
Cc: andrew@lunn.ch, rmk@armlinux.org.uk,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	cphealy@gmail.com, nikita.yoush@cogentembedded.com,
	vivien.didelot@savoirfairelinux.com, Nisar.Sayed@microchip.com,
	UNGLinuxDriver@microchip.com
Subject: Re: [RFC net-next 4/5] net: phy: Add support for IEEE standard test modes
Date: Tue, 1 May 2018 13:51:08 -0700	[thread overview]
Message-ID: <6053df89-a77d-51bd-a72b-07f3cfa5fdde@gmail.com> (raw)
In-Reply-To: <9235D6609DB808459E95D78E17F2E43D40D55B0A@CHN-SV-EXMX02.mchp-main.com>

On 05/01/2018 01:07 PM, Woojung.Huh@microchip.com wrote:
> Hi Florian,
> 
>> Not sure I completely understand your suggestion, do you mean that I
>> should break down the body of that function above such that there are
>> per-speed lower level functions? Something like the pseudo-code below:
>>
>> genphy_set_test() {
>> 	switch (mode) {
>> 	case PHY_STD_TEST_MODE_100BASET2_1:
>> 	..
>> 	case PHY_STD_TEST_MODE_100BASET2_3:
>> 		return genphy_set_100baset2();
>>
>> 	case PHY_STD_TEST_MODE_1000BASET_1:
>> 	..
>> 	case PHY_STD_TEST_MODE_1000BASET_4:
>> 		return genphy_set_1000baset();
>>
>> 	case PHY_STD_TEST_MODE_8021BWQCQ_1:
>> 		return genphy_set_100baset1();
>>
>> }
> Yes, I should write pseudo code. Sorry about confusion.
> User can override this function or expand to other modes.

Well, the way the code is structure is that if you call that function
with a test mode value that is not part of the standard set, it returns
-EOPNOTSUPP, so if your particular PHY driver wants to "overlay"
standard and non-standard modes, it can by using that hint.

This should work even if we have more standard test modes in the future
because the test modes are dynamically fetched by user-space using the
ETH_GSTRINGS ioctl().

Does that cover what you had in mind?
-- 
Florian

  reply	other threads:[~2018-05-01 20:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28  0:32 [RFC net-next 0/5] Support for PHY " Florian Fainelli
2018-04-28  0:32 ` [RFC net-next 1/5] net: phy: Pass stringset argument to ethtool operations Florian Fainelli
2018-04-28  0:32 ` [RFC net-next 2/5] net: ethtool: Add UAPI for PHY test modes Florian Fainelli
2018-04-28  0:32 ` [RFC net-next 3/5] net: ethtool: Add plumbing to get/set " Florian Fainelli
2018-04-28  0:32 ` [RFC net-next 4/5] net: phy: Add support for IEEE standard " Florian Fainelli
2018-04-30 23:20   ` Andrew Lunn
2018-05-01 17:03     ` Florian Fainelli
2018-05-01 17:29   ` Woojung.Huh
2018-05-01 18:43     ` Florian Fainelli
2018-05-01 20:07       ` Woojung.Huh
2018-05-01 20:51         ` Florian Fainelli [this message]
2018-05-07  0:02           ` Woojung.Huh
2018-04-28  0:32 ` [RFC net-next 5/5] net: phy: broadcom: Add support for PHY " Florian Fainelli
2018-04-28  0:32 ` [PATCH ethtool 1/2] ethtool-copy.h: Sync with net-next Florian Fainelli
2018-04-28  0:32 ` [PATCH ethtool 2/2] ethtool: Add support for PHY test modes Florian Fainelli
2018-04-30  2:55 ` [RFC net-next 0/5] Support " David Miller
2018-04-30 16:30   ` Florian Fainelli
2018-04-30 16:40     ` Andrew Lunn
2018-04-30 19:23       ` Florian Fainelli
2018-04-30 23:24     ` Andrew Lunn
2018-05-01 17:21       ` Florian Fainelli
2018-05-01 17:47         ` Andrew Lunn
2018-05-01 18:27           ` Florian Fainelli
2018-05-01 19:59             ` Andrew Lunn
2018-05-01 18:06         ` David Miller

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=6053df89-a77d-51bd-a72b-07f3cfa5fdde@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Nisar.Sayed@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=rmk@armlinux.org.uk \
    --cc=vivien.didelot@savoirfairelinux.com \
    --subject='Re: [RFC net-next 4/5] net: phy: Add support for IEEE standard test modes' \
    /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

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).