X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=linux%2Fmppe%2Fppp_mppe_compress.c;h=efdb5d15e95af072a6f8b8a1a571760c8fdd2cb1;hp=8b62ba734370af7876e1065042f92c88fb0e44c8;hb=ca1af9f74dc0f333c80eb2fa10a4b80306dc4040;hpb=bdcfa30186a72e80c4cb753a5ee03befc34fda4b diff --git a/linux/mppe/ppp_mppe_compress.c b/linux/mppe/ppp_mppe_compress.c index 8b62ba7..efdb5d1 100644 --- a/linux/mppe/ppp_mppe_compress.c +++ b/linux/mppe/ppp_mppe_compress.c @@ -2,7 +2,7 @@ * ==FILEVERSION 20020320== * * ppp_mppe_compress.c - interface MPPE to the PPP code. - * This version is for use with Linux kernel 2.2.x (ppp driver 2.3.x). + * This version is for use with Linux kernel 2.2.19+ and 2.4.x. * * By Frank Cusack . * Copyright (c) 2002 Google, Inc. @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -559,7 +559,7 @@ mppe_incomp(void *arg, unsigned char *ibuf, int icnt) * Module interface table *************************************************************/ -/* These are in ppp.c */ +/* These are in ppp.c (2.2.x) or ppp_generic.c (2.4.x) */ extern int ppp_register_compressor (struct compressor *cp); extern void ppp_unregister_compressor (struct compressor *cp); @@ -583,7 +583,19 @@ struct compressor ppp_mppe = { mppe_comp_stats, /* decomp_stat */ }; -__initfunc(int ppp_mppe_install(void)) +/* 2.2 compatibility defines */ +#ifndef __init +#define __init +#endif +#ifndef __exit +#define __exit +#endif +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + +int __init +ppp_mppe_init(void) { int answer = ppp_register_compressor(&ppp_mppe); @@ -592,20 +604,12 @@ __initfunc(int ppp_mppe_install(void)) return answer; } -#ifdef MODULE - -int -init_module(void) -{ - return ppp_mppe_install(); -} - -void -cleanup_module(void) +void __exit +ppp_mppe_cleanup(void) { - if (MOD_IN_USE) - printk(KERN_INFO "PPP MPPE Compression module busy\n"); - else - ppp_unregister_compressor(&ppp_mppe); + ppp_unregister_compressor(&ppp_mppe); } -#endif + +module_init(ppp_mppe_init); +module_exit(ppp_mppe_cleanup); +MODULE_LICENSE("BSD without advertisement clause");