fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
4b31676f89e318c11400fc0c4defc802da29222fsrivijitha dugganapalli * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
6ac72a9ce9da39bd0abf3111fb48494c6d892613Alexander Stetsenko/*
6ac72a9ce9da39bd0abf3111fb48494c6d892613Alexander Stetsenko * Copyright 2011, Nexenta Systems, Inc. All rights reserved.
09409df0fea2444decd38bc1b87ab7a80d3251e5Jeff Biseda * Copyright (c) 2013 by Delphix. All rights reserved.
6ac72a9ce9da39bd0abf3111fb48494c6d892613Alexander Stetsenko */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _STMF_STATE_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _STMF_STATE_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct stmf_state {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t stmf_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kcondvar_t stmf_cv;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dev_info_t *stmf_dip;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_lu_provider_t *stmf_ilplist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_port_provider_t *stmf_ipplist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_lu_t *stmf_ilulist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_local_port_t *stmf_ilportlist;
427fcaf873956aad428be801380a44e59d38b8b5tim szeto id_space_t *stmf_ilport_inst_space;
427fcaf873956aad428be801380a44e59d38b8b5tim szeto avl_tree_t stmf_irportlist;
427fcaf873956aad428be801380a44e59d38b8b5tim szeto id_space_t *stmf_irport_inst_space;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int stmf_nlps;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int stmf_npps;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int stmf_nlus;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int stmf_nlports;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t stmf_service_running:1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_inventory_locked:1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_exclusive_open:1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_opened:1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_process_initial_luns:1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rsvd:3;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t stmf_config_state; /* See stmf_ioctl.h */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte uint8_t stmf_alua_state;
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte uint16_t stmf_alua_node;
4b31676f89e318c11400fc0c4defc802da29222fsrivijitha dugganapalli uint8_t stmf_default_lu_state;
4b31676f89e318c11400fc0c4defc802da29222fsrivijitha dugganapalli uint8_t stmf_default_lport_state;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_taskq_t *stmf_svc_taskq;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t stmf_svc_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_lu_t *stmf_svc_ilu_draining;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_i_lu_t *stmf_svc_ilu_timing;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct stmf_svc_req *stmf_svc_active;
6ac72a9ce9da39bd0abf3111fb48494c6d892613Alexander Stetsenko struct stmf_svc_req **stmf_svc_tailp;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_id_list_t stmf_hg_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_id_list_t stmf_tg_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_id_list_t stmf_luid_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_ver_tg_t *stmf_ver_tg_head;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_pp_data_t *stmf_ppdlist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} stmf_state_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * svc flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define STMF_SVC_STARTED 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define STMF_SVC_ACTIVE 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define STMF_SVC_TERMINATE 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * svc request. We probably have to modify it once more services (and probably
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * different types of services) are added to the stmf_svc_thread.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct stmf_svc_req {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct stmf_svc_req *svc_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int svc_req_alloc_size;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int svc_cmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *svc_obj;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct stmf_state_change_info svc_info;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} stmf_svc_req_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern stmf_state_t stmf_state;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _STMF_STATE_H */