xref: /titanic_50/usr/src/uts/common/sys/1394/adapters/hci1394.h (revision c77a61a72b5ecdc507d6cf104142edd371a16c84)
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_H
28 #define	_SYS_1394_ADAPTERS_HCI1394_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * hci1394.h
34  *    This file contains general defines and function prototypes for things
35  *    that did not warrant separate header files.
36  */
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <sys/types.h>
43 #include <sys/conf.h>
44 #include <sys/ddi.h>
45 #include <sys/sunddi.h>
46 
47 #include <sys/1394/ieee1394.h>
48 #include <sys/1394/h1394.h>
49 
50 #include <sys/1394/adapters/hci1394_def.h>
51 #include <sys/1394/adapters/hci1394_tnf.h>
52 #include <sys/1394/adapters/hci1394_drvinfo.h>
53 #include <sys/1394/adapters/hci1394_tlist.h>
54 #include <sys/1394/adapters/hci1394_tlabel.h>
55 #include <sys/1394/adapters/hci1394_ioctl.h>
56 #include <sys/1394/adapters/hci1394_rio_regs.h>
57 #include <sys/1394/adapters/hci1394_ohci.h>
58 #include <sys/1394/adapters/hci1394_descriptors.h>
59 #include <sys/1394/adapters/hci1394_csr.h>
60 #include <sys/1394/adapters/hci1394_vendor.h>
61 #include <sys/1394/adapters/hci1394_buf.h>
62 #include <sys/1394/adapters/hci1394_q.h>
63 #include <sys/1394/adapters/hci1394_async.h>
64 #include <sys/1394/adapters/hci1394_ixl.h>
65 #include <sys/1394/adapters/hci1394_isoch.h>
66 #include <sys/1394/id1394.h>
67 #include <sys/1394/adapters/hci1394_state.h>
68 
69 
70 /* Number of initial states to setup. Used in call to ddi_soft_state_init() */
71 #define	HCI1394_INITIAL_STATES		3
72 
73 /*
74  * Size of the Address Map Array passed to the Service Layer. There are 4
75  * sections in the OpenHCI address space. They are Physical, Posted Write,
76  * Normal, and CSR space.
77  */
78 #define	HCI1394_ADDR_MAP_SIZE		4
79 
80 /* Macro to align address on a quadlet boundry */
81 #define	HCI1394_ALIGN_QUAD(addr) (((addr) + 3) & 0xFFFFFFFC)
82 
83 /* These functions can be found in hci1394_attach.c */
84 int hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
85 
86 /* These functions can be found in hci1394_detach.c */
87 int hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
88 void hci1394_detach_hardware(hci1394_state_t *soft_state);
89 void hci1394_pci_fini(hci1394_state_t *soft_state);
90 void hci1394_soft_state_fini(hci1394_state_t *soft_state);
91 
92 /* These functions can be found in hci1394_misc.c */
93 hci1394_statevar_t hci1394_state(hci1394_drvinfo_t *drvinfo);
94 int hci1394_state_set(hci1394_drvinfo_t *drvinfo, hci1394_statevar_t state);
95 int hci1394_open(dev_t *devp, int flag, int otyp, cred_t *credp);
96 int hci1394_close(dev_t dev, int flag, int otyp, cred_t *credp);
97 void hci1394_shutdown(dev_info_t *dip);
98 int hci1394_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
99     void **result);
100 
101 /* These functions can be found in hci1394_ioctl.c */
102 int hci1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
103     int *rvalp);
104 
105 /* These functions can be found in hci1394_isr.c */
106 int hci1394_isr_init(hci1394_state_t *soft_state);
107 void hci1394_isr_fini(hci1394_state_t *soft_state);
108 int hci1394_isr_handler_init(hci1394_state_t *soft_state);
109 void hci1394_isr_handler_fini(hci1394_state_t *soft_state);
110 void hci1394_isr_mask_setup(hci1394_state_t *soft_state);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif	/* _SYS_1394_ADAPTERS_HCI1394_H */
117