w5100.h 1017 B

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