#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/spi/spi.h>
#include "w5100.h"
#define W5100_SPI_WRITE_OPCODE …
#define W5100_SPI_READ_OPCODE …
static int w5100_spi_read(struct net_device *ndev, u32 addr)
{ … }
static int w5100_spi_write(struct net_device *ndev, u32 addr, u8 data)
{ … }
static int w5100_spi_read16(struct net_device *ndev, u32 addr)
{ … }
static int w5100_spi_write16(struct net_device *ndev, u32 addr, u16 data)
{ … }
static int w5100_spi_readbulk(struct net_device *ndev, u32 addr, u8 *buf,
int len)
{ … }
static int w5100_spi_writebulk(struct net_device *ndev, u32 addr, const u8 *buf,
int len)
{ … }
static const struct w5100_ops w5100_spi_ops = …;
#define W5200_SPI_WRITE_OPCODE …
struct w5200_spi_priv { … };
static struct w5200_spi_priv *w5200_spi_priv(struct net_device *ndev)
{ … }
static int w5200_spi_init(struct net_device *ndev)
{ … }
static int w5200_spi_read(struct net_device *ndev, u32 addr)
{ … }
static int w5200_spi_write(struct net_device *ndev, u32 addr, u8 data)
{ … }
static int w5200_spi_read16(struct net_device *ndev, u32 addr)
{ … }
static int w5200_spi_write16(struct net_device *ndev, u32 addr, u16 data)
{ … }
static int w5200_spi_readbulk(struct net_device *ndev, u32 addr, u8 *buf,
int len)
{ … }
static int w5200_spi_writebulk(struct net_device *ndev, u32 addr, const u8 *buf,
int len)
{ … }
static const struct w5100_ops w5200_ops = …;
#define W5500_SPI_BLOCK_SELECT(addr) …
#define W5500_SPI_READ_CONTROL(addr) …
#define W5500_SPI_WRITE_CONTROL(addr) …
struct w5500_spi_priv { … };
static struct w5500_spi_priv *w5500_spi_priv(struct net_device *ndev)
{ … }
static int w5500_spi_init(struct net_device *ndev)
{ … }
static int w5500_spi_read(struct net_device *ndev, u32 addr)
{ … }
static int w5500_spi_write(struct net_device *ndev, u32 addr, u8 data)
{ … }
static int w5500_spi_read16(struct net_device *ndev, u32 addr)
{ … }
static int w5500_spi_write16(struct net_device *ndev, u32 addr, u16 data)
{ … }
static int w5500_spi_readbulk(struct net_device *ndev, u32 addr, u8 *buf,
int len)
{ … }
static int w5500_spi_writebulk(struct net_device *ndev, u32 addr, const u8 *buf,
int len)
{ … }
static const struct w5100_ops w5500_ops = …;
static const struct of_device_id w5100_of_match[] = …;
MODULE_DEVICE_TABLE(of, w5100_of_match);
static int w5100_spi_probe(struct spi_device *spi)
{ … }
static void w5100_spi_remove(struct spi_device *spi)
{ … }
static const struct spi_device_id w5100_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, w5100_spi_ids);
static struct spi_driver w5100_spi_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;