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