Andrew Sutton wrote :
> irda buffs,
>
> quick questions about timeouts: the project i'm working on is pretty timeout
> sensitive. i have a requirement that i need to be able to unplug and replug a
> device with a minumum of wait time before the connection times out and
> resources are cleaned up. unfortunately, i don't know that much about lower
> layers of the irda protocol with respect to timeouts.
>
> there's a sysctl entry that controls the max inactive time. does that specify
> how much inaction there is on the link before a timeout occurs?
>
> also, does the irda protocol have a keep-alive signal or does the application
> have to provide an equivilant?
Here are the two sysctl you may use :
o max_inactive_time
o lap_keepalive_time
As I was the one adding them to the stack, I will explain you
what they do. By the way Werner, this is Howto material ;-)
Let assume the two devices are connected at the LAP layer. The
IrDA stack turn around the link at regular interval (RR frames). After
a certain number of RR frames not received, the stack will declare the
link dead and close it. This time is negociated between the two
devices at the LAP layer (basically pick the smaller of both end) and
called 'ldisc' (see /proc/net/irda/irlap).
'max_inactive_time' control the ldisc you will use for
negociation (but you may get a shorter time out of negociation). Valid
values are defined in IrLAP and are 3, 8, 12, 16, 20, 25, 30, 40
seconds.
Also, IrDA defines an event that is generated after 3s (an
early warning supposed to tell the user to get back in sight). For
now, this event is only plugged to the IrNET control channel ("Link
Broken" event - at ldisc the event is "Disconnected to").
Summary : 'max_inactive_time' will control how much you wait
after the device is gone until you consider the link broken.
Let assume the two devices are connected at the LAP layer. Let
assume that they close all IrLMP sockets. At this point, we don't know
if they have other things to say each other and will open new socket
of if they are done.
'lap_keepalive_time' control how much time you will keep LAP
connected after all the IrLMP socket are closed.
> an additional concern is how timeouts affect discovery. in order to ensure
> optimal pnp interoperability, i'd like to be able to rediscover a device as
> soon as its plugged in. if the device was unplugged or the link broken, i
> believe the discovery entry for that device may persist after the timeout
> occurs and i have to wait until that entry is gone before re-discovering the
> device. does the irda stack automatically remove the discovery entry after a
> timeout?
You may have seen me doing quite some work on the issue,
making sure that discovery events are propagated in timely
fashion. For now, those events are only plugged on the IrNET control
channel.
As of 2.4.10, all Discovery and Expiry events are propagated
up the stack with no delay (except passive discovery - 200ms). This
allow a user space program to act as soon as the IrDA stack discover a
device.
However, the speed of discovery is contrained by the period of
the discover frame. Discovery happens every 3s, so you may wait up to 3s.
> any help is greatly appreciated. thanks,
>
> Andrew Sutton
Good luck...
Jean
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda