linux/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h

/* bnx2x_sp.h: Qlogic Everest network driver.
 *
 * Copyright 2011-2013 Broadcom Corporation
 * Copyright (c) 2014 QLogic Corporation
 * All rights reserved
 *
 * Unless you and Qlogic execute a separate written software license
 * agreement governing use of this software, this software is licensed to you
 * under the terms of the GNU General Public License version 2, available
 * at http://www.gnu.org/licenses/gpl-2.0.html (the "GPL").
 *
 * Notwithstanding the above, under no circumstances may you combine this
 * software in any way with any other Qlogic software provided under a
 * license other than the GPL, without Qlogic's express prior written
 * consent.
 *
 * Maintained by: Ariel Elior <[email protected]>
 * Written by: Vladislav Zolotarov
 *
 */
#ifndef BNX2X_SP_VERBS
#define BNX2X_SP_VERBS

struct bnx2x;
struct eth_context;

/* Bits representing general command's configuration */
enum {};

bnx2x_obj_type;

/* Public slow path states */
enum {};

struct bnx2x_raw_obj {};

/************************* VLAN-MAC commands related parameters ***************/
struct bnx2x_mac_ramrod_data {};

struct bnx2x_vlan_ramrod_data {};

struct bnx2x_vlan_mac_ramrod_data {};

bnx2x_classification_ramrod_data;

/* VLAN_MAC commands */
enum bnx2x_vlan_mac_cmd {};

struct bnx2x_vlan_mac_data {};

/*************************** Exe Queue obj ************************************/
bnx2x_exe_queue_cmd_data;

struct bnx2x_exeq_elem {};

bnx2x_qable_obj;

bnx2x_exeq_comp_elem;

struct bnx2x_exe_queue_obj;

exe_q_validate;

exe_q_remove;

/* Return positive if entry was optimized, 0 - if not, negative
 * in case of an error.
 */
exe_q_optimize;
exe_q_execute;
exe_q_get;

struct bnx2x_exe_queue_obj {};
/***************** Classification verbs: Set/Del MAC/VLAN/VLAN-MAC ************/
/*
 * Element in the VLAN_MAC registry list having all currently configured
 * rules.
 */
struct bnx2x_vlan_mac_registry_elem {};

/* Bits representing VLAN_MAC commands specific flags */
enum {};
/* When looking for matching filters, some flags are not interesting */
#define BNX2X_VLAN_MAC_CMP_MASK
#define BNX2X_VLAN_MAC_CMP_FLAGS(flags)

struct bnx2x_vlan_mac_ramrod_params {};

struct bnx2x_vlan_mac_obj {};

enum {};

/** RX_MODE verbs:DROP_ALL/ACCEPT_ALL/ACCEPT_ALL_MULTI/ACCEPT_ALL_VLAN/NORMAL */

/* RX_MODE ramrod special flags: set in rx_mode_flags field in
 * a bnx2x_rx_mode_ramrod_params.
 */
enum {};

enum {};

struct bnx2x_rx_mode_ramrod_params {};

struct bnx2x_rx_mode_obj {};

/********************** Set multicast group ***********************************/

struct bnx2x_mcast_list_elem {};

bnx2x_mcast_config_data;

struct bnx2x_mcast_ramrod_params {};

enum bnx2x_mcast_cmd {};

struct bnx2x_mcast_obj {};

/*************************** Credit handling **********************************/
struct bnx2x_credit_pool_obj {};

/*************************** RSS configuration ********************************/
enum {};

struct bnx2x_config_rss_params {};

struct bnx2x_rss_config_obj {};

/*********************** Queue state update ***********************************/

/* UPDATE command options */
enum {};

/* Allowed Queue states */
enum bnx2x_q_state {};

/* Allowed Queue states */
enum bnx2x_q_logical_state {};

/* Allowed commands */
enum bnx2x_queue_cmd {};

/* queue SETUP + INIT flags */
enum {};

/* Queue type options: queue type may be a combination of below. */
enum bnx2x_q_type {};

#define BNX2X_PRIMARY_CID_INDEX
#define BNX2X_MULTI_TX_COS_E1X
#define BNX2X_MULTI_TX_COS_E2_E3A0
#define BNX2X_MULTI_TX_COS_E3B0
#define BNX2X_MULTI_TX_COS

#define MAC_PAD
/* DMAE channel to be used by FW for timesync workaroun. A driver that sends
 * timesync-related ramrods must not use this DMAE command ID.
 */
#define FW_DMAE_CMD_ID

struct bnx2x_queue_init_params {};

struct bnx2x_queue_terminate_params {};

struct bnx2x_queue_cfc_del_params {};

struct bnx2x_queue_update_params {};

struct bnx2x_queue_update_tpa_params {};

struct rxq_pause_params {};

/* general */
struct bnx2x_general_setup_params {};

struct bnx2x_rxq_setup_params {};

struct bnx2x_txq_setup_params {};

struct bnx2x_queue_setup_params {};

struct bnx2x_queue_setup_tx_only_params {};

struct bnx2x_queue_state_params {};

struct bnx2x_viflist_params {};

struct bnx2x_queue_sp_obj {};

/********************** Function state update *********************************/

/* UPDATE command options */
enum {};

/* Allowed Function states */
enum bnx2x_func_state {};

/* Allowed Function commands */
enum bnx2x_func_cmd {};

struct bnx2x_func_hw_init_params {};

struct bnx2x_func_hw_reset_params {};

struct bnx2x_func_start_params {};

struct bnx2x_func_switch_update_params {};

struct bnx2x_func_afex_update_params {};

struct bnx2x_func_afex_viflists_params {};

struct bnx2x_func_tx_start_params {};

struct bnx2x_func_set_timesync_params {};

struct bnx2x_func_state_params {};

struct bnx2x_func_sp_drv_ops {};

struct bnx2x_func_sp_obj {};

/********************** Interfaces ********************************************/
/* Queueable objects set */
bnx2x_qable_obj;
/************** Function state update *********/
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);

enum bnx2x_func_state bnx2x_func_get_state(struct bnx2x *bp,
					   struct bnx2x_func_sp_obj *o);
/******************* Queue State **************/
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);

int bnx2x_queue_state_change(struct bnx2x *bp,
			     struct bnx2x_queue_state_params *params);

int bnx2x_get_q_logical_state(struct bnx2x *bp,
			       struct bnx2x_queue_sp_obj *obj);

/********************* VLAN-MAC ****************/
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_vlan_mac_h_read_lock(struct bnx2x *bp,
					struct bnx2x_vlan_mac_obj *o);
void bnx2x_vlan_mac_h_read_unlock(struct bnx2x *bp,
				  struct bnx2x_vlan_mac_obj *o);
int bnx2x_vlan_mac_h_write_lock(struct bnx2x *bp,
				struct bnx2x_vlan_mac_obj *o);
int bnx2x_config_vlan_mac(struct bnx2x *bp,
			   struct bnx2x_vlan_mac_ramrod_params *p);

int bnx2x_vlan_mac_move(struct bnx2x *bp,
			struct bnx2x_vlan_mac_ramrod_params *p,
			struct bnx2x_vlan_mac_obj *dest_o);

/********************* RX MODE ****************/

void bnx2x_init_rx_mode_obj(struct bnx2x *bp,
			    struct bnx2x_rx_mode_obj *o);

/**
 * bnx2x_config_rx_mode - Send and RX_MODE ramrod according to the provided parameters.
 *
 * @p: Command parameters
 *
 * Return: 0 - if operation was successful and there is no pending completions,
 *         positive number - if there are pending completions,
 *         negative - if there were errors
 */
int bnx2x_config_rx_mode(struct bnx2x *bp,
			 struct bnx2x_rx_mode_ramrod_params *p);

/****************** MULTICASTS ****************/

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);

/**
 * bnx2x_config_mcast - Configure multicast MACs list.
 *
 * @cmd: 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 successful and there are no pending completions,
 *         negative if there were errors, positive if there are pending
 *         completions.
 */
int bnx2x_config_mcast(struct bnx2x *bp,
		       struct bnx2x_mcast_ramrod_params *p,
		       enum bnx2x_mcast_cmd cmd);

/****************** CREDIT POOL ****************/
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_init_credit_pool(struct bnx2x_credit_pool_obj *p,
			    int base, int credit);

/****************** RSS CONFIGURATION ****************/
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);

/**
 * bnx2x_config_rss - Updates RSS configuration according to provided parameters
 *
 * Return: 0 in case of success
 */
int bnx2x_config_rss(struct bnx2x *bp,
		     struct bnx2x_config_rss_params *p);

/**
 * bnx2x_get_rss_ind_table - Return the current ind_table configuration.
 *
 * @ind_table: buffer to fill with the current indirection
 *                  table content. Should be at least
 *                  T_ETH_INDIRECTION_TABLE_SIZE bytes long.
 */
void bnx2x_get_rss_ind_table(struct bnx2x_rss_config_obj *rss_obj,
			     u8 *ind_table);

#define PF_MAC_CREDIT_E2(bp, func_num)

#define BNX2X_VFS_VLAN_CREDIT(bp)

#define PF_VLAN_CREDIT_E2(bp, func_num)

#endif /* BNX2X_SP_VERBS */