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
common.h File Reference
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/mdio.h>
#include <linux/crc32.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <linux/pci_ids.h>

Go to the source code of this file.

Data Structures

struct  t1_rx_mode
 
struct  sge_params
 
struct  chelsio_pci_params
 
struct  tp_params
 
struct  mc5_params
 
struct  adapter_params
 
struct  link_config
 
struct  port_info
 
struct  adapter
 
struct  board_info
 

Macros

#define pr_fmt(fmt)   "cxgb: " fmt
 
#define DRV_DESCRIPTION   "Chelsio 10Gb Ethernet Driver"
 
#define DRV_NAME   "cxgb"
 
#define DRV_VERSION   "2.2"
 
#define CH_DEVICE(devid, ssid, idx)   { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx }
 
#define SUPPORTED_PAUSE   (1 << 13)
 
#define SUPPORTED_LOOPBACK   (1 << 15)
 
#define ADVERTISED_PAUSE   (1 << 13)
 
#define ADVERTISED_ASYM_PAUSE   (1 << 14)
 
#define t1_rx_mode_promisc(rm)   (rm->dev->flags & IFF_PROMISC)
 
#define t1_rx_mode_allmulti(rm)   (rm->dev->flags & IFF_ALLMULTI)
 
#define t1_rx_mode_mc_cnt(rm)   (netdev_mc_count(rm->dev))
 
#define t1_get_netdev(rm)   (rm->dev)
 
#define MAX_NPORTS   4
 
#define PORT_MASK   ((1 << MAX_NPORTS) - 1)
 
#define NMTUS   8
 
#define TCB_SIZE   128
 
#define SPEED_INVALID   0xffff
 
#define DUPLEX_INVALID   0xff
 
#define DEFAULT_SERVER_REGION_LEN   256
 
#define DEFAULT_RT_REGION_LEN   1024
 
#define t1_is_T1B(adap)   adapter_matches_type(adap, CHBT_TERM_T1, TERM_T1B)
 
#define is_T2(adap)   adapter_matches_type(adap, CHBT_TERM_T2, TERM_T2)
 
#define for_each_port(adapter, iter)   for (iter = 0; iter < (adapter)->params.nports; ++iter)
 
#define board_info(adapter)   ((adapter)->params.brd_info)
 
#define is_10G(adapter)   (board_info(adapter)->caps & SUPPORTED_10000baseT_Full)
 

Typedefs

typedef struct adapter adapter_t
 

Enumerations

enum  {
  CHBT_BOARD_N110, CHBT_BOARD_N210, CHBT_BOARD_7500, CHBT_BOARD_8000,
  CHBT_BOARD_CHT101, CHBT_BOARD_CHT110, CHBT_BOARD_CHT210, CHBT_BOARD_CHT204,
  CHBT_BOARD_CHT204V, CHBT_BOARD_CHT204E, CHBT_BOARD_CHN204, CHBT_BOARD_COUGAR,
  CHBT_BOARD_6800, CHBT_BOARD_SIMUL
}
 
enum  { CHBT_TERM_FPGA, CHBT_TERM_T1, CHBT_TERM_T2, CHBT_TERM_T3 }
 
enum  {
  CHBT_MAC_CHELSIO_A, CHBT_MAC_IXF1010, CHBT_MAC_PM3393, CHBT_MAC_VSC7321,
  CHBT_MAC_DUMMY
}
 
enum  {
  CHBT_PHY_88E1041, CHBT_PHY_88E1111, CHBT_PHY_88X2010, CHBT_PHY_XPAK,
  CHBT_PHY_MY3126, CHBT_PHY_8244, CHBT_PHY_DUMMY
}
 
enum  { PAUSE_RX = 1 << 0, PAUSE_TX = 1 << 1, PAUSE_AUTONEG = 1 << 2 }
 
enum  { TERM_T1A = 0, TERM_T1B = 1, TERM_T2 = 3 }
 
enum  { FULL_INIT_DONE = 1 << 0 }
 

Functions

int __t1_tpi_read (adapter_t *adapter, u32 addr, u32 *valp)
 
int __t1_tpi_write (adapter_t *adapter, u32 addr, u32 value)
 
int t1_tpi_write (adapter_t *adapter, u32 addr, u32 value)
 
int t1_tpi_read (adapter_t *adapter, u32 addr, u32 *value)
 
void t1_interrupts_enable (adapter_t *adapter)
 
void t1_interrupts_disable (adapter_t *adapter)
 
void t1_interrupts_clear (adapter_t *adapter)
 
int t1_elmer0_ext_intr_handler (adapter_t *adapter)
 
void t1_elmer0_ext_intr (adapter_t *adapter)
 
int t1_slow_intr_handler (adapter_t *adapter)
 
int t1_link_start (struct cphy *phy, struct cmac *mac, struct link_config *lc)
 
struct board_infot1_get_board_info (unsigned int board_id)
 
struct board_infot1_get_board_info_from_ids (unsigned int devid, unsigned short ssid)
 
int t1_seeprom_read (adapter_t *adapter, u32 addr, __le32 *data)
 
int t1_get_board_rev (adapter_t *adapter, const struct board_info *bi, struct adapter_params *p)
 
int t1_init_hw_modules (adapter_t *adapter)
 
int t1_init_sw_modules (adapter_t *adapter, const struct board_info *bi)
 
void t1_free_sw_modules (adapter_t *adapter)
 
void t1_fatal_err (adapter_t *adapter)
 
void t1_link_changed (adapter_t *adapter, int port_id)
 
void t1_link_negotiated (adapter_t *adapter, int port_id, int link_stat, int speed, int duplex, int pause)
 

Variables

struct pci_device_id t1_pci_tbl []
 

Macro Definition Documentation

#define ADVERTISED_ASYM_PAUSE   (1 << 14)

Definition at line 69 of file common.h.

#define ADVERTISED_PAUSE   (1 << 13)

Definition at line 68 of file common.h.

#define board_info (   adapter)    ((adapter)->params.brd_info)

Definition at line 319 of file common.h.

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

Definition at line 62 of file common.h.

#define DEFAULT_RT_REGION_LEN   1024

Definition at line 184 of file common.h.

#define DEFAULT_SERVER_REGION_LEN   256

Definition at line 183 of file common.h.

#define DRV_DESCRIPTION   "Chelsio 10Gb Ethernet Driver"

Definition at line 58 of file common.h.

#define DRV_NAME   "cxgb"

Definition at line 59 of file common.h.

#define DRV_VERSION   "2.2"

Definition at line 60 of file common.h.

#define DUPLEX_INVALID   0xff

Definition at line 88 of file common.h.

#define for_each_port (   adapter,
  iter 
)    for (iter = 0; iter < (adapter)->params.nports; ++iter)

Definition at line 316 of file common.h.

#define is_10G (   adapter)    (board_info(adapter)->caps & SUPPORTED_10000baseT_Full)

Definition at line 320 of file common.h.

#define is_T2 (   adap)    adapter_matches_type(adap, CHBT_TERM_T2, TERM_T2)

Definition at line 308 of file common.h.

#define MAX_NPORTS   4

Definition at line 82 of file common.h.

#define NMTUS   8

Definition at line 84 of file common.h.

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

Definition at line 83 of file common.h.

#define pr_fmt (   fmt)    "cxgb: " fmt

Definition at line 39 of file common.h.

#define SPEED_INVALID   0xffff

Definition at line 87 of file common.h.

#define SUPPORTED_LOOPBACK   (1 << 15)

Definition at line 66 of file common.h.

#define SUPPORTED_PAUSE   (1 << 13)

Definition at line 65 of file common.h.

#define t1_get_netdev (   rm)    (rm->dev)

Definition at line 80 of file common.h.

#define t1_is_T1B (   adap)    adapter_matches_type(adap, CHBT_TERM_T1, TERM_T1B)

Definition at line 307 of file common.h.

#define t1_rx_mode_allmulti (   rm)    (rm->dev->flags & IFF_ALLMULTI)

Definition at line 78 of file common.h.

#define t1_rx_mode_mc_cnt (   rm)    (netdev_mc_count(rm->dev))

Definition at line 79 of file common.h.

#define t1_rx_mode_promisc (   rm)    (rm->dev->flags & IFF_PROMISC)

Definition at line 77 of file common.h.

#define TCB_SIZE   128

Definition at line 85 of file common.h.

Typedef Documentation

Definition at line 71 of file common.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
CHBT_BOARD_N110 
CHBT_BOARD_N210 
CHBT_BOARD_7500 
CHBT_BOARD_8000 
CHBT_BOARD_CHT101 
CHBT_BOARD_CHT110 
CHBT_BOARD_CHT210 
CHBT_BOARD_CHT204 
CHBT_BOARD_CHT204V 
CHBT_BOARD_CHT204E 
CHBT_BOARD_CHN204 
CHBT_BOARD_COUGAR 
CHBT_BOARD_6800 
CHBT_BOARD_SIMUL 

Definition at line 90 of file common.h.

anonymous enum
Enumerator:
CHBT_TERM_FPGA 
CHBT_TERM_T1 
CHBT_TERM_T2 
CHBT_TERM_T3 

Definition at line 107 of file common.h.

anonymous enum
Enumerator:
CHBT_MAC_CHELSIO_A 
CHBT_MAC_IXF1010 
CHBT_MAC_PM3393 
CHBT_MAC_VSC7321 
CHBT_MAC_DUMMY 

Definition at line 114 of file common.h.

anonymous enum
Enumerator:
CHBT_PHY_88E1041 
CHBT_PHY_88E1111 
CHBT_PHY_88X2010 
CHBT_PHY_XPAK 
CHBT_PHY_MY3126 
CHBT_PHY_8244 
CHBT_PHY_DUMMY 

Definition at line 122 of file common.h.

anonymous enum
Enumerator:
PAUSE_RX 
PAUSE_TX 
PAUSE_AUTONEG 

Definition at line 132 of file common.h.

anonymous enum
Enumerator:
TERM_T1A 
TERM_T1B 
TERM_T2 

Definition at line 139 of file common.h.

anonymous enum
Enumerator:
FULL_INIT_DONE 

Definition at line 263 of file common.h.

Function Documentation

int __t1_tpi_read ( adapter_t adapter,
u32  addr,
u32 valp 
)

Definition at line 111 of file subr.c.

int __t1_tpi_write ( adapter_t adapter,
u32  addr,
u32  value 
)

Definition at line 82 of file subr.c.

void t1_elmer0_ext_intr ( adapter_t adapter)
int t1_elmer0_ext_intr_handler ( adapter_t adapter)

Definition at line 668 of file subr.c.

void t1_fatal_err ( adapter_t adapter)
void t1_free_sw_modules ( adapter_t adapter)

Definition at line 1009 of file subr.c.

struct board_info* t1_get_board_info ( unsigned int  board_id)
read

Definition at line 543 of file subr.c.

struct board_info* t1_get_board_info_from_ids ( unsigned int  devid,
unsigned short  ssid 
)
read
int t1_get_board_rev ( adapter_t adapter,
const struct board_info bi,
struct adapter_params p 
)

Definition at line 895 of file subr.c.

int t1_init_hw_modules ( adapter_t adapter)

Definition at line 963 of file subr.c.

int t1_init_sw_modules ( adapter_t adapter,
const struct board_info bi 
)

Definition at line 1052 of file subr.c.

void t1_interrupts_clear ( adapter_t adapter)

Definition at line 816 of file subr.c.

void t1_interrupts_disable ( adapter_t adapter)

Definition at line 790 of file subr.c.

void t1_interrupts_enable ( adapter_t adapter)

Definition at line 756 of file subr.c.

void t1_link_changed ( adapter_t adapter,
int  port_id 
)

Definition at line 151 of file subr.c.

void t1_link_negotiated ( adapter_t adapter,
int  port_id,
int  link_stat,
int  speed,
int  duplex,
int  pause 
)
int t1_link_start ( struct cphy phy,
struct cmac mac,
struct link_config lc 
)

Definition at line 624 of file subr.c.

int t1_seeprom_read ( adapter_t adapter,
u32  addr,
__le32 data 
)

Definition at line 563 of file subr.c.

int t1_slow_intr_handler ( adapter_t adapter)

Definition at line 870 of file subr.c.

int t1_tpi_read ( adapter_t adapter,
u32  addr,
u32 value 
)

Definition at line 128 of file subr.c.

int t1_tpi_write ( adapter_t adapter,
u32  addr,
u32  value 
)

Definition at line 98 of file subr.c.

Variable Documentation

struct pci_device_id t1_pci_tbl[]