#define DRV_NAME …
#define DRV_VERSION …
#define DRV_RELDATE …
static int debug = …;
#define MAX_UNITS …
static int options[MAX_UNITS] = …;
static int full_duplex[MAX_UNITS] = …;
static int rx_copybreak;
#define TX_RING_SIZE …
#define TX_QUEUE_LEN …
#define RX_RING_SIZE …
#define TX_TOTAL_SIZE …
#define RX_TOTAL_SIZE …
#define TX_TIMEOUT …
#define PKT_BUF_SZ …
#define TX_FIFO_THRESH …
#define RX_FIFO_THRESH …
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <asm/io.h>
#include <linux/uaccess.h>
#include <asm/byteorder.h>
static char version[] = …;
static char version2[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param(debug, int, 0);
module_param(rx_copybreak, int, 0);
module_param_array(…);
module_param_array(…);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
enum chip_capability_flags { … };
#define EPIC_TOTAL_SIZE …
#define USE_IO_OPS …
#ifdef USE_IO_OPS
#define EPIC_BAR …
#else
#define EPIC_BAR …
#endif
chip_t;
struct epic_chip_info { … };
static const struct epic_chip_info pci_id_tbl[] = …;
static const struct pci_device_id epic_pci_tbl[] = …;
MODULE_DEVICE_TABLE (pci, epic_pci_tbl);
#define ew16(reg, val) …
#define ew32(reg, val) …
#define er8(reg) …
#define er16(reg) …
#define er32(reg) …
enum epic_registers { … };
enum IntrStatus { … };
enum CommandBits { … };
#define EpicRemoved …
#define EpicNapiEvent …
#define EpicNormalEvent …
static const u16 media2miictl[16] = …;
struct epic_tx_desc { … };
struct epic_rx_desc { … };
enum desc_status_bits { … };
#define PRIV_ALIGN …
struct epic_private { … };
static int epic_open(struct net_device *dev);
static int read_eeprom(struct epic_private *, int);
static int mdio_read(struct net_device *dev, int phy_id, int location);
static void mdio_write(struct net_device *dev, int phy_id, int loc, int val);
static void epic_restart(struct net_device *dev);
static void epic_timer(struct timer_list *t);
static void epic_tx_timeout(struct net_device *dev, unsigned int txqueue);
static void epic_init_ring(struct net_device *dev);
static netdev_tx_t epic_start_xmit(struct sk_buff *skb,
struct net_device *dev);
static int epic_rx(struct net_device *dev, int budget);
static int epic_poll(struct napi_struct *napi, int budget);
static irqreturn_t epic_interrupt(int irq, void *dev_instance);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static const struct ethtool_ops netdev_ethtool_ops;
static int epic_close(struct net_device *dev);
static struct net_device_stats *epic_get_stats(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
static const struct net_device_ops epic_netdev_ops = …;
static int epic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
#define EE_SHIFT_CLK …
#define EE_CS …
#define EE_DATA_WRITE …
#define EE_WRITE_0 …
#define EE_WRITE_1 …
#define EE_DATA_READ …
#define EE_ENB …
#define eeprom_delay() …
#define EE_WRITE_CMD …
#define EE_READ64_CMD …
#define EE_READ256_CMD …
#define EE_ERASE_CMD …
static void epic_disable_int(struct net_device *dev, struct epic_private *ep)
{ … }
static inline void __epic_pci_commit(void __iomem *ioaddr)
{ … }
static inline void epic_napi_irq_off(struct net_device *dev,
struct epic_private *ep)
{ … }
static inline void epic_napi_irq_on(struct net_device *dev,
struct epic_private *ep)
{ … }
static int read_eeprom(struct epic_private *ep, int location)
{ … }
#define MII_READOP …
#define MII_WRITEOP …
static int mdio_read(struct net_device *dev, int phy_id, int location)
{ … }
static void mdio_write(struct net_device *dev, int phy_id, int loc, int value)
{ … }
static int epic_open(struct net_device *dev)
{ … }
static void epic_pause(struct net_device *dev)
{ … }
static void epic_restart(struct net_device *dev)
{ … }
static void check_media(struct net_device *dev)
{ … }
static void epic_timer(struct timer_list *t)
{ … }
static void epic_tx_timeout(struct net_device *dev, unsigned int txqueue)
{ … }
static void epic_init_ring(struct net_device *dev)
{ … }
static netdev_tx_t epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static void epic_tx_error(struct net_device *dev, struct epic_private *ep,
int status)
{ … }
static void epic_tx(struct net_device *dev, struct epic_private *ep)
{ … }
static irqreturn_t epic_interrupt(int irq, void *dev_instance)
{ … }
static int epic_rx(struct net_device *dev, int budget)
{ … }
static void epic_rx_err(struct net_device *dev, struct epic_private *ep)
{ … }
static int epic_poll(struct napi_struct *napi, int budget)
{ … }
static int epic_close(struct net_device *dev)
{ … }
static struct net_device_stats *epic_get_stats(struct net_device *dev)
{ … }
static void set_rx_mode(struct net_device *dev)
{ … }
static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
{ … }
static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int netdev_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static int netdev_nway_reset(struct net_device *dev)
{ … }
static u32 netdev_get_link(struct net_device *dev)
{ … }
static u32 netdev_get_msglevel(struct net_device *dev)
{ … }
static void netdev_set_msglevel(struct net_device *dev, u32 value)
{ … }
static int ethtool_begin(struct net_device *dev)
{ … }
static void ethtool_complete(struct net_device *dev)
{ … }
static const struct ethtool_ops netdev_ethtool_ops = …;
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ … }
static void epic_remove_one(struct pci_dev *pdev)
{ … }
static int __maybe_unused epic_suspend(struct device *dev_d)
{ … }
static int __maybe_unused epic_resume(struct device *dev_d)
{ … }
static SIMPLE_DEV_PM_OPS(epic_pm_ops, epic_suspend, epic_resume);
static struct pci_driver epic_driver = …;
static int __init epic_init (void)
{ … }
static void __exit epic_cleanup (void)
{ … }
module_init(…) …;
module_exit(epic_cleanup);