[PATCH 2.6 IrDA] stir4200 turnaround calculation fix

2005-03-04 Thread Jean Tourrilhes
ir261_stir_turn.diff :


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 <[EMAIL PROTECTED]>
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.cMon 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();
-   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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6 IrDA] stir4200 turnaround calculation fix

2005-03-04 Thread Jean Tourrilhes
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 [EMAIL PROTECTED]
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.cMon 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;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/