~ubuntu-branches/ubuntu/trusty/linux-ti-omap/trusty

« back to all changes in this revision

Viewing changes to ubuntu/ndiswrapper/wrapper.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader, Amit Kucheria
  • Date: 2010-03-23 18:05:12 UTC
  • Revision ID: james.westby@ubuntu.com-20100323180512-iavj906ocnphdubp
Tags: 2.6.33-500.3
[ Amit Kucheria ]

* [Config] Fix the debug package name to end in -dbgsym
* SAUCE: Add the ubuntu/ drivers to omap
* SAUCE: Re-export the symbols for aufs
* [Config] Enable AUFS and COMPCACHE

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2003-2005 Pontus Fuchs, Giridhar Pemmasani
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 */
 
15
 
 
16
#include "ndis.h"
 
17
#include "iw_ndis.h"
 
18
#include "loader.h"
 
19
#include "pnp.h"
 
20
#include "wrapper.h"
 
21
 
 
22
char *if_name = "wlan%d";
 
23
int proc_uid, proc_gid;
 
24
int hangcheck_interval;
 
25
static char *utils_version = UTILS_VERSION;
 
26
 
 
27
#if defined(DEBUG) && (DEBUG > 0)
 
28
int debug = DEBUG;
 
29
#else
 
30
int debug = 0;
 
31
#endif
 
32
 
 
33
WRAP_MODULE_PARM_STRING(if_name, 0400);
 
34
MODULE_PARM_DESC(if_name, "Network interface name or template "
 
35
                 "(default: wlan%d)");
 
36
WRAP_MODULE_PARM_INT(proc_uid, 0600);
 
37
MODULE_PARM_DESC(proc_uid, "The uid of the files created in /proc "
 
38
                 "(default: 0).");
 
39
WRAP_MODULE_PARM_INT(proc_gid, 0600);
 
40
MODULE_PARM_DESC(proc_gid, "The gid of the files created in /proc "
 
41
                 "(default: 0).");
 
42
WRAP_MODULE_PARM_INT(debug, 0600);
 
43
MODULE_PARM_DESC(debug, "debug level");
 
44
 
 
45
/* 0 - default value provided by NDIS driver,
 
46
 * positive value - force hangcheck interval to that many seconds
 
47
 * negative value - disable hangcheck
 
48
 */
 
49
WRAP_MODULE_PARM_INT(hangcheck_interval, 0600);
 
50
MODULE_PARM_DESC(hangcheck_interval, "The interval, in seconds, for checking"
 
51
                 " if driver is hung. (default: 0)");
 
52
 
 
53
WRAP_MODULE_PARM_STRING(utils_version, 0400);
 
54
MODULE_PARM_DESC(utils_version, "Compatible version of utils "
 
55
                 "(read only: " UTILS_VERSION ")");
 
56
 
 
57
MODULE_AUTHOR("ndiswrapper team <ndiswrapper-general@lists.sourceforge.net>");
 
58
#ifdef MODULE_DESCRIPTION
 
59
MODULE_DESCRIPTION("NDIS wrapper driver");
 
60
#endif
 
61
#ifdef MODULE_VERSION
 
62
MODULE_VERSION(DRIVER_VERSION);
 
63
#endif
 
64
MODULE_LICENSE("GPL");
 
65
 
 
66
static void module_cleanup(void)
 
67
{
 
68
        loader_exit();
 
69
#ifdef ENABLE_USB
 
70
        usb_exit();
 
71
#endif
 
72
 
 
73
        wrap_procfs_remove();
 
74
        wrapndis_exit();
 
75
        ndis_exit();
 
76
        rtl_exit();
 
77
        crt_exit();
 
78
        ntoskernel_exit();
 
79
        wrapmem_exit();
 
80
}
 
81
 
 
82
static int __init wrapper_init(void)
 
83
{
 
84
        printk(KERN_INFO "%s version %s loaded (smp=%s, preempt=%s)\n",
 
85
               DRIVER_NAME, DRIVER_VERSION,
 
86
#ifdef CONFIG_SMP
 
87
               "yes"
 
88
#else
 
89
               "no"
 
90
#endif
 
91
                ,
 
92
#ifdef CONFIG_PREEMPT_RT
 
93
                "rt"
 
94
#elif defined(CONFIG_PREEMPT)
 
95
                "yes"
 
96
#else
 
97
                "no"
 
98
#endif
 
99
                );
 
100
 
 
101
        if (wrapmem_init() || ntoskernel_init() || crt_init() ||
 
102
            rtl_init() || ndis_init() || wrapndis_init() ||
 
103
#ifdef ENABLE_USB
 
104
            usb_init() ||
 
105
#endif
 
106
            wrap_procfs_init() || loader_init()) {
 
107
                module_cleanup();
 
108
                ERROR("%s: initialization failed", DRIVER_NAME);
 
109
                return -EINVAL;
 
110
        }
 
111
        EXIT1(return 0);
 
112
}
 
113
 
 
114
static void __exit wrapper_exit(void)
 
115
{
 
116
        ENTER1("");
 
117
        module_cleanup();
 
118
}
 
119
 
 
120
module_init(wrapper_init);
 
121
module_exit(wrapper_exit);