xref: /illumos-gate/usr/src/uts/common/sys/1394/adapters/hci1394_drvinfo.h (revision e7cbe64f7a72dae5cb44f100db60ca88f3313c65)
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 (c) 1999-2000 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SYS_1394_ADAPTERS_HCI1394_DRVINFO_H
28 #define	_SYS_1394_ADAPTERS_HCI1394_DRVINFO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * hci1394_drvinfo.h
34  *     drvinfo contains the core information which is shared amoung the various
35  *     different parts of the this driver.  It should be the file that everyone
36  *     else includes.
37  *
38  *     This file should not have any dependencies on any other hci1394 header
39  *     files.
40  */
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #include <sys/ddi.h>
47 #include <sys/modctl.h>
48 #include <sys/sunddi.h>
49 
50 #include <sys/1394/h1394.h>
51 
52 
53 /* State of the HAL driver */
54 typedef enum {
55 	HCI1394_INITIAL,
56 	HCI1394_BUS_RESET,
57 	HCI1394_NORMAL,
58 	HCI1394_SHUTDOWN
59 } hci1394_statevar_t;
60 
61 /* protected state */
62 typedef struct hci1394_drvstate_s {
63 	hci1394_statevar_t	ds_state;
64 	kmutex_t		ds_mutex;
65 } hci1394_drvstate_t;
66 
67 
68 /* Driver Statistics */
69 typedef struct hci1394_stats_s {
70 	uint_t		st_bus_reset_count;
71 	uint_t		st_selfid_count;
72 	uint_t		st_phy_isr;
73 	uint_t		st_phy_loop_err;
74 	uint_t		st_phy_pwrfail_err;
75 	uint_t		st_phy_timeout_err;
76 	uint_t		st_phy_portevt_err;
77 } hci1394_stats_t;
78 
79 
80 /* General Driver Information use in all parts of the driver */
81 typedef struct hci1394_drvinfo_s {
82 	dev_info_t		*di_dip;
83 	void			*di_sl_private;
84 	int			di_instance;
85 	uint32_t		di_gencnt;
86 	hci1394_drvstate_t	di_drvstate;
87 	hci1394_stats_t		di_stats;
88 	ddi_iblock_cookie_t	di_iblock_cookie;
89 	ddi_device_acc_attr_t	di_reg_attr;
90 	ddi_device_acc_attr_t	di_buf_attr;
91 } hci1394_drvinfo_t;
92 
93 _NOTE(SCHEME_PROTECTS_DATA("Single thread modifies", hci1394_drvinfo_s))
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif	/* _SYS_1394_ADAPTERS_HCI1394_DRVINFO_H */
100