Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
octeon_mgmt.c File Reference
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/etherdevice.h>
#include <linux/capability.h>
#include <linux/net_tstamp.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/if_vlan.h>
#include <linux/of_mdio.h>
#include <linux/module.h>
#include <linux/of_net.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/phy.h>
#include <linux/io.h>
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-mixx-defs.h>
#include <asm/octeon/cvmx-agl-defs.h>

Go to the source code of this file.

Data Structures

union  mgmt_port_ring_entry
 
struct  octeon_mgmt
 
struct  octeon_mgmt_cam_state
 

Macros

#define DRV_NAME   "octeon_mgmt"
 
#define DRV_VERSION   "2.0"
 
#define DRV_DESCRIPTION   "Cavium Networks Octeon MII (management) port Network Driver"
 
#define OCTEON_MGMT_NAPI_WEIGHT   16
 
#define OCTEON_MGMT_RX_RING_SIZE   512
 
#define OCTEON_MGMT_TX_RING_SIZE   128
 
#define OCTEON_MGMT_RX_HEADROOM   (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)
 
#define RING_ENTRY_CODE_DONE   0xf
 
#define RING_ENTRY_CODE_MORE   0x10
 
#define MIX_ORING1   0x0
 
#define MIX_ORING2   0x8
 
#define MIX_IRING1   0x10
 
#define MIX_IRING2   0x18
 
#define MIX_CTL   0x20
 
#define MIX_IRHWM   0x28
 
#define MIX_IRCNT   0x30
 
#define MIX_ORHWM   0x38
 
#define MIX_ORCNT   0x40
 
#define MIX_ISR   0x48
 
#define MIX_INTENA   0x50
 
#define MIX_REMCNT   0x58
 
#define MIX_BIST   0x78
 
#define AGL_GMX_PRT_CFG   0x10
 
#define AGL_GMX_RX_FRM_CTL   0x18
 
#define AGL_GMX_RX_FRM_MAX   0x30
 
#define AGL_GMX_RX_JABBER   0x38
 
#define AGL_GMX_RX_STATS_CTL   0x50
 
#define AGL_GMX_RX_STATS_PKTS_DRP   0xb0
 
#define AGL_GMX_RX_STATS_OCTS_DRP   0xb8
 
#define AGL_GMX_RX_STATS_PKTS_BAD   0xc0
 
#define AGL_GMX_RX_ADR_CTL   0x100
 
#define AGL_GMX_RX_ADR_CAM_EN   0x108
 
#define AGL_GMX_RX_ADR_CAM0   0x180
 
#define AGL_GMX_RX_ADR_CAM1   0x188
 
#define AGL_GMX_RX_ADR_CAM2   0x190
 
#define AGL_GMX_RX_ADR_CAM3   0x198
 
#define AGL_GMX_RX_ADR_CAM4   0x1a0
 
#define AGL_GMX_RX_ADR_CAM5   0x1a8
 
#define AGL_GMX_TX_CLK   0x208
 
#define AGL_GMX_TX_STATS_CTL   0x268
 
#define AGL_GMX_TX_CTL   0x270
 
#define AGL_GMX_TX_STAT0   0x280
 
#define AGL_GMX_TX_STAT1   0x288
 
#define AGL_GMX_TX_STAT2   0x290
 
#define AGL_GMX_TX_STAT3   0x298
 
#define AGL_GMX_TX_STAT4   0x2a0
 
#define AGL_GMX_TX_STAT5   0x2a8
 
#define AGL_GMX_TX_STAT6   0x2b0
 
#define AGL_GMX_TX_STAT7   0x2b8
 
#define AGL_GMX_TX_STAT8   0x2c0
 
#define AGL_GMX_TX_STAT9   0x2c8
 
#define NS_PER_PHY_CLK   8
 

Functions

 MODULE_DEVICE_TABLE (of, octeon_mgmt_match)
 
void octeon_mdiobus_force_mod_depencency (void)
 
 module_init (octeon_mgmt_mod_init)
 
 module_exit (octeon_mgmt_mod_exit)
 
 MODULE_DESCRIPTION (DRV_DESCRIPTION)
 
 MODULE_AUTHOR ("David Daney")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 

Macro Definition Documentation

#define AGL_GMX_PRT_CFG   0x10

Definition at line 77 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM0   0x180

Definition at line 89 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM1   0x188

Definition at line 90 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM2   0x190

Definition at line 91 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM3   0x198

Definition at line 92 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM4   0x1a0

Definition at line 93 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM5   0x1a8

Definition at line 94 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CAM_EN   0x108

Definition at line 88 of file octeon_mgmt.c.

#define AGL_GMX_RX_ADR_CTL   0x100

Definition at line 87 of file octeon_mgmt.c.

#define AGL_GMX_RX_FRM_CTL   0x18

Definition at line 78 of file octeon_mgmt.c.

#define AGL_GMX_RX_FRM_MAX   0x30

Definition at line 79 of file octeon_mgmt.c.

#define AGL_GMX_RX_JABBER   0x38

Definition at line 80 of file octeon_mgmt.c.

#define AGL_GMX_RX_STATS_CTL   0x50

Definition at line 81 of file octeon_mgmt.c.

#define AGL_GMX_RX_STATS_OCTS_DRP   0xb8

Definition at line 84 of file octeon_mgmt.c.

#define AGL_GMX_RX_STATS_PKTS_BAD   0xc0

Definition at line 85 of file octeon_mgmt.c.

#define AGL_GMX_RX_STATS_PKTS_DRP   0xb0

Definition at line 83 of file octeon_mgmt.c.

#define AGL_GMX_TX_CLK   0x208

Definition at line 96 of file octeon_mgmt.c.

#define AGL_GMX_TX_CTL   0x270

Definition at line 98 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT0   0x280

Definition at line 99 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT1   0x288

Definition at line 100 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT2   0x290

Definition at line 101 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT3   0x298

Definition at line 102 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT4   0x2a0

Definition at line 103 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT5   0x2a8

Definition at line 104 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT6   0x2b0

Definition at line 105 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT7   0x2b8

Definition at line 106 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT8   0x2c0

Definition at line 107 of file octeon_mgmt.c.

#define AGL_GMX_TX_STAT9   0x2c8

Definition at line 108 of file octeon_mgmt.c.

#define AGL_GMX_TX_STATS_CTL   0x268

Definition at line 97 of file octeon_mgmt.c.

#define DRV_DESCRIPTION   "Cavium Networks Octeon MII (management) port Network Driver"

Definition at line 32 of file octeon_mgmt.c.

#define DRV_NAME   "octeon_mgmt"

Definition at line 30 of file octeon_mgmt.c.

#define DRV_VERSION   "2.0"

Definition at line 31 of file octeon_mgmt.c.

#define MIX_BIST   0x78

Definition at line 75 of file octeon_mgmt.c.

#define MIX_CTL   0x20

Definition at line 67 of file octeon_mgmt.c.

#define MIX_INTENA   0x50

Definition at line 73 of file octeon_mgmt.c.

#define MIX_IRCNT   0x30

Definition at line 69 of file octeon_mgmt.c.

#define MIX_IRHWM   0x28

Definition at line 68 of file octeon_mgmt.c.

#define MIX_IRING1   0x10

Definition at line 65 of file octeon_mgmt.c.

#define MIX_IRING2   0x18

Definition at line 66 of file octeon_mgmt.c.

#define MIX_ISR   0x48

Definition at line 72 of file octeon_mgmt.c.

#define MIX_ORCNT   0x40

Definition at line 71 of file octeon_mgmt.c.

#define MIX_ORHWM   0x38

Definition at line 70 of file octeon_mgmt.c.

#define MIX_ORING1   0x0

Definition at line 63 of file octeon_mgmt.c.

#define MIX_ORING2   0x8

Definition at line 64 of file octeon_mgmt.c.

#define MIX_REMCNT   0x58

Definition at line 74 of file octeon_mgmt.c.

#define NS_PER_PHY_CLK   8
#define OCTEON_MGMT_NAPI_WEIGHT   16

Definition at line 35 of file octeon_mgmt.c.

#define OCTEON_MGMT_RX_HEADROOM   (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)

Definition at line 44 of file octeon_mgmt.c.

#define OCTEON_MGMT_RX_RING_SIZE   512

Definition at line 40 of file octeon_mgmt.c.

#define OCTEON_MGMT_TX_RING_SIZE   128

Definition at line 41 of file octeon_mgmt.c.

#define RING_ENTRY_CODE_DONE   0xf

Definition at line 56 of file octeon_mgmt.c.

#define RING_ENTRY_CODE_MORE   0x10

Definition at line 57 of file octeon_mgmt.c.

Function Documentation

MODULE_AUTHOR ( "David Daney"  )
MODULE_DESCRIPTION ( DRV_DESCRIPTION  )
MODULE_DEVICE_TABLE ( of  ,
octeon_mgmt_match   
)
module_exit ( octeon_mgmt_mod_exit  )
module_init ( octeon_mgmt_mod_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( DRV_VERSION  )
void octeon_mdiobus_force_mod_depencency ( void  )

Definition at line 194 of file mdio-octeon.c.