1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate * spppasyn_mod.c - modload support for PPP AHDLC STREAMS module
3*0Sstevel@tonic-gate *
4*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5*0Sstevel@tonic-gate * Use is subject to license terms.
6*0Sstevel@tonic-gate *
7*0Sstevel@tonic-gate * Permission to use, copy, modify, and distribute this software and its
8*0Sstevel@tonic-gate * documentation is hereby granted, provided that the above copyright
9*0Sstevel@tonic-gate * notice appears in all copies.
10*0Sstevel@tonic-gate *
11*0Sstevel@tonic-gate * SUN MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY OF
12*0Sstevel@tonic-gate * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
13*0Sstevel@tonic-gate * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14*0Sstevel@tonic-gate * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
15*0Sstevel@tonic-gate * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
16*0Sstevel@tonic-gate * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
17*0Sstevel@tonic-gate *
18*0Sstevel@tonic-gate * Copyright (c) 1994 The Australian National University.
19*0Sstevel@tonic-gate * All rights reserved.
20*0Sstevel@tonic-gate *
21*0Sstevel@tonic-gate * Permission to use, copy, modify, and distribute this software and its
22*0Sstevel@tonic-gate * documentation is hereby granted, provided that the above copyright
23*0Sstevel@tonic-gate * notice appears in all copies. This software is provided without any
24*0Sstevel@tonic-gate * warranty, express or implied. The Australian National University
25*0Sstevel@tonic-gate * makes no representations about the suitability of this software for
26*0Sstevel@tonic-gate * any purpose.
27*0Sstevel@tonic-gate *
28*0Sstevel@tonic-gate * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
29*0Sstevel@tonic-gate * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
30*0Sstevel@tonic-gate * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
31*0Sstevel@tonic-gate * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
32*0Sstevel@tonic-gate * OF SUCH DAMAGE.
33*0Sstevel@tonic-gate *
34*0Sstevel@tonic-gate * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
35*0Sstevel@tonic-gate * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
36*0Sstevel@tonic-gate * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
37*0Sstevel@tonic-gate * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
38*0Sstevel@tonic-gate * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
39*0Sstevel@tonic-gate * OR MODIFICATIONS.
40*0Sstevel@tonic-gate *
41*0Sstevel@tonic-gate * $Id: ppp_mod.c,v 1.3 1999/02/26 10:53:28 paulus Exp $
42*0Sstevel@tonic-gate */
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gate #include <sys/types.h>
47*0Sstevel@tonic-gate #include <sys/conf.h>
48*0Sstevel@tonic-gate #include <sys/ddi.h>
49*0Sstevel@tonic-gate #include <sys/conf.h>
50*0Sstevel@tonic-gate #include <sys/modctl.h>
51*0Sstevel@tonic-gate #include <net/pppio.h>
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gate /*
54*0Sstevel@tonic-gate * Globals for PPP AHDLC loadable module wrapper
55*0Sstevel@tonic-gate */
56*0Sstevel@tonic-gate char _depends_on[] = "drv/sppp"; /* we need some helper routines */
57*0Sstevel@tonic-gate extern struct streamtab spppasyn_tab;
58*0Sstevel@tonic-gate extern const char spppasyn_module_description[];
59*0Sstevel@tonic-gate
60*0Sstevel@tonic-gate /*
61*0Sstevel@tonic-gate * Module linkage information for the kernel.
62*0Sstevel@tonic-gate */
63*0Sstevel@tonic-gate static struct fmodsw mod_fsw = {
64*0Sstevel@tonic-gate AHDLC_MOD_NAME, /* f_name */
65*0Sstevel@tonic-gate &spppasyn_tab, /* f_str */
66*0Sstevel@tonic-gate D_MP | D_MTPERQ /* f_flag */
67*0Sstevel@tonic-gate };
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate static struct modlstrmod modlstrmod = {
70*0Sstevel@tonic-gate &mod_strmodops, /* strmod_modops */
71*0Sstevel@tonic-gate (char *)spppasyn_module_description, /* strmod_linkinfo */
72*0Sstevel@tonic-gate &mod_fsw /* strmod_fmodsw */
73*0Sstevel@tonic-gate };
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate static struct modlinkage modlinkage = {
76*0Sstevel@tonic-gate MODREV_1, /* ml_rev, has to be MODREV_1 */
77*0Sstevel@tonic-gate &modlstrmod, /* ml_linkage, NULL-terminated list */
78*0Sstevel@tonic-gate NULL /* of linkage structures */
79*0Sstevel@tonic-gate };
80*0Sstevel@tonic-gate
81*0Sstevel@tonic-gate int
_init(void)82*0Sstevel@tonic-gate _init(void)
83*0Sstevel@tonic-gate {
84*0Sstevel@tonic-gate return (mod_install(&modlinkage));
85*0Sstevel@tonic-gate }
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gate int
_fini(void)88*0Sstevel@tonic-gate _fini(void)
89*0Sstevel@tonic-gate {
90*0Sstevel@tonic-gate return (mod_remove(&modlinkage));
91*0Sstevel@tonic-gate }
92*0Sstevel@tonic-gate
93*0Sstevel@tonic-gate int
_info(struct modinfo * modinfop)94*0Sstevel@tonic-gate _info(struct modinfo *modinfop)
95*0Sstevel@tonic-gate {
96*0Sstevel@tonic-gate return (mod_info(&modlinkage, modinfop));
97*0Sstevel@tonic-gate }
98