IrDA on Linux

by Hans Schou

I have a ASUS L8400 laptop with Mandrake 8.1 installed. Mandrake was misconfigured by default so I had to change device in /etc/sysconfig/irda. Mandrake 8.1 uses devfs and /dev/ttyS1 is equal to /dev/tts/1.

IRDA=yes
DEVICE=/dev/tts/1
DISCOVERY=yes

If you have devfs then try:

# /etc/init.d/irda restart
# insmod ircomm
# insmod ircomm-tty
# ls -l /dev/ircomm?
crw-r--r--    1 root     root     161,   0 Jan  2 16:42 /dev/ircomm0
crw-------    1 root     root     161,   1 Jan  1  1970 /dev/ircomm1
crw-------    1 root     root     161,   2 Jan  1  1970 /dev/ircomm2
crw-------    1 root     root     161,   3 Jan  1  1970 /dev/ircomm3
crw-------    1 root     root     161,   4 Jan  1  1970 /dev/ircomm4
crw-------    1 root     root     161,   5 Jan  1  1970 /dev/ircomm5
crw-------    1 root     root     161,   6 Jan  1  1970 /dev/ircomm6
crw-------    1 root     root     161,   7 Jan  1  1970 /dev/ircomm7
crw-------    1 root     root     161,   8 Jan  1  1970 /dev/ircomm8
crw-------    1 root     root     161,   9 Jan  1  1970 /dev/ircomm9

If you do not have devfs then you have to make a node yourself:

mknod /dev/ircomm0 c 161 0

# lsmod | grep ir
ircomm-tty             20528   0  (autoclean)
ircomm                  8064   0  [ircomm-tty]
irtty                   6000   2  (autoclean)
irda                   93568   1  (autoclean) [ircomm-tty ircomm irtty]

Use findchip for the first debugging:

# findchip
NSC,PC87338,11.2,0x398,0x2f8,0x2f8,3,3,1,0,1
# findchip -v
Found NSC PC87338 Controller at 0x398, DevID=0x0b, Rev. 2
    SIR Base 0x2f8, FIR Base 0x2f8
    IRQ = 3, DMA = 3
    Enabled: yes, Suspended: no
    UART compatible: yes
    Half duplex delay = 0 us

After starting /etc/init.d/irda try irdadump: (my hostname is "figus")

# irdadump irda0
15:15:38.657183 xid:cmd fa4d613b > ffffffff S=6 s=0 (14)
15:15:38.747181 xid:cmd fa4d613b > ffffffff S=6 s=1 (14)
15:15:38.837179 xid:cmd fa4d613b > ffffffff S=6 s=2 (14)
15:15:38.927180 xid:cmd fa4d613b > ffffffff S=6 s=3 (14)
15:15:39.017179 xid:cmd fa4d613b > ffffffff S=6 s=4 (14)
15:15:39.107180 xid:cmd fa4d613b > ffffffff S=6 s=5 (14)
15:15:39.197181 xid:cmd fa4d613b > ffffffff S=6 s=* figus hint=0400 [ Computer ] (21)

After turning on the Nokia 6210 I got:

# irdadump irda0
15:19:44.657188 xid:cmd fa4d613b > ffffffff S=6 s=0 (14)
15:19:44.747180 xid:cmd fa4d613b > ffffffff S=6 s=1 (14)
15:19:44.837179 xid:cmd fa4d613b > ffffffff S=6 s=2 (14)
15:19:44.927179 xid:cmd fa4d613b > ffffffff S=6 s=3 (14)
15:19:45.017182 xid:cmd fa4d613b > ffffffff S=6 s=4 (14)
15:19:45.017178 xid:rsp fa4d613b < 6b620000 S=6 s=3 Nokia 6210 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27)
15:19:45.107179 xid:cmd fa4d613b > ffffffff S=6 s=5 (14)
15:19:45.197179 xid:cmd fa4d613b > ffffffff S=6 s=* figus hint=0400 [ Computer ] (21)

Just for fun I tried to load IrDALAN to see if there was any difference:

# insmod irlan ; irdadump irda0
Using /lib/modules/2.4.8-26mdk/kernel/net/irda/irlan/irlan.o.gz
15:21:29.657195 xid:cmd fa4d613b > ffffffff S=6 s=0 (14)
15:21:29.747181 xid:cmd fa4d613b > ffffffff S=6 s=1 (14)
15:21:29.837180 xid:cmd fa4d613b > ffffffff S=6 s=2 (14)
15:21:29.927180 xid:cmd fa4d613b > ffffffff S=6 s=3 (14)
15:21:30.017181 xid:cmd fa4d613b > ffffffff S=6 s=4 (14)
15:21:30.107182 xid:cmd fa4d613b > ffffffff S=6 s=5 (14)
15:21:30.107179 xid:rsp fa4d613b < 6b620000 S=6 s=4 Nokia 6210 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27)
15:21:30.197182 xid:cmd fa4d613b > ffffffff S=6 s=* figus hint=4400 [ Computer LAN Access ] (21)
# cat /proc/net/irda/discovery
IrLMP: Discovery log:
nickname: Nokia 6210, hint: 0xb125, saddr: 0x911d416b, daddr: 0x02170000

Resource: http://www.retepnet.it/alfmar/pxnsoa.html#irda .