MA620 and Linux, or There and Back Again
Thanks to the the irda-users mailing list and frantic searching on Google, I managed to get the dongle working with Linux at 9600bps (bits per second) within a day or so. The various modules that you need to accomplish this are:
* uhci_hcd * pl2303 * irda * irtty-sir * ma600-sir * ircomm-tty
From what I understand, the -sir modules are the USB versions of the corresponding serial IR modules. My original script to enable the dongle was:
================================================================ #!/bin/sh # # Minimal stuff required to get the MA620 USB IRDA dongle recognised by # the kernel. Version 1 -- works with unpatched kernel, but only at # 9600bps.
modprobe uhci_hcd modprobe pl2303 modprobe irda echo 9600 > /proc/sys/net/irda/max_baud_rate modprobe irtty-sir modprobe ma600-sir modprobe ircomm-tty irattach /dev/usb/ttyUSB0 -d ma600 -s
exit 0 ================================================================
As you would guess, the echo 9600 line limits the rate of the IrDA dongle to 9600bps. This is because the MA620 driver is still being worked on and there's a small bug that causes problems at higher speeds.
On submitting this problem to the irda-users mailing list, Martin Diehl suggested a small change in the kernel. I quote him:
Simply try editing the file linux/drivers/net/irda/ma600-sir.c. In line 197 (2.6.7-vanilla) change the "#if 1" to read "#if 0" and rebuild your module. By chance this will help you out because the speed chance was likely working, just the verification failed.
Being part of the ``Top 10 Clueless About Kernel List'', I blindly followed his suggestion and rebuilt the kernel, and lo and behold, suddenly I could use the dongle at higher speeds.
With Martin's change in place I've so far used the USB port at up to 115200bps without problems. The speed still kind of sucks when transferring MP3s to the phone (more about that later), but baby, let me tell you, it's definitely an improvement over 9600bps!
Here's the new script for enabling the MA620 USB IrDA dongle with a patched kernel 2.6.7:
================================================================ #!/bin/sh # # Minimal stuff required to get the MA620 USB IRDA dongle recognised by # the kernel. Version 2 -- works only with kernel patched with Martin # Diehl's #if 0, at up to 115200bps.
modprobe uhci_hcd modprobe pl2303 modprobe irda modprobe irtty-sir modprobe ma600-sir modprobe ircomm-tty irattach /dev/usb/ttyUSB0 -d ma600 -s
exit 0 ================================================================
All that has happened is that the line limiting the IR rate to 9600bps before loading the remaining drivers has vanished. L33t, huh? '>
After you start IrDA (and assuming everything works OK), you should see something like the following when you put the phone (with cover open) in front of the dongle and run irdadump( :
================================================================ 14:19:49.808390 xid:rsp 3f8d7c1b > e3afec86 S=6 s=3 mail hint=0400 [ Computer ] (20) 14:19:50.205921 xid:cmd ffffffff < e3afec86 S=6 s=* A760 hint=c124 [ PnP LAN Access IrCOMM IrOBEX ] (21) ================================================================
The files in /proc/net/irda have the following contents, which I cannot decipher but presumably someone can, otherwise they wouldn't be there:
================================================================ *** /proc/net/irda/discovery: IrLMP: Discovery log:
nickname: A760, hint: 0xc124, saddr: 0x3f8d7c1b, daddr: 0xe9877945
*** /proc/net/irda/ircomm:
*** /proc/net/irda/irias: LM-IAS Objects: name: Device, id=0 - Attribute name: "IrLMPSupport", value[IAS_OCT_SEQ]: octet sequence (3 bytes)
- Attribute name: "DeviceName", value[IAS_STRING]: "mail"
*** /proc/net/irda/irlap: irlap0 state: LAP_NDM device name: irda0, hardware name: ttyUSB0 caddr: 0x20, saddr: 0x3f8d7c1b, daddr: 0x000000 win size: 0, win: 0, line capacity: 0, bytes left: 0 tx queue len: 0 win queue len: 0 rbusy: FALSE mbusy: FALSE retrans: 0 vs: 0 vr: 0 va: 0 qos bps maxtt dsize winsize addbofs mintt ldisc comp tx 9600 0 64 1 12 0 0 rx 9600 0 64 1 12 0 0
*** /proc/net/irda/irlmp: Unconnected LSAPs: lsap state: LSAP_DISCONNECTED, slsap_sel: 0x0, dlsap_sel: 0xff, (IrIAS srv)
Registered Link Layers: lap state: LAP_STANDBY, saddr: 0x3f8d7c1b, daddr: 0xffffffff, num lsaps: 0
Connected LSAPs:
*** /proc/net/irda/irttp: |