linux/drivers/net/ethernet/fujitsu/fmvj18x_cs.c

/*======================================================================
    fmvj18x_cs.c 2.8 2002/03/23

    A fmvj18x (and its compatibles) PCMCIA client driver

    Contributed by Shingo Fujimoto, [email protected]

    TDK LAK-CD021 and CONTEC C-NET(PC)C support added by 
    Nobuhiro Katayama, [email protected]

    The PCMCIA client code is based on code written by David Hinds.
    Network code is based on the "FMV-18x driver" by Yutaka TAMIYA
    but is actually largely Donald Becker's AT1700 driver, which
    carries the following attribution:

    Written 1993-94 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.
    
    The author may be reached as [email protected], or C/O
    Scyld Computing Corporation
    410 Severn Ave., Suite 210
    Annapolis MD 21403
   
======================================================================*/

#define pr_fmt(fmt)

#define DRV_NAME
#define DRV_VERSION

#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/crc32.h>

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

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

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

/* Module parameters */

MODULE_DESCRIPTION();
MODULE_LICENSE();

#define INT_MODULE_PARM(n, v)

/* SRAM configuration */
/* 0:4KB*2 TX buffer   else:8KB*2 TX buffer */
INT_MODULE_PARM(sram_config, 0);


/*====================================================================*/
/*
    PCMCIA event handlers
 */
static int fmvj18x_config(struct pcmcia_device *link);
static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id);
static int fmvj18x_setup_mfc(struct pcmcia_device *link);
static void fmvj18x_release(struct pcmcia_device *link);
static void fmvj18x_detach(struct pcmcia_device *p_dev);

/*
    LAN controller(MBH86960A) specific routines
 */
static int fjn_config(struct net_device *dev, struct ifmap *map);
static int fjn_open(struct net_device *dev);
static int fjn_close(struct net_device *dev);
static netdev_tx_t fjn_start_xmit(struct sk_buff *skb,
					struct net_device *dev);
static irqreturn_t fjn_interrupt(int irq, void *dev_id);
static void fjn_rx(struct net_device *dev);
static void fjn_reset(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
static void fjn_tx_timeout(struct net_device *dev, unsigned int txqueue);
static const struct ethtool_ops netdev_ethtool_ops;

/*
    card type
 */
enum cardtype {};

/*
    driver specific data structure
*/
struct local_info {};

#define MC_FILTERBREAK

/*====================================================================*/
/* 
    ioport offset from the base address 
 */
#define TX_STATUS
#define RX_STATUS
#define TX_INTR
#define RX_INTR
#define TX_MODE
#define RX_MODE
#define CONFIG_0
#define CONFIG_1

#define NODE_ID
#define MAR_ADR

#define DATAPORT
#define TX_START
#define COL_CTRL
#define BMPR12
#define BMPR13
#define RX_SKIP

#define LAN_CTRL

#define MAC_ID
#define UNGERMANN_MAC_ID

/* 
    control bits 
 */
#define ENA_TMT_OK
#define ENA_TMT_REC
#define ENA_COL
#define ENA_16_COL
#define ENA_TBUS_ERR

#define ENA_PKT_RDY
#define ENA_BUS_ERR
#define ENA_LEN_ERR
#define ENA_ALG_ERR
#define ENA_CRC_ERR
#define ENA_OVR_FLO

/* flags */
#define F_TMT_RDY
#define F_NET_BSY
#define F_TMT_OK
#define F_SRT_PKT
#define F_COL_ERR
#define F_16_COL
#define F_TBUS_ERR

#define F_PKT_RDY
#define F_BUS_ERR
#define F_LEN_ERR
#define F_ALG_ERR
#define F_CRC_ERR
#define F_OVR_FLO

#define F_BUF_EMP

#define F_SKP_PKT

/* default bitmaps */
#define D_TX_INTR
#define D_RX_INTR
#define TX_STAT_M
#define RX_STAT_M

/* commands */
#define D_TX_MODE
#define ID_MATCHED
#define RECV_ALL
#define CONFIG0_DFL
#define CONFIG0_DFL_1
#define CONFIG0_RST
#define CONFIG0_RST_1
#define BANK_0
#define BANK_1
#define BANK_2
#define CHIP_OFF
#define DO_TX
#define SEND_PKT
#define AUTO_MODE
#define MANU_MODE
#define TDK_AUTO_MODE
#define TDK_MANU_MODE
#define INTR_OFF
#define INTR_ON

#define TX_TIMEOUT

#define BANK_0U
#define BANK_1U
#define BANK_2U

static const struct net_device_ops fjn_netdev_ops =;

static int fmvj18x_probe(struct pcmcia_device *link)
{} /* fmvj18x_attach */

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

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

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

static int mfc_try_io_port(struct pcmcia_device *link)
{}

static int ungermann_try_io_port(struct pcmcia_device *link)
{}

static int fmvj18x_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
{}

static int fmvj18x_config(struct pcmcia_device *link)
{} /* fmvj18x_config */
/*====================================================================*/

static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
{} /* fmvj18x_get_hwinfo */
/*====================================================================*/

static int fmvj18x_setup_mfc(struct pcmcia_device *link)
{}
/*====================================================================*/

static void fmvj18x_release(struct pcmcia_device *link)
{}

static int fmvj18x_suspend(struct pcmcia_device *link)
{}

static int fmvj18x_resume(struct pcmcia_device *link)
{}

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

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

static struct pcmcia_driver fmvj18x_cs_driver =;
module_pcmcia_driver();

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

static irqreturn_t fjn_interrupt(int dummy, void *dev_id)
{} /* fjn_interrupt */

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

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

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

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

static void fjn_reset(struct net_device *dev)
{} /* fjn_reset */

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

static void fjn_rx(struct net_device *dev)
{} /* fjn_rx */

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

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

static const struct ethtool_ops netdev_ethtool_ops =;

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

static int fjn_open(struct net_device *dev)
{} /* fjn_open */

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

static int fjn_close(struct net_device *dev)
{} /* fjn_close */

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

/*
  Set the multicast/promiscuous mode for this adaptor.
*/

static void set_rx_mode(struct net_device *dev)
{}