diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-03-30 21:43:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-01 15:39:32 -0400 |
commit | 98cd1552ea27e512c7e99e2aa76042a26e4fb25c (patch) | |
tree | aba74b9bf561693e0fae899c347b33cd8698eec5 /drivers/net/dsa/dsa_loop.h | |
parent | 772c3bdad10db607b1035ae74cc817e81a114021 (diff) |
net: dsa: Mock-up driver
This patch adds support for a DSA mock-up driver which essentially does
the following:
- registers/unregisters 4 fixed PHYs to the slave network devices
- uses eth0 (configurable) as the master netdev
- registers the switch as a fixed MDIO device against the fixed MDIO bus
at address 31
- includes dynamic debug prints for dsa_switch_ops functions that can be
enabled to get call traces
This is a good way to test modular builds as well as exercise the DSA
APIs without requiring access to real hardware. This does not test the
data-path, although this could be added later on.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/dsa_loop.h')
-rw-r--r-- | drivers/net/dsa/dsa_loop.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/dsa/dsa_loop.h b/drivers/net/dsa/dsa_loop.h new file mode 100644 index 000000000000..dc396877fc95 --- /dev/null +++ b/drivers/net/dsa/dsa_loop.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef __DSA_LOOP_H | ||
2 | #define __DSA_LOOP_H | ||
3 | |||
4 | struct dsa_chip_data; | ||
5 | |||
6 | struct dsa_loop_pdata { | ||
7 | /* Must be first, such that dsa_register_switch() can access this | ||
8 | * without gory pointer manipulations | ||
9 | */ | ||
10 | struct dsa_chip_data cd; | ||
11 | const char *name; | ||
12 | unsigned int enabled_ports; | ||
13 | const char *netdev; | ||
14 | }; | ||
15 | |||
16 | #define DSA_LOOP_NUM_PORTS 6 | ||
17 | #define DSA_LOOP_CPU_PORT (DSA_LOOP_NUM_PORTS - 1) | ||
18 | |||
19 | #endif /* __DSA_LOOP_H */ | ||