| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic iSCSI Offload Driver |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #ifndef _QEDI_H_ |
|---|
| .. | .. |
|---|
| 39 | 36 | */ |
|---|
| 40 | 37 | #define QEDI_MODE_NORMAL 0 |
|---|
| 41 | 38 | #define QEDI_MODE_RECOVERY 1 |
|---|
| 39 | +#define QEDI_MODE_SHUTDOWN 2 |
|---|
| 42 | 40 | |
|---|
| 43 | 41 | #define ISCSI_WQE_SET_PTU_INVALIDATE 1 |
|---|
| 44 | 42 | #define QEDI_MAX_ISCSI_TASK 4096 |
|---|
| 45 | 43 | #define QEDI_MAX_TASK_NUM 0x0FFF |
|---|
| 46 | 44 | #define QEDI_MAX_ISCSI_CONNS_PER_HBA 1024 |
|---|
| 47 | 45 | #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 |
|---|
| 49 | 47 | |
|---|
| 50 | 48 | #define QEDI_MAX_BD_LEN 0xffff |
|---|
| 51 | 49 | #define QEDI_BD_SPLIT_SZ 0x1000 |
|---|
| .. | .. |
|---|
| 63 | 61 | #define QEDI_LOCAL_PORT_INVALID 0xffff |
|---|
| 64 | 62 | #define TX_RX_RING 16 |
|---|
| 65 | 63 | #define RX_RING (TX_RX_RING - 1) |
|---|
| 66 | | -#define LL2_SINGLE_BUF_SIZE 0x400 |
|---|
| 67 | | -#define QEDI_PAGE_SIZE 4096 |
|---|
| 68 | 64 | #define QEDI_PAGE_ALIGN(addr) ALIGN(addr, QEDI_PAGE_SIZE) |
|---|
| 69 | 65 | #define QEDI_PAGE_MASK (~((QEDI_PAGE_SIZE) - 1)) |
|---|
| 70 | 66 | |
|---|
| 71 | | -#define QEDI_PAGE_SIZE 4096 |
|---|
| 72 | 67 | #define QEDI_HW_DMA_BOUNDARY 0xfff |
|---|
| 73 | 68 | #define QEDI_PATH_HANDLE 0xFE0000000UL |
|---|
| 74 | 69 | |
|---|
| .. | .. |
|---|
| 146 | 141 | }; |
|---|
| 147 | 142 | |
|---|
| 148 | 143 | /* 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 |
|---|
| 150 | 145 | #define QEDI_CQ_SIZE 2048 |
|---|
| 151 | 146 | #define QEDI_CMDQ_SIZE QEDI_MAX_ISCSI_TASK |
|---|
| 152 | 147 | #define QEDI_PROTO_CQ_PROD_IDX 0 |
|---|
| .. | .. |
|---|
| 279 | 274 | spinlock_t ll2_lock; /* Light L2 lock */ |
|---|
| 280 | 275 | spinlock_t hba_lock; /* per port lock */ |
|---|
| 281 | 276 | 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 |
|---|
| 282 | 281 | unsigned long flags; |
|---|
| 283 | 282 | #define UIO_DEV_OPENED 1 |
|---|
| 284 | 283 | #define QEDI_IOTHREAD_WAKE 2 |
|---|
| 285 | 284 | #define QEDI_IN_RECOVERY 5 |
|---|
| 286 | 285 | #define QEDI_IN_OFFLINE 6 |
|---|
| 286 | +#define QEDI_IN_SHUTDOWN 7 |
|---|
| 287 | +#define QEDI_BLOCK_IO 8 |
|---|
| 287 | 288 | |
|---|
| 288 | 289 | u8 mac[ETH_ALEN]; |
|---|
| 289 | 290 | u32 src_ip[4]; |
|---|
| .. | .. |
|---|
| 309 | 310 | u32 max_sqes; |
|---|
| 310 | 311 | u8 num_queues; |
|---|
| 311 | 312 | u32 max_active_conns; |
|---|
| 313 | + s32 msix_count; |
|---|
| 312 | 314 | |
|---|
| 313 | 315 | struct iscsi_cid_queue cid_que; |
|---|
| 314 | 316 | struct qedi_endpoint **ep_tbl; |
|---|
| .. | .. |
|---|
| 337 | 339 | u16 ll2_mtu; |
|---|
| 338 | 340 | |
|---|
| 339 | 341 | struct workqueue_struct *dpc_wq; |
|---|
| 342 | + struct delayed_work recovery_work; |
|---|
| 343 | + struct delayed_work board_disable_work; |
|---|
| 340 | 344 | |
|---|
| 341 | 345 | spinlock_t task_idx_lock; /* To protect gbl context */ |
|---|
| 342 | 346 | s32 last_tidx_alloc; |
|---|