1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* QLogic FCoE Offload Driver
3 * Copyright (c) 2016-2018 Cavium Inc.
5 #ifndef _SCSI_FW_FUNCS_H
6 #define _SCSI_FW_FUNCS_H
7 #include <linux/qed/common_hsi.h>
8 #include <linux/qed/storage_common.h>
9 #include <linux/qed/fcoe_common.h>
11 struct scsi_sgl_task_params
{
13 struct regpair sgl_phys_addr
;
14 u32 total_buffer_size
;
17 /* true if SGL contains a small (< 4KB) SGE in middle(not 1st or last)
18 * -> relevant for tx only
23 struct scsi_dif_task_params
{
25 bool initial_ref_tag_is_valid
;
27 u16 application_tag_mask
;
28 u16 dif_block_size_log
;
36 /* Enable Connection error upon DIF error (segments with DIF errors are
39 bool tx_dif_conn_err_en
;
41 bool keep_ref_tag_const
;
43 bool validate_app_tag
;
44 bool validate_ref_tag
;
48 bool forward_app_tag_with_mask
;
49 bool forward_ref_tag_with_mask
;
52 struct scsi_initiator_cmd_params
{
53 /* for cdb_size > default CDB size (extended CDB > 16 bytes) ->
54 * pointer to the CDB buffer SGE
56 struct scsi_sge extended_cdb_sge
;
58 /* Physical address of sense data buffer for sense data - 256B buffer */
59 struct regpair sense_data_buffer_phys_addr
;
63 * @brief scsi_is_slow_sgl - checks for slow SGL
65 * @param num_sges - number of sges in SGL
66 * @param small_mid_sge - True is the SGL contains an SGE which is smaller than
67 * 4KB and its not the 1st or last SGE in the SGL
69 bool scsi_is_slow_sgl(u16 num_sges
, bool small_mid_sge
);
72 * @brief init_scsi_sgl_context - initializes SGL task context
74 * @param sgl_params - SGL context parameters to initialize (output parameter)
75 * @param data_desc - context struct containing SGEs array to set (output
77 * @param sgl_task_params - SGL parameters (input)
79 void init_scsi_sgl_context(struct scsi_sgl_params
*sgl_params
,
80 struct scsi_cached_sges
*ctx_data_desc
,
81 struct scsi_sgl_task_params
*sgl_task_params
);