1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright 2008 Cisco Systems, Inc. All rights reserved. 4 * Copyright 2007 Nuova Systems, Inc. All rights reserved. 5 */ 6 #ifndef _VNIC_SCSI_H_ 7 #define _VNIC_SCSI_H_ 8 9 #define VNIC_FNIC_WQ_COPY_COUNT_MIN 1 10 #define VNIC_FNIC_WQ_COPY_COUNT_MAX 1 11 12 #define VNIC_FNIC_WQ_DESCS_MIN 64 13 #define VNIC_FNIC_WQ_DESCS_MAX 128 14 15 #define VNIC_FNIC_WQ_COPY_DESCS_MIN 64 16 #define VNIC_FNIC_WQ_COPY_DESCS_MAX 512 17 18 #define VNIC_FNIC_RQ_DESCS_MIN 64 19 #define VNIC_FNIC_RQ_DESCS_MAX 128 20 21 #define VNIC_FNIC_EDTOV_MIN 1000 22 #define VNIC_FNIC_EDTOV_MAX 255000 23 #define VNIC_FNIC_EDTOV_DEF 2000 24 25 #define VNIC_FNIC_RATOV_MIN 1000 26 #define VNIC_FNIC_RATOV_MAX 255000 27 28 #define VNIC_FNIC_MAXDATAFIELDSIZE_MIN 256 29 #define VNIC_FNIC_MAXDATAFIELDSIZE_MAX 2048 30 31 #define VNIC_FNIC_FLOGI_RETRIES_MIN 0 32 #define VNIC_FNIC_FLOGI_RETRIES_MAX 0xffffffff 33 #define VNIC_FNIC_FLOGI_RETRIES_DEF 0xffffffff 34 35 #define VNIC_FNIC_FLOGI_TIMEOUT_MIN 1000 36 #define VNIC_FNIC_FLOGI_TIMEOUT_MAX 255000 37 38 #define VNIC_FNIC_PLOGI_RETRIES_MIN 0 39 #define VNIC_FNIC_PLOGI_RETRIES_MAX 255 40 #define VNIC_FNIC_PLOGI_RETRIES_DEF 8 41 42 #define VNIC_FNIC_PLOGI_TIMEOUT_MIN 1000 43 #define VNIC_FNIC_PLOGI_TIMEOUT_MAX 255000 44 45 #define VNIC_FNIC_IO_THROTTLE_COUNT_MIN 1 46 #define VNIC_FNIC_IO_THROTTLE_COUNT_MAX 2048 47 48 #define VNIC_FNIC_LINK_DOWN_TIMEOUT_MIN 0 49 #define VNIC_FNIC_LINK_DOWN_TIMEOUT_MAX 240000 50 51 #define VNIC_FNIC_PORT_DOWN_TIMEOUT_MIN 0 52 #define VNIC_FNIC_PORT_DOWN_TIMEOUT_MAX 240000 53 54 #define VNIC_FNIC_PORT_DOWN_IO_RETRIES_MIN 0 55 #define VNIC_FNIC_PORT_DOWN_IO_RETRIES_MAX 255 56 57 #define VNIC_FNIC_LUNS_PER_TARGET_MIN 1 58 #define VNIC_FNIC_LUNS_PER_TARGET_MAX 4096 59 60 /* Device-specific region: scsi configuration */ 61 struct vnic_fc_config { 62 u64 node_wwn; 63 u64 port_wwn; 64 u32 flags; 65 u32 wq_enet_desc_count; 66 u32 wq_copy_desc_count; 67 u32 rq_desc_count; 68 u32 flogi_retries; 69 u32 flogi_timeout; 70 u32 plogi_retries; 71 u32 plogi_timeout; 72 u32 io_throttle_count; 73 u32 link_down_timeout; 74 u32 port_down_timeout; 75 u32 port_down_io_retries; 76 u32 luns_per_tgt; 77 u16 maxdatafieldsize; 78 u16 ed_tov; 79 u16 ra_tov; 80 u16 intr_timer; 81 u8 intr_timer_type; 82 u8 intr_mode; 83 u8 lun_queue_depth; 84 u8 io_timeout_retry; 85 u16 wq_copy_count; 86 }; 87 88 #define VFCF_FCP_SEQ_LVL_ERR 0x1 /* Enable FCP-2 Error Recovery */ 89 #define VFCF_PERBI 0x2 /* persistent binding info available */ 90 #define VFCF_FIP_CAPABLE 0x4 /* firmware can handle FIP */ 91 92 #define VFCF_FC_INITIATOR 0x20 /* FC Initiator Mode */ 93 #define VFCF_FC_TARGET 0x40 /* FC Target Mode */ 94 #define VFCF_FC_NVME_INITIATOR 0x80 /* FC-NVMe Initiator Mode */ 95 #define VFCF_FC_NVME_TARGET 0x100 /* FC-NVMe Target Mode */ 96 97 #endif /* _VNIC_SCSI_H_ */ 98