Commit 685ed2fb authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by David S. Miller

[IRDA]: stir4200 turnaround calculation fix

	<Patch from John K. Luebs>
Proper turnaround computations in the stir4200 driver
Take care of Tx packet without IrDA metadata (speed)
Signed-off-by: default avatarJohn K. Luebs <jkluebs@lu...>
Signed-off-by: default avatarJean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fcf21c6
......@@ -671,7 +671,8 @@ static void turnaround_delay(const struct stir_cb *stir, long us)
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 *arg)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment