xref: /titanic_50/usr/src/uts/common/sys/1394/adapters/hci1394.h (revision cd3e933325e68e23516a196a8fea7f49b1e497c3)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_1394_ADAPTERS_HCI1394_H
27 #define	_SYS_1394_ADAPTERS_HCI1394_H
28 
29 
30 /*
31  * hci1394.h
32  *    This file contains general defines and function prototypes for things
33  *    that did not warrant separate header files.
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <sys/types.h>
41 #include <sys/conf.h>
42 #include <sys/ddi.h>
43 #include <sys/sunddi.h>
44 
45 #include <sys/1394/ieee1394.h>
46 #include <sys/1394/h1394.h>
47 
48 #include <sys/1394/adapters/hci1394_def.h>
49 #include <sys/1394/adapters/hci1394_tnf.h>
50 #include <sys/1394/adapters/hci1394_drvinfo.h>
51 #include <sys/1394/adapters/hci1394_tlist.h>
52 #include <sys/1394/adapters/hci1394_tlabel.h>
53 #include <sys/1394/adapters/hci1394_ioctl.h>
54 #include <sys/1394/adapters/hci1394_rio_regs.h>
55 #include <sys/1394/adapters/hci1394_ohci.h>
56 #include <sys/1394/adapters/hci1394_descriptors.h>
57 #include <sys/1394/adapters/hci1394_csr.h>
58 #include <sys/1394/adapters/hci1394_vendor.h>
59 #include <sys/1394/adapters/hci1394_buf.h>
60 #include <sys/1394/adapters/hci1394_q.h>
61 #include <sys/1394/adapters/hci1394_async.h>
62 #include <sys/1394/adapters/hci1394_ixl.h>
63 #include <sys/1394/adapters/hci1394_isoch.h>
64 #include <sys/1394/id1394.h>
65 #include <sys/1394/adapters/hci1394_state.h>
66 
67 
68 /* Number of initial states to setup. Used in call to ddi_soft_state_init() */
69 #define	HCI1394_INITIAL_STATES		3
70 
71 /*
72  * Size of the Address Map Array passed to the Service Layer. There are 4
73  * sections in the OpenHCI address space. They are Physical, Posted Write,
74  * Normal, and CSR space.
75  */
76 #define	HCI1394_ADDR_MAP_SIZE		4
77 
78 /* Macro to align address on a quadlet boundry */
79 #define	HCI1394_ALIGN_QUAD(addr) (((addr) + 3) & 0xFFFFFFFC)
80 
81 /* These functions can be found in hci1394_attach.c */
82 int hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
83 
84 /* These functions can be found in hci1394_detach.c */
85 int hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
86 void hci1394_detach_hardware(hci1394_state_t *soft_state);
87 void hci1394_pci_fini(hci1394_state_t *soft_state);
88 void hci1394_soft_state_fini(hci1394_state_t *soft_state);
89 int hci1394_quiesce(dev_info_t *dip);
90 
91 /* These functions can be found in hci1394_misc.c */
92 hci1394_statevar_t hci1394_state(hci1394_drvinfo_t *drvinfo);
93 int hci1394_state_set(hci1394_drvinfo_t *drvinfo, hci1394_statevar_t state);
94 int hci1394_open(dev_t *devp, int flag, int otyp, cred_t *credp);
95 int hci1394_close(dev_t dev, int flag, int otyp, cred_t *credp);
96 void hci1394_shutdown(dev_info_t *dip);
97 int hci1394_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
98     void **result);
99 
100 /* These functions can be found in hci1394_ioctl.c */
101 int hci1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
102     int *rvalp);
103 
104 /* These functions can be found in hci1394_isr.c */
105 int hci1394_isr_init(hci1394_state_t *soft_state);
106 void hci1394_isr_fini(hci1394_state_t *soft_state);
107 int hci1394_isr_handler_init(hci1394_state_t *soft_state);
108 void hci1394_isr_handler_fini(hci1394_state_t *soft_state);
109 void hci1394_isr_mask_setup(hci1394_state_t *soft_state);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif	/* _SYS_1394_ADAPTERS_HCI1394_H */
116