xref: /openbmc/linux/drivers/scsi/fnic/vnic_scsi.h (revision c4c3c32d)
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      2112
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       1024
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 };
83 
84 #define VFCF_FCP_SEQ_LVL_ERR	0x1	/* Enable FCP-2 Error Recovery */
85 #define VFCF_PERBI		0x2	/* persistent binding info available */
86 #define VFCF_FIP_CAPABLE	0x4	/* firmware can handle FIP */
87 
88 #endif /* _VNIC_SCSI_H_ */
89