IRDA with vanilla kernel-2.6.1 on Gentoo Dell Inspiron 8100 SMC SuperIO Chip LPC47N252 Original location of this document: http://www.eskimo.com/~roger/programming/irda.txt Last edited on: 20040129 1) Introduction 2) Kernel Configuration a) Infrared Drivers b) Serial Drivers 3) Module Configuration 4) Interrupts 5) IRDA Configuration File 6) Putting It All Together a) Gnokii b) Wvdial 7) References 1) Introduction The smsc-ircc2 modules wants IRQ 3. Free IRQ 3 or smsc-ircc2 will fail to work, unless you can get it to use another IRQ. My orinoco wireless pcmcia card (orinoco, orinoco_cs) wants to use IRQ 3. The way that I averted this was compiling the smsc-ircc2 statically and setting both irda & pcmcia at boot levels within the init scripts. You can debug the irq conflict by looking at "cat /proc/interrupts" & removing pcmcia from the startup init scripts. If all else fails, turn-off the serial, parallel, mini-pci ports within the bios and reboot from a cold start. I have successfully gotten irtty-sir module working this way, but it failed to work after I re-enabled the ports. So far, I've quickly tested to see if the ltmodem drivers conflict (or anything else) while using irdadump to view activity. The ltmodem drivers no longer conflict with the kernel-2.6.1 irda code. I have yet to fully test by using an actual application. However, irdadump activity would immediately cease after loading lt_serial & lt_modem when using kernel-2.4.x. The beta kernel-2.6 ltmodem source that I used can be found here: http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/ http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/ltmodem-2.6-alk-v00.tar.gz Just had a patch posted to the irda-users mailing list that enables irq sharing with the smsc-ircc2 driver. The original email which includes the patch can be found here (It appears to have failed to work with smsc-ircc2 compiled statically when I tried it -- How about as module?): http://www.eskimo.com/~roger/programming/irda-email.txt http://www.speakeasy.org/~rogerxx/programming/irda-email.txt http://www.eskimo.com/~roger/programming/smsc-ircc2.shareirq.patch http://www.speakeasy.org/~rogerxx/programming/smsc-ircc2.shareirq.patch To apply this patch: # cd /usr/src/linux-2.6.1/drivers/net/irda/ # patch -p1 < /location/of/patch/smsc-ircc2.shareirq.patch # cd /usr/src/linux-2.6.1 # make bzImage modules modules_install Another method you can probably use to avoid orinoco/orinoco_cs from using IRQ 3 is (if you havn't done so already): # echo "exclude irq 3" >>/etc/pcmcia/config.opts 2) Kernel Configuration 2a) Infrared Drivers I've gone out of the way of Jean's advice and compiled my IRDA drivers statically as I hate trying to get stuff to autoload. Well, hey, this is kernel-2.6.1 (and not >=2.) and it works statically -- so far. *I'm not sure if irtty-sir (and some other modules) are needed anymore since using smsc-ircc2 module. # IrDA (infrared) support # CONFIG_IRDA=y # # IrDA protocols # CONFIG_IRLAN=y CONFIG_IRNET=m CONFIG_IRCOMM=y CONFIG_IRDA_ULTRA=y # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y CONFIG_IRDA_DEBUG=y # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=y # # Dongle support # # CONFIG_DONGLE is not set # # Old SIR device drivers # CONFIG_IRPORT_SIR=y # # Old Serial dongle support # # CONFIG_DONGLE_OLD is not set # # FIR device drivers # CONFIG_USB_IRDA=y # CONFIG_NSC_FIR is not set # CONFIG_WINBOND_FIR is not set # CONFIG_TOSHIBA_FIR is not set CONFIG_SMC_IRCC_FIR=y # CONFIG_ALI_FIR is not set # CONFIG_VLSI_FIR is not set # CONFIG_VIA_FIR is not set 2b) Serial Drivers I have removed the /etc/init.d/serial from startup and am not loading the serial_core & 8250 modules on startup. *Nor have I checked for conflicts with the serial drivers with the smsc-ircc2 module. I will probably further debug later by re-adding the serial modules to load on startup. # Serial drivers # CONFIG_SERIAL_8250=m # CONFIG_SERIAL_8250_CS is not set CONFIG_SERIAL_8250_ACPI=y CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=m CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 CONFIG_PRINTER=y # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set 3) Module Configuration Nothing is needed to configure with the modules as I've mine are statically linked. Nothing added to /etc/modules.autoload.d/kernel-2.6 You may want to alias irda0 smsc-ircc2 within /etc/modules.d/smsc-ircc2 or elsewhere. Note that "/etc/init.d/irda start" may complain about trying to find the old smc-ircc module name. If you do configure the IRDA as modules, you may want to add the following within the /etc/init.d/irda script file: Load the real smsc-ircc2 module (the default init.d irda script may only look for smc-ircc): -snip- start() { checkconfig || return 1 /sbin/modprobe smsc-ircc2 2>/dev/null # Check that irda is enabled. -snip- Safely shutdown & remove any irda modules: -snip- stop() { ebegin "Shutting down IrDA" start-stop-daemon --stop --quiet --pidfile /var/run/irattach.pid /sbin/ifconfig irda0 down sleep 1 /sbin/rmmod irnet irport irtty_sir sir_dev ircomm-tty ircomm smsc-ircc2 irda 2> /dev/null eend ${?} -snip- 4) Interrupts cat /proc/interrupts CPU0 0: 2082195 XT-PIC timer 1: 13147 XT-PIC i8042 2: 0 XT-PIC cascade 3: 15137 XT-PIC irda0 4: 9911 XT-PIC orinoco_cs 5: 206 XT-PIC Maestro3 8: 2 XT-PIC rtc 9: 0 XT-PIC acpi 10: 0 XT-PIC yenta, yenta, uhci_hcd 11: 122541 XT-PIC nvidia 12: 227392 XT-PIC i8042 14: 141892 XT-PIC ide0 NMI: 0 LOC: 0 ERR: 0 MIS: 0 5) IRDA Configuration File # cat /etc/conf.d/irda IRDA=yes #IRDADEV=/dev/ttyS0 # ttySx ports are used with irtty-sir module #IRDADEV=/dev/ttyS1 IRDADEV=irda0 # irda0 interface is used with smsc-ircc2 module #Set (optional) Dongle name here #DONGLE=actisys+ DISCOVERY=yes 6) Putting It All Together Basically, the /etc/init.d/irda file will autoload modules and run: # irattach irda0 -s At this point, you want to: # tail /var/log/messages -n 10 and check to see if the smsc-ircc2 module was able to get IRQ 3. If smsc-ircc2 fails to get IRQ 3, look for conflicts -- See Introduction If everything looks ok and you only see trivial errors, try: # irdadump 05:41:35.027847 xid:cmd e32f1d88 > ffffffff S=6 s=0 (14) 05:41:35.117824 xid:cmd e32f1d88 > ffffffff S=6 s=1 (14) 05:41:35.198012 xid:rsp e32f1d88 < f0340000 S=6 s=1 Nokia 8290 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27) 05:41:35.207810 xid:cmd e32f1d88 > ffffffff S=6 s=2 (14) 05:41:35.297798 xid:cmd e32f1d88 > ffffffff S=6 s=3 (14) 05:41:35.387782 xid:cmd e32f1d88 > ffffffff S=6 s=4 (14) 05:41:35.477769 xid:cmd e32f1d88 > ffffffff S=6 s=5 (14) 05:41:35.567758 xid:cmd e32f1d88 > ffffffff S=6 s=* localhost3 hint=4400 [ Computer LAN Access ] (26) 05:41:38.027391 xid:cmd e32f1d88 > ffffffff S=6 s=0 (14) 05:41:38.110184 xid:rsp e32f1d88 < f0340000 S=6 s=0 Nokia 8290 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27) 05:41:38.117369 xid:cmd e32f1d88 > ffffffff S=6 s=1 (14) 05:41:38.207354 xid:cmd e32f1d88 > ffffffff S=6 s=2 (14) 05:41:38.297341 xid:cmd e32f1d88 > ffffffff S=6 s=3 (14) 05:41:38.387328 xid:cmd e32f1d88 > ffffffff S=6 s=4 (14) 05:41:38.477315 xid:cmd e32f1d88 > ffffffff S=6 s=5 (14) 05:41:38.567302 xid:cmd e32f1d88 > ffffffff S=6 s=* localhost3 hint=4400 [ Computer LAN Access ] (26) You should see something like this. Try putting your mobile phone or other irda device near and you should see the device name picked-up as in my case. If you see the above but you're not getting your irda device picked-up by the laptop's irda device, you either have a problem with the kernel configuration or you need to play with the /proc/sys/net/irda files as you're device might be finicky about what timings it likes -- see Jean's IRDA Quick Tutorial within the Reference section below. 6a) Gnokii I use irda to connect my Nokia 8290 to my I8k laptop. I'll attach snip of my gnokii config file: /etc/gnokiirc port = /dev/ircomm0 model = 6110 connection = irda 6b) Wvdial If I really need to check my email (because I like to download spam over a <19k gsm mobile phone!). [Dialer mobile-eskimo] Baud = 115200 Dial Command = ATDT Init1 = ATZ Init2 = AT&FX4 Modem = /dev/ircomm0 # *I have yet to try this with smsc-ircc2 - it should work Password = your_password_here Phone = 800-246-6874 Stupid Mode = yes Username = your_login_name_here 7) References Jean's IRDA Quick Tutorial http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrDA.html IRDA Mailing List (Jean frequents here ;-) http://lists.sourceforge.net/lists/listinfo/irda-users Linux IRDA Project Homepage http://irda.sourceforge.net/ * - denotes areas of further testing