#define pr_fmt(fmt) …
#define DRV_NAME …
#define DRV_RELDATE …
#define PFX …
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <asm/dma.h>
#include <asm/irq.h>
static const struct pci_device_id pcnet32_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, pcnet32_pci_tbl);
static int cards_found;
static unsigned int pcnet32_portlist[] = …;
static int pcnet32_debug;
static int tx_start = …;
static int pcnet32vlb;
static struct net_device *pcnet32_dev;
static int max_interrupt_work = …;
static int rx_copybreak = …;
#define PCNET32_PORT_AUI …
#define PCNET32_PORT_10BT …
#define PCNET32_PORT_GPSI …
#define PCNET32_PORT_MII …
#define PCNET32_PORT_PORTSEL …
#define PCNET32_PORT_ASEL …
#define PCNET32_PORT_100 …
#define PCNET32_PORT_FD …
#define PCNET32_DMA_MASK …
#define PCNET32_WATCHDOG_TIMEOUT …
#define PCNET32_BLINK_TIMEOUT …
static const unsigned char options_mapping[] = …;
static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = …;
#define PCNET32_TEST_LEN …
#define PCNET32_NUM_REGS …
#define MAX_UNITS …
static int options[MAX_UNITS];
static int full_duplex[MAX_UNITS];
static int homepna[MAX_UNITS];
#ifndef PCNET32_LOG_TX_BUFFERS
#define PCNET32_LOG_TX_BUFFERS …
#define PCNET32_LOG_RX_BUFFERS …
#define PCNET32_LOG_MAX_TX_BUFFERS …
#define PCNET32_LOG_MAX_RX_BUFFERS …
#endif
#define TX_RING_SIZE …
#define TX_MAX_RING_SIZE …
#define RX_RING_SIZE …
#define RX_MAX_RING_SIZE …
#define PKT_BUF_SKB …
#define PKT_BUF_SIZE …
#define NEG_BUF_SIZE …
#define PCNET32_WIO_RDP …
#define PCNET32_WIO_RAP …
#define PCNET32_WIO_RESET …
#define PCNET32_WIO_BDP …
#define PCNET32_DWIO_RDP …
#define PCNET32_DWIO_RAP …
#define PCNET32_DWIO_RESET …
#define PCNET32_DWIO_BDP …
#define PCNET32_TOTAL_SIZE …
#define CSR0 …
#define CSR0_INIT …
#define CSR0_START …
#define CSR0_STOP …
#define CSR0_TXPOLL …
#define CSR0_INTEN …
#define CSR0_IDON …
#define CSR0_NORMAL …
#define PCNET32_INIT_LOW …
#define PCNET32_INIT_HIGH …
#define CSR3 …
#define CSR4 …
#define CSR5 …
#define CSR5_SUSPEND …
#define CSR15 …
#define PCNET32_MC_FILTER …
#define PCNET32_79C970A …
struct pcnet32_rx_head { … };
struct pcnet32_tx_head { … };
struct pcnet32_init_block { … };
struct pcnet32_access { … };
struct pcnet32_private { … };
static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
static int pcnet32_probe1(unsigned long, int, struct pci_dev *);
static int pcnet32_open(struct net_device *);
static int pcnet32_init_ring(struct net_device *);
static netdev_tx_t pcnet32_start_xmit(struct sk_buff *,
struct net_device *);
static void pcnet32_tx_timeout(struct net_device *dev, unsigned int txqueue);
static irqreturn_t pcnet32_interrupt(int, void *);
static int pcnet32_close(struct net_device *);
static struct net_device_stats *pcnet32_get_stats(struct net_device *);
static void pcnet32_load_multicast(struct net_device *dev);
static void pcnet32_set_multicast_list(struct net_device *);
static int pcnet32_ioctl(struct net_device *, struct ifreq *, int);
static void pcnet32_watchdog(struct timer_list *);
static int mdio_read(struct net_device *dev, int phy_id, int reg_num);
static void mdio_write(struct net_device *dev, int phy_id, int reg_num,
int val);
static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits);
static void pcnet32_ethtool_test(struct net_device *dev,
struct ethtool_test *eth_test, u64 * data);
static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1);
static int pcnet32_get_regs_len(struct net_device *dev);
static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *ptr);
static void pcnet32_purge_tx_ring(struct net_device *dev);
static int pcnet32_alloc_ring(struct net_device *dev, const char *name);
static void pcnet32_free_ring(struct net_device *dev);
static void pcnet32_check_media(struct net_device *dev, int verbose);
static u16 pcnet32_wio_read_csr(unsigned long addr, int index)
{ … }
static void pcnet32_wio_write_csr(unsigned long addr, int index, u16 val)
{ … }
static u16 pcnet32_wio_read_bcr(unsigned long addr, int index)
{ … }
static void pcnet32_wio_write_bcr(unsigned long addr, int index, u16 val)
{ … }
static u16 pcnet32_wio_read_rap(unsigned long addr)
{ … }
static void pcnet32_wio_write_rap(unsigned long addr, u16 val)
{ … }
static void pcnet32_wio_reset(unsigned long addr)
{ … }
static int pcnet32_wio_check(unsigned long addr)
{ … }
static const struct pcnet32_access pcnet32_wio = …;
static u16 pcnet32_dwio_read_csr(unsigned long addr, int index)
{ … }
static void pcnet32_dwio_write_csr(unsigned long addr, int index, u16 val)
{ … }
static u16 pcnet32_dwio_read_bcr(unsigned long addr, int index)
{ … }
static void pcnet32_dwio_write_bcr(unsigned long addr, int index, u16 val)
{ … }
static u16 pcnet32_dwio_read_rap(unsigned long addr)
{ … }
static void pcnet32_dwio_write_rap(unsigned long addr, u16 val)
{ … }
static void pcnet32_dwio_reset(unsigned long addr)
{ … }
static int pcnet32_dwio_check(unsigned long addr)
{ … }
static const struct pcnet32_access pcnet32_dwio = …;
static void pcnet32_netif_stop(struct net_device *dev)
{ … }
static void pcnet32_netif_start(struct net_device *dev)
{ … }
static void pcnet32_realloc_tx_ring(struct net_device *dev,
struct pcnet32_private *lp,
unsigned int size)
{ … }
static void pcnet32_realloc_rx_ring(struct net_device *dev,
struct pcnet32_private *lp,
unsigned int size)
{ … }
static void pcnet32_purge_rx_ring(struct net_device *dev)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void pcnet32_poll_controller(struct net_device *dev)
{ … }
#endif
static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
int can_sleep)
{ … }
static void pcnet32_clr_suspend(struct pcnet32_private *lp, ulong ioaddr)
{ … }
static int pcnet32_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int pcnet32_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static void pcnet32_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static u32 pcnet32_get_link(struct net_device *dev)
{ … }
static u32 pcnet32_get_msglevel(struct net_device *dev)
{ … }
static void pcnet32_set_msglevel(struct net_device *dev, u32 value)
{ … }
static int pcnet32_nway_reset(struct net_device *dev)
{ … }
static void pcnet32_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{ … }
static int pcnet32_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{ … }
static void pcnet32_get_strings(struct net_device *dev, u32 stringset,
u8 *data)
{ … }
static int pcnet32_get_sset_count(struct net_device *dev, int sset)
{ … }
static void pcnet32_ethtool_test(struct net_device *dev,
struct ethtool_test *test, u64 * data)
{ … }
static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
{ … }
static int pcnet32_set_phys_id(struct net_device *dev,
enum ethtool_phys_id_state state)
{ … }
static void pcnet32_rx_entry(struct net_device *dev,
struct pcnet32_private *lp,
struct pcnet32_rx_head *rxp,
int entry)
{ … }
static int pcnet32_rx(struct net_device *dev, int budget)
{ … }
static int pcnet32_tx(struct net_device *dev)
{ … }
static int pcnet32_poll(struct napi_struct *napi, int budget)
{ … }
#define PCNET32_REGS_PER_PHY …
#define PCNET32_MAX_PHYS …
static int pcnet32_get_regs_len(struct net_device *dev)
{ … }
static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *ptr)
{ … }
static const struct ethtool_ops pcnet32_ethtool_ops = …;
static void pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
{ … }
static int
pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static const struct net_device_ops pcnet32_netdev_ops = …;
static int
pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
{ … }
static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
{ … }
static void pcnet32_free_ring(struct net_device *dev)
{ … }
static int pcnet32_open(struct net_device *dev)
{ … }
static void pcnet32_purge_tx_ring(struct net_device *dev)
{ … }
static int pcnet32_init_ring(struct net_device *dev)
{ … }
static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
{ … }
static void pcnet32_tx_timeout(struct net_device *dev, unsigned int txqueue)
{ … }
static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{ … }
static irqreturn_t
pcnet32_interrupt(int irq, void *dev_id)
{ … }
static int pcnet32_close(struct net_device *dev)
{ … }
static struct net_device_stats *pcnet32_get_stats(struct net_device *dev)
{ … }
static void pcnet32_load_multicast(struct net_device *dev)
{ … }
static void pcnet32_set_multicast_list(struct net_device *dev)
{ … }
static int mdio_read(struct net_device *dev, int phy_id, int reg_num)
{ … }
static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val)
{ … }
static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ … }
static int pcnet32_check_otherphy(struct net_device *dev)
{ … }
static void pcnet32_check_media(struct net_device *dev, int verbose)
{ … }
static void pcnet32_watchdog(struct timer_list *t)
{ … }
static int __maybe_unused pcnet32_pm_suspend(struct device *device_d)
{ … }
static int __maybe_unused pcnet32_pm_resume(struct device *device_d)
{ … }
static void pcnet32_remove_one(struct pci_dev *pdev)
{ … }
static SIMPLE_DEV_PM_OPS(pcnet32_pm_ops, pcnet32_pm_suspend, pcnet32_pm_resume);
static struct pci_driver pcnet32_driver = …;
static int debug = …;
static int tx_start_pt = …;
static int pcnet32_have_pci;
module_param(debug, int, 0);
MODULE_PARM_DESC(…) …;
module_param(max_interrupt_work, int, 0);
MODULE_PARM_DESC(…) …;
module_param(rx_copybreak, int, 0);
MODULE_PARM_DESC(…) …;
module_param(tx_start_pt, int, 0);
MODULE_PARM_DESC(…) …;
module_param(pcnet32vlb, int, 0);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define PCNET32_MSG_DEFAULT …
static int __init pcnet32_init_module(void)
{ … }
static void __exit pcnet32_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(pcnet32_cleanup_module);