Message ID | 20231208193518.2018114-3-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Add some history to the DSA documentation | expand |
On Fri, Dec 8, 2023 at 8:36 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > We were documenting a bunch of stuff which was removed in commit > 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some > further cleanup to do in struct dsa_chip_data, so rather than describing > every possible field (when maybe we should be switching to kerneldoc > format), just say what's important about it. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> (...) > + ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is > + populated by board-specific code. The hardware switch driver may also have I tend to avoid talking about "board-specific" since that has an embedded tone to it, and rather say "system-specific". But DSA switches are certainly in 99% of the cases embedded so it's definitely no big deal. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On 12/8/23 11:35, Vladimir Oltean wrote: > We were documenting a bunch of stuff which was removed in commit > 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some > further cleanup to do in struct dsa_chip_data, so rather than describing > every possible field (when maybe we should be switching to kerneldoc > format), just say what's important about it. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
On Fri, Dec 08, 2023 at 11:19:28PM +0100, Linus Walleij wrote: > On Fri, Dec 8, 2023 at 8:36 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > > + ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is > > + populated by board-specific code. The hardware switch driver may also have > > I tend to avoid talking about "board-specific" since that has an embedded > tone to it, and rather say "system-specific". But DSA switches are certainly > in 99% of the cases embedded so it's definitely no big deal. I've changed this to "system-specific". > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Thanks for the review, I appreciate it!
On Fri, Dec 08, 2023 at 09:35:16PM +0200, Vladimir Oltean wrote: > We were documenting a bunch of stuff which was removed in commit > 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some > further cleanup to do in struct dsa_chip_data, so rather than describing > every possible field (when maybe we should be switching to kerneldoc > format), just say what's important about it. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> > --- > Documentation/networking/dsa/dsa.rst | 23 +++++++++++------------ > 1 file changed, 11 insertions(+), 12 deletions(-) > > diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst > index 0c326a42eb81..676c92136a0e 100644 > --- a/Documentation/networking/dsa/dsa.rst > +++ b/Documentation/networking/dsa/dsa.rst > @@ -413,18 +413,17 @@ PHYs, external PHYs, or even external switches. > Data structures > --------------- > > -DSA data structures are defined in ``include/net/dsa.h`` as well as > -``net/dsa/dsa_priv.h``: > - > -- ``dsa_chip_data``: platform data configuration for a given switch device, > - this structure describes a switch device's parent device, its address, as > - well as various properties of its ports: names/labels, and finally a routing > - table indication (when cascading switches) > - > -- ``dsa_platform_data``: platform device configuration data which can reference > - a collection of dsa_chip_data structures if multiple switches are cascaded, > - the conduit network device this switch tree is attached to needs to be > - referenced > +DSA data structures are defined in ``include/linux/platform_data/dsa.h``, > +``include/net/dsa.h`` as well as ``net/dsa/dsa_priv.h``: > + > +- ``dsa_chip_data``: platform data configuration for a given switch device. > + Most notably, it is necessary to the DSA core because it holds a reference to > + the conduit interface. It must be accessible through the > + ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is > + populated by board-specific code. The hardware switch driver may also have > + its own portion of ``platform_data`` description. In that case, > + ``ds->dev->platform_data`` can point to a switch-specific structure, which > + encapsulates ``struct dsa_chip_data`` as its first element. > > - ``dsa_switch_tree``: structure assigned to the conduit network device under > ``dsa_ptr``, this structure references a dsa_platform_data structure as well as > -- > 2.34.1 >
diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst index 0c326a42eb81..676c92136a0e 100644 --- a/Documentation/networking/dsa/dsa.rst +++ b/Documentation/networking/dsa/dsa.rst @@ -413,18 +413,17 @@ PHYs, external PHYs, or even external switches. Data structures --------------- -DSA data structures are defined in ``include/net/dsa.h`` as well as -``net/dsa/dsa_priv.h``: - -- ``dsa_chip_data``: platform data configuration for a given switch device, - this structure describes a switch device's parent device, its address, as - well as various properties of its ports: names/labels, and finally a routing - table indication (when cascading switches) - -- ``dsa_platform_data``: platform device configuration data which can reference - a collection of dsa_chip_data structures if multiple switches are cascaded, - the conduit network device this switch tree is attached to needs to be - referenced +DSA data structures are defined in ``include/linux/platform_data/dsa.h``, +``include/net/dsa.h`` as well as ``net/dsa/dsa_priv.h``: + +- ``dsa_chip_data``: platform data configuration for a given switch device. + Most notably, it is necessary to the DSA core because it holds a reference to + the conduit interface. It must be accessible through the + ``ds->dev->platform_data`` pointer at ``dsa_register_switch()`` time. It is + populated by board-specific code. The hardware switch driver may also have + its own portion of ``platform_data`` description. In that case, + ``ds->dev->platform_data`` can point to a switch-specific structure, which + encapsulates ``struct dsa_chip_data`` as its first element. - ``dsa_switch_tree``: structure assigned to the conduit network device under ``dsa_ptr``, this structure references a dsa_platform_data structure as well as
We were documenting a bunch of stuff which was removed in commit 93e86b3bc842 ("net: dsa: Remove legacy probing support"). There's some further cleanup to do in struct dsa_chip_data, so rather than describing every possible field (when maybe we should be switching to kerneldoc format), just say what's important about it. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- Documentation/networking/dsa/dsa.rst | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)