smsc911x.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /***************************************************************************
  3. *
  4. * Copyright (C) 2004-2008 SMSC
  5. * Copyright (C) 2005-2008 ARM
  6. *
  7. ***************************************************************************/
  8. #ifndef __LINUX_SMSC911X_H__
  9. #define __LINUX_SMSC911X_H__
  10. #include <linux/phy.h>
  11. #include <linux/if_ether.h>
  12. /* platform_device configuration data, should be assigned to
  13. * the platform_device's dev.platform_data */
  14. struct smsc911x_platform_config {
  15. unsigned int irq_polarity;
  16. unsigned int irq_type;
  17. unsigned int flags;
  18. unsigned int shift;
  19. phy_interface_t phy_interface;
  20. unsigned char mac[ETH_ALEN];
  21. };
  22. /* Constants for platform_device irq polarity configuration */
  23. #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW 0
  24. #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH 1
  25. /* Constants for platform_device irq type configuration */
  26. #define SMSC911X_IRQ_TYPE_OPEN_DRAIN 0
  27. #define SMSC911X_IRQ_TYPE_PUSH_PULL 1
  28. /* Constants for flags */
  29. #define SMSC911X_USE_16BIT (BIT(0))
  30. #define SMSC911X_USE_32BIT (BIT(1))
  31. #define SMSC911X_FORCE_INTERNAL_PHY (BIT(2))
  32. #define SMSC911X_FORCE_EXTERNAL_PHY (BIT(3))
  33. #define SMSC911X_SAVE_MAC_ADDRESS (BIT(4))
  34. /*
  35. * SMSC911X_SWAP_FIFO:
  36. * Enables software byte swap for fifo data. Should only be used as a
  37. * "last resort" in the case of big endian mode on boards with incorrectly
  38. * routed data bus to older devices such as LAN9118. Newer devices such as
  39. * LAN9221 can handle this in hardware, there are registers to control
  40. * this swapping but the driver doesn't currently use them.
  41. */
  42. #define SMSC911X_SWAP_FIFO (BIT(5))
  43. #endif /* __LINUX_SMSC911X_H__ */