diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
commit | e308faf24f68e262d92d294a01ddca7a17e76762 (patch) | |
tree | 22c47cb315811834861f013067878ff664e95abd /net/x25/x25_out.c | |
parent | 30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff) |
Sync with Linux 2.1.46.
Diffstat (limited to 'net/x25/x25_out.c')
-rw-r--r-- | net/x25/x25_out.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index 321baa5d6..aa8fc2c1b 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c @@ -1,5 +1,5 @@ /* - * X.25 Packet Layer release 001 + * X.25 Packet Layer release 002 * * This is ALPHA test software. This code may break your machine, randomly fail to work with new * releases, misbehave and/or generally screw up. It might even work. @@ -14,6 +14,7 @@ * * History * X.25 001 Jonathan Naylor Started coding. + * X.25 002 Jonathan Naylor New timer architecture. */ #include <linux/config.h> @@ -129,7 +130,8 @@ void x25_kick(struct sock *sk) unsigned short end; int modulus; - del_timer(&sk->timer); + if (sk->protinfo.x25->state != X25_STATE_3) + return; /* * Transmit interrupt data. @@ -140,38 +142,39 @@ void x25_kick(struct sock *sk) x25_transmit_link(skb, sk->protinfo.x25->neighbour); } + if (sk->protinfo.x25->condition & X25_COND_PEER_RX_BUSY) + return; + + if (skb_peek(&sk->write_queue) == NULL) + return; + modulus = (sk->protinfo.x25->neighbour->extended) ? X25_EMODULUS : X25_SMODULUS; end = (sk->protinfo.x25->va + sk->protinfo.x25->facilities.winsize_out) % modulus; + if (sk->protinfo.x25->vs == end) + return; + /* - * Transmit normal stream data. + * Transmit data until either we're out of data to send or + * the window is full. */ - if (!(sk->protinfo.x25->condition & X25_COND_PEER_RX_BUSY) && - sk->protinfo.x25->vs != end && - skb_peek(&sk->write_queue) != NULL) { - /* - * Transmit data until either we're out of data to send or - * the window is full. - */ - skb = skb_dequeue(&sk->write_queue); + skb = skb_dequeue(&sk->write_queue); - do { - /* - * Transmit the frame. - */ - x25_send_iframe(sk, skb); + do { + /* + * Transmit the frame. + */ + x25_send_iframe(sk, skb); - sk->protinfo.x25->vs = (sk->protinfo.x25->vs + 1) % modulus; + sk->protinfo.x25->vs = (sk->protinfo.x25->vs + 1) % modulus; - } while (sk->protinfo.x25->vs != end && (skb = skb_dequeue(&sk->write_queue)) != NULL); + } while (sk->protinfo.x25->vs != end && (skb = skb_dequeue(&sk->write_queue)) != NULL); - sk->protinfo.x25->vl = sk->protinfo.x25->vr; - sk->protinfo.x25->condition &= ~X25_COND_ACK_PENDING; - sk->protinfo.x25->timer = 0; - } + sk->protinfo.x25->vl = sk->protinfo.x25->vr; + sk->protinfo.x25->condition &= ~X25_COND_ACK_PENDING; - x25_set_timer(sk); + x25_stop_timer(sk); } /* @@ -188,7 +191,8 @@ void x25_enquiry_response(struct sock *sk) sk->protinfo.x25->vl = sk->protinfo.x25->vr; sk->protinfo.x25->condition &= ~X25_COND_ACK_PENDING; - sk->protinfo.x25->timer = 0; + + x25_stop_timer(sk); } void x25_check_iframes_acked(struct sock *sk, unsigned short nr) |