#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/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.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/dma-mapping.h>
#include <linux/bitops.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/uaccess.h>
#define uw32(reg, val) …
#define ur32(reg) …
#define PCI_ULI5261_ID …
#define PCI_ULI5263_ID …
#define ULI526X_IO_SIZE …
#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 ULI526X_RESET …
#define CR0_DEFAULT …
#define CR6_DEFAULT …
#define CR7_DEFAULT …
#define CR15_DEFAULT …
#define TDES0_ERR_MASK …
#define MAX_PACKET_SIZE …
#define ULI5261_MAX_MULTICAST …
#define RX_COPY_SIZE …
#define MAX_CHECK_PACKET …
#define ULI526X_10MHF …
#define ULI526X_100MHF …
#define ULI526X_10MFD …
#define ULI526X_100MFD …
#define ULI526X_AUTO …
#define ULI526X_TXTH_72 …
#define ULI526X_TXTH_96 …
#define ULI526X_TXTH_128 …
#define ULI526X_TXTH_256 …
#define ULI526X_TXTH_512 …
#define ULI526X_TXTH_1K …
#define ULI526X_TIMER_WUT …
#define ULI526X_TX_TIMEOUT …
#define ULI526X_TX_KICK …
#define ULI526X_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 …
struct tx_desc { … } __attribute__(( aligned … ));
struct rx_desc { … } __attribute__(( aligned … ));
struct uli526x_board_info { … };
enum uli526x_offsets { … };
enum uli526x_CR6_bits { … };
static int uli526x_debug;
static unsigned char uli526x_media_mode = …;
static u32 uli526x_cr6_user_set;
static int debug;
static u32 cr6set;
static int mode = …;
static int uli526x_open(struct net_device *);
static netdev_tx_t uli526x_start_xmit(struct sk_buff *,
struct net_device *);
static int uli526x_stop(struct net_device *);
static void uli526x_set_filter_mode(struct net_device *);
static const struct ethtool_ops netdev_ethtool_ops;
static u16 read_srom_word(struct uli526x_board_info *, int);
static irqreturn_t uli526x_interrupt(int, void *);
#ifdef CONFIG_NET_POLL_CONTROLLER
static void uli526x_poll(struct net_device *dev);
#endif
static void uli526x_descriptor_init(struct net_device *, void __iomem *);
static void allocate_rx_buffer(struct net_device *);
static void update_cr6(u32, void __iomem *);
static void send_filter_frame(struct net_device *, int);
static u16 phy_readby_cr9(struct uli526x_board_info *, u8, u8);
static u16 phy_readby_cr10(struct uli526x_board_info *, u8, u8);
static void phy_writeby_cr9(struct uli526x_board_info *, u8, u8, u16);
static void phy_writeby_cr10(struct uli526x_board_info *, u8, u8, u16);
static void phy_write_1bit(struct uli526x_board_info *db, u32);
static u16 phy_read_1bit(struct uli526x_board_info *db);
static u8 uli526x_sense_speed(struct uli526x_board_info *);
static void uli526x_process_mode(struct uli526x_board_info *);
static void uli526x_timer(struct timer_list *t);
static void uli526x_rx_packet(struct net_device *, struct uli526x_board_info *);
static void uli526x_free_tx_pkt(struct net_device *, struct uli526x_board_info *);
static void uli526x_reuse_skb(struct uli526x_board_info *, struct sk_buff *);
static void uli526x_dynamic_reset(struct net_device *);
static void uli526x_free_rxbuffer(struct uli526x_board_info *);
static void uli526x_init(struct net_device *);
static void uli526x_set_phyxcer(struct uli526x_board_info *);
static void srom_clk_write(struct uli526x_board_info *db, u32 data)
{ … }
static const struct net_device_ops netdev_ops = …;
static int uli526x_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{ … }
static void uli526x_remove_one(struct pci_dev *pdev)
{ … }
static int uli526x_open(struct net_device *dev)
{ … }
static void uli526x_init(struct net_device *dev)
{ … }
static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{ … }
static int uli526x_stop(struct net_device *dev)
{ … }
static irqreturn_t uli526x_interrupt(int irq, void *dev_id)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void uli526x_poll(struct net_device *dev)
{ … }
#endif
static void uli526x_free_tx_pkt(struct net_device *dev,
struct uli526x_board_info * db)
{ … }
static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info * db)
{ … }
static void uli526x_set_filter_mode(struct net_device * dev)
{ … }
static void
ULi_ethtool_get_link_ksettings(struct uli526x_board_info *db,
struct ethtool_link_ksettings *cmd)
{ … }
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 u32 netdev_get_link(struct net_device *dev) { … }
static void uli526x_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{ … }
static const struct ethtool_ops netdev_ethtool_ops = …;
static void uli526x_timer(struct timer_list *t)
{ … }
static void uli526x_reset_prepare(struct net_device *dev)
{ … }
static void uli526x_dynamic_reset(struct net_device *dev)
{ … }
static int __maybe_unused uli526x_suspend(struct device *dev_d)
{ … }
static int __maybe_unused uli526x_resume(struct device *dev_d)
{ … }
static void uli526x_free_rxbuffer(struct uli526x_board_info * db)
{ … }
static void uli526x_reuse_skb(struct uli526x_board_info *db, struct sk_buff * skb)
{ … }
static void uli526x_descriptor_init(struct net_device *dev, void __iomem *ioaddr)
{ … }
static void update_cr6(u32 cr6_data, void __iomem *ioaddr)
{ … }
#ifdef __BIG_ENDIAN
#define FLT_SHIFT …
#else
#define FLT_SHIFT …
#endif
static void send_filter_frame(struct net_device *dev, int mc_cnt)
{ … }
static void allocate_rx_buffer(struct net_device *dev)
{ … }
static u16 read_srom_word(struct uli526x_board_info *db, int offset)
{ … }
static u8 uli526x_sense_speed(struct uli526x_board_info * db)
{ … }
static void uli526x_set_phyxcer(struct uli526x_board_info *db)
{ … }
static void uli526x_process_mode(struct uli526x_board_info *db)
{ … }
static void phy_writeby_cr9(struct uli526x_board_info *db, u8 phy_addr,
u8 offset, u16 phy_data)
{ … }
static u16 phy_readby_cr9(struct uli526x_board_info *db, u8 phy_addr, u8 offset)
{ … }
static u16 phy_readby_cr10(struct uli526x_board_info *db, u8 phy_addr,
u8 offset)
{ … }
static void phy_writeby_cr10(struct uli526x_board_info *db, u8 phy_addr,
u8 offset, u16 phy_data)
{ … }
static void phy_write_1bit(struct uli526x_board_info *db, u32 data)
{ … }
static u16 phy_read_1bit(struct uli526x_board_info *db)
{ … }
static const struct pci_device_id uli526x_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, uli526x_pci_tbl);
static SIMPLE_DEV_PM_OPS(uli526x_pm_ops, uli526x_suspend, uli526x_resume);
static struct pci_driver uli526x_driver = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param(debug, int, 0644);
module_param(mode, int, 0);
module_param(cr6set, int, 0);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
static int __init uli526x_init_module(void)
{ … }
static void __exit uli526x_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(uli526x_cleanup_module);