1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_1394_ADAPTERS_HCI1394_STATE_H
28 #define	_SYS_1394_ADAPTERS_HCI1394_STATE_H
29 
30 /*
31  * hci1394_state.h
32  *    The hci1394 driver soft state structure.
33  */
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <sys/ddi.h>
40 #include <sys/modctl.h>
41 #include <sys/sunddi.h>
42 #include <sys/types.h>
43 #include <sys/note.h>
44 
45 #include <sys/1394/h1394.h>
46 
47 #include <sys/1394/adapters/hci1394_drvinfo.h>
48 #include <sys/1394/adapters/hci1394_vendor.h>
49 #include <sys/1394/adapters/hci1394_ohci.h>
50 #include <sys/1394/adapters/hci1394_csr.h>
51 #include <sys/1394/adapters/hci1394_async.h>
52 #include <sys/1394/adapters/hci1394_isoch.h>
53 
54 
55 /*
56  * hci1394 state structure
57  *    put all handles and pointers at the top so it is easier to find things
58  *    when debugging
59  */
60 struct hci1394_state_s {
61 	/* various module handles */
62 	hci1394_ohci_handle_t	ohci;	/* see hci1394_ohci.h */
63 	hci1394_async_handle_t	async;	/* see hci1394_async.h */
64 	hci1394_vendor_handle_t	vendor;	/* see hci1394_vendor.h */
65 	hci1394_csr_handle_t	csr;	/* see hci1394_csr.h */
66 	hci1394_isoch_handle_t	isoch;	/* see hci1394_isoch.h */
67 
68 	/*
69 	 * This is the address of the buffer we are to copy the selfid info
70 	 * into. The Services layer will give us this during the Bus Reset
71 	 * interrupt and we will copy it into the buffer during the selfid
72 	 * complete interrupt.
73 	 */
74 	uint32_t		*sl_selfid_buf;
75 
76 	/*
77 	 * drvinfo contains the core information which is shared among the
78 	 * various different parts of the this driver. (e.g. dip, instance,
79 	 * statistics, iblock_cookie, etc.)
80 	 */
81 	hci1394_drvinfo_t	drvinfo; /* see hci1394_drvinfo.h */
82 
83 	/* Vendor Information about this adapter */
84 	hci1394_vendor_info_t	vendor_info; /* see hci1394_vendor.h */
85 
86 	/* attach stuff */
87 	ddi_acc_handle_t	pci_config;
88 	boolean_t		swap_data;
89 
90 	/* Adapter info passed up to the Services Layer */
91 	h1394_halinfo_t		halinfo; /* see h1394.h */
92 };
93 
94 _NOTE(SCHEME_PROTECTS_DATA("Single thread modifies", \
95 	hci1394_state_s::drvinfo.di_gencnt \
96 	hci1394_state_s::drvinfo.di_stats.st_bus_reset_count \
97 	hci1394_state_s::drvinfo.di_stats.st_selfid_count))
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif	/* _SYS_1394_ADAPTERS_HCI1394_STATE_H */
104