Next Previous Contents

5. Configuration

5.1 General Configuration

5.2 IrManager

Dag Brattli wrote: " IrManager [...].is a user-space daemon that is inspired and quite similar to the cardmgr used in the PCMCIA distribution.

The IrManager will receive events from the kernel level side of the protocol stack. When the IrManager receives an event it can execute shell commands and scripts, so I have added the /etc/irda directory which will contain such scripts. [...]

For example, if IrLMP discovers a remote device with IrLAN provider capabilities and no local IrLAN client has registered, then IrLMP will send an event to the IrManager and make it "modprobe" the module required. [...]

When application level clients are ready for communication and user-space configuration, they can also notify IrManager about this, so that it can execute the right script. For example IrLAN will send the event EVENT_IRLAN_START when the data channel is ready for exchanging Ethernet frames. When IrManager receives this event, it will execute /etc/irda/network start <devname> to configure the network interface. This network script is actually the same as used by the PCMCIA code and since I'm using the Redhat variant of it, it will in turn execute /sbin/ifup <devname>.

So by using the IrManager, I "only" have to do this when I start the stack:


irattach /dev/ttyS2 &
irmanager -d 1           # -d 1 means: start discovery process

and then when my laptop discovers the IrLAN provider (HP Netbeamer in my case) it will ask IrManager to load the module irlan_client. When the connection is up and ready, it will ask it to execute /etc/irda/network start eth0. When the connection is broken, it will again ask it to take down the interface using /etc/irda/network stop eth0.[...]

That's all to get it working if you are using Redhat. If you are using some other distribution which doesn't have /sbin/ifup, then you better copy /etc/pcmcia/network.opts to /etc/irda/network.opts or configure the file yourself.

If you want to use the IrLAN server, you will still have to modprobe irlan_server before you start the irmanager _without_ -d 1.

And just like the cardmgr, you will (if you want to) get the beeps when the connection is up and running and when it is disconnected!!!

I hope that we can add such scripts for all the other clients/services that need user level configuration. It would be really cool to have a /etc/irda/printer script for configuring IrDA(TM) capable printers. So if you get in range of an IrDA(TM) capable printer, then IrManager should load the irlpt_client module, and also configure the other stuff that needs to be done for using this printer.

I also hope that we can use the config file for configuring IrDA(TM) ports and device drivers. Something like:


Device Drivers
  module "irtty" script="irattach /dev/ttyS2"
  module "smc_ircc" irq=11 port=0x34f

So that IrManager can load and start all these when it is executed. In this way we would only have to start IrManager in /etc/rc.d/init.d/irda and the rest would be plug and play. There would be no need for manually starting programs and configuring devices. When irmanager receives the following events for a device <dev> it will currently do:

EVENT_IRLAN_START, start and configure the device using /sbin/ifup <dev>

EVENT_IRLAN_STOP, close the device using /sbin/ifdown <dev>

This can however be easily changed by the user, if this is not what is the prefered behaviour.

5.3 Low Level Drivers

There are three sorts of low level drivers: SIR, dongle and FIR. If the right driver is detected by the kernel you get a message like:


IrDA irda_device irda0 registered.

SIR

Jan  2 12:57:26 japh kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A
Jan  2 12:57:26 japh kernel: ttyS02 at 0x03e8 (irq = 4) is a 16550A
Jan  2 12:57:26 japh kernel: Linux Support for the IrDA (tm) protocols (Dag Brattli)
Jan  2 12:59:09 japh syslog: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Jan  2 12:59:09 japh syslog: Setting discovery to 1 exited with status 1
Jan  2 12:59:09 japh syslog: + 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli
Jan  2 12:59:09 japh syslog: + 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli
Jan  2 12:59:09 japh syslog: Serial connection established.
Jan  2 12:59:09 japh kernel: IrDA irda_device irda0 registered.
Jan  2 13:01:22 japh syslog: executing: './drivers start '
Jan  2 13:01:22 japh syslog: Serial connection established.
Jan  2 13:01:42 japh syslogd: Printing partial message
Jan  2 13:01:42 japh 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli 
Jan  2 13:02:49 japh kernel: IrDA Discovered: japh
Jan  2 13:02:49 japh kernel:     Services: Computer 

Dongle Connection - Infrared Adapters for the Serial Port

The currently supported dongles are the Extended Systems Inc. ESI-9680 JetEye, the Tekram IRmate 210B, the ACTiSYS IR220L and 220L+, the Greenwich GIrBIL. dongle.

Dag Brattli wrote (modified by wh): "To use dongles you have to do something like this:


modprobe tekram         # or esi or actisys
irmanager -d 1          # 
irattach -d tekram      # or -d esi or -d actisys

As you can see, you must still use the -d option with irattach since it is possible to have two serial ports using different dongles at the same time (so the tty you are binding must know which dongle it is supposed to use). So if you have two dongles and two serial ports, you could do something like this:
modprobe tekram
modprobe esi
irattach /dev/ttyS0 -d esi &
irattach /dev/ttyS1 -d tekram &

PS: I would not try to turn the two dongles against each other, since I really don't know how the stack would react :-) ... Since I don't have any of these new ACTiSYS 220L+ dongles, I'm not able to test it. Since the new dongle has support for one extra speed (38400bps), you must specify the dongles differently with irattach so that the kernel knows which dongle you are using (and what QoS can be used):
irattach /dev/ttyS0 -d actisys     # for the 220L dongle 
irattach /dev/ttyS0 -d actisys+    # for the 220L+ dongle

The current implementation of dongle support does not have any state associated with it, so its not possible to use both ACTiSYS dongles (220L and 220L+) at the same time (connected to two serial ports) for now. If someone needs to be able to do so, please mail me (Dag Brattli) and I will think about it!"

Note: When I tried to use an infrared modem (Swissmod 56Ki, manufactured by Telelink AG) connected to my laptop (IrDA works with Window$95 only, due to non standard hardware) I had to remove the infrared support in the BIOS to get it working!

Dongle Connection - Infrared Motherboard Adapter

Support for the ACTiSYS IR2000 dongle has been implemented in a file called pc87108 which you can either compile into the kernel or insmod/modprobe to insert the module:


irmanager -d 1
modprobe pc87108

or insert modprobe pc87108 into the /etc/irda/drivers file (I think).

Fast InfraRed (FIR)

The IrDA(TM) standard knows three kinds of speeds:

  1. SIR = Standard IrDA, up to 115kbps IrDA,
  2. MIR = Medium Speed IrDA,
  3. FIR = Fast IrDA (4Mbps),
  4. VFIR = Very Fast IrDA(16Mbps), seems to become a future standard
Up to 115.200bps many infrared controllers work like a serial port. Up to 4Mbps they work in "FIR mode". Currently there are two chips supported: NationalSemiConductor NSC PC87108 e.g. used in IBM Thinkpad 560X and Winbond W83977AF (IR) FIR chip e.g. used in the Corel Netwinder PC. You may start the FIR service by loading the according module. Linux/IrDA will probe your hardware then.


Next Previous Contents