hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/s390/scsi/zfcp_def.h
....@@ -4,7 +4,7 @@
44 *
55 * Global definitions for the zfcp device driver.
66 *
7
- * Copyright IBM Corp. 2002, 2010
7
+ * Copyright IBM Corp. 2002, 2020
88 */
99
1010 #ifndef ZFCP_DEF_H
....@@ -41,24 +41,16 @@
4141 #include "zfcp_fc.h"
4242 #include "zfcp_qdio.h"
4343
44
-struct zfcp_reqlist;
45
-
46
-/********************* SCSI SPECIFIC DEFINES *********************************/
47
-#define ZFCP_SCSI_ER_TIMEOUT (10*HZ)
48
-
4944 /********************* FSF SPECIFIC DEFINES *********************************/
5045
5146 /* ATTENTION: value must not be used by hardware */
5247 #define FSF_QTCB_UNSOLICITED_STATUS 0x6305
5348
54
-/* timeout value for "default timer" for fsf requests */
55
-#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ)
56
-
5749 /*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
5850
5951 /*
60
- * Note, the leftmost status byte is common among adapter, port
61
- * and unit
52
+ * Note, the leftmost 12 status bits (3 nibbles) are common among adapter, port
53
+ * and unit. This is a mask for bitwise 'and' with status values.
6254 */
6355 #define ZFCP_COMMON_FLAGS 0xfff00000
6456
....@@ -94,10 +86,53 @@
9486 #define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080
9587 #define ZFCP_STATUS_FSFREQ_TMFUNCFAILED 0x00000200
9688 #define ZFCP_STATUS_FSFREQ_DISMISSED 0x00001000
89
+#define ZFCP_STATUS_FSFREQ_XDATAINCOMPLETE 0x00020000
9790
9891 /************************* STRUCTURE DEFINITIONS *****************************/
9992
100
-struct zfcp_fsf_req;
93
+/**
94
+ * enum zfcp_erp_act_type - Type of ERP action object.
95
+ * @ZFCP_ERP_ACTION_REOPEN_LUN: LUN recovery.
96
+ * @ZFCP_ERP_ACTION_REOPEN_PORT: Port recovery.
97
+ * @ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: Forced port recovery.
98
+ * @ZFCP_ERP_ACTION_REOPEN_ADAPTER: Adapter recovery.
99
+ *
100
+ * Values must fit into u8 because of code dependencies:
101
+ * zfcp_dbf_rec_trig(), &zfcp_dbf_rec_trigger.want, &zfcp_dbf_rec_trigger.need;
102
+ * zfcp_dbf_rec_run_lvl(), zfcp_dbf_rec_run(), &zfcp_dbf_rec_running.rec_action.
103
+ */
104
+enum zfcp_erp_act_type {
105
+ ZFCP_ERP_ACTION_REOPEN_LUN = 1,
106
+ ZFCP_ERP_ACTION_REOPEN_PORT = 2,
107
+ ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3,
108
+ ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4,
109
+};
110
+
111
+/*
112
+ * Values must fit into u16 because of code dependencies:
113
+ * zfcp_dbf_rec_run_lvl(), zfcp_dbf_rec_run(), zfcp_dbf_rec_run_wka(),
114
+ * &zfcp_dbf_rec_running.rec_step.
115
+ */
116
+enum zfcp_erp_steps {
117
+ ZFCP_ERP_STEP_UNINITIALIZED = 0x0000,
118
+ ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010,
119
+ ZFCP_ERP_STEP_PORT_CLOSING = 0x0100,
120
+ ZFCP_ERP_STEP_PORT_OPENING = 0x0800,
121
+ ZFCP_ERP_STEP_LUN_CLOSING = 0x1000,
122
+ ZFCP_ERP_STEP_LUN_OPENING = 0x2000,
123
+};
124
+
125
+struct zfcp_erp_action {
126
+ struct list_head list;
127
+ enum zfcp_erp_act_type type; /* requested action code */
128
+ struct zfcp_adapter *adapter; /* device which should be recovered */
129
+ struct zfcp_port *port;
130
+ struct scsi_device *sdev;
131
+ u32 status; /* recovery status */
132
+ enum zfcp_erp_steps step; /* active step of this erp action */
133
+ unsigned long fsf_req_id;
134
+ struct timer_list timer;
135
+};
101136
102137 /* holds various memory pools of an adapter */
103138 struct zfcp_adapter_mempool {
....@@ -109,37 +144,6 @@
109144 mempool_t *sr_data;
110145 mempool_t *gid_pn;
111146 mempool_t *qtcb_pool;
112
-};
113
-
114
-struct zfcp_erp_action {
115
- struct list_head list;
116
- int action; /* requested action code */
117
- struct zfcp_adapter *adapter; /* device which should be recovered */
118
- struct zfcp_port *port;
119
- struct scsi_device *sdev;
120
- u32 status; /* recovery status */
121
- u32 step; /* active step of this erp action */
122
- unsigned long fsf_req_id;
123
- struct timer_list timer;
124
-};
125
-
126
-struct fsf_latency_record {
127
- u32 min;
128
- u32 max;
129
- u64 sum;
130
-};
131
-
132
-struct latency_cont {
133
- struct fsf_latency_record channel;
134
- struct fsf_latency_record fabric;
135
- u64 counter;
136
-};
137
-
138
-struct zfcp_latencies {
139
- struct latency_cont read;
140
- struct latency_cont write;
141
- struct latency_cont cmd;
142
- spinlock_t lock;
143147 };
144148
145149 struct zfcp_adapter {
....@@ -154,6 +158,8 @@
154158 u32 adapter_features; /* FCP channel features */
155159 u32 connection_features; /* host connection features */
156160 u32 hardware_version; /* of FCP channel */
161
+ u32 fc_security_algorithms; /* of FCP channel */
162
+ u32 fc_security_algorithms_old; /* of FCP channel */
157163 u16 timer_ticks; /* time int for a tick */
158164 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
159165 struct list_head port_list; /* remote port list */
....@@ -194,6 +200,7 @@
194200 struct device_dma_parameters dma_parms;
195201 struct zfcp_fc_events events;
196202 unsigned long next_port_scan;
203
+ struct zfcp_diag_adapter *diagnostics;
197204 };
198205
199206 struct zfcp_port {
....@@ -213,11 +220,32 @@
213220 atomic_t erp_counter;
214221 u32 maxframe_size;
215222 u32 supported_classes;
223
+ u32 connection_info;
224
+ u32 connection_info_old;
216225 struct work_struct gid_pn_work;
217226 struct work_struct test_link_work;
218227 struct work_struct rport_work;
219228 enum { RPORT_NONE, RPORT_ADD, RPORT_DEL } rport_task;
220229 unsigned int starget_id;
230
+};
231
+
232
+struct zfcp_latency_record {
233
+ u32 min;
234
+ u32 max;
235
+ u64 sum;
236
+};
237
+
238
+struct zfcp_latency_cont {
239
+ struct zfcp_latency_record channel;
240
+ struct zfcp_latency_record fabric;
241
+ u64 counter;
242
+};
243
+
244
+struct zfcp_latencies {
245
+ struct zfcp_latency_cont read;
246
+ struct zfcp_latency_cont write;
247
+ struct zfcp_latency_cont cmd;
248
+ spinlock_t lock;
221249 };
222250
223251 /**
....@@ -287,9 +315,7 @@
287315 * @qdio_req: qdio queue related values
288316 * @completion: used to signal the completion of the request
289317 * @status: status of the request
290
- * @fsf_command: FSF command issued
291318 * @qtcb: associated QTCB
292
- * @seq_no: sequence number of this request
293319 * @data: private data
294320 * @timer: timer data of this request
295321 * @erp_action: reference to erp action if request issued on behalf of ERP
....@@ -304,9 +330,7 @@
304330 struct zfcp_qdio_req qdio_req;
305331 struct completion completion;
306332 u32 status;
307
- u32 fsf_command;
308333 struct fsf_qtcb *qtcb;
309
- u32 seq_no;
310334 void *data;
311335 struct timer_list timer;
312336 struct zfcp_erp_action *erp_action;
....@@ -321,4 +345,9 @@
321345 return atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_MB_ACT;
322346 }
323347
348
+static inline bool zfcp_fsf_req_is_status_read_buffer(struct zfcp_fsf_req *req)
349
+{
350
+ return req->qtcb == NULL;
351
+}
352
+
324353 #endif /* ZFCP_DEF_H */