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

/* de2104x.c: A Linux PCI Ethernet driver for Intel/Digital 21040/1 chips. */
/*
	Copyright 2001,2003 Jeff Garzik <[email protected]>

	Copyright 1994, 1995 Digital Equipment Corporation.	    [de4x5.c]
	Written/copyright 1994-2001 by Donald Becker.		    [tulip.c]

	This software may be used and distributed according to the terms of
	the GNU General Public License (GPL), incorporated herein by reference.
	Drivers based on or derived from this code fall under the GPL and must
	retain the authorship, copyright and license notice.  This file is not
	a complete program and may only be used when the entire operating
	system is licensed under the GPL.

	See the file COPYING in this distribution for more information.

	TODO, in rough priority order:
	* Support forcing media type with a module parameter,
	  like dl2k.c/sundance.c
	* Constants (module parms?) for Rx work limit
	* Complete reset on PciErr
	* Jumbo frames / dev->change_mtu
	* Adjust Rx FIFO threshold and Max Rx DMA burst on Rx FIFO error
	* Adjust Tx FIFO threshold and Max Tx DMA burst on Tx FIFO error
	* Implement Tx software interrupt mitigation via
	  Tx descriptor bit

 */

#define pr_fmt(fmt)

#define DRV_NAME
#define DRV_RELDATE

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/compiler.h>
#include <linux/rtnetlink.h>
#include <linux/crc32.h>
#include <linux/slab.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

static int debug =;
module_param (debug, int, 0);
MODULE_PARM_DESC();

/* 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
module_param (rx_copybreak, int, 0);
MODULE_PARM_DESC();

#define DE_DEF_MSG_ENABLE

/* Descriptor skip length in 32 bit longwords. */
#ifndef CONFIG_DE2104X_DSL
#define DSL
#else
#define DSL
#endif

#define DE_RX_RING_SIZE
#define DE_TX_RING_SIZE
#define DE_RING_BYTES
#define NEXT_TX(N)
#define NEXT_RX(N)
#define TX_BUFFS_AVAIL(CP)

#define PKT_BUF_SZ
#define RX_OFFSET

#define DE_SETUP_SKB
#define DE_DUMMY_SKB
#define DE_SETUP_FRAME_WORDS
#define DE_EEPROM_WORDS
#define DE_EEPROM_SIZE
#define DE_MAX_MEDIA

#define DE_MEDIA_TP_AUTO
#define DE_MEDIA_BNC
#define DE_MEDIA_AUI
#define DE_MEDIA_TP
#define DE_MEDIA_TP_FD
#define DE_MEDIA_INVALID
#define DE_MEDIA_FIRST
#define DE_MEDIA_LAST
#define DE_AUI_BNC

#define DE_TIMER_LINK
#define DE_TIMER_NO_LINK

#define DE_NUM_REGS
#define DE_REGS_SIZE
#define DE_REGS_VER

/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT

/* This is a mysterious value that can be written to CSR11 in the 21040 (only)
   to support a pre-NWay full-duplex signaling mechanism using short frames.
   No one knows what it should be, but if left at its default value some
   10base2(!) packets trigger a full-duplex-request interrupt. */
#define FULL_DUPLEX_MAGIC

enum {};

static const u32 de_intr_mask =;

/*
 * Set the programmable burst length to 4 longwords for all:
 * DMA errors result without these values. Cache align 16 long.
 */
static const u32 de_bus_mode =;

struct de_srom_media_block {} __packed;

struct de_srom_info_leaf {} __packed;

struct de_desc {};

struct media_info {};

struct ring_info {};

struct de_private {};


static void de_set_rx_mode (struct net_device *dev);
static void de_tx (struct de_private *de);
static void de_clean_rings (struct de_private *de);
static void de_media_interrupt (struct de_private *de, u32 status);
static void de21040_media_timer (struct timer_list *t);
static void de21041_media_timer (struct timer_list *t);
static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media);


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

static const char * const media_name[DE_MAX_MEDIA] =;

/* 21040 transceiver register settings:
 * TP AUTO(unused), BNC(unused), AUI, TP, TP FD*/
static u16 t21040_csr13[] =;
static u16 t21040_csr14[] =;
static u16 t21040_csr15[] =;

/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/
static u16 t21041_csr13[] =;
static u16 t21041_csr14[] =;
/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */
static u16 t21041_csr14_brk[] =;
static u16 t21041_csr15[] =;


#define dr32(reg)
#define dw32(reg, val)


static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
			    u32 status, u32 len)
{}

static void de_rx (struct de_private *de)
{}

static irqreturn_t de_interrupt (int irq, void *dev_instance)
{}

static void de_tx (struct de_private *de)
{}

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

/* Set or clear the multicast filter for this adaptor.
   Note that we only use exclusion around actually queueing the
   new frame, not around filling de->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 __de_set_rx_mode (struct net_device *dev)
{}

static void de_set_rx_mode (struct net_device *dev)
{}

static inline void de_rx_missed(struct de_private *de, u32 rx_missed)
{}

static void __de_get_stats(struct de_private *de)
{}

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

static inline int de_is_running (struct de_private *de)
{}

static void de_stop_rxtx (struct de_private *de)
{}

static inline void de_start_rxtx (struct de_private *de)
{}

static void de_stop_hw (struct de_private *de)
{}

static void de_link_up(struct de_private *de)
{}

static void de_link_down(struct de_private *de)
{}

static void de_set_media (struct de_private *de)
{}

static void de_next_media (struct de_private *de, const u32 *media,
			   unsigned int n_media)
{}

static void de21040_media_timer (struct timer_list *t)
{}

static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media)
{}

static void de21041_media_timer (struct timer_list *t)
{}

static void de_media_interrupt (struct de_private *de, u32 status)
{}

static int de_reset_mac (struct de_private *de)
{}

static void de_adapter_wake (struct de_private *de)
{}

static void de_adapter_sleep (struct de_private *de)
{}

static int de_init_hw (struct de_private *de)
{}

static int de_refill_rx (struct de_private *de)
{}

static int de_init_rings (struct de_private *de)
{}

static int de_alloc_rings (struct de_private *de)
{}

static void de_clean_rings (struct de_private *de)
{}

static void de_free_rings (struct de_private *de)
{}

static int de_open (struct net_device *dev)
{}

static int de_close (struct net_device *dev)
{}

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

static void __de_get_regs(struct de_private *de, u8 *buf)
{}

static void __de_get_link_ksettings(struct de_private *de,
				    struct ethtool_link_ksettings *cmd)
{}

static int __de_set_link_ksettings(struct de_private *de,
				   const struct ethtool_link_ksettings *cmd)
{}

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

static int de_get_regs_len(struct net_device *dev)
{}

static int de_get_link_ksettings(struct net_device *dev,
				 struct ethtool_link_ksettings *cmd)
{}

static int de_set_link_ksettings(struct net_device *dev,
				 const struct ethtool_link_ksettings *cmd)
{}

static u32 de_get_msglevel(struct net_device *dev)
{}

static void de_set_msglevel(struct net_device *dev, u32 msglvl)
{}

static int de_get_eeprom(struct net_device *dev,
			 struct ethtool_eeprom *eeprom, u8 *data)
{}

static int de_nway_reset(struct net_device *dev)
{}

static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
			void *data)
{}

static const struct ethtool_ops de_ethtool_ops =;

static void de21040_get_mac_address(struct de_private *de)
{}

static void de21040_get_media_info(struct de_private *de)
{}

/* Note: this routine returns extra data bits for size detection. */
static unsigned tulip_read_eeprom(void __iomem *regs, int location,
				  int addr_len)
{}

static void de21041_get_srom_info(struct de_private *de)
{}

static const struct net_device_ops de_netdev_ops =;

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

static void de_remove_one(struct pci_dev *pdev)
{}

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

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

static SIMPLE_DEV_PM_OPS(de_pm_ops, de_suspend, de_resume);

static void de_shutdown(struct pci_dev *pdev)
{}

static struct pci_driver de_driver =;

module_pci_driver();