patch-2.1.96 linux/net/rose/rose_in.c

Next file: linux/net/rose/rose_link.c
Previous file: linux/net/rose/rose_dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.95/linux/net/rose/rose_in.c linux/net/rose/rose_in.c
@@ -141,10 +141,6 @@
 
 		case ROSE_RR:
 		case ROSE_RNR:
-			if (frametype == ROSE_RNR)
-				sk->protinfo.rose->condition |= ROSE_COND_PEER_RX_BUSY;
-			else
-				sk->protinfo.rose->condition &= ~ROSE_COND_PEER_RX_BUSY;
 			if (!rose_validate_nr(sk, nr)) {
 				rose_write_internal(sk, ROSE_RESET_REQUEST);
 				sk->protinfo.rose->condition = 0x00;
@@ -157,8 +153,11 @@
 				rose_stop_idletimer(sk);
 			} else {
 				rose_frames_acked(sk, nr);
-				if (frametype == ROSE_RNR)
-					rose_requeue_frames(sk);
+				if (frametype == ROSE_RNR) {
+					sk->protinfo.rose->condition |= ROSE_COND_PEER_RX_BUSY;
+				} else {
+					sk->protinfo.rose->condition &= ~ROSE_COND_PEER_RX_BUSY;
+				}
 			}
 			break;
 
@@ -177,16 +176,26 @@
 				break;
 			}
 			rose_frames_acked(sk, nr);
-			if (sk->protinfo.rose->condition & ROSE_COND_OWN_RX_BUSY)
-				break;
 			if (ns == sk->protinfo.rose->vr) {
 				rose_start_idletimer(sk);
 				if (sock_queue_rcv_skb(sk, skb) == 0) {
 					sk->protinfo.rose->vr = (sk->protinfo.rose->vr + 1) % ROSE_MODULUS;
 					queued = 1;
 				} else {
-					sk->protinfo.rose->condition |= ROSE_COND_OWN_RX_BUSY;
+					/* Should never happen ! */
+					rose_write_internal(sk, ROSE_RESET_REQUEST);
+					sk->protinfo.rose->condition = 0x00;
+					sk->protinfo.rose->vs        = 0;
+					sk->protinfo.rose->vr        = 0;
+					sk->protinfo.rose->va        = 0;
+					sk->protinfo.rose->vl        = 0;
+					sk->protinfo.rose->state     = ROSE_STATE_4;
+					rose_start_t2timer(sk);
+					rose_stop_idletimer(sk);
+					break;
 				}
+				if (atomic_read(&sk->rmem_alloc) > (sk->rcvbuf / 2))
+					sk->protinfo.rose->condition |= ROSE_COND_OWN_RX_BUSY;
 			}
 			/*
 			 * If the window is full, ack the frame, else start the

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov