Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dgrp_driver.c
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 1999-2003 Digi International (www.digi.com)
4  * Jeff Randall
5  * James Puzzo <jamesp at digi dot com>
6  * Scott Kilau <Scott_Kilau at digi dot com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
15  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  * PURPOSE. See the GNU General Public License for more details.
17  *
18  */
19 
20 /*
21  * Driver specific includes
22  */
23 #include <linux/module.h>
24 #include <linux/slab.h>
25 #include <linux/tty.h>
26 #include <linux/init.h>
27 
28 /*
29  * PortServer includes
30  */
31 #include "dgrp_common.h"
32 
33 
34 MODULE_LICENSE("GPL");
35 MODULE_AUTHOR("Digi International, http://www.digi.com");
36 MODULE_DESCRIPTION("RealPort driver for Digi's ethernet-based serial connectivity product line");
38 
41 
42 int dgrp_rawreadok = 1; /* Bypass flipbuf on input */
43 int dgrp_register_cudevices = 1;/* Turn on/off registering legacy cu devices */
44 int dgrp_register_prdevices = 1;/* Turn on/off registering transparent print */
45 int dgrp_poll_tick = 20; /* Poll interval - in ms */
46 
47 module_param_named(rawreadok, dgrp_rawreadok, int, 0644);
48 MODULE_PARM_DESC(rawreadok, "Bypass flip buffers on input");
49 
50 module_param_named(register_cudevices, dgrp_register_cudevices, int, 0644);
51 MODULE_PARM_DESC(register_cudevices, "Turn on/off registering legacy cu devices");
52 
53 module_param_named(register_prdevices, dgrp_register_prdevices, int, 0644);
54 MODULE_PARM_DESC(register_prdevices, "Turn on/off registering transparent print devices");
55 
56 module_param_named(pollrate, dgrp_poll_tick, int, 0644);
57 MODULE_PARM_DESC(pollrate, "Poll interval in ms");
58 
59 /* Driver load/unload functions */
60 static int dgrp_init_module(void);
61 static void dgrp_cleanup_module(void);
62 
63 module_init(dgrp_init_module);
64 module_exit(dgrp_cleanup_module);
65 
66 /*
67  * init_module()
68  *
69  * Module load. This is where it all starts.
70  */
71 static int dgrp_init_module(void)
72 {
73  INIT_LIST_HEAD(&nd_struct_list);
74 
79  dgrp_poll_data.timer.data = (unsigned long) &dgrp_poll_data;
80 
82 
84 
85  return 0;
86 }
87 
88 
89 /*
90  * Module unload. This is where it all ends.
91  */
92 static void dgrp_cleanup_module(void)
93 {
94  struct nd_struct *nd, *next;
95 
96  /*
97  * Attempting to free resources in backwards
98  * order of allocation, in case that helps
99  * memory pool fragmentation.
100  */
102 
104 
105 
107  dgrp_tty_uninit(nd);
108  kfree(nd);
109  }
110 }