#include "dl2k.h"
#include <linux/dma-mapping.h>
#define dw32(reg, val) …
#define dw16(reg, val) …
#define dw8(reg, val) …
#define dr32(reg) …
#define dr16(reg) …
#define dr8(reg) …
#define MAX_UNITS …
static int mtu[MAX_UNITS];
static int vlan[MAX_UNITS];
static int jumbo[MAX_UNITS];
static char *media[MAX_UNITS];
static int tx_flow= …;
static int rx_flow= …;
static int copy_thresh;
static int rx_coalesce= …;
static int rx_timeout= …;
static int tx_coalesce= …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param_array(…);
module_param_array(…);
module_param_array(…);
module_param_array(…);
module_param(tx_flow, int, 0);
module_param(rx_flow, int, 0);
module_param(copy_thresh, int, 0);
module_param(rx_coalesce, int, 0);
module_param(rx_timeout, int, 0);
module_param(tx_coalesce, int, 0);
#define DEFAULT_INTR …
static void dl2k_enable_int(struct netdev_private *np)
{ … }
static const int max_intrloop = …;
static const int multicast_filter_limit = …;
static int rio_open (struct net_device *dev);
static void rio_timer (struct timer_list *t);
static void rio_tx_timeout (struct net_device *dev, unsigned int txqueue);
static netdev_tx_t start_xmit (struct sk_buff *skb, struct net_device *dev);
static irqreturn_t rio_interrupt (int irq, void *dev_instance);
static void rio_free_tx (struct net_device *dev, int irq);
static void tx_error (struct net_device *dev, int tx_status);
static int receive_packet (struct net_device *dev);
static void rio_error (struct net_device *dev, int int_status);
static void set_multicast (struct net_device *dev);
static struct net_device_stats *get_stats (struct net_device *dev);
static int clear_stats (struct net_device *dev);
static int rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
static int rio_close (struct net_device *dev);
static int find_miiphy (struct net_device *dev);
static int parse_eeprom (struct net_device *dev);
static int read_eeprom (struct netdev_private *, int eep_addr);
static int mii_wait_link (struct net_device *dev, int wait);
static int mii_set_media (struct net_device *dev);
static int mii_get_media (struct net_device *dev);
static int mii_set_media_pcs (struct net_device *dev);
static int mii_get_media_pcs (struct net_device *dev);
static int mii_read (struct net_device *dev, int phy_addr, int reg_num);
static int mii_write (struct net_device *dev, int phy_addr, int reg_num,
u16 data);
static const struct ethtool_ops ethtool_ops;
static const struct net_device_ops netdev_ops = …;
static int
rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static int
find_miiphy (struct net_device *dev)
{ … }
static int
parse_eeprom (struct net_device *dev)
{ … }
static void rio_set_led_mode(struct net_device *dev)
{ … }
static inline dma_addr_t desc_to_dma(struct netdev_desc *desc)
{ … }
static void free_list(struct net_device *dev)
{ … }
static void rio_reset_ring(struct netdev_private *np)
{ … }
static int alloc_list(struct net_device *dev)
{ … }
static void rio_hw_init(struct net_device *dev)
{ … }
static void rio_hw_stop(struct net_device *dev)
{ … }
static int rio_open(struct net_device *dev)
{ … }
static void
rio_timer (struct timer_list *t)
{ … }
static void
rio_tx_timeout (struct net_device *dev, unsigned int txqueue)
{ … }
static netdev_tx_t
start_xmit (struct sk_buff *skb, struct net_device *dev)
{ … }
static irqreturn_t
rio_interrupt (int irq, void *dev_instance)
{ … }
static void
rio_free_tx (struct net_device *dev, int irq)
{ … }
static void
tx_error (struct net_device *dev, int tx_status)
{ … }
static int
receive_packet (struct net_device *dev)
{ … }
static void
rio_error (struct net_device *dev, int int_status)
{ … }
static struct net_device_stats *
get_stats (struct net_device *dev)
{ … }
static int
clear_stats (struct net_device *dev)
{ … }
static void
set_multicast (struct net_device *dev)
{ … }
static void rio_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ … }
static int rio_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int rio_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static u32 rio_get_link(struct net_device *dev)
{ … }
static const struct ethtool_ops ethtool_ops = …;
static int
rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{ … }
#define EEP_READ …
#define EEP_BUSY …
static int read_eeprom(struct netdev_private *np, int eep_addr)
{ … }
enum phy_ctrl_bits { … };
#define mii_delay() …
static void
mii_sendbit (struct net_device *dev, u32 data)
{ … }
static int
mii_getbit (struct net_device *dev)
{ … }
static void
mii_send_bits (struct net_device *dev, u32 data, int len)
{ … }
static int
mii_read (struct net_device *dev, int phy_addr, int reg_num)
{ … }
static int
mii_write (struct net_device *dev, int phy_addr, int reg_num, u16 data)
{ … }
static int
mii_wait_link (struct net_device *dev, int wait)
{ … }
static int
mii_get_media (struct net_device *dev)
{ … }
static int
mii_set_media (struct net_device *dev)
{ … }
static int
mii_get_media_pcs (struct net_device *dev)
{ … }
static int
mii_set_media_pcs (struct net_device *dev)
{ … }
static int
rio_close (struct net_device *dev)
{ … }
static void
rio_remove1 (struct pci_dev *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int rio_suspend(struct device *device)
{ … }
static int rio_resume(struct device *device)
{ … }
static SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
#define RIO_PM_OPS …
#else
#define RIO_PM_OPS …
#endif
static struct pci_driver rio_driver = …;
module_pci_driver(…) …;