1/* QLogic FCoE Offload Driver
2 * Copyright (c) 2016-2018 Cavium Inc.
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8#ifndef _FCOE_FW_FUNCS_H
9#define _FCOE_FW_FUNCS_H
10#include "drv_scsi_fw_funcs.h"
11#include "qedf_hsi.h"
12#include <linux/qed/qed_if.h>
13
14struct fcoe_task_params {
15 /* Output parameter [set/filled by the HSI function] */
16 struct e4_fcoe_task_context *context;
17
18 /* Output parameter [set/filled by the HSI function] */
19 struct fcoe_wqe *sqe;
20 enum fcoe_task_type task_type;
21 u32 tx_io_size; /* in bytes */
22 u32 rx_io_size; /* in bytes */
23 u32 conn_cid;
24 u16 itid;
25 u8 cq_rss_number;
26
27 /* Whether it's Tape device or not (0=Disk, 1=Tape) */
28 u8 is_tape_device;
29};
30
31/**
32 * @brief init_initiator_rw_fcoe_task - Initializes FCoE task context for
33 * read/write task types and init fcoe_sqe
34 *
35 * @param task_params - Pointer to task parameters struct
36 * @param sgl_task_params - Pointer to SGL task params
37 * @param sense_data_buffer_phys_addr - Pointer to sense data buffer
38 * @param task_retry_id - retry identification - Used only for Tape device
39 * @param fcp_cmnd_payload - FCP CMD Payload
40 */
41int init_initiator_rw_fcoe_task(struct fcoe_task_params *task_params,
42 struct scsi_sgl_task_params *sgl_task_params,
43 struct regpair sense_data_buffer_phys_addr,
44 u32 task_retry_id,
45 u8 fcp_cmd_payload[32]);
46
47/**
48 * @brief init_initiator_midpath_fcoe_task - Initializes FCoE task context for
49 * midpath/unsolicited task types and init fcoe_sqe
50 *
51 * @param task_params - Pointer to task parameters struct
52 * @param mid_path_fc_header - FC header
53 * @param tx_sgl_task_params - Pointer to Tx SGL task params
54 * @param rx_sgl_task_params - Pointer to Rx SGL task params
55 * @param fw_to_place_fc_header - Indication if the FW will place the FC header
56 * in addition to the data arrives.
57 */
58int init_initiator_midpath_unsolicited_fcoe_task(
59 struct fcoe_task_params *task_params,
60 struct fcoe_tx_mid_path_params *mid_path_fc_header,
61 struct scsi_sgl_task_params *tx_sgl_task_params,
62 struct scsi_sgl_task_params *rx_sgl_task_params,
63 u8 fw_to_place_fc_header);
64
65/**
66 * @brief init_initiator_abort_fcoe_task - Initializes FCoE task context for
67 * abort task types and init fcoe_sqe
68 *
69 * @param task_params - Pointer to task parameters struct
70 */
71int init_initiator_abort_fcoe_task(struct fcoe_task_params *task_params);
72
73/**
74 * @brief init_initiator_cleanup_fcoe_task - Initializes FCoE task context for
75 * cleanup task types and init fcoe_sqe
76 *
77 *
78 * @param task_params - Pointer to task parameters struct
79 */
80int init_initiator_cleanup_fcoe_task(struct fcoe_task_params *task_params);
81
82/**
83 * @brief init_initiator_cleanup_fcoe_task - Initializes FCoE task context for
84 * sequence recovery task types and init fcoe_sqe
85 *
86 *
87 * @param task_params - Pointer to task parameters struct
88 * @param desired_offset - The desired offest the task will be re-sent from
89 */
90int init_initiator_sequence_recovery_fcoe_task(
91 struct fcoe_task_params *task_params,
92 u32 desired_offset);
93#endif
94