Skip to contentSkip to conversation

patch-2.4.2-irda1 (irda-usb)

PATCH In review Dag Brattli 3 participants 6 messages Feb 27, 2001 – Feb 28, 2001

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patch-2.4.2-irda1 (irda-usb)

Linus,

Please apply this patch to your latest Linux-2.4.2 source. Changes:

o IrDA-USB dongle support [new feature]

-- Dag

Documentation/Configure.help +14 -2
diff -urpN linux-2.4.2/Documentation/Configure.help linux-2.4.2-irda-patch/Documentation/Configure.help
@@ -16739,8 +16739,7 @@ CONFIG_IRDA
   infrared communication and is supported by most laptops and PDA's.
 
   To use Linux support for the IrDA (tm) protocols, you will also need
-  some user-space utilities like the irmanager and probably irattach
-  as well. For more information, see the file
+  some user-space utilities like irattach. For more information, see the file
   Documentation/networking/irda.txt. You also want to read the
   IR-HOWTO, available at http://www.linuxdoc.org/docs.html#howto .
 
@@ -16849,6 +16848,19 @@ CONFIG_IRPORT_SIR
   115200 bps.
 
   If unsure, say Y.
+
+USB IrDA FIR Dongle Device Driver
+CONFIG_USB_IRDA
+  Say Y here if you want to build support for the USB IrDA FIR Dongle
+  device driver. If you want to compile it as a module (irda-usb.o),
+  say M here and read Documentation/modules.txt. IrDA-USB support the
+  various IrDA USB dongles available and most of their pecularities.
+  Those dongles plug in the USB port of your computer, are plug and
+  play, and support SIR and FIR (4Mbps) speeds. On the other hand,
+  those dongles tend to be less efficient than a FIR chipset.
+
+  Please note that the driver is still experimental. And of course,
+  you will need both USB and IrDA support in your kernel...
 
 Winbond W83977AF IrDA Device Driver
 CONFIG_WINBOND_FIR
drivers/net/irda/Config.in +9 -8
diff -urpN linux-2.4.2/drivers/net/irda/Config.in linux-2.4.2-irda-patch/drivers/net/irda/Config.in
@@ -5,14 +5,6 @@ comment 'SIR device drivers'
 dep_tristate 'IrTTY (uses Linux serial driver)' CONFIG_IRTTY_SIR $CONFIG_IRDA
 dep_tristate 'IrPORT (IrDA serial driver)' CONFIG_IRPORT_SIR $CONFIG_IRDA
 
-comment 'FIR device drivers'
-dep_tristate 'NSC PC87108/PC87338' CONFIG_NSC_FIR  $CONFIG_IRDA
-dep_tristate 'Winbond W83977AF (IR)' CONFIG_WINBOND_FIR $CONFIG_IRDA
-dep_tristate 'Toshiba Type-O IR Port' CONFIG_TOSHIBA_FIR $CONFIG_IRDA
-if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
-dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
-fi
-
 comment 'Dongle support' 
 bool 'Serial dongle support' CONFIG_DONGLE
 if [ "$CONFIG_DONGLE" != "n" ]; then
@@ -22,6 +14,15 @@ if [ "$CONFIG_DONGLE" != "n" ]; then
    dep_tristate '  Greenwich GIrBIL dongle' CONFIG_GIRBIL_DONGLE $CONFIG_IRDA
    dep_tristate '  Parallax LiteLink dongle' CONFIG_LITELINK_DONGLE $CONFIG_IRDA
    dep_tristate '  Old Belkin dongle' CONFIG_OLD_BELKIN_DONGLE $CONFIG_IRDA   
+fi
+
+comment 'FIR device drivers'
+dep_tristate 'IrDA USB dongles (Experimental)' CONFIG_USB_IRDA $CONFIG_IRDA $CONFIG_USB $CONFIG_EXPERIMENTAL
+dep_tristate 'NSC PC87108/PC87338' CONFIG_NSC_FIR  $CONFIG_IRDA
+dep_tristate 'Winbond W83977AF (IR)' CONFIG_WINBOND_FIR $CONFIG_IRDA
+dep_tristate 'Toshiba Type-O IR Port' CONFIG_TOSHIBA_FIR $CONFIG_IRDA
+if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
+dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
 fi
 
 endmenu
drivers/net/irda/Makefile +1 -0
diff -urpN linux-2.4.2/drivers/net/irda/Makefile linux-2.4.2-irda-patch/drivers/net/irda/Makefile
@@ -12,6 +12,7 @@ export-objs	= irport.o
 
 obj-$(CONFIG_IRTTY_SIR)		+= irtty.o
 obj-$(CONFIG_IRPORT_SIR)	+= 		irport.o
+obj-$(CONFIG_USB_IRDA)		+= irda-usb.o
 obj-$(CONFIG_NSC_FIR)		+= nsc-ircc.o
 obj-$(CONFIG_WINBOND_FIR)	+= w83977af_ir.o
 obj-$(CONFIG_TOSHIBA_FIR)	+= toshoboe.o
drivers/net/irda/irda-usb.c +1158 -0

1,158 lines not on this page · raw message

include/net/irda/irda-usb.h +122 -0

122 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Dag Brattli

Linus,

Please apply this patch to your latest Linux-2.4.2 source. Changes:

o IrDA-USB dongle support [new feature]

I'd recommend that this file be in the /drivers/usb directory, much like almost all other USB drivers are.

drivers/net/irda/irda-usb.c line 80

Quoted 10 lines
drivers/net/irda/irda-usb.c +10 -0
+/* These are the currently known IrDA USB dongles. Add new dongles here */
+struct irda_usb_dongle dongles[] = { /* idVendor, idProduct, idCapability */
+	/* ACTiSYS Corp,  ACT-IR2000U FIR-USB Adapter */
+	{ 0x9c4, 0x011, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	/* KC Technology Inc.,  KC-180 USB IrDA Device */
+	{ 0x50f, 0x180, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	/* Extended Systems, Inc.,  XTNDAccess IrDA USB (ESI-9685) */
+	{ 0x8e9, 0x100, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	{ 0, 0, 0 }, /* The end */
+};

You should also probably add the following snippet to allow the USB hotplug functionality to work properly:

static __devinitdata struct usb_device_id id_table [] = {
        { USB_DEVICE(0x09c4, 0x0011) },
        { USB_DEVICE(0x050f, 0x0180) },
        { USB_DEVICE(0x08e9, 0x0100) },
        { }                                     /* Terminating entry */
};

MODULE_DEVICE_TABLE (usb, id_table);

If IRDA has a class descriptor, can't you just rely on that, and not have to worry about the individual device vendor and product ids?

drivers/net/irda/irda-usb.c line 90

Quoted 7 lines

+ * This routine is called by the USB subsystem for each new device
+ * in the system. We need to check if the device is ours, and in
+ * this case start handling it.
+ * Note : it might be worth protecting this function by a global
+ * spinlock...

drivers/net/irda/irda-usb.c +2 -0
+static void *irda_usb_probe(struct usb_device *dev, unsigned int ifnum,
+			   const struct usb_device_id *id)

A spinlock is not needed as the probe functions are called sequentially.

thanks,

greg k-h

Signature · 2 lines
greg@(kroah|wirex).com
http://immunix.org/~greg
#2 lore raw
Quoted 9 lines · Greg KH
Quoted 5 lines · Dag Brattli

Linus,

Please apply this patch to your latest Linux-2.4.2 source. Changes:

o IrDA-USB dongle support [new feature]

I'd recommend that this file be in the /drivers/usb directory, much like almost all other USB drivers are.

Yes, but do we want to spread the IrDA code around? The same argument applies to IrDA device drivers!?

Quoted 14 lines

drivers/net/irda/irda-usb.c line 80

Quoted 10 lines
drivers/net/irda/irda-usb.c +10 -0
+/* These are the currently known IrDA USB dongles. Add new dongles here */
+struct irda_usb_dongle dongles[] = { /* idVendor, idProduct, idCapability */
+	/* ACTiSYS Corp,  ACT-IR2000U FIR-USB Adapter */
+	{ 0x9c4, 0x011, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	/* KC Technology Inc.,  KC-180 USB IrDA Device */
+	{ 0x50f, 0x180, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	/* Extended Systems, Inc.,  XTNDAccess IrDA USB (ESI-9685) */
+	{ 0x8e9, 0x100, IUC_SPEED_BUG | IUC_NO_WINDOW },
+	{ 0, 0, 0 }, /* The end */
+};

You should also probably add the following snippet to allow the USB hotplug functionality to work properly:

Quoted 7 lines
static __devinitdata struct usb_device_id id_table [] = {
        { USB_DEVICE(0x09c4, 0x0011) },
        { USB_DEVICE(0x050f, 0x0180) },
        { USB_DEVICE(0x08e9, 0x0100) },
        { }                                     /* Terminating entry */
};

MODULE_DEVICE_TABLE (usb, id_table);

OK!

Quoted 2 lines

If IRDA has a class descriptor, can't you just rely on that, and not have to worry about the individual device vendor and product ids?

Sorry, some of the dongles don't follow the spec fully, as you can see from our table. Actually none of them follow the spec, since they are all based on the same chip which was made before the spec was finished. But there should be a new dongle out now which do follow the spec (but we haven't got hold of it yet)

Quoted 11 lines

drivers/net/irda/irda-usb.c line 90

Quoted 8 lines

+ * This routine is called by the USB subsystem for each new device
+ * in the system. We need to check if the device is ours, and in
+ * this case start handling it.
+ * Note : it might be worth protecting this function by a global
+ * spinlock...

drivers/net/irda/irda-usb.c +2 -0
+static void *irda_usb_probe(struct usb_device *dev, unsigned int ifnum,
+			   const struct usb_device_id *id)

A spinlock is not needed as the probe functions are called sequentially.

Quoted 3 lines

thanks,

greg k-h

----
Dag Brattli <[email protected]>
My homepage http://www.brattli.net/dag/

Try Linux-IrDA: http://irda.sourceforge.net/
Try Pygmy:      http://pygmy.sourceforge.net/
#3 lore raw
In reply to Greg KH
Quoted 5 lines · Dag Brattli
Quoted 2 lines

I'd recommend that this file be in the /drivers/usb directory, much like almost all other USB drivers are.

Yes, but do we want to spread the IrDA code around? The same argument applies to IrDA device drivers!?

I agree, and am not saying that it _has_ to be there. Just a suggestion, and if you're comfortable with it in the irda directory, that's fine.

thanks,

greg k-h

Signature · 2 lines
greg@(kroah|wirex).com
http://immunix.org/~greg
#4 lore raw
In reply to Greg KH
Quoted 7 lines · Greg KH
Quoted 5 lines · Dag Brattli
Quoted 2 lines

I'd recommend that this file be in the /drivers/usb directory, much like almost all other USB drivers are.

Yes, but do we want to spread the IrDA code around? The same argument applies to IrDA device drivers!?

Quoted 7 lines

I agree, and am not saying that it _has_ to be there. Just a suggestion, and if you're comfortable with it in the irda directory, that's fine.

thanks,

greg k-h

	Hi,

	First thanks for Dag for bringing me into the conversation. I

may add my little bit of spice, especially that I was the one pushing for having the driver in .../drivers/net/irda.
By the way, Greg, sorry if I hurt your feeling, I don't want
to put down any of the great work that has been done on the USB stack.

My feeling is that devices are mostly defined by their higher
level interface, because this is what is closer to the user.
If I look at a Pcmcia Ethernet card, I will tend to associate
more with a PCI Ethernet card rather than a Pcmcia SCSI card. Both card have the same high level interface (TCP/IP) even if their low level interface is different (Pcmcia, PCI).
People tend to agree with that, and that's why you have
directories called drivers/net, drivers/scsi and driver/sound, rather that drivers/pci, drivers/isa, drivers/mca and drivers/pcmcia.

If I get an IrDA-USB dongle, the feature that matter the most
is that it does IrDA, the fact that it connect to my PC via USB is rather secondary.
That's it. I hope it explain some of the rationale and why we
departed from the usual drivers/usb arrangement. Actually, I think that stuffing all USB drivers in drivers/usb is not that great, but that's not my call...

	Have fun...

	Jean
#5 lore raw
In reply to Greg KH
Quoted 6 lines · Jean Tourrilhes

First thanks for Dag for bringing me into the conversation. I
may add my little bit of spice, especially that I was the one pushing for having the driver in .../drivers/net/irda.
By the way, Greg, sorry if I hurt your feeling, I don't want
to put down any of the great work that has been done on the USB stack.

Thanks, but it didn't bother me, or hurt any of my feelings at all. I just wanted to point out that all of the other usb drivers (with 2 exceptions) reside in the drivers/usb directory, and I didn't know if you knew that.

(the exceptions are the input drivers, which are part of the input core, and the cpia video driver, which has the parallel port and the usb driver all together in one file.)

Quoted 9 lines

My feeling is that devices are mostly defined by their higher
level interface, because this is what is closer to the user.
If I look at a Pcmcia Ethernet card, I will tend to associate
more with a PCI Ethernet card rather than a Pcmcia SCSI card. Both card have the same high level interface (TCP/IP) even if their low level interface is different (Pcmcia, PCI).
People tend to agree with that, and that's why you have
directories called drivers/net, drivers/scsi and driver/sound, rather that drivers/pci, drivers/isa, drivers/mca and drivers/pcmcia.

This argument has been discussed in the past (see the linux-usb-devel and linux-kernel mailing list archives) but from what I remember, Linus and others wanted them all to stay in the drivers/usb directory for now.

Personally I don't care either way, but it has been easier to do usb core changes (such as the hotplug interface changes that I suggested for your driver) with all of the drivers in one place, not that I can't do a recursive grep :)

thanks,

greg k-h

Signature · 2 lines
greg@(kroah|wirex).com
http://immunix.org/~greg