Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
bnx2x_sp.c File Reference
#include <linux/module.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/crc32c.h>
#include "bnx2x.h"
#include "bnx2x_cmn.h"
#include "bnx2x_sp.h"

Go to the source code of this file.

Data Structures

struct  bnx2x_mcast_mac_elem
 
struct  bnx2x_pending_mcast_cmd
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define BNX2X_MAX_EMUL_MULTI   16
 
#define MAC_LEADING_ZERO_CNT   (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
 
#define list_next_entry(pos, member)   list_entry((pos)->member.next, typeof(*(pos)), member)
 
#define BNX2X_57711_SET_MC_FILTER(filter, bit)
 
#define BNX2X_CAM_SIZE_EMUL   5
 

Functions

void bnx2x_set_mac_in_nig (struct bnx2x *bp, bool add, unsigned char *dev_addr, int index)
 
int bnx2x_config_vlan_mac (struct bnx2x *bp, struct bnx2x_vlan_mac_ramrod_params *p)
 
void bnx2x_init_mac_obj (struct bnx2x *bp, struct bnx2x_vlan_mac_obj *mac_obj, u8 cl_id, u32 cid, u8 func_id, void *rdata, dma_addr_t rdata_mapping, int state, unsigned long *pstate, bnx2x_obj_type type, struct bnx2x_credit_pool_obj *macs_pool)
 
void bnx2x_init_vlan_obj (struct bnx2x *bp, struct bnx2x_vlan_mac_obj *vlan_obj, u8 cl_id, u32 cid, u8 func_id, void *rdata, dma_addr_t rdata_mapping, int state, unsigned long *pstate, bnx2x_obj_type type, struct bnx2x_credit_pool_obj *vlans_pool)
 
void bnx2x_init_vlan_mac_obj (struct bnx2x *bp, struct bnx2x_vlan_mac_obj *vlan_mac_obj, u8 cl_id, u32 cid, u8 func_id, void *rdata, dma_addr_t rdata_mapping, int state, unsigned long *pstate, bnx2x_obj_type type, struct bnx2x_credit_pool_obj *macs_pool, struct bnx2x_credit_pool_obj *vlans_pool)
 
int bnx2x_config_rx_mode (struct bnx2x *bp, struct bnx2x_rx_mode_ramrod_params *p)
 
void bnx2x_init_rx_mode_obj (struct bnx2x *bp, struct bnx2x_rx_mode_obj *o)
 
int bnx2x_config_mcast (struct bnx2x *bp, struct bnx2x_mcast_ramrod_params *p, int cmd)
 
void bnx2x_init_mcast_obj (struct bnx2x *bp, struct bnx2x_mcast_obj *mcast_obj, u8 mcast_cl_id, u32 mcast_cid, u8 func_id, u8 engine_id, void *rdata, dma_addr_t rdata_mapping, int state, unsigned long *pstate, bnx2x_obj_type type)
 
void bnx2x_init_mac_credit_pool (struct bnx2x *bp, struct bnx2x_credit_pool_obj *p, u8 func_id, u8 func_num)
 
void bnx2x_init_vlan_credit_pool (struct bnx2x *bp, struct bnx2x_credit_pool_obj *p, u8 func_id, u8 func_num)
 
void bnx2x_get_rss_ind_table (struct bnx2x_rss_config_obj *rss_obj, u8 *ind_table)
 
int bnx2x_config_rss (struct bnx2x *bp, struct bnx2x_config_rss_params *p)
 
void bnx2x_init_rss_config_obj (struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, u8 cl_id, u32 cid, u8 func_id, u8 engine_id, void *rdata, dma_addr_t rdata_mapping, int state, unsigned long *pstate, bnx2x_obj_type type)
 
int bnx2x_queue_state_change (struct bnx2x *bp, struct bnx2x_queue_state_params *params)
 
void bnx2x_init_queue_obj (struct bnx2x *bp, struct bnx2x_queue_sp_obj *obj, u8 cl_id, u32 *cids, u8 cid_cnt, u8 func_id, void *rdata, dma_addr_t rdata_mapping, unsigned long type)
 
enum bnx2x_func_state bnx2x_func_get_state (struct bnx2x *bp, struct bnx2x_func_sp_obj *o)
 
void bnx2x_init_func_obj (struct bnx2x *bp, struct bnx2x_func_sp_obj *obj, void *rdata, dma_addr_t rdata_mapping, void *afex_rdata, dma_addr_t afex_rdata_mapping, struct bnx2x_func_sp_drv_ops *drv_iface)
 
int bnx2x_func_state_change (struct bnx2x *bp, struct bnx2x_func_state_params *params)
 

Macro Definition Documentation

#define BNX2X_57711_SET_MC_FILTER (   filter,
  bit 
)
Value:
do { \
(filter)[(bit) >> 5] |= (1 << ((bit) & 0x1f)); \
} while (0)

Definition at line 3070 of file bnx2x_sp.c.

#define BNX2X_CAM_SIZE_EMUL   5
#define BNX2X_MAX_EMUL_MULTI   16

Definition at line 31 of file bnx2x_sp.c.

#define list_next_entry (   pos,
  member 
)    list_entry((pos)->member.next, typeof(*(pos)), member)

Definition at line 1035 of file bnx2x_sp.c.

#define MAC_LEADING_ZERO_CNT   (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)

Definition at line 33 of file bnx2x_sp.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 20 of file bnx2x_sp.c.

Function Documentation

int bnx2x_config_mcast ( struct bnx2x bp,
struct bnx2x_mcast_ramrod_params p,
int  cmd 
)

bnx2x_config_mcast - Configure multicast MACs list.

: command to execute: BNX2X_MCAST_CMD_X

May configure a new list provided in p->mcast_list (BNX2X_MCAST_CMD_ADD), clean up (BNX2X_MCAST_CMD_DEL) or restore (BNX2X_MCAST_CMD_RESTORE) a current configuration, continue to execute the pending commands (BNX2X_MCAST_CMD_CONT).

If previous command is still pending or if number of MACs to configure is more that maximum number of MACs in one command, the current command will be enqueued to the tail of the pending commands list.

Return: 0 is operation was successfull and there are no pending completions, negative if there were errors, positive if there are pending completions.

Definition at line 3563 of file bnx2x_sp.c.

int bnx2x_config_rss ( struct bnx2x bp,
struct bnx2x_config_rss_params p 
)

bnx2x_config_rss - Updates RSS configuration according to provided parameters

Return: 0 in case of success

Definition at line 4178 of file bnx2x_sp.c.

int bnx2x_config_rx_mode ( struct bnx2x bp,
struct bnx2x_rx_mode_ramrod_params p 
)

bnx2x_config_rx_mode - Send and RX_MODE ramrod according to the provided parameters.

: Command parameters

Return: 0 - if operation was successfull and there is no pending completions, positive number - if there are pending completions, negative - if there were errors

Definition at line 2358 of file bnx2x_sp.c.

int bnx2x_config_vlan_mac ( struct bnx2x bp,
struct bnx2x_vlan_mac_ramrod_params p 
)

bnx2x_config_vlan_mac - configure VLAN/MAC/VLAN_MAC filtering rules.

: device handle :

Definition at line 1744 of file bnx2x_sp.c.

enum bnx2x_func_state bnx2x_func_get_state ( struct bnx2x bp,
struct bnx2x_func_sp_obj o 
)

Definition at line 5203 of file bnx2x_sp.c.

int bnx2x_func_state_change ( struct bnx2x bp,
struct bnx2x_func_state_params params 
)

bnx2x_func_state_change - perform Function state change transition

: device handle : parameters to perform the transaction

returns 0 in case of successfully completed transition, negative error code in case of failure, positive (EBUSY) value if there is a completion to that is still pending (possible only if RAMROD_COMP_WAIT is not set in params->ramrod_flags for asynchronous commands).

Definition at line 5817 of file bnx2x_sp.c.

void bnx2x_get_rss_ind_table ( struct bnx2x_rss_config_obj rss_obj,
u8 ind_table 
)

bnx2x_get_rss_ind_table - Return the current ind_table configuration.

: buffer to fill with the current indirection table content. Should be at least T_ETH_INDIRECTION_TABLE_SIZE bytes long.

Definition at line 4172 of file bnx2x_sp.c.

void bnx2x_init_func_obj ( struct bnx2x bp,
struct bnx2x_func_sp_obj obj,
void rdata,
dma_addr_t  rdata_mapping,
void afex_rdata,
dma_addr_t  afex_rdata_mapping,
struct bnx2x_func_sp_drv_ops drv_iface 
)

Definition at line 5782 of file bnx2x_sp.c.

void bnx2x_init_mac_credit_pool ( struct bnx2x bp,
struct bnx2x_credit_pool_obj p,
u8  func_id,
u8  func_num 
)

Definition at line 3952 of file bnx2x_sp.c.

void bnx2x_init_mac_obj ( struct bnx2x bp,
struct bnx2x_vlan_mac_obj mac_obj,
u8  cl_id,
u32  cid,
u8  func_id,
void rdata,
dma_addr_t  rdata_mapping,
int  state,
unsigned long pstate,
bnx2x_obj_type  type,
struct bnx2x_credit_pool_obj macs_pool 
)

Definition at line 1931 of file bnx2x_sp.c.

void bnx2x_init_mcast_obj ( struct bnx2x bp,
struct bnx2x_mcast_obj mcast_obj,
u8  mcast_cl_id,
u32  mcast_cid,
u8  func_id,
u8  engine_id,
void rdata,
dma_addr_t  rdata_mapping,
int  state,
unsigned long pstate,
bnx2x_obj_type  type 
)

Definition at line 3653 of file bnx2x_sp.c.

void bnx2x_init_queue_obj ( struct bnx2x bp,
struct bnx2x_queue_sp_obj obj,
u8  cl_id,
u32 cids,
u8  cid_cnt,
u8  func_id,
void rdata,
dma_addr_t  rdata_mapping,
unsigned long  type 
)

Definition at line 5170 of file bnx2x_sp.c.

void bnx2x_init_rss_config_obj ( struct bnx2x bp,
struct bnx2x_rss_config_obj rss_obj,
u8  cl_id,
u32  cid,
u8  func_id,
u8  engine_id,
void rdata,
dma_addr_t  rdata_mapping,
int  state,
unsigned long pstate,
bnx2x_obj_type  type 
)

Definition at line 4204 of file bnx2x_sp.c.

void bnx2x_init_rx_mode_obj ( struct bnx2x bp,
struct bnx2x_rx_mode_obj o 
)

Definition at line 2378 of file bnx2x_sp.c.

void bnx2x_init_vlan_credit_pool ( struct bnx2x bp,
struct bnx2x_credit_pool_obj p,
u8  func_id,
u8  func_num 
)

Definition at line 4010 of file bnx2x_sp.c.

void bnx2x_init_vlan_mac_obj ( struct bnx2x bp,
struct bnx2x_vlan_mac_obj vlan_mac_obj,
u8  cl_id,
u32  cid,
u8  func_id,
void rdata,
dma_addr_t  rdata_mapping,
int  state,
unsigned long pstate,
bnx2x_obj_type  type,
struct bnx2x_credit_pool_obj macs_pool,
struct bnx2x_credit_pool_obj vlans_pool 
)

Definition at line 2025 of file bnx2x_sp.c.

void bnx2x_init_vlan_obj ( struct bnx2x bp,
struct bnx2x_vlan_mac_obj vlan_obj,
u8  cl_id,
u32  cid,
u8  func_id,
void rdata,
dma_addr_t  rdata_mapping,
int  state,
unsigned long pstate,
bnx2x_obj_type  type,
struct bnx2x_credit_pool_obj vlans_pool 
)

Definition at line 1985 of file bnx2x_sp.c.

int bnx2x_queue_state_change ( struct bnx2x bp,
struct bnx2x_queue_state_params params 
)

bnx2x_queue_state_change - perform Queue state change transition

: device handle : parameters to perform the transition

returns 0 in case of successfully completed transition, negative error code in case of failure, positive (EBUSY) value if there is a completion to that is still pending (possible only if RAMROD_COMP_WAIT is not set in params->ramrod_flags for asynchronous commands).

Definition at line 4232 of file bnx2x_sp.c.

void bnx2x_set_mac_in_nig ( struct bnx2x bp,
bool  add,
unsigned char dev_addr,
int  index 
)

Definition at line 635 of file bnx2x_sp.c.