14bb7efa7SGarrett D'Amore /*
24bb7efa7SGarrett D'Amore * CDDL HEADER START
34bb7efa7SGarrett D'Amore *
44bb7efa7SGarrett D'Amore * The contents of this file are subject to the terms of the
54bb7efa7SGarrett D'Amore * Common Development and Distribution License (the "License").
64bb7efa7SGarrett D'Amore * You may not use this file except in compliance with the License.
74bb7efa7SGarrett D'Amore *
84bb7efa7SGarrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
94bb7efa7SGarrett D'Amore * or http://www.opensolaris.org/os/licensing.
104bb7efa7SGarrett D'Amore * See the License for the specific language governing permissions
114bb7efa7SGarrett D'Amore * and limitations under the License.
124bb7efa7SGarrett D'Amore *
134bb7efa7SGarrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
144bb7efa7SGarrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
154bb7efa7SGarrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
164bb7efa7SGarrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
174bb7efa7SGarrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
184bb7efa7SGarrett D'Amore *
194bb7efa7SGarrett D'Amore * CDDL HEADER END
204bb7efa7SGarrett D'Amore */
214bb7efa7SGarrett D'Amore /*
22*3f7d54a6SGarrett D'Amore * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
234bb7efa7SGarrett D'Amore */
244bb7efa7SGarrett D'Amore
254bb7efa7SGarrett D'Amore /*
264bb7efa7SGarrett D'Amore * SD card module support.
274bb7efa7SGarrett D'Amore */
284bb7efa7SGarrett D'Amore
294bb7efa7SGarrett D'Amore #include <sys/modctl.h>
304bb7efa7SGarrett D'Amore #include <sys/sdcard/sda_impl.h>
314bb7efa7SGarrett D'Amore
324bb7efa7SGarrett D'Amore /*
334bb7efa7SGarrett D'Amore * Static Variables.
344bb7efa7SGarrett D'Amore */
354bb7efa7SGarrett D'Amore
364bb7efa7SGarrett D'Amore static struct modlmisc modlmisc = {
374bb7efa7SGarrett D'Amore &mod_miscops,
384bb7efa7SGarrett D'Amore "SD Card Architecture",
394bb7efa7SGarrett D'Amore };
404bb7efa7SGarrett D'Amore
414bb7efa7SGarrett D'Amore static struct modlinkage modlinkage = {
424bb7efa7SGarrett D'Amore MODREV_1, { &modlmisc, NULL }
434bb7efa7SGarrett D'Amore };
444bb7efa7SGarrett D'Amore
454bb7efa7SGarrett D'Amore /*
464bb7efa7SGarrett D'Amore * DDI entry points.
474bb7efa7SGarrett D'Amore */
484bb7efa7SGarrett D'Amore
494bb7efa7SGarrett D'Amore int
_init(void)504bb7efa7SGarrett D'Amore _init(void)
514bb7efa7SGarrett D'Amore {
524bb7efa7SGarrett D'Amore int rv;
534bb7efa7SGarrett D'Amore
544bb7efa7SGarrett D'Amore sda_cmd_init();
554bb7efa7SGarrett D'Amore
564bb7efa7SGarrett D'Amore if ((rv = mod_install(&modlinkage)) != 0) {
574bb7efa7SGarrett D'Amore sda_cmd_fini();
584bb7efa7SGarrett D'Amore }
594bb7efa7SGarrett D'Amore
604bb7efa7SGarrett D'Amore return (rv);
614bb7efa7SGarrett D'Amore }
624bb7efa7SGarrett D'Amore
634bb7efa7SGarrett D'Amore int
_fini(void)644bb7efa7SGarrett D'Amore _fini(void)
654bb7efa7SGarrett D'Amore {
664bb7efa7SGarrett D'Amore int rv;
674bb7efa7SGarrett D'Amore
684bb7efa7SGarrett D'Amore if ((rv = mod_remove(&modlinkage)) == 0) {
694bb7efa7SGarrett D'Amore sda_cmd_fini();
704bb7efa7SGarrett D'Amore }
714bb7efa7SGarrett D'Amore return (rv);
724bb7efa7SGarrett D'Amore }
734bb7efa7SGarrett D'Amore
744bb7efa7SGarrett D'Amore int
_info(struct modinfo * modinfop)754bb7efa7SGarrett D'Amore _info(struct modinfo *modinfop)
764bb7efa7SGarrett D'Amore {
774bb7efa7SGarrett D'Amore return (mod_info(&modlinkage, modinfop));
784bb7efa7SGarrett D'Amore }
79