Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/irda In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/irda Modified Files: Config.in Makefile actisys.c esi.c girbil.c irport.c irtty.c litelink.c nsc-ircc.c old_belkin.c smc-ircc.c tekram.c toshoboe.c w83977af_ir.c Added Files: ali-ircc.c ep7211_ir.c irda-usb.c sa1100_ir.c vlsi_ir.c Log Message: synch 2.4.15 commit 50 --- NEW FILE --- /********************************************************************* * * Filename: ali-ircc.h * Version: 0.5 * Description: Driver for the ALI M1535D and M1543C FIR Controller * Status: Experimental. * Author: Benjamin Kong <ben...@al...> * Created at: 2000/10/16 03:46PM * Modified at: 2001/1/3 02:55PM * Modified by: Benjamin Kong <ben...@al...> * * Copyright (c) 2000 Benjamin Kong <ben...@al...> * All Rights Reserved * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * [...2273 lines suppressed...] MODULE_LICENSE("GPL"); MODULE_PARM(io, "1-4i"); MODULE_PARM_DESC(io, "Base I/O addresses"); MODULE_PARM(irq, "1-4i"); MODULE_PARM_DESC(irq, "IRQ lines"); MODULE_PARM(dma, "1-4i"); MODULE_PARM_DESC(dma, "DMA channels"); int init_module(void) { return ali_ircc_init(); } void cleanup_module(void) { ali_ircc_cleanup(); } #endif /* MODULE */ --- NEW FILE --- /* * IR port driver for the Cirrus Logic EP7211 processor. * * Copyright 2001, Blue Mug Inc. All rights reserved. */ #include <linux/module.h> #include <linux/delay.h> #include <linux/tty.h> #include <linux/sched.h> #include <linux/init.h> #include <net/irda/irda.h> #include <net/irda/irmod.h> #include <net/irda/irda_device.h> #include <asm/io.h> #include <asm/hardware.h> #define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */ #define MAX_DELAY 10000 /* 1 ms */ static void ep7211_ir_open(dongle_t *self, struct qos_info *qos); static void ep7211_ir_close(dongle_t *self); static int ep7211_ir_change_speed(struct irda_task *task); static int ep7211_ir_reset(struct irda_task *task); static struct dongle_reg dongle = { Q_NULL, IRDA_EP7211_IR, ep7211_ir_open, ep7211_ir_close, ep7211_ir_reset, ep7211_ir_change_speed, }; static void ep7211_ir_open(dongle_t *self, struct qos_info *qos) { unsigned int syscon1, flags; save_flags(flags); cli(); /* Turn on the SIR encoder. */ syscon1 = clps_readl(SYSCON1); syscon1 |= SYSCON1_SIREN; clps_writel(syscon1, SYSCON1); /* XXX: We should disable modem status interrupts on the first UART (interrupt #14). */ restore_flags(flags); MOD_INC_USE_COUNT; } static void ep7211_ir_close(dongle_t *self) { unsigned int syscon1, flags; save_flags(flags); cli(); /* Turn off the SIR encoder. */ syscon1 = clps_readl(SYSCON1); syscon1 &= ~SYSCON1_SIREN; clps_writel(syscon1, SYSCON1); /* XXX: If we've disabled the modem status interrupts, we should reset them back to their original state. */ restore_flags(flags); MOD_DEC_USE_COUNT; } /* * Function ep7211_ir_change_speed (task) * * Change speed of the EP7211 I/R port. We don't really have to do anything * for the EP7211 as long as the rate is being changed at the serial port * level. */ static int ep7211_ir_change_speed(struct irda_task *task) { irda_task_next_state(task, IRDA_TASK_DONE); return 0; } /* * Function ep7211_ir_reset (task) * * Reset the EP7211 I/R. We don't really have to do anything. * */ static int ep7211_ir_reset(struct irda_task *task) { irda_task_next_state(task, IRDA_TASK_DONE); return 0; } /* * Function ep7211_ir_init(void) * * Initialize EP7211 I/R module * */ int __init ep7211_ir_init(void) { return irda_device_register_dongle(&dongle); } /* * Function ep7211_ir_cleanup(void) * * Cleanup EP7211 I/R module * */ static void __exit ep7211_ir_cleanup(void) { irda_device_unregister_dongle(&dongle); } MODULE_AUTHOR("Jon McClintock <jo...@bl...>"); MODULE_DESCRIPTION("EP7211 I/R driver"); MODULE_LICENSE("GPL"); #ifdef MODULE module_init(ep7211_ir_init); #endif /* MODULE */ module_exit(ep7211_ir_cleanup); --- NEW FILE --- /***************************************************************************** * * Filename: irda-usb.c * Version: 0.9b * Description: IrDA-USB Driver * Status: Experimental * Author: Dag Brattli <da...@br...> * * Copyright (C) 2000, Roman Weissgaerber <we...@vi...> * Copyright (C) 2001, Dag Brattli <da...@br...> * Copyright (C) 2001, Jean Tourrilhes <jt...@hp...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of [...1545 lines suppressed...] /* If the Device is zombie */ if((irda->usbdev != NULL) && (irda->present == 0)) { IRDA_DEBUG(0, __FUNCTION__ "(), disconnect zombie now !\n"); irda_usb_disconnect(irda->usbdev, (void *) irda); } } /* Deregister the driver and remove all pending instances */ usb_deregister(&irda_driver); } module_exit(usb_irda_cleanup); /*------------------------------------------------------------------*/ /* * Module parameters */ MODULE_PARM(qos_mtt_bits, "i"); MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time"); MODULE_AUTHOR("Roman Weissgaerber <we...@vi...>, Dag Brattli <da...@br...> and Jean Tourrilhes <jt...@hp...>"); MODULE_DESCRIPTION("IrDA-USB Dongle Driver"); --- NEW FILE --- /* * linux/drivers/net/irda/sa1100_ir.c * * Copyright (C) 2000-2001 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Infra-red driver for the StrongARM SA1100 embedded microprocessor * * Note that we don't have to worry about the SA1111's DMA bugs in here, * so we use the straight forward pci_map_* functions with a null pointer. * IMHO we should really be using our own machine specific set. */ #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> [...1124 lines suppressed...] * We now know that the netdevice is no longer in use, and all * references to our driver have been removed. The only structure * which may still be present is the netdevice, which will get * cleaned up by net/core/dev.c */ } #ifdef MODULE module_init(sa1100_irda_init); module_exit(sa1100_irda_exit); #endif MODULE_AUTHOR("Russell King <rm...@ar...>"); MODULE_DESCRIPTION("StrongARM SA1100 IrDA driver"); MODULE_LICENSE("GPL"); MODULE_PARM(power_level, "i"); MODULE_PARM_DESC(power_level, "IrDA power level, 1 (low) to 3 (high)"); MODULE_PARM(tx_lpm, "i"); MODULE_PARM_DESC(tx_lpm, "Enable transmitter low power (1.6us) mode"); EXPORT_NO_SYMBOLS; --- NEW FILE --- /********************************************************************* * * vlsi_ir.c: VLSI82C147 PCI IrDA controller driver for Linux * * Version: 0.3, Sep 30, 2001 * * Copyright (c) 2001 Martin Diehl * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License [...1298 lines suppressed...] drivername, (i)?"rx":"tx", ringsize[i]); printk(", using default=8\n"); ringsize[i] = 8; break; } } sirpulse = !!sirpulse; return pci_module_init(&vlsi_irda_driver); } static void __exit vlsi_mod_exit(void) { pci_unregister_driver(&vlsi_irda_driver); } module_init(vlsi_mod_init); module_exit(vlsi_mod_exit); Index: Config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/Config.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Config.in 14 Jan 2001 17:41:55 -0000 1.1.1.1 +++ Config.in 11 Apr 2002 12:37:48 -0000 1.2 @@ -5,14 +5,6 @@ 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,23 @@ 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 + if [ "$CONFIG_ARCH_EP7211" = "y" ]; then + dep_tristate ' EP7211 I/R support' CONFIG_EP7211_IR $CONFIG_IRDA + fi +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 +dep_tristate 'ALi M5123 FIR (Experimental)' CONFIG_ALI_FIR $CONFIG_IRDA +dep_tristate 'VLSI 82C147 SIR/MIR/FIR (Experimental)' CONFIG_VLSI_FIR $CONFIG_IRDA +fi +if [ "$CONFIG_ARCH_SA1100" = "y" ]; then + dep_tristate 'SA1100 Internal IR' CONFIG_SA1100_FIR $CONFIG_IRDA fi endmenu Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 17:41:55 -0000 1.1.1.1 +++ Makefile 11 Apr 2002 12:37:48 -0000 1.2 @@ -1,3 +1,4 @@ +# File: drivers/irda/Makefile # # Makefile for the Linux IrDA infrared port device drivers. # @@ -12,15 +13,20 @@ 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_SA1100_FIR) += sa1100_ir.o obj-$(CONFIG_TOSHIBA_FIR) += toshoboe.o obj-$(CONFIG_SMC_IRCC_FIR) += smc-ircc.o irport.o +obj-$(CONFIG_ALI_FIR) += ali-ircc.o +obj-$(CONFIG_VLSI_FIR) += vlsi_ir.o obj-$(CONFIG_ESI_DONGLE) += esi.o obj-$(CONFIG_TEKRAM_DONGLE) += tekram.o obj-$(CONFIG_ACTISYS_DONGLE) += actisys.o obj-$(CONFIG_GIRBIL_DONGLE) += girbil.o obj-$(CONFIG_LITELINK_DONGLE) += litelink.o obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin.o +obj-$(CONFIG_EP7211_IR) += ep7211_ir.o include $(TOPDIR)/Rules.make Index: actisys.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/actisys.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- actisys.c 14 Jan 2001 17:41:56 -0000 1.1.1.1 +++ actisys.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -272,6 +272,8 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...> - Jean Tourrilhes <jt...@hp...>"); MODULE_DESCRIPTION("ACTiSYS IR-220L and IR-220L+ dongle driver"); +MODULE_LICENSE("GPL"); + /* * Function init_module (void) Index: esi.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/esi.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- esi.c 14 Jan 2001 17:41:56 -0000 1.1.1.1 +++ esi.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -136,6 +136,7 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Extended Systems JetEye PC dongle driver"); +MODULE_LICENSE("GPL"); /* * Function init_module (void) Index: girbil.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/girbil.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- girbil.c 14 Jan 2001 17:42:13 -0000 1.1.1.1 +++ girbil.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -234,6 +234,8 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Greenwich GIrBIL dongle driver"); +MODULE_LICENSE("GPL"); + /* * Function init_module (void) Index: irport.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/irport.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- irport.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ irport.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -293,9 +293,9 @@ iobase = self->io.sir_base; - spin_lock_irqsave(&self->lock, flags); - irport_stop(self); + + spin_lock_irqsave(&self->lock, flags); /* Initialize UART */ outb(UART_LCR_WLEN8, iobase+UART_LCR); /* Reset DLAB */ @@ -353,7 +353,7 @@ int lcr; /* Line control reg */ int divisor; - IRDA_DEBUG(2, __FUNCTION__ "(), Setting speed to: %d\n", speed); + IRDA_DEBUG(0, __FUNCTION__ "(), Setting speed to: %d\n", speed); ASSERT(self != NULL, return;); @@ -609,14 +609,16 @@ * * Transmits the current frame until FIFO is full, then * waits until the next transmitt interrupt, and continues until the - * frame is transmited. + * frame is transmitted. */ int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev) { struct irport_cb *self; unsigned long flags; int iobase; - __s32 speed; + s32 speed; + + IRDA_DEBUG(0, __FUNCTION__ "()\n"); ASSERT(dev != NULL, return 0;); @@ -772,24 +774,33 @@ { struct irport_cb *self; int iobase; + char hwname[16]; + IRDA_DEBUG(0, __FUNCTION__ "()\n"); + ASSERT(dev != NULL, return -1;); self = (struct irport_cb *) dev->priv; iobase = self->io.sir_base; if (request_irq(self->io.irq, self->interrupt, 0, dev->name, - (void *) dev)) + (void *) dev)) { + IRDA_DEBUG(0, __FUNCTION__ "(), unable to allocate irq=%d\n", + self->io.irq); return -EAGAIN; + } irport_start(self); + /* Give self a hardware name */ + sprintf(hwname, "SIR @ 0x%03x", self->io.sir_base); + /* * Open new IrLAP layer instance, now that everything should be * initialized properly */ - self->irlap = irlap_open(dev, &self->qos); + self->irlap = irlap_open(dev, &self->qos, hwname); /* FIXME: change speed of dongle */ /* Ready to play! */ @@ -951,13 +962,17 @@ switch (cmd) { case SIOCSBANDWIDTH: /* Set bandwidth */ if (!capable(CAP_NET_ADMIN)) - return -EPERM; - irda_task_execute(self, __irport_change_speed, NULL, NULL, - (void *) irq->ifr_baudrate); + ret = -EPERM; + else + irda_task_execute(self, __irport_change_speed, NULL, + NULL, (void *) irq->ifr_baudrate); break; case SIOCSDONGLE: /* Set dongle */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + break; + } + /* Initialize dongle */ dongle = irda_device_dongle_init(dev, irq->ifr_dongle); if (!dongle) @@ -978,16 +993,22 @@ NULL); break; case SIOCSMEDIABUSY: /* Set media busy */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + break; + } + irda_device_set_media_busy(self->netdev, TRUE); break; case SIOCGRECEIVING: /* Check if we are receiving right now */ irq->ifr_receiving = irport_is_receiving(self); break; case SIOCSDTRRTS: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + break; + } + irport_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts); break; default: @@ -1008,12 +1029,14 @@ #ifdef MODULE MODULE_PARM(io, "1-4i"); -MODULE_PARM_DESC(io, "Base I/O adresses"); +MODULE_PARM_DESC(io, "Base I/O addresses"); MODULE_PARM(irq, "1-4i"); MODULE_PARM_DESC(irq, "IRQ lines"); MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Half duplex serial driver for IrDA SIR mode"); +MODULE_LICENSE("GPL"); + void cleanup_module(void) { Index: irtty.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/irtty.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- irtty.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ irtty.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -824,7 +824,7 @@ /* * Function irtty_raw_read (self, buf, len) * - * Receive incomming data. This function sleeps, so it must only be + * Receive incoming data. This function sleeps, so it must only be * called with a process context. Timeout is currently defined to be * a multiple of 10 ms. */ @@ -895,6 +895,8 @@ static int irtty_net_open(struct net_device *dev) { struct irtty_cb *self = (struct irtty_cb *) dev->priv; + struct tty_struct *tty = self->tty; + char hwname[16]; ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRTTY_MAGIC, return -1;); @@ -907,11 +909,16 @@ /* Make sure we can receive more data */ irtty_stop_receiver(self, FALSE); + /* Give self a hardware name */ + sprintf(hwname, "%s%d", tty->driver.name, + MINOR(tty->device) - tty->driver.minor_start + + tty->driver.name_base); + /* * Open new IrLAP layer instance, now that everything should be * initialized properly */ - self->irlap = irlap_open(dev, &self->qos); + self->irlap = irlap_open(dev, &self->qos, hwname); MOD_INC_USE_COUNT; @@ -971,13 +978,17 @@ switch (cmd) { case SIOCSBANDWIDTH: /* Set bandwidth */ if (!capable(CAP_NET_ADMIN)) - return -EPERM; - irda_task_execute(self, irtty_change_speed, NULL, NULL, - (void *) irq->ifr_baudrate); + ret = -EPERM; + else + irda_task_execute(self, irtty_change_speed, NULL, NULL, + (void *) irq->ifr_baudrate); break; case SIOCSDONGLE: /* Set dongle */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + break; + } + /* Initialize dongle */ dongle = irda_device_dongle_init(dev, irq->ifr_dongle); if (!dongle) @@ -999,21 +1010,24 @@ break; case SIOCSMEDIABUSY: /* Set media busy */ if (!capable(CAP_NET_ADMIN)) - return -EPERM; - irda_device_set_media_busy(self->netdev, TRUE); + ret = -EPERM; + else + irda_device_set_media_busy(self->netdev, TRUE); break; case SIOCGRECEIVING: /* Check if we are receiving right now */ irq->ifr_receiving = irtty_is_receiving(self); break; case SIOCSDTRRTS: if (!capable(CAP_NET_ADMIN)) - return -EPERM; - irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts); + ret = -EPERM; + else + irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts); break; case SIOCSMODE: if (!capable(CAP_NET_ADMIN)) - return -EPERM; - irtty_set_mode(dev, irq->ifr_mode); + ret = -EPERM; + else + irtty_set_mode(dev, irq->ifr_mode); break; default: ret = -EOPNOTSUPP; @@ -1035,6 +1049,8 @@ MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("IrDA TTY device driver"); +MODULE_LICENSE("GPL"); + MODULE_PARM(qos_mtt_bits, "i"); MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time"); Index: litelink.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/litelink.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- litelink.c 14 Jan 2001 17:42:13 -0000 1.1.1.1 +++ litelink.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -166,6 +166,8 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Parallax Litelink dongle driver"); +MODULE_LICENSE("GPL"); + /* * Function init_module (void) Index: nsc-ircc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/nsc-ircc.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- nsc-ircc.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ nsc-ircc.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -90,7 +90,7 @@ static nsc_chip_t chips[] = { { "PC87108", { 0x150, 0x398, 0xea }, 0x05, 0x10, 0xf0, nsc_ircc_probe_108, nsc_ircc_init_108 }, - { "PC87338", { 0x398, 0x15c, 0x2e }, 0x08, 0xb0, 0xf0, + { "PC87338", { 0x398, 0x15c, 0x2e }, 0x08, 0xb0, 0xf8, nsc_ircc_probe_338, nsc_ircc_init_338 }, { NULL } }; @@ -112,7 +112,7 @@ "Reserved", "Reserved", "HP HSDL-1100/HSDL-2100", - "HP HSDL-1100/HSDL-2100" + "HP HSDL-1100/HSDL-2100", "Supports SIR Mode only", "No dongle connected", }; @@ -160,7 +160,7 @@ int i = 0; /* Probe for all the NSC chipsets we know about */ - for (chip=chips; chip->name ; chip++,i++) { + for (chip=chips; chip->name ; chip++) { IRDA_DEBUG(2, __FUNCTION__"(), Probing for %s ...\n", chip->name); @@ -196,7 +196,7 @@ * we init the chip, if not we probe the values * set by the BIOS */ - if (io[i] < 2000) { + if (io[i] < 0x2000) { chip->init(chip, &info); } else chip->probe(chip, &info); @@ -251,9 +251,14 @@ IRDA_DEBUG(2, __FUNCTION__ "()\n"); + MESSAGE("%s, Found chip at base=0x%03x\n", driver_name, + info->cfg_base); + if ((nsc_ircc_setup(info)) == -1) return -1; + MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); + /* Allocate new instance of the driver */ self = kmalloc(sizeof(struct nsc_ircc_cb), GFP_KERNEL); if (self == NULL) { @@ -315,8 +320,8 @@ self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL|GFP_DMA); if (self->tx_buff.head == NULL) { - kfree(self); kfree(self->rx_buff.head); + kfree(self); return -ENOMEM; } memset(self->tx_buff.head, 0, self->tx_buff.truesize); @@ -597,7 +602,7 @@ outb(CFG_PNP0, cfg_base); reg = inb(cfg_base+1); - pnp = (reg >> 4) & 0x01; + pnp = (reg >> 3) & 0x01; if (pnp) { IRDA_DEBUG(2, "(), Chip is in PnP mode\n"); outb(0x46, cfg_base); @@ -699,8 +704,6 @@ ERROR("%s, Wrong chip version %02x\n", driver_name, version); return -1; } - MESSAGE("%s, Found chip at base=0x%03x\n", driver_name, - info->cfg_base); /* Switch to advanced mode */ switch_bank(iobase, BANK2); @@ -729,8 +732,6 @@ outb(0x0d, iobase+2); /* Set SIR pulse width to 1.6us */ outb(0x2a, iobase+4); /* Set beginning frag, and preamble length */ - MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); - /* Enable receive interrupts */ switch_bank(iobase, BANK0); outb(IER_RXHDL_IE, iobase+IER); @@ -1263,7 +1264,7 @@ * Function nsc_ircc_pio_xmit (self, iobase) * * Transmit data using PIO. Returns the number of bytes that actually - * got transfered + * got transferred * */ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size) @@ -1835,6 +1836,7 @@ { struct nsc_ircc_cb *self; int iobase; + char hwname[32]; __u8 bank; IRDA_DEBUG(4, __FUNCTION__ "()\n"); @@ -1858,7 +1860,7 @@ if (request_dma(self->io.dma, dev->name)) { WARNING("%s, unable to allocate dma=%d\n", driver_name, self->io.dma); - free_irq(self->io.irq, self); + free_irq(self->io.irq, dev); return -EAGAIN; } @@ -1873,14 +1875,16 @@ outb(bank, iobase+BSR); /* Ready to play! */ - netif_start_queue(dev); + /* Give self a hardware name */ + sprintf(hwname, "NSC-FIR @ 0x%03x", self->io.fir_base); + /* * Open new IrLAP layer instance, now that everything should be * initialized properly */ - self->irlap = irlap_open(dev, &self->qos); + self->irlap = irlap_open(dev, &self->qos, hwname); MOD_INC_USE_COUNT; @@ -2008,18 +2012,10 @@ static void nsc_ircc_wakeup(struct nsc_ircc_cb *self) { - int iobase; - if (!self->io.suspended) return; - iobase = self->io.fir_base; - - /* Switch to advanced mode */ - switch_bank(iobase, BANK2); - outb(ECR1_EXT_SL, iobase+ECR1); - switch_bank(iobase, BANK0); - + nsc_ircc_setup(&self->io); nsc_ircc_net_open(self->netdev); MESSAGE("%s, Waking up\n", driver_name); @@ -2046,6 +2042,8 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("NSC IrDA Device Driver"); +MODULE_LICENSE("GPL"); + MODULE_PARM(qos_mtt_bits, "i"); MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time"); Index: old_belkin.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/old_belkin.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- old_belkin.c 14 Jan 2001 17:42:24 -0000 1.1.1.1 +++ old_belkin.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -152,6 +152,8 @@ #ifdef MODULE MODULE_AUTHOR("Jean Tourrilhes <jt...@hp...>"); MODULE_DESCRIPTION("Belkin (old) SmartBeam dongle driver"); +MODULE_LICENSE("GPL"); + /* * Function init_module (void) Index: smc-ircc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/smc-ircc.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- smc-ircc.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ smc-ircc.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -8,8 +8,11 @@ * Created at: * Modified at: Tue Feb 22 10:05:06 2000 * Modified by: Dag Brattli <da...@br...> + * Modified at: Tue Jun 26 2001 + * Modified by: Stefani Seibold <st...@se...> * - * Copyright (c) 1999-2000 Dag Brattli + * Copyright (c) 2001 Stefani Seibold + * Copyright (c) 1999-2001 Dag Brattli * Copyright (c) 1998-1999 Thomas Davis, * All Rights Reserved. [...1156 lines suppressed...] + +module_init(smc_init); +module_exit(smc_cleanup); + +MODULE_AUTHOR("Thomas Davis <ta...@jp...>"); +MODULE_DESCRIPTION("SMC IrCC controller driver"); +MODULE_LICENSE("GPL"); + +MODULE_PARM(ircc_dma, "1i"); +MODULE_PARM_DESC(ircc_dma, "DMA channel"); +MODULE_PARM(ircc_irq, "1i"); +MODULE_PARM_DESC(ircc_irq, "IRQ line"); +MODULE_PARM(ircc_fir, "1-4i"); +MODULE_PARM_DESC(ircc_fir, "FIR Base Address"); +MODULE_PARM(ircc_sir, "1-4i"); +MODULE_PARM_DESC(ircc_sir, "SIR Base Address"); +MODULE_PARM(ircc_cfg, "1-4i"); +MODULE_PARM_DESC(ircc_cfg, "Configuration register base address"); #endif /* MODULE */ Index: tekram.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/tekram.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- tekram.c 14 Jan 2001 17:42:08 -0000 1.1.1.1 +++ tekram.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -267,6 +267,7 @@ #ifdef MODULE MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Tekram IrMate IR-210B dongle driver"); +MODULE_LICENSE("GPL"); /* * Function init_module (void) Index: toshoboe.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/toshoboe.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- toshoboe.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ toshoboe.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -43,9 +43,6 @@ /* Define this to enable FIR and MIR support */ #define ENABLE_FAST -/* Number of ports this driver can support, you also need to edit dev_self below */ -#define NSELFS 4 - /* Size of IO window */ #define CHIP_IO_EXTENT 0x1f @@ -77,14 +74,19 @@ #include <net/irda/irda_device.h> #include <linux/pm.h> -static int toshoboe_pmproc (struct pm_dev *dev, pm_request_t rqst, void *data); #include <net/irda/toshoboe.h> -static char *driver_name = "toshoboe"; +#define PCI_DEVICE_ID_FIR701b 0x0d01 + +static struct pci_device_id toshoboe_pci_tbl[] __initdata = { + { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701b, PCI_ANY_ID, PCI_ANY_ID, }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(pci, toshoboe_pci_tbl); -static struct toshoboe_cb *dev_self[NSELFS + 1] = -{NULL, NULL, NULL, NULL, NULL}; +static const char *driver_name = "toshoboe"; static int max_baud = 4000000; @@ -191,8 +193,8 @@ outb_p (OBOE_NTR_VAL, OBOE_NTR); outb_p (0xf0, OBOE_REG_D); outb_p (0xff, OBOE_ISR); - outb_p (0x0f, OBOE_REG_1A); - outb_p (0xff, OBOE_REG_1B); + outb_p (0x0f, OBOE_REG_1B); + outb_p (0xff, OBOE_REG_1A); physaddr = virt_to_bus (self->taskfile); @@ -508,6 +510,7 @@ toshoboe_net_open (struct net_device *dev) { struct toshoboe_cb *self; + char hwname[32]; IRDA_DEBUG (4, __FUNCTION__ "()\n"); @@ -535,11 +538,13 @@ /* Ready to play! */ netif_start_queue(dev); + /* Give self a hardware name */ + sprintf(hwname, "Toshiba-FIR @ 0x%03x", self->base); /* * Open new IrLAP layer instance, now that everything should be * initialized properly */ - self->irlap = irlap_open(dev, &self->qos); + self->irlap = irlap_open(dev, &self->qos, hwname); self->open = 1; @@ -608,18 +613,21 @@ /* Disable interrupts & save flags */ save_flags(flags); cli(); - switch (cmd) { case SIOCSBANDWIDTH: /* Set bandwidth */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + goto out; + } /* toshoboe_setbaud(self, irq->ifr_baudrate); */ /* Just change speed once - inserted by Paul Bristow */ self->new_speed = irq->ifr_baudrate; break; case SIOCSMEDIABUSY: /* Set media busy */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + goto out; + } irda_device_set_media_busy(self->netdev, TRUE); break; case SIOCGRECEIVING: /* Check if we are receiving right now */ @@ -628,27 +636,27 @@ default: ret = -EOPNOTSUPP; } - +out: restore_flags(flags); - return ret; } -#ifdef MODULE - MODULE_DESCRIPTION("Toshiba OBOE IrDA Device Driver"); MODULE_AUTHOR("James McKenzie <ja...@fi...>"); +MODULE_LICENSE("GPL"); + MODULE_PARM (max_baud, "i"); MODULE_PARM_DESC(max_baus, "Maximum baud rate"); -static int -toshoboe_close (struct toshoboe_cb *self) +static void +toshoboe_remove (struct pci_dev *pci_dev) { int i; + struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); IRDA_DEBUG (4, __FUNCTION__ "()\n"); - ASSERT (self != NULL, return -1; + ASSERT (self != NULL, return; ); if (!self->stopped) @@ -683,34 +691,23 @@ self->taskfilebuf = NULL; self->taskfile = NULL; - return (0); + return; } -#endif - - - static int -toshoboe_open (struct pci_dev *pci_dev) +toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid) { struct toshoboe_cb *self; struct net_device *dev; - struct pm_dev *pmdev; int i = 0; int ok = 0; int err; IRDA_DEBUG (4, __FUNCTION__ "()\n"); - while (dev_self[i]) - i++; - - if (i == NSELFS) - { - printk (KERN_ERR "Oboe: No more instances available"); - return -ENOMEM; - } + if ((err=pci_enable_device(pci_dev))) + return err; self = kmalloc (sizeof (struct toshoboe_cb), GFP_KERNEL); @@ -723,12 +720,10 @@ memset (self, 0, sizeof (struct toshoboe_cb)); - dev_self[i] = self; /*This needs moving if we ever get more than one chip */ - self->open = 0; self->stopped = 0; self->pdev = pci_dev; - self->base = pci_dev->resource[0].start; + self->base = pci_resource_start(pci_dev,0); self->io.sir_base = self->base; self->io.irq = pci_dev->irq; @@ -736,19 +731,15 @@ self->io.speed = 9600; /* Lock the port that we need */ - i = check_region (self->io.sir_base, self->io.sir_ext); - if (i < 0) + if (NULL==request_region (self->io.sir_base, self->io.sir_ext, driver_name)) { IRDA_DEBUG (0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", self->io.sir_base); - dev_self[i] = NULL; - kfree (self); - - return -ENODEV; + err = -EBUSY; + goto freeself; } - irda_init_max_qos_capabilies (&self->qos); self->qos.baud_rate.bits = 0; @@ -791,8 +782,8 @@ if (!self->taskfilebuf) { printk (KERN_ERR "toshoboe: kmalloc for DMA failed()\n"); - kfree (self); - return -ENOMEM; + err = -ENOMEM; + goto freeregion; } @@ -826,25 +817,16 @@ if (ok != RX_SLOTS + TX_SLOTS) { printk (KERN_ERR "toshoboe: kmalloc for buffers failed()\n"); + err = -ENOMEM; + goto freebufs; + } - for (i = 0; i < TX_SLOTS; ++i) - if (self->xmit_bufs[i]) - kfree (self->xmit_bufs[i]); - for (i = 0; i < RX_SLOTS; ++i) - if (self->recv_bufs[i]) - kfree (self->recv_bufs[i]); - - kfree (self); - return -ENOMEM; - - } - - request_region (self->io.sir_base, self->io.sir_ext, driver_name); if (!(dev = dev_alloc("irda%d", &err))) { - ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); - return -ENOMEM; + ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); + err = -ENOMEM; + goto freebufs; } dev->priv = (void *) self; self->netdev = dev; @@ -862,12 +844,10 @@ rtnl_unlock(); if (err) { ERROR(__FUNCTION__ "(), register_netdev() failed!\n"); - return -1; + /* XXX there is not freeing for dev? */ + goto freebufs; } - - pmdev = pm_register (PM_PCI_DEV, PM_PCI_ID(pci_dev), toshoboe_pmproc); - if (pmdev) - pmdev->data = self; + pci_set_drvdata(pci_dev,self); printk (KERN_WARNING "ToshOboe: Using "); #ifdef ONETASK @@ -878,48 +858,66 @@ printk (" tasks, version %s\n", rcsid); return (0); +freebufs: + for (i = 0; i < TX_SLOTS; ++i) + if (self->xmit_bufs[i]) + kfree (self->xmit_bufs[i]); + for (i = 0; i < RX_SLOTS; ++i) + if (self->recv_bufs[i]) + kfree (self->recv_bufs[i]); + kfree(self->taskfilebuf); +freeregion: + release_region (self->io.sir_base, self->io.sir_ext); +freeself: + kfree (self); + return err; } -static void -toshoboe_gotosleep (struct toshoboe_cb *self) +static int +toshoboe_suspend (struct pci_dev *pci_dev, u32 crap) { int i = 10; + struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); printk (KERN_WARNING "ToshOboe: suspending\n"); - if (self->stopped) - return; + if (!self || self->stopped) + return 0; self->stopped = 1; if (!self->open) - return; + return 0; /*FIXME: can't sleep here wait one second */ while ((i--) && (self->txpending)) - mdelay (100); + udelay (100); toshoboe_stopchip (self); toshoboe_disablebm (self); self->txpending = 0; - + return 0; } -static void -toshoboe_wakeup (struct toshoboe_cb *self) +static int +toshoboe_resume (struct pci_dev *pci_dev) { + struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); unsigned long flags; + if (!self) + return 0; + if (!self->stopped) - return; + return 0; if (!self->open) { self->stopped = 0; - return; + return 0; } save_flags (flags); @@ -936,90 +934,29 @@ netif_wake_queue(self->netdev); restore_flags (flags); printk (KERN_WARNING "ToshOboe: waking up\n"); - -} - -static int -toshoboe_pmproc (struct pm_dev *dev, pm_request_t rqst, void *data) -{ - struct toshoboe_cb *self = (struct toshoboe_cb *) dev->data; - if (self) { - switch (rqst) { - case PM_SUSPEND: - toshoboe_gotosleep (self); - break; - case PM_RESUME: - toshoboe_wakeup (self); - break; - } - } return 0; } +static struct pci_driver toshoboe_pci_driver = { + name : "toshoboe", + id_table : toshoboe_pci_tbl, + probe : toshoboe_probe, + remove : toshoboe_remove, + suspend : toshoboe_suspend, + resume : toshoboe_resume +}; -int __init toshoboe_init (void) -{ - struct pci_dev *pci_dev = NULL; - int found = 0; - - do - { - pci_dev = pci_find_device (PCI_VENDOR_ID_TOSHIBA, - PCI_DEVICE_ID_FIR701, pci_dev); - if (pci_dev) - { - printk (KERN_WARNING "ToshOboe: Found 701 chip at 0x%0lx irq %d\n", - pci_dev->resource[0].start, - pci_dev->irq); - - if (!toshoboe_open (pci_dev)) - found++; - } - - } - while (pci_dev); - - - if (found) - { - return 0; - } - - return -ENODEV; -} - -#ifdef MODULE - -static void -toshoboe_cleanup (void) -{ - int i; - - IRDA_DEBUG (4, __FUNCTION__ "()\n"); - - for (i = 0; i < 4; i++) - { - if (dev_self[i]) - toshoboe_close (dev_self[i]); - } - - pm_unregister_all (toshoboe_pmproc); -} - - - -int -init_module (void) +int __init +toshoboe_init (void) { - return toshoboe_init (); + return pci_module_init(&toshoboe_pci_driver); } - void -cleanup_module (void) +toshoboe_cleanup (void) { - toshoboe_cleanup (); + pci_unregister_driver(&toshoboe_pci_driver); } - -#endif +module_init(toshoboe_init); +module_exit(toshoboe_cleanup); Index: w83977af_ir.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/w83977af_ir.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- w83977af_ir.c 25 Feb 2001 23:15:01 -0000 1.1.1.2 +++ w83977af_ir.c 11 Apr 2002 12:37:48 -0000 1.2 @@ -875,7 +875,7 @@ self->stats.rx_fifo_errors++; } else { - /* Check if we have transfered all data to memory */ + /* Check if we have transferred all data to memory */ switch_bank(iobase, SET0); if (inb(iobase+USR) & USR_RDR) { #ifdef CONFIG_USE_INTERNAL_TIMER @@ -1210,6 +1210,7 @@ { struct w83977af_ir *self; int iobase; + char hwname[32]; __u8 set; IRDA_DEBUG(0, __FUNCTION__ "()\n"); @@ -1251,11 +1252,14 @@ /* Ready to play! */ netif_start_queue(dev); + /* Give self a hardware name */ + sprintf(hwname, "w83977af @ 0x%03x", self->io.fir_base); + /* * Open new IrLAP layer instance, now that everything should be * initialized properly */ - self->irlap = irlap_open(dev, &self->qos); + self->irlap = irlap_open(dev, &self->qos, hwname); MOD_INC_USE_COUNT; @@ -1374,6 +1378,8 @@ MODULE_AUTHOR("Dag Brattli <da...@cs...>"); MODULE_DESCRIPTION("Winbond W83977AF IrDA Device Driver"); +MODULE_LICENSE("GPL"); + MODULE_PARM(qos_mtt_bits, "i"); MODULE_PARM_DESC(qos_mtt_bits, "Mimimum Turn Time"); |