To get the IrDA port of your laptop working with Linux/IrDA you may use StandardInfraRed (SIR) or FastInfraRed (FIR).
Up to 115.200bps, the infrared port emulates a serial port like the 16550A UART. This will be detected by the kernel serial driver at boot time, or when you load the serial module. If infrared support is enabled in the BIOS, for most laptops you will get a kernel message like:
Serial driver version 4.25 with no serial options enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A #first serial port /dev/ttyS0 ttyS01 at 0x3000 (irq = 10) is a 16550A #e.g. infrared port ttyS02 at 0x0300 (irq = 3) is a 16550A #e.g. PCMCIA modem port
If you want to use up to 4Mbps, your machine has to be equipped with a certain FIR chip. You need a certain Linux/IrDA driver to support this chip. Therefore you need exact information about the FIR chip. You may get this information in one of the following ways:
irda-utils
contain a program findchip
now.cat /proc/pci
. The according files for 2.2.x kernels are in /proc/bus/pci . Though often the PCI information is incomplete. You may find the latest information about PCI devices and vendor numbers in the kernel documentation usually in /usr/src/linux/Documentation or at the page of Craig Hart http://members.hyperlink.net.au/~chart . From kernel 2.1.82 on, you may use lspci
from the pci-utils
package, too.CTPCI330.EXE
provided in ZIP format by the German computer magazine CT ftp://www.heise.de/pub/ct/ctsi/ctpci330.zip . The information provided by this program is sometimes better than that provided by the Linux tools.isapnp
tools, could be useful. At the page from Craig Hart I found this PNP IDs:
IBM0002 IBM Thinkpad Infrared Port IBM0034 IBM Thinkpad Infrared Port PNP0510 Generic IRDA-compatible device PNP8294 IrDA Infrared NDIS driver (Microsoft-supplied) PNP8389 Peer IrLAN infrared driver (Microsoft-supplied)
lspnp -v
(from Thomas Davis).dmesg
, whether FIR is detected or not.-rw-rw-r-- 1 ratbert ratbert 743 Apr 3 1997 smcirlap.inf -rw-rw-r-- 1 ratbert ratbert 17021 Mar 24 1997 smcirlap.vxd -rw-rw-r-- 1 ratbert ratbert 1903 Jul 18 1997 smcser.inf -rw-rw-r-- 1 ratbert ratbert 31350 Jun 7 1997 smcser.vxd
FINDCHIP.EXE
. And includes a FIRSETUP.EXE
utility that is supposed to be able to set all values except the chip address. Furthermore it contains BIOSDUMP.EXE
, which produces this output:
Example 1 (from a COMPAQ Armada 1592DT)
In current devNode: Size = 78 Handle = 14 ID = 0x1105D041 = 'PNP0511' -- Generic IrDA SIR Types: Base = 0x07, Sub = 0x00, Interface = 0x02 Comm. Device, RS-232, 16550-compatible Attribute = 0x80 CAN be disabled CAN be configured BOTH Static & Dynamic configuration Allocated Resource Descriptor Block TAG's: TAG=0x47, Length=7 I/O Tag, 16-bit Decode Min=0x03E8, Max=0x03E8 Align=0x00, Range=0x08 TAG=0x22, Length=2 IRQ Tag, Mask=0x0010 TAG=0x79, Length=1 END Tag, Data=0x2F
Result 1:
Irq Tag, Mask (bit mapped - ) = 0x0010 = 0000 0000 0000 0001 0000
so, it's IRQ 4. (start at 0, count up ..), so this is a SIR only device, at IRQ=4, IO=x03e8.
Example 2 (from an unknown machine)
In current devNode: Size = 529 Handle = 14 ID = 0x10F0A34D = 'SMCF010' -- SMC IrCC Types: Base = 0x07, Sub = 0x00, Interface = 0x02 Comm. Device, RS-232, 16550-compatible Attribute = 0x80 CAN be disabled CAN be configured BOTH Static & Dynamic configuration Allocated Resource Descriptor Block TAG's: TAG=0x47, Length=7 I/O Tag, 16-bit Decode Min=0x02F8, Max=0x02F8 Align=0x00, Range=0x08 TAG=0x22, Length=2 IRQ Tag, Mask=0x0008 TAG=0x47, Length=7 I/O Tag, 16-bit Decode Min=0x02E8, Max=0x02E8 Align=0x00, Range=0x08 TAG=0x2A, Length=2 DMA Tag, Mask=0x02, Info=0x08 TAG=0x79, Length=1 END Tag, Data=0x00
Result 2:
a) it's a SMC IrCC chip
b) one portion is at 0x02f8, has an io-extent of 8 bytes; irq = 3
c) another portion is at 0x02e8, io-extent of 8 bytes; dma = 1 (0x02 =0000 0010)
Thomas Davis has placed some device information at http://www.jps.net/tadavis/irda/devids.txt .
WARNING: The package is not intended for the end user, and some of the utilities could be harmful. The only documentation in the package is in M$ Word format. Linux users may read this with catdoc
, available at http://www.fe.msk.ru/~vitus/catdoc/ .
WINMSD
(Windows NT Diagnostics) in Windows NT 4.0, WINMSD
is quite useful, and a bit more informative than Windows9x's Device Manager.LEDs Encode/Decode SIR/FIR HSDL-1001 HSDL-7001 UART 16550/ MicroController ______ ______________ ____________ | | | | | | (|| TXD|<---|IR_TXD TXD|<---|SOUT | | | | | | | | | | RCV|--->|SIN | | | | | | | (|| RCV|--->|IR_RCV 16XCLK|<---|BAUDOUT | | | | NRST|-+ | | ------ -------------- | ------------ V
Though the source is build to work with big endian machines, I didn't get any reports about actually using it. It would be interesting if it's actually working or not. You will probably need an IrDA dongle or something to test it.
i386 and alpha are little endian, arm can choose (but the NetWinder has been wired as a little endian machine). m68k, sparc and ppc are big-endian! mips can choose I think. If unsure, look in /usr/src/linux/asm/byteorder.h and check if it includes <linux/byteorder/big_endian.h>
or <linux/byteorder/little_endian.h>
.
Dag Brattli: "The problem ... has not been analyzed yet. It may be unsafe, and it may work pretty well. All upstream traffic should be safe (bh's), but downstream traffic _may_ be dangerous. I really don't know. ... All list operations irqueue.c in Linux-IrDA is currently SMP safe!". Please check the source code for the current status.
There are some surveys about Linux and infrared capable devices in the WWW:
To make this hardware survey list more valuable it is necessary to collect more information about the infrared devices in different hardware. You can help by sending me a short e-mail containing the exact name of the hardware you have and which type of infrared controller is used.
Please let me also know how well Linux/IrDA worked, at which tty, port and interrupt it works and the corresponding infrared device (e.g. printer, cellular phone) you use.
You can also help by contributing detailed technological information about some infrared devices, which is necessary to develope an according driver for Linux.