linux/drivers/net/ethernet/3com/3c589_cs.c

/* ======================================================================
 *
 * A PCMCIA ethernet driver for the 3com 3c589 card.
 *
 * Copyright (C) 1999 David A. Hinds -- [email protected]
 *
 * 3c589_cs.c 1.162 2001/10/13 00:08:50
 *
 * The network driver code is based on Donald Becker's 3c589 code:
 *
 * Written 1994 by Donald Becker.
 * Copyright 1993 United States Government as represented by the
 * Director, National Security Agency.  This software may be used and
 * distributed according to the terms of the GNU General Public License,
 * incorporated herein by reference.
 * Donald Becker may be reached at [email protected]
 *
 * Updated for 2.5.x by Alan Cox <[email protected]>
 *
 * ======================================================================
 */

#define pr_fmt(fmt)

#define DRV_NAME

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <linux/uaccess.h>
#include <linux/io.h>

#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>


/* To minimize the size of the driver source I only define operating
 * constants if they are used several times. You'll need the manual
 * if you want to understand driver details.
 */

/* Offsets from base I/O address. */
#define EL3_DATA
#define EL3_TIMER
#define EL3_CMD
#define EL3_STATUS

#define EEPROM_READ
#define EEPROM_BUSY

#define EL3WINDOW(win_num)

/* The top five bits written to EL3_CMD are a command, the lower
 * 11 bits are the parameter, if applicable.
 */

enum c509cmd {};

enum c509status {};

/* The SetRxFilter command accepts the following classes: */
enum RxFilter {};

/* Register window 1 offsets, the window used in normal operation. */
#define TX_FIFO
#define RX_FIFO
#define RX_STATUS
#define TX_STATUS
#define TX_FREE

#define WN0_IRQ
#define WN4_MEDIA
#define MEDIA_TP
#define MEDIA_LED

/* Time in jiffies before concluding Tx hung */
#define TX_TIMEOUT

struct el3_private {};

static const char *if_names[] =;

/*====================================================================*/

/* Module parameters */

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

#define INT_MODULE_PARM(n, v)

/* Special hook for setting if_port when module is loaded */
INT_MODULE_PARM(if_port, 0);


/*====================================================================*/

static int tc589_config(struct pcmcia_device *link);
static void tc589_release(struct pcmcia_device *link);

static u16 read_eeprom(unsigned int ioaddr, int index);
static void tc589_reset(struct net_device *dev);
static void media_check(struct timer_list *t);
static int el3_config(struct net_device *dev, struct ifmap *map);
static int el3_open(struct net_device *dev);
static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
					struct net_device *dev);
static irqreturn_t el3_interrupt(int irq, void *dev_id);
static void update_stats(struct net_device *dev);
static struct net_device_stats *el3_get_stats(struct net_device *dev);
static int el3_rx(struct net_device *dev);
static int el3_close(struct net_device *dev);
static void el3_tx_timeout(struct net_device *dev, unsigned int txqueue);
static void set_rx_mode(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static const struct ethtool_ops netdev_ethtool_ops;

static void tc589_detach(struct pcmcia_device *p_dev);

static const struct net_device_ops el3_netdev_ops =;

static int tc589_probe(struct pcmcia_device *link)
{}

static void tc589_detach(struct pcmcia_device *link)
{} /* tc589_detach */

static int tc589_config(struct pcmcia_device *link)
{} /* tc589_config */

static void tc589_release(struct pcmcia_device *link)
{}

static int tc589_suspend(struct pcmcia_device *link)
{}

static int tc589_resume(struct pcmcia_device *link)
{}

/*====================================================================*/

/* Use this for commands that may take time to finish */

static void tc589_wait_for_completion(struct net_device *dev, int cmd)
{}

/* Read a word from the EEPROM using the regular EEPROM access register.
 * Assume that we are in register window zero.
 */

static u16 read_eeprom(unsigned int ioaddr, int index)
{}

/* Set transceiver type, perhaps to something other than what the user
 * specified in dev->if_port.
 */

static void tc589_set_xcvr(struct net_device *dev, int if_port)
{}

static void dump_status(struct net_device *dev)
{}

/* Reset and restore all of the 3c589 registers. */
static void tc589_reset(struct net_device *dev)
{}

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

static const struct ethtool_ops netdev_ethtool_ops =;

static int el3_config(struct net_device *dev, struct ifmap *map)
{}

static int el3_open(struct net_device *dev)
{}

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

static void pop_tx_status(struct net_device *dev)
{}

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

/* The EL3 interrupt handler. */
static irqreturn_t el3_interrupt(int irq, void *dev_id)
{}

static void media_check(struct timer_list *t)
{}

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

/* Update statistics.  We change to register window 6, so this should be run
* single-threaded if the device is active. This is expected to be a rare
* operation, and it's simpler for the rest of the driver to assume that
* window 1 is always valid rather than use a special window-state variable.
*
* Caller must hold the lock for this
*/

static void update_stats(struct net_device *dev)
{}

static int el3_rx(struct net_device *dev)
{}

static void set_rx_mode(struct net_device *dev)
{}

static void set_multicast_list(struct net_device *dev)
{}

static int el3_close(struct net_device *dev)
{}

static const struct pcmcia_device_id tc589_ids[] =;
MODULE_DEVICE_TABLE(pcmcia, tc589_ids);

static struct pcmcia_driver tc589_driver =;
module_pcmcia_driver();