diff options
author | sudarsana.kalluru@cavium.com <sudarsana.kalluru@cavium.com> | 2017-04-26 09:00:49 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-27 16:51:33 -0400 |
commit | f470f22cfa3d42f357ed404a06ec77aa09ddb05b (patch) | |
tree | 6dcac6594740019ad70af9c746114b55e0ed19cd /drivers/net/ethernet/qlogic/qed/qed_mcp.h | |
parent | 26d31ac11fa47a0ee8dc4c64136ea34feda57e3e (diff) | |
download | linux-f470f22cfa3d42f357ed404a06ec77aa09ddb05b.tar.gz linux-f470f22cfa3d42f357ed404a06ec77aa09ddb05b.tar.bz2 linux-f470f22cfa3d42f357ed404a06ec77aa09ddb05b.zip |
qed: Add support for MFW resource locking.
The patch adds API for default initialization of the MFW resource
locking.
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_mcp.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_mcp.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h index ac7d406be1ed..e8cf59774f43 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h @@ -795,7 +795,8 @@ int qed_mcp_ov_update_eswitch(struct qed_hwfn *p_hwfn, enum qed_resc_lock { QED_RESC_LOCK_DBG_DUMP = QED_MCP_RESC_LOCK_MIN_VAL, - QED_RESC_LOCK_RESC_ALLOC = QED_MCP_RESC_LOCK_MAX_VAL + QED_RESC_LOCK_RESC_ALLOC = QED_MCP_RESC_LOCK_MAX_VAL, + QED_RESC_LOCK_RESC_INVALID }; /** @@ -818,9 +819,11 @@ struct qed_resc_lock_params { /* Number of times to retry locking */ u8 retry_num; +#define QED_MCP_RESC_LOCK_RETRY_CNT_DFLT 10 /* The interval in usec between retries */ u16 retry_interval; +#define QED_MCP_RESC_LOCK_RETRY_VAL_DFLT 10000 /* Use sleep or delay between retries */ bool sleep_b4_retry; @@ -872,4 +875,17 @@ qed_mcp_resc_unlock(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, struct qed_resc_unlock_params *p_params); +/** + * @brief - default initialization for lock/unlock resource structs + * + * @param p_lock - lock params struct to be initialized; Can be NULL + * @param p_unlock - unlock params struct to be initialized; Can be NULL + * @param resource - the requested resource + * @paral b_is_permanent - disable retries & aging when set + */ +void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock, + struct qed_resc_unlock_params *p_unlock, + enum qed_resc_lock + resource, bool b_is_permanent); + #endif |