#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/irq.h>
#include <linux/mii.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
#include <linux/regmap.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/spi/spi.h>
#include <linux/types.h>
#include "dm9051.h"
#define DRVNAME_9051 …
struct rx_ctl_mach { … };
struct dm9051_rxctrl { … };
struct dm9051_rxhdr { … };
struct board_info { … };
static int dm9051_set_reg(struct board_info *db, unsigned int reg, unsigned int val)
{ … }
static int dm9051_update_bits(struct board_info *db, unsigned int reg, unsigned int mask,
unsigned int val)
{ … }
static int dm9051_dumpblk(struct board_info *db, u8 reg, size_t count)
{ … }
static int dm9051_set_regs(struct board_info *db, unsigned int reg, const void *val,
size_t val_count)
{ … }
static int dm9051_get_regs(struct board_info *db, unsigned int reg, void *val,
size_t val_count)
{ … }
static int dm9051_write_mem(struct board_info *db, unsigned int reg, const void *buff,
size_t len)
{ … }
static int dm9051_read_mem(struct board_info *db, unsigned int reg, void *buff,
size_t len)
{ … }
static int dm9051_nsr_poll(struct board_info *db)
{ … }
static int dm9051_epcr_poll(struct board_info *db)
{ … }
static int dm9051_irq_flag(struct board_info *db)
{ … }
static unsigned int dm9051_intcr_value(struct board_info *db)
{ … }
static int dm9051_set_fcr(struct board_info *db)
{ … }
static int dm9051_set_recv(struct board_info *db)
{ … }
static int dm9051_core_reset(struct board_info *db)
{ … }
static int dm9051_update_fcr(struct board_info *db)
{ … }
static int dm9051_disable_interrupt(struct board_info *db)
{ … }
static int dm9051_enable_interrupt(struct board_info *db)
{ … }
static int dm9051_stop_mrcmd(struct board_info *db)
{ … }
static int dm9051_clear_interrupt(struct board_info *db)
{ … }
static int dm9051_eeprom_read(struct board_info *db, int offset, u8 *to)
{ … }
static int dm9051_eeprom_write(struct board_info *db, int offset, u8 *data)
{ … }
static int dm9051_phyread(void *context, unsigned int reg, unsigned int *val)
{ … }
static int dm9051_phywrite(void *context, unsigned int reg, unsigned int val)
{ … }
static int dm9051_mdio_read(struct mii_bus *bus, int addr, int regnum)
{ … }
static int dm9051_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
{ … }
static void dm9051_reg_lock_mutex(void *dbcontext)
{ … }
static void dm9051_reg_unlock_mutex(void *dbcontext)
{ … }
static struct regmap_config regconfigdm = …;
static struct regmap_config regconfigdmbulk = …;
static int dm9051_map_init(struct spi_device *spi, struct board_info *db)
{ … }
static int dm9051_map_chipid(struct board_info *db)
{ … }
static int dm9051_map_etherdev_par(struct net_device *ndev, struct board_info *db)
{ … }
static void dm9051_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ … }
static void dm9051_set_msglevel(struct net_device *ndev, u32 value)
{ … }
static u32 dm9051_get_msglevel(struct net_device *ndev)
{ … }
static int dm9051_get_eeprom_len(struct net_device *dev)
{ … }
static int dm9051_get_eeprom(struct net_device *ndev,
struct ethtool_eeprom *ee, u8 *data)
{ … }
static int dm9051_set_eeprom(struct net_device *ndev,
struct ethtool_eeprom *ee, u8 *data)
{ … }
static void dm9051_get_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{ … }
static int dm9051_set_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{ … }
static const struct ethtool_ops dm9051_ethtool_ops = …;
static int dm9051_all_start(struct board_info *db)
{ … }
static int dm9051_all_stop(struct board_info *db)
{ … }
static int dm9051_all_restart(struct board_info *db)
{ … }
static int dm9051_loop_rx(struct board_info *db)
{ … }
static int dm9051_single_tx(struct board_info *db, u8 *buff, unsigned int len)
{ … }
static int dm9051_loop_tx(struct board_info *db)
{ … }
static irqreturn_t dm9051_rx_threaded_irq(int irq, void *pw)
{ … }
static void dm9051_tx_delay(struct work_struct *work)
{ … }
static void dm9051_rxctl_delay(struct work_struct *work)
{ … }
static int dm9051_open(struct net_device *ndev)
{ … }
static int dm9051_stop(struct net_device *ndev)
{ … }
static netdev_tx_t dm9051_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{ … }
static void dm9051_set_rx_mode(struct net_device *ndev)
{ … }
static int dm9051_set_mac_address(struct net_device *ndev, void *p)
{ … }
static const struct net_device_ops dm9051_netdev_ops = …;
static void dm9051_operation_clear(struct board_info *db)
{ … }
static int dm9051_mdio_register(struct board_info *db)
{ … }
static void dm9051_handle_link_change(struct net_device *ndev)
{ … }
static int dm9051_phy_connect(struct board_info *db)
{ … }
static int dm9051_probe(struct spi_device *spi)
{ … }
static void dm9051_drv_remove(struct spi_device *spi)
{ … }
static const struct of_device_id dm9051_match_table[] = …;
MODULE_DEVICE_TABLE(of, dm9051_match_table);
static const struct spi_device_id dm9051_id_table[] = …;
static struct spi_driver dm9051_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;