Hi,
I've been looking for a bug which sometimes makes IrLAP use a very
long time to disconnect the link if the remote device is suddenly
removed. When talking to my mobile phone which has max turn time of
500 ms for tx and 100 ms for rx, it used 5 * 12 secs to disconnect
the link instead of just 12 secs.
I found a problem in irlap.c where N1 and N2 where calculated from
qos_tx, but the final timer where calculated from qos_rx. It's the
final timer which ticks the retry_count in irlap_event.c, so I think
that the following patch should be correct. It fixes the problem for
me, so please try it and check that I haven't overlooked something.
-- Dag
--- linux-2.4.3-ac5/net/irda/irlap.c Fri Apr 13 14:53:48 2001
+++ linux/net/irda/irlap.c Wed Apr 18 11:28:07 2001
@@ -1069,7 +1069,7 @@ void irlap_apply_connection_parameters(s
/* Set the negociated xbofs value */
self->next_bofs = self->qos_tx.additional_bofs.value;
- if(now)
+ if (now)
self->bofs_count = self->next_bofs;
/* Set the negociated link speed (may need the new xbofs value) */
@@ -1100,13 +1100,13 @@ void irlap_apply_connection_parameters(s
*/
self->N1 = -1; /* Disable */
else
- self->N1 = 3000 / self->qos_tx.max_turn_time.value;
+ self->N1 = 3000 / self->qos_rx.max_turn_time.value;
IRDA_DEBUG(4, "Setting N1 = %d\n", self->N1);
self->N2 = self->qos_tx.link_disc_time.value * 1000 /
- self->qos_tx.max_turn_time.value;
+ self->qos_rx.max_turn_time.value;
IRDA_DEBUG(4, "Setting N2 = %d\n", self->N2);
/*
--
Dag Brattli, Mail: [EMAIL PROTECTED]
CEO, ObexCode SUS Web: http://www.obexcode.com
Antenneveien 12 Phone: +47 776 52 806
NO-9017 Tromsoe, NORWAY Cell: +47 481 06 352
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda