Thomas Gleixner | 3287e96 | 2019-06-01 10:08:54 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 2 | /* |
| 3 | * QLogic iSCSI Offload Driver |
| 4 | * Copyright (c) 2016 Cavium Inc. |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _QEDI_GBL_H_ |
| 8 | #define _QEDI_GBL_H_ |
| 9 | |
| 10 | #include "qedi_iscsi.h" |
| 11 | |
Arnd Bergmann | bd57119 | 2017-03-02 15:58:03 +0100 | [diff] [blame] | 12 | #ifdef CONFIG_DEBUG_FS |
| 13 | extern int qedi_do_not_recover; |
| 14 | #else |
| 15 | #define qedi_do_not_recover (0) |
| 16 | #endif |
| 17 | |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 18 | extern uint qedi_io_tracing; |
Arnd Bergmann | bd57119 | 2017-03-02 15:58:03 +0100 | [diff] [blame] | 19 | |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 20 | extern struct scsi_host_template qedi_host_template; |
| 21 | extern struct iscsi_transport qedi_iscsi_transport; |
| 22 | extern const struct qed_iscsi_ops *qedi_ops; |
Arnd Bergmann | 779936f | 2018-02-02 14:12:19 +0100 | [diff] [blame] | 23 | extern const struct qedi_debugfs_ops qedi_debugfs_ops[]; |
| 24 | extern const struct file_operations qedi_dbg_fops[]; |
Bart Van Assche | 1ebbd3b | 2021-10-12 16:35:50 -0700 | [diff] [blame] | 25 | extern const struct attribute_group *qedi_shost_groups[]; |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 26 | |
| 27 | int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); |
| 28 | void qedi_free_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); |
| 29 | |
| 30 | int qedi_send_iscsi_login(struct qedi_conn *qedi_conn, |
| 31 | struct iscsi_task *task); |
| 32 | int qedi_send_iscsi_logout(struct qedi_conn *qedi_conn, |
| 33 | struct iscsi_task *task); |
Mike Christie | f7eea75 | 2021-05-25 13:18:15 -0500 | [diff] [blame] | 34 | int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask); |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 35 | int qedi_send_iscsi_text(struct qedi_conn *qedi_conn, |
| 36 | struct iscsi_task *task); |
| 37 | int qedi_send_iscsi_nopout(struct qedi_conn *qedi_conn, |
| 38 | struct iscsi_task *task, |
| 39 | char *datap, int data_len, int unsol); |
| 40 | int qedi_iscsi_send_ioreq(struct iscsi_task *task); |
| 41 | int qedi_get_task_idx(struct qedi_ctx *qedi); |
| 42 | void qedi_clear_task_idx(struct qedi_ctx *qedi, int idx); |
| 43 | int qedi_iscsi_cleanup_task(struct iscsi_task *task, |
| 44 | bool mark_cmd_node_deleted); |
| 45 | void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd); |
| 46 | void qedi_update_itt_map(struct qedi_ctx *qedi, u32 tid, u32 proto_itt, |
| 47 | struct qedi_cmd *qedi_cmd); |
| 48 | void qedi_get_proto_itt(struct qedi_ctx *qedi, u32 tid, u32 *proto_itt); |
| 49 | void qedi_get_task_tid(struct qedi_ctx *qedi, u32 itt, int16_t *tid); |
| 50 | void qedi_process_iscsi_error(struct qedi_endpoint *ep, |
Tomer Tayar | da09091 | 2017-12-27 19:30:07 +0200 | [diff] [blame] | 51 | struct iscsi_eqe_data *data); |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 52 | void qedi_start_conn_recovery(struct qedi_ctx *qedi, |
| 53 | struct qedi_conn *qedi_conn); |
| 54 | struct qedi_conn *qedi_get_conn_from_id(struct qedi_ctx *qedi, u32 iscsi_cid); |
Tomer Tayar | da09091 | 2017-12-27 19:30:07 +0200 | [diff] [blame] | 55 | void qedi_process_tcp_error(struct qedi_endpoint *ep, |
| 56 | struct iscsi_eqe_data *data); |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 57 | void qedi_mark_device_missing(struct iscsi_cls_session *cls_session); |
| 58 | void qedi_mark_device_available(struct iscsi_cls_session *cls_session); |
| 59 | void qedi_reset_host_mtu(struct qedi_ctx *qedi, u16 mtu); |
| 60 | int qedi_recover_all_conns(struct qedi_ctx *qedi); |
| 61 | void qedi_fp_process_cqes(struct qedi_work *work); |
| 62 | int qedi_cleanup_all_io(struct qedi_ctx *qedi, |
| 63 | struct qedi_conn *qedi_conn, |
| 64 | struct iscsi_task *task, bool in_recovery); |
| 65 | void qedi_trace_io(struct qedi_ctx *qedi, struct iscsi_task *task, |
| 66 | u16 tid, int8_t direction); |
| 67 | int qedi_alloc_id(struct qedi_portid_tbl *id_tbl, u16 id); |
| 68 | u16 qedi_alloc_new_id(struct qedi_portid_tbl *id_tbl); |
| 69 | void qedi_free_id(struct qedi_portid_tbl *id_tbl, u16 id); |
| 70 | int qedi_create_sysfs_ctx_attr(struct qedi_ctx *qedi); |
| 71 | void qedi_remove_sysfs_ctx_attr(struct qedi_ctx *qedi); |
| 72 | void qedi_clearsq(struct qedi_ctx *qedi, |
| 73 | struct qedi_conn *qedi_conn, |
| 74 | struct iscsi_task *task); |
Manish Rangankar | ace7f46 | 2016-12-01 00:21:08 -0800 | [diff] [blame] | 75 | |
| 76 | #endif |