patch-2.4.1 linux/net/x25/x25_subr.c

Next file: linux/net/x25/x25_timer.c
Previous file: linux/net/x25/x25_route.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0/linux/net/x25/x25_subr.c linux/net/x25/x25_subr.c
@@ -19,8 +19,6 @@
  *					  negotiation.
  */
 
-#include <linux/config.h>
-#if defined(CONFIG_X25) || defined(CONFIG_X25_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -351,4 +349,18 @@
 	sk->dead = 1;
 }
 
-#endif
+/*
+ * Clear an own-rx-busy condition and tell the peer about this, provided
+ * that there is a significant amount of free receive buffer space available.
+ */
+void x25_check_rbuf(struct sock *sk)
+{
+	if (atomic_read(&sk->rmem_alloc) < (sk->rcvbuf / 2) &&
+	    (sk->protinfo.x25->condition & X25_COND_OWN_RX_BUSY)) {
+		sk->protinfo.x25->condition &= ~X25_COND_OWN_RX_BUSY;
+		sk->protinfo.x25->condition &= ~X25_COND_ACK_PENDING;
+		sk->protinfo.x25->vl         = sk->protinfo.x25->vr;
+		x25_write_internal(sk, X25_RR);
+		x25_stop_timer(sk);
+	}
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)