Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ether3.c File Reference

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/malloc.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/ecard.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "ether3.h"

Include dependency graph for ether3.c:

Go to the source code of this file.

Defines

#define BUS_16   2
#define BUS_8   1
#define BUS_UNKNOWN   0
#define ether3_inb(r)   ({ unsigned int __v = inb((r)); udelay(1); __v; })
#define ether3_inw(r)   ({ unsigned int __v = inw((r)); udelay(1); __v; })
#define ether3_writebuffer(dev, data, length)   outsw(REG_BUFWIN, (data), (length) >> 1)
#define ether3_writeword(dev, data)   outw((data), REG_BUFWIN)
#define ether3_writelong(dev, data)
#define ether3_readbuffer(dev, data, length)   insw(REG_BUFWIN, (data), (length) >> 1)
#define ether3_readword(dev)   inw(REG_BUFWIN)
#define ether3_readlong(dev)   inw(REG_BUFWIN) | (inw(REG_BUFWIN) << 16)
#define TXHDR_FLAGS   (TXHDR_TRANSMIT|TXHDR_CHAINCONTINUE|TXHDR_DATAFOLLOWS|TXHDR_ENSUCCESS)

Enumerations

enum  buffer_rw_t { buffer_write, buffer_read }

Functions

static void ether3_setmulticastlist (struct device *dev)
static int ether3_rx (struct device *dev, struct dev_priv *priv, unsigned int maxcnt)
static void ether3_tx (struct device *dev, struct dev_priv *priv)
static void ether3_outb (int v, const int r)
static void ether3_outw (int v, const int r)
static int ether3_setbuffer (struct device *dev, buffer_rw_t read, int start)
static void ether3_ledoff (unsigned long data)
static void ether3_ledon (struct device *dev, struct dev_priv *priv)
 __initfunc (static void ether3_addr(char *addr, struct expansion_card *ec))
 __initfunc (static int ether3_ramtest(struct device *dev, unsigned char byte))
 __initfunc (static int ether3_init_2(struct device *dev))
static void ether3_init_for_open (struct device *dev)
static int ether3_probe_bus_8 (struct device *dev, int val)
static int ether3_probe_bus_16 (struct device *dev, int val)
 __initfunc (static void ether3_get_dev(struct device *dev, struct expansion_card *ec))
 __initfunc (int ether3_probe(struct device *dev))
static int ether3_open (struct device *dev)
static int ether3_close (struct device *dev)
static struct enet_statistics * ether3_getstats (struct device *dev)
static int ether3_sendpacket (struct sk_buff *skb, struct device *dev)
static void ether3_interrupt (int irq, void *dev_id, struct pt_regs *regs)

Variables

static char * version = "ether3 ethernet driver (c) 1995-1999 R.M.King v1.15\n"
static unsigned int net_debug = NET_DEBUG
static const card_ids __init ether3_cids []
unsigned char def_eth_addr [6] = {0x00, 'L', 'i', 'n', 'u', 'x'}


Define Documentation

#define BUS_16   2
 

Definition at line 81 of file ether3.c.

#define BUS_8   1
 

Definition at line 82 of file ether3.c.

#define BUS_UNKNOWN   0
 

Definition at line 83 of file ether3.c.

#define ether3_inb r   )     ({ unsigned int __v = inb((r)); udelay(1); __v; })
 

Definition at line 114 of file ether3.c.

Referenced by ether3_probe_bus_8().

#define ether3_inw r   )     ({ unsigned int __v = inw((r)); udelay(1); __v; })
 

Definition at line 115 of file ether3.c.

Referenced by ether3_close(), ether3_init_for_open(), ether3_interrupt(), ether3_probe_bus_16(), ether3_rx(), ether3_sendpacket(), and ether3_setbuffer().

#define ether3_readbuffer dev,
data,
length   )     insw(REG_BUFWIN, (data), (length) >> 1)
 

Definition at line 163 of file ether3.c.

Referenced by __initfunc(), and ether3_rx().

#define ether3_readlong dev   )     inw(REG_BUFWIN) | (inw(REG_BUFWIN) << 16)
 

Definition at line 169 of file ether3.c.

Referenced by ether3_sendpacket(), and ether3_tx().

#define ether3_readword dev   )     inw(REG_BUFWIN)
 

Definition at line 166 of file ether3.c.

Referenced by ether3_rx().

#define ether3_writebuffer dev,
data,
length   )     outsw(REG_BUFWIN, (data), (length) >> 1)
 

Definition at line 148 of file ether3.c.

Referenced by __initfunc(), and ether3_sendpacket().

#define ether3_writelong dev,
data   ) 
 

Value:

{                       \
        unsigned long reg_bufwin = REG_BUFWIN;                  \
        outw((data), reg_bufwin);                               \
        outw((data) >> 16, reg_bufwin);                         \
}

Definition at line 154 of file ether3.c.

Referenced by __initfunc(), ether3_init_for_open(), and ether3_sendpacket().

#define ether3_writeword dev,
data   )     outw((data), REG_BUFWIN)
 

Definition at line 151 of file ether3.c.

Referenced by ether3_sendpacket().

#define TXHDR_FLAGS   (TXHDR_TRANSMIT|TXHDR_CHAINCONTINUE|TXHDR_DATAFOLLOWS|TXHDR_ENSUCCESS)
 

Referenced by ether3_sendpacket().


Enumeration Type Documentation

enum buffer_rw_t
 

Enumeration values:
buffer_write 
buffer_read 

Definition at line 93 of file ether3.c.


Function Documentation

__initfunc int   ether3_probe(struct device *dev)  ) 
 

Definition at line 501 of file ether3.c.

References ec, ecard_find(), ecard_startfind(), ENODEV, ether3_cids, ether3_probe1(), and NULL.

Here is the call graph for this function:

__initfunc static void   ether3_get_dev(struct device *dev, struct expansion_card *ec)  ) 
 

Definition at line 481 of file ether3.c.

References expansion_card::cid, ecard_address(), ecard_claim, ECARD_MEMC, ioaddr, expansion_card::irq, expansion_card::irqaddr, expansion_card::irqmask, MANU_ANT, in_ecid::manufacturer, PROD_ANT_ETHERB, and in_ecid::product.

Here is the call graph for this function:

__initfunc static int   ether3_init_2(struct device *dev)  ) 
 

Definition at line 276 of file ether3.c.

References buffer_write, CFG1_BUFSELSTAT0, CFG1_DMABURST8, CFG1_LOCBUFMEM, CFG1_RECVCOMPSTAT0, CFG1_RECVPROMISC, CFG1_RECVSPECBRMULTI, CFG1_RECVSPECBROAD, CFG1_TRANSEND, CFG2_CTRLO, CFG2_ERRENCRC, CFG2_RECVCRC, ether3_outb(), ether3_outw(), ether3_setbuffer(), ether3_writelong, i, IFF_MULTICAST, IFF_PROMISC, REG_BUFWIN, REG_COMMAND, REG_CONFIG1, REG_CONFIG2, REG_RECVEND, REG_RECVPTR, REG_TRANSMITPTR, dev_priv::regs, dev_priv::rx_head, and TX_END.

Here is the call graph for this function:

__initfunc static int   ether3_ramtest(struct device *dev, unsigned char byte)  ) 
 

Definition at line 227 of file ether3.c.

References buffer_read, buffer_write, ether3_readbuffer, ether3_setbuffer(), ether3_writebuffer, i, kfree(), kmalloc(), memset, printk, ret, RX_END, RX_LEN, RX_START, TX_END, and xff.

Here is the call graph for this function:

__initfunc static void   ether3_addr(char *addr, struct expansion_card *ec)  ) 
 

Definition at line 202 of file ether3.c.

References in_chunk_dir::d, def_eth_addr, ecard_readchunk(), i, KERN_ERR, memcpy, printk, s, simple_strtoul(), strchr, and x10.

Here is the call graph for this function:

static int ether3_close struct device *  dev  )  [static]
 

Definition at line 551 of file ether3.c.

References CMD_RXOFF, CMD_TXOFF, disable_irq, ether3_inw, ether3_outb(), ether3_outw(), free_irq(), MOD_DEC_USE_COUNT, REG_COMMAND, REG_CONFIG2, REG_STATUS, dev_priv::regs, STAT_RXON, STAT_TXON, and x80.

Here is the call graph for this function:

static struct enet_statistics* ether3_getstats struct device *  dev  )  [static]
 

Definition at line 576 of file ether3.c.

References dev_priv::stats.

static void ether3_init_for_open struct device *  dev  )  [static]
 

Definition at line 327 of file ether3.c.

References buffer_write, CFG1_BUFSELSTAT0, CFG1_LOCBUFMEM, CFG1_TRANSEND, CFG2_CTRLO, CFG2_RESET, CMD_ENINTRX, CMD_ENINTTX, CMD_RXOFF, CMD_RXON, CMD_TXOFF, enet_statistics, ether3_inw, ether3_outb(), ether3_outw(), ether3_setbuffer(), ether3_writelong, i, memset, REG_BUFWIN, REG_COMMAND, REG_CONFIG1, REG_CONFIG2, REG_RECVEND, REG_RECVPTR, REG_STATUS, REG_TRANSMITPTR, dev_priv::regs, dev_priv::rx_head, RX_START, STAT_RXON, STAT_TXON, dev_priv::stats, TX_END, dev_priv::tx_head, dev_priv::tx_tail, and udelay.

Referenced by ether3_open().

Here is the call graph for this function:

static void ether3_interrupt int  irq,
void *  dev_id,
struct pt_regs regs
[static]
 

Definition at line 711 of file ether3.c.

References CMD_ACKINTRX, CMD_ACKINTTX, DEBUG_INT, device, ether3_inw, ether3_outw(), ether3_rx(), ether3_tx(), net_debug, printk, REG_COMMAND, REG_STATUS, dev_priv::regs, STAT_INTRX, STAT_INTTX, and status.

Referenced by ether3_open().

Here is the call graph for this function:

static void ether3_ledoff unsigned long  data  )  [static]
 

Definition at line 176 of file ether3.c.

References CFG2_CTRLO, dev, device, ether3_outw(), REG_CONFIG2, and dev_priv::regs.

Referenced by ether3_ledon().

Here is the call graph for this function:

static void ether3_ledon struct device *  dev,
struct dev_priv priv
[inline, static]
 

Definition at line 187 of file ether3.c.

References add_timer(), CFG2_CTRLO, timer_list::data, del_timer(), ether3_ledoff(), ether3_outw(), timer_list::expires, timer_list::function, HZ, jiffies, long, REG_CONFIG2, dev_priv::regs, and dev_priv::timer.

Referenced by ether3_rx(), and ether3_sendpacket().

Here is the call graph for this function:

static int ether3_open struct device *  dev  )  [static]
 

Definition at line 529 of file ether3.c.

References EAGAIN, ether3_init_for_open(), ether3_interrupt(), MOD_DEC_USE_COUNT, MOD_INC_USE_COUNT, and request_irq().

Here is the call graph for this function:

static void ether3_outb int  v,
const int  r
[inline, static]
 

Definition at line 103 of file ether3.c.

References outb, and udelay.

Referenced by __initfunc(), ether3_close(), ether3_init_for_open(), and ether3_probe_bus_8().

static void ether3_outw int  v,
const int  r
[inline, static]
 

Definition at line 109 of file ether3.c.

References outw, and udelay.

Referenced by __initfunc(), ether3_close(), ether3_init_for_open(), ether3_interrupt(), ether3_ledoff(), ether3_ledon(), ether3_probe_bus_16(), ether3_rx(), ether3_sendpacket(), ether3_setbuffer(), and ether3_setmulticastlist().

static int ether3_probe_bus_16 struct device *  dev,
int  val
[inline, static]
 

Definition at line 388 of file ether3.c.

References ether3_inw, ether3_outw(), KERN_DEBUG, printk, and REG_RECVPTR.

Here is the call graph for this function:

static int ether3_probe_bus_8 struct device *  dev,
int  val
[inline, static]
 

Definition at line 367 of file ether3.c.

References ether3_inb, ether3_outb(), KERN_DEBUG, printk, and REG_RECVPTR.

Here is the call graph for this function:

static int ether3_rx struct device *  dev,
struct dev_priv priv,
unsigned int  maxcnt
[static]
 

Definition at line 750 of file ether3.c.

References buf, buffer_read, CMD_RXON, sk_buff::dev, done, enet_statistics, eth_type_trans(), ether3_inw, ether3_ledon(), ether3_outw(), ether3_readbuffer, ether3_readword, ether3_setbuffer(), HZ, jiffies, length(), netif_rx(), ntohs(), printk, REG_COMMAND, REG_RECVEND, REG_RECVPTR, REG_STATUS, dev_priv::regs, RX_END, dev_priv::rx_head, RX_START, RXHDR_CHAINCONTINUE, RXHDR_RECEIVE, RXSTAT_CRCERROR, RXSTAT_DONE, RXSTAT_DRIBBLEERROR, RXSTAT_OVERSIZE, RXSTAT_SHORTPACKET, STAT_RXON, dev_priv::stats, stats, and status.

Referenced by ether3_interrupt().

Here is the call graph for this function:

static int ether3_sendpacket struct sk_buff skb,
struct device *  dev
[static]
 

Definition at line 609 of file ether3.c.

References dev_priv::broken, buffer_read, buffer_write, CFG2_CTRLO, CMD_TXON, sk_buff::data, del_timer(), dev_kfree_skb, ETH_ZLEN, ether3_inw, ether3_ledon(), ether3_outw(), ether3_readlong, ether3_setbuffer(), ether3_writebuffer, ether3_writelong, ether3_writeword, htons(), jiffies, KERN_ERR, sk_buff::len, length(), printk, ptr, REG_COMMAND, REG_CONFIG1, REG_CONFIG2, REG_RECVEND, REG_RECVPTR, REG_STATUS, REG_TRANSMITPTR, dev_priv::regs, restore_flags, retry, save_flags_cli, STAT_TXON, dev_priv::stats, test_and_set_bit, dev_priv::timer, dev_priv::tx_head, dev_priv::tx_tail, TXHDR_CHAINCONTINUE, and TXHDR_FLAGS.

Here is the call graph for this function:

static int ether3_setbuffer struct device *  dev,
buffer_rw_t  read,
int  start
[static]
 

Definition at line 118 of file ether3.c.

References dev_priv::broken, buffer_read, CFG1_LOCBUFMEM, CMD_FIFOREAD, CMD_FIFOWRITE, ether3_inw, ether3_outw(), printk, REG_COMMAND, REG_CONFIG1, REG_DMAADDR, REG_STATUS, dev_priv::regs, STAT_FIFOEMPTY, timeout, and udelay.

Referenced by __initfunc(), ether3_init_for_open(), ether3_rx(), ether3_sendpacket(), and ether3_tx().

Here is the call graph for this function:

static void ether3_setmulticastlist struct device *  dev  )  [static]
 

Definition at line 588 of file ether3.c.

References CFG1_LOCBUFMEM, CFG1_RECVPROMISC, CFG1_RECVSPECBRMULTI, CFG1_RECVSPECBROAD, ether3_outw(), IFF_ALLMULTI, IFF_PROMISC, REG_CONFIG1, and dev_priv::regs.

Here is the call graph for this function:

static void ether3_tx struct device *  dev,
struct dev_priv priv
[static]
 

Definition at line 870 of file ether3.c.

References buffer_read, ether3_readlong, ether3_setbuffer(), mark_bh, NET_BH, dev_priv::stats, status, dev_priv::tx_tail, TXHDR_TRANSMIT, TXSTAT_16COLLISIONS, TXSTAT_BABBLED, and TXSTAT_DONE.

Referenced by ether3_interrupt().

Here is the call graph for this function:


Variable Documentation

unsigned char def_eth_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'}
 

Definition at line 89 of file ether3.c.

Referenced by __initfunc().

const card_ids __init ether3_cids[] [static]
 

Initial value:

 {
        { MANU_ANT2, PROD_ANT_ETHER3 },
        { MANU_ANT,  PROD_ANT_ETHER3 },
        { MANU_ANT,  PROD_ANT_ETHERB }, 
        { 0xffff, 0xffff }
}

Definition at line 70 of file ether3.c.

Referenced by __initfunc().

unsigned int net_debug = NET_DEBUG [static]
 

Definition at line 69 of file ether3.c.

char* version = "ether3 ethernet driver (c) 1995-1999 R.M.King v1.15\n" [static]
 

Definition at line 41 of file ether3.c.