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

enet.c File Reference

#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/malloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <asm/8xx_immap.h>
#include <asm/pgtable.h>
#include <asm/fads.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include "commproc.h"

Include dependency graph for enet.c:

Go to the source code of this file.

Defines

#define CPM_ENET_RX_PAGES   4
#define CPM_ENET_RX_FRSIZE   2048
#define CPM_ENET_RX_FRPPG   (PAGE_SIZE / CPM_ENET_RX_FRSIZE)
#define RX_RING_SIZE   (CPM_ENET_RX_FRPPG * CPM_ENET_RX_PAGES)
#define TX_RING_SIZE   8
#define TX_RING_MOD_MASK   7
#define PKT_MAXBUF_SIZE   1518
#define PKT_MINBUF_SIZE   64
#define PKT_MAXBLR_SIZE   1520
#define CPM_CR_ENET   CPM_CR_CH_SCC2
#define PROFF_ENET   PROFF_SCC2
#define SCC_ENET   1
#define CPMVEC_ENET   CPMVEC_SCC2

Functions

static int cpm_enet_open (struct device *dev)
static int cpm_enet_start_xmit (struct sk_buff *skb, struct device *dev)
static int cpm_enet_rx (struct device *dev)
static void cpm_enet_interrupt (void *dev_id)
static int cpm_enet_close (struct device *dev)
static struct net_device_statscpm_enet_get_stats (struct device *dev)
static void set_multicast_list (struct device *dev)
int __init cpm_enet_init ()
int __init m8xx_enet_init (void)


Define Documentation

#define CPM_CR_ENET   CPM_CR_CH_SCC2
 

Definition at line 172 of file enet.c.

Referenced by cpm_enet_interrupt(), m8xx_enet_init(), and set_multicast_list().

#define CPM_ENET_RX_FRPPG   (PAGE_SIZE / CPM_ENET_RX_FRSIZE)
 

Definition at line 118 of file enet.c.

Referenced by m8xx_enet_init().

#define CPM_ENET_RX_FRSIZE   2048
 

Definition at line 117 of file enet.c.

Referenced by m8xx_enet_init().

#define CPM_ENET_RX_PAGES   4
 

Definition at line 116 of file enet.c.

Referenced by m8xx_enet_init().

#define CPMVEC_ENET   CPMVEC_SCC2
 

Definition at line 175 of file enet.c.

Referenced by m8xx_enet_init().

#define PKT_MAXBLR_SIZE   1520
 

Definition at line 127 of file enet.c.

Referenced by __initfunc(), and m8xx_enet_init().

#define PKT_MAXBUF_SIZE   1518
 

Definition at line 125 of file enet.c.

Referenced by __initfunc(), and m8xx_enet_init().

#define PKT_MINBUF_SIZE   64
 

Definition at line 126 of file enet.c.

Referenced by m8xx_enet_init().

#define PROFF_ENET   PROFF_SCC2
 

Definition at line 173 of file enet.c.

Referenced by m8xx_enet_init().

#define RX_RING_SIZE   (CPM_ENET_RX_FRPPG * CPM_ENET_RX_PAGES)
 

Definition at line 119 of file enet.c.

Referenced by __initfunc(), ace_bh(), ace_init(), ace_interrupt(), alloc_rbufs(), ariadne_init_ring(), ariadne_open(), ariadne_rx(), ariadne_start_xmit(), bigmac_clean_rings(), bigmac_init_rings(), BoardAllocMem(), BoardInitMem(), boomerang_rx(), cpm_enet_start_xmit(), epic_close(), epic_init_ring(), epic_restart(), epic_rx(), fec_enet_start_xmit(), free_rbufs(), hamachi_close(), hamachi_init_ring(), hamachi_rx(), hamachi_tx_timeout(), happy_meal_clean_rings(), happy_meal_ether_init(), happy_meal_init_rings(), i596_open(), init_ring(), lance_init_ring(), lance_purge_ring(), lance_rx(), m8xx_enet_init(), myri_clean_rings(), myri_ether_init(), myri_init_rings(), netdev_close(), netdev_rx(), NEXT_RX(), pcnet32_close(), pcnet32_init_ring(), pcnet32_rx(), pcnet32_start_xmit(), PREV_RX(), qe_init_rings(), qe_rx(), rx_oom_timer(), SetupRing(), speedo_close(), speedo_init_rx_ring(), speedo_interrupt(), speedo_refill_rx_buf(), speedo_resume(), speedo_rx(), speedo_show_state(), sun4c_bigmac_init_rings(), sun4c_bigmac_rx(), sun4c_happy_meal_init_rings(), sun4d_happy_meal_start_xmit(), tulip_close(), tulip_init_ring(), tulip_interrupt(), tulip_refill_rx(), tulip_rx(), tulip_tx_timeout(), vortex_close(), vortex_open(), yellowfin_close(), yellowfin_init_ring(), yellowfin_rx(), and yellowfin_tx_timeout().

#define SCC_ENET   1
 

Definition at line 174 of file enet.c.

Referenced by m8xx_enet_init().

#define TX_RING_MOD_MASK   7
 

Definition at line 121 of file enet.c.

Referenced by __initfunc(), cpm_enet_interrupt(), cpm_enet_start_xmit(), fec_enet_interrupt(), fec_enet_start_xmit(), lance_interrupt(), lance_open(), lance_start_xmit(), lance_tx(), pcnet32_interrupt(), and pcnet32_start_xmit().

#define TX_RING_SIZE   8
 

Definition at line 120 of file enet.c.

Referenced by __initfunc(), alloc_tbufs(), ariadne_init_ring(), ariadne_interrupt(), ariadne_open(), ariadne_start_xmit(), bigmac_clean_rings(), bigmac_init_rings(), BoardAllocMem(), BoardInitMem(), boomerang_interrupt(), boomerang_start_xmit(), cpm_enet_start_xmit(), epic_close(), epic_init_ring(), epic_interrupt(), epic_restart(), epic_start_xmit(), epic_timer(), fec_enet_start_xmit(), free_tbufs(), hamachi_close(), hamachi_init_ring(), hamachi_interrupt(), hamachi_start_xmit(), hamachi_tx(), hamachi_tx_timeout(), i596_start_xmit(), init_ring(), intr_handler(), IRQ(), lance_init_ring(), lance_interrupt(), lance_purge_ring(), m8xx_enet_init(), myri_clean_rings(), myri_ether_init(), netdev_close(), netdev_ethtool_ioctl(), pcnet32_close(), pcnet32_init_ring(), pcnet32_interrupt(), pcnet32_purge_tx_ring(), pcnet32_start_xmit(), qe_start_xmit(), set_rx_mode(), SetupRing(), speedo_close(), speedo_purge_tx(), speedo_resume(), speedo_show_state(), speedo_start_xmit(), speedo_tx_buffer_gc(), speedo_tx_timeout(), start_tx(), sun4c_bigmac_init_rings(), tulip_close(), tulip_init_ring(), tulip_interrupt(), tulip_start_xmit(), tulip_tx_timeout(), vortex_close(), vortex_open(), vortex_start_xmit(), vortex_tx_timeout(), yellowfin_close(), yellowfin_init_ring(), yellowfin_interrupt(), yellowfin_start_xmit(), and yellowfin_tx_timeout().


Function Documentation

static int cpm_enet_close struct device *  dev  )  [static]
 

Definition at line 600 of file enet.c.

Referenced by m8xx_enet_init().

static struct net_device_stats * cpm_enet_get_stats struct device *  dev  )  [static]
 

Definition at line 608 of file enet.c.

References cpm_enet_private::stats.

Referenced by m8xx_enet_init().

int __init cpm_enet_init  ) 
 

Definition at line 701 of file enet.c.

References m8xx_enet_init().

Referenced by __initfunc().

Here is the call graph for this function:

static void cpm_enet_interrupt void *  dev_id  )  [static]
 

Definition at line 327 of file enet.c.

References BD_ENET_TX_CSL, BD_ENET_TX_DEF, BD_ENET_TX_HB, BD_ENET_TX_LC, BD_ENET_TX_READY, BD_ENET_TX_RL, BD_ENET_TX_UN, BD_ENET_TX_WRAP, cpm_buf_desc::cbd_sc, net_device_stats::collisions, comm_proc::cp_cpcr, CPM_CR_ENET, CPM_CR_FLG, CPM_CR_RESTART_TX, cpm_enet_rx(), cpmp, cpm_enet_private::cur_tx, dev, dev_kfree_skb, device, cpm_enet_private::dirty_tx, mark_bh, mk_cr_cmd, NET_BH, printk, net_device_stats::rx_dropped, scc::scc_scce, SCCE_ENET_BSY, SCCE_ENET_RXF, SCCE_ENET_TXB, SCCE_ENET_TXE, cpm_enet_private::sccp, cpm_enet_private::skb_dirty, cpm_enet_private::stats, net_device_stats::tx_aborted_errors, cpm_enet_private::tx_bd_base, net_device_stats::tx_carrier_errors, net_device_stats::tx_errors, net_device_stats::tx_fifo_errors, cpm_enet_private::tx_full, net_device_stats::tx_heartbeat_errors, net_device_stats::tx_packets, TX_RING_MOD_MASK, cpm_enet_private::tx_skbuff, net_device_stats::tx_window_errors, and ushort.

Referenced by m8xx_enet_init().

Here is the call graph for this function:

static int cpm_enet_open struct device *  dev  )  [static]
 

Definition at line 184 of file enet.c.

Referenced by m8xx_enet_init().

static int cpm_enet_rx struct device *  dev  )  [static]
 

Definition at line 506 of file enet.c.

References __va, BD_ENET_RX_CL, BD_ENET_RX_CR, BD_ENET_RX_EMPTY, BD_ENET_RX_FIRST, BD_ENET_RX_LAST, BD_ENET_RX_LG, BD_ENET_RX_NO, BD_ENET_RX_OV, BD_ENET_RX_SH, BD_ENET_RX_STATS, BD_ENET_RX_WRAP, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_datlen, cpm_buf_desc::cbd_sc, cpm_enet_private::cur_rx, sk_buff::dev, eth_copy_and_sum(), eth_type_trans(), netif_rx(), NULL, printk, sk_buff::protocol, cpm_enet_private::rx_bd_base, net_device_stats::rx_bytes, net_device_stats::rx_crc_errors, net_device_stats::rx_dropped, net_device_stats::rx_frame_errors, net_device_stats::rx_length_errors, net_device_stats::rx_packets, cpm_enet_private::stats, and ushort.

Referenced by cpm_enet_interrupt().

Here is the call graph for this function:

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

Definition at line 199 of file enet.c.

References __pa, BD_ENET_TX_INTR, BD_ENET_TX_LAST, BD_ENET_TX_PAD, BD_ENET_TX_READY, BD_ENET_TX_STATS, BD_ENET_TX_TC, BD_ENET_TX_WRAP, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_datlen, cpm_buf_desc::cbd_sc, cli, cpm_enet_private::cur_rx, cpm_enet_private::cur_tx, sk_buff::data, ETH_ZLEN, i, jiffies, sk_buff::len, cpm_enet_private::lock, printk, restore_flags, cpm_enet_private::rx_bd_base, RX_RING_SIZE, save_flags, cpm_enet_private::skb_cur, cpm_enet_private::stats, test_and_set_bit, cpm_enet_private::tx_bd_base, net_device_stats::tx_bytes, net_device_stats::tx_errors, cpm_enet_private::tx_full, TX_RING_MOD_MASK, TX_RING_SIZE, and cpm_enet_private::tx_skbuff.

Referenced by m8xx_enet_init().

int __init m8xx_enet_init void   ) 
 

Definition at line 702 of file enet.c.

References __clear_user, __pa, _PAGE_NO_CACHE, BD_ENET_RX_EMPTY, BD_ENET_RX_INTR, BD_SC_WRAP, cpm_buf_desc::cbd_bufaddr, cpm_buf_desc::cbd_sc, comm_proc::cp_cpcr, comm_proc::cp_dparam, comm_proc::cp_dpmem, comm_proc::cp_pbdat, comm_proc::cp_pbdir, comm_proc::cp_pbpar, comm_proc::cp_scc, comm_proc::cp_sicr, CPM_CR_ENET, CPM_CR_FLG, CPM_CR_INIT_TRX, cpm_enet_close(), cpm_enet_get_stats(), cpm_enet_interrupt(), cpm_enet_open(), CPM_ENET_RX_FRPPG, CPM_ENET_RX_FRSIZE, CPM_ENET_RX_PAGES, cpm_enet_start_xmit(), cpm_install_handler(), cpmp, CPMVEC_ENET, current, dev, device, ep, flush_tlb_page, i, immap::im_ioport, IMAP_ADDR, init_etherdev(), init_task, io_port::iop_padir, io_port::iop_paodr, io_port::iop_papar, io_port::iop_pcdat, io_port::iop_pcdir, io_port::iop_pcpar, io_port::iop_pcso, j, kmalloc(), long, m8xx_cpm_dpalloc(), mk_cr_cmd, PA_ENET_RCLK, PA_ENET_RXD, PA_ENET_TCLK, PA_ENET_TXD, PC_ENET_CLSN, PC_ENET_RENA, PC_ENET_TENA, PKT_MAXBLR_SIZE, PKT_MAXBUF_SIZE, PKT_MINBUF_SIZE, printk, PROFF_ENET, res, RX_RING_SIZE, scc::scc_dsr, SCC_EB, SCC_ENET, scc::scc_gsmrh, scc::scc_gsmrl, SCC_GSMRL_ENR, SCC_GSMRL_ENT, SCC_GSMRL_MODE_ENET, SCC_GSMRL_TCI, SCC_GSMRL_TPL_48, SCC_GSMRL_TPP_10, scc_param::scc_mrblr, scc::scc_pmsr, SCC_PMSR_ENCRC, SCC_PMSR_NIB22, scc_param::scc_rbase, scc_param::scc_rfcr, scc::scc_scce, scc::scc_sccm, scc_param::scc_tbase, scc_param::scc_tfcr, SCCE_ENET_RXF, SCCE_ENET_TXB, SCCE_ENET_TXE, cpm_enet_private::sccp, scc_enet::sen_alec, scc_enet::sen_cmask, scc_enet::sen_cpres, scc_enet::sen_crcec, scc_enet::sen_disfc, scc_enet::sen_gaddr1, scc_enet::sen_gaddr2, scc_enet::sen_gaddr3, scc_enet::sen_gaddr4, scc_enet::sen_genscc, scc_enet::sen_iaddr1, scc_enet::sen_iaddr2, scc_enet::sen_iaddr3, scc_enet::sen_iaddr4, scc_enet::sen_maxd1, scc_enet::sen_maxd2, scc_enet::sen_maxflr, scc_enet::sen_minflr, scc_enet::sen_paddrh, scc_enet::sen_pads, scc_enet::sen_pper, scc_enet::sen_retlim, scc_enet::sen_taddrh, scc_enet::sen_taddrl, scc_enet::sen_taddrm, set_multicast_list(), SICR_ENET_CLKRT, SICR_ENET_MASK, TX_RING_SIZE, uint, and va_to_pte().

Referenced by cpm_enet_init().

Here is the call graph for this function:

static void set_multicast_list struct device *  dev  )  [static]
 

Definition at line 625 of file enet.c.

References comm_proc::cp_cpcr, CPM_CR_ENET, CPM_CR_FLG, CPM_CR_SET_GADDR, cpmp, ep, i, IFF_ALLMULTI, IFF_PROMISC, j, mk_cr_cmd, printk, scc::scc_pmsr, SCC_PMSR_PRO, cpm_enet_private::sccp, scc_enet::sen_gaddr1, scc_enet::sen_gaddr2, scc_enet::sen_gaddr3, scc_enet::sen_gaddr4, scc_enet::sen_taddrh, u_char, and udelay.

Referenced by __initfunc(), depca_ioctl(), eepro_probe1(), el3_probe(), ethdev_init(), ewrk3_init(), ewrk3_ioctl(), lp486e_probe(), ltpc_init(), m8xx_enet_init(), and sbni_probe1().