/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
#ifndef _STMF_H
#define _STMF_H
#include <sys/stmf_defines.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum stmf_struct_id {
/*
* Provider callback commands
*/
/*
* Provider callback flags
*/
typedef void *data_seg_handle_t;
/*
* contexts within stmf:
* 1) supplied by the port provider that the LU provider uses to exchange
* data with the backing store.
* 2) supplied by the LU provider that the port provider uses exchange
* data with the host initiator.
* The second format is optionally supported by the port provided as
* indicated by the command task flags.
*/
typedef struct stmf_sglist_ent {
typedef struct stmf_data_buf {
void *db_stmf_private;
void *db_port_private;
void *db_lu_private;
/*
* db_flags
*/
typedef struct scsi_task {
void *task_stmf_private;
void *task_port_private;
void *task_lu_private;
/* CMD information from initiator */
/* Fields to manage data phase */
/* Status Phase */
/* Misc. task data */
void *task_extended_cmd;
} scsi_task_t;
/*
* Maximum expected transfer length. Can also be used when the transfer
* length is unknown when the task is allocated (e.g. SAS)
*/
/*
* task_flags definitions.
*/
/*
* If TF_INITIAL_BURST is set, the dbuf passed with new_task() contains
* data from initial burst. Otherwise its just a buffer which the port
* passed to the LU.
*/
/* Both READ_DATA and WRITE_DATA can be set for bidirectional xfers */
/*
* Task Management flags.
*/
/*
* additional flags
*/
/*
* PP sets this flag if it can process dbufs created by the LU.
*/
/*
* scsi_task_t extension identifiers
*/
#define STMF_TASK_EXT_NONE 0
/*
* max_nbufs
*/
/*
* Task status ctrl
*/
/*
* The flags used by I/O flow.
*/
/*
* struct allocation flags
*/
typedef struct stmf_state_change_info {
char *st_additional_info;
typedef struct stmf_change_status {
char *st_additional_info;
/*
* conditions causing or affecting the change.
*/
/*
* cmds to stmf_abort entry point
*/
/*
* cmds to be used by stmf ctl
*/
#define STMF_CMD_GET_LPORT_STATUS \
#define STMF_CMD_LU_ONLINE_COMPLETE \
#define STMF_CMD_LPORT_ONLINE_COMPLETE \
#define STMF_ACK_LU_ONLINE_COMPLETE \
#define STMF_ACK_LPORT_ONLINE_COMPLETE \
#define STMF_CMD_LU_OFFLINE_COMPLETE \
#define STMF_CMD_LPORT_OFFLINE_COMPLETE \
#define STMF_ACK_LU_OFFLINE_COMPLETE \
#define STMF_ACK_LPORT_OFFLINE_COMPLETE \
/*
* For LPORTs and LUs to create their own ctl cmds which dont
* conflict with stmf ctl cmds.
*/
/*
* Commands for various info routines.
*/
/* Command classifiers */
/* Commands for LPORT info routines */
/* XXX - Implement these. */
#if 0
#endif
/*
* Events
*/
#define LPORT_EVENT_INITIAL_LUN_MAPPED 0
/*
*/
/*
* VPD page bits.
*/
/*
* Common macros to simplify coding
*/
void stmf_free(void *struct_ptr);
int eventid);
struct scsi_devid_desc *lu_id);
struct scsi_devid_desc *lu_id);
struct scsi_devid_desc *);
struct scsi_transport_id *);
void stmf_remote_port_free(struct stmf_remote_port *);
#ifdef __cplusplus
}
#endif
#endif /* _STMF_H */