Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79502
b: refs/heads/master
c: 91cde6f
h: refs/heads/master
v: v3
  • Loading branch information
Ross Burton authored and David S. Miller committed Jan 28, 2008
1 parent 78063d6 commit a7e7933
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0e1899bdbd5e997d2256fcc23fc4e3d2bc5f811
refs/heads/master: 91cde6f7d295a9eafea51d821f6e609288736c79
7 changes: 5 additions & 2 deletions trunk/net/irda/irlmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ int __init irlmp_init(void)
irlmp->last_lsap_sel = 0x0f; /* Reserved 0x00-0x0f */
strcpy(sysctl_devname, "Linux");

/* Do discovery every 3 seconds */
init_timer(&irlmp->discovery_timer);
irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ);

/* Do discovery every 3 seconds, conditionaly */
if (sysctl_discovery)
irlmp_start_discovery_timer(irlmp,
sysctl_discovery_timeout*HZ);

return 0;
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/net/irda/irlmp_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ void irlmp_discovery_timer_expired(void *data)
/* We always cleanup the log (active & passive discovery) */
irlmp_do_expiry();

/* Active discovery is conditional */
if (sysctl_discovery)
irlmp_do_discovery(sysctl_discovery_slots);
irlmp_do_discovery(sysctl_discovery_slots);

/* Restart timer */
irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout * HZ);
Expand Down
28 changes: 27 additions & 1 deletion trunk/net/irda/irsysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/init.h>

#include <net/irda/irda.h> /* irda_debug */
#include <net/irda/irlmp.h>
#include <net/irda/timer.h>
#include <net/irda/irias_object.h>

extern int sysctl_discovery;
Expand All @@ -45,6 +47,8 @@ extern int sysctl_max_noreply_time;
extern int sysctl_warn_noreply_time;
extern int sysctl_lap_keepalive_time;

extern struct irlmp_cb *irlmp;

/* this is needed for the proc_dointvec_minmax - Jean II */
static int max_discovery_slots = 16; /* ??? */
static int min_discovery_slots = 1;
Expand Down Expand Up @@ -85,6 +89,27 @@ static int do_devname(ctl_table *table, int write, struct file *filp,
return ret;
}


static int do_discovery(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;

ret = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if (ret)
return ret;

if (irlmp == NULL)
return -ENODEV;

if (sysctl_discovery)
irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ);
else
del_timer_sync(&irlmp->discovery_timer);

return ret;
}

/* One file */
static ctl_table irda_table[] = {
{
Expand All @@ -93,7 +118,8 @@ static ctl_table irda_table[] = {
.data = &sysctl_discovery,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
.proc_handler = &do_discovery,
.strategy = &sysctl_intvec
},
{
.ctl_name = NET_IRDA_DEVNAME,
Expand Down

0 comments on commit a7e7933

Please sign in to comment.