dsa_loop_bdinfo.c 756 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. #include <linux/kernel.h>
  3. #include <linux/init.h>
  4. #include <linux/phy.h>
  5. #include <net/dsa.h>
  6. #include "dsa_loop.h"
  7. static struct dsa_loop_pdata dsa_loop_pdata = {
  8. .cd = {
  9. .port_names[0] = "lan1",
  10. .port_names[1] = "lan2",
  11. .port_names[2] = "lan3",
  12. .port_names[3] = "lan4",
  13. .port_names[DSA_LOOP_CPU_PORT] = "cpu",
  14. },
  15. .name = "DSA mockup driver",
  16. .enabled_ports = 0x1f,
  17. .netdev = "eth0",
  18. };
  19. static const struct mdio_board_info bdinfo = {
  20. .bus_id = "fixed-0",
  21. .modalias = "dsa-loop",
  22. .mdio_addr = 31,
  23. .platform_data = &dsa_loop_pdata,
  24. };
  25. static int __init dsa_loop_bdinfo_init(void)
  26. {
  27. return mdiobus_register_board_info(&bdinfo, 1);
  28. }
  29. arch_initcall(dsa_loop_bdinfo_init)
  30. MODULE_LICENSE("GPL");