dev-dsa.c 902 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Atheros AR71xx DSA switch device support
  3. *
  4. * Copyright (C) 2008-2012 Gabor Juhos <[email protected]>
  5. * Copyright (C) 2008 Imre Kaloz <[email protected]>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published
  9. * by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <asm/mach-ath79/ath79.h>
  14. #include "dev-dsa.h"
  15. static struct platform_device ar71xx_dsa_switch_device = {
  16. .name = "dsa",
  17. .id = 0,
  18. };
  19. void __init ath79_register_dsa(struct device *netdev,
  20. struct device *miidev,
  21. struct dsa_platform_data *d)
  22. {
  23. int i;
  24. d->netdev = netdev;
  25. for (i = 0; i < d->nr_chips; i++)
  26. d->chip[i].mii_bus = miidev;
  27. ar71xx_dsa_switch_device.dev.platform_data = d;
  28. platform_device_register(&ar71xx_dsa_switch_device);
  29. }