#define pr_fmt(fmt) …
#define DRV_NAME …
#define DRV_RELDATE …
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/compiler.h>
#include <linux/rtnetlink.h>
#include <linux/crc32.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int debug = …;
module_param (debug, int, 0);
MODULE_PARM_DESC(…) …;
#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \
defined(CONFIG_SPARC) || defined(__ia64__) || \
defined(__sh__) || defined(__mips__)
static int rx_copybreak = 1518;
#else
static int rx_copybreak = …;
#endif
module_param (rx_copybreak, int, 0);
MODULE_PARM_DESC(…) …;
#define DE_DEF_MSG_ENABLE …
#ifndef CONFIG_DE2104X_DSL
#define DSL …
#else
#define DSL …
#endif
#define DE_RX_RING_SIZE …
#define DE_TX_RING_SIZE …
#define DE_RING_BYTES …
#define NEXT_TX(N) …
#define NEXT_RX(N) …
#define TX_BUFFS_AVAIL(CP) …
#define PKT_BUF_SZ …
#define RX_OFFSET …
#define DE_SETUP_SKB …
#define DE_DUMMY_SKB …
#define DE_SETUP_FRAME_WORDS …
#define DE_EEPROM_WORDS …
#define DE_EEPROM_SIZE …
#define DE_MAX_MEDIA …
#define DE_MEDIA_TP_AUTO …
#define DE_MEDIA_BNC …
#define DE_MEDIA_AUI …
#define DE_MEDIA_TP …
#define DE_MEDIA_TP_FD …
#define DE_MEDIA_INVALID …
#define DE_MEDIA_FIRST …
#define DE_MEDIA_LAST …
#define DE_AUI_BNC …
#define DE_TIMER_LINK …
#define DE_TIMER_NO_LINK …
#define DE_NUM_REGS …
#define DE_REGS_SIZE …
#define DE_REGS_VER …
#define TX_TIMEOUT …
#define FULL_DUPLEX_MAGIC …
enum { … };
static const u32 de_intr_mask = …;
static const u32 de_bus_mode = …;
struct de_srom_media_block { … } __packed;
struct de_srom_info_leaf { … } __packed;
struct de_desc { … };
struct media_info { … };
struct ring_info { … };
struct de_private { … };
static void de_set_rx_mode (struct net_device *dev);
static void de_tx (struct de_private *de);
static void de_clean_rings (struct de_private *de);
static void de_media_interrupt (struct de_private *de, u32 status);
static void de21040_media_timer (struct timer_list *t);
static void de21041_media_timer (struct timer_list *t);
static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media);
static const struct pci_device_id de_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, de_pci_tbl);
static const char * const media_name[DE_MAX_MEDIA] = …;
static u16 t21040_csr13[] = …;
static u16 t21040_csr14[] = …;
static u16 t21040_csr15[] = …;
static u16 t21041_csr13[] = …;
static u16 t21041_csr14[] = …;
static u16 t21041_csr14_brk[] = …;
static u16 t21041_csr15[] = …;
#define dr32(reg) …
#define dw32(reg, val) …
static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
u32 status, u32 len)
{ … }
static void de_rx (struct de_private *de)
{ … }
static irqreturn_t de_interrupt (int irq, void *dev_instance)
{ … }
static void de_tx (struct de_private *de)
{ … }
static netdev_tx_t de_start_xmit (struct sk_buff *skb,
struct net_device *dev)
{ … }
static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
{ … }
static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
{ … }
static void __de_set_rx_mode (struct net_device *dev)
{ … }
static void de_set_rx_mode (struct net_device *dev)
{ … }
static inline void de_rx_missed(struct de_private *de, u32 rx_missed)
{ … }
static void __de_get_stats(struct de_private *de)
{ … }
static struct net_device_stats *de_get_stats(struct net_device *dev)
{ … }
static inline int de_is_running (struct de_private *de)
{ … }
static void de_stop_rxtx (struct de_private *de)
{ … }
static inline void de_start_rxtx (struct de_private *de)
{ … }
static void de_stop_hw (struct de_private *de)
{ … }
static void de_link_up(struct de_private *de)
{ … }
static void de_link_down(struct de_private *de)
{ … }
static void de_set_media (struct de_private *de)
{ … }
static void de_next_media (struct de_private *de, const u32 *media,
unsigned int n_media)
{ … }
static void de21040_media_timer (struct timer_list *t)
{ … }
static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media)
{ … }
static void de21041_media_timer (struct timer_list *t)
{ … }
static void de_media_interrupt (struct de_private *de, u32 status)
{ … }
static int de_reset_mac (struct de_private *de)
{ … }
static void de_adapter_wake (struct de_private *de)
{ … }
static void de_adapter_sleep (struct de_private *de)
{ … }
static int de_init_hw (struct de_private *de)
{ … }
static int de_refill_rx (struct de_private *de)
{ … }
static int de_init_rings (struct de_private *de)
{ … }
static int de_alloc_rings (struct de_private *de)
{ … }
static void de_clean_rings (struct de_private *de)
{ … }
static void de_free_rings (struct de_private *de)
{ … }
static int de_open (struct net_device *dev)
{ … }
static int de_close (struct net_device *dev)
{ … }
static void de_tx_timeout (struct net_device *dev, unsigned int txqueue)
{ … }
static void __de_get_regs(struct de_private *de, u8 *buf)
{ … }
static void __de_get_link_ksettings(struct de_private *de,
struct ethtool_link_ksettings *cmd)
{ … }
static int __de_set_link_ksettings(struct de_private *de,
const struct ethtool_link_ksettings *cmd)
{ … }
static void de_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info)
{ … }
static int de_get_regs_len(struct net_device *dev)
{ … }
static int de_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int de_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static u32 de_get_msglevel(struct net_device *dev)
{ … }
static void de_set_msglevel(struct net_device *dev, u32 msglvl)
{ … }
static int de_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data)
{ … }
static int de_nway_reset(struct net_device *dev)
{ … }
static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *data)
{ … }
static const struct ethtool_ops de_ethtool_ops = …;
static void de21040_get_mac_address(struct de_private *de)
{ … }
static void de21040_get_media_info(struct de_private *de)
{ … }
static unsigned tulip_read_eeprom(void __iomem *regs, int location,
int addr_len)
{ … }
static void de21041_get_srom_info(struct de_private *de)
{ … }
static const struct net_device_ops de_netdev_ops = …;
static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void de_remove_one(struct pci_dev *pdev)
{ … }
static int __maybe_unused de_suspend(struct device *dev_d)
{ … }
static int __maybe_unused de_resume(struct device *dev_d)
{ … }
static SIMPLE_DEV_PM_OPS(de_pm_ops, de_suspend, de_resume);
static void de_shutdown(struct pci_dev *pdev)
{ … }
static struct pci_driver de_driver = …;
module_pci_driver(…) …;