xref: /linux/drivers/net/ethernet/wiznet/w5100.h (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
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 <msink@permonline.ru>
7  */
8 
9 enum {
10 	W5100,
11 	W5200,
12 	W5500,
13 };
14 
15 struct w5100_ops {
16 	bool may_sleep;
17 	int chip_id;
18 	int (*read)(struct net_device *ndev, u32 addr);
19 	int (*write)(struct net_device *ndev, u32 addr, u8 data);
20 	int (*read16)(struct net_device *ndev, u32 addr);
21 	int (*write16)(struct net_device *ndev, u32 addr, u16 data);
22 	int (*readbulk)(struct net_device *ndev, u32 addr, u8 *buf, int len);
23 	int (*writebulk)(struct net_device *ndev, u32 addr, const u8 *buf,
24 			 int len);
25 	int (*reset)(struct net_device *ndev);
26 	int (*init)(struct net_device *ndev);
27 };
28 
29 void *w5100_ops_priv(const struct net_device *ndev);
30 
31 int w5100_probe(struct device *dev, const struct w5100_ops *ops,
32 		int sizeof_ops_priv, const void *mac_addr, int irq,
33 		int link_gpio);
34 void w5100_remove(struct device *dev);
35 
36 extern const struct dev_pm_ops w5100_pm_ops;
37