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 3/6] net: dsa: mv88e6xxx: add a software reset op
Date: Fri, 02 Dec 2016 12:30:04 -0500 [thread overview]
Message-ID: <87fum66xyb.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20161202154342.GL21887@lunn.ch>
Hi Andrew,
Andrew Lunn <andrew@lunn.ch> writes:
> + /* Switch Software Reset */
> + int (*g1_reset)(struct mv88e6xxx_chip *chip);
> +
>
> We have a collection of function pointers with port_ prefix, another
> collection with stats_, and a third with ppu_, etc. And then we have
> some which do not fit a specific category. Those i have prefixed with
> g1_ or g2_. I think we should have some prefix, and that is my
> suggestion.
I disagree. There's only one entry point to issue a switch software
reset, so .reset is enough.
I use this opportunity to give a bit of details about mv88e6xxx/ so that
things get written down at least once somewhere:
global1.c implements accessors to "Global 1 Registers" features and are
prefixed with mv88e6xxx_g1_; port.c implements accessors to "Port
Registers" features and are prefixed with mv88e6xxx_port_, and so
on. (where xxx can be a model if there's conflict due to a redefinition
of the same register)
If a feature is not present or if there's more than one way to access
it, these accessors are bundled in the per-chip mv88e6xxx_ops structure
for disambiguation.
chip.c implements support for a single chip by aggregating and nicely
wrapping these operations. It provides a generic API for Marvell
switches, used to implement net/dsa routines.
Here's a couple of example. Setting a switch MAC can be done in Global
1, or Global 2 depending on the model. Thus .set_switch_mac can be
mv88e6xxx_g1_set_switch_mac or mv88e6xxx_g2_set_switch_mac.
Setting the port's speed is always in the same Port register, but its
layout varies with the model. Thus .port_set_speed can be
mv88e6185_port_set_speed or mv88e6352_port_set_speed.
Thanks,
Vivien
next prev parent reply other threads:[~2016-12-02 17:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 22:59 [PATCH net-next 0/6] net: dsa: mv88e6xxx: rework reset and PPU code Vivien Didelot
2016-11-30 22:59 ` [PATCH net-next 1/6] net: dsa: mv88e6xxx: add helper to disable ports Vivien Didelot
2016-11-30 23:20 ` Andrew Lunn
2016-11-30 22:59 ` [PATCH net-next 2/6] net: dsa: mv88e6xxx: add helper to hardware reset Vivien Didelot
2016-11-30 23:21 ` Andrew Lunn
2016-11-30 22:59 ` [PATCH net-next 3/6] net: dsa: mv88e6xxx: add a software reset op Vivien Didelot
2016-11-30 23:26 ` Andrew Lunn
2016-12-01 20:41 ` Vivien Didelot
2016-12-02 15:43 ` Andrew Lunn
2016-12-02 17:30 ` Vivien Didelot [this message]
2016-12-02 17:23 ` David Miller
2016-11-30 22:59 ` [PATCH net-next 4/6] net: dsa: mv88e6xxx: add a PPU polling op Vivien Didelot
2016-11-30 22:59 ` [PATCH net-next 5/6] net: dsa: mv88e6xxx: add helper for switch ready Vivien Didelot
2016-11-30 23:38 ` Andrew Lunn
2016-12-01 20:31 ` Vivien Didelot
2016-11-30 22:59 ` [PATCH net-next 6/6] net: dsa: mv88e6xxx: add PPU enable/disable ops 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=87fum66xyb.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me \
--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 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).