Re: [PATCH net 2/4] docs: net: dsa: update platform_data documentation
From: Alvin Šipraga <hidden>
Date: 2023-12-10 13:37:26
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 <redacted>
quoted hunk ↗ jump to hunk
--- 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