17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * spppasyn_mod.c - modload support for PPP AHDLC STREAMS module
37c478bd9Sstevel@tonic-gate  *
4*89b43686SBayard Bell  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
5*89b43686SBayard Bell  * Use is subject to license terms.
6*89b43686SBayard Bell  *
7*89b43686SBayard Bell  * CONTRIBUTOR MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY
8*89b43686SBayard Bell  * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
9*89b43686SBayard Bell  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
10*89b43686SBayard Bell  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  CONTRIBUTOR SHALL NOT BE LIABLE
11*89b43686SBayard Bell  * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
12*89b43686SBayard Bell  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
13*89b43686SBayard Bell  *
14*89b43686SBayard Bell  * Permission to use, copy, modify, and distribute this software and its
15*89b43686SBayard Bell  * documentation is hereby granted, provided that the above copyright
16*89b43686SBayard Bell  * notice appears in all copies.
17*89b43686SBayard Bell  *
187c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
197c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
207c478bd9Sstevel@tonic-gate  *
217c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software and its
227c478bd9Sstevel@tonic-gate  * documentation is hereby granted, provided that the above copyright
237c478bd9Sstevel@tonic-gate  * notice appears in all copies.
247c478bd9Sstevel@tonic-gate  *
257c478bd9Sstevel@tonic-gate  * SUN MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY OF
267c478bd9Sstevel@tonic-gate  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
277c478bd9Sstevel@tonic-gate  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
287c478bd9Sstevel@tonic-gate  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  SUN SHALL NOT BE LIABLE FOR
297c478bd9Sstevel@tonic-gate  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
307c478bd9Sstevel@tonic-gate  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
317c478bd9Sstevel@tonic-gate  *
327c478bd9Sstevel@tonic-gate  * Copyright (c) 1994 The Australian National University.
337c478bd9Sstevel@tonic-gate  * All rights reserved.
347c478bd9Sstevel@tonic-gate  *
357c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software and its
367c478bd9Sstevel@tonic-gate  * documentation is hereby granted, provided that the above copyright
377c478bd9Sstevel@tonic-gate  * notice appears in all copies.  This software is provided without any
387c478bd9Sstevel@tonic-gate  * warranty, express or implied. The Australian National University
397c478bd9Sstevel@tonic-gate  * makes no representations about the suitability of this software for
407c478bd9Sstevel@tonic-gate  * any purpose.
417c478bd9Sstevel@tonic-gate  *
427c478bd9Sstevel@tonic-gate  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
437c478bd9Sstevel@tonic-gate  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
447c478bd9Sstevel@tonic-gate  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
457c478bd9Sstevel@tonic-gate  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
467c478bd9Sstevel@tonic-gate  * OF SUCH DAMAGE.
477c478bd9Sstevel@tonic-gate  *
487c478bd9Sstevel@tonic-gate  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
497c478bd9Sstevel@tonic-gate  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
507c478bd9Sstevel@tonic-gate  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
517c478bd9Sstevel@tonic-gate  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
527c478bd9Sstevel@tonic-gate  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
537c478bd9Sstevel@tonic-gate  * OR MODIFICATIONS.
547c478bd9Sstevel@tonic-gate  *
557c478bd9Sstevel@tonic-gate  * $Id: ppp_mod.c,v 1.3 1999/02/26 10:53:28 paulus Exp $
567c478bd9Sstevel@tonic-gate  */
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate #include <sys/types.h>
597c478bd9Sstevel@tonic-gate #include <sys/conf.h>
607c478bd9Sstevel@tonic-gate #include <sys/ddi.h>
617c478bd9Sstevel@tonic-gate #include <sys/conf.h>
627c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
637c478bd9Sstevel@tonic-gate #include <net/pppio.h>
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate /*
667c478bd9Sstevel@tonic-gate  * Globals for PPP AHDLC loadable module wrapper
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate extern struct streamtab spppasyn_tab;
697c478bd9Sstevel@tonic-gate extern const char spppasyn_module_description[];
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate /*
727c478bd9Sstevel@tonic-gate  * Module linkage information for the kernel.
737c478bd9Sstevel@tonic-gate  */
747c478bd9Sstevel@tonic-gate static struct fmodsw mod_fsw = {
757c478bd9Sstevel@tonic-gate 	AHDLC_MOD_NAME,					/* f_name */
767c478bd9Sstevel@tonic-gate 	&spppasyn_tab,					/* f_str */
777c478bd9Sstevel@tonic-gate 	D_MP | D_MTPERQ					/* f_flag */
787c478bd9Sstevel@tonic-gate };
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate static struct modlstrmod modlstrmod = {
817c478bd9Sstevel@tonic-gate 	&mod_strmodops,				/* strmod_modops */
827c478bd9Sstevel@tonic-gate 	(char *)spppasyn_module_description,	/* strmod_linkinfo */
837c478bd9Sstevel@tonic-gate 	&mod_fsw				/* strmod_fmodsw */
847c478bd9Sstevel@tonic-gate };
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate static struct modlinkage modlinkage = {
877c478bd9Sstevel@tonic-gate 	MODREV_1,			/* ml_rev, has to be MODREV_1 */
887c478bd9Sstevel@tonic-gate 	&modlstrmod,			/* ml_linkage, NULL-terminated list */
897c478bd9Sstevel@tonic-gate 	NULL				/*  of linkage structures */
907c478bd9Sstevel@tonic-gate };
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate int
_init(void)937c478bd9Sstevel@tonic-gate _init(void)
947c478bd9Sstevel@tonic-gate {
957c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
967c478bd9Sstevel@tonic-gate }
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate int
_fini(void)997c478bd9Sstevel@tonic-gate _fini(void)
1007c478bd9Sstevel@tonic-gate {
1017c478bd9Sstevel@tonic-gate 	return (mod_remove(&modlinkage));
1027c478bd9Sstevel@tonic-gate }
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate int
_info(struct modinfo * modinfop)1057c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
1067c478bd9Sstevel@tonic-gate {
1077c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
1087c478bd9Sstevel@tonic-gate }
109