gianfar_mii.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * drivers/net/gianfar_mii.h
  3. *
  4. * Gianfar Ethernet Driver -- MII Management Bus Implementation
  5. * Driver for the MDIO bus controller in the Gianfar register space
  6. *
  7. * Author: Andy Fleming
  8. * Maintainer: Kumar Gala
  9. *
  10. * Copyright (c) 2002-2004 Freescale Semiconductor, Inc.
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the
  14. * Free Software Foundation; either version 2 of the License, or (at your
  15. * option) any later version.
  16. *
  17. */
  18. #ifndef __GIANFAR_MII_H
  19. #define __GIANFAR_MII_H
  20. #define MIIMIND_BUSY 0x00000001
  21. #define MIIMIND_NOTVALID 0x00000004
  22. #define MII_READ_COMMAND 0x00000001
  23. #define GFAR_SUPPORTED (SUPPORTED_10baseT_Half \
  24. | SUPPORTED_10baseT_Full \
  25. | SUPPORTED_100baseT_Half \
  26. | SUPPORTED_100baseT_Full \
  27. | SUPPORTED_Autoneg \
  28. | SUPPORTED_MII)
  29. struct gfar_mii {
  30. u32 miimcfg; /* 0x.520 - MII Management Config Register */
  31. u32 miimcom; /* 0x.524 - MII Management Command Register */
  32. u32 miimadd; /* 0x.528 - MII Management Address Register */
  33. u32 miimcon; /* 0x.52c - MII Management Control Register */
  34. u32 miimstat; /* 0x.530 - MII Management Status Register */
  35. u32 miimind; /* 0x.534 - MII Management Indicator Register */
  36. };
  37. int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
  38. int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
  39. int __init gfar_mdio_init(void);
  40. void __exit gfar_mdio_exit(void);
  41. #endif /* GIANFAR_PHY_H */