xref: /freebsd/sys/dev/ocs_fc/ocs_scsi.h (revision cd0d51baaa4509a1db83251a601d34404d20c990)
1 /*-
2  * Copyright (c) 2017 Broadcom. All rights reserved.
3  * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  *    this list of conditions and the following disclaimer in the documentation
13  *    and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  *    may be used to endorse or promote products derived from this software
17  *    without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  * $FreeBSD$
32  */
33 
34 /**
35  * @file
36  * OCS SCSI API declarations
37  *
38  */
39 
40 #if !defined(__OCS_SCSI_H__)
41 #define __OCS_SCSI_H__
42 
43 #include "ocs_ddump.h"
44 #include "ocs_mgmt.h"
45 #include "ocs_utils.h"
46 
47 
48 /* ocs_scsi_rcv_cmd() ocs_scsi_rcv_tmf() flags */
49 #define OCS_SCSI_CMD_DIR_IN		(1U << 0)
50 #define OCS_SCSI_CMD_DIR_OUT		(1U << 1)
51 #define OCS_SCSI_CMD_SIMPLE		(1U << 2)
52 #define OCS_SCSI_CMD_HEAD_OF_QUEUE	(1U << 3)
53 #define OCS_SCSI_CMD_ORDERED		(1U << 4)
54 #define OCS_SCSI_CMD_UNTAGGED		(1U << 5)
55 #define OCS_SCSI_CMD_ACA		(1U << 6)
56 #define OCS_SCSI_FIRST_BURST_ERR	(1U << 7)
57 #define OCS_SCSI_FIRST_BURST_ABORTED	(1U << 8)
58 
59 /* ocs_scsi_send_rd_data/recv_wr_data/send_resp flags */
60 #define OCS_SCSI_LAST_DATAPHASE		(1U << 0)
61 #define OCS_SCSI_NO_AUTO_RESPONSE	(1U << 1)
62 #define OCS_SCSI_LOW_LATENCY		(1U << 2)
63 
64 #define OCS_SCSI_WQ_STEERING_SHIFT	(16)
65 #define OCS_SCSI_WQ_STEERING_MASK	(0xf << OCS_SCSI_WQ_STEERING_SHIFT)
66 #define OCS_SCSI_WQ_STEERING_CLASS	(0 << OCS_SCSI_WQ_STEERING_SHIFT)
67 #define OCS_SCSI_WQ_STEERING_REQUEST	(1 << OCS_SCSI_WQ_STEERING_SHIFT)
68 #define OCS_SCSI_WQ_STEERING_CPU	(2 << OCS_SCSI_WQ_STEERING_SHIFT)
69 
70 #define OCS_SCSI_WQ_CLASS_SHIFT		(20)
71 #define OCS_SCSI_WQ_CLASS_MASK		(0xf << OCS_SCSI_WQ_CLASS_SHIFT)
72 #define OCS_SCSI_WQ_CLASS(x)		((x & OCS_SCSI_WQ_CLASS_MASK) << OCS_SCSI_WQ_CLASS_SHIFT)
73 
74 #define OCS_SCSI_WQ_CLASS_LOW_LATENCY	(1)
75 
76 /*!
77  * @defgroup scsi_api_base SCSI Base Target/Initiator
78  * @defgroup scsi_api_target SCSI Target
79  * @defgroup scsi_api_initiator SCSI Initiator
80  */
81 
82 /**
83  * @brief SCSI command response.
84  *
85  * This structure is used by target-servers to specify SCSI status and
86  * sense data.  In this case all but the @b residual element are used. For
87  * initiator-clients, this structure is used by the SCSI API to convey the
88  * response data for issued commands, including the residual element.
89  */
90 typedef struct {
91 	uint8_t scsi_status;			/**< SCSI status */
92 	uint16_t scsi_status_qualifier;		/**< SCSI status qualifier */
93 	uint8_t *response_data;			/**< pointer to response data buffer */
94 	uint32_t response_data_length;		/**< length of response data buffer (bytes) */
95 	uint8_t *sense_data;			/**< pointer to sense data buffer */
96 	uint32_t sense_data_length;		/**< length of sense data buffer (bytes) */
97 	int32_t residual;			/**< command residual (not used for target), positive value
98 						  *  indicates an underflow, negative value indicates overflow
99 						  */
100 	uint32_t response_wire_length;		/**< Command response length received in wcqe */
101 } ocs_scsi_cmd_resp_t;
102 
103 /* Status values returned by IO callbacks */
104 typedef enum {
105 	OCS_SCSI_STATUS_GOOD = 0,
106 	OCS_SCSI_STATUS_ABORTED,
107 	OCS_SCSI_STATUS_ERROR,
108 	OCS_SCSI_STATUS_DIF_GUARD_ERROR,
109 	OCS_SCSI_STATUS_DIF_REF_TAG_ERROR,
110 	OCS_SCSI_STATUS_DIF_APP_TAG_ERROR,
111 	OCS_SCSI_STATUS_DIF_UNKNOWN_ERROR,
112 	OCS_SCSI_STATUS_PROTOCOL_CRC_ERROR,
113 	OCS_SCSI_STATUS_NO_IO,
114 	OCS_SCSI_STATUS_ABORT_IN_PROGRESS,
115 	OCS_SCSI_STATUS_CHECK_RESPONSE,
116 	OCS_SCSI_STATUS_COMMAND_TIMEOUT,
117 	OCS_SCSI_STATUS_TIMEDOUT_AND_ABORTED,
118 	OCS_SCSI_STATUS_SHUTDOWN,
119 	OCS_SCSI_STATUS_NEXUS_LOST,
120 
121 } ocs_scsi_io_status_e;
122 
123 /* SCSI command status */
124 #define SCSI_STATUS_GOOD				0x00
125 #define SCSI_STATUS_CHECK_CONDITION			0x02
126 #define SCSI_STATUS_CONDITION_MET			0x04
127 #define SCSI_STATUS_BUSY				0x08
128 #define SCSI_STATUS_RESERVATION_CONFLICT		0x18
129 #define SCSI_STATUS_TASK_SET_FULL			0x28
130 #define SCSI_STATUS_ACA_ACTIVE				0x30
131 #define SCSI_STATUS_TASK_ABORTED			0x40
132 
133 
134 
135 /* Callback used by send_rd_data(), recv_wr_data(), send_resp() */
136 typedef int32_t (*ocs_scsi_io_cb_t)(ocs_io_t *io, ocs_scsi_io_status_e status, uint32_t flags,
137 	void *arg);
138 
139 /* Callback used by send_rd_io(), send_wr_io() */
140 typedef int32_t (*ocs_scsi_rsp_io_cb_t)(ocs_io_t *io, ocs_scsi_io_status_e status, ocs_scsi_cmd_resp_t *rsp,
141 	uint32_t flags, void *arg);
142 
143 /* ocs_scsi_cb_t flags */
144 #define OCS_SCSI_IO_CMPL		(1U << 0)	/* IO completed */
145 #define OCS_SCSI_IO_CMPL_RSP_SENT	(1U << 1)	/* IO completed, response sent */
146 #define OCS_SCSI_IO_ABORTED		(1U << 2)	/* IO was aborted */
147 
148 /* ocs_scsi_recv_tmf() request values */
149 typedef enum {
150 	OCS_SCSI_TMF_ABORT_TASK = 1,
151 	OCS_SCSI_TMF_QUERY_TASK_SET,
152 	OCS_SCSI_TMF_ABORT_TASK_SET,
153 	OCS_SCSI_TMF_CLEAR_TASK_SET,
154 	OCS_SCSI_TMF_QUERY_ASYNCHRONOUS_EVENT,
155 	OCS_SCSI_TMF_LOGICAL_UNIT_RESET,
156 	OCS_SCSI_TMF_CLEAR_ACA,
157 	OCS_SCSI_TMF_TARGET_RESET,
158 } ocs_scsi_tmf_cmd_e;
159 
160 /* ocs_scsi_send_tmf_resp() response values */
161 typedef enum {
162 	OCS_SCSI_TMF_FUNCTION_COMPLETE = 1,
163 	OCS_SCSI_TMF_FUNCTION_SUCCEEDED,
164 	OCS_SCSI_TMF_FUNCTION_IO_NOT_FOUND,
165 	OCS_SCSI_TMF_FUNCTION_REJECTED,
166 	OCS_SCSI_TMF_INCORRECT_LOGICAL_UNIT_NUMBER,
167 	OCS_SCSI_TMF_SERVICE_DELIVERY,
168 } ocs_scsi_tmf_resp_e;
169 
170 /**
171  * @brief property names for ocs_scsi_get_property() functions
172  */
173 
174 typedef enum {
175 	OCS_SCSI_MAX_SGE,
176 	OCS_SCSI_MAX_SGL,
177 	OCS_SCSI_WWNN,
178 	OCS_SCSI_WWPN,
179 	OCS_SCSI_SERIALNUMBER,
180 	OCS_SCSI_PARTNUMBER,
181 	OCS_SCSI_PORTNUM,
182 	OCS_SCSI_BIOS_VERSION_STRING,
183 	OCS_SCSI_MAX_IOS,
184 	OCS_SCSI_DIF_CAPABLE,
185 	OCS_SCSI_DIF_MULTI_SEPARATE,
186 	OCS_SCSI_MAX_FIRST_BURST,
187 	OCS_SCSI_ENABLE_TASK_SET_FULL,
188 } ocs_scsi_property_e;
189 
190 #define DIF_SIZE		8
191 
192 /**
193  * @brief T10 DIF operations
194  *
195  *	WARNING: do not reorder or insert to this list without making appropriate changes in ocs_dif.c
196  */
197 typedef enum {
198 	OCS_SCSI_DIF_OPER_DISABLED,
199 	OCS_SCSI_DIF_OPER_IN_NODIF_OUT_CRC,
200 	OCS_SCSI_DIF_OPER_IN_CRC_OUT_NODIF,
201 	OCS_SCSI_DIF_OPER_IN_NODIF_OUT_CHKSUM,
202 	OCS_SCSI_DIF_OPER_IN_CHKSUM_OUT_NODIF,
203 	OCS_SCSI_DIF_OPER_IN_CRC_OUT_CRC,
204 	OCS_SCSI_DIF_OPER_IN_CHKSUM_OUT_CHKSUM,
205 	OCS_SCSI_DIF_OPER_IN_CRC_OUT_CHKSUM,
206 	OCS_SCSI_DIF_OPER_IN_CHKSUM_OUT_CRC,
207 	OCS_SCSI_DIF_OPER_IN_RAW_OUT_RAW,
208 } ocs_scsi_dif_oper_e;
209 #define OCS_SCSI_DIF_OPER_PASS_THRU	OCS_SCSI_DIF_OPER_IN_CRC_OUT_CRC
210 #define OCS_SCSI_DIF_OPER_STRIP		OCS_SCSI_DIF_OPER_IN_CRC_OUT_NODIF
211 #define OCS_SCSI_DIF_OPER_INSERT	OCS_SCSI_DIF_OPER_IN_NODIF_OUT_CRC
212 
213 /**
214  * @brief T10 DIF block sizes
215  */
216 typedef enum {
217 	OCS_SCSI_DIF_BK_SIZE_512,
218 	OCS_SCSI_DIF_BK_SIZE_1024,
219 	OCS_SCSI_DIF_BK_SIZE_2048,
220 	OCS_SCSI_DIF_BK_SIZE_4096,
221 	OCS_SCSI_DIF_BK_SIZE_520,
222 	OCS_SCSI_DIF_BK_SIZE_4104
223 } ocs_scsi_dif_blk_size_e;
224 
225 /**
226  * @brief generic scatter-gather list structure
227  */
228 
229 typedef struct ocs_scsi_sgl_s {
230 	uintptr_t	addr;			/**< physical address */
231 	uintptr_t	dif_addr;		/**< address of DIF segment, zero if DIF is interleaved */
232 	size_t		len;			/**< length */
233 } ocs_scsi_sgl_t;
234 
235 
236 /**
237  * @brief T10 DIF information passed to the transport
238  */
239 
240 typedef struct ocs_scsi_dif_info_s {
241 	ocs_scsi_dif_oper_e dif_oper;
242 	ocs_scsi_dif_blk_size_e blk_size;
243 	uint32_t ref_tag;
244 	uint32_t app_tag:16,
245 		check_ref_tag:1,
246 		check_app_tag:1,
247 		check_guard:1,
248 		dif_separate:1,
249 
250 		/* If the APP TAG is 0xFFFF, disable checking the REF TAG and CRC fields */
251 		disable_app_ffff:1,
252 
253 		/* if the APP TAG is 0xFFFF and REF TAG is 0xFFFF_FFFF, disable checking the received CRC field. */
254 		disable_app_ref_ffff:1,
255 		:10;
256 	uint64_t lba;
257 } ocs_scsi_dif_info_t;
258 
259 /* Return values for calls from base driver to target-server/initiator-client */
260 #define OCS_SCSI_CALL_COMPLETE	0 /* All work is done */
261 #define OCS_SCSI_CALL_ASYNC	1 /* Work will be completed asynchronously */
262 
263 /* Calls from target/initiator to base driver */
264 
265 typedef enum {
266 	OCS_SCSI_IO_ROLE_ORIGINATOR,
267 	OCS_SCSI_IO_ROLE_RESPONDER,
268 } ocs_scsi_io_role_e;
269 
270 extern void ocs_scsi_io_alloc_enable(ocs_node_t *node);
271 extern void ocs_scsi_io_alloc_disable(ocs_node_t *node);
272 extern ocs_io_t *ocs_scsi_io_alloc(ocs_node_t *node, ocs_scsi_io_role_e role);
273 extern void ocs_scsi_io_free(ocs_io_t *io);
274 extern ocs_io_t *ocs_io_get_instance(ocs_t *ocs, uint32_t index);
275 
276 extern void ocs_scsi_register_bounce(ocs_t *ocs, void(*fctn)(void(*fctn)(void *arg), void *arg,
277 							     uint32_t s_id, uint32_t d_id, uint32_t ox_id));
278 
279 /* Calls from base driver to target-server */
280 
281 extern int32_t ocs_scsi_tgt_driver_init(void);
282 extern int32_t ocs_scsi_tgt_driver_exit(void);
283 extern int32_t ocs_scsi_tgt_io_init(ocs_io_t *io);
284 extern int32_t ocs_scsi_tgt_io_exit(ocs_io_t *io);
285 extern int32_t ocs_scsi_tgt_new_device(ocs_t *ocs);
286 extern int32_t ocs_scsi_tgt_del_device(ocs_t *ocs);
287 extern int32_t ocs_scsi_tgt_new_domain(ocs_domain_t *domain);
288 extern void ocs_scsi_tgt_del_domain(ocs_domain_t *domain);
289 extern int32_t ocs_scsi_tgt_new_sport(ocs_sport_t *sport);
290 extern void ocs_scsi_tgt_del_sport(ocs_sport_t *sport);
291 extern void ocs_scsi_sport_deleted(ocs_sport_t *sport);
292 extern int32_t ocs_scsi_validate_initiator(ocs_node_t *node);
293 extern int32_t ocs_scsi_new_initiator(ocs_node_t *node);
294 typedef enum {
295 	OCS_SCSI_INITIATOR_DELETED,
296 	OCS_SCSI_INITIATOR_MISSING,
297 } ocs_scsi_del_initiator_reason_e;
298 extern int32_t ocs_scsi_del_initiator(ocs_node_t *node, ocs_scsi_del_initiator_reason_e reason);
299 extern int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags);
300 extern int32_t ocs_scsi_recv_cmd_first_burst(ocs_io_t *io, uint64_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags,
301 	ocs_dma_t first_burst_buffers[], uint32_t first_burst_bytes);
302 extern int32_t ocs_scsi_recv_tmf(ocs_io_t *tmfio, uint64_t lun, ocs_scsi_tmf_cmd_e cmd, ocs_io_t *abortio,
303 	uint32_t flags);
304 extern ocs_sport_t *ocs_sport_get_instance(ocs_domain_t *domain, uint32_t index);
305 extern ocs_domain_t *ocs_domain_get_instance(ocs_t *ocs, uint32_t index);
306 
307 
308 /* Calls from target-server to base driver */
309 
310 extern int32_t ocs_scsi_send_rd_data(ocs_io_t *io, uint32_t flags,
311 	ocs_scsi_dif_info_t *dif_info,
312 	ocs_scsi_sgl_t *sgl, uint32_t sgl_count,
313 	uint32_t wire_len, ocs_scsi_io_cb_t cb, void *arg);
314 extern int32_t ocs_scsi_recv_wr_data(ocs_io_t *io, uint32_t flags,
315 	ocs_scsi_dif_info_t *dif_info,
316 	ocs_scsi_sgl_t *sgl, uint32_t sgl_count,
317 	uint32_t wire_len, ocs_scsi_io_cb_t cb, void *arg);
318 extern int32_t ocs_scsi_send_resp(ocs_io_t *io, uint32_t flags, ocs_scsi_cmd_resp_t *rsp,
319 		ocs_scsi_io_cb_t cb, void *arg);
320 extern int32_t ocs_scsi_send_tmf_resp(ocs_io_t *io, ocs_scsi_tmf_resp_e rspcode, uint8_t addl_rsp_info[3],
321 		ocs_scsi_io_cb_t cb, void *arg);
322 extern int32_t ocs_scsi_tgt_abort_io(ocs_io_t *io, ocs_scsi_io_cb_t cb, void *arg);
323 extern void ocs_scsi_io_complete(ocs_io_t *io);
324 extern uint32_t ocs_scsi_get_property(ocs_t *ocs, ocs_scsi_property_e prop);
325 extern void *ocs_scsi_get_property_ptr(ocs_t *ocs, ocs_scsi_property_e prop);
326 
327 extern void ocs_scsi_del_initiator_complete(ocs_node_t *node);
328 
329 extern void ocs_scsi_update_first_burst_transferred(ocs_io_t *io, uint32_t transferred);
330 
331 /* Calls from base driver to initiator-client */
332 
333 extern int32_t ocs_scsi_ini_driver_init(void);
334 extern int32_t ocs_scsi_ini_driver_exit(void);
335 extern int32_t ocs_scsi_ini_io_init(ocs_io_t *io);
336 extern int32_t ocs_scsi_ini_io_exit(ocs_io_t *io);
337 extern int32_t ocs_scsi_ini_new_device(ocs_t *ocs);
338 extern int32_t ocs_scsi_ini_del_device(ocs_t *ocs);
339 extern int32_t ocs_scsi_ini_new_domain(ocs_domain_t *domain);
340 extern void ocs_scsi_ini_del_domain(ocs_domain_t *domain);
341 extern int32_t ocs_scsi_ini_new_sport(ocs_sport_t *sport);
342 extern void ocs_scsi_ini_del_sport(ocs_sport_t *sport);
343 extern int32_t ocs_scsi_new_target(ocs_node_t *node);
344 
345 typedef enum {
346 	OCS_SCSI_TARGET_DELETED,
347 	OCS_SCSI_TARGET_MISSING,
348 } ocs_scsi_del_target_reason_e;
349 extern int32_t ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_target_reason_e reason);
350 
351 /* Calls from the initiator-client to the base driver */
352 
353 extern int32_t ocs_scsi_send_rd_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len,
354 	ocs_scsi_dif_info_t *dif_info,
355 	ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg);
356 extern int32_t ocs_scsi_send_wr_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len,
357 	ocs_scsi_dif_info_t *dif_info,
358 	ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg);
359 extern int32_t ocs_scsi_send_wr_io_first_burst(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len,
360 	ocs_scsi_dif_info_t *dif_info,
361 	ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst,
362 	ocs_scsi_rsp_io_cb_t cb, void *arg);
363 extern int32_t ocs_scsi_send_tmf(ocs_node_t *node, ocs_io_t *io, ocs_io_t *io_to_abort, uint64_t lun,
364 	ocs_scsi_tmf_cmd_e tmf, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t len, ocs_scsi_rsp_io_cb_t cb, void *arg);
365 extern int32_t ocs_scsi_send_nodata_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_rsp_io_cb_t cb, void *arg);
366 extern void ocs_scsi_del_target_complete(ocs_node_t *node);
367 
368 typedef enum {
369 	OCS_SCSI_DDUMP_DEVICE,
370 	OCS_SCSI_DDUMP_DOMAIN,
371 	OCS_SCSI_DDUMP_SPORT,
372 	OCS_SCSI_DDUMP_NODE,
373 	OCS_SCSI_DDUMP_IO,
374 } ocs_scsi_ddump_type_e;
375 
376 /* base driver to target/initiator */
377 
378 struct ocs_scsi_vaddr_len_s {
379 	void *vaddr;
380 	uint32_t length;
381 } ;
382 extern int32_t ocs_scsi_get_block_vaddr(ocs_io_t *io, uint64_t blocknumber, ocs_scsi_vaddr_len_t addrlen[],
383 	uint32_t max_addrlen, void **dif_vaddr);
384 
385 extern void ocs_scsi_ini_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj);
386 extern void ocs_scsi_tgt_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj);
387 
388 /* Calls within base driver */
389 extern int32_t ocs_scsi_io_dispatch(ocs_io_t *io, void *cb);
390 extern int32_t ocs_scsi_io_dispatch_abort(ocs_io_t *io, void *cb);
391 extern void ocs_scsi_check_pending(ocs_t *ocs);
392 
393 extern uint32_t ocs_scsi_dif_blocksize(ocs_scsi_dif_info_t *dif_info);
394 extern int32_t ocs_scsi_dif_set_blocksize(ocs_scsi_dif_info_t *dif_info, uint32_t blocksize);
395 extern int32_t ocs_scsi_dif_mem_blocksize(ocs_scsi_dif_info_t *dif_info, int wiretomem);
396 extern int32_t ocs_scsi_dif_wire_blocksize(ocs_scsi_dif_info_t *dif_info, int wiretomem);
397 
398 
399 uint32_t ocs_get_crn(ocs_node_t *node, uint8_t *crn, uint64_t lun);
400 void ocs_del_crn(ocs_node_t *node);
401 void ocs_reset_crn(ocs_node_t *node, uint64_t lun);
402 
403 /**
404  * @brief Notification from base driver that domain is in force-free path.
405  *
406  * @par Description Domain is forcefully going away.  Cleanup any resources associated with it.
407  *
408  * @param domain Pointer to domain being free'd.
409  *
410  * @return None.
411  */
412 
413 static inline void
414 ocs_scsi_notify_domain_force_free(ocs_domain_t *domain)
415 {
416 	/* Nothing to do */
417 	return;
418 }
419 
420 /**
421  * @brief Notification from base driver that sport is in force-free path.
422  *
423  * @par Description Sport is forcefully going away.  Cleanup any resources associated with it.
424  *
425  * @param sport Pointer to sport being free'd.
426  *
427  * @return None.
428  */
429 
430 static inline void
431 ocs_scsi_notify_sport_force_free(ocs_sport_t *sport)
432 {
433 	/* Nothing to do */
434 	return;
435 }
436 
437 
438 /**
439  * @brief Notification from base driver that node is in force-free path.
440  *
441  * @par Description Node is forcefully going away.  Cleanup any resources associated with it.
442  *
443  * @param node Pointer to node being free'd.
444  *
445  * @return None.
446  */
447 
448 static inline void
449 ocs_scsi_notify_node_force_free(ocs_node_t *node)
450 {
451 	/* Nothing to do */
452 	return;
453 }
454 #endif /* __OCS_SCSI_H__ */
455