Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
ethernet.c File Reference
#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/phy.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/of_net.h>
#include <net/dst.h>
#include <asm/octeon/octeon.h>
#include "ethernet-defines.h"
#include "octeon-ethernet.h"
#include "ethernet-mem.h"
#include "ethernet-rx.h"
#include "ethernet-tx.h"
#include "ethernet-mdio.h"
#include "ethernet-util.h"
#include <asm/octeon/cvmx-pip.h>
#include <asm/octeon/cvmx-pko.h>
#include <asm/octeon/cvmx-fau.h>
#include <asm/octeon/cvmx-ipd.h>
#include <asm/octeon/cvmx-helper.h>
#include <asm/octeon/cvmx-gmxx-defs.h>
#include <asm/octeon/cvmx-smix-defs.h>

Go to the source code of this file.

Functions

 module_param (num_packet_buffers, int, 0444)
 
 MODULE_PARM_DESC (num_packet_buffers,"\n""\tNumber of packet buffers to allocate and store in the\n""\tFPA. By default, 1024 packet buffers are used unless\n""\tCONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS is defined.")
 
 module_param (pow_receive_group, int, 0444)
 
 MODULE_PARM_DESC (pow_receive_group,"\n""\tPOW group to receive packets from. All ethernet hardware\n""\twill be configured to send incomming packets to this POW\n""\tgroup. Also any other software can submit packets to this\n""\tgroup for the kernel to process.")
 
 module_param (pow_send_group, int, 0644)
 
 MODULE_PARM_DESC (pow_send_group,"\n""\tPOW group to send packets to other software on. This\n""\tcontrols the creation of the virtual device pow0.\n""\talways_use_pow also depends on this value.")
 
 module_param (always_use_pow, int, 0444)
 
 MODULE_PARM_DESC (always_use_pow,"\n""\tWhen set, always send to the pow group. This will cause\n""\tpackets sent to real ethernet devices to be sent to the\n""\tPOW group instead of the hardware. Unless some other\n""\tapplication changes the config, packets will still be\n""\treceived from the low level hardware. Use this option\n""\tto allow a CVMX app to intercept all packets from the\n""\tlinux kernel. You must specify pow_send_group along with\n""\tthis option.")
 
 module_param_string (pow_send_list, pow_send_list, sizeof(pow_send_list), 0444)
 
 MODULE_PARM_DESC (pow_send_list,"\n""\tComma separated list of ethernet devices that should use the\n""\tPOW for transmit instead of the actual ethernet hardware. This\n""\tis a per port version of always_use_pow. always_use_pow takes\n""\tprecedence over this list. For example, setting this to\n""\t\"eth2,spi3,spi7\" would cause these three devices to transmit\n""\tusing the pow_send_group.")
 
 module_param (max_rx_cpus, int, 0444)
 
 MODULE_PARM_DESC (max_rx_cpus,"\n""\t\tThe maximum number of CPUs to use for packet reception.\n""\t\tUse -1 to use all available CPUs.")
 
 module_param (rx_napi_weight, int, 0444)
 
 MODULE_PARM_DESC (rx_napi_weight,"The NAPI WEIGHT parameter.")
 
int cvm_oct_free_work (void *work_queue_entry)
 
 EXPORT_SYMBOL (cvm_oct_free_work)
 
int cvm_oct_common_init (struct net_device *dev)
 
void cvm_oct_common_uninit (struct net_device *dev)
 
void octeon_mdiobus_force_mod_depencency (void)
 
 MODULE_DEVICE_TABLE (of, cvm_oct_match)
 
 module_platform_driver (cvm_oct_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Cavium Networks <support@caviumnetworks.com>")
 
 MODULE_DESCRIPTION ("Cavium Networks Octeon ethernet driver.")
 

Variables

int num_packet_buffers = 1024
 
int pow_receive_group = 15
 
int pow_send_group = -1
 
int always_use_pow
 
char pow_send_list [128] = ""
 
int max_rx_cpus = -1
 
int rx_napi_weight = 32
 
struct workqueue_structcvm_oct_poll_queue
 
atomic_t cvm_oct_poll_queue_stopping = ATOMIC_INIT(0)
 
struct net_devicecvm_oct_device [TOTAL_NUMBER_OF_PORTS]
 
u64 cvm_oct_tx_poll_interval
 

Function Documentation

int cvm_oct_common_init ( struct net_device dev)

cvm_oct_common_init - per network device initialization : Device to initialize

Returns Zero on success

Definition at line 448 of file ethernet.c.

void cvm_oct_common_uninit ( struct net_device dev)

Definition at line 495 of file ethernet.c.

int cvm_oct_free_work ( void work_queue_entry)

cvm_oct_free_work- Free a work queue entry

: Work queue entry to free

Returns Zero on success, Negative on failure.

Definition at line 197 of file ethernet.c.

EXPORT_SYMBOL ( cvm_oct_free_work  )
MODULE_AUTHOR ( "Cavium Networks <support@caviumnetworks.com>"  )
MODULE_DESCRIPTION ( "Cavium Networks Octeon ethernet driver."  )
MODULE_DEVICE_TABLE ( of  ,
cvm_oct_match   
)
MODULE_LICENSE ( "GPL"  )
module_param ( num_packet_buffers  ,
int  ,
0444   
)
module_param ( pow_receive_group  ,
int  ,
0444   
)
module_param ( pow_send_group  ,
int  ,
0644   
)
module_param ( always_use_pow  ,
int  ,
0444   
)
module_param ( max_rx_cpus  ,
int  ,
0444   
)
module_param ( rx_napi_weight  ,
int  ,
0444   
)
module_param_string ( pow_send_list  ,
pow_send_list  ,
sizeof(pow_send_list ,
0444   
)
MODULE_PARM_DESC ( num_packet_buffers  ,
"\n""\tNumber of packet buffers to allocate and store in the\n""\tFPA. By  default,
1024 packet buffers are used unless\n""\tCONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS is defined."   
)
MODULE_PARM_DESC ( pow_receive_group  ,
"\n""\tPOW group to receive packets from. All ethernet hardware\n""\twill be configured to send incomming packets to this POW\n""\tgroup. Also any other software can submit packets to this\n""\tgroup for the kernel to process."   
)
MODULE_PARM_DESC ( pow_send_group  ,
"\n""\tPOW group to send packets to other software on. This\n""\tcontrols the creation of the virtual device pow0.\n""\talways_use_pow also depends on this value."   
)
MODULE_PARM_DESC ( always_use_pow  ,
"\n""\tWhen  set,
always send to the pow group.This will cause\n""\tpackets sent to real ethernet devices to be sent to the\n""\tPOW group instead of the hardware.Unless some other\n""\tapplication changes the  config,
packets will still be\n""\treceived from the low level hardware.Use this option\n""\tto allow a CVMX app to intercept all packets from the\n""\tlinux kernel.You must specify pow_send_group along with\n""\tthis option."   
)
MODULE_PARM_DESC ( pow_send_list  ,
"\n""\tComma separated list of ethernet devices that should use the\n""\tPOW for transmit instead of the actual ethernet hardware. This\n""\tis a per port version of always_use_pow. always_use_pow takes\n""\tprecedence over this list. For  example,
setting this to\n""\t\"  eth2,
spi3  ,
spi7\" would cause these three devices to transmit\n""\tusing the pow_send_group."   
)
MODULE_PARM_DESC ( max_rx_cpus  ,
"\n""\t\tThe maximum number of CPUs to use for packet reception.\n""\t\tUse -1 to use all available CPUs."   
)
MODULE_PARM_DESC ( rx_napi_weight  ,
"The NAPI WEIGHT parameter."   
)
module_platform_driver ( cvm_oct_driver  )
void octeon_mdiobus_force_mod_depencency ( void  )

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

Variable Documentation

int always_use_pow

Definition at line 86 of file ethernet.c.

Array of every ethernet device owned by this driver indexed by the ipd input port number.

Definition at line 134 of file ethernet.c.

struct workqueue_struct* cvm_oct_poll_queue

cvm_oct_poll_queue - Workqueue for polling operations.

Definition at line 121 of file ethernet.c.

atomic_t cvm_oct_poll_queue_stopping = ATOMIC_INIT(0)

cvm_oct_poll_queue_stopping - flag to indicate polling should stop.

Set to one right before cvm_oct_poll_queue is destroyed.

Definition at line 128 of file ethernet.c.

u64 cvm_oct_tx_poll_interval

Definition at line 136 of file ethernet.c.

int max_rx_cpus = -1

Definition at line 108 of file ethernet.c.

int num_packet_buffers = 1024

Definition at line 63 of file ethernet.c.

int pow_receive_group = 15

Definition at line 71 of file ethernet.c.

int pow_send_group = -1

Definition at line 79 of file ethernet.c.

char pow_send_list[128] = ""

Definition at line 98 of file ethernet.c.

int rx_napi_weight = 32

Definition at line 114 of file ethernet.c.