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