blob: 72942772b198f15245598dfb77176e40b239cfa4 [file] [log] [blame]
Thomas Gleixner3287e962019-06-01 10:08:54 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Manish Rangankarace7f462016-12-01 00:21:08 -08002/*
3 * QLogic iSCSI Offload Driver
4 * Copyright (c) 2016 Cavium Inc.
Manish Rangankarace7f462016-12-01 00:21:08 -08005 */
6
7#ifndef _QEDI_GBL_H_
8#define _QEDI_GBL_H_
9
10#include "qedi_iscsi.h"
11
Arnd Bergmannbd571192017-03-02 15:58:03 +010012#ifdef CONFIG_DEBUG_FS
13extern int qedi_do_not_recover;
14#else
15#define qedi_do_not_recover (0)
16#endif
17
Manish Rangankarace7f462016-12-01 00:21:08 -080018extern uint qedi_io_tracing;
Arnd Bergmannbd571192017-03-02 15:58:03 +010019
Manish Rangankarace7f462016-12-01 00:21:08 -080020extern struct scsi_host_template qedi_host_template;
21extern struct iscsi_transport qedi_iscsi_transport;
22extern const struct qed_iscsi_ops *qedi_ops;
Arnd Bergmann779936f2018-02-02 14:12:19 +010023extern const struct qedi_debugfs_ops qedi_debugfs_ops[];
24extern const struct file_operations qedi_dbg_fops[];
Bart Van Assche1ebbd3b2021-10-12 16:35:50 -070025extern const struct attribute_group *qedi_shost_groups[];
Manish Rangankarace7f462016-12-01 00:21:08 -080026
27int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep);
28void qedi_free_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep);
29
30int qedi_send_iscsi_login(struct qedi_conn *qedi_conn,
31 struct iscsi_task *task);
32int qedi_send_iscsi_logout(struct qedi_conn *qedi_conn,
33 struct iscsi_task *task);
Mike Christief7eea752021-05-25 13:18:15 -050034int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask);
Manish Rangankarace7f462016-12-01 00:21:08 -080035int qedi_send_iscsi_text(struct qedi_conn *qedi_conn,
36 struct iscsi_task *task);
37int qedi_send_iscsi_nopout(struct qedi_conn *qedi_conn,
38 struct iscsi_task *task,
39 char *datap, int data_len, int unsol);
40int qedi_iscsi_send_ioreq(struct iscsi_task *task);
41int qedi_get_task_idx(struct qedi_ctx *qedi);
42void qedi_clear_task_idx(struct qedi_ctx *qedi, int idx);
43int qedi_iscsi_cleanup_task(struct iscsi_task *task,
44 bool mark_cmd_node_deleted);
45void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd);
46void qedi_update_itt_map(struct qedi_ctx *qedi, u32 tid, u32 proto_itt,
47 struct qedi_cmd *qedi_cmd);
48void qedi_get_proto_itt(struct qedi_ctx *qedi, u32 tid, u32 *proto_itt);
49void qedi_get_task_tid(struct qedi_ctx *qedi, u32 itt, int16_t *tid);
50void qedi_process_iscsi_error(struct qedi_endpoint *ep,
Tomer Tayarda090912017-12-27 19:30:07 +020051 struct iscsi_eqe_data *data);
Manish Rangankarace7f462016-12-01 00:21:08 -080052void qedi_start_conn_recovery(struct qedi_ctx *qedi,
53 struct qedi_conn *qedi_conn);
54struct qedi_conn *qedi_get_conn_from_id(struct qedi_ctx *qedi, u32 iscsi_cid);
Tomer Tayarda090912017-12-27 19:30:07 +020055void qedi_process_tcp_error(struct qedi_endpoint *ep,
56 struct iscsi_eqe_data *data);
Manish Rangankarace7f462016-12-01 00:21:08 -080057void qedi_mark_device_missing(struct iscsi_cls_session *cls_session);
58void qedi_mark_device_available(struct iscsi_cls_session *cls_session);
59void qedi_reset_host_mtu(struct qedi_ctx *qedi, u16 mtu);
60int qedi_recover_all_conns(struct qedi_ctx *qedi);
61void qedi_fp_process_cqes(struct qedi_work *work);
62int qedi_cleanup_all_io(struct qedi_ctx *qedi,
63 struct qedi_conn *qedi_conn,
64 struct iscsi_task *task, bool in_recovery);
65void qedi_trace_io(struct qedi_ctx *qedi, struct iscsi_task *task,
66 u16 tid, int8_t direction);
67int qedi_alloc_id(struct qedi_portid_tbl *id_tbl, u16 id);
68u16 qedi_alloc_new_id(struct qedi_portid_tbl *id_tbl);
69void qedi_free_id(struct qedi_portid_tbl *id_tbl, u16 id);
70int qedi_create_sysfs_ctx_attr(struct qedi_ctx *qedi);
71void qedi_remove_sysfs_ctx_attr(struct qedi_ctx *qedi);
72void qedi_clearsq(struct qedi_ctx *qedi,
73 struct qedi_conn *qedi_conn,
74 struct iscsi_task *task);
Manish Rangankarace7f462016-12-01 00:21:08 -080075
76#endif