Thomas Gleixner | 80503b2 | 2019-05-24 12:04:09 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 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> |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 7 | */ |
| 8 | |
Akinobu Mita | 0c165ff | 2016-04-15 00:11:33 +0900 | [diff] [blame] | 9 | enum { |
| 10 | W5100, |
| 11 | W5200, |
Akinobu Mita | 35ef7d6 | 2016-04-27 05:43:48 +0900 | [diff] [blame] | 12 | W5500, |
Akinobu Mita | 0c165ff | 2016-04-15 00:11:33 +0900 | [diff] [blame] | 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 | 35ef7d6 | 2016-04-27 05:43:48 +0900 | [diff] [blame] | 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, |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 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, |
Akinobu Mita | c3875ca | 2016-05-14 14:55:50 +0900 | [diff] [blame] | 32 | int sizeof_ops_priv, const void *mac_addr, int irq, |
| 33 | int link_gpio); |
Akinobu Mita | 850576c | 2016-04-15 00:11:30 +0900 | [diff] [blame] | 34 | int w5100_remove(struct device *dev); |
| 35 | |
| 36 | extern const struct dev_pm_ops w5100_pm_ops; |