net: mscc: ocelot: move ocelot_port_private :: chip_port to ocelot_port :: index
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 11 May 2022 10:06:37 +0000 (13:06 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:39:18 +0000 (16:39 -0700)
commit7e708760fc114f049df9dccb994e23d20866b310
treec6a4f19010382f197987d8b2d2ccda663c9596d2
parent6d0be600477089026c76fe529bd96fad4cf69c3b
net: mscc: ocelot: move ocelot_port_private :: chip_port to ocelot_port :: index

Currently the ocelot switch lib is unaware of the index of a struct
ocelot_port, since that is kept in the encapsulating structures of outer
drivers (struct dsa_port :: index, struct ocelot_port_private :: chip_port).

With the upcoming increase in complexity associated with assigning DSA
tag_8021q CPU ports to certain user ports, it becomes necessary for the
switch lib to be able to retrieve the index of a certain ocelot_port.

Therefore, introduce a new u8 to ocelot_port (same size as the chip_port
used by the ocelot switchdev driver) and rework the existing code to
populate and use it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c
drivers/net/ethernet/mscc/ocelot.h
drivers/net/ethernet/mscc/ocelot_net.c
include/soc/mscc/ocelot.h