mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Jeff Garzik <jgarzik@pobox.com>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.5 IrDA] IrLAP retry count
Date: Fri, 8 Aug 2003 11:51:55 -0700	[thread overview]
Message-ID: <20030808185155.GC13274@bougret.hpl.hp.com> (raw)

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

                 reply	other threads:[~2003-08-08 18:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030808185155.GC13274@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=jgarzik@pobox.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®