blob: 9b1fa23b46fec02fb566515d0ea19031e5726db3 [file] [log] [blame]
Akinobu Mita850576c2016-04-15 00:11:30 +09001/*
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 Mita0c165ff2016-04-15 00:11:33 +090010enum {
11 W5100,
12 W5200,
13};
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 Mita850576c2016-04-15 00:11:30 +090018 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
29void *w5100_ops_priv(const struct net_device *ndev);
30
31int w5100_probe(struct device *dev, const struct w5100_ops *ops,
32 int sizeof_ops_priv, u8 *mac_addr, int irq, int link_gpio);
33int w5100_remove(struct device *dev);
34
35extern const struct dev_pm_ops w5100_pm_ops;