OSDN Git Service

net: dsa: Mock-up driver
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 31 Mar 2017 01:43:21 +0000 (18:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Apr 2017 19:39:32 +0000 (12:39 -0700)
commit98cd1552ea27e512c7e99e2aa76042a26e4fb25c
treeaba74b9bf561693e0fae899c347b33cd8698eec5
parent772c3bdad10db607b1035ae74cc817e81a114021
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>
drivers/net/dsa/Kconfig
drivers/net/dsa/Makefile
drivers/net/dsa/dsa_loop.c [new file with mode: 0644]
drivers/net/dsa/dsa_loop.h [new file with mode: 0644]
drivers/net/dsa/dsa_loop_bdinfo.c [new file with mode: 0644]