aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irsysctl.c
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2008-01-22 21:27:53 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:54 -0500
commit91cde6f7d295a9eafea51d821f6e609288736c79 (patch)
tree8465492a91f93aad746437468510aed76e421c53 /net/irda/irsysctl.c
parentc0e1899bdbd5e997d2256fcc23fc4e3d2bc5f811 (diff)
[IrDA]: LMP discovery timer not started by default
By default, LMP sets up a 3 seconds timer for discovery. We don't need it until discovery is set to 1. Signed-off-by: Ross Burton <ross@openedhand.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irsysctl.c')
-rw-r--r--net/irda/irsysctl.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index d8aba869ff11..9ab3df15425d 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -29,6 +29,8 @@
29#include <linux/init.h> 29#include <linux/init.h>
30 30
31#include <net/irda/irda.h> /* irda_debug */ 31#include <net/irda/irda.h> /* irda_debug */
32#include <net/irda/irlmp.h>
33#include <net/irda/timer.h>
32#include <net/irda/irias_object.h> 34#include <net/irda/irias_object.h>
33 35
34extern int sysctl_discovery; 36extern int sysctl_discovery;
@@ -45,6 +47,8 @@ extern int sysctl_max_noreply_time;
45extern int sysctl_warn_noreply_time; 47extern int sysctl_warn_noreply_time;
46extern int sysctl_lap_keepalive_time; 48extern int sysctl_lap_keepalive_time;
47 49
50extern struct irlmp_cb *irlmp;
51
48/* this is needed for the proc_dointvec_minmax - Jean II */ 52/* this is needed for the proc_dointvec_minmax - Jean II */
49static int max_discovery_slots = 16; /* ??? */ 53static int max_discovery_slots = 16; /* ??? */
50static int min_discovery_slots = 1; 54static int min_discovery_slots = 1;
@@ -85,6 +89,27 @@ static int do_devname(ctl_table *table, int write, struct file *filp,
85 return ret; 89 return ret;
86} 90}
87 91
92
93static int do_discovery(ctl_table *table, int write, struct file *filp,
94 void __user *buffer, size_t *lenp, loff_t *ppos)
95{
96 int ret;
97
98 ret = proc_dointvec(table, write, filp, buffer, lenp, ppos);
99 if (ret)
100 return ret;
101
102 if (irlmp == NULL)
103 return -ENODEV;
104
105 if (sysctl_discovery)
106 irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ);
107 else
108 del_timer_sync(&irlmp->discovery_timer);
109
110 return ret;
111}
112
88/* One file */ 113/* One file */
89static ctl_table irda_table[] = { 114static ctl_table irda_table[] = {
90 { 115 {
@@ -93,7 +118,8 @@ static ctl_table irda_table[] = {
93 .data = &sysctl_discovery, 118 .data = &sysctl_discovery,
94 .maxlen = sizeof(int), 119 .maxlen = sizeof(int),
95 .mode = 0644, 120 .mode = 0644,
96 .proc_handler = &proc_dointvec 121 .proc_handler = &do_discovery,
122 .strategy = &sysctl_intvec
97 }, 123 },
98 { 124 {
99 .ctl_name = NET_IRDA_DEVNAME, 125 .ctl_name = NET_IRDA_DEVNAME,