diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2009-03-20 19:42:10 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-03-07 09:23:52 +0100 |
commit | 47682c55a03fe87664d84e3f7b3cbe6a418ab9af (patch) | |
tree | 79c760eb555e6a65a3f9d10b7cd391db0edb2fa9 | |
parent | c470abd4fde40ea6a0846a2beab642a578c0b8cd (diff) |
NET: Fix 6pack timersax25-6pack-timer-fixes
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | drivers/net/hamradio/6pack.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 922bf440e9f1..ea5deb5bc520 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -522,14 +522,9 @@ static void resync_tnc(unsigned long channel) sp->tty->ops->write(sp->tty, &sp->led_state, 1); sp->tty->ops->write(sp->tty, &resync_cmd, 1); - /* Start resync timer again -- the TNC might be still absent */ - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); + mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT); } static inline int tnc_init(struct sixpack *sp) @@ -540,10 +535,10 @@ static inline int tnc_init(struct sixpack *sp) sp->tty->ops->write(sp->tty, &inbyte, 1); - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; + init_timer(&sp->resync_t); + sp->resync_t.data = (unsigned long) sp; + sp->resync_t.function = resync_tnc; + sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; add_timer(&sp->resync_t); return 0; @@ -627,8 +622,6 @@ static int sixpack_open(struct tty_struct *tty) sp->tx_t.function = sp_xmit_on_air; sp->tx_t.data = (unsigned long) sp; - init_timer(&sp->resync_t); - spin_unlock_bh(&sp->lock); /* Done. We have linked the TTY line to a channel. */ @@ -926,13 +919,8 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd) /* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ - if (sp->tnc_state == TNC_IN_SYNC) { - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_INIT_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); - } + if (sp->tnc_state == TNC_IN_SYNC) + mod_timer(&sp->resync_t, jiffies + SIXP_INIT_RESYNC_TIMEOUT); sp->status1 = cmd & SIXP_PRIO_DATA_MASK; } @@ -997,7 +985,7 @@ sixpack_decode(struct sixpack *sp, const unsigned char *pre_rbuff, int count) inbyte = pre_rbuff[count1]; if (inbyte == SIXP_FOUND_TNC) { tnc_set_sync_state(sp, TNC_IN_SYNC); - del_timer(&sp->resync_t); + mod_timer(&sp->resync_t, SIXP_INIT_RESYNC_TIMEOUT); } if ((inbyte & SIXP_PRIO_CMD_MASK) != 0) decode_prio_command(sp, inbyte); @@ -1008,7 +996,7 @@ sixpack_decode(struct sixpack *sp, const unsigned char *pre_rbuff, int count) } } -MODULE_AUTHOR("Ralf Baechle DO1GRB <ralf@linux-mips.org>"); +MODULE_AUTHOR("Ralf Baechle DL5RB <ralf@linux-mips.org>"); MODULE_DESCRIPTION("6pack driver for AX.25"); MODULE_LICENSE("GPL"); MODULE_ALIAS_LDISC(N_6PACK); |