Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85640
b: refs/heads/master
c: 21fab4a
h: refs/heads/master
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Feb 13, 2008
1 parent aa50f79 commit f6bcd2d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 45 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: 4de211f1a279275c6c67d6e9b6b25513e46b0bb9
refs/heads/master: 21fab4a86a411c18c6b4d663ae710ca1f6206b3c
1 change: 1 addition & 0 deletions trunk/include/net/ax25.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ extern void ax25_calculate_rtt(ax25_cb *);
extern void ax25_disconnect(ax25_cb *, int);

/* ax25_timer.c */
extern void ax25_setup_timers(ax25_cb *);
extern void ax25_start_heartbeat(ax25_cb *);
extern void ax25_start_t1timer(ax25_cb *);
extern void ax25_start_t2timer(ax25_cb *);
Expand Down
6 changes: 1 addition & 5 deletions trunk/net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,7 @@ ax25_cb *ax25_create_cb(void)
skb_queue_head_init(&ax25->ack_queue);
skb_queue_head_init(&ax25->reseq_queue);

init_timer(&ax25->timer);
init_timer(&ax25->t1timer);
init_timer(&ax25->t2timer);
init_timer(&ax25->t3timer);
init_timer(&ax25->idletimer);
ax25_setup_timers(ax25);

ax25_fillin_cb(ax25, NULL);

Expand Down
60 changes: 21 additions & 39 deletions trunk/net/ax25/ax25_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,63 +40,45 @@ static void ax25_t2timer_expiry(unsigned long);
static void ax25_t3timer_expiry(unsigned long);
static void ax25_idletimer_expiry(unsigned long);

void ax25_start_heartbeat(ax25_cb *ax25)
void ax25_setup_timers(ax25_cb *ax25)
{
del_timer(&ax25->timer);

ax25->timer.data = (unsigned long)ax25;
ax25->timer.function = &ax25_heartbeat_expiry;
ax25->timer.expires = jiffies + 5 * HZ;
setup_timer(&ax25->timer, ax25_heartbeat_expiry, (unsigned long)ax25);
setup_timer(&ax25->t1timer, ax25_t1timer_expiry, (unsigned long)ax25);
setup_timer(&ax25->t2timer, ax25_t2timer_expiry, (unsigned long)ax25);
setup_timer(&ax25->t3timer, ax25_t3timer_expiry, (unsigned long)ax25);
setup_timer(&ax25->idletimer, ax25_idletimer_expiry,
(unsigned long)ax25);
}

add_timer(&ax25->timer);
void ax25_start_heartbeat(ax25_cb *ax25)
{
mod_timer(&ax25->timer, jiffies + 5 * HZ);
}

void ax25_start_t1timer(ax25_cb *ax25)
{
del_timer(&ax25->t1timer);

ax25->t1timer.data = (unsigned long)ax25;
ax25->t1timer.function = &ax25_t1timer_expiry;
ax25->t1timer.expires = jiffies + ax25->t1;

add_timer(&ax25->t1timer);
mod_timer(&ax25->t1timer, jiffies + ax25->t1);
}

void ax25_start_t2timer(ax25_cb *ax25)
{
del_timer(&ax25->t2timer);

ax25->t2timer.data = (unsigned long)ax25;
ax25->t2timer.function = &ax25_t2timer_expiry;
ax25->t2timer.expires = jiffies + ax25->t2;

add_timer(&ax25->t2timer);
mod_timer(&ax25->t2timer, jiffies + ax25->t2);
}

void ax25_start_t3timer(ax25_cb *ax25)
{
del_timer(&ax25->t3timer);

if (ax25->t3 > 0) {
ax25->t3timer.data = (unsigned long)ax25;
ax25->t3timer.function = &ax25_t3timer_expiry;
ax25->t3timer.expires = jiffies + ax25->t3;

add_timer(&ax25->t3timer);
}
if (ax25->t3 > 0)
mod_timer(&ax25->t3timer, jiffies + ax25->t3);
else
del_timer(&ax25->t3timer);
}

void ax25_start_idletimer(ax25_cb *ax25)
{
del_timer(&ax25->idletimer);

if (ax25->idle > 0) {
ax25->idletimer.data = (unsigned long)ax25;
ax25->idletimer.function = &ax25_idletimer_expiry;
ax25->idletimer.expires = jiffies + ax25->idle;

add_timer(&ax25->idletimer);
}
if (ax25->idle > 0)
mod_timer(&ax25->idletimer, jiffies + ax25->idle);
else
del_timer(&ax25->idletimer);
}

void ax25_stop_heartbeat(ax25_cb *ax25)
Expand Down

0 comments on commit f6bcd2d

Please sign in to comment.