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_drvinfo.h>
50 #include <sys/1394/adapters/hci1394_tlist.h>
51 #include <sys/1394/adapters/hci1394_tlabel.h>
52 #include <sys/1394/adapters/hci1394_ioctl.h>
53 #include <sys/1394/adapters/hci1394_rio_regs.h>
54 #include <sys/1394/adapters/hci1394_ohci.h>
55 #include <sys/1394/adapters/hci1394_descriptors.h>
56 #include <sys/1394/adapters/hci1394_csr.h>
57 #include <sys/1394/adapters/hci1394_vendor.h>
58 #include <sys/1394/adapters/hci1394_buf.h>
59 #include <sys/1394/adapters/hci1394_q.h>
60 #include <sys/1394/adapters/hci1394_async.h>
61 #include <sys/1394/adapters/hci1394_ixl.h>
62 #include <sys/1394/adapters/hci1394_isoch.h>
63 #include <sys/1394/id1394.h>
64 #include <sys/1394/adapters/hci1394_state.h>
65 
66 
67 /* Number of initial states to setup. Used in call to ddi_soft_state_init() */
68 #define	HCI1394_INITIAL_STATES		3
69 
70 /*
71  * Size of the Address Map Array passed to the Service Layer. There are 4
72  * sections in the OpenHCI address space. They are Physical, Posted Write,
73  * Normal, and CSR space.
74  */
75 #define	HCI1394_ADDR_MAP_SIZE		4
76 
77 /* Macro to align address on a quadlet boundry */
78 #define	HCI1394_ALIGN_QUAD(addr) (((addr) + 3) & 0xFFFFFFFC)
79 
80 /* These functions can be found in hci1394_attach.c */
81 int hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
82 
83 /* These functions can be found in hci1394_detach.c */
84 int hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
85 void hci1394_detach_hardware(hci1394_state_t *soft_state);
86 void hci1394_pci_fini(hci1394_state_t *soft_state);
87 void hci1394_soft_state_fini(hci1394_state_t *soft_state);
88 int hci1394_quiesce(dev_info_t *dip);
89 
90 /* These functions can be found in hci1394_misc.c */
91 hci1394_statevar_t hci1394_state(hci1394_drvinfo_t *drvinfo);
92 int hci1394_state_set(hci1394_drvinfo_t *drvinfo, hci1394_statevar_t state);
93 int hci1394_open(dev_t *devp, int flag, int otyp, cred_t *credp);
94 int hci1394_close(dev_t dev, int flag, int otyp, cred_t *credp);
95 void hci1394_shutdown(dev_info_t *dip);
96 int hci1394_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
97     void **result);
98 
99 /* These functions can be found in hci1394_ioctl.c */
100 int hci1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
101     int *rvalp);
102 
103 /* These functions can be found in hci1394_isr.c */
104 int hci1394_isr_init(hci1394_state_t *soft_state);
105 void hci1394_isr_fini(hci1394_state_t *soft_state);
106 int hci1394_isr_handler_init(hci1394_state_t *soft_state);
107 void hci1394_isr_handler_fini(hci1394_state_t *soft_state);
108 void hci1394_isr_mask_setup(hci1394_state_t *soft_state);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif	/* _SYS_1394_ADAPTERS_HCI1394_H */
115