#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/crc32.h>
#include <linux/mii.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/ethtool.h>
#include <linux/dm9000.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/io.h>
#include "dm9000.h"
#define DM9000_PHY …
#define CARDNAME …
static int watchdog = …;
module_param(watchdog, int, 0400);
MODULE_PARM_DESC(…) …;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
enum dm9000_type { … };
struct board_info { … };
#define dm9000_dbg(db, lev, msg...) …
static inline struct board_info *to_dm9000_board(struct net_device *dev)
{ … }
static u8
ior(struct board_info *db, int reg)
{ … }
static void
iow(struct board_info *db, int reg, int value)
{ … }
static void
dm9000_reset(struct board_info *db)
{ … }
static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
{ … }
static void dm9000_dumpblk_8bit(void __iomem *reg, int count)
{ … }
static void dm9000_dumpblk_16bit(void __iomem *reg, int count)
{ … }
static void dm9000_dumpblk_32bit(void __iomem *reg, int count)
{ … }
static void dm9000_msleep(struct board_info *db, unsigned int ms)
{ … }
static int
dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
{ … }
static void
dm9000_phy_write(struct net_device *dev,
int phyaddr_unused, int reg, int value)
{ … }
static void dm9000_set_io(struct board_info *db, int byte_width)
{ … }
static void dm9000_schedule_poll(struct board_info *db)
{ … }
static int dm9000_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{ … }
static unsigned int
dm9000_read_locked(struct board_info *db, int reg)
{ … }
static int dm9000_wait_eeprom(struct board_info *db)
{ … }
static void
dm9000_read_eeprom(struct board_info *db, int offset, u8 *to)
{ … }
static void
dm9000_write_eeprom(struct board_info *db, int offset, u8 *data)
{ … }
static void dm9000_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static u32 dm9000_get_msglevel(struct net_device *dev)
{ … }
static void dm9000_set_msglevel(struct net_device *dev, u32 value)
{ … }
static int dm9000_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int dm9000_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static int dm9000_nway_reset(struct net_device *dev)
{ … }
static int dm9000_set_features(struct net_device *dev,
netdev_features_t features)
{ … }
static u32 dm9000_get_link(struct net_device *dev)
{ … }
#define DM_EEPROM_MAGIC …
static int dm9000_get_eeprom_len(struct net_device *dev)
{ … }
static int dm9000_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *ee, u8 *data)
{ … }
static int dm9000_set_eeprom(struct net_device *dev,
struct ethtool_eeprom *ee, u8 *data)
{ … }
static void dm9000_get_wol(struct net_device *dev, struct ethtool_wolinfo *w)
{ … }
static int dm9000_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
{ … }
static const struct ethtool_ops dm9000_ethtool_ops = …;
static void dm9000_show_carrier(struct board_info *db,
unsigned carrier, unsigned nsr)
{ … }
static void
dm9000_poll_work(struct work_struct *w)
{ … }
static void
dm9000_release_board(struct platform_device *pdev, struct board_info *db)
{ … }
static unsigned char dm9000_type_to_char(enum dm9000_type type)
{ … }
static void
dm9000_hash_table_unlocked(struct net_device *dev)
{ … }
static void
dm9000_hash_table(struct net_device *dev)
{ … }
static void
dm9000_mask_interrupts(struct board_info *db)
{ … }
static void
dm9000_unmask_interrupts(struct board_info *db)
{ … }
static void
dm9000_init_dm9000(struct net_device *dev)
{ … }
static void dm9000_timeout(struct net_device *dev, unsigned int txqueue)
{ … }
static void dm9000_send_packet(struct net_device *dev,
int ip_summed,
u16 pkt_len)
{ … }
static netdev_tx_t
dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static void dm9000_tx_done(struct net_device *dev, struct board_info *db)
{ … }
struct dm9000_rxhdr { … } __packed;
static void
dm9000_rx(struct net_device *dev)
{ … }
static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
{ … }
static irqreturn_t dm9000_wol_interrupt(int irq, void *dev_id)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void dm9000_poll_controller(struct net_device *dev)
{ … }
#endif
static int
dm9000_open(struct net_device *dev)
{ … }
static void
dm9000_shutdown(struct net_device *dev)
{ … }
static int
dm9000_stop(struct net_device *ndev)
{ … }
static const struct net_device_ops dm9000_netdev_ops = …;
static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev)
{ … }
static int
dm9000_probe(struct platform_device *pdev)
{ … }
static int
dm9000_drv_suspend(struct device *dev)
{ … }
static int
dm9000_drv_resume(struct device *dev)
{ … }
static const struct dev_pm_ops dm9000_drv_pm_ops = …;
static void dm9000_drv_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id dm9000_of_matches[] = …;
MODULE_DEVICE_TABLE(of, dm9000_of_matches);
#endif
static struct platform_driver dm9000_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;