18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Ethernet driver for the WIZnet W5100 chip. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2006-2008 WIZnet Co.,Ltd. 68c2ecf20Sopenharmony_ci * Copyright (C) 2012 Mike Sinkovsky <msink@permonline.ru> 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cienum { 108c2ecf20Sopenharmony_ci W5100, 118c2ecf20Sopenharmony_ci W5200, 128c2ecf20Sopenharmony_ci W5500, 138c2ecf20Sopenharmony_ci}; 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistruct w5100_ops { 168c2ecf20Sopenharmony_ci bool may_sleep; 178c2ecf20Sopenharmony_ci int chip_id; 188c2ecf20Sopenharmony_ci int (*read)(struct net_device *ndev, u32 addr); 198c2ecf20Sopenharmony_ci int (*write)(struct net_device *ndev, u32 addr, u8 data); 208c2ecf20Sopenharmony_ci int (*read16)(struct net_device *ndev, u32 addr); 218c2ecf20Sopenharmony_ci int (*write16)(struct net_device *ndev, u32 addr, u16 data); 228c2ecf20Sopenharmony_ci int (*readbulk)(struct net_device *ndev, u32 addr, u8 *buf, int len); 238c2ecf20Sopenharmony_ci int (*writebulk)(struct net_device *ndev, u32 addr, const u8 *buf, 248c2ecf20Sopenharmony_ci int len); 258c2ecf20Sopenharmony_ci int (*reset)(struct net_device *ndev); 268c2ecf20Sopenharmony_ci int (*init)(struct net_device *ndev); 278c2ecf20Sopenharmony_ci}; 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_civoid *w5100_ops_priv(const struct net_device *ndev); 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciint w5100_probe(struct device *dev, const struct w5100_ops *ops, 328c2ecf20Sopenharmony_ci int sizeof_ops_priv, const void *mac_addr, int irq, 338c2ecf20Sopenharmony_ci int link_gpio); 348c2ecf20Sopenharmony_ciint w5100_remove(struct device *dev); 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ciextern const struct dev_pm_ops w5100_pm_ops; 37