linux/drivers/atm/he.c

/*

  he.c

  ForeRunnerHE ATM Adapter driver for ATM on Linux
  Copyright (C) 1999-2001  Naval Research Laboratory

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

/*

  he.c

  ForeRunnerHE ATM Adapter driver for ATM on Linux
  Copyright (C) 1999-2001  Naval Research Laboratory

  Permission to use, copy, modify and distribute this software and its
  documentation is hereby granted, provided that both the copyright
  notice and this permission notice appear in all copies of the software,
  derivative works or modified versions, and any portions thereof, and
  that both notices appear in supporting documentation.

  NRL ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND
  DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
  RESULTING FROM THE USE OF THIS SOFTWARE.

  This driver was written using the "Programmer's Reference Manual for
  ForeRunnerHE(tm)", MANU0361-01 - Rev. A, 08/21/98.

  AUTHORS:
	chas williams <[email protected]>
	eric kinzie <[email protected]>

  NOTES:
	4096 supported 'connections'
	group 0 is used for all traffic
	interrupt queue 0 is used for all interrupts
	aal0 support (based on work from [email protected])

 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/pci.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/bitmap.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/uaccess.h>

#include <linux/atmdev.h>
#include <linux/atm.h>
#include <linux/sonet.h>

#undef USE_SCATTERGATHER
#undef USE_CHECKSUM_HW			/* still confused about this */
/* #undef HE_DEBUG */

#include "he.h"
#include "suni.h"
#include <linux/atm_he.h>

#define hprintk(fmt,args...)

#ifdef HE_DEBUG
#define HPRINTK
#else /* !HE_DEBUG */
#define HPRINTK(fmt,args...)
#endif /* HE_DEBUG */

/* declarations */

static int he_open(struct atm_vcc *vcc);
static void he_close(struct atm_vcc *vcc);
static int he_send(struct atm_vcc *vcc, struct sk_buff *skb);
static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
static irqreturn_t he_irq_handler(int irq, void *dev_id);
static void he_tasklet(unsigned long data);
static int he_proc_read(struct atm_dev *dev,loff_t *pos,char *page);
static int he_start(struct atm_dev *dev);
static void he_stop(struct he_dev *dev);
static void he_phy_put(struct atm_dev *, unsigned char, unsigned long);
static unsigned char he_phy_get(struct atm_dev *, unsigned long);

static u8 read_prom_byte(struct he_dev *he_dev, int addr);

/* globals */

static struct he_dev *he_devs;
static bool disable64;
static short nvpibits =;
static short nvcibits =;
static short rx_skb_reserve =;
static bool irq_coalesce =;
static bool sdh;

/* Read from EEPROM = 0000 0011b */
static unsigned int readtab[] =;     
 
/* Clock to read from/write to the EEPROM */
static unsigned int clocktab[] =;     

static const struct atmdev_ops he_ops =;

#define he_writel(dev, val, reg)
#define he_readl(dev, reg)

/* section 2.12 connection memory access */

static __inline__ void
he_writel_internal(struct he_dev *he_dev, unsigned val, unsigned addr,
								unsigned flags)
{}

#define he_writel_rcm(dev, val, reg)

#define he_writel_tcm(dev, val, reg)

#define he_writel_mbox(dev, val, reg)

static unsigned
he_readl_internal(struct he_dev *he_dev, unsigned addr, unsigned flags)
{}

#define he_readl_rcm(dev, reg)

#define he_readl_tcm(dev, reg)

#define he_readl_mbox(dev, reg)


/* figure 2.2 connection id */

#define he_mkcid(dev, vpi, vci)

/* 2.5.1 per connection transmit state registers */

#define he_writel_tsr0(dev, val, cid)
#define he_readl_tsr0(dev, cid)

#define he_writel_tsr1(dev, val, cid)

#define he_writel_tsr2(dev, val, cid)

#define he_writel_tsr3(dev, val, cid)

#define he_writel_tsr4(dev, val, cid)

	/* from page 2-20
	 *
	 * NOTE While the transmit connection is active, bits 23 through 0
	 *      of this register must not be written by the host.  Byte
	 *      enables should be used during normal operation when writing
	 *      the most significant byte.
	 */

#define he_writel_tsr4_upper(dev, val, cid)

#define he_readl_tsr4(dev, cid)

#define he_writel_tsr5(dev, val, cid)

#define he_writel_tsr6(dev, val, cid)

#define he_writel_tsr7(dev, val, cid)


#define he_writel_tsr8(dev, val, cid)

#define he_writel_tsr9(dev, val, cid)

#define he_writel_tsr10(dev, val, cid)

#define he_writel_tsr11(dev, val, cid)


#define he_writel_tsr12(dev, val, cid)

#define he_writel_tsr13(dev, val, cid)


#define he_writel_tsr14(dev, val, cid)

#define he_writel_tsr14_upper(dev, val, cid)

/* 2.7.1 per connection receive state registers */

#define he_writel_rsr0(dev, val, cid)
#define he_readl_rsr0(dev, cid)

#define he_writel_rsr1(dev, val, cid)

#define he_writel_rsr2(dev, val, cid)

#define he_writel_rsr3(dev, val, cid)

#define he_writel_rsr4(dev, val, cid)

#define he_writel_rsr5(dev, val, cid)

#define he_writel_rsr6(dev, val, cid)

#define he_writel_rsr7(dev, val, cid)

static __inline__ struct atm_vcc*
__find_vcc(struct he_dev *he_dev, unsigned cid)
{}

static int he_init_one(struct pci_dev *pci_dev,
		       const struct pci_device_id *pci_ent)
{}

static void he_remove_one(struct pci_dev *pci_dev)
{}


static unsigned
rate_to_atmf(unsigned rate)		/* cps to atm forum format */
{}

static void he_init_rx_lbfp0(struct he_dev *he_dev)
{}

static void he_init_rx_lbfp1(struct he_dev *he_dev)
{}

static void he_init_tx_lbfp(struct he_dev *he_dev)
{}

static int he_init_tpdrq(struct he_dev *he_dev)
{}

static void he_init_cs_block(struct he_dev *he_dev)
{}

static int he_init_cs_block_rcm(struct he_dev *he_dev)
{}

static int he_init_group(struct he_dev *he_dev, int group)
{}

static int he_init_irq(struct he_dev *he_dev)
{}

static int he_start(struct atm_dev *dev)
{}

static void
he_stop(struct he_dev *he_dev)
{}

static struct he_tpd *
__alloc_tpd(struct he_dev *he_dev)
{}

#define AAL5_LEN(buf,len)

/* 2.10.1.2 receive
 *
 * aal5 packets can optionally return the tcp checksum in the lower
 * 16 bits of the crc (RSR0_TCP_CKSUM)
 */

#define TCP_CKSUM(buf,len)

static int
he_service_rbrq(struct he_dev *he_dev, int group)
{}

static void
he_service_tbrq(struct he_dev *he_dev, int group)
{}

static void
he_service_rbpl(struct he_dev *he_dev, int group)
{}

static void
he_tasklet(unsigned long data)
{}

static irqreturn_t
he_irq_handler(int irq, void *dev_id)
{}

static __inline__ void
__enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
{}

static int
he_open(struct atm_vcc *vcc)
{}

static void
he_close(struct atm_vcc *vcc)
{}

static int
he_send(struct atm_vcc *vcc, struct sk_buff *skb)
{}

static int
he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
{}

static void
he_phy_put(struct atm_dev *atm_dev, unsigned char val, unsigned long addr)
{}
 
	
static unsigned char
he_phy_get(struct atm_dev *atm_dev, unsigned long addr)
{}

static int
he_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
{}

/* eeprom routines  -- see 4.7 */

static u8 read_prom_byte(struct he_dev *he_dev, int addr)
{}

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
module_param(disable64, bool, 0);
MODULE_PARM_DESC();
module_param(nvpibits, short, 0);
MODULE_PARM_DESC();
module_param(nvcibits, short, 0);
MODULE_PARM_DESC();
module_param(rx_skb_reserve, short, 0);
MODULE_PARM_DESC();
module_param(irq_coalesce, bool, 0);
MODULE_PARM_DESC();
module_param(sdh, bool, 0);
MODULE_PARM_DESC();

static const struct pci_device_id he_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci, he_pci_tbl);

static struct pci_driver he_driver =;

module_pci_driver();