Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
eth_v10.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.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/string.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/if.h>
#include <linux/mii.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <arch/svinto.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/dma.h>
#include <asm/ethernet.h>
#include <asm/cache.h>
#include <arch/io_interface_mux.h>

Go to the source code of this file.

Data Structures

struct  net_local
 
struct  etrax_eth_descr
 
struct  transceiver_ops
 

Macros

#define D(x)
 
#define MAX_MEDIA_DATA_SIZE   1522
 
#define MIN_PACKET_LEN   46
 
#define ETHER_HEAD_LEN   14
 
#define MDIO_START   0x1
 
#define MDIO_READ   0x2
 
#define MDIO_WRITE   0x1
 
#define MDIO_PREAMBLE   0xfffffffful
 
#define MDIO_AUX_CTRL_STATUS_REG   0x18
 
#define MDIO_BC_FULL_DUPLEX_IND   0x1
 
#define MDIO_BC_SPEED   0x2
 
#define MDIO_TDK_DIAGNOSTIC_REG   18
 
#define MDIO_TDK_DIAGNOSTIC_RATE   0x400
 
#define MDIO_TDK_DIAGNOSTIC_DPLX   0x800
 
#define MDIO_INT_STATUS_REG_2   0x0011
 
#define MDIO_INT_FULL_DUPLEX_IND   (1 << 9)
 
#define MDIO_INT_SPEED   (1 << 14)
 
#define NET_FLASH_TIME   (HZ/50) /* 20 ms */
 
#define NET_FLASH_PAUSE   (HZ/100) /* 10 ms */
 
#define NET_LINK_UP_CHECK_INTERVAL   (2*HZ) /* 2 s */
 
#define NET_DUPLEX_CHECK_INTERVAL   (2*HZ) /* 2 s */
 
#define NO_NETWORK_ACTIVITY   0
 
#define NETWORK_ACTIVITY   1
 
#define NBR_OF_RX_DESC   32
 
#define NBR_OF_TX_DESC   16
 
#define RX_COPYBREAK   256
 
#define RX_QUEUE_THRESHOLD   NBR_OF_RX_DESC/2
 
#define GET_BIT(bit, val)   (((val) >> (bit)) & 0x01)
 
#define SETF(var, reg, field, val)
 
#define SETS(var, reg, field, val)
 
#define tx_done(dev)   (*R_DMA_CH0_CMD == 0)
 

Typedefs

typedef struct etrax_eth_descr etrax_eth_descr
 

Enumerations

enum  duplex { half, full, autoneg }
 

Functions

 __setup ("etrax100_eth=", e100_boot_setup)
 
 module_init (etrax_init_module)
 

Variables

struct transceiver_ops transceivers []
 
struct transceiver_opstransceiver = &transceivers[0]
 

Macro Definition Documentation

#define D (   x)

Definition at line 43 of file eth_v10.c.

#define ETHER_HEAD_LEN   14

Definition at line 101 of file eth_v10.c.

#define GET_BIT (   bit,
  val 
)    (((val) >> (bit)) & 0x01)

Definition at line 147 of file eth_v10.c.

#define MAX_MEDIA_DATA_SIZE   1522

Definition at line 98 of file eth_v10.c.

#define MDIO_AUX_CTRL_STATUS_REG   0x18

Definition at line 112 of file eth_v10.c.

#define MDIO_BC_FULL_DUPLEX_IND   0x1

Definition at line 113 of file eth_v10.c.

#define MDIO_BC_SPEED   0x2

Definition at line 114 of file eth_v10.c.

#define MDIO_INT_FULL_DUPLEX_IND   (1 << 9)

Definition at line 123 of file eth_v10.c.

#define MDIO_INT_SPEED   (1 << 14)

Definition at line 124 of file eth_v10.c.

#define MDIO_INT_STATUS_REG_2   0x0011

Definition at line 122 of file eth_v10.c.

#define MDIO_PREAMBLE   0xfffffffful

Definition at line 109 of file eth_v10.c.

#define MDIO_READ   0x2

Definition at line 107 of file eth_v10.c.

#define MDIO_START   0x1

Definition at line 106 of file eth_v10.c.

#define MDIO_TDK_DIAGNOSTIC_DPLX   0x800

Definition at line 119 of file eth_v10.c.

#define MDIO_TDK_DIAGNOSTIC_RATE   0x400

Definition at line 118 of file eth_v10.c.

#define MDIO_TDK_DIAGNOSTIC_REG   18

Definition at line 117 of file eth_v10.c.

#define MDIO_WRITE   0x1

Definition at line 108 of file eth_v10.c.

#define MIN_PACKET_LEN   46

Definition at line 100 of file eth_v10.c.

#define NBR_OF_RX_DESC   32

Definition at line 135 of file eth_v10.c.

#define NBR_OF_TX_DESC   16

Definition at line 136 of file eth_v10.c.

#define NET_DUPLEX_CHECK_INTERVAL   (2*HZ) /* 2 s */

Definition at line 130 of file eth_v10.c.

#define NET_FLASH_PAUSE   (HZ/100) /* 10 ms */

Definition at line 128 of file eth_v10.c.

#define NET_FLASH_TIME   (HZ/50) /* 20 ms */

Definition at line 127 of file eth_v10.c.

#define NET_LINK_UP_CHECK_INTERVAL   (2*HZ) /* 2 s */

Definition at line 129 of file eth_v10.c.

#define NETWORK_ACTIVITY   1

Definition at line 133 of file eth_v10.c.

#define NO_NETWORK_ACTIVITY   0

Definition at line 132 of file eth_v10.c.

#define RX_COPYBREAK   256

Definition at line 140 of file eth_v10.c.

#define RX_QUEUE_THRESHOLD   NBR_OF_RX_DESC/2

Definition at line 145 of file eth_v10.c.

#define SETF (   var,
  reg,
  field,
  val 
)
Value:
var = (var & ~IO_MASK_(reg##_, field##_)) | \

Definition at line 150 of file eth_v10.c.

#define SETS (   var,
  reg,
  field,
  val 
)
Value:
var = (var & ~IO_MASK_(reg##_, field##_)) | \
IO_STATE_(reg##_, field##_, _##val)

Definition at line 152 of file eth_v10.c.

#define tx_done (   dev)    (*R_DMA_CH0_CMD == 0)

Definition at line 274 of file eth_v10.c.

Typedef Documentation

Enumeration Type Documentation

enum duplex
Enumerator:
half 
full 
autoneg 

Definition at line 89 of file eth_v10.c.

Function Documentation

__setup ( )
module_init ( etrax_init_module  )

Variable Documentation

struct transceiver_ops* transceiver = &transceivers[0]

Definition at line 255 of file eth_v10.c.

struct transceiver_ops transceivers[]
Initial value:
=
{
{0x1018, broadcom_check_speed, broadcom_check_duplex},
{0xC039, tdk_check_speed, tdk_check_duplex},
{0x039C, tdk_check_speed, tdk_check_duplex},
{0x04de, intel_check_speed, intel_check_duplex},
{0x0000, generic_check_speed, generic_check_duplex}
}

Definition at line 242 of file eth_v10.c.