Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* QLogic FCoE Offload Driver
0003  * Copyright (c) 2016-2018 Cavium Inc.
0004  */
0005 #ifndef _SCSI_FW_FUNCS_H
0006 #define _SCSI_FW_FUNCS_H
0007 #include <linux/qed/common_hsi.h>
0008 #include <linux/qed/storage_common.h>
0009 #include <linux/qed/fcoe_common.h>
0010 
0011 struct scsi_sgl_task_params {
0012     struct scsi_sge *sgl;
0013     struct regpair sgl_phys_addr;
0014     u32 total_buffer_size;
0015     u16 num_sges;
0016 
0017      /* true if SGL contains a small (< 4KB) SGE in middle(not 1st or last)
0018       * -> relevant for tx only
0019       */
0020     bool small_mid_sge;
0021 };
0022 
0023 struct scsi_dif_task_params {
0024     u32 initial_ref_tag;
0025     bool initial_ref_tag_is_valid;
0026     u16 application_tag;
0027     u16 application_tag_mask;
0028     u16 dif_block_size_log;
0029     bool dif_on_network;
0030     bool dif_on_host;
0031     u8 host_guard_type;
0032     u8 protection_type;
0033     u8 ref_tag_mask;
0034     bool crc_seed;
0035 
0036      /* Enable Connection error upon DIF error (segments with DIF errors are
0037       * dropped)
0038       */
0039     bool tx_dif_conn_err_en;
0040     bool ignore_app_tag;
0041     bool keep_ref_tag_const;
0042     bool validate_guard;
0043     bool validate_app_tag;
0044     bool validate_ref_tag;
0045     bool forward_guard;
0046     bool forward_app_tag;
0047     bool forward_ref_tag;
0048     bool forward_app_tag_with_mask;
0049     bool forward_ref_tag_with_mask;
0050 };
0051 
0052 struct scsi_initiator_cmd_params {
0053      /* for cdb_size > default CDB size (extended CDB > 16 bytes) ->
0054       * pointer to the CDB buffer SGE
0055       */
0056     struct scsi_sge extended_cdb_sge;
0057 
0058     /* Physical address of sense data buffer for sense data - 256B buffer */
0059     struct regpair sense_data_buffer_phys_addr;
0060 };
0061 
0062 /**
0063  * @brief scsi_is_slow_sgl - checks for slow SGL
0064  *
0065  * @param num_sges - number of sges in SGL
0066  * @param small_mid_sge - True is the SGL contains an SGE which is smaller than
0067  * 4KB and its not the 1st or last SGE in the SGL
0068  */
0069 bool scsi_is_slow_sgl(u16 num_sges, bool small_mid_sge);
0070 
0071 /**
0072  * @brief init_scsi_sgl_context - initializes SGL task context
0073  *
0074  * @param sgl_params - SGL context parameters to initialize (output parameter)
0075  * @param data_desc - context struct containing SGEs array to set (output
0076  * parameter)
0077  * @param sgl_task_params - SGL parameters (input)
0078  */
0079 void init_scsi_sgl_context(struct scsi_sgl_params *sgl_params,
0080     struct scsi_cached_sges *ctx_data_desc,
0081     struct scsi_sgl_task_params *sgl_task_params);
0082 #endif