Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
bnx2x_cmn.c File Reference
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/ip.h>
#include <net/ipv6.h>
#include <net/ip6_checksum.h>
#include <linux/prefetch.h>
#include "bnx2x_cmn.h"
#include "bnx2x_init.h"
#include "bnx2x_sp.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define TPA_TSTAMP_OPT_LEN   12
 
#define LOAD_ERROR_EXIT(bp, label)
 

Functions

int bnx2x_tx_int (struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
 
int bnx2x_rx_int (struct bnx2x_fastpath *fp, int budget)
 
void bnx2x_acquire_phy_lock (struct bnx2x *bp)
 
void bnx2x_release_phy_lock (struct bnx2x *bp)
 
u16 bnx2x_get_mf_speed (struct bnx2x *bp)
 
void bnx2x_link_report (struct bnx2x *bp)
 
void __bnx2x_link_report (struct bnx2x *bp)
 
void bnx2x_init_rx_rings (struct bnx2x *bp)
 
void bnx2x_free_skbs (struct bnx2x *bp)
 
void bnx2x_update_max_mf_config (struct bnx2x *bp, u32 value)
 
void bnx2x_free_irq (struct bnx2x *bp)
 
int bnx2x_enable_msix (struct bnx2x *bp)
 
int bnx2x_enable_msi (struct bnx2x *bp)
 
void bnx2x_netif_start (struct bnx2x *bp)
 
void bnx2x_netif_stop (struct bnx2x *bp, int disable_hw)
 
u16 bnx2x_select_queue (struct net_device *dev, struct sk_buff *skb)
 
void bnx2x_set_num_queues (struct bnx2x *bp)
 
int bnx2x_config_rss_pf (struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, bool config_hash)
 
bool bnx2x_test_firmware_version (struct bnx2x *bp, bool is_err)
 
int bnx2x_nic_load (struct bnx2x *bp, int load_mode)
 
int bnx2x_nic_unload (struct bnx2x *bp, int unload_mode, bool keep_link)
 
int bnx2x_set_power_state (struct bnx2x *bp, pci_power_t state)
 
int bnx2x_poll (struct napi_struct *napi, int budget)
 
netdev_tx_t bnx2x_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
int bnx2x_setup_tc (struct net_device *dev, u8 num_tc)
 
int bnx2x_change_mac_addr (struct net_device *dev, void *p)
 
void bnx2x_free_fp_mem (struct bnx2x *bp)
 
int bnx2x_alloc_fp_mem (struct bnx2x *bp)
 
void bnx2x_free_mem_bp (struct bnx2x *bp)
 
int __devinit bnx2x_alloc_mem_bp (struct bnx2x *bp)
 
int bnx2x_reload_if_running (struct net_device *dev)
 
int bnx2x_get_cur_phy_idx (struct bnx2x *bp)
 
int bnx2x_get_link_cfg_idx (struct bnx2x *bp)
 
int bnx2x_change_mtu (struct net_device *dev, int new_mtu)
 
netdev_features_t bnx2x_fix_features (struct net_device *dev, netdev_features_t features)
 
int bnx2x_set_features (struct net_device *dev, netdev_features_t features)
 
void bnx2x_tx_timeout (struct net_device *dev)
 
int bnx2x_suspend (struct pci_dev *pdev, pm_message_t state)
 
int bnx2x_resume (struct pci_dev *pdev)
 
void bnx2x_set_ctx_validation (struct bnx2x *bp, struct eth_context *cxt, u32 cid)
 
void bnx2x_update_coalesce_sb_index (struct bnx2x *bp, u8 fw_sb_id, u8 sb_index, u8 disable, u16 usec)
 

Variables

int load_count [2][3] = { {0} }
 

Macro Definition Documentation

#define LOAD_ERROR_EXIT (   bp,
  label 
)
Value:
do { \
goto label; \
} while (0)

Definition at line 1857 of file bnx2x_cmn.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 18 of file bnx2x_cmn.c.

#define TPA_TSTAMP_OPT_LEN   12

Definition at line 388 of file bnx2x_cmn.c.

Function Documentation

void __bnx2x_link_report ( struct bnx2x bp)

__bnx2x_link_report - report link status to OS.

: driver handle

None atomic inmlementation. Should be called under the phy_lock.

Definition at line 1048 of file bnx2x_cmn.c.

void bnx2x_acquire_phy_lock ( struct bnx2x bp)

Definition at line 947 of file bnx2x_cmn.c.

int bnx2x_alloc_fp_mem ( struct bnx2x bp)
  1. Allocate FP for leading - fatal if error
  2. {CNIC} Allocate FCoE FP - fatal if error
  3. {CNIC} Allocate OOO + FWD - disable OOO if error
  4. Allocate RSS - fix number of queues if error

Definition at line 3644 of file bnx2x_cmn.c.

int __devinit bnx2x_alloc_mem_bp ( struct bnx2x bp)

bnx2x_alloc_mem_bp - allocate memories outsize main driver structure

: driver handle

Definition at line 3708 of file bnx2x_cmn.c.

int bnx2x_change_mac_addr ( struct net_device dev,
void p 
)

Definition at line 3331 of file bnx2x_cmn.c.

int bnx2x_change_mtu ( struct net_device dev,
int  new_mtu 
)

bnx2x_change_mtu - change mtu netdev callback

: net device : requested mtu

Definition at line 3866 of file bnx2x_cmn.c.

int bnx2x_config_rss_pf ( struct bnx2x bp,
struct bnx2x_rss_config_obj rss_obj,
bool  config_hash 
)

bnx2x_config_rss_pf - configure RSS parameters in a PF.

: driver handle : RSS object to use : indirection table to configure : re-configure RSS hash keys configuration

Definition at line 1740 of file bnx2x_cmn.c.

int bnx2x_enable_msi ( struct bnx2x bp)

bnx2x_enable_msi - request msi mode from OS, updated internals accordingly

: driver handle

Definition at line 1497 of file bnx2x_cmn.c.

int bnx2x_enable_msix ( struct bnx2x bp)

bnx2x_enable_msix - set msix configuration.

: driver handle

fills msix_table, requests vectors, updates num_queues according to number of available vectors.

Definition at line 1376 of file bnx2x_cmn.c.

netdev_features_t bnx2x_fix_features ( struct net_device dev,
netdev_features_t  features 
)

Definition at line 3890 of file bnx2x_cmn.c.

void bnx2x_free_fp_mem ( struct bnx2x bp)

Definition at line 3434 of file bnx2x_cmn.c.

void bnx2x_free_irq ( struct bnx2x bp)

Definition at line 1366 of file bnx2x_cmn.c.

void bnx2x_free_mem_bp ( struct bnx2x bp)

bnx2x_free_mem_bp - release memories outsize main driver structure

: driver handle

Definition at line 3697 of file bnx2x_cmn.c.

void bnx2x_free_skbs ( struct bnx2x bp)

Definition at line 1311 of file bnx2x_cmn.c.

int bnx2x_get_cur_phy_idx ( struct bnx2x bp)

Definition at line 3792 of file bnx2x_cmn.c.

int bnx2x_get_link_cfg_idx ( struct bnx2x bp)

Definition at line 3822 of file bnx2x_cmn.c.

u16 bnx2x_get_mf_speed ( struct bnx2x bp)

bnx2x_get_mf_speed - calculate MF speed.

: driver handle

Takes into account current linespeed and MF configuration.

Definition at line 964 of file bnx2x_cmn.c.

void bnx2x_init_rx_rings ( struct bnx2x bp)

Definition at line 1155 of file bnx2x_cmn.c.

void bnx2x_link_report ( struct bnx2x bp)

bnx2x_link_report - report link status to OS.

: driver handle

Calls the __bnx2x_link_report() under the same locking scheme as a link/PHY state managing code to ensure a consistent link reporting.

Definition at line 1033 of file bnx2x_cmn.c.

void bnx2x_netif_start ( struct bnx2x bp)

Definition at line 1575 of file bnx2x_cmn.c.

void bnx2x_netif_stop ( struct bnx2x bp,
int  disable_hw 
)

Definition at line 1585 of file bnx2x_cmn.c.

int bnx2x_nic_load ( struct bnx2x bp,
int  load_mode 
)

Definition at line 1992 of file bnx2x_cmn.c.

int bnx2x_nic_unload ( struct bnx2x bp,
int  unload_mode,
bool  keep_link 
)

Definition at line 2336 of file bnx2x_cmn.c.

int bnx2x_poll ( struct napi_struct napi,
int  budget 
)

bnx2x_poll - NAPI callback

: napi structure :

Definition at line 2522 of file bnx2x_cmn.c.

void bnx2x_release_phy_lock ( struct bnx2x bp)

Definition at line 955 of file bnx2x_cmn.c.

int bnx2x_reload_if_running ( struct net_device dev)

Definition at line 3781 of file bnx2x_cmn.c.

int bnx2x_resume ( struct pci_dev pdev)

Definition at line 3994 of file bnx2x_cmn.c.

int bnx2x_rx_int ( struct bnx2x_fastpath fp,
int  budget 
)

Definition at line 684 of file bnx2x_cmn.c.

u16 bnx2x_select_queue ( struct net_device dev,
struct sk_buff skb 
)

Definition at line 1591 of file bnx2x_cmn.c.

void bnx2x_set_ctx_validation ( struct bnx2x bp,
struct eth_context cxt,
u32  cid 
)

bnx2x_set_ctx_validation - set CDU context validation values

: driver handle : context of the connection on the host memory : SW CID of the connection to be configured

Definition at line 4031 of file bnx2x_cmn.c.

int bnx2x_set_features ( struct net_device dev,
netdev_features_t  features 
)

Definition at line 3904 of file bnx2x_cmn.c.

void bnx2x_set_num_queues ( struct bnx2x bp)

bnx2x_set_num_queues - set number of queues according to mode.

: driver handle

Definition at line 1618 of file bnx2x_cmn.c.

int bnx2x_set_power_state ( struct bnx2x bp,
pci_power_t  state 
)

bnx2x_set_power_state - set power state to the requested value.

: driver handle : required state D0 or D3hot

Currently only D0 and D3hot are supported.

Definition at line 2466 of file bnx2x_cmn.c.

int bnx2x_setup_tc ( struct net_device dev,
u8  num_tc 
)

bnx2x_setup_tc - routine to configure net_device for multi tc

: net device to configure : number of traffic classes to enable

callback connected to the ndo_setup_tc function pointer

Definition at line 3271 of file bnx2x_cmn.c.

netdev_tx_t bnx2x_start_xmit ( struct sk_buff skb,
struct net_device dev 
)

Definition at line 2913 of file bnx2x_cmn.c.

int bnx2x_suspend ( struct pci_dev pdev,
pm_message_t  state 
)

Definition at line 3963 of file bnx2x_cmn.c.

bool bnx2x_test_firmware_version ( struct bnx2x bp,
bool  is_err 
)

Definition at line 1871 of file bnx2x_cmn.c.

int bnx2x_tx_int ( struct bnx2x bp,
struct bnx2x_fp_txdata txdata 
)

Definition at line 163 of file bnx2x_cmn.c.

void bnx2x_tx_timeout ( struct net_device dev)

bnx2x_tx_timeout - tx timeout netdev callback

: net device

Definition at line 3946 of file bnx2x_cmn.c.

void bnx2x_update_coalesce_sb_index ( struct bnx2x bp,
u8  fw_sb_id,
u8  sb_index,
u8  disable,
u16  usec 
)

Definition at line 4074 of file bnx2x_cmn.c.

void bnx2x_update_max_mf_config ( struct bnx2x bp,
u32  value 
)

bnx2x_update_max_mf_config - update MAX part of MF configuration in HW.

: driver handle : new value

Definition at line 1317 of file bnx2x_cmn.c.

Variable Documentation

int load_count[2][3] = { {0} }

Definition at line 89 of file bnx2x_cmn.c.