Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 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 | |
Akinobu Mita | 0c165ff | 2016-04-15 00:11:33 +0900 | [diff] [blame^] | 10 | enum { |
| 11 | W5100, |
| 12 | W5200, |
| 13 | }; |
| 14 | |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 15 | struct w5100_ops { |
Akinobu Mita | bf2c6b90 | 2016-04-15 00:11:31 +0900 | [diff] [blame] | 16 | bool may_sleep; |
Akinobu Mita | 0c165ff | 2016-04-15 00:11:33 +0900 | [diff] [blame^] | 17 | int chip_id; |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 18 | int (*read)(struct net_device *ndev, u16 addr); |
| 19 | int (*write)(struct net_device *ndev, u16 addr, u8 data); |
| 20 | int (*read16)(struct net_device *ndev, u16 addr); |
| 21 | int (*write16)(struct net_device *ndev, u16 addr, u16 data); |
| 22 | int (*readbulk)(struct net_device *ndev, u16 addr, u8 *buf, int len); |
| 23 | int (*writebulk)(struct net_device *ndev, u16 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, u8 *mac_addr, int irq, int link_gpio); |
| 33 | int w5100_remove(struct device *dev); |
| 34 | |
| 35 | extern const struct dev_pm_ops w5100_pm_ops; |