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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 * 1394 (firewire) OpenHCI 1.0 HBA driver. This file contains the driver's
30 * _init(), _info(), and _fini().
33 #include <sys/modctl.h>
36 #include <sys/sunddi.h>
38 #include <sys/1394/ieee1394.h>
39 #include <sys/1394/h1394.h>
41 #include <sys/1394/adapters/hci1394.h>
44 /* HAL State Pointer */
47 /* Character/Block Operations */
48 static struct cb_ops hci1394_cb_ops
= {
49 hci1394_open
, /* open */
50 hci1394_close
, /* close */
51 nodev
, /* strategy (block) */
52 nodev
, /* print (block) */
53 nodev
, /* dump (block) */
56 hci1394_ioctl
, /* ioctl */
60 nochpoll
, /* chpoll */
61 ddi_prop_op
, /* prop_op */
64 D_64BIT
| D_HOTPLUG
, /* flags */
68 /* Driver Operations */
69 static struct dev_ops hci1394_ops
= {
70 DEVO_REV
, /* struct rev */
72 hci1394_getinfo
, /* getinfo */
73 nulldev
, /* identify */
75 hci1394_attach
, /* attach */
76 hci1394_detach
, /* detach */
78 &hci1394_cb_ops
, /* cb_ops */
81 hci1394_quiesce
, /* devo_quiesce */
84 /* Module Driver Info */
85 static struct modldrv hci1394_modldrv
= {
87 "1394 OpenHCI HBA driver",
92 static struct modlinkage hci1394_modlinkage
= {
99 extern int tnf_mod_load(void);
100 extern int tnf_mod_unload(struct modlinkage
*mlp
);
110 (void) tnf_mod_load();
113 status
= ddi_soft_state_init(&hci1394_statep
, sizeof (hci1394_state_t
),
114 (size_t)HCI1394_INITIAL_STATES
);
117 (void) tnf_mod_unload(&hci1394_modlinkage
);
122 /* Call into services layer to init bus-ops */
123 status
= h1394_init(&hci1394_modlinkage
);
126 (void) tnf_mod_unload(&hci1394_modlinkage
);
131 status
= mod_install(&hci1394_modlinkage
);
133 ddi_soft_state_fini(&hci1394_statep
);
135 (void) tnf_mod_unload(&hci1394_modlinkage
);
145 _info(struct modinfo
*modinfop
)
149 status
= mod_info(&hci1394_modlinkage
, modinfop
);
160 status
= mod_remove(&hci1394_modlinkage
);
165 /* Call into services layer notify about _fini */
166 h1394_fini(&hci1394_modlinkage
);
167 ddi_soft_state_fini(&hci1394_statep
);
170 (void) tnf_mod_unload(&hci1394_modlinkage
);