xref: /onnv-gate/usr/src/uts/sun/io/qfe.c (revision 8275:7c223a798022)
14943Sgd78059 /*
24943Sgd78059  * CDDL HEADER START
34943Sgd78059  *
44943Sgd78059  * The contents of this file are subject to the terms of the
54943Sgd78059  * Common Development and Distribution License (the "License").
64943Sgd78059  * You may not use this file except in compliance with the License.
74943Sgd78059  *
84943Sgd78059  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
94943Sgd78059  * or http://www.opensolaris.org/os/licensing.
104943Sgd78059  * See the License for the specific language governing permissions
114943Sgd78059  * and limitations under the License.
124943Sgd78059  *
134943Sgd78059  * When distributing Covered Code, include this CDDL HEADER in each
144943Sgd78059  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
154943Sgd78059  * If applicable, add the following below this CDDL HEADER, with the
164943Sgd78059  * fields enclosed by brackets "[]" replaced with your own identifying
174943Sgd78059  * information: Portions Copyright [yyyy] [name of copyright owner]
184943Sgd78059  *
194943Sgd78059  * CDDL HEADER END
204943Sgd78059  */
217656SSherry.Moore@Sun.COM 
224943Sgd78059 /*
237656SSherry.Moore@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
244943Sgd78059  * Use is subject to license terms.
254943Sgd78059  */
264943Sgd78059 
274943Sgd78059 
284943Sgd78059 /*
294943Sgd78059  * SunOS MT QFE Device Driver (layered above FEPS/Cheerio)
304943Sgd78059  */
314943Sgd78059 
324943Sgd78059 #include	<sys/types.h>
334943Sgd78059 #include	<sys/debug.h>
344943Sgd78059 #include	<sys/stream.h>
354943Sgd78059 #include	<sys/cmn_err.h>
364943Sgd78059 #include	<sys/kmem.h>
374943Sgd78059 #include	<sys/modctl.h>
384943Sgd78059 #include	<sys/conf.h>
39*8275SEric Cheng #include	<sys/mac_provider.h>
404943Sgd78059 #include	<sys/mac_ether.h>
414943Sgd78059 #include	<sys/ddi.h>
424943Sgd78059 #include	<sys/sunddi.h>
434943Sgd78059 
444943Sgd78059 /*
454943Sgd78059  * Function prototypes.
464943Sgd78059  */
474943Sgd78059 extern int hmeattach(dev_info_t *, ddi_attach_cmd_t);
484943Sgd78059 extern int hmedetach(dev_info_t *, ddi_detach_cmd_t);
494943Sgd78059 
504943Sgd78059 DDI_DEFINE_STREAM_OPS(qfe_dev_ops, nulldev, nulldev, hmeattach, hmedetach,
517656SSherry.Moore@Sun.COM     nodev, NULL, D_MP, NULL, ddi_quiesce_not_supported);
524943Sgd78059 
534943Sgd78059 /*
544943Sgd78059  * Module linkage information for the kernel.
554943Sgd78059  */
564943Sgd78059 static struct modldrv modldrv = {
574943Sgd78059 	&mod_driverops,	/* Type of module.  This one is a driver */
584943Sgd78059 	"Sun QFE 10/100 Mb Ethernet",
594943Sgd78059 	&qfe_dev_ops,	/* driver ops */
604943Sgd78059 };
614943Sgd78059 
624943Sgd78059 static struct modlinkage modlinkage = {
634943Sgd78059 	MODREV_1, &modldrv, NULL
644943Sgd78059 };
654943Sgd78059 
664943Sgd78059 /* <<<<<<<<<<<<<<<<<<<<<<<<<<<  LOADABLE ENTRIES  >>>>>>>>>>>>>>>>>>>>>>> */
674943Sgd78059 
684943Sgd78059 int
_init(void)694943Sgd78059 _init(void)
704943Sgd78059 {
714943Sgd78059 	int	status;
724943Sgd78059 
734943Sgd78059 	mac_init_ops(&qfe_dev_ops, "qfe");
744943Sgd78059 	if ((status = mod_install(&modlinkage)) != 0) {
754943Sgd78059 		mac_fini_ops(&qfe_dev_ops);
764943Sgd78059 	}
774943Sgd78059 	return (status);
784943Sgd78059 }
794943Sgd78059 
804943Sgd78059 int
_fini(void)814943Sgd78059 _fini(void)
824943Sgd78059 {
834943Sgd78059 	int	status;
844943Sgd78059 
854943Sgd78059 	if ((status = mod_remove(&modlinkage)) == 0) {
864943Sgd78059 		mac_fini_ops(&qfe_dev_ops);
874943Sgd78059 	}
884943Sgd78059 	return (status);
894943Sgd78059 }
904943Sgd78059 
914943Sgd78059 int
_info(struct modinfo * modinfop)924943Sgd78059 _info(struct modinfo *modinfop)
934943Sgd78059 {
944943Sgd78059 	return (mod_info(&modlinkage, modinfop));
954943Sgd78059 }
96