Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
lpc_eth.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/crc32.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/clk.h>
#include <linux/workqueue.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/phy.h>
#include <linux/dma-mapping.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/types.h>
#include <linux/io.h>
#include <mach/board.h>
#include <mach/platform.h>
#include <mach/hardware.h>

Go to the source code of this file.

Data Structures

struct  txrx_desc_t
 
struct  rx_status_t
 
struct  netdata_local
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MODNAME   "lpc-eth"
 
#define DRV_VERSION   "1.00"
 
#define ENET_MAXF_SIZE   1536
 
#define ENET_RX_DESC   48
 
#define ENET_TX_DESC   16
 
#define NAPI_WEIGHT   16
 
#define LPC_ENET_MAC1(x)   (x + 0x000)
 
#define LPC_ENET_MAC2(x)   (x + 0x004)
 
#define LPC_ENET_IPGT(x)   (x + 0x008)
 
#define LPC_ENET_IPGR(x)   (x + 0x00C)
 
#define LPC_ENET_CLRT(x)   (x + 0x010)
 
#define LPC_ENET_MAXF(x)   (x + 0x014)
 
#define LPC_ENET_SUPP(x)   (x + 0x018)
 
#define LPC_ENET_TEST(x)   (x + 0x01C)
 
#define LPC_ENET_MCFG(x)   (x + 0x020)
 
#define LPC_ENET_MCMD(x)   (x + 0x024)
 
#define LPC_ENET_MADR(x)   (x + 0x028)
 
#define LPC_ENET_MWTD(x)   (x + 0x02C)
 
#define LPC_ENET_MRDD(x)   (x + 0x030)
 
#define LPC_ENET_MIND(x)   (x + 0x034)
 
#define LPC_ENET_SA0(x)   (x + 0x040)
 
#define LPC_ENET_SA1(x)   (x + 0x044)
 
#define LPC_ENET_SA2(x)   (x + 0x048)
 
#define LPC_ENET_COMMAND(x)   (x + 0x100)
 
#define LPC_ENET_STATUS(x)   (x + 0x104)
 
#define LPC_ENET_RXDESCRIPTOR(x)   (x + 0x108)
 
#define LPC_ENET_RXSTATUS(x)   (x + 0x10C)
 
#define LPC_ENET_RXDESCRIPTORNUMBER(x)   (x + 0x110)
 
#define LPC_ENET_RXPRODUCEINDEX(x)   (x + 0x114)
 
#define LPC_ENET_RXCONSUMEINDEX(x)   (x + 0x118)
 
#define LPC_ENET_TXDESCRIPTOR(x)   (x + 0x11C)
 
#define LPC_ENET_TXSTATUS(x)   (x + 0x120)
 
#define LPC_ENET_TXDESCRIPTORNUMBER(x)   (x + 0x124)
 
#define LPC_ENET_TXPRODUCEINDEX(x)   (x + 0x128)
 
#define LPC_ENET_TXCONSUMEINDEX(x)   (x + 0x12C)
 
#define LPC_ENET_TSV0(x)   (x + 0x158)
 
#define LPC_ENET_TSV1(x)   (x + 0x15C)
 
#define LPC_ENET_RSV(x)   (x + 0x160)
 
#define LPC_ENET_FLOWCONTROLCOUNTER(x)   (x + 0x170)
 
#define LPC_ENET_FLOWCONTROLSTATUS(x)   (x + 0x174)
 
#define LPC_ENET_RXFILTER_CTRL(x)   (x + 0x200)
 
#define LPC_ENET_RXFILTERWOLSTATUS(x)   (x + 0x204)
 
#define LPC_ENET_RXFILTERWOLCLEAR(x)   (x + 0x208)
 
#define LPC_ENET_HASHFILTERL(x)   (x + 0x210)
 
#define LPC_ENET_HASHFILTERH(x)   (x + 0x214)
 
#define LPC_ENET_INTSTATUS(x)   (x + 0xFE0)
 
#define LPC_ENET_INTENABLE(x)   (x + 0xFE4)
 
#define LPC_ENET_INTCLEAR(x)   (x + 0xFE8)
 
#define LPC_ENET_INTSET(x)   (x + 0xFEC)
 
#define LPC_ENET_POWERDOWN(x)   (x + 0xFF4)
 
#define LPC_MAC1_RECV_ENABLE   (1 << 0)
 
#define LPC_MAC1_PASS_ALL_RX_FRAMES   (1 << 1)
 
#define LPC_MAC1_RX_FLOW_CONTROL   (1 << 2)
 
#define LPC_MAC1_TX_FLOW_CONTROL   (1 << 3)
 
#define LPC_MAC1_LOOPBACK   (1 << 4)
 
#define LPC_MAC1_RESET_TX   (1 << 8)
 
#define LPC_MAC1_RESET_MCS_TX   (1 << 9)
 
#define LPC_MAC1_RESET_RX   (1 << 10)
 
#define LPC_MAC1_RESET_MCS_RX   (1 << 11)
 
#define LPC_MAC1_SIMULATION_RESET   (1 << 14)
 
#define LPC_MAC1_SOFT_RESET   (1 << 15)
 
#define LPC_MAC2_FULL_DUPLEX   (1 << 0)
 
#define LPC_MAC2_FRAME_LENGTH_CHECKING   (1 << 1)
 
#define LPC_MAC2_HUGH_LENGTH_CHECKING   (1 << 2)
 
#define LPC_MAC2_DELAYED_CRC   (1 << 3)
 
#define LPC_MAC2_CRC_ENABLE   (1 << 4)
 
#define LPC_MAC2_PAD_CRC_ENABLE   (1 << 5)
 
#define LPC_MAC2_VLAN_PAD_ENABLE   (1 << 6)
 
#define LPC_MAC2_AUTO_DETECT_PAD_ENABLE   (1 << 7)
 
#define LPC_MAC2_PURE_PREAMBLE_ENFORCEMENT   (1 << 8)
 
#define LPC_MAC2_LONG_PREAMBLE_ENFORCEMENT   (1 << 9)
 
#define LPC_MAC2_NO_BACKOFF   (1 << 12)
 
#define LPC_MAC2_BACK_PRESSURE   (1 << 13)
 
#define LPC_MAC2_EXCESS_DEFER   (1 << 14)
 
#define LPC_IPGT_LOAD(n)   ((n) & 0x7F)
 
#define LPC_IPGR_LOAD_PART2(n)   ((n) & 0x7F)
 
#define LPC_IPGR_LOAD_PART1(n)   (((n) & 0x7F) << 8)
 
#define LPC_CLRT_LOAD_RETRY_MAX(n)   ((n) & 0xF)
 
#define LPC_CLRT_LOAD_COLLISION_WINDOW(n)   (((n) & 0x3F) << 8)
 
#define LPC_MAXF_LOAD_MAX_FRAME_LEN(n)   ((n) & 0xFFFF)
 
#define LPC_SUPP_SPEED   (1 << 8)
 
#define LPC_SUPP_RESET_RMII   (1 << 11)
 
#define LPC_TEST_SHORTCUT_PAUSE_QUANTA   (1 << 0)
 
#define LPC_TEST_PAUSE   (1 << 1)
 
#define LPC_TEST_BACKPRESSURE   (1 << 2)
 
#define LPC_MCFG_SCAN_INCREMENT   (1 << 0)
 
#define LPC_MCFG_SUPPRESS_PREAMBLE   (1 << 1)
 
#define LPC_MCFG_CLOCK_SELECT(n)   (((n) & 0x7) << 2)
 
#define LPC_MCFG_CLOCK_HOST_DIV_4   0
 
#define LPC_MCFG_CLOCK_HOST_DIV_6   2
 
#define LPC_MCFG_CLOCK_HOST_DIV_8   3
 
#define LPC_MCFG_CLOCK_HOST_DIV_10   4
 
#define LPC_MCFG_CLOCK_HOST_DIV_14   5
 
#define LPC_MCFG_CLOCK_HOST_DIV_20   6
 
#define LPC_MCFG_CLOCK_HOST_DIV_28   7
 
#define LPC_MCFG_RESET_MII_MGMT   (1 << 15)
 
#define LPC_MCMD_READ   (1 << 0)
 
#define LPC_MCMD_SCAN   (1 << 1)
 
#define LPC_MADR_REGISTER_ADDRESS(n)   ((n) & 0x1F)
 
#define LPC_MADR_PHY_0ADDRESS(n)   (((n) & 0x1F) << 8)
 
#define LPC_MWDT_WRITE(n)   ((n) & 0xFFFF)
 
#define LPC_MRDD_READ_MASK   0xFFFF
 
#define LPC_MIND_BUSY   (1 << 0)
 
#define LPC_MIND_SCANNING   (1 << 1)
 
#define LPC_MIND_NOT_VALID   (1 << 2)
 
#define LPC_MIND_MII_LINK_FAIL   (1 << 3)
 
#define LPC_COMMAND_RXENABLE   (1 << 0)
 
#define LPC_COMMAND_TXENABLE   (1 << 1)
 
#define LPC_COMMAND_REG_RESET   (1 << 3)
 
#define LPC_COMMAND_TXRESET   (1 << 4)
 
#define LPC_COMMAND_RXRESET   (1 << 5)
 
#define LPC_COMMAND_PASSRUNTFRAME   (1 << 6)
 
#define LPC_COMMAND_PASSRXFILTER   (1 << 7)
 
#define LPC_COMMAND_TXFLOWCONTROL   (1 << 8)
 
#define LPC_COMMAND_RMII   (1 << 9)
 
#define LPC_COMMAND_FULLDUPLEX   (1 << 10)
 
#define LPC_STATUS_RXACTIVE   (1 << 0)
 
#define LPC_STATUS_TXACTIVE   (1 << 1)
 
#define LPC_TSV0_CRC_ERROR   (1 << 0)
 
#define LPC_TSV0_LENGTH_CHECK_ERROR   (1 << 1)
 
#define LPC_TSV0_LENGTH_OUT_OF_RANGE   (1 << 2)
 
#define LPC_TSV0_DONE   (1 << 3)
 
#define LPC_TSV0_MULTICAST   (1 << 4)
 
#define LPC_TSV0_BROADCAST   (1 << 5)
 
#define LPC_TSV0_PACKET_DEFER   (1 << 6)
 
#define LPC_TSV0_ESCESSIVE_DEFER   (1 << 7)
 
#define LPC_TSV0_ESCESSIVE_COLLISION   (1 << 8)
 
#define LPC_TSV0_LATE_COLLISION   (1 << 9)
 
#define LPC_TSV0_GIANT   (1 << 10)
 
#define LPC_TSV0_UNDERRUN   (1 << 11)
 
#define LPC_TSV0_TOTAL_BYTES(n)   (((n) >> 12) & 0xFFFF)
 
#define LPC_TSV0_CONTROL_FRAME   (1 << 28)
 
#define LPC_TSV0_PAUSE   (1 << 29)
 
#define LPC_TSV0_BACKPRESSURE   (1 << 30)
 
#define LPC_TSV0_VLAN   (1 << 31)
 
#define LPC_TSV1_TRANSMIT_BYTE_COUNT(n)   ((n) & 0xFFFF)
 
#define LPC_TSV1_COLLISION_COUNT(n)   (((n) >> 16) & 0xF)
 
#define LPC_RSV_RECEIVED_BYTE_COUNT(n)   ((n) & 0xFFFF)
 
#define LPC_RSV_RXDV_EVENT_IGNORED   (1 << 16)
 
#define LPC_RSV_RXDV_EVENT_PREVIOUSLY_SEEN   (1 << 17)
 
#define LPC_RSV_CARRIER_EVNT_PREVIOUS_SEEN   (1 << 18)
 
#define LPC_RSV_RECEIVE_CODE_VIOLATION   (1 << 19)
 
#define LPC_RSV_CRC_ERROR   (1 << 20)
 
#define LPC_RSV_LENGTH_CHECK_ERROR   (1 << 21)
 
#define LPC_RSV_LENGTH_OUT_OF_RANGE   (1 << 22)
 
#define LPC_RSV_RECEIVE_OK   (1 << 23)
 
#define LPC_RSV_MULTICAST   (1 << 24)
 
#define LPC_RSV_BROADCAST   (1 << 25)
 
#define LPC_RSV_DRIBBLE_NIBBLE   (1 << 26)
 
#define LPC_RSV_CONTROL_FRAME   (1 << 27)
 
#define LPC_RSV_PAUSE   (1 << 28)
 
#define LPC_RSV_UNSUPPORTED_OPCODE   (1 << 29)
 
#define LPC_RSV_VLAN   (1 << 30)
 
#define LPC_FCCR_MIRRORCOUNTER(n)   ((n) & 0xFFFF)
 
#define LPC_FCCR_PAUSETIMER(n)   (((n) >> 16) & 0xFFFF)
 
#define LPC_FCCR_MIRRORCOUNTERCURRENT(n)   ((n) & 0xFFFF)
 
#define LPC_RXFLTRW_ACCEPTUNICAST   (1 << 0)
 
#define LPC_RXFLTRW_ACCEPTUBROADCAST   (1 << 1)
 
#define LPC_RXFLTRW_ACCEPTUMULTICAST   (1 << 2)
 
#define LPC_RXFLTRW_ACCEPTUNICASTHASH   (1 << 3)
 
#define LPC_RXFLTRW_ACCEPTUMULTICASTHASH   (1 << 4)
 
#define LPC_RXFLTRW_ACCEPTPERFECT   (1 << 5)
 
#define LPC_RXFLTRWSTS_MAGICPACKETENWOL   (1 << 12)
 
#define LPC_RXFLTRWSTS_RXFILTERENWOL   (1 << 13)
 
#define LPC_RXFLTRWSTS_RXFILTERWOL   (1 << 7)
 
#define LPC_RXFLTRWSTS_MAGICPACKETWOL   (1 << 8)
 
#define LPC_MACINT_RXOVERRUNINTEN   (1 << 0)
 
#define LPC_MACINT_RXERRORONINT   (1 << 1)
 
#define LPC_MACINT_RXFINISHEDINTEN   (1 << 2)
 
#define LPC_MACINT_RXDONEINTEN   (1 << 3)
 
#define LPC_MACINT_TXUNDERRUNINTEN   (1 << 4)
 
#define LPC_MACINT_TXERRORINTEN   (1 << 5)
 
#define LPC_MACINT_TXFINISHEDINTEN   (1 << 6)
 
#define LPC_MACINT_TXDONEINTEN   (1 << 7)
 
#define LPC_MACINT_SOFTINTEN   (1 << 12)
 
#define LPC_MACINT_WAKEUPINTEN   (1 << 13)
 
#define LPC_POWERDOWN_MACAHB   (1 << 31)
 
#define RXSTATUS_SIZE   0x000007FF
 
#define RXSTATUS_CONTROL   (1 << 18)
 
#define RXSTATUS_VLAN   (1 << 19)
 
#define RXSTATUS_FILTER   (1 << 20)
 
#define RXSTATUS_MULTICAST   (1 << 21)
 
#define RXSTATUS_BROADCAST   (1 << 22)
 
#define RXSTATUS_CRC   (1 << 23)
 
#define RXSTATUS_SYMBOL   (1 << 24)
 
#define RXSTATUS_LENGTH   (1 << 25)
 
#define RXSTATUS_RANGE   (1 << 26)
 
#define RXSTATUS_ALIGN   (1 << 27)
 
#define RXSTATUS_OVERRUN   (1 << 28)
 
#define RXSTATUS_NODESC   (1 << 29)
 
#define RXSTATUS_LAST   (1 << 30)
 
#define RXSTATUS_ERROR   (1 << 31)
 
#define RXSTATUS_STATUS_ERROR
 
#define RXDESC_CONTROL_SIZE   0x000007FF
 
#define RXDESC_CONTROL_INT   (1 << 31)
 
#define TXSTATUS_COLLISIONS_GET(x)   (((x) >> 21) & 0xF)
 
#define TXSTATUS_DEFER   (1 << 25)
 
#define TXSTATUS_EXCESSDEFER   (1 << 26)
 
#define TXSTATUS_EXCESSCOLL   (1 << 27)
 
#define TXSTATUS_LATECOLL   (1 << 28)
 
#define TXSTATUS_UNDERRUN   (1 << 29)
 
#define TXSTATUS_NODESC   (1 << 30)
 
#define TXSTATUS_ERROR   (1 << 31)
 
#define TXDESC_CONTROL_SIZE   0x000007FF
 
#define TXDESC_CONTROL_OVERRIDE   (1 << 26)
 
#define TXDESC_CONTROL_HUGE   (1 << 27)
 
#define TXDESC_CONTROL_PAD   (1 << 28)
 
#define TXDESC_CONTROL_CRC   (1 << 29)
 
#define TXDESC_CONTROL_LAST   (1 << 30)
 
#define TXDESC_CONTROL_INT   (1 << 31)
 

Functions

 module_platform_driver (lpc_eth_driver)
 
 MODULE_AUTHOR ("Kevin Wells <[email protected]>")
 
 MODULE_AUTHOR ("Roland Stigge <[email protected]>")
 
 MODULE_DESCRIPTION ("LPC Ethernet Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DRV_VERSION   "1.00"

Definition at line 53 of file lpc_eth.c.

#define ENET_MAXF_SIZE   1536

Definition at line 55 of file lpc_eth.c.

#define ENET_RX_DESC   48

Definition at line 56 of file lpc_eth.c.

#define ENET_TX_DESC   16

Definition at line 57 of file lpc_eth.c.

#define LPC_CLRT_LOAD_COLLISION_WINDOW (   n)    (((n) & 0x3F) << 8)

Definition at line 156 of file lpc_eth.c.

#define LPC_CLRT_LOAD_RETRY_MAX (   n)    ((n) & 0xF)

Definition at line 155 of file lpc_eth.c.

#define LPC_COMMAND_FULLDUPLEX   (1 << 10)

Definition at line 233 of file lpc_eth.c.

#define LPC_COMMAND_PASSRUNTFRAME   (1 << 6)

Definition at line 229 of file lpc_eth.c.

#define LPC_COMMAND_PASSRXFILTER   (1 << 7)

Definition at line 230 of file lpc_eth.c.

#define LPC_COMMAND_REG_RESET   (1 << 3)

Definition at line 226 of file lpc_eth.c.

#define LPC_COMMAND_RMII   (1 << 9)

Definition at line 232 of file lpc_eth.c.

#define LPC_COMMAND_RXENABLE   (1 << 0)

Definition at line 224 of file lpc_eth.c.

#define LPC_COMMAND_RXRESET   (1 << 5)

Definition at line 228 of file lpc_eth.c.

#define LPC_COMMAND_TXENABLE   (1 << 1)

Definition at line 225 of file lpc_eth.c.

#define LPC_COMMAND_TXFLOWCONTROL   (1 << 8)

Definition at line 231 of file lpc_eth.c.

#define LPC_COMMAND_TXRESET   (1 << 4)

Definition at line 227 of file lpc_eth.c.

#define LPC_ENET_CLRT (   x)    (x + 0x010)

Definition at line 68 of file lpc_eth.c.

#define LPC_ENET_COMMAND (   x)    (x + 0x100)

Definition at line 81 of file lpc_eth.c.

#define LPC_ENET_FLOWCONTROLCOUNTER (   x)    (x + 0x170)

Definition at line 96 of file lpc_eth.c.

#define LPC_ENET_FLOWCONTROLSTATUS (   x)    (x + 0x174)

Definition at line 97 of file lpc_eth.c.

#define LPC_ENET_HASHFILTERH (   x)    (x + 0x214)

Definition at line 102 of file lpc_eth.c.

#define LPC_ENET_HASHFILTERL (   x)    (x + 0x210)

Definition at line 101 of file lpc_eth.c.

#define LPC_ENET_INTCLEAR (   x)    (x + 0xFE8)

Definition at line 105 of file lpc_eth.c.

#define LPC_ENET_INTENABLE (   x)    (x + 0xFE4)

Definition at line 104 of file lpc_eth.c.

#define LPC_ENET_INTSET (   x)    (x + 0xFEC)

Definition at line 106 of file lpc_eth.c.

#define LPC_ENET_INTSTATUS (   x)    (x + 0xFE0)

Definition at line 103 of file lpc_eth.c.

#define LPC_ENET_IPGR (   x)    (x + 0x00C)

Definition at line 67 of file lpc_eth.c.

#define LPC_ENET_IPGT (   x)    (x + 0x008)

Definition at line 66 of file lpc_eth.c.

#define LPC_ENET_MAC1 (   x)    (x + 0x000)

Definition at line 64 of file lpc_eth.c.

#define LPC_ENET_MAC2 (   x)    (x + 0x004)

Definition at line 65 of file lpc_eth.c.

#define LPC_ENET_MADR (   x)    (x + 0x028)

Definition at line 74 of file lpc_eth.c.

#define LPC_ENET_MAXF (   x)    (x + 0x014)

Definition at line 69 of file lpc_eth.c.

#define LPC_ENET_MCFG (   x)    (x + 0x020)

Definition at line 72 of file lpc_eth.c.

#define LPC_ENET_MCMD (   x)    (x + 0x024)

Definition at line 73 of file lpc_eth.c.

#define LPC_ENET_MIND (   x)    (x + 0x034)

Definition at line 77 of file lpc_eth.c.

#define LPC_ENET_MRDD (   x)    (x + 0x030)

Definition at line 76 of file lpc_eth.c.

#define LPC_ENET_MWTD (   x)    (x + 0x02C)

Definition at line 75 of file lpc_eth.c.

#define LPC_ENET_POWERDOWN (   x)    (x + 0xFF4)

Definition at line 107 of file lpc_eth.c.

#define LPC_ENET_RSV (   x)    (x + 0x160)

Definition at line 95 of file lpc_eth.c.

#define LPC_ENET_RXCONSUMEINDEX (   x)    (x + 0x118)

Definition at line 87 of file lpc_eth.c.

#define LPC_ENET_RXDESCRIPTOR (   x)    (x + 0x108)

Definition at line 83 of file lpc_eth.c.

#define LPC_ENET_RXDESCRIPTORNUMBER (   x)    (x + 0x110)

Definition at line 85 of file lpc_eth.c.

#define LPC_ENET_RXFILTER_CTRL (   x)    (x + 0x200)

Definition at line 98 of file lpc_eth.c.

#define LPC_ENET_RXFILTERWOLCLEAR (   x)    (x + 0x208)

Definition at line 100 of file lpc_eth.c.

#define LPC_ENET_RXFILTERWOLSTATUS (   x)    (x + 0x204)

Definition at line 99 of file lpc_eth.c.

#define LPC_ENET_RXPRODUCEINDEX (   x)    (x + 0x114)

Definition at line 86 of file lpc_eth.c.

#define LPC_ENET_RXSTATUS (   x)    (x + 0x10C)

Definition at line 84 of file lpc_eth.c.

#define LPC_ENET_SA0 (   x)    (x + 0x040)

Definition at line 78 of file lpc_eth.c.

#define LPC_ENET_SA1 (   x)    (x + 0x044)

Definition at line 79 of file lpc_eth.c.

#define LPC_ENET_SA2 (   x)    (x + 0x048)

Definition at line 80 of file lpc_eth.c.

#define LPC_ENET_STATUS (   x)    (x + 0x104)

Definition at line 82 of file lpc_eth.c.

#define LPC_ENET_SUPP (   x)    (x + 0x018)

Definition at line 70 of file lpc_eth.c.

#define LPC_ENET_TEST (   x)    (x + 0x01C)

Definition at line 71 of file lpc_eth.c.

#define LPC_ENET_TSV0 (   x)    (x + 0x158)

Definition at line 93 of file lpc_eth.c.

#define LPC_ENET_TSV1 (   x)    (x + 0x15C)

Definition at line 94 of file lpc_eth.c.

#define LPC_ENET_TXCONSUMEINDEX (   x)    (x + 0x12C)

Definition at line 92 of file lpc_eth.c.

#define LPC_ENET_TXDESCRIPTOR (   x)    (x + 0x11C)

Definition at line 88 of file lpc_eth.c.

#define LPC_ENET_TXDESCRIPTORNUMBER (   x)    (x + 0x124)

Definition at line 90 of file lpc_eth.c.

#define LPC_ENET_TXPRODUCEINDEX (   x)    (x + 0x128)

Definition at line 91 of file lpc_eth.c.

#define LPC_ENET_TXSTATUS (   x)    (x + 0x120)

Definition at line 89 of file lpc_eth.c.

#define LPC_FCCR_MIRRORCOUNTER (   n)    ((n) & 0xFFFF)

Definition at line 291 of file lpc_eth.c.

#define LPC_FCCR_MIRRORCOUNTERCURRENT (   n)    ((n) & 0xFFFF)

Definition at line 297 of file lpc_eth.c.

#define LPC_FCCR_PAUSETIMER (   n)    (((n) >> 16) & 0xFFFF)

Definition at line 292 of file lpc_eth.c.

#define LPC_IPGR_LOAD_PART1 (   n)    (((n) & 0x7F) << 8)

Definition at line 150 of file lpc_eth.c.

#define LPC_IPGR_LOAD_PART2 (   n)    ((n) & 0x7F)

Definition at line 149 of file lpc_eth.c.

#define LPC_IPGT_LOAD (   n)    ((n) & 0x7F)

Definition at line 144 of file lpc_eth.c.

#define LPC_MAC1_LOOPBACK   (1 << 4)

Definition at line 116 of file lpc_eth.c.

#define LPC_MAC1_PASS_ALL_RX_FRAMES   (1 << 1)

Definition at line 113 of file lpc_eth.c.

#define LPC_MAC1_RECV_ENABLE   (1 << 0)

Definition at line 112 of file lpc_eth.c.

#define LPC_MAC1_RESET_MCS_RX   (1 << 11)

Definition at line 120 of file lpc_eth.c.

#define LPC_MAC1_RESET_MCS_TX   (1 << 9)

Definition at line 118 of file lpc_eth.c.

#define LPC_MAC1_RESET_RX   (1 << 10)

Definition at line 119 of file lpc_eth.c.

#define LPC_MAC1_RESET_TX   (1 << 8)

Definition at line 117 of file lpc_eth.c.

#define LPC_MAC1_RX_FLOW_CONTROL   (1 << 2)

Definition at line 114 of file lpc_eth.c.

#define LPC_MAC1_SIMULATION_RESET   (1 << 14)

Definition at line 121 of file lpc_eth.c.

#define LPC_MAC1_SOFT_RESET   (1 << 15)

Definition at line 122 of file lpc_eth.c.

#define LPC_MAC1_TX_FLOW_CONTROL   (1 << 3)

Definition at line 115 of file lpc_eth.c.

#define LPC_MAC2_AUTO_DETECT_PAD_ENABLE   (1 << 7)

Definition at line 134 of file lpc_eth.c.

#define LPC_MAC2_BACK_PRESSURE   (1 << 13)

Definition at line 138 of file lpc_eth.c.

#define LPC_MAC2_CRC_ENABLE   (1 << 4)

Definition at line 131 of file lpc_eth.c.

#define LPC_MAC2_DELAYED_CRC   (1 << 3)

Definition at line 130 of file lpc_eth.c.

#define LPC_MAC2_EXCESS_DEFER   (1 << 14)

Definition at line 139 of file lpc_eth.c.

#define LPC_MAC2_FRAME_LENGTH_CHECKING   (1 << 1)

Definition at line 128 of file lpc_eth.c.

#define LPC_MAC2_FULL_DUPLEX   (1 << 0)

Definition at line 127 of file lpc_eth.c.

#define LPC_MAC2_HUGH_LENGTH_CHECKING   (1 << 2)

Definition at line 129 of file lpc_eth.c.

#define LPC_MAC2_LONG_PREAMBLE_ENFORCEMENT   (1 << 9)

Definition at line 136 of file lpc_eth.c.

#define LPC_MAC2_NO_BACKOFF   (1 << 12)

Definition at line 137 of file lpc_eth.c.

#define LPC_MAC2_PAD_CRC_ENABLE   (1 << 5)

Definition at line 132 of file lpc_eth.c.

#define LPC_MAC2_PURE_PREAMBLE_ENFORCEMENT   (1 << 8)

Definition at line 135 of file lpc_eth.c.

#define LPC_MAC2_VLAN_PAD_ENABLE   (1 << 6)

Definition at line 133 of file lpc_eth.c.

#define LPC_MACINT_RXDONEINTEN   (1 << 3)

Definition at line 329 of file lpc_eth.c.

#define LPC_MACINT_RXERRORONINT   (1 << 1)

Definition at line 327 of file lpc_eth.c.

#define LPC_MACINT_RXFINISHEDINTEN   (1 << 2)

Definition at line 328 of file lpc_eth.c.

#define LPC_MACINT_RXOVERRUNINTEN   (1 << 0)

Definition at line 326 of file lpc_eth.c.

#define LPC_MACINT_SOFTINTEN   (1 << 12)

Definition at line 334 of file lpc_eth.c.

#define LPC_MACINT_TXDONEINTEN   (1 << 7)

Definition at line 333 of file lpc_eth.c.

#define LPC_MACINT_TXERRORINTEN   (1 << 5)

Definition at line 331 of file lpc_eth.c.

#define LPC_MACINT_TXFINISHEDINTEN   (1 << 6)

Definition at line 332 of file lpc_eth.c.

#define LPC_MACINT_TXUNDERRUNINTEN   (1 << 4)

Definition at line 330 of file lpc_eth.c.

#define LPC_MACINT_WAKEUPINTEN   (1 << 13)

Definition at line 335 of file lpc_eth.c.

#define LPC_MADR_PHY_0ADDRESS (   n)    (((n) & 0x1F) << 8)

Definition at line 201 of file lpc_eth.c.

#define LPC_MADR_REGISTER_ADDRESS (   n)    ((n) & 0x1F)

Definition at line 200 of file lpc_eth.c.

#define LPC_MAXF_LOAD_MAX_FRAME_LEN (   n)    ((n) & 0xFFFF)

Definition at line 161 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_10   4

Definition at line 185 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_14   5

Definition at line 186 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_20   6

Definition at line 187 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_28   7

Definition at line 188 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_4   0

Definition at line 182 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_6   2

Definition at line 183 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_HOST_DIV_8   3

Definition at line 184 of file lpc_eth.c.

#define LPC_MCFG_CLOCK_SELECT (   n)    (((n) & 0x7) << 2)

Definition at line 181 of file lpc_eth.c.

#define LPC_MCFG_RESET_MII_MGMT   (1 << 15)

Definition at line 189 of file lpc_eth.c.

#define LPC_MCFG_SCAN_INCREMENT   (1 << 0)

Definition at line 179 of file lpc_eth.c.

#define LPC_MCFG_SUPPRESS_PREAMBLE   (1 << 1)

Definition at line 180 of file lpc_eth.c.

#define LPC_MCMD_READ   (1 << 0)

Definition at line 194 of file lpc_eth.c.

#define LPC_MCMD_SCAN   (1 << 1)

Definition at line 195 of file lpc_eth.c.

#define LPC_MIND_BUSY   (1 << 0)

Definition at line 216 of file lpc_eth.c.

#define LPC_MIND_MII_LINK_FAIL   (1 << 3)

Definition at line 219 of file lpc_eth.c.

#define LPC_MIND_NOT_VALID   (1 << 2)

Definition at line 218 of file lpc_eth.c.

#define LPC_MIND_SCANNING   (1 << 1)

Definition at line 217 of file lpc_eth.c.

#define LPC_MRDD_READ_MASK   0xFFFF

Definition at line 211 of file lpc_eth.c.

#define LPC_MWDT_WRITE (   n)    ((n) & 0xFFFF)

Definition at line 206 of file lpc_eth.c.

#define LPC_POWERDOWN_MACAHB   (1 << 31)

Definition at line 340 of file lpc_eth.c.

#define LPC_RSV_BROADCAST   (1 << 25)

Definition at line 281 of file lpc_eth.c.

#define LPC_RSV_CARRIER_EVNT_PREVIOUS_SEEN   (1 << 18)

Definition at line 274 of file lpc_eth.c.

#define LPC_RSV_CONTROL_FRAME   (1 << 27)

Definition at line 283 of file lpc_eth.c.

#define LPC_RSV_CRC_ERROR   (1 << 20)

Definition at line 276 of file lpc_eth.c.

#define LPC_RSV_DRIBBLE_NIBBLE   (1 << 26)

Definition at line 282 of file lpc_eth.c.

#define LPC_RSV_LENGTH_CHECK_ERROR   (1 << 21)

Definition at line 277 of file lpc_eth.c.

#define LPC_RSV_LENGTH_OUT_OF_RANGE   (1 << 22)

Definition at line 278 of file lpc_eth.c.

#define LPC_RSV_MULTICAST   (1 << 24)

Definition at line 280 of file lpc_eth.c.

#define LPC_RSV_PAUSE   (1 << 28)

Definition at line 284 of file lpc_eth.c.

#define LPC_RSV_RECEIVE_CODE_VIOLATION   (1 << 19)

Definition at line 275 of file lpc_eth.c.

#define LPC_RSV_RECEIVE_OK   (1 << 23)

Definition at line 279 of file lpc_eth.c.

#define LPC_RSV_RECEIVED_BYTE_COUNT (   n)    ((n) & 0xFFFF)

Definition at line 271 of file lpc_eth.c.

#define LPC_RSV_RXDV_EVENT_IGNORED   (1 << 16)

Definition at line 272 of file lpc_eth.c.

#define LPC_RSV_RXDV_EVENT_PREVIOUSLY_SEEN   (1 << 17)

Definition at line 273 of file lpc_eth.c.

#define LPC_RSV_UNSUPPORTED_OPCODE   (1 << 29)

Definition at line 285 of file lpc_eth.c.

#define LPC_RSV_VLAN   (1 << 30)

Definition at line 286 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTPERFECT   (1 << 5)

Definition at line 308 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTUBROADCAST   (1 << 1)

Definition at line 304 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTUMULTICAST   (1 << 2)

Definition at line 305 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTUMULTICASTHASH   (1 << 4)

Definition at line 307 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTUNICAST   (1 << 0)

Definition at line 303 of file lpc_eth.c.

#define LPC_RXFLTRW_ACCEPTUNICASTHASH   (1 << 3)

Definition at line 306 of file lpc_eth.c.

#define LPC_RXFLTRWSTS_MAGICPACKETENWOL   (1 << 12)

Definition at line 313 of file lpc_eth.c.

#define LPC_RXFLTRWSTS_MAGICPACKETWOL   (1 << 8)

Definition at line 320 of file lpc_eth.c.

#define LPC_RXFLTRWSTS_RXFILTERENWOL   (1 << 13)

Definition at line 314 of file lpc_eth.c.

#define LPC_RXFLTRWSTS_RXFILTERWOL   (1 << 7)

Definition at line 319 of file lpc_eth.c.

#define LPC_STATUS_RXACTIVE   (1 << 0)

Definition at line 238 of file lpc_eth.c.

#define LPC_STATUS_TXACTIVE   (1 << 1)

Definition at line 239 of file lpc_eth.c.

#define LPC_SUPP_RESET_RMII   (1 << 11)

Definition at line 167 of file lpc_eth.c.

#define LPC_SUPP_SPEED   (1 << 8)

Definition at line 166 of file lpc_eth.c.

#define LPC_TEST_BACKPRESSURE   (1 << 2)

Definition at line 174 of file lpc_eth.c.

#define LPC_TEST_PAUSE   (1 << 1)

Definition at line 173 of file lpc_eth.c.

#define LPC_TEST_SHORTCUT_PAUSE_QUANTA   (1 << 0)

Definition at line 172 of file lpc_eth.c.

#define LPC_TSV0_BACKPRESSURE   (1 << 30)

Definition at line 259 of file lpc_eth.c.

#define LPC_TSV0_BROADCAST   (1 << 5)

Definition at line 249 of file lpc_eth.c.

#define LPC_TSV0_CONTROL_FRAME   (1 << 28)

Definition at line 257 of file lpc_eth.c.

#define LPC_TSV0_CRC_ERROR   (1 << 0)

Definition at line 244 of file lpc_eth.c.

#define LPC_TSV0_DONE   (1 << 3)

Definition at line 247 of file lpc_eth.c.

#define LPC_TSV0_ESCESSIVE_COLLISION   (1 << 8)

Definition at line 252 of file lpc_eth.c.

#define LPC_TSV0_ESCESSIVE_DEFER   (1 << 7)

Definition at line 251 of file lpc_eth.c.

#define LPC_TSV0_GIANT   (1 << 10)

Definition at line 254 of file lpc_eth.c.

#define LPC_TSV0_LATE_COLLISION   (1 << 9)

Definition at line 253 of file lpc_eth.c.

#define LPC_TSV0_LENGTH_CHECK_ERROR   (1 << 1)

Definition at line 245 of file lpc_eth.c.

#define LPC_TSV0_LENGTH_OUT_OF_RANGE   (1 << 2)

Definition at line 246 of file lpc_eth.c.

#define LPC_TSV0_MULTICAST   (1 << 4)

Definition at line 248 of file lpc_eth.c.

#define LPC_TSV0_PACKET_DEFER   (1 << 6)

Definition at line 250 of file lpc_eth.c.

#define LPC_TSV0_PAUSE   (1 << 29)

Definition at line 258 of file lpc_eth.c.

#define LPC_TSV0_TOTAL_BYTES (   n)    (((n) >> 12) & 0xFFFF)

Definition at line 256 of file lpc_eth.c.

#define LPC_TSV0_UNDERRUN   (1 << 11)

Definition at line 255 of file lpc_eth.c.

#define LPC_TSV0_VLAN   (1 << 31)

Definition at line 260 of file lpc_eth.c.

#define LPC_TSV1_COLLISION_COUNT (   n)    (((n) >> 16) & 0xF)

Definition at line 266 of file lpc_eth.c.

#define LPC_TSV1_TRANSMIT_BYTE_COUNT (   n)    ((n) & 0xFFFF)

Definition at line 265 of file lpc_eth.c.

#define MODNAME   "lpc-eth"

Definition at line 52 of file lpc_eth.c.

#define NAPI_WEIGHT   16

Definition at line 59 of file lpc_eth.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 20 of file lpc_eth.c.

#define RXDESC_CONTROL_INT   (1 << 31)

Definition at line 383 of file lpc_eth.c.

#define RXDESC_CONTROL_SIZE   0x000007FF

Definition at line 382 of file lpc_eth.c.

#define RXSTATUS_ALIGN   (1 << 27)

Definition at line 371 of file lpc_eth.c.

#define RXSTATUS_BROADCAST   (1 << 22)

Definition at line 366 of file lpc_eth.c.

#define RXSTATUS_CONTROL   (1 << 18)

Definition at line 362 of file lpc_eth.c.

#define RXSTATUS_CRC   (1 << 23)

Definition at line 367 of file lpc_eth.c.

#define RXSTATUS_ERROR   (1 << 31)

Definition at line 375 of file lpc_eth.c.

#define RXSTATUS_FILTER   (1 << 20)

Definition at line 364 of file lpc_eth.c.

#define RXSTATUS_LAST   (1 << 30)

Definition at line 374 of file lpc_eth.c.

#define RXSTATUS_LENGTH   (1 << 25)

Definition at line 369 of file lpc_eth.c.

#define RXSTATUS_MULTICAST   (1 << 21)

Definition at line 365 of file lpc_eth.c.

#define RXSTATUS_NODESC   (1 << 29)

Definition at line 373 of file lpc_eth.c.

#define RXSTATUS_OVERRUN   (1 << 28)

Definition at line 372 of file lpc_eth.c.

#define RXSTATUS_RANGE   (1 << 26)

Definition at line 370 of file lpc_eth.c.

#define RXSTATUS_SIZE   0x000007FF

Definition at line 361 of file lpc_eth.c.

#define RXSTATUS_STATUS_ERROR
Value:

Definition at line 377 of file lpc_eth.c.

#define RXSTATUS_SYMBOL   (1 << 24)

Definition at line 368 of file lpc_eth.c.

#define RXSTATUS_VLAN   (1 << 19)

Definition at line 363 of file lpc_eth.c.

#define TXDESC_CONTROL_CRC   (1 << 29)

Definition at line 400 of file lpc_eth.c.

#define TXDESC_CONTROL_HUGE   (1 << 27)

Definition at line 398 of file lpc_eth.c.

#define TXDESC_CONTROL_INT   (1 << 31)

Definition at line 402 of file lpc_eth.c.

#define TXDESC_CONTROL_LAST   (1 << 30)

Definition at line 401 of file lpc_eth.c.

#define TXDESC_CONTROL_OVERRIDE   (1 << 26)

Definition at line 397 of file lpc_eth.c.

#define TXDESC_CONTROL_PAD   (1 << 28)

Definition at line 399 of file lpc_eth.c.

#define TXDESC_CONTROL_SIZE   0x000007FF

Definition at line 396 of file lpc_eth.c.

#define TXSTATUS_COLLISIONS_GET (   x)    (((x) >> 21) & 0xF)

Definition at line 386 of file lpc_eth.c.

#define TXSTATUS_DEFER   (1 << 25)

Definition at line 387 of file lpc_eth.c.

#define TXSTATUS_ERROR   (1 << 31)

Definition at line 393 of file lpc_eth.c.

#define TXSTATUS_EXCESSCOLL   (1 << 27)

Definition at line 389 of file lpc_eth.c.

#define TXSTATUS_EXCESSDEFER   (1 << 26)

Definition at line 388 of file lpc_eth.c.

#define TXSTATUS_LATECOLL   (1 << 28)

Definition at line 390 of file lpc_eth.c.

#define TXSTATUS_NODESC   (1 << 30)

Definition at line 392 of file lpc_eth.c.

#define TXSTATUS_UNDERRUN   (1 << 29)

Definition at line 391 of file lpc_eth.c.

Function Documentation

MODULE_AUTHOR ( "Kevin Wells <[email protected]>"  )
MODULE_AUTHOR ( "Roland Stigge <[email protected]>"  )
MODULE_DESCRIPTION ( "LPC Ethernet Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( lpc_eth_driver  )