bcm63xx_dev_enet.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef BCM63XX_DEV_ENET_H_
  2. #define BCM63XX_DEV_ENET_H_
  3. #include <linux/if_ether.h>
  4. #include <linux/init.h>
  5. /*
  6. * on board ethernet platform data
  7. */
  8. struct bcm63xx_enet_platform_data {
  9. char mac_addr[ETH_ALEN];
  10. int has_phy;
  11. /* if has_phy, then set use_internal_phy */
  12. int use_internal_phy;
  13. /* or fill phy info to use an external one */
  14. int phy_id;
  15. int has_phy_interrupt;
  16. int phy_interrupt;
  17. /* if has_phy, use autonegociated pause parameters or force
  18. * them */
  19. int pause_auto;
  20. int pause_rx;
  21. int pause_tx;
  22. /* if !has_phy, set desired forced speed/duplex */
  23. int force_speed_100;
  24. int force_duplex_full;
  25. /* if !has_phy, set callback to perform mii device
  26. * init/remove */
  27. int (*mii_config)(struct net_device *dev, int probe,
  28. int (*mii_read)(struct net_device *dev,
  29. int phy_id, int reg),
  30. void (*mii_write)(struct net_device *dev,
  31. int phy_id, int reg, int val));
  32. };
  33. /*
  34. * on board ethernet switch platform data
  35. */
  36. #define ENETSW_MAX_PORT 8
  37. #define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
  38. #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
  39. #define ENETSW_RGMII_PORT0 4
  40. struct bcm63xx_enetsw_port {
  41. int used;
  42. int phy_id;
  43. int bypass_link;
  44. int force_speed;
  45. int force_duplex_full;
  46. const char *name;
  47. };
  48. struct bcm63xx_enetsw_platform_data {
  49. char mac_addr[ETH_ALEN];
  50. int num_ports;
  51. struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT];
  52. };
  53. int __init bcm63xx_enet_register(int unit,
  54. const struct bcm63xx_enet_platform_data *pd);
  55. int bcm63xx_enetsw_register(const struct bcm63xx_enetsw_platform_data *pd);
  56. #endif /* ! BCM63XX_DEV_ENET_H_ */