All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next 06/21] net: dsa: mv88e6xxx: factorize MAC address setting
Date: Sat, 07 May 2016 16:37:03 -0400	[thread overview]
Message-ID: <878tzlfvv4.fsf@ketchup.mtl.sfl> (raw)
In-Reply-To: <20160506222320.GB2073@lunn.ch>

Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

>> @@ -378,6 +385,7 @@ enum mv88e6xxx_cap {
>>  #define MV88E6XXX_FLAG_EEPROM		BIT(MV88E6XXX_CAP_EEPROM)
>>  #define MV88E6XXX_FLAG_PPU		BIT(MV88E6XXX_CAP_PPU)
>>  #define MV88E6XXX_FLAG_SMI_PHY		BIT(MV88E6XXX_CAP_SMI_PHY)
>> +#define MV88E6XXX_FLAG_SWITCH_MAC	BIT(MV88E6XXX_CAP_SWITCH_MAC_WOL_WOF)
>>  #define MV88E6XXX_FLAG_TEMP		BIT(MV88E6XXX_CAP_TEMP)
>>  #define MV88E6XXX_FLAG_TEMP_LIMIT	BIT(MV88E6XXX_CAP_TEMP_LIMIT)
>
> There is a general pattern here that the flag has a name derived from
> the capability. Except you dropped the WOL_WOF here. It would probably
> be better to not have WOL_WOF at all.

Indeed, I did that because the global 2 register 0x0D "Switch
MAC/WoL/WoF" is used to indirectly configure the switch MAC address, the
Wake on Lan and Wake on Frame. So I explicitly named the capability
MV88E6XXX_CAP_SWITCH_MAC_WOL_WOF and the flag for the switch MAC
MV88E6XXX_FLAG_SWITCH_MAC.

So if we add support for WoL, we can then define:

    #define MV88E6XXX_FLAG_WOL BIT(MV88E6XXX_CAP_SWITCH_MAC_WOL_WOF)

But I can get rid of it if it feels confusing.

Thanks,

        Vivien

  reply	other threads:[~2016-05-07 20:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 21:57 [PATCH net-next 00/21] net: dsa: mv88e6xxx: turn into monolithic driver Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 01/21] net: dsa: mv88e6xxx: add flags to info Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 02/21] net: dsa: mv88e6xxx: factorize PHY access with PPU Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 03/21] net: dsa: mv88e6xxx: factorize PHY indirect access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 04/21] net: dsa: mv88e6xxx: factorize EEPROM access Vivien Didelot
2016-05-06 22:20   ` Andrew Lunn
2016-05-06 21:57 ` [PATCH net-next 05/21] net: dsa: mv88e6xxx: factorize temperature access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 06/21] net: dsa: mv88e6xxx: factorize MAC address setting Vivien Didelot
2016-05-06 22:23   ` Andrew Lunn
2016-05-07 20:37     ` Vivien Didelot [this message]
2016-05-06 21:57 ` [PATCH net-next 07/21] net: dsa: mv88e6xxx: factorize EEE access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 08/21] net: dsa: mv88e6xxx: factorize registers access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 09/21] net: dsa: mv88e6xxx: factorize bridge support Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 10/21] net: dsa: mv88e6xxx: factorize VTU access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 11/21] net: dsa: mv88e6xxx: factorize ATU access Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 12/21] net: dsa: mv88e6xxx: factorize switch reset Vivien Didelot
2016-05-06 22:27   ` Andrew Lunn
2016-05-06 21:57 ` [PATCH net-next 13/21] net: dsa: mv88e6xxx: factorize global setup Vivien Didelot
2016-05-06 22:29   ` Andrew Lunn
2016-05-06 21:57 ` [PATCH net-next 14/21] net: dsa: mv88e6xxx: factorize GLOBAL_CONTROL setup Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 15/21] net: dsa: mv88e6xxx: factorize VLAN Ethertype Vivien Didelot
2016-05-06 22:33   ` Andrew Lunn
2016-05-07 20:51     ` Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 16/21] net: dsa: mv88e6xxx: factorize GLOBAL_MONITOR_CONTROL setup Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 17/21] net: dsa: mv88e6xxx: factorize GLOBAL_CONTROL_2 setup Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 18/21] net: dsa: mv88e6xxx: factorize frames priorities Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 19/21] net: dsa: mv88e6xxx: factorize switch setup Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 20/21] net: dsa: mv88e6xxx: factorize tag protocol Vivien Didelot
2016-05-06 21:57 ` [PATCH net-next 21/21] net: dsa: mv88e6xxx: factorize the switch driver Vivien Didelot

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=878tzlfvv4.fsf@ketchup.mtl.sfl \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.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 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.