Commit ee824f4b authored by Omkar Kulkarni's avatar Omkar Kulkarni Committed by David S. Miller

qed: Split huge qed_hsi.h header file

The qed_hsi.h is a huge header file containing HSI (Hardware Software
Interface) definitions of storm memory access, debug related, general
and management firmware specific. In order to have a better
code-organization HSI definition, this patch split the code across
multiple files, i.e.
- storm memory access HSI : qed_iro_hsi.h
- debug related HSI       : qed_dbg_hsi.h
- Management firmware HSI : qed_mfg_hsi.h
- General HSI             : qed_hsi.h

In addition, this patch also fixes existing checkpatch warnings and
few important checks.
Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
Signed-off-by: default avatarShai Malin <smalin@marvell.com>
Signed-off-by: default avatarOmkar Kulkarni <okulkarni@marvell.com>
Signed-off-by: default avatarPrabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb09a1ed
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <linux/qed/qed_if.h> #include <linux/qed/qed_if.h>
#include "qed_debug.h" #include "qed_debug.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_dbg_hsi.h"
#include "qed_mfw_hsi.h"
extern const struct qed_common_ops qed_common_ops_pass; extern const struct qed_common_ops qed_common_ops_pass;
......
This diff is collapsed.
...@@ -84,16 +84,17 @@ struct qed_dcbx_mib_meta_data { ...@@ -84,16 +84,17 @@ struct qed_dcbx_mib_meta_data {
extern const struct qed_eth_dcbnl_ops qed_dcbnl_ops_pass; extern const struct qed_eth_dcbnl_ops qed_dcbnl_ops_pass;
#ifdef CONFIG_DCB #ifdef CONFIG_DCB
int qed_dcbx_get_config_params(struct qed_hwfn *, struct qed_dcbx_set *); int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
struct qed_dcbx_set *params);
int qed_dcbx_config_params(struct qed_hwfn *, int qed_dcbx_config_params(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
struct qed_ptt *, struct qed_dcbx_set *, bool); struct qed_dcbx_set *params, bool hw_commit);
#endif #endif
/* QED local interface routines */ /* QED local interface routines */
int int
qed_dcbx_mib_update_event(struct qed_hwfn *, qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
struct qed_ptt *, enum qed_mib_read_type); enum qed_mib_read_type type);
int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn); int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn);
void qed_dcbx_info_free(struct qed_hwfn *p_hwfn); void qed_dcbx_info_free(struct qed_hwfn *p_hwfn);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "qed.h" #include "qed.h"
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_dbg_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_mcp.h" #include "qed_mcp.h"
#include "qed_reg_addr.h" #include "qed_reg_addr.h"
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "qed_dev_api.h" #include "qed_dev_api.h"
#include "qed_fcoe.h" #include "qed_fcoe.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_init_ops.h" #include "qed_init_ops.h"
#include "qed_int.h" #include "qed_int.h"
......
...@@ -161,7 +161,6 @@ int qed_hw_stop_fastpath(struct qed_dev *cdev); ...@@ -161,7 +161,6 @@ int qed_hw_stop_fastpath(struct qed_dev *cdev);
*/ */
int qed_hw_start_fastpath(struct qed_hwfn *p_hwfn); int qed_hw_start_fastpath(struct qed_hwfn *p_hwfn);
/** /**
* qed_hw_prepare(): Prepare Qed hardware. * qed_hw_prepare(): Prepare Qed hardware.
* *
...@@ -510,6 +509,5 @@ int qed_db_recovery_add(struct qed_dev *cdev, ...@@ -510,6 +509,5 @@ int qed_db_recovery_add(struct qed_dev *cdev,
int qed_db_recovery_del(struct qed_dev *cdev, int qed_db_recovery_del(struct qed_dev *cdev,
void __iomem *db_addr, void *db_data); void __iomem *db_addr, void *db_data);
const char *qed_hw_get_resc_name(enum qed_resources res_id); const char *qed_hw_get_resc_name(enum qed_resources res_id);
#endif #endif
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_int.h" #include "qed_int.h"
#include "qed_iro_hsi.h"
#include "qed_ll2.h" #include "qed_ll2.h"
#include "qed_mcp.h" #include "qed_mcp.h"
#include "qed_reg_addr.h" #include "qed_reg_addr.h"
......
This diff is collapsed.
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_init_ops.h" #include "qed_init_ops.h"
#include "qed_iro_hsi.h"
#include "qed_reg_addr.h" #include "qed_reg_addr.h"
#define CDU_VALIDATION_DEFAULT_CFG 61 #define CDU_VALIDATION_DEFAULT_CFG 61
......
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_int.h" #include "qed_int.h"
#include "qed_iro_hsi.h"
#include "qed_iscsi.h" #include "qed_iscsi.h"
#include "qed_ll2.h" #include "qed_ll2.h"
#include "qed_mcp.h" #include "qed_mcp.h"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "qed_dev_api.h" #include "qed_dev_api.h"
#include <linux/qed/qed_eth_if.h> #include <linux/qed/qed_eth_if.h>
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_int.h" #include "qed_int.h"
#include "qed_l2.h" #include "qed_l2.h"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_dev_api.h" #include "qed_dev_api.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_int.h" #include "qed_int.h"
#include "qed_ll2.h" #include "qed_ll2.h"
...@@ -106,7 +107,7 @@ static int qed_ll2_alloc_buffer(struct qed_dev *cdev, ...@@ -106,7 +107,7 @@ static int qed_ll2_alloc_buffer(struct qed_dev *cdev,
} }
static int qed_ll2_dealloc_buffer(struct qed_dev *cdev, static int qed_ll2_dealloc_buffer(struct qed_dev *cdev,
struct qed_ll2_buffer *buffer) struct qed_ll2_buffer *buffer)
{ {
spin_lock_bh(&cdev->ll2->lock); spin_lock_bh(&cdev->ll2->lock);
...@@ -1124,6 +1125,7 @@ static int qed_sp_ll2_tx_queue_stop(struct qed_hwfn *p_hwfn, ...@@ -1124,6 +1125,7 @@ static int qed_sp_ll2_tx_queue_stop(struct qed_hwfn *p_hwfn,
struct qed_spq_entry *p_ent = NULL; struct qed_spq_entry *p_ent = NULL;
struct qed_sp_init_data init_data; struct qed_sp_init_data init_data;
int rc = -EINVAL; int rc = -EINVAL;
qed_db_recovery_del(p_hwfn->cdev, p_tx->doorbell_addr, &p_tx->db_msg); qed_db_recovery_del(p_hwfn->cdev, p_tx->doorbell_addr, &p_tx->db_msg);
/* Get SPQ entry */ /* Get SPQ entry */
...@@ -1762,7 +1764,7 @@ int qed_ll2_post_rx_buffer(void *cxt, ...@@ -1762,7 +1764,7 @@ int qed_ll2_post_rx_buffer(void *cxt,
} }
} }
/* If we're lacking entires, let's try to flush buffers to FW */ /* If we're lacking entries, let's try to flush buffers to FW */
if (!p_curp || !p_curb) { if (!p_curp || !p_curb) {
rc = -EBUSY; rc = -EBUSY;
p_curp = NULL; p_curp = NULL;
...@@ -2609,7 +2611,6 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params) ...@@ -2609,7 +2611,6 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
DP_NOTICE(cdev, "Failed to add an LLH filter\n"); DP_NOTICE(cdev, "Failed to add an LLH filter\n");
goto err3; goto err3;
} }
} }
ether_addr_copy(cdev->ll2_mac_address, params->ll2_mac_address); ether_addr_copy(cdev->ll2_mac_address, params->ll2_mac_address);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define QED_LL2_LEGACY_CONN_BASE_PF 0 #define QED_LL2_LEGACY_CONN_BASE_PF 0
#define QED_LL2_CTX_CONN_BASE_PF QED_MAX_NUM_OF_LEGACY_LL2_CONNS_PF #define QED_LL2_CTX_CONN_BASE_PF QED_MAX_NUM_OF_LEGACY_LL2_CONNS_PF
struct qed_ll2_rx_packet { struct qed_ll2_rx_packet {
struct list_head list_entry; struct list_head list_entry;
struct core_rx_bd_with_buff_len *rxq_bd; struct core_rx_bd_with_buff_len *rxq_bd;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_dcbx.h" #include "qed_dcbx.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_mfw_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_mcp.h" #include "qed_mcp.h"
#include "qed_reg_addr.h" #include "qed_reg_addr.h"
......
This diff is collapsed.
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "qed.h" #include "qed.h"
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_init_ops.h" #include "qed_init_ops.h"
#include "qed_int.h" #include "qed_int.h"
...@@ -33,7 +34,6 @@ ...@@ -33,7 +34,6 @@
#include "qed_roce.h" #include "qed_roce.h"
#include "qed_sp.h" #include "qed_sp.h"
int qed_rdma_bmap_alloc(struct qed_hwfn *p_hwfn, int qed_rdma_bmap_alloc(struct qed_hwfn *p_hwfn,
struct qed_bmap *bmap, u32 max_count, char *name) struct qed_bmap *bmap, u32 max_count, char *name)
{ {
...@@ -1903,7 +1903,6 @@ void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -1903,7 +1903,6 @@ void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
val, p_hwfn->dcbx_no_edpm, p_hwfn->db_bar_no_edpm); val, p_hwfn->dcbx_no_edpm, p_hwfn->db_bar_no_edpm);
} }
void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
{ {
p_hwfn->db_bar_no_edpm = true; p_hwfn->db_bar_no_edpm = true;
......
...@@ -168,16 +168,19 @@ static inline bool qed_rdma_is_xrc_qp(struct qed_rdma_qp *qp) ...@@ -168,16 +168,19 @@ static inline bool qed_rdma_is_xrc_qp(struct qed_rdma_qp *qp)
return false; return false;
} }
#if IS_ENABLED(CONFIG_QED_RDMA) #if IS_ENABLED(CONFIG_QED_RDMA)
void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt); void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt); void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn); int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn);
void qed_rdma_info_free(struct qed_hwfn *p_hwfn); void qed_rdma_info_free(struct qed_hwfn *p_hwfn);
#else #else
static inline void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) {} static inline void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt) {}
static inline void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, static inline void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt) {} struct qed_ptt *p_ptt) {}
static inline int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) {return -EINVAL;} static inline int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn)
{return -EINVAL; }
static inline void qed_rdma_info_free(struct qed_hwfn *p_hwfn) {} static inline void qed_rdma_info_free(struct qed_hwfn *p_hwfn) {}
#endif #endif
......
...@@ -792,7 +792,6 @@ static int qed_roce_sp_destroy_qp_requester(struct qed_hwfn *p_hwfn, ...@@ -792,7 +792,6 @@ static int qed_roce_sp_destroy_qp_requester(struct qed_hwfn *p_hwfn,
if (rc) if (rc)
goto err; goto err;
/* Free ORQ - only if ramrod succeeded, in case FW is still using it */ /* Free ORQ - only if ramrod succeeded, in case FW is still using it */
dma_free_coherent(&p_hwfn->cdev->pdev->dev, dma_free_coherent(&p_hwfn->cdev->pdev->dev,
qp->orq_num_pages * RDMA_RING_PAGE_SIZE, qp->orq_num_pages * RDMA_RING_PAGE_SIZE,
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_dev_api.h" #include "qed_dev_api.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_int.h" #include "qed_int.h"
#include "qed_iscsi.h" #include "qed_iscsi.h"
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/qed/qed_iov_if.h> #include <linux/qed/qed_iov_if.h>
#include "qed_cxt.h" #include "qed_cxt.h"
#include "qed_hsi.h" #include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h" #include "qed_hw.h"
#include "qed_init_ops.h" #include "qed_init_ops.h"
#include "qed_int.h" #include "qed_int.h"
......
...@@ -27,7 +27,7 @@ static void *qed_vf_pf_prep(struct qed_hwfn *p_hwfn, u16 type, u16 length) ...@@ -27,7 +27,7 @@ static void *qed_vf_pf_prep(struct qed_hwfn *p_hwfn, u16 type, u16 length)
"preparing to send 0x%04x tlv over vf pf channel\n", "preparing to send 0x%04x tlv over vf pf channel\n",
type); type);
/* Reset Requst offset */ /* Reset Request offset */
p_iov->offset = (u8 *)p_iov->vf2pf_request; p_iov->offset = (u8 *)p_iov->vf2pf_request;
/* Clear mailbox - both request and reply */ /* Clear mailbox - both request and reply */
...@@ -444,7 +444,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) ...@@ -444,7 +444,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
u32 reg; u32 reg;
int rc; int rc;
/* Set number of hwfns - might be overriden once leading hwfn learns /* Set number of hwfns - might be overridden once leading hwfn learns
* actual configuration from PF. * actual configuration from PF.
*/ */
if (IS_LEAD_HWFN(p_hwfn)) if (IS_LEAD_HWFN(p_hwfn))
...@@ -504,7 +504,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) ...@@ -504,7 +504,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
QED_MSG_IOV, QED_MSG_IOV,
"VF's Request mailbox [%p virt 0x%llx phys], Response mailbox [%p virt 0x%llx phys]\n", "VF's Request mailbox [%p virt 0x%llx phys], Response mailbox [%p virt 0x%llx phys]\n",
p_iov->vf2pf_request, p_iov->vf2pf_request,
(u64) p_iov->vf2pf_request_phys, (u64)p_iov->vf2pf_request_phys,
p_iov->pf2vf_reply, (u64)p_iov->pf2vf_reply_phys); p_iov->pf2vf_reply, (u64)p_iov->pf2vf_reply_phys);
/* Allocate Bulletin board */ /* Allocate Bulletin board */
...@@ -561,6 +561,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) ...@@ -561,6 +561,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
return -ENOMEM; return -ENOMEM;
} }
#define TSTORM_QZONE_START PXP_VF_BAR0_START_SDM_ZONE_A #define TSTORM_QZONE_START PXP_VF_BAR0_START_SDM_ZONE_A
#define MSTORM_QZONE_START(dev) (TSTORM_QZONE_START + \ #define MSTORM_QZONE_START(dev) (TSTORM_QZONE_START + \
(TSTORM_QZONE_SIZE * NUM_OF_L2_QUEUES(dev))) (TSTORM_QZONE_SIZE * NUM_OF_L2_QUEUES(dev)))
...@@ -1285,8 +1286,8 @@ int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn, ...@@ -1285,8 +1286,8 @@ int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
/* clear mailbox and prep first tlv */ /* clear mailbox and prep first tlv */
req = qed_vf_pf_prep(p_hwfn, CHANNEL_TLV_UCAST_FILTER, sizeof(*req)); req = qed_vf_pf_prep(p_hwfn, CHANNEL_TLV_UCAST_FILTER, sizeof(*req));
req->opcode = (u8) p_ucast->opcode; req->opcode = (u8)p_ucast->opcode;
req->type = (u8) p_ucast->type; req->type = (u8)p_ucast->type;
memcpy(req->mac, p_ucast->mac, ETH_ALEN); memcpy(req->mac, p_ucast->mac, ETH_ALEN);
req->vlan = p_ucast->vlan; req->vlan = p_ucast->vlan;
......
...@@ -48,7 +48,7 @@ struct channel_tlv { ...@@ -48,7 +48,7 @@ struct channel_tlv {
u16 length; u16 length;
}; };
/* header of first vf->pf tlv carries the offset used to calculate reponse /* header of first vf->pf tlv carries the offset used to calculate response
* buffer address * buffer address
*/ */
struct vfpf_first_tlv { struct vfpf_first_tlv {
...@@ -85,8 +85,8 @@ struct vfpf_acquire_tlv { ...@@ -85,8 +85,8 @@ struct vfpf_acquire_tlv {
struct vfpf_first_tlv first_tlv; struct vfpf_first_tlv first_tlv;
struct vf_pf_vfdev_info { struct vf_pf_vfdev_info {
#define VFPF_ACQUIRE_CAP_PRE_FP_HSI (1 << 0) /* VF pre-FP hsi version */ #define VFPF_ACQUIRE_CAP_PRE_FP_HSI BIT(0) /* VF pre-FP hsi version */
#define VFPF_ACQUIRE_CAP_100G (1 << 1) /* VF can support 100g */ #define VFPF_ACQUIRE_CAP_100G BIT(1) /* VF can support 100g */
/* A requirement for supporting multi-Tx queues on a single queue-zone, /* A requirement for supporting multi-Tx queues on a single queue-zone,
* VF would pass qids as additional information whenever passing queue * VF would pass qids as additional information whenever passing queue
* references. * references.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment