You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
qed: Add module with basic common support
The Qlogic Everest Driver is the backend module for the QL4xxx ethernet
products by Qlogic.
This module serves two main purposes:
1. It's responsible to contain all the common code that will be shared
between the various drivers that would be used with said line of
products. Flows such as chip initialization and de-initialization
fall under this category.
2. It would abstract the protocol-specific HW & FW components, allowing
the protocol drivers to have a clean APIs which is detached in its
slowpath configuration from the actual HSI.
This adds a very basic module without any protocol-specific bits.
I.e., this adds a basic implementation that almost entirely falls under
the first category.
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
8941faa161
commit
fe56b9e6a8
10
MAINTAINERS
10
MAINTAINERS
@@ -8540,6 +8540,16 @@ L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
F: drivers/net/ethernet/qlogic/qlge/
|
||||
|
||||
QLOGIC QL4xxx ETHERNET DRIVER
|
||||
M: Yuval Mintz <Yuval.Mintz@qlogic.com>
|
||||
M: Ariel Elior <Ariel.Elior@qlogic.com>
|
||||
M: everest-linux-l2@qlogic.com
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
F: drivers/net/ethernet/qlogic/qed/
|
||||
F: include/linux/qed/
|
||||
F: drivers/net/ethernet/qlogic/qede/
|
||||
|
||||
QNX4 FILESYSTEM
|
||||
M: Anders Larsen <al@alarsen.net>
|
||||
W: http://www.alarsen.net/linux/qnx4fs/
|
||||
|
||||
@@ -91,4 +91,10 @@ config NETXEN_NIC
|
||||
---help---
|
||||
This enables the support for NetXen's Gigabit Ethernet card.
|
||||
|
||||
config QED
|
||||
tristate "QLogic QED 25/40/100Gb core driver"
|
||||
depends on PCI
|
||||
---help---
|
||||
This enables the support for ...
|
||||
|
||||
endif # NET_VENDOR_QLOGIC
|
||||
|
||||
@@ -6,3 +6,4 @@ obj-$(CONFIG_QLA3XXX) += qla3xxx.o
|
||||
obj-$(CONFIG_QLCNIC) += qlcnic/
|
||||
obj-$(CONFIG_QLGE) += qlge/
|
||||
obj-$(CONFIG_NETXEN_NIC) += netxen/
|
||||
obj-$(CONFIG_QED) += qed/
|
||||
|
||||
4
drivers/net/ethernet/qlogic/qed/Makefile
Normal file
4
drivers/net/ethernet/qlogic/qed/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
obj-$(CONFIG_QED) := qed.o
|
||||
|
||||
qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
|
||||
qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o
|
||||
448
drivers/net/ethernet/qlogic/qed/qed.h
Normal file
448
drivers/net/ethernet/qlogic/qed/qed.h
Normal file
@@ -0,0 +1,448 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_H
|
||||
#define _QED_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/zlib.h>
|
||||
#include <linux/hashtable.h>
|
||||
#include <linux/qed/qed_if.h>
|
||||
#include "qed_hsi.h"
|
||||
|
||||
#define DRV_MODULE_VERSION "8.4.0.0"
|
||||
|
||||
#define MAX_HWFNS_PER_DEVICE (4)
|
||||
#define NAME_SIZE 16
|
||||
#define VER_SIZE 16
|
||||
|
||||
/* cau states */
|
||||
enum qed_coalescing_mode {
|
||||
QED_COAL_MODE_DISABLE,
|
||||
QED_COAL_MODE_ENABLE
|
||||
};
|
||||
|
||||
struct qed_eth_cb_ops;
|
||||
struct qed_dev_info;
|
||||
|
||||
/* helpers */
|
||||
static inline u32 qed_db_addr(u32 cid, u32 DEMS)
|
||||
{
|
||||
u32 db_addr = FIELD_VALUE(DB_LEGACY_ADDR_DEMS, DEMS) |
|
||||
FIELD_VALUE(DB_LEGACY_ADDR_ICID, cid);
|
||||
|
||||
return db_addr;
|
||||
}
|
||||
|
||||
#define ALIGNED_TYPE_SIZE(type_name, p_hwfn) \
|
||||
((sizeof(type_name) + (u32)(1 << (p_hwfn->cdev->cache_shift)) - 1) & \
|
||||
~((1 << (p_hwfn->cdev->cache_shift)) - 1))
|
||||
|
||||
#define for_each_hwfn(cdev, i) for (i = 0; i < cdev->num_hwfns; i++)
|
||||
|
||||
#define D_TRINE(val, cond1, cond2, true1, true2, def) \
|
||||
(val == (cond1) ? true1 : \
|
||||
(val == (cond2) ? true2 : def))
|
||||
|
||||
/* forward */
|
||||
struct qed_ptt_pool;
|
||||
struct qed_spq;
|
||||
struct qed_sb_info;
|
||||
struct qed_sb_attn_info;
|
||||
struct qed_cxt_mngr;
|
||||
struct qed_sb_sp_info;
|
||||
struct qed_mcp_info;
|
||||
|
||||
struct qed_rt_data {
|
||||
u32 init_val;
|
||||
bool b_valid;
|
||||
};
|
||||
|
||||
/* The PCI personality is not quite synonymous to protocol ID:
|
||||
* 1. All personalities need CORE connections
|
||||
* 2. The Ethernet personality may support also the RoCE protocol
|
||||
*/
|
||||
enum qed_pci_personality {
|
||||
QED_PCI_ETH,
|
||||
QED_PCI_DEFAULT /* default in shmem */
|
||||
};
|
||||
|
||||
/* All VFs are symmetric, all counters are PF + all VFs */
|
||||
struct qed_qm_iids {
|
||||
u32 cids;
|
||||
u32 vf_cids;
|
||||
u32 tids;
|
||||
};
|
||||
|
||||
enum QED_RESOURCES {
|
||||
QED_SB,
|
||||
QED_VPORT,
|
||||
QED_PQ,
|
||||
QED_RL,
|
||||
QED_ILT,
|
||||
QED_MAX_RESC,
|
||||
};
|
||||
|
||||
struct qed_hw_info {
|
||||
/* PCI personality */
|
||||
enum qed_pci_personality personality;
|
||||
|
||||
/* Resource Allocation scheme results */
|
||||
u32 resc_start[QED_MAX_RESC];
|
||||
u32 resc_num[QED_MAX_RESC];
|
||||
|
||||
#define RESC_START(_p_hwfn, resc) ((_p_hwfn)->hw_info.resc_start[resc])
|
||||
#define RESC_NUM(_p_hwfn, resc) ((_p_hwfn)->hw_info.resc_num[resc])
|
||||
#define FEAT_NUM(_p_hwfn, resc) ((_p_hwfn)->hw_info.feat_num[resc])
|
||||
|
||||
u8 num_tc;
|
||||
u8 offload_tc;
|
||||
u8 non_offload_tc;
|
||||
|
||||
u32 concrete_fid;
|
||||
u16 opaque_fid;
|
||||
u16 ovlan;
|
||||
u32 part_num[4];
|
||||
|
||||
u32 vendor_id;
|
||||
u32 device_id;
|
||||
|
||||
unsigned char hw_mac_addr[ETH_ALEN];
|
||||
|
||||
struct qed_igu_info *p_igu_info;
|
||||
|
||||
u32 port_mode;
|
||||
u32 hw_mode;
|
||||
};
|
||||
|
||||
struct qed_hw_cid_data {
|
||||
u32 cid;
|
||||
bool b_cid_allocated;
|
||||
|
||||
/* Additional identifiers */
|
||||
u16 opaque_fid;
|
||||
u8 vport_id;
|
||||
};
|
||||
|
||||
/* maximun size of read/write commands (HW limit) */
|
||||
#define DMAE_MAX_RW_SIZE 0x2000
|
||||
|
||||
struct qed_dmae_info {
|
||||
/* Mutex for synchronizing access to functions */
|
||||
struct mutex mutex;
|
||||
|
||||
u8 channel;
|
||||
|
||||
dma_addr_t completion_word_phys_addr;
|
||||
|
||||
/* The memory location where the DMAE writes the completion
|
||||
* value when an operation is finished on this context.
|
||||
*/
|
||||
u32 *p_completion_word;
|
||||
|
||||
dma_addr_t intermediate_buffer_phys_addr;
|
||||
|
||||
/* An intermediate buffer for DMAE operations that use virtual
|
||||
* addresses - data is DMA'd to/from this buffer and then
|
||||
* memcpy'd to/from the virtual address
|
||||
*/
|
||||
u32 *p_intermediate_buffer;
|
||||
|
||||
dma_addr_t dmae_cmd_phys_addr;
|
||||
struct dmae_cmd *p_dmae_cmd;
|
||||
};
|
||||
|
||||
struct qed_qm_info {
|
||||
struct init_qm_pq_params *qm_pq_params;
|
||||
struct init_qm_vport_params *qm_vport_params;
|
||||
struct init_qm_port_params *qm_port_params;
|
||||
u16 start_pq;
|
||||
u8 start_vport;
|
||||
u8 pure_lb_pq;
|
||||
u8 offload_pq;
|
||||
u8 pure_ack_pq;
|
||||
u8 vf_queues_offset;
|
||||
u16 num_pqs;
|
||||
u16 num_vf_pqs;
|
||||
u8 num_vports;
|
||||
u8 max_phys_tcs_per_port;
|
||||
bool pf_rl_en;
|
||||
bool pf_wfq_en;
|
||||
bool vport_rl_en;
|
||||
bool vport_wfq_en;
|
||||
u8 pf_wfq;
|
||||
u32 pf_rl;
|
||||
};
|
||||
|
||||
struct qed_fw_data {
|
||||
const u8 *modes_tree_buf;
|
||||
union init_op *init_ops;
|
||||
const u32 *arr_data;
|
||||
u32 init_ops_size;
|
||||
};
|
||||
|
||||
struct qed_simd_fp_handler {
|
||||
void *token;
|
||||
void (*func)(void *);
|
||||
};
|
||||
|
||||
struct qed_hwfn {
|
||||
struct qed_dev *cdev;
|
||||
u8 my_id; /* ID inside the PF */
|
||||
#define IS_LEAD_HWFN(edev) (!((edev)->my_id))
|
||||
u8 rel_pf_id; /* Relative to engine*/
|
||||
u8 abs_pf_id;
|
||||
#define QED_PATH_ID(_p_hwfn) ((_p_hwfn)->abs_pf_id & 1)
|
||||
u8 port_id;
|
||||
bool b_active;
|
||||
|
||||
u32 dp_module;
|
||||
u8 dp_level;
|
||||
char name[NAME_SIZE];
|
||||
|
||||
bool first_on_engine;
|
||||
bool hw_init_done;
|
||||
|
||||
/* BAR access */
|
||||
void __iomem *regview;
|
||||
void __iomem *doorbells;
|
||||
u64 db_phys_addr;
|
||||
unsigned long db_size;
|
||||
|
||||
/* PTT pool */
|
||||
struct qed_ptt_pool *p_ptt_pool;
|
||||
|
||||
/* HW info */
|
||||
struct qed_hw_info hw_info;
|
||||
|
||||
/* rt_array (for init-tool) */
|
||||
struct qed_rt_data *rt_data;
|
||||
|
||||
/* SPQ */
|
||||
struct qed_spq *p_spq;
|
||||
|
||||
/* EQ */
|
||||
struct qed_eq *p_eq;
|
||||
|
||||
/* Consolidate Q*/
|
||||
struct qed_consq *p_consq;
|
||||
|
||||
/* Slow-Path definitions */
|
||||
struct tasklet_struct *sp_dpc;
|
||||
bool b_sp_dpc_enabled;
|
||||
|
||||
struct qed_ptt *p_main_ptt;
|
||||
struct qed_ptt *p_dpc_ptt;
|
||||
|
||||
struct qed_sb_sp_info *p_sp_sb;
|
||||
struct qed_sb_attn_info *p_sb_attn;
|
||||
|
||||
/* Protocol related */
|
||||
struct qed_pf_params pf_params;
|
||||
|
||||
/* Array of sb_info of all status blocks */
|
||||
struct qed_sb_info *sbs_info[MAX_SB_PER_PF_MIMD];
|
||||
u16 num_sbs;
|
||||
|
||||
struct qed_cxt_mngr *p_cxt_mngr;
|
||||
|
||||
/* Flag indicating whether interrupts are enabled or not*/
|
||||
bool b_int_enabled;
|
||||
|
||||
struct qed_mcp_info *mcp_info;
|
||||
|
||||
struct qed_dmae_info dmae_info;
|
||||
|
||||
/* QM init */
|
||||
struct qed_qm_info qm_info;
|
||||
|
||||
/* Buffer for unzipping firmware data */
|
||||
void *unzip_buf;
|
||||
|
||||
struct qed_simd_fp_handler simd_proto_handler[64];
|
||||
|
||||
struct z_stream_s *stream;
|
||||
};
|
||||
|
||||
struct pci_params {
|
||||
int pm_cap;
|
||||
|
||||
unsigned long mem_start;
|
||||
unsigned long mem_end;
|
||||
unsigned int irq;
|
||||
u8 pf_num;
|
||||
};
|
||||
|
||||
struct qed_int_param {
|
||||
u32 int_mode;
|
||||
u8 num_vectors;
|
||||
u8 min_msix_cnt; /* for minimal functionality */
|
||||
};
|
||||
|
||||
struct qed_int_params {
|
||||
struct qed_int_param in;
|
||||
struct qed_int_param out;
|
||||
struct msix_entry *msix_table;
|
||||
bool fp_initialized;
|
||||
u8 fp_msix_base;
|
||||
u8 fp_msix_cnt;
|
||||
};
|
||||
|
||||
struct qed_dev {
|
||||
u32 dp_module;
|
||||
u8 dp_level;
|
||||
char name[NAME_SIZE];
|
||||
|
||||
u8 type;
|
||||
#define QED_DEV_TYPE_BB_A0 (0 << 0)
|
||||
#define QED_DEV_TYPE_MASK (0x3)
|
||||
#define QED_DEV_TYPE_SHIFT (0)
|
||||
|
||||
u16 chip_num;
|
||||
#define CHIP_NUM_MASK 0xffff
|
||||
#define CHIP_NUM_SHIFT 16
|
||||
|
||||
u16 chip_rev;
|
||||
#define CHIP_REV_MASK 0xf
|
||||
#define CHIP_REV_SHIFT 12
|
||||
|
||||
u16 chip_metal;
|
||||
#define CHIP_METAL_MASK 0xff
|
||||
#define CHIP_METAL_SHIFT 4
|
||||
|
||||
u16 chip_bond_id;
|
||||
#define CHIP_BOND_ID_MASK 0xf
|
||||
#define CHIP_BOND_ID_SHIFT 0
|
||||
|
||||
u8 num_engines;
|
||||
u8 num_ports_in_engines;
|
||||
u8 num_funcs_in_port;
|
||||
|
||||
u8 path_id;
|
||||
enum mf_mode mf_mode;
|
||||
#define IS_MF(_p_hwfn) (((_p_hwfn)->cdev)->mf_mode != SF)
|
||||
#define IS_MF_SI(_p_hwfn) (((_p_hwfn)->cdev)->mf_mode == MF_NPAR)
|
||||
#define IS_MF_SD(_p_hwfn) (((_p_hwfn)->cdev)->mf_mode == MF_OVLAN)
|
||||
|
||||
int pcie_width;
|
||||
int pcie_speed;
|
||||
u8 ver_str[VER_SIZE];
|
||||
|
||||
/* Add MF related configuration */
|
||||
u8 mcp_rev;
|
||||
u8 boot_mode;
|
||||
|
||||
u8 wol;
|
||||
|
||||
u32 int_mode;
|
||||
enum qed_coalescing_mode int_coalescing_mode;
|
||||
u8 rx_coalesce_usecs;
|
||||
u8 tx_coalesce_usecs;
|
||||
|
||||
/* Start Bar offset of first hwfn */
|
||||
void __iomem *regview;
|
||||
void __iomem *doorbells;
|
||||
u64 db_phys_addr;
|
||||
unsigned long db_size;
|
||||
|
||||
/* PCI */
|
||||
u8 cache_shift;
|
||||
|
||||
/* Init */
|
||||
const struct iro *iro_arr;
|
||||
#define IRO (p_hwfn->cdev->iro_arr)
|
||||
|
||||
/* HW functions */
|
||||
u8 num_hwfns;
|
||||
struct qed_hwfn hwfns[MAX_HWFNS_PER_DEVICE];
|
||||
|
||||
u32 drv_type;
|
||||
|
||||
struct qed_eth_stats *reset_stats;
|
||||
struct qed_fw_data *fw_data;
|
||||
|
||||
u32 mcp_nvm_resp;
|
||||
|
||||
/* Linux specific here */
|
||||
struct qede_dev *edev;
|
||||
struct pci_dev *pdev;
|
||||
int msg_enable;
|
||||
|
||||
struct pci_params pci_params;
|
||||
|
||||
struct qed_int_params int_params;
|
||||
|
||||
u8 protocol;
|
||||
#define IS_QED_ETH_IF(cdev) ((cdev)->protocol == QED_PROTOCOL_ETH)
|
||||
|
||||
const struct firmware *firmware;
|
||||
};
|
||||
|
||||
#define QED_GET_TYPE(dev) (((dev)->type & QED_DEV_TYPE_MASK) >> \
|
||||
QED_DEV_TYPE_SHIFT)
|
||||
#define QED_IS_BB_A0(dev) (QED_GET_TYPE(dev) == QED_DEV_TYPE_BB_A0)
|
||||
#define QED_IS_BB(dev) (QED_IS_BB_A0(dev))
|
||||
|
||||
#define NUM_OF_SBS(dev) MAX_SB_PER_PATH_BB
|
||||
#define NUM_OF_ENG_PFS(dev) MAX_NUM_PFS_BB
|
||||
|
||||
/**
|
||||
* @brief qed_concrete_to_sw_fid - get the sw function id from
|
||||
* the concrete value.
|
||||
*
|
||||
* @param concrete_fid
|
||||
*
|
||||
* @return inline u8
|
||||
*/
|
||||
static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
|
||||
u32 concrete_fid)
|
||||
{
|
||||
u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID);
|
||||
|
||||
return pfid;
|
||||
}
|
||||
|
||||
#define PURE_LB_TC 8
|
||||
|
||||
#define QED_LEADING_HWFN(dev) (&dev->hwfns[0])
|
||||
|
||||
/* Other Linux specific common definitions */
|
||||
#define DP_NAME(cdev) ((cdev)->name)
|
||||
|
||||
#define REG_ADDR(cdev, offset) (void __iomem *)((u8 __iomem *)\
|
||||
(cdev->regview) + \
|
||||
(offset))
|
||||
|
||||
#define REG_RD(cdev, offset) readl(REG_ADDR(cdev, offset))
|
||||
#define REG_WR(cdev, offset, val) writel((u32)val, REG_ADDR(cdev, offset))
|
||||
#define REG_WR16(cdev, offset, val) writew((u16)val, REG_ADDR(cdev, offset))
|
||||
|
||||
#define DOORBELL(cdev, db_addr, val) \
|
||||
writel((u32)val, (void __iomem *)((u8 __iomem *)\
|
||||
(cdev->doorbells) + (db_addr)))
|
||||
|
||||
/* Prototypes */
|
||||
int qed_fill_dev_info(struct qed_dev *cdev,
|
||||
struct qed_dev_info *dev_info);
|
||||
u32 qed_unzip_data(struct qed_hwfn *p_hwfn,
|
||||
u32 input_len, u8 *input_buf,
|
||||
u32 max_size, u8 *unzip_buf);
|
||||
|
||||
#define QED_ETH_INTERFACE_VERSION 300
|
||||
|
||||
#endif /* _QED_H */
|
||||
847
drivers/net/ethernet/qlogic/qed/qed_cxt.c
Normal file
847
drivers/net/ethernet/qlogic/qed/qed_cxt.c
Normal file
File diff suppressed because it is too large
Load Diff
139
drivers/net/ethernet/qlogic/qed/qed_cxt.h
Normal file
139
drivers/net/ethernet/qlogic/qed/qed_cxt.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_CXT_H
|
||||
#define _QED_CXT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/qed/qed_if.h>
|
||||
#include "qed_hsi.h"
|
||||
#include "qed.h"
|
||||
|
||||
struct qed_cxt_info {
|
||||
void *p_cxt;
|
||||
u32 iid;
|
||||
enum protocol_type type;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_acquire - Acquire a new cid of a specific protocol type
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param type
|
||||
* @param p_cid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
|
||||
enum protocol_type type,
|
||||
u32 *p_cid);
|
||||
|
||||
/**
|
||||
* @brief qedo_cid_get_cxt_info - Returns the context info for a specific cid
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_info in/out
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn,
|
||||
struct qed_cxt_info *p_info);
|
||||
|
||||
enum qed_cxt_elem_type {
|
||||
QED_ELEM_CXT,
|
||||
QED_ELEM_TASK
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_set_pf_params - Set the PF params for cxt init
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_set_pf_params(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_cfg_ilt_compute - compute ILT init parameters
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_mngr_alloc - Allocate and init the context manager struct
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_mngr_free
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_cxt_mngr_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired map
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_mngr_setup - Reset the acquired CIDs
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_cxt_mngr_setup(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_hw_init_common - Initailze ILT and DQ, common phase, per path.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_cxt_hw_init_common(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_cxt_hw_init_pf(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_qm_init_pf - Initailze the QM PF phase, per path
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
|
||||
void qed_qm_init_pf(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_cxt_release - Release a cid
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param cid
|
||||
*/
|
||||
void qed_cxt_release_cid(struct qed_hwfn *p_hwfn,
|
||||
u32 cid);
|
||||
|
||||
#endif
|
||||
1277
drivers/net/ethernet/qlogic/qed/qed_dev.c
Normal file
1277
drivers/net/ethernet/qlogic/qed/qed_dev.c
Normal file
File diff suppressed because it is too large
Load Diff
222
drivers/net/ethernet/qlogic/qed/qed_dev_api.h
Normal file
222
drivers/net/ethernet/qlogic/qed/qed_dev_api.h
Normal file
@@ -0,0 +1,222 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_DEV_API_H
|
||||
#define _QED_DEV_API_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/qed/qed_chain.h>
|
||||
#include <linux/qed/qed_if.h>
|
||||
#include "qed_int.h"
|
||||
|
||||
/**
|
||||
* @brief qed_init_dp - initialize the debug level
|
||||
*
|
||||
* @param cdev
|
||||
* @param dp_module
|
||||
* @param dp_level
|
||||
*/
|
||||
void qed_init_dp(struct qed_dev *cdev,
|
||||
u32 dp_module,
|
||||
u8 dp_level);
|
||||
|
||||
/**
|
||||
* @brief qed_init_struct - initialize the device structure to
|
||||
* its defaults
|
||||
*
|
||||
* @param cdev
|
||||
*/
|
||||
void qed_init_struct(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_resc_free -
|
||||
*
|
||||
* @param cdev
|
||||
*/
|
||||
void qed_resc_free(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_resc_alloc -
|
||||
*
|
||||
* @param cdev
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_resc_alloc(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_resc_setup -
|
||||
*
|
||||
* @param cdev
|
||||
*/
|
||||
void qed_resc_setup(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_hw_init -
|
||||
*
|
||||
* @param cdev
|
||||
* @param b_hw_start
|
||||
* @param int_mode - interrupt mode [msix, inta, etc.] to use.
|
||||
* @param allow_npar_tx_switch - npar tx switching to be used
|
||||
* for vports configured for tx-switching.
|
||||
* @param bin_fw_data - binary fw data pointer in binary fw file.
|
||||
* Pass NULL if not using binary fw file.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_hw_init(struct qed_dev *cdev,
|
||||
bool b_hw_start,
|
||||
enum qed_int_mode int_mode,
|
||||
bool allow_npar_tx_switch,
|
||||
const u8 *bin_fw_data);
|
||||
|
||||
/**
|
||||
* @brief qed_hw_stop -
|
||||
*
|
||||
* @param cdev
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_hw_stop(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_hw_reset -
|
||||
*
|
||||
* @param cdev
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_hw_reset(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_hw_prepare -
|
||||
*
|
||||
* @param cdev
|
||||
* @param personality - personality to initialize
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_hw_prepare(struct qed_dev *cdev,
|
||||
int personality);
|
||||
|
||||
/**
|
||||
* @brief qed_hw_remove -
|
||||
*
|
||||
* @param cdev
|
||||
*/
|
||||
void qed_hw_remove(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_acquire - Allocate a PTT window
|
||||
*
|
||||
* Should be called at the entry point to the driver (at the beginning of an
|
||||
* exported function)
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return struct qed_ptt
|
||||
*/
|
||||
struct qed_ptt *qed_ptt_acquire(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_release - Release PTT Window
|
||||
*
|
||||
* Should be called at the end of a flow - at the end of the function that
|
||||
* acquired the PTT.
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_ptt_release(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
enum qed_dmae_address_type_t {
|
||||
QED_DMAE_ADDRESS_HOST_VIRT,
|
||||
QED_DMAE_ADDRESS_HOST_PHYS,
|
||||
QED_DMAE_ADDRESS_GRC
|
||||
};
|
||||
|
||||
/* value of flags If QED_DMAE_FLAG_RW_REPL_SRC flag is set and the
|
||||
* source is a block of length DMAE_MAX_RW_SIZE and the
|
||||
* destination is larger, the source block will be duplicated as
|
||||
* many times as required to fill the destination block. This is
|
||||
* used mostly to write a zeroed buffer to destination address
|
||||
* using DMA
|
||||
*/
|
||||
#define QED_DMAE_FLAG_RW_REPL_SRC 0x00000001
|
||||
#define QED_DMAE_FLAG_COMPLETION_DST 0x00000008
|
||||
|
||||
struct qed_dmae_params {
|
||||
u32 flags; /* consists of QED_DMAE_FLAG_* values */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief qed_dmae_host2grc - copy data from source addr to
|
||||
* dmae registers using the given ptt
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param source_addr
|
||||
* @param grc_addr (dmae_data_offset)
|
||||
* @param size_in_dwords
|
||||
* @param flags (one of the flags defined above)
|
||||
*/
|
||||
int
|
||||
qed_dmae_host2grc(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u64 source_addr,
|
||||
u32 grc_addr,
|
||||
u32 size_in_dwords,
|
||||
u32 flags);
|
||||
|
||||
/**
|
||||
* @brief qed_chain_alloc - Allocate and initialize a chain
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param intended_use
|
||||
* @param mode
|
||||
* @param num_elems
|
||||
* @param elem_size
|
||||
* @param p_chain
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int
|
||||
qed_chain_alloc(struct qed_dev *cdev,
|
||||
enum qed_chain_use_mode intended_use,
|
||||
enum qed_chain_mode mode,
|
||||
u16 num_elems,
|
||||
size_t elem_size,
|
||||
struct qed_chain *p_chain);
|
||||
|
||||
/**
|
||||
* @brief qed_chain_free - Free chain DMA memory
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_chain
|
||||
*/
|
||||
void qed_chain_free(struct qed_dev *cdev,
|
||||
struct qed_chain *p_chain);
|
||||
|
||||
/**
|
||||
* *@brief Cleanup of previous driver remains prior to load
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param id - For PF, engine-relative. For VF, PF-relative.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_final_cleanup(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u16 id);
|
||||
|
||||
#endif
|
||||
4966
drivers/net/ethernet/qlogic/qed/qed_hsi.h
Normal file
4966
drivers/net/ethernet/qlogic/qed/qed_hsi.h
Normal file
File diff suppressed because it is too large
Load Diff
776
drivers/net/ethernet/qlogic/qed/qed_hw.c
Normal file
776
drivers/net/ethernet/qlogic/qed/qed_hw.c
Normal file
File diff suppressed because it is too large
Load Diff
263
drivers/net/ethernet/qlogic/qed/qed_hw.h
Normal file
263
drivers/net/ethernet/qlogic/qed/qed_hw.h
Normal file
@@ -0,0 +1,263 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_HW_H
|
||||
#define _QED_HW_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include "qed.h"
|
||||
#include "qed_dev_api.h"
|
||||
|
||||
/* Forward decleration */
|
||||
struct qed_ptt;
|
||||
|
||||
enum reserved_ptts {
|
||||
RESERVED_PTT_EDIAG,
|
||||
RESERVED_PTT_USER_SPACE,
|
||||
RESERVED_PTT_MAIN,
|
||||
RESERVED_PTT_DPC,
|
||||
RESERVED_PTT_MAX
|
||||
};
|
||||
|
||||
enum _dmae_cmd_dst_mask {
|
||||
DMAE_CMD_DST_MASK_NONE = 0,
|
||||
DMAE_CMD_DST_MASK_PCIE = 1,
|
||||
DMAE_CMD_DST_MASK_GRC = 2
|
||||
};
|
||||
|
||||
enum _dmae_cmd_src_mask {
|
||||
DMAE_CMD_SRC_MASK_PCIE = 0,
|
||||
DMAE_CMD_SRC_MASK_GRC = 1
|
||||
};
|
||||
|
||||
enum _dmae_cmd_crc_mask {
|
||||
DMAE_CMD_COMP_CRC_EN_MASK_NONE = 0,
|
||||
DMAE_CMD_COMP_CRC_EN_MASK_SET = 1
|
||||
};
|
||||
|
||||
/* definitions for DMA constants */
|
||||
#define DMAE_GO_VALUE 0x1
|
||||
|
||||
#define DMAE_COMPLETION_VAL 0xD1AE
|
||||
#define DMAE_CMD_ENDIANITY 0x2
|
||||
|
||||
#define DMAE_CMD_SIZE 14
|
||||
#define DMAE_CMD_SIZE_TO_FILL (DMAE_CMD_SIZE - 5)
|
||||
#define DMAE_MIN_WAIT_TIME 0x2
|
||||
#define DMAE_MAX_CLIENTS 32
|
||||
|
||||
/**
|
||||
* @brief qed_gtt_init - Initialize GTT windows
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_gtt_init(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_invalidate - Forces all ptt entries to be re-configured
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_ptt_invalidate(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_pool_alloc - Allocate and initialize PTT pool
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return struct _qed_status - success (0), negative - error.
|
||||
*/
|
||||
int qed_ptt_pool_alloc(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_pool_free -
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_ptt_pool_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_get_hw_addr - Get PTT's GRC/HW address
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*
|
||||
* @return u32
|
||||
*/
|
||||
u32 qed_ptt_get_hw_addr(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_get_bar_addr - Get PPT's external BAR address
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*
|
||||
* @return u32
|
||||
*/
|
||||
u32 qed_ptt_get_bar_addr(struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief qed_ptt_set_win - Set PTT Window's GRC BAR address
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param new_hw_addr
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_ptt_set_win(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 new_hw_addr);
|
||||
|
||||
/**
|
||||
* @brief qed_get_reserved_ptt - Get a specific reserved PTT
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param ptt_idx
|
||||
*
|
||||
* @return struct qed_ptt *
|
||||
*/
|
||||
struct qed_ptt *qed_get_reserved_ptt(struct qed_hwfn *p_hwfn,
|
||||
enum reserved_ptts ptt_idx);
|
||||
|
||||
/**
|
||||
* @brief qed_wr - Write value to BAR using the given ptt
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param val
|
||||
* @param hw_addr
|
||||
*/
|
||||
void qed_wr(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 hw_addr,
|
||||
u32 val);
|
||||
|
||||
/**
|
||||
* @brief qed_rd - Read value from BAR using the given ptt
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param val
|
||||
* @param hw_addr
|
||||
*/
|
||||
u32 qed_rd(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 hw_addr);
|
||||
|
||||
/**
|
||||
* @brief qed_memcpy_from - copy n bytes from BAR using the given
|
||||
* ptt
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param dest
|
||||
* @param hw_addr
|
||||
* @param n
|
||||
*/
|
||||
void qed_memcpy_from(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
void *dest,
|
||||
u32 hw_addr,
|
||||
size_t n);
|
||||
|
||||
/**
|
||||
* @brief qed_memcpy_to - copy n bytes to BAR using the given
|
||||
* ptt
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param hw_addr
|
||||
* @param src
|
||||
* @param n
|
||||
*/
|
||||
void qed_memcpy_to(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 hw_addr,
|
||||
void *src,
|
||||
size_t n);
|
||||
/**
|
||||
* @brief qed_fid_pretend - pretend to another function when
|
||||
* accessing the ptt window. There is no way to unpretend
|
||||
* a function. The only way to cancel a pretend is to
|
||||
* pretend back to the original function.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param fid - fid field of pxp_pretend structure. Can contain
|
||||
* either pf / vf, port/path fields are don't care.
|
||||
*/
|
||||
void qed_fid_pretend(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u16 fid);
|
||||
|
||||
/**
|
||||
* @brief qed_port_pretend - pretend to another port when
|
||||
* accessing the ptt window
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param port_id - the port to pretend to
|
||||
*/
|
||||
void qed_port_pretend(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u8 port_id);
|
||||
|
||||
/**
|
||||
* @brief qed_port_unpretend - cancel any previously set port
|
||||
* pretend
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_port_unpretend(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief qed_dmae_idx_to_go_cmd - map the idx to dmae cmd
|
||||
* this is declared here since other files will require it.
|
||||
* @param idx
|
||||
*/
|
||||
u32 qed_dmae_idx_to_go_cmd(u8 idx);
|
||||
|
||||
/**
|
||||
* @brief qed_dmae_info_alloc - Init the dmae_info structure
|
||||
* which is part of p_hwfn.
|
||||
* @param p_hwfn
|
||||
*/
|
||||
int qed_dmae_info_alloc(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_dmae_info_free - Free the dmae_info structure
|
||||
* which is part of p_hwfn
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_dmae_info_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
union qed_qm_pq_params {
|
||||
struct {
|
||||
u8 tc;
|
||||
} core;
|
||||
|
||||
struct {
|
||||
u8 is_vf;
|
||||
u8 vf_id;
|
||||
u8 tc;
|
||||
} eth;
|
||||
};
|
||||
|
||||
u16 qed_get_qm_pq(struct qed_hwfn *p_hwfn,
|
||||
enum protocol_type proto,
|
||||
union qed_qm_pq_params *params);
|
||||
|
||||
int qed_init_fw_data(struct qed_dev *cdev,
|
||||
const u8 *fw_data);
|
||||
#endif
|
||||
798
drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
Normal file
798
drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
Normal file
File diff suppressed because it is too large
Load Diff
531
drivers/net/ethernet/qlogic/qed/qed_init_ops.c
Normal file
531
drivers/net/ethernet/qlogic/qed/qed_init_ops.c
Normal file
File diff suppressed because it is too large
Load Diff
110
drivers/net/ethernet/qlogic/qed/qed_init_ops.h
Normal file
110
drivers/net/ethernet/qlogic/qed/qed_init_ops.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_INIT_OPS_H
|
||||
#define _QED_INIT_OPS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include "qed.h"
|
||||
|
||||
/**
|
||||
* @brief qed_init_iro_array - init iro_arr.
|
||||
*
|
||||
*
|
||||
* @param cdev
|
||||
*/
|
||||
void qed_init_iro_array(struct qed_dev *cdev);
|
||||
|
||||
/**
|
||||
* @brief qed_init_run - Run the init-sequence.
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param phase
|
||||
* @param phase_id
|
||||
* @param modes
|
||||
* @return _qed_status_t
|
||||
*/
|
||||
int qed_init_run(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
int phase,
|
||||
int phase_id,
|
||||
int modes);
|
||||
|
||||
/**
|
||||
* @brief qed_init_hwfn_allocate - Allocate RT array, Store 'values' ptrs.
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return _qed_status_t
|
||||
*/
|
||||
int qed_init_alloc(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_init_hwfn_deallocate
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_init_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_init_clear_rt_data - Clears the runtime init array.
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_init_clear_rt_data(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_init_store_rt_reg - Store a configuration value in the RT array.
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param rt_offset
|
||||
* @param val
|
||||
*/
|
||||
void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn,
|
||||
u32 rt_offset,
|
||||
u32 val);
|
||||
|
||||
#define STORE_RT_REG(hwfn, offset, val) \
|
||||
qed_init_store_rt_reg(hwfn, offset, val)
|
||||
|
||||
#define OVERWRITE_RT_REG(hwfn, offset, val) \
|
||||
qed_init_store_rt_reg(hwfn, offset, val)
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param rt_offset
|
||||
* @param val
|
||||
* @param size
|
||||
*/
|
||||
void qed_init_store_rt_agg(struct qed_hwfn *p_hwfn,
|
||||
u32 rt_offset,
|
||||
u32 *val,
|
||||
size_t size);
|
||||
|
||||
#define STORE_RT_REG_AGG(hwfn, offset, val) \
|
||||
qed_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Initialize GTT global windows and set admin window
|
||||
* related params of GTT/PTT to default values.
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_gtt_init(struct qed_hwfn *p_hwfn);
|
||||
#endif
|
||||
802
drivers/net/ethernet/qlogic/qed/qed_int.c
Normal file
802
drivers/net/ethernet/qlogic/qed/qed_int.c
Normal file
File diff suppressed because it is too large
Load Diff
391
drivers/net/ethernet/qlogic/qed/qed_int.h
Normal file
391
drivers/net/ethernet/qlogic/qed/qed_int.h
Normal file
@@ -0,0 +1,391 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_INT_H
|
||||
#define _QED_INT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include "qed.h"
|
||||
|
||||
/* Fields of IGU PF CONFIGRATION REGISTER */
|
||||
#define IGU_PF_CONF_FUNC_EN (0x1 << 0) /* function enable */
|
||||
#define IGU_PF_CONF_MSI_MSIX_EN (0x1 << 1) /* MSI/MSIX enable */
|
||||
#define IGU_PF_CONF_INT_LINE_EN (0x1 << 2) /* INT enable */
|
||||
#define IGU_PF_CONF_ATTN_BIT_EN (0x1 << 3) /* attention enable */
|
||||
#define IGU_PF_CONF_SINGLE_ISR_EN (0x1 << 4) /* single ISR mode enable */
|
||||
#define IGU_PF_CONF_SIMD_MODE (0x1 << 5) /* simd all ones mode */
|
||||
|
||||
/* Igu control commands
|
||||
*/
|
||||
enum igu_ctrl_cmd {
|
||||
IGU_CTRL_CMD_TYPE_RD,
|
||||
IGU_CTRL_CMD_TYPE_WR,
|
||||
MAX_IGU_CTRL_CMD
|
||||
};
|
||||
|
||||
/* Control register for the IGU command register
|
||||
*/
|
||||
struct igu_ctrl_reg {
|
||||
u32 ctrl_data;
|
||||
#define IGU_CTRL_REG_FID_MASK 0xFFFF /* Opaque_FID */
|
||||
#define IGU_CTRL_REG_FID_SHIFT 0
|
||||
#define IGU_CTRL_REG_PXP_ADDR_MASK 0xFFF /* Command address */
|
||||
#define IGU_CTRL_REG_PXP_ADDR_SHIFT 16
|
||||
#define IGU_CTRL_REG_RESERVED_MASK 0x1
|
||||
#define IGU_CTRL_REG_RESERVED_SHIFT 28
|
||||
#define IGU_CTRL_REG_TYPE_MASK 0x1 /* use enum igu_ctrl_cmd */
|
||||
#define IGU_CTRL_REG_TYPE_SHIFT 31
|
||||
};
|
||||
|
||||
enum qed_coalescing_fsm {
|
||||
QED_COAL_RX_STATE_MACHINE,
|
||||
QED_COAL_TX_STATE_MACHINE
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief qed_int_cau_conf_pi - configure cau for a given
|
||||
* status block
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param igu_sb_id
|
||||
* @param pi_index
|
||||
* @param state
|
||||
* @param timeset
|
||||
*/
|
||||
void qed_int_cau_conf_pi(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u16 igu_sb_id,
|
||||
u32 pi_index,
|
||||
enum qed_coalescing_fsm coalescing_fsm,
|
||||
u8 timeset);
|
||||
|
||||
/**
|
||||
* @brief qed_int_igu_enable_int - enable device interrupts
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param int_mode - interrupt mode to use
|
||||
*/
|
||||
void qed_int_igu_enable_int(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
enum qed_int_mode int_mode);
|
||||
|
||||
/**
|
||||
* @brief qed_int_igu_disable_int - disable device interrupts
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_int_igu_disable_int(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief qed_int_igu_read_sisr_reg - Reads the single isr multiple dpc
|
||||
* register from igu.
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return u64
|
||||
*/
|
||||
u64 qed_int_igu_read_sisr_reg(struct qed_hwfn *p_hwfn);
|
||||
|
||||
#define QED_SP_SB_ID 0xffff
|
||||
/**
|
||||
* @brief qed_int_sb_init - Initializes the sb_info structure.
|
||||
*
|
||||
* once the structure is initialized it can be passed to sb related functions.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param sb_info points to an uninitialized (but
|
||||
* allocated) sb_info structure
|
||||
* @param sb_virt_addr
|
||||
* @param sb_phy_addr
|
||||
* @param sb_id the sb_id to be used (zero based in driver)
|
||||
* should use QED_SP_SB_ID for SP Status block
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_sb_init(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
struct qed_sb_info *sb_info,
|
||||
void *sb_virt_addr,
|
||||
dma_addr_t sb_phy_addr,
|
||||
u16 sb_id);
|
||||
/**
|
||||
* @brief qed_int_sb_setup - Setup the sb.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param sb_info initialized sb_info structure
|
||||
*/
|
||||
void qed_int_sb_setup(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
struct qed_sb_info *sb_info);
|
||||
|
||||
/**
|
||||
* @brief qed_int_sb_release - releases the sb_info structure.
|
||||
*
|
||||
* once the structure is released, it's memory can be freed
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param sb_info points to an allocated sb_info structure
|
||||
* @param sb_id the sb_id to be used (zero based in driver)
|
||||
* should never be equal to QED_SP_SB_ID
|
||||
* (SP Status block)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_sb_release(struct qed_hwfn *p_hwfn,
|
||||
struct qed_sb_info *sb_info,
|
||||
u16 sb_id);
|
||||
|
||||
/**
|
||||
* @brief qed_int_sp_dpc - To be called when an interrupt is received on the
|
||||
* default status block.
|
||||
*
|
||||
* @param p_hwfn - pointer to hwfn
|
||||
*
|
||||
*/
|
||||
void qed_int_sp_dpc(unsigned long hwfn_cookie);
|
||||
|
||||
/**
|
||||
* @brief qed_int_get_num_sbs - get the number of status
|
||||
* blocks configured for this funciton in the igu.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_iov_blks - configured free blks for vfs
|
||||
*
|
||||
* @return int - number of status blocks configured
|
||||
*/
|
||||
int qed_int_get_num_sbs(struct qed_hwfn *p_hwfn,
|
||||
int *p_iov_blks);
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Interrupt handler
|
||||
*/
|
||||
|
||||
#define QED_CAU_DEF_RX_TIMER_RES 0
|
||||
#define QED_CAU_DEF_TX_TIMER_RES 0
|
||||
|
||||
#define QED_SB_ATT_IDX 0x0001
|
||||
#define QED_SB_EVENT_MASK 0x0003
|
||||
|
||||
#define SB_ALIGNED_SIZE(p_hwfn) \
|
||||
ALIGNED_TYPE_SIZE(struct status_block, p_hwfn)
|
||||
|
||||
struct qed_igu_block {
|
||||
u8 status;
|
||||
#define QED_IGU_STATUS_FREE 0x01
|
||||
#define QED_IGU_STATUS_VALID 0x02
|
||||
#define QED_IGU_STATUS_PF 0x04
|
||||
|
||||
u8 vector_number;
|
||||
u8 function_id;
|
||||
u8 is_pf;
|
||||
};
|
||||
|
||||
struct qed_igu_map {
|
||||
struct qed_igu_block igu_blocks[MAX_TOT_SB_PER_PATH];
|
||||
};
|
||||
|
||||
struct qed_igu_info {
|
||||
struct qed_igu_map igu_map;
|
||||
u16 igu_dsb_id;
|
||||
u16 igu_base_sb;
|
||||
u16 igu_base_sb_iov;
|
||||
u16 igu_sb_cnt;
|
||||
u16 igu_sb_cnt_iov;
|
||||
u16 free_blks;
|
||||
};
|
||||
|
||||
/* TODO Names of function may change... */
|
||||
void qed_int_igu_init_pure_rt(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
bool b_set,
|
||||
bool b_slowpath);
|
||||
|
||||
void qed_int_igu_init_rt(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_int_igu_read_cam - Reads the IGU CAM.
|
||||
* This function needs to be called during hardware
|
||||
* prepare. It reads the info from igu cam to know which
|
||||
* status block is the default / base status block etc.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
typedef int (*qed_int_comp_cb_t)(struct qed_hwfn *p_hwfn,
|
||||
void *cookie);
|
||||
/**
|
||||
* @brief qed_int_register_cb - Register callback func for
|
||||
* slowhwfn statusblock.
|
||||
*
|
||||
* Every protocol that uses the slowhwfn status block
|
||||
* should register a callback function that will be called
|
||||
* once there is an update of the sp status block.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param comp_cb - function to be called when there is an
|
||||
* interrupt on the sp sb
|
||||
*
|
||||
* @param cookie - passed to the callback function
|
||||
* @param sb_idx - OUT parameter which gives the chosen index
|
||||
* for this protocol.
|
||||
* @param p_fw_cons - pointer to the actual address of the
|
||||
* consumer for this protocol.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_register_cb(struct qed_hwfn *p_hwfn,
|
||||
qed_int_comp_cb_t comp_cb,
|
||||
void *cookie,
|
||||
u8 *sb_idx,
|
||||
__le16 **p_fw_cons);
|
||||
|
||||
/**
|
||||
* @brief qed_int_unregister_cb - Unregisters callback
|
||||
* function from sp sb.
|
||||
* Partner of qed_int_register_cb -> should be called
|
||||
* when no longer required.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param pi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_unregister_cb(struct qed_hwfn *p_hwfn,
|
||||
u8 pi);
|
||||
|
||||
/**
|
||||
* @brief qed_int_get_sp_sb_id - Get the slowhwfn sb id.
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return u16
|
||||
*/
|
||||
u16 qed_int_get_sp_sb_id(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief Status block cleanup. Should be called for each status
|
||||
* block that will be used -> both PF / VF
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param sb_id - igu status block id
|
||||
* @param cleanup_set - set(1) / clear(0)
|
||||
* @param opaque_fid - the function for which to perform
|
||||
* cleanup, for example a PF on behalf of
|
||||
* its VFs.
|
||||
*/
|
||||
void qed_int_igu_cleanup_sb(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 sb_id,
|
||||
bool cleanup_set,
|
||||
u16 opaque_fid);
|
||||
|
||||
/**
|
||||
* @brief Status block cleanup. Should be called for each status
|
||||
* block that will be used -> both PF / VF
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param sb_id - igu status block id
|
||||
* @param opaque - opaque fid of the sb owner.
|
||||
* @param cleanup_set - set(1) / clear(0)
|
||||
*/
|
||||
void qed_int_igu_init_pure_rt_single(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 sb_id,
|
||||
u16 opaque,
|
||||
bool b_set);
|
||||
|
||||
/**
|
||||
* @brief qed_int_cau_conf - configure cau for a given status
|
||||
* block
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param ptt
|
||||
* @param sb_phys
|
||||
* @param igu_sb_id
|
||||
* @param vf_number
|
||||
* @param vf_valid
|
||||
*/
|
||||
void qed_int_cau_conf_sb(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
dma_addr_t sb_phys,
|
||||
u16 igu_sb_id,
|
||||
u16 vf_number,
|
||||
u8 vf_valid);
|
||||
|
||||
/**
|
||||
* @brief qed_int_alloc
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_int_alloc(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief qed_int_free
|
||||
*
|
||||
* @param p_hwfn
|
||||
*/
|
||||
void qed_int_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief qed_int_setup
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_int_setup(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief - Enable Interrupt & Attention for hw function
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param int_mode
|
||||
*/
|
||||
void qed_int_igu_enable(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
enum qed_int_mode int_mode);
|
||||
|
||||
/**
|
||||
* @brief - Initialize CAU status block entry
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_sb_entry
|
||||
* @param pf_id
|
||||
* @param vf_number
|
||||
* @param vf_valid
|
||||
*/
|
||||
void qed_init_cau_sb_entry(struct qed_hwfn *p_hwfn,
|
||||
struct cau_sb_entry *p_sb_entry,
|
||||
u8 pf_id,
|
||||
u16 vf_number,
|
||||
u8 vf_valid);
|
||||
|
||||
#define QED_MAPPING_MEMORY_SIZE(dev) (NUM_OF_SBS(dev))
|
||||
|
||||
#endif
|
||||
948
drivers/net/ethernet/qlogic/qed/qed_main.c
Normal file
948
drivers/net/ethernet/qlogic/qed/qed_main.c
Normal file
File diff suppressed because it is too large
Load Diff
549
drivers/net/ethernet/qlogic/qed/qed_mcp.c
Normal file
549
drivers/net/ethernet/qlogic/qed/qed_mcp.c
Normal file
File diff suppressed because it is too large
Load Diff
232
drivers/net/ethernet/qlogic/qed/qed_mcp.h
Normal file
232
drivers/net/ethernet/qlogic/qed/qed_mcp.h
Normal file
@@ -0,0 +1,232 @@
|
||||
/* QLogic qed NIC Driver
|
||||
* Copyright (c) 2015 QLogic Corporation
|
||||
*
|
||||
* This software is available under the terms of the GNU General Public License
|
||||
* (GPL) Version 2, available from the file COPYING in the main directory of
|
||||
* this source tree.
|
||||
*/
|
||||
|
||||
#ifndef _QED_MCP_H
|
||||
#define _QED_MCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/slab.h>
|
||||
#include "qed_hsi.h"
|
||||
|
||||
struct qed_mcp_function_info {
|
||||
u8 pause_on_host;
|
||||
|
||||
enum qed_pci_personality protocol;
|
||||
|
||||
u8 bandwidth_min;
|
||||
u8 bandwidth_max;
|
||||
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
u64 wwn_port;
|
||||
u64 wwn_node;
|
||||
|
||||
#define QED_MCP_VLAN_UNSET (0xffff)
|
||||
u16 ovlan;
|
||||
};
|
||||
|
||||
struct qed_mcp_nvm_common {
|
||||
u32 offset;
|
||||
u32 param;
|
||||
u32 resp;
|
||||
u32 cmd;
|
||||
};
|
||||
|
||||
struct qed_mcp_drv_version {
|
||||
u32 version;
|
||||
u8 name[MCP_DRV_VER_STR_SIZE - 4];
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get the management firmware version value
|
||||
*
|
||||
* @param cdev - qed dev pointer
|
||||
* @param mfw_ver - mfw version value
|
||||
*
|
||||
* @return int - 0 - operation was successul.
|
||||
*/
|
||||
int qed_mcp_get_mfw_ver(struct qed_dev *cdev,
|
||||
u32 *mfw_ver);
|
||||
|
||||
/**
|
||||
* @brief General function for sending commands to the MCP
|
||||
* mailbox. It acquire mutex lock for the entire
|
||||
* operation, from sending the request until the MCP
|
||||
* response. Waiting for MCP response will be checked up
|
||||
* to 5 seconds every 5ms.
|
||||
*
|
||||
* @param p_hwfn - hw function
|
||||
* @param p_ptt - PTT required for register access
|
||||
* @param cmd - command to be sent to the MCP.
|
||||
* @param param - Optional param
|
||||
* @param o_mcp_resp - The MCP response code (exclude sequence).
|
||||
* @param o_mcp_param- Optional parameter provided by the MCP
|
||||
* response
|
||||
* @return int - 0 - operation
|
||||
* was successul.
|
||||
*/
|
||||
int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 cmd,
|
||||
u32 param,
|
||||
u32 *o_mcp_resp,
|
||||
u32 *o_mcp_param);
|
||||
|
||||
/**
|
||||
* @brief - drains the nig, allowing completion to pass in case of pauses.
|
||||
* (Should be called only from sleepable context)
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
int qed_mcp_drain(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief Send driver version to MFW
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* @param version - Version value
|
||||
* @param name - Protocol driver name
|
||||
*
|
||||
* @return int - 0 - operation was successul.
|
||||
*/
|
||||
int
|
||||
qed_mcp_send_drv_version(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
struct qed_mcp_drv_version *p_ver);
|
||||
|
||||
/* Using hwfn number (and not pf_num) is required since in CMT mode,
|
||||
* same pf_num may be used by two different hwfn
|
||||
* TODO - this shouldn't really be in .h file, but until all fields
|
||||
* required during hw-init will be placed in their correct place in shmem
|
||||
* we need it in qed_dev.c [for readin the nvram reflection in shmem].
|
||||
*/
|
||||
#define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (QED_IS_BB((p_hwfn)->cdev) ? \
|
||||
((rel_pfid) | \
|
||||
((p_hwfn)->abs_pf_id & 1) << 3) : \
|
||||
rel_pfid)
|
||||
#define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id)
|
||||
|
||||
/* TODO - this is only correct as long as only BB is supported, and
|
||||
* no port-swapping is implemented; Afterwards we'll need to fix it.
|
||||
*/
|
||||
#define MFW_PORT(_p_hwfn) ((_p_hwfn)->abs_pf_id % \
|
||||
((_p_hwfn)->cdev->num_ports_in_engines * 2))
|
||||
struct qed_mcp_info {
|
||||
struct mutex mutex; /* MCP access lock */
|
||||
u32 public_base;
|
||||
u32 drv_mb_addr;
|
||||
u32 mfw_mb_addr;
|
||||
u32 port_addr;
|
||||
u16 drv_mb_seq;
|
||||
u16 drv_pulse_seq;
|
||||
struct qed_mcp_function_info func_info;
|
||||
|
||||
u8 *mfw_mb_cur;
|
||||
u8 *mfw_mb_shadow;
|
||||
u16 mfw_mb_length;
|
||||
u16 mcp_hist;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize the interface with the MCP
|
||||
*
|
||||
* @param p_hwfn - HW func
|
||||
* @param p_ptt - PTT required for register access
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief Initialize the port interface with the MCP
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
* Can only be called after `num_ports_in_engines' is set
|
||||
*/
|
||||
void qed_mcp_cmd_port_init(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
/**
|
||||
* @brief Releases resources allocated during the init process.
|
||||
*
|
||||
* @param p_hwfn - HW func
|
||||
* @param p_ptt - PTT required for register access
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
||||
int qed_mcp_free(struct qed_hwfn *p_hwfn);
|
||||
|
||||
/**
|
||||
* @brief Sends a LOAD_REQ to the MFW, and in case operation
|
||||
* succeed, returns whether this PF is the first on the
|
||||
* chip/engine/port or function. This function should be
|
||||
* called when driver is ready to accept MFW events after
|
||||
* Storms initializations are done.
|
||||
*
|
||||
* @param p_hwfn - hw function
|
||||
* @param p_ptt - PTT required for register access
|
||||
* @param p_load_code - The MCP response param containing one
|
||||
* of the following:
|
||||
* FW_MSG_CODE_DRV_LOAD_ENGINE
|
||||
* FW_MSG_CODE_DRV_LOAD_PORT
|
||||
* FW_MSG_CODE_DRV_LOAD_FUNCTION
|
||||
* @return int -
|
||||
* 0 - Operation was successul.
|
||||
* -EBUSY - Operation failed
|
||||
*/
|
||||
int qed_mcp_load_req(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt,
|
||||
u32 *p_load_code);
|
||||
|
||||
/**
|
||||
* @brief Read the MFW mailbox into Current buffer.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*/
|
||||
void qed_mcp_read_mb(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief - calls during init to read shmem of all function-related info.
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @param return 0 upon success.
|
||||
*/
|
||||
int qed_mcp_fill_shmem_func_info(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief - Reset the MCP using mailbox command.
|
||||
*
|
||||
* @param p_hwfn
|
||||
* @param p_ptt
|
||||
*
|
||||
* @param return 0 upon success.
|
||||
*/
|
||||
int qed_mcp_reset(struct qed_hwfn *p_hwfn,
|
||||
struct qed_ptt *p_ptt);
|
||||
|
||||
/**
|
||||
* @brief indicates whether the MFW objects [under mcp_info] are accessible
|
||||
*
|
||||
* @param p_hwfn
|
||||
*
|
||||
* @return true iff MFW is running and mcp_info is initialized
|
||||
*/
|
||||
bool qed_mcp_is_init(struct qed_hwfn *p_hwfn);
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user