diff -u --recursive --new-file v2.4.2/linux/CREDITS linux/CREDITS --- v2.4.2/linux/CREDITS Wed Feb 21 18:20:08 2001 +++ linux/CREDITS Fri Mar 2 11:12:06 2001 @@ -316,8 +316,8 @@ S: Australia N: Hugh Blemings -E: hugh@linuxcare.com -W: http://www.linuxcare.com.au/hugh/ +E: hugh@misc.nu +W: http://misc.nu/hugh/ D: Author and maintainer of the Keyspan USB to Serial drivers S: Po Box 234 S: Belconnen ACT 2616 diff -u --recursive --new-file v2.4.2/linux/Documentation/arm/SA1100/Brutus linux/Documentation/arm/SA1100/Brutus --- v2.4.2/linux/Documentation/arm/SA1100/Brutus Fri May 12 11:21:20 2000 +++ linux/Documentation/arm/SA1100/Brutus Fri Mar 2 11:12:06 2001 @@ -3,7 +3,7 @@ http://developer.intel.com/design/strong/applnots/sa1100lx/getstart.htm -To compile for Brutus, you must issue the following comands: +To compile for Brutus, you must issue the following commands: make brutus_config make config diff -u --recursive --new-file v2.4.2/linux/Documentation/isdn/INTERFACE linux/Documentation/isdn/INTERFACE --- v2.4.2/linux/Documentation/isdn/INTERFACE Wed Feb 21 18:20:09 2001 +++ linux/Documentation/isdn/INTERFACE Fri Mar 2 11:12:12 2001 @@ -1,4 +1,4 @@ -$Id: INTERFACE,v 1.15 1999/08/25 20:02:13 werner Exp $ +$Id: INTERFACE,v 1.15.8.1 2001/02/16 16:43:22 kai Exp $ Description of the Interface between Linklevel and Hardwarelevel of isdn4linux: diff -u --recursive --new-file v2.4.2/linux/Documentation/isdn/README.eicon linux/Documentation/isdn/README.eicon --- v2.4.2/linux/Documentation/isdn/README.eicon Sat Nov 11 18:58:02 2000 +++ linux/Documentation/isdn/README.eicon Fri Mar 2 11:12:12 2001 @@ -100,17 +100,6 @@ the necessary D-Channel traces for isdnlog. -FILECHECK: -A part of the eicon driver source code files are provided -by Eicon Technology. In order to get the best support from Eicon, -these files are tested with a checksum, just to know if the files -were modified. This does *not* mean, you are not allowed to modify the -driver. If you want to improve the driver or you fix a bug, please do -so and let me (or Eicon) know, about the necessary changes. So -every user knows, if the driver he uses is modified or checked with -Eicon files. When the driver has been loaded, in the syslog you will -find something like "verified" or "modified" right after the version. - Thanks to Deutsche Mailbox Saar-Lor-Lux GmbH diff -u --recursive --new-file v2.4.2/linux/Documentation/isdn/README.hysdn linux/Documentation/isdn/README.hysdn --- v2.4.2/linux/Documentation/isdn/README.hysdn Wed Feb 21 18:20:09 2001 +++ linux/Documentation/isdn/README.hysdn Fri Mar 2 11:12:12 2001 @@ -1,4 +1,4 @@ -$Id: README.hysdn,v 1.3 2000/08/06 09:22:51 armin Exp $ +$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $ The hysdn driver has been written by by Werner Cornelius (werner@isdn4linux.de or werner@titro.de) for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver diff -u --recursive --new-file v2.4.2/linux/Documentation/kernel-parameters.txt linux/Documentation/kernel-parameters.txt --- v2.4.2/linux/Documentation/kernel-parameters.txt Sat Dec 30 11:23:13 2000 +++ linux/Documentation/kernel-parameters.txt Fri Mar 2 11:02:15 2001 @@ -188,8 +188,10 @@ es1371= [HW,SOUND] - ether= [HW,NET] Ethernet cards parameters (iomem, irq, - dev_name). + ether= [HW,NET] Ethernet cards parameters (irq, + base_io_addr, mem_start, mem_end, name. + (mem_start is often overloaded to mean something + different and driver-specific). fd_mcs= [HW,SCSI] @@ -328,7 +330,11 @@ ncr53c8xx= [HW,SCSI] - netdev= [NET] + netdev= [NET] Ethernet cards parameters (irq, + base_io_addr, mem_start, mem_end, name. + (mem_start is often overloaded to mean something + different and driver-specific). + (cf: ether=) nfsaddrs= [NFS] diff -u --recursive --new-file v2.4.2/linux/Documentation/networking/8139too.txt linux/Documentation/networking/8139too.txt --- v2.4.2/linux/Documentation/networking/8139too.txt Mon Oct 30 12:54:42 2000 +++ linux/Documentation/networking/8139too.txt Fri Mar 2 11:02:14 2001 @@ -180,6 +180,52 @@ Change History -------------- +Version 0.9.15 - February 20, 2001 + +* Call pci_enable_device to wake up/assign resource to device, + before actually using it. +* Support wacky clone PCI ids (report from Norival Toniato Junior) +* Text spelling corrections +* Make sure tp->phys[] is signed +* Always wake queue after hw restart, in tx_timeout +* Record time of last received packet + + +Version 0.9.14 - January 11, 2001 + +* Merge some changes from Becker version 1.13: + * Add DFE 538TX PCI id + * MII read/write functions updated + * Cfg93[45]6 lock/unlock fix + * RTL-8129 (MII) support +* Clean up spinlocking + + +Version 0.9.13 - December, 2000 + +* Clear blocked signals, avoid buffer overrun setting current->comm +* Remove bogus PCI BAR length assertions +* Remove unused 'debug' module parameter + + +Version 0.9.12 - November 23, 2000 + +* Kill major Tx stop/wake queue race +* Use SET_MODULE_OWNER and fix module unload race +* Fix cable length ("Twister") tuning +* Proper media[] array length checking +* Replace timer with kernel thread for twister tuning state machine + and media checking. Fixes mdio_xxx locking, now mdio_xxx is always + protected by rtnl_lock semaphore. +* Correct some sledgehammer a.k.a. overzealous spin-locks +* Performance: Eliminate atomic_t for Tx counters, we don't need it +* Performance: Don't copy Tx buffer if the rare case occurs where it + is aligned perfectly for us. +* Eliminate needless casting of dev->priv +* PIO mode selection and Twister tuning are now CONFIG_xxx options + (though purposefully not in net/Config.in... yet) + + Version 0.9.11 - October 28, 2000 * Do not fail when PIO and MMIO region lengths do not match. diff -u --recursive --new-file v2.4.2/linux/Documentation/networking/tulip.txt linux/Documentation/networking/tulip.txt --- v2.4.2/linux/Documentation/networking/tulip.txt Tue Nov 7 11:08:09 2000 +++ linux/Documentation/networking/tulip.txt Fri Mar 2 11:02:14 2001 @@ -148,6 +148,17 @@ Version history =============== +0.9.14 (February 20, 2000): +* Fix PNIC problems (Manfred Spraul) +* Add new PCI id for Accton comet +* Support Davicom tulips +* Fix oops in eeprom parsing +* Enable workarounds for early PCI chipsets +* IA64, hppa csr0 support +* Support media types 5, 6 +* Interpret a bit more of the 21142 SROM extended media type 3 +* Add missing delay in eeprom reading + 0.9.11 (November 3, 2000): * Eliminate extra bus accesses when sharing interrupts (prumpf) * Barrier following ownership descriptor bit flip (prumpf) diff -u --recursive --new-file v2.4.2/linux/Documentation/s390/cds.txt linux/Documentation/s390/cds.txt --- v2.4.2/linux/Documentation/s390/cds.txt Wed Feb 21 18:20:09 2001 +++ linux/Documentation/s390/cds.txt Fri Mar 2 11:12:06 2001 @@ -241,7 +241,7 @@ The get_dev_info_by_irq() / get_dev_info_by_devno() functions return: - 0 - sucessful completion + 0 - successful completion -ENODEV - irq or devno don't specify a known subchannel or device number. -EINVAL - invalid devinfo value. @@ -317,7 +317,7 @@ 0 - successful completion -ENODEV - irq doesn't specify a valid subchannel number -EINVAL - an invalid parameter was detected --EBUSY - an irrecoverable I/O error occured or the device is not +-EBUSY - an irrecoverable I/O error occurred or the device is not operational. Usage Notes : @@ -568,7 +568,7 @@ The do_IO() function returns : - 0 - successful completion or request successfuly initiated + 0 - successful completion or request successfully initiated -EBUSY - the do_io() function was caled out of sequence. The device is currently processing a previous I/O request -ENODEV - irq doesn't specify a valid subchannel, the device is @@ -777,7 +777,7 @@ The halt_IO() function returns : - 0 - successful completion or request successfuly initiated + 0 - successful completion or request successfully initiated -EBUSY - the device is currently performing a synchronous I/O operation : do_IO() with flag DOIO_WAIT_FOR_INTERRUPT or an error was encountered and the device is currently diff -u --recursive --new-file v2.4.2/linux/Makefile linux/Makefile --- v2.4.2/linux/Makefile Wed Feb 21 18:20:09 2001 +++ linux/Makefile Wed Feb 21 18:19:54 2001 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 -SUBLEVEL = 2 -EXTRAVERSION = +SUBLEVEL = 3 +EXTRAVERSION =-pre1 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c --- v2.4.2/linux/arch/alpha/kernel/alpha_ksyms.c Wed Feb 21 18:20:09 2001 +++ linux/arch/alpha/kernel/alpha_ksyms.c Fri Mar 2 11:15:47 2001 @@ -235,3 +235,4 @@ EXPORT_SYMBOL_NOVERS(memset); EXPORT_SYMBOL(get_wchan); +EXPORT_SYMBOL(flush_tlb_page); diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/console.c linux/arch/alpha/kernel/console.c --- v2.4.2/linux/arch/alpha/kernel/console.c Mon Jun 19 17:59:32 2000 +++ linux/arch/alpha/kernel/console.c Fri Mar 2 11:12:07 2001 @@ -21,8 +21,8 @@ unsigned long __vga_hose_io_base = 0; /* base for default hose */ unsigned long __vga_hose_mem_base = 0; /* base for default hose */ -static struct pci_controler * __init -default_vga_hose_select(struct pci_controler *h1, struct pci_controler *h2) +static struct pci_controller * __init +default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) { if (h2->index < h1->index) return h2; @@ -31,7 +31,7 @@ } void __init -set_vga_hose(struct pci_controler *hose) +set_vga_hose(struct pci_controller *hose) { if (hose) { __vga_hose_io_base = hose->io_space->start; @@ -42,7 +42,7 @@ void __init locate_and_init_vga(void *(*sel_func)(void *, void *)) { - struct pci_controler *hose = NULL; + struct pci_controller *hose = NULL; struct pci_dev *dev = NULL; if (!sel_func) sel_func = (void *)default_vga_hose_select; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_apecs.c linux/arch/alpha/kernel/core_apecs.c --- v2.4.2/linux/arch/alpha/kernel/core_apecs.c Tue Mar 21 10:46:21 2000 +++ linux/arch/alpha/kernel/core_apecs.c Fri Mar 2 11:12:07 2001 @@ -357,7 +357,7 @@ }; void -apecs_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +apecs_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { wmb(); *(vip)APECS_IOC_TBIA = 0; @@ -367,13 +367,13 @@ void __init apecs_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; /* * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_cia.c linux/arch/alpha/kernel/core_cia.c --- v2.4.2/linux/arch/alpha/kernel/core_cia.c Mon Dec 11 13:46:26 2000 +++ linux/arch/alpha/kernel/core_cia.c Fri Mar 2 11:12:07 2001 @@ -299,7 +299,7 @@ */ void -cia_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +cia_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { wmb(); *(vip)CIA_IOC_PCI_TBIA = 3; /* Flush all locked and unlocked. */ @@ -314,7 +314,7 @@ */ static void -cia_pci_tbi_try1(struct pci_controler *hose, +cia_pci_tbi_try1(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { wmb(); @@ -359,7 +359,7 @@ } static void -cia_pci_tbi_try2(struct pci_controler *hose, +cia_pci_tbi_try2(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { unsigned long flags; @@ -595,7 +595,7 @@ static void __init do_init_arch(int is_pyxis) { - struct pci_controler *hose; + struct pci_controller *hose; int temp; int cia_rev; @@ -628,7 +628,7 @@ *(vip)CIA_IOC_HAE_IO = 0; /* For PYXIS, we always use BWX bus and i/o accesses. To that end, - make sure they're enabled on the controler. */ + make sure they're enabled on the controller. */ if (is_pyxis) { temp = *(vip)CIA_IOC_CIA_CNFG; temp |= CIA_CNFG_IOA_BWEN; @@ -643,7 +643,7 @@ * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_irongate.c linux/arch/alpha/kernel/core_irongate.c --- v2.4.2/linux/arch/alpha/kernel/core_irongate.c Mon Aug 28 21:21:57 2000 +++ linux/arch/alpha/kernel/core_irongate.c Fri Mar 2 11:12:07 2001 @@ -367,7 +367,7 @@ void __init irongate_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; IRONGATE0->stat_cmd = IRONGATE0->stat_cmd & ~0x100; irongate_pci_clr_err(); @@ -377,7 +377,7 @@ * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_lca.c linux/arch/alpha/kernel/core_lca.c --- v2.4.2/linux/arch/alpha/kernel/core_lca.c Tue Mar 21 10:46:21 2000 +++ linux/arch/alpha/kernel/core_lca.c Fri Mar 2 11:12:07 2001 @@ -279,7 +279,7 @@ }; void -lca_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +lca_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { wmb(); *(vip)LCA_IOC_TBIA = 0; @@ -289,13 +289,13 @@ void __init lca_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; /* * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_mcpcia.c linux/arch/alpha/kernel/core_mcpcia.c --- v2.4.2/linux/arch/alpha/kernel/core_mcpcia.c Wed Jun 21 22:30:59 2000 +++ linux/arch/alpha/kernel/core_mcpcia.c Fri Mar 2 11:12:07 2001 @@ -89,7 +89,7 @@ static unsigned int conf_read(unsigned long addr, unsigned char type1, - struct pci_controler *hose) + struct pci_controller *hose) { unsigned long flags; unsigned long mid = MCPCIA_HOSE2MID(hose->index); @@ -137,7 +137,7 @@ static void conf_write(unsigned long addr, unsigned int value, unsigned char type1, - struct pci_controler *hose) + struct pci_controller *hose) { unsigned long flags; unsigned long mid = MCPCIA_HOSE2MID(hose->index); @@ -171,7 +171,7 @@ } static int -mk_conf_addr(struct pci_dev *dev, int where, struct pci_controler *hose, +mk_conf_addr(struct pci_dev *dev, int where, struct pci_controller *hose, unsigned long *pci_addr, unsigned char *type1) { u8 bus = dev->bus->number; @@ -199,7 +199,7 @@ static int mcpcia_read_config_byte(struct pci_dev *dev, int where, u8 *value) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr, w; unsigned char type1; @@ -215,7 +215,7 @@ static int mcpcia_read_config_word(struct pci_dev *dev, int where, u16 *value) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr, w; unsigned char type1; @@ -231,7 +231,7 @@ static int mcpcia_read_config_dword(struct pci_dev *dev, int where, u32 *value) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr; unsigned char type1; @@ -246,7 +246,7 @@ static int mcpcia_write_config(struct pci_dev *dev, int where, u32 value, long mask) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr; unsigned char type1; @@ -288,7 +288,7 @@ }; void -mcpcia_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +mcpcia_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { wmb(); *(vuip)MCPCIA_SG_TBIA(MCPCIA_HOSE2MID(hose->index)) = 0; @@ -333,11 +333,11 @@ static void __init mcpcia_new_hose(int h) { - struct pci_controler *hose; + struct pci_controller *hose; struct resource *io, *mem, *hae_mem; int mid = MCPCIA_HOSE2MID(h); - hose = alloc_pci_controler(); + hose = alloc_pci_controller(); if (h == 0) pci_isa_hose = hose; io = alloc_resource(); @@ -386,7 +386,7 @@ } static void __init -mcpcia_startup_hose(struct pci_controler *hose) +mcpcia_startup_hose(struct pci_controller *hose) { int mid = MCPCIA_HOSE2MID(hose->index); unsigned int tmp; @@ -464,7 +464,7 @@ void __init mcpcia_init_hoses(void) { - struct pci_controler *hose; + struct pci_controller *hose; int hose_count; int h; @@ -561,7 +561,7 @@ mcpcia_print_system_area(unsigned long la_ptr) { struct el_common *frame; - struct pci_controler *hose; + struct pci_controller *hose; struct IOD_subpacket { unsigned long base; @@ -638,7 +638,7 @@ { /* FIXME: how do we figure out which hose the error was on? */ - struct pci_controler *hose; + struct pci_controller *hose; for (hose = hose_head; hose; hose = hose->next) mcpcia_pci_clr_err(MCPCIA_HOSE2MID(hose->index)); break; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_polaris.c linux/arch/alpha/kernel/core_polaris.c --- v2.4.2/linux/arch/alpha/kernel/core_polaris.c Tue Mar 21 10:46:21 2000 +++ linux/arch/alpha/kernel/core_polaris.c Fri Mar 2 11:12:07 2001 @@ -178,7 +178,7 @@ void __init polaris_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; /* May need to initialize error reporting (see PCICTL0/1), but * for now assume that the firmware has done the right thing @@ -192,7 +192,7 @@ * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_t2.c linux/arch/alpha/kernel/core_t2.c --- v2.4.2/linux/arch/alpha/kernel/core_t2.c Tue Mar 21 10:46:21 2000 +++ linux/arch/alpha/kernel/core_t2.c Fri Mar 2 11:12:07 2001 @@ -324,7 +324,7 @@ void __init t2_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; unsigned int i; for (i = 0; i < NR_CPUS; i++) { @@ -384,7 +384,7 @@ * Create our single hose. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_titan.c linux/arch/alpha/kernel/core_titan.c --- v2.4.2/linux/arch/alpha/kernel/core_titan.c Tue Jul 18 22:58:28 2000 +++ linux/arch/alpha/kernel/core_titan.c Fri Mar 2 11:12:07 2001 @@ -83,7 +83,7 @@ mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr, unsigned char *type1) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr; u8 bus = dev->bus->number; u8 device_fn = dev->devfn; @@ -200,7 +200,7 @@ void -titan_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +titan_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { titan_pachip *pachip = (hose->index & 1) ? TITAN_pachip1 : TITAN_pachip0; @@ -243,7 +243,7 @@ } static void __init -titan_init_agp(titan_pachip_port *port, struct pci_controler *hose) +titan_init_agp(titan_pachip_port *port, struct pci_controller *hose) { union TPAchipPCTL pctl; @@ -276,9 +276,9 @@ static void __init titan_init_one_pachip_port(titan_pachip_port *port, int index) { - struct pci_controler *hose; + struct pci_controller *hose; - hose = alloc_pci_controler(); + hose = alloc_pci_controller(); if (index == 0) pci_isa_hose = hose; hose->io_space = alloc_resource(); diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_tsunami.c linux/arch/alpha/kernel/core_tsunami.c --- v2.4.2/linux/arch/alpha/kernel/core_tsunami.c Mon Jun 19 17:59:32 2000 +++ linux/arch/alpha/kernel/core_tsunami.c Fri Mar 2 11:12:07 2001 @@ -90,7 +90,7 @@ mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr, unsigned char *type1) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr; u8 bus = dev->bus->number; u8 device_fn = dev->devfn; @@ -206,7 +206,7 @@ }; void -tsunami_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +tsunami_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { tsunami_pchip *pchip = hose->index ? TSUNAMI_pchip1 : TSUNAMI_pchip0; volatile unsigned long *csr; @@ -280,12 +280,12 @@ static void __init tsunami_init_one_pchip(tsunami_pchip *pchip, int index) { - struct pci_controler *hose; + struct pci_controller *hose; if (tsunami_probe_read(&pchip->pctl.csr) == 0) return; - hose = alloc_pci_controler(); + hose = alloc_pci_controller(); if (index == 0) pci_isa_hose = hose; hose->io_space = alloc_resource(); diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/core_wildfire.c linux/arch/alpha/kernel/core_wildfire.c --- v2.4.2/linux/arch/alpha/kernel/core_wildfire.c Mon Jun 19 17:59:32 2000 +++ linux/arch/alpha/kernel/core_wildfire.c Fri Mar 2 11:12:07 2001 @@ -64,10 +64,10 @@ void __init wildfire_init_hose(int qbbno, int hoseno) { - struct pci_controler *hose; + struct pci_controller *hose; wildfire_pci *pci; - hose = alloc_pci_controler(); + hose = alloc_pci_controller(); hose->io_space = alloc_resource(); hose->mem_space = alloc_resource(); @@ -346,7 +346,7 @@ } void -wildfire_pci_tbi(struct pci_controler *hose, dma_addr_t start, dma_addr_t end) +wildfire_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end) { int qbbno = hose->index >> 3; int hoseno = hose->index & 7; @@ -360,7 +360,7 @@ mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr, unsigned char *type1) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long addr; u8 bus = dev->bus->number; u8 device_fn = dev->devfn; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/pci-noop.c linux/arch/alpha/kernel/pci-noop.c --- v2.4.2/linux/arch/alpha/kernel/pci-noop.c Wed Feb 21 18:20:10 2001 +++ linux/arch/alpha/kernel/pci-noop.c Fri Mar 2 11:12:07 2001 @@ -14,17 +14,17 @@ /* - * The PCI controler list. + * The PCI controller list. */ -struct pci_controler *hose_head, **hose_tail = &hose_head; -struct pci_controler *pci_isa_hose; +struct pci_controller *hose_head, **hose_tail = &hose_head; +struct pci_controller *pci_isa_hose; -struct pci_controler * __init -alloc_pci_controler(void) +struct pci_controller * __init +alloc_pci_controller(void) { - struct pci_controler *hose; + struct pci_controller *hose; hose = alloc_bootmem(sizeof(*hose)); @@ -47,7 +47,7 @@ asmlinkage long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) { - struct pci_controler *hose; + struct pci_controller *hose; struct pci_dev *dev; /* from hose or from bus.devfn */ diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/pci.c linux/arch/alpha/kernel/pci.c --- v2.4.2/linux/arch/alpha/kernel/pci.c Mon Dec 11 13:46:26 2000 +++ linux/arch/alpha/kernel/pci.c Fri Mar 2 11:12:07 2001 @@ -43,11 +43,11 @@ /* - * The PCI controler list. + * The PCI controller list. */ -struct pci_controler *hose_head, **hose_tail = &hose_head; -struct pci_controler *pci_isa_hose; +struct pci_controller *hose_head, **hose_tail = &hose_head; +struct pci_controller *pci_isa_hose; /* * Quirks. @@ -136,7 +136,7 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size) { struct pci_dev *dev = data; - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; unsigned long alignto; unsigned long start = res->start; @@ -224,7 +224,7 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus) { /* Update device resources. */ - struct pci_controler *hose = (struct pci_controler *)bus->sysdata; + struct pci_controller *hose = (struct pci_controller *)bus->sysdata; int i; for (i = 0; i < PCI_NUM_RESOURCES; i++) { @@ -244,7 +244,7 @@ { /* Propogate hose info into the subordinate devices. */ - struct pci_controler *hose = bus->sysdata; + struct pci_controller *hose = bus->sysdata; struct list_head *ln; struct pci_dev *dev = bus->self; @@ -284,7 +284,7 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, struct resource *res, int resource) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int where; u32 reg; @@ -328,7 +328,7 @@ u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; if (dev->bus->number != hose->first_busno) { u8 pin = *pinp; @@ -349,7 +349,7 @@ pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges) { - struct pci_controler *hose = (struct pci_controler *)bus->sysdata; + struct pci_controller *hose = (struct pci_controller *)bus->sysdata; ranges->io_start -= hose->io_space->start; ranges->io_end -= hose->io_space->start; @@ -383,11 +383,11 @@ void __init common_init_pci(void) { - struct pci_controler *hose; + struct pci_controller *hose; struct pci_bus *bus; int next_busno; - /* Scan all of the recorded PCI controlers. */ + /* Scan all of the recorded PCI controllers. */ for (next_busno = 0, hose = hose_head; hose; hose = hose->next) { hose->first_busno = next_busno; hose->last_busno = 0xff; @@ -402,10 +402,10 @@ } -struct pci_controler * __init -alloc_pci_controler(void) +struct pci_controller * __init +alloc_pci_controller(void) { - struct pci_controler *hose; + struct pci_controller *hose; hose = alloc_bootmem(sizeof(*hose)); @@ -432,7 +432,7 @@ asmlinkage long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) { - struct pci_controler *hose; + struct pci_controller *hose; struct pci_dev *dev; /* from hose or from bus.devfn */ diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/pci_impl.h linux/arch/alpha/kernel/pci_impl.h --- v2.4.2/linux/arch/alpha/kernel/pci_impl.h Thu Mar 16 14:08:32 2000 +++ linux/arch/alpha/kernel/pci_impl.h Fri Mar 2 11:12:07 2001 @@ -6,7 +6,7 @@ */ struct pci_dev; -struct pci_controler; +struct pci_controller; struct pci_iommu_arena; /* @@ -133,7 +133,7 @@ struct pci_iommu_arena { spinlock_t lock; - struct pci_controler *hose; + struct pci_controller *hose; unsigned long *ptes; dma_addr_t dma_base; unsigned int size; @@ -143,15 +143,15 @@ /* The hose list. */ -extern struct pci_controler *hose_head, **hose_tail; -extern struct pci_controler *pci_isa_hose; +extern struct pci_controller *hose_head, **hose_tail; +extern struct pci_controller *pci_isa_hose; extern void common_init_pci(void); extern u8 common_swizzle(struct pci_dev *, u8 *); -extern struct pci_controler *alloc_pci_controler(void); +extern struct pci_controller *alloc_pci_controller(void); extern struct resource *alloc_resource(void); -extern struct pci_iommu_arena *iommu_arena_new(struct pci_controler *, +extern struct pci_iommu_arena *iommu_arena_new(struct pci_controller *, dma_addr_t, unsigned long, unsigned long); extern long iommu_arena_alloc(struct pci_iommu_arena *arena, long n); diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/pci_iommu.c linux/arch/alpha/kernel/pci_iommu.c --- v2.4.2/linux/arch/alpha/kernel/pci_iommu.c Mon Dec 11 13:46:26 2000 +++ linux/arch/alpha/kernel/pci_iommu.c Fri Mar 2 11:12:07 2001 @@ -43,7 +43,7 @@ } struct pci_iommu_arena * -iommu_arena_new(struct pci_controler *hose, dma_addr_t base, +iommu_arena_new(struct pci_controller *hose, dma_addr_t base, unsigned long window_size, unsigned long align) { unsigned long mem_size; @@ -147,7 +147,7 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size, int direction) { - struct pci_controler *hose = pdev ? pdev->sysdata : pci_isa_hose; + struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; dma_addr_t max_dma = pdev ? pdev->dma_mask : 0x00ffffff; struct pci_iommu_arena *arena; long npages, dma_ofs, i; @@ -215,7 +215,7 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size, int direction) { - struct pci_controler *hose = pdev ? pdev->sysdata : pci_isa_hose; + struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; struct pci_iommu_arena *arena; long dma_ofs, npages; @@ -454,7 +454,7 @@ int direction) { struct scatterlist *start, *end, *out; - struct pci_controler *hose; + struct pci_controller *hose; struct pci_iommu_arena *arena; dma_addr_t max_dma; @@ -528,7 +528,7 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, int direction) { - struct pci_controler *hose; + struct pci_controller *hose; struct pci_iommu_arena *arena; struct scatterlist *end; dma_addr_t max_dma; @@ -596,7 +596,7 @@ int pci_dma_supported(struct pci_dev *pdev, dma_addr_t mask) { - struct pci_controler *hose; + struct pci_controller *hose; struct pci_iommu_arena *arena; #if !DEBUG_NODIRECT diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/proto.h linux/arch/alpha/kernel/proto.h --- v2.4.2/linux/arch/alpha/kernel/proto.h Mon Jun 19 17:59:32 2000 +++ linux/arch/alpha/kernel/proto.h Fri Mar 2 11:12:07 2001 @@ -10,14 +10,14 @@ struct pt_regs; struct task_struct; struct pci_dev; -struct pci_controler; +struct pci_controller; /* core_apecs.c */ extern struct pci_ops apecs_pci_ops; extern void apecs_init_arch(void); extern void apecs_pci_clr_err(void); extern void apecs_machine_check(u64, u64, struct pt_regs *); -extern void apecs_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_cia.c */ extern struct pci_ops cia_pci_ops; @@ -25,7 +25,7 @@ extern void cia_init_arch(void); extern void pyxis_init_arch(void); extern void cia_machine_check(u64, u64, struct pt_regs *); -extern void cia_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_irongate.c */ extern struct pci_ops irongate_pci_ops; @@ -38,14 +38,14 @@ extern struct pci_ops lca_pci_ops; extern void lca_init_arch(void); extern void lca_machine_check(u64, u64, struct pt_regs *); -extern void lca_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_mcpcia.c */ extern struct pci_ops mcpcia_pci_ops; extern void mcpcia_init_arch(void); extern void mcpcia_init_hoses(void); extern void mcpcia_machine_check(u64, u64, struct pt_regs *); -extern void mcpcia_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_polaris.c */ extern struct pci_ops polaris_pci_ops; @@ -66,21 +66,21 @@ extern void titan_init_arch(void); extern void titan_kill_arch(int); extern void titan_machine_check(u64, u64, struct pt_regs *); -extern void titan_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_tsunami.c */ extern struct pci_ops tsunami_pci_ops; extern void tsunami_init_arch(void); extern void tsunami_kill_arch(int); extern void tsunami_machine_check(u64, u64, struct pt_regs *); -extern void tsunami_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_wildfire.c */ extern struct pci_ops wildfire_pci_ops; extern void wildfire_init_arch(void); extern void wildfire_kill_arch(int); extern void wildfire_machine_check(u64, u64, struct pt_regs *); -extern void wildfire_pci_tbi(struct pci_controler *, dma_addr_t, dma_addr_t); +extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* setup.c */ extern unsigned long srm_hae; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c --- v2.4.2/linux/arch/alpha/kernel/setup.c Wed Feb 21 18:20:10 2001 +++ linux/arch/alpha/kernel/setup.c Fri Mar 2 11:12:07 2001 @@ -201,7 +201,7 @@ long i; if (hose_head) { - struct pci_controler *hose; + struct pci_controller *hose; for (hose = hose_head; hose; hose = hose->next) if (hose->index == 0) { io = hose->io_space; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_dp264.c linux/arch/alpha/kernel/sys_dp264.c --- v2.4.2/linux/arch/alpha/kernel/sys_dp264.c Fri Oct 27 10:55:01 2000 +++ linux/arch/alpha/kernel/sys_dp264.c Fri Mar 2 11:12:07 2001 @@ -404,13 +404,13 @@ }; const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5; - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int irq = COMMON_TABLE_LOOKUP; if (irq > 0) { irq += 16 * hose->index; } else { - /* ??? The Contaq IDE controler on the ISA bridge uses + /* ??? The Contaq IDE controller on the ISA bridge uses "legacy" interrupts 14 and 15. I don't know if anything can wind up at the same slot+pin on hose1, so we'll just have to trust whatever value the console might @@ -455,7 +455,7 @@ static u8 __init monet_swizzle(struct pci_dev *dev, u8 *pinp) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int slot, pin = *pinp; if (hose->first_busno == dev->bus->number) { @@ -521,7 +521,7 @@ }; const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5; - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int irq = COMMON_TABLE_LOOKUP; if (irq > 0) diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_eiger.c linux/arch/alpha/kernel/sys_eiger.c --- v2.4.2/linux/arch/alpha/kernel/sys_eiger.c Thu Mar 16 14:07:09 2000 +++ linux/arch/alpha/kernel/sys_eiger.c Fri Mar 2 11:12:07 2001 @@ -177,7 +177,7 @@ static u8 __init eiger_swizzle(struct pci_dev *dev, u8 *pinp) { - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int slot, pin = *pinp; int bridge_count = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_jensen.c linux/arch/alpha/kernel/sys_jensen.c --- v2.4.2/linux/arch/alpha/kernel/sys_jensen.c Tue Mar 21 10:46:21 2000 +++ linux/arch/alpha/kernel/sys_jensen.c Fri Mar 2 11:12:07 2001 @@ -124,12 +124,12 @@ static void __init jensen_init_arch(void) { - struct pci_controler *hose; + struct pci_controller *hose; /* Create a hose so that we can report i/o base addresses to userland. */ - pci_isa_hose = hose = alloc_pci_controler(); + pci_isa_hose = hose = alloc_pci_controller(); hose->io_space = &ioport_resource; hose->mem_space = &iomem_resource; hose->index = 0; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_rawhide.c linux/arch/alpha/kernel/sys_rawhide.c --- v2.4.2/linux/arch/alpha/kernel/sys_rawhide.c Fri Oct 27 10:55:01 2000 +++ linux/arch/alpha/kernel/sys_rawhide.c Fri Mar 2 11:12:07 2001 @@ -139,7 +139,7 @@ static void __init rawhide_init_irq(void) { - struct pci_controler *hose; + struct pci_controller *hose; long i; mcpcia_init_hoses(); @@ -204,7 +204,7 @@ }; const long min_idsel = 1, max_idsel = 5, irqs_per_slot = 5; - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int irq = COMMON_TABLE_LOOKUP; if (irq >= 0) irq += 24 * hose->index; diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_titan.c linux/arch/alpha/kernel/sys_titan.c --- v2.4.2/linux/arch/alpha/kernel/sys_titan.c Mon Jun 19 17:59:32 2000 +++ linux/arch/alpha/kernel/sys_titan.c Fri Mar 2 11:12:07 2001 @@ -321,10 +321,10 @@ } #ifdef CONFIG_VGA_HOSE -static struct pci_controler * __init -privateer_vga_hose_select(struct pci_controler *h1, struct pci_controler *h2) +static struct pci_controller * __init +privateer_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) { - struct pci_controler *hose = h1; + struct pci_controller *hose = h1; int agp1, agp2; /* which hose(s) are agp? */ diff -u --recursive --new-file v2.4.2/linux/arch/alpha/kernel/sys_wildfire.c linux/arch/alpha/kernel/sys_wildfire.c --- v2.4.2/linux/arch/alpha/kernel/sys_wildfire.c Mon Oct 30 12:24:22 2000 +++ linux/arch/alpha/kernel/sys_wildfire.c Fri Mar 2 11:12:07 2001 @@ -315,7 +315,7 @@ }; const long min_idsel = 0, max_idsel = 7, irqs_per_slot = 5; - struct pci_controler *hose = dev->sysdata; + struct pci_controller *hose = dev->sysdata; int irq = COMMON_TABLE_LOOKUP; if (irq > 0) { diff -u --recursive --new-file v2.4.2/linux/arch/arm/mach-sa1100/arch.c linux/arch/arm/mach-sa1100/arch.c --- v2.4.2/linux/arch/arm/mach-sa1100/arch.c Mon Sep 18 15:15:25 2000 +++ linux/arch/arm/mach-sa1100/arch.c Fri Mar 2 11:12:06 2001 @@ -54,7 +54,7 @@ if (machine_is_assabet()) { /* * On Assabet, we must probe for the Neponset board *before* - * paging_init() has occured to actually determine the amount + * paging_init() has occurred to actually determine the amount * of RAM available. */ extern void map_sa1100_gpio_regs(void); diff -u --recursive --new-file v2.4.2/linux/arch/arm/mm/mm-sa1100.c linux/arch/arm/mm/mm-sa1100.c --- v2.4.2/linux/arch/arm/mm/mm-sa1100.c Mon Sep 18 15:15:25 2000 +++ linux/arch/arm/mm/mm-sa1100.c Fri Mar 2 11:12:06 2001 @@ -199,7 +199,7 @@ /* * On Assabet, we must probe for the Neponset board *before* paging_init() - * has occured to actually determine the amount of RAM available. To do so, + * has occurred to actually determine the amount of RAM available. To do so, * we map the appropriate IO section in the page table here in order to * access GPIO registers. */ diff -u --recursive --new-file v2.4.2/linux/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile --- v2.4.2/linux/arch/i386/boot/Makefile Mon Dec 20 14:43:39 1999 +++ linux/arch/i386/boot/Makefile Thu Feb 22 00:25:29 2001 @@ -43,7 +43,7 @@ $(HOSTCC) $(HOSTCFLAGS) -o $@ $< -I$(TOPDIR)/include bootsect: bootsect.o - $(LD) -Ttext 0x0 -s -oformat binary -o $@ $< + $(LD) -Ttext 0x0 -s --oformat binary -o $@ $< bootsect.o: bootsect.s $(AS) -o $@ $< @@ -52,7 +52,7 @@ $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ bbootsect: bbootsect.o - $(LD) -Ttext 0x0 -s -oformat binary $< -o $@ + $(LD) -Ttext 0x0 -s --oformat binary $< -o $@ bbootsect.o: bbootsect.s $(AS) -o $@ $< @@ -61,7 +61,7 @@ $(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ setup: setup.o - $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $< + $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $< setup.o: setup.s $(AS) -o $@ $< @@ -70,7 +70,7 @@ $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ bsetup: bsetup.o - $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $< + $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $< bsetup.o: bsetup.s $(AS) -o $@ $< diff -u --recursive --new-file v2.4.2/linux/arch/i386/defconfig linux/arch/i386/defconfig --- v2.4.2/linux/arch/i386/defconfig Wed Feb 21 18:20:11 2001 +++ linux/arch/i386/defconfig Fri Mar 2 11:49:00 2001 @@ -382,7 +382,6 @@ # CONFIG_NE3210 is not set # CONFIG_ES3210 is not set # CONFIG_8139TOO is not set -# CONFIG_RTL8129 is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set diff -u --recursive --new-file v2.4.2/linux/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c --- v2.4.2/linux/arch/i386/kernel/i386_ksyms.c Wed Feb 21 18:20:11 2001 +++ linux/arch/i386/kernel/i386_ksyms.c Fri Mar 2 12:03:49 2001 @@ -27,6 +27,7 @@ #include #include #include +#include extern void dump_thread(struct pt_regs *, struct user *); extern spinlock_t rtc_lock; @@ -134,6 +135,9 @@ EXPORT_SYMBOL(__global_save_flags); EXPORT_SYMBOL(__global_restore_flags); EXPORT_SYMBOL(smp_call_function); + +/* TLB flushing */ +EXPORT_SYMBOL(flush_tlb_page); #endif #ifdef CONFIG_MCA diff -u --recursive --new-file v2.4.2/linux/arch/i386/kernel/i387.c linux/arch/i386/kernel/i387.c --- v2.4.2/linux/arch/i386/kernel/i387.c Wed Feb 21 18:20:11 2001 +++ linux/arch/i386/kernel/i387.c Fri Feb 23 10:09:08 2001 @@ -179,7 +179,7 @@ unsigned short get_fpu_mxcsr( struct task_struct *tsk ) { - if ( cpu_has_fxsr ) { + if ( cpu_has_xmm ) { return tsk->thread.i387.fxsave.mxcsr; } else { return 0x1f80; diff -u --recursive --new-file v2.4.2/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c --- v2.4.2/linux/arch/i386/kernel/traps.c Wed Feb 21 18:20:11 2001 +++ linux/arch/i386/kernel/traps.c Thu Mar 1 16:54:35 2001 @@ -388,7 +388,7 @@ #if CONFIG_X86_IO_APIC -int nmi_watchdog = 1; +int nmi_watchdog = 0; static int __init setup_nmi_watchdog(char *str) { diff -u --recursive --new-file v2.4.2/linux/arch/i386/lib/mmx.c linux/arch/i386/lib/mmx.c --- v2.4.2/linux/arch/i386/lib/mmx.c Sat Feb 3 19:51:22 2001 +++ linux/arch/i386/lib/mmx.c Thu Mar 1 18:04:34 2001 @@ -3,6 +3,7 @@ #include #include +#include /* * MMX 3DNow! library helper functions @@ -25,8 +26,14 @@ void *_mmx_memcpy(void *to, const void *from, size_t len) { - void *p=to; - int i= len >> 6; /* len/64 */ + void *p; + int i; + + if (in_interrupt()) + return __memcpy(to, from, len); + + p = to; + i = len >> 6; /* len/64 */ kernel_fpu_begin(); diff -u --recursive --new-file v2.4.2/linux/arch/i386/mm/extable.c linux/arch/i386/mm/extable.c --- v2.4.2/linux/arch/i386/mm/extable.c Wed Feb 21 18:20:11 2001 +++ linux/arch/i386/mm/extable.c Fri Mar 2 11:12:07 2001 @@ -49,7 +49,7 @@ spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp != NULL; mp = mp->next) { - if (mp->ex_table_start == NULL) + if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr); diff -u --recursive --new-file v2.4.2/linux/arch/mips/kernel/mips_ksyms.c linux/arch/mips/kernel/mips_ksyms.c --- v2.4.2/linux/arch/mips/kernel/mips_ksyms.c Fri Aug 4 16:15:37 2000 +++ linux/arch/mips/kernel/mips_ksyms.c Fri Mar 2 11:15:47 2001 @@ -140,3 +140,4 @@ #endif EXPORT_SYMBOL(get_wchan); +EXPORT_SYMBOL(flush_tlb_page); diff -u --recursive --new-file v2.4.2/linux/arch/mips64/kernel/mips64_ksyms.c linux/arch/mips64/kernel/mips64_ksyms.c --- v2.4.2/linux/arch/mips64/kernel/mips64_ksyms.c Thu Jul 27 18:36:54 2000 +++ linux/arch/mips64/kernel/mips64_ksyms.c Fri Mar 2 11:15:47 2001 @@ -121,3 +121,4 @@ #endif EXPORT_SYMBOL(get_wchan); +EXPORT_SYMBOL(flush_tlb_page); diff -u --recursive --new-file v2.4.2/linux/arch/s390/kernel/entry.S linux/arch/s390/kernel/entry.S --- v2.4.2/linux/arch/s390/kernel/entry.S Wed Feb 21 18:20:14 2001 +++ linux/arch/s390/kernel/entry.S Fri Mar 2 11:12:06 2001 @@ -687,7 +687,7 @@ lr %r3,%r8 la %r0,0x7f nr %r3,%r0 # clear per-event-bit - be BASED(pgm_dn) # none of Martins exceptions occured bypass + be BASED(pgm_dn) # none of Martins exceptions occurred bypass l %r9,BASED(.Ljump_table) sll %r3,2 l %r9,0(%r3,%r9) # load address of handler routine diff -u --recursive --new-file v2.4.2/linux/arch/s390/tools/dasdfmt/dasdfmt.c linux/arch/s390/tools/dasdfmt/dasdfmt.c --- v2.4.2/linux/arch/s390/tools/dasdfmt/dasdfmt.c Wed Feb 21 18:20:14 2001 +++ linux/arch/s390/tools/dasdfmt/dasdfmt.c Fri Mar 2 11:12:06 2001 @@ -477,7 +477,7 @@ rc=stat(dev_name,&stat_buf); if (rc) { - ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \ + ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \ "%s\n",prog_name,strerror(errno)); } else { if (!S_ISBLK(stat_buf.st_mode)) diff -u --recursive --new-file v2.4.2/linux/arch/s390x/kernel/entry.S linux/arch/s390x/kernel/entry.S --- v2.4.2/linux/arch/s390x/kernel/entry.S Wed Feb 21 18:20:14 2001 +++ linux/arch/s390x/kernel/entry.S Fri Mar 2 11:12:06 2001 @@ -724,7 +724,7 @@ stosm 48(%r15),0x03 # reenable interrupts lghi %r3,0x7f nr %r3,%r8 # clear per-event-bit & move to r3 - je pgm_dn # none of Martins exceptions occured bypass + je pgm_dn # none of Martins exceptions occurred bypass sll %r3,3 larl %r9,pgm_check_table lg %r9,0(%r3,%r9) # load address of handler routine diff -u --recursive --new-file v2.4.2/linux/arch/s390x/tools/dasdfmt/dasdfmt.c linux/arch/s390x/tools/dasdfmt/dasdfmt.c --- v2.4.2/linux/arch/s390x/tools/dasdfmt/dasdfmt.c Wed Feb 21 18:20:15 2001 +++ linux/arch/s390x/tools/dasdfmt/dasdfmt.c Fri Mar 2 11:12:06 2001 @@ -477,7 +477,7 @@ rc=stat(dev_name,&stat_buf); if (rc) { - ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \ + ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \ "%s\n",prog_name,strerror(errno)); } else { if (!S_ISBLK(stat_buf.st_mode)) diff -u --recursive --new-file v2.4.2/linux/arch/sh/kernel/sh_ksyms.c linux/arch/sh/kernel/sh_ksyms.c --- v2.4.2/linux/arch/sh/kernel/sh_ksyms.c Sat Feb 3 19:51:24 2001 +++ linux/arch/sh/kernel/sh_ksyms.c Fri Mar 2 11:15:47 2001 @@ -77,3 +77,4 @@ /* needed by some modules */ EXPORT_SYMBOL(flush_dcache_page); #endif +EXPORT_SYMBOL(flush_tlb_page); diff -u --recursive --new-file v2.4.2/linux/drivers/char/i810_rng.c linux/drivers/char/i810_rng.c --- v2.4.2/linux/drivers/char/i810_rng.c Wed Feb 21 18:20:19 2001 +++ linux/drivers/char/i810_rng.c Fri Mar 2 11:12:07 2001 @@ -114,15 +114,13 @@ Minimum interval is 1 jiffy, maximum interval is 24 hours. * In order to unload the i810_rng module, you must first - disable the hardware via sysctl i810_hw_enabled, as shown above, + disable the hardware via sysctl i810_rng_timer, as shown above, and make sure all users of the character device have closed * The timer and the character device may be used simultaneously, if desired. - * FIXME: support poll() - - * FIXME: should we be crazy and support mmap()? + * FIXME: support poll(2) * FIXME: It is possible for the timer function to read, and shove into the kernel entropy pool, 2499 bytes of data @@ -135,6 +133,9 @@ * FIXME: module unload is racy. To fix this, struct ctl_table needs an owner member a la struct file_operations. + * FIXME: Timer interval should not be in jiffies, but in a more + user-understandable value like milliseconds. + * Since the RNG is accessed from a timer as well as normal kernel code, but not from interrupts, we use spin_lock_bh in regular code, and spin_lock in the timer function, to @@ -179,6 +180,15 @@ Version 0.9.2: * Simplify open blocking logic + Version 0.9.3: + * Clean up rng_read a bit. + * Update i810_rng driver Web site URL. + * Increase default timer interval to 4 samples per second. + * Abort if mem region is not available. + * BSS zero-initialization cleanup. + * Call misc_register() from rng_init_one. + * Fix O_NONBLOCK to occur before we schedule. + */ @@ -202,7 +212,7 @@ /* * core module and version information */ -#define RNG_VERSION "0.9.2" +#define RNG_VERSION "0.9.3" #define RNG_MODULE_NAME "i810_rng" #define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION #define PFX RNG_MODULE_NAME ": " @@ -249,6 +259,9 @@ #define RNG_DATA_PRESENT 0x01 #define RNG_DATA 2 +/* + * Magic address at which Intel PCI bridges locate the RNG + */ #define RNG_ADDR 0xFFBC015F #define RNG_ADDR_LEN 3 @@ -259,9 +272,9 @@ /* * Frequency that data is added to kernel entropy pool - * HZ>>1 == every half-second + * HZ>>1 == every quarter-second */ -#define RNG_DEF_TIMER_LEN (HZ >> 1) +#define RNG_DEF_TIMER_LEN (HZ >> 2) /* @@ -283,7 +296,6 @@ static unsigned int rng_entropy = 8; /* number of entropy bits we submit to /dev/random */ static unsigned int rng_entropy_sysctl; /* sysctl for changing entropy bits */ static unsigned int rng_interval_sysctl; /* sysctl for changing timer interval */ -static int rng_have_mem_region; /* did we grab RNG region via request_mem_region? */ static unsigned int rng_fips_counter; /* size of internal FIPS test data pool */ static unsigned int rng_timer_len = RNG_DEF_TIMER_LEN; /* timer interval, in jiffies */ static void *rng_mem; /* token to our ioremap'd RNG register area */ @@ -622,12 +634,10 @@ static int rng_dev_open (struct inode *inode, struct file *filp) { - int rc = -EINVAL; - if ((filp->f_mode & FMODE_READ) == 0) - return rc; + return -EINVAL; if (filp->f_mode & FMODE_WRITE) - return rc; + return -EINVAL; /* wait for device to become free */ if (filp->f_flags & O_NONBLOCK) { @@ -639,15 +649,11 @@ } if (rng_enable (1)) { - rc = -EIO; - goto err_out; + up (&rng_open_sem); + return -EIO; } return 0; - -err_out: - up (&rng_open_sem); - return rc; } @@ -686,20 +692,35 @@ ret++; } + if (filp->f_flags & O_NONBLOCK) + return ret ? : -EAGAIN; + if (current->need_resched) schedule (); if (signal_pending (current)) return ret ? : -ERESTARTSYS; - - if (filp->f_flags & O_NONBLOCK) - return ret ? : -EAGAIN; } return ret; } +static struct file_operations rng_chrdev_ops = { + owner: THIS_MODULE, + open: rng_dev_open, + release: rng_dev_release, + read: rng_dev_read, +}; + + +static struct miscdevice rng_miscdev = { + RNG_MISCDEV_MINOR, + RNG_MODULE_NAME, + &rng_chrdev_ops, +}; + + /* * rng_init_one - look for and attempt to init a single RNG */ @@ -713,16 +734,25 @@ if (pci_enable_device (dev)) return -EIO; - /* XXX currently fails, investigate who has our mem region */ - if (request_mem_region (RNG_ADDR, RNG_ADDR_LEN, RNG_MODULE_NAME)) - rng_have_mem_region = 1; + if (!request_mem_region (RNG_ADDR, RNG_ADDR_LEN, RNG_MODULE_NAME)) { + printk (KERN_ERR PFX "cannot reserve RNG region\n"); + DPRINTK ("EXIT, returning -EBUSY\n"); + return -EBUSY; + } + + rc = misc_register (&rng_miscdev); + if (rc) { + printk (KERN_ERR PFX "cannot register misc device\n"); + DPRINTK ("EXIT, returning %d\n", rc); + goto err_out_free_res; + } rng_mem = ioremap (RNG_ADDR, RNG_ADDR_LEN); if (rng_mem == NULL) { printk (KERN_ERR PFX "cannot ioremap RNG Memory\n"); DPRINTK ("EXIT, returning -EBUSY\n"); rc = -EBUSY; - goto err_out_free_res; + goto err_out_free_miscdev; } /* Check for Intel 82802 */ @@ -756,9 +786,10 @@ err_out_free_map: iounmap (rng_mem); +err_out_free_miscdev: + misc_deregister (&rng_miscdev); err_out_free_res: - if (rng_have_mem_region) - release_mem_region (RNG_ADDR, RNG_ADDR_LEN); + release_mem_region (RNG_ADDR, RNG_ADDR_LEN); return rc; } @@ -786,21 +817,6 @@ MODULE_PARM_DESC(rng_entropy, "Bits of entropy to add to random pool per RNG byte (range: 0-8, default 8)"); -static struct file_operations rng_chrdev_ops = { - owner: THIS_MODULE, - open: rng_dev_open, - release: rng_dev_release, - read: rng_dev_read, -}; - - -static struct miscdevice rng_miscdev = { - RNG_MISCDEV_MINOR, - RNG_MODULE_NAME, - &rng_chrdev_ops, -}; - - /* * rng_init - initialize RNG module */ @@ -826,15 +842,6 @@ if (rc) return rc; - rc = misc_register (&rng_miscdev); - if (rc) { - iounmap (rng_mem); - if (rng_have_mem_region) - release_mem_region (RNG_ADDR, RNG_ADDR_LEN); - DPRINTK ("EXIT, returning %d\n", rc); - return rc; - } - printk (KERN_INFO RNG_DRIVER_NAME " loaded\n"); rng_pdev = pdev; @@ -859,8 +866,9 @@ rng_sysctl (0); iounmap (rng_mem); - if (rng_have_mem_region) - release_mem_region (RNG_ADDR, RNG_ADDR_LEN); + release_mem_region (RNG_ADDR, RNG_ADDR_LEN); + + rng_pdev = NULL; DPRINTK ("EXIT\n"); } @@ -892,8 +900,8 @@ * random as random :) */ -static int poker[16] = { 0, }, runs[12] = { 0, }; -static int ones = 0, rlength = -1, current_bit = 0, rng_test = 0; +static int poker[16], runs[12]; +static int ones, rlength = -1, current_bit, rng_test; /* diff -u --recursive --new-file v2.4.2/linux/drivers/char/istallion.c linux/drivers/char/istallion.c --- v2.4.2/linux/drivers/char/istallion.c Wed Feb 21 18:20:19 2001 +++ linux/drivers/char/istallion.c Fri Mar 2 11:12:07 2001 @@ -213,12 +213,8 @@ * at 9600 baud, 8 data bits, no parity, 1 stop bit. */ static struct termios stli_deftermios = { - 0, - 0, - (B9600 | CS8 | CREAD | HUPCL | CLOCAL), - 0, - 0, - INIT_C_CC + c_cflag: (B9600 | CS8 | CREAD | HUPCL | CLOCAL), + c_cc: INIT_C_CC, }; /* diff -u --recursive --new-file v2.4.2/linux/drivers/char/mxser.c linux/drivers/char/mxser.c --- v2.4.2/linux/drivers/char/mxser.c Wed Dec 6 12:06:18 2000 +++ linux/drivers/char/mxser.c Fri Mar 2 11:12:07 2001 @@ -120,7 +120,7 @@ #define CI104J_ASIC_ID 5 enum { - MXSER_BOARD_C168_ISA = 0, + MXSER_BOARD_C168_ISA = 1, MXSER_BOARD_C104_ISA, MXSER_BOARD_CI104J, MXSER_BOARD_C168_PCI, @@ -617,16 +617,18 @@ pdev = pci_find_device(mxser_pcibrds[b].vendor_id, mxser_pcibrds[b].device_id, pdev); if (!pdev) - break; + { + b++; + continue; + } if (pci_enable_device(pdev)) continue; - b++; hwconf.pdev = pdev; printk("Found MOXA %s board(BusNo=%d,DevNo=%d)\n", mxser_brdname[mxser_pcibrds[b].board_type - 1], pdev->bus->number, PCI_SLOT(pdev->devfn >> 3)); if (m >= MXSER_BOARDS) { - printk("Too many Smartio family boards find (maximum %d),board not configured\n", MXSER_BOARDS); + printk("Too many Smartio family boards found (maximum %d),board not configured\n", MXSER_BOARDS); } else { retval = mxser_get_PCI_conf(pdev, mxser_pcibrds[b].board_type, &hwconf); @@ -1457,7 +1459,9 @@ if (info->xmit_cnt < WAKEUP_CHARS) { set_bit(MXSER_EVENT_TXLOW, &info->event); - schedule_task(&info->tqueue); + MOD_INC_USE_COUNT; + if (schedule_task(&info->tqueue) == 0) + MOD_DEC_USE_COUNT; } if (info->xmit_cnt <= 0) { info->IER &= ~UART_IER_THRI; @@ -1486,8 +1490,9 @@ else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) && (info->flags & ASYNC_CALLOUT_NOHUP))) set_bit(MXSER_EVENT_HANGUP, &info->event); - schedule_task(&info->tqueue); - + MOD_INC_USE_COUNT; + if (schedule_task(&info->tqueue) == 0) + MOD_DEC_USE_COUNT; } if (info->flags & ASYNC_CTS_FLOW) { if (info->tty->hw_stopped) { @@ -1671,7 +1676,7 @@ */ if (inb(info->base + UART_LSR) == 0xff) { restore_flags(flags); - if (suser()) { + if (capable(CAP_SYS_ADMIN)) { if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); return (0); @@ -2188,8 +2193,7 @@ status = inb(info->base + UART_LSR); restore_flags(flags); result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); - put_user(result, value); - return (0); + return put_user(result, value); } /* @@ -2229,8 +2233,7 @@ ((status & UART_MSR_RI) ? TIOCM_RNG : 0) | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0) | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0); - put_user(result, value); - return (0); + return put_user(result, value); } static int mxser_set_modem_info(struct mxser_struct *info, unsigned int cmd, diff -u --recursive --new-file v2.4.2/linux/drivers/char/stallion.c linux/drivers/char/stallion.c --- v2.4.2/linux/drivers/char/stallion.c Wed Feb 21 18:20:20 2001 +++ linux/drivers/char/stallion.c Fri Mar 2 11:12:07 2001 @@ -165,12 +165,8 @@ * at 9600, 8 data bits, 1 stop bit. */ static struct termios stl_deftermios = { - 0, - 0, - (B9600 | CS8 | CREAD | HUPCL | CLOCAL), - 0, - 0, - INIT_C_CC + c_cflag: (B9600 | CS8 | CREAD | HUPCL | CLOCAL), + c_cc: INIT_C_CC, }; /* diff -u --recursive --new-file v2.4.2/linux/drivers/ieee1394/csr.c linux/drivers/ieee1394/csr.c --- v2.4.2/linux/drivers/ieee1394/csr.c Tue Jan 2 16:45:38 2001 +++ linux/drivers/ieee1394/csr.c Thu Mar 1 16:57:11 2001 @@ -403,31 +403,30 @@ } -struct hpsb_highlevel_ops csr_ops = { +static struct hpsb_highlevel_ops csr_ops = { add_host: add_host, host_reset: host_reset, }; -struct hpsb_address_ops map_ops = { +static struct hpsb_address_ops map_ops = { read: read_maps, }; -struct hpsb_address_ops fcp_ops = { +static struct hpsb_address_ops fcp_ops = { write: write_fcp, }; -struct hpsb_address_ops reg_ops = { +static struct hpsb_address_ops reg_ops = { read: read_regs, write: write_regs, lock: lock_regs, }; +static struct hpsb_highlevel *hl; void init_csr(void) { - struct hpsb_highlevel *hl; - hl = hpsb_register_highlevel("standard registers", &csr_ops); if (hl == NULL) { HPSB_ERR("out of memory during ieee1394 initialization"); @@ -448,4 +447,9 @@ hpsb_register_addrspace(hl, &map_ops, CSR_REGISTER_BASE + CSR_SPEED_MAP, CSR_REGISTER_BASE + CSR_SPEED_MAP_END); +} + +void cleanup_csr(void) +{ + hpsb_unregister_highlevel(hl); } diff -u --recursive --new-file v2.4.2/linux/drivers/ieee1394/csr.h linux/drivers/ieee1394/csr.h --- v2.4.2/linux/drivers/ieee1394/csr.h Wed Mar 22 00:02:48 2000 +++ linux/drivers/ieee1394/csr.h Thu Mar 1 16:57:11 2001 @@ -50,5 +50,6 @@ void init_csr(void); +void cleanup_csr(void); #endif /* _IEEE1394_CSR_H */ diff -u --recursive --new-file v2.4.2/linux/drivers/ieee1394/guid.c linux/drivers/ieee1394/guid.c --- v2.4.2/linux/drivers/ieee1394/guid.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/ieee1394/guid.c Thu Mar 1 16:57:11 2001 @@ -219,11 +219,19 @@ host_reset: host_reset, }; +static struct hpsb_highlevel *hl; + void init_ieee1394_guid(void) { atomic_set(&outstanding_requests, 0); - if (!hpsb_register_highlevel("GUID manager", &guid_ops)) { + hl = hpsb_register_highlevel("GUID manager", &guid_ops); + if (!hl) { HPSB_ERR("out of memory during ieee1394 initialization"); } +} + +void cleanup_ieee1394_guid(void) +{ + hpsb_unregister_highlevel(hl); } diff -u --recursive --new-file v2.4.2/linux/drivers/ieee1394/guid.h linux/drivers/ieee1394/guid.h --- v2.4.2/linux/drivers/ieee1394/guid.h Mon Jun 19 17:59:40 2000 +++ linux/drivers/ieee1394/guid.h Thu Mar 1 16:57:11 2001 @@ -49,6 +49,6 @@ void init_ieee1394_guid(void); - +void cleanup_ieee1394_guid(void); #endif /* _IEEE1394_GUID_H */ diff -u --recursive --new-file v2.4.2/linux/drivers/ieee1394/ieee1394_core.c linux/drivers/ieee1394/ieee1394_core.c --- v2.4.2/linux/drivers/ieee1394/ieee1394_core.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/ieee1394/ieee1394_core.c Thu Mar 1 16:57:11 2001 @@ -269,7 +269,7 @@ } /* set self mapping */ - for (i = nodecount - 1; i; i--) { + for (i = 0; i < nodecount; i++) { map[64*i + i] = speedcap[i]; } @@ -802,6 +802,12 @@ init_ieee1394_guid(); return 0; +} + +void cleanup_module(void) +{ + cleanup_ieee1394_guid(); + cleanup_csr(); } #endif diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/Config.in linux/drivers/isdn/Config.in --- v2.4.2/linux/drivers/isdn/Config.in Tue Jan 2 16:45:37 2001 +++ linux/drivers/isdn/Config.in Fri Mar 2 11:12:10 2001 @@ -9,7 +9,7 @@ if [ "$CONFIG_ISDN_PPP" != "n" ]; then bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP - dep_tristate ' Support BSD compression (module only)' CONFIG_ISDN_PPP_BSDCOMP m + dep_tristate ' Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN fi fi bool ' Support audio via ISDN' CONFIG_ISDN_AUDIO @@ -23,7 +23,7 @@ mainmenu_option next_comment comment 'ISDN feature submodules' dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN - dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN m + dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN endmenu comment 'low-level hardware drivers' @@ -77,6 +77,9 @@ fi fi fi + +dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA + endmenu ### Active ISDN cards @@ -92,7 +95,7 @@ bool 'Eicon active card support' CONFIG_ISDN_DRV_EICON if [ "$CONFIG_ISDN_DRV_EICON" != "n" ]; then if [ "$CONFIG_ISDN_DRV_EICON_OLD" != "y" ]; then - dep_tristate ' Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS $CONFIG_ISDN + dep_tristate ' Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS $CONFIG_ISDN $CONFIG_PCI fi if [ "$CONFIG_ISDN_DRV_EICON_DIVAS" != "y" ]; then dep_tristate ' Legacy Eicon driver' CONFIG_ISDN_DRV_EICON_OLD $CONFIG_ISDN diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/Makefile linux/drivers/isdn/Makefile --- v2.4.2/linux/drivers/isdn/Makefile Fri Dec 29 14:40:54 2000 +++ linux/drivers/isdn/Makefile Fri Mar 2 11:12:10 2001 @@ -11,8 +11,7 @@ # Multipart objects. list-multi := isdn.o -isdn-objs := isdn_net.o isdn_tty.o isdn_cards.o isdn_v110.o \ - isdn_common.o +isdn-objs := isdn_net.o isdn_tty.o isdn_v110.o isdn_common.o # Optional parts of multipart objects. diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/act2000/act2000.h linux/drivers/isdn/act2000/act2000.h --- v2.4.2/linux/drivers/isdn/act2000/act2000.h Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/act2000/act2000.h Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: act2000.h,v 1.8 2000/11/12 16:32:06 kai Exp $ +/* $Id: act2000.h,v 1.8.6.2 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/act2000/capi.c linux/drivers/isdn/act2000/capi.c --- v2.4.2/linux/drivers/isdn/act2000/capi.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/act2000/capi.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: capi.c,v 1.9 2000/11/12 16:32:06 kai Exp $ +/* $Id: capi.c,v 1.9.6.1 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * CAPI encoder/decoder @@ -124,7 +124,7 @@ m->hdr.cmd.cmd = c; \ m->hdr.cmd.subcmd = s; \ m->hdr.msgnum = actcapi_nextsmsg(card); \ - } \ + } else m = NULL;\ } #define ACTCAPI_CHKSKB if (!skb) { \ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/act2000/capi.h linux/drivers/isdn/act2000/capi.h --- v2.4.2/linux/drivers/isdn/act2000/capi.h Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/act2000/capi.h Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: capi.h,v 1.6 2000/11/12 16:32:06 kai Exp $ +/* $Id: capi.h,v 1.6.6.1 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -44,7 +44,7 @@ char *description; } actcapi_msgdsc; -/* CAPI Adress */ +/* CAPI Address */ typedef struct actcapi_addr { __u8 len; /* Length of element */ __u8 tnp; /* Type/Numbering Plan */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/act2000/module.c linux/drivers/isdn/act2000/module.c --- v2.4.2/linux/drivers/isdn/act2000/module.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/act2000/module.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: module.c,v 1.14 2000/11/12 16:32:06 kai Exp $ +/* $Id: module.c,v 1.14.6.2 2000/12/18 22:14:10 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -24,6 +24,7 @@ #include "act2000.h" #include "act2000_isa.h" #include "capi.h" +#include static unsigned short act2000_isa_ports[] = { @@ -820,12 +821,7 @@ #define DRIVERNAME "IBM Active 2000 ISDN driver" -#ifdef MODULE -#define act2000_init init_module -#endif - -int -act2000_init(void) +static int __init act2000_init(void) { printk(KERN_INFO "%s\n", DRIVERNAME); if (!cards) @@ -837,9 +833,7 @@ return 0; } -#ifdef MODULE -void -cleanup_module(void) +static void __exit act2000_exit(void) { act2000_card *card = cards; act2000_card *last; @@ -858,34 +852,5 @@ printk(KERN_INFO "%s unloaded\n", DRIVERNAME); } -#else -void -act2000_setup(char *str, int *ints) -{ - int i, j, argc, port, irq, bus; - - argc = ints[0]; - i = 1; - if (argc) - while (argc) { - port = irq = -1; - bus = 0; - if (argc) { - bus = ints[i]; - i++; - argc--; - } - if (argc) { - port = ints[i]; - i++; - argc--; - } - if (argc) { - irq = ints[i]; - i++; - argc--; - } - act2000_addcard(bus, port, irq, act_id); - } -} -#endif +module_init(act2000_init); +module_exit(act2000_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/avm_cs.c linux/drivers/isdn/avmb1/avm_cs.c --- v2.4.2/linux/drivers/isdn/avmb1/avm_cs.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/avmb1/avm_cs.c Fri Mar 2 11:12:07 2001 @@ -138,6 +138,8 @@ /* Initialize the dev_link_t structure */ link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); + if (!link) + return NULL; memset(link, 0, sizeof(struct dev_link_t)); link->release.function = &avmcs_release; link->release.data = (u_long)link; @@ -169,6 +171,8 @@ /* Allocate space for private device-specific data */ local = kmalloc(sizeof(local_info_t), GFP_KERNEL); + if (!local) + return NULL; memset(local, 0, sizeof(local_info_t)); link->priv = local; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/b1.c linux/drivers/isdn/avmb1/b1.c --- v2.4.2/linux/drivers/isdn/avmb1/b1.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/b1.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,14 @@ /* - * $Id: b1.c,v 1.20 2000/11/23 20:45:14 kai Exp $ + * $Id: b1.c,v 1.20.6.1 2001/02/13 11:43:29 kai Exp $ * * Common module for AVM B1 cards. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1.c,v $ + * Revision 1.20.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.20 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -117,7 +120,7 @@ #include "capicmd.h" #include "capiutil.h" -static char *revision = "$Revision: 1.20 $"; +static char *revision = "$Revision: 1.20.6.1 $"; /* ------------------------------------------------------------- */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/b1dma.c linux/drivers/isdn/avmb1/b1dma.c --- v2.4.2/linux/drivers/isdn/avmb1/b1dma.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/b1dma.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,14 @@ /* - * $Id: b1dma.c,v 1.11 2000/11/19 17:02:47 kai Exp $ + * $Id: b1dma.c,v 1.11.6.1 2001/02/13 11:43:29 kai Exp $ * * Common module for AVM B1 cards that support dma with AMCC * * (c) Copyright 2000 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1dma.c,v $ + * Revision 1.11.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.11 2000/11/19 17:02:47 kai * compatibility cleanup - part 3 * @@ -62,7 +65,7 @@ #include "capicmd.h" #include "capiutil.h" -static char *revision = "$Revision: 1.11 $"; +static char *revision = "$Revision: 1.11.6.1 $"; /* ------------------------------------------------------------- */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/b1isa.c linux/drivers/isdn/avmb1/b1isa.c --- v2.4.2/linux/drivers/isdn/avmb1/b1isa.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/b1isa.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: b1isa.c,v 1.10 2000/11/23 20:45:14 kai Exp $ + * $Id: b1isa.c,v 1.10.6.2 2001/02/16 16:43:23 kai Exp $ * * Module for AVM B1 ISA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1isa.c,v $ + * Revision 1.10.6.2 2001/02/16 16:43:23 kai + * Changes from -ac16, little bug fixes, typos and the like + * + * Revision 1.10.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.10 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -24,7 +30,7 @@ * - fixed problem with memory mapping if address is not aligned * * Revision 1.6 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and + * new message after successful detection including card revision and * used resources. * * Revision 1.5 1999/11/05 16:38:01 calle @@ -83,7 +89,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.10 $"; +static char *revision = "$Revision: 1.10.6.2 $"; /* ------------------------------------------------------------- */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/b1pcmcia.c linux/drivers/isdn/avmb1/b1pcmcia.c --- v2.4.2/linux/drivers/isdn/avmb1/b1pcmcia.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/b1pcmcia.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: b1pcmcia.c,v 1.12 2000/11/23 20:45:14 kai Exp $ + * $Id: b1pcmcia.c,v 1.12.6.2 2001/02/16 16:43:23 kai Exp $ * * Module for AVM B1/M1/M2 PCMCIA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1pcmcia.c,v $ + * Revision 1.12.6.2 2001/02/16 16:43:23 kai + * Changes from -ac16, little bug fixes, typos and the like + * + * Revision 1.12.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.12 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -33,7 +39,7 @@ * - fixed problem with memory mapping if address is not aligned * * Revision 1.6 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and + * new message after successful detection including card revision and * used resources. * * Revision 1.5 1999/11/05 16:38:01 calle @@ -93,7 +99,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.12 $"; +static char *revision = "$Revision: 1.12.6.2 $"; /* ------------------------------------------------------------- */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/c4.c linux/drivers/isdn/avmb1/c4.c --- v2.4.2/linux/drivers/isdn/avmb1/c4.c Tue Nov 28 21:44:41 2000 +++ linux/drivers/isdn/avmb1/c4.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: c4.c,v 1.20.6.1 2000/11/28 12:02:45 kai Exp $ + * $Id: c4.c,v 1.20.6.3 2001/02/16 16:43:23 kai Exp $ * * Module for AVM C4 card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: c4.c,v $ + * Revision 1.20.6.3 2001/02/16 16:43:23 kai + * Changes from -ac16, little bug fixes, typos and the like + * + * Revision 1.20.6.2 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.20.6.1 2000/11/28 12:02:45 kai * MODULE_DEVICE_TABLE for 2.4 * @@ -75,7 +81,7 @@ * - fixed problem with memory mapping if address is not aligned * * Revision 1.3 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and + * new message after successful detection including card revision and * used resources. * * Revision 1.2 2000/01/21 20:52:58 keil @@ -106,7 +112,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.20.6.1 $"; +static char *revision = "$Revision: 1.20.6.3 $"; #undef CONFIG_C4_DEBUG #undef CONFIG_C4_POLLDEBUG @@ -1330,7 +1336,6 @@ add_card: 0, /* no add_card function */ }; - static int ncards = 0; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/capi.c linux/drivers/isdn/avmb1/capi.c --- v2.4.2/linux/drivers/isdn/avmb1/capi.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/avmb1/capi.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: capi.c,v 1.44.6.3 2000/12/17 22:45:08 kai Exp $ + * $Id: capi.c,v 1.44.6.5 2001/02/13 11:43:29 kai Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capi.c,v $ + * Revision 1.44.6.5 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * + * Revision 1.44.6.4 2001/02/10 14:41:20 kai + * Changes from kernel tree + * * Revision 1.44.6.3 2000/12/17 22:45:08 kai * That's hopefully it for test13-4 * @@ -253,7 +259,7 @@ #include "capifs.h" #endif -static char *revision = "$Revision: 1.44.6.3 $"; +static char *revision = "$Revision: 1.44.6.5 $"; MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)"); @@ -1317,7 +1323,6 @@ #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "capi_raw_open %d\n", GET_USE_COUNT(THIS_MODULE)); #endif - mp->datahandle = 0; mp->file = file; file->private_data = (void *)mp; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/capidrv.c linux/drivers/isdn/avmb1/capidrv.c --- v2.4.2/linux/drivers/isdn/avmb1/capidrv.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/avmb1/capidrv.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: capidrv.c,v 1.39 2000/11/23 20:45:14 kai Exp $ + * $Id: capidrv.c,v 1.39.6.2 2001/02/13 11:43:29 kai Exp $ * * ISDN4Linux Driver, using capi20 interface (kernelcapi) * * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capidrv.c,v $ + * Revision 1.39.6.2 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * + * Revision 1.39.6.1 2001/02/10 14:41:20 kai + * Changes from kernel tree + * * Revision 1.39 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -219,7 +225,7 @@ #include "capicmd.h" #include "capidrv.h" -static char *revision = "$Revision: 1.39 $"; +static char *revision = "$Revision: 1.39.6.2 $"; static int debugmode = 0; MODULE_AUTHOR("Carsten Paeth "); @@ -488,7 +494,7 @@ } -/* -------- controller managment ------------------------------------- */ +/* -------- controller management ------------------------------------- */ static inline capidrv_contr *findcontrbydriverid(int driverid) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/capifs.c linux/drivers/isdn/avmb1/capifs.c --- v2.4.2/linux/drivers/isdn/avmb1/capifs.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/avmb1/capifs.c Fri Mar 2 11:12:07 2001 @@ -1,11 +1,17 @@ /* - * $Id: capifs.c,v 1.14.6.1 2000/11/28 12:02:45 kai Exp $ + * $Id: capifs.c,v 1.14.6.3 2001/02/13 11:43:29 kai Exp $ * * (c) Copyright 2000 by Carsten Paeth (calle@calle.de) * * Heavily based on devpts filesystem from H. Peter Anvin * * $Log: capifs.c,v $ + * Revision 1.14.6.3 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * + * Revision 1.14.6.2 2001/02/10 14:41:20 kai + * Changes from kernel tree + * * Revision 1.14.6.1 2000/11/28 12:02:45 kai * MODULE_DEVICE_TABLE for 2.4 * @@ -93,7 +99,7 @@ MODULE_AUTHOR("Carsten Paeth "); -static char *revision = "$Revision: 1.14.6.1 $"; +static char *revision = "$Revision: 1.14.6.3 $"; struct capifs_ncci { struct inode *inode; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/capiutil.c linux/drivers/isdn/avmb1/capiutil.c --- v2.4.2/linux/drivers/isdn/avmb1/capiutil.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/capiutil.c Fri Mar 2 11:12:07 2001 @@ -1,5 +1,5 @@ /* - * $Id: capiutil.c,v 1.13 2000/11/23 20:45:14 kai Exp $ + * $Id: capiutil.c,v 1.13.6.1 2001/02/13 11:43:29 kai Exp $ * * CAPI 2.0 convert capi message to capi message struct * @@ -7,6 +7,9 @@ * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capiutil.c,v $ + * Revision 1.13.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.13 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/kcapi.c linux/drivers/isdn/avmb1/kcapi.c --- v2.4.2/linux/drivers/isdn/avmb1/kcapi.c Fri Dec 29 14:07:22 2000 +++ linux/drivers/isdn/avmb1/kcapi.c Fri Mar 2 11:12:08 2001 @@ -1,11 +1,14 @@ /* - * $Id: kcapi.c,v 1.21.6.1 2000/12/10 23:39:19 kai Exp $ + * $Id: kcapi.c,v 1.21.6.2 2001/02/13 11:43:29 kai Exp $ * * Kernel CAPI 2.0 Module * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kcapi.c,v $ + * Revision 1.21.6.2 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.21.6.1 2000/12/10 23:39:19 kai * in 2.4 we don't have tq_scheduler anymore. * also add one supported card to hfc_pci.c @@ -136,7 +139,7 @@ #include #endif -static char *revision = "$Revision: 1.21.6.1 $"; +static char *revision = "$Revision: 1.21.6.2 $"; /* ------------------------------------------------------------- */ @@ -814,7 +817,7 @@ } } /* - * ncci managment + * ncci management */ static void controllercb_new_ncci(struct capi_ctr * card, diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/t1isa.c linux/drivers/isdn/avmb1/t1isa.c --- v2.4.2/linux/drivers/isdn/avmb1/t1isa.c Tue Nov 28 21:43:13 2000 +++ linux/drivers/isdn/avmb1/t1isa.c Fri Mar 2 11:12:08 2001 @@ -1,11 +1,17 @@ /* - * $Id: t1isa.c,v 1.16 2000/11/23 20:45:14 kai Exp $ + * $Id: t1isa.c,v 1.16.6.2 2001/02/16 16:43:24 kai Exp $ * * Module for AVM T1 HEMA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: t1isa.c,v $ + * Revision 1.16.6.2 2001/02/16 16:43:24 kai + * Changes from -ac16, little bug fixes, typos and the like + * + * Revision 1.16.6.1 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.16 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -33,7 +39,7 @@ * - fixed problem with memory mapping if address is not aligned * * Revision 1.9 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and + * new message after successful detection including card revision and * used resources. * * Revision 1.8 1999/11/05 16:38:01 calle @@ -104,7 +110,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.16 $"; +static char *revision = "$Revision: 1.16.6.2 $"; /* ------------------------------------------------------------- */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/t1pci.c linux/drivers/isdn/avmb1/t1pci.c --- v2.4.2/linux/drivers/isdn/avmb1/t1pci.c Tue Nov 28 21:44:41 2000 +++ linux/drivers/isdn/avmb1/t1pci.c Fri Mar 2 11:12:08 2001 @@ -1,11 +1,14 @@ /* - * $Id: t1pci.c,v 1.13.6.1 2000/11/28 12:02:45 kai Exp $ + * $Id: t1pci.c,v 1.13.6.2 2001/02/13 11:43:29 kai Exp $ * * Module for AVM T1 PCI-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: t1pci.c,v $ + * Revision 1.13.6.2 2001/02/13 11:43:29 kai + * more compatility changes for 2.2.19 + * * Revision 1.13.6.1 2000/11/28 12:02:45 kai * MODULE_DEVICE_TABLE for 2.4 * @@ -88,7 +91,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.13.6.1 $"; +static char *revision = "$Revision: 1.13.6.2 $"; #undef CONFIG_T1PCI_DEBUG #undef CONFIG_T1PCI_POLLDEBUG diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/divert/divert_init.c linux/drivers/isdn/divert/divert_init.c --- v2.4.2/linux/drivers/isdn/divert/divert_init.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/divert/divert_init.c Fri Mar 2 11:12:08 2001 @@ -1,5 +1,5 @@ /* - * $Id: divert_init.c,v 1.5 2000/11/13 22:51:47 kai Exp $ + * $Id: divert_init.c,v 1.5.6.2 2001/01/24 22:18:17 kai Exp $ * * Module init for DSS1 diversion services for i4l. * @@ -23,6 +23,7 @@ #include #include +#include #include "isdn_divert.h" /********************/ @@ -46,7 +47,7 @@ /* Module interface code */ /* no cmd line parms */ /*************************/ -int init_module(void) +static int __init divert_init(void) { int i; if (divert_dev_init()) @@ -63,12 +64,12 @@ #endif printk(KERN_INFO "dss1_divert module successfully installed\n"); return(0); -} /* init_module */ +} /**********************/ /* Module deinit code */ /**********************/ -void cleanup_module(void) +static void __exit divert_exit(void) { int flags; int i; @@ -89,6 +90,8 @@ deleterule(-1); /* delete all rules and free mem */ deleteprocs(); printk(KERN_INFO "dss1_divert module successfully removed \n"); -} /* cleanup_module */ +} +module_init(divert_init); +module_exit(divert_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/divert/isdn_divert.c linux/drivers/isdn/divert/isdn_divert.c --- v2.4.2/linux/drivers/isdn/divert/isdn_divert.c Wed Feb 21 18:20:22 2001 +++ linux/drivers/isdn/divert/isdn_divert.c Fri Mar 2 11:12:08 2001 @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.c,v 1.6.6.1 2001/02/07 11:31:31 kai Exp $ + * $Id: isdn_divert.c,v 1.6.6.2 2001/02/16 16:43:25 kai Exp $ * * DSS1 main diversion supplementary handling for i4l. * @@ -290,7 +290,7 @@ /* insert a new rule before idx */ /********************************/ int insertrule(int idx, divert_rule *newrule) -{ struct deflect_struc *ds,*ds1; +{ struct deflect_struc *ds,*ds1=NULL; int flags; if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/Divas_mod.c linux/drivers/isdn/eicon/Divas_mod.c --- v2.4.2/linux/drivers/isdn/eicon/Divas_mod.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/eicon/Divas_mod.c Fri Mar 2 11:12:08 2001 @@ -1,13 +1,6 @@ /* * - * Copyright (C) Eicon Technology Corporation, 2000. - * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * - * Eicon File Revision : 1.15 - * * 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, or (at your option) @@ -26,6 +19,7 @@ #include +#include #include #undef N_DATA @@ -40,27 +34,23 @@ #include "adapter.h" #include "uxio.h" + #ifdef MODULE #include "idi.h" void DIVA_DIDD_Write(DESCRIPTOR *, int); EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read); EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Write); EXPORT_SYMBOL_NOVERS(DivasPrintf); -#define Divas_init init_module -#else -#define Divas_init eicon_init #endif -extern char *file_check(void); - int DivasCardsDiscover(void); -int -Divas_init(void) +static int __init +divas_init(void) { printk(KERN_DEBUG "DIVA Server Driver - initialising\n"); - printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.15 (%s)\n",file_check()); + printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.16\n"); #if !defined(CONFIG_PCI) @@ -85,9 +75,8 @@ return 0; } -#ifdef MODULE -void -cleanup_module(void) +static void __exit +divas_exit(void) { card_t *pCard; word wCardIndex; @@ -156,15 +145,6 @@ unregister_chrdev(Divas_major, "Divas"); } -void mod_inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -void mod_dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - -#endif +module_init(divas_init); +module_exit(divas_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/Makefile linux/drivers/isdn/eicon/Makefile --- v2.4.2/linux/drivers/isdn/eicon/Makefile Fri Dec 29 14:40:54 2000 +++ linux/drivers/isdn/eicon/Makefile Fri Mar 2 11:12:08 2001 @@ -12,10 +12,9 @@ list-multi := eicon.o divas.o eicon-objs := eicon_mod.o eicon_isa.o eicon_pci.o eicon_idi.o \ - eicon_io.o fcheck.o + eicon_io.o divas-objs := common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o \ - fourbri.o lincfg.o linchr.o linsys.o linio.o fcheck.o \ - Divas_mod.o + fourbri.o lincfg.o linchr.o linsys.o linio.o Divas_mod.o # Optional parts of multipart objects. diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/adapter.h linux/drivers/isdn/eicon/adapter.h --- v2.4.2/linux/drivers/isdn/eicon/adapter.h Mon Dec 11 13:21:41 2000 +++ linux/drivers/isdn/eicon/adapter.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.7 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/bri.c linux/drivers/isdn/eicon/bri.c --- v2.4.2/linux/drivers/isdn/eicon/bri.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/bri.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.8 * * This program is free software; you can redistribute it and/or modify @@ -63,6 +60,7 @@ void io_inc(ADAPTER *a, void *adr); static int diva_server_bri_test_int(card_t *card); +static int bri_ISR (card_t* card); #define PLX_IOBASE 0 #define DIVAS_IOBASE 1 @@ -80,7 +78,6 @@ void UxCardPortIoOutW(ux_diva_card_t *card, byte *base, int offset, word); int DivasBRIInitPCI(card_t *card, dia_card_t *cfg); -int bri_ISR (card_t* card); static int diva_server_bri_reset(card_t *card) @@ -361,7 +358,7 @@ UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->nt2); UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 10); - UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, 0); + UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->sig_flags); UxCardPortIoOutW(card->hw, DivasIOBase, REG_ADDRLO, 11); UxCardPortIoOut(card->hw, DivasIOBase, REG_DATA, config->watchdog); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/common.c linux/drivers/isdn/eicon/common.c --- v2.4.2/linux/drivers/isdn/eicon/common.c Wed Sep 27 13:45:40 2000 +++ linux/drivers/isdn/eicon/common.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.15 * * This program is free software; you can redistribute it and/or modify @@ -101,7 +98,6 @@ return; } -static void DIVA_DIDD_Write(DESCRIPTOR *table, int tablelength) { if (tablelength > sizeof(DIDD_Table)) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/constant.h linux/drivers/isdn/eicon/constant.h --- v2.4.2/linux/drivers/isdn/eicon/constant.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/constant.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/divalog.h linux/drivers/isdn/eicon/divalog.h --- v2.4.2/linux/drivers/isdn/eicon/divalog.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/divalog.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/divas.h linux/drivers/isdn/eicon/divas.h --- v2.4.2/linux/drivers/isdn/eicon/divas.h Mon Dec 11 13:21:41 2000 +++ linux/drivers/isdn/eicon/divas.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.5 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/dsp_defs.h linux/drivers/isdn/eicon/dsp_defs.h --- v2.4.2/linux/drivers/isdn/eicon/dsp_defs.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/dsp_defs.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/dspdids.h linux/drivers/isdn/eicon/dspdids.h --- v2.4.2/linux/drivers/isdn/eicon/dspdids.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/dspdids.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/eicon.h linux/drivers/isdn/eicon/eicon.h --- v2.4.2/linux/drivers/isdn/eicon/eicon.h Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/eicon/eicon.h Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon.h,v 1.23 2000/06/21 11:28:42 armin Exp $ +/* $Id: eicon.h,v 1.23.6.2 2001/02/13 11:43:30 kai Exp $ * * ISDN low-level module for Eicon active ISDN-Cards. * @@ -150,7 +150,6 @@ #include #include - typedef struct { __u16 length __attribute__ ((packed)); /* length of data/parameter field */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/eicon_idi.c linux/drivers/isdn/eicon/eicon_idi.c --- v2.4.2/linux/drivers/isdn/eicon/eicon_idi.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/eicon_idi.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon_idi.c,v 1.41 2000/08/12 18:00:47 armin Exp $ +/* $Id: eicon_idi.c,v 1.41.6.1 2001/02/10 14:44:09 kai Exp $ * * ISDN lowlevel-module for Eicon active cards. * IDI interface @@ -36,7 +36,7 @@ #undef EICON_FULL_SERVICE_OKTETT -char *eicon_idi_revision = "$Revision: 1.41 $"; +char *eicon_idi_revision = "$Revision: 1.41.6.1 $"; eicon_manifbuf *manbuf; @@ -2506,7 +2506,7 @@ case ISDN_PROTO_L2_TRANS: idi_do_req(ccard, chan, N_CONNECT, 1); break; - default: + default:; /* On most incoming calls we use automatic connect */ /* idi_do_req(ccard, chan, N_CONNECT, 1); */ } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/eicon_io.c linux/drivers/isdn/eicon/eicon_io.c --- v2.4.2/linux/drivers/isdn/eicon/eicon_io.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/eicon_io.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon_io.c,v 1.13 2000/05/07 08:51:04 armin Exp $ +/* $Id: eicon_io.c,v 1.13.6.1 2001/02/16 09:09:50 armin Exp $ * * ISDN low-level module for Eicon active ISDN-Cards. * Code for communicating with hardware. @@ -6,7 +6,7 @@ * Copyright 1999,2000 by Armin Schindler (mac@melware.de) * Copyright 1999,2000 Cytronics & Melware (info@melware.de) * - * Thanks to Eicon Technology GmbH & Co. oHG for + * Thanks to Eicon Networks for * documents, informations and hardware. * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/eicon_mod.c linux/drivers/isdn/eicon/eicon_mod.c --- v2.4.2/linux/drivers/isdn/eicon/eicon_mod.c Wed Sep 27 13:45:40 2000 +++ linux/drivers/isdn/eicon/eicon_mod.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon_mod.c,v 1.37 2000/09/02 11:16:47 armin Exp $ +/* $Id: eicon_mod.c,v 1.37.6.4 2001/02/16 09:09:50 armin Exp $ * * ISDN lowlevel-module for Eicon active cards. * @@ -6,7 +6,7 @@ * Copyright 1998-2000 by Armin Schindler (mac@melware.de) * Copyright 1999,2000 Cytronics & Melware (info@melware.de) * - * Thanks to Eicon Technology GmbH & Co. oHG for + * Thanks to Eicon Networks for * documents, informations and hardware. * * Deutsche Mailbox Saar-Lor-Lux GmbH @@ -32,7 +32,7 @@ #define DRIVERNAME "Eicon active ISDN driver" #define DRIVERRELEASE "2.0" -#define DRIVERPATCH ".15" +#define DRIVERPATCH ".16" #include @@ -55,7 +55,7 @@ static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains start of card-list */ -static char *eicon_revision = "$Revision: 1.37 $"; +static char *eicon_revision = "$Revision: 1.37.6.4 $"; extern char *eicon_pci_revision; extern char *eicon_isa_revision; @@ -64,9 +64,6 @@ extern int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile, unsigned int command, unsigned long arg); extern void eicon_pci_init_conf(eicon_card *card); -void mod_inc_use_count(void); -void mod_dec_use_count(void); -extern char *file_check(void); #ifdef MODULE #define MOD_USE_COUNT (GET_USE_COUNT (&__this_module)) @@ -377,7 +374,7 @@ #ifdef MODULE case EICON_IOCTL_FREEIT: while (MOD_USE_COUNT > 0) MOD_DEC_USE_COUNT; - mod_inc_use_count(); + MOD_INC_USE_COUNT; return 0; #endif case EICON_IOCTL_LOADPCI: @@ -573,14 +570,10 @@ eicon_log(card, 1, "eicon CMD_GETSIL not implemented\n"); return 0; case ISDN_CMD_LOCK: -#ifdef MODULE - mod_inc_use_count(); -#endif + MOD_INC_USE_COUNT; return 0; case ISDN_CMD_UNLOCK: -#ifdef MODULE - mod_dec_use_count(); -#endif + MOD_DEC_USE_COUNT; return 0; #ifdef CONFIG_ISDN_TTY_FAX case ISDN_CMD_FAXCMD: @@ -1177,8 +1170,7 @@ return 0; } -#ifdef MODULE -static void +static void __exit unregister_card(eicon_card * card) { isdn_ctrl cmd; @@ -1204,7 +1196,6 @@ break; } } -#endif /* MODULE */ static void eicon_freecard(eicon_card *card) { @@ -1311,11 +1302,7 @@ } -#ifdef MODULE -#define eicon_init init_module -#endif - -int +static int __init eicon_init(void) { int card_count = 0; @@ -1341,8 +1328,8 @@ #endif strcpy(tmprev, eicon_idi_revision); printk("%s\n", eicon_getrev(tmprev)); - printk(KERN_INFO "%s Release: %s%s (%s)\n", DRIVERNAME, - DRIVERRELEASE, DRIVERPATCH, file_check()); + printk(KERN_INFO "%s Release: %s%s\n", DRIVERNAME, + DRIVERRELEASE, DRIVERPATCH); #ifdef CONFIG_ISDN_DRV_EICON_ISA #ifdef CONFIG_MCA @@ -1391,19 +1378,6 @@ return 0; } - -#ifdef MODULE - -void mod_inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -void mod_dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - #ifdef CONFIG_ISDN_DRV_EICON_PCI void DIVA_DIDD_Write(DESCRIPTOR *, int); EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read); @@ -1414,8 +1388,8 @@ card_t DivasCards[1]; #endif -void -cleanup_module(void) +static void __exit +eicon_exit(void) { #if CONFIG_PCI #ifdef CONFIG_ISDN_DRV_EICON_PCI @@ -1499,7 +1473,7 @@ printk(KERN_INFO "%s unloaded\n", DRIVERNAME); } -#else /* no module */ +#ifndef MODULE static int __init eicon_setup(char *line) @@ -1712,3 +1686,5 @@ #endif /* CONFIG_MCA */ #endif /* CONFIG_ISDN_DRV_EICON_ISA */ +module_init(eicon_init); +module_exit(eicon_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/eicon_pci.c linux/drivers/isdn/eicon/eicon_pci.c --- v2.4.2/linux/drivers/isdn/eicon/eicon_pci.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/eicon_pci.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon_pci.c,v 1.15 2000/06/12 12:44:02 armin Exp $ +/* $Id: eicon_pci.c,v 1.15.6.2 2001/02/16 09:09:50 armin Exp $ * * ISDN low-level module for Eicon active ISDN-Cards. * Hardware-specific code for PCI cards. @@ -6,7 +6,7 @@ * Copyright 1998-2000 by Armin Schindler (mac@melware.de) * Copyright 1999,2000 Cytronics & Melware (info@melware.de) * - * Thanks to Eicon Technology GmbH & Co. oHG for + * Thanks to Eicon Networks for * documents, informations and hardware. * * This program is free software; you can redistribute it and/or modify @@ -35,7 +35,7 @@ #include "adapter.h" #include "uxio.h" -char *eicon_pci_revision = "$Revision: 1.15 $"; +char *eicon_pci_revision = "$Revision: 1.15.6.2 $"; #if CONFIG_PCI /* intire stuff is only for PCI */ #ifdef CONFIG_ISDN_DRV_EICON_PCI @@ -86,7 +86,7 @@ printk(KERN_INFO "%s: DriverID='%s' CardID=%d\n", eicon_ctype_name[ctype], did, card_id); } -err: +err:; } pCard++; } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/fcheck.c linux/drivers/isdn/eicon/fcheck.c --- v2.4.2/linux/drivers/isdn/eicon/fcheck.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/fcheck.c Wed Dec 31 16:00:00 1969 @@ -1,31 +0,0 @@ -/* $Id: fcheck.c,v 1.3 2000/06/12 12:44:02 armin Exp $ - * - * (c) 2000 Cytronics & Melware - * - * This file is (c) under GNU PUBLIC LICENSE - * For changes and modifications please read - * ../../../Documentation/isdn/README.eicon - * - * - */ - -#include - -char * -file_check(void) { - -#ifdef FILECHECK -#if FILECHECK == 0 - return("verified"); -#endif -#if FILECHECK == 1 - return("modified"); -#endif -#if FILECHECK == 127 - return("verification failed"); -#endif -#else - return("not verified"); -#endif -} - diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/fourbri.c linux/drivers/isdn/eicon/fourbri.c --- v2.4.2/linux/drivers/isdn/eicon/fourbri.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/fourbri.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.7 * * This program is free software; you can redistribute it and/or modify @@ -67,7 +64,7 @@ void mem_inc(ADAPTER *a, void *adr); int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg); -int fourbri_ISR (card_t* card); +static int fourbri_ISR (card_t* card); int FPGA_Download(word, dword, byte *, byte *, int); extern byte FPGA_Bytes[]; @@ -113,7 +110,7 @@ UxCardMemOut(card->hw, &shared[ 8], config->tei); UxCardMemOut(card->hw, &shared[ 9], config->nt2); - UxCardMemOut(card->hw, &shared[10], 0); + UxCardMemOut(card->hw, &shared[10], config->sig_flags); UxCardMemOut(card->hw, &shared[11], config->watchdog); UxCardMemOut(card->hw, &shared[12], config->permanent); UxCardMemOut(card->hw, &shared[13], config->x_interface); @@ -561,23 +558,16 @@ }*/ -int fourbri_ISR (card_t* card) +static int fourbri_ISR (card_t* card) { - int served = 0; byte *ctl; - byte *reg = UxCardMemAttach(card->hw, DIVAS_REG_MEMORY); - if (UxCardPortIoIn(card->hw, reg, PLX9054_INTCSR) & 0x80) - { - served = 1; - card->int_pend += 1; - DivasDpcSchedule(); /* ISR DPC */ + card->int_pend += 1; + DivasDpcSchedule(); /* ISR DPC */ - ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY); - UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF); - UxCardMemDetach(card->hw, ctl); - } + ctl = UxCardMemAttach(card->hw, DIVAS_CTL_MEMORY); + UxCardMemOut(card->hw, &ctl[MQ_BREG_IRQ_TEST], MQ_IRQ_REQ_OFF); + UxCardMemDetach(card->hw, ctl); - UxCardMemDetach(card->hw, reg); - return (served != 0); + return (1); } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/fpga.c linux/drivers/isdn/eicon/fpga.c --- v2.4.2/linux/drivers/isdn/eicon/fpga.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/fpga.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.2 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/idi.c linux/drivers/isdn/eicon/idi.c --- v2.4.2/linux/drivers/isdn/eicon/idi.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/idi.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.8 * * This program is free software; you can redistribute it and/or modify @@ -248,13 +245,13 @@ /* * IDI request function for active cards */ - static void request(card_t *card, ENTITY *e) { word *special_req; int i; int ipl; + if (card->log_types & DIVAS_LOG_IDI) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/idi.h linux/drivers/isdn/eicon/idi.h --- v2.4.2/linux/drivers/isdn/eicon/idi.h Mon Dec 11 13:21:41 2000 +++ linux/drivers/isdn/eicon/idi.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify @@ -65,7 +62,7 @@ struct postcall_s { word command; /* command = 0x0300 */ word dummy; /* not used */ - IDI_CALL callback; /* routine adress to call back */ + IDI_CALL callback; /* routine address to call back */ ENTITY *contxt; /* ptr to entity to use */ }; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/kprintf.c linux/drivers/isdn/eicon/kprintf.c --- v2.4.2/linux/drivers/isdn/eicon/kprintf.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/kprintf.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.3 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/lincfg.c linux/drivers/isdn/eicon/lincfg.c --- v2.4.2/linux/drivers/isdn/eicon/lincfg.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/lincfg.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.9 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/linchr.c linux/drivers/isdn/eicon/linchr.c --- v2.4.2/linux/drivers/isdn/eicon/linchr.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/eicon/linchr.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.12 * * This program is free software; you can redistribute it and/or modify @@ -24,6 +21,8 @@ * */ +#define __NO_VERSION__ +#include #include #include @@ -240,14 +239,12 @@ return 0; } -int private_usage_count; -extern void mod_inc_use_count(void); -extern void mod_dec_use_count(void); +static int private_usage_count; int do_open(struct inode *pInode, struct file *pFile) { -#if defined(MODULE) - mod_inc_use_count(); + MOD_INC_USE_COUNT; +#ifdef MODULE private_usage_count++; #endif return 0; @@ -255,8 +252,8 @@ int do_release(struct inode *pInode, struct file *pFile) { -#if defined(MODULE) - mod_dec_use_count(); + MOD_DEC_USE_COUNT; +#ifdef MODULE private_usage_count--; #endif return 0; @@ -267,8 +264,6 @@ while (private_usage_count > 0) { private_usage_count--; -#if defined(MODULE) - mod_dec_use_count(); -#endif + MOD_DEC_USE_COUNT; } } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/linio.c linux/drivers/isdn/eicon/linio.c --- v2.4.2/linux/drivers/isdn/eicon/linio.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/eicon/linio.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.16 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/linsys.c linux/drivers/isdn/eicon/linsys.c --- v2.4.2/linux/drivers/isdn/eicon/linsys.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/linsys.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.10 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/log.c linux/drivers/isdn/eicon/log.c --- v2.4.2/linux/drivers/isdn/eicon/log.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/log.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.5 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/md5sums.asc linux/drivers/isdn/eicon/md5sums.asc --- v2.4.2/linux/drivers/isdn/eicon/md5sums.asc Wed Sep 27 13:45:40 2000 +++ linux/drivers/isdn/eicon/md5sums.asc Wed Dec 31 16:00:00 1969 @@ -1,16 +0,0 @@ -# These are valid md5sums to detect modifications -# in eicon driver files provided by Eicon Technology. -# For changes and modifications in these files please -# read ../../../Documentation/isdn/README.eicon -# -34bfe8d08d337a97c699ac8326f1d9b6 common.c -dbb92cba52db31ff8325a252b3f595c3 idi.c -15687687ef82f099966ed42772001cd3 bri.c -c3e3b720c3351b66635bd548195e29e8 pri.c -b0a6d2ab49bcfcfd1825860f178a84b4 log.c -673746176316b72271a09c0a27287a01 xlog.c -07e1bbabdb4d69880db196ef31bfb241 kprintf.c -b60b40ad630f26b7923369df95b4d1b9 fpga.c -5013ecca0a38a8fcc4a61642754f2076 fourbri.c -1501ae468a0c5eaab1e60720fa723a67 fcheck.c -# end of md5sums diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/pc.h linux/drivers/isdn/eicon/pc.h --- v2.4.2/linux/drivers/isdn/eicon/pc.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/pc.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.2 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/pc_maint.h linux/drivers/isdn/eicon/pc_maint.h --- v2.4.2/linux/drivers/isdn/eicon/pc_maint.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/pc_maint.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/pr_pc.h linux/drivers/isdn/eicon/pr_pc.h --- v2.4.2/linux/drivers/isdn/eicon/pr_pc.h Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/pr_pc.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.0 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/pri.c linux/drivers/isdn/eicon/pri.c --- v2.4.2/linux/drivers/isdn/eicon/pri.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/pri.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.5 * * This program is free software; you can redistribute it and/or modify @@ -82,7 +79,7 @@ void mem_inc(ADAPTER *a, void *adr); int DivasPRIInitPCI(card_t *card, dia_card_t *cfg); -int pri_ISR (card_t* card); +static int pri_ISR (card_t* card); static int diva_server_reset(card_t *card) { @@ -156,7 +153,7 @@ UxCardMemOut(card->hw, &shared[ 8], config->tei); UxCardMemOut(card->hw, &shared[ 9], config->nt2); - UxCardMemOut(card->hw, &shared[10], 0); + UxCardMemOut(card->hw, &shared[10], config->sig_flags); UxCardMemOut(card->hw, &shared[11], config->watchdog); UxCardMemOut(card->hw, &shared[12], config->permanent); UxCardMemOut(card->hw, &shared[13], config->x_interface); @@ -509,7 +506,7 @@ } -int pri_ISR (card_t* card) +static int pri_ISR (card_t* card) { int served = 0; byte* cfg = UxCardMemAttach(card->hw, DIVAS_CFG_MEMORY); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/sys.h linux/drivers/isdn/eicon/sys.h --- v2.4.2/linux/drivers/isdn/eicon/sys.h Mon Dec 11 13:21:41 2000 +++ linux/drivers/isdn/eicon/sys.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.2 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/uxio.h linux/drivers/isdn/eicon/uxio.h --- v2.4.2/linux/drivers/isdn/eicon/uxio.h Mon Dec 11 13:21:41 2000 +++ linux/drivers/isdn/eicon/uxio.h Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.6 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/eicon/xlog.c linux/drivers/isdn/eicon/xlog.c --- v2.4.2/linux/drivers/isdn/eicon/xlog.c Sun Aug 13 10:05:32 2000 +++ linux/drivers/isdn/eicon/xlog.c Fri Mar 2 11:12:08 2001 @@ -3,9 +3,6 @@ * * Copyright (C) Eicon Technology Corporation, 2000. * - * This source file is supplied for the exclusive use with Eicon - * Technology Corporation's range of DIVA Server Adapters. - * * Eicon File Revision : 1.2 * * This program is free software; you can redistribute it and/or modify diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/Makefile linux/drivers/isdn/hisax/Makefile --- v2.4.2/linux/drivers/isdn/hisax/Makefile Sat Feb 3 19:51:27 2001 +++ linux/drivers/isdn/hisax/Makefile Fri Mar 2 11:12:08 2001 @@ -34,6 +34,7 @@ hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o +hisax-objs-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o hisax-objs-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o hisax-objs-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o hisax-objs-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/amd7930.c linux/drivers/isdn/hisax/amd7930.c --- v2.4.2/linux/drivers/isdn/hisax/amd7930.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/amd7930.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: amd7930.c,v 1.5 2000/11/24 17:05:37 kai Exp $ +/* $Id: amd7930.c,v 1.5.6.1 2001/02/16 16:43:25 kai Exp $ * * HiSax ISDN driver - chip specific routines for AMD 7930 * @@ -14,7 +14,7 @@ * * The code is unreliable enough to be consider alpha * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the * SparcStation 1+. The chip provides microphone and speaker interfaces @@ -94,7 +94,7 @@ #include "rawhdlc.h" #include -static const char *amd7930_revision = "$Revision: 1.5 $"; +static const char *amd7930_revision = "$Revision: 1.5.6.1 $"; #define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */ #define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/arcofi.c linux/drivers/isdn/hisax/arcofi.c --- v2.4.2/linux/drivers/isdn/hisax/arcofi.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/arcofi.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: arcofi.c,v 1.12 2000/11/25 17:01:00 kai Exp $ +/* $Id: arcofi.c,v 1.12.6.1 2001/02/16 16:43:25 kai Exp $ * * arcofi.c Ansteuerung ARCOFI 2165 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/arcofi.h linux/drivers/isdn/hisax/arcofi.h --- v2.4.2/linux/drivers/isdn/hisax/arcofi.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/arcofi.h Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: arcofi.h,v 1.6 2000/06/26 08:59:12 keil Exp $ +/* $Id: arcofi.h,v 1.6.6.1 2001/02/16 16:43:25 kai Exp $ * * arcofi.h Ansteuerung ARCOFI 2165 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/asuscom.c linux/drivers/isdn/hisax/asuscom.c --- v2.4.2/linux/drivers/isdn/hisax/asuscom.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/asuscom.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: asuscom.c,v 1.11 2000/11/24 17:05:37 kai Exp $ +/* $Id: asuscom.c,v 1.11.6.1 2001/02/16 16:43:25 kai Exp $ * * asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards * @@ -6,7 +6,7 @@ * * Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -20,7 +20,7 @@ extern const char *CardType[]; -const char *Asuscom_revision = "$Revision: 1.11 $"; +const char *Asuscom_revision = "$Revision: 1.11.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/avm_a1.c linux/drivers/isdn/hisax/avm_a1.c --- v2.4.2/linux/drivers/isdn/hisax/avm_a1.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/avm_a1.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: avm_a1.c,v 2.13 2000/11/24 17:05:37 kai Exp $ +/* $Id: avm_a1.c,v 2.13.6.1 2001/02/16 16:43:25 kai Exp $ * * avm_a1.c low level stuff for AVM A1 (Fritz) isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -15,7 +15,7 @@ #include "isdnl1.h" extern const char *CardType[]; -static const char *avm_revision = "$Revision: 2.13 $"; +static const char *avm_revision = "$Revision: 2.13.6.1 $"; #define AVM_A1_STAT_ISAC 0x01 #define AVM_A1_STAT_HSCX 0x02 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/avm_a1p.c linux/drivers/isdn/hisax/avm_a1p.c --- v2.4.2/linux/drivers/isdn/hisax/avm_a1p.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/avm_a1p.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: avm_a1p.c,v 2.7 2000/11/24 17:05:37 kai Exp $ +/* $Id: avm_a1p.c,v 2.7.6.1 2001/02/16 16:43:25 kai Exp $ * * avm_a1p.c low level stuff for the following AVM cards: * A1 PCMCIA @@ -7,7 +7,7 @@ * * Author Carsten Paeth (calle@calle.in-berlin.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License */ #define __NO_VERSION__ #include @@ -53,7 +53,7 @@ #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) -static const char *avm_revision = "$Revision: 2.7 $"; +static const char *avm_revision = "$Revision: 2.7.6.1 $"; static inline u_char ReadISAC(struct IsdnCardState *cs, u_char offset) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/avm_pci.c linux/drivers/isdn/hisax/avm_pci.c --- v2.4.2/linux/drivers/isdn/hisax/avm_pci.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/avm_pci.c Fri Mar 2 11:12:08 2001 @@ -1,11 +1,11 @@ -/* $Id: avm_pci.c,v 1.22.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: avm_pci.c,v 1.22.6.4 2001/02/16 16:43:25 kai Exp $ * * avm_pci.c low level stuff for AVM Fritz!PCI and ISA PnP isdn cards * Thanks to AVM, Berlin for informations * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -18,7 +18,7 @@ #include extern const char *CardType[]; -static const char *avm_pci_rev = "$Revision: 1.22.6.2 $"; +static const char *avm_pci_rev = "$Revision: 1.22.6.4 $"; #define AVM_FRITZ_PCI 1 #define AVM_FRITZ_PNP 2 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/bkm_a4t.c linux/drivers/isdn/hisax/bkm_a4t.c --- v2.4.2/linux/drivers/isdn/hisax/bkm_a4t.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/bkm_a4t.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: bkm_a4t.c,v 1.13.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: bkm_a4t.c,v 1.13.6.4 2001/02/16 16:43:25 kai Exp $ * bkm_a4t.c low level stuff for T-Berkom A4T * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -6,7 +6,7 @@ * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -24,7 +24,7 @@ extern const char *CardType[]; -const char *bkm_a4t_revision = "$Revision: 1.13.6.2 $"; +const char *bkm_a4t_revision = "$Revision: 1.13.6.4 $"; static inline u_char diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/bkm_a8.c linux/drivers/isdn/hisax/bkm_a8.c --- v2.4.2/linux/drivers/isdn/hisax/bkm_a8.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/bkm_a8.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: bkm_a8.c,v 1.14.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: bkm_a8.c,v 1.14.6.4 2001/02/16 16:43:25 kai Exp $ * bkm_a8.c low level stuff for Scitel Quadro (4*S0, passive) * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -6,7 +6,7 @@ * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -27,7 +27,7 @@ extern const char *CardType[]; -const char sct_quadro_revision[] = "$Revision: 1.14.6.2 $"; +const char sct_quadro_revision[] = "$Revision: 1.14.6.4 $"; static const char *sct_quadro_subtypes[] = { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/callc.c linux/drivers/isdn/hisax/callc.c --- v2.4.2/linux/drivers/isdn/hisax/callc.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/callc.c Fri Mar 2 11:12:08 2001 @@ -1,9 +1,9 @@ -/* $Id: callc.c,v 2.51 2000/11/24 17:05:37 kai Exp $ +/* $Id: callc.c,v 2.51.6.1 2001/02/16 16:43:25 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -20,7 +20,7 @@ #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module)) #endif /* MODULE */ -const char *lli_revision = "$Revision: 2.51 $"; +const char *lli_revision = "$Revision: 2.51.6.1 $"; extern struct IsdnCard cards[]; extern int nrcards; @@ -337,7 +337,7 @@ * RESUME */ -/* incomming call */ +/* incoming call */ static void lli_deliver_call(struct FsmInst *fi, int event, void *arg) @@ -1026,9 +1026,11 @@ printk(KERN_WARNING"call to dummy_pstack pr=%04x arg %lx\n", pr, (long)arg); } -static void +static int init_PStack(struct PStack **stp) { *stp = kmalloc(sizeof(struct PStack), GFP_ATOMIC); + if (!*stp) + return -ENOMEM; (*stp)->next = NULL; (*stp)->l1.l1l2 = dummy_pstack; (*stp)->l1.l1hw = dummy_pstack; @@ -1041,16 +1043,20 @@ (*stp)->l3.l3l4 = dummy_pstack; (*stp)->lli.l4l3 = dummy_pstack; (*stp)->ma.layer = dummy_pstack; + return 0; } -static void +static int init_d_st(struct Channel *chanp) { struct PStack *st; struct IsdnCardState *cs = chanp->cs; char tmp[16]; + int err; - init_PStack(&chanp->d_st); + err = init_PStack(&chanp->d_st); + if (err) + return err; st = chanp->d_st; st->next = NULL; HiSax_addlist(cs, st); @@ -1075,6 +1081,8 @@ st->lli.userdata = chanp; st->lli.l2writewakeup = NULL; st->l3.l3l4 = dchan_l3l4; + + return 0; } static void @@ -1090,10 +1098,11 @@ va_end(args); } -static void +static int init_chan(int chan, struct IsdnCardState *csta) { struct Channel *chanp = csta->channel + chan; + int err; chanp->cs = csta; chanp->bcs = csta->bcs + chan; @@ -1102,7 +1111,9 @@ chanp->debug = 0; chanp->Flags = 0; chanp->leased = 0; - init_PStack(&chanp->b_st); + err = init_PStack(&chanp->b_st); + if (err) + return err; chanp->b_st->l1.delay = DEFAULT_B_DELAY; chanp->fi.fsm = &callcfsm; chanp->fi.state = ST_NULL; @@ -1112,31 +1123,41 @@ FsmInitTimer(&chanp->fi, &chanp->dial_timer); FsmInitTimer(&chanp->fi, &chanp->drel_timer); if (!chan || (test_bit(FLG_TWO_DCHAN, &csta->HW_Flags) && chan < 2)) { - init_d_st(chanp); + err = init_d_st(chanp); + if (err) + return err; } else { chanp->d_st = csta->channel->d_st; } chanp->data_open = 0; + return 0; } int CallcNewChan(struct IsdnCardState *csta) { - int i; + int i, err; chancount += 2; - init_chan(0, csta); - init_chan(1, csta); + err = init_chan(0, csta); + if (err) + return err; + err = init_chan(1, csta); + if (err) + return err; printk(KERN_INFO "HiSax: 2 channels added\n"); - for (i = 0; i < MAX_WAITING_CALLS; i++) - init_chan(i+2,csta); + for (i = 0; i < MAX_WAITING_CALLS; i++) { + err = init_chan(i+2,csta); + if (err) + return err; + } printk(KERN_INFO "HiSax: MAX_WAITING_CALLS added\n"); if (test_bit(FLG_PTP, &csta->channel->d_st->l2.flag)) { printk(KERN_INFO "LAYER2 WATCHING ESTABLISH\n"); csta->channel->d_st->lli.l4l3(csta->channel->d_st, DL_ESTABLISH | REQUEST, NULL); } - return (2); + return (0); } static void diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/cert.c linux/drivers/isdn/hisax/cert.c --- v2.4.2/linux/drivers/isdn/hisax/cert.c Mon Aug 21 07:49:02 2000 +++ linux/drivers/isdn/hisax/cert.c Fri Mar 2 11:12:08 2001 @@ -1,8 +1,8 @@ -/* $Id: cert.c,v 2.3 2000/06/26 08:59:12 keil Exp $ +/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/config.c linux/drivers/isdn/hisax/config.c --- v2.4.2/linux/drivers/isdn/hisax/config.c Sat Feb 3 19:51:27 2001 +++ linux/drivers/isdn/hisax/config.c Fri Mar 2 11:12:08 2001 @@ -1,9 +1,9 @@ -/* $Id: config.c,v 2.57.6.6 2000/12/10 23:39:19 kai Exp $ +/* $Id: config.c,v 2.57.6.10 2001/02/16 16:43:25 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -11,7 +11,6 @@ #include #include #include -#include #include "hisax.h" #include #include @@ -1195,7 +1194,12 @@ return (0); } init_tei(cs, cs->protocol); - CallcNewChan(cs); + ret = CallcNewChan(cs); + if (ret) { + closecard(cardnr); + restore_flags(flags); + return 0; + } /* ISAR needs firmware download first */ if (!test_bit(HW_ISAR, &cs->HW_Flags)) ll_run(cs, 0); @@ -1326,8 +1330,7 @@ #endif } -int __init -HiSax_init(void) +static int __init HiSax_init(void) { int i,j; int nzproto = 0; @@ -1497,11 +1500,7 @@ } } -#ifdef MODULE -int init_module(void) { return HiSax_init(); } - -void -cleanup_module(void) +static void __exit HiSax_exit(void) { int cardnr = nrcards -1; long flags; @@ -1518,7 +1517,6 @@ restore_flags(flags); printk(KERN_INFO "HiSax module removed\n"); } -#endif #ifdef CONFIG_HISAX_ELSA int elsa_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot) @@ -1707,6 +1705,8 @@ return (ret); } +#include + static struct pci_device_id hisax_pci_tbl[] __initdata = { #ifdef CONFIG_HISAX_FRITZPCI {PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID}, @@ -1770,3 +1770,6 @@ }; MODULE_DEVICE_TABLE(pci, hisax_pci_tbl); + +module_init(HiSax_init); +module_exit(HiSax_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/diva.c linux/drivers/isdn/hisax/diva.c --- v2.4.2/linux/drivers/isdn/hisax/diva.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/diva.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: diva.c,v 1.25.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: diva.c,v 1.25.6.4 2001/02/16 16:43:25 kai Exp $ * * diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -24,7 +24,7 @@ extern const char *CardType[]; -const char *Diva_revision = "$Revision: 1.25.6.2 $"; +const char *Diva_revision = "$Revision: 1.25.6.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/elsa.c linux/drivers/isdn/hisax/elsa.c --- v2.4.2/linux/drivers/isdn/hisax/elsa.c Tue Nov 28 21:44:41 2000 +++ linux/drivers/isdn/hisax/elsa.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: elsa.c,v 2.26.6.1 2000/11/28 12:02:46 kai Exp $ +/* $Id: elsa.c,v 2.26.6.3 2001/02/16 16:43:25 kai Exp $ * * elsa.c low level stuff for Elsa isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -30,7 +30,7 @@ extern const char *CardType[]; -const char *Elsa_revision = "$Revision: 2.26.6.1 $"; +const char *Elsa_revision = "$Revision: 2.26.6.3 $"; const char *Elsa_Types[] = {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/elsa_ser.c linux/drivers/isdn/hisax/elsa_ser.c --- v2.4.2/linux/drivers/isdn/hisax/elsa_ser.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/elsa_ser.c Fri Mar 2 11:12:08 2001 @@ -1,8 +1,8 @@ -/* $Id: elsa_ser.c,v 2.10 2000/11/19 17:02:47 kai Exp $ +/* $Id: elsa_ser.c,v 2.10.6.1 2001/02/16 16:43:26 kai Exp $ * * stuff for the serial modem on ELSA cards * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/fsm.c linux/drivers/isdn/hisax/fsm.c --- v2.4.2/linux/drivers/isdn/hisax/fsm.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/fsm.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: fsm.c,v 1.14 2000/11/24 17:05:37 kai Exp $ +/* $Id: fsm.c,v 1.14.6.1 2001/02/16 16:43:26 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden @@ -6,7 +6,7 @@ * Thanks to Jan den Ouden * Fritz Elfert * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/gazel.c linux/drivers/isdn/hisax/gazel.c --- v2.4.2/linux/drivers/isdn/hisax/gazel.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/gazel.c Fri Mar 2 11:12:08 2001 @@ -1,11 +1,11 @@ -/* $Id: gazel.c,v 2.11.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: gazel.c,v 2.11.6.4 2001/02/16 16:43:26 kai Exp $ * * gazel.c low level stuff for Gazel isdn cards * * Author BeWan Systems * based on source code from Karsten Keil * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -19,7 +19,7 @@ #include extern const char *CardType[]; -const char *gazel_revision = "$Revision: 2.11.6.2 $"; +const char *gazel_revision = "$Revision: 2.11.6.4 $"; #define R647 1 #define R685 2 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfc_2bds0.c linux/drivers/isdn/hisax/hfc_2bds0.c --- v2.4.2/linux/drivers/isdn/hisax/hfc_2bds0.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/hfc_2bds0.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bds0.c,v 1.15 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfc_2bds0.c,v 1.15.6.1 2001/02/16 16:43:26 kai Exp $ * * specific routines for CCD's HFC 2BDS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfc_2bds0.h linux/drivers/isdn/hisax/hfc_2bds0.h --- v2.4.2/linux/drivers/isdn/hisax/hfc_2bds0.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/hfc_2bds0.h Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bds0.h,v 1.4 2000/06/26 08:59:12 keil Exp $ +/* $Id: hfc_2bds0.h,v 1.4.6.1 2001/02/16 16:43:27 kai Exp $ * * specific defines for CCD's HFC 2BDS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfc_2bs0.c linux/drivers/isdn/hisax/hfc_2bs0.c --- v2.4.2/linux/drivers/isdn/hisax/hfc_2bs0.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/hfc_2bs0.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bs0.c,v 1.17 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfc_2bs0.c,v 1.17.6.1 2001/02/16 16:43:27 kai Exp $ * * specific routines for CCD's HFC 2BS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfc_2bs0.h linux/drivers/isdn/hisax/hfc_2bs0.h --- v2.4.2/linux/drivers/isdn/hisax/hfc_2bs0.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/hfc_2bs0.h Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bs0.h,v 1.3 2000/06/26 08:59:13 keil Exp $ +/* $Id: hfc_2bs0.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * * specific defines for CCD's HFC 2BS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfc_pci.c linux/drivers/isdn/hisax/hfc_pci.c --- v2.4.2/linux/drivers/isdn/hisax/hfc_pci.c Fri Dec 29 14:07:22 2000 +++ linux/drivers/isdn/hisax/hfc_pci.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: hfc_pci.c,v 1.34.6.3 2000/12/10 23:39:19 kai Exp $ +/* $Id: hfc_pci.c,v 1.34.6.4 2001/02/13 10:33:58 kai Exp $ * hfc_pci.c low level driver for CCD´s hfc-pci based cards * @@ -35,7 +35,7 @@ extern const char *CardType[]; -static const char *hfcpci_revision = "$Revision: 1.34.6.3 $"; +static const char *hfcpci_revision = "$Revision: 1.34.6.4 $"; /* table entry in the PCI devices list */ typedef struct { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hfcscard.c linux/drivers/isdn/hisax/hfcscard.c --- v2.4.2/linux/drivers/isdn/hisax/hfcscard.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/hfcscard.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hfcscard.c,v 1.8 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfcscard.c,v 1.8.6.1 2001/02/16 16:43:27 kai Exp $ * * hfcscard.c low level stuff for hfcs based cards (Teles3c, ACER P10) * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -16,7 +16,7 @@ extern const char *CardType[]; -static const char *hfcs_revision = "$Revision: 1.8 $"; +static const char *hfcs_revision = "$Revision: 1.8.6.1 $"; static void hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h --- v2.4.2/linux/drivers/isdn/hisax/hisax.h Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hisax/hisax.h Fri Mar 2 11:12:08 2001 @@ -1,8 +1,8 @@ -/* $Id: hisax.h,v 2.52.6.1 2000/12/06 16:59:19 kai Exp $ +/* $Id: hisax.h,v 2.52.6.3 2001/02/16 16:43:27 kai Exp $ * * Basic declarations, defines and prototypes * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -126,13 +126,13 @@ #define l3dss1_process #include "l3dss1.h" #undef l3dss1_process -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 #define l3ni1_process #include "l3ni1.h" #undef l3ni1_process -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ #define MAX_DFRAME_LEN 260 #define MAX_DFRAME_LEN_L1 300 @@ -318,10 +318,10 @@ { u_char uuuu; /* only as dummy */ #ifdef CONFIG_HISAX_EURO dss1_stk_priv dss1; /* private dss1 data */ -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 ni1_stk_priv ni1; /* private ni1 data */ -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ } prot; }; @@ -342,10 +342,10 @@ { u_char uuuu; /* only when euro not defined, avoiding empty union */ #ifdef CONFIG_HISAX_EURO dss1_proc_priv dss1; /* private dss1 data */ -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 ni1_proc_priv ni1; /* private ni1 data */ -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ } prot; }; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hscx.c linux/drivers/isdn/hisax/hscx.c --- v2.4.2/linux/drivers/isdn/hisax/hscx.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/hscx.c Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hscx.c,v 1.21 2000/11/24 17:05:37 kai Exp $ +/* $Id: hscx.c,v 1.21.6.1 2001/02/16 16:43:27 kai Exp $ * * hscx.c HSCX specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hscx.h linux/drivers/isdn/hisax/hscx.h --- v2.4.2/linux/drivers/isdn/hisax/hscx.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/hscx.h Fri Mar 2 11:12:08 2001 @@ -1,10 +1,10 @@ -/* $Id: hscx.h,v 1.6 2000/06/26 08:59:13 keil Exp $ +/* $Id: hscx.h,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $ * * hscx.h HSCX specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/hscx_irq.c linux/drivers/isdn/hisax/hscx_irq.c --- v2.4.2/linux/drivers/isdn/hisax/hscx_irq.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/hscx_irq.c Fri Mar 2 11:12:08 2001 @@ -1,4 +1,4 @@ -/* $Id: hscx_irq.c,v 1.16 2000/11/19 17:02:47 kai Exp $ +/* $Id: hscx_irq.c,v 1.16.6.1 2001/02/16 16:43:27 kai Exp $ * * hscx_irq.c low level b-channel stuff for Siemens HSCX * @@ -6,7 +6,7 @@ * * This is an include file for fast inline IRQ stuff * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/icc.c linux/drivers/isdn/hisax/icc.c --- v2.4.2/linux/drivers/isdn/hisax/icc.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/icc.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -// $Id: icc.c,v 1.5 2000/11/24 17:05:37 kai Exp $ +// $Id: icc.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $ //----------------------------------------------------------------------------- // // ICC specific routines @@ -7,10 +7,10 @@ // www.traverse.com.au // // 1999.6.25 Initial implementation of routines for Siemens ISDN -// Communication Controler PEB 2070 based on the ISAC routines +// Communication Controller PEB 2070 based on the ISAC routines // written by Karsten Keil. // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/icc.h linux/drivers/isdn/hisax/icc.h --- v2.4.2/linux/drivers/isdn/hisax/icc.h Mon Aug 21 07:49:03 2000 +++ linux/drivers/isdn/hisax/icc.h Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -// $Id: icc.h,v 1.2 2000/06/26 08:59:13 keil Exp $ +// $Id: icc.h,v 1.2.6.1 2001/02/16 16:43:27 kai Exp $ //----------------------------------------------------------------------------- // // ICC specific routines @@ -7,10 +7,10 @@ // www.traverse.com.au // // 1999.7.14 Initial implementation of routines for Siemens ISDN -// Communication Controler PEB 2070 based on the ISAC routines +// Communication Controller PEB 2070 based on the ISAC routines // written by Karsten Keil. // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/ipac.h linux/drivers/isdn/hisax/ipac.h --- v2.4.2/linux/drivers/isdn/hisax/ipac.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/ipac.h Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: ipac.h,v 1.5 2000/06/26 08:59:13 keil Exp $ +/* $Id: ipac.h,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $ * * ipac.h IPAC specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isac.c linux/drivers/isdn/hisax/isac.c --- v2.4.2/linux/drivers/isdn/hisax/isac.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/isac.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: isac.c,v 1.28 2000/11/24 17:05:37 kai Exp $ +/* $Id: isac.c,v 1.28.6.1 2001/02/16 16:43:27 kai Exp $ * * isac.c ISAC specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert */ @@ -445,7 +445,7 @@ if (cs->debug & L1_DEB_MONITOR) debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp -1]); } - AfterMOX1: + AfterMOX1:; #endif } } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isac.h linux/drivers/isdn/hisax/isac.h --- v2.4.2/linux/drivers/isdn/hisax/isac.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/isac.h Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: isac.h,v 1.7 2000/06/26 08:59:13 keil Exp $ +/* $Id: isac.h,v 1.7.6.1 2001/02/16 16:43:27 kai Exp $ * * isac.h ISAC specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isar.c linux/drivers/isdn/hisax/isar.c --- v2.4.2/linux/drivers/isdn/hisax/isar.c Mon Nov 27 16:56:09 2000 +++ linux/drivers/isdn/hisax/isar.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: isar.c,v 1.17 2000/11/24 17:05:37 kai Exp $ +/* $Id: isar.c,v 1.17.6.1 2001/02/16 16:43:27 kai Exp $ * * isar.c ISAR (Siemens PSB 7110) specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isar.h linux/drivers/isdn/hisax/isar.h --- v2.4.2/linux/drivers/isdn/hisax/isar.h Mon Aug 21 07:49:03 2000 +++ linux/drivers/isdn/hisax/isar.h Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: isar.h,v 1.9 2000/06/26 08:59:13 keil Exp $ +/* $Id: isar.h,v 1.9.6.1 2001/02/16 16:43:27 kai Exp $ * * isar.h ISAR (Siemens PSB 7110) specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl1.c linux/drivers/isdn/hisax/isdnl1.c --- v2.4.2/linux/drivers/isdn/hisax/isdnl1.c Fri Dec 29 14:07:22 2000 +++ linux/drivers/isdn/hisax/isdnl1.c Fri Mar 2 11:12:09 2001 @@ -1,11 +1,11 @@ -/* $Id: isdnl1.c,v 2.41.6.1 2000/12/10 22:01:04 kai Exp $ +/* $Id: isdnl1.c,v 2.41.6.2 2001/02/16 16:43:27 kai Exp $ * * isdnl1.c common low level stuff for Siemens Chipsetbased isdn cards * based on the teles driver from Jan den Ouden * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -15,7 +15,7 @@ * */ -const char *l1_revision = "$Revision: 2.41.6.1 $"; +const char *l1_revision = "$Revision: 2.41.6.2 $"; #define __NO_VERSION__ #include diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl1.h linux/drivers/isdn/hisax/isdnl1.h --- v2.4.2/linux/drivers/isdn/hisax/isdnl1.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/isdnl1.h Fri Mar 2 11:12:09 2001 @@ -1,8 +1,8 @@ -/* $Id: isdnl1.h,v 2.9 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl1.h,v 2.9.6.1 2001/02/16 16:43:27 kai Exp $ * * Layer 1 defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl2.c linux/drivers/isdn/hisax/isdnl2.c --- v2.4.2/linux/drivers/isdn/hisax/isdnl2.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/isdnl2.c Fri Mar 2 11:12:09 2001 @@ -1,9 +1,9 @@ -/* $Id: isdnl2.c,v 2.25 2000/11/24 17:05:38 kai Exp $ +/* $Id: isdnl2.c,v 2.25.6.1 2001/02/16 16:43:27 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -16,7 +16,7 @@ #include "hisax.h" #include "isdnl2.h" -const char *l2_revision = "$Revision: 2.25 $"; +const char *l2_revision = "$Revision: 2.25.6.1 $"; static void l2m_debug(struct FsmInst *fi, char *fmt, ...); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl2.h linux/drivers/isdn/hisax/isdnl2.h --- v2.4.2/linux/drivers/isdn/hisax/isdnl2.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/isdnl2.h Fri Mar 2 11:12:09 2001 @@ -1,8 +1,8 @@ -/* $Id: isdnl2.h,v 1.3 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl2.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * * Layer 2 defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl3.c linux/drivers/isdn/hisax/isdnl3.c --- v2.4.2/linux/drivers/isdn/hisax/isdnl3.c Sat Feb 3 19:51:27 2001 +++ linux/drivers/isdn/hisax/isdnl3.c Fri Mar 2 11:12:09 2001 @@ -1,9 +1,9 @@ -/* $Id: isdnl3.c,v 2.17 2000/11/24 17:05:38 kai Exp $ +/* $Id: isdnl3.c,v 2.17.6.2 2001/02/16 16:43:27 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -18,7 +18,7 @@ #include "isdnl3.h" #include -const char *l3_revision = "$Revision: 2.17 $"; +const char *l3_revision = "$Revision: 2.17.6.2 $"; static struct Fsm l3fsm; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isdnl3.h linux/drivers/isdn/hisax/isdnl3.h --- v2.4.2/linux/drivers/isdn/hisax/isdnl3.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/isdnl3.h Fri Mar 2 11:12:09 2001 @@ -1,6 +1,6 @@ -/* $Id: isdnl3.h,v 2.6 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl3.h,v 2.6.6.1 2001/02/16 16:43:27 kai Exp $ * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/isurf.c linux/drivers/isdn/hisax/isurf.c --- v2.4.2/linux/drivers/isdn/hisax/isurf.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/isurf.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: isurf.c,v 1.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: isurf.c,v 1.10.6.1 2001/02/16 16:43:27 kai Exp $ * * isurf.c low level stuff for Siemens I-Surf/I-Talk cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -17,7 +17,7 @@ extern const char *CardType[]; -static const char *ISurf_revision = "$Revision: 1.10 $"; +static const char *ISurf_revision = "$Revision: 1.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/ix1_micro.c linux/drivers/isdn/hisax/ix1_micro.c --- v2.4.2/linux/drivers/isdn/hisax/ix1_micro.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/ix1_micro.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: ix1_micro.c,v 2.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: ix1_micro.c,v 2.10.6.1 2001/02/16 16:43:27 kai Exp $ * * ix1_micro.c low level stuff for ITK ix1-micro Rev.2 isdn cards * derived from the original file teles3.c from Karsten Keil @@ -14,7 +14,7 @@ /* For the modification done by the author the following terms and conditions - apply (GNU PUBLIC LICENSE) + apply (GNU General Public License) This program is free software; you can redistribute it and/or modify @@ -50,7 +50,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *ix1_revision = "$Revision: 2.10 $"; +const char *ix1_revision = "$Revision: 2.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/jade.c linux/drivers/isdn/hisax/jade.c --- v2.4.2/linux/drivers/isdn/hisax/jade.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/jade.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: jade.c,v 1.6 2000/11/24 17:05:38 kai Exp $ +/* $Id: jade.c,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $ * * jade.c JADE stuff (derived from original hscx.c) * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/jade.h linux/drivers/isdn/hisax/jade.h --- v2.4.2/linux/drivers/isdn/hisax/jade.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/jade.h Fri Mar 2 11:12:09 2001 @@ -1,9 +1,9 @@ -/* $Id: jade.h,v 1.3 2000/06/26 08:59:14 keil Exp $ +/* $Id: jade.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * jade.h JADE specific defines * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/jade_irq.c linux/drivers/isdn/hisax/jade_irq.c --- v2.4.2/linux/drivers/isdn/hisax/jade_irq.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/jade_irq.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: jade_irq.c,v 1.5 2000/11/19 17:02:48 kai Exp $ +/* $Id: jade_irq.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $ * * jade_irq.c Low level JADE IRQ stuff (derived from original hscx_irq.c) * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3_1tr6.c linux/drivers/isdn/hisax/l3_1tr6.c --- v2.4.2/linux/drivers/isdn/hisax/l3_1tr6.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/l3_1tr6.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: l3_1tr6.c,v 2.13 2000/11/19 17:02:48 kai Exp $ +/* $Id: l3_1tr6.c,v 2.13.6.1 2001/02/16 16:43:27 kai Exp $ * * German 1TR6 D-channel protocol * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -17,7 +17,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *l3_1tr6_revision = "$Revision: 2.13 $"; +const char *l3_1tr6_revision = "$Revision: 2.13.6.1 $"; #define MsgHead(ptr, cref, mty, dis) \ *ptr++ = dis; \ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3_1tr6.h linux/drivers/isdn/hisax/l3_1tr6.h --- v2.4.2/linux/drivers/isdn/hisax/l3_1tr6.h Sun Aug 6 12:43:41 2000 +++ linux/drivers/isdn/hisax/l3_1tr6.h Fri Mar 2 11:12:09 2001 @@ -1,8 +1,8 @@ -/* $Id: l3_1tr6.h,v 2.2 2000/06/26 08:59:14 keil Exp $ +/* $Id: l3_1tr6.h,v 2.2.6.1 2001/02/16 16:43:27 kai Exp $ * * German 1TR6 D-channel protocol defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #ifndef l3_1tr6 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3dss1.c linux/drivers/isdn/hisax/l3dss1.c --- v2.4.2/linux/drivers/isdn/hisax/l3dss1.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/l3dss1.c Fri Mar 2 11:12:09 2001 @@ -1,11 +1,11 @@ -/* $Id: l3dss1.c,v 2.30 2000/11/19 17:02:48 kai Exp $ +/* $Id: l3dss1.c,v 2.30.6.1 2001/02/16 16:43:27 kai Exp $ * * EURO/DSS1 D-channel protocol * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -22,7 +22,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *dss1_revision = "$Revision: 2.30 $"; +const char *dss1_revision = "$Revision: 2.30.6.1 $"; #define EXT_BEARER_CAPS 1 @@ -426,9 +426,9 @@ #undef FOO1 } -#else not HISAX_DE_AOC +#else /* not HISAX_DE_AOC */ l3_debug(st, "invoke break"); -#endif not HISAX_DE_AOC +#endif /* not HISAX_DE_AOC */ break; case 2: /* return result */ /* if no process available handle separately */ @@ -438,12 +438,12 @@ return; } if ((pc->prot.dss1.invoke_id) && (pc->prot.dss1.invoke_id == id)) - { /* Diversion successfull */ + { /* Diversion successful */ free_invoke_id(st,pc->prot.dss1.invoke_id); pc->prot.dss1.remote_result = 0; /* success */ pc->prot.dss1.invoke_id = 0; pc->redir_result = pc->prot.dss1.remote_result; - st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */ + st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */ else l3_debug(st,"return error unknown identifier"); break; @@ -2112,7 +2112,7 @@ MsgHead(p, pc->callref, MT_FACILITY); for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */ - if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ + if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ *p++ = 0x1c; /* Facility info element */ *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */ @@ -2138,7 +2138,7 @@ *p++ = pc->chan->setup.phone[l]; if (len_sub) - { *p++ = 0x04; /* called party subadress */ + { *p++ = 0x04; /* called party subaddress */ *p++ = len_sub - 2; while (*subp) *p++ = *subp++; } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3dss1.h linux/drivers/isdn/hisax/l3dss1.h --- v2.4.2/linux/drivers/isdn/hisax/l3dss1.h Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/hisax/l3dss1.h Fri Mar 2 11:12:09 2001 @@ -1,8 +1,8 @@ -/* $Id: l3dss1.h,v 1.10 2000/06/26 08:59:14 keil Exp $ +/* $Id: l3dss1.h,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $ * * DSS1 (Euro) D-channel protocol defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3ni1.c linux/drivers/isdn/hisax/l3ni1.c --- v2.4.2/linux/drivers/isdn/hisax/l3ni1.c Fri Dec 29 14:07:22 2000 +++ linux/drivers/isdn/hisax/l3ni1.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -// $Id: l3ni1.c,v 2.5.6.1 2000/12/06 16:59:19 kai Exp $ +// $Id: l3ni1.c,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $ // //----------------------------------------------------------------------------- // @@ -16,7 +16,7 @@ // Will Scales - beta tester extraordinaire // Brett Whittacre - beta tester and remote devel system in Vegas // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- #define __NO_VERSION__ @@ -26,7 +26,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *ni1_revision = "$Revision: 2.5.6.1 $"; +const char *ni1_revision = "$Revision: 2.5.6.2 $"; #define EXT_BEARER_CAPS 1 @@ -372,12 +372,12 @@ return; } if ((pc->prot.ni1.invoke_id) && (pc->prot.ni1.invoke_id == id)) - { /* Diversion successfull */ + { /* Diversion successful */ free_invoke_id(st,pc->prot.ni1.invoke_id); pc->prot.ni1.remote_result = 0; /* success */ pc->prot.ni1.invoke_id = 0; pc->redir_result = pc->prot.ni1.remote_result; - st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */ + st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */ else l3_debug(st,"return error unknown identifier"); break; @@ -1973,7 +1973,7 @@ MsgHead(p, pc->callref, MT_FACILITY); for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */ - if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ + if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ *p++ = 0x1c; /* Facility info element */ *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */ @@ -1999,7 +1999,7 @@ *p++ = pc->chan->setup.phone[l]; if (len_sub) - { *p++ = 0x04; /* called party subadress */ + { *p++ = 0x04; /* called party subaddress */ *p++ = len_sub - 2; while (*subp) *p++ = *subp++; } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/l3ni1.h linux/drivers/isdn/hisax/l3ni1.h --- v2.4.2/linux/drivers/isdn/hisax/l3ni1.h Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/l3ni1.h Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -// $Id: l3ni1.h,v 2.3 2000/11/16 13:50:43 keil Exp $ +// $Id: l3ni1.h,v 2.3.6.1 2001/02/16 16:43:28 kai Exp $ //----------------------------------------------------------------------------- // // NI1 D-channel protocol @@ -12,7 +12,7 @@ // code provided by Ragnar Paulson. // // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/lmgr.c linux/drivers/isdn/hisax/lmgr.c --- v2.4.2/linux/drivers/isdn/hisax/lmgr.c Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/hisax/lmgr.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: lmgr.c,v 1.7 2000/06/26 08:59:14 keil Exp $ +/* $Id: lmgr.c,v 1.7.6.1 2001/02/16 16:43:28 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * * Layermanagement module * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/mic.c linux/drivers/isdn/hisax/mic.c --- v2.4.2/linux/drivers/isdn/hisax/mic.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/mic.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: mic.c,v 1.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: mic.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $ * * mic.c low level stuff for mic cards * @@ -6,7 +6,7 @@ * * Author Stephan von Krawczynski * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -19,7 +19,7 @@ extern const char *CardType[]; -const char *mic_revision = "$Revision: 1.10 $"; +const char *mic_revision = "$Revision: 1.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/netjet.c linux/drivers/isdn/hisax/netjet.c --- v2.4.2/linux/drivers/isdn/hisax/netjet.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hisax/netjet.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: netjet.c,v 1.24.6.2 2000/12/17 22:45:11 kai Exp $ +/* $Id: netjet.c,v 1.24.6.4 2001/02/16 16:43:28 kai Exp $ * * netjet.c low level stuff for Traverse Technologie NETJet ISDN cards * @@ -6,7 +6,7 @@ * * Thanks to Traverse Technologie Australia for documents and informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -22,7 +22,7 @@ #include #include "netjet.h" -const char *NETjet_revision = "$Revision: 1.24.6.2 $"; +const char *NETjet_revision = "$Revision: 1.24.6.4 $"; /* Interface functions */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/netjet.h linux/drivers/isdn/hisax/netjet.h --- v2.4.2/linux/drivers/isdn/hisax/netjet.h Tue Nov 28 21:44:41 2000 +++ linux/drivers/isdn/hisax/netjet.h Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -// $Id: netjet.h,v 2.5.6.1 2000/11/28 12:02:46 kai Exp $ +// $Id: netjet.h,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $ //----------------------------------------------------------------------------- // // NETjet common header file @@ -6,7 +6,7 @@ // Author Kerstern Keil repackaged by // Matt Henderson - Traverse Technologies P/L www.traverse.com.au // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/niccy.c linux/drivers/isdn/hisax/niccy.c --- v2.4.2/linux/drivers/isdn/hisax/niccy.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/niccy.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: niccy.c,v 1.15.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: niccy.c,v 1.15.6.4 2001/02/16 16:43:28 kai Exp $ * * niccy.c low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and * compatible (SAGEM cybermodem) @@ -7,7 +7,7 @@ * * Thanks to Dr. Neuhaus and SAGEM for informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -22,7 +22,7 @@ #include extern const char *CardType[]; -const char *niccy_revision = "$Revision: 1.15.6.2 $"; +const char *niccy_revision = "$Revision: 1.15.6.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/nj_s.c linux/drivers/isdn/hisax/nj_s.c --- v2.4.2/linux/drivers/isdn/hisax/nj_s.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hisax/nj_s.c Fri Mar 2 11:12:09 2001 @@ -1,6 +1,6 @@ -// $Id: nj_s.c,v 2.7.6.2 2001/02/07 11:31:31 kai Exp $ +// $Id: nj_s.c,v 2.7.6.4 2001/02/16 16:43:28 kai Exp $ // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // #define __NO_VERSION__ @@ -14,7 +14,7 @@ #include #include "netjet.h" -const char *NETjet_S_revision = "$Revision: 2.7.6.2 $"; +const char *NETjet_S_revision = "$Revision: 2.7.6.4 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/nj_u.c linux/drivers/isdn/hisax/nj_u.c --- v2.4.2/linux/drivers/isdn/hisax/nj_u.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hisax/nj_u.c Fri Mar 2 11:12:09 2001 @@ -1,6 +1,6 @@ -/* $Id: nj_u.c,v 2.8.6.2 2001/02/07 11:31:31 kai Exp $ +/* $Id: nj_u.c,v 2.8.6.4 2001/02/16 16:43:28 kai Exp $ * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -15,7 +15,7 @@ #include #include "netjet.h" -const char *NETjet_U_revision = "$Revision: 2.8.6.2 $"; +const char *NETjet_U_revision = "$Revision: 2.8.6.4 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/q931.c linux/drivers/isdn/hisax/q931.c --- v2.4.2/linux/drivers/isdn/hisax/q931.c Mon Aug 21 07:49:03 2000 +++ linux/drivers/isdn/hisax/q931.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: q931.c,v 1.10 2000/06/26 08:59:14 keil Exp $ +/* $Id: q931.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $ * * q931.c code to decode ITU Q.931 call control messages * * Author Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Changelog * @@ -1228,7 +1228,7 @@ finish = 1; } } else if (sapi == TEI_SAPI) { - dp += sprintf(dp, "tei managment\n"); + dp += sprintf(dp, "tei management\n"); finish = 1; } else { dp += sprintf(dp, "unknown sapi %d broadcast\n", sapi); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/rawhdlc.c linux/drivers/isdn/hisax/rawhdlc.c --- v2.4.2/linux/drivers/isdn/hisax/rawhdlc.c Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/hisax/rawhdlc.c Fri Mar 2 11:12:09 2001 @@ -1,11 +1,11 @@ -/* $Id: rawhdlc.c,v 1.5 2000/06/26 08:59:14 keil Exp $ +/* $Id: rawhdlc.c,v 1.5.6.1 2001/02/16 16:43:28 kai Exp $ * * rawhdlc.c support routines for cards that don't support HDLC * * Author Karsten Keil (keil@isdn4linux.de) * Brent Baccala * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930, * don't perform HDLC encapsulation over the B channel. Drivers for diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/rawhdlc.h linux/drivers/isdn/hisax/rawhdlc.h --- v2.4.2/linux/drivers/isdn/hisax/rawhdlc.h Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/hisax/rawhdlc.h Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: rawhdlc.h,v 1.3 2000/06/26 08:59:14 keil Exp $ +/* $Id: rawhdlc.h,v 1.3.6.1 2001/02/16 16:43:29 kai Exp $ * * rawhdlc.h support routines for cards that don't support HDLC * * Author Brent Baccala * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/s0box.c linux/drivers/isdn/hisax/s0box.c --- v2.4.2/linux/drivers/isdn/hisax/s0box.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/s0box.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: s0box.c,v 2.4 2000/11/24 17:05:38 kai Exp $ +/* $Id: s0box.c,v 2.4.6.1 2001/02/16 16:43:29 kai Exp $ * * s0box.c low level stuff for Creatix S0BOX * * Author S0BOX specific stuff: Enrik Berkhan (enrik@starfleet.inka.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -15,7 +15,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *s0box_revision = "$Revision: 2.4 $"; +const char *s0box_revision = "$Revision: 2.4.6.1 $"; static inline void writereg(unsigned int padr, signed int addr, u_char off, u_char val) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/saphir.c linux/drivers/isdn/hisax/saphir.c --- v2.4.2/linux/drivers/isdn/hisax/saphir.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/saphir.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: saphir.c,v 1.8 2000/11/24 17:05:38 kai Exp $ +/* $Id: saphir.c,v 1.8.6.1 2001/02/16 16:43:29 kai Exp $ * * saphir.c low level stuff for HST Saphir 1 * @@ -6,7 +6,7 @@ * * Thanks to HST High Soft Tech GmbH * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -19,7 +19,7 @@ #include "isdnl1.h" extern const char *CardType[]; -static char *saphir_rev = "$Revision: 1.8 $"; +static char *saphir_rev = "$Revision: 1.8.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/sedlbauer.c linux/drivers/isdn/hisax/sedlbauer.c --- v2.4.2/linux/drivers/isdn/hisax/sedlbauer.c Wed Nov 29 10:35:15 2000 +++ linux/drivers/isdn/hisax/sedlbauer.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: sedlbauer.c,v 1.25.6.2 2000/11/29 17:48:59 kai Exp $ +/* $Id: sedlbauer.c,v 1.25.6.4 2001/02/16 16:43:29 kai Exp $ * * sedlbauer.c low level stuff for Sedlbauer cards * includes support for the Sedlbauer speed star (speed star II), @@ -16,7 +16,7 @@ * Sedlbauer AG for informations * Edgar Toernig * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -52,7 +52,7 @@ extern const char *CardType[]; -const char *Sedlbauer_revision = "$Revision: 1.25.6.2 $"; +const char *Sedlbauer_revision = "$Revision: 1.25.6.4 $"; const char *Sedlbauer_Types[] = {"None", "speed card/win", "speed star", "speed fax+", diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/sedlbauer_cs.c linux/drivers/isdn/hisax/sedlbauer_cs.c --- v2.4.2/linux/drivers/isdn/hisax/sedlbauer_cs.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/isdn/hisax/sedlbauer_cs.c Fri Mar 2 11:12:09 2001 @@ -0,0 +1,682 @@ +/*====================================================================== + + A Sedlbauer PCMCIA client driver + + This driver is for the Sedlbauer Speed Star and Speed Star II, + which are ISDN PCMCIA Cards. + + sedlbauer_cs.c 1.1a 2001/01/28 15:04:04 + + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The initial developer of the original code is David A. Hinds + . Portions created by David A. Hinds + are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + + Modifications from dummy_cs.c are Copyright (C) 1999-2001 Marcus Niemann + . All Rights Reserved. + + Alternatively, the contents of this file may be used under the + terms of the GNU Public License version 2 (the "GPL"), in which + case the provisions of the GPL are applicable instead of the + above. If you wish to allow the use of your version of this file + only under the terms of the GPL and not to allow others to use + your version of this file under the MPL, indicate your decision + by deleting the provisions above and replace them with the notice + and other provisions required by the GPL. If you do not delete + the provisions above, a recipient may use your version of this + file under either the MPL or the GPL. + +======================================================================*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* + All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If + you do not define PCMCIA_DEBUG at all, all the debug code will be + left out. If you compile with PCMCIA_DEBUG=0, the debug code will + be present but disabled -- but it can then be enabled for specific + modules at load time with a 'pc_debug=#' option to insmod. +*/ + +#ifdef PCMCIA_DEBUG +static int pc_debug = PCMCIA_DEBUG; +MODULE_PARM(pc_debug, "i"); +#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); +static char *version = +"sedlbauer_cs.c 1.1a 2001/01/28 15:04:04 (M.Niemann)"; +#else +#define DEBUG(n, args...) +#endif + + +/*====================================================================*/ + +/* Parameters that can be set with 'insmod' */ + +/* The old way: bit map of interrupts to choose from */ +/* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ +static u_int irq_mask = 0xdeb8; +/* Newer, simpler way of listing specific interrupts */ +static int irq_list[4] = { -1 }; + +MODULE_PARM(irq_mask, "i"); +MODULE_PARM(irq_list, "1-4i"); + +static int protocol = 2; /* EURO-ISDN Default */ +MODULE_PARM(protocol, "i"); + +extern int sedl_init_pcmcia(int, int, int*, int); + +/*====================================================================*/ + +/* + The event() function is this driver's Card Services event handler. + It will be called by Card Services when an appropriate card status + event is received. The config() and release() entry points are + used to configure or release a socket, in response to card + insertion and ejection events. They are invoked from the sedlbauer + event handler. +*/ + +static void sedlbauer_config(dev_link_t *link); +static void sedlbauer_release(u_long arg); +static int sedlbauer_event(event_t event, int priority, + event_callback_args_t *args); + +/* + The attach() and detach() entry points are used to create and destroy + "instances" of the driver, where each instance represents everything + needed to manage one actual PCMCIA card. +*/ + +static dev_link_t *sedlbauer_attach(void); +static void sedlbauer_detach(dev_link_t *); + +/* + You'll also need to prototype all the functions that will actually + be used to talk to your device. See 'memory_cs' for a good example + of a fully self-sufficient driver; the other drivers rely more or + less on other parts of the kernel. +*/ + +/* + The dev_info variable is the "key" that is used to match up this + device driver with appropriate cards, through the card configuration + database. +*/ + +static dev_info_t dev_info = "sedlbauer_cs"; + +/* + A linked list of "instances" of the sedlbauer device. Each actual + PCMCIA card corresponds to one device instance, and is described + by one dev_link_t structure (defined in ds.h). + + You may not want to use a linked list for this -- for example, the + memory card driver uses an array of dev_link_t pointers, where minor + device numbers are used to derive the corresponding array index. +*/ + +static dev_link_t *dev_list = NULL; + +/* + A dev_link_t structure has fields for most things that are needed + to keep track of a socket, but there will usually be some device + specific information that also needs to be kept track of. The + 'priv' pointer in a dev_link_t structure can be used to point to + a device-specific private data structure, like this. + + To simplify the data structure handling, we actually include the + dev_link_t structure in the device's private data structure. + + A driver needs to provide a dev_node_t structure for each device + on a card. In some cases, there is only one device per card (for + example, ethernet cards, modems). In other cases, there may be + many actual or logical devices (SCSI adapters, memory cards with + multiple partitions). The dev_node_t structures need to be kept + in a linked list starting at the 'dev' field of a dev_link_t + structure. We allocate them in the card's private data structure, + because they generally shouldn't be allocated dynamically. + + In this case, we also provide a flag to indicate if a device is + "stopped" due to a power management event, or card ejection. The + device IO routines can use a flag like this to throttle IO to a + card that is not ready to accept it. + + The bus_operations pointer is used on platforms for which we need + to use special socket-specific versions of normal IO primitives + (inb, outb, readb, writeb, etc) for card IO. +*/ + +typedef struct local_info_t { + dev_link_t link; + dev_node_t node; + int stop; + struct bus_operations *bus; +} local_info_t; + +/*====================================================================*/ + +static void cs_error(client_handle_t handle, int func, int ret) +{ + error_info_t err = { func, ret }; + CardServices(ReportError, handle, &err); +} + +/*====================================================================== + + sedlbauer_attach() creates an "instance" of the driver, allocating + local data structures for one device. The device is registered + with Card Services. + + The dev_link structure is initialized, but we don't actually + configure the card at this point -- we wait until we receive a + card insertion event. + +======================================================================*/ + +static dev_link_t *sedlbauer_attach(void) +{ + local_info_t *local; + dev_link_t *link; + client_reg_t client_reg; + int ret, i; + + DEBUG(0, "sedlbauer_attach()\n"); + + /* Allocate space for private device-specific data */ + local = kmalloc(sizeof(local_info_t), GFP_KERNEL); + if (!local) return NULL; + memset(local, 0, sizeof(local_info_t)); + link = &local->link; link->priv = local; + + /* Initialize the dev_link_t structure */ + link->release.function = &sedlbauer_release; + link->release.data = (u_long)link; + + /* Interrupt setup */ + link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; + link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; + if (irq_list[0] == -1) + link->irq.IRQInfo2 = irq_mask; + else + for (i = 0; i < 4; i++) + link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.Handler = NULL; + + /* + General socket configuration defaults can go here. In this + client, we assume very little, and rely on the CIS for almost + everything. In most clients, many details (i.e., number, sizes, + and attributes of IO windows) are fixed by the nature of the + device, and can be hard-wired here. + */ + + /* from old sedl_cs + */ + /* The io structure describes IO port mapping */ + link->io.NumPorts1 = 8; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; + link->io.IOAddrLines = 3; + + + link->conf.Attributes = 0; + link->conf.Vcc = 50; + link->conf.IntType = INT_MEMORY_AND_IO; + + /* Register with Card Services */ + link->next = dev_list; + dev_list = link; + client_reg.dev_info = &dev_info; + client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; + client_reg.EventMask = + CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | + CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | + CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; + client_reg.event_handler = &sedlbauer_event; + client_reg.Version = 0x0210; + client_reg.event_callback_args.client_data = link; + ret = CardServices(RegisterClient, &link->handle, &client_reg); + if (ret != CS_SUCCESS) { + cs_error(link->handle, RegisterClient, ret); + sedlbauer_detach(link); + return NULL; + } + + return link; +} /* sedlbauer_attach */ + +/*====================================================================== + + This deletes a driver "instance". The device is de-registered + with Card Services. If it has been released, all local data + structures are freed. Otherwise, the structures will be freed + when the device is released. + +======================================================================*/ + +static void sedlbauer_detach(dev_link_t *link) +{ + dev_link_t **linkp; + + DEBUG(0, "sedlbauer_detach(0x%p)\n", link); + + /* Locate device structure */ + for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) + if (*linkp == link) break; + if (*linkp == NULL) + return; + + /* + If the device is currently configured and active, we won't + actually delete it yet. Instead, it is marked so that when + the release() function is called, that will trigger a proper + detach(). + */ + if (link->state & DEV_CONFIG) { +#ifdef PCMCIA_DEBUG + printk(KERN_DEBUG "sedlbauer_cs: detach postponed, '%s' " + "still locked\n", link->dev->dev_name); +#endif + link->state |= DEV_STALE_LINK; + return; + } + + /* Break the link with Card Services */ + if (link->handle) + CardServices(DeregisterClient, link->handle); + + /* Unlink device structure, and free it */ + *linkp = link->next; + /* This points to the parent local_info_t struct */ + kfree(link->priv); +} /* sedlbauer_detach */ + +/*====================================================================== + + sedlbauer_config() is scheduled to run after a CARD_INSERTION event + is received, to configure the PCMCIA socket, and to make the + device available to the system. + +======================================================================*/ + +#define CS_CHECK(fn, args...) \ +while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed + +#define CFG_CHECK(fn, args...) \ +if (CardServices(fn, args) != 0) goto next_entry + +static void sedlbauer_config(dev_link_t *link) +{ + client_handle_t handle = link->handle; + local_info_t *dev = link->priv; + tuple_t tuple; + cisparse_t parse; + int last_fn, last_ret; + u_char buf[64]; + config_info_t conf; + win_req_t req; + memreq_t map; + + + DEBUG(0, "sedlbauer_config(0x%p)\n", link); + + /* + This reads the card's CONFIG tuple to find its configuration + registers. + */ + tuple.DesiredTuple = CISTPL_CONFIG; + tuple.Attributes = 0; + tuple.TupleData = buf; + tuple.TupleDataMax = sizeof(buf); + tuple.TupleOffset = 0; + CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetTupleData, handle, &tuple); + CS_CHECK(ParseTuple, handle, &tuple, &parse); + link->conf.ConfigBase = parse.config.base; + link->conf.Present = parse.config.rmask[0]; + + /* Configure card */ + link->state |= DEV_CONFIG; + + /* Look up the current Vcc */ + CS_CHECK(GetConfigurationInfo, handle, &conf); + link->conf.Vcc = conf.Vcc; + + /* + In this loop, we scan the CIS for configuration table entries, + each of which describes a valid card configuration, including + voltage, IO window, memory window, and interrupt settings. + + We make no assumptions about the card to be configured: we use + just the information available in the CIS. In an ideal world, + this would work for any PCMCIA card, but it requires a complete + and accurate CIS. In practice, a driver usually "knows" most of + these things without consulting the CIS, and most client drivers + will only use the CIS to fill in implementation-defined details. + */ + tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; + CS_CHECK(GetFirstTuple, handle, &tuple); + while (1) { + cistpl_cftable_entry_t dflt = { 0 }; + cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); + CFG_CHECK(GetTupleData, handle, &tuple); + CFG_CHECK(ParseTuple, handle, &tuple, &parse); + + if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; + if (cfg->index == 0) goto next_entry; + link->conf.ConfigIndex = cfg->index; + + /* Does this card need audio output? */ + if (cfg->flags & CISTPL_CFTABLE_AUDIO) { + link->conf.Attributes |= CONF_ENABLE_SPKR; + link->conf.Status = CCSR_AUDIO_ENA; + } + + /* Use power settings for Vcc and Vpp if present */ + /* Note that the CIS values need to be rescaled */ + if (cfg->vcc.present & (1<vcc.param[CISTPL_POWER_VNOM]/10000) + goto next_entry; + } else if (dflt.vcc.present & (1<vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = + cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; + else if (dflt.vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = + dflt.vpp1.param[CISTPL_POWER_VNOM]/10000; + + /* Do we need to allocate an interrupt? */ + if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) + link->conf.Attributes |= CONF_ENABLE_IRQ; + + /* IO window settings */ + link->io.NumPorts1 = link->io.NumPorts2 = 0; + if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { + cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; + if (!(io->flags & CISTPL_IO_8BIT)) + link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; + if (!(io->flags & CISTPL_IO_16BIT)) + link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; +/* new in dummy.cs 2001/01/28 MN + link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; +*/ + link->io.BasePort1 = io->win[0].base; + link->io.NumPorts1 = io->win[0].len; + if (io->nwin > 1) { + link->io.Attributes2 = link->io.Attributes1; + link->io.BasePort2 = io->win[1].base; + link->io.NumPorts2 = io->win[1].len; + } + /* This reserves IO space but doesn't actually enable it */ + CFG_CHECK(RequestIO, link->handle, &link->io); + } + + /* + Now set up a common memory window, if needed. There is room + in the dev_link_t structure for one memory window handle, + but if the base addresses need to be saved, or if multiple + windows are needed, the info should go in the private data + structure for this device. + + Note that the memory window base is a physical address, and + needs to be mapped to virtual space with ioremap() before it + is used. + */ + if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) { + cistpl_mem_t *mem = + (cfg->mem.nwin) ? &cfg->mem : &dflt.mem; + req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; + req.Attributes |= WIN_ENABLE; + req.Base = mem->win[0].host_addr; + req.Size = mem->win[0].len; +/* new in dummy.cs 2001/01/28 MN + if (req.Size < 0x1000) + req.Size = 0x1000; +*/ + req.AccessSpeed = 0; + link->win = (window_handle_t)link->handle; + CFG_CHECK(RequestWindow, &link->win, &req); + map.Page = 0; map.CardOffset = mem->win[0].card_addr; + CFG_CHECK(MapMemPage, link->win, &map); + } + /* If we got this far, we're cool! */ + break; + + next_entry: +/* new in dummy.cs 2001/01/28 MN + if (link->io.NumPorts1) + CardServices(ReleaseIO, link->handle, &link->io); +*/ + CS_CHECK(GetNextTuple, handle, &tuple); + } + + /* + Allocate an interrupt line. Note that this does not assign a + handler to the interrupt, unless the 'Handler' member of the + irq structure is initialized. + */ + if (link->conf.Attributes & CONF_ENABLE_IRQ) + CS_CHECK(RequestIRQ, link->handle, &link->irq); + + /* + This actually configures the PCMCIA socket -- setting up + the I/O windows and the interrupt mapping, and putting the + card and host interface into "Memory and IO" mode. + */ + CS_CHECK(RequestConfiguration, link->handle, &link->conf); + + /* + At this point, the dev_node_t structure(s) need to be + initialized and arranged in a linked list at link->dev. + */ + sprintf(dev->node.dev_name, "sedlbauer"); + dev->node.major = dev->node.minor = 0; + link->dev = &dev->node; + + /* Finally, report what we've done */ + printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d", + dev->node.dev_name, link->conf.ConfigIndex, + link->conf.Vcc/10, link->conf.Vcc%10); + if (link->conf.Vpp1) + printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10); + if (link->conf.Attributes & CONF_ENABLE_IRQ) + printk(", irq %d", link->irq.AssignedIRQ); + if (link->io.NumPorts1) + printk(", io 0x%04x-0x%04x", link->io.BasePort1, + link->io.BasePort1+link->io.NumPorts1-1); + if (link->io.NumPorts2) + printk(" & 0x%04x-0x%04x", link->io.BasePort2, + link->io.BasePort2+link->io.NumPorts2-1); + if (link->win) + printk(", mem 0x%06lx-0x%06lx", req.Base, + req.Base+req.Size-1); + printk("\n"); + + link->state &= ~DEV_CONFIG_PENDING; + + sedl_init_pcmcia(link->io.BasePort1, link->irq.AssignedIRQ, + &(((local_info_t*)link->priv)->stop), + protocol); + + return; + +cs_failed: + cs_error(link->handle, last_fn, last_ret); + sedlbauer_release((u_long)link); + +} /* sedlbauer_config */ + +/*====================================================================== + + After a card is removed, sedlbauer_release() will unregister the + device, and release the PCMCIA configuration. If the device is + still open, this will be postponed until it is closed. + +======================================================================*/ + +static void sedlbauer_release(u_long arg) +{ + dev_link_t *link = (dev_link_t *)arg; + + DEBUG(0, "sedlbauer_release(0x%p)\n", link); + + /* + If the device is currently in use, we won't release until it + is actually closed, because until then, we can't be sure that + no one will try to access the device or its data structures. + */ + if (link->open) { + DEBUG(1, "sedlbauer_cs: release postponed, '%s' still open\n", + link->dev->dev_name); + link->state |= DEV_STALE_CONFIG; + return; + } + + /* Unlink the device chain */ + link->dev = NULL; + + /* + In a normal driver, additional code may be needed to release + other kernel data structures associated with this device. + */ + + /* Don't bother checking to see if these succeed or not */ + if (link->win) + CardServices(ReleaseWindow, link->win); + CardServices(ReleaseConfiguration, link->handle); + if (link->io.NumPorts1) + CardServices(ReleaseIO, link->handle, &link->io); + if (link->irq.AssignedIRQ) + CardServices(ReleaseIRQ, link->handle, &link->irq); + link->state &= ~DEV_CONFIG; + + if (link->state & DEV_STALE_LINK) + sedlbauer_detach(link); + +} /* sedlbauer_release */ + +/*====================================================================== + + The card status event handler. Mostly, this schedules other + stuff to run after an event is received. + + When a CARD_REMOVAL event is received, we immediately set a + private flag to block future accesses to this device. All the + functions that actually access the device should check this flag + to make sure the card is still present. + +======================================================================*/ + +static int sedlbauer_event(event_t event, int priority, + event_callback_args_t *args) +{ + dev_link_t *link = args->client_data; + local_info_t *dev = link->priv; + + DEBUG(1, "sedlbauer_event(0x%06x)\n", event); + + switch (event) { + case CS_EVENT_CARD_REMOVAL: + link->state &= ~DEV_PRESENT; + if (link->state & DEV_CONFIG) { + ((local_info_t *)link->priv)->stop = 1; + mod_timer(&link->release, jiffies + HZ/20); + } + break; + case CS_EVENT_CARD_INSERTION: + link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; + dev->bus = args->bus; + sedlbauer_config(link); + break; + case CS_EVENT_PM_SUSPEND: + link->state |= DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_RESET_PHYSICAL: + /* Mark the device as stopped, to block IO until later */ + dev->stop = 1; + if (link->state & DEV_CONFIG) + CardServices(ReleaseConfiguration, link->handle); + break; + case CS_EVENT_PM_RESUME: + link->state &= ~DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_CARD_RESET: + if (link->state & DEV_CONFIG) + CardServices(RequestConfiguration, link->handle, &link->conf); + dev->stop = 0; + /* + In a normal driver, additional code may go here to restore + the device state and restart IO. + */ + break; + } + return 0; +} /* sedlbauer_event */ + +/*====================================================================*/ + +static int __init init_sedlbauer_cs(void) +{ + servinfo_t serv; + DEBUG(0, "%s\n", version); + CardServices(GetCardServicesInfo, &serv); + if (serv.Revision != CS_RELEASE_CODE) { + printk(KERN_NOTICE "sedlbauer_cs: Card Services release " + "does not match!\n"); + return -1; + } + register_pccard_driver(&dev_info, &sedlbauer_attach, &sedlbauer_detach); + return 0; +} + +static void __exit exit_sedlbauer_cs(void) +{ + DEBUG(0, "sedlbauer_cs: unloading\n"); + unregister_pccard_driver(&dev_info); + while (dev_list != NULL) { + del_timer(&dev_list->release); + if (dev_list->state & DEV_CONFIG) + sedlbauer_release((u_long)dev_list); + sedlbauer_detach(dev_list); + } +} + +module_init(init_sedlbauer_cs); +module_exit(exit_sedlbauer_cs); + diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/sportster.c linux/drivers/isdn/hisax/sportster.c --- v2.4.2/linux/drivers/isdn/hisax/sportster.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/sportster.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: sportster.c,v 1.14 2000/11/24 17:05:38 kai Exp $ +/* $Id: sportster.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $ * * sportster.c low level stuff for USR Sportster internal TA * @@ -6,7 +6,7 @@ * * Thanks to Christian "naddy" Weisgerber (3Com, US Robotics) for documentation * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -17,7 +17,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *sportster_revision = "$Revision: 1.14 $"; +const char *sportster_revision = "$Revision: 1.14.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/tei.c linux/drivers/isdn/hisax/tei.c --- v2.4.2/linux/drivers/isdn/hisax/tei.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/tei.c Fri Mar 2 11:12:09 2001 @@ -1,9 +1,9 @@ -/* $Id: tei.c,v 2.17 2000/11/24 17:05:38 kai Exp $ +/* $Id: tei.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -17,7 +17,7 @@ #include #include -const char *tei_revision = "$Revision: 2.17 $"; +const char *tei_revision = "$Revision: 2.17.6.1 $"; #define ID_REQUEST 1 #define ID_ASSIGNED 2 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/teleint.c linux/drivers/isdn/hisax/teleint.c --- v2.4.2/linux/drivers/isdn/hisax/teleint.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/teleint.c Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: teleint.c,v 1.14 2000/11/24 17:05:38 kai Exp $ +/* $Id: teleint.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $ * * teleint.c low level stuff for TeleInt isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -17,7 +17,7 @@ extern const char *CardType[]; -const char *TeleInt_revision = "$Revision: 1.14 $"; +const char *TeleInt_revision = "$Revision: 1.14.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/teles0.c linux/drivers/isdn/hisax/teles0.c --- v2.4.2/linux/drivers/isdn/hisax/teles0.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/teles0.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: teles0.c,v 2.13 2000/11/24 17:05:38 kai Exp $ +/* $Id: teles0.c,v 2.13.6.1 2001/02/16 16:43:29 kai Exp $ * * teles0.c low level stuff for Teles Memory IO isdn cards * based on the teles driver from Jan den Ouden @@ -9,7 +9,7 @@ * Fritz Elfert * Beat Doebeli * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -21,7 +21,7 @@ extern const char *CardType[]; -const char *teles0_revision = "$Revision: 2.13 $"; +const char *teles0_revision = "$Revision: 2.13.6.1 $"; #define TELES_IOMEM_SIZE 0x400 #define byteout(addr,val) outb(val,addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/teles3.c linux/drivers/isdn/hisax/teles3.c --- v2.4.2/linux/drivers/isdn/hisax/teles3.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hisax/teles3.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: teles3.c,v 2.17 2000/11/24 17:05:38 kai Exp $ +/* $Id: teles3.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $ * * teles3.c low level stuff for Teles 16.3 & PNP isdn cards * @@ -10,7 +10,7 @@ * Fritz Elfert * Beat Doebeli * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -21,7 +21,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *teles3_revision = "$Revision: 2.17 $"; +const char *teles3_revision = "$Revision: 2.17.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/telespci.c linux/drivers/isdn/hisax/telespci.c --- v2.4.2/linux/drivers/isdn/hisax/telespci.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/telespci.c Fri Mar 2 11:12:09 2001 @@ -1,11 +1,11 @@ -/* $Id: telespci.c,v 2.16.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: telespci.c,v 2.16.6.4 2001/02/16 16:43:29 kai Exp $ * * telespci.c low level stuff for Teles PCI isdn cards * * Author Ton van Rosmalen * Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -18,7 +18,7 @@ #include extern const char *CardType[]; -const char *telespci_revision = "$Revision: 2.16.6.2 $"; +const char *telespci_revision = "$Revision: 2.16.6.4 $"; #define ZORAN_PO_RQ_PEN 0x02000000 #define ZORAN_PO_WR 0x00800000 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/w6692.c linux/drivers/isdn/hisax/w6692.c --- v2.4.2/linux/drivers/isdn/hisax/w6692.c Wed Nov 29 10:12:29 2000 +++ linux/drivers/isdn/hisax/w6692.c Fri Mar 2 11:12:09 2001 @@ -1,11 +1,11 @@ -/* $Id: w6692.c,v 1.12.6.2 2000/11/29 16:00:14 kai Exp $ +/* $Id: w6692.c,v 1.12.6.4 2001/02/16 16:43:29 kai Exp $ * * w6692.c Winbond W6692 specific routines * * Author Petr Novak * (based on HiSax driver by Karsten Keil) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -35,7 +35,7 @@ extern const char *CardType[]; -const char *w6692_revision = "$Revision: 1.12.6.2 $"; +const char *w6692_revision = "$Revision: 1.12.6.4 $"; #define DBUSY_TIMER_VALUE 80 diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hisax/w6692.h linux/drivers/isdn/hisax/w6692.h --- v2.4.2/linux/drivers/isdn/hisax/w6692.h Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/hisax/w6692.h Fri Mar 2 11:12:09 2001 @@ -1,10 +1,10 @@ -/* $Id: w6692.h,v 1.2 2000/06/26 08:59:15 keil Exp $ +/* $Id: w6692.h,v 1.2.6.1 2001/02/16 16:43:29 kai Exp $ * * w6692.h Winbond W6692 specific defines * * Author Petr Novak * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/boardergo.c linux/drivers/isdn/hysdn/boardergo.c --- v2.4.2/linux/drivers/isdn/hysdn/boardergo.c Fri Dec 29 14:07:22 2000 +++ linux/drivers/isdn/hysdn/boardergo.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: boardergo.c,v 1.5.6.1 2000/12/10 22:01:04 kai Exp $ +/* $Id: boardergo.c,v 1.5.6.2 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, specific routines for ergo type boards. * @@ -270,7 +270,7 @@ return (-ERR_BOOTIMG_FAIL); } } /* start_boot_img */ - return (0); /* successfull */ + return (0); /* successful */ } /* ergo_writebootimg */ /********************************************************************************/ @@ -337,7 +337,7 @@ /***********************************************************************************/ /* ergo_waitpofready waits for a maximum of 10 seconds for the completition of the */ -/* boot process. If the process has been successfull 0 is returned otherwise a */ +/* boot process. If the process has been successful 0 is returned otherwise a */ /* negative error code is returned. */ /***********************************************************************************/ static int @@ -361,7 +361,7 @@ (dpr->ToPcSize < MIN_RDY_MSG_SIZE) || (dpr->ToPcSize > MAX_RDY_MSG_SIZE) || ((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC)) - break; /* an error occured */ + break; /* an error occurred */ /* Check for additional data delivered during SysReady */ msg_size = dpr->ToPcSize - RDY_MAGIC_SIZE; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hycapi.c linux/drivers/isdn/hysdn/hycapi.c --- v2.4.2/linux/drivers/isdn/hysdn/hycapi.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hysdn/hycapi.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: hycapi.c,v 1.8 2000/11/22 17:13:13 kai Exp $ +/* $Id: hycapi.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $ * * Linux driver for HYSDN cards, CAPI2.0-Interface. * written by Ulrich Albrecht (u.albrecht@hypercope.de) for Hypercope GmbH @@ -41,7 +41,7 @@ #include "hysdn_defs.h" #include -static char hycapi_revision[]="$Revision: 1.8 $"; +static char hycapi_revision[]="$Revision: 1.8.6.1 $"; typedef struct _hycapi_appl { unsigned int ctrl_mask; @@ -522,7 +522,7 @@ /****************************************************************** hycapi_rx_capipkt -Recieve a capi-message. +Receive a capi-message. All B3_DATA_IND are converted to 64K-extension compatible format. New nccis are created if neccessary. diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_boot.c linux/drivers/isdn/hysdn/hysdn_boot.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_boot.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hysdn/hysdn_boot.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_boot.c,v 1.4 2000/11/13 22:51:47 kai Exp $ +/* $Id: hysdn_boot.c,v 1.4.6.2 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, specific routines for booting and pof handling. * @@ -49,7 +49,7 @@ uchar pof_state; /* actual state of read handler */ uchar is_crypted; /* card data is crypted */ int BufSize; /* actual number of bytes bufferd */ - int last_error; /* last occured error */ + int last_error; /* last occurred error */ word pof_recid; /* actual pof recid */ ulong pof_reclen; /* total length of pof record data */ ulong pof_recoffset; /* actual offset inside pof record */ @@ -62,7 +62,7 @@ }; /*****************************************************/ -/* start decryption of sucessive POF file chuncks. */ +/* start decryption of successive POF file chuncks. */ /* */ /* to be called at start of POF file reading, */ /* before starting any decryption on any POF record. */ @@ -93,7 +93,7 @@ /********************************************************************************/ /* pof_handle_data executes the required actions dependant on the active record */ -/* id. If successfull 0 is returned, a negative value shows an error. */ +/* id. If successful 0 is returned, a negative value shows an error. */ /********************************************************************************/ static int pof_handle_data(hysdn_card * card, int datlen) @@ -182,7 +182,7 @@ /* number of data bytes. The number delivered is additionally supplied for */ /* verification. The functions handles the data and returns the needed number */ /* of bytes for the next action. If the returned value is 0 or less an error */ -/* occured and booting must be aborted. */ +/* occurred and booting must be aborted. */ /******************************************************************************/ int pof_write_buffer(hysdn_card * card, int datlen) @@ -253,7 +253,7 @@ break; } if ((boot->last_error = pof_handle_data(card, datlen)) < 0) - return (boot->last_error); /* an error occured */ + return (boot->last_error); /* an error occurred */ boot->pof_recoffset += datlen; if (boot->pof_recoffset >= boot->pof_reclen) { boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ @@ -346,7 +346,7 @@ /*********************************************************************************/ /* EvalSysrTokData checks additional records delivered with the Sysready Message */ -/* when POF has been booted. A return value of 0 is used if no error occured. */ +/* when POF has been booted. A return value of 0 is used if no error occurred. */ /*********************************************************************************/ int EvalSysrTokData(hysdn_card * card, uchar * cp, int len) diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_init.c linux/drivers/isdn/hysdn/hysdn_init.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_init.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/hysdn/hysdn_init.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_init.c,v 1.6.6.1 2000/11/28 12:02:47 kai Exp $ +/* $Id: hysdn_init.c,v 1.6.6.5 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, init functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -32,7 +32,7 @@ #include "hysdn_defs.h" -static char *hysdn_init_revision = "$Revision: 1.6.6.1 $"; +static char *hysdn_init_revision = "$Revision: 1.6.6.5 $"; int cardmax; /* number of found cards */ hysdn_card *card_root = NULL; /* pointer to first card */ @@ -89,6 +89,7 @@ akt_pcidev)) != NULL) { if (pci_enable_device(akt_pcidev)) continue; + if (!(card = kmalloc(sizeof(hysdn_card), GFP_KERNEL))) { printk(KERN_ERR "HYSDN: unable to alloc device mem \n"); return; @@ -173,7 +174,6 @@ /* image becomes smaller and the driver code is only loaded when needed. */ /* Additionally newer versions may be activated without rebooting. */ /****************************************************************************/ -#ifdef CONFIG_MODULES /******************************************************/ /* extract revision number from string for log output */ @@ -197,12 +197,12 @@ /****************************************************************************/ /* init_module is called once when the module is loaded to do all necessary */ /* things like autodetect... */ -/* If the return value of this function is 0 the init has been successfull */ +/* If the return value of this function is 0 the init has been successful */ /* and the module is added to the list in /proc/modules, otherwise an error */ /* is assumed and the module will not be kept in memory. */ /****************************************************************************/ -int -init_module(void) +static int __init +hysdn_init(void) { char tmp[50]; @@ -235,14 +235,14 @@ /***********************************************************************/ /* cleanup_module is called when the module is released by the kernel. */ -/* The routine is only called if init_module has been successfull and */ +/* The routine is only called if init_module has been successful and */ /* the module counter has a value of 0. Otherwise this function will */ /* not be called. This function must release all resources still allo- */ /* cated as after the return from this function the module code will */ /* be removed from memory. */ /***********************************************************************/ -void -cleanup_module(void) +static void __exit +hysdn_exit(void) { #ifdef CONFIG_HYSDN_CAPI hysdn_card *card; @@ -261,4 +261,5 @@ printk(KERN_NOTICE "HYSDN: module unloaded\n"); } /* cleanup_module */ -#endif /* CONFIG_MODULES */ +module_init(hysdn_init); +module_exit(hysdn_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_net.c linux/drivers/isdn/hysdn/hysdn_net.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_net.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/hysdn/hysdn_net.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_net.c,v 1.8 2000/11/13 22:51:47 kai Exp $ +/* $Id: hysdn_net.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, net (ethernet type) handling routines. * @@ -38,7 +38,7 @@ #include "hysdn_defs.h" /* store the actual version for log reporting */ -char *hysdn_net_revision = "$Revision: 1.8 $"; +char *hysdn_net_revision = "$Revision: 1.8.6.1 $"; #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */ @@ -350,7 +350,7 @@ if (card->debug_flags & LOG_NET_INIT) hysdn_addlog(card, "network device deleted"); - return (0); /* always successfull */ + return (0); /* always successful */ } /* hysdn_net_release */ /*****************************************************************************/ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_procconf.c linux/drivers/isdn/hysdn/hysdn_procconf.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_procconf.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/hysdn/hysdn_procconf.c Fri Mar 2 11:12:10 2001 @@ -56,7 +56,7 @@ /***********************************************************************/ /* process_line parses one config line and transfers it to the card if */ /* necessary. */ -/* if the return value is negative an error occured. */ +/* if the return value is negative an error occurred. */ /***********************************************************************/ static int process_line(struct conf_writedata *cnf) @@ -130,7 +130,7 @@ if (ch == 0x1A) { /* we detected a pof file */ if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0) - return (cnf->needed_size); /* an error occured -> exit */ + return (cnf->needed_size); /* an error occurred -> exit */ cnf->buf_size = 0; /* buffer is empty */ cnf->state = CONF_STATE_POF; /* new state */ } else { @@ -158,7 +158,7 @@ cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size); /* write data */ if (cnf->needed_size <= 0) { cnf->card->state = CARD_STATE_BOOTERR; /* show boot error */ - return (cnf->needed_size); /* an error occured */ + return (cnf->needed_size); /* an error occurred */ } cnf->buf_size = 0; /* buffer is empty again */ } diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_procfs.c linux/drivers/isdn/hysdn/hysdn_procfs.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_procfs.c Wed Jul 12 21:58:42 2000 +++ linux/drivers/isdn/hysdn/hysdn_procfs.c Fri Mar 2 11:12:10 2001 @@ -139,7 +139,7 @@ return (-ESPIPE); if ((retval = pof_boot_write(card, buf, count)) < 0) - retval = -EFAULT; /* an error occured */ + retval = -EFAULT; /* an error occurred */ return (retval); } /* hysdn_log_write */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/hysdn/hysdn_sched.c linux/drivers/isdn/hysdn/hysdn_sched.c --- v2.4.2/linux/drivers/isdn/hysdn/hysdn_sched.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/hysdn/hysdn_sched.c Fri Mar 2 11:12:10 2001 @@ -141,7 +141,7 @@ /*****************************************************************************/ -/* send one config line to the card and return 0 if successfull, otherwise a */ +/* send one config line to the card and return 0 if successful, otherwise a */ /* negative error code. */ /* The function works with timeouts perhaps not giving the greatest speed */ /* sending the line, but this should be meaningless beacuse only some lines */ diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/icn/icn.c linux/drivers/isdn/icn/icn.c --- v2.4.2/linux/drivers/isdn/icn/icn.c Fri Nov 17 11:16:20 2000 +++ linux/drivers/isdn/icn/icn.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: icn.c,v 1.65 2000/11/13 22:51:48 kai Exp $ +/* $Id: icn.c,v 1.65.6.3 2001/02/16 16:43:31 kai Exp $ * ISDN low-level module for the ICN active ISDN-Card. * @@ -21,6 +21,7 @@ */ #include "icn.h" +#include /* * Verbose bootcode- and protocol-downloading. @@ -33,7 +34,7 @@ #undef MAP_DEBUG static char -*revision = "$Revision: 1.65 $"; +*revision = "$Revision: 1.65.6.3 $"; static int icn_addcard(int, char *, char *); @@ -867,7 +868,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif if (card->doubleS0) { SLEEP(1); @@ -883,7 +884,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif } kfree(codebuf); @@ -1638,10 +1639,7 @@ return 0; } -#ifdef MODULE -#define icn_init init_module -#else -#include +#ifndef MODULE static int __init icn_setup(char *line) { @@ -1667,10 +1665,9 @@ return(1); } __setup("icn=", icn_setup); -#endif /* MODULES */ +#endif /* MODULE */ -int -icn_init(void) +static int __init icn_init(void) { char *p; char rev[10]; @@ -1681,9 +1678,6 @@ dev.mcard = NULL; dev.firstload = 1; - /* No symbols to export, hide all symbols */ - EXPORT_NO_SYMBOLS; - if ((p = strchr(revision, ':'))) { strcpy(rev, p + 1); p = strchr(rev, '$'); @@ -1695,9 +1689,7 @@ return (icn_addcard(portbase, icn_id, icn_id2)); } -#ifdef MODULE -void -cleanup_module(void) +static void __exit icn_exit(void) { isdn_ctrl cmd; icn_card *card = cards; @@ -1731,4 +1723,6 @@ release_shmem((ulong) dev.shmem, 0x4000); printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n"); } -#endif + +module_init(icn_init); +module_exit(icn_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/icn/icn.h linux/drivers/isdn/icn/icn.h --- v2.4.2/linux/drivers/isdn/icn/icn.h Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/icn/icn.h Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: icn.h,v 1.30 2000/11/13 22:51:48 kai Exp $ +/* $Id: icn.h,v 1.30.6.2 2001/02/16 16:43:31 kai Exp $ * ISDN lowlevel-module for the ICN active ISDN-Card. * @@ -217,9 +217,9 @@ #ifdef MODULE MODULE_AUTHOR("Fritz Elfert"); MODULE_PARM(portbase, "i"); -MODULE_PARM_DESC(portbase, "Port adress of first card"); +MODULE_PARM_DESC(portbase, "Port address of first card"); MODULE_PARM(membase, "i"); -MODULE_PARM_DESC(membase, "Shared memory adress of all cards"); +MODULE_PARM_DESC(membase, "Shared memory address of all cards"); MODULE_PARM(icn_id, "s"); MODULE_PARM_DESC(icn_id, "ID-String of first card"); MODULE_PARM(icn_id2, "s"); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_bsdcomp.c linux/drivers/isdn/isdn_bsdcomp.c --- v2.4.2/linux/drivers/isdn/isdn_bsdcomp.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/isdn_bsdcomp.c Fri Mar 2 11:12:09 2001 @@ -47,12 +47,8 @@ * SUCH DAMAGE. */ -#ifndef MODULE -#error This file must be compiled as a module. -#endif - #include - +#include #include #include #include @@ -919,7 +915,7 @@ * Module support routines *************************************************************/ -int init_module(void) +static int __init isdn_bsdcomp_init(void) { int answer = isdn_ppp_register_compressor (&ippp_bsd_compress); if (answer == 0) @@ -927,7 +923,10 @@ return answer; } -void cleanup_module(void) +static void __exit isdn_bsdcomp_exit(void) { isdn_ppp_unregister_compressor (&ippp_bsd_compress); } + +module_init(isdn_bsdcomp_init); +module_exit(isdn_bsdcomp_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_cards.c linux/drivers/isdn/isdn_cards.c --- v2.4.2/linux/drivers/isdn/isdn_cards.c Fri Dec 29 14:40:54 2000 +++ linux/drivers/isdn/isdn_cards.c Wed Dec 31 16:00:00 1969 @@ -1,63 +0,0 @@ -/* $Id: isdn_cards.c,v 1.14 2000/11/23 20:45:14 kai Exp $ - - * Linux ISDN subsystem, initialization for non-modularized drivers. - * - * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) - * - * 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, 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 - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include - -#ifdef CONFIG_ISDN_DRV_ICN -extern void icn_init(void); -#endif - -#ifdef CONFIG_ISDN_DRV_HISAX -extern void HiSax_init(void); -#endif - -#ifdef CONFIG_ISDN_DRV_PCBIT -extern void pcbit_init(void); -#endif - -#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS) -extern void eicon_init(void); -#endif - -#if CONFIG_ISDN_DRV_ACT2000 -extern void act2000_init(void); -#endif - -void -isdn_cards_init(void) -{ -#if CONFIG_ISDN_DRV_ICN - icn_init(); -#endif -#ifdef CONFIG_ISDN_DRV_HISAX - HiSax_init(); -#endif -#if CONFIG_ISDN_DRV_PCBIT - pcbit_init(); -#endif -#if CONFIG_ISDN_DRV_ACT2000 - act2000_init(); -#endif -#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS) - eicon_init(); -#endif -} diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_cards.h linux/drivers/isdn/isdn_cards.h --- v2.4.2/linux/drivers/isdn/isdn_cards.h Sun Aug 6 12:43:42 2000 +++ linux/drivers/isdn/isdn_cards.h Wed Dec 31 16:00:00 1969 @@ -1,23 +0,0 @@ -/* $Id: isdn_cards.h,v 1.4 2000/05/11 22:29:20 kai Exp $ - - * Linux ISDN subsystem, initialization for non-modularized drivers. - * - * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de) - * - * 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, 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 - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -extern void isdn_cards_init(void); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_common.c linux/drivers/isdn/isdn_common.c --- v2.4.2/linux/drivers/isdn/isdn_common.c Wed Feb 21 18:20:23 2001 +++ linux/drivers/isdn/isdn_common.c Fri Mar 2 11:12:10 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_common.c,v 1.114.6.6 2001/02/07 11:31:30 kai Exp $ +/* $Id: isdn_common.c,v 1.114.6.8 2001/02/16 16:43:22 kai Exp $ * Linux ISDN subsystem, common used functions (linklevel). * @@ -42,9 +42,8 @@ #endif #ifdef CONFIG_ISDN_DIVERSION #include -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ #include "isdn_v110.h" -#include "isdn_cards.h" #include /* Debugflags */ @@ -52,7 +51,7 @@ isdn_dev *dev; -static char *isdn_revision = "$Revision: 1.114.6.6 $"; +static char *isdn_revision = "$Revision: 1.114.6.8 $"; extern char *isdn_net_revision; extern char *isdn_tty_revision; @@ -70,7 +69,7 @@ #ifdef CONFIG_ISDN_DIVERSION static isdn_divert_if *divert_if; /* = NULL */ -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ static int isdn_writebuf_stub(int, int, const u_char *, int, int); @@ -520,7 +519,7 @@ if (divert_if) if ((retval = divert_if->stat_callback(c))) return(retval); /* processed */ -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ if ((!retval) && (dev->drv[di]->flags & DRV_FLAG_REJBUS)) { /* No tty responding */ cmd.driver = di; @@ -593,7 +592,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; case ISDN_STAT_DISPLAY: #ifdef ISDN_DEBUG_STATCALLB @@ -603,7 +602,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; case ISDN_STAT_DCONN: if (i < 0) @@ -645,7 +644,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; break; case ISDN_STAT_BCONN: @@ -774,7 +773,7 @@ case ISDN_STAT_REDIR: if (divert_if) return(divert_if->stat_callback(c)); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ default: return -1; } @@ -2160,7 +2159,7 @@ EXPORT_SYMBOL(DIVERT_REG_NAME); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ EXPORT_SYMBOL(register_isdn); @@ -2409,7 +2408,6 @@ printk(" loaded\n"); #else printk("\n"); - isdn_cards_init(); #endif isdn_info_update(); return 0; diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c --- v2.4.2/linux/drivers/isdn/isdn_tty.c Mon Nov 27 16:53:43 2000 +++ linux/drivers/isdn/isdn_tty.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_tty.c,v 1.94 2000/11/25 17:00:59 kai Exp $ +/* $Id: isdn_tty.c,v 1.94.6.1 2001/02/16 16:43:22 kai Exp $ * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel). * @@ -66,7 +66,7 @@ static int si2bit[8] = {4, 1, 4, 4, 4, 4, 4, 4}; -char *isdn_tty_revision = "$Revision: 1.94 $"; +char *isdn_tty_revision = "$Revision: 1.94.6.1 $"; /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb() @@ -3773,7 +3773,7 @@ sprintf(ds, "\r\n%d", info->emu.charge); isdn_tty_at_cout(ds, info); break; - default: + default:; } break; #ifdef DUMMY_HAYES_AT diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdn_v110.c linux/drivers/isdn/isdn_v110.c --- v2.4.2/linux/drivers/isdn/isdn_v110.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/isdn_v110.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_v110.c,v 1.5.6.1 2001/01/23 17:45:02 kai Exp $ +/* $Id: isdn_v110.c,v 1.5.6.3 2001/02/16 16:43:23 kai Exp $ * Linux ISDN subsystem, V.110 related functions (linklevel). * @@ -30,7 +30,7 @@ #undef ISDN_V110_DEBUG -char *isdn_v110_revision = "$Revision: 1.5.6.1 $"; +char *isdn_v110_revision = "$Revision: 1.5.6.3 $"; #define V110_38400 255 #define V110_19200 15 @@ -70,7 +70,7 @@ * FlipBits reorders sequences of keylen bits in one byte. * E.g. source order 7654321 will be converted to 45670123 when keylen = 4, * and to 67452301 when keylen = 2. This is necessary because ordering on - * the isdn line is the the other way. + * the isdn line is the other way. */ static __inline unsigned char FlipBits(unsigned char c, int keylen) @@ -600,7 +600,7 @@ case ISDN_PROTO_L2_V11038: dev->v110[idx] = isdn_v110_open(V110_38400, hdrlen, maxsize); break; - default: + default:; } if ((v = dev->v110[idx])) { while (v->SyncInit) { diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdnloop/isdnloop.c linux/drivers/isdn/isdnloop/isdnloop.c --- v2.4.2/linux/drivers/isdn/isdnloop/isdnloop.c Fri Nov 17 11:16:21 2000 +++ linux/drivers/isdn/isdnloop/isdnloop.c Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: isdnloop.c,v 1.11 2000/11/13 22:51:50 kai Exp $ +/* $Id: isdnloop.c,v 1.11.6.2 2001/02/16 16:43:32 kai Exp $ * ISDN low-level module implementing a dummy loop driver. * @@ -21,10 +21,12 @@ */ #include +#include +#include #include "isdnloop.h" static char -*revision = "$Revision: 1.11 $"; +*revision = "$Revision: 1.11.6.2 $"; static int isdnloop_addcard(char *); @@ -975,7 +977,7 @@ * user = flag: 1 = called form userlevel, 0 called from kernel. * card = pointer to card struct. * Return: - * number of bytes transfered (currently always equals len). + * number of bytes transferred (currently always equals len). */ static int isdnloop_writecmd(const u_char * buf, int len, int user, isdnloop_card * card) @@ -1534,22 +1536,7 @@ return 0; } -#ifdef MODULE -#define isdnloop_init init_module -#else -void -isdnloop_setup(char *str, int *ints) -{ - static char sid[20]; - - if (strlen(str)) { - strcpy(sid, str); - isdnloop_id = sid; - } -} -#endif - -int +static int __init isdnloop_init(void) { char *p; @@ -1568,9 +1555,8 @@ return (isdnloop_addcard(isdnloop_id)); } -#ifdef MODULE -void -cleanup_module(void) +static void __exit +isdnloop_exit(void) { isdn_ctrl cmd; isdnloop_card *card = cards; @@ -1598,4 +1584,6 @@ } printk(KERN_NOTICE "isdnloop-ISDN-driver unloaded\n"); } -#endif + +module_init(isdnloop_init); +module_exit(isdnloop_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/isdnloop/isdnloop.h linux/drivers/isdn/isdnloop/isdnloop.h --- v2.4.2/linux/drivers/isdn/isdnloop/isdnloop.h Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/isdnloop/isdnloop.h Fri Mar 2 11:12:09 2001 @@ -1,4 +1,4 @@ -/* $Id: isdnloop.h,v 1.5 2000/11/13 22:51:50 kai Exp $ +/* $Id: isdnloop.h,v 1.5.6.1 2001/02/10 14:41:23 kai Exp $ * Loopback lowlevel module for testing of linklevel. * diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/callbacks.c linux/drivers/isdn/pcbit/callbacks.c --- v2.4.2/linux/drivers/isdn/pcbit/callbacks.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/pcbit/callbacks.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/callbacks.h linux/drivers/isdn/pcbit/callbacks.h --- v2.4.2/linux/drivers/isdn/pcbit/callbacks.h Tue Apr 23 02:31:35 1996 +++ linux/drivers/isdn/pcbit/callbacks.h Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/capi.c linux/drivers/isdn/pcbit/capi.c --- v2.4.2/linux/drivers/isdn/pcbit/capi.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/pcbit/capi.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/capi.h linux/drivers/isdn/pcbit/capi.h --- v2.4.2/linux/drivers/isdn/pcbit/capi.h Sat Jun 29 10:36:22 1996 +++ linux/drivers/isdn/pcbit/capi.h Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/drv.c linux/drivers/isdn/pcbit/drv.c --- v2.4.2/linux/drivers/isdn/pcbit/drv.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/pcbit/drv.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/edss1.c linux/drivers/isdn/pcbit/edss1.c --- v2.4.2/linux/drivers/isdn/pcbit/edss1.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/pcbit/edss1.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/edss1.h linux/drivers/isdn/pcbit/edss1.h --- v2.4.2/linux/drivers/isdn/pcbit/edss1.h Tue Apr 23 02:31:35 1996 +++ linux/drivers/isdn/pcbit/edss1.h Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/layer2.c linux/drivers/isdn/pcbit/layer2.c --- v2.4.2/linux/drivers/isdn/pcbit/layer2.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/isdn/pcbit/layer2.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/layer2.h linux/drivers/isdn/pcbit/layer2.h --- v2.4.2/linux/drivers/isdn/pcbit/layer2.h Mon Dec 11 13:21:16 2000 +++ linux/drivers/isdn/pcbit/layer2.h Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/module.c linux/drivers/isdn/pcbit/module.c --- v2.4.2/linux/drivers/isdn/pcbit/module.c Mon Aug 21 07:49:03 2000 +++ linux/drivers/isdn/pcbit/module.c Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* @@ -12,7 +12,7 @@ */ #include - +#include #include #include #include @@ -26,21 +26,12 @@ static int irq[MAX_PCBIT_CARDS] = {0, }; static int num_boards; -struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, 0, 0, 0}; - -int init_module(void); -void cleanup_module(void); +struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, }; extern void pcbit_terminate(int board); extern int pcbit_init_dev(int board, int mem_base, int irq); -#ifdef MODULE -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); -#define pcbit_init init_module -#endif - -int pcbit_init(void) +static int __init pcbit_init(void) { int board; @@ -83,15 +74,10 @@ else return -EIO; } - - /* No symbols to export, hide all symbols */ - EXPORT_NO_SYMBOLS; - return 0; } -#ifdef MODULE -void cleanup_module(void) +static void __exit pcbit_exit(void) { int board; @@ -101,9 +87,8 @@ "PCBIT-D module unloaded\n"); } -#else +#ifndef MODULE #define MAX_PARA (MAX_PCBIT_CARDS * 2) -#include static int __init pcbit_setup(char *line) { int i, j, argc; @@ -134,5 +119,9 @@ __setup("pcbit=", pcbit_setup); #endif +MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); +MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); +module_init(pcbit_init); +module_exit(pcbit_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/pcbit/pcbit.h linux/drivers/isdn/pcbit/pcbit.h --- v2.4.2/linux/drivers/isdn/pcbit/pcbit.h Thu Nov 18 21:03:01 1999 +++ linux/drivers/isdn/pcbit/pcbit.h Fri Mar 2 11:12:09 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/sc/init.c linux/drivers/isdn/sc/init.c --- v2.4.2/linux/drivers/isdn/sc/init.c Thu Oct 12 14:19:32 2000 +++ linux/drivers/isdn/sc/init.c Fri Mar 2 11:12:10 2001 @@ -1,3 +1,5 @@ +#include +#include #include "includes.h" #include "hardware.h" #include "card.h" @@ -37,23 +39,12 @@ return 0; } -#ifdef MODULE MODULE_PARM(io, "1-4i"); MODULE_PARM(irq, "1-4i"); MODULE_PARM(ram, "1-4i"); MODULE_PARM(do_reset, "i"); -#define init_sc init_module -#else -/* -Initialization code for non-module version to be included -void sc_setup(char *str, int *ints) -{ -} -*/ -#endif - -int init_sc(void) +static int __init sc_init(void) { int b = -1; int i, j; @@ -410,8 +401,7 @@ return status; } -#ifdef MODULE -void cleanup_module(void) +static void __exit sc_exit(void) { int i, j; @@ -463,7 +453,6 @@ } pr_info("SpellCaster ISA ISDN Adapter Driver Unloaded.\n"); } -#endif int identify_board(unsigned long rambase, unsigned int iobase) { @@ -579,3 +568,6 @@ return -1; } + +module_init(sc_init); +module_exit(sc_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/sc/interrupt.c linux/drivers/isdn/sc/interrupt.c --- v2.4.2/linux/drivers/isdn/sc/interrupt.c Wed Apr 1 16:21:04 1998 +++ linux/drivers/isdn/sc/interrupt.c Fri Mar 2 11:12:10 2001 @@ -141,7 +141,7 @@ } else if(callid>=0x0000 && callid<=0x7FFF) { - pr_debug("%s: Got Incomming Call\n", adapter[card]->devicename); + pr_debug("%s: Got Incoming Call\n", adapter[card]->devicename); strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4])); strcpy(setup.eazmsn,adapter[card]->channel[rcvmsg.phy_link_no-1].dn); setup.si1 = 7; diff -u --recursive --new-file v2.4.2/linux/drivers/md/md.c linux/drivers/md/md.c --- v2.4.2/linux/drivers/md/md.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/md/md.c Fri Mar 2 11:16:25 2001 @@ -682,6 +682,8 @@ rdev->bdev = NULL; } +void md_autodetect_dev (kdev_t dev); + static void export_rdev (mdk_rdev_t * rdev) { printk("export_rdev(%s)\n",partition_name(rdev->dev)); @@ -696,6 +698,7 @@ md_list_del(&rdev->pending); MD_INIT_LIST_HEAD(&rdev->pending); } + md_autodetect_dev(rdev->dev); rdev->dev = 0; rdev->faulty = 0; kfree(rdev); @@ -3584,7 +3587,7 @@ static int detected_devices[128] md__initdata; static int dev_cnt; -void md_autodetect_dev(kdev_t dev) +void md_autodetect_dev (kdev_t dev) { if (dev_cnt >= 0 && dev_cnt < 127) detected_devices[dev_cnt++] = dev; @@ -3598,7 +3601,7 @@ printk(KERN_INFO "autodetecting RAID arrays\n"); - for (i=0; ipending, &pending_raid_disks); } + dev_cnt = 0; autorun_devices(-1); } @@ -3656,7 +3660,7 @@ kdev_t device; char *devnames, *pername = ""; - if(get_option(&str, &minor) != 2) { /* MD Number */ + if (get_option(&str, &minor) != 2) { /* MD Number */ printk("md: Too few arguments supplied to md=.\n"); return 0; } @@ -3667,7 +3671,7 @@ printk ("md: Warning - md=%d,... has been specified twice;\n" " will discard the first definition.\n", minor); } - switch(get_option(&str, &level)) { /* RAID Personality */ + switch (get_option(&str, &level)) { /* RAID Personality */ case 2: /* could be 0 or -1.. */ if (level == 0 || level == -1) { if (get_option(&str, &factor) != 2 || /* Chunk Size */ @@ -3820,7 +3824,6 @@ printk(KERN_INFO "skipping autodetection of RAID arrays\n"); else autostart_arrays(); - dev_cnt = -1; /* make sure further calls to md_autodetect_dev are ignored */ md_setup_drive(); return 0; } diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/Config.in linux/drivers/media/radio/Config.in --- v2.4.2/linux/drivers/media/radio/Config.in Tue Sep 19 08:01:34 2000 +++ linux/drivers/media/radio/Config.in Fri Mar 2 11:12:10 2001 @@ -21,6 +21,7 @@ if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then hex ' GemTek i/o port (0x20c, 0x30c, 0x24c or 0x34c)' CONFIG_RADIO_GEMTEK_PORT 34c fi +dep_tristate ' Guillemot MAXI Radio FM 2000 radio' CONFIG_RADIO_MAXIRADIO $CONFIG_VIDEO_DEV dep_tristate ' Maestro on board radio' CONFIG_RADIO_MAESTRO $CONFIG_VIDEO_DEV dep_tristate ' Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV dep_tristate ' SF16FMI Radio' CONFIG_RADIO_SF16FMI $CONFIG_VIDEO_DEV diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/Makefile linux/drivers/media/radio/Makefile --- v2.4.2/linux/drivers/media/radio/Makefile Fri Dec 29 14:07:22 2000 +++ linux/drivers/media/radio/Makefile Fri Mar 2 11:12:10 2001 @@ -31,6 +31,7 @@ obj-$(CONFIG_RADIO_CADET) += radio-cadet.o obj-$(CONFIG_RADIO_TYPHOON) += radio-typhoon.o obj-$(CONFIG_RADIO_TERRATEC) += radio-terratec.o +obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o obj-$(CONFIG_RADIO_MIROPCM20) += radio-miropcm20.o diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-aimslab.c linux/drivers/media/radio/radio-aimslab.c --- v2.4.2/linux/drivers/media/radio/radio-aimslab.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-aimslab.c Fri Mar 2 11:12:10 2001 @@ -308,20 +308,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void rt_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct rt_device rtrack_unit; static struct video_device rtrack_radio= { + owner: THIS_MODULE, name: "RadioTrack radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_RTRACK, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-aztech.c linux/drivers/media/radio/radio-aztech.c --- v2.4.2/linux/drivers/media/radio/radio-aztech.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-aztech.c Fri Mar 2 11:12:10 2001 @@ -259,20 +259,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void az_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct az_device aztech_unit; static struct video_device aztech_radio= { + owner: THIS_MODULE, name: "Aztech radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_AZTECH, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-cadet.c linux/drivers/media/radio/radio-cadet.c --- v2.4.2/linux/drivers/media/radio/radio-cadet.c Mon Nov 27 17:47:38 2000 +++ linux/drivers/media/radio/radio-cadet.c Fri Mar 2 11:12:10 2001 @@ -16,6 +16,10 @@ * 2000-04-29 Russell Kroll * Added ISAPnP detection for Linux 2.3/2.4 * + * 2001-01-10 Russell Kroll + * Removed dead CONFIG_RADIO_CADET_PORT code + * PnP detection on load is now default (no args necessary) + * */ #include /* Modules */ @@ -25,16 +29,12 @@ #include /* outb, outb_p */ #include /* copy to/from user */ #include /* kernel radio structs */ -#include /* CONFIG_RADIO_CADET_PORT */ #include #include -#ifndef CONFIG_RADIO_CADET_PORT -#define CONFIG_RADIO_CADET_PORT 0x330 -#endif #define RDS_BUFFER 256 -static int io=CONFIG_RADIO_CADET_PORT; +static int io=-1; /* default to isapnp activation */ static int users=0; static int curtuner=0; static int tunestat=0; @@ -518,7 +518,6 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; init_waitqueue_head(&readq); return 0; } @@ -530,12 +529,12 @@ rdsstat=0; } users--; - MOD_DEC_USE_COUNT; } static struct video_device cadet_radio= { + owner: THIS_MODULE, name: "Cadet radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_CADET, @@ -587,6 +586,11 @@ return -1; } + /* + * io should only be set if the user has used something like + * isapnp (the userspace program) to initialize this card for us + */ + static int __init cadet_init(void) { /* @@ -626,6 +630,14 @@ MODULE_DESCRIPTION("A driver for the ADS Cadet AM/FM/RDS radio card."); MODULE_PARM(io, "i"); MODULE_PARM_DESC(io, "I/O address of Cadet card (0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e)"); + +static struct isapnp_device_id id_table[] __devinitdata = { + { ISAPNP_ANY_ID, ISAPNP_ANY_ID, + ISAPNP_VENDOR('M','S','M'), ISAPNP_FUNCTION(0x0c24), 0 }, + {0} +}; + +MODULE_DEVICE_TABLE(isapnp, id_table); EXPORT_NO_SYMBOLS; diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-gemtek.c linux/drivers/media/radio/radio-gemtek.c --- v2.4.2/linux/drivers/media/radio/radio-gemtek.c Sat Dec 30 11:19:13 2000 +++ linux/drivers/media/radio/radio-gemtek.c Fri Mar 2 11:12:10 2001 @@ -235,20 +235,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void gemtek_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct gemtek_device gemtek_unit; static struct video_device gemtek_radio= { + owner: THIS_MODULE, name: "GemTek radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_GEMTEK, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-maestro.c linux/drivers/media/radio/radio-maestro.c --- v2.4.2/linux/drivers/media/radio/radio-maestro.c Fri Nov 17 17:56:51 2000 +++ linux/drivers/media/radio/radio-maestro.c Fri Mar 2 11:12:10 2001 @@ -69,6 +69,7 @@ static struct video_device maestro_radio= { + owner: THIS_MODULE, name: "Maestro radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_SF16MI, @@ -282,14 +283,12 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void radio_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-maxiradio.c linux/drivers/media/radio/radio-maxiradio.c --- v2.4.2/linux/drivers/media/radio/radio-maxiradio.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/media/radio/radio-maxiradio.c Fri Mar 2 11:12:10 2001 @@ -0,0 +1,388 @@ +/* + * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux + * (C) 2001 Dimitromanolakis Apostolos + * + * Based in the radio Maestro PCI driver. Actually it uses the same chip + * for radio but different pci controller. + * + * I didn't have any specs I reversed engineered the protocol from + * the windows driver (radio.dll). + * + * The card uses the TEA5757 chip that includes a search function but it + * is useless as I haven't found any way to read back the frequency. If + * anybody does please mail me. + * + * For the pdf file see: + * http://www.semiconductors.philips.com/pip/TEA5757H/V1 + * + * + * CHANGES: + * 0.75b + * - better pci interface thanks to Francois Romieu + * + * 0.75 + * - tiding up + * - removed support for multiple devices as it didn't work anyway + * + * BUGS: + * - card unmutes if you change frequency + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* version 0.75 Sun Feb 4 22:51:27 EET 2001 */ +#define DRIVER_VERSION "0.75" + +#ifndef PCI_VENDOR_ID_GUILLEMOT +#define PCI_VENDOR_ID_GUILLEMOT 0x5046 +#endif + +#ifndef PCI_DEVICE_ID_GUILLEMOT +#define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001 +#endif + + +/* TEA5757 pin mappings */ +const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16 ; + + +#define FREQ_LO 50*16000 +#define FREQ_HI 150*16000 + +#define FREQ_IF 171200 /* 10.7*16000 */ +#define FREQ_STEP 200 /* 12.5*16 */ + +#define FREQ2BITS(x) ((( (unsigned int)(x)+FREQ_IF+(FREQ_STEP<<1))\ + /(FREQ_STEP<<2))<<2) /* (x==fmhz*16*1000) -> bits */ + +#define BITS2FREQ(x) ((x) * FREQ_STEP - FREQ_IF) + + +static int radio_open(struct video_device *, int); +static int radio_ioctl(struct video_device *, unsigned int, void *); +static void radio_close(struct video_device *); + +static struct video_device maxiradio_radio= +{ + owner: THIS_MODULE, + name: "Maxi Radio FM2000 radio", + type: VID_TYPE_TUNER, + hardware: VID_HARDWARE_SF16MI, + open: radio_open, + close: radio_close, + ioctl: radio_ioctl, +}; + +static struct radio_device +{ + __u16 io, /* base of radio io */ + muted, /* VIDEO_AUDIO_MUTE */ + stereo, /* VIDEO_TUNER_STEREO_ON */ + tuned; /* signal strength (0 or 0xffff) */ + + unsigned long freq; + + struct semaphore lock; +} radio_unit = {0, 0, 0, 0, }; + + +static void sleep_125ms(void) +{ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(HZ >> 3); +} + + +static void outbit(unsigned long bit, __u16 io) +{ + if(bit != 0) + { + outb( power|wren|data ,io); udelay(4); + outb( power|wren|data|clk ,io); udelay(4); + outb( power|wren|data ,io); udelay(4); + } + else + { + outb( power|wren ,io); udelay(4); + outb( power|wren|clk ,io); udelay(4); + outb( power|wren ,io); udelay(4); + } +} + +static void turn_power(__u16 io, int p) +{ + if(p != 0) outb(power, io); else outb(0,io); +} + + +static void set_freq(__u16 io, __u32 data) +{ + unsigned long int si; + int bl; + + /* TEA5757 shift register bits (see pdf) */ + + outbit(0,io); // 24 search + outbit(1,io); // 23 search up/down + + outbit(0,io); // 22 stereo/mono + + outbit(0,io); // 21 band + outbit(0,io); // 20 band (only 00=FM works I think) + + outbit(0,io); // 19 port ? + outbit(0,io); // 18 port ? + + outbit(0,io); // 17 search level + outbit(0,io); // 16 search level + + si = 0x8000; + for(bl = 1; bl <= 16 ; bl++) { outbit(data & si,io); si >>=1; } + + outb(power,io); +} + +static int get_stereo(__u16 io) +{ + outb(power,io); udelay(4); + return !(inb(io) & mo_st); +} + +static int get_tune(__u16 io) +{ + outb(power+clk,io); udelay(4); + return !(inb(io) & mo_st); +} + + +inline static int radio_function(struct video_device *dev, + unsigned int cmd, void *arg) +{ + struct radio_device *card=dev->priv; + switch(cmd) { + case VIDIOCGCAP: { + struct video_capability v; + + strcpy(v.name, "Maxi Radio FM2000 radio"); + v.type=VID_TYPE_TUNER; + v.channels=v.audios=1; + v.maxwidth=v.maxheight=v.minwidth=v.minheight=0; + + if(copy_to_user(arg,&v,sizeof(v))) + return -EFAULT; + + return 0; + } + case VIDIOCGTUNER: { + struct video_tuner v; + + if(copy_from_user(&v, arg,sizeof(v))!=0) + return -EFAULT; + + if(v.tuner) + return -EINVAL; + + card->stereo = 0xffff * get_stereo(card->io); + card->tuned = 0xffff * get_tune(card->io); + + v.flags = VIDEO_TUNER_LOW | card->stereo; + v.signal = card->tuned; + + strcpy(v.name, "FM"); + + v.rangelow = FREQ_LO; + v.rangehigh = FREQ_HI; + v.mode = VIDEO_MODE_AUTO; + + if(copy_to_user(arg,&v, sizeof(v))) + return -EFAULT; + + return 0; + } + case VIDIOCSTUNER: { + struct video_tuner v; + + if(copy_from_user(&v, arg, sizeof(v))) + return -EFAULT; + + if(v.tuner!=0) + return -EINVAL; + + return 0; + } + case VIDIOCGFREQ: { + unsigned long tmp=card->freq; + + if(copy_to_user(arg, &tmp, sizeof(tmp))) + return -EFAULT; + + return 0; + } + + case VIDIOCSFREQ: { + unsigned long tmp; + + if(copy_from_user(&tmp, arg, sizeof(tmp))) + return -EFAULT; + + if ( tmpFREQ_HI ) + return -EINVAL; + + card->freq = tmp; + + set_freq(card->io, FREQ2BITS(card->freq)); + sleep_125ms(); + + return 0; + } + case VIDIOCGAUDIO: { + struct video_audio v; + strcpy(v.name, "Radio"); + v.audio=v.volume=v.bass=v.treble=v.balance=v.step=0; + v.flags=VIDEO_AUDIO_MUTABLE | card->muted; + v.mode=VIDEO_SOUND_STEREO; + if(copy_to_user(arg,&v, sizeof(v))) + return -EFAULT; + return 0; + } + + case VIDIOCSAUDIO: { + struct video_audio v; + + if(copy_from_user(&v, arg, sizeof(v))) + return -EFAULT; + + if(v.audio) + return -EINVAL; + + + card->muted = v.flags & VIDEO_AUDIO_MUTE; + + if(card->muted) + turn_power(card->io, 0); + else + set_freq(card->io, FREQ2BITS(card->freq)); + + return 0; + } + + case VIDIOCGUNIT: { + struct video_unit v; + v.video=VIDEO_NO_UNIT; + v.vbi=VIDEO_NO_UNIT; + v.radio=dev->minor; + v.audio=0; + v.teletext=VIDEO_NO_UNIT; + if(copy_to_user(arg, &v, sizeof(v))) + return -EFAULT; + return 0; + } + default: return -ENOIOCTLCMD; + } +} + +static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg) +{ + struct radio_device *card=dev->priv; + int ret; + down(&card->lock); + ret = radio_function(dev, cmd, arg); + up(&card->lock); + return ret; +} + +static int radio_open(struct video_device *dev, int flags) +{ + return 0; +} + +static void radio_close(struct video_device *dev) +{ +} + +MODULE_AUTHOR("Dimitromanolakis Apostolos, apdim@grecian.net"); +MODULE_DESCRIPTION("Radio driver for the Guillemot Maxi Radio FM2000 radio."); + +EXPORT_NO_SYMBOLS; + +static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + if(!request_region(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) { + printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n"); + goto err_out; + } + + if (pci_enable_device(pdev)) + goto err_out_free_region; + + radio_unit.io = pci_resource_start(pdev, 0); + init_MUTEX(&radio_unit.lock); + maxiradio_radio.priv = &radio_unit; + + if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO)==-1) { + printk("radio-maxiradio: can't register device!"); + goto err_out_free_region; + } + + printk(KERN_INFO "radio-maxiradio: version " + DRIVER_VERSION + " time " + __TIME__ " " + __DATE__ + "\n"); + + printk(KERN_INFO "radio-maxiradio: found Guillemot MAXI Radio device (io = 0x%x)\n", + radio_unit.io); + return 0; + +err_out_free_region: + release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); +err_out: + return -ENODEV; +} + +static void __devexit maxiradio_remove_one(struct pci_dev *pdev) +{ + video_unregister_device(&maxiradio_radio); + release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); +} + +static struct pci_device_id maxiradio_pci_tbl[] __devinitdata = { + { PCI_VENDOR_ID_GUILLEMOT, PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO, + PCI_ANY_ID, PCI_ANY_ID, }, + { 0,} +}; + +MODULE_DEVICE_TABLE(pci, maxiradio_pci_tbl); + +static struct pci_driver maxiradio_driver = { + name: "radio-maxiradio", + id_table: maxiradio_pci_tbl, + probe: maxiradio_init_one, + remove: maxiradio_remove_one, +}; + +int __init maxiradio_radio_init(void) +{ + return pci_module_init(&maxiradio_driver); +} + +void __exit maxiradio_radio_exit(void) +{ + pci_unregister_driver(&maxiradio_driver); +} + +module_init(maxiradio_radio_init); +module_exit(maxiradio_radio_exit); diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-miropcm20.c linux/drivers/media/radio/radio-miropcm20.c --- v2.4.2/linux/drivers/media/radio/radio-miropcm20.c Fri Nov 17 17:56:51 2000 +++ linux/drivers/media/radio/radio-miropcm20.c Fri Mar 2 11:12:10 2001 @@ -178,20 +178,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void pcm20_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct pcm20_device pcm20_unit; static struct video_device pcm20_radio= { + owner: THIS_MODULE, name: "Miro PCM 20 radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_RTRACK, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-rtrack2.c linux/drivers/media/radio/radio-rtrack2.c --- v2.4.2/linux/drivers/media/radio/radio-rtrack2.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-rtrack2.c Fri Mar 2 11:12:10 2001 @@ -201,20 +201,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void rt_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct rt_device rtrack2_unit; static struct video_device rtrack2_radio= { + owner: THIS_MODULE, name: "RadioTrack II radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_RTRACK2, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-sf16fmi.c linux/drivers/media/radio/radio-sf16fmi.c --- v2.4.2/linux/drivers/media/radio/radio-sf16fmi.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-sf16fmi.c Fri Mar 2 11:12:10 2001 @@ -41,7 +41,7 @@ static struct semaphore lock; /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */ -/* It is only usefull to give freq in intervall of 800 (=0.05Mhz), +/* It is only useful to give freq in intervall of 800 (=0.05Mhz), * other bits will be truncated, e.g 92.7400016 -> 92.7, but * 92.7400017 -> 92.75 */ @@ -262,20 +262,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void fmi_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct fmi_device fmi_unit; static struct video_device fmi_radio= { + owner: THIS_MODULE, name: "SF16FMx radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_SF16MI, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-terratec.c linux/drivers/media/radio/radio-terratec.c --- v2.4.2/linux/drivers/media/radio/radio-terratec.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-terratec.c Fri Mar 2 11:12:10 2001 @@ -280,20 +280,19 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void tt_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct tt_device terratec_unit; static struct video_device terratec_radio= { + owner: THIS_MODULE, name: "TerraTec ActiveRadio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_TERRATEC, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-trust.c linux/drivers/media/radio/radio-trust.c --- v2.4.2/linux/drivers/media/radio/radio-trust.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-trust.c Fri Mar 2 11:12:10 2001 @@ -274,18 +274,17 @@ if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void tr_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct video_device trust_radio= { + owner: THIS_MODULE, name: "Trust FM Radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_TRUST, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-typhoon.c linux/drivers/media/radio/radio-typhoon.c --- v2.4.2/linux/drivers/media/radio/radio-typhoon.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-typhoon.c Fri Mar 2 11:12:10 2001 @@ -260,7 +260,6 @@ if (typhoon->users) return -EBUSY; typhoon->users++; - MOD_INC_USE_COUNT; return 0; } @@ -268,7 +267,6 @@ { struct typhoon_device *typhoon = dev->priv; typhoon->users--; - MOD_DEC_USE_COUNT; } static struct typhoon_device typhoon_unit = @@ -280,6 +278,7 @@ static struct video_device typhoon_radio = { + owner: THIS_MODULE, name: "Typhoon Radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_TYPHOON, diff -u --recursive --new-file v2.4.2/linux/drivers/media/radio/radio-zoltrix.c linux/drivers/media/radio/radio-zoltrix.c --- v2.4.2/linux/drivers/media/radio/radio-zoltrix.c Mon Jan 1 10:14:31 2001 +++ linux/drivers/media/radio/radio-zoltrix.c Fri Mar 2 11:12:10 2001 @@ -327,20 +327,19 @@ if (users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } static void zol_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } static struct zol_device zoltrix_unit; static struct video_device zoltrix_radio = { + owner: THIS_MODULE, name: "Zoltrix Radio Plus", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_ZOLTRIX, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/bttv-driver.c linux/drivers/media/video/bttv-driver.c --- v2.4.2/linux/drivers/media/video/bttv-driver.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/bttv-driver.c Fri Mar 2 11:12:10 2001 @@ -1352,7 +1352,6 @@ if (bttv_debug) printk("bttv%d: open called\n",btv->nr); - MOD_INC_USE_COUNT; down(&btv->lock); if (btv->user) goto out_unlock; @@ -1378,7 +1377,6 @@ out_unlock: up(&btv->lock); - MOD_DEC_USE_COUNT; return ret; } @@ -1423,7 +1421,6 @@ rvfree((void *) btv->fbuffer, gbuffers*gbufsize); btv->fbuffer=0; up(&btv->lock); - MOD_DEC_USE_COUNT; } @@ -2053,6 +2050,7 @@ static struct video_device bttv_template= { + owner: THIS_MODULE, name: "UNSET", type: VID_TYPE_TUNER|VID_TYPE_CAPTURE|VID_TYPE_OVERLAY|VID_TYPE_TELETEXT, hardware: VID_HARDWARE_BT848, @@ -2140,7 +2138,6 @@ struct bttv *btv=(struct bttv *)(dev-2); unsigned long irq_flags; - MOD_INC_USE_COUNT; down(&btv->lock); if (btv->needs_restart) bt848_restart(btv); @@ -2164,7 +2161,6 @@ btv->vbi_on = 0; bt848_set_risc_jmps(btv,-1); spin_unlock_irqrestore(&btv->s_lock, irq_flags); - MOD_DEC_USE_COUNT; } static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg) @@ -2202,6 +2198,7 @@ static struct video_device vbi_template= { + owner: THIS_MODULE, name: "bttv vbi", type: VID_TYPE_CAPTURE|VID_TYPE_TELETEXT, hardware: VID_HARDWARE_BT848, @@ -2220,7 +2217,6 @@ struct bttv *btv = (struct bttv *)(dev-1); unsigned long v; - MOD_INC_USE_COUNT; down(&btv->lock); if (btv->user) goto busy_unlock; @@ -2237,7 +2233,6 @@ busy_unlock: up(&btv->lock); - MOD_DEC_USE_COUNT; return -EBUSY; } @@ -2249,7 +2244,6 @@ btv->user--; btv->radio = 0; up(&btv->lock); - MOD_DEC_USE_COUNT; } static long radio_read(struct video_device *v, char *buf, unsigned long count, int nonblock) @@ -2320,6 +2314,7 @@ static struct video_device radio_template= { + owner: THIS_MODULE, name: "bttv radio", type: VID_TYPE_TUNER, hardware: VID_HARDWARE_BT848, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/bw-qcam.c linux/drivers/media/video/bw-qcam.c --- v2.4.2/linux/drivers/media/video/bw-qcam.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/bw-qcam.c Fri Mar 2 11:12:10 2001 @@ -696,13 +696,11 @@ static int qcam_open(struct video_device *dev, int flags) { - MOD_INC_USE_COUNT; return 0; } static void qcam_close(struct video_device *dev) { - MOD_DEC_USE_COUNT; } static long qcam_write(struct video_device *v, const char *buf, unsigned long count, int noblock) @@ -918,6 +916,7 @@ static struct video_device qcam_template= { + owner: THIS_MODULE, name: "Connectix Quickcam", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_QCAM_BW, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/c-qcam.c linux/drivers/media/video/c-qcam.c --- v2.4.2/linux/drivers/media/video/c-qcam.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/c-qcam.c Fri Mar 2 11:12:10 2001 @@ -500,13 +500,11 @@ static int qcam_open(struct video_device *dev, int flags) { - MOD_INC_USE_COUNT; return 0; } static void qcam_close(struct video_device *dev) { - MOD_DEC_USE_COUNT; } static long qcam_write(struct video_device *v, const char *buf, unsigned long count, int noblock) @@ -725,6 +723,7 @@ /* video device template */ static struct video_device qcam_template= { + owner: THIS_MODULE, name: "Colour QuickCam", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_QCAM_C, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/cpia.c linux/drivers/media/video/cpia.c --- v2.4.2/linux/drivers/media/video/cpia.c Fri Nov 17 17:56:51 2000 +++ linux/drivers/media/video/cpia.c Fri Mar 2 11:12:10 2001 @@ -2499,9 +2499,6 @@ cam->mmap_kludge = 0; ++cam->open_count; -#ifdef MODULE - MOD_INC_USE_COUNT; -#endif return 0; } @@ -2554,9 +2551,6 @@ } -#ifdef MODULE - MOD_DEC_USE_COUNT; -#endif return; } @@ -3031,6 +3025,7 @@ } static struct video_device cpia_template = { + owner: THIS_MODULE, name: "CPiA Camera", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_CPIA, /* FIXME */ diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/cpia.h linux/drivers/media/video/cpia.h --- v2.4.2/linux/drivers/media/video/cpia.h Mon Dec 11 13:15:37 2000 +++ linux/drivers/media/video/cpia.h Fri Mar 2 11:12:10 2001 @@ -62,7 +62,7 @@ /* transferCmd sends commands to the camera. command MUST point to * an 8 byte buffer in kernel space. data can be NULL if no extra * data is needed. The size of the data is given by the last 2 - * bytes of comand. data must also point to memory in kernel space. + * bytes of command. data must also point to memory in kernel space. * Returns negative value on error, otherwise 0. */ int (*transferCmd)(void *privdata, u8 *command, u8 *data); diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/cpia_pp.c linux/drivers/media/video/cpia_pp.c --- v2.4.2/linux/drivers/media/video/cpia_pp.c Mon Mar 27 10:22:31 2000 +++ linux/drivers/media/video/cpia_pp.c Fri Mar 2 11:12:10 2001 @@ -34,9 +34,7 @@ #include #include -#ifdef CONFIG_KMOD #include -#endif /* #define _CPIA_DEBUG_ define for verbose debug output */ #include "cpia.h" @@ -502,9 +500,6 @@ ++cam->open_count; -#ifdef MODULE - MOD_INC_USE_COUNT; -#endif return 0; } @@ -535,9 +530,6 @@ static int cpia_pp_close(void *privdata) { struct pp_cam_entry *cam = privdata; -#ifdef MODULE - MOD_DEC_USE_COUNT; -#endif if (--cam->open_count == 0) { parport_release(cam->pdev); } diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/planb.c linux/drivers/media/video/planb.c --- v2.4.2/linux/drivers/media/video/planb.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/planb.c Fri Mar 2 11:12:10 2001 @@ -2037,6 +2037,7 @@ static struct video_device planb_template= { + owner: THIS_MODULE, name: PLANB_DEVICE_NAME, type: VID_TYPE_OVERLAY, hardware: VID_HARDWARE_PLANB, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/pms.c linux/drivers/media/video/pms.c --- v2.4.2/linux/drivers/media/video/pms.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/pms.c Fri Mar 2 11:12:10 2001 @@ -672,13 +672,11 @@ static int pms_open(struct video_device *dev, int flags) { - MOD_INC_USE_COUNT; return 0; } static void pms_close(struct video_device *dev) { - MOD_DEC_USE_COUNT; } static long pms_write(struct video_device *v, const char *buf, unsigned long count, int noblock) @@ -902,6 +900,7 @@ struct video_device pms_template= { + owner: THIS_MODULE, name: "Mediavision PMS", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_PMS, @@ -935,14 +934,15 @@ 0xE4 }; - if(check_region(0x9A01,1)) + if (!request_region(0x9A01, 1, "Mediavision PMS config")) { printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n"); return -EBUSY; } - if(check_region(io_port,3)) + if (!request_region(io_port, 3, "Mediavision PMS")) { printk(KERN_WARNING "mediavision: I/O port %d in use.\n", io_port); + release_region(0x9A01, 1); return -EBUSY; } outb(0xB8, 0x9A01); /* Unlock */ @@ -961,16 +961,16 @@ else idec=0; - printk(KERN_INFO "PMS type is %d\n", idec); - if(idec==0) - return -ENODEV; + printk(KERN_INFO "PMS type is %d\n", idec); + if(idec == 0) { + release_region(io_port, 3); + release_region(0x9A01, 1); + return -ENODEV; + } /* * Ok we have a PMS of some sort */ - - request_region(io_port,3, "Mediavision PMS"); - request_region(0x9A01, 1, "Mediavision PMS config"); mvv_write(0x04, mem_base>>12); /* Set the memory area */ diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/stradis.c linux/drivers/media/video/stradis.c --- v2.4.2/linux/drivers/media/video/stradis.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/stradis.c Fri Mar 2 11:12:10 2001 @@ -672,7 +672,7 @@ /* auto mute off, power on, no de-emphasis */ /* I2S data up to 24-bit 64xFs internal SCLK */ I2CWrite(&(saa->i2c), 0x22, 0x01, 0x11, 2); - /* ATAPI mixer setings */ + /* ATAPI mixer settings */ I2CWrite(&(saa->i2c), 0x22, 0x02, 0x49, 2); /* attenuation left 3db */ I2CWrite(&(saa->i2c), 0x22, 0x03, 0x00, 2); @@ -1988,6 +1988,7 @@ /* template for video_device-structure */ static struct video_device saa_template = { + owner: THIS_MODULE, name: "SAA7146A", type: VID_TYPE_CAPTURE | VID_TYPE_OVERLAY, hardware: VID_HARDWARE_SAA7146, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/videodev.c linux/drivers/media/video/videodev.c --- v2.4.2/linux/drivers/media/video/videodev.c Tue Jan 2 16:45:37 2001 +++ linux/drivers/media/video/videodev.c Fri Mar 2 11:12:10 2001 @@ -166,6 +166,9 @@ goto error_out; } vfl->busy=1; /* In case vfl->open sleeps */ + + if(vfl->owner) + __MOD_INC_USE_COUNT(vfl->owner); unlock_kernel(); if(vfl->open) @@ -174,6 +177,9 @@ if(err) { vfl->busy=0; + if(vfl->owner) + __MOD_DEC_USE_COUNT(vfl->owner); + return err; } } @@ -195,6 +201,8 @@ if(vfl->close) vfl->close(vfl); vfl->busy=0; + if(vfl->owner) + __MOD_DEC_USE_COUNT(vfl->owner); unlock_kernel(); return 0; } diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/vino.c linux/drivers/media/video/vino.c --- v2.4.2/linux/drivers/media/video/vino.c Fri Nov 17 17:56:51 2000 +++ linux/drivers/media/video/vino.c Fri Mar 2 11:12:10 2001 @@ -203,13 +203,11 @@ static int vino_open(struct video_device *dev, int flags) { - MOD_INC_USE_COUNT; return 0; } static void vino_close(struct video_device *dev) { - MOD_DEC_USE_COUNT; } static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg) @@ -224,6 +222,7 @@ } static struct video_device vino_dev = { + owner: THIS_MODULE, name: "Vino IndyCam/TV", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_VINO, diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/zr36120.c linux/drivers/media/video/zr36120.c --- v2.4.2/linux/drivers/media/video/zr36120.c Wed Feb 21 18:20:24 2001 +++ linux/drivers/media/video/zr36120.c Fri Mar 2 11:12:10 2001 @@ -788,7 +788,6 @@ /* do the common part of all open's */ zoran_common_open(ztv, flags); - MOD_INC_USE_COUNT; return 0; } @@ -820,7 +819,6 @@ kfree( ztv->overinfo.overlay ); ztv->overinfo.overlay = 0; - MOD_DEC_USE_COUNT; } /* @@ -1482,6 +1480,7 @@ static struct video_device zr36120_template= { + owner: THIS_MODULE, name: "UNSET", type: VID_TYPE_TUNER|VID_TYPE_CAPTURE|VID_TYPE_OVERLAY, hardware: VID_HARDWARE_ZR36120, @@ -1541,7 +1540,6 @@ /* start read-ahead */ zoran_cap(ztv, 1); - MOD_INC_USE_COUNT; return 0; } @@ -1573,7 +1571,6 @@ item->memadr = 0; } - MOD_DEC_USE_COUNT; } /* @@ -1819,6 +1816,7 @@ static struct video_device vbi_template= { + owner: THIS_MODULE, name: "UNSET", type: VID_TYPE_CAPTURE|VID_TYPE_TELETEXT, hardware: VID_HARDWARE_ZR36120, diff -u --recursive --new-file v2.4.2/linux/drivers/net/8139too.c linux/drivers/net/8139too.c --- v2.4.2/linux/drivers/net/8139too.c Wed Feb 21 18:20:25 2001 +++ linux/drivers/net/8139too.c Fri Mar 2 11:02:14 2001 @@ -3,14 +3,15 @@ 8139too.c: A RealTek RTL-8139 Fast Ethernet driver for Linux. Maintained by Jeff Garzik + Copyright 2000,2001 Jeff Garzik Much code comes from Donald Becker's rtl8139.c driver, - versions 1.11 and older. This driver was originally based - on rtl8139.c version 1.07. Header of rtl8139.c version 1.11: + versions 1.13 and older. This driver was originally based + on rtl8139.c version 1.07. Header of rtl8139.c version 1.13: ---------- - Written 1997-2000 by Donald Becker. + Written 1997-2001 by Donald Becker. This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference. Drivers based on or derived from this @@ -74,7 +75,7 @@ Tobias Ringström - Rx interrupt status checking suggestion - Andrew Morton - (v0.9.13): clear blocked signals, avoid + Andrew Morton - Clear blocked signals, avoid buffer overrun setting current->comm. Submitting bug reports: @@ -150,7 +151,7 @@ #include -#define RTL8139_VERSION "0.9.13" +#define RTL8139_VERSION "0.9.15" #define MODNAME "8139too" #define RTL8139_DRIVER_NAME MODNAME " Fast Ethernet driver " RTL8139_VERSION #define PFX MODNAME ": " @@ -188,7 +189,9 @@ /* A few user-configurable values. */ /* media options */ -static int media[] = {-1, -1, -1, -1, -1, -1, -1, -1}; +#define MAX_UNITS 8 +static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 20; @@ -230,6 +233,7 @@ enum { + HAS_MII_XCVR = 0x010000, HAS_CHIP_XCVR = 0x020000, HAS_LNK_CHNG = 0x040000, }; @@ -237,6 +241,7 @@ #define RTL_MIN_IO_SIZE 0x80 #define RTL8139B_IO_SIZE 256 +#define RTL8129_CAPS HAS_MII_XCVR #define RTL8139_CAPS HAS_CHIP_XCVR|HAS_LNK_CHNG typedef enum { @@ -246,19 +251,24 @@ /*MPX5030,*/ DELTA8139, ADDTRON8139, + DFE538TX, + RTL8129, } board_t; /* indexed by board_t, above */ static struct { const char *name; + u32 hw_flags; } board_info[] __devinitdata = { - { "RealTek RTL8139 Fast Ethernet" }, - { "RealTek RTL8139B PCI/CardBus" }, - { "SMC1211TX EZCard 10/100 (RealTek RTL8139)" }, -/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)" },*/ - { "Delta Electronics 8139 10/100BaseTX" }, - { "Addtron Technolgy 8139 10/100BaseTX" }, + { "RealTek RTL8139 Fast Ethernet", RTL8139_CAPS }, + { "RealTek RTL8139B PCI/CardBus", RTL8139_CAPS }, + { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", RTL8139_CAPS }, +/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)", RTL8139_CAPS },*/ + { "Delta Electronics 8139 10/100BaseTX", RTL8139_CAPS }, + { "Addtron Technolgy 8139 10/100BaseTX", RTL8139_CAPS }, + { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS }, + { "RealTek RTL8129", RTL8129_CAPS }, }; @@ -269,6 +279,15 @@ /* {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/ {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 }, {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 }, + {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE538TX }, + {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 }, + + /* some crazy cards report invalid vendor ids like + * 0x0001 here. The other ids are valid and constant, + * so we simply don't match on the main vendor id. + */ + {PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 }, + {0,} }; MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl); @@ -504,7 +523,6 @@ struct rtl8139_private { - board_t board; void *mmio_addr; int drv_flags; struct pci_dev *pci_dev; @@ -512,15 +530,16 @@ unsigned char *rx_ring; unsigned int cur_rx; /* Index into the Rx buffer of next Rx pkt. */ unsigned int tx_flag; - unsigned int cur_tx; - unsigned int dirty_tx; + unsigned long cur_tx; + unsigned long dirty_tx; /* The saved address of a sent-in-place packet/buffer, for skfree(). */ struct ring_info tx_info[NUM_TX_DESC]; unsigned char *tx_buf[NUM_TX_DESC]; /* Tx bounce buffers */ unsigned char *tx_bufs; /* Tx bounce buffer region. */ dma_addr_t rx_ring_dma; dma_addr_t tx_bufs_dma; - char phys[4]; /* MII device addresses. */ + signed char phys[4]; /* MII device addresses. */ + u16 advertising; /* NWay media advertisement */ char twistie, twist_row, twist_col; /* Twister tune state. */ unsigned int full_duplex:1; /* Full-duplex operation requested. */ unsigned int duplex_lock:1; @@ -539,7 +558,8 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver"); MODULE_PARM (multicast_filter_limit, "i"); MODULE_PARM (max_interrupt_work, "i"); -MODULE_PARM (media, "1-" __MODULE_STRING(8) "i"); +MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); static int read_eeprom (void *ioaddr, int location, int addr_len); static int rtl8139_open (struct net_device *dev); @@ -658,6 +678,11 @@ SET_MODULE_OWNER(dev); tp = dev->priv; + /* enable device (incl. PCI PM wakeup and hotplug setup) */ + rc = pci_enable_device (pdev); + if (rc) + goto err_out; + pio_start = pci_resource_start (pdev, 0); pio_end = pci_resource_end (pdev, 0); pio_flags = pci_resource_flags (pdev, 0); @@ -697,25 +722,11 @@ goto err_out; } - /* make sure our PIO region in PCI space is available */ - if (!request_region (pio_start, pio_len, dev->name)) { - printk (KERN_ERR PFX "no I/O resource available, aborting\n"); - rc = -EBUSY; - goto err_out; - } - - /* make sure our MMIO region in PCI space is available */ - if (!request_mem_region (mmio_start, mmio_len, dev->name)) { - printk (KERN_ERR PFX "no mem resource available, aborting\n"); - rc = -EBUSY; - goto err_out_free_pio; - } - - /* enable device (incl. PCI PM wakeup), and bus-mastering */ - rc = pci_enable_device (pdev); + rc = pci_request_regions (pdev, dev->name); if (rc) - goto err_out_free_mmio; + goto err_out; + /* enable PCI bus-mastering */ pci_set_master (pdev); #ifdef USE_IO_OPS @@ -726,7 +737,7 @@ if (ioaddr == NULL) { printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); rc = -EIO; - goto err_out_free_mmio; + goto err_out_free_res; } #endif /* USE_IO_OPS */ @@ -792,11 +803,9 @@ assert (ioaddr > 0); #ifndef USE_IO_OPS iounmap (ioaddr); +err_out_free_res: #endif /* !USE_IO_OPS */ -err_out_free_mmio: - release_mem_region (mmio_start, mmio_len); -err_out_free_pio: - release_region (pio_start, pio_len); + pci_release_regions (pdev); err_out: unregister_netdev (dev); kfree (dev); @@ -813,7 +822,7 @@ int i, addr_len, option; void *ioaddr = NULL; static int board_idx = -1; - static int printed_version = 0; + static int printed_version; u8 tmp; DPRINTK ("ENTER\n"); @@ -862,10 +871,8 @@ tp = dev->priv; /* note: tp->chipset set in rtl8139_init_board */ - tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | - PCI_COMMAND_MASTER | RTL8139_CAPS; + tp->drv_flags = board_info[ent->driver_data].hw_flags; tp->pci_dev = pdev; - tp->board = ent->driver_data; tp->mmio_addr = ioaddr; spin_lock_init (&tp->lock); init_waitqueue_head (&tp->thr_wait); @@ -873,8 +880,6 @@ pdev->driver_data = dev; - tp->phys[0] = 32; - printk (KERN_INFO "%s: %s at 0x%lx, " "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " "IRQ %d\n", @@ -889,6 +894,30 @@ printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", dev->name, rtl_chip_info[tp->chipset].name); + /* Find the connected MII xcvrs. + Doing this in open() would allow detecting external xcvrs later, but + takes too much time. */ + if (tp->drv_flags & HAS_MII_XCVR) { + int phy, phy_idx = 0; + for (phy = 0; phy < 32 && phy_idx < sizeof(tp->phys); phy++) { + int mii_status = mdio_read(dev, phy, 1); + if (mii_status != 0xffff && mii_status != 0x0000) { + tp->phys[phy_idx++] = phy; + tp->advertising = mdio_read(dev, phy, 4); + printk(KERN_INFO "%s: MII transceiver %d status 0x%4.4x " + "advertising %4.4x.\n", + dev->name, phy, mii_status, tp->advertising); + } + } + if (phy_idx == 0) { + printk(KERN_INFO "%s: No MII transceivers found! Assuming SYM " + "transceiver.\n", + dev->name); + tp->phys[0] = 32; + } + } else + tp->phys[0] = 32; + /* Put the chip into low-power mode. */ RTL_W8_F (Cfg9346, Cfg9346_Unlock); @@ -899,21 +928,29 @@ RTL_W8_F (HltClk, 'H'); /* 'R' would leave the clock running. */ /* The lower four bits are the media type. */ - option = (board_idx >= ARRAY_SIZE(media)) ? 0 : media[board_idx]; + option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx]; if (option > 0) { - tp->full_duplex = (option & 0x200) ? 1 : 0; - tp->default_port = option & 15; + tp->full_duplex = (option & 0x210) ? 1 : 0; + tp->default_port = option & 0xFF; if (tp->default_port) tp->medialock = 1; } - + if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) + tp->full_duplex = full_duplex[board_idx]; if (tp->full_duplex) { - printk (KERN_INFO - "%s: Media type forced to Full Duplex.\n", - dev->name); - mdio_write (dev, tp->phys[0], 4, 0x141); + printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); + /* Changing the MII-advertised media because might prevent + re-connection. */ tp->duplex_lock = 1; } + if (tp->default_port) { + printk(KERN_INFO " Forcing %dMbs %s-duplex operation.\n", + (option & 0x20 ? 100 : 10), + (option & 0x10 ? "full" : "half")); + mdio_write(dev, tp->phys[0], 0, + ((option & 0x20) ? 0x2000 : 0) | /* 100mbps? */ + ((option & 0x10) ? 0x0100 : 0)); /* Full duplex? */ + } DPRINTK ("EXIT - returning 0\n"); return 0; @@ -938,10 +975,7 @@ iounmap (np->mmio_addr); #endif /* !USE_IO_OPS */ - release_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); - release_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); + pci_release_regions (pdev); #ifndef RTL8139_NDEBUG /* poison memory before freeing */ @@ -1035,7 +1069,7 @@ #define MDIO_WRITE0 (MDIO_DIR) #define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT) -#define mdio_delay() readb(mdio_addr) +#define mdio_delay(mdio_addr) readb(mdio_addr) static char mii_2_8139_map[8] = { @@ -1059,9 +1093,9 @@ for (i = 32; i >= 0; i--) { writeb (MDIO_WRITE1, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); writeb (MDIO_WRITE1 | MDIO_CLK, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); } DPRINTK ("EXIT\n"); @@ -1089,20 +1123,18 @@ int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0; writeb (MDIO_DIR | dataval, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); writeb (MDIO_DIR | dataval | MDIO_CLK, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); } /* Read the two transition, 16 data, and wire-idle bits. */ for (i = 19; i > 0; i--) { writeb (0, mdio_addr); - mdio_delay (); - retval = - (retval << 1) | ((readb (mdio_addr) & MDIO_DATA_IN) ? 1 - : 0); + mdio_delay (mdio_addr); + retval = (retval << 1) | ((readb (mdio_addr) & MDIO_DATA_IN) ? 1 : 0); writeb (MDIO_CLK, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); } DPRINTK ("EXIT, returning %d\n", (retval >> 1) & 0xffff); @@ -1115,19 +1147,19 @@ { struct rtl8139_private *tp = dev->priv; void *mdio_addr = tp->mmio_addr + Config4; - int mii_cmd = - (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; + int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; int i; DPRINTK ("ENTER\n"); if (phy_id > 31) { /* Really a 8139. Use internal registers. */ - if (location < 8 && mii_2_8139_map[location]) { - writew (value, - tp->mmio_addr + mii_2_8139_map[location]); - readw (tp->mmio_addr + mii_2_8139_map[location]); - } - DPRINTK ("EXIT after directly using 8139 internal regs\n"); + void *ioaddr = tp->mmio_addr; + if (location == 0) { + RTL_W8_F (Cfg9346, Cfg9346_Unlock); + RTL_W16_F (BasicModeCtrl, value); + RTL_W8_F (Cfg9346, Cfg9346_Lock); + } else if (location < 8 && mii_2_8139_map[location]) + RTL_W16_F (mii_2_8139_map[location], value); return; } mdio_sync (mdio_addr); @@ -1137,20 +1169,18 @@ int dataval = (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0; writeb (dataval, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); writeb (dataval | MDIO_CLK, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); } - /* Clear out extra bits. */ for (i = 2; i > 0; i--) { writeb (0, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); writeb (MDIO_CLK, mdio_addr); - mdio_delay (); + mdio_delay (mdio_addr); } - - DPRINTK ("EXIT\n"); + return; } @@ -1231,6 +1261,8 @@ if ((RTL_R8 (ChipCmd) & CmdReset) == 0) break; + /* unlock Config[01234] and BMCR register writes */ + RTL_W8_F (Cfg9346, Cfg9346_Unlock); /* Restore our idea of the MAC address. */ RTL_W32_F (MAC0 + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0))); RTL_W32_F (MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4))); @@ -1246,12 +1278,23 @@ /* Check this value: the documentation for IFG contradicts ifself. */ RTL_W32 (TxConfig, (TX_DMA_BURST << TxDMAShift)); - /* unlock Config[01234] and BMCR register writes */ - RTL_W8_F (Cfg9346, Cfg9346_Unlock); - udelay (10); - tp->cur_rx = 0; + /* This is check_duplex() */ + if (tp->phys[0] >= 0 || (tp->drv_flags & HAS_MII_XCVR)) { + u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5); + if (mii_reg5 == 0xffff) + ; /* Not there */ + else if ((mii_reg5 & 0x0100) == 0x0100 + || (mii_reg5 & 0x00C0) == 0x0040) + tp->full_duplex = 1; + printk(KERN_INFO"%s: Setting %s%s-duplex based on" + " auto-negotiated partner ability %4.4x.\n", dev->name, + mii_reg5 == 0 ? "" : + (mii_reg5 & 0x0180) ? "100mbps " : "10mbps ", + tp->full_duplex ? "full" : "half", mii_reg5); + } + if (tp->chipset >= CH_8139A) { tmp = RTL_R8 (Config1) & Config1Clear; tmp |= Cfg1_Driver_Load; @@ -1544,7 +1587,7 @@ RTL_W16 (IntrMask, 0x0000); /* Emit info to figure out what went wrong. */ - printk (KERN_DEBUG "%s: Tx queue start entry %d dirty entry %d.\n", + printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", dev->name, tp->cur_tx, tp->dirty_tx); for (i = 0; i < NUM_TX_DESC; i++) printk (KERN_DEBUG "%s: Tx descriptor %d is %8.8lx.%s\n", @@ -1559,6 +1602,8 @@ /* ...and finally, reset everything */ rtl8139_hw_start (dev); + + netif_wake_queue (dev); } @@ -1593,11 +1638,15 @@ tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); dev->trans_start = jiffies; + + spin_lock_irq (&tp->lock); + tp->cur_tx++; - mb(); if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) netif_stop_queue (dev); + spin_unlock_irq (&tp->lock); + DPRINTK ("%s: Queued Tx packet at %p size %u to slot %d.\n", dev->name, skb->data, skb->len, entry); @@ -1609,7 +1658,7 @@ struct rtl8139_private *tp, void *ioaddr) { - unsigned int dirty_tx, tx_left; + unsigned long dirty_tx, tx_left; assert (dev != NULL); assert (tp != NULL); @@ -1673,9 +1722,8 @@ #ifndef RTL8139_NDEBUG if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { - printk (KERN_ERR - "%s: Out-of-sync dirty pointer, %d vs. %d.\n", - dev->name, dirty_tx, tp->cur_tx); + printk (KERN_ERR "%s: Out-of-sync dirty pointer, %ld vs. %ld.\n", + dev->name, dirty_tx, tp->cur_tx); dirty_tx += NUM_TX_DESC; } #endif /* RTL8139_NDEBUG */ @@ -1683,7 +1731,6 @@ /* only wake the queue if we did work, and the queue is stopped */ if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; - mb(); if (netif_queue_stopped (dev)) netif_wake_queue (dev); } @@ -1917,8 +1964,6 @@ void *ioaddr = tp->mmio_addr; int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */ - spin_lock (&tp->lock); - do { status = RTL_R16 (IntrStatus); @@ -1949,7 +1994,7 @@ RxFIFOOver error (I got the feeling this depends on the CPU speed, lower CPU speed --> more errors). After clearing the RxOverflow bit the transfer of the - packet was repeated and all data are error free transfered */ + packet was repeated and all data are error free transferred */ RTL_W16_F (IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status); DPRINTK ("%s: interrupt status=%#4.4x new intstat=%#4.4x.\n", @@ -1970,8 +2015,11 @@ if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver)) /* Rx interrupt */ rtl8139_rx_interrupt (dev, tp, ioaddr); - if (status & (TxOK | TxErr)) + if (status & (TxOK | TxErr)) { + spin_lock (&tp->lock); rtl8139_tx_interrupt (dev, tp, ioaddr); + spin_unlock (&tp->lock); + } boguscnt--; } while (boguscnt > 0); @@ -1986,8 +2034,6 @@ RTL_W16 (IntrStatus, 0xffff); } - spin_unlock (&tp->lock); - DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, RTL_R16 (IntrStatus)); } @@ -2074,7 +2120,19 @@ break; } - mdio_write (dev, data[0], data[1] & 0x1f, data[2]); + if (data[0] == tp->phys[0]) { + u16 value = data[2]; + switch (data[1]) { + case 0: + /* Check for autonegotiation on or reset. */ + tp->medialock = (value & 0x9000) ? 0 : 1; + if (tp->medialock) + tp->full_duplex = (value & 0x0100) ? 1 : 0; + break; + case 4: tp->advertising = value; break; + } + } + mdio_write(dev, data[0], data[1] & 0x1f, data[2]); break; default: @@ -2095,8 +2153,10 @@ DPRINTK ("ENTER\n"); if (netif_running(dev)) { + spin_lock_irq (&tp->lock); tp->stats.rx_missed_errors += RTL_R32 (RxMissed); RTL_W32 (RxMissed, 0); + spin_unlock_irq (&tp->lock); } DPRINTK ("EXIT\n"); @@ -2117,12 +2177,11 @@ unsigned char current_octet = *data++; int bit; for (bit = 0; bit < 8; bit++, current_octet >>= 1) - crc = (crc << 1) ^ - ((crc < 0) ^ (current_octet & 1) ? + crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0); } - DPRINTK ("EXIT\n"); + DPRINTK ("EXIT, returning %u\n", crc); return crc; } @@ -2131,6 +2190,7 @@ { struct rtl8139_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; + unsigned long flags; u32 mc_filter[2]; /* Multicast hash filter */ int i, rx_mode; u32 tmp; @@ -2164,9 +2224,7 @@ mc_filter); } - /* if called from irq handler, lock already acquired */ - if (!in_irq ()) - spin_lock_irq (&tp->lock); + spin_lock_irqsave (&tp->lock, flags); /* We can safely update without stopping the chip. */ tmp = rtl8139_rx_config | rx_mode | @@ -2175,8 +2233,7 @@ RTL_W32_F (MAR0 + 0, mc_filter[0]); RTL_W32_F (MAR0 + 4, mc_filter[1]); - if (!in_irq ()) - spin_unlock_irq (&tp->lock); + spin_unlock_irqrestore (&tp->lock, flags); DPRINTK ("EXIT\n"); } diff -u --recursive --new-file v2.4.2/linux/drivers/net/Config.in linux/drivers/net/Config.in --- v2.4.2/linux/drivers/net/Config.in Wed Feb 21 18:20:25 2001 +++ linux/drivers/net/Config.in Fri Mar 2 11:02:14 2001 @@ -142,12 +142,11 @@ dep_tristate ' EtherExpressPro/100 support' CONFIG_EEPRO100 $CONFIG_PCI dep_mbool ' Enable Power Management (EXPERIMENTAL)' CONFIG_EEPRO100_PM $CONFIG_EEPRO100 $CONFIG_EXPERIMENTAL dep_tristate ' Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390 $CONFIG_EISA $CONFIG_EXPERIMENTAL - dep_tristate ' National Semiconductor DP83810 series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI + dep_tristate ' National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI dep_tristate ' PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI dep_tristate ' Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' RealTek RTL-8139 PCI Fast Ethernet Adapter support' CONFIG_8139TOO $CONFIG_PCI - dep_tristate ' RealTek 8129 (not 8019/8029/8139!) support (EXPERIMENTAL)' CONFIG_RTL8129 $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' SiS 900/7016 PCI Fast Ethernet Adapter support' CONFIG_SIS900 $CONFIG_PCI dep_tristate ' SMC EtherPower II' CONFIG_EPIC100 $CONFIG_PCI dep_tristate ' Sundance Alta support' CONFIG_SUNDANCE $CONFIG_PCI diff -u --recursive --new-file v2.4.2/linux/drivers/net/Makefile linux/drivers/net/Makefile --- v2.4.2/linux/drivers/net/Makefile Sat Feb 3 19:51:28 2001 +++ linux/drivers/net/Makefile Fri Mar 2 11:02:14 2001 @@ -163,7 +163,6 @@ obj-$(CONFIG_3C515) += 3c515.o obj-$(CONFIG_EEXPRESS) += eexpress.o obj-$(CONFIG_EEXPRESS_PRO) += eepro.o -obj-$(CONFIG_RTL8129) += rtl8129.o obj-$(CONFIG_8139TOO) += 8139too.o obj-$(CONFIG_WAVELAN) += wavelan.o obj-$(CONFIG_ARLAN) += arlan.o arlan-proc.o diff -u --recursive --new-file v2.4.2/linux/drivers/net/defxx.c linux/drivers/net/defxx.c --- v2.4.2/linux/drivers/net/defxx.c Wed Feb 21 18:20:26 2001 +++ linux/drivers/net/defxx.c Fri Mar 2 11:02:15 2001 @@ -195,6 +195,8 @@ * Jun 2000 jgarzik PCI and resource alloc cleanups * Jul 2000 tjeerd Much cleanup and some bug fixes * Sep 2000 tjeerd Fix leak on unload, cosmetic code cleanup + * Feb 2001 Skb allocation fixes + * Feb 2001 davej PCI enable cleanups. */ /* Include files */ @@ -225,7 +227,7 @@ /* Version information string - should be updated prior to each new release!!! */ static char version[] __devinitdata = - "defxx.c:v1.05d 2000/09/05 Lawrence V. Stefani and others\n"; + "defxx.c:v1.05e 2001/02/03 Lawrence V. Stefani and others\n"; #define DYNAMIC_BUFFERS 1 @@ -242,7 +244,7 @@ static void dfx_bus_config_check(DFX_board_t *bp); static int dfx_driver_init(struct net_device *dev); -static int dfx_adap_init(DFX_board_t *bp); +static int dfx_adap_init(DFX_board_t *bp, int get_buffers); static int dfx_open(struct net_device *dev); static int dfx_close(struct net_device *dev); @@ -264,8 +266,9 @@ static int dfx_hw_adap_state_rd(DFX_board_t *bp); static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type); -static void dfx_rcv_init(DFX_board_t *bp); +static int dfx_rcv_init(DFX_board_t *bp, int get_buffers); static void dfx_rcv_queue_process(DFX_board_t *bp); +static void dfx_rcv_flush(DFX_board_t *bp); static int dfx_xmt_queue_pkt(struct sk_buff *skb, struct net_device *dev); static int dfx_xmt_done(DFX_board_t *bp); @@ -339,7 +342,6 @@ u16 port = bp->base_addr + offset; outb(data, port); - return; } static inline void dfx_port_read_byte( @@ -352,7 +354,6 @@ u16 port = bp->base_addr + offset; *data = inb(port); - return; } static inline void dfx_port_write_long( @@ -365,7 +366,6 @@ u16 port = bp->base_addr + offset; outl(data, port); - return; } static inline void dfx_port_read_long( @@ -378,7 +378,6 @@ u16 port = bp->base_addr + offset; *data = inl(port); - return; } @@ -395,6 +394,7 @@ * * Arguments: * pdev - pointer to pci device information (NULL for EISA) + * ioaddr - pointer to port (NULL for PCI) * * Functional Description: * @@ -415,6 +415,7 @@ struct net_device *dev; DFX_board_t *bp; /* board pointer */ static int version_disp; + int err; if (!version_disp) /* display version info if adapter is found */ { @@ -426,18 +427,27 @@ * init_fddidev() allocates a device structure with private data, clears the device structure and private data, * and calls fddi_setup() and register_netdev(). Not much left to do for us here. */ - dev = init_fddidev( NULL, sizeof(*bp)); - + dev = init_fddidev(NULL, sizeof(*bp)); if (!dev) { printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n"); return -ENOMEM; } - bp = (DFX_board_t*)dev->priv; + /* Enable PCI device. */ + if (pdev != NULL) { + err = pci_enable_device (pdev); + if (err) goto err_out; + ioaddr = pci_resource_start (pdev, 1); + } + + SET_MODULE_OWNER(dev); + + bp = dev->priv; if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) { printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n", dev->name, PFI_K_CSR_IO_LEN, ioaddr); + err = -EBUSY; goto err_out; } @@ -462,13 +472,13 @@ bp->bus_type = DFX_BUS_TYPE_PCI; bp->pci_dev = pdev; pdev->driver_data = dev; - if (pci_enable_device (pdev)) - goto err_out_region; pci_set_master (pdev); } - if (dfx_driver_init(dev) != DFX_K_SUCCESS) + if (dfx_driver_init(dev) != DFX_K_SUCCESS) { + err = -ENODEV; goto err_out_region; + } return 0; @@ -477,12 +487,12 @@ err_out: unregister_netdev(dev); kfree(dev); - return -ENODEV; + return err; } static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { - return dfx_init_one_pci_or_eisa(pdev, pci_resource_start (pdev, 1)); + return dfx_init_one_pci_or_eisa(pdev, 0); } static int __init dfx_eisa_init(void) @@ -642,7 +652,6 @@ dfx_port_write_long(bp, PFI_K_REG_MODE_CTRL, (PFI_MODE_M_PDQ_INT_ENB | PFI_MODE_M_DMA_ENB)); } - return; } @@ -737,7 +746,6 @@ } } } - return; } @@ -977,6 +985,7 @@ * * Arguments: * bp - pointer to board information + * get_buffers - non-zero if buffers to be allocated * * Functional Description: * Issues the low-level firmware/hardware calls necessary to bring @@ -996,7 +1005,7 @@ * upon a successful return of this routine. */ -static int dfx_adap_init(DFX_board_t *bp) +static int dfx_adap_init(DFX_board_t *bp, int get_buffers) { DBG_printk("In dfx_adap_init...\n"); @@ -1131,9 +1140,23 @@ return(DFX_K_FAILURE); } + /* + * Remove any existing dynamic buffers (i.e. if the adapter is being + * reinitialized) + */ + + if (get_buffers) + dfx_rcv_flush(bp); + /* Initialize receive descriptor block and produce buffers */ - dfx_rcv_init(bp); + if (dfx_rcv_init(bp, get_buffers)) + { + printk("%s: Receive buffer allocation failed\n", bp->dev->name); + if (get_buffers) + dfx_rcv_flush(bp); + return(DFX_K_FAILURE); + } /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */ @@ -1141,6 +1164,8 @@ if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) { printk("%s: Start command failed\n", bp->dev->name); + if (get_buffers) + dfx_rcv_flush(bp); return(DFX_K_FAILURE); } @@ -1183,19 +1208,17 @@ static int dfx_open(struct net_device *dev) { + int ret; DFX_board_t *bp = (DFX_board_t *)dev->priv; DBG_printk("In dfx_open...\n"); - MOD_INC_USE_COUNT; - /* Register IRQ - support shared interrupts by passing device ptr */ - if (request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev)) - { + ret = request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev); + if (ret) { printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq); - MOD_DEC_USE_COUNT; - return -EAGAIN; + return ret; } /* @@ -1228,11 +1251,10 @@ /* Reset and initialize adapter */ bp->reset_type = PI_PDATA_A_RESET_M_SKIP_ST; /* skip self-test */ - if (dfx_adap_init(bp) != DFX_K_SUCCESS) + if (dfx_adap_init(bp, 1) != DFX_K_SUCCESS) { printk(KERN_ERR "%s: Adapter open failed!\n", dev->name); free_irq(dev->irq, dev); - MOD_DEC_USE_COUNT; return -EAGAIN; } @@ -1318,6 +1340,10 @@ memset(bp->cons_block_virt, 0, sizeof(PI_CONSUMER_BLOCK)); + /* Release all dynamically allocate skb in the receive ring. */ + + dfx_rcv_flush(bp); + /* Clear device structure flags */ netif_stop_queue(dev); @@ -1326,7 +1352,6 @@ free_irq(dev->irq, dev); - MOD_DEC_USE_COUNT; return(0); } @@ -1412,7 +1437,6 @@ printk("%s: Halt ID: Unknown (code = %X)\n", bp->dev->name, halt_id); break; } - return; } @@ -1504,7 +1528,7 @@ bp->link_available = PI_K_FALSE; /* link is no longer available */ bp->reset_type = 0; /* rerun on-board diagnostics */ printk("%s: Resetting adapter...\n", bp->dev->name); - if (dfx_adap_init(bp) != DFX_K_SUCCESS) + if (dfx_adap_init(bp, 0) != DFX_K_SUCCESS) { printk("%s: Adapter reset failed! Disabling adapter interrupts.\n", bp->dev->name); dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_DISABLE_ALL_INTS); @@ -1552,7 +1576,7 @@ bp->link_available = PI_K_FALSE; /* link is no longer available */ bp->reset_type = 0; /* rerun on-board diagnostics */ printk("%s: Resetting adapter...\n", bp->dev->name); - if (dfx_adap_init(bp) != DFX_K_SUCCESS) + if (dfx_adap_init(bp, 0) != DFX_K_SUCCESS) { printk("%s: Adapter reset failed! Disabling adapter interrupts.\n", bp->dev->name); dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_DISABLE_ALL_INTS); @@ -1565,7 +1589,6 @@ bp->link_available = PI_K_TRUE; /* set link available flag */ } } - return; } @@ -1640,7 +1663,6 @@ if (port_status & PI_PSTATUS_M_TYPE_0_PENDING) dfx_int_type_0_process(bp); /* process Type 0 interrupts */ - return; } @@ -1732,7 +1754,6 @@ } spin_unlock(&bp->lock); - return; } @@ -2039,7 +2060,6 @@ { DBG_printk("%s: Adapter filters updated!\n", dev->name); } - return; } @@ -2540,7 +2560,6 @@ /* Deassert reset */ dfx_port_write_long(bp, PI_PDQ_K_REG_PORT_RESET, 0); - return; } @@ -2631,7 +2650,28 @@ return(DFX_K_HW_TIMEOUT); return(DFX_K_SUCCESS); } + +/* + * ================= + * = dfx_alloc_skb = + * ================= + * + * Overview: + * Allocate an skbuff for sending. + * + * Functional Description: + * Same as dev_alloc_skb(), but it may sleep. + */ +static inline struct sk_buff *dfx_alloc_skb(unsigned int length) +{ + struct sk_buff *skb; + + skb = alloc_skb(length + 16, GFP_BUFFER); + if (skb) + skb_reserve(skb, 16); + return skb; +} /* * Align an sk_buff to a boundary power of 2 @@ -2662,6 +2702,7 @@ * * Arguments: * bp - pointer to board information + * get_buffers - non-zero if buffers to be allocated * * Functional Description: * This routine can be called during dfx_adap_init() or during an adapter @@ -2669,7 +2710,10 @@ * LLC Host queue receive buffers. * * Return Codes: - * None + * Return 0 on success or -ENOMEM if buffer allocation failed (when using + * dynamic buffer allocation). If the buffer allocation failed, the + * already allocated buffers will not be released and the caller should do + * this. * * Assumptions: * The PDQ has been reset and the adapter and driver maintained Type 2 @@ -2680,7 +2724,7 @@ * is notified. */ -static void dfx_rcv_init(DFX_board_t *bp) +static int dfx_rcv_init(DFX_board_t *bp, int get_buffers) { int i, j; /* used in for loop */ @@ -2702,14 +2746,16 @@ * driver initialization when we allocated memory for the receive buffers. */ + if (get_buffers) { #ifdef DYNAMIC_BUFFERS for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++) for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post) { - struct sk_buff *newskb; + struct sk_buff *newskb = dfx_alloc_skb(NEW_SKB_SIZE); + if (!newskb) + return -ENOMEM; bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP | ((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN)); - newskb = dev_alloc_skb(NEW_SKB_SIZE); /* * align to 128 bytes for compatibility with * the old EISA boards. @@ -2733,12 +2779,13 @@ bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX)); } #endif + } /* Update receive producer and Type 2 register */ bp->rcv_xmt_reg.index.rcv_prod = bp->rcv_bufs_to_post; dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword); - return; + return 0; } @@ -2833,7 +2880,7 @@ bp->p_rcv_buff_va[entry] = (char *)newskb; bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data); } else - skb = 0; + skb = NULL; } else #endif skb = dev_alloc_skb(pkt_len+3); /* alloc new buffer to pass up, add room for PRH */ @@ -2858,6 +2905,7 @@ skb->dev = bp->dev; /* pass up device pointer */ skb->protocol = fddi_type_trans(skb, bp->dev); + bp->rcv_total_bytes += skb->len; netif_rx(skb); /* Update the rcv counters */ @@ -2865,8 +2913,6 @@ bp->rcv_total_frames++; if (*(p_buff + RCV_BUFF_K_DA) & 0x01) bp->rcv_multicast_frames++; - - bp->rcv_total_bytes += skb->len; } } } @@ -2882,7 +2928,6 @@ bp->rcv_xmt_reg.index.rcv_prod += 1; bp->rcv_xmt_reg.index.rcv_comp += 1; } - return; } @@ -3183,6 +3228,54 @@ /* * ================= + * = dfx_rcv_flush = + * ================= + * + * Overview: + * Remove all skb's in the receive ring. + * + * Returns: + * None + * + * Arguments: + * bp - pointer to board information + * + * Functional Description: + * Free's all the dynamically allocated skb's that are + * currently attached to the device receive ring. This + * function is typically only used when the device is + * initialized or reinitialized. + * + * Return Codes: + * None + * + * Side Effects: + * None + */ +#ifdef DYNAMIC_BUFFERS +static void dfx_rcv_flush( DFX_board_t *bp ) + { + int i, j; + + for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++) + for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post) + { + struct sk_buff *skb; + skb = (struct sk_buff *)bp->p_rcv_buff_va[i+j]; + if (skb) + dev_kfree_skb(skb); + bp->p_rcv_buff_va[i+j] = NULL; + } + + } +#else +static inline void dfx_rcv_flush( DFX_board_t *bp ) +{ +} +#endif /* DYNAMIC_BUFFERS */ + +/* + * ================= * = dfx_xmt_flush = * ================= * @@ -3257,7 +3350,6 @@ prod_cons = (u32)(bp->cons_block_virt->xmt_rcv_data & ~PI_CONS_M_XMT_INDEX); prod_cons |= (u32)(bp->rcv_xmt_reg.index.xmt_prod << PI_CONS_V_XMT_INDEX); bp->cons_block_virt->xmt_rcv_data = prod_cons; - return; } static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev) diff -u --recursive --new-file v2.4.2/linux/drivers/net/epic100.c linux/drivers/net/epic100.c --- v2.4.2/linux/drivers/net/epic100.c Wed Feb 21 18:20:26 2001 +++ linux/drivers/net/epic100.c Fri Mar 2 11:02:15 2001 @@ -1,6 +1,6 @@ /* epic100.c: A SMC 83c170 EPIC/100 Fast Ethernet driver for Linux. */ /* - Written/copyright 1997-2000 by Donald Becker. + Written/copyright 1997-2001 by Donald Becker. This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference. @@ -37,15 +37,19 @@ * Fix locking (jgarzik) * Limit 83c175 probe to ethernet-class PCI devices (rgooch) + LK1.1.6: + * Merge becker version 1.11 + * Move pci_enable_device before any PCI BAR len checks + */ /* These identify the driver base version and may not be removed. */ static const char version[] = -"epic100.c:v1.09 5/29/2000 Written by Donald Becker \n"; +"epic100.c:v1.11 1/7/2001 Written by Donald Becker \n"; static const char version2[] = " http://www.scyld.com/network/epic100.html\n"; static const char version3[] = -" (unofficial 2.4.x kernel port, version 1.1.5, September 7, 2000)\n"; +" (unofficial 2.4.x kernel port, version 1.1.6, January 11, 2001)\n"; /* The user-configurable values. These may be modified when a driver module is loaded.*/ @@ -61,7 +65,7 @@ /* Set the copy breakpoint for the copy-only-tiny-frames scheme. Setting to > 1518 effectively disables this feature. */ -static int rx_copybreak = 0; +static int rx_copybreak; /* Operational parameters that are set at compile time. */ @@ -73,6 +77,8 @@ #define TX_RING_SIZE 16 #define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */ #define RX_RING_SIZE 32 +#define TX_TOTAL_SIZE TX_RING_SIZE*sizeof(struct epic_tx_desc) +#define RX_TOTAL_SIZE RX_RING_SIZE*sizeof(struct epic_rx_desc) /* Operational parameters that usually are not changed. */ /* Time in jiffies before concluding the transmitter is hung. */ @@ -161,14 +167,13 @@ enum chip_capability_flags { MII_PWRDWN=1, TYPE2_INTR=2, NO_MII=4 }; #define EPIC_TOTAL_SIZE 0x100 +#define USE_IO_OPS 1 #ifdef USE_IO_OPS #define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_IO|PCI_ADDR0 #else #define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_MEM|PCI_ADDR1 #endif -#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr)) - typedef enum { SMSC_83C170_0, SMSC_83C170, @@ -185,7 +190,7 @@ /* indexed by chip_t */ -static struct epic_chip_info epic_chip_info[] __devinitdata = { +static struct epic_chip_info pci_id_tbl[] = { { "SMSC EPIC/100 83c170", EPIC_IOTYPE, EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN }, { "SMSC EPIC/100 83c170", @@ -269,16 +274,18 @@ DescOwn=0x8000, }; - +#define PRIV_ALIGN 15 /* Required alignment mask */ struct epic_private { - /* Tx and Rx rings first so that they remain paragraph aligned. */ - struct epic_rx_desc rx_ring[RX_RING_SIZE]; - struct epic_tx_desc tx_ring[TX_RING_SIZE]; + struct epic_rx_desc *rx_ring; + struct epic_tx_desc *tx_ring; /* The saved address of a sent-in-place packet/buffer, for skfree(). */ struct sk_buff* tx_skbuff[TX_RING_SIZE]; /* The addresses of receive-in-place skbuffs. */ struct sk_buff* rx_skbuff[RX_RING_SIZE]; + dma_addr_t tx_ring_dma; + dma_addr_t rx_ring_dma; + /* Ring pointers. */ spinlock_t lock; /* Group with Tx control cache line. */ unsigned int cur_tx, dirty_tx; @@ -290,7 +297,7 @@ long last_rx_time; /* Last Rx, in jiffies. */ struct pci_dev *pci_dev; /* PCI bus location. */ - int chip_flags; + int chip_id, chip_flags; struct net_device_stats stats; struct timer_list timer; /* Media selection timer. */ @@ -301,7 +308,7 @@ int mii_phy_cnt; unsigned int tx_full:1; /* The Tx queue is full. */ unsigned int full_duplex:1; /* Current duplex setting. */ - unsigned int force_fd:1; /* Full-duplex operation requested. */ + unsigned int duplex_lock:1; /* Duplex forced by the user. */ unsigned int default_port:4; /* Last dev->if_port value. */ unsigned int media2:4; /* Secondary monitored media port. */ unsigned int medialock:1; /* Don't sense media type. */ @@ -310,8 +317,8 @@ static int epic_open(struct net_device *dev); static int read_eeprom(long ioaddr, int location); -static int mdio_read(long ioaddr, int phy_id, int location); -static void mdio_write(long ioaddr, int phy_id, int location, int value); +static int mdio_read(struct net_device *dev, int phy_id, int location); +static void mdio_write(struct net_device *dev, int phy_id, int loc, int val); static void epic_restart(struct net_device *dev); static void epic_timer(unsigned long data); static void epic_tx_timeout(struct net_device *dev); @@ -330,13 +337,15 @@ const struct pci_device_id *ent) { static int card_idx = -1; - static int printed_version = 0; + static int printed_version; + long ioaddr; + int chip_idx = (int) ent->driver_data; + int irq; struct net_device *dev; struct epic_private *ep; int i, option = 0, duplex = 0; - struct epic_chip_info *ci = &epic_chip_info[ent->driver_data]; - long ioaddr; - int chip_idx = (int) ent->driver_data; + void *ring_space; + dma_addr_t ring_dma; card_idx++; @@ -344,16 +353,16 @@ printk (KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s", version, version2, version3); - if ((pci_resource_len(pdev, 0) < ci->io_size) || - (pci_resource_len(pdev, 1) < ci->io_size)) { + i = pci_enable_device(pdev); + if (i) + return i; + irq = pdev->irq; + + if (pci_resource_len(pdev, 0) < pci_id_tbl[chip_idx].io_size) { printk (KERN_ERR "card %d: no PCI region space\n", card_idx); return -ENODEV; } - i = pci_enable_device(pdev); - if (i) - return i; - pci_set_master(pdev); dev = init_etherdev(NULL, sizeof (*ep)); @@ -361,20 +370,10 @@ printk (KERN_ERR "card %d: no memory for eth device\n", card_idx); return -ENOMEM; } + SET_MODULE_OWNER(dev); - /* request 100% of both regions 0 and 1, just to make - * sure noone else steals our regions while we are talking - * to them */ - if (!request_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0), dev->name)) { - printk (KERN_ERR "epic100 %d: I/O region busy\n", card_idx); + if (pci_request_regions(pdev, dev->name)) goto err_out_free_netdev; - } - if (!request_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1), dev->name)) { - printk (KERN_ERR "epic100 %d: I/O region busy\n", card_idx); - goto err_out_free_pio; - } #ifdef USE_IO_OPS ioaddr = pci_resource_start (pdev, 0); @@ -383,11 +382,26 @@ ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); if (!ioaddr) { printk (KERN_ERR "epic100 %d: ioremap failed\n", card_idx); - goto err_out_free_mmio; + goto err_out_free_res; } #endif - if (dev->mem_start) { + pci_set_drvdata(pdev, dev); + ep = dev->priv; + + ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma); + if (!ring_space) + goto err_out_iounmap; + ep->tx_ring = (struct epic_tx_desc *)ring_space; + ep->tx_ring_dma = ring_dma; + + ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma); + if (!ring_space) + goto err_out_unmap_tx; + ep->rx_ring = (struct epic_rx_desc *)ring_space; + ep->rx_ring_dma = ring_dma; + + if (dev->mem_start && dev->mem_start != ~0) { option = dev->mem_start; duplex = (dev->mem_start & 16) ? 1 : 0; } else if (card_idx >= 0 && card_idx < MAX_UNITS) { @@ -397,18 +411,13 @@ duplex = full_duplex[card_idx]; } - pdev->driver_data = dev; - dev->base_addr = ioaddr; - dev->irq = pdev->irq; + dev->irq = irq; - ep = dev->priv; - ep->pci_dev = pdev; - ep->chip_flags = ci->drv_flags; spin_lock_init (&ep->lock); printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", - dev->name, ci->name, ioaddr, dev->irq); + dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq); /* Bring the chip out of low-power mode. */ outl(0x4200, ioaddr + GENCTL); @@ -421,7 +430,7 @@ outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); outl(0x0200, ioaddr + GENCTL); - /* This could also be read from the EEPROM. */ + /* Note: the '175 does not have a serial EEPROM. */ for (i = 0; i < 3; i++) ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4)); @@ -436,27 +445,31 @@ i % 16 == 15 ? "\n" : ""); } + ep->pci_dev = pdev; + ep->chip_id = chip_idx; + ep->chip_flags = pci_id_tbl[chip_idx].drv_flags; + /* Find the connected MII xcvrs. Doing this in open() would allow detecting external xcvrs later, but takes much time and no cards have external MII. */ { int phy, phy_idx = 0; for (phy = 1; phy < 32 && phy_idx < sizeof(ep->phys); phy++) { - int mii_status = mdio_read(ioaddr, phy, 1); + int mii_status = mdio_read(dev, phy, 1); if (mii_status != 0xffff && mii_status != 0x0000) { ep->phys[phy_idx++] = phy; printk(KERN_INFO "%s: MII transceiver #%d control " "%4.4x status %4.4x.\n", - dev->name, phy, mdio_read(ioaddr, phy, 0), mii_status); + dev->name, phy, mdio_read(dev, phy, 0), mii_status); } } ep->mii_phy_cnt = phy_idx; if (phy_idx != 0) { phy = ep->phys[0]; - ep->advertising = mdio_read(ioaddr, phy, 4); - printk( KERN_INFO "%s: Autonegotiation advertising %4.4x link " - "partner %4.4x.\n", - dev->name, ep->advertising, mdio_read(ioaddr, phy, 5)); + ep->advertising = mdio_read(dev, phy, 4); + printk(KERN_INFO "%s: Autonegotiation advertising %4.4x link " + "partner %4.4x.\n", + dev->name, ep->advertising, mdio_read(dev, phy, 5)); } else if ( ! (ep->chip_flags & NO_MII)) { printk(KERN_WARNING "%s: ***WARNING***: No MII transceiver found!\n", dev->name); @@ -471,7 +484,11 @@ outl(0x0008, ioaddr + GENCTL); /* The lower four bits are the media type. */ - ep->force_fd = duplex; + if (duplex) { + ep->duplex_lock = ep->full_duplex = 1; + printk(KERN_INFO "%s: Forced full duplex operation requested.\n", + dev->name); + } dev->if_port = ep->default_port = option; if (ep->default_port) ep->medialock = 1; @@ -488,14 +505,14 @@ return 0; +err_out_unmap_tx: + pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); +err_out_iounmap: #ifndef USE_IO_OPS -err_out_free_mmio: - release_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); + iounmap(ioaddr); +err_out_free_res: #endif -err_out_free_pio: - release_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); + pci_release_regions(pdev); err_out_free_netdev: unregister_netdev(dev); kfree(dev); @@ -514,7 +531,7 @@ #define EE_ENB (0x0001 | EE_CS) /* Delay between EEPROM clock transitions. - No extra delay is needed with 33Mhz PCI, but 66Mhz is untested. + This serves to flush the operation to the PCI bus. */ #define eeprom_delay() inl(ee_addr) @@ -561,24 +578,34 @@ #define MII_READOP 1 #define MII_WRITEOP 2 -static int mdio_read(long ioaddr, int phy_id, int location) +static int mdio_read(struct net_device *dev, int phy_id, int location) { + long ioaddr = dev->base_addr; + int read_cmd = (phy_id << 9) | (location << 4) | MII_READOP; int i; - outl((phy_id << 9) | (location << 4) | MII_READOP, ioaddr + MIICtrl); - /* Typical operation takes < 50 ticks. */ - for (i = 4000; i > 0; i--) - if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) + outl(read_cmd, ioaddr + MIICtrl); + /* Typical operation takes 25 loops. */ + for (i = 400; i > 0; i--) + if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { + /* Work around read failure bug. */ + if (phy_id == 1 && location < 6 + && inw(ioaddr + MIIData) == 0xffff) { + outl(read_cmd, ioaddr + MIICtrl); + continue; + } return inw(ioaddr + MIIData); + } return 0xffff; } -static void mdio_write(long ioaddr, int phy_id, int location, int value) +static void mdio_write(struct net_device *dev, int phy_id, int loc, int value) { + long ioaddr = dev->base_addr; int i; outw(value, ioaddr + MIIData); - outl((phy_id << 9) | (location << 4) | MII_WRITEOP, ioaddr + MIICtrl); + outl((phy_id << 9) | (loc << 4) | MII_WRITEOP, ioaddr + MIICtrl); for (i = 10000; i > 0; i--) { if ((inl(ioaddr + MIICtrl) & MII_WRITEOP) == 0) break; @@ -589,27 +616,21 @@ static int epic_open(struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; int i; int retval; - ep->full_duplex = ep->force_fd; - /* Soft reset the chip. */ outl(0x4001, ioaddr + GENCTL); - MOD_INC_USE_COUNT; - - if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev))) { - MOD_DEC_USE_COUNT; + if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev))) return retval; - } epic_init_ring(dev); outl(0x4000, ioaddr + GENCTL); - /* This next magic! line by Ken Yamaguchi.. ?? */ + /* This magic is documented in SMSC app note 7.15 */ outl(0x0008, ioaddr + TEST1); /* Pull the chip out of low-power mode, enable interrupts, and set for @@ -639,21 +660,21 @@ if (media2miictl[dev->if_port & 15]) { if (ep->mii_phy_cnt) - mdio_write(ioaddr, ep->phys[0], 0, media2miictl[dev->if_port&15]); + mdio_write(dev, ep->phys[0], 0, media2miictl[dev->if_port&15]); if (dev->if_port == 1) { if (debug > 1) printk(KERN_INFO "%s: Using the 10base2 transceiver, MII " "status %4.4x.\n", - dev->name, mdio_read(ioaddr, ep->phys[0], 1)); + dev->name, mdio_read(dev, ep->phys[0], 1)); outl(0x13, ioaddr + MIICfg); } } else { - int mii_reg5 = mdio_read(ioaddr, ep->phys[0], 5); + int mii_reg5 = mdio_read(dev, ep->phys[0], 5); if (mii_reg5 != 0xffff) { if ((mii_reg5 & 0x0100) || (mii_reg5 & 0x01C0) == 0x0040) ep->full_duplex = 1; else if (! (mii_reg5 & 0x4000)) - mdio_write(ioaddr, ep->phys[0], 0, 0x1200); + mdio_write(dev, ep->phys[0], 0, 0x1200); if (debug > 1) printk(KERN_INFO "%s: Setting %s-duplex based on MII xcvr %d" " register read of %4.4x.\n", dev->name, @@ -663,8 +684,8 @@ } outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl); - outl(virt_to_bus(ep->rx_ring), ioaddr + PRxCDAR); - outl(virt_to_bus(ep->tx_ring), ioaddr + PTxCDAR); + outl(ep->rx_ring_dma, ioaddr + PRxCDAR); + outl(ep->tx_ring_dma, ioaddr + PTxCDAR); /* Start the chip's Rx process. */ set_rx_mode(dev); @@ -700,7 +721,7 @@ static void epic_pause(struct net_device *dev) { long ioaddr = dev->base_addr; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; netif_stop_queue (dev); @@ -723,17 +744,19 @@ static void epic_restart(struct net_device *dev) { long ioaddr = dev->base_addr; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; int i; - printk(KERN_DEBUG "%s: Restarting the EPIC chip, Rx %d/%d Tx %d/%d.\n", - dev->name, ep->cur_rx, ep->dirty_rx, ep->dirty_tx, ep->cur_tx); /* Soft reset the chip. */ - outl(0x0001, ioaddr + GENCTL); + outl(0x4001, ioaddr + GENCTL); + printk(KERN_DEBUG "%s: Restarting the EPIC chip, Rx %d/%d Tx %d/%d.\n", + dev->name, ep->cur_rx, ep->dirty_rx, ep->dirty_tx, ep->cur_tx); udelay(1); - /* Duplicate code from epic_open(). */ - outl(0x0008, ioaddr + TEST1); + + /* This magic is documented in SMSC app note 7.15 */ + for (i = 16; i > 0; i--) + outl(0x0008, ioaddr + TEST1); #if defined(__powerpc__) || defined(__sparc__) /* Big endian */ outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL); @@ -750,9 +773,10 @@ ep->tx_threshold = TX_FIFO_THRESH; outl(ep->tx_threshold, ioaddr + TxThresh); outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl); - outl(virt_to_bus(&ep->rx_ring[ep->cur_rx%RX_RING_SIZE]), ioaddr + PRxCDAR); - outl(virt_to_bus(&ep->tx_ring[ep->dirty_tx%TX_RING_SIZE]), - ioaddr + PTxCDAR); + outl(ep->rx_ring_dma + (ep->cur_rx%RX_RING_SIZE)* + sizeof(struct epic_rx_desc), ioaddr + PRxCDAR); + outl(ep->tx_ring_dma + (ep->dirty_tx%TX_RING_SIZE)* + sizeof(struct epic_tx_desc), ioaddr + PTxCDAR); /* Start the chip's Rx process. */ set_rx_mode(dev); @@ -770,16 +794,34 @@ return; } -static void epic_timer(unsigned long data) +static void check_media(struct net_device *dev) { - struct net_device *dev = (struct net_device *)data; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; - int next_tick = 60*HZ; - int mii_reg5 = ep->mii_phy_cnt ? mdio_read(ioaddr, ep->phys[0], 5) : 0; + int mii_reg5 = ep->mii_phy_cnt ? mdio_read(dev, ep->phys[0], 5) : 0; int negotiated = mii_reg5 & ep->advertising; int duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040; + if (ep->duplex_lock) + return; + if (mii_reg5 == 0xffff) /* Bogus read */ + return; + if (ep->full_duplex != duplex) { + ep->full_duplex = duplex; + printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link" + " partner capability of %4.4x.\n", dev->name, + ep->full_duplex ? "full" : "half", ep->phys[0], mii_reg5); + outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl); + } +} + +static void epic_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct epic_private *ep = dev->priv; + long ioaddr = dev->base_addr; + int next_tick = 5*HZ; + if (debug > 3) { printk(KERN_DEBUG "%s: Media monitor tick, Tx status %8.8x.\n", dev->name, (int)inl(ioaddr + TxSTAT)); @@ -789,15 +831,7 @@ (int)inl(ioaddr + INTSTAT), (int)inl(ioaddr + RxSTAT)); } - if (! ep->force_fd) { - if (ep->full_duplex != duplex) { - ep->full_duplex = duplex; - printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link" - " partner capability of %4.4x.\n", dev->name, - ep->full_duplex ? "full" : "half", ep->phys[0], mii_reg5); - outl(ep->full_duplex ? 0x7F : 0x79, ioaddr + TxCtrl); - } - } + check_media(dev); ep->timer.expires = jiffies + next_tick; add_timer(&ep->timer); @@ -805,7 +839,7 @@ static void epic_tx_timeout(struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; if (debug > 0) { @@ -827,13 +861,14 @@ dev->trans_start = jiffies; ep->stats.tx_errors++; - return; + if (!ep->tx_full) + netif_wake_queue(dev); } /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ static void epic_init_ring(struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; int i; ep->tx_full = 0; @@ -847,11 +882,12 @@ for (i = 0; i < RX_RING_SIZE; i++) { ep->rx_ring[i].rxstatus = 0; ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz); - ep->rx_ring[i].next = virt_to_le32desc(&ep->rx_ring[i+1]); + ep->rx_ring[i].next = ep->rx_ring_dma + + (i+1)*sizeof(struct epic_rx_desc); ep->rx_skbuff[i] = 0; } /* Mark the last entry as wrapping the ring. */ - ep->rx_ring[i-1].next = virt_to_le32desc(&ep->rx_ring[0]); + ep->rx_ring[i-1].next = ep->rx_ring_dma; /* Fill in the Rx buffers. Handle allocation failure gracefully. */ for (i = 0; i < RX_RING_SIZE; i++) { @@ -861,7 +897,8 @@ break; skb->dev = dev; /* Mark as being used by this device. */ skb_reserve(skb, 2); /* 16 byte align the IP header. */ - ep->rx_ring[i].bufaddr = virt_to_le32desc(skb->tail); + ep->rx_ring[i].bufaddr = pci_map_single(ep->pci_dev, + skb->tail, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); ep->rx_ring[i].rxstatus = cpu_to_le32(DescOwn); } ep->dirty_rx = (unsigned int)(i - RX_RING_SIZE); @@ -871,29 +908,31 @@ for (i = 0; i < TX_RING_SIZE; i++) { ep->tx_skbuff[i] = 0; ep->tx_ring[i].txstatus = 0x0000; - ep->tx_ring[i].next = virt_to_le32desc(&ep->tx_ring[i+1]); + ep->tx_ring[i].next = ep->tx_ring_dma + + (i+1)*sizeof(struct epic_tx_desc); } - ep->tx_ring[i-1].next = virt_to_le32desc(&ep->tx_ring[0]); + ep->tx_ring[i-1].next = ep->tx_ring_dma; return; } static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; int entry, free_count; u32 ctrl_word; + long flags; /* Caution: the write order is important here, set the field with the "ownership" bit last. */ - spin_lock_irq(&ep->lock); /* Calculate the next Tx descriptor entry. */ + spin_lock_irqsave(&ep->lock, flags); free_count = ep->cur_tx - ep->dirty_tx; entry = ep->cur_tx % TX_RING_SIZE; ep->tx_skbuff[entry] = skb; - ep->tx_ring[entry].bufaddr = virt_to_le32desc(skb->data); - + ep->tx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, skb->data, + skb->len, PCI_DMA_TODEVICE); if (free_count < TX_QUEUE_LEN/2) {/* Typical path */ ctrl_word = cpu_to_le32(0x100000); /* No interrupt */ } else if (free_count == TX_QUEUE_LEN/2) { @@ -914,8 +953,7 @@ if (ep->tx_full) netif_stop_queue(dev); - spin_unlock_irq(&ep->lock); - + spin_unlock_irqrestore(&ep->lock, flags); /* Trigger an immediate transmit demand. */ outl(TxQueued, dev->base_addr + COMMAND); @@ -934,12 +972,10 @@ static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_instance; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; int status, boguscnt = max_interrupt_work; - spin_lock(&ep->lock); - do { status = inl(ioaddr + INTSTAT); /* Acknowledge all of the current interrupt sources ASAP. */ @@ -962,9 +998,11 @@ /* Note: if this lock becomes a problem we can narrow the locked region at the cost of occasionally grabbing the lock more times. */ + spin_lock(&ep->lock); cur_tx = ep->cur_tx; dirty_tx = ep->dirty_tx; for (; cur_tx - dirty_tx > 0; dirty_tx++) { + struct sk_buff *skb; int entry = dirty_tx % TX_RING_SIZE; int txstatus = le32_to_cpu(ep->tx_ring[entry].txstatus); @@ -975,7 +1013,7 @@ /* There was an major error, log it. */ #ifndef final_version if (debug > 1) - printk("%s: Transmit error, Tx status %8.8x.\n", + printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", dev->name, txstatus); #endif ep->stats.tx_errors++; @@ -996,13 +1034,16 @@ } /* Free the original skb. */ - dev_kfree_skb_irq(ep->tx_skbuff[entry]); + skb = ep->tx_skbuff[entry]; + pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, + skb->len, PCI_DMA_TODEVICE); + dev_kfree_skb_irq(skb); ep->tx_skbuff[entry] = 0; } #ifndef final_version if (cur_tx - dirty_tx > TX_RING_SIZE) { - printk("%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n", + printk(KERN_WARNING "%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n", dev->name, dirty_tx, cur_tx, ep->tx_full); dirty_tx += TX_RING_SIZE; } @@ -1010,10 +1051,12 @@ ep->dirty_tx = dirty_tx; if (ep->tx_full && cur_tx - dirty_tx < TX_QUEUE_LEN - 4) { - /* The ring is no longer full, clear tbusy. */ + /* The ring is no longer full, allow new TX entries. */ ep->tx_full = 0; + spin_unlock(&ep->lock); netif_wake_queue(dev); - } + } else + spin_unlock(&ep->lock); } /* Check uncommon events all at once. */ @@ -1060,12 +1103,12 @@ printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, status); - spin_unlock(&ep->lock); + return; } static int epic_rx(struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; int entry = ep->cur_rx % RX_RING_SIZE; int rx_work_limit = ep->dirty_rx + RX_RING_SIZE - ep->cur_rx; int work_done = 0; @@ -1074,7 +1117,7 @@ printk(KERN_DEBUG " In epic_rx(), entry %d %8.8x.\n", entry, ep->rx_ring[entry].rxstatus); /* If we own the next entry, it's a new packet. Send it up. */ - while (!(le32_to_cpu(ep->rx_ring[entry].rxstatus) & DescOwn)) { + while ((ep->rx_ring[entry].rxstatus & cpu_to_le32(DescOwn)) == 0) { int status = le32_to_cpu(ep->rx_ring[entry].rxstatus); if (debug > 4) @@ -1098,6 +1141,10 @@ short pkt_len = (status >> 16) - 4; struct sk_buff *skb; + pci_dma_sync_single(ep->pci_dev, ep->rx_ring[entry].bufaddr, + ep->rx_buf_sz, PCI_DMA_FROMDEVICE); + pci_unmap_single(ep->pci_dev, ep->rx_ring[entry].bufaddr, + ep->rx_buf_sz, PCI_DMA_FROMDEVICE); if (pkt_len > PKT_BUF_SZ - 4) { printk(KERN_ERR "%s: Oversized Ethernet frame, status %x " "%d bytes.\n", @@ -1141,7 +1188,8 @@ break; skb->dev = dev; /* Mark as being used by this device. */ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ - ep->rx_ring[entry].bufaddr = virt_to_le32desc(skb->tail); + ep->rx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, + skb->tail, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); work_done++; } ep->rx_ring[entry].rxstatus = cpu_to_le32(DescOwn); @@ -1152,7 +1200,8 @@ static int epic_close(struct net_device *dev) { long ioaddr = dev->base_addr; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; + struct sk_buff *skb; int i; netif_stop_queue(dev); @@ -1167,31 +1216,36 @@ /* Free all the skbuffs in the Rx queue. */ for (i = 0; i < RX_RING_SIZE; i++) { - struct sk_buff *skb = ep->rx_skbuff[i]; + skb = ep->rx_skbuff[i]; ep->rx_skbuff[i] = 0; ep->rx_ring[i].rxstatus = 0; /* Not owned by Epic chip. */ ep->rx_ring[i].buflength = 0; - ep->rx_ring[i].bufaddr = 0xBADF00D0; /* An invalid address. */ if (skb) { + pci_unmap_single(ep->pci_dev, ep->rx_ring[i].bufaddr, + ep->rx_buf_sz, PCI_DMA_FROMDEVICE); dev_kfree_skb(skb); } + ep->rx_ring[i].bufaddr = 0xBADF00D0; /* An invalid address. */ } for (i = 0; i < TX_RING_SIZE; i++) { - if (ep->tx_skbuff[i]) - dev_kfree_skb(ep->tx_skbuff[i]); + skb = ep->tx_skbuff[i]; ep->tx_skbuff[i] = 0; + if (!skb) + continue; + pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, + skb->len, PCI_DMA_TODEVICE); + dev_kfree_skb(skb); } /* Green! Leave the chip in low-power mode. */ outl(0x0008, ioaddr + GENCTL); - MOD_DEC_USE_COUNT; return 0; } static struct net_device_stats *epic_get_stats(struct net_device *dev) { - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; if (netif_running(dev)) { @@ -1233,7 +1287,7 @@ static void set_rx_mode(struct net_device *dev) { long ioaddr = dev->base_addr; - struct epic_private *ep = (struct epic_private *)dev->priv; + struct epic_private *ep = dev->priv; unsigned char mc_filter[8]; /* Multicast hash filter */ int i; @@ -1271,25 +1325,26 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { + struct epic_private *ep = (void *)dev->priv; long ioaddr = dev->base_addr; u16 *data = (u16 *)&rq->ifr_data; switch(cmd) { case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ - data[0] = ((struct epic_private *)dev->priv)->phys[0] & 0x1f; + data[0] = ep->phys[0] & 0x1f; /* Fall Through */ case SIOCDEVPRIVATE+1: /* Read the specified MII register. */ if (! netif_running(dev)) { outl(0x0200, ioaddr + GENCTL); outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); } - data[3] = mdio_read(ioaddr, data[0] & 0x1f, data[1] & 0x1f); + data[3] = mdio_read(dev, data[0] & 0x1f, data[1] & 0x1f); +#if 0 /* Just leave on if the ioctl() is ever used. */ if (! netif_running(dev)) { -#ifdef notdef /* Leave on if the ioctl() is used. */ outl(0x0008, ioaddr + GENCTL); outl((inl(ioaddr + NVCTL) & ~0x483C) | 0x0000, ioaddr + NVCTL); -#endif } +#endif return 0; case SIOCDEVPRIVATE+2: /* Write the specified MII register */ if (!capable(CAP_NET_ADMIN)) @@ -1298,13 +1353,26 @@ outl(0x0200, ioaddr + GENCTL); outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); } - mdio_write(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2]); + if (data[0] == ep->phys[0]) { + u16 value = data[2]; + switch (data[1]) { + case 0: + /* Check for autonegotiation on or reset. */ + ep->duplex_lock = (value & 0x9000) ? 0 : 1; + if (ep->duplex_lock) + ep->full_duplex = (value & 0x0100) ? 1 : 0; + break; + case 4: ep->advertising = value; break; + } + /* Perhaps check_duplex(dev), depending on chip semantics. */ + } + mdio_write(dev, data[0] & 0x1f, data[1] & 0x1f, data[2]); +#if 0 /* Leave on if the ioctl() is used. */ if (! netif_running(dev)) { -#ifdef notdef /* Leave on if the ioctl() is used. */ outl(0x0008, ioaddr + GENCTL); outl((inl(ioaddr + NVCTL) & ~0x483C) | 0x0000, ioaddr + NVCTL); -#endif } +#endif return 0; default: return -EOPNOTSUPP; @@ -1314,36 +1382,40 @@ static void __devexit epic_remove_one (struct pci_dev *pdev) { - struct net_device *dev = pdev->driver_data; + struct net_device *dev = pci_get_drvdata(pdev); + struct epic_private *ep = dev->priv; + pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); + pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma); unregister_netdev(dev); #ifndef USE_IO_OPS - iounmap ((void*) dev->base_addr); + iounmap((void*) dev->base_addr); #endif - release_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); - release_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); + pci_release_regions(pdev); kfree(dev); + pci_set_drvdata(pdev, NULL); + /* pci_power_off(pdev, -1); */ } static void epic_suspend (struct pci_dev *pdev) { - struct net_device *dev = pdev->driver_data; + struct net_device *dev = pci_get_drvdata(pdev); long ioaddr = dev->base_addr; epic_pause(dev); /* Put the chip into low-power mode. */ outl(0x0008, ioaddr + GENCTL); + /* pci_power_off(pdev, -1); */ } static void epic_resume (struct pci_dev *pdev) { - struct net_device *dev = pdev->driver_data; + struct net_device *dev = pci_get_drvdata(pdev); - epic_restart (dev); + epic_restart(dev); + /* pci_power_on(pdev); */ } diff -u --recursive --new-file v2.4.2/linux/drivers/net/net_init.c linux/drivers/net/net_init.c --- v2.4.2/linux/drivers/net/net_init.c Wed Feb 21 18:20:27 2001 +++ linux/drivers/net/net_init.c Fri Mar 2 11:02:15 2001 @@ -390,23 +390,6 @@ #endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */ -int ether_config(struct net_device *dev, struct ifmap *map) -{ - if (map->mem_start != (u_long)(-1)) - dev->mem_start = map->mem_start; - if (map->mem_end != (u_long)(-1)) - dev->mem_end = map->mem_end; - if (map->base_addr != (u_short)(-1)) - dev->base_addr = map->base_addr; - if (map->irq != (u_char)(-1)) - dev->irq = map->irq; - if (map->dma != (u_char)(-1)) - dev->dma = map->dma; - if (map->port != (u_char)(-1)) - dev->if_port = map->port; - return 0; -} - int register_netdev(struct net_device *dev) { int err; diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/3c574_cs.c linux/drivers/net/pcmcia/3c574_cs.c --- v2.4.2/linux/drivers/net/pcmcia/3c574_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/3c574_cs.c Fri Mar 2 11:02:15 2001 @@ -1166,7 +1166,9 @@ skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); + dev->last_rx = jiffies; lp->stats.rx_packets++; + lp->stats.rx_bytes += pkt_len; } else { DEBUG(1, "%s: couldn't allocate a sk_buff of" " size %d.\n", dev->name, pkt_len); diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/3c589_cs.c linux/drivers/net/pcmcia/3c589_cs.c --- v2.4.2/linux/drivers/net/pcmcia/3c589_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/3c589_cs.c Fri Mar 2 11:02:15 2001 @@ -4,7 +4,7 @@ Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net - 3c589_cs.c 1.154 2000/09/30 17:39:04 + 3c589_cs.c 1.156 2001/02/07 00:19:41 The network driver code is based on Donald Becker's 3c589 code: @@ -117,7 +117,7 @@ MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static char *version = -"3c589_cs.c 1.154 2000/09/30 17:39:04 (David Hinds)"; +"3c589_cs.c 1.156 2001/02/07 00:19:41 (David Hinds)"; #else #define DEBUG(n, args...) #endif @@ -993,8 +993,9 @@ skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); + dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += skb->len; + lp->stats.rx_bytes += pkt_len; } else { DEBUG(1, "%s: couldn't allocate a sk_buff of" " size %d.\n", dev->name, pkt_len); diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/fmvj18x_cs.c linux/drivers/net/pcmcia/fmvj18x_cs.c --- v2.4.2/linux/drivers/net/pcmcia/fmvj18x_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/fmvj18x_cs.c Fri Mar 2 11:02:15 2001 @@ -1,5 +1,5 @@ /*====================================================================== - fmvj18x_cs.c,v 2.0 2000/10/01 03:13:53 root Exp + fmvj18x_cs.c 2.2 2001/01/07 A fmvj18x (and its compatibles) PCMCIA client driver @@ -19,7 +19,7 @@ Director, National Security Agency. This software may be used and distributed according to the terms - of the GNU Public License, incorporated herein by reference. + of the GNU General Public License, incorporated herein by reference. The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O Center of Excellence in Space Data and Information Sciences @@ -87,8 +87,7 @@ driver version infomation */ #ifdef PCMCIA_DEBUG -static char *version = - "fmvj18x_cs.c,v 2.0 2000/10/01 03:13:53 root Exp"; +static char *version = "fmvj18x_cs.c 2.2 2001/01/07"; #endif /*====================================================================*/ @@ -96,6 +95,7 @@ PCMCIA event handlers */ static void fmvj18x_config(dev_link_t *link); +static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id); static void fmvj18x_release(u_long arg); static int fmvj18x_event(event_t event, int priority, event_callback_args_t *args); @@ -103,7 +103,7 @@ static void fmvj18x_detach(dev_link_t *); /* - LAN controler(MBH86960A) specific routines + LAN controller(MBH86960A) specific routines */ static int fjn_config(struct net_device *dev, struct ifmap *map); static int fjn_open(struct net_device *dev); @@ -122,7 +122,9 @@ /* card type */ -typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN } cardtype_t; +typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN, + XXX10304 +} cardtype_t; #define MANFID_UNGERMANN 0x02c0 @@ -223,8 +225,8 @@ #define RECV_ALL 0x03 /* (RX_MODE) */ #define CONFIG0_DFL 0x5a /* 16bit bus, 4K x 2 Tx queues */ #define CONFIG0_DFL_1 0x5e /* 16bit bus, 8K x 2 Tx queues */ -#define CONFIG0_RST 0xda /* Data Link Controler off (CONFIG_0) */ -#define CONFIG0_RST_1 0xde /* Data Link Controler off (CONFIG_0) */ +#define CONFIG0_RST 0xda /* Data Link Controller off (CONFIG_0) */ +#define CONFIG0_RST_1 0xde /* Data Link Controller off (CONFIG_0) */ #define BANK_0 0xa0 /* bank 0 (CONFIG_1) */ #define BANK_1 0xa4 /* bank 1 (CONFIG_1) */ #define BANK_2 0xa8 /* bank 2 (CONFIG_1) */ @@ -235,8 +237,8 @@ #define MANU_MODE 0x03 /* Stop and skip packet on 16 col */ #define TDK_AUTO_MODE 0x47 /* Auto skip packet on 16 col detected */ #define TDK_MANU_MODE 0x43 /* Stop and skip packet on 16 col */ -#define INTR_OFF 0x0d /* LAN controler ignores interrupts */ -#define INTR_ON 0x1d /* LAN controler will catch interrupts */ +#define INTR_OFF 0x0d /* LAN controller ignores interrupts */ +#define INTR_ON 0x1d /* LAN controller will catch interrupts */ #define TX_TIMEOUT ((400*HZ)/1000) @@ -321,8 +323,10 @@ ether_setup(dev); dev->open = &fjn_open; dev->stop = &fjn_close; +#ifdef HAVE_TX_TIMEOUT dev->tx_timeout = fjn_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; +#endif /* Register with Card Services */ link->next = dev_list; @@ -438,6 +442,12 @@ switch (le16_to_cpu(buf[0])) { case MANFID_TDK: cardtype = TDK; + if (le16_to_cpu(buf[1]) == PRODID_TDK_CF010) { + cs_status_t status; + CardServices(GetStatus, handle, &status); + if (status.CardState & CS_EVENT_3VCARD) + link->conf.Vcc = 33; /* inserted in 3.3V slot */ + } break; case MANFID_CONTEC: cardtype = CONTEC; @@ -461,6 +471,15 @@ else buf[0] = 0xffff; switch (le16_to_cpu(buf[0])) { + case MANFID_FUJITSU: + if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) { + cardtype = XXX10304; /* MBH10304 with buggy CIS */ + link->conf.ConfigIndex = 0x20; + } else { + cardtype = MBH10302; + link->conf.ConfigIndex = 1; + } + break; case MANFID_UNGERMANN: cardtype = UNGERMANN; /* @@ -505,7 +524,7 @@ else outb(BANK_0, ioaddr + CONFIG_1); - /* Reset controler */ + /* Reset controller */ if( sram_config == 0 ) outb(CONFIG0_RST, ioaddr + CONFIG_0); else @@ -550,6 +569,19 @@ dev->dev_addr[i] = inb(ioaddr + UNGERMANN_MAC_ID + i); card_name = "Access/CARD"; break; + case XXX10304: + /* Read MACID from Buggy CIS */ + if (fmvj18x_get_hwinfo(link, tuple.TupleData) == -1) { + printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net + address."); + unregister_netdev(dev); + goto failed; + } + for (i = 0 ; i < 6; i++) { + dev->dev_addr[i] = tuple.TupleData[i]; + } + card_name = "FMV-J182"; + break; case MBH10302: default: /* Read MACID from register */ @@ -580,7 +612,60 @@ fmvj18x_release((u_long)link); } /* fmvj18x_config */ - +/*====================================================================*/ + +static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id) +{ + win_req_t req; + memreq_t mem; + u_char *base; + int i, j; + + /* Allocate a small memory window */ + req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; + req.Base = 0; req.Size = 0; + req.AccessSpeed = 0; + link->win = (window_handle_t)link->handle; + i = CardServices(RequestWindow, &link->win, &req); + if (i != CS_SUCCESS) { + cs_error(link->handle, RequestWindow, i); + return -1; + } + + base = ioremap(req.Base, req.Size); + mem.Page = 0; + mem.CardOffset = 0; + CardServices(MapMemPage, link->win, &mem); + + /* + * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format + * 22 0d xx xx xx 04 06 yy yy yy yy yy yy ff + * 'xx' is garbage. + * 'yy' is MAC address. + */ + for (i = 0; i < 0x200; i++) { + if (readb(base+i*2) == 0x22) { + if (readb(base+(i-1)*2) == 0xff + && readb(base+(i+5)*2) == 0x04 + && readb(base+(i+6)*2) == 0x06 + && readb(base+(i+13)*2) == 0xff) + break; + } + } + + if (i != 0x200) { + for (j = 0 ; j < 6; j++,i++) { + node_id[j] = readb(base+(i+7)*2); + } + } + + iounmap(base); + j = CardServices(ReleaseWindow, link->win); + if (j != CS_SUCCESS) + cs_error(link->handle, ReleaseWindow, j); + return (i != 0x200) ? 0 : -1; + +} /* fmvj18x_get_hwinfo */ /*====================================================================*/ static void fmvj18x_release(u_long arg) @@ -775,7 +860,7 @@ lp->sent = 0; lp->open_time = jiffies; sti(); - netif_start_queue(dev); + netif_wake_queue(dev); } static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) @@ -923,7 +1008,7 @@ outb(D_TX_INTR, ioaddr + TX_INTR); outb(D_RX_INTR, ioaddr + RX_INTR); - /* Turn on interrupts from LAN card controler */ + /* Turn on interrupts from LAN card controller */ if( lp->cardtype != TDK ) outb(INTR_ON, ioaddr + LAN_CTRL); } /* fjn_reset */ @@ -995,8 +1080,9 @@ #endif netif_rx(skb); + dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += skb->len; + lp->stats.rx_bytes += pkt_len; } if (--boguscount <= 0) break; diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/i82593.h linux/drivers/net/pcmcia/i82593.h --- v2.4.2/linux/drivers/net/pcmcia/i82593.h Wed Oct 20 21:33:12 1999 +++ linux/drivers/net/pcmcia/i82593.h Fri Mar 2 11:02:15 2001 @@ -221,4 +221,4 @@ #define I82593_MAX_MULTICAST_ADDRESSES 128 /* Hardware hashed filter */ -#endif _I82593_H +#endif /* _I82593_H */ diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/netwave_cs.c linux/drivers/net/pcmcia/netwave_cs.c --- v2.4.2/linux/drivers/net/pcmcia/netwave_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/netwave_cs.c Fri Mar 2 11:02:15 2001 @@ -1463,16 +1463,16 @@ skb->protocol = eth_type_trans(skb,dev); /* Queue packet for network layer */ netif_rx(skb); - + + dev->last_rx = jiffies; + priv->stats.rx_packets++; + priv->stats.rx_bytes += rcvLen; + /* Got the packet, tell the adapter to skip it */ wait_WOC(iobase); writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0); writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1); DEBUG(3, "Packet reception ok\n"); - - priv->stats.rx_packets++; - - priv->stats.rx_bytes += skb->len; } return 0; } diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/nmclan_cs.c linux/drivers/net/pcmcia/nmclan_cs.c --- v2.4.2/linux/drivers/net/pcmcia/nmclan_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/nmclan_cs.c Fri Mar 2 11:02:15 2001 @@ -1288,9 +1288,9 @@ skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); /* Send the packet to the upper (protocol) layers. */ - + dev->last_rx = jiffies; lp->linux_stats.rx_packets++; - lp->linux_stats.rx_bytes += skb->len; + lp->linux_stats.rx_bytes += pkt_len; outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ continue; } else { diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/pcnet_cs.c linux/drivers/net/pcmcia/pcnet_cs.c --- v2.4.2/linux/drivers/net/pcmcia/pcnet_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/pcnet_cs.c Fri Mar 2 11:02:15 2001 @@ -11,7 +11,7 @@ Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net - pcnet_cs.c 1.126 2000/10/02 20:38:23 + pcnet_cs.c 1.132 2001/02/09 03:13:29 The network driver code is based on Donald Becker's NE2000 code: @@ -72,7 +72,7 @@ MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static char *version = -"pcnet_cs.c 1.126 2000/10/02 20:38:23 (David Hinds)"; +"pcnet_cs.c 1.132 2001/02/09 03:13:29 (David Hinds)"; #else #define DEBUG(n, args...) #endif @@ -137,7 +137,7 @@ #define HAS_IBM_MISC 0x08 #define IS_DL10019 0x10 #define IS_DL10022 0x20 -#define IS_AX88190 0x40 +#define HAS_MII 0x40 #define USE_SHMEM 0x80 /* autodetected */ static hw_info_t hw_info[] = { @@ -204,8 +204,8 @@ #define NR_INFO (sizeof(hw_info)/sizeof(hw_info_t)) static hw_info_t default_info = { 0, 0, 0, 0, 0 }; -static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019 }; -static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10019|IS_DL10022 }; +static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII }; +static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII }; typedef struct pcnet_dev_t { struct net_device dev; /* so &dev == &pcnet_dev_t */ @@ -507,10 +507,10 @@ if (link->conf.ConfigBase != 0x03c0) return NULL; - outb_p(0x01, EN0_DCFG); /* Set word-wide access. */ - outb_p(0x00, EN0_RSARLO); /* DMA starting at 0x0400. */ - outb_p(0x04, EN0_RSARHI); - outb_p(E8390_RREAD+E8390_START, E8390_CMD); + outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */ + outb_p(0x00, ioaddr + EN0_RSARLO); /* DMA starting at 0x0400. */ + outb_p(0x04, ioaddr + EN0_RSARHI); + outb_p(E8390_RREAD+E8390_START, ioaddr + E8390_CMD); for (i = 0; i < 6; i += 2) { j = inw(ioaddr + PCNET_DATAPORT); @@ -718,6 +718,7 @@ info->flags |= (delay_output) ? DELAY_OUTPUT : 0; if ((manfid == MANFID_SOCKET) && ((prodid == PRODID_SOCKET_LPE) || + (prodid == PRODID_SOCKET_LPE_CF) || (prodid == PRODID_SOCKET_EIO))) info->flags &= ~USE_BIG_BUF; if (!use_big_buf) @@ -746,13 +747,11 @@ link->dev = &info->node; link->state &= ~DEV_CONFIG_PENDING; - if (info->flags & IS_DL10019) { + if (info->flags & (IS_DL10019|IS_DL10022)) { dev->do_ioctl = &do_ioctl; printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", dev->name, ((info->flags & IS_DL10022) ? 22 : 19), inb(dev->base_addr + 0x1a)); - } else if (info->flags & IS_AX88190) { - printk(KERN_INFO "%s: NE2000 (AX88190): ", dev->name); } else printk(KERN_INFO "%s: NE2000 Compatible: ", dev->name); printk("io %#3lx, irq %d,", dev->base_addr, dev->irq); @@ -1024,6 +1023,8 @@ ei_status.txing = ei_status.dmaing = 0; + outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, nic_base + E8390_CMD); + outb(inb(nic_base + PCNET_RESET), nic_base + PCNET_RESET); for (i = 0; i < 100; i++) { @@ -1092,10 +1093,17 @@ return; } - if (!(info->flags & IS_DL10019)) + if (!(info->flags & HAS_MII)) + goto reschedule; + + link = mdio_read(dev->base_addr + DLINK_GPIO, 0, 1); + if (!link || (link == 0xffff)) { + printk(KERN_INFO "%s: MII is missing!\n", dev->name); + info->flags &= ~HAS_MII; goto reschedule; + } - link = mdio_read(dev->base_addr + DLINK_GPIO, 0, 1) & 0x0004; + link &= 0x0004; if (link != info->link_status) { u_short p = mdio_read(dev->base_addr + DLINK_GPIO, 0, 5); printk(KERN_INFO "%s: %s link beat\n", dev->name, diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/ray_cs.c linux/drivers/net/pcmcia/ray_cs.c --- v2.4.2/linux/drivers/net/pcmcia/ray_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/ray_cs.c Fri Mar 2 11:02:15 2001 @@ -2219,9 +2219,9 @@ skb->protocol = eth_type_trans(skb,dev); netif_rx(skb); - + dev->last_rx = jiffies; local->stats.rx_packets++; - local->stats.rx_bytes += skb->len; + local->stats.rx_bytes += total_len; /* Gather signal strength per address */ #ifdef WIRELESS_SPY diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/smc91c92_cs.c linux/drivers/net/pcmcia/smc91c92_cs.c --- v2.4.2/linux/drivers/net/pcmcia/smc91c92_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/smc91c92_cs.c Fri Mar 2 11:02:15 2001 @@ -8,7 +8,7 @@ Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net - smc91c92_cs.c 1.104 2000/08/31 21:25:13 + smc91c92_cs.c 1.106 2001/02/07 00:19:58 This driver contains code written by Donald Becker (becker@cesdis.gsfc.nasa.gov), Rowan Hughes (x-csrdh@jcu.edu.au), @@ -231,7 +231,7 @@ RxEnable = 0x0100, RxStripCRC = 0x0200}; #define RCR_SOFTRESET 0x8000 /* resets the chip */ #define RCR_STRIP_CRC 0x200 /* strips CRC */ -#define RCR_ENABLE 0x100 /* IFF this is set, we can recieve packets */ +#define RCR_ENABLE 0x100 /* IFF this is set, we can receive packets */ #define RCR_ALMUL 0x4 /* receive all multicast packets */ #define RCR_PROMISC 0x2 /* enable promiscuous mode */ @@ -1617,8 +1617,9 @@ skb->dev = dev; netif_rx(skb); + dev->last_rx = jiffies; smc->stats.rx_packets++; - smc->stats.rx_bytes += skb->len; + smc->stats.rx_bytes += packet_length; if (rx_status & RS_MULTICAST) smc->stats.multicast++; } else { diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/wavelan.h linux/drivers/net/pcmcia/wavelan.h --- v2.4.2/linux/drivers/net/pcmcia/wavelan.h Wed Oct 20 21:33:12 1999 +++ linux/drivers/net/pcmcia/wavelan.h Fri Mar 2 11:02:15 2001 @@ -7,11 +7,11 @@ * Original copyright follow. See wavelan_cs.h for details. * * This file contain the declarations of the Wavelan hardware. Note that - * the Pcmcia Wavelan include a i82593 controler (see definitions in + * the Pcmcia Wavelan include a i82593 controller (see definitions in * file i82593.h). * * The main difference between the pcmcia hardware and the ISA one is - * the Ethernet Controler (i82593 instead of i82586). The i82593 allow + * the Ethernet Controller (i82593 instead of i82586). The i82593 allow * only one send buffer. The PSA (Parameter Storage Area : EEprom for * permanent storage of various info) is memory mapped, but not the * MMI (Modem Management Interface). diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/wavelan_cs.c linux/drivers/net/pcmcia/wavelan_cs.c --- v2.4.2/linux/drivers/net/pcmcia/wavelan_cs.c Thu Jan 4 12:50:12 2001 +++ linux/drivers/net/pcmcia/wavelan_cs.c Fri Mar 2 11:02:15 2001 @@ -37,6 +37,12 @@ * Apr 2 '98 made changes to bring the i82593 control/int handling in line * with offical specs... * + * Changes: + * Arnaldo Carvalho de Melo - 08/08/2000 + * - reorganize kmallocs in wavelan_attach, checking all for failure + * and releasing the previous allocations if one fails + * + * **************************************************************************** * Copyright 1995 * Anthony D. Joseph @@ -512,7 +518,7 @@ /* Do not remove this unless you have a good reason */ printk(KERN_NOTICE "%s: Warning, you have enabled roaming on" " device %s !\n", dev->name, dev->name); - printk(KERN_NOTICE "Roaming is currently an experimental unsuported feature" + printk(KERN_NOTICE "Roaming is currently an experimental unsupported feature" " of the Wavelan driver.\n"); printk(KERN_NOTICE "It may work, but may also make the driver behave in" " erratic ways or crash.\n"); @@ -820,7 +826,7 @@ /************************ I82593 SUBROUTINES *************************/ /* - * Usefull subroutines to manage the Ethernet controler + * Useful subroutines to manage the Ethernet controller */ /*------------------------------------------------------------------*/ @@ -853,7 +859,7 @@ /* We are waiting for command completion */ wv_wait_completed = TRUE; - /* Issue the command to the controler */ + /* Issue the command to the controller */ outb(cmd, LCCR(base)); /* If we don't have to check the result of the command */ @@ -1774,7 +1780,7 @@ #if WIRELESS_EXT > 7 const int BAND_NUM = 10; /* Number of bands */ int c = 0; /* Channel number */ -#endif WIRELESS_EXT +#endif /* WIRELESS_EXT */ /* Read the frequency table */ fee_read(base, 0x71 /* frequency table */, @@ -1792,7 +1798,7 @@ (c < BAND_NUM)) c++; list[i].i = c; /* Set the list index */ -#endif WIRELESS_EXT +#endif /* WIRELESS_EXT */ /* put in the list */ list[i].m = (((freq + 24) * 5) + 24000L) * 10000; @@ -2727,8 +2733,9 @@ netif_rx(skb); /* Keep stats up to date */ + dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += skb->len; + lp->stats.rx_bytes += sksize; #ifdef DEBUG_RX_TRACE printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name); @@ -2949,7 +2956,7 @@ /*------------------------------------------------------------------*/ /* * This routine is called when we want to send a packet (NET3 callback) - * In this routine, we check if the the harware is ready to accept + * In this routine, we check if the hardware is ready to accept * the packet. We also prevent reentrance. Then, we call the function * to send the packet... */ @@ -2974,7 +2981,7 @@ * In other words, prevent reentering this routine. */ if (1) { - /* If somebody has asked to reconfigure the controler, we can do it now */ + /* If somebody has asked to reconfigure the controller, we can do it now */ if (lp->reconfig_82593) { lp->reconfig_82593 = FALSE; wv_82593_config (dev); @@ -3332,7 +3339,7 @@ /*------------------------------------------------------------------*/ /* - * This routine does a standard config of the WaveLAN controler (i82593). + * This routine does a standard config of the WaveLAN controller (i82593). * In the ISA driver, this is integrated in wavelan_hardware_reset() * (called by wv_hw_config(), wv_82593_reconfig() & wavelan_packet_xmit()) */ @@ -3596,7 +3603,7 @@ hacr_write_slow(base, HACR_RESET); hacr_write(base, HACR_DEFAULT); - /* Check if the the module has been powered up... */ + /* Check if the module has been powered up... */ if(hasr_read(base) & HASR_NO_CLK) { #ifdef DEBUG_CONFIG_ERRORS @@ -3614,7 +3621,7 @@ outb(OP0_RESET, LCCR(base)); mdelay(1); /* A bit crude ! */ - /* Initialize the LAN controler */ + /* Initialize the LAN controller */ if((wv_82593_config(dev) == FALSE) || (wv_diag(dev) == FALSE)) { @@ -3918,7 +3925,7 @@ * This function is the interrupt handler for the WaveLAN card. This * routine will be called whenever: * 1. A packet is received. - * 2. A packet has successfully been transfered and the unit is + * 2. A packet has successfully been transferred and the unit is * ready to transmit another packet. * 3. A command has completed execution. */ @@ -4285,7 +4292,7 @@ /* Power up (power up time is 250us) */ hacr_write(base, HACR_DEFAULT); - /* Check if the the module has been powered up... */ + /* Check if the module has been powered up... */ if(hasr_read(base) & HASR_NO_CLK) { #ifdef DEBUG_CONFIG_ERRORS @@ -4424,7 +4431,24 @@ /* Initialize the dev_link_t structure */ link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); + if (!link) + return NULL; + + /* Allocate the generic data structure */ + dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); + if (!dev) + goto fail_alloc_dev; + + /* Allocate the wavelan-specific data structure. */ + lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL); + if (!lp) + goto fail_alloc_dev_priv; + + memset(lp, 0, sizeof(net_local)); memset(link, 0, sizeof(struct dev_link_t)); + memset(dev, 0, sizeof(struct net_device)); + + dev->priv = lp; /* Unused for the Wavelan */ link->release.function = &wv_pcmcia_release; @@ -4454,15 +4478,8 @@ link->next = dev_list; dev_list = link; - /* Allocate the generic data structure */ - dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); - memset(dev, 0x00, sizeof(struct net_device)); link->priv = link->irq.Instance = dev; - /* Allocate the wavelan-specific data structure. */ - dev->priv = lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL); - memset(lp, 0x00, sizeof(net_local)); - /* Init specific data */ wv_wait_completed = 0; lp->status = FALSE; @@ -4531,6 +4548,12 @@ #endif return link; + +fail_alloc_dev_priv: + kfree(dev); +fail_alloc_dev: + kfree(link); + return NULL; } /*------------------------------------------------------------------*/ diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/wavelan_cs.h linux/drivers/net/pcmcia/wavelan_cs.h --- v2.4.2/linux/drivers/net/pcmcia/wavelan_cs.h Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/wavelan_cs.h Fri Mar 2 11:02:15 2001 @@ -96,7 +96,7 @@ * * wavelan.h : Description of the hardware interface & structs * - * i82593.h : Description if the Ethernet controler + * i82593.h : Description if the Ethernet controller */ /* --------------------------- HISTORY --------------------------- */ @@ -225,7 +225,7 @@ * - wavelan_set_multicast_list : avoid reset * - add wireless extensions (ioctl & get_wireless_stats) * get/set nwid/frequency on fly, info for /proc/net/wireless - * - Supress useless stuff from lp (net_local), but add link + * - Suppress useless stuff from lp (net_local), but add link * - More inlines * - Lot of others minor details & cleanups * @@ -315,7 +315,7 @@ * o Rename wavelan_release to wv_pcmcia_release & move up * o move unregister_netdev to wavelan_detach() * o wavelan_release() no longer call wavelan_detach() - * o Supress "release" timer + * o Suppress "release" timer * o Other cleanups & fixes * - New MAC address in the probe * - Reorg PSA_CRC code (endian neutral & cleaner) @@ -430,14 +430,14 @@ #undef DEBUG_CONFIG_INFO /* What's going on... */ #define DEBUG_CONFIG_ERRORS /* Errors on configuration */ #undef DEBUG_TX_TRACE /* Transmission calls */ -#undef DEBUG_TX_INFO /* Header of the transmited packet */ +#undef DEBUG_TX_INFO /* Header of the transmitted packet */ #undef DEBUG_TX_FAIL /* Normal failure conditions */ #define DEBUG_TX_ERROR /* Unexpected conditions */ #undef DEBUG_RX_TRACE /* Transmission calls */ -#undef DEBUG_RX_INFO /* Header of the transmited packet */ +#undef DEBUG_RX_INFO /* Header of the transmitted packet */ #undef DEBUG_RX_FAIL /* Normal failure conditions */ #define DEBUG_RX_ERROR /* Unexpected conditions */ -#undef DEBUG_PACKET_DUMP 32 /* Dump packet on the screen */ +#undef DEBUG_PACKET_DUMP /* Dump packet on the screen */ #undef DEBUG_IOCTL_TRACE /* Misc call by Linux */ #undef DEBUG_IOCTL_INFO /* Various debug info */ #define DEBUG_IOCTL_ERROR /* What's going wrong */ @@ -557,7 +557,7 @@ en_stats stats; /* Ethernet interface statistics */ int nresets; /* Number of hw resets */ u_char configured; /* If it is configured */ - u_char reconfig_82593; /* Need to reconfigure the controler */ + u_char reconfig_82593; /* Need to reconfigure the controller */ u_char promiscuous; /* Promiscuous mode */ u_char allmulticast; /* All Multicast mode */ int mc_count; /* Number of multicast addresses */ @@ -669,7 +669,7 @@ char *, int); static inline void - wv_82593_reconfig(device *); /* Reconfigure the controler */ + wv_82593_reconfig(device *); /* Reconfigure the controller */ /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */ static inline void wv_init_info(device *); /* display startup info */ diff -u --recursive --new-file v2.4.2/linux/drivers/net/pcmcia/xirc2ps_cs.c linux/drivers/net/pcmcia/xirc2ps_cs.c --- v2.4.2/linux/drivers/net/pcmcia/xirc2ps_cs.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/pcmcia/xirc2ps_cs.c Fri Mar 2 11:02:15 2001 @@ -125,7 +125,7 @@ enum xirc_isr { TxBufOvr = 0x01, /* TX Buffer Overflow */ PktTxed = 0x02, /* Packet Transmitted */ - MACIntr = 0x04, /* MAC Interrupt occured */ + MACIntr = 0x04, /* MAC Interrupt occurred */ TxResGrant = 0x08, /* Tx Reservation Granted */ RxFullPkt = 0x20, /* Rx Full Packet */ RxPktRej = 0x40, /* Rx Packet Rejected */ @@ -382,6 +382,7 @@ static void do_powerdown(struct net_device *dev); static int do_stop(struct net_device *dev); + /*=============== Helper functions =========================*/ static void flush_stale_links(void) @@ -1350,7 +1351,6 @@ * packets */ lp->stats.rx_dropped++; DEBUG(2, "%s: RX drop, too much done\n", dev->name); - PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */ } else if (rsr & PktRxOk) { struct sk_buff *skb; @@ -1420,13 +1420,13 @@ skb->protocol = eth_type_trans(skb, dev); skb->dev = dev; netif_rx(skb); + dev->last_rx = jiffies; lp->stats.rx_packets++; lp->stats.rx_bytes += pktlen; if (!(rsr & PhyPkt)) lp->stats.multicast++; } - PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */ - } else { + } else { /* bad packet */ DEBUG(5, "rsr=%#02x\n", rsr); } if (rsr & PktTooLong) { @@ -1441,6 +1441,9 @@ lp->stats.rx_fifo_errors++; /* okay ? */ DEBUG(3, "%s: Alignment error\n", dev->name); } + + /* clear the received/dropped/error packet */ + PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */ /* get the new ethernet status */ eth_status = GetByte(XIRCREG_ESR); diff -u --recursive --new-file v2.4.2/linux/drivers/net/rcpci45.c linux/drivers/net/rcpci45.c --- v2.4.2/linux/drivers/net/rcpci45.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/rcpci45.c Fri Mar 2 11:02:15 2001 @@ -134,6 +134,7 @@ unregister_netdev(dev); free_irq(dev->irq, dev); iounmap((void *)dev->base_addr); + pci_release_regions(pdev); kfree(pDpa->PLanApiPA); kfree(pDpa->pPab); kfree(pDpa); @@ -156,12 +157,10 @@ { unsigned long *vaddr; PDPA pDpa; - int error = -ENOMEM; + int error; static int card_idx = -1; struct net_device *dev; - unsigned long pci_start = pci_resource_start(pdev,0); - unsigned long pci_len = pci_resource_len(pdev,0); - + unsigned long pci_start, pci_len; card_idx++; @@ -177,8 +176,18 @@ dev = init_etherdev(NULL, sizeof(*pDpa)); if (!dev) { printk(KERN_ERR "(rcpci45 driver:) unable to allocate in init_etherdev\n"); + error = -ENOMEM; + goto err_out; + } + + error = pci_enable_device(pdev); + if (error) { + printk(KERN_ERR "(rcpci45 driver:) %d: unable to enable pci device, aborting\n",card_idx); goto err_out; } + error = -ENOMEM; + pci_start = pci_resource_start(pdev,0); + pci_len = pci_resource_len(pdev,0); pdev->driver_data = dev; @@ -188,6 +197,7 @@ if (!pci_start || !(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { printk(KERN_ERR "(rcpci45 driver:) No PCI memory resources! Aborting.\n"); + error = -EBUSY; goto err_out_free_dev; } @@ -214,20 +224,14 @@ * I/O read/write. Thus, we need to map it to some virtual address * area in order to access the registers as normal memory. */ - if (request_mem_region(pci_start, pci_len, dev->name) == NULL) { - printk(KERN_ERR "(rcpci45 driver:) %d: resource 0x%lx @ 0x%lx busy, aborting\n",card_idx, pci_start, pci_len); - goto err_out_free_msgbuf; - } - - if (pci_enable_device(pdev)) { - printk(KERN_ERR "(rcpci45 driver:) %d: unable to enable pci device, aborting\n",card_idx); - goto err_out_free_msgbuf; - } + error = pci_request_regions(pdev, dev->name); + if (error) + goto err_out_free_msgbuf; vaddr = (ulong *) ioremap (pci_start, pci_len); if (!vaddr) { printk(KERN_ERR "(rcpci45 driver:) Unable to remap address range from %lu to %lu\n", pci_start, pci_start+pci_len); - goto err_out_free_msgbuf; + goto err_out_free_region; } dprintk("rcpci45_init_one: 0x%x, priv = 0x%x, vaddr = 0x%x\n", @@ -239,13 +243,14 @@ return 0; /* success */ - + err_out_free_region: + pci_release_regions(pdev); err_out_free_msgbuf: kfree(pDpa->msgbuf); err_out_free_dev: + unregister_netdev(dev); kfree(dev); err_out: - unregister_netdev(dev); card_idx--; return error; } @@ -384,7 +389,7 @@ /* * we'll get the context when the adapter interrupts us to tell us that - * the transmision is done. At that time, we can free skb. + * the transmission is done. At that time, we can free skb. */ ptcb->b.context = (U32)skb; ptcb->b.scount = 1; diff -u --recursive --new-file v2.4.2/linux/drivers/net/rtl8129.c linux/drivers/net/rtl8129.c --- v2.4.2/linux/drivers/net/rtl8129.c Sun Sep 17 09:41:29 2000 +++ linux/drivers/net/rtl8129.c Wed Dec 31 16:00:00 1969 @@ -1,1483 +0,0 @@ -/* rtl8129.c: A RealTek RTL8129 Fast Ethernet driver for Linux. */ -/* - Written 1997-1999 by Donald Becker. - - This software may be used and distributed according to the terms - of the GNU Public License, incorporated herein by reference. - All other rights reserved. - - This driver is for boards based on the RTL8129 PCI ethernet chip. - - The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O - Center of Excellence in Space Data and Information Sciences - Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771 - - Support and updates available at - http://cesdis.gsfc.nasa.gov/linux/drivers/rtl8139.html - - Twister-tuning table provided by Kinston . -*/ - -static const char *version = -"rtl8129.c:v1.07 5/6/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/rtl8139.html\n"; - -/* A few user-configurable values. */ -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; -#define rtl8129_debug debug -static int rtl8129_debug = 1; - -/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). - The RTL chips use a 64 element hash table based on the Ethernet CRC. */ -static int multicast_filter_limit = 32; - -/* Used to pass the full-duplex flag, etc. */ -#define MAX_UNITS 8 /* More are supported, limit only on options */ -static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; - -/* Size of the in-memory receive ring. */ -#define RX_BUF_LEN_IDX 3 /* 0==8K, 1==16K, 2==32K, 3==64K */ -#define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) -/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */ -#define TX_BUF_SIZE 1536 - -/* PCI Tuning Parameters - Threshold is bytes transferred to chip before transmission starts. */ -#define TX_FIFO_THRESH 256 /* In bytes, rounded down to 32 byte units. */ - -/* The following settings are log_2(bytes)-4: 0 == 16 bytes .. 6==1024. */ -#define RX_FIFO_THRESH 4 /* Rx buffer level before first PCI xfer. */ -#define RX_DMA_BURST 4 /* Maximum PCI burst, '4' is 256 bytes */ -#define TX_DMA_BURST 4 /* Calculate as 16< -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* Processor type for cache alignment. */ -#include -#include - -/* Kernel compatibility defines, some common to David Hind's PCMCIA package. - This is only in the support-all-kernels source code. */ - -#define RUN_AT(x) (jiffies + (x)) - -#include - -#if LINUX_VERSION_CODE < 0x20123 -#define test_and_set_bit(val, addr) set_bit(val, addr) -#endif -#if LINUX_VERSION_CODE <= 0x20139 -#define net_device_stats enet_statistics -#else -#define NETSTATS_VER2 -#endif -#if LINUX_VERSION_CODE < 0x20155 || defined(CARDBUS) -/* Grrrr, the PCI code changed, but did not consider CardBus... */ -#include -#define PCI_SUPPORT_VER1 -#else -#define PCI_SUPPORT_VER2 -#endif - -/* The I/O extent. */ -#define RTL8129_TOTAL_SIZE 0x80 - -/* - Theory of Operation - -I. Board Compatibility - -This device driver is designed for the RealTek RTL8129, the RealTek Fast -Ethernet controllers for PCI. This chip is used on a few clone boards. - - -II. Board-specific settings - -PCI bus devices are configured by the system at boot time, so no jumpers -need to be set on the board. The system BIOS will assign the -PCI INTA signal to a (preferably otherwise unused) system IRQ line. -Note: Kernel versions earlier than 1.3.73 do not support shared PCI -interrupt lines. - -III. Driver operation - -IIIa. Rx Ring buffers - -The receive unit uses a single linear ring buffer rather than the more -common (and more efficient) descriptor-based architecture. Incoming frames -are sequentially stored into the Rx region, and the host copies them into -skbuffs. - -Comment: While it is theoretically possible to process many frames in place, -any delay in Rx processing would cause us to drop frames. More importantly, -the Linux protocol stack is not designed to operate in this manner. - -IIIb. Tx operation - -The RTL8129 uses a fixed set of four Tx descriptors in register space. -In a stunningly bad design choice, Tx frames must be 32 bit aligned. Linux -aligns the IP header on word boundaries, and 14 byte ethernet header means -that almost all frames will need to be copied to an alignment buffer. - -IVb. References - -http://www.realtek.com.tw/cn/cn.html -http://cesdis.gsfc.nasa.gov/linux/misc/NWay.html - -IVc. Errata - -*/ - - -/* This table drives the PCI probe routines. It's mostly boilerplate in all - of the drivers, and will likely be provided by some future kernel. - Note the matching code -- the first table entry matchs all 56** cards but - second only the 1234 card. -*/ -enum pci_flags_bit { - PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, - PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3, -}; -struct pci_id_info { - const char *name; - u16 vendor_id, device_id, device_id_mask, flags; - int io_size; - struct net_device *(*probe1)(struct pci_dev *pdev, int pci_bus, int pci_devfn, long ioaddr, int irq, int chip_idx, int fnd_cnt); -}; - -static struct net_device * rtl8129_probe1(struct pci_dev *pdev, int pci_bus, - int pci_devfn, long ioaddr, - int irq, int chp_idx, int fnd_cnt); - -static struct pci_id_info pci_tbl[] = -{{ "RealTek RTL8129 Fast Ethernet", - 0x10ec, 0x8129, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1}, -#ifdef USE_8139_SUPPORT_ALSO - { "RealTek RTL8139 Fast Ethernet", - 0x10ec, 0x8139, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1}, - { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", - 0x1113, 0x1211, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1}, - { "Accton MPX5030 (RealTek RTL8139)", - 0x1113, 0x1211, 0xffff, PCI_USES_IO|PCI_USES_MASTER, 0x80, rtl8129_probe1}, -#endif - {0,}, /* 0 terminated list. */ -}; - -/* The capability table matches the chip table above. */ -enum {HAS_MII_XCVR=0x01, HAS_CHIP_XCVR=0x02, HAS_LNK_CHNG=0x04}; -static int rtl_cap_tbl[] = { - HAS_MII_XCVR, HAS_CHIP_XCVR|HAS_LNK_CHNG, HAS_CHIP_XCVR|HAS_LNK_CHNG, -}; - - -/* The rest of these values should never change. */ -#define NUM_TX_DESC 4 /* Number of Tx descriptor registers. */ - -/* Symbolic offsets to registers. */ -enum RTL8129_registers { - MAC0=0, /* Ethernet hardware address. */ - MAR0=8, /* Multicast filter. */ - TxStatus0=0x10, /* Transmit status (Four 32bit registers). */ - TxAddr0=0x20, /* Tx descriptors (also four 32bit). */ - RxBuf=0x30, RxEarlyCnt=0x34, RxEarlyStatus=0x36, - ChipCmd=0x37, RxBufPtr=0x38, RxBufAddr=0x3A, - IntrMask=0x3C, IntrStatus=0x3E, - TxConfig=0x40, RxConfig=0x44, - Timer=0x48, /* A general-purpose counter. */ - RxMissed=0x4C, /* 24 bits valid, write clears. */ - Cfg9346=0x50, Config0=0x51, Config1=0x52, - FlashReg=0x54, GPPinData=0x58, GPPinDir=0x59, MII_SMI=0x5A, HltClk=0x5B, - MultiIntr=0x5C, TxSummary=0x60, - MII_BMCR=0x62, MII_BMSR=0x64, NWayAdvert=0x66, NWayLPAR=0x68, - NWayExpansion=0x6A, - /* Undocumented registers, but required for proper operation. */ - FIFOTMS=0x70, /* FIFO Test Mode Select */ - CSCR=0x74, /* Chip Status and Configuration Register. */ - PARA78=0x78, PARA7c=0x7c, /* Magic transceiver parameter register. */ -}; - -enum ChipCmdBits { - CmdReset=0x10, CmdRxEnb=0x08, CmdTxEnb=0x04, RxBufEmpty=0x01, }; - -/* Interrupt register bits, using my own meaningful names. */ -enum IntrStatusBits { - PCIErr=0x8000, PCSTimeout=0x4000, - RxFIFOOver=0x40, RxUnderrun=0x20, RxOverflow=0x10, - TxErr=0x08, TxOK=0x04, RxErr=0x02, RxOK=0x01, -}; -enum TxStatusBits { - TxHostOwns=0x2000, TxUnderrun=0x4000, TxStatOK=0x8000, - TxOutOfWindow=0x20000000, TxAborted=0x40000000, TxCarrierLost=0x80000000, -}; -enum RxStatusBits { - RxMulticast=0x8000, RxPhysical=0x4000, RxBroadcast=0x2000, - RxBadSymbol=0x0020, RxRunt=0x0010, RxTooLong=0x0008, RxCRCErr=0x0004, - RxBadAlign=0x0002, RxStatusOK=0x0001, -}; - -/* Twister tuning parameters from RealTek. - Completely undocumented, but required to tune bad links. */ -enum CSCRBits { - CSCR_LinkOKBit=0x0400, CSCR_LinkChangeBit=0x0800, - CSCR_LinkStatusBits=0x0f000, CSCR_LinkDownOffCmd=0x003c0, - CSCR_LinkDownCmd=0x0f3c0, -}; -static const unsigned long param[4][4]={ - {0x0cb39de43,0x0cb39ce43,0x0fb38de03,0x0cb38de43}, - {0x0cb39de43,0x0cb39ce43,0x0cb39ce83,0x0cb39ce83}, - {0x0cb39de43,0x0cb39ce43,0x0cb39ce83,0x0cb39ce83}, - {0x0bb39de43,0x0bb39ce43,0x0bb39ce83,0x0bb39ce83} -}; - -struct ring_info { - struct sk_buff *skb; - dma_addr_t mapping; -}; - -struct rtl8129_private { - char devname[8]; /* Used only for kernel debugging. */ - const char *product_name; - struct net_device *next_module; - struct pci_dev *pdev; - int chip_id; - int chip_revision; - unsigned char pci_bus, pci_devfn; - struct net_device_stats stats; - struct timer_list timer; /* Media selection timer. */ - unsigned int cur_rx; /* Index into the Rx buffer of next Rx pkt. */ - unsigned int cur_tx, dirty_tx, tx_flag; - /* The saved address of a sent-in-place packet/buffer, for skfree(). */ - struct ring_info tx_info[NUM_TX_DESC]; - unsigned char *tx_buf[NUM_TX_DESC]; /* Tx bounce buffers */ - unsigned char *rx_ring; - unsigned char *tx_bufs; /* Tx bounce buffer region. */ - dma_addr_t rx_ring_dma; - dma_addr_t tx_bufs_dma; - char phys[4]; /* MII device addresses. */ - char twistie, twist_cnt; /* Twister tune state. */ - unsigned int tx_full:1; /* The Tx queue is full. */ - unsigned int full_duplex:1; /* Full-duplex operation requested. */ - unsigned int duplex_lock:1; - unsigned int default_port:4; /* Last dev->if_port value. */ - unsigned int media2:4; /* Secondary monitored media port. */ - unsigned int medialock:1; /* Don't sense media type. */ - unsigned int mediasense:1; /* Media sensing in progress. */ -}; - -MODULE_AUTHOR("Donald Becker "); -MODULE_DESCRIPTION("RealTek RTL8129 Fast Ethernet driver"); -MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM(multicast_filter_limit, "i"); -MODULE_PARM(max_interrupt_work, "i"); -MODULE_PARM(debug, "i"); - -static int rtl8129_open(struct net_device *dev); -static int read_eeprom(long ioaddr, int location); -static int mdio_read(struct net_device *dev, int phy_id, int location); -static void mdio_write(struct net_device *dev, int phy_id, int location, int val); -static void rtl8129_timer(unsigned long data); -static void rtl8129_tx_timeout(struct net_device *dev); -static void rtl8129_init_ring(struct net_device *dev); -static int rtl8129_start_xmit(struct sk_buff *skb, struct net_device *dev); -static int rtl8129_rx(struct net_device *dev); -static void rtl8129_interrupt(int irq, void *dev_instance, struct pt_regs *regs); -static int rtl8129_close(struct net_device *dev); -static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static struct net_device_stats *rtl8129_get_stats(struct net_device *dev); -static inline u32 ether_crc(int length, unsigned char *data); -static void set_rx_mode(struct net_device *dev); - - -/* A list of all installed RTL8129 devices, for removing the driver module. */ -static struct net_device *root_rtl8129_dev = NULL; - -/* Ideally we would detect all network cards in slot order. That would - be best done a central PCI probe dispatch, which wouldn't work - well when dynamically adding drivers. So instead we detect just the - Rtl81*9 cards in slot order. */ - -static int __init rtl8129_probe(void) -{ - int cards_found = 0; - int pci_index = 0; - unsigned char pci_bus, pci_device_fn; - struct net_device *dev; - - if ( ! pcibios_present()) - return -ENODEV; - - for (; pci_index < 0xff; pci_index++) { - struct pci_dev *pdev; - u16 vendor, device, pci_command, new_command; - int chip_idx, irq; - long ioaddr; - - if (pcibios_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pci_index, - &pci_bus, &pci_device_fn) - != PCIBIOS_SUCCESSFUL) - break; - pcibios_read_config_word(pci_bus, pci_device_fn, - PCI_VENDOR_ID, &vendor); - pcibios_read_config_word(pci_bus, pci_device_fn, - PCI_DEVICE_ID, &device); - - for (chip_idx = 0; pci_tbl[chip_idx].vendor_id; chip_idx++) - if (vendor == pci_tbl[chip_idx].vendor_id - && (device & pci_tbl[chip_idx].device_id_mask) == - pci_tbl[chip_idx].device_id) - break; - if (pci_tbl[chip_idx].vendor_id == 0) /* Compiled out! */ - continue; - - pdev = pci_find_slot(pci_bus, pci_device_fn); - - ioaddr = pci_resource_start(pdev, 0); - irq = pdev->irq; - - if (pci_enable_device(pdev)) - continue; - - if ((pci_tbl[chip_idx].flags & PCI_USES_IO) && - check_region(ioaddr, pci_tbl[chip_idx].io_size)) - continue; - - /* Activate the card: fix for brain-damaged Win98 BIOSes. */ - pcibios_read_config_word(pci_bus, pci_device_fn, - PCI_COMMAND, &pci_command); - new_command = pci_command | (pci_tbl[chip_idx].flags & 7); - if (pci_command != new_command) { - printk(KERN_INFO " The PCI BIOS has not enabled the" - " device at %d/%d! Updating PCI command %4.4x->%4.4x.\n", - pci_bus, pci_device_fn, pci_command, new_command); - pcibios_write_config_word(pci_bus, pci_device_fn, - PCI_COMMAND, new_command); - } - - dev = pci_tbl[chip_idx].probe1(pdev, pci_bus, pci_device_fn, ioaddr, irq, chip_idx, cards_found); - - if (dev && (pci_tbl[chip_idx].flags & PCI_COMMAND_MASTER)) { - u8 pci_latency; - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_LATENCY_TIMER, &pci_latency); - if (pci_latency < 32) { - printk(KERN_NOTICE " PCI latency timer (CFLT) is " - "unreasonably low at %d. Setting to 64 clocks.\n", - pci_latency); - pcibios_write_config_byte(pci_bus, pci_device_fn, - PCI_LATENCY_TIMER, 64); - } - } - dev = 0; - cards_found++; - } - - return cards_found ? 0 : -ENODEV; -} - -static struct net_device *rtl8129_probe1(struct pci_dev *pdev, int pci_bus, - int pci_devfn, long ioaddr, - int irq, int chip_idx, int found_cnt) -{ - static int did_version = 0; /* Already printed version info. */ - struct rtl8129_private *tp; - int i, option = found_cnt < MAX_UNITS ? options[found_cnt] : 0; - struct net_device *dev; - - if (rtl8129_debug > 0 && did_version++ == 0) - printk(KERN_INFO "%s", version); - - dev = init_etherdev(NULL, 0); - if (dev == NULL) - goto out; - - printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", - dev->name, pci_tbl[chip_idx].name, ioaddr, irq); - - /* Bring the chip out of low-power mode. */ - outb(0x00, ioaddr + Config1); - - if (read_eeprom(ioaddr, 0) != 0xffff) { - for (i = 0; i < 3; i++) { - ((u16 *)(dev->dev_addr))[i] = - le16_to_cpu(read_eeprom(ioaddr, i + 7)); - } - } else { - for (i = 0; i < 6; i++) - dev->dev_addr[i] = inb(ioaddr + MAC0 + i); - } - for (i = 0; i < 5; i++) - printk("%2.2x:", dev->dev_addr[i]); - printk("%2.2x.\n", dev->dev_addr[i]); - - /* We do a request_region() to register /proc/ioports info. */ - if (!request_region(ioaddr, pci_tbl[chip_idx].io_size, dev->name)) - goto out_free_dev; - - dev->base_addr = ioaddr; - dev->irq = irq; - - /* Some data structures must be quadword aligned. */ - tp = kmalloc(sizeof(*tp), GFP_KERNEL | GFP_DMA); - if (tp == NULL) - goto out_release_region; - - memset(tp, 0, sizeof(*tp)); - dev->priv = tp; - - tp->next_module = root_rtl8129_dev; - root_rtl8129_dev = dev; - - tp->pdev = pdev; - tp->chip_id = chip_idx; - tp->pci_bus = pci_bus; - tp->pci_devfn = pci_devfn; - - /* Find the connected MII xcvrs. - Doing this in open() would allow detecting external xcvrs later, but - takes too much time. */ - if (rtl_cap_tbl[chip_idx] & HAS_MII_XCVR) { - int phy, phy_idx; - for (phy = 0, phy_idx = 0; phy < 32 && phy_idx < sizeof(tp->phys); - phy++) { - int mii_status = mdio_read(dev, phy, 1); - if (mii_status != 0xffff && mii_status != 0x0000) { - tp->phys[phy_idx++] = phy; - printk(KERN_INFO "%s: MII transceiver found at address %d.\n", - dev->name, phy); - } - } - if (phy_idx == 0) { - printk(KERN_INFO "%s: No MII transceivers found! Assuming SYM " - "transceiver.\n", - dev->name); - tp->phys[0] = -1; - } - } else - tp->phys[0] = 32; - - /* Put the chip into low-power mode. */ - outb(0xC0, ioaddr + Cfg9346); - outb(0x03, ioaddr + Config1); - outb('H', ioaddr + HltClk); /* 'R' would leave the clock running. */ - - /* The lower four bits are the media type. */ - if (option > 0) { - tp->full_duplex = (option & 0x200) ? 1 : 0; - tp->default_port = option & 15; - if (tp->default_port) - tp->medialock = 1; - } - - if (found_cnt < MAX_UNITS && full_duplex[found_cnt] > 0) - tp->full_duplex = full_duplex[found_cnt]; - - if (tp->full_duplex) { - printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); - mdio_write(dev, tp->phys[0], 4, 0x141); - tp->duplex_lock = 1; - } - - /* The Rtl8129-specific entries in the device structure. */ - dev->open = &rtl8129_open; - dev->hard_start_xmit = &rtl8129_start_xmit; - dev->tx_timeout = &rtl8129_tx_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - dev->stop = &rtl8129_close; - dev->get_stats = &rtl8129_get_stats; - dev->set_multicast_list = &set_rx_mode; - dev->do_ioctl = &mii_ioctl; - return dev; - -out_release_region: - release_region(ioaddr, pci_tbl[chip_idx].io_size); -out_free_dev: - unregister_netdev(dev); - kfree(dev); -out: - return NULL; -} - -/* Serial EEPROM section. */ - -/* EEPROM_Ctrl bits. */ -#define EE_SHIFT_CLK 0x04 /* EEPROM shift clock. */ -#define EE_CS 0x08 /* EEPROM chip select. */ -#define EE_DATA_WRITE 0x02 /* EEPROM chip data in. */ -#define EE_WRITE_0 0x00 -#define EE_WRITE_1 0x02 -#define EE_DATA_READ 0x01 /* EEPROM chip data out. */ -#define EE_ENB (0x80 | EE_CS) - -/* Delay between EEPROM clock transitions. - No extra delay is needed with 33Mhz PCI, but 66Mhz may change this. - */ - -#define eeprom_delay() inl(ee_addr) - -/* The EEPROM commands include the alway-set leading bit. */ -#define EE_WRITE_CMD (5 << 6) -#define EE_READ_CMD (6 << 6) -#define EE_ERASE_CMD (7 << 6) - -static int read_eeprom(long ioaddr, int location) -{ - int i; - unsigned retval = 0; - long ee_addr = ioaddr + Cfg9346; - int read_cmd = location | EE_READ_CMD; - - outb(EE_ENB & ~EE_CS, ee_addr); - outb(EE_ENB, ee_addr); - - /* Shift the read command bits out. */ - for (i = 10; i >= 0; i--) { - int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0; - outb(EE_ENB | dataval, ee_addr); - eeprom_delay(); - outb(EE_ENB | dataval | EE_SHIFT_CLK, ee_addr); - eeprom_delay(); - } - outb(EE_ENB, ee_addr); - eeprom_delay(); - - for (i = 16; i > 0; i--) { - outb(EE_ENB | EE_SHIFT_CLK, ee_addr); - eeprom_delay(); - retval = (retval << 1) | ((inb(ee_addr) & EE_DATA_READ) ? 1 : 0); - outb(EE_ENB, ee_addr); - eeprom_delay(); - } - - /* Terminate the EEPROM access. */ - outb(~EE_CS, ee_addr); - return retval; -} - -/* MII serial management: mostly bogus for now. */ -/* Read and write the MII management registers using software-generated - serial MDIO protocol. - The maximum data clock rate is 2.5 Mhz. The minimum timing is usually - met by back-to-back PCI I/O cycles, but we insert a delay to avoid - "overclocking" issues. */ -#define MDIO_DIR 0x80 -#define MDIO_DATA_OUT 0x04 -#define MDIO_DATA_IN 0x02 -#define MDIO_CLK 0x01 -#define MDIO_WRITE0 (MDIO_DIR) -#define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT) - -#define mdio_delay() inb(mdio_addr) - -static char mii_2_8139_map[8] = {MII_BMCR, MII_BMSR, 0, 0, NWayAdvert, - NWayLPAR, NWayExpansion, 0 }; - -/* Syncronize the MII management interface by shifting 32 one bits out. */ -static void mdio_sync(long mdio_addr) -{ - int i; - - for (i = 32; i >= 0; i--) { - outb(MDIO_WRITE1, mdio_addr); - mdio_delay(); - outb(MDIO_WRITE1 | MDIO_CLK, mdio_addr); - mdio_delay(); - } - return; -} -static int mdio_read(struct net_device *dev, int phy_id, int location) -{ - long mdio_addr = dev->base_addr + MII_SMI; - int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; - int retval = 0; - int i; - - if (phy_id > 31) { /* Really a 8139. Use internal registers. */ - return location < 8 && mii_2_8139_map[location] ? - inw(dev->base_addr + mii_2_8139_map[location]) : 0; - } - mdio_sync(mdio_addr); - /* Shift the read command bits out. */ - for (i = 15; i >= 0; i--) { - int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0; - - outb(MDIO_DIR | dataval, mdio_addr); - mdio_delay(); - outb(MDIO_DIR | dataval | MDIO_CLK, mdio_addr); - mdio_delay(); - } - - /* Read the two transition, 16 data, and wire-idle bits. */ - for (i = 19; i > 0; i--) { - outb(0, mdio_addr); - mdio_delay(); - retval = (retval << 1) | ((inb(mdio_addr) & MDIO_DATA_IN) ? 1 : 0); - outb(MDIO_CLK, mdio_addr); - mdio_delay(); - } - return (retval>>1) & 0xffff; -} - -static void mdio_write(struct net_device *dev, int phy_id, int location, int value) -{ - long mdio_addr = dev->base_addr + MII_SMI; - int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value; - int i; - - if (phy_id > 31) { /* Really a 8139. Use internal registers. */ - if (location < 8 && mii_2_8139_map[location]) - outw(value, dev->base_addr + mii_2_8139_map[location]); - return; - } - mdio_sync(mdio_addr); - - /* Shift the command bits out. */ - for (i = 31; i >= 0; i--) { - int dataval = (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0; - outb(dataval, mdio_addr); - mdio_delay(); - outb(dataval | MDIO_CLK, mdio_addr); - mdio_delay(); - } - /* Clear out extra bits. */ - for (i = 2; i > 0; i--) { - outb(0, mdio_addr); - mdio_delay(); - outb(MDIO_CLK, mdio_addr); - mdio_delay(); - } - return; -} - - -static int -rtl8129_open(struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - int i, retval; - - MOD_INC_USE_COUNT; - - /* Soft reset the chip. */ - outb(CmdReset, ioaddr + ChipCmd); - - if ((retval = request_irq(dev->irq, &rtl8129_interrupt, SA_SHIRQ, dev->name, dev))) { - MOD_DEC_USE_COUNT; - return retval; - } - - tp->tx_bufs = pci_alloc_consistent(tp->pdev, - TX_BUF_SIZE * NUM_TX_DESC, - &tp->tx_bufs_dma); - tp->rx_ring = pci_alloc_consistent(tp->pdev, - RX_BUF_LEN + 16, - &tp->rx_ring_dma); - if (tp->tx_bufs == NULL || tp->rx_ring == NULL) { - free_irq(dev->irq, dev); - if (tp->tx_bufs) - pci_free_consistent(tp->pdev, - TX_BUF_SIZE * NUM_TX_DESC, - tp->tx_bufs, tp->tx_bufs_dma); - if (tp->rx_ring) - pci_free_consistent(tp->pdev, - RX_BUF_LEN + 16, - tp->rx_ring, tp->rx_ring_dma); - if (rtl8129_debug > 0) - printk(KERN_ERR "%s: Couldn't allocate a %d byte receive ring.\n", - dev->name, RX_BUF_LEN); - MOD_DEC_USE_COUNT; - return -ENOMEM; - } - rtl8129_init_ring(dev); - - /* Check that the chip has finished the reset. */ - for (i = 1000; i > 0; i--) - if ((inb(ioaddr + ChipCmd) & CmdReset) == 0) - break; - - for (i = 0; i < 6; i++) - outb(dev->dev_addr[i], ioaddr + MAC0 + i); - - /* Must enable Tx/Rx before setting transfer thresholds! */ - outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd); - outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) | (RX_DMA_BURST<<8), - ioaddr + RxConfig); - outl((TX_DMA_BURST<<8)|0x03000000, ioaddr + TxConfig); - tp->tx_flag = (TX_FIFO_THRESH<<11) & 0x003f0000; - - tp->full_duplex = tp->duplex_lock; - if (tp->phys[0] >= 0 || (rtl_cap_tbl[tp->chip_id] & HAS_MII_XCVR)) { - u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5); - if (mii_reg5 == 0xffff) - ; /* Not there */ - else if ((mii_reg5 & 0x0100) == 0x0100 - || (mii_reg5 & 0x00C0) == 0x0040) - tp->full_duplex = 1; - if (rtl8129_debug > 1) - printk(KERN_INFO"%s: Setting %s%s-duplex based on" - " auto-negotiated partner ability %4.4x.\n", dev->name, - mii_reg5 == 0 ? "" : - (mii_reg5 & 0x0180) ? "100mbps " : "10mbps ", - tp->full_duplex ? "full" : "half", mii_reg5); - } - - outb(0xC0, ioaddr + Cfg9346); - outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1); - outb(0x00, ioaddr + Cfg9346); - - outl(tp->rx_ring_dma, ioaddr + RxBuf); - - /* Start the chip's Tx and Rx process. */ - outl(0, ioaddr + RxMissed); - set_rx_mode(dev); - - outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd); - - /* Enable all known interrupts by setting the interrupt mask. */ - outw(PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver - | TxErr | TxOK | RxErr | RxOK, ioaddr + IntrMask); - - if (rtl8129_debug > 1) - printk(KERN_DEBUG"%s: rtl8129_open() ioaddr %#lx IRQ %d" - " GP Pins %2.2x %s-duplex.\n", - dev->name, ioaddr, dev->irq, inb(ioaddr + GPPinData), - tp->full_duplex ? "full" : "half"); - - /* Set the timer to switch to check for link beat and perhaps switch - to an alternate media type. */ - init_timer(&tp->timer); - tp->timer.expires = RUN_AT((24*HZ)/10); /* 2.4 sec. */ - tp->timer.data = (unsigned long)dev; - tp->timer.function = &rtl8129_timer; - add_timer(&tp->timer); - - return 0; -} - -static void rtl8129_timer(unsigned long data) -{ - struct net_device *dev = (struct net_device *)data; - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - int next_tick = 60*HZ; - int mii_reg5 = mdio_read(dev, tp->phys[0], 5); - - if (! tp->duplex_lock && mii_reg5 != 0xffff) { - int duplex = (mii_reg5&0x0100) || (mii_reg5 & 0x01C0) == 0x0040; - if (tp->full_duplex != duplex) { - tp->full_duplex = duplex; - printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link" - " partner ability of %4.4x.\n", dev->name, - tp->full_duplex ? "full" : "half", tp->phys[0], mii_reg5); - outb(0xC0, ioaddr + Cfg9346); - outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1); - outb(0x00, ioaddr + Cfg9346); - } - } - /* Check for bogusness. */ - if (inw(ioaddr + IntrStatus) & (TxOK | RxOK)) { - int status = inw(ioaddr + IntrStatus); - if (status & (TxOK | RxOK)) { /* Double check */ - printk(KERN_ERR "%s: RTL8129 Interrupt line blocked, status %x.\n", - dev->name, status); - rtl8129_interrupt(dev->irq, dev, 0); - } - } - if (netif_queue_stopped(dev) && - (jiffies - dev->trans_start) >= 2*TX_TIMEOUT) - rtl8129_tx_timeout(dev); - -#if 0 - if (tp->twistie) { - unsigned int CSCRval = inw(ioaddr + CSCR); /* Read link status. */ - if (tp->twistie == 1) { - if (CSCRval & CSCR_LinkOKBit) { - outw(CSCR_LinkDownOffCmd, ioaddr + CSCR); - tp->twistie = 2; - next_tick = HZ/10; - } else { - outw(CSCR_LinkDownCmd, ioaddr + CSCR); - outl(FIFOTMS_default,ioaddr + FIFOTMS); - outl(PARA78_default ,ioaddr + PARA78); - outl(PARA7c_default ,ioaddr + PARA7c); - tp->twistie = 0; - } - } else if (tp->twistie == 2) { - int linkcase = (CSCRval & CSCR_LinkStatusBits) >> 12; - int row; - if (linkcase >= 0x7000) row = 3; - else if (linkcase >= 0x3000) row = 2; - else if (linkcase >= 0x1000) row = 1; - else row = 0; - tp->twistie == row + 3; - outw(0,ioaddr+FIFOTMS); - outl(param[row][0], ioaddr+PARA7c); - tp->twist_cnt = 1; - } else { - outl(param[tp->twistie-3][tp->twist_cnt], ioaddr+PARA7c); - if (++tp->twist_cnt < 4) { - next_tick = HZ/10; - } else if (tp->twistie-3 == 3) { - if ((CSCRval & CSCR_LinkStatusBits) != 0x7000) { - outl(PARA7c_xxx, ioaddr+PARA7c); - next_tick = HZ/10; /* 100ms. */ - outl(FIFOTMS_default, ioaddr+FIFOTMS); - outl(PARA78_default, ioaddr+PARA78); - outl(PARA7c_default, ioaddr+PARA7c); - tp->twistie == 3 + 3; - outw(0,ioaddr+FIFOTMS); - outl(param[3][0], ioaddr+PARA7c); - tp->twist_cnt = 1; - } - } - } - } -#endif - - if (rtl8129_debug > 2) { - if (rtl_cap_tbl[tp->chip_id] & HAS_MII_XCVR) - printk(KERN_DEBUG"%s: Media selection tick, GP pins %2.2x.\n", - dev->name, inb(ioaddr + GPPinData)); - else - printk(KERN_DEBUG"%s: Media selection tick, Link partner %4.4x.\n", - dev->name, inw(ioaddr + NWayLPAR)); - printk(KERN_DEBUG"%s: Other registers are IntMask %4.4x IntStatus %4.4x" - " RxStatus %4.4x.\n", - dev->name, inw(ioaddr + IntrMask), inw(ioaddr + IntrStatus), - inl(ioaddr + RxEarlyStatus)); - printk(KERN_DEBUG"%s: Chip config %2.2x %2.2x.\n", - dev->name, inb(ioaddr + Config0), inb(ioaddr + Config1)); - } - - tp->timer.expires = RUN_AT(next_tick); - add_timer(&tp->timer); -} - -static void rtl8129_tx_timeout(struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - int mii_reg, i; - - if (rtl8129_debug > 0) - printk(KERN_WARNING "%s: Transmit timeout, status %2.2x %4.4x " - "media %2.2x.\n", - dev->name, inb(ioaddr + ChipCmd), inw(ioaddr + IntrStatus), - inb(ioaddr + GPPinData)); - - /* Disable interrupts by clearing the interrupt mask. */ - outw(0x0000, ioaddr + IntrMask); - /* Emit info to figure out what went wrong. */ - printk("%s: Tx queue start entry %d dirty entry %d.\n", - dev->name, tp->cur_tx, tp->dirty_tx); - for (i = 0; i < NUM_TX_DESC; i++) - printk(KERN_DEBUG"%s: Tx descriptor %d is %8.8x.%s\n", - dev->name, i, inl(ioaddr + TxStatus0 + i*4), - i == tp->dirty_tx % NUM_TX_DESC ? " (queue head)" : ""); - printk(KERN_DEBUG"%s: MII #%d registers are:", dev->name, tp->phys[0]); - for (mii_reg = 0; mii_reg < 8; mii_reg++) - printk(" %4.4x", mdio_read(dev, tp->phys[0], mii_reg)); - printk(".\n"); - - /* Soft reset the chip. */ - outb(CmdReset, ioaddr + ChipCmd); - /* Check that the chip has finished the reset. */ - for (i = 1000; i > 0; i--) - if ((inb(ioaddr + ChipCmd) & CmdReset) == 0) - break; - for (i = 0; i < 6; i++) - outb(dev->dev_addr[i], ioaddr + MAC0 + i); - - outb(0x00, ioaddr + Cfg9346); - tp->cur_rx = 0; - /* Must enable Tx/Rx before setting transfer thresholds! */ - outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd); - outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) | (RX_DMA_BURST<<8), - ioaddr + RxConfig); - outl((TX_DMA_BURST<<8), ioaddr + TxConfig); - set_rx_mode(dev); - { /* Save the unsent Tx packets. */ - struct sk_buff *saved_skb[NUM_TX_DESC], *skb; - int j; - for (j = 0; tp->cur_tx - tp->dirty_tx > 0 ; j++, tp->dirty_tx++) { - struct ring_info *rp = &tp->tx_info[tp->dirty_tx % NUM_TX_DESC]; - - saved_skb[j] = rp->skb; - if (rp->mapping != 0) { - pci_unmap_single(tp->pdev, rp->mapping, rp->skb->len, PCI_DMA_TODEVICE); - rp->mapping = 0; - } - } - tp->dirty_tx = tp->cur_tx = 0; - - for (i = 0; i < j; i++) { - skb = tp->tx_info[i].skb = saved_skb[i]; - if ((long)skb->data & 3) { /* Must use alignment buffer. */ - memcpy(tp->tx_buf[i], skb->data, skb->len); - outl(tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs), - ioaddr + TxAddr0 + i*4); - } else { - tp->tx_info[i].mapping = - pci_map_single(tp->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); - outl(tp->tx_info[i].mapping, ioaddr + TxAddr0 + i*4); - } - /* Note: the chip doesn't have auto-pad! */ - outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN), - ioaddr + TxStatus0 + i*4); - } - tp->cur_tx = i; - while (i < NUM_TX_DESC) { - tp->tx_info[i].skb = NULL; - tp->tx_info[i].mapping = 0; - i++; - } - if (tp->cur_tx - tp->dirty_tx < NUM_TX_DESC) {/* Typical path */ - netif_wake_queue(dev); - tp->tx_full = 0; - } else { - tp->tx_full = 1; - netif_stop_queue(dev); - } - } - - dev->trans_start = jiffies; - tp->stats.tx_errors++; - /* Enable all known interrupts by setting the interrupt mask. */ - outw(PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver - | TxErr | TxOK | RxErr | RxOK, ioaddr + IntrMask); - return; -} - - -/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ -static void -rtl8129_init_ring(struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - int i; - - tp->tx_full = 0; - tp->cur_rx = 0; - tp->dirty_tx = tp->cur_tx = 0; - - for (i = 0; i < NUM_TX_DESC; i++) { - tp->tx_buf[i] = &tp->tx_bufs[i*TX_BUF_SIZE]; - tp->tx_info[i].skb = NULL; - tp->tx_info[i].mapping = 0; - } -} - -static int -rtl8129_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - int entry; - - netif_stop_queue(dev); - - /* Calculate the next Tx descriptor entry. */ - entry = tp->cur_tx % NUM_TX_DESC; - - tp->tx_info[entry].skb = skb; - if ((long)skb->data & 3) { /* Must use alignment buffer. */ - tp->tx_info[entry].mapping = 0; - memcpy(tp->tx_buf[entry], skb->data, skb->len); - outl(tp->tx_bufs_dma + (tp->tx_buf[entry] - tp->tx_bufs), - ioaddr + TxAddr0 + entry*4); - } else { - tp->tx_info[entry].mapping = - pci_map_single(tp->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); - outl(tp->tx_info[entry].mapping, ioaddr + TxAddr0 + entry*4); - } - /* Note: the chip doesn't have auto-pad! */ - outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN), - ioaddr + TxStatus0 + entry*4); - - if (++tp->cur_tx - tp->dirty_tx < NUM_TX_DESC) { /* Typical path */ - netif_start_queue(dev); - } else { - tp->tx_full = 1; - } - - dev->trans_start = jiffies; - if (rtl8129_debug > 4) - printk(KERN_DEBUG"%s: Queued Tx packet at %p size %d to slot %d.\n", - dev->name, skb->data, (int)skb->len, entry); - - return 0; -} - -/* The interrupt handler does all of the Rx thread work and cleans up - after the Tx thread. */ -static void rtl8129_interrupt(int irq, void *dev_instance, struct pt_regs *regs) -{ - struct net_device *dev = (struct net_device *)dev_instance; - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - int boguscnt = max_interrupt_work; - int status, link_changed = 0; - long ioaddr = dev->base_addr; - - do { - status = inw(ioaddr + IntrStatus); - /* Acknowledge all of the current interrupt sources ASAP, but - an first get an additional status bit from CSCR. */ - if ((status & RxUnderrun) && inw(ioaddr+CSCR) & CSCR_LinkChangeBit) - link_changed = 1; - outw(status, ioaddr + IntrStatus); - - if (rtl8129_debug > 4) - printk(KERN_DEBUG"%s: interrupt status=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, inw(ioaddr + IntrStatus)); - - if ((status & (PCIErr|PCSTimeout|RxUnderrun|RxOverflow|RxFIFOOver - |TxErr|TxOK|RxErr|RxOK)) == 0) - break; - - if (status & (RxOK|RxUnderrun|RxOverflow|RxFIFOOver))/* Rx interrupt */ - rtl8129_rx(dev); - - if (status & (TxOK | TxErr)) { - unsigned int dirty_tx = tp->dirty_tx; - - while (tp->cur_tx - dirty_tx > 0) { - int entry = dirty_tx % NUM_TX_DESC; - int txstatus = inl(ioaddr + TxStatus0 + entry*4); - - if ( ! (txstatus & (TxStatOK | TxUnderrun | TxAborted))) - break; /* It still hasn't been Txed */ - - /* Note: TxCarrierLost is always asserted at 100mbps. */ - if (txstatus & (TxOutOfWindow | TxAborted)) { - /* There was an major error, log it. */ - if (rtl8129_debug > 1) - printk(KERN_NOTICE"%s: Transmit error, Tx status %8.8x.\n", - dev->name, txstatus); - tp->stats.tx_errors++; - if (txstatus&TxAborted) { - tp->stats.tx_aborted_errors++; - outl((TX_DMA_BURST<<8)|0x03000001, ioaddr + TxConfig); - } - if (txstatus&TxCarrierLost) tp->stats.tx_carrier_errors++; - if (txstatus&TxOutOfWindow) tp->stats.tx_window_errors++; -#ifdef ETHER_STATS - if ((txstatus & 0x0f000000) == 0x0f000000) - tp->stats.collisions16++; -#endif - } else { - if (txstatus & TxUnderrun) { - /* Add 64 to the Tx FIFO threshold. */ - if (tp->tx_flag < 0x00300000) - tp->tx_flag += 0x00020000; - tp->stats.tx_fifo_errors++; - } - tp->stats.collisions += (txstatus >> 24) & 15; -#if LINUX_VERSION_CODE > 0x20119 - tp->stats.tx_bytes += txstatus & 0x7ff; -#endif - tp->stats.tx_packets++; - } - - if (tp->tx_info[entry].mapping != 0) { - pci_unmap_single(tp->pdev, - tp->tx_info[entry].mapping, - tp->tx_info[entry].skb->len, - PCI_DMA_TODEVICE); - tp->tx_info[entry].mapping = 0; - } - - /* Free the original skb. */ - dev_kfree_skb_irq(tp->tx_info[entry].skb); - tp->tx_info[entry].skb = NULL; - if (tp->tx_full) { - /* The ring is no longer full, wake the queue. */ - tp->tx_full = 0; - netif_wake_queue(dev); - } - dirty_tx++; - } - -#ifndef final_version - if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { - printk(KERN_ERR"%s: Out-of-sync dirty pointer, %d vs. %d, full=%d.\n", - dev->name, dirty_tx, tp->cur_tx, tp->tx_full); - dirty_tx += NUM_TX_DESC; - } -#endif - tp->dirty_tx = dirty_tx; - } - - /* Check uncommon events with one test. */ - if (status & (PCIErr|PCSTimeout |RxUnderrun|RxOverflow|RxFIFOOver - |TxErr|RxErr)) { - if (rtl8129_debug > 2) - printk(KERN_NOTICE"%s: Abnormal interrupt, status %8.8x.\n", - dev->name, status); - - if (status == 0xffffffff) - break; - /* Update the error count. */ - tp->stats.rx_missed_errors += inl(ioaddr + RxMissed); - outl(0, ioaddr + RxMissed); - - if ((status & RxUnderrun) && link_changed && - (rtl_cap_tbl[tp->chip_id] & HAS_LNK_CHNG)) { - /* Really link-change on new chips. */ - int lpar = inw(ioaddr + NWayLPAR); - int duplex = (lpar&0x0100)||(lpar & 0x01C0) == 0x0040; - if (tp->full_duplex != duplex) { - tp->full_duplex = duplex; - outb(0xC0, ioaddr + Cfg9346); - outb(tp->full_duplex ? 0x60 : 0x20, ioaddr + Config1); - outb(0x00, ioaddr + Cfg9346); - } - status &= ~RxUnderrun; - } - if (status & (RxUnderrun | RxOverflow | RxErr | RxFIFOOver)) - tp->stats.rx_errors++; - - if (status & (PCSTimeout)) tp->stats.rx_length_errors++; - if (status & (RxUnderrun|RxFIFOOver)) tp->stats.rx_fifo_errors++; - if (status & RxOverflow) { - tp->stats.rx_over_errors++; - tp->cur_rx = inw(ioaddr + RxBufAddr) % RX_BUF_LEN; - outw(tp->cur_rx - 16, ioaddr + RxBufPtr); - } - if (status & PCIErr) { - u32 pci_cmd_status; - pcibios_read_config_dword(tp->pci_bus, tp->pci_devfn, - PCI_COMMAND, &pci_cmd_status); - - printk(KERN_ERR "%s: PCI Bus error %4.4x.\n", - dev->name, pci_cmd_status); - } - } - if (--boguscnt < 0) { - printk(KERN_WARNING"%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", - dev->name, status); - /* Clear all interrupt sources. */ - outw(0xffff, ioaddr + IntrStatus); - break; - } - } while (1); - - if (rtl8129_debug > 3) - printk(KERN_DEBUG"%s: exiting interrupt, intr_status=%#4.4x.\n", - dev->name, inl(ioaddr + IntrStatus)); - return; -} - -/* The data sheet doesn't describe the Rx ring at all, so I'm guessing at the - field alignments and semantics. */ -static int rtl8129_rx(struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - unsigned char *rx_ring = tp->rx_ring; - u16 cur_rx = tp->cur_rx; - - if (rtl8129_debug > 4) - printk(KERN_DEBUG"%s: In rtl8129_rx(), current %4.4x BufAddr %4.4x," - " free to %4.4x, Cmd %2.2x.\n", - dev->name, cur_rx, inw(ioaddr + RxBufAddr), - inw(ioaddr + RxBufPtr), inb(ioaddr + ChipCmd)); - - while ((inb(ioaddr + ChipCmd) & 1) == 0) { - int ring_offset = cur_rx % RX_BUF_LEN; - u32 rx_status = le32_to_cpu(*(u32*)(rx_ring + ring_offset)); - int rx_size = rx_status >> 16; - - if (rtl8129_debug > 4) { - int i; - printk(KERN_DEBUG"%s: rtl8129_rx() status %4.4x, size %4.4x, cur %4.4x.\n", - dev->name, rx_status, rx_size, cur_rx); - printk(KERN_DEBUG"%s: Frame contents ", dev->name); - for (i = 0; i < 70; i++) - printk(" %2.2x", le32_to_cpu(rx_ring[ring_offset + i])); - printk(".\n"); - } - if (rx_status & RxTooLong) { - if (rtl8129_debug > 0) - printk(KERN_NOTICE"%s: Oversized Ethernet frame, status %4.4x!\n", - dev->name, rx_status); - tp->stats.rx_length_errors++; - } else if (rx_status & - (RxBadSymbol|RxRunt|RxTooLong|RxCRCErr|RxBadAlign)) { - if (rtl8129_debug > 1) - printk(KERN_DEBUG"%s: Ethernet frame had errors," - " status %4.4x.\n", dev->name, rx_status); - tp->stats.rx_errors++; - if (rx_status & (RxBadSymbol|RxBadAlign)) - tp->stats.rx_frame_errors++; - if (rx_status & (RxRunt|RxTooLong)) tp->stats.rx_length_errors++; - if (rx_status & RxCRCErr) tp->stats.rx_crc_errors++; - /* Reset the receiver, based on RealTek recommendation. (Bug?) */ - tp->cur_rx = 0; - outb(CmdTxEnb, ioaddr + ChipCmd); - outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd); - outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) | - (RX_DMA_BURST<<8), ioaddr + RxConfig); - } else { - /* Malloc up new buffer, compatible with net-2e. */ - /* Omit the four octet CRC from the length. */ - struct sk_buff *skb; - int pkt_size = rx_size - 4; - - skb = dev_alloc_skb(pkt_size + 2); - if (skb == NULL) { - printk(KERN_WARNING"%s: Memory squeeze, deferring packet.\n", - dev->name); - /* We should check that some rx space is free. - If not, free one and mark stats->rx_dropped++. */ - tp->stats.rx_dropped++; - break; - } - skb->dev = dev; - skb_reserve(skb, 2); /* 16 byte align the IP fields. */ - if (ring_offset+rx_size > RX_BUF_LEN) { - int semi_count = RX_BUF_LEN - ring_offset - 4; - memcpy(skb_put(skb, semi_count), &rx_ring[ring_offset + 4], - semi_count); - memcpy(skb_put(skb, pkt_size-semi_count), rx_ring, - pkt_size-semi_count); - if (rtl8129_debug > 4) { - int i; - printk(KERN_DEBUG"%s: Frame wrap @%d", - dev->name, semi_count); - for (i = 0; i < 16; i++) - printk(" %2.2x", le32_to_cpu(rx_ring[i])); - printk(".\n"); - memset(rx_ring, 0xcc, 16); - } - } else { -#if 1 /* USE_IP_COPYSUM */ - eth_copy_and_sum(skb, &rx_ring[ring_offset + 4], - pkt_size, 0); - skb_put(skb, pkt_size); -#else - memcpy(skb_put(skb, pkt_size), &rx_ring[ring_offset + 4], - pkt_size); -#endif - } - skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); -#if LINUX_VERSION_CODE > 0x20119 - tp->stats.rx_bytes += pkt_size; -#endif - tp->stats.rx_packets++; - } - - cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; - outw(cur_rx - 16, ioaddr + RxBufPtr); - } - if (rtl8129_debug > 4) - printk(KERN_DEBUG"%s: Done rtl8129_rx(), current %4.4x BufAddr %4.4x," - " free to %4.4x, Cmd %2.2x.\n", - dev->name, cur_rx, inw(ioaddr + RxBufAddr), - inw(ioaddr + RxBufPtr), inb(ioaddr + ChipCmd)); - tp->cur_rx = cur_rx; - return 0; -} - -static int -rtl8129_close(struct net_device *dev) -{ - long ioaddr = dev->base_addr; - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - int i; - - netif_stop_queue(dev); - - del_timer_sync(&tp->timer); - - if (rtl8129_debug > 1) - printk(KERN_DEBUG"%s: Shutting down ethercard, status was 0x%4.4x.\n", - dev->name, inw(ioaddr + IntrStatus)); - - /* Disable interrupts by clearing the interrupt mask. */ - outw(0x0000, ioaddr + IntrMask); - - /* Stop the chip's Tx and Rx DMA processes. */ - outb(0x00, ioaddr + ChipCmd); - - /* Update the error counts. */ - tp->stats.rx_missed_errors += inl(ioaddr + RxMissed); - outl(0, ioaddr + RxMissed); - - free_irq(dev->irq, dev); - - for (i = 0; i < NUM_TX_DESC; i++) { - struct sk_buff *skb = tp->tx_info[i].skb; - dma_addr_t mapping = tp->tx_info[i].mapping; - - if (skb) { - if (mapping) - pci_unmap_single(tp->pdev, mapping, skb->len, PCI_DMA_TODEVICE); - dev_kfree_skb(skb); - } - tp->tx_info[i].skb = NULL; - tp->tx_info[i].mapping = 0; - } - pci_free_consistent(tp->pdev, RX_BUF_LEN + 16, - tp->rx_ring, tp->rx_ring_dma); - pci_free_consistent(tp->pdev, TX_BUF_SIZE * NUM_TX_DESC, - tp->tx_bufs, tp->tx_bufs_dma); - tp->rx_ring = NULL; - tp->tx_bufs = NULL; - - /* Green! Put the chip in low-power mode. */ - outb(0xC0, ioaddr + Cfg9346); - outb(0x03, ioaddr + Config1); - outb('H', ioaddr + HltClk); /* 'R' would leave the clock running. */ - - MOD_DEC_USE_COUNT; - - return 0; -} - -static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - u16 *data = (u16 *)&rq->ifr_data; - - switch(cmd) { - case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ - data[0] = tp->phys[0] & 0x3f; - /* Fall Through */ - case SIOCDEVPRIVATE+1: /* Read the specified MII register. */ - data[3] = mdio_read(dev, data[0], data[1] & 0x1f); - return 0; - case SIOCDEVPRIVATE+2: /* Write the specified MII register */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - mdio_write(dev, data[0], data[1] & 0x1f, data[2]); - return 0; - default: - return -EOPNOTSUPP; - } -} - -static struct net_device_stats * -rtl8129_get_stats(struct net_device *dev) -{ - struct rtl8129_private *tp = (struct rtl8129_private *)dev->priv; - long ioaddr = dev->base_addr; - - if (netif_running(dev)) { - tp->stats.rx_missed_errors += inl(ioaddr + RxMissed); - outl(0, ioaddr + RxMissed); - } - - return &tp->stats; -} - -/* Set or clear the multicast filter for this adaptor. - This routine is not state sensitive and need not be SMP locked. */ - -static unsigned const ethernet_polynomial = 0x04c11db7U; -static inline u32 ether_crc(int length, unsigned char *data) -{ - int crc = -1; - - while (--length >= 0) { - unsigned char current_octet = *data++; - int bit; - for (bit = 0; bit < 8; bit++, current_octet >>= 1) - crc = (crc << 1) ^ - ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0); - } - return crc; -} - -/* Bits in RxConfig. */ -enum rx_mode_bits { - AcceptErr=0x20, AcceptRunt=0x10, AcceptBroadcast=0x08, - AcceptMulticast=0x04, AcceptMyPhys=0x02, AcceptAllPhys=0x01, -}; - -static void set_rx_mode(struct net_device *dev) -{ - long ioaddr = dev->base_addr; - u32 mc_filter[2]; /* Multicast hash filter */ - int i, rx_mode; - - if (rtl8129_debug > 3) - printk(KERN_DEBUG"%s: set_rx_mode(%4.4x) done -- Rx config %8.8x.\n", - dev->name, dev->flags, inl(ioaddr + RxConfig)); - - /* Note: do not reorder, GCC is clever about common statements. */ - if (dev->flags & IFF_PROMISC) { - /* Unconditionally log net taps. */ - printk(KERN_NOTICE"%s: Promiscuous mode enabled.\n", dev->name); - rx_mode = AcceptBroadcast|AcceptMulticast|AcceptMyPhys|AcceptAllPhys; - mc_filter[1] = mc_filter[0] = 0xffffffff; - } else if ((dev->mc_count > multicast_filter_limit) - || (dev->flags & IFF_ALLMULTI)) { - /* Too many to filter perfectly -- accept all multicasts. */ - rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; - mc_filter[1] = mc_filter[0] = 0xffffffff; - } else { - struct dev_mc_list *mclist; - rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; - mc_filter[1] = mc_filter[0] = 0; - for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter); - } - /* We can safely update without stopping the chip. */ - outb(rx_mode, ioaddr + RxConfig); - outl(mc_filter[0], ioaddr + MAR0 + 0); - outl(mc_filter[1], ioaddr + MAR0 + 4); - return; -} - - -static void __exit rtl8129_cleanup (void) -{ - struct net_device *next_dev; - - /* No need to check MOD_IN_USE, as sys_delete_module() checks. */ - while (root_rtl8129_dev) { - struct rtl8129_private *tp = - (struct rtl8129_private *)root_rtl8129_dev->priv; - next_dev = tp->next_module; - unregister_netdev(root_rtl8129_dev); - release_region(root_rtl8129_dev->base_addr, - pci_tbl[tp->chip_id].io_size); - kfree(tp); - kfree(root_rtl8129_dev); - root_rtl8129_dev = next_dev; - } -} - -module_init(rtl8129_probe); -module_exit(rtl8129_cleanup); - -/* - * Local variables: - * compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8129.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`" - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 4 - * End: - */ diff -u --recursive --new-file v2.4.2/linux/drivers/net/sis900.c linux/drivers/net/sis900.c --- v2.4.2/linux/drivers/net/sis900.c Wed Feb 21 18:20:28 2001 +++ linux/drivers/net/sis900.c Fri Mar 2 11:02:15 2001 @@ -18,6 +18,7 @@ preliminary Rev. 1.0 Jan. 18, 1998 http://www.sis.com.tw/support/databook.htm + Rev 1.07.09 Feb. 9 2001 Dave Jones PCI enable cleanup Rev 1.07.08 Jan. 8 2001 Lei-Chun Chang added RTL8201 PHY support Rev 1.07.07 Nov. 29 2000 Lei-Chun Chang added kernel-doc extractable documentation and 630 workaround fix Rev 1.07.06 Nov. 7 2000 Jeff Garzik some bug fix and cleaning @@ -60,7 +61,7 @@ #include "sis900.h" static const char *version = -"sis900.c: v1.07.08 1/8/2001\n"; +"sis900.c: v1.07.09 2/9/2001\n"; static int max_interrupt_work = 20; static int multicast_filter_limit = 128; @@ -252,10 +253,10 @@ static int __devinit sis900_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id) { struct sis900_private *sis_priv; - long ioaddr = pci_resource_start(pci_dev, 0); + long ioaddr; struct net_device *net_dev; - int irq = pci_dev->irq; - int i, ret = 0; + int irq; + int i, ret; u8 revision; char *card_name = card_names[pci_id->driver_data]; @@ -266,10 +267,14 @@ } /* setup various bits in PCI command register */ - if (pci_enable_device (pci_dev)) - return -ENODEV; + ret = pci_enable_device (pci_dev); + if (ret) return ret; + pci_set_master(pci_dev); + irq = pci_dev->irq; + ioaddr = pci_resource_start(pci_dev, 0); + net_dev = init_etherdev(NULL, sizeof(struct sis900_private)); if (!net_dev) return -ENOMEM; @@ -1469,14 +1474,14 @@ tx_status = sis_priv->tx_ring[entry].cmdsts; if (tx_status & OWN) { - /* The packet is not transmited yet (owned by hardware) ! + /* The packet is not transmitted yet (owned by hardware) ! Note: the interrupt is generated only when Tx Machine is idle, so this is an almost impossible case */ break; } if (tx_status & (ABORT | UNDERRUN | OWCOLL)) { - /* packet unsuccessfully transmited */ + /* packet unsuccessfully transmitted */ if (sis900_debug > 3) printk(KERN_INFO "%s: Transmit " "error, Tx status %8.8x.\n", @@ -1491,7 +1496,7 @@ if (tx_status & OWCOLL) sis_priv->stats.tx_window_errors++; } else { - /* packet successfully transmited */ + /* packet successfully transmitted */ sis_priv->stats.collisions += (tx_status & COLCNT) >> 16; sis_priv->stats.tx_bytes += tx_status & DSIZE; sis_priv->stats.tx_packets++; diff -u --recursive --new-file v2.4.2/linux/drivers/net/sundance.c linux/drivers/net/sundance.c --- v2.4.2/linux/drivers/net/sundance.c Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/sundance.c Fri Mar 2 11:02:15 2001 @@ -314,6 +314,7 @@ #define PRIV_ALIGN 15 /* Required alignment mask */ /* Use __attribute__((aligned (L1_CACHE_BYTES))) to maintain alignment within the structure. */ +#define MII_CNT 4 struct netdev_private { /* Descriptor rings first for alignment. */ struct netdev_desc rx_ring[RX_RING_SIZE]; @@ -346,7 +347,7 @@ /* MII transceiver section. */ int mii_cnt; /* MII device addresses. */ u16 advertising; /* NWay media advertisement */ - unsigned char phys[2]; /* MII device addresses. */ + unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ }; /* The station address location in the EEPROM. */ @@ -379,7 +380,7 @@ struct netdev_private *np; static int card_idx; int chip_idx = ent->driver_data; - int irq = pdev->irq; + int irq; int i, option = card_idx < MAX_UNITS ? options[card_idx] : 0; long ioaddr; @@ -387,19 +388,20 @@ return -EIO; pci_set_master(pdev); + irq = pdev->irq; + dev = init_etherdev(NULL, sizeof(*np)); if (!dev) return -ENOMEM; SET_MODULE_OWNER(dev); + if (pci_request_regions(pdev, dev->name)) + goto err_out_netdev; + #ifdef USE_IO_OPS ioaddr = pci_resource_start(pdev, 0); - if (!request_region(ioaddr, pci_id_tbl[chip_idx].io_size, dev->name)) - goto err_out_netdev; #else ioaddr = pci_resource_start(pdev, 1); - if (!request_mem_region(ioaddr, pci_id_tbl[chip_idx].io_size, dev->name)) - goto err_out_netdev; ioaddr = (long) ioremap (ioaddr, pci_id_tbl[chip_idx].io_size); if (!ioaddr) goto err_out_iomem; @@ -456,7 +458,7 @@ if (1) { int phy, phy_idx = 0; np->phys[0] = 1; /* Default setting */ - for (phy = 0; phy < 32 && phy_idx < 4; phy++) { + for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) { int mii_status = mdio_read(dev, phy, 1); if (mii_status != 0xffff && mii_status != 0x0000) { np->phys[phy_idx++] = phy; @@ -485,8 +487,7 @@ #ifndef USE_IO_OPS err_out_iomem: - release_mem_region(pci_resource_start(pdev, 1), - pci_id_tbl[chip_idx].io_size); + pci_release_regions(pdev); #endif err_out_netdev: unregister_netdev (dev); @@ -735,7 +736,9 @@ dev->trans_start = jiffies; np->stats.tx_errors++; - return; + + if (!np->tx_full) + netif_wake_queue(dev); } @@ -1233,11 +1236,8 @@ while (dev) { struct netdev_private *np = (void *)(dev->priv); unregister_netdev(dev); -#ifdef USE_IO_OPS - release_region(dev->base_addr, pci_id_tbl[np->chip_id].io_size); -#else - release_mem_region(pci_resource_start(pdev, 1), - pci_id_tbl[np->chip_id].io_size); + pci_release_regions(pdev); +#ifndef USE_IO_OPS iounmap((char *)(dev->base_addr)); #endif kfree(dev); diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/ChangeLog linux/drivers/net/tulip/ChangeLog --- v2.4.2/linux/drivers/net/tulip/ChangeLog Sat Feb 3 19:51:28 2001 +++ linux/drivers/net/tulip/ChangeLog Fri Mar 2 11:02:14 2001 @@ -1,3 +1,54 @@ +2001-02-20 Jeff Garzik + + * media.c (tulip_select_media): No need to initialize + new_csr6, all cases initialize it properly. + +2001-02-18 Manfred Spraul + + * interrupt.c (tulip_refill_rx): Make public. + If PNIC chip stops due to lack of Rx buffers, restart it. + (tulip_interrupt): PNIC doesn't have a h/w timer, emulate + with software timers. + * pnic.c (pnic_check_duplex): New function, PNIC-specific + version of tulip_check_duplex. + (pnic_lnk_change): Call pnic_check_duplex. If we use an + external MII, then we mustn't use the internal negotiation. + (pnic_timer): Support Rx refilling on work overflow in + interrupt handler, as PNIC doesn't support a h/w timer. + * tulip_core.c (tulip_tbl[]): Modify default csr6 + +2001-02-11 Jeff Garzik + + * tulip_core.c (tulip_init_one): Call pci_enable_device + to ensure wakeup/resource assignment before checking those + values. + (tulip_init_one): Replace PCI ids with constants from pci_id.h. + (tulip_suspend, tulip_resume, tulip_remove_one): Call + pci_power_on/off (commented out for now). + +2001-02-10 Jeff Garzik + + * tulip.h: Add CFDD_xxx bits for Tulip power management + * tulip_core.c (tulip_set_power_state): New function, + manipulating Tulip chip power state where supported. + (tulip_up, tulip_down, tulip_init_one): Use it. + +2001-02-10 Jeff Garzik + + * tulip_core.c (tulip_tx_timeout): Call netif_wake_queue + to ensure the next Tx is always sent to us. + +2001-01-27 Jeff Garzik + + * tulip_core.c (tulip_remove_one): Fix mem leak by freeing + tp->media_tbl. Add check for !dev, reformat code appropriately. + +2001-01-27 Jeff Garzik + + * tulip_tbl[]: Comment all entries to make order and chip_id + relationship more clear. + * tulip_pci_tbl[]: Add new Accton PCI id (COMET chipset). + 2001-01-16 Jeff Garzik * tulip_core.c: static vars no longer explicitly diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/interrupt.c linux/drivers/net/tulip/interrupt.c --- v2.4.2/linux/drivers/net/tulip/interrupt.c Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/tulip/interrupt.c Fri Mar 2 11:02:14 2001 @@ -23,7 +23,7 @@ -static int tulip_refill_rx(struct net_device *dev) +int tulip_refill_rx(struct net_device *dev) { struct tulip_private *tp = (struct tulip_private *)dev->priv; int entry; @@ -50,6 +50,14 @@ } tp->rx_ring[entry].status = cpu_to_le32(DescOwned); } + if(tp->chip_id == LC82C168) { + if(((inl(dev->base_addr + CSR5)>>17)&0x07) == 4) { + /* Rx stopped due to out of buffers, + * restart it + */ + outl(0x01, dev->base_addr + CSR2); + } + } return refilled; } @@ -332,7 +340,11 @@ /* Josip Loncaric at ICASE did extensive experimentation to develop a good interrupt mitigation setting.*/ outl(0x8b240000, ioaddr + CSR11); - } else { + } else if (tp->chip_id == LC82C168) { + /* the LC82C168 doesn't have a hw timer.*/ + outl(0x00, ioaddr + CSR7); + mod_timer(&tp->timer, RUN_AT(HZ/50)); + } else { /* Mask all interrupting sources, set timer to re-enable. */ outl(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7); @@ -355,14 +367,19 @@ if (tp->rx_buffers[entry].skb == NULL) { if (tulip_debug > 1) printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx); - if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) { - if (tulip_debug > 1) - printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir); - outl(tulip_tbl[tp->chip_id].valid_intrs | TimerInt, - ioaddr + CSR7); - outl(TimerInt, ioaddr + CSR5); - outl(12, ioaddr + CSR11); - tp->ttimer = 1; + if (tp->chip_id == LC82C168) { + outl(0x00, ioaddr + CSR7); + mod_timer(&tp->timer, RUN_AT(HZ/50)); + } else { + if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) { + if (tulip_debug > 1) + printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir); + outl(tulip_tbl[tp->chip_id].valid_intrs | TimerInt, + ioaddr + CSR7); + outl(TimerInt, ioaddr + CSR5); + outl(12, ioaddr + CSR11); + tp->ttimer = 1; + } } } diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/media.c linux/drivers/net/tulip/media.c --- v2.4.2/linux/drivers/net/tulip/media.c Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/tulip/media.c Fri Mar 2 11:02:14 2001 @@ -148,7 +148,7 @@ long ioaddr = dev->base_addr; struct tulip_private *tp = (struct tulip_private *)dev->priv; struct mediatable *mtable = tp->mtable; - u32 new_csr6=0; + u32 new_csr6; int i; if (mtable) { diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/pnic.c linux/drivers/net/tulip/pnic.c --- v2.4.2/linux/drivers/net/tulip/pnic.c Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/tulip/pnic.c Fri Mar 2 11:02:14 2001 @@ -50,6 +50,61 @@ } } +/* Modified version of tulip_check_duplex: + * Always update the 100mbps bit, even if the + * full duplex bit didn't change. + * Manfred Spraul + */ +int pnic_check_duplex(struct net_device *dev) +{ + struct tulip_private *tp = (struct tulip_private *)dev->priv; + int mii_reg1, mii_reg5, negotiated, duplex; + int new_csr6; + + mii_reg1 = tulip_mdio_read(dev, tp->phys[0], 1); + mii_reg5 = tulip_mdio_read(dev, tp->phys[0], 5); + if (tulip_debug > 1) + printk(KERN_INFO "%s: MII status %4.4x, Link partner report " + "%4.4x.\n", dev->name, mii_reg1, mii_reg5); + if (mii_reg1 == 0xffff) + return -2; + if ((mii_reg1 & 0x0004) == 0) { + int new_reg1 = tulip_mdio_read(dev, tp->phys[0], 1); + if ((new_reg1 & 0x0004) == 0) { + if (tulip_debug > 1) + printk(KERN_INFO "%s: No link beat on the MII interface," + " status %4.4x.\n", dev->name, new_reg1); + return -1; + } + } + negotiated = mii_reg5 & tp->advertising[0]; + /* 100baseTx-FD or 10T-FD, but not 100-HD */ + duplex = ((negotiated & 0x0300) == 0x0100 + || (negotiated & 0x00C0) == 0x0040) || + tp->full_duplex_lock; + + new_csr6 = tp->csr6; + if (negotiated & 0x0380) /* 100mbps. */ + new_csr6 &= ~0x00400000; + else + new_csr6 |= 0x00400000; + if (duplex) + new_csr6 |= 0x0200; + else + new_csr6 &= ~0x0200; + if (new_csr6 != tp->csr6) { + tp->full_duplex = duplex; + tp->csr6 = new_csr6; + if (tulip_debug > 0) + printk(KERN_INFO "%s: Setting %s-duplex based on MII" + "#%d link partner capability of %4.4x.\n", + dev->name, tp->full_duplex ? "full" : "half", + tp->phys[0], mii_reg5); + tulip_restart_rxtx(tp, tp->csr6); + return 1; + } + return 0; +} void pnic_lnk_change(struct net_device *dev, int csr5) { @@ -62,6 +117,11 @@ dev->name, phy_reg, csr5); if (inl(ioaddr + CSR5) & TPLnkFail) { outl((inl(ioaddr + CSR7) & ~TPLnkFail) | TPLnkPass, ioaddr + CSR7); + /* If we use an external MII, then we mustn't use the + * internal negotiation. + */ + if (tulip_media_cap[dev->if_port] & MediaIsMII) + return; if (! tp->nwayset || jiffies - dev->trans_start > 1*HZ) { tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff); tulip_outl_csr(tp, tp->csr6, CSR6); @@ -70,11 +130,18 @@ dev->trans_start = jiffies; } } else if (inl(ioaddr + CSR5) & TPLnkPass) { - pnic_do_nway(dev); + if (tulip_media_cap[dev->if_port] & MediaIsMII) { + spin_lock(&tp->lock); + pnic_check_duplex(dev); + spin_unlock(&tp->lock); + } else { + pnic_do_nway(dev); + } outl((inl(ioaddr + CSR7) & ~TPLnkPass) | TPLnkFail, ioaddr + CSR7); } } +int tulip_refill_rx(struct net_device *dev); void pnic_timer(unsigned long data) { @@ -82,10 +149,21 @@ struct tulip_private *tp = (struct tulip_private *)dev->priv; long ioaddr = dev->base_addr; int next_tick = 60*HZ; + + if(!inl(ioaddr + CSR7)) { + /* the timer was called due to a work overflow + * in the interrupt handler. Skip the connection + * checks, the nic is definitively speaking with + * his link partner. + */ + goto too_good_connection; + } if (tulip_media_cap[dev->if_port] & MediaIsMII) { - if (tulip_check_duplex(dev) > 0) + spin_lock_irq(&tp->lock); + if (pnic_check_duplex(dev) > 0) next_tick = 3*HZ; + spin_unlock_irq(&tp->lock); } else { int csr12 = inl(ioaddr + CSR12); int new_csr6 = tp->csr6 & ~0x40C40200; @@ -137,7 +215,14 @@ } } } - tp->timer.expires = RUN_AT(next_tick); - add_timer(&tp->timer); +too_good_connection: + mod_timer(&tp->timer, RUN_AT(next_tick)); + if(!inl(ioaddr + CSR7)) { + if (tulip_debug > 1) + printk(KERN_INFO "%s: sw timer wakeup.\n", dev->name); + disable_irq(dev->irq); + tulip_refill_rx(dev); + enable_irq(dev->irq); + outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7); + } } - diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/tulip.h linux/drivers/net/tulip/tulip.h --- v2.4.2/linux/drivers/net/tulip/tulip.h Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/tulip/tulip.h Fri Mar 2 11:02:14 2001 @@ -107,7 +107,14 @@ CSR12 = 0x60, CSR13 = 0x68, CSR14 = 0x70, - CSR15 = 0x78 + CSR15 = 0x78, +}; + +/* register offset and bits for CFDD PCI config reg */ +enum pci_cfg_driver_reg { + CFDD = 0x40, + CFDD_Sleep = (1 << 31), + CFDD_Snooze = (1 << 30), }; diff -u --recursive --new-file v2.4.2/linux/drivers/net/tulip/tulip_core.c linux/drivers/net/tulip/tulip_core.c --- v2.4.2/linux/drivers/net/tulip/tulip_core.c Wed Feb 21 18:20:29 2001 +++ linux/drivers/net/tulip/tulip_core.c Fri Mar 2 11:02:14 2001 @@ -28,7 +28,7 @@ #include static char version[] __devinitdata = - "Linux Tulip driver version 0.9.13a (January 20, 2001)\n"; + "Linux Tulip driver version 0.9.14 (February 20, 2001)\n"; /* A few user-configurable values. */ @@ -120,37 +120,63 @@ */ struct tulip_chip_table tulip_tbl[] = { + /* DC21040 */ { "Digital DC21040 Tulip", 128, 0x0001ebef, 0, tulip_timer }, + + /* DC21041 */ { "Digital DC21041 Tulip", 128, 0x0001ebef, HAS_MEDIA_TABLE | HAS_NWAY, tulip_timer }, + + /* DC21140 */ { "Digital DS21140 Tulip", 128, 0x0001ebef, HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, tulip_timer }, + + /* DC21142, DC21143 */ { "Digital DS21143 Tulip", 128, 0x0801fbff, HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY | HAS_INTR_MITIGATION, t21142_timer }, - { "Lite-On 82c168 PNIC", 256, 0x0001ebef, + + /* LC82C168 */ + { "Lite-On 82c168 PNIC", 256, 0x0001fbef, HAS_MII | HAS_PNICNWAY, pnic_timer }, + + /* MX98713 */ { "Macronix 98713 PMAC", 128, 0x0001ebef, HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, mxic_timer }, + + /* MX98715 */ { "Macronix 98715 PMAC", 256, 0x0001ebef, HAS_MEDIA_TABLE, mxic_timer }, + + /* MX98725 */ { "Macronix 98725 PMAC", 256, 0x0001ebef, HAS_MEDIA_TABLE, mxic_timer }, + + /* AX88140 */ { "ASIX AX88140", 128, 0x0001fbff, HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | MC_HASH_ONLY | IS_ASIX, tulip_timer }, + + /* PNIC2 */ { "Lite-On PNIC-II", 256, 0x0801fbff, HAS_MII | HAS_NWAY | HAS_8023X, t21142_timer }, + + /* COMET */ { "ADMtek Comet", 256, 0x0001abef, MC_HASH_ONLY, comet_timer }, + + /* COMPEX9881 */ { "Compex 9881 PMAC", 128, 0x0001ebef, HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM, mxic_timer }, + + /* I21145 */ { "Intel DS21145 Tulip", 128, 0x0801fbff, HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY, t21142_timer }, + + /* DM910X */ { "Davicom DM9102/DM9102A", 128, 0x0001ebef, HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI, tulip_timer }, - {0}, }; @@ -176,6 +202,7 @@ { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 }, { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, + { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 }, {0, } }; @@ -212,6 +239,24 @@ +static void tulip_set_power_state (struct tulip_private *tp, + int sleep, int snooze) +{ + if (tp->flags & HAS_ACPI) { + u32 tmp, newtmp; + pci_read_config_dword (tp->pdev, CFDD, &tmp); + newtmp = tmp & ~(CFDD_Sleep | CFDD_Snooze); + if (sleep) + newtmp |= CFDD_Sleep; + else if (snooze) + newtmp |= CFDD_Snooze; + if (tmp != newtmp) + pci_write_config_dword (tp->pdev, CFDD, newtmp); + } + +} + + static void tulip_up(struct net_device *dev) { struct tulip_private *tp = (struct tulip_private *)dev->priv; @@ -222,8 +267,7 @@ DPRINTK("ENTER\n"); /* Wake the chip from sleep/snooze mode. */ - if (tp->flags & HAS_ACPI) - pci_write_config_dword(tp->pdev, 0x40, 0); + tulip_set_power_state (tp, 0, 0); /* On some chip revs we must set the MII/SYM port before the reset!? */ if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii)) @@ -532,8 +576,9 @@ tp->stats.tx_errors++; out: - dev->trans_start = jiffies; spin_unlock_irqrestore (&tp->lock, flags); + dev->trans_start = jiffies; + netif_wake_queue (dev); } @@ -670,8 +715,7 @@ dev->if_port = tp->saved_if_port; /* Leave the driver in snooze, not sleep, mode. */ - if (tp->flags & HAS_ACPI) - pci_write_config_dword (tp->pdev, 0x40, 0x40000000); + tulip_set_power_state (tp, 0, 1); } @@ -1049,7 +1093,7 @@ * different driver (lmc driver) */ - if( pdev->subsystem_vendor == 0x1376 ){ + if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) { printk (KERN_ERR PFX "skipping LMC card.\n"); return -ENODEV; } @@ -1080,16 +1124,24 @@ thankfully its an old 486 chipset. */ - if (pci_find_device(PCI_VENDOR_ID_INTEL, 0x0483, NULL)) + if (pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424, NULL)) csr0 = 0x00A04800; /* The dreaded SiS496 486 chipset. Same workaround as above. */ - if (pci_find_device(PCI_VENDOR_ID_SI, 0x0496, NULL)) + if (pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, NULL)) csr0 = 0x00A04800; /* * And back to business */ + i = pci_enable_device(pdev); + if (i) { + printk (KERN_ERR PFX + "Cannot enable tulip board #%d, aborting\n", + board_idx); + return i; + } + ioaddr = pci_resource_start (pdev, 0); irq = pdev->irq; @@ -1126,12 +1178,6 @@ goto err_out_free_pio_res; } - if (pci_enable_device(pdev)) { - printk (KERN_ERR PFX "%s: Cannot enable PCI device, aborting\n", - dev->name); - goto err_out_free_mmio_res; - } - pci_set_master(pdev); pci_read_config_byte (pdev, PCI_REVISION_ID, &chip_rev); @@ -1443,8 +1489,7 @@ } /* put the chip in snooze mode until opened */ - if (tulip_tbl[chip_idx].flags & HAS_ACPI) - pci_write_config_dword(pdev, 0x40, 0x40000000); + tulip_set_power_state (tp, 0, 1); return 0; @@ -1468,8 +1513,8 @@ if (dev && netif_device_present (dev)) { netif_device_detach (dev); tulip_down (dev); + /* pci_power_off(pdev, -1); */ } -// pci_set_power_state(pdev, 3); } @@ -1477,8 +1522,11 @@ { struct net_device *dev = pci_get_drvdata(pdev); - pci_enable_device(pdev); +#if 1 + pci_enable_device (pdev); +#endif if (dev && !netif_device_present (dev)) { + /* pci_power_on(pdev); */ tulip_up (dev); netif_device_attach (dev); } @@ -1487,24 +1535,29 @@ static void __devexit tulip_remove_one (struct pci_dev *pdev) { - struct net_device *dev = pci_get_drvdata(pdev); + struct net_device *dev = pci_get_drvdata (pdev); + struct tulip_private *tp; - if (dev) { - struct tulip_private *tp = (struct tulip_private *)dev->priv; - pci_free_consistent(pdev, - sizeof(struct tulip_rx_desc) * RX_RING_SIZE + - sizeof(struct tulip_tx_desc) * TX_RING_SIZE, - tp->rx_ring, - tp->rx_ring_dma); - unregister_netdev(dev); - release_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); - release_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); - kfree(dev); + if (!dev) + return; - pci_set_drvdata(pdev, NULL); - } + tp = dev->priv; + pci_free_consistent (pdev, + sizeof (struct tulip_rx_desc) * RX_RING_SIZE + + sizeof (struct tulip_tx_desc) * TX_RING_SIZE, + tp->rx_ring, tp->rx_ring_dma); + unregister_netdev (dev); + release_mem_region (pci_resource_start (pdev, 1), + pci_resource_len (pdev, 1)); + release_region (pci_resource_start (pdev, 0), + pci_resource_len (pdev, 0)); + if (tp->mtable) + kfree (tp->mtable); + kfree (dev); + + pci_set_drvdata (pdev, NULL); + + /* pci_power_off (pdev, -1); */ } diff -u --recursive --new-file v2.4.2/linux/drivers/net/via-rhine.c linux/drivers/net/via-rhine.c --- v2.4.2/linux/drivers/net/via-rhine.c Mon Dec 11 13:38:29 2000 +++ linux/drivers/net/via-rhine.c Fri Mar 2 11:02:15 2001 @@ -55,6 +55,9 @@ LK1.1.6: - Urban Widmark: merges from Beckers 1.08b version (VT6102 + mdio) set netif_running_on/off on startup, del_timer_sync + + LK1.1.7: + - Manfred Spraul: added reset into tx_timeout */ @@ -114,20 +117,21 @@ #include #include #include -#include +#include #include #include #include #include #include #include +#include #include /* Processor type for cache alignment. */ #include #include /* These identify the driver base version and may not be removed. */ static char version1[] __devinitdata = -"via-rhine.c:v1.08b-LK1.1.6 8/9/2000 Written by Donald Becker\n"; +"via-rhine.c:v1.08b-LK1.1.7 8/9/2000 Written by Donald Becker\n"; static char version2[] __devinitdata = " http://www.scyld.com/network/via-rhine.html\n"; @@ -213,7 +217,7 @@ most useful with small frames. Since the VIA chips are only able to transfer data to buffers on 32 bit -boundaries, the the IP header at offset 14 in an ethernet frame isn't +boundaries, the IP header at offset 14 in an ethernet frame isn't longword aligned for further processing. Copying these unaligned buffers has the beneficial effect of 16-byte aligning the IP header. @@ -380,6 +384,7 @@ CmdNoTxPoll=0x0800, CmdReset=0x8000, }; +#define MAX_MII_CNT 4 struct netdev_private { /* Descriptor rings */ struct rx_desc *rx_ring; @@ -421,7 +426,8 @@ /* MII transceiver section. */ u16 advertising; /* NWay media advertisement */ - unsigned char phys[2]; /* MII device addresses. */ + unsigned char phys[MAX_MII_CNT]; /* MII device addresses. */ + unsigned int mii_cnt; /* number of MIIs found, but only the first one is used */ u16 mii_status; /* last read MII status */ }; @@ -431,7 +437,6 @@ static void via_rhine_check_duplex(struct net_device *dev); static void via_rhine_timer(unsigned long data); static void via_rhine_tx_timeout(struct net_device *dev); -static void via_rhine_init_ring(struct net_device *dev); static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev); static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static void via_rhine_tx(struct net_device *dev); @@ -443,6 +448,25 @@ static int via_rhine_close(struct net_device *dev); static inline void clear_tally_counters(long ioaddr); +static void wait_for_reset(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + int i; + + i = 0; + do { + udelay(5); + i++; + if(i > 2000) { + printk(KERN_ERR "%s: reset did not complete in 10 ms.\n", + dev->name); + break; + } + } while(readw(ioaddr + ChipCmd) & CmdReset); + if (debug > 1) + printk(KERN_INFO "%s: reset finished after %d microseconds.\n", + dev->name, 5*i); +} static int __devinit via_rhine_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) @@ -451,14 +475,11 @@ struct netdev_private *np; int i, option; int chip_id = (int) ent->driver_data; - int irq = pdev->irq; static int card_idx = -1; static int did_version = 0; long ioaddr; int io_size; int pci_flags; - void *ring; - dma_addr_t ring_dma; /* print version once and once only */ if (! did_version++) { @@ -471,6 +492,9 @@ io_size = via_rhine_chip_info[chip_id].io_size; pci_flags = via_rhine_chip_info[chip_id].pci_flags; + if (pci_enable_device (pdev)) + goto err_out; + /* this should always be supported */ if (!pci_dma_supported(pdev, 0xffffffff)) { printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n"); @@ -484,20 +508,7 @@ goto err_out; } - /* allocate pci dma space for rx and tx descriptor rings */ - ring = pci_alloc_consistent(pdev, - RX_RING_SIZE * sizeof(struct rx_desc) + - TX_RING_SIZE * sizeof(struct tx_desc), - &ring_dma); - if (!ring) { - printk(KERN_ERR "Could not allocate DMA memory.\n"); - goto err_out; - } - ioaddr = pci_resource_start (pdev, pci_flags & PCI_ADDR0 ? 0 : 1); - - if (pci_enable_device (pdev)) - goto err_out_free_dma; if (pci_flags & PCI_USES_MASTER) pci_set_master (pdev); @@ -506,26 +517,12 @@ if (dev == NULL) { printk (KERN_ERR "init_ethernet failed for card #%d\n", card_idx); - goto err_out_free_dma; + goto err_out; } SET_MODULE_OWNER(dev); - /* request all PIO and MMIO regions just to make sure - * noone else attempts to use any portion of our I/O space */ - if (!request_region (pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0), dev->name)) { - printk (KERN_ERR "request_region failed for device %s, region 0x%X @ 0x%lX\n", - dev->name, io_size, - pci_resource_start (pdev, 0)); + if (pci_request_regions(pdev, dev->name)) goto err_out_free_netdev; - } - if (!request_mem_region (pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1), dev->name)) { - printk (KERN_ERR "request_mem_region failed for device %s, region 0x%X @ 0x%lX\n", - dev->name, io_size, - pci_resource_start (pdev, 1)); - goto err_out_free_pio; - } #ifndef USE_IO ioaddr = (long) ioremap (ioaddr, io_size); @@ -533,7 +530,7 @@ printk (KERN_ERR "ioremap failed for device %s, region 0x%X @ 0x%X\n", dev->name, io_size, pci_resource_start (pdev, 1)); - goto err_out_free_mmio; + goto err_out_free_res; } #endif @@ -545,25 +542,22 @@ dev->dev_addr[i] = readb(ioaddr + StationAddr + i); for (i = 0; i < 5; i++) printk("%2.2x:", dev->dev_addr[i]); - printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); + printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], pdev->irq); /* Reset the chip to erase previous misconfiguration. */ writew(CmdReset, ioaddr + ChipCmd); + wait_for_reset(dev); dev->base_addr = ioaddr; - dev->irq = irq; + dev->irq = pdev->irq; np = dev->priv; spin_lock_init (&np->lock); np->chip_id = chip_id; np->drv_flags = via_rhine_chip_info[chip_id].drv_flags; np->pdev = pdev; - np->rx_ring = ring; - np->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc); - np->rx_ring_dma = ring_dma; - np->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc); - if (dev->mem_start) + if (dev->mem_start && dev->mem_start != ~0) option = dev->mem_start; /* The lower four bits are the media type. */ @@ -593,7 +587,7 @@ if (np->drv_flags & CanHaveMII) { int phy, phy_idx = 0; np->phys[0] = 1; /* Standard for this chip. */ - for (phy = 1; phy < 32 && phy_idx < 4; phy++) { + for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) { int mii_status = mdio_read(dev, phy, 1); if (mii_status != 0xffff && mii_status != 0x0000) { np->phys[phy_idx++] = phy; @@ -610,6 +604,7 @@ netif_carrier_off(dev); } } + np->mii_cnt = phy_idx; } return 0; @@ -617,27 +612,209 @@ #ifndef USE_IO /* note this is ifdef'd because the ioremap is ifdef'd... * so additional exit conditions above this must move - * release_mem_region outside of the ifdef */ -err_out_free_mmio: - release_mem_region(pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); + * pci_release_regions outside of the ifdef */ +err_out_free_res: + pci_release_regions(pdev); #endif -err_out_free_pio: - release_region(pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); err_out_free_netdev: unregister_netdev (dev); kfree (dev); -err_out_free_dma: - pci_free_consistent(pdev, +err_out: + return -ENODEV; +} + +static int alloc_ring(struct net_device* dev) +{ + struct netdev_private *np = dev->priv; + void *ring; + dma_addr_t ring_dma; + + ring = pci_alloc_consistent(np->pdev, + RX_RING_SIZE * sizeof(struct rx_desc) + + TX_RING_SIZE * sizeof(struct tx_desc), + &ring_dma); + if (!ring) { + printk(KERN_ERR "Could not allocate DMA memory.\n"); + return -ENOMEM; + } + np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, + &np->tx_bufs_dma); + if (np->tx_bufs == NULL) { + pci_free_consistent(np->pdev, RX_RING_SIZE * sizeof(struct rx_desc) + TX_RING_SIZE * sizeof(struct tx_desc), ring, ring_dma); -err_out: - return -ENODEV; + return -ENOMEM; + } + + np->rx_ring = ring; + np->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc); + np->rx_ring_dma = ring_dma; + np->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc); + + + return 0; } +void free_ring(struct net_device* dev) +{ + struct netdev_private *np = dev->priv; + + pci_free_consistent(np->pdev, + RX_RING_SIZE * sizeof(struct rx_desc) + + TX_RING_SIZE * sizeof(struct tx_desc), + np->rx_ring, np->rx_ring_dma); + + pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, + np->tx_bufs, np->tx_bufs_dma); + +} + +static void alloc_rbufs(struct net_device *dev) +{ + struct netdev_private *np = dev->priv; + dma_addr_t next; + int i; + + np->dirty_rx = np->cur_rx = 0; + + np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); + np->rx_head_desc = &np->rx_ring[0]; + next = np->rx_ring_dma; + + /* Init the ring entries */ + for (i = 0; i < RX_RING_SIZE; i++) { + np->rx_ring[i].rx_status = 0; + np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz); + next += sizeof(struct rx_desc); + np->rx_ring[i].next_desc = cpu_to_le32(next); + np->rx_skbuff[i] = 0; + } + /* Mark the last entry as wrapping the ring. */ + np->rx_ring[i-1].next_desc = cpu_to_le32(np->rx_ring_dma); + + /* Fill in the Rx buffers. Handle allocation failure gracefully. */ + for (i = 0; i < RX_RING_SIZE; i++) { + struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); + np->rx_skbuff[i] = skb; + if (skb == NULL) + break; + skb->dev = dev; /* Mark as being used by this device. */ + + np->rx_skbuff_dma[i] = + pci_map_single(np->pdev, skb->tail, np->rx_buf_sz, + PCI_DMA_FROMDEVICE); + + np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]); + np->rx_ring[i].rx_status = cpu_to_le32(DescOwn); + } + np->dirty_rx = (unsigned int)(i - RX_RING_SIZE); +} + +static void free_rbufs(struct net_device* dev) +{ + struct netdev_private *np = dev->priv; + int i; + + /* Free all the skbuffs in the Rx queue. */ + for (i = 0; i < RX_RING_SIZE; i++) { + np->rx_ring[i].rx_status = 0; + np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ + if (np->rx_skbuff[i]) { + pci_unmap_single(np->pdev, + np->rx_skbuff_dma[i], + np->rx_buf_sz, PCI_DMA_FROMDEVICE); + dev_kfree_skb(np->rx_skbuff[i]); + } + np->rx_skbuff[i] = 0; + } +} + +static void alloc_tbufs(struct net_device* dev) +{ + struct netdev_private *np = dev->priv; + dma_addr_t next; + int i; + + np->dirty_tx = np->cur_tx = 0; + next = np->tx_ring_dma; + for (i = 0; i < TX_RING_SIZE; i++) { + np->tx_skbuff[i] = 0; + np->tx_ring[i].tx_status = 0; + np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000); + next += sizeof(struct tx_desc); + np->tx_ring[i].next_desc = cpu_to_le32(next); + np->tx_buf[i] = &np->tx_bufs[i * PKT_BUF_SZ]; + } + np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma); + +} + +static void free_tbufs(struct net_device* dev) +{ + struct netdev_private *np = dev->priv; + int i; + + for (i = 0; i < TX_RING_SIZE; i++) { + np->tx_ring[i].tx_status = 0; + np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000); + np->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ + if (np->tx_skbuff[i]) { + if (np->tx_skbuff_dma[i]) { + pci_unmap_single(np->pdev, + np->tx_skbuff_dma[i], + np->tx_skbuff[i]->len, PCI_DMA_TODEVICE); + } + dev_kfree_skb(np->tx_skbuff[i]); + } + np->tx_skbuff[i] = 0; + np->tx_buf[i] = 0; + } +} + +static void init_registers(struct net_device *dev) +{ + struct netdev_private *np = dev->priv; + long ioaddr = dev->base_addr; + int i; + + for (i = 0; i < 6; i++) + writeb(dev->dev_addr[i], ioaddr + StationAddr + i); + + /* Initialize other registers. */ + writew(0x0006, ioaddr + PCIBusConfig); /* Tune configuration??? */ + /* Configure the FIFO thresholds. */ + writeb(0x20, ioaddr + TxConfig); /* Initial threshold 32 bytes */ + np->tx_thresh = 0x20; + np->rx_thresh = 0x60; /* Written in via_rhine_set_rx_mode(). */ + + if (dev->if_port == 0) + dev->if_port = np->default_port; + + writel(np->rx_ring_dma, ioaddr + RxRingPtr); + writel(np->tx_ring_dma, ioaddr + TxRingPtr); + + via_rhine_set_rx_mode(dev); + + /* Enable interrupts by setting the interrupt mask. */ + writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow| IntrRxDropped| + IntrTxDone | IntrTxAbort | IntrTxUnderrun | + IntrPCIErr | IntrStatsMax | IntrLinkChange | IntrMIIChange, + ioaddr + IntrEnable); + + np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll; + if (np->duplex_lock) + np->chip_cmd |= CmdFDuplex; + writew(np->chip_cmd, ioaddr + ChipCmd); + + via_rhine_check_duplex(dev); + /* The LED outputs of various MII xcvrs should be configured. */ + /* For NS or Mison phys, turn on bit 1 in register 0x17 */ + /* For ESI phys, turn on bit 7 in register 0x17. */ + mdio_write(dev, np->phys[0], 0x17, mdio_read(dev, np->phys[0], 0x17) | + (np->drv_flags & HasESIPhy) ? 0x0080 : 0x0001); +} /* Read and write over the MII Management Data I/O (MDIO) interface. */ static int mdio_read(struct net_device *dev, int phy_id, int regnum) @@ -660,7 +837,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int boguscnt = 1024; @@ -691,75 +868,36 @@ static int via_rhine_open(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int i; /* Reset the chip. */ writew(CmdReset, ioaddr + ChipCmd); - i = request_irq(dev->irq, &via_rhine_interrupt, SA_SHIRQ, dev->name, dev); + i = request_irq(np->pdev->irq, &via_rhine_interrupt, SA_SHIRQ, dev->name, dev); if (i) return i; if (debug > 1) printk(KERN_DEBUG "%s: via_rhine_open() irq %d.\n", - dev->name, dev->irq); - - np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, - &np->tx_bufs_dma); - if (np->tx_bufs == NULL) { - free_irq(dev->irq, dev); - return -ENOMEM; - } - - via_rhine_init_ring(dev); - - writel(np->rx_ring_dma, ioaddr + RxRingPtr); - writel(np->tx_ring_dma, ioaddr + TxRingPtr); - - for (i = 0; i < 6; i++) - writeb(dev->dev_addr[i], ioaddr + StationAddr + i); - - /* Initialize other registers. */ - writew(0x0006, ioaddr + PCIBusConfig); /* Tune configuration??? */ - /* Configure the FIFO thresholds. */ - writeb(0x20, ioaddr + TxConfig); /* Initial threshold 32 bytes */ - np->tx_thresh = 0x20; - np->rx_thresh = 0x60; /* Written in via_rhine_set_rx_mode(). */ - - if (dev->if_port == 0) - dev->if_port = np->default_port; - - netif_start_queue(dev); - - via_rhine_set_rx_mode(dev); - - /* Enable interrupts by setting the interrupt mask. */ - writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow| IntrRxDropped| - IntrTxDone | IntrTxAbort | IntrTxUnderrun | - IntrPCIErr | IntrStatsMax | IntrLinkChange | IntrMIIChange, - ioaddr + IntrEnable); - - np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll; - if (np->duplex_lock) - np->chip_cmd |= CmdFDuplex; - writew(np->chip_cmd, ioaddr + ChipCmd); - - via_rhine_check_duplex(dev); - - /* The LED outputs of various MII xcvrs should be configured. */ - /* For NS or Mison phys, turn on bit 1 in register 0x17 */ - /* For ESI phys, turn on bit 7 in register 0x17. */ - mdio_write(dev, np->phys[0], 0x17, mdio_read(dev, np->phys[0], 0x17) | - (np->drv_flags & HasESIPhy) ? 0x0080 : 0x0001); - + dev->name, np->pdev->irq); + + i = alloc_ring(dev); + if (i) + return i; + alloc_rbufs(dev); + alloc_tbufs(dev); + wait_for_reset(dev); + init_registers(dev); if (debug > 2) printk(KERN_DEBUG "%s: Done via_rhine_open(), status %4.4x " "MII status: %4.4x.\n", dev->name, readw(ioaddr + ChipCmd), mdio_read(dev, np->phys[0], 1)); + netif_start_queue(dev); + /* Set the timer to check for link beat. */ init_timer(&np->timer); np->timer.expires = jiffies + 2; @@ -772,7 +910,7 @@ static void via_rhine_check_duplex(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int mii_reg5 = mdio_read(dev, np->phys[0], 5); int negotiated = mii_reg5 & np->advertising; @@ -799,7 +937,7 @@ static void via_rhine_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int next_tick = 10*HZ; int mii_status; @@ -835,89 +973,42 @@ struct netdev_private *np = (struct netdev_private *) dev->priv; long ioaddr = dev->base_addr; - /* Lock to protect mdio_read and access to stats. A friendly - advice to the implementor of the XXXs in this function is to be - sure not to spin too long (whatever that means :) */ - spin_lock_irq (&np->lock); - printk (KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " "%4.4x, resetting...\n", dev->name, readw (ioaddr + IntrStatus), mdio_read (dev, np->phys[0], 1)); - /* XXX Perhaps we should reinitialize the hardware here. */ dev->if_port = 0; - /* Stop and restart the chip's Tx processes . */ - /* XXX to do */ - - /* Trigger an immediate transmit demand. */ - /* XXX to do */ + /* protect against concurrent rx interrupts */ + disable_irq(np->pdev->irq); - dev->trans_start = jiffies; - np->stats.tx_errors++; - - spin_unlock_irq (&np->lock); -} + spin_lock(&np->lock); + /* Reset the chip. */ + writew(CmdReset, ioaddr + ChipCmd); -/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ -static void via_rhine_init_ring(struct net_device *dev) -{ - struct netdev_private *np = (struct netdev_private *)dev->priv; - int i; - dma_addr_t next = np->rx_ring_dma; - - np->cur_rx = np->cur_tx = 0; - np->dirty_rx = np->dirty_tx = 0; - - np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); - np->rx_head_desc = &np->rx_ring[0]; - - for (i = 0; i < RX_RING_SIZE; i++) { - np->rx_ring[i].rx_status = 0; - np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz); - next += sizeof(struct rx_desc); - np->rx_ring[i].next_desc = cpu_to_le32(next); - np->rx_skbuff[i] = 0; - } - /* Mark the last entry as wrapping the ring. */ - np->rx_ring[i-1].next_desc = cpu_to_le32(np->rx_ring_dma); - - /* Fill in the Rx buffers. Handle allocation failure gracefully. */ - for (i = 0; i < RX_RING_SIZE; i++) { - struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); - np->rx_skbuff[i] = skb; - if (skb == NULL) - break; - skb->dev = dev; /* Mark as being used by this device. */ - - np->rx_skbuff_dma[i] = - pci_map_single(np->pdev, skb->tail, np->rx_buf_sz, - PCI_DMA_FROMDEVICE); - - np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]); - np->rx_ring[i].rx_status = cpu_to_le32(DescOwn); - } - np->dirty_rx = (unsigned int)(i - RX_RING_SIZE); - - next = np->tx_ring_dma; - for (i = 0; i < TX_RING_SIZE; i++) { - np->tx_skbuff[i] = 0; - np->tx_ring[i].tx_status = 0; - np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000); - next += sizeof(struct tx_desc); - np->tx_ring[i].next_desc = cpu_to_le32(next); - np->tx_buf[i] = &np->tx_bufs[i * PKT_BUF_SZ]; - } - np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma); + /* clear all descriptors */ + free_tbufs(dev); + free_rbufs(dev); + alloc_tbufs(dev); + alloc_rbufs(dev); + + /* Reinitialize the hardware. */ + wait_for_reset(dev); + init_registers(dev); + + spin_unlock(&np->lock); + enable_irq(np->pdev->irq); - return; + dev->trans_start = jiffies; + np->stats.tx_errors++; + netif_wake_queue(dev); } static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; unsigned entry; /* Caution: the write order is important here, set the field @@ -1017,7 +1108,7 @@ for clarity. */ static void via_rhine_tx(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; int txstatus = 0, entry = np->dirty_tx % TX_RING_SIZE; spin_lock (&np->lock); @@ -1066,7 +1157,7 @@ for clarity and better register allocation. */ static void via_rhine_rx(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; int entry = np->cur_rx % RX_RING_SIZE; int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx; @@ -1149,7 +1240,7 @@ skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; - np->stats.rx_bytes += skb->len; + np->stats.rx_bytes += pkt_len; np->stats.rx_packets++; } entry = (++np->cur_rx) % RX_RING_SIZE; @@ -1180,7 +1271,7 @@ static void via_rhine_error(struct net_device *dev, int intr_status) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; spin_lock (&np->lock); @@ -1215,8 +1306,9 @@ "threshold setting to %2.2x.\n", dev->name, np->tx_thresh); } if ((intr_status & ~( IntrLinkChange | IntrStatsMax | - IntrTxAbort | IntrTxAborted)) && debug > 1) { - printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", + IntrTxAbort | IntrTxAborted))) { + if (debug > 1) + printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", dev->name, intr_status); /* Recovery for other fault sources not known. */ writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); @@ -1227,7 +1319,7 @@ static struct net_device_stats *via_rhine_get_stats(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; unsigned long flags; @@ -1273,7 +1365,7 @@ static void via_rhine_set_rx_mode(struct net_device *dev) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; u32 mc_filter[2]; /* Multicast hash filter */ u8 rx_mode; /* Note: 0x02=accept runt, 0x01=accept errs */ @@ -1305,7 +1397,7 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct netdev_private *np = (struct netdev_private *)dev->priv; + struct netdev_private *np = dev->priv; u16 *data = (u16 *)&rq->ifr_data; unsigned long flags; int retval; @@ -1338,13 +1430,11 @@ static int via_rhine_close(struct net_device *dev) { long ioaddr = dev->base_addr; - struct netdev_private *np = (struct netdev_private *)dev->priv; - int i; - unsigned long flags; + struct netdev_private *np = dev->priv; del_timer_sync(&np->timer); - spin_lock_irqsave(&np->lock, flags); + spin_lock_irq(&np->lock); netif_stop_queue(dev); @@ -1361,44 +1451,12 @@ /* Stop the chip's Tx and Rx processes. */ writew(CmdStop, ioaddr + ChipCmd); - spin_unlock_irqrestore(&np->lock, flags); - - /* Make sure there is no irq-handler running on a different CPU. */ - synchronize_irq(); - - free_irq(dev->irq, dev); + spin_unlock_irq(&np->lock); - /* Free all the skbuffs in the Rx queue. */ - for (i = 0; i < RX_RING_SIZE; i++) { - np->rx_ring[i].rx_status = 0; - np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ - if (np->rx_skbuff[i]) { - pci_unmap_single(np->pdev, - np->rx_skbuff_dma[i], - np->rx_buf_sz, PCI_DMA_FROMDEVICE); - dev_kfree_skb(np->rx_skbuff[i]); - } - np->rx_skbuff[i] = 0; - } - - /* Free all the skbuffs in the Tx queue, and also any bounce buffers. */ - for (i = 0; i < TX_RING_SIZE; i++) { - np->tx_ring[i].tx_status = 0; - np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000); - np->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ - if (np->tx_skbuff[i]) { - if (np->tx_skbuff_dma[i]) { - pci_unmap_single(np->pdev, - np->tx_skbuff_dma[i], - np->tx_skbuff[i]->len, PCI_DMA_TODEVICE); - } - dev_kfree_skb(np->tx_skbuff[i]); - } - np->tx_skbuff[i] = 0; - np->tx_buf[i] = 0; - } - pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, - np->tx_bufs, np->tx_bufs_dma); + free_irq(np->pdev->irq, dev); + free_rbufs(dev); + free_tbufs(dev); + free_ring(dev); return 0; } @@ -1411,10 +1469,7 @@ unregister_netdev(dev); - release_region(pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); - release_mem_region(pci_resource_start (pdev, 1), - pci_resource_len (pdev, 1)); + pci_release_regions(pdev); #ifndef USE_IO iounmap((char *)(dev->base_addr)); diff -u --recursive --new-file v2.4.2/linux/drivers/net/yellowfin.c linux/drivers/net/yellowfin.c --- v2.4.2/linux/drivers/net/yellowfin.c Mon Dec 11 13:38:29 2000 +++ linux/drivers/net/yellowfin.c Fri Mar 2 11:02:15 2001 @@ -1,33 +1,54 @@ /* yellowfin.c: A Packet Engines G-NIC ethernet driver for linux. */ /* - Written 1997-1999 by Donald Becker. + Written 1997-2001 by Donald Becker. - This software may be used and distributed according to the terms - of the GNU Public License, incorporated herein by reference. + This software may be used and distributed according to the terms of + the GNU General Public License (GPL), incorporated herein by reference. + Drivers based on or derived from this code fall under the GPL and must + retain the authorship, copyright and license notice. This file is not + a complete program and may only be used when the entire operating + system is licensed under the GPL. This driver is for the Packet Engines G-NIC PCI Gigabit Ethernet adapter. It also supports the Symbios Logic version of the same chip core. - The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O - Center of Excellence in Space Data and Information Sciences - Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771 + The author may be reached as becker@scyld.com, or C/O + Scyld Computing Corporation + 410 Severn Ave., Suite 210 + Annapolis MD 21403 Support and updates available at - http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html + http://www.scyld.com/network/yellowfin.html + + + Linux kernel changelog: + ----------------------- + + LK1.1.1 (jgarzik): Port to 2.4 kernel + + LK1.1.2 (jgarzik): + * Merge in becker version 1.05 + */ -static const char *version = -"yellowfin.c:v1.03a 7/30/99 Written by Donald Becker, becker@cesdis.edu\n" -" http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html\n"; +/* These identify the driver base version and may not be removed. */ +static const char version1[] = +"yellowfin.c:v1.05 1/09/2001 Written by Donald Becker \n"; +static const char version2[] = +" http://www.scyld.com/network/yellowfin.html\n"; +static const char version3[] = +" (unofficial 2.4.x port, LK1.1.2, January 11, 2001)\n"; -/* A few user-configurable values. */ +/* The user-configurable values. + These may be modified when a driver module is loaded.*/ -static int debug = 1; +static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */ +/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 20; -static int mtu = 0; +static int mtu; #ifdef YF_PROTOTYPE /* Support for prototype hardware errata. */ /* System-wide count of bogus-rx frames. */ -static int bogus_rx = 0; +static int bogus_rx; static int dma_ctrl = 0x004A0263; /* Constrained by errata */ static int fifo_cfg = 0x0020; /* Bypass external Tx FIFO. */ #elif YF_NEW /* A future perfect board :->. */ @@ -40,7 +61,7 @@ /* Set the copy breakpoint for the copy-only-tiny-frames scheme. Setting to > 1514 effectively disables this feature. */ -static int rx_copybreak = 0; +static int rx_copybreak; /* Used to pass the media type, etc. No media types are currently defined. These exist for driver @@ -51,12 +72,12 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* Do ugly workaround for GX server chipset errata. */ -static int gx_fix = 0; +static int gx_fix; /* Operational parameters that are set at compile time. */ /* Keep the ring sizes a power of two for efficiency. - Making the Tx queue too long decreases the effectiveness of channel + Making the Tx ring too long decreases the effectiveness of channel bonding and packet priority. There are no ill effects from too-large receive rings. */ #define TX_RING_SIZE 16 @@ -66,57 +87,61 @@ /* Operational parameters that usually are not changed. */ /* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (2*HZ) +#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ #define yellowfin_debug debug -#if !defined(__OPTIMIZE__) || !defined(__KERNEL__) +#if !defined(__OPTIMIZE__) #warning You must compile this file with the correct options! #warning See the last lines of the source file. #error You must compile this driver with "-O". #endif -#include #include #include #include #include #include #include -#include +#include #include #include #include +#include +#include +#include #include /* Processor type for cache alignment. */ #include #include #include -#include -#include -#include - -/* Condensed operations for readability. - Compatibility defines are now in drv_compat.h */ - +/* Condensed operations for readability. */ #define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr)) #define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr)) - -#ifdef USE_IO_OPS -#define YF_INB inb -#define YF_INW inw -#define YF_INL inl -#define YF_OUTB outb -#define YF_OUTW outw -#define YF_OUTL outl -#else -#define YF_INB readb -#define YF_INW readw -#define YF_INL readl -#define YF_OUTB writeb -#define YF_OUTW writew -#define YF_OUTL writel -#endif +#ifndef USE_IO_OPS +#undef inb +#undef inw +#undef inl +#undef outb +#undef outw +#undef outl +#define inb readb +#define inw readw +#define inl readl +#define outb writeb +#define outw writew +#define outl writel +#endif /* !USE_IO_OPS */ +MODULE_AUTHOR("Donald Becker "); +MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); +MODULE_PARM(max_interrupt_work, "i"); +MODULE_PARM(mtu, "i"); +MODULE_PARM(debug, "i"); +MODULE_PARM(rx_copybreak, "i"); +MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(gx_fix, "i"); /* Theory of Operation @@ -193,50 +218,53 @@ IVc. Errata See Packet Engines confidential appendix (prototype chips only). - */ - -/* A few values that may be tweaked. */ -#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ -/* The rest of these values should never change. */ + +enum pci_id_flags_bits { + /* Set PCI command register bits before calling probe1(). */ + PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, + /* Read and map the single following PCI BAR. */ + PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4, + PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400, + PCI_UNUSED_IRQ=0x800, +}; enum capability_flags { HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16, - HasMACAddrBug=32, /* Really only on early revs. */ + HasMACAddrBug=32, /* Only on early revs. */ }; - - /* The PCI I/O space extent. */ #define YELLOWFIN_SIZE 0x100 +#ifdef USE_IO_OPS +#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0) +#else +#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1) +#endif -#define YELLOWFIN_MODULE_NAME "yellowfin" -#define PFX YELLOWFIN_MODULE_NAME ": " - - -typedef enum { - YELLOWFIN_GNIC, - SYM83C885, -} chip_t; - - -struct chip_info { - const char *name; - int flags; +struct pci_id_info { + const char *name; + struct match_info { + int pci, pci_mask, subsystem, subsystem_mask; + int revision, revision_mask; /* Only 8 bits. */ + } id; + enum pci_id_flags_bits pci_flags; + int io_size; /* Needed for I/O region check or ioremap(). */ + int drv_flags; /* Driver use, intended as capability flags. */ }; - -/* index by chip_t */ -static struct chip_info chip_info[] = { - {"Yellowfin G-NIC Gigabit Ethernet", +static struct pci_id_info pci_id_tbl[] = { + {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff}, + PCI_IOTYPE, YELLOWFIN_SIZE, FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug}, - {"Symbios SYM83C885", HasMII }, + {"Symbios SYM83C885", { 0x07011000, 0xffffffff}, + PCI_IOTYPE, YELLOWFIN_SIZE, HasMII }, + {0,}, }; - static struct pci_device_id yellowfin_pci_tbl[] __devinitdata = { - { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, YELLOWFIN_GNIC }, - { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SYM83C885 }, + { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, { 0, } }; MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl); @@ -300,21 +328,22 @@ IntrEarlyRx=0x100, IntrWakeup=0x200, }; #define PRIV_ALIGN 31 /* Required alignment mask */ +#define MII_CNT 4 struct yellowfin_private { - /* Descriptor rings first for alignment. Tx requires a second descriptor - for status. */ + /* Descriptor rings first for alignment. + Tx requires a second descriptor for status. */ struct yellowfin_desc rx_ring[RX_RING_SIZE]; struct yellowfin_desc tx_ring[TX_RING_SIZE*2]; /* The addresses of receive-in-place skbuffs. */ struct sk_buff* rx_skbuff[RX_RING_SIZE]; - /* The saved address of a sent-in-place packet/buffer, for skfree(). */ + /* The saved address of a sent-in-place packet/buffer, for later free(). */ struct sk_buff* tx_skbuff[TX_RING_SIZE]; struct tx_status_words tx_status[TX_RING_SIZE]; struct timer_list timer; /* Media selection timer. */ struct net_device_stats stats; /* Frequently used and paired value: keep adjacent for cache effect. */ + int chip_id, drv_flags; struct pci_dev *pci_dev; - int chip_id, flags; struct yellowfin_desc *rx_head_desc; unsigned int cur_rx, dirty_rx; /* Producer/consumer ring indices */ unsigned int rx_buf_sz; /* Based on MTU+slack. */ @@ -329,29 +358,14 @@ /* MII transceiver section. */ int mii_cnt; /* MII device addresses. */ u16 advertising; /* NWay media advertisement */ - unsigned char phys[2]; /* MII device addresses. */ - u32 pad[4]; /* Used for 32-byte alignment */ + unsigned char phys[MII_CNT]; /* MII device addresses, only first one used */ spinlock_t lock; }; - -MODULE_AUTHOR("Donald Becker "); -MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); -MODULE_PARM(max_interrupt_work, "i"); -MODULE_PARM(mtu, "i"); -MODULE_PARM(debug, "i"); -MODULE_PARM(rx_copybreak, "i"); -MODULE_PARM(gx_fix, "i"); -MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); - - static int read_eeprom(long ioaddr, int location); static int mdio_read(long ioaddr, int phy_id, int location); static void mdio_write(long ioaddr, int phy_id, int location, int value); -#ifdef HAVE_PRIVATE_IOCTL static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -#endif static int yellowfin_open(struct net_device *dev); static void yellowfin_timer(unsigned long data); static void yellowfin_tx_timeout(struct net_device *dev); @@ -365,15 +379,141 @@ static void set_rx_mode(struct net_device *dev); +static int __devinit yellowfin_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev; + struct yellowfin_private *np; + int irq; + int chip_idx = ent->driver_data; + static int find_cnt = 0; + long ioaddr, real_ioaddr; + int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; + int drv_flags = pci_id_tbl[chip_idx].drv_flags; + + i = pci_enable_device(pdev); + if (i) return i; + + dev = init_etherdev(NULL, sizeof(*np)); + if (!dev) { + printk (KERN_ERR "yellowfin: cannot allocate ethernet device\n"); + return -ENOMEM; + } + SET_MODULE_OWNER(dev); + + np = dev->priv; + + if (pci_request_regions(pdev, dev->name)) + goto err_out_free_netdev; + + pci_set_master (pdev); + +#ifdef USE_IO_OPS + real_ioaddr = ioaddr = pci_resource_start (pdev, 0); +#else + real_ioaddr = ioaddr = pci_resource_start (pdev, 1); + ioaddr = (long) ioremap(ioaddr, YELLOWFIN_SIZE); + if (!ioaddr) + goto err_out_free_res; +#endif + irq = pdev->irq; + + printk(KERN_INFO "%s: %s type %8x at 0x%lx, ", + dev->name, pci_id_tbl[chip_idx].name, inl(ioaddr + ChipRev), ioaddr); + + if (drv_flags & IsGigabit) + for (i = 0; i < 6; i++) + dev->dev_addr[i] = inb(ioaddr + StnAddr + i); + else { + int ee_offset = (read_eeprom(ioaddr, 6) == 0xff ? 0x100 : 0); + for (i = 0; i < 6; i++) + dev->dev_addr[i] = read_eeprom(ioaddr, ee_offset + i); + } + for (i = 0; i < 5; i++) + printk("%2.2x:", dev->dev_addr[i]); + printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); + + /* Reset the chip. */ + outl(0x80000000, ioaddr + DMACtrl); + + dev->base_addr = ioaddr; + dev->irq = irq; + + pci_set_drvdata(pdev, dev); + np->lock = SPIN_LOCK_UNLOCKED; + + np->pci_dev = pdev; + np->chip_id = chip_idx; + np->drv_flags = drv_flags; + + if (dev->mem_start && dev->mem_start != ~0) + option = dev->mem_start; + + /* The lower four bits are the media type. */ + if (option > 0) { + if (option & 0x200) + np->full_duplex = 1; + np->default_port = option & 15; + if (np->default_port) + np->medialock = 1; + } + if (find_cnt < MAX_UNITS && full_duplex[find_cnt] > 0) + np->full_duplex = 1; + + if (np->full_duplex) + np->duplex_lock = 1; + + /* The Yellowfin-specific entries in the device structure. */ + dev->open = &yellowfin_open; + dev->hard_start_xmit = &yellowfin_start_xmit; + dev->stop = &yellowfin_close; + dev->get_stats = &yellowfin_get_stats; + dev->set_multicast_list = &set_rx_mode; + dev->do_ioctl = &mii_ioctl; + dev->tx_timeout = yellowfin_tx_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + + if (mtu) + dev->mtu = mtu; + + if (np->drv_flags & HasMII) { + int phy, phy_idx = 0; + for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) { + int mii_status = mdio_read(ioaddr, phy, 1); + if (mii_status != 0xffff && mii_status != 0x0000) { + np->phys[phy_idx++] = phy; + np->advertising = mdio_read(ioaddr, phy, 4); + printk(KERN_INFO "%s: MII PHY found at address %d, status " + "0x%4.4x advertising %4.4x.\n", + dev->name, phy, mii_status, np->advertising); + } + } + np->mii_cnt = phy_idx; + } + + find_cnt++; + + return 0; + +#ifndef USE_IO_OPS +err_out_free_res: + pci_release_regions(pdev); +#endif +err_out_free_netdev: + unregister_netdev (dev); + kfree (dev); + return -ENODEV; +} + static int __devinit read_eeprom(long ioaddr, int location) { int bogus_cnt = 10000; /* Typical 33Mhz: 1050 ticks */ - YF_OUTB(location, ioaddr + EEAddr); - YF_OUTB(0x30 | ((location >> 8) & 7), ioaddr + EECtrl); - while ((YF_INB(ioaddr + EEStatus) & 0x80) && --bogus_cnt > 0) + outb(location, ioaddr + EEAddr); + outb(0x30 | ((location >> 8) & 7), ioaddr + EECtrl); + while ((inb(ioaddr + EEStatus) & 0x80) && --bogus_cnt > 0) ; - return YF_INB(ioaddr + EERead); + return inb(ioaddr + EERead); } /* MII Managemen Data I/O accesses. @@ -384,24 +524,24 @@ { int i; - YF_OUTW((phy_id<<8) + location, ioaddr + MII_Addr); - YF_OUTW(1, ioaddr + MII_Cmd); + outw((phy_id<<8) + location, ioaddr + MII_Addr); + outw(1, ioaddr + MII_Cmd); for (i = 10000; i >= 0; i--) - if ((YF_INW(ioaddr + MII_Status) & 1) == 0) + if ((inw(ioaddr + MII_Status) & 1) == 0) break; - return YF_INW(ioaddr + MII_Rd_Data); + return inw(ioaddr + MII_Rd_Data); } static void mdio_write(long ioaddr, int phy_id, int location, int value) { int i; - YF_OUTW((phy_id<<8) + location, ioaddr + MII_Addr); - YF_OUTW(value, ioaddr + MII_Wr_Data); + outw((phy_id<<8) + location, ioaddr + MII_Addr); + outw(value, ioaddr + MII_Wr_Data); /* Wait for the command to finish. */ for (i = 10000; i >= 0; i--) - if ((YF_INW(ioaddr + MII_Status) & 1) == 0) + if ((inw(ioaddr + MII_Status) & 1) == 0) break; return; } @@ -414,10 +554,10 @@ int i; /* Reset the chip. */ - YF_OUTL(0x80000000, ioaddr + DMACtrl); + outl(0x80000000, ioaddr + DMACtrl); - if (request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev)) - return -EAGAIN; + i = request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev); + if (i) return i; if (yellowfin_debug > 1) printk(KERN_DEBUG "%s: yellowfin_open() irq %d.\n", @@ -425,58 +565,59 @@ yellowfin_init_ring(dev); - YF_OUTL(virt_to_bus(yp->rx_ring), ioaddr + RxPtr); - YF_OUTL(virt_to_bus(yp->tx_ring), ioaddr + TxPtr); + outl(virt_to_bus(yp->rx_ring), ioaddr + RxPtr); + outl(virt_to_bus(yp->tx_ring), ioaddr + TxPtr); for (i = 0; i < 6; i++) - YF_OUTB(dev->dev_addr[i], ioaddr + StnAddr + i); + outb(dev->dev_addr[i], ioaddr + StnAddr + i); /* Set up various condition 'select' registers. There are no options here. */ - YF_OUTL(0x00800080, ioaddr + TxIntrSel); /* Interrupt on Tx abort */ - YF_OUTL(0x00800080, ioaddr + TxBranchSel); /* Branch on Tx abort */ - YF_OUTL(0x00400040, ioaddr + TxWaitSel); /* Wait on Tx status */ - YF_OUTL(0x00400040, ioaddr + RxIntrSel); /* Interrupt on Rx done */ - YF_OUTL(0x00400040, ioaddr + RxBranchSel); /* Branch on Rx error */ - YF_OUTL(0x00400040, ioaddr + RxWaitSel); /* Wait on Rx done */ + outl(0x00800080, ioaddr + TxIntrSel); /* Interrupt on Tx abort */ + outl(0x00800080, ioaddr + TxBranchSel); /* Branch on Tx abort */ + outl(0x00400040, ioaddr + TxWaitSel); /* Wait on Tx status */ + outl(0x00400040, ioaddr + RxIntrSel); /* Interrupt on Rx done */ + outl(0x00400040, ioaddr + RxBranchSel); /* Branch on Rx error */ + outl(0x00400040, ioaddr + RxWaitSel); /* Wait on Rx done */ /* Initialize other registers: with so many this eventually this will converted to an offset/value list. */ - YF_OUTL(dma_ctrl, ioaddr + DMACtrl); - YF_OUTW(fifo_cfg, ioaddr + FIFOcfg); + outl(dma_ctrl, ioaddr + DMACtrl); + outw(fifo_cfg, ioaddr + FIFOcfg); /* Enable automatic generation of flow control frames, period 0xffff. */ - YF_OUTL(0x0030FFFF, ioaddr + FlowCtrl); + outl(0x0030FFFF, ioaddr + FlowCtrl); yp->tx_threshold = 32; - YF_OUTL(yp->tx_threshold, ioaddr + TxThreshold); + outl(yp->tx_threshold, ioaddr + TxThreshold); if (dev->if_port == 0) dev->if_port = yp->default_port; - netif_start_queue (dev); + netif_start_queue(dev); /* Setting the Rx mode will start the Rx process. */ - if (yp->flags & IsGigabit) { + if (yp->drv_flags & IsGigabit) { /* We are always in full-duplex mode with gigabit! */ yp->full_duplex = 1; - YF_OUTW(0x01CF, ioaddr + Cnfg); + outw(0x01CF, ioaddr + Cnfg); } else { - YF_OUTW(0x0018, ioaddr + FrameGap0); /* 0060/4060 for non-MII 10baseT */ - YF_OUTW(0x1018, ioaddr + FrameGap1); - YF_OUTW(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg); + outw(0x0018, ioaddr + FrameGap0); /* 0060/4060 for non-MII 10baseT */ + outw(0x1018, ioaddr + FrameGap1); + outw(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg); } set_rx_mode(dev); /* Enable interrupts by setting the interrupt mask. */ - YF_OUTW(0x81ff, ioaddr + IntrEnb); /* See enum intr_status_bits */ - YF_OUTW(0x0000, ioaddr + EventStatus); /* Clear non-interrupting events */ - YF_OUTL(0x80008000, ioaddr + RxCtrl); /* Start Rx and Tx channels. */ - YF_OUTL(0x80008000, ioaddr + TxCtrl); + outw(0x81ff, ioaddr + IntrEnb); /* See enum intr_status_bits */ + outw(0x0000, ioaddr + EventStatus); /* Clear non-interrupting events */ + outl(0x80008000, ioaddr + RxCtrl); /* Start Rx and Tx channels. */ + outl(0x80008000, ioaddr + TxCtrl); if (yellowfin_debug > 2) { printk(KERN_DEBUG "%s: Done yellowfin_open().\n", dev->name); } + /* Set the timer to check for link beat. */ init_timer(&yp->timer); yp->timer.expires = jiffies + 3*HZ; @@ -496,7 +637,7 @@ if (yellowfin_debug > 3) { printk(KERN_DEBUG "%s: Yellowfin timer tick, status %8.8x.\n", - dev->name, YF_INW(ioaddr + IntrStatus)); + dev->name, inw(ioaddr + IntrStatus)); } if (yp->mii_cnt) { @@ -513,7 +654,7 @@ || (negotiated & 0x00C0) == 0x0040)) { yp->full_duplex = 1; } - YF_OUTW(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg); + outw(0x101C | (yp->full_duplex ? 2 : 0), ioaddr + Cnfg); if (mii_reg1 & 0x0004) next_tick = 60*HZ; @@ -533,7 +674,7 @@ printk(KERN_WARNING "%s: Yellowfin transmit timed out at %d/%d Tx " "status %4.4x, Rx status %4.4x, resetting...\n", dev->name, yp->cur_tx, yp->dirty_tx, - YF_INL(ioaddr + TxStatus), YF_INL(ioaddr + RxStatus)); + inl(ioaddr + TxStatus), inl(ioaddr + RxStatus)); /* Note: these should be KERN_DEBUG. */ if (yellowfin_debug) { @@ -553,13 +694,12 @@ dev->if_port = 0; /* Wake the potentially-idle transmit channel. */ - YF_OUTL(0x10001000, dev->base_addr + TxCtrl); + outl(0x10001000, dev->base_addr + TxCtrl); if (yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE) netif_wake_queue (dev); /* Typical path */ dev->trans_start = jiffies; yp->stats.tx_errors++; - return; } /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ @@ -642,8 +782,8 @@ netif_stop_queue (dev); - /* Caution: the write order is important here, set the base address - with the "ownership" bits last. */ + /* Note: Ordering is important here, set the field with the + "ownership" bit last, and only then increment cur_tx. */ /* Calculate the next Tx descriptor entry. */ entry = yp->cur_tx % TX_RING_SIZE; @@ -691,7 +831,7 @@ /* Non-x86 Todo: explicitly flush cache lines here. */ /* Wake the potentially-idle transmit channel. */ - YF_OUTL(0x10001000, dev->base_addr + TxCtrl); + outl(0x10001000, dev->base_addr + TxCtrl); if (yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE) netif_start_queue (dev); /* Typical path */ @@ -712,7 +852,8 @@ { struct net_device *dev = (struct net_device *)dev_instance; struct yellowfin_private *yp; - long ioaddr, boguscnt = max_interrupt_work; + long ioaddr; + int boguscnt = max_interrupt_work; #ifndef final_version /* Can never occur. */ if (dev == NULL) { @@ -727,7 +868,7 @@ spin_lock (&yp->lock); do { - u16 intr_status = YF_INW(ioaddr + IntrClear); + u16 intr_status = inw(ioaddr + IntrClear); if (yellowfin_debug > 4) printk(KERN_DEBUG "%s: Yellowfin interrupt, status %4.4x.\n", @@ -738,7 +879,7 @@ if (intr_status & (IntrRxDone | IntrEarlyRx)) { yellowfin_rx(dev); - YF_OUTL(0x10001000, ioaddr + RxCtrl); /* Wake Rx engine. */ + outl(0x10001000, ioaddr + RxCtrl); /* Wake Rx engine. */ } #ifdef NO_TXSTATS @@ -746,8 +887,8 @@ int entry = yp->dirty_tx % TX_RING_SIZE; if (yp->tx_ring[entry].result_status == 0) break; - yp->stats.tx_bytes += yp->tx_skbuff[entry]->len; yp->stats.tx_packets++; + yp->stats.tx_bytes += yp->tx_skbuff[entry]->len; /* Free the original skb. */ dev_kfree_skb_irq(yp->tx_skbuff[entry]); yp->tx_skbuff[entry] = 0; @@ -756,11 +897,8 @@ && yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) { /* The ring is no longer full, clear tbusy. */ yp->tx_full = 0; - } - if (yp->tx_full) - netif_stop_queue(dev); - else netif_wake_queue(dev); + } #else if (intr_status & IntrTxDone || yp->tx_tail_desc->tx_errs) { @@ -831,11 +969,8 @@ && yp->cur_tx - dirty_tx < TX_QUEUE_SIZE - 2) { /* The ring is no longer full, clear tbusy. */ yp->tx_full = 0; - } - if (yp->tx_full) - netif_stop_queue(dev); - else netif_wake_queue(dev); + } yp->dirty_tx = dirty_tx; yp->tx_tail_desc = &yp->tx_status[dirty_tx % TX_RING_SIZE]; @@ -847,7 +982,8 @@ yellowfin_error(dev, intr_status); if (--boguscnt < 0) { - printk(KERN_WARNING "%s: Too much work at interrupt, status=0x%4.4x.\n", + printk(KERN_WARNING "%s: Too much work at interrupt, " + "status=0x%4.4x.\n", dev->name, intr_status); break; } @@ -855,19 +991,10 @@ if (yellowfin_debug > 3) printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", - dev->name, YF_INW(ioaddr + IntrStatus)); - - /* Code that should never be run! Perhaps remove after testing.. */ - { - static int stopit = 10; - if ((!(netif_running(dev))) && --stopit < 0) { - printk(KERN_ERR "%s: Emergency stop, looping startup interrupt.\n", - dev->name); - free_irq(irq, dev); - } - } + dev->name, inw(ioaddr + IntrStatus)); spin_unlock (&yp->lock); + return; } /* This routine is logically part of the interrupt handler, but separated @@ -876,7 +1003,7 @@ { struct yellowfin_private *yp = (struct yellowfin_private *)dev->priv; int entry = yp->cur_rx % RX_RING_SIZE; - int boguscnt = 20; + int boguscnt = yp->dirty_rx + RX_RING_SIZE - yp->cur_rx; if (yellowfin_debug > 4) { printk(KERN_DEBUG " In yellowfin_rx(), entry %d status %8.8x.\n", @@ -905,7 +1032,7 @@ printk(KERN_WARNING "%s: Oversized Ethernet frame spanned multiple buffers," " status %4.4x!\n", dev->name, desc_status); yp->stats.rx_length_errors++; - } else if ((yp->flags & IsGigabit) && (frame_status & 0x0038)) { + } else if ((yp->drv_flags & IsGigabit) && (frame_status & 0x0038)) { /* There was a error. */ if (yellowfin_debug > 3) printk(KERN_DEBUG " yellowfin_rx() Rx error was %4.4x.\n", @@ -915,7 +1042,7 @@ if (frame_status & 0x0008) yp->stats.rx_frame_errors++; if (frame_status & 0x0010) yp->stats.rx_crc_errors++; if (frame_status < 0) yp->stats.rx_dropped++; - } else if ( !(yp->flags & IsGigabit) && + } else if ( !(yp->drv_flags & IsGigabit) && ((buf_addr[data_size-1] & 0x85) || buf_addr[data_size-2] & 0xC0)) { u8 status1 = buf_addr[data_size-2]; u8 status2 = buf_addr[data_size-1]; @@ -952,21 +1079,22 @@ without copying to a properly sized skbuff. */ if (pkt_len > rx_copybreak) { char *temp = skb_put(skb = yp->rx_skbuff[entry], pkt_len); -#ifndef final_verison /* Remove after testing. */ + yp->rx_skbuff[entry] = NULL; +#ifndef final_version /* Remove after testing. */ if (le32desc_to_virt(yp->rx_ring[entry].addr) != temp) - printk(KERN_WARNING "%s: Warning -- the skbuff addresses " + printk(KERN_ERR "%s: Internal fault: The skbuff addresses " "do not match in yellowfin_rx: %p vs. %p / %p.\n", - dev->name, le32desc_to_virt(yp->rx_ring[entry].addr), + dev->name, + le32desc_to_virt(yp->rx_ring[entry].addr), skb->head, temp); #endif - yp->rx_skbuff[entry] = NULL; } else { skb = dev_alloc_skb(pkt_len + 2); if (skb == NULL) break; skb->dev = dev; - skb_reserve(skb, 2); /* 16 byte align the data fields */ -#if 1 || USE_IP_CSUM + skb_reserve(skb, 2); /* 16 byte align the IP header */ +#if HAS_IP_COPYSUM eth_copy_and_sum(skb, yp->rx_skbuff[entry]->tail, pkt_len, 0); skb_put(skb, pkt_len); #else @@ -989,9 +1117,9 @@ entry = yp->dirty_rx % RX_RING_SIZE; if (yp->rx_skbuff[entry] == NULL) { struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); - if (skb == NULL) - break; /* Better luck next round. */ yp->rx_skbuff[entry] = skb; + if (skb == NULL) + break; /* Better luck next round. */ skb->dev = dev; /* Mark as being used by this device. */ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ yp->rx_ring[entry].addr = virt_to_le32desc(skb->tail); @@ -1032,29 +1160,30 @@ netif_stop_queue (dev); if (yellowfin_debug > 1) { - printk(KERN_DEBUG "%s: Shutting down ethercard, status was Tx %4.4x Rx %4.4x Int %2.2x.\n", - dev->name, YF_INW(ioaddr + TxStatus), - YF_INW(ioaddr + RxStatus), - YF_INW(ioaddr + IntrStatus)); + printk(KERN_DEBUG "%s: Shutting down ethercard, status was Tx %4.4x " + "Rx %4.4x Int %2.2x.\n", + dev->name, inw(ioaddr + TxStatus), + inw(ioaddr + RxStatus), inw(ioaddr + IntrStatus)); printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d, Rx %d / %d.\n", dev->name, yp->cur_tx, yp->dirty_tx, yp->cur_rx, yp->dirty_rx); } /* Disable interrupts by clearing the interrupt mask. */ - YF_OUTW(0x0000, ioaddr + IntrEnb); + outw(0x0000, ioaddr + IntrEnb); /* Stop the chip's Tx and Rx processes. */ - YF_OUTL(0x80000000, ioaddr + RxCtrl); - YF_OUTL(0x80000000, ioaddr + TxCtrl); + outl(0x80000000, ioaddr + RxCtrl); + outl(0x80000000, ioaddr + TxCtrl); del_timer(&yp->timer); -#if !defined(final_version) && defined(__i386__) +#if defined(__i386__) if (yellowfin_debug > 2) { - printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", (int)virt_to_bus(yp->tx_ring)); + printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", + (int)virt_to_bus(yp->tx_ring)); for (i = 0; i < TX_RING_SIZE*2; i++) printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", - YF_INL(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', + inl(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); @@ -1063,10 +1192,11 @@ i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); - printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", (int)virt_to_bus(yp->rx_ring)); + printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", + (int)virt_to_bus(yp->rx_ring)); for (i = 0; i < RX_RING_SIZE; i++) { printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", - YF_INL(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ', + inl(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ', i, yp->rx_ring[i].dbdma_cmd, yp->rx_ring[i].addr, yp->rx_ring[i].result_status); if (yellowfin_debug > 6) { @@ -1105,6 +1235,7 @@ dev->name, bogus_rx); } #endif + return 0; } @@ -1143,17 +1274,17 @@ { struct yellowfin_private *yp = (struct yellowfin_private *)dev->priv; long ioaddr = dev->base_addr; - u16 cfg_value = YF_INW(ioaddr + Cnfg); + u16 cfg_value = inw(ioaddr + Cnfg); /* Stop the Rx process to change any value. */ - YF_OUTW(cfg_value & ~0x1000, ioaddr + Cnfg); + outw(cfg_value & ~0x1000, ioaddr + Cnfg); if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ /* Unconditionally log net taps. */ printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name); - YF_OUTW(0x000F, ioaddr + AddrMode); + outw(0x000F, ioaddr + AddrMode); } else if ((dev->mc_count > 64) || (dev->flags & IFF_ALLMULTI)) { /* Too many to filter well, or accept all multicasts. */ - YF_OUTW(0x000B, ioaddr + AddrMode); + outw(0x000B, ioaddr + AddrMode); } else if (dev->mc_count > 0) { /* Must use the multicast hash table. */ struct dev_mc_list *mclist; u16 hash_table[4]; @@ -1163,7 +1294,7 @@ i++, mclist = mclist->next) { /* Due to a bug in the early chip versions, multiple filter slots must be set for each address. */ - if (yp->flags & HasMulticastBug) { + if (yp->drv_flags & HasMulticastBug) { set_bit((ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f, hash_table); set_bit((ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f, @@ -1176,24 +1307,24 @@ } /* Copy the hash table to the chip. */ for (i = 0; i < 4; i++) - YF_OUTW(hash_table[i], ioaddr + HashTbl + i*2); - YF_OUTW(0x0003, ioaddr + AddrMode); + outw(hash_table[i], ioaddr + HashTbl + i*2); + outw(0x0003, ioaddr + AddrMode); } else { /* Normal, unicast/broadcast-only mode. */ - YF_OUTW(0x0001, ioaddr + AddrMode); + outw(0x0001, ioaddr + AddrMode); } /* Restart the Rx process. */ - YF_OUTW(cfg_value | 0x1000, ioaddr + Cnfg); + outw(cfg_value | 0x1000, ioaddr + Cnfg); } -#ifdef HAVE_PRIVATE_IOCTL static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { + struct yellowfin_private *np = (void *)dev->priv; long ioaddr = dev->base_addr; u16 *data = (u16 *)&rq->ifr_data; switch(cmd) { case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ - data[0] = ((struct yellowfin_private *)dev->priv)->phys[0] & 0x1f; + data[0] = np->phys[0] & 0x1f; /* Fall Through */ case SIOCDEVPRIVATE+1: /* Read the specified MII register. */ data[3] = mdio_read(ioaddr, data[0] & 0x1f, data[1] & 0x1f); @@ -1201,155 +1332,30 @@ case SIOCDEVPRIVATE+2: /* Write the specified MII register */ if (!capable(CAP_NET_ADMIN)) return -EPERM; + if (data[0] == np->phys[0]) { + u16 value = data[2]; + switch (data[1]) { + case 0: + /* Check for autonegotiation on or reset. */ + np->medialock = (value & 0x9000) ? 0 : 1; + if (np->medialock) + np->full_duplex = (value & 0x0100) ? 1 : 0; + break; + case 4: np->advertising = value; break; + } + /* Perhaps check_duplex(dev), depending on chip semantics. */ + } mdio_write(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2]); return 0; default: return -EOPNOTSUPP; } } -#endif /* HAVE_PRIVATE_IOCTL */ - - -static int __devinit yellowfin_init_one(struct pci_dev *pdev, - const struct pci_device_id *ent) -{ - struct net_device *dev; - struct yellowfin_private *yp; - int option, i, irq; - int flags, chip_idx; - static int find_cnt = 0; - long ioaddr, real_ioaddr; - - chip_idx = ent->driver_data; - flags = chip_info[chip_idx].flags; - - dev = init_etherdev(NULL, sizeof(*yp)); - if (!dev) { - printk (KERN_ERR PFX "cannot allocate ethernet device\n"); - return -ENOMEM; - } - SET_MODULE_OWNER(dev); - - yp = dev->priv; - - if (!request_region (pci_resource_start (pdev, 0), - YELLOWFIN_SIZE, YELLOWFIN_MODULE_NAME)) { - printk (KERN_ERR PFX "cannot obtain I/O port region\n"); - goto err_out_free_netdev; - } - if (!request_mem_region (pci_resource_start (pdev, 1), - YELLOWFIN_SIZE, YELLOWFIN_MODULE_NAME)) { - printk (KERN_ERR PFX "cannot obtain MMIO region\n"); - goto err_out_free_pio_region; - } - - if (pci_enable_device (pdev)) - goto err_out_free_mmio_region; - pci_set_master (pdev); - -#ifdef USE_IO_OPS - real_ioaddr = ioaddr = pci_resource_start (pdev, 0); -#else - real_ioaddr = ioaddr = pci_resource_start (pdev, 1); - ioaddr = (long) ioremap(ioaddr, YELLOWFIN_SIZE); - if (!ioaddr) - goto err_out_free_mmio_region; -#endif - irq = pdev->irq; - printk(KERN_INFO "%s: %s type %8x at 0x%lx, ", - dev->name, chip_info[chip_idx].name, - YF_INL(ioaddr + ChipRev), real_ioaddr); - - if (flags & IsGigabit) - for (i = 0; i < 6; i++) - dev->dev_addr[i] = YF_INB(ioaddr + StnAddr + i); - else { - int ee_offset = (read_eeprom(ioaddr, 6) == 0xff ? 0x100 : 0); - for (i = 0; i < 6; i++) - dev->dev_addr[i] = read_eeprom(ioaddr, ee_offset + i); - } - for (i = 0; i < 5; i++) - printk("%2.2x:", dev->dev_addr[i]); - printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); - - /* Reset the chip. */ - YF_OUTL(0x80000000, ioaddr + DMACtrl); - - dev->base_addr = ioaddr; - dev->irq = irq; - - pdev->driver_data = dev; - yp->chip_id = chip_idx; - yp->flags = flags; - yp->lock = SPIN_LOCK_UNLOCKED; - - option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; - if (dev->mem_start) - option = dev->mem_start; - - /* The lower four bits are the media type. */ - if (option > 0) { - if (option & 0x200) - yp->full_duplex = 1; - yp->default_port = option & 15; - if (yp->default_port) - yp->medialock = 1; - } - if (find_cnt < MAX_UNITS && full_duplex[find_cnt] > 0) - yp->full_duplex = 1; - - if (yp->full_duplex) - yp->duplex_lock = 1; - - /* The Yellowfin-specific entries in the device structure. */ - dev->open = &yellowfin_open; - dev->hard_start_xmit = &yellowfin_start_xmit; - dev->stop = &yellowfin_close; - dev->get_stats = &yellowfin_get_stats; - dev->set_multicast_list = &set_rx_mode; -#ifdef HAVE_PRIVATE_IOCTL - dev->do_ioctl = &mii_ioctl; -#endif - dev->tx_timeout = yellowfin_tx_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - - if (mtu) - dev->mtu = mtu; - - if (yp->flags & HasMII) { - int phy, phy_idx = 0; - for (phy = 0; phy < 32 && phy_idx < 4; phy++) { - int mii_status = mdio_read(ioaddr, phy, 1); - if (mii_status != 0xffff && - mii_status != 0x0000) { - yp->phys[phy_idx++] = phy; - yp->advertising = mdio_read(ioaddr, phy, 4); - printk(KERN_INFO "%s: MII PHY found at address %d, status " - "0x%4.4x advertising %4.4x.\n", - dev->name, phy, mii_status, yp->advertising); - } - } - yp->mii_cnt = phy_idx; - } - - find_cnt++; - - return 0; - -err_out_free_mmio_region: - release_mem_region (pci_resource_start (pdev, 1), YELLOWFIN_SIZE); -err_out_free_pio_region: - release_region (pci_resource_start (pdev, 0), YELLOWFIN_SIZE); -err_out_free_netdev: - unregister_netdev (dev); - kfree (dev); - return -ENODEV; -} static void __devexit yellowfin_remove_one (struct pci_dev *pdev) { - struct net_device *dev = pdev->driver_data; + struct net_device *dev = pci_get_drvdata(pdev); struct yellowfin_private *np; if (!dev) @@ -1358,19 +1364,19 @@ unregister_netdev (dev); - release_region (dev->base_addr, YELLOWFIN_SIZE); - release_mem_region (dev->base_addr, YELLOWFIN_SIZE); + pci_release_regions (pdev); #ifndef USE_IO_OPS iounmap ((void *) dev->base_addr); #endif kfree (dev); + pci_set_drvdata(pdev, NULL); } static struct pci_driver yellowfin_driver = { - name: YELLOWFIN_MODULE_NAME, + name: "yellowfin", id_table: yellowfin_pci_tbl, probe: yellowfin_init_one, remove: yellowfin_remove_one, @@ -1380,7 +1386,8 @@ static int __init yellowfin_init (void) { if (debug) /* Emit version even if no cards detected. */ - printk(KERN_INFO "%s", version); + printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s", + version1, version2, version3); return pci_module_init (&yellowfin_driver); } @@ -1394,12 +1401,12 @@ module_init(yellowfin_init); module_exit(yellowfin_cleanup); - - + /* * Local variables: - * compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c yellowfin.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`" - * compile-command-alphaLX: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O2 -c yellowfin.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS` -fomit-frame-pointer -fno-strength-reduce -mno-fp-regs -Wa,-m21164a -DBWX_USABLE -DBWIO_ENABLED" + * compile-command: "gcc -DMODULE -Wall -Wstrict-prototypes -O6 -c yellowfin.c" + * compile-command-alphaLX: "gcc -DMODULE -Wall -Wstrict-prototypes -O2 -c yellowfin.c -fomit-frame-pointer -fno-strength-reduce -mno-fp-regs -Wa,-m21164a -DBWX_USABLE -DBWIO_ENABLED" + * simple-compile-command: "gcc -DMODULE -O6 -c yellowfin.c" * c-indent-level: 4 * c-basic-offset: 4 * tab-width: 4 diff -u --recursive --new-file v2.4.2/linux/drivers/pci/pci.c linux/drivers/pci/pci.c --- v2.4.2/linux/drivers/pci/pci.c Wed Feb 21 18:20:30 2001 +++ linux/drivers/pci/pci.c Fri Mar 2 11:02:15 2001 @@ -39,10 +39,12 @@ /** * pci_find_slot - locate PCI device from a given PCI slot * @bus: number of PCI bus on which desired PCI device resides - * @devfn: number of PCI slot in which desired PCI device resides + * @devfn: encodes number of PCI slot in which the desired PCI + * device resides and the logical device number within that slot + * in case of multi-function devices. * - * Given a PCI bus and slot number, the desired PCI device is - * located in system global list of PCI devices. If the device + * Given a PCI bus and slot/function number, the desired PCI device + * is located in system global list of PCI devices. If the device * is found, a pointer to its data structure is returned. If no * device is found, %NULL is returned. */ @@ -58,7 +60,20 @@ return NULL; } - +/** + * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id + * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids + * @device: PCI device id to match, or %PCI_ANY_ID to match all vendor ids + * @ss_vendor: PCI subsystem vendor id to match, or %PCI_ANY_ID to match all vendor ids + * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all vendor ids + * @from: Previous PCI device found in search, or %NULL for new search. + * + * Iterates through the list of known PCI devices. If a PCI device is + * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its + * device structure is returned. Otherwise, %NULL is returned. + * A new search is initiated by passing %NULL to the @from argument. + * Otherwise if @from is not %NULL, searches continue from next device on the global list. + */ struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device, unsigned int ss_vendor, unsigned int ss_device, @@ -88,9 +103,8 @@ * Iterates through the list of known PCI devices. If a PCI device is * found with a matching @vendor and @device, a pointer to its device structure is * returned. Otherwise, %NULL is returned. - * * A new search is initiated by passing %NULL to the @from argument. - * Otherwise if @from is not null, searches continue from that point. + * Otherwise if @from is not %NULL, searches continue from next device on the global list. */ struct pci_dev * pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from) @@ -107,9 +121,8 @@ * Iterates through the list of known PCI devices. If a PCI device is * found with a matching @class, a pointer to its device structure is * returned. Otherwise, %NULL is returned. - * * A new search is initiated by passing %NULL to the @from argument. - * Otherwise if @from is not null, searches continue from that point. + * Otherwise if @from is not %NULL, searches continue from next device on the global list. */ struct pci_dev * pci_find_class(unsigned int class, const struct pci_dev *from) @@ -125,7 +138,28 @@ return NULL; } - +/** + * pci_find_capability - query for devices' capabilities + * @dev: PCI device to query + * @cap: capability code + * + * Tell if a device supports a given PCI capability. + * Returns the address of the requested capability structure within the device's PCI + * configuration space or 0 in case the device does not support it. + * Possible values for @flags: + * + * %PCI_CAP_ID_PM Power Management + * + * %PCI_CAP_ID_AGP Accelerated Graphics Port + * + * %PCI_CAP_ID_VPD Vital Product Data + * + * %PCI_CAP_ID_SLOTID Slot Identification + * + * %PCI_CAP_ID_MSI Message Signalled Interrupts + * + * %PCI_CAP_ID_CHSWP CompactPCI HotSwap + */ int pci_find_capability(struct pci_dev *dev, int cap) { @@ -274,12 +308,93 @@ return pin; } +/** + * pci_release_regions - Release reserved PCI I/O and memory resources + * @pdev: PCI device whose resources were previously reserved by pci_request_regions + * + * Releases all PCI I/O and memory resources previously reserved by a + * successful call to pci_request_regions. Call this function only + * after all use of the PCI regions has ceased. + */ +void pci_release_regions(struct pci_dev *pdev) +{ + int i; + + for (i = 0; i < 6; i++) { + if (pci_resource_len(pdev, i) == 0) + continue; + + if (pci_resource_flags(pdev, i) & IORESOURCE_IO) + release_region(pci_resource_start(pdev, i), + pci_resource_len(pdev, i)); + + else if (pci_resource_flags(pdev, i) & IORESOURCE_MEM) + release_mem_region(pci_resource_start(pdev, i), + pci_resource_len(pdev, i)); + } +} + +/** + * pci_request_regions - Reserved PCI I/O and memory resources + * @pdev: PCI device whose resources are to be reserved + * + * Mark all PCI regions associated with PCI device @pdev as + * being reserved by owner @res_name. Do not access any + * address inside the PCI regions unless this call returns + * successfully. + * + * Returns 0 on success, or %EBUSY on error. A warning + * message is also printed on failure. + */ +int pci_request_regions(struct pci_dev *pdev, char *res_name) +{ + int i; + + for (i = 0; i < 6; i++) { + if (pci_resource_len(pdev, i) == 0) + continue; + + if (pci_resource_flags(pdev, i) & IORESOURCE_IO) { + if (!request_region(pci_resource_start(pdev, i), + pci_resource_len(pdev, i), res_name)) + goto err_out; + } + + else if (pci_resource_flags(pdev, i) & IORESOURCE_MEM) { + if (!request_mem_region(pci_resource_start(pdev, i), + pci_resource_len(pdev, i), res_name)) + goto err_out; + } + } + + return 0; + +err_out: + printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%lx@%lx for device %s\n", + pci_resource_flags(pdev, i) & IORESOURCE_IO ? "I/O" : "mem", + i + 1, /* PCI BAR # */ + pci_resource_len(pdev, i), pci_resource_start(pdev, i), + pdev->slot_name); + pci_release_regions(pdev); + return -EBUSY; +} + + /* * Registration of PCI drivers and handling of hot-pluggable devices. */ static LIST_HEAD(pci_drivers); +/** + * pci_match_device - Tell if a PCI device structure has a matching PCI device + * @ids: array of PCI device id structures to search in + * @dev: the PCI device structure to match against + * + * Used by a driver to check whether a PCI device present in the + * system is in its list of supported devices.Returns the matching + * pci_device_id structure or %NULL if there is no match. + */ const struct pci_device_id * pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { @@ -320,6 +435,14 @@ return ret; } +/** + * pci_register_driver - register a new pci driver + * @drv: the driver structure to register + * + * Adds the driver structure to the list of registered drivers + * Returns the number of pci devices which were claimed by the driver + * during registration. + */ int pci_register_driver(struct pci_driver *drv) { @@ -334,6 +457,15 @@ return count; } +/** + * pci_unregister_driver - unregister a pci driver + * @drv: the driver structure to unregister + * + * Deletes the driver structure from the list of registered PCI drivers, + * gives it a chance to clean up and marks the devices for which it + * was responsible as driverless. + */ + void pci_unregister_driver(struct pci_driver *drv) { @@ -395,6 +527,13 @@ call_usermodehelper (argv [0], argv, envp); } +/** + * pci_insert_device - insert a hotplug device + * @dev: the device to insert + * @bus: where to insert it + * + * Add a new device to the device lists and notify userspace (/sbin/hotplug). + */ void pci_insert_device(struct pci_dev *dev, struct pci_bus *bus) { @@ -427,6 +566,13 @@ } } +/** + * pci_remove_device - remove a hotplug device + * @dev: the device to remove + * + * Delete the device structure from the device lists and + * notify userspace (/sbin/hotplug). + */ void pci_remove_device(struct pci_dev *dev) { @@ -452,6 +598,13 @@ name: "compat" }; +/** + * pci_dev_driver - get the pci_driver of a device + * @dev: the device to query + * + * Returns the appropriate pci_driver structure or %NULL if there is no + * registered driver for the device. + */ struct pci_driver * pci_dev_driver(const struct pci_dev *dev) { @@ -503,7 +656,13 @@ PCI_OP(write, word, u16) PCI_OP(write, dword, u32) - +/** + * pci_set_master - enables bus-mastering for device dev + * @dev: the PCI device to enable + * + * Enables bus-mastering on the device and calls pcibios_set_master() + * to do the needed arch specific settings. + */ void pci_set_master(struct pci_dev *dev) { @@ -837,8 +996,15 @@ dev->irq = irq; } -/* - * Fill in class and map information of a device +/** + * pci_setup_device - fill in class and map information of a device + * @dev: the device structure to fill + * + * Initialize the device structure with information about the device's + * vendor,class,memory and IO-space addresses,IRQ lines etc. + * Called at initialisation of the PCI subsystem and by CardBus services. + * Returns 0 on success and -1 if unknown type of device (not normal, bridge + * or CardBus). */ int pci_setup_device(struct pci_dev * dev) { diff -u --recursive --new-file v2.4.2/linux/drivers/s390/char/tape34xx.c linux/drivers/s390/char/tape34xx.c --- v2.4.2/linux/drivers/s390/char/tape34xx.c Wed Feb 21 18:20:30 2001 +++ linux/drivers/s390/char/tape34xx.c Fri Mar 2 11:12:07 2001 @@ -1437,7 +1437,7 @@ debug_text_event (tape_debug_area,6,"xdefhandle"); #endif /* TAPE_DEBUG */ tapestate_set (tape, TS_FAILED); - PRINT_ERR ("TAPE34XX: An unexpected Unit Check occured.\n"); + PRINT_ERR ("TAPE34XX: An unexpected Unit Check occurred.\n"); PRINT_ERR ("TAPE34XX: Please read Documentation/s390/TAPE and report it!\n"); PRINT_ERR ("TAPE34XX: Current state is: %s", (((tapestate_get (tape) < TS_SIZE) && (tapestate_get (tape) >= 0)) ? @@ -1804,7 +1804,7 @@ tape->wanna_wakeup=1; wake_up (&tape->wq); } else { - PRINT_ERR ("TAPE34XX: An unexpected Unit Check occured.\n"); + PRINT_ERR ("TAPE34XX: An unexpected Unit Check occurred.\n"); PRINT_ERR ("TAPE34XX: Please send the following 20 lines of output to cotte@de.ibm.com\n"); PRINT_ERR ("TAPE34XX: Current state is: %s", (((tapestate_get (tape) < TS_SIZE) && (tapestate_get (tape) >= 0)) ? diff -u --recursive --new-file v2.4.2/linux/drivers/s390/net/ctc.c linux/drivers/s390/net/ctc.c --- v2.4.2/linux/drivers/s390/net/ctc.c Wed Feb 21 18:20:31 2001 +++ linux/drivers/s390/net/ctc.c Fri Mar 2 11:12:07 2001 @@ -884,7 +884,7 @@ if (sense & 0x01) printk(KERN_DEBUG "%s: Interface disconnect or Selective reset occurred (remote side)\n", dev->name); else - printk(KERN_DEBUG "%s: System reset occured (remote side)\n", dev->name); + printk(KERN_DEBUG "%s: System reset occurred (remote side)\n", dev->name); #endif } else if (sense & 0x20) { if (sense & 0x04) diff -u --recursive --new-file v2.4.2/linux/drivers/s390/s390mach.c linux/drivers/s390/s390mach.c --- v2.4.2/linux/drivers/s390/s390mach.c Wed Feb 21 18:20:31 2001 +++ linux/drivers/s390/s390mach.c Fri Mar 2 11:12:07 2001 @@ -139,7 +139,7 @@ #endif memcpy( &mcic, - &S390_lowcore.mcck_interuption_code, + &S390_lowcore.mcck_interruption_code, sizeof(__u64)); if ( mcic.mcc.mcd.cp ) // CRW pending ? diff -u --recursive --new-file v2.4.2/linux/drivers/scsi/3w-xxxx.c linux/drivers/scsi/3w-xxxx.c --- v2.4.2/linux/drivers/scsi/3w-xxxx.c Wed Nov 8 17:09:50 2000 +++ linux/drivers/scsi/3w-xxxx.c Fri Mar 2 11:12:06 2001 @@ -1573,6 +1573,8 @@ /* This function will find and initialize any cards */ int tw_scsi_detect(Scsi_Host_Template *tw_host) { + int ret; + dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_detect()\n"); /* Check if the kernel has PCI interface compiled in */ @@ -1581,7 +1583,11 @@ return 0; } - return(tw_findcards(tw_host)); + spin_unlock_irq(&io_request_lock); + ret = tw_findcards(tw_host); + spin_lock_irq(&io_request_lock); + + return ret; } /* End tw_scsi_detect() */ /* This is the new scsi eh abort function */ diff -u --recursive --new-file v2.4.2/linux/drivers/scsi/3w-xxxx.h linux/drivers/scsi/3w-xxxx.h --- v2.4.2/linux/drivers/scsi/3w-xxxx.h Mon Dec 11 13:19:49 2000 +++ linux/drivers/scsi/3w-xxxx.h Fri Mar 2 11:12:06 2001 @@ -289,7 +289,7 @@ unsigned short aen_queue[TW_Q_LENGTH]; unsigned char aen_head; unsigned char aen_tail; - u32 flags; + long flags; /* long req'd for set_bit --RR */ } TW_Device_Extension; /* Function prototypes */ diff -u --recursive --new-file v2.4.2/linux/drivers/scsi/NCR53c406a.c linux/drivers/scsi/NCR53c406a.c --- v2.4.2/linux/drivers/scsi/NCR53c406a.c Mon Sep 18 13:36:24 2000 +++ linux/drivers/scsi/NCR53c406a.c Fri Mar 2 11:12:11 2001 @@ -184,13 +184,13 @@ /* ================================================================= */ #if USE_BIOS -static void *bios_base = (void *)0; +static void *bios_base; #endif #if PORT_BASE static int port_base = PORT_BASE; #else -static int port_base = 0; +static int port_base; #endif #if IRQ_LEV @@ -200,16 +200,16 @@ #endif #if USE_DMA -static int dma_chan = 0; +static int dma_chan; #endif #if USE_PIO static int fast_pio = USE_FAST_PIO; #endif -static Scsi_Cmnd *current_SC = NULL; -static volatile int internal_done_flag = 0; -static volatile int internal_done_errcode = 0; +static Scsi_Cmnd *current_SC; +static volatile int internal_done_flag; +static volatile int internal_done_errcode; static char info_msg[256]; /* ================================================================= */ @@ -484,17 +484,17 @@ #endif USE_BIOS #ifdef PORT_BASE - if (check_region(port_base, 0x10)) /* ports already snatched */ + if (!request_region(port_base, 0x10, "NCR53c406a")) /* ports already snatched */ port_base = 0; #else /* autodetect */ if (port_base) { /* LILO override */ - if (check_region(port_base, 0x10)) + if (!request_region(port_base, 0x10, "NCR53c406a")) port_base = 0; } else { for(i=0; i 0) { if(request_irq(irq_level, do_NCR53c406a_intr, 0, "NCR53c406a", NULL)){ printk("NCR53c406a: unable to allocate IRQ %d\n", irq_level); - return 0; + goto err_release; } tpnt->can_queue = 1; DEB(printk("NCR53c406a: allocated IRQ %d\n", irq_level)); @@ -548,19 +548,19 @@ DEB(printk("NCR53c406a: No interrupts detected\n")); #if USE_DMA printk("NCR53c406a: No interrupts found and DMA mode defined. Giving up.\n"); - return 0; + goto err_release; #endif USE_DMA } else { DEB(printk("NCR53c406a: Shouldn't get here!\n")); - return 0; + goto err_free_irq; } #if USE_DMA dma_chan = DMA_CHAN; if(request_dma(dma_chan, "NCR53c406a") != 0){ printk("NCR53c406a: unable to allocate DMA channel %d\n", dma_chan); - return 0; + goto err_release; } DEB(printk("Allocated DMA channel %d\n", dma_chan)); @@ -570,6 +570,10 @@ tpnt->proc_name = "NCR53c406a"; shpnt = scsi_register(tpnt, 0); + if (!shpnt) { + printk("NCR53c406a: Unable to register host, giving up.\n"); + goto err_free_dma; + } shpnt->irq = irq_level; shpnt->io_port = port_base; shpnt->n_io_port = 0x10; @@ -586,6 +590,17 @@ #endif return (tpnt->present); + + + err_free_dma: +#if USE_DMA + free_dma(dma_chan); +#endif + err_free_irq: + free_irq(irq_level, do_NCR53c406a_intr); + err_release: + release_region(port_base, 0x10); + return 0; } /* called from init/main.c */ diff -u --recursive --new-file v2.4.2/linux/drivers/scsi/dmx3191d.c linux/drivers/scsi/dmx3191d.c --- v2.4.2/linux/drivers/scsi/dmx3191d.c Sat Nov 11 19:01:11 2000 +++ linux/drivers/scsi/dmx3191d.c Fri Mar 2 11:12:11 2001 @@ -68,18 +68,17 @@ while ((pdev = pci_find_device(PCI_VENDOR_ID_DOMEX, PCI_DEVICE_ID_DOMEX_DMX3191D, pdev))) { - unsigned long port = pci_resource_start (pdev, 0); - + unsigned long port; if (pci_enable_device(pdev)) continue; - if (check_region(port, DMX3191D_REGION)) { + port = pci_resource_start (pdev, 0); + + if (!request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME)) { dmx3191d_printk("region 0x%lx-0x%lx already reserved\n", port, port + DMX3191D_REGION); continue; } - - request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME); instance = scsi_register(tmpl, sizeof(struct NCR5380_hostdata)); if(instance == NULL) diff -u --recursive --new-file v2.4.2/linux/drivers/sound/awe_wave.c linux/drivers/sound/awe_wave.c --- v2.4.2/linux/drivers/sound/awe_wave.c Wed Feb 21 18:20:34 2001 +++ linux/drivers/sound/awe_wave.c Fri Mar 2 11:12:11 2001 @@ -206,7 +206,7 @@ int io = AWE_DEFAULT_BASE_ADDR; /* Emu8000 base address */ int memsize = AWE_DEFAULT_MEM_SIZE; /* memory size in Kbytes */ #if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE -static int isapnp = 1; +static int isapnp = -1; #else static int isapnp = 0; #endif @@ -4843,10 +4843,12 @@ if (isapnp) { if (awe_probe_isapnp(&io) < 0) { printk(KERN_ERR "AWE32: No ISAPnP cards found\n"); - return 0; + if (isapnp != -1) + return 0; + } else { + setup_ports(io, 0, 0); + return 1; } - setup_ports(io, 0, 0); - return 1; } #endif /* isapnp */ diff -u --recursive --new-file v2.4.2/linux/drivers/sound/maestro.c linux/drivers/sound/maestro.c --- v2.4.2/linux/drivers/sound/maestro.c Wed Feb 21 18:20:35 2001 +++ linux/drivers/sound/maestro.c Fri Mar 2 11:12:11 2001 @@ -1427,7 +1427,7 @@ apu_set_register(ess, channel, 10, 0x8F08); } - /* clear WP interupts */ + /* clear WP interrupts */ outw(1, ess->card->iobase+0x04); /* enable WP ints */ outw(inw(ess->card->iobase+0x18)|4, ess->card->iobase+0x18); @@ -1559,7 +1559,7 @@ apu_set_register(ess, channel, 11, route); } - /* clear WP interupts */ + /* clear WP interrupts */ outw(1, ess->card->iobase+0x04); /* enable WP ints */ outw(inw(ess->card->iobase+0x18)|4, ess->card->iobase+0x18); @@ -3446,10 +3446,10 @@ printk(KERN_INFO "maestro: not attempting power management.\n"); else { if(!parse_power(card,pcidev)) - printk(KERN_INFO "maestro: no PCI power managment interface found.\n"); + printk(KERN_INFO "maestro: no PCI power management interface found.\n"); else { pci_read_config_dword(pcidev, card->power_regs, &n); - printk(KERN_INFO "maestro: PCI power managment capability: 0x%x\n",n>>16); + printk(KERN_INFO "maestro: PCI power management capability: 0x%x\n",n>>16); } } diff -u --recursive --new-file v2.4.2/linux/drivers/sound/via82cxxx_audio.c linux/drivers/sound/via82cxxx_audio.c --- v2.4.2/linux/drivers/sound/via82cxxx_audio.c Wed Feb 21 18:20:35 2001 +++ linux/drivers/sound/via82cxxx_audio.c Fri Mar 2 11:02:15 2001 @@ -15,7 +15,7 @@ */ -#define VIA_VERSION "1.1.14a" +#define VIA_VERSION "1.1.14b" #include @@ -282,6 +282,8 @@ unsigned rev_h : 1; + int locked_rate : 1; + struct semaphore syscall_sem; struct semaphore open_sem; @@ -508,10 +510,16 @@ static int via_set_rate (struct ac97_codec *ac97, struct via_channel *chan, unsigned rate) { + struct via_info *card = ac97->private_data; int rate_reg; DPRINTK ("ENTER, rate = %d\n", rate); + if (card->locked_rate) { + chan->rate = 48000; + goto out; + } + if (rate > 48000) rate = 48000; if (rate < 4000) rate = 4000; @@ -535,6 +543,13 @@ */ chan->rate = via_ac97_read_reg (ac97, rate_reg); + if (chan->rate == 0) { + card->locked_rate = 1; + chan->rate = 48000; + printk (KERN_WARNING PFX "Codec rate locked at 48Khz\n"); + } + +out: DPRINTK ("EXIT, returning rate %d Hz\n", chan->rate); return chan->rate; } @@ -1421,15 +1436,19 @@ /* WARNING: this line is magic. Remove this * and things break. */ /* enable variable rate, variable rate MIC ADC */ - tmp16 = via_ac97_read_reg (&card->ac97, 0x2A); - via_ac97_write_reg (&card->ac97, 0x2A, tmp16 | (1<<0)); - - pci_read_config_byte (pdev, VIA_ACLINK_CTRL, &tmp8); - if ((tmp8 & (VIA_CR41_AC97_ENABLE | VIA_CR41_AC97_RESET)) == 0) { - printk (KERN_ERR PFX "cannot enable AC97 controller, aborting\n"); - DPRINTK ("EXIT, tmp8=%X, returning -ENODEV\n", tmp8); - return -ENODEV; - } + /* + * If we cannot enable VRA, we have a locked-rate codec. + * We try again to enable VRA before assuming so, however. + */ + tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS); + if ((tmp16 & 1) == 0) { + via_ac97_write_reg (&card->ac97, AC97_EXTENDED_STATUS, tmp16 | 1); + tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS); + if ((tmp16 & 1) == 0) { + card->locked_rate = 1; + printk (KERN_WARNING PFX "Codec rate locked at 48Khz\n"); + } + } DPRINTK ("EXIT, returning 0\n"); return 0; @@ -1478,8 +1497,8 @@ } /* enable variable rate, variable rate MIC ADC */ - tmp16 = via_ac97_read_reg (&card->ac97, 0x2A); - via_ac97_write_reg (&card->ac97, 0x2A, tmp16 | (1<<0)); + tmp16 = via_ac97_read_reg (&card->ac97, AC97_EXTENDED_STATUS); + via_ac97_write_reg (&card->ac97, AC97_EXTENDED_STATUS, tmp16 | 1); DPRINTK ("EXIT, returning 0\n"); return 0; diff -u --recursive --new-file v2.4.2/linux/drivers/sound/wavfront.c linux/drivers/sound/wavfront.c --- v2.4.2/linux/drivers/sound/wavfront.c Wed Feb 21 18:20:35 2001 +++ linux/drivers/sound/wavfront.c Fri Mar 2 11:12:11 2001 @@ -94,7 +94,7 @@ #ifdef CONFIG_SMP #define LOOPS_PER_TICK cpu_data[smp_processor_id()].loops_per_jiffy #else -#define LOOPS_PER_TICK loops_per_sec +#define LOOPS_PER_TICK loops_per_jiffy #endif #endif @@ -693,7 +693,7 @@ /*********************************************************************** WaveFront: data munging -Things here are wierd. All data written to the board cannot +Things here are weird. All data written to the board cannot have its most significant bit set. Any data item with values potentially > 0x7F (127) must be split across multiple bytes. @@ -702,7 +702,7 @@ that is represented on the x86 side as an array of bytes. The most efficient approach to handling both cases seems to be to use 2 different functions for munging and 2 for de-munging. This avoids -wierd casting and worrying about bit-level offsets. +weird casting and worrying about bit-level offsets. **********************************************************************/ @@ -1213,7 +1213,7 @@ shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleEndOffset), shptr, 4); - /* This one is truly wierd. What kind of wierdo decided that in + /* This one is truly weird. What kind of weirdo decided that in a system dominated by 16 and 32 bit integers, they would use a just 12 bits ? */ @@ -3069,7 +3069,7 @@ This code was developed using DOSEMU. The Turtle Beach SETUPSND utility was run with I/O tracing in DOSEMU enabled, and a reconstruction of the port I/O done, using the Yamaha faxback document as a guide - to add more logic to the code. Its really pretty wierd. + to add more logic to the code. Its really pretty weird. There was an alternative approach of just dumping the whole I/O sequence as a series of port/value pairs and a simple loop diff -u --recursive --new-file v2.4.2/linux/drivers/sound/ymfpci.c linux/drivers/sound/ymfpci.c --- v2.4.2/linux/drivers/sound/ymfpci.c Wed Feb 21 18:20:35 2001 +++ linux/drivers/sound/ymfpci.c Thu Feb 22 20:30:33 2001 @@ -95,34 +95,6 @@ MODULE_DEVICE_TABLE(pci, ymf_id_tbl); /* - * Mindlessly copied from cs46xx XXX - */ -static inline unsigned ld2(unsigned int x) -{ - unsigned r = 0; - - if (x >= 0x10000) { - x >>= 16; - r += 16; - } - if (x >= 0x100) { - x >>= 8; - r += 8; - } - if (x >= 0x10) { - x >>= 4; - r += 4; - } - if (x >= 4) { - x >>= 2; - r += 2; - } - if (x >= 2) - r++; - return r; -} - -/* * common I/O routines */ @@ -347,7 +319,6 @@ { struct ymf_dmabuf *dmabuf; int w_16; - unsigned bytepersec; unsigned bufsize; unsigned long flags; int redzone; @@ -367,20 +338,16 @@ if ((ret = alloc_dmabuf(dmabuf))) return ret; - bytepersec = state->format.rate << state->format.shift; - /* * Create fake fragment sizes and numbers for OSS ioctls. + * Import what Doom might have set with SNDCTL_DSP_SETFRAGMENT. */ bufsize = PAGE_SIZE << dmabuf->buforder; - if (dmabuf->ossfragshift) { - if ((1000 << dmabuf->ossfragshift) < bytepersec) - dmabuf->fragshift = ld2(bytepersec/1000); - else - dmabuf->fragshift = dmabuf->ossfragshift; - } else { - /* lets hand out reasonable big ass buffers by default */ - dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT -2); + /* lets hand out reasonable big ass buffers by default */ + dmabuf->fragshift = (dmabuf->buforder + PAGE_SHIFT -2); + if (dmabuf->ossfragshift > 3 && + dmabuf->ossfragshift < dmabuf->fragshift) { + dmabuf->fragshift = dmabuf->ossfragshift; } dmabuf->numfrag = bufsize >> dmabuf->fragshift; while (dmabuf->numfrag < 4 && dmabuf->fragshift > 3) { @@ -390,9 +357,6 @@ dmabuf->fragsize = 1 << dmabuf->fragshift; dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift; - /* - * Import what Doom might have set with SNDCTL_DSD_SETFRAGMENT. - */ if (dmabuf->ossmaxfrags >= 2 && dmabuf->ossmaxfrags < dmabuf->numfrag) { dmabuf->numfrag = dmabuf->ossmaxfrags; dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift; @@ -1726,8 +1690,6 @@ dmabuf->ossfragshift = 4; if (dmabuf->ossfragshift > 15) dmabuf->ossfragshift = 15; - if (dmabuf->ossmaxfrags < 4) - dmabuf->ossmaxfrags = 4; return 0; case SNDCTL_DSP_GETOSPACE: @@ -2370,9 +2332,9 @@ int err; - if (pci_enable_device(pcidev) < 0) { + if ((err = pci_enable_device(pcidev)) != 0) { printk(KERN_ERR "ymfpci: pci_enable_device failed\n"); - return -ENODEV; + return err; } if ((codec = kmalloc(sizeof(ymfpci_t), GFP_KERNEL)) == NULL) { diff -u --recursive --new-file v2.4.2/linux/fs/adfs/super.c linux/fs/adfs/super.c --- v2.4.2/linux/fs/adfs/super.c Wed Feb 21 18:20:38 2001 +++ linux/fs/adfs/super.c Fri Mar 2 11:12:11 2001 @@ -385,6 +385,12 @@ sb->u.adfs_sb.s_size = adfs_discsize(dr, sb->s_blocksize_bits); sb->u.adfs_sb.s_version = dr->format_version; sb->u.adfs_sb.s_log2sharesize = dr->log2sharesize; + + /* + * Max file size is 2Gb + */ + + sb->s_maxbytes = MAX_NON_LFS; sb->u.adfs_sb.s_map = adfs_read_map(sb, dr); if (!sb->u.adfs_sb.s_map) diff -u --recursive --new-file v2.4.2/linux/fs/affs/super.c linux/fs/affs/super.c --- v2.4.2/linux/fs/affs/super.c Wed Feb 21 18:20:38 2001 +++ linux/fs/affs/super.c Fri Mar 2 11:12:11 2001 @@ -415,6 +415,12 @@ s->s_flags |= MS_NODEV | MS_NOSUID; + /* + * Max file size is 2Gb + */ + + s->s_maxbytes = MAX_NON_LFS; + /* Keep super block in cache */ bb = affs_bread(dev,root_block,s->s_blocksize); if (!bb) diff -u --recursive --new-file v2.4.2/linux/fs/bfs/inode.c linux/fs/bfs/inode.c --- v2.4.2/linux/fs/bfs/inode.c Tue Nov 28 22:43:39 2000 +++ linux/fs/bfs/inode.c Fri Mar 2 11:12:11 2001 @@ -250,6 +250,7 @@ set_blocksize(dev, BFS_BSIZE); s->s_blocksize = BFS_BSIZE; s->s_blocksize_bits = BFS_BSIZE_BITS; + s->s_maxbytes = MAX_NON_LFS; bh = bread(dev, 0, BFS_BSIZE); if(!bh) diff -u --recursive --new-file v2.4.2/linux/fs/coda/inode.c linux/fs/coda/inode.c --- v2.4.2/linux/fs/coda/inode.c Fri Dec 29 14:07:57 2000 +++ linux/fs/coda/inode.c Fri Mar 2 11:12:11 2001 @@ -141,6 +141,7 @@ sb->s_magic = CODA_SUPER_MAGIC; sb->s_dev = dev; sb->s_op = &coda_super_operations; + sb->s_maxbytes = MAX_NON_LFS; /* get root fid from Venus: this needs the root inode */ error = venus_rootfid(sb, &fid); diff -u --recursive --new-file v2.4.2/linux/fs/cramfs/inode.c linux/fs/cramfs/inode.c --- v2.4.2/linux/fs/cramfs/inode.c Fri Dec 29 14:07:57 2000 +++ linux/fs/cramfs/inode.c Fri Mar 2 11:12:11 2001 @@ -194,9 +194,9 @@ /* Set it all up.. */ sb->s_op = &cramfs_ops; - sb->s_root = d_alloc_root(get_cramfs_inode(sb, &super.root)); + sb->s_root = d_alloc_root(get_cramfs_inode(sb, &super.root)); + sb->s_maxbytes = MAX_NON_LFS; retval = sb; - out: return retval; } diff -u --recursive --new-file v2.4.2/linux/fs/efs/super.c linux/fs/efs/super.c --- v2.4.2/linux/fs/efs/super.c Wed Jun 21 10:10:02 2000 +++ linux/fs/efs/super.c Fri Mar 2 11:12:11 2001 @@ -178,6 +178,8 @@ s->s_magic = EFS_SUPER_MAGIC; s->s_blocksize = EFS_BLOCKSIZE; s->s_blocksize_bits = EFS_BLOCKSIZE_BITS; + s->s_maxbytes = MAX_NON_LFS; + if (!(s->s_flags & MS_RDONLY)) { #ifdef DEBUG printk(KERN_INFO "EFS: forcing read-only mode\n"); diff -u --recursive --new-file v2.4.2/linux/fs/hfs/super.c linux/fs/hfs/super.c --- v2.4.2/linux/fs/hfs/super.c Wed Feb 21 18:20:39 2001 +++ linux/fs/hfs/super.c Fri Mar 2 11:12:11 2001 @@ -436,6 +436,7 @@ goto bail1; } + s->s_maxbytes = MAX_NON_LFS; s->s_magic = HFS_SUPER_MAGIC; s->s_blocksize_bits = HFS_SECTOR_SIZE_BITS; s->s_blocksize = HFS_SECTOR_SIZE; diff -u --recursive --new-file v2.4.2/linux/fs/hpfs/super.c linux/fs/hpfs/super.c --- v2.4.2/linux/fs/hpfs/super.c Tue Sep 5 14:07:30 2000 +++ linux/fs/hpfs/super.c Fri Mar 2 11:12:11 2001 @@ -427,6 +427,7 @@ s->s_blocksize = 512; s->s_blocksize_bits = 9; s->s_op = &hpfs_sops; + s->s_maxbytes = MAX_NON_LFS; s->s_hpfs_root = superblock->root; s->s_hpfs_fs_size = superblock->n_sectors; diff -u --recursive --new-file v2.4.2/linux/fs/isofs/inode.c linux/fs/isofs/inode.c --- v2.4.2/linux/fs/isofs/inode.c Wed Feb 21 18:20:39 2001 +++ linux/fs/isofs/inode.c Fri Mar 2 11:12:11 2001 @@ -616,7 +616,7 @@ #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS if (isonum_723 (h_pri->volume_set_size) != 1) goto out_no_support; -#endif IGNORE_WRONG_MULTI_VOLUME_SPECS +#endif /* IGNORE_WRONG_MULTI_VOLUME_SPECS */ s->u.isofs_sb.s_nzones = isonum_733 (h_pri->volume_space_size); s->u.isofs_sb.s_log_zone_size = isonum_723 (h_pri->logical_block_size); s->u.isofs_sb.s_max_size = isonum_733(h_pri->volume_space_size); @@ -625,7 +625,7 @@ #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS if (isonum_723 (pri->volume_set_size) != 1) goto out_no_support; -#endif IGNORE_WRONG_MULTI_VOLUME_SPECS +#endif /* IGNORE_WRONG_MULTI_VOLUME_SPECS */ s->u.isofs_sb.s_nzones = isonum_733 (pri->volume_space_size); s->u.isofs_sb.s_log_zone_size = isonum_723 (pri->logical_block_size); s->u.isofs_sb.s_max_size = isonum_733(pri->volume_space_size); @@ -662,6 +662,11 @@ Rock Ridge extensions) */ s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */; + + /* Set this for reference. Its not currently used except on write + which we don't have .. */ + + s->s_maxbytes = MAX_NON_LFS; /* RDE: data zone now byte offset! */ diff -u --recursive --new-file v2.4.2/linux/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c --- v2.4.2/linux/fs/jffs/inode-v23.c Wed Feb 21 18:20:39 2001 +++ linux/fs/jffs/inode-v23.c Fri Mar 2 11:12:11 2001 @@ -10,8 +10,8 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * $Id: inode-v23.c,v 1.43 2000/08/22 08:00:22 dwmw2 Exp $ - * + * $Id: inode-v23.c,v 1.43.2.6 2001/01/09 00:32:48 dwmw2 Exp $ + * + sb_maxbytes / generic_file_open() fixes for 2.4.0-ac4 * * Ported to Linux 2.3.x and MTD: * Copyright (C) 2000 Alexander Larsson (alex@cendio.se), Cendio Systems AB @@ -84,6 +84,7 @@ sb->s_blocksize = PAGE_CACHE_SIZE; sb->s_blocksize_bits = PAGE_CACHE_SHIFT; sb->u.generic_sbp = (void *) 0; + sb->s_maxbytes = 0xFFFFFFFF; /* Build the file system. */ if (jffs_build_fs(sb) < 0) { diff -u --recursive --new-file v2.4.2/linux/fs/minix/inode.c linux/fs/minix/inode.c --- v2.4.2/linux/fs/minix/inode.c Wed Feb 21 18:20:39 2001 +++ linux/fs/minix/inode.c Fri Mar 2 11:12:11 2001 @@ -259,6 +259,9 @@ minix_set_bit(0,s->u.minix_sb.s_imap[0]->b_data); minix_set_bit(0,s->u.minix_sb.s_zmap[0]->b_data); + + s->s_maxbytes = MAX_NON_LFS; + /* set up enough so that it can read an inode */ s->s_op = &minix_sops; root_inode = iget(s, MINIX_ROOT_INO); diff -u --recursive --new-file v2.4.2/linux/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c --- v2.4.2/linux/fs/ncpfs/inode.c Wed Feb 21 18:20:39 2001 +++ linux/fs/ncpfs/inode.c Fri Mar 2 11:12:11 2001 @@ -327,6 +327,7 @@ else default_bufsize = 1024; + sb->s_maxbytes = MAX_NON_LFS; sb->s_blocksize = 1024; /* Eh... Is this correct? */ sb->s_blocksize_bits = 10; sb->s_magic = NCP_SUPER_MAGIC; diff -u --recursive --new-file v2.4.2/linux/fs/nfs/inode.c linux/fs/nfs/inode.c --- v2.4.2/linux/fs/nfs/inode.c Wed Feb 21 18:20:40 2001 +++ linux/fs/nfs/inode.c Fri Mar 2 11:12:11 2001 @@ -434,6 +434,11 @@ if (server->namelen == 0 || server->namelen > maxlen) server->namelen = maxlen; + if(version == 2) + sb->s_maxbytes = MAX_NON_LFS; + else + sb->s_maxbytes = ~0ULL; /* Unlimited on NFSv3 */ + /* Fire up the writeback cache */ if (nfs_reqlist_alloc(server) < 0) { printk(KERN_NOTICE "NFS: cannot initialize writeback cache.\n"); diff -u --recursive --new-file v2.4.2/linux/fs/proc/inode.c linux/fs/proc/inode.c --- v2.4.2/linux/fs/proc/inode.c Fri Nov 17 16:51:47 2000 +++ linux/fs/proc/inode.c Fri Mar 2 11:12:12 2001 @@ -188,6 +188,8 @@ s->s_blocksize_bits = 10; s->s_magic = PROC_SUPER_MAGIC; s->s_op = &proc_sops; + s->s_maxbytes = MAX_NON_LFS; + root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); if (!root_inode) goto out_no_root; diff -u --recursive --new-file v2.4.2/linux/fs/qnx4/inode.c linux/fs/qnx4/inode.c --- v2.4.2/linux/fs/qnx4/inode.c Wed Feb 21 18:20:40 2001 +++ linux/fs/qnx4/inode.c Fri Mar 2 11:12:12 2001 @@ -369,6 +369,7 @@ } s->s_op = &qnx4_sops; s->s_magic = QNX4_SUPER_MAGIC; + s->s_maxbytes = MAX_NON_LFS; #ifndef CONFIG_QNX4FS_RW s->s_flags |= MS_RDONLY; /* Yup, read-only yet */ #endif diff -u --recursive --new-file v2.4.2/linux/fs/reiserfs/dir.c linux/fs/reiserfs/dir.c --- v2.4.2/linux/fs/reiserfs/dir.c Sat Feb 3 19:51:31 2001 +++ linux/fs/reiserfs/dir.c Fri Mar 2 10:06:47 2001 @@ -51,12 +51,16 @@ int windex ; struct reiserfs_transaction_handle th ; + lock_kernel(); + journal_begin(&th, dentry->d_inode->i_sb, 1) ; windex = push_journal_writer("dir_fsync") ; reiserfs_prepare_for_journal(th.t_super, SB_BUFFER_WITH_SB(th.t_super), 1) ; journal_mark_dirty(&th, dentry->d_inode->i_sb, SB_BUFFER_WITH_SB (dentry->d_inode->i_sb)) ; pop_journal_writer(windex) ; journal_end_sync(&th, dentry->d_inode->i_sb, 1) ; + + unlock_kernel(); return ret ; } diff -u --recursive --new-file v2.4.2/linux/fs/reiserfs/inode.c linux/fs/reiserfs/inode.c --- v2.4.2/linux/fs/reiserfs/inode.c Sat Feb 3 19:51:31 2001 +++ linux/fs/reiserfs/inode.c Wed Feb 28 19:21:58 2001 @@ -771,6 +771,7 @@ ** flush unbh before the transaction commits */ reiserfs_add_page_to_flush_list(&th, inode, unbh) ; + mark_buffer_dirty(unbh) ; //inode->i_blocks += inode->i_sb->s_blocksize / 512; //mark_tail_converted (inode); diff -u --recursive --new-file v2.4.2/linux/fs/reiserfs/stree.c linux/fs/reiserfs/stree.c --- v2.4.2/linux/fs/reiserfs/stree.c Sat Feb 3 19:51:31 2001 +++ linux/fs/reiserfs/stree.c Wed Feb 28 19:21:58 2001 @@ -1438,7 +1438,6 @@ if ( p_s_un_bh ) { int off; - int block_off ; char *data ; /* We are in direct2indirect conversion, so move tail contents @@ -1452,7 +1451,8 @@ ** the unformatted node, which might schedule, meaning we'd have to ** loop all the way back up to the start of the while loop. ** - ** The unformatted node is prepared and logged after the do_balance. + ** The unformatted node must be dirtied later on. We can't be + ** sure here if the entire tail has been deleted yet. ** ** p_s_un_bh is from the page cache (all unformatted nodes are ** from the page cache) and might be a highmem page. So, we @@ -1463,24 +1463,12 @@ data = page_address(p_s_un_bh->b_page) ; off = ((le_ih_k_offset (&s_ih) - 1) & (PAGE_CACHE_SIZE - 1)); - block_off = off & (p_s_un_bh->b_size - 1) ; memcpy(data + off, B_I_PITEM(PATH_PLAST_BUFFER(p_s_path), &s_ih), n_ret_value); - - /* clear out the rest of the block past the end of the file. */ - if (block_off + n_ret_value < p_s_un_bh->b_size) { - memset(data + off + n_ret_value, 0, - p_s_un_bh->b_size - block_off - n_ret_value) ; - } } /* Perform balancing after all resources have been collected at once. */ do_balance(&s_del_balance, NULL, NULL, M_DELETE); - - /* see comment above for why this is after the do_balance */ - if (p_s_un_bh) { - mark_buffer_dirty(p_s_un_bh) ; - } /* Return deleted body length */ return n_ret_value; diff -u --recursive --new-file v2.4.2/linux/fs/reiserfs/super.c linux/fs/reiserfs/super.c --- v2.4.2/linux/fs/reiserfs/super.c Sat Feb 3 19:51:31 2001 +++ linux/fs/reiserfs/super.c Fri Mar 2 11:12:12 2001 @@ -1,5 +1,14 @@ /* * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README + * + * Trivial changes by Alan Cox to add the LFS fixes + * + * Trivial Changes: + * Rights granted to Hans Reiser to redistribute under other terms providing + * he accepts all liability including but not limited to patent, fitness + * for purpose, and direct or indirect claims arising from failure to perform. + * + * NO WARRANTY */ #ifdef __KERNEL__ @@ -483,6 +492,7 @@ SB_BUFFER_WITH_SB (s) = bh; SB_DISK_SUPER_BLOCK (s) = rs; s->s_op = &reiserfs_sops; + s->s_maxbytes = 0xFFFFFFFF; /* 4Gig */ return 0; } diff -u --recursive --new-file v2.4.2/linux/fs/reiserfs/tail_conversion.c linux/fs/reiserfs/tail_conversion.c --- v2.4.2/linux/fs/reiserfs/tail_conversion.c Wed Feb 21 18:20:40 2001 +++ linux/fs/reiserfs/tail_conversion.c Wed Feb 28 19:21:58 2001 @@ -32,6 +32,7 @@ struct super_block * sb = inode->i_sb; struct buffer_head *up_to_date_bh ; struct item_head * p_le_ih = PATH_PITEM_HEAD (path); + unsigned long total_tail = 0 ; struct cpu_key end_key; /* Key to search for the last byte of the converted item. */ struct item_head ind_ih; /* new indirect item to be inserted or @@ -121,10 +122,19 @@ n_retval = reiserfs_delete_item (th, path, &end_key, inode, up_to_date_bh) ; + total_tail += n_retval ; if (tail_size == n_retval) // done: file does not have direct items anymore break; + } + /* if we've copied bytes from disk into the page, we need to zero + ** out the unused part of the block (it was not up to date before) + ** the page is still kmapped (by whoever called reiserfs_get_block) + */ + if (up_to_date_bh) { + unsigned pgoff = (tail_offset + total_tail - 1) & (PAGE_CACHE_SIZE - 1); + memset(page_address(unbh->b_page) + pgoff, 0, n_blk_size - total_tail) ; } inode->u.reiserfs_i.i_first_direct_byte = U32_MAX; diff -u --recursive --new-file v2.4.2/linux/fs/romfs/inode.c linux/fs/romfs/inode.c --- v2.4.2/linux/fs/romfs/inode.c Wed Feb 21 18:20:40 2001 +++ linux/fs/romfs/inode.c Fri Mar 2 11:12:12 2001 @@ -110,6 +110,9 @@ set_blocksize(dev, ROMBSIZE); s->s_blocksize = ROMBSIZE; s->s_blocksize_bits = ROMBSBITS; + s->u.generic_sbp = (void *) 0; + s->s_maxbytes = 0xFFFFFFFF; + bh = bread(dev, 0, ROMBSIZE); if (!bh) { /* XXX merge with other printk? */ diff -u --recursive --new-file v2.4.2/linux/fs/smbfs/inode.c linux/fs/smbfs/inode.c --- v2.4.2/linux/fs/smbfs/inode.c Wed Feb 21 18:20:40 2001 +++ linux/fs/smbfs/inode.c Fri Mar 2 11:12:12 2001 @@ -399,6 +399,7 @@ sb->s_magic = SMB_SUPER_MAGIC; sb->s_flags = 0; sb->s_op = &smb_sops; + sb->s_maxbytes = MAX_NON_LFS; /* client support missing */ sb->u.smbfs_sb.mnt = NULL; sb->u.smbfs_sb.sock_file = NULL; diff -u --recursive --new-file v2.4.2/linux/fs/sysv/inode.c linux/fs/sysv/inode.c --- v2.4.2/linux/fs/sysv/inode.c Mon Dec 4 19:00:09 2000 +++ linux/fs/sysv/inode.c Fri Mar 2 11:12:12 2001 @@ -365,6 +365,7 @@ panic("sysv fs: bad i-node size"); set_blocksize(dev,BLOCK_SIZE); sb->sv_block_base = 0; + sb->s_maxbytes = MAX_NON_LFS; /* Try to read Xenix superblock */ if ((bh = bread(dev, 1, BLOCK_SIZE)) != NULL) { diff -u --recursive --new-file v2.4.2/linux/fs/udf/super.c linux/fs/udf/super.c --- v2.4.2/linux/fs/udf/super.c Wed Feb 21 18:20:40 2001 +++ linux/fs/udf/super.c Fri Mar 2 11:12:12 2001 @@ -1415,7 +1415,7 @@ iput(inode); goto error_out; } - + sb->s_maxbytes = ~0ULL; return sb; error_out: diff -u --recursive --new-file v2.4.2/linux/fs/ufs/super.c linux/fs/ufs/super.c --- v2.4.2/linux/fs/ufs/super.c Wed Feb 21 18:20:40 2001 +++ linux/fs/ufs/super.c Fri Mar 2 11:12:12 2001 @@ -489,6 +489,12 @@ if (!uspi) goto failed; + /* Set a 2Gig file limit. Some UFS variants need to override + this but as I don't know which I'll let those in the know loosen + the rules */ + + sb->s_maxbytes = MAX_NON_LFS; + switch (sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) { case UFS_MOUNT_UFSTYPE_44BSD: UFSD(("ufstype=44bsd\n")) diff -u --recursive --new-file v2.4.2/linux/include/asm-alpha/io.h linux/include/asm-alpha/io.h --- v2.4.2/linux/include/asm-alpha/io.h Wed Feb 21 18:20:41 2001 +++ linux/include/asm-alpha/io.h Fri Mar 2 11:12:07 2001 @@ -455,6 +455,23 @@ #define isa_memcpy_fromio(a,b,c) memcpy_fromio((a),__ioremap(b),(c)) #define isa_memcpy_toio(a,b,c) memcpy_toio(__ioremap(a),(b),(c)) +static inline int +isa_check_signature(unsigned long io_addr, const unsigned char *signature, + int length) +{ + int retval = 0; + do { + if (isa_readb(io_addr) != *signature) + goto out; + io_addr++; + signature++; + length--; + } while (length); + retval = 1; +out: + return retval; +} + /* * The Alpha Jensen hardware for some rather strange reason puts diff -u --recursive --new-file v2.4.2/linux/include/asm-alpha/machvec.h linux/include/asm-alpha/machvec.h --- v2.4.2/linux/include/asm-alpha/machvec.h Thu Mar 2 11:35:17 2000 +++ linux/include/asm-alpha/machvec.h Fri Mar 2 11:12:07 2001 @@ -21,7 +21,7 @@ struct linux_hose_info; struct pci_dev; struct pci_ops; -struct pci_controler; +struct pci_controller; struct alpha_machine_vector { @@ -40,7 +40,7 @@ unsigned long min_io_address; unsigned long min_mem_address; - void (*mv_pci_tbi)(struct pci_controler *hose, + void (*mv_pci_tbi)(struct pci_controller *hose, dma_addr_t start, dma_addr_t end); unsigned int (*mv_inb)(unsigned long); diff -u --recursive --new-file v2.4.2/linux/include/asm-alpha/pci.h linux/include/asm-alpha/pci.h --- v2.4.2/linux/include/asm-alpha/pci.h Tue Jul 18 22:58:28 2000 +++ linux/include/asm-alpha/pci.h Fri Mar 2 11:12:07 2001 @@ -16,10 +16,10 @@ struct resource; struct pci_iommu_arena; -/* A controler. Used to manage multiple PCI busses. */ +/* A controller. Used to manage multiple PCI busses. */ -struct pci_controler { - struct pci_controler *next; +struct pci_controller { + struct pci_controller *next; struct pci_bus *bus; struct resource *io_space; struct resource *mem_space; diff -u --recursive --new-file v2.4.2/linux/include/asm-alpha/semaphore.h linux/include/asm-alpha/semaphore.h --- v2.4.2/linux/include/asm-alpha/semaphore.h Tue Nov 14 11:12:08 2000 +++ linux/include/asm-alpha/semaphore.h Fri Mar 2 11:12:07 2001 @@ -12,6 +12,7 @@ #include #include #include /* __builtin_expect */ +#include #define DEBUG_SEMAPHORE 0 #define DEBUG_RW_SEMAPHORE 0 diff -u --recursive --new-file v2.4.2/linux/include/asm-alpha/smp.h linux/include/asm-alpha/smp.h --- v2.4.2/linux/include/asm-alpha/smp.h Tue Jan 2 16:45:37 2001 +++ linux/include/asm-alpha/smp.h Fri Mar 2 11:30:15 2001 @@ -57,6 +57,7 @@ #define smp_processor_id() (current->processor) extern unsigned long cpu_present_mask; +#define cpu_online_map cpu_present_mask #endif /* CONFIG_SMP */ diff -u --recursive --new-file v2.4.2/linux/include/asm-arm/arch-sa1100/irq.h linux/include/asm-arm/arch-sa1100/irq.h --- v2.4.2/linux/include/asm-arm/arch-sa1100/irq.h Wed Feb 21 18:20:41 2001 +++ linux/include/asm-arm/arch-sa1100/irq.h Fri Mar 2 11:12:06 2001 @@ -134,7 +134,7 @@ int mask = (1 << GPIO_11_27_IRQ(irq)); if (GPIO_11_27_spurious & mask) { /* - * We don't want to miss an interrupt that would have occured + * We don't want to miss an interrupt that would have occurred * while it was masked. Simulate it if it is the case. */ int state = GPLR; diff -u --recursive --new-file v2.4.2/linux/include/asm-i386/string-486.h linux/include/asm-i386/string-486.h --- v2.4.2/linux/include/asm-i386/string-486.h Thu Jan 4 14:50:47 2001 +++ linux/include/asm-i386/string-486.h Thu Mar 1 18:04:34 2001 @@ -352,11 +352,6 @@ #ifdef CONFIG_X86_USE_3DNOW -#include -#include -#include -#include -#include #include /* @@ -365,14 +360,14 @@ static inline void * __constant_memcpy3d(void * to, const void * from, size_t len) { - if(len<512 || in_interrupt()) + if (len < 512) return __memcpy_c(to, from, len); return _mmx_memcpy(to, from, len); } static inline void *__memcpy3d(void *to, const void *from, size_t len) { - if(len<512 || in_interrupt()) + if(len < 512) return __memcpy_g(to, from, len); return _mmx_memcpy(to, from, len); } diff -u --recursive --new-file v2.4.2/linux/include/asm-i386/string.h linux/include/asm-i386/string.h --- v2.4.2/linux/include/asm-i386/string.h Thu Jan 4 14:50:47 2001 +++ linux/include/asm-i386/string.h Thu Mar 1 18:04:34 2001 @@ -287,13 +287,6 @@ #ifdef CONFIG_X86_USE_3DNOW -/* All this just for in_interrupt() ... */ - -#include -#include -#include -#include -#include #include /* @@ -302,14 +295,14 @@ static inline void * __constant_memcpy3d(void * to, const void * from, size_t len) { - if(len<512 || in_interrupt()) + if (len < 512) return __constant_memcpy(to, from, len); return _mmx_memcpy(to, from, len); } extern __inline__ void *__memcpy3d(void *to, const void *from, size_t len) { - if(len<512 || in_interrupt()) + if (len < 512) return __memcpy(to, from, len); return _mmx_memcpy(to, from, len); } diff -u --recursive --new-file v2.4.2/linux/include/asm-mips64/smp.h linux/include/asm-mips64/smp.h --- v2.4.2/linux/include/asm-mips64/smp.h Fri Aug 4 16:15:37 2000 +++ linux/include/asm-mips64/smp.h Fri Mar 2 11:30:15 2001 @@ -40,6 +40,7 @@ /* Good enough for toy^Wupto 64 CPU Origins. */ extern unsigned long cpu_present_mask; +#define cpu_online_map cpu_present_mask #endif diff -u --recursive --new-file v2.4.2/linux/include/asm-s390/ccwcache.h linux/include/asm-s390/ccwcache.h --- v2.4.2/linux/include/asm-s390/ccwcache.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390/ccwcache.h Fri Mar 2 11:12:06 2001 @@ -59,7 +59,7 @@ #define CQR_STATUS_FILLED 0x01 /* request is ready to be preocessed */ #define CQR_STATUS_QUEUED 0x02 /* request is queued to be processed */ #define CQR_STATUS_IN_IO 0x03 /* request is currently in IO */ -#define CQR_STATUS_DONE 0x04 /* request is completed sucessfully */ +#define CQR_STATUS_DONE 0x04 /* request is completed successfully */ #define CQR_STATUS_ERROR 0x05 /* request is completed with error */ #define CQR_STATUS_FAILED 0x06 /* request is finally failed */ diff -u --recursive --new-file v2.4.2/linux/include/asm-s390/lowcore.h linux/include/asm-s390/lowcore.h --- v2.4.2/linux/include/asm-s390/lowcore.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390/lowcore.h Fri Mar 2 11:12:06 2001 @@ -124,7 +124,7 @@ __u8 pad3[0xD8-0xC4]; /* 0x0c4 */ __u32 cpu_timer_save_area[2]; /* 0x0d8 */ __u32 clock_comp_save_area[2]; /* 0x0e0 */ - __u32 mcck_interuption_code[2]; /* 0x0e8 */ + __u32 mcck_interruption_code[2]; /* 0x0e8 */ __u8 pad4[0xf4-0xf0]; /* 0x0f0 */ __u32 external_damage_code; /* 0x0f4 */ __u32 failing_storage_address; /* 0x0f8 */ diff -u --recursive --new-file v2.4.2/linux/include/asm-s390x/ccwcache.h linux/include/asm-s390x/ccwcache.h --- v2.4.2/linux/include/asm-s390x/ccwcache.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390x/ccwcache.h Fri Mar 2 11:12:06 2001 @@ -59,7 +59,7 @@ #define CQR_STATUS_FILLED 0x01 /* request is ready to be preocessed */ #define CQR_STATUS_QUEUED 0x02 /* request is queued to be processed */ #define CQR_STATUS_IN_IO 0x03 /* request is currently in IO */ -#define CQR_STATUS_DONE 0x04 /* request is completed sucessfully */ +#define CQR_STATUS_DONE 0x04 /* request is completed successfully */ #define CQR_STATUS_ERROR 0x05 /* request is completed with error */ #define CQR_STATUS_FAILED 0x06 /* request is finally failed */ diff -u --recursive --new-file v2.4.2/linux/include/asm-s390x/dasd.h linux/include/asm-s390x/dasd.h --- v2.4.2/linux/include/asm-s390x/dasd.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390x/dasd.h Fri Mar 2 11:12:06 2001 @@ -203,7 +203,7 @@ typedef ccw_req_t *(*dasd_erp_action_fn_t) (ccw_req_t * cqr); typedef ccw_req_t *(*dasd_erp_postaction_fn_t) (ccw_req_t * cqr); -typedef int (*dasd_ck_id_fn_t) (dev_info_t *); +typedef int (*dasd_ck_id_fn_t) (s390_dev_info_t *); typedef int (*dasd_ck_characteristics_fn_t) (struct dasd_device_t *); typedef int (*dasd_fill_geometry_fn_t) (struct dasd_device_t *, struct hd_geometry *); typedef ccw_req_t *(*dasd_format_fn_t) (struct dasd_device_t *, struct format_data_t *); @@ -269,7 +269,7 @@ } dasd_profile_info_t; typedef struct dasd_device_t { - dev_info_t devinfo; + s390_dev_info_t devinfo; dasd_discipline_t *discipline; int level; int open_count; diff -u --recursive --new-file v2.4.2/linux/include/asm-s390x/lowcore.h linux/include/asm-s390x/lowcore.h --- v2.4.2/linux/include/asm-s390x/lowcore.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390x/lowcore.h Fri Mar 2 11:12:06 2001 @@ -116,7 +116,7 @@ __u8 pad3[0xc8-0xc4]; /* 0x0c4 */ __u32 stfl_fac_list; /* 0x0c8 */ __u8 pad4[0xe8-0xcc]; /* 0x0cc */ - __u32 mcck_interuption_code[2]; /* 0x0e8 */ + __u32 mcck_interruption_code[2]; /* 0x0e8 */ __u8 pad5[0xf4-0xf0]; /* 0x0f0 */ __u32 external_damage_code; /* 0x0f4 */ addr_t failing_storage_address; /* 0x0f8 */ diff -u --recursive --new-file v2.4.2/linux/include/asm-s390x/socket.h linux/include/asm-s390x/socket.h --- v2.4.2/linux/include/asm-s390x/socket.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390x/socket.h Fri Mar 2 11:12:06 2001 @@ -50,6 +50,7 @@ #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP +#define SO_ACCEPTCONN 30 /* Nast libc5 fixup - bletch */ #if defined(__KERNEL__) diff -u --recursive --new-file v2.4.2/linux/include/asm-s390x/unistd.h linux/include/asm-s390x/unistd.h --- v2.4.2/linux/include/asm-s390x/unistd.h Wed Feb 21 18:20:42 2001 +++ linux/include/asm-s390x/unistd.h Fri Mar 2 11:12:06 2001 @@ -330,7 +330,6 @@ static inline _syscall1(int,delete_module,const char *,name) static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf) -extern int sys_wait4(int, int *, int, struct rusage *); static inline pid_t waitpid(int pid, int * wait_stat, int flags) { return sys_wait4(pid, wait_stat, flags, NULL); diff -u --recursive --new-file v2.4.2/linux/include/asm-sparc/smp.h linux/include/asm-sparc/smp.h --- v2.4.2/linux/include/asm-sparc/smp.h Tue Oct 10 10:33:52 2000 +++ linux/include/asm-sparc/smp.h Fri Mar 2 11:30:15 2001 @@ -51,6 +51,7 @@ extern int smp_found_cpus; extern unsigned char boot_cpu_id; extern unsigned long cpu_present_map; +#define cpu_online_map cpu_present_map typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); diff -u --recursive --new-file v2.4.2/linux/include/asm-sparc64/smp.h linux/include/asm-sparc64/smp.h --- v2.4.2/linux/include/asm-sparc64/smp.h Tue Oct 3 09:24:41 2000 +++ linux/include/asm-sparc64/smp.h Fri Mar 2 11:30:15 2001 @@ -60,6 +60,7 @@ extern unsigned char boot_cpu_id; extern unsigned long cpu_present_map; +#define cpu_online_map cpu_present_map /* * General functions that each host system must provide. diff -u --recursive --new-file v2.4.2/linux/include/linux/fs.h linux/include/linux/fs.h --- v2.4.2/linux/include/linux/fs.h Wed Feb 21 18:20:45 2001 +++ linux/include/linux/fs.h Fri Mar 2 11:12:11 2001 @@ -244,7 +244,7 @@ struct buffer_head *b_reqnext; /* request queue */ struct buffer_head **b_pprev; /* doubly linked list of hash-queue */ - char * b_data; /* pointer to data block (512 byte) */ + char * b_data; /* pointer to data block */ struct page *b_page; /* the page this bh is mapped to */ void (*b_end_io)(struct buffer_head *bh, int uptodate); /* I/O completion */ void *b_private; /* reserved for b_end_io */ @@ -504,6 +504,8 @@ extern int init_private_file(struct file *, struct dentry *, int); +#define MAX_NON_LFS ((1UL<<31) - 1) + #define FL_POSIX 1 #define FL_FLOCK 2 #define FL_BROKEN 4 /* broken flock() emulation */ @@ -651,6 +653,7 @@ unsigned char s_blocksize_bits; unsigned char s_lock; unsigned char s_dirt; + unsigned long long s_maxbytes; /* Max file size */ struct file_system_type *s_type; struct super_operations *s_op; struct dquot_operations *dq_op; diff -u --recursive --new-file v2.4.2/linux/include/linux/genhd.h linux/include/linux/genhd.h --- v2.4.2/linux/include/linux/genhd.h Thu Jan 4 14:50:47 2001 +++ linux/include/linux/genhd.h Fri Mar 2 11:12:12 2001 @@ -223,6 +223,11 @@ #endif /* CONFIG_UNIXWARE_DISKLABEL */ +#ifdef CONFIG_MINIX_SUBPARTITION +# define MINIX_PARTITION 0x81 /* Minix Partition ID */ +# define MINIX_NR_SUBPARTITIONS 4 +#endif /* CONFIG_MINIX_SUBPARTITION */ + #ifdef __KERNEL__ extern struct gendisk *gendisk_head; /* linked list of disks */ diff -u --recursive --new-file v2.4.2/linux/include/linux/netdevice.h linux/include/linux/netdevice.h --- v2.4.2/linux/include/linux/netdevice.h Thu Jan 4 14:51:20 2001 +++ linux/include/linux/netdevice.h Fri Mar 2 11:02:15 2001 @@ -630,7 +630,6 @@ extern void tr_setup(struct net_device *dev); extern void fc_setup(struct net_device *dev); extern void fc_freedev(struct net_device *dev); -extern int ether_config(struct net_device *dev, struct ifmap *map); /* Support for loadable net-drivers */ extern int register_netdev(struct net_device *dev); extern void unregister_netdev(struct net_device *dev); diff -u --recursive --new-file v2.4.2/linux/include/linux/pci.h linux/include/linux/pci.h --- v2.4.2/linux/include/linux/pci.h Wed Feb 21 18:20:45 2001 +++ linux/include/linux/pci.h Fri Mar 2 11:02:15 2001 @@ -539,6 +539,9 @@ unsigned long pci_bridge_check_io(struct pci_dev *); void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), int (*)(struct pci_dev *, u8, u8)); +#define HAVE_PCI_REQ_REGIONS 1 +int pci_request_regions(struct pci_dev *, char *); +void pci_release_regions(struct pci_dev *); /* New-style probing supporting hot-pluggable devices */ int pci_register_driver(struct pci_driver *); diff -u --recursive --new-file v2.4.2/linux/include/linux/videodev.h linux/include/linux/videodev.h --- v2.4.2/linux/include/linux/videodev.h Mon Dec 11 13:15:36 2000 +++ linux/include/linux/videodev.h Fri Mar 2 11:12:10 2001 @@ -6,13 +6,12 @@ #ifdef __KERNEL__ -#if LINUX_VERSION_CODE >= 0x020100 #include -#endif #include struct video_device { + struct module *owner; char name[32]; int type; int hardware; diff -u --recursive --new-file v2.4.2/linux/include/pcmcia/ciscode.h linux/include/pcmcia/ciscode.h --- v2.4.2/linux/include/pcmcia/ciscode.h Wed Feb 21 18:20:46 2001 +++ linux/include/pcmcia/ciscode.h Fri Mar 2 11:02:15 2001 @@ -112,10 +112,12 @@ #define PRODID_SOCKET_DUAL_RS232 0x0006 #define PRODID_SOCKET_EIO 0x000a #define PRODID_SOCKET_LPE 0x000d +#define PRODID_SOCKET_LPE_CF 0x0075 #define MANFID_SUNDISK 0x0045 #define MANFID_TDK 0x0105 +#define PRODID_TDK_CF010 0x0900 #define MANFID_TOSHIBA 0x0098 diff -u --recursive --new-file v2.4.2/linux/kernel/sched.c linux/kernel/sched.c --- v2.4.2/linux/kernel/sched.c Wed Feb 21 18:20:46 2001 +++ linux/kernel/sched.c Fri Mar 2 11:26:30 2001 @@ -339,7 +339,7 @@ if (task_on_runqueue(p)) goto out; add_to_runqueue(p); - if (!synchronous) + if (!synchronous || !(p->cpus_allowed & (1 << smp_processor_id()))) reschedule_idle(p); success = 1; out: @@ -473,7 +473,7 @@ goto out_unlock; spin_lock_irqsave(&runqueue_lock, flags); - if (prev->state == TASK_RUNNING) + if ((prev->state == TASK_RUNNING) && !prev->has_cpu) reschedule_idle(prev); spin_unlock_irqrestore(&runqueue_lock, flags); goto out_unlock; diff -u --recursive --new-file v2.4.2/linux/mm/slab.c linux/mm/slab.c --- v2.4.2/linux/mm/slab.c Sat Feb 3 19:51:32 2001 +++ linux/mm/slab.c Fri Mar 2 11:29:39 2001 @@ -814,28 +814,6 @@ return cachep; } -/* - * This check if the kmem_cache_t pointer is chained in the cache_cache - * list. -arca - */ -static int is_chained_kmem_cache(kmem_cache_t * cachep) -{ - struct list_head *p; - int ret = 0; - - /* Find the cache in the chain of caches. */ - down(&cache_chain_sem); - list_for_each(p, &cache_chain) { - if (p == &cachep->next) { - ret = 1; - break; - } - } - up(&cache_chain_sem); - - return ret; -} - #ifdef CONFIG_SMP /* * Waits for all CPUs to execute func(). @@ -938,7 +916,7 @@ */ int kmem_cache_shrink(kmem_cache_t *cachep) { - if (!cachep || in_interrupt() || !is_chained_kmem_cache(cachep)) + if (!cachep || in_interrupt()) BUG(); return __kmem_cache_shrink(cachep); diff -u --recursive --new-file v2.4.2/linux/net/core/dev.c linux/net/core/dev.c --- v2.4.2/linux/net/core/dev.c Mon Dec 11 13:29:35 2000 +++ linux/net/core/dev.c Fri Mar 2 11:02:15 2001 @@ -349,7 +349,7 @@ /* * Saves at boot time configured settings for any netdevice. */ -static int __init netdev_boot_setup(char *str) +int __init netdev_boot_setup(char *str) { int ints[5]; struct ifmap map; @@ -359,7 +359,7 @@ return 0; /* Save settings */ - memset(&map, -1, sizeof(map)); + memset(&map, 0, sizeof(map)); if (ints[0] > 0) map.irq = ints[1]; if (ints[0] > 1) diff -u --recursive --new-file v2.4.2/linux/net/ethernet/eth.c linux/net/ethernet/eth.c --- v2.4.2/linux/net/ethernet/eth.c Tue Aug 22 08:59:00 2000 +++ linux/net/ethernet/eth.c Fri Mar 2 11:02:15 2001 @@ -30,6 +30,7 @@ * Alan Cox : Protect against forwarding explosions with * older network drivers and IFF_ALLMULTI. * Christer Weinigel : Better rebuild header message. + * Andrew Morton : 26Feb01: kill ether_setup() - use netdev_boot_setup(). * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -60,31 +61,9 @@ #include #include -static int __init eth_setup(char *str) -{ - int ints[5]; - struct ifmap map; +extern int __init netdev_boot_setup(char *str); - str = get_options(str, ARRAY_SIZE(ints), ints); - if (!str || !*str) - return 0; - - /* Save settings */ - memset(&map, -1, sizeof(map)); - if (ints[0] > 0) - map.irq = ints[1]; - if (ints[0] > 1) - map.base_addr = ints[2]; - if (ints[0] > 2) - map.mem_start = ints[3]; - if (ints[0] > 3) - map.mem_end = ints[4]; - - /* Add new entry to the list */ - return netdev_boot_setup_add(str, &map); -} - -__setup("ether=", eth_setup); +__setup("ether=", netdev_boot_setup); /* * Create the Ethernet MAC header for an arbitrary protocol layer diff -u --recursive --new-file v2.4.2/linux/net/irda/af_irda.c linux/net/irda/af_irda.c --- v2.4.2/linux/net/irda/af_irda.c Sat Feb 3 19:51:33 2001 +++ linux/net/irda/af_irda.c Fri Mar 2 11:12:12 2001 @@ -146,7 +146,7 @@ /* Close our TSAP. * If we leave it open, IrLMP put it back into the list of - * unconnected LSAPs. The problem is that any incomming request + * unconnected LSAPs. The problem is that any incoming request * can then be matched to this socket (and it will be, because * it is at the head of the list). This would prevent any * listening socket waiting on the same TSAP to get those requests. @@ -229,7 +229,7 @@ /* * Function irda_connect_indication(instance, sap, qos, max_sdu_size, userdata) * - * Incomming connection + * Incoming connection * */ static void irda_connect_indication(void *instance, void *sap, @@ -285,7 +285,7 @@ /* * Function irda_connect_response (handle) * - * Accept incomming connection + * Accept incoming connection * */ void irda_connect_response(struct irda_sock *self) @@ -836,7 +836,7 @@ /* * Function irda_accept (sock, newsock, flags) * - * Wait for incomming connection + * Wait for incoming connection * */ static int irda_accept(struct socket *sock, struct socket *newsock, int flags) @@ -1995,6 +1995,9 @@ if (get_user(len, optlen)) return -EFAULT; + if(optlen < 0) + return -EINVAL; + switch (optname) { case IRLMP_ENUMDEVICES: /* Ask lmp for the current discovery log */ diff -u --recursive --new-file v2.4.2/linux/net/irda/ircomm/ircomm_core.c linux/net/irda/ircomm/ircomm_core.c --- v2.4.2/linux/net/irda/ircomm/ircomm_core.c Mon Nov 27 18:07:31 2000 +++ linux/net/irda/ircomm/ircomm_core.c Fri Mar 2 11:12:12 2001 @@ -220,7 +220,7 @@ /* * Function ircomm_connect_indication (self, qos, skb) * - * Notify user layer about the incomming connection + * Notify user layer about the incoming connection * */ void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb, diff -u --recursive --new-file v2.4.2/linux/net/irda/ircomm/ircomm_event.c linux/net/irda/ircomm/ircomm_event.c --- v2.4.2/linux/net/irda/ircomm/ircomm_event.c Tue Dec 21 10:17:58 1999 +++ linux/net/irda/ircomm/ircomm_event.c Fri Mar 2 11:12:12 2001 @@ -151,7 +151,7 @@ /* * Function ircomm_state_waitr (self, event, skb) * - * IrCOMM has received an incomming connection request and is awaiting + * IrCOMM has received an incoming connection request and is awaiting * response from the user */ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, diff -u --recursive --new-file v2.4.2/linux/net/irda/ircomm/ircomm_lmp.c linux/net/irda/ircomm/ircomm_lmp.c --- v2.4.2/linux/net/irda/ircomm/ircomm_lmp.c Tue Dec 21 10:17:58 1999 +++ linux/net/irda/ircomm/ircomm_lmp.c Fri Mar 2 11:12:12 2001 @@ -219,7 +219,7 @@ /* * Function ircomm_lmp_data_indication (instance, sap, skb) * - * Incomming data which we must deliver to the state machine, to check + * Incoming data which we must deliver to the state machine, to check * we are still connected. */ int ircomm_lmp_data_indication(void *instance, void *sap, diff -u --recursive --new-file v2.4.2/linux/net/irda/ircomm/ircomm_ttp.c linux/net/irda/ircomm/ircomm_ttp.c --- v2.4.2/linux/net/irda/ircomm/ircomm_ttp.c Tue Dec 21 10:17:58 1999 +++ linux/net/irda/ircomm/ircomm_ttp.c Fri Mar 2 11:12:12 2001 @@ -156,7 +156,7 @@ /* * Function ircomm_ttp_data_indication (instance, sap, skb) * - * Incomming data + * Incoming data * */ int ircomm_ttp_data_indication(void *instance, void *sap, diff -u --recursive --new-file v2.4.2/linux/net/irda/ircomm/ircomm_tty.c linux/net/irda/ircomm/ircomm_tty.c --- v2.4.2/linux/net/irda/ircomm/ircomm_tty.c Mon Nov 27 18:07:31 2000 +++ linux/net/irda/ircomm/ircomm_tty.c Fri Mar 2 11:12:12 2001 @@ -1106,7 +1106,7 @@ /* * Function ircomm_tty_data_indication (instance, sap, skb) * - * Handle incomming data, and deliver it to the line discipline + * Handle incoming data, and deliver it to the line discipline * */ static int ircomm_tty_data_indication(void *instance, void *sap, @@ -1155,7 +1155,7 @@ /* * Function ircomm_tty_control_indication (instance, sap, skb) * - * Parse all incomming parameters (easy!) + * Parse all incoming parameters (easy!) * */ static int ircomm_tty_control_indication(void *instance, void *sap, diff -u --recursive --new-file v2.4.2/linux/net/irda/irias_object.c linux/net/irda/irias_object.c --- v2.4.2/linux/net/irda/irias_object.c Mon Jan 1 09:54:07 2001 +++ linux/net/irda/irias_object.c Fri Mar 2 11:12:12 2001 @@ -162,7 +162,7 @@ ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -1;); ASSERT(attrib != NULL, return -1;); - /* Remove atribute from object */ + /* Remove attribute from object */ node = hashbin_remove(obj->attribs, 0, attrib->name); if (!node) return 0; /* Already removed or non-existent */ diff -u --recursive --new-file v2.4.2/linux/net/irda/irlan/irlan_provider.c linux/net/irda/irlan/irlan_provider.c --- v2.4.2/linux/net/irda/irlan/irlan_provider.c Sat Nov 11 18:11:23 2000 +++ linux/net/irda/irlan/irlan_provider.c Fri Mar 2 11:12:12 2001 @@ -162,7 +162,7 @@ /* * Function irlan_provider_connect_response (handle) * - * Accept incomming connection + * Accept incoming connection * */ void irlan_provider_connect_response(struct irlan_cb *self, @@ -371,7 +371,7 @@ /* * Function irlan_provider_register(void) * - * Register provider support so we can accept incomming connections. + * Register provider support so we can accept incoming connections. * */ int irlan_provider_open_ctrl_tsap(struct irlan_cb *self) diff -u --recursive --new-file v2.4.2/linux/net/irda/irlap.c linux/net/irda/irlap.c --- v2.4.2/linux/net/irda/irlap.c Wed Feb 21 18:20:47 2001 +++ linux/net/irda/irlap.c Fri Mar 2 11:12:12 2001 @@ -51,6 +51,7 @@ hashbin_t *irlap = NULL; int sysctl_slot_timeout = SLOT_TIMEOUT * 1000 / HZ; +extern void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb); static void __irlap_close(struct irlap_cb *self); static char *lap_reasons[] = { @@ -241,7 +242,7 @@ /* * Function irlap_connect_response (self, skb) * - * Service user has accepted incomming connection + * Service user has accepted incoming connection * */ void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb) diff -u --recursive --new-file v2.4.2/linux/net/irda/irlap_comp.c linux/net/irda/irlap_comp.c --- v2.4.2/linux/net/irda/irlap_comp.c Sat Nov 11 18:11:22 2000 +++ linux/net/irda/irlap_comp.c Fri Mar 2 11:12:12 2001 @@ -92,7 +92,7 @@ /* * Function irda_set_compression (self, proto) * - * The the compression protocol to be used by this session + * The compression protocol to be used by this session * */ int irda_set_compression( struct irlap_cb *self, int proto) diff -u --recursive --new-file v2.4.2/linux/net/irda/irlap_event.c linux/net/irda/irlap_event.c --- v2.4.2/linux/net/irda/irlap_event.c Wed Feb 21 18:20:47 2001 +++ linux/net/irda/irlap_event.c Fri Mar 2 11:12:12 2001 @@ -546,7 +546,7 @@ break; case SLOT_TIMER_EXPIRED: /* - * Wait a little longer if we detect an incomming frame. This + * Wait a little longer if we detect an incoming frame. This * is not mentioned in the spec, but is a good thing to do, * since we want to work even with devices that violate the * timing requirements. diff -u --recursive --new-file v2.4.2/linux/net/irda/irlmp.c linux/net/irda/irlmp.c --- v2.4.2/linux/net/irda/irlmp.c Wed Feb 21 18:20:47 2001 +++ linux/net/irda/irlmp.c Fri Mar 2 11:12:12 2001 @@ -450,7 +450,7 @@ /* * Function irlmp_connect_indication (self) * - * Incomming connection + * Incoming connection * */ void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb) diff -u --recursive --new-file v2.4.2/linux/net/irda/irlmp_frame.c linux/net/irda/irlmp_frame.c --- v2.4.2/linux/net/irda/irlmp_frame.c Sat Nov 11 18:11:23 2000 +++ linux/net/irda/irlmp_frame.c Fri Mar 2 11:12:12 2001 @@ -470,7 +470,7 @@ lsap = (struct lsap_cb *) hashbin_get_first(queue); while (lsap != NULL) { /* - * If this is an incomming connection, then the destination + * If this is an incoming connection, then the destination * LSAP selector may have been specified as LM_ANY so that * any client can connect. In that case we only need to check * if the source LSAP (in our view!) match! diff -u --recursive --new-file v2.4.2/linux/net/irda/irnet/Config.in linux/net/irda/irnet/Config.in --- v2.4.2/linux/net/irda/irnet/Config.in Sat Nov 11 18:11:23 2000 +++ linux/net/irda/irnet/Config.in Fri Mar 2 11:12:12 2001 @@ -1 +1,4 @@ -dep_tristate ' IrNET protocol' CONFIG_IRNET $CONFIG_IRDA +if [ "$CONFIG_NETDEVICES" != "n" ]; then + dep_tristate ' IrNET protocol' CONFIG_IRNET $CONFIG_IRDA $CONFIG_PPP +fi + diff -u --recursive --new-file v2.4.2/linux/net/irda/irnet/irnet.h linux/net/irda/irnet/irnet.h --- v2.4.2/linux/net/irda/irnet/irnet.h Mon Dec 11 13:33:14 2000 +++ linux/net/irda/irnet/irnet.h Fri Mar 2 11:12:12 2001 @@ -9,7 +9,7 @@ * what's in there... * * Note : as most part of the Linux kernel, this module is available - * under the GNU Public License (GPL). + * under the GNU General Public License (GPL). */ #ifndef IRNET_H @@ -52,14 +52,14 @@ * o multipoint operation (limited by IrLAP specification) * o information in /proc/net/irda/irnet * o IrNET events on /dev/irnet (for user space daemon) - * o IrNET deamon (irnetd) to automatically handle incomming requests + * o IrNET deamon (irnetd) to automatically handle incoming requests * o Windows 2000 compatibility (tested, but need more work) * Currently missing : * o Lot's of testing (that's your job) * o Connection retries (may be too hard to do) * o Check pppd persist mode - * o User space deamon (to automatically handle incomming requests) - * o A registered device number (comming, waiting from an answer) + * o User space deamon (to automatically handle incoming requests) + * o A registered device number (coming, waiting from an answer) * o Final integration in Linux-IrDA (up to Dag) * * The setup is not currently the most easy, but this should get much @@ -109,16 +109,16 @@ * and allow to offer the event channel, useful for other stuff like debug. * * On the other hand, this require a loose coordination between the - * present module and irnetd. One critical area is how incomming request + * present module and irnetd. One critical area is how incoming request * are handled. - * When irnet receive an incomming request, it send an event to irnetd and - * drop the incomming IrNET socket. + * When irnet receive an incoming request, it send an event to irnetd and + * drop the incoming IrNET socket. * irnetd start a pppd instance, which create a new IrNET socket. This new * socket is then connected in the originating node to the pppd instance. * At this point, in the originating node, the first socket is closed. * * I admit, this is a bit messy and waste some ressources. The alternative - * is caching incomming socket, and that's also quite messy and waste + * is caching incoming socket, and that's also quite messy and waste * ressources. * We also make connection time slower. For example, on a 115 kb/s link it * adds 60ms to the connection time (770 ms). However, this is slower than diff -u --recursive --new-file v2.4.2/linux/net/irda/irnet/irnet_irda.c linux/net/irda/irnet/irnet_irda.c --- v2.4.2/linux/net/irda/irnet/irnet_irda.c Sun Nov 12 20:40:42 2000 +++ linux/net/irda/irnet/irnet_irda.c Fri Mar 2 11:12:12 2001 @@ -523,7 +523,7 @@ /* * The IrNET service is composed of one server socket and a variable * number of regular IrNET sockets. The server socket is supposed to - * handle incomming connections and redirect them to one IrNET sockets. + * handle incoming connections and redirect them to one IrNET sockets. * It's a superset of the regular IrNET socket, but has a very distinct * behaviour... */ @@ -662,7 +662,7 @@ /* * Function irda_connect_socket (self) * - * Connect an incomming connection to the socket + * Connect an incoming connection to the socket * */ static inline int @@ -721,7 +721,7 @@ /* * Function irda_disconnect_server (self) * - * Cleanup the server socket when the incomming connection abort + * Cleanup the server socket when the incoming connection abort * */ static inline void @@ -1097,7 +1097,7 @@ /* * Function irnet_connect_indication(instance, sap, qos, max_sdu_size, userdata) * - * Incomming connection + * Incoming connection * * In theory, this function is called only on the server socket. * Some other node is attempting to connect to the IrNET service, and has diff -u --recursive --new-file v2.4.2/linux/scripts/mkdep.c linux/scripts/mkdep.c --- v2.4.2/linux/scripts/mkdep.c Wed Sep 27 14:09:30 2000 +++ linux/scripts/mkdep.c Fri Mar 2 11:12:12 2001 @@ -2,7 +2,7 @@ * Originally by Linus Torvalds. * Smart CONFIG_* processing by Werner Almesberger, Michael Chastain. * - * Usage: mkdep file ... + * Usage: mkdep cflags -- file ... * * Read source files and output makefile dependency lines for them. * I make simple dependency lines for #include <*.h> and #include "*.h". @@ -22,10 +22,17 @@ * 2.3.99-pre1, Andrew Morton * - Changed so that 'filename.o' depends upon 'filename.[cS]'. This is so that * missing source files are noticed, rather than silently ignored. + * + * 2.4.2-pre3, Keith Owens + * - Accept cflags followed by '--' followed by filenames. mkdep extracts -I + * options from cflags and looks in the specified directories as well as the + * defaults. Only -I is supported, no attempt is made to handle -idirafter, + * -isystem, -I- etc. */ #include #include +#include #include #include #include @@ -44,11 +51,10 @@ struct path_struct { int len; - char buffer[256-sizeof(int)]; -} path_array[2] = { - { 0, "" }, - { 0, "" } + char *buffer; }; +struct path_struct *path_array; +int paths; /* Current input file */ @@ -181,9 +187,10 @@ /* * Handle an #include line. */ -void handle_include(int type, const char * name, int len) +void handle_include(int start, const char * name, int len) { - struct path_struct *path = path_array+type; + struct path_struct *path; + int i; if (len == 14 && !memcmp(name, "linux/config.h", len)) return; @@ -191,13 +198,58 @@ if (len >= 7 && !memcmp(name, "config/", 7)) define_config(name+7, len-7-2); - memcpy(path->buffer+path->len, name, len); - path->buffer[path->len+len] = '\0'; - if (access(path->buffer, F_OK) != 0) - return; + for (i = start, path = path_array+start; i < paths; ++i, ++path) { + memcpy(path->buffer+path->len, name, len); + path->buffer[path->len+len] = '\0'; + if (access(path->buffer, F_OK) == 0) { + do_depname(); + printf(" \\\n %s", path->buffer); + return; + } + } - do_depname(); - printf(" \\\n %s", path->buffer); +} + + + +/* + * Add a path to the list of include paths. + */ +void add_path(const char * name) +{ + struct path_struct *path; + char resolved_path[PATH_MAX+1]; + const char *name2; + + if (strcmp(name, ".")) { + name2 = realpath(name, resolved_path); + if (!name2) { + fprintf(stderr, "realpath(%s) failed, %m\n", name); + exit(1); + } + } + else { + name2 = ""; + } + + path_array = realloc(path_array, (++paths)*sizeof(*path_array)); + if (!path_array) { + fprintf(stderr, "cannot expand path_arry\n"); + exit(1); + } + + path = path_array+paths-1; + path->len = strlen(name2); + path->buffer = malloc(path->len+1+256+1); + if (!path->buffer) { + fprintf(stderr, "cannot allocate path buffer\n"); + exit(1); + } + strcpy(path->buffer, name2); + if (path->len && *(path->buffer+path->len-1) != '/') { + *(path->buffer+path->len) = '/'; + *(path->buffer+(++(path->len))) = '\0'; + } } @@ -210,7 +262,7 @@ char *pc; int i; - pc = path_array[0].buffer + path_array[0].len; + pc = path_array[paths-1].buffer + path_array[paths-1].len; memcpy(pc, "config/", 7); pc += 7; @@ -228,7 +280,7 @@ define_config(pc, len); do_depname(); - printf(" \\\n $(wildcard %s.h)", path_array[0].buffer); + printf(" \\\n $(wildcard %s.h)", path_array[paths-1].buffer); } @@ -387,7 +439,7 @@ GETNEXT CASE('\n', start); NOTCASE('"', pound_include_dquote); - handle_include(1, map_dot, next - map_dot - 1); + handle_include(0, map_dot, next - map_dot - 1); goto start; /* #\s*include\s*<(.*)> */ @@ -395,7 +447,7 @@ GETNEXT CASE('\n', start); NOTCASE('>', pound_include_langle); - handle_include(0, map_dot, next - map_dot - 1); + handle_include(1, map_dot, next - map_dot - 1); goto start; /* #\s*d */ @@ -524,7 +576,7 @@ int main(int argc, char **argv) { int len; - char *hpath; + const char *hpath; hpath = getenv("HPATH"); if (!hpath) { @@ -532,12 +584,26 @@ "Don't bypass the top level Makefile.\n", stderr); return 1; } - len = strlen(hpath); - memcpy(path_array[0].buffer, hpath, len); - if (len && hpath[len-1] != '/') - path_array[0].buffer[len++] = '/'; - path_array[0].buffer[len] = '\0'; - path_array[0].len = len; + + add_path("."); /* for #include "..." */ + + while (++argv, --argc > 0) { + if (strncmp(*argv, "-I", 2) == 0) { + if (*((*argv)+2)) { + add_path((*argv)+2); + } + else { + ++argv; + --argc; + add_path(*argv); + } + } + else if (strcmp(*argv, "--") == 0) { + break; + } + } + + add_path(hpath); /* must be last entry, for config files */ while (--argc > 0) { const char * filename = *++argv; diff -u --recursive --new-file v2.4.2/linux/scripts/ver_linux linux/scripts/ver_linux --- v2.4.2/linux/scripts/ver_linux Sun Sep 17 09:45:06 2000 +++ linux/scripts/ver_linux Fri Mar 2 11:12:12 2001 @@ -5,30 +5,64 @@ # differ on your system. # PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH -echo '-- Versions installed: (if some fields are empty or look' -echo '-- unusual then possibly you have very old versions)' +echo 'If some fields are empty or look unusual you may have an old version.' +echo 'Compare to the current minimal requirements in Documentation/Changes.' +echo ' ' + uname -a -insmod -V 2>&1 | awk 'NR==1 {print "Kernel modules ",$NF}' +echo ' ' + echo "Gnu C " `gcc --version` + make --version 2>&1 | awk -F, '{print $1}' | awk \ - '/GNU Make/{print "Gnu Make ",$NF}' + '/GNU Make/{print "Gnu make ",$NF}' + ld -v 2>&1 | awk -F\) '{print $1}' | awk \ - '/BFD/{print "Binutils ",$NF}' -ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed -e 's/\.so$//' \ - | awk -F'[.-]' '{print "Linux C Library " $(NF-2)"."$(NF-1)"."$NF}' -echo -n "Dynamic linker " -ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1 + '/BFD/{print "binutils ",$NF}' + +mount --version | awk -F\- '{print "util-linux ", $NF}' + +insmod -V 2>&1 | awk 'NR==1 {print "modutils ",$NF}' + +tune2fs 2>&1 | grep tune2fs | sed 's/,//' | awk \ +'NR==1 {print "e2fsprogs ", $2}' + +reiserfsck 2>&1 | grep reiserfsprogs | awk \ +'NR==1{print "reiserfsprogs ", $NF}' + +cardmgr -V 2>&1| grep version | awk \ +'NR==1{print "pcmcia-cs ", $3}' + +pppd --version 2>&1| grep version | awk \ +'NR==1{print "PPP ", $3}' + +isdnctrl 2>&1 | grep version | awk \ +'NR==1{print "isdn4k-utils ", $NF}' + +ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ +-e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ +$(NF-2)"."$(NF-1)"."$NF}' + +ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1 | awk \ +'NR==1{print "Dynamic linker (ldd) ", $NF}' + ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ '{print "Linux C++ Library " $4"."$5"."$6}' + ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}' -mount --version | awk -F\- '{print "Mount ", $NF}' -hostname -V 2>&1 | awk 'NR==1{print "Net-tools ", $NF}' + +ifconfig --version 2>&1 | grep tools | awk \ +'NR==1{print "Net-tools ", $NF}' + # Kbd needs 'loadkeys -h', loadkeys -h 2>&1 | awk \ '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}' + # while console-tools needs 'loadkeys -V'. loadkeys -V 2>&1 | awk \ '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}' + expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}' + X=`cat /proc/modules | sed -e "s/ .*$//"` echo "Modules Loaded "$X