emac-sgmii.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _EMAC_SGMII_H_
  13. #define _EMAC_SGMII_H_
  14. struct emac_adapter;
  15. struct platform_device;
  16. typedef int (*emac_sgmii_function)(struct emac_adapter *adpt);
  17. /** emac_sgmii - internal emac phy
  18. * @base base address
  19. * @digital per-lane digital block
  20. * @irq the interrupt number
  21. * @decode_error_count reference count of consecutive decode errors
  22. * @initialize initialization function
  23. * @open called when the driver is opened
  24. * @close called when the driver is closed
  25. * @link_up called when the link comes up
  26. * @link_down called when the link comes down
  27. */
  28. struct emac_sgmii {
  29. void __iomem *base;
  30. void __iomem *digital;
  31. unsigned int irq;
  32. atomic_t decode_error_count;
  33. emac_sgmii_function initialize;
  34. emac_sgmii_function open;
  35. emac_sgmii_function close;
  36. emac_sgmii_function link_up;
  37. emac_sgmii_function link_down;
  38. };
  39. int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt);
  40. void emac_sgmii_reset(struct emac_adapter *adpt);
  41. int emac_sgmii_init_fsm9900(struct emac_adapter *adpt);
  42. int emac_sgmii_init_qdf2432(struct emac_adapter *adpt);
  43. int emac_sgmii_init_qdf2400(struct emac_adapter *adpt);
  44. #endif