linux/include/soc/mscc
Vladimir Oltean e0632940bc net: mscc: ocelot: don't rely on preprocessor for vcap key/action packing
The IGR_PORT_MASK key width is different between the 11-port VSC7514 and
the 6-port VSC9959 switches. And since IGR_PORT_MASK is one of the first
fields of a VCAP key entry, it means that all further field
offset/length pairs are shifted between the 2.

The ocelot driver performs packing of VCAP half keys with the help of
some preprocessor macros:

- A set of macros for defining the HKO (Half Key Offset) and HKL (Half
  Key Length) of each possible key field. The offset of each field is
  defined as the sum between the offset and the sum of the previous
  field.

- A set of accessors on top of vcap_key_set for shorter (aka less
  typing) access to the HKO and HKL of each key field.

Since the field offsets and lengths are different between switches,
defining them through the preprocessor isn't going to fly. So introduce
a structure holding (offset, length) pairs and instantiate it in
ocelot_board.c for VSC7514. In a future patch, a similar structure will
be instantiated in felix_vsc9959.c for NXP LS1028A.

The accessors also need to go. They are based on macro name
concatenation, which is horrible to understand and follow.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-03 18:57:42 -08:00
..
ocelot_ana.h net: mscc: ocelot: export ANA, DEV and QSYS registers to include/soc/mscc 2020-01-05 23:22:33 -08:00
ocelot_dev.h net: mscc: ocelot: export ANA, DEV and QSYS registers to include/soc/mscc 2020-01-05 23:22:33 -08:00
ocelot_hsio.h
ocelot_qsys.h net: mscc: ocelot: export ANA, DEV and QSYS registers to include/soc/mscc 2020-01-05 23:22:33 -08:00
ocelot_sys.h net: mscc: ocelot: publish ocelot_sys.h to include/soc/mscc 2019-11-15 12:32:16 -08:00
ocelot_vcap.h net: mscc: ocelot: don't rely on preprocessor for vcap key/action packing 2020-03-03 18:57:42 -08:00
ocelot.h net: mscc: ocelot: don't rely on preprocessor for vcap key/action packing 2020-03-03 18:57:42 -08:00