2005-03-05 00:43:44

by Jean Tourrilhes

[permalink] [raw]
Subject: [PATCH 2.6 IrDA] 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)
Signed-off-by: John K. Luebs <jkluebs@lu...>
Signed-off-by: Jean Tourrilhes <[email protected]>


diff -u -p linux/drivers/net/irda/stir4200.d0.c linux/drivers/net/irda/stir4200.c
--- linux/drivers/net/irda/stir4200.d0.c Mon Feb 7 16:35:45 2005
+++ linux/drivers/net/irda/stir4200.c Mon Feb 7 16:37:25 2005
@@ -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;