linux/drivers/net/ethernet/dec/tulip/tulip_core.c

/*	tulip_core.c: A DEC 21x4x-family ethernet driver for Linux.

	Copyright 2000,2001  The Linux Kernel Team
	Written/copyright 1994-2001 by Donald Becker.

	This software may be used and distributed according to the terms
	of the GNU General Public License, incorporated herein by reference.

	Please submit bugs to http://bugzilla.kernel.org/ .
*/

#define pr_fmt(fmt)

#define DRV_NAME

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include "tulip.h"
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <linux/mii.h>
#include <linux/crc32.h>
#include <asm/unaligned.h>
#include <linux/uaccess.h>

#ifdef CONFIG_SPARC
#include <asm/prom.h>
#endif

/* A few user-configurable values. */

/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
static unsigned int max_interrupt_work =;

#define MAX_UNITS
/* Used to pass the full-duplex flag, etc. */
static int full_duplex[MAX_UNITS];
static int options[MAX_UNITS];
static int mtu[MAX_UNITS];			/* Jumbo MTU for interfaces. */

/*  The possible media types that can be set in options[] are: */
const char * const medianame[32] =;

/* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \
	defined(CONFIG_SPARC) || defined(__ia64__) || \
	defined(__sh__) || defined(__mips__)
static int rx_copybreak = 1518;
#else
static int rx_copybreak =;
#endif

/*
  Set the bus performance register.
	Typical: Set 16 longword cache alignment, no burst limit.
	Cache alignment bits 15:14	     Burst length 13:8
		0000	No alignment  0x00000000 unlimited		0800 8 longwords
		4000	8  longwords		0100 1 longword		1000 16 longwords
		8000	16 longwords		0200 2 longwords	2000 32 longwords
		C000	32  longwords		0400 4 longwords
	Warning: many older 486 systems are broken and require setting 0x00A04800
	   8 longword cache alignment, 8 longword burst.
	ToDo: Non-Intel setting could be better.
*/

#if defined(__alpha__) || defined(__ia64__)
static int csr0 = 0x01A00000 | 0xE000;
#elif defined(__i386__) || defined(__powerpc__) || defined(__x86_64__)
static int csr0 =;
#elif defined(CONFIG_SPARC) || defined(__hppa__)
/* The UltraSparc PCI controllers will disconnect at every 64-byte
 * crossing anyways so it makes no sense to tell Tulip to burst
 * any more than that.
 */
static int csr0 = 0x01A00000 | 0x9000;
#elif defined(__arm__) || defined(__sh__)
static int csr0 = 0x01A00000 | 0x4800;
#elif defined(__mips__)
static int csr0 = 0x00200000 | 0x4000;
#else
static int csr0;
#endif

/* Operational parameters that usually are not changed. */
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT


MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
module_param(tulip_debug, int, 0);
module_param(max_interrupt_work, int, 0);
module_param(rx_copybreak, int, 0);
module_param(csr0, int, 0);
module_param_array();
module_param_array();

#ifdef TULIP_DEBUG
int tulip_debug =;
#else
int tulip_debug = 1;
#endif

static void tulip_timer(struct timer_list *t)
{}

/*
 * This table use during operation for capabilities and media timer.
 *
 * It is indexed via the values in 'enum chips'
 */

const struct tulip_chip_table tulip_tbl[] =;


static const struct pci_device_id tulip_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, tulip_pci_tbl);


/* A full-duplex map for media types. */
const char tulip_media_cap[32] =;

static void tulip_tx_timeout(struct net_device *dev, unsigned int txqueue);
static void tulip_init_ring(struct net_device *dev);
static void tulip_free_ring(struct net_device *dev);
static netdev_tx_t tulip_start_xmit(struct sk_buff *skb,
					  struct net_device *dev);
static int tulip_open(struct net_device *dev);
static int tulip_close(struct net_device *dev);
static void tulip_up(struct net_device *dev);
static void tulip_down(struct net_device *dev);
static struct net_device_stats *tulip_get_stats(struct net_device *dev);
static int private_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static void set_rx_mode(struct net_device *dev);
static void tulip_set_wolopts(struct pci_dev *pdev, u32 wolopts);
#ifdef CONFIG_NET_POLL_CONTROLLER
static void poll_tulip(struct net_device *dev);
#endif

static void tulip_set_power_state (struct tulip_private *tp,
				   int sleep, int snooze)
{}


static void tulip_up(struct net_device *dev)
{}

static int
tulip_open(struct net_device *dev)
{}


static void tulip_tx_timeout(struct net_device *dev, unsigned int txqueue)
{}


/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
static void tulip_init_ring(struct net_device *dev)
{}

static netdev_tx_t
tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
{}

static void tulip_clean_tx_ring(struct tulip_private *tp)
{}

static void tulip_down (struct net_device *dev)
{}

static void tulip_free_ring (struct net_device *dev)
{}

static int tulip_close (struct net_device *dev)
{}

static struct net_device_stats *tulip_get_stats(struct net_device *dev)
{}


static void tulip_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{}


static int tulip_ethtool_set_wol(struct net_device *dev,
				 struct ethtool_wolinfo *wolinfo)
{}

static void tulip_ethtool_get_wol(struct net_device *dev,
				  struct ethtool_wolinfo *wolinfo)
{}


static const struct ethtool_ops ops =;

/* Provide ioctl() calls to examine the MII xcvr state. */
static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{}


/* Set or clear the multicast filter for this adaptor.
   Note that we only use exclusion around actually queueing the
   new frame, not around filling tp->setup_frame.  This is non-deterministic
   when re-entered but still correct. */

static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
{}

static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
{}


static void set_rx_mode(struct net_device *dev)
{}

#ifdef CONFIG_TULIP_MWI
static void tulip_mwi_config(struct pci_dev *pdev, struct net_device *dev)
{}
#endif

/*
 *	Chips that have the MRM/reserved bit quirk and the burst quirk. That
 *	is the DM910X and the on chip ULi devices
 */

static int tulip_uli_dm_quirk(struct pci_dev *pdev)
{}

static const struct net_device_ops tulip_netdev_ops =;

static const struct pci_device_id early_486_chipsets[] =;

static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{}


/* set the registers according to the given wolopts */
static void tulip_set_wolopts (struct pci_dev *pdev, u32 wolopts)
{}

static int __maybe_unused tulip_suspend(struct device *dev_d)
{}

static int __maybe_unused tulip_resume(struct device *dev_d)
{}

static void tulip_remove_one(struct pci_dev *pdev)
{}

#ifdef CONFIG_NET_POLL_CONTROLLER
/*
 * Polling 'interrupt' - used by things like netconsole to send skbs
 * without having to re-enable interrupts. It's not called while
 * the interrupt routine is executing.
 */

static void poll_tulip (struct net_device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(tulip_pm_ops, tulip_suspend, tulip_resume);

static struct pci_driver tulip_driver =;


static int __init tulip_init (void)
{}


static void __exit tulip_cleanup (void)
{}


module_init();
module_exit(tulip_cleanup);