diff options
Diffstat (limited to 'net/irda/irsysctl.c')
-rw-r--r-- | net/irda/irsysctl.c | 28 |
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 | ||
34 | extern int sysctl_discovery; | 36 | extern int sysctl_discovery; |
@@ -45,6 +47,8 @@ extern int sysctl_max_noreply_time; | |||
45 | extern int sysctl_warn_noreply_time; | 47 | extern int sysctl_warn_noreply_time; |
46 | extern int sysctl_lap_keepalive_time; | 48 | extern int sysctl_lap_keepalive_time; |
47 | 49 | ||
50 | extern 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 */ |
49 | static int max_discovery_slots = 16; /* ??? */ | 53 | static int max_discovery_slots = 16; /* ??? */ |
50 | static int min_discovery_slots = 1; | 54 | static 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 | |||
93 | static 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 */ |
89 | static ctl_table irda_table[] = { | 114 | static 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, |