new driver : stir4200
PATCH 1/1 new driver : stir4200
Hi Dave,
After a long maturation, this is time to send you the latest
version of the stir4200 USB driver. Initially started by Paul Stewart, modified by Martin Diehl and me, and later partially rewriten by Stephen Hemminger.
The hardware has many quirks. This is the first version that
work reliably at SIR and mostly work at FIR. We may never get optimal operation from this hardware due to its pecularities, but at least its now usable.
Would you mind pushing that to Linus ?
Regards,
Jean
------------------------------------------------------------------
drivers/net/irda/Kconfig renamed from drivers/net/irda.d8/Kconfig +16 -0
@@ -292,6 +292,22 @@ config USB_IRDA Please note that the driver is still experimental. And of course, you will need both USB and IrDA support in your kernel... +config SIGMATEL_FIR + tristate "SigmaTel STIr4200 bridge (EXPERIMENTAL)" + depends on IRDA && USB && EXPERIMENTAL + select CRC32 + ---help--- + Say Y here if you want to build support for the SigmaTel STIr4200 + USB IrDA FIR bridge device driver. + + USB bridge based on the SigmaTel STIr4200 don't conform to the + IrDA-USB device class specification, and therefore need their + own specific driver. Those dongles support SIR and FIR (4Mbps) + speeds. + + To compile it as a module, choose M here: the module will be called + stir4200. + config NSC_FIR tristate "NSC PC87108/PC87338" depends on IRDA && ISA
drivers/net/irda/Makefile renamed from drivers/net/irda.d8/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_IRPORT_SIR) += irport.o # FIR drivers obj-$(CONFIG_USB_IRDA) += irda-usb.o +obj-$(CONFIG_SIGMATEL_FIR) += stir4200.o obj-$(CONFIG_NSC_FIR) += nsc-ircc.o obj-$(CONFIG_WINBOND_FIR) += w83977af_ir.o obj-$(CONFIG_SA1100_FIR) += sa1100_ir.o
drivers/net/irda/stir4200.c renamed from drivers/net/irda.d8/stir4200.c +1282 -0
1,282 lines not on this page · raw message
Quoted 11 lines · Jean Tourrilhes
drivers/net/irda/stir4200.c renamed from drivers/net/irda.d8/stir4200.c +11
-0+static void stir_disconnect (struct usb_interface *intf) +{ +struct stir_cb *stir =usb_get_intfdata (intf); +struct net_device *net; + +usb_set_intfdata (intf,NULL ); +if (!stir) +return ; + +/* Stop transmitter */ + net = stir->netdev;
drivers/net/irda/stir4200.c line 1225
Quoted 10 lines
drivers/net/irda/stir4200.c renamed from drivers/net/irda.d8/stir4200.c +10
-0+netif_device_detach (net); + +/* Remove netdevice */ +unregister_netdev (net); + +/* No longer attached to USB bus */ + stir->usbdev =NULL ; + +free_netdev (net); +}
1) Do we need netif_device_detach() there?
2) Shouldn't we leave usb_set_intfdata() until after unregister_netdev()?
Quoted 4 lines · On Fri, 13 Feb 2004 17:50:59 -0800 Jean Tourrilhes <[email protected]>…
After a long maturation, this is time to send you the latest
version of the stir4200 USB driver. Initially started by Paul Stewart, modified by Martin Diehl and me, and later partially rewriten by Stephen Hemminger.
...
Quoted 1 line
Would you mind pushing that to Linus ?
I'll queue this up for 2.6.4-pre1, thanks.
If you address Al Viro's concerns, just send me a relative patch with the fix. Thanks again.
Jean Tourrilhes <[email protected]> :
[...]
Quoted 4 lines
After a long maturation, this is time to send you the latest
version of the stir4200 USB driver. Initially started by Paul Stewart, modified by Martin Diehl and me, and later partially rewriten by Stephen Hemminger.
Fix + minor change attached.
--
Ueimor
If stir_reset() succeeds, stir_net_open() must not return a success status code for every failure until irlap_open().
drivers/net/irda/stir4200.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/irda/stir4200.c renamed from drivers/net/irda/stir4200.c~stir4200-bad-return-status +2 -1
@@ -913,6 +913,8 @@ static int stir_net_open(struct net_deviif (err) goto err_out1; + err = -ENOMEM ; +/* Note: Max SIR frame possible is 4273 */ stir->tx_data =kmalloc (STIR_FIFO_SIZE ,GFP_KERNEL );if (!stir->tx_data) {
@@ -956,7 +958,6 @@ static int stir_net_open(struct net_devi* Note : will send immediately a speed change... */ sprintf (hwname,"usb#%d" , stir->usbdev->devnum); - err = -ENOMEM ; stir->irlap =irlap_open (netdev, &stir->qos, hwname);if (!stir->irlap) {ERROR ("%s(): irlap_open failed\n" , __FUNCTION__);
_
Defer netif_start_queue() until device opening succeeds.
drivers/net/irda/stir4200.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/irda/stir4200.c renamed from drivers/net/irda/stir4200.c~stir4200-late-netif-start-queue +2 -2
@@ -950,8 +950,6 @@ static int stir_net_open(struct net_devi } } -netif_start_queue (netdev); -/* * Now that everything should be initialized properly, * Open new IrLAP layer instance to take care of us...
@@ -974,6 +972,8 @@ static int stir_net_open(struct net_devi goto err_out4; } +netif_start_queue (netdev); +return 0 ; err_out4:
_
David S. Miller
AppliedQuoted 1 line · On Sat, 14 Feb 2004 13:56:09 +0100 Francois Romieu <[email protected]> wrote:
Fix + minor change attached.
I've applied both fixes, thanks Francois.