mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.5 IrDA] IrLAP retry count
@ 2003-08-08 18:51 Jean Tourrilhes
  0 siblings, 0 replies; only message in thread
From: Jean Tourrilhes @ 2003-08-08 18:51 UTC (permalink / raw)
  To: Jeff Garzik, Linux kernel mailing list

ir260_lap_retry_count.diff :
~~~~~~~~~~~~~~~~~~~~~~~~~~
	o [CORRECT] add interoperability workaround for 2.4.X IrDA stacks


diff -u -p linux/net/irda/irlap_event.d2.c linux/net/irda/irlap_event.c
--- linux/net/irda/irlap_event.d2.c	Fri Jul 18 11:08:41 2003
+++ linux/net/irda/irlap_event.c	Fri Jul 18 11:30:47 2003
@@ -1215,35 +1215,31 @@ static int irlap_state_nrm_p(struct irla
 		 *  Check for expected I(nformation) frame
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) {
-			/*  poll bit cleared?  */
-			if (!info->pf) {
-				self->vr = (self->vr + 1) % 8;
 
-				/* Update Nr received */
-				irlap_update_nr_received( self, info->nr);
+			/* Update Vr (next frame for us to receive) */
+			self->vr = (self->vr + 1) % 8;
 
-				self->ack_required = TRUE;
+			/* Update Nr received, cleanup our retry queue */
+			irlap_update_nr_received(self, info->nr);
+
+			/*
+			 *  Got expected NR, so reset the
+			 *  retry_count. This is not done by IrLAP spec,
+			 *  which is strange!
+			 */
+			self->retry_count = 0;
+			self->ack_required = TRUE;
 
+			/*  poll bit cleared?  */
+			if (!info->pf) {
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_P);
 
 				irlap_data_indication(self, skb, FALSE);
 			} else {
+				/* No longer waiting for pf */
 				del_timer(&self->final_timer);
 
-				self->vr = (self->vr + 1) % 8;
-
-				/* Update Nr received */
-				irlap_update_nr_received(self, info->nr);
-
-				/*
-				 *  Got expected NR, so reset the
-				 *  retry_count. This is not done by IrLAP,
-				 *  which is strange!
-				 */
-				self->retry_count = 0;
-				self->ack_required = TRUE;
-
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 
 				/* Call higher layer *before* changing state
@@ -1869,14 +1865,17 @@ static int irlap_state_nrm_s(struct irla
 		 *  Check for expected I(nformation) frame
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) {
+
+			/* Update Vr (next frame for us to receive) */
+			self->vr = (self->vr + 1) % 8;
+
+			/* Update Nr received */
+			irlap_update_nr_received(self, info->nr);
+
 			/*
 			 *  poll bit cleared?
 			 */
 			if (!info->pf) {
-				self->vr = (self->vr + 1) % 8;
-
-				/* Update Nr received */
-				irlap_update_nr_received(self, info->nr);
 
 				self->ack_required = TRUE;
 
@@ -1893,11 +1892,6 @@ static int irlap_state_nrm_s(struct irla
 				irlap_data_indication(self, skb, FALSE);
 				break;
 			} else {
-				self->vr = (self->vr + 1) % 8;
-
-				/* Update Nr received */
-				irlap_update_nr_received(self, info->nr);
-
 				/*
 				 *  We should wait before sending RR, and
 				 *  also before changing to XMIT_S

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-08 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-08 18:51 [PATCH 2.5 IrDA] IrLAP retry count Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®