xref: /onnv-gate/usr/src/uts/common/io/comstar/stmf/stmf_state.h (revision 12682:c1fa75665a52)
17836SJohn.Forte@Sun.COM /*
27836SJohn.Forte@Sun.COM  * CDDL HEADER START
37836SJohn.Forte@Sun.COM  *
47836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
57836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
67836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
77836SJohn.Forte@Sun.COM  *
87836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
107836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
117836SJohn.Forte@Sun.COM  * and limitations under the License.
127836SJohn.Forte@Sun.COM  *
137836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
147836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
167836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
177836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
187836SJohn.Forte@Sun.COM  *
197836SJohn.Forte@Sun.COM  * CDDL HEADER END
207836SJohn.Forte@Sun.COM  */
217836SJohn.Forte@Sun.COM /*
22*12682SSrivijitha.Dugganapalli@Sun.COM  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
237836SJohn.Forte@Sun.COM  */
247836SJohn.Forte@Sun.COM #ifndef	_STMF_STATE_H
257836SJohn.Forte@Sun.COM #define	_STMF_STATE_H
267836SJohn.Forte@Sun.COM 
277836SJohn.Forte@Sun.COM #ifdef	__cplusplus
287836SJohn.Forte@Sun.COM extern "C" {
297836SJohn.Forte@Sun.COM #endif
307836SJohn.Forte@Sun.COM 
317836SJohn.Forte@Sun.COM typedef struct stmf_state {
327836SJohn.Forte@Sun.COM 	kmutex_t		stmf_lock;
337836SJohn.Forte@Sun.COM 	kcondvar_t		stmf_cv;
347836SJohn.Forte@Sun.COM 	dev_info_t		*stmf_dip;
357836SJohn.Forte@Sun.COM 	stmf_i_lu_provider_t	*stmf_ilplist;
367836SJohn.Forte@Sun.COM 	stmf_i_port_provider_t	*stmf_ipplist;
377836SJohn.Forte@Sun.COM 	stmf_i_lu_t		*stmf_ilulist;
387836SJohn.Forte@Sun.COM 	stmf_i_local_port_t	*stmf_ilportlist;
3911773STim.Szeto@Sun.COM 	id_space_t		*stmf_ilport_inst_space;
4011773STim.Szeto@Sun.COM 	avl_tree_t		stmf_irportlist;
4111773STim.Szeto@Sun.COM 	id_space_t		*stmf_irport_inst_space;
4211773STim.Szeto@Sun.COM 	avl_tree_t		stmf_itl_kstat_list;
437836SJohn.Forte@Sun.COM 	int			stmf_nlps;
447836SJohn.Forte@Sun.COM 	int			stmf_npps;
457836SJohn.Forte@Sun.COM 	int			stmf_nlus;
467836SJohn.Forte@Sun.COM 	int			stmf_nlports;
477836SJohn.Forte@Sun.COM 	uint8_t			stmf_service_running:1,
487836SJohn.Forte@Sun.COM 				stmf_inventory_locked:1,
497836SJohn.Forte@Sun.COM 				stmf_exclusive_open:1,
507836SJohn.Forte@Sun.COM 				stmf_opened:1,
517836SJohn.Forte@Sun.COM 				stmf_process_initial_luns:1,
527836SJohn.Forte@Sun.COM 				rsvd:3;
537836SJohn.Forte@Sun.COM 	uint8_t			stmf_config_state; /* See stmf_ioctl.h */
5410725SJohn.Forte@Sun.COM 	uint8_t			stmf_alua_state;
5510725SJohn.Forte@Sun.COM 	uint16_t		stmf_alua_node;
56*12682SSrivijitha.Dugganapalli@Sun.COM 	uint8_t			stmf_default_lu_state;
57*12682SSrivijitha.Dugganapalli@Sun.COM 	uint8_t			stmf_default_lport_state;
587836SJohn.Forte@Sun.COM 	ddi_taskq_t		*stmf_svc_taskq;
597836SJohn.Forte@Sun.COM 	uint32_t		stmf_svc_flags;
607836SJohn.Forte@Sun.COM 	stmf_i_lu_t		*stmf_svc_ilu_draining;
617836SJohn.Forte@Sun.COM 	stmf_i_lu_t		*stmf_svc_ilu_timing;
627836SJohn.Forte@Sun.COM 	struct stmf_svc_req	*stmf_svc_active;
637836SJohn.Forte@Sun.COM 	struct stmf_svc_req	*stmf_svc_waiting;
647836SJohn.Forte@Sun.COM 
657836SJohn.Forte@Sun.COM 	stmf_id_list_t		stmf_hg_list;
667836SJohn.Forte@Sun.COM 	stmf_id_list_t		stmf_tg_list;
677836SJohn.Forte@Sun.COM 	stmf_id_list_t		stmf_luid_list;
687836SJohn.Forte@Sun.COM 
697836SJohn.Forte@Sun.COM 	stmf_ver_tg_t		*stmf_ver_tg_head;
707836SJohn.Forte@Sun.COM 
717836SJohn.Forte@Sun.COM 	stmf_pp_data_t		*stmf_ppdlist;
727836SJohn.Forte@Sun.COM } stmf_state_t;
737836SJohn.Forte@Sun.COM 
747836SJohn.Forte@Sun.COM /*
757836SJohn.Forte@Sun.COM  * svc flags
767836SJohn.Forte@Sun.COM  */
777836SJohn.Forte@Sun.COM #define	STMF_SVC_STARTED		1
787836SJohn.Forte@Sun.COM #define	STMF_SVC_ACTIVE			2
797836SJohn.Forte@Sun.COM #define	STMF_SVC_TERMINATE		4
807836SJohn.Forte@Sun.COM 
817836SJohn.Forte@Sun.COM /*
827836SJohn.Forte@Sun.COM  * svc request. We probably have to modify it once more services (and probably
837836SJohn.Forte@Sun.COM  * different types of services) are added to the stmf_svc_thread.
847836SJohn.Forte@Sun.COM  */
857836SJohn.Forte@Sun.COM typedef struct stmf_svc_req {
867836SJohn.Forte@Sun.COM 	struct stmf_svc_req		*svc_next;
877836SJohn.Forte@Sun.COM 	int				svc_req_alloc_size;
887836SJohn.Forte@Sun.COM 	int				svc_cmd;
897836SJohn.Forte@Sun.COM 	void				*svc_obj;
907836SJohn.Forte@Sun.COM 	struct stmf_state_change_info	svc_info;
917836SJohn.Forte@Sun.COM } stmf_svc_req_t;
927836SJohn.Forte@Sun.COM 
937836SJohn.Forte@Sun.COM extern stmf_state_t stmf_state;
947836SJohn.Forte@Sun.COM 
957836SJohn.Forte@Sun.COM #ifdef	__cplusplus
967836SJohn.Forte@Sun.COM }
977836SJohn.Forte@Sun.COM #endif
987836SJohn.Forte@Sun.COM 
997836SJohn.Forte@Sun.COM #endif /* _STMF_STATE_H */
100