Make use of devlink regions to allow read access to some of the internal of the switches. Currently access to global1, global2 and the ATU is provided.
The switch itself will never trigger a region snapshot, it is assumed it is performed from user space as needed. v2: Remove left of debug print Comment ATU format is generic to mv88e6xxx Combine declaration and the assignment on a single line. v3: Drop support for port regions Improve the devlink API with a priv member and passing the region to the snapshot function Make the helper to convert from devlink to ds an inline function Andrew Lunn (9): net: devlink: regions: Add a priv member to the regions ops struct net: devlink: region: Pass the region ops to the snapshot function net: dsa: Add helper to convert from devlink to ds net: dsa: Add devlink regions support to DSA net: dsa: mv88e6xxx: Move devlink code into its own file net: dsa: mv88e6xxx: Create helper for FIDs in use net: dsa: mv88e6xxx: Add devlink regions net: dsa: wire up devlink info get net: dsa: mv88e6xxx: Implement devlink info get callback drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c | 290 ++-------- drivers/net/dsa/mv88e6xxx/chip.h | 14 + drivers/net/dsa/mv88e6xxx/devlink.c | 523 +++++++++++++++++++ drivers/net/dsa/mv88e6xxx/devlink.h | 21 + drivers/net/ethernet/intel/ice/ice_devlink.c | 2 + drivers/net/netdevsim/dev.c | 6 +- include/net/devlink.h | 6 +- include/net/dsa.h | 18 +- net/core/devlink.c | 2 +- net/dsa/dsa.c | 28 +- net/dsa/dsa2.c | 19 +- 12 files changed, 653 insertions(+), 277 deletions(-) create mode 100644 drivers/net/dsa/mv88e6xxx/devlink.c create mode 100644 drivers/net/dsa/mv88e6xxx/devlink.h -- 2.28.0