Chapter 11 Notebooks ­ PCMCIA, APM, IrDA Notebooks, in particular, have special components and requirements, among these are "Advanced Power Management" (APM), Infra-red ports (IrDA) and PC cards (PCMCIA). Occasionally these components can also be found in desktop computers. Because the differences between the two types are non- essential the use and configuration of both will be described in this chapter. Those interested in specific notebooks should definitely visit the "Linux Lap- top Homepage" at http://www.cs.utexas.edu/users/kharker/ linux-laptop. Another good source of information is the "LiLAC" Homepage under http://home.snafu.de/wehe/index_li.html. There you can find an interesting Laptop Howto as well as an IrDA Howto. 11.1 PCMCIA 11.1.1 Hardware PCMCIA stands for "Personal Computer Memory Card International Asso- ciation" (not, as commonly supposed, People Can't Memorize Computer In- dustry Acronyms ;-) ) although it is commonly used as a collective term for both the hardware and the associated software. The essential part is the PCMCIAcard, of which two types exist: PC cards: This is the most common type. With a 16-bit bus bandwidth, most are relatively inexpensive and are usually trouble-free and stable. CardBus cards: This is a new standard. They have a 32-bit bus bandwidth and are quicker, although also more expensive. Due to the fact that the data transfer rate is often limited at other points in the system the increase in bandwidth is often unjustified. In the meantime there are quite a few drivers for these cards as well, although they are often unstable - depend- ing on the PCMCIA controller. When the PCMCIA service is active the card type can be found with the command cardctl ident. A list of supported cards can be found in SUPPORTED_CARDS in /usr/doc/packages/pcmcia. There you'll also find the actualized version of the PCMCIA-HOWTO. The second important component is the PCMCIA controller, or the PC card/CardBus-bridge. This creates a connection between the card itself and the PCI bus, or in older devices to the ISA bus. These controllers are most 279 11. Notebooks ­ PCMCIA, APM, IrDA often compatible to the i82365 chip from Intel; of which all models are supported. The type of controller can be found with the command probe. In the case of PCI devices the command lspci -vt also offers interesting information. 11.1.2 Software All necessary drivers and programs can be found, as long as they are not al- ready integrated into the kernel, in package PCMCIA, series a1. The modules pcmcia_core, i82365 (or tcic, less often) and ds form the basis and are normally automatically started when booting. They initialize the PCM- CIA controller and supply basic functions. Because PCMCIA cards can be added or removed at run time a Daemon is needed to check the activities of the slots. This is done by the Cardman- ager (cardmgr), which is automatically started after loading the base mod- ules. When a card is inserted into a slot Cardmanager determines the type and function and loads the necessary module. You can check which modules are loaded with the command lsmod. If all modules are successfully loaded Cardmanager, depending on the function of the card, starts predetermined ini- tialization scripts that build the necessary network connections or mount the necessary external SCSI drives. When the card is removed Cardmanager, us- ing the same scripts, ends the diverse card activities, after which the modules that are no longer needed are unloaded. Theoretically, you can simply remove the card. This works very well with network, modem, or ISDN cards as long as there is no active network con- nection. It does not work with mounted partitions, external drives, or NFS directories. For this you need to be certain that the devices are synchronized and cleanly unmounted. If in doubt the following command can be of help earth: # cardctl eject This command deactivates the card, as long as it is still in the notebook. 11.1.3 Configuration When the PCMCIA package is installed four PCMCIA variables will be found in /etc/rc.config. START PCMCIA determines whether the ser- vice should be started when booting. It can be started with the command rcpcmcia start even when START PCMCIA is set to no. PCMCIA de- termines the type of PCMCIA controller. This value is automatically set at in- stallation and almost always has the value i82365. The other two variables, PCMCIA PCIC OPTS and PCMCIA CORE OPTS involve options for the ba- sis modules and can normally be left empty. The default value of do pnp=0 for PCMCIA CORE OPTS is only important for Compaq notebooks. Because the selection of driver modules is taken care of by Cardmanager (cardmgr) no other hardware related settings are necessary. Ethernet and Token Ring Ethernet or Token Ring connections can be easily configured using YaST. In the menu item `System administration' `Network config- uration' these devices can be configured in the same manner as normal 280 11.1. PCMCIA hardware devices with the exception that the device must be marked as a PCMCIA device with F9 ; see also Section 3.6.3 page 95. The following points should be taken into consideration: * When more than one Ethernet or Token Ring devices are marked as PCM- CIA only the first device configuration is used. * The settings, in contrast to normal network cards, are immediately acti- vated with F10 . * The device names shown (eth0, eth1, tr0. . . ) should only be seen as information relating to the type of device due to the fact that the numera- tion of PCMCIA devices is determined dynamically. * When a non-active device is reactivated with F4 the device must also be marked as a PCMCIA device with F9 again. ISDN ISDN-PC cards are configured in much the same manner as other cards; see also Section 6.2 page 150, the only difference being that the device must be marked as a PCMCIA device under the menu items `System adminis- tration' `Network configuration' with F9 . In the `Con- figuration of ISDN hardware' dialog neither IRQ nor IO port nor the ISDN protocol (Euro-ISDN or 1TR6) should be changed. So-called ISDN modems are also available as PCMCIA cards. They are modem or multi-functional cards with an additional "ISDN-Connection-Kit" and are handled as modems. Modems Modem PC cards normally have no specific settings. After insertion the card is available in /dev/modem. The configuration of the device with wvdial (wvdial) follows that of a normal modem; see also Section 6.6 page 163. SCSI and IDE The necessary driver modules are loaded by Cardmanager. After insertion the device is ready for use. The Device name is determined dynami- cally. Information about available SCSI or IDE devices can be found under /proc/scsi or /proc/ide. Before inserting external hard drives, CD-ROM drives and similar devices be sure that the device is on. SCSI devices must be actively terminated. Important: Before a SCSI or IDE device is removed from the slot the partitions and/or device must be unmounted. If this step is left out the device can only be accessed after rebooting although the system is still stable. It is possible to install Linux entirely on such an external drive, but the boot process is somewhat more complicated. A "boot disk" will be needed which includes the kernel and an Init-Ramdisk (initrd); more information on this can be found in Section 16.2 page 377. The initrd includes a virtual file 281 11. Notebooks ­ PCMCIA, APM, IrDA system with all the necessary PCMCIA modules and programs. The SuSE Linux "boot disk" and boot disk images include these, which means that with these you can boot your external installation. It is, however, somewhat uncomfortable having to load the PCMCIA support every time you boot your system; advanced users can create their own boot disks that are tailored to their systems1. 11.1.4 Configurations for Changing ­ "Schemes" Mobile computers often have different configurations. For example, one for work and one for home. For PCMCIA devices this proves to be quite easy, although the configuration files need to be edited by hand; YaST cannot yet handle this task.2. Singular configuration profiles for PCMCIA are known as "Schemes". The configuration files found in /etc/pcmcia/*.opts can include more than one scheme. The data for a specific scheme are included in configuration blocks and are selected with an "address". The addresses are comma sep- arated words. The first word is the name of the scheme. The other words contain information such as slot in which the card is inserted or the number of a hard drive partition. Detailed information can be found at the beginning of the /etc/pcmcia/*.opts files as well as in the PCMCIA-HOWTO. The standard scheme used by SuSE Linux has the name SuSE. The SuSE scheme is edited with SuSEconfig, when the network connection is config- ured with YaST. Due to this, manual alterations to this scheme will be lost by using SuSEconfig. We'll use an ethernet card configuration as an example scheme configuration, making two schemes, named work and home. The file /etc/pcmcia/ network.opts (see file 11.1.1 on the facing page) will have several con- figuration blocks with the following addresses: * SuSE,*,*,*: This block already exists and should be left as is, in case you'd like to use YaST for future configurations. * work,*,*,*: This block is for the network configuration on the job. * home,*,*,*: The configuration for home. * *,*,*,*: This block already exists as well and should be left as is for use in future configurations. It is easiest to use YaST to configure a scheme and then change the name, after running SuSEconfig, from SuSE to work or home. Those who wish to edit everything themselves can find more information about terms such as NETMASK, BROADCAST etc. in Table 5.1 page 135, and all specific values in PCMCIA-HOWTO (in /usr/doc/packages/pcmcia you'll find the current version). Scheme changes can be made a boot or run time. The active scheme is defined by the command cardctl scheme. Changes in schemes 1 Tips can be found in the PCMCIA-HOWTO in Section 5.3 "Booting from a PCMCIA device." 2 Several ISDN devices, with the same network address and the same default route, can be configured. These are not started automatically, but selectively. ­ In the case of modems, several different profiles can be configured with the wvdial 282 11.1. PCMCIA # The address format is "scheme,socket,instance,hwaddr" . case "$ADDRESS" in SuSE,*,*,*) INFO="This scheme is to be configured by YaST/SuSEconfig" # [... abbreviated ...] ;; work,*,*,*) INFO="Network configuration for the company via DHCP" IF_PORT="" BOOTP="n" DHCP="y" IPADDR="" NETMASK="" NETWORK="" BROADCAST="" GATEWAY="" DOMAIN="" SEARCH="" DNS_1="" MOUNTS="" start_fn () { return; } stop_fn () { return; } ;; home,*,*,*) INFO="Network configuration for home, using a fixed address" IF_PORT="" BOOTP="n" DHCP="n" IPADDR="10.0.1.23" NETMASK="255.255.255.0" NETWORK="10.0.1.0" BROADCAST="10.0.1.255" GATEWAY="10.0.1.1" DOMAIN="home.de" SEARCH="home.de work.de" DNS_1="10.0.1.1" MOUNTS="" start_fn () { return; } stop_fn () { return; } ;; *,*,*,*) INFO="Sample private network setup" # [... abbreviated ...] ;; esac File contents 11.1.1: /etc/pcmcia/network.opts 283 11. Notebooks ­ PCMCIA, APM, IrDA image = /boot/vmlinuz root = /dev/hda7 label = work alias = w append = xzx SCHEME=work xzx #image = /boot/vmlinuz root = /dev/hda7 label = home alias = h append = xzx SCHEME=home xzx #image = /boot/vmlinuz root = /dev/hda7 label = suseconf alias = s append = xzx SCHEME=SuSE xzx File contents 11.1.2: PCMCIA: example from lilo.conf can be made at run time with the same command using the syntax cardctl scheme . These settings are not lost when restarting the system which means that the last selected scheme is still ac- tive at the next boot unless specifically changed. This is done at the boot prompt (LILO:) by adding the parameter SCHEME=; more information on giving parameters at the boot prompt can be found in Section 14.3.2 page 327. You can configure LILO to create one or more boot schemes. The append parameter in /etc/lilo.conf is used for this (and other) purposes as can be seen in File 11.1.2. After reconfiguring /etc/lilo.conf the command lilo needs to be called. Using the example configuration in File 11.1.2 by simply adding w, h or s when booting a specific scheme can be started. APM-Support The PCMCIA package in SuSE Linux is compiled without APM support due to the fact that this does not function properly on all systems. You can use apmd to simulate APM support (see Section 11.2.3 page 289) or recompile the kernel, which is actually not very difficult. It is important that the correct kernel is running when re-compiling, because certain information is taken from it. The PCMCIA package should already be installed but not started; if in doubt run the command rcpcmcia stop. Next install the PCMCIA source package with YaST and finally call: earth: # rpm -ba /usr/src/packages/SPECS/pcmcia.spec That's it! A new binary package should exist as well under /usr/src/ packages/RPMS in case you'd like to use the same kernel for other sys- tems. 11.1.5 If Things Still Don't Work Some notebooks have problems with specific PCMCIA cards. Most can be easily solved when you look at the matter systematically. First check to see 284 11.1. PCMCIA if the problem lies with the card or the PCMCIA base system. To do this, boot the computer without any cards inserted. Only after the base system functions correctly should you insert a card. All important messages can be found in /var/log/messages. Therefore this information should be observed with earth: # tail -f /var/log/messages while the necessary tests are running. Doing so you can reduce the problem to one of the following two errors. The PCMCIA Base System Does Not Function Properly If the system hangs when booting, after you receive the message "PCM- CIA: Starting services:" or other strange things happen you should reboot, giving the parameter NOPCMCIA=yes at the boot prompt (LILO:). After the system is running you should load the modules, one after the other, manually, with the commands modprobe pcmcia core, modprobe i82365 or ­ in very rare circumstances ­ modprobe tcic and modprobe ds. The critical modules are, in each case, the first ones. If the problem occurs when loading pcmcia_core help can be found in manpage for pcmcia core (man pcmcia core). The options described in this can be tested in conjunction with the modprobe command. We'll use the example where, due to activated P'n'P support ("Plug-and-Play") the system hangs when loading pcmcia_core. In this case the P'n'P support needs to be deactivated with the command do pnp=0. To test this add this module option to the modprobe as follows: earth: # modprobe pcmcia core do pnp=0 If this helps you should set the variable PCMCIA CORE OPTS in /etc/rc. config to: PCMCIA CORE OPTS="do pnp=0" After this the P'n'P support is no longer automatically loaded. From now on, if you need P'n'P support, you should change the option to 1. To set more than one option, separate each with an empty space as follows: PCMCIA CORE OPTS="do pnp=0 probe io=0" If the problem occurs when loading i82365 help can be found in man- page for i82365 (man i82365). This error is the result of a resource conflict, which means that either an interrupt, an IO port or a memory area is being shared by two devices. This module checks for such sharing but sometimes this check itself leads to problems. In this case the parameter irq list= helps. This list should include all interrupts to be used by the base system and has the following syntax: earth: # modprobe i82365 irq list=5,7,9,10 or longterm in /etc/rc.config: PCMCIA PCIC OPTS="irq list=5,7,9,10" In addition to this there are the files /etc/pcmcia/config and /etc/ pcmcia/config.opts which are used by Cardmanager. The settings in these files are used for the loading of driver modules for the PCMCIA 285 11. Notebooks ­ PCMCIA, APM, IrDA cards. IRQs, IO-Ports and memory areas can be assigned or unassigned in the file /etc/pcmcia/config.opts as well. The difference between this and the above option is that when resources are unassigned in this file the PCMCIA card does not use them, but the base system module i82365 still checks them. The PCMCIA Card Doesn't Function (Correctly) There are three possibilities for errors: The card is not correctly detected, the card causes a resource conflict, or the card is not supported. If the card is not properly detected the message "unsupported card in Slot x" will appear in /var/log/messages. This message only means that Cardmanager cannot correctly assign a driver. /etc/pcmcia/ config is used for this purpose, it is, so to speak, a "driver database". You can add entries to the "driver database" using existing entries as an example. Using the command cardctl ident you can determine the identification information for the card. More information on this topic can be found in the PCMCIA-HOWTO, section 6 ("Dealing with unsupported cards") as well as the manpage for pcmcia (man pcmcia). After changing /etc/pcmcia/config be sure to reload it with rcpcmcia reload. Generally speaking, it doesn't matter which IRQ or IO port a PCMCIA card uses as long as these are not shared by another device (CD-ROM on 2. IDE- Controller: IRQ 15; serial or IrDA Port: IRQ 3, IRQ 4; sound, printer: IRQ 5, IRQ 7). In cases of resource conflicts these should be specifically defined in /etc/pcmcia/config.opts. If the problem still exists these settings can be further specified as a module option in config.opts. For example if the module pcnet_cs should use IRQ 5 the following entry would be made: module "pcnet cs" opts "irq list=5" Most available options are described in the manpages3. If the manpage does not include the information needed there are several options available in man- page for i82365 (man i82365) or the answer lies in the source code of the module. . . One common problem with 10/100 Mbit-Network cards: the transfer rate is not correctly detected. In this case the command ifport can be of help. With this the transfer rate can be shown and changed; see also manpage for ifport (man ifport). The correct setting can be entered in the variable IFPORT in /etc/pcmcia/network.opts. 11.1.6 Installation via PCMCIA In some cases PCMCIA support is necessary to install SuSE Linux. For this you should choose `Load PCMCIA Module' from the menu item `Kernel-Module (Hardware Drivers)' in linuxrc. At first two entry fields will appear. here you can specify options for the modules pcmcia_core and i82365. Normally these can be left empty. The man- pages for pcmcia_core and i82365 can be found as text files on the first 3 Tip: rpm -ql pcmcia | grep man gives a list all package pcmcia manpages. 286 11.2. APM ­ Power Management CD in the directory docu. During installation system messages are displayed on several virtual consoles and can be viewed using Alt + F .4 After the first part of the installation the system is partially or totally rebooted. In rare cases the system hangs when starting the PCMCIA system. The instal- lation is far enough along that you can use the boot option NOPCMCIA=yes to boot Linux without PCMCIA support, at least in text mode. More infor- mation on this can be found in Section 11.1.5 page 284. 11.1.7 Other Help Programs The program cardctl has already been mentioned several times. cardctl is an important tool for finding information about PCMCIA devices and/or taking specific actions. Details can be found in manpage for cardctl (man cardctl); or simply give the command cardctl ot receive a list of command options. Figure 11.1: PCMCIA ­ Cardinfo This program has a graphical front-end as well which can be started with the command cardinfo (See Figure 11.1). Most options can be controlled with this although, unfortunately, you cannot change between "schemes" using this tool. Friends of KDE can also use the program kardinfo. This tool is basically the same as cardinfo. More help can be found in package pcmcia with ifport, ifuser, probe and rcpcmcia although they are not often needed in day to day problems. To discover everything that exists in package pcmcia, use the command rpm -ql pcmcia. 11.2 APM ­ Power Management 4 In YaST2 you must use Ctrl + Alt + F because YaST2 runs under the X Window System. 287 11. Notebooks ­ PCMCIA, APM, IrDA 11.2.1 Fundamentals Power management can be used, assuming that the necessary hardware and BIOS routines exist. Most notebooks and desktops include these ­ the diverse energy saving functions are usually only important for mobile computers. These functions are described below: Standby ­ In this operating mode the display is turned off and, by some machines, the processor power is reduced. Suspend (to memory) ­ In this mode all system information is written to RAM and the entire system is then suspended. Here the computer uses very little energy; so little, in fact, that the computer can run in this mode from between 12 hours to several days on one battery. The advantage of this is that within seconds you can resume working at the same point at which you left, without rebooting or restarting any programs. This is where using Linux becomes interesting ­ you never need to turn the com- puter off ­ other operating systems become unstable in time. With most modern notebooks you only need to close the lid, therefore suspending the system, and later simply opening it again to resume working. Hibernation (Suspend to disk) ­ In this operating mode the computer can run right through the winter. That is, all information is saved to the hard drive and the system is turned off. Resuming operation takes about 30 - 90 seconds and the system is back to the same point where you left off. Some manufacturers offer interesting mixes of suspend and hibernation. Battery Control ­ Very interesting. Automatic Shutdown ­ Interesting for desktops. After a "shutdown" the computer is completely turned off. Hard drive power off ­ This function saves not only energy but, for those with a loud hard drive, also stress. Problems can occur, however, with, for example, an editor that automatically saves changes, causing the drive to turn back on, again and again. Some of these functions are implemented by the BIOS alone. Standby and suspend can be invoked, on many notebooks with a combination of keys or by simply closing the lid. The operating system has nothing do with these functions although with the correct kernel and packages installed these can also be invoked with a command. This is helpful if you like to perform certain actions every time the mode is invoked. 11.2.2 The Correct Kernel For advanced APM functionality a kernel which suports this is needed. Several of the SuSE standard kernel includes this functionality. You can check to see whether these functions are supported with the command cat /proc/apm. If a line appears with diverse numbers everything is okay and the command shutdown -h should turn the computer off. Due to the fact that some BIOS's do not correctly support the standards strange things can sometimes happen. Some of these problems can be solved by using a special kernel configurations. More information can be found in our Support Database at http://sdb.suse.de/sdb/en/html or on the 288 11.2. APM ­ Power Management "Linux Laptop Homepage" at http://www.cs.utexas.edu/users/ kharker/linux-laptop. 11.2.3 The APM-Daemon The Daemon apmd, found in package apmd, series ap serves to watch the battery and can take specific actions when "standby" or "suspend" is started. This package is not always necessary but can often be of use. In order to start this at boot the variable START APMD in /etc/rc.config should be set to yes. You can also start this with the command rcapmd start. Several variables can be configured in /etc/rc.config.d/apmd.rc. config. Because this file contains comments as to the settings of these variables we won't go into detail here. * PCMCIA in SuSE Linux is compiled without APM support. Those who do not wish to recompile the PCMCIA package can set the variable PCMCIA SUSPEND ON SUSPEND to yes. Some cards, however, loose function after a suspend. In this case you should use the harder method of setting the variable PCMCIA EJECT ON SUSPEND=yes. * If the time is incorrect after a suspend set the variable SET CLOCK ON RESUME to yes. * If problems occur with the X Window System when the system wakes help can be found by setting the variable LEAVE X BEFORE SUSPEND=yes. In addition you can set the "spindown" behavior of the hard drive differently for the battery mode or even tell the computer to shutdown when the battery reaches a critically low level. Advanced users can add functionalities them- selves in the file /usr/sbin/apmd_proxy. 11.2.4 More Commands package apmd has a few other useful programs. With apm you can check the actual battery capacity and put the system into standby (apm -S) or suspend (apm -s mode; see also manpage for apm (man apm). The command apmsleep suspends the system for a certain amount of time; see also manpage for apmsleep (man apmsleep). To observe a log file without having the hard drive continuously running use the command tailf instead of tail -f. There are also tools for the X Window System as well as the command xapm which shows a graphic representation of the battery status. If you're using KDE or at least kpanel ­ the program kbatmon shows battery status and can suspend or put the system to sleep. 11.2.5 Pause for the Hard Drive The hard drive can be turned off when not needed with the program hdparm. This program also has other useful hard drive functions. The drive can be placed in standby mode with the command option -y or completely turned off with -Y. The drive will automatically turn off after 30 seconds with the option hdparm -S 6. The number in this command is the number of 5 289 11. Notebooks ­ PCMCIA, APM, IrDA second intervals (in this case 6, so 6 5 = 30). This function is turned off with a value of 0. With larger numbers the interval is also increased, more information can be found in the manpages for this program. You can set the standby behavior to be dependent on whether the computer is plugged in or in battery mode by configuring /etc/rc.config.d/ apmd.rc.config but if you do so be sure to set the variable CHECK TIME to 0. Due to the fact that the hard drive is often needed the sleep function is often useless because many programs, for example text editors, regularly write temporary data to the drive. Programs intended to help, such as tail -f often cause this as well. Replacing this command with tailf solves this problem. Even when none of these programs are in use there are processes that cause the hard drive to be waked from its' sleep. It is important to know that the data is not actually written to the hard drive, rather in a buffer supplied by the kernel. With this write operation speeds are increased. There exists an Update-Daemon which, in regular time intervals, synchronizes the drive and takes care of the buffer. This daemon has been integrated into the kernel since Kernel 2.2.11 and cannot, without other changes, be turned off or replaced with the "mobile update daemon". You can, however, change this behavior with the /proc file system. The command earth: # cat /proc/sys/vm/bdflush shows the actual configuration and with earth: # echo "60 500 64 256 6000 60000 3000 1884 2" > /proc/sys/vm/bdflush you can actualize the settings. If you'd like to change this be sure to check /usr/src/linux/Documentation/proc.txt for the meanings of the individual numbers. You can manually synchronize the hard drive with the command sync. 11.3 IrDA ­ Infra-red Data Association IrDA (Infra-red Data Association) is an industry standard for wireless com- munications that uses light in the infra-red spectrum. Many laptops delivered today have an IrDA compatible sender/receiver that enables the communi- cation with other devices, such as printers, modems, LANs, or even other laptops. The transfer rate varies from 2400 bps up to 4 Mbps. Support for this protocol in the Linux kernel is not yet complete. The project is still seen as "experimental" (beta status). Therefore this funtion- ality is not included in the Standard-Kernel. This implies that the driver has not been fully tested yet and may not be as stable as other parts of the kernel. 290 11.3. IrDA ­ Infra-red Data Association Software The package irda supplies support for infra-red ports as well as the IrDA Protocol itself. After installation of this package you can find the documen- tation under /usr/doc/packages/irda/README. From the package howto you can install the IR-HOWTO. After installation it can be found under /usr/doc/howto/en/IR-HOWTO.gz. For more information on the Linux IrDA-Project visit the URL http://www.cs. uit.no/linux-irda/. Configuration By a normal installation the variables START IRDA, IRDA PORT and IRDA IRQ are set in the file /etc/rc.config . Normally the use of IrDA is deactivated; with the command earth: # rcirda start you can manually activate the port. You can deactivate it with the parameter stop. When activated the necessary kernel modules are loaded. With IRDA PORT (Default /dev/ttyS1) and IRDA IRQ (Default 3) you can configure the IrDA port; they are set by the script /etc/irda/ drivers when support for the infra-red port is activated. If you give START IRDA a value of yes support for the infra-red port will be activated at boot. Unfortunatly IrDA uses noticeably more electricity due to the so-called "discovery" packets that are broadcast every few seconds, which look for other devices with IrDA communication ports with which to communicate. Application In order to print using the infra-red port you need to send the print data to the device file /dev/irlpt0. This device file has the same attributes as the normal "wired" port /dev/lp0, the only difference being the wireless transmission per infra-red light. You can configure a printer to use this port in the same manner as a parallel port or serial port printer using YaST (see Section 3.6.1 page 90). When printing be sure that the printer is in sight of the computer and that the IrDA support is started. If you want to communicate with other computers, mobile telephones or the like you can address the device using the device file /dev/ircomm0. With the Siemens S25 mobile telephone, for instance, you can use the program wvdial to access the internet. Troubleshooting If devices do not respond when using the Infra-red port you can check to see if the device is found by the computer using the command irdadump as `root': earth: # irdadump 291 11. Notebooks ­ PCMCIA, APM, IrDA 21:41:38.435239 xid:cmd 5b62bed5 > ffffffff S=6 s=0 (14) 21:41:38.525167 xid:cmd 5b62bed5 > ffffffff S=6 s=1 (14) 21:41:38.615159 xid:cmd 5b62bed5 > ffffffff S=6 s=2 (14) 21:41:38.705178 xid:cmd 5b62bed5 > ffffffff S=6 s=3 (14) 21:41:38.795198 xid:cmd 5b62bed5 > ffffffff S=6 s=4 (14) 21:41:38.885163 xid:cmd 5b62bed5 > ffffffff S=6 s=5 (14) 21:41:38.965133 xid:rsp 5b62bed5 < 6cac38dc S=6 s=5 BJC-80 \ hint=8804 [ Printer IrCOMM ] (23) 21:41:38.975176 xid:cmd 5b62bed5 > ffffffff S=6 s=* erde \ hint=0500 [ PnP Computer ] (21) Screen output 11.3.1: IrDA: irdadump In the case of a Canon BJC-80 printer in "sight" of the computer earthyou'll receive the following output in regular intervals (see Output 11.3.1). If you receive no output or the device does not respond check the configu- ration of the port. Are you using the correct port? Sometimes the infra-red port can be found under the device file /dev/ttyS2 or /dev/ttyS3 or the device is not being assigned to Interupt 3. These settings can be changed on nearly every laptop in the BIOS setup. It is important to note that you can only communicate with devices using IrDA if the device you wish to communicate with supports the protocols Printer or IrCOMM. With the help of special programs (irobex palm3 or irobex receive, please make note of the descriptions in IR-HOWTO) you can communicate with devices that use the IROBEX Protocol (e. g.3Com Palm Pilot). Which protocol your device supports can be taken from the output of irdadump, in brackets after the device name. Support for the IrLAN Protocol is still a "Work in progress" and will be included in future versions of Linux. You can check to see if the IrDA port is actually emitting light with a normal video camera...in contrast to humans most video cameras can "see" infra-red light. 292