Skip to contentSkip to conversation

stir4200 turnaround calculation fix

PATCH New Jean Tourrilhes 1 participant 1 message Mar 5, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stir4200 turnaround calculation fix

ir261_stir_turn.diff :
~~~~~~~~~~~~~~~~~~~~
<Patch from John K. Luebs>
o [CORRECT] Proper turnaround computations in the stir4200 driver
o [CORRECT] Take care of Tx packet without IrDA metadata (speed)

drivers/net/irda/stir4200.c renamed from drivers/net/irda/stir4200.d0.c +3 -2
diff -u -p linux/drivers/net/irda/stir4200.d0.c  linux/drivers/net/irda/stir4200.c
@@ -671,7 +671,8 @@ static void turnaround_delay(const struc
 		return;
 
 	do_gettimeofday(&now);
-	us -= (now.tv_sec - stir->rx_time.tv_sec) * USEC_PER_SEC;
+	if (now.tv_sec - stir->rx_time.tv_sec > 0)
+		us -= USEC_PER_SEC;
 	us -= now.tv_usec - stir->rx_time.tv_usec;
 	if (us < 10)
 		return;
@@ -787,7 +788,7 @@ static int stir_transmit_thread(void *ar
 				stir_send(stir, skb);
 			dev_kfree_skb(skb);
 
-			if (stir->speed != new_speed) {
+			if ((new_speed != -1) && (stir->speed != new_speed)) {
 				if (fifo_txwait(stir, -1) ||
 				    change_speed(stir, new_speed))
 					break;