Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
cxgb3_main.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/mdio.h>
#include <linux/sockios.h>
#include <linux/workqueue.h>
#include <linux/proc_fs.h>
#include <linux/rtnetlink.h>
#include <linux/firmware.h>
#include <linux/log2.h>
#include <linux/stringify.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include "common.h"
#include "cxgb3_ioctl.h"
#include "regs.h"
#include "cxgb3_offload.h"
#include "version.h"
#include "cxgb3_ctl_defs.h"
#include "t3_cpl.h"
#include "firmware_exports.h"

Go to the source code of this file.

Macros

#define PORT_MASK   ((1 << MAX_NPORTS) - 1)
 
#define DFLT_MSG_ENABLE
 
#define EEPROM_MAGIC   0x38E2F10C
 
#define CH_DEVICE(devid, idx)   { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, PCI_ANY_ID, 0, 0, idx }
 
#define CXGB3_SHOW(name, val_expr)
 
#define CXGB3_ATTR_R(name, val_expr)
 
#define CXGB3_ATTR_RW(name, val_expr, store_method)
 
#define TM_ATTR(name, sched)
 
#define FW_VERSION
 
#define FW_FNAME   "cxgb3/t3fw-" FW_VERSION ".bin"
 
#define TPSRAM_VERSION
 
#define TPSRAM_NAME   "cxgb3/t3%c_psram-" TPSRAM_VERSION ".bin"
 
#define AEL2005_OPT_EDC_NAME   "cxgb3/ael2005_opt_edc.bin"
 
#define AEL2005_TWX_EDC_NAME   "cxgb3/ael2005_twx_edc.bin"
 
#define AEL2020_TWX_EDC_NAME   "cxgb3/ael2020_twx_edc.bin"
 
#define T3_REGMAP_SIZE   (3 * 1024)
 
#define ADVERTISED_MASK
 
#define TSO_FLAGS   (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
 
#define VLAN_FEAT
 

Enumerations

enum  {
  MAX_TXQ_ENTRIES = 16384, MAX_CTRL_TXQ_ENTRIES = 1024, MAX_RSPQ_ENTRIES = 16384, MAX_RX_BUFFERS = 16384,
  MAX_RX_JUMBO_BUFFERS = 16384, MIN_TXQ_ENTRIES = 4, MIN_CTRL_TXQ_ENTRIES = 4, MIN_RSPQ_ENTRIES = 32,
  MIN_FL_ENTRIES = 32
}
 

Functions

 MODULE_DESCRIPTION (DRV_DESC)
 
 MODULE_AUTHOR ("Chelsio Communications")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_DEVICE_TABLE (pci, cxgb3_pci_tbl)
 
 module_param (dflt_msg_enable, int, 0644)
 
 MODULE_PARM_DESC (dflt_msg_enable,"Chelsio T3 default message enable bitmap")
 
 module_param (msi, int, 0644)
 
 MODULE_PARM_DESC (msi,"whether to use MSI or MSI-X")
 
 module_param (ofld_disable, int, 0644)
 
 MODULE_PARM_DESC (ofld_disable,"whether to enable offload at init time or not")
 
void t3_os_link_fault (struct adapter *adap, int port_id, int state)
 
void t3_os_link_changed (struct adapter *adapter, int port_id, int link_stat, int speed, int duplex, int pause)
 
void t3_os_phymod_changed (struct adapter *adap, int port_id)
 
 CXGB3_ATTR_R (cam_size, t3_mc5_size(&adap->mc5))
 
 CXGB3_ATTR_RW (nfilters, adap->params.mc5.nfilters, store_nfilters)
 
 CXGB3_ATTR_RW (nservers, adap->params.mc5.nservers, store_nservers)
 
 TM_ATTR (sched0, 0)
 
 TM_ATTR (sched1, 1)
 
 TM_ATTR (sched2, 2)
 
 TM_ATTR (sched3, 3)
 
 TM_ATTR (sched4, 4)
 
 TM_ATTR (sched5, 5)
 
 TM_ATTR (sched6, 6)
 
 TM_ATTR (sched7, 7)
 
 MODULE_FIRMWARE (FW_FNAME)
 
 MODULE_FIRMWARE ("cxgb3/t3b_psram-"TPSRAM_VERSION".bin")
 
 MODULE_FIRMWARE ("cxgb3/t3c_psram-"TPSRAM_VERSION".bin")
 
 MODULE_FIRMWARE (AEL2005_OPT_EDC_NAME)
 
 MODULE_FIRMWARE (AEL2005_TWX_EDC_NAME)
 
 MODULE_FIRMWARE (AEL2020_TWX_EDC_NAME)
 
int t3_get_edc_fw (struct cphy *phy, int edc_idx, int size)
 
void t3_os_ext_intr_handler (struct adapter *adapter)
 
void t3_os_link_fault_handler (struct adapter *adapter, int port_id)
 
void t3_fatal_err (struct adapter *adapter)
 
 module_init (cxgb3_init_module)
 
 module_exit (cxgb3_cleanup_module)
 

Variables

struct workqueue_structcxgb3_wq
 

Macro Definition Documentation

#define ADVERTISED_MASK
Value:
ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | \
ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full | \
ADVERTISED_10000baseT_Full)

Definition at line 1851 of file cxgb3_main.c.

#define AEL2005_OPT_EDC_NAME   "cxgb3/ael2005_opt_edc.bin"

Definition at line 992 of file cxgb3_main.c.

#define AEL2005_TWX_EDC_NAME   "cxgb3/ael2005_twx_edc.bin"

Definition at line 993 of file cxgb3_main.c.

#define AEL2020_TWX_EDC_NAME   "cxgb3/ael2020_twx_edc.bin"

Definition at line 994 of file cxgb3_main.c.

#define CH_DEVICE (   devid,
  idx 
)    { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, PCI_ANY_ID, 0, 0, idx }

Definition at line 82 of file cxgb3_main.c.

#define CXGB3_ATTR_R (   name,
  val_expr 
)
Value:
CXGB3_SHOW(name, val_expr) \
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)

Definition at line 775 of file cxgb3_main.c.

#define CXGB3_ATTR_RW (   name,
  val_expr,
  store_method 
)
Value:
CXGB3_SHOW(name, val_expr) \
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, show_##name, store_method)

Definition at line 779 of file cxgb3_main.c.

#define CXGB3_SHOW (   name,
  val_expr 
)
Value:
static ssize_t format_##name(struct net_device *dev, char *buf) \
{ \
struct port_info *pi = netdev_priv(dev); \
struct adapter *adap = pi->adapter; \
return sprintf(buf, "%u\n", val_expr); \
} \
static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
char *buf) \
{ \
return attr_show(d, buf, format_##name); \
}

Definition at line 719 of file cxgb3_main.c.

#define DFLT_MSG_ENABLE
Value:

Definition at line 76 of file cxgb3_main.c.

#define EEPROM_MAGIC   0x38E2F10C

Definition at line 80 of file cxgb3_main.c.

#define FW_FNAME   "cxgb3/t3fw-" FW_VERSION ".bin"

Definition at line 988 of file cxgb3_main.c.

#define FW_VERSION
Value:

Definition at line 986 of file cxgb3_main.c.

#define PORT_MASK   ((1 << MAX_NPORTS) - 1)

Definition at line 74 of file cxgb3_main.c.

#define T3_REGMAP_SIZE   (3 * 1024)

Definition at line 1600 of file cxgb3_main.c.

#define TM_ATTR (   name,
  sched 
)
Value:
static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
char *buf) \
{ \
return tm_attr_show(d, buf, sched); \
} \
static ssize_t store_##name(struct device *d, struct device_attribute *attr, \
const char *buf, size_t len) \
{ \
return tm_attr_store(d, buf, len, sched); \
} \
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, show_##name, store_##name)

Definition at line 846 of file cxgb3_main.c.

#define TPSRAM_NAME   "cxgb3/t3%c_psram-" TPSRAM_VERSION ".bin"

Definition at line 991 of file cxgb3_main.c.

#define TPSRAM_VERSION
Value:

Definition at line 989 of file cxgb3_main.c.

#define TSO_FLAGS   (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)

Definition at line 3176 of file cxgb3_main.c.

#define VLAN_FEAT
Value:
NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)

Definition at line 3177 of file cxgb3_main.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAX_TXQ_ENTRIES 
MAX_CTRL_TXQ_ENTRIES 
MAX_RSPQ_ENTRIES 
MAX_RX_BUFFERS 
MAX_RX_JUMBO_BUFFERS 
MIN_TXQ_ENTRIES 
MIN_CTRL_TXQ_ENTRIES 
MIN_RSPQ_ENTRIES 
MIN_FL_ENTRIES 

Definition at line 62 of file cxgb3_main.c.

Function Documentation

CXGB3_ATTR_R ( cam_size  ,
t3_mc5_size &->  mc5 
)
CXGB3_ATTR_RW ( nfilters  ,
adap->params.mc5.  nfilters,
store_nfilters   
)
CXGB3_ATTR_RW ( nservers  ,
adap->params.mc5.  nservers,
store_nservers   
)
MODULE_AUTHOR ( "Chelsio Communications"  )
MODULE_DESCRIPTION ( DRV_DESC  )
MODULE_DEVICE_TABLE ( pci  ,
cxgb3_pci_tbl   
)
module_exit ( cxgb3_cleanup_module  )
MODULE_FIRMWARE ( FW_FNAME  )
MODULE_FIRMWARE ( "cxgb3/t3b_psram-"TPSRAM_VERSION".bin"  )
MODULE_FIRMWARE ( "cxgb3/t3c_psram-"TPSRAM_VERSION".bin"  )
MODULE_FIRMWARE ( AEL2005_OPT_EDC_NAME  )
MODULE_FIRMWARE ( AEL2005_TWX_EDC_NAME  )
MODULE_FIRMWARE ( AEL2020_TWX_EDC_NAME  )
module_init ( cxgb3_init_module  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( dflt_msg_enable  ,
int  ,
0644   
)
module_param ( msi  ,
int  ,
0644   
)
module_param ( ofld_disable  ,
int  ,
0644   
)
MODULE_PARM_DESC ( dflt_msg_enable  ,
"Chelsio T3 default message enable bitmap  
)
MODULE_PARM_DESC ( msi  ,
"whether to use MSI or MSI-X  
)
MODULE_PARM_DESC ( ofld_disable  ,
"whether to enable offload at init time or not"   
)
MODULE_VERSION ( DRV_VERSION  )
void t3_fatal_err ( struct adapter adapter)

Definition at line 2961 of file cxgb3_main.c.

int t3_get_edc_fw ( struct cphy phy,
int  edc_idx,
int  size 
)

Definition at line 1020 of file cxgb3_main.c.

void t3_os_ext_intr_handler ( struct adapter adapter)

Definition at line 2837 of file cxgb3_main.c.

void t3_os_link_changed ( struct adapter adapter,
int  port_id,
int  link_stat,
int  speed,
int  duplex,
int  pause 
)

t3_os_link_changed - handle link status changes : the adapter associated with the link change : the port index whose limk status has changed : the new status of the link : the new speed setting : the new duplex setting : the new flow-control setting

This is the OS-dependent handler for link status changes. The OS neutral handler takes care of most of the processing for these events, then calls this handler for any OS-specific processing.

Definition at line 247 of file cxgb3_main.c.

void t3_os_link_fault ( struct adapter adap,
int  port_id,
int  state 
)

Definition at line 195 of file cxgb3_main.c.

void t3_os_link_fault_handler ( struct adapter adapter,
int  port_id 
)

Definition at line 2855 of file cxgb3_main.c.

void t3_os_phymod_changed ( struct adapter adap,
int  port_id 
)

t3_os_phymod_changed - handle PHY module changes : the PHY reporting the module change : new module type

This is the OS-dependent handler for PHY module changes. It is invoked when a PHY module is removed or inserted for any OS-specific processing.

Definition at line 311 of file cxgb3_main.c.

TM_ATTR ( sched0  ,
 
)
TM_ATTR ( sched1  ,
 
)
TM_ATTR ( sched2  ,
 
)
TM_ATTR ( sched3  ,
 
)
TM_ATTR ( sched4  ,
 
)
TM_ATTR ( sched5  ,
 
)
TM_ATTR ( sched6  ,
 
)
TM_ATTR ( sched7  ,
 
)

Variable Documentation

Definition at line 145 of file cxgb3_main.c.