forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/scsi/qedi/qedi.h
....@@ -1,10 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * QLogic iSCSI Offload Driver
34 * Copyright (c) 2016 Cavium Inc.
4
- *
5
- * This software is available under the terms of the GNU General Public License
6
- * (GPL) Version 2, available from the file COPYING in the main directory of
7
- * this source tree.
85 */
96
107 #ifndef _QEDI_H_
....@@ -39,13 +36,14 @@
3936 */
4037 #define QEDI_MODE_NORMAL 0
4138 #define QEDI_MODE_RECOVERY 1
39
+#define QEDI_MODE_SHUTDOWN 2
4240
4341 #define ISCSI_WQE_SET_PTU_INVALIDATE 1
4442 #define QEDI_MAX_ISCSI_TASK 4096
4543 #define QEDI_MAX_TASK_NUM 0x0FFF
4644 #define QEDI_MAX_ISCSI_CONNS_PER_HBA 1024
4745 #define QEDI_ISCSI_MAX_BDS_PER_CMD 255 /* Firmware max BDs is 255 */
48
-#define MAX_OUSTANDING_TASKS_PER_CON 1024
46
+#define MAX_OUTSTANDING_TASKS_PER_CON 1024
4947
5048 #define QEDI_MAX_BD_LEN 0xffff
5149 #define QEDI_BD_SPLIT_SZ 0x1000
....@@ -63,12 +61,9 @@
6361 #define QEDI_LOCAL_PORT_INVALID 0xffff
6462 #define TX_RX_RING 16
6563 #define RX_RING (TX_RX_RING - 1)
66
-#define LL2_SINGLE_BUF_SIZE 0x400
67
-#define QEDI_PAGE_SIZE 4096
6864 #define QEDI_PAGE_ALIGN(addr) ALIGN(addr, QEDI_PAGE_SIZE)
6965 #define QEDI_PAGE_MASK (~((QEDI_PAGE_SIZE) - 1))
7066
71
-#define QEDI_PAGE_SIZE 4096
7267 #define QEDI_HW_DMA_BOUNDARY 0xfff
7368 #define QEDI_PATH_HANDLE 0xFE0000000UL
7469
....@@ -146,7 +141,7 @@
146141 };
147142
148143 /* Queue sizes in number of elements */
149
-#define QEDI_SQ_SIZE MAX_OUSTANDING_TASKS_PER_CON
144
+#define QEDI_SQ_SIZE MAX_OUTSTANDING_TASKS_PER_CON
150145 #define QEDI_CQ_SIZE 2048
151146 #define QEDI_CMDQ_SIZE QEDI_MAX_ISCSI_TASK
152147 #define QEDI_PROTO_CQ_PROD_IDX 0
....@@ -279,11 +274,17 @@
279274 spinlock_t ll2_lock; /* Light L2 lock */
280275 spinlock_t hba_lock; /* per port lock */
281276 struct task_struct *ll2_recv_thread;
277
+ unsigned long qedi_err_flags;
278
+#define QEDI_ERR_ATTN_CLR_EN 0
279
+#define QEDI_ERR_IS_RECOVERABLE 2
280
+#define QEDI_ERR_OVERRIDE_EN 31
282281 unsigned long flags;
283282 #define UIO_DEV_OPENED 1
284283 #define QEDI_IOTHREAD_WAKE 2
285284 #define QEDI_IN_RECOVERY 5
286285 #define QEDI_IN_OFFLINE 6
286
+#define QEDI_IN_SHUTDOWN 7
287
+#define QEDI_BLOCK_IO 8
287288
288289 u8 mac[ETH_ALEN];
289290 u32 src_ip[4];
....@@ -309,6 +310,7 @@
309310 u32 max_sqes;
310311 u8 num_queues;
311312 u32 max_active_conns;
313
+ s32 msix_count;
312314
313315 struct iscsi_cid_queue cid_que;
314316 struct qedi_endpoint **ep_tbl;
....@@ -337,6 +339,8 @@
337339 u16 ll2_mtu;
338340
339341 struct workqueue_struct *dpc_wq;
342
+ struct delayed_work recovery_work;
343
+ struct delayed_work board_disable_work;
340344
341345 spinlock_t task_idx_lock; /* To protect gbl context */
342346 s32 last_tidx_alloc;