blob: 5d3d4b541fec452e75e49bd8f9a920257c05f1ad [file] [log] [blame]
Thomas Gleixner80503b22019-05-24 12:04:09 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Akinobu Mita850576c2016-04-15 00:11:30 +09002/*
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 Mita850576c2016-04-15 00:11:30 +09007 */
8
Akinobu Mita0c165ff2016-04-15 00:11:33 +09009enum {
10 W5100,
11 W5200,
Akinobu Mita35ef7d62016-04-27 05:43:48 +090012 W5500,
Akinobu Mita0c165ff2016-04-15 00:11:33 +090013};
14
Akinobu Mita850576c2016-04-15 00:11:30 +090015struct w5100_ops {
Akinobu Mitabf2c6b902016-04-15 00:11:31 +090016 bool may_sleep;
Akinobu Mita0c165ff2016-04-15 00:11:33 +090017 int chip_id;
Akinobu Mita35ef7d62016-04-27 05:43:48 +090018 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 Mita850576c2016-04-15 00:11:30 +090024 int len);
25 int (*reset)(struct net_device *ndev);
26 int (*init)(struct net_device *ndev);
27};
28
29void *w5100_ops_priv(const struct net_device *ndev);
30
31int w5100_probe(struct device *dev, const struct w5100_ops *ops,
Akinobu Mitac3875ca2016-05-14 14:55:50 +090032 int sizeof_ops_priv, const void *mac_addr, int irq,
33 int link_gpio);
Akinobu Mita850576c2016-04-15 00:11:30 +090034int w5100_remove(struct device *dev);
35
36extern const struct dev_pm_ops w5100_pm_ops;