patch-2.1.25 linux/net/rose/rose_link.c
Next file: linux/net/rose/rose_out.c
Previous file: linux/net/rose/rose_in.c
Back to the patch index
Back to the overall index
- Lines: 137
- Date:
Sun Feb 2 15:18:52 1997
- Orig file:
v2.1.24/linux/net/rose/rose_link.c
- Orig date:
Thu Jan 23 21:06:59 1997
diff -u --recursive --new-file v2.1.24/linux/net/rose/rose_link.c linux/net/rose/rose_link.c
@@ -44,37 +44,20 @@
static void rose_link_timer(unsigned long);
/*
- * Linux set/reset timer routines
+ * Linux set timer
*/
-static void rose_link_set_timer(struct rose_neigh *neigh)
+void rose_link_set_timer(struct rose_neigh *neigh)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ save_flags(flags); cli();
del_timer(&neigh->timer);
restore_flags(flags);
- neigh->timer.next = neigh->timer.prev = NULL;
neigh->timer.data = (unsigned long)neigh;
neigh->timer.function = &rose_link_timer;
-
neigh->timer.expires = jiffies + 10;
- add_timer(&neigh->timer);
-}
-
-static void rose_link_reset_timer(struct rose_neigh *neigh)
-{
- unsigned long flags;
- save_flags(flags);
- cli();
- del_timer(&neigh->timer);
- restore_flags(flags);
-
- neigh->timer.data = (unsigned long)neigh;
- neigh->timer.function = &rose_link_timer;
- neigh->timer.expires = jiffies + 10;
add_timer(&neigh->timer);
}
@@ -88,19 +71,22 @@
{
struct rose_neigh *neigh = (struct rose_neigh *)param;
- if (neigh->t0timer == 0 || --neigh->t0timer > 0) {
- rose_link_reset_timer(neigh);
- return;
- }
+ if (neigh->ftimer > 0)
+ neigh->ftimer--;
- /*
- * T0 for a link has expired.
- */
- rose_transmit_restart_request(neigh);
+ if (neigh->t0timer > 0) {
+ neigh->t0timer--;
- neigh->t0timer = neigh->t0;
+ if (neigh->t0timer == 0) {
+ rose_transmit_restart_request(neigh);
+ neigh->t0timer = sysctl_rose_restart_request_timeout;
+ }
+ }
- rose_link_set_timer(neigh);
+ if (neigh->ftimer > 0 || neigh->t0timer > 0)
+ rose_link_set_timer(neigh);
+ else
+ del_timer(&neigh->timer);
}
/*
@@ -117,7 +103,7 @@
else
rose_call = &rose_callsign;
- return ax25_send_frame(skb, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
+ return ax25_send_frame(skb, 0, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
}
/*
@@ -199,8 +185,6 @@
*dptr++ = 0x00;
*dptr++ = 0;
- skb->sk = NULL;
-
if (!rose_send_frame(skb, neigh))
kfree_skb(skb, FREE_WRITE);
}
@@ -228,8 +212,6 @@
*dptr++ = 0x00;
*dptr++ = ROSE_RESTART_CONFIRMATION;
- skb->sk = NULL;
-
if (!rose_send_frame(skb, neigh))
kfree_skb(skb, FREE_WRITE);
}
@@ -258,8 +240,6 @@
*dptr++ = ROSE_DIAGNOSTIC;
*dptr++ = diag;
- skb->sk = NULL;
-
if (!rose_send_frame(skb, neigh))
kfree_skb(skb, FREE_WRITE);
}
@@ -290,8 +270,6 @@
*dptr++ = cause;
*dptr++ = 0x00;
- skb->sk = NULL;
-
if (!rose_send_frame(skb, neigh))
kfree_skb(skb, FREE_WRITE);
}
@@ -311,8 +289,6 @@
dptr = skb_push(skb, 1);
*dptr++ = AX25_P_ROSE;
- skb->arp = 1;
-
if (neigh->restarted) {
if (!rose_send_frame(skb, neigh))
kfree_skb(skb, FREE_WRITE);
@@ -321,7 +297,7 @@
if (neigh->t0timer == 0) {
rose_transmit_restart_request(neigh);
- neigh->t0timer = neigh->t0;
+ neigh->t0timer = sysctl_rose_restart_request_timeout;
rose_link_set_timer(neigh);
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov