1fcf3ce44SJohn Forte /*
2fcf3ce44SJohn Forte  * CDDL HEADER START
3fcf3ce44SJohn Forte  *
4fcf3ce44SJohn Forte  * The contents of this file are subject to the terms of the
5fcf3ce44SJohn Forte  * Common Development and Distribution License (the "License").
6fcf3ce44SJohn Forte  * You may not use this file except in compliance with the License.
7fcf3ce44SJohn Forte  *
8fcf3ce44SJohn Forte  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fcf3ce44SJohn Forte  * or http://www.opensolaris.org/os/licensing.
10fcf3ce44SJohn Forte  * See the License for the specific language governing permissions
11fcf3ce44SJohn Forte  * and limitations under the License.
12fcf3ce44SJohn Forte  *
13fcf3ce44SJohn Forte  * When distributing Covered Code, include this CDDL HEADER in each
14fcf3ce44SJohn Forte  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fcf3ce44SJohn Forte  * If applicable, add the following below this CDDL HEADER, with the
16fcf3ce44SJohn Forte  * fields enclosed by brackets "[]" replaced with your own identifying
17fcf3ce44SJohn Forte  * information: Portions Copyright [yyyy] [name of copyright owner]
18fcf3ce44SJohn Forte  *
19fcf3ce44SJohn Forte  * CDDL HEADER END
20fcf3ce44SJohn Forte  */
21fcf3ce44SJohn Forte /*
22309bed43SCharles Binford - Sun Microsystems - Wichita  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
236140ef00SDan McDonald  *
24*61dfa509SRick McNeal  * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
25fcf3ce44SJohn Forte  */
26fcf3ce44SJohn Forte 
27fcf3ce44SJohn Forte #ifndef	_SBD_IMPL_H
28fcf3ce44SJohn Forte #define	_SBD_IMPL_H
29fcf3ce44SJohn Forte 
30fcf3ce44SJohn Forte #ifdef	__cplusplus
31fcf3ce44SJohn Forte extern "C" {
32fcf3ce44SJohn Forte #endif
33fcf3ce44SJohn Forte 
34fcf3ce44SJohn Forte struct register_lu_cmd;
35fcf3ce44SJohn Forte struct modify_lu_cmd;
36fcf3ce44SJohn Forte struct sbd_lu_attr;
37fcf3ce44SJohn Forte struct sbd_it_data;
38fcf3ce44SJohn Forte 
39*61dfa509SRick McNeal #define	ATOMIC8_GET(val) (		\
40*61dfa509SRick McNeal 			(atomic_add_8_nv(&(val), 0)))
41*61dfa509SRick McNeal #define	ATOMIC32_GET(val) (		\
42*61dfa509SRick McNeal 			(atomic_add_32_nv(&(val), 0)))
43*61dfa509SRick McNeal 
44fcf3ce44SJohn Forte /*
45fcf3ce44SJohn Forte  * sms endianess
46fcf3ce44SJohn Forte  */
47fcf3ce44SJohn Forte #define	SMS_BIG_ENDIAN			0x00
48fcf3ce44SJohn Forte #define	SMS_LITTLE_ENDIAN		0xFF
49fcf3ce44SJohn Forte 
50fcf3ce44SJohn Forte #ifdef	_BIG_ENDIAN
51fcf3ce44SJohn Forte #define	SMS_DATA_ORDER	SMS_BIG_ENDIAN
52fcf3ce44SJohn Forte #else
53fcf3ce44SJohn Forte #define	SMS_DATA_ORDER	SMS_LITTLE_ENDIAN
54fcf3ce44SJohn Forte #endif
55fcf3ce44SJohn Forte 
568fe96085Stim szeto /* Test if one of the BitOrder definitions exists */
578fe96085Stim szeto #ifdef _BIT_FIELDS_LTOH
588fe96085Stim szeto #elif defined(_BIT_FIELDS_HTOL)
598fe96085Stim szeto #else
608fe96085Stim szeto #error  One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
618fe96085Stim szeto #endif
628fe96085Stim szeto 
63fcf3ce44SJohn Forte #define	SBD_V0_MAGIC	0x53554e4d4943524f
64fcf3ce44SJohn Forte #define	SBD_MAGIC	0x53554e5342444c55
65fcf3ce44SJohn Forte 
66fcf3ce44SJohn Forte typedef struct sbd_v0_meta_start {
67fcf3ce44SJohn Forte 	uint64_t		sm_magic;	/* SBD_MAGIC */
68fcf3ce44SJohn Forte 	uint64_t		sm_meta_size;	/* Includes everything */
69fcf3ce44SJohn Forte } sbd_v0_meta_start_t;
70fcf3ce44SJohn Forte 
71fcf3ce44SJohn Forte typedef struct sbd_meta_start {
72fcf3ce44SJohn Forte 	uint64_t		sm_magic;
73fcf3ce44SJohn Forte 	uint64_t		sm_meta_size;
74fcf3ce44SJohn Forte 	uint64_t		sm_meta_size_used;
75fcf3ce44SJohn Forte 	uint64_t		sm_rsvd1;	/* Defaults to zero */
76fcf3ce44SJohn Forte 	uint64_t		sm_rsvd2;
77fcf3ce44SJohn Forte 	uint16_t		sm_ver_major;
78fcf3ce44SJohn Forte 	uint16_t		sm_ver_minor;
79fcf3ce44SJohn Forte 	uint16_t		sm_ver_subminor;
80fcf3ce44SJohn Forte 	uint8_t			sm_flags;	/* None at this moment */
81fcf3ce44SJohn Forte 	uint8_t			sm_chksum;
82fcf3ce44SJohn Forte } sbd_meta_start_t;
83fcf3ce44SJohn Forte 
84fcf3ce44SJohn Forte typedef struct sm_v0_section_hdr {
85fcf3ce44SJohn Forte 	uint64_t	sms_offset;	/* Offset of this section */
86fcf3ce44SJohn Forte 	uint64_t	sms_size;	/* Includes the header and padding */
87fcf3ce44SJohn Forte 	uint16_t	sms_id;		/* Section identifier */
88fcf3ce44SJohn Forte 	uint16_t	sms_padding;	/* For alignment */
89fcf3ce44SJohn Forte 	uint32_t	sms_seqno;	/* For multiple sections with same ID */
90fcf3ce44SJohn Forte 	uint8_t		sms_hdr_data_order; /* 0x00 or 0xff */
91fcf3ce44SJohn Forte 	uint8_t		sms_payload_data_order;
92fcf3ce44SJohn Forte 	uint16_t	rsvd2;
93fcf3ce44SJohn Forte 	uint32_t	rsvd3;		/* 8 byte align */
94fcf3ce44SJohn Forte } sm_v0_section_hdr_t;
95fcf3ce44SJohn Forte 
968fe96085Stim szeto /*
978fe96085Stim szeto  * sbd_it_flags
988fe96085Stim szeto  */
998fe96085Stim szeto #define	SBD_IT_HAS_SCSI2_RESERVATION	0x0001
1008fe96085Stim szeto #define	SBD_IT_PGR_REGISTERED		0x0002
1018fe96085Stim szeto #define	SBD_IT_PGR_EXCLUSIVE_RSV_HOLDER	0x0004
1028fe96085Stim szeto #define	SBD_IT_PGR_CHECK_FLAG		0x0008
1038fe96085Stim szeto 
1048fe96085Stim szeto /*
1058fe96085Stim szeto  * PGR flags
1068fe96085Stim szeto  */
1078fe96085Stim szeto #define	SBD_PGR_APTPL			0x01
1088fe96085Stim szeto #define	SBD_PGR_RSVD_ONE		0x02
1098fe96085Stim szeto #define	SBD_PGR_RSVD_ALL_REGISTRANTS	0x04
1108fe96085Stim szeto #define	SBD_PGR_ALL_KEYS_HAS_IT		0x08
1118fe96085Stim szeto 
1128fe96085Stim szeto #define	SBD_PGR_RSVD(pgr)	(((pgr)->pgr_flags) & (SBD_PGR_RSVD_ONE | \
1138fe96085Stim szeto 					SBD_PGR_RSVD_ALL_REGISTRANTS))
1148fe96085Stim szeto #define	SBD_PGR_RSVD_NONE(pgr)	(!(SBD_PGR_RSVD(pgr)))
115fcf3ce44SJohn Forte 
116fcf3ce44SJohn Forte /*
1178fe96085Stim szeto  * PGR key flags
118fcf3ce44SJohn Forte  */
1198fe96085Stim szeto #define	SBD_PGR_KEY_ALL_TG_PT		0x01
120716c1805SNattuvetty Bhavyan #define	SBD_PGR_KEY_TPT_ID_FLAG		0x02
1218fe96085Stim szeto 
1228fe96085Stim szeto typedef struct sbd_pgr_key_info {
1238fe96085Stim szeto 	uint64_t	pgr_key;
1248fe96085Stim szeto 	uint16_t	pgr_key_lpt_len;
1258fe96085Stim szeto 	uint16_t	pgr_key_rpt_len;
1268fe96085Stim szeto 	uint8_t		pgr_key_flags;
127716c1805SNattuvetty Bhavyan 	uint8_t		pgr_key_it[1];	/* order:- initiator info followed by */
128716c1805SNattuvetty Bhavyan 					/* scsi_devid_desc of local port */
1298fe96085Stim szeto } sbd_pgr_key_info_t;
1308fe96085Stim szeto 
1318fe96085Stim szeto typedef struct sbd_pgr_info {
1328fe96085Stim szeto 	sm_section_hdr_t	pgr_sms_header;
1338fe96085Stim szeto 	uint32_t		pgr_rsvholder_indx;
1348fe96085Stim szeto 	uint32_t		pgr_numkeys;
1358fe96085Stim szeto 	uint8_t			pgr_flags;
1368fe96085Stim szeto 	uint8_t			pgr_data_order;
1378fe96085Stim szeto #ifdef _BIT_FIELDS_LTOH
1388fe96085Stim szeto 	uint8_t			pgr_rsv_type:4,
1398fe96085Stim szeto 				pgr_rsv_scope:4;
1408fe96085Stim szeto #else
1418fe96085Stim szeto 	uint8_t			pgr_rsv_scope:4,
1428fe96085Stim szeto 				pgr_rsv_type:4;
1438fe96085Stim szeto #endif
1448fe96085Stim szeto 	uint8_t			rsvd[5];	/* 8 byte boundary */
1458fe96085Stim szeto 
1468fe96085Stim szeto } sbd_pgr_info_t;
1478fe96085Stim szeto 
1488fe96085Stim szeto typedef struct sbd_pgr_key {
1498fe96085Stim szeto 	uint64_t		pgr_key;
1508fe96085Stim szeto 	uint16_t		pgr_key_lpt_len;
1518fe96085Stim szeto 	uint16_t		pgr_key_rpt_len;
1528fe96085Stim szeto 	uint8_t			pgr_key_flags;
1538fe96085Stim szeto 	struct scsi_devid_desc	*pgr_key_lpt_id;
154716c1805SNattuvetty Bhavyan 	struct scsi_transport_id *pgr_key_rpt_id;
1558fe96085Stim szeto 	struct sbd_it_data	*pgr_key_it;
1568fe96085Stim szeto 	struct sbd_pgr_key	*pgr_key_next;
1578fe96085Stim szeto 	struct sbd_pgr_key	*pgr_key_prev;
1588fe96085Stim szeto } sbd_pgr_key_t;
1598fe96085Stim szeto 
1608fe96085Stim szeto typedef struct sbd_pgr {
1618fe96085Stim szeto 	sbd_pgr_key_t		*pgr_keylist;
1628fe96085Stim szeto 	sbd_pgr_key_t		*pgr_rsvholder;
1638fe96085Stim szeto 	uint32_t		pgr_PRgeneration; /* PGR PRgeneration value */
1648fe96085Stim szeto 	uint8_t			pgr_flags;	/* PGR flags (eg: APTPL)  */
1658fe96085Stim szeto 	uint8_t			pgr_rsv_type:4,
1668fe96085Stim szeto 				pgr_rsv_scope:4;
1678fe96085Stim szeto 	krwlock_t		pgr_lock; /* Lock order pgr_lock, sl_lock */
1688fe96085Stim szeto } sbd_pgr_t;
1698fe96085Stim szeto 
170fcf3ce44SJohn Forte 
171fcf3ce44SJohn Forte typedef struct sbd_v0_lu_info {
172fcf3ce44SJohn Forte 	sm_v0_section_hdr_t	sli_sms_header;
173fcf3ce44SJohn Forte 	uint64_t		sli_total_store_size;
174fcf3ce44SJohn Forte 	uint64_t		sli_total_meta_size;
175fcf3ce44SJohn Forte 	uint64_t		rsvd0;
176fcf3ce44SJohn Forte 	uint64_t		sli_lu_data_offset;
177fcf3ce44SJohn Forte 	uint64_t		sli_lu_data_size;
178fcf3ce44SJohn Forte 	uint64_t		rsvd1;
179fcf3ce44SJohn Forte 	uint32_t		sli_flags;
180fcf3ce44SJohn Forte 	uint16_t		sli_blocksize;
181fcf3ce44SJohn Forte 	uint16_t		rsvd2;
182fcf3ce44SJohn Forte 	uint8_t			sli_lu_devid[20];
183fcf3ce44SJohn Forte 	uint32_t		rsvd3;
184fcf3ce44SJohn Forte } sbd_v0_lu_info_t;
185fcf3ce44SJohn Forte 
186fcf3ce44SJohn Forte typedef struct sbd_lu_info {
187fcf3ce44SJohn Forte 	sm_section_hdr_t	sli_sms_header;
188fcf3ce44SJohn Forte 	uint64_t		sli_total_store_size;
189fcf3ce44SJohn Forte 	uint64_t		sli_total_meta_size;
190fcf3ce44SJohn Forte 	uint64_t		sli_lu_data_offset;
191fcf3ce44SJohn Forte 	uint64_t		sli_lu_data_size;
192fcf3ce44SJohn Forte 	uint32_t		sli_flags;
193fcf3ce44SJohn Forte 	uint16_t		sli_blocksize;
194fcf3ce44SJohn Forte 	uint8_t			sli_data_order;
195fcf3ce44SJohn Forte 	uint8_t			rsvd1;
196fcf3ce44SJohn Forte 	uint8_t			sli_lu_devid[20];
197fcf3ce44SJohn Forte 	uint32_t		rsvd2;
198fcf3ce44SJohn Forte } sbd_lu_info_t;
199fcf3ce44SJohn Forte 
200fcf3ce44SJohn Forte /*
201fcf3ce44SJohn Forte  * sl_flags
202fcf3ce44SJohn Forte  */
203fcf3ce44SJohn Forte #define	SBD_LU_HAS_SCSI2_RESERVATION	0x0001
204fcf3ce44SJohn Forte 
205fcf3ce44SJohn Forte typedef struct sbd_cmd {
206fcf3ce44SJohn Forte 	uint8_t		flags;
207fcf3ce44SJohn Forte 	uint8_t		nbufs;
208fcf3ce44SJohn Forte 	uint16_t	cmd_type;	/* Type of command */
2096140ef00SDan McDonald 	uint32_t	trans_data_len;	/* Length of transient data buf */
210fcf3ce44SJohn Forte 	uint64_t	addr;		/* current */
211fcf3ce44SJohn Forte 	uint32_t	len;		/* len left */
212fcf3ce44SJohn Forte 	uint32_t	current_ro;	/* running relative offset */
2136140ef00SDan McDonald 	uint8_t		*trans_data;	/* Any transient data */
214*61dfa509SRick McNeal 	ats_state_t	*ats_state;
215*61dfa509SRick McNeal 	uint32_t	rsvd;
216fcf3ce44SJohn Forte } sbd_cmd_t;
217fcf3ce44SJohn Forte 
218fcf3ce44SJohn Forte /*
219fcf3ce44SJohn Forte  * flags for sbd_cmd
220*61dfa509SRick McNeal  *
221*61dfa509SRick McNeal  * SBD_SCSI_CMD_ACTIVE means that a command is running.  This is the time
222*61dfa509SRick McNeal  *      between the function sbd_new_task is called and either the command
223*61dfa509SRick McNeal  *      completion is sent (stmf_scsilib_send_status) or an abort is
224*61dfa509SRick McNeal  *      issued
225*61dfa509SRick McNeal  *
226*61dfa509SRick McNeal  * SBD_SCSI_CMD_ABORT_REQUESTED is when a command is being aborted.  It may
227*61dfa509SRick McNeal  *      be set prior to the task being dispatched or anywhere in the process
228*61dfa509SRick McNeal  *      of the command.
229*61dfa509SRick McNeal  *
230*61dfa509SRick McNeal  * SBD_SCSI_CMD_XFER_FAIL is set when a command data buffer transfer was
231*61dfa509SRick McNeal  *      errored.  Usually it leads to an abort.
232*61dfa509SRick McNeal  *
233*61dfa509SRick McNeal  * SBD_SCSI_CMD_SYNC_WRITE synchronous write being done.
234*61dfa509SRick McNeal  *
235*61dfa509SRick McNeal  * SBD_SCSI_CMD_TRANS_DATA means that a buffer has been allocated to
236*61dfa509SRick McNeal  *      be used for the transfer of data.
237fcf3ce44SJohn Forte  */
238fcf3ce44SJohn Forte #define	SBD_SCSI_CMD_ACTIVE		0x01
239fcf3ce44SJohn Forte #define	SBD_SCSI_CMD_ABORT_REQUESTED	0x02
240fcf3ce44SJohn Forte #define	SBD_SCSI_CMD_XFER_FAIL		0x04
241309bed43SCharles Binford - Sun Microsystems - Wichita #define	SBD_SCSI_CMD_SYNC_WRITE		0x08
2426140ef00SDan McDonald #define	SBD_SCSI_CMD_TRANS_DATA		0x10
243*61dfa509SRick McNeal #define	SBD_SCSI_CMD_ATS_RELATED	0x20
244fcf3ce44SJohn Forte 
245fcf3ce44SJohn Forte /*
246fcf3ce44SJohn Forte  * cmd types
247fcf3ce44SJohn Forte  */
248fcf3ce44SJohn Forte #define	SBD_CMD_SCSI_READ	0x01
249fcf3ce44SJohn Forte #define	SBD_CMD_SCSI_WRITE	0x02
250fcf3ce44SJohn Forte #define	SBD_CMD_SMALL_READ	0x03
251fcf3ce44SJohn Forte #define	SBD_CMD_SMALL_WRITE	0x04
2528fe96085Stim szeto #define	SBD_CMD_SCSI_PR_OUT	0x05
253fcf3ce44SJohn Forte 
254fcf3ce44SJohn Forte typedef struct sbd_it_data {
255fcf3ce44SJohn Forte 	struct sbd_it_data	*sbd_it_next;
256fcf3ce44SJohn Forte 	uint64_t		sbd_it_session_id;
257fcf3ce44SJohn Forte 	uint8_t			sbd_it_lun[8];
258fcf3ce44SJohn Forte 	uint8_t			sbd_it_ua_conditions;
259fcf3ce44SJohn Forte 	uint8_t			sbd_it_flags;
2608fe96085Stim szeto 	sbd_pgr_key_t		*pgr_key_ptr;
261fcf3ce44SJohn Forte } sbd_it_data_t;
262fcf3ce44SJohn Forte 
26345039663SJohn Forte typedef struct sbd_create_standby_lu {
26445039663SJohn Forte 	uint32_t	stlu_meta_fname_size;
26545039663SJohn Forte 	uint32_t	stlu_rsvd;
26645039663SJohn Forte 	uint8_t		stlu_guid[16];
26745039663SJohn Forte 	char		stlu_meta_fname[8];
26845039663SJohn Forte } sbd_create_standby_lu_t;
26945039663SJohn Forte 
270fcf3ce44SJohn Forte /*
271fcf3ce44SJohn Forte  * Different UA conditions
272fcf3ce44SJohn Forte  */
27345039663SJohn Forte #define	SBD_UA_POR			    0x01
27445039663SJohn Forte #define	SBD_UA_CAPACITY_CHANGED		    0x02
27545039663SJohn Forte #define	SBD_UA_MODE_PARAMETERS_CHANGED	    0x04
27645039663SJohn Forte #define	SBD_UA_ACCESS_STATE_TRANSITION	    0x08
27745039663SJohn Forte #define	SBD_UA_REGISTRATIONS_PREEMPTED	    0x10
27845039663SJohn Forte #define	SBD_UA_RESERVATIONS_PREEMPTED	    0x20
27945039663SJohn Forte #define	SBD_UA_RESERVATIONS_RELEASED	    0x40
28045039663SJohn Forte #define	SBD_UA_ASYMMETRIC_ACCESS_CHANGED    0x80
281fcf3ce44SJohn Forte 
282fcf3ce44SJohn Forte /*
283fcf3ce44SJohn Forte  * sbd_it_flags
284fcf3ce44SJohn Forte  */
2858fe96085Stim szeto #define	SBD_IT_HAS_SCSI2_RESERVATION	0x0001
286fcf3ce44SJohn Forte 
2873fb517f7SJames Moore /*
2883fb517f7SJames Moore  * dbuf private data needed for direct zvol data transfers
2893fb517f7SJames Moore  *
2903fb517f7SJames Moore  * To further isolate the zvol knowledge, the object handles
2913fb517f7SJames Moore  * needed to call into zfs are declared void * here.
2923fb517f7SJames Moore  */
2933fb517f7SJames Moore 
2943fb517f7SJames Moore typedef struct sbd_zvol_io {
2953fb517f7SJames Moore 	uint64_t	zvio_offset;	/* offset into volume */
2963fb517f7SJames Moore 	int		zvio_flags;	/* flags */
297*61dfa509SRick McNeal 	void		*zvio_dbp;	/* array of dmu buffers */
2983fb517f7SJames Moore 	void		*zvio_abp;	/* array of arc buffers */
2993fb517f7SJames Moore 	uio_t		*zvio_uio;	/* for copy operations */
3003fb517f7SJames Moore } sbd_zvol_io_t;
3013fb517f7SJames Moore 
3023fb517f7SJames Moore #define	ZVIO_DEFAULT	0
3033fb517f7SJames Moore #define	ZVIO_COMMIT	1
3043fb517f7SJames Moore #define	ZVIO_ABORT	2
3053fb517f7SJames Moore #define	ZVIO_SYNC	4
3063fb517f7SJames Moore #define	ZVIO_ASYNC	8
3073fb517f7SJames Moore 
3083fb517f7SJames Moore /*
3093fb517f7SJames Moore  * zvol data path functions
3103fb517f7SJames Moore  */
3113fb517f7SJames Moore int sbd_zvol_get_volume_params(sbd_lu_t *sl);
3123fb517f7SJames Moore uint32_t sbd_zvol_numsegs(sbd_lu_t *sl, uint64_t off, uint32_t len);
3133fb517f7SJames Moore int sbd_zvol_alloc_read_bufs(sbd_lu_t *sl, stmf_data_buf_t *dbuf);
3143fb517f7SJames Moore void sbd_zvol_rele_read_bufs(sbd_lu_t *sl, stmf_data_buf_t *dbuf);
3153fb517f7SJames Moore int sbd_zvol_alloc_write_bufs(sbd_lu_t *sl, stmf_data_buf_t *dbuf);
3163fb517f7SJames Moore void sbd_zvol_rele_write_bufs_abort(sbd_lu_t *sl, stmf_data_buf_t *dbuf);
3173fb517f7SJames Moore int sbd_zvol_rele_write_bufs(sbd_lu_t *sl, stmf_data_buf_t *dbuf);
3183fb517f7SJames Moore int sbd_zvol_copy_read(sbd_lu_t *sl, uio_t *uio);
3193fb517f7SJames Moore int sbd_zvol_copy_write(sbd_lu_t *sl, uio_t *uio, int flags);
3203fb517f7SJames Moore 
321fcf3ce44SJohn Forte stmf_status_t sbd_task_alloc(struct scsi_task *task);
322fcf3ce44SJohn Forte void sbd_new_task(struct scsi_task *task, struct stmf_data_buf *initial_dbuf);
323fcf3ce44SJohn Forte void sbd_dbuf_xfer_done(struct scsi_task *task, struct stmf_data_buf *dbuf);
324fcf3ce44SJohn Forte void sbd_send_status_done(struct scsi_task *task);
325fcf3ce44SJohn Forte void sbd_task_free(struct scsi_task *task);
326fcf3ce44SJohn Forte stmf_status_t sbd_abort(struct stmf_lu *lu, int abort_cmd, void *arg,
327fcf3ce44SJohn Forte 							uint32_t flags);
328*61dfa509SRick McNeal void sbd_task_poll(struct scsi_task *task);
3293fb517f7SJames Moore void sbd_dbuf_free(struct scsi_task *task, struct stmf_data_buf *dbuf);
330fcf3ce44SJohn Forte void sbd_ctl(struct stmf_lu *lu, int cmd, void *arg);
331fcf3ce44SJohn Forte stmf_status_t sbd_info(uint32_t cmd, stmf_lu_t *lu, void *arg,
332fcf3ce44SJohn Forte 				uint8_t *buf, uint32_t *bufsizep);
333*61dfa509SRick McNeal uint8_t sbd_get_lbasize_shift(stmf_lu_t *lu);
334*61dfa509SRick McNeal int sbd_is_valid_lu(stmf_lu_t *lu);
335fcf3ce44SJohn Forte 
336fcf3ce44SJohn Forte #ifdef	__cplusplus
337fcf3ce44SJohn Forte }
338fcf3ce44SJohn Forte #endif
339fcf3ce44SJohn Forte 
340fcf3ce44SJohn Forte #endif /* _SBD_IMPL_H */
341