Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Ethernet driver for the WIZnet W5100 chip.
0004  *
0005  * Copyright (C) 2006-2008 WIZnet Co.,Ltd.
0006  * Copyright (C) 2012 Mike Sinkovsky <msink@permonline.ru>
0007  */
0008 
0009 enum {
0010     W5100,
0011     W5200,
0012     W5500,
0013 };
0014 
0015 struct w5100_ops {
0016     bool may_sleep;
0017     int chip_id;
0018     int (*read)(struct net_device *ndev, u32 addr);
0019     int (*write)(struct net_device *ndev, u32 addr, u8 data);
0020     int (*read16)(struct net_device *ndev, u32 addr);
0021     int (*write16)(struct net_device *ndev, u32 addr, u16 data);
0022     int (*readbulk)(struct net_device *ndev, u32 addr, u8 *buf, int len);
0023     int (*writebulk)(struct net_device *ndev, u32 addr, const u8 *buf,
0024              int len);
0025     int (*reset)(struct net_device *ndev);
0026     int (*init)(struct net_device *ndev);
0027 };
0028 
0029 void *w5100_ops_priv(const struct net_device *ndev);
0030 
0031 int w5100_probe(struct device *dev, const struct w5100_ops *ops,
0032         int sizeof_ops_priv, const void *mac_addr, int irq,
0033         int link_gpio);
0034 void w5100_remove(struct device *dev);
0035 
0036 extern const struct dev_pm_ops w5100_pm_ops;