#define pr_fmt(fmt) …
#define DRV_NAME …
#define DRV_VERSION …
#define DRV_RELDATE …
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/compiler.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/gfp.h>
#include <linux/mii.h>
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/cache.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>
static char version[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
static int debug = …;
module_param(debug, int, 0);
MODULE_PARM_DESC(…) …;
static int multicast_filter_limit = …;
module_param(multicast_filter_limit, int, 0);
MODULE_PARM_DESC(…) …;
#define CP_DEF_MSG_ENABLE …
#define CP_NUM_STATS …
#define CP_STATS_SIZE …
#define CP_REGS_SIZE …
#define CP_REGS_VER …
#define CP_RX_RING_SIZE …
#define CP_TX_RING_SIZE …
#define CP_RING_BYTES …
#define NEXT_TX(N) …
#define NEXT_RX(N) …
#define TX_BUFFS_AVAIL(CP) …
#define PKT_BUF_SZ …
#define CP_INTERNAL_PHY …
#define RX_FIFO_THRESH …
#define RX_DMA_BURST …
#define TX_DMA_BURST …
#define TX_EARLY_THRESH …
#define TX_TIMEOUT …
#define CP_MIN_MTU …
#define CP_MAX_MTU …
enum { … };
static const unsigned int cp_rx_config = …;
struct cp_desc { … };
struct cp_dma_stats { … } __packed;
struct cp_extra_stats { … };
struct cp_private { … };
#define cpr8(reg) …
#define cpr16(reg) …
#define cpr32(reg) …
#define cpw8(reg,val) …
#define cpw16(reg,val) …
#define cpw32(reg,val) …
#define cpw8_f(reg,val) …
#define cpw16_f(reg,val) …
#define cpw32_f(reg,val) …
static void __cp_set_rx_mode (struct net_device *dev);
static void cp_tx (struct cp_private *cp);
static void cp_clean_rings (struct cp_private *cp);
#ifdef CONFIG_NET_POLL_CONTROLLER
static void cp_poll_controller(struct net_device *dev);
#endif
static int cp_get_eeprom_len(struct net_device *dev);
static int cp_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data);
static int cp_set_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data);
static struct { … } ethtool_stats_keys[] = …;
static inline void cp_set_rxbufsize (struct cp_private *cp)
{ … }
static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb,
struct cp_desc *desc)
{ … }
static void cp_rx_err_acct (struct cp_private *cp, unsigned rx_tail,
u32 status, u32 len)
{ … }
static inline unsigned int cp_rx_csum_ok (u32 status)
{ … }
static int cp_rx_poll(struct napi_struct *napi, int budget)
{ … }
static irqreturn_t cp_interrupt (int irq, void *dev_instance)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void cp_poll_controller(struct net_device *dev)
{ … }
#endif
static void cp_tx (struct cp_private *cp)
{ … }
static inline u32 cp_tx_vlan_tag(struct sk_buff *skb)
{ … }
static void unwind_tx_frag_mapping(struct cp_private *cp, struct sk_buff *skb,
int first, int entry_last)
{ … }
static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
struct net_device *dev)
{ … }
static void __cp_set_rx_mode (struct net_device *dev)
{ … }
static void cp_set_rx_mode (struct net_device *dev)
{ … }
static void __cp_get_stats(struct cp_private *cp)
{ … }
static struct net_device_stats *cp_get_stats(struct net_device *dev)
{ … }
static void cp_stop_hw (struct cp_private *cp)
{ … }
static void cp_reset_hw (struct cp_private *cp)
{ … }
static inline void cp_start_hw (struct cp_private *cp)
{ … }
static void cp_enable_irq(struct cp_private *cp)
{ … }
static void cp_init_hw (struct cp_private *cp)
{ … }
static int cp_refill_rx(struct cp_private *cp)
{ … }
static void cp_init_rings_index (struct cp_private *cp)
{ … }
static int cp_init_rings (struct cp_private *cp)
{ … }
static int cp_alloc_rings (struct cp_private *cp)
{ … }
static void cp_clean_rings (struct cp_private *cp)
{ … }
static void cp_free_rings (struct cp_private *cp)
{ … }
static int cp_open (struct net_device *dev)
{ … }
static int cp_close (struct net_device *dev)
{ … }
static void cp_tx_timeout(struct net_device *dev, unsigned int txqueue)
{ … }
static int cp_change_mtu(struct net_device *dev, int new_mtu)
{ … }
static const char mii_2_8139_map[8] = …;
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 location,
int value)
{ … }
static int netdev_set_wol (struct cp_private *cp,
const struct ethtool_wolinfo *wol)
{ … }
static void netdev_get_wol (struct cp_private *cp,
struct ethtool_wolinfo *wol)
{ … }
static void cp_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
{ … }
static void cp_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{ … }
static int cp_get_regs_len(struct net_device *dev)
{ … }
static int cp_get_sset_count (struct net_device *dev, int sset)
{ … }
static int cp_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int cp_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static int cp_nway_reset(struct net_device *dev)
{ … }
static u32 cp_get_msglevel(struct net_device *dev)
{ … }
static void cp_set_msglevel(struct net_device *dev, u32 value)
{ … }
static int cp_set_features(struct net_device *dev, netdev_features_t features)
{ … }
static void cp_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *p)
{ … }
static void cp_get_wol (struct net_device *dev, struct ethtool_wolinfo *wol)
{ … }
static int cp_set_wol (struct net_device *dev, struct ethtool_wolinfo *wol)
{ … }
static void cp_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
{ … }
static void cp_get_ethtool_stats (struct net_device *dev,
struct ethtool_stats *estats, u64 *tmp_stats)
{ … }
static const struct ethtool_ops cp_ethtool_ops = …;
static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{ … }
static int cp_set_mac_address(struct net_device *dev, void *p)
{ … }
#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_EXTEND_CMD …
#define EE_WRITE_CMD …
#define EE_READ_CMD …
#define EE_ERASE_CMD …
#define EE_EWDS_ADDR …
#define EE_WRAL_ADDR …
#define EE_ERAL_ADDR …
#define EE_EWEN_ADDR …
#define CP_EEPROM_MAGIC …
static void eeprom_cmd_start(void __iomem *ee_addr)
{ … }
static void eeprom_cmd(void __iomem *ee_addr, int cmd, int cmd_len)
{ … }
static void eeprom_cmd_end(void __iomem *ee_addr)
{ … }
static void eeprom_extend_cmd(void __iomem *ee_addr, int extend_cmd,
int addr_len)
{ … }
static u16 read_eeprom (void __iomem *ioaddr, int location, int addr_len)
{ … }
static void write_eeprom(void __iomem *ioaddr, int location, u16 val,
int addr_len)
{ … }
static int cp_get_eeprom_len(struct net_device *dev)
{ … }
static int cp_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data)
{ … }
static int cp_set_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data)
{ … }
static void cp_set_d3_state (struct cp_private *cp)
{ … }
static netdev_features_t cp_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{ … }
static const struct net_device_ops cp_netdev_ops = …;
static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void cp_remove_one (struct pci_dev *pdev)
{ … }
static int __maybe_unused cp_suspend(struct device *device)
{ … }
static int __maybe_unused cp_resume(struct device *device)
{ … }
static const struct pci_device_id cp_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, cp_pci_tbl);
static SIMPLE_DEV_PM_OPS(cp_pm_ops, cp_suspend, cp_resume);
static struct pci_driver cp_driver = …;
module_pci_driver(…) …;