pppt.h revision 450396635f70344c58b6b1e4db38cf17ff34445c
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PPPT_H
#define _PPPT_H
#include <sys/pppt_ic_if.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int pppt_logging;
#define TGT_DEREG_RETRY_SECONDS 1
typedef enum {
PPPT_STATUS_SUCCESS = 0,
#define PPPT_MODNAME "pppt"
/* Target states and events, update pppt_ts_name table whenever modified */
typedef enum {
TS_UNDEFINED = 0,
#ifdef PPPT_TGT_SM_STRINGS
"TS_UNDEFINED",
"TS_CREATED",
"TS_ONLINING",
"TS_ONLINE",
"TS_STMF_ONLINE",
"TS_DELETING_NEED_OFFLINE",
"TS_OFFLINING",
"TS_OFFLINE",
"TS_STMF_OFFLINE",
"TS_DELETING_STMF_DEREG",
"TS_DELETING_STMF_DEREG_FAIL",
"TS_DELETING",
"TS_MAX_STATE"
};
#endif
typedef enum {
TE_UNDEFINED = 0,
TE_WAIT_REF_COMPLETE, /* XXX */
#ifdef PPPT_TGT_SM_STRINGS
"TE_UNDEFINED",
"TE_STMF_ONLINE_REQ",
"TE_ONLINE_SUCCESS",
"TE_ONLINE_FAIL",
"TE_STMF_ONLINE_COMPLETE_ACK",
"TE_STMF_OFFLINE_REQ",
"TE_OFFLINE_COMPLETE",
"TE_STMF_OFFLINE_COMPLETE_ACK",
"TE_DELETE",
"TE_STMF_DEREG_SUCCESS",
"TE_STMF_DEREG_FAIL",
"TE_STMF_DEREG_RETRY",
"TE_WAIT_REF_COMPLETE",
"TE_MAX_EVENT"
};
#endif
typedef struct pppt_tgt_s {
/* Target state */
int target_refcount;
} pppt_tgt_t;
typedef struct {
struct pppt_tgt_s *ps_target;
int ps_refcnt;
} pppt_sess_t;
typedef struct {
} pppt_buf_t;
typedef enum {
PTS_INIT = 0,
typedef struct {
int pt_refcnt;
} pppt_task_t;
/*
* Error statistics
*/
typedef struct {
#define PPPT_INC_STAT(stat_field) \
/*
* State values for the iscsit service
*/
typedef enum {
PSS_UNDEFINED = 0,
typedef struct {
extern pppt_global_t pppt_global;
int pppt_sess_avl_compare_by_id(const void *void_sess1,
const void *void_sess2);
int pppt_sess_avl_compare_by_name(const void *void_sess1,
const void *void_sess2);
pppt_task_t *pppt_task_alloc(void);
#ifdef __cplusplus
}
#endif
#endif /* _PPPT_H */