#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/log2.h>
#include <linux/etherdevice.h>
#include <linux/mii.h>
#include "8390.h"
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/uaccess.h>
#define PCNET_CMD …
#define PCNET_DATAPORT …
#define PCNET_RESET …
#define PCNET_MISC …
#define PCNET_START_PG …
#define PCNET_STOP_PG …
#define SOCKET_START_PG …
#define SOCKET_STOP_PG …
#define PCNET_RDC_TIMEOUT …
static const char *if_names[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define INT_MODULE_PARM(n, v) …
INT_MODULE_PARM(if_port, 1);
INT_MODULE_PARM(use_big_buf, 1);
INT_MODULE_PARM(mem_speed, 0);
INT_MODULE_PARM(delay_output, 0);
INT_MODULE_PARM(delay_time, 4);
INT_MODULE_PARM(use_shmem, -1);
INT_MODULE_PARM(full_duplex, 0);
static int hw_addr[6] = …;
module_param_array(…);
static void mii_phy_probe(struct net_device *dev);
static int pcnet_config(struct pcmcia_device *link);
static void pcnet_release(struct pcmcia_device *link);
static int pcnet_open(struct net_device *dev);
static int pcnet_close(struct net_device *dev);
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
static void ei_watchdog(struct timer_list *t);
static void pcnet_reset_8390(struct net_device *dev);
static int set_config(struct net_device *dev, struct ifmap *map);
static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
int stop_pg, int cm_offset);
static int setup_dma_config(struct pcmcia_device *link, int start_pg,
int stop_pg);
static void pcnet_detach(struct pcmcia_device *p_dev);
struct hw_info { … };
#define DELAY_OUTPUT …
#define HAS_MISC_REG …
#define USE_BIG_BUF …
#define HAS_IBM_MISC …
#define IS_DL10019 …
#define IS_DL10022 …
#define HAS_MII …
#define USE_SHMEM …
#define AM79C9XX_HOME_PHY …
#define AM79C9XX_ETH_PHY …
#define MII_PHYID_REV_MASK …
#define MII_PHYID_REG1 …
#define MII_PHYID_REG2 …
static struct hw_info hw_info[] = …;
#define NR_INFO …
static struct hw_info default_info = …;
static struct hw_info dl10019_info = …;
static struct hw_info dl10022_info = …;
struct pcnet_dev { … };
static inline struct pcnet_dev *PRIV(struct net_device *dev)
{ … }
static const struct net_device_ops pcnet_netdev_ops = …;
static int pcnet_probe(struct pcmcia_device *link)
{ … }
static void pcnet_detach(struct pcmcia_device *link)
{ … }
static struct hw_info *get_hwinfo(struct pcmcia_device *link)
{ … }
static struct hw_info *get_prom(struct pcmcia_device *link)
{ … }
static struct hw_info *get_dl10019(struct pcmcia_device *link)
{ … }
static struct hw_info *get_ax88190(struct pcmcia_device *link)
{ … }
static struct hw_info *get_hwired(struct pcmcia_device *link)
{ … }
static int try_io_port(struct pcmcia_device *link)
{ … }
static int pcnet_confcheck(struct pcmcia_device *p_dev, void *priv_data)
{ … }
static struct hw_info *pcnet_try_config(struct pcmcia_device *link,
int *has_shmem, int try)
{ … }
static int pcnet_config(struct pcmcia_device *link)
{ … }
static void pcnet_release(struct pcmcia_device *link)
{ … }
static int pcnet_suspend(struct pcmcia_device *link)
{ … }
static int pcnet_resume(struct pcmcia_device *link)
{ … }
#define DLINK_GPIO …
#define DLINK_DIAG …
#define DLINK_EEPROM …
#define MDIO_SHIFT_CLK …
#define MDIO_DATA_OUT …
#define MDIO_DIR_WRITE …
#define MDIO_DATA_WRITE0 …
#define MDIO_DATA_WRITE1 …
#define MDIO_DATA_READ …
#define MDIO_MASK …
static void mdio_sync(unsigned int addr)
{ … }
static int mdio_read(unsigned int addr, int phy_id, int loc)
{ … }
static void mdio_write(unsigned int addr, int phy_id, int loc, int value)
{ … }
#define EE_EEP …
#define EE_ASIC …
#define EE_CS …
#define EE_CK …
#define EE_DO …
#define EE_DI …
#define EE_ADOT …
#define EE_READ_CMD …
#define DL19FDUPLX …
static int read_eeprom(unsigned int ioaddr, int location)
{ … }
static void write_asic(unsigned int ioaddr, int location, short asic_data)
{ … }
static void set_misc_reg(struct net_device *dev)
{ … }
static void mii_phy_probe(struct net_device *dev)
{ … }
static int pcnet_open(struct net_device *dev)
{ … }
static int pcnet_close(struct net_device *dev)
{ … }
static void pcnet_reset_8390(struct net_device *dev)
{ … }
static int set_config(struct net_device *dev, struct ifmap *map)
{ … }
static irqreturn_t ei_irq_wrapper(int irq, void *dev_id)
{ … }
static void ei_watchdog(struct timer_list *t)
{ … }
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ … }
static void dma_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr,
int ring_page)
{ … }
static void dma_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset)
{ … }
static void dma_block_output(struct net_device *dev, int count,
const u_char *buf, const int start_page)
{ … }
static int setup_dma_config(struct pcmcia_device *link, int start_pg,
int stop_pg)
{ … }
static void copyin(void *dest, void __iomem *src, int c)
{ … }
static void copyout(void __iomem *dest, const void *src, int c)
{ … }
static void shmem_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr,
int ring_page)
{ … }
static void shmem_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset)
{ … }
static void shmem_block_output(struct net_device *dev, int count,
const u_char *buf, const int start_page)
{ … }
static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
int stop_pg, int cm_offset)
{ … }
static const struct pcmcia_device_id pcnet_ids[] = …;
MODULE_DEVICE_TABLE(pcmcia, pcnet_ids);
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;
static struct pcmcia_driver pcnet_driver = …;
module_pcmcia_driver(…);