#define pr_fmt(fmt) …
#define DRV_NAME …
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/uaccess.h>
#include <asm/irq.h>
#ifdef CONFIG_TULIP_DM910X
#include <linux/of.h>
#endif
#define PCI_DM9132_ID …
#define PCI_DM9102_ID …
#define PCI_DM9100_ID …
#define PCI_DM9009_ID …
#define DM9102_IO_SIZE …
#define DM9102A_IO_SIZE …
#define TX_MAX_SEND_CNT …
#define TX_DESC_CNT …
#define RX_DESC_CNT …
#define TX_FREE_DESC_CNT …
#define TX_WAKE_DESC_CNT …
#define DESC_ALL_CNT …
#define TX_BUF_ALLOC …
#define RX_ALLOC_SIZE …
#define DM910X_RESET …
#define CR0_DEFAULT …
#define CR6_DEFAULT …
#define CR7_DEFAULT …
#define CR15_DEFAULT …
#define TDES0_ERR_MASK …
#define MAX_PACKET_SIZE …
#define DMFE_MAX_MULTICAST …
#define RX_COPY_SIZE …
#define MAX_CHECK_PACKET …
#define DM9801_NOISE_FLOOR …
#define DM9802_NOISE_FLOOR …
#define DMFE_WOL_LINKCHANGE …
#define DMFE_WOL_SAMPLEPACKET …
#define DMFE_WOL_MAGICPACKET …
#define DMFE_10MHF …
#define DMFE_100MHF …
#define DMFE_10MFD …
#define DMFE_100MFD …
#define DMFE_AUTO …
#define DMFE_1M_HPNA …
#define DMFE_TXTH_72 …
#define DMFE_TXTH_96 …
#define DMFE_TXTH_128 …
#define DMFE_TXTH_256 …
#define DMFE_TXTH_512 …
#define DMFE_TXTH_1K …
#define DMFE_TIMER_WUT …
#define DMFE_TX_TIMEOUT …
#define DMFE_TX_KICK …
#define dw32(reg, val) …
#define dw16(reg, val) …
#define dr32(reg) …
#define dr16(reg) …
#define dr8(reg) …
#define DMFE_DBUG(dbug_now, msg, value) …
#define SHOW_MEDIA_TYPE(mode) …
#define CR9_SROM_READ …
#define CR9_SRCS …
#define CR9_SRCLK …
#define CR9_CRDOUT …
#define SROM_DATA_0 …
#define SROM_DATA_1 …
#define PHY_DATA_1 …
#define PHY_DATA_0 …
#define MDCLKH …
#define PHY_POWER_DOWN …
#define SROM_V41_CODE …
#define __CHK_IO_SIZE(pci_id, dev_rev) …
#define CHK_IO_SIZE(pci_dev) …
struct tx_desc { … } __attribute__(( aligned … ));
struct rx_desc { … } __attribute__(( aligned … ));
struct dmfe_board_info { … };
enum dmfe_offsets { … };
enum dmfe_CR6_bits { … };
static int dmfe_debug;
static unsigned char dmfe_media_mode = …;
static u32 dmfe_cr6_user_set;
static int debug;
static u32 cr6set;
static unsigned char mode = …;
static u8 chkmode = …;
static u8 HPNA_mode;
static u8 HPNA_rx_cmd;
static u8 HPNA_tx_cmd;
static u8 HPNA_NoiseFloor;
static u8 SF_mode;
static int dmfe_open(struct net_device *);
static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct net_device *);
static int dmfe_stop(struct net_device *);
static void dmfe_set_filter_mode(struct net_device *);
static const struct ethtool_ops netdev_ethtool_ops;
static u16 read_srom_word(void __iomem *, int);
static irqreturn_t dmfe_interrupt(int , void *);
#ifdef CONFIG_NET_POLL_CONTROLLER
static void poll_dmfe (struct net_device *dev);
#endif
static void dmfe_descriptor_init(struct net_device *);
static void allocate_rx_buffer(struct net_device *);
static void update_cr6(u32, void __iomem *);
static void send_filter_frame(struct net_device *);
static void dm9132_id_table(struct net_device *);
static u16 dmfe_phy_read(void __iomem *, u8, u8, u32);
static void dmfe_phy_write(void __iomem *, u8, u8, u16, u32);
static void dmfe_phy_write_1bit(void __iomem *, u32);
static u16 dmfe_phy_read_1bit(void __iomem *);
static u8 dmfe_sense_speed(struct dmfe_board_info *);
static void dmfe_process_mode(struct dmfe_board_info *);
static void dmfe_timer(struct timer_list *);
static inline u32 cal_CRC(unsigned char *, unsigned int, u8);
static void dmfe_rx_packet(struct net_device *, struct dmfe_board_info *);
static void dmfe_free_tx_pkt(struct net_device *, struct dmfe_board_info *);
static void dmfe_reuse_skb(struct dmfe_board_info *, struct sk_buff *);
static void dmfe_dynamic_reset(struct net_device *);
static void dmfe_free_rxbuffer(struct dmfe_board_info *);
static void dmfe_init_dm910x(struct net_device *);
static void dmfe_parse_srom(struct dmfe_board_info *);
static void dmfe_program_DM9801(struct dmfe_board_info *, int);
static void dmfe_program_DM9802(struct dmfe_board_info *);
static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * );
static void dmfe_set_phyxcer(struct dmfe_board_info *);
static const struct net_device_ops netdev_ops = …;
static int dmfe_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void dmfe_remove_one(struct pci_dev *pdev)
{ … }
static int dmfe_open(struct net_device *dev)
{ … }
static void dmfe_init_dm910x(struct net_device *dev)
{ … }
static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{ … }
static int dmfe_stop(struct net_device *dev)
{ … }
static irqreturn_t dmfe_interrupt(int irq, void *dev_id)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void poll_dmfe (struct net_device *dev)
{ … }
#endif
static void dmfe_free_tx_pkt(struct net_device *dev, struct dmfe_board_info *db)
{ … }
static inline u32 cal_CRC(unsigned char * Data, unsigned int Len, u8 flag)
{ … }
static void dmfe_rx_packet(struct net_device *dev, struct dmfe_board_info *db)
{ … }
static void dmfe_set_filter_mode(struct net_device *dev)
{ … }
static void dmfe_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static int dmfe_ethtool_set_wol(struct net_device *dev,
struct ethtool_wolinfo *wolinfo)
{ … }
static void dmfe_ethtool_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wolinfo)
{ … }
static const struct ethtool_ops netdev_ethtool_ops = …;
static void dmfe_timer(struct timer_list *t)
{ … }
static void dmfe_dynamic_reset(struct net_device *dev)
{ … }
static void dmfe_free_rxbuffer(struct dmfe_board_info * db)
{ … }
static void dmfe_reuse_skb(struct dmfe_board_info *db, struct sk_buff * skb)
{ … }
static void dmfe_descriptor_init(struct net_device *dev)
{ … }
static void update_cr6(u32 cr6_data, void __iomem *ioaddr)
{ … }
static void dm9132_id_table(struct net_device *dev)
{ … }
static void send_filter_frame(struct net_device *dev)
{ … }
static void allocate_rx_buffer(struct net_device *dev)
{ … }
static void srom_clk_write(void __iomem *ioaddr, u32 data)
{ … }
static u16 read_srom_word(void __iomem *ioaddr, int offset)
{ … }
static u8 dmfe_sense_speed(struct dmfe_board_info *db)
{ … }
static void dmfe_set_phyxcer(struct dmfe_board_info *db)
{ … }
static void dmfe_process_mode(struct dmfe_board_info *db)
{ … }
static void dmfe_phy_write(void __iomem *ioaddr, u8 phy_addr, u8 offset,
u16 phy_data, u32 chip_id)
{ … }
static u16 dmfe_phy_read(void __iomem *ioaddr, u8 phy_addr, u8 offset, u32 chip_id)
{ … }
static void dmfe_phy_write_1bit(void __iomem *ioaddr, u32 phy_data)
{ … }
static u16 dmfe_phy_read_1bit(void __iomem *ioaddr)
{ … }
static void dmfe_parse_srom(struct dmfe_board_info * db)
{ … }
static void dmfe_program_DM9801(struct dmfe_board_info * db, int HPNA_rev)
{ … }
static void dmfe_program_DM9802(struct dmfe_board_info * db)
{ … }
static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * db)
{ … }
static const struct pci_device_id dmfe_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl);
static int __maybe_unused dmfe_suspend(struct device *dev_d)
{ … }
static int __maybe_unused dmfe_resume(struct device *dev_d)
{ … }
static SIMPLE_DEV_PM_OPS(dmfe_pm_ops, dmfe_suspend, dmfe_resume);
static struct pci_driver dmfe_driver = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param(debug, int, 0);
module_param(mode, byte, 0);
module_param(cr6set, int, 0);
module_param(chkmode, byte, 0);
module_param(HPNA_mode, byte, 0);
module_param(HPNA_rx_cmd, byte, 0);
module_param(HPNA_tx_cmd, byte, 0);
module_param(HPNA_NoiseFloor, byte, 0);
module_param(SF_mode, byte, 0);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
static int __init dmfe_init_module(void)
{ … }
static void __exit dmfe_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(dmfe_cleanup_module);