Subject: Re: IrDA (was: Nokia GSM phones and pkgsrc? kernel?)
To: None <feico@pasta.cs.uit.no>
From: Roger Brooks <R.S.Brooks@liverpool.ac.uk>
List: current-users
Date: 04/03/2000 23:55:24
On Wed, 29 Mar 2000, Feico Dillema wrote:

>I know the main author of the Linux-Irda code as we work in the same
>project group (meaning we work in the same Lab but not on the same
>stuff). I have subtly and less-subtly tried to push him into making
>a *BSD port of his code in the past. Without to much effect; he
>simply has not the time to do it. He has mentioned that a port to BSD
>should not be that difficult as little code depends on
>kernel-specifics (this statement can be a bit incorrect due to lack of 
>familiarity on the differences between Linux and BSD though). I think
>a lot of the kernel code could be pushed to userland (maybe at a
>performance penalty).

I spent a bit of time looking over the code last weekend.  I think the
most difficult part is going to be the SIR driver.  This is implemented
as a tty line discipline (like ppp), and will need to be modified to work
with the NetBSD tty driver.

It would not be a good idea to move the code to userland, and not just
for performance reasons.  First of all, IrDA allows multiple endpoints
in a device, and given a sufficiently sophisticated device it should be
possible for several processes on the Unix system to have simultaneous
connections open to different endpoints.
The IrDA standards define several upper layer protocols:

IrOBEX (Object Exchange), presented in the Linux implementation as
an AF_IRDA socket.

IrCOMM (serial and parallel port emulation), presented as tty and
parallel port device files.

IrLAN (LAN access), presented as a virtual ethernet interface (I think).

So to implement the IrDA stack in userland, you'd have to get the data
back into the kernel so it could emerge through one of the abover interfaces.

While it might be possible to substitute FIFOs for AF_IRDA sockets,
the other two protocols would be much more difficult.

If you want to run PPP over an IrDA connection to a GSM phone, it looks
like this:

	IP Stack
	ppp0
	/dev/ircomm0 (IrDA tty device in PPP line discipline set by pppd)
	IrDA Stack
	irda0 (network interface)
	/dev/tty02 (real tty in IrDA line discipline set by irattach)

It's difficult to see how you could do this outside the kernel, and in any
case /dev/ircomm0 has to be a tty device so that you can switch it to PPPDISC.

Likewise, an IrLAN device has to look like a network interface so that
you can use ifconfig to set an IP address on it.

>Also, there is the licence issue.  I discussed this with him in the 
>past and I can say that *he* his willing to release *his* code under a 
>BSD license (so that somebody can port and include it into *BSD).
>Unfortunately, that's not enough. Many people have contributed to the
>code and supplied patches (under the assumption that they contributed
>to GPL-ed code). The big questions are then:
>
>1 Do we need all contributers permission to release the code under BSD
>  licence?
>2 If so, are we able to track them all down.
>3 If we don't get permission (of some), can we still separate their
>  contributions from the main code tree.
>
>Note that these questions need to be answered without requiring to
>much time from the main author. Also note that AFAIK the code tree has
>not been under a revision control regime like CVS, which complicates
>point 2 and 3 above. Maybe a GPL-license guru could answer point 1
>above (as I and the Linux-Irda author are not sure about such license
>details).

I think for the present I'll assume it may be impossible to get a GPL-free
version, and so it will have to be an LKM.

>So, it may be worthwhile to talk to the Linux-Irda author for anybody
>considering porting the code to BSD and see what comes out of it.

I'll get in touch with him when I have spent a bit more time looking at the
code.


Roger

------------------------------------------------------------------------------
Roger Brooks (Systems Programmer),          |  Email: R.S.Brooks@liv.ac.uk
Computing Services Dept,                    |  Tel:   +44 151 794 4441
The University of Liverpool,                |  Fax:   +44 151 794 4442
PO Box 147, Liverpool L69 3BX, UK           | 
------------------------------------------------------------------------------