w5100.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Ethernet driver for the WIZnet W5100 chip.
  4. *
  5. * Copyright (C) 2006-2008 WIZnet Co.,Ltd.
  6. * Copyright (C) 2012 Mike Sinkovsky <[email protected]>
  7. */
  8. enum {
  9. W5100,
  10. W5200,
  11. W5500,
  12. };
  13. struct w5100_ops {
  14. bool may_sleep;
  15. int chip_id;
  16. int (*read)(struct net_device *ndev, u32 addr);
  17. int (*write)(struct net_device *ndev, u32 addr, u8 data);
  18. int (*read16)(struct net_device *ndev, u32 addr);
  19. int (*write16)(struct net_device *ndev, u32 addr, u16 data);
  20. int (*readbulk)(struct net_device *ndev, u32 addr, u8 *buf, int len);
  21. int (*writebulk)(struct net_device *ndev, u32 addr, const u8 *buf,
  22. int len);
  23. int (*reset)(struct net_device *ndev);
  24. int (*init)(struct net_device *ndev);
  25. };
  26. void *w5100_ops_priv(const struct net_device *ndev);
  27. int w5100_probe(struct device *dev, const struct w5100_ops *ops,
  28. int sizeof_ops_priv, const void *mac_addr, int irq,
  29. int link_gpio);
  30. void w5100_remove(struct device *dev);
  31. extern const struct dev_pm_ops w5100_pm_ops;