From 6f5dc02e5019141d9f366a0948b32d361bc800f6 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:28:39 -0500 Subject: [PATCH] Import 2.3.29pre1 --- Documentation/Configure.help | 202 ++++-- Documentation/networking/sis900.txt | 460 ++++++++++++++ MAINTAINERS | 6 + Makefile | 5 +- arch/alpha/kernel/signal.c | 1 + arch/alpha/kernel/sys_sio.c | 4 +- arch/arm/kernel/signal.c | 1 + arch/arm/mm/ioremap.c | 2 +- arch/i386/boot/Makefile | 8 +- arch/i386/defconfig | 1 + arch/i386/kernel/setup.c | 3 + arch/i386/kernel/signal.c | 1 + arch/i386/mm/init.c | 5 + arch/i386/mm/ioremap.c | 2 +- arch/m68k/kernel/signal.c | 1 + arch/m68k/mm/kmap.c | 2 +- arch/mips/kernel/signal.c | 2 +- arch/ppc/kernel/signal.c | 1 + arch/ppc/mm/init.c | 2 +- arch/sh/kernel/signal.c | 1 + arch/sh/mm/ioremap.c | 2 +- arch/sparc/kernel/signal.c | 3 +- arch/sparc64/kernel/signal.c | 3 +- drivers/acorn/char/serial-card.c | 2 + drivers/block/Config.in | 4 +- drivers/block/aec6210.c | 1 + drivers/block/ide-cd.c | 18 - drivers/block/ide-features.c | 1 - drivers/block/ide-geometry.c | 1 - drivers/block/rd.c | 42 +- drivers/block/xd.c | 2 +- drivers/char/bttv.c | 67 +- drivers/char/bttv.h | 1 + drivers/char/serial.c | 923 +++++++++++++++++++--------- drivers/char/tuner.c | 6 + drivers/char/tuner.h | 7 +- drivers/isdn/Config.in | 10 +- drivers/isdn/avmb1/capi.c | 14 +- drivers/isdn/avmb1/compat.h | 45 -- drivers/isdn/avmb1/t1pci.c | 8 +- drivers/isdn/eicon/eicon_isa.h | 5 +- drivers/isdn/eicon/eicon_mod.c | 19 +- drivers/isdn/hisax/hisax.h | 13 +- drivers/isdn/hisax/isurf.c | 34 +- drivers/isdn/hisax/sedlbauer.c | 135 +++- drivers/isdn/hisax/teles0.c | 57 +- drivers/isdn/hisax/telespci.c | 27 +- drivers/isdn/pcbit/drv.c | 31 +- drivers/isdn/pcbit/pcbit.h | 8 +- drivers/net/8390.c | 5 +- drivers/net/Config.in | 2 +- drivers/net/Makefile | 9 +- drivers/net/Space.c | 3 + drivers/net/setup.c | 6 +- drivers/net/slhc.c | 3 +- drivers/net/tokenring/tms380tr.c | 390 ++++++------ drivers/scsi/BusLogic.h | 1 - drivers/scsi/aha152x.c | 2 +- drivers/scsi/aic7xxx.c | 32 +- drivers/scsi/aic7xxx/aic7xxx.seq | 23 +- drivers/scsi/aic7xxx_proc.c | 13 +- drivers/scsi/aic7xxx_seq.c | 481 ++++++++------- drivers/scsi/dtc.c | 2 +- drivers/scsi/fdomain.c | 2 +- drivers/scsi/hosts.c | 2 - drivers/scsi/hosts.h | 1 - drivers/scsi/scsi.c | 22 +- drivers/scsi/scsi_proc.c | 4 +- drivers/scsi/scsicam.c | 10 +- drivers/scsi/seagate.c | 2 +- drivers/scsi/t128.c | 2 +- drivers/usb/README.dc2xx | 25 +- drivers/usb/dc2xx.c | 92 +-- drivers/usb/uhci.c | 3 +- drivers/usb/usb_scsi.c | 28 +- fs/inode.c | 1 + fs/proc/Makefile | 2 + fs/proc/inode.c | 12 - fs/proc/kcore.c | 56 +- fs/proc/openprom-dev.c | 46 ++ fs/proc/openpromfs.c | 163 +++-- fs/proc/procfs_syms.c | 7 - fs/proc/root.c | 124 +--- fs/super.c | 1 - fs/udf/super.c | 1 - include/asm-arm/signal.h | 1 + include/asm-i386/e820.h | 3 +- include/asm-i386/io.h | 19 + include/asm-i386/signal.h | 1 + include/asm-m68k/signal.h | 1 + include/asm-ppc/signal.h | 1 + include/asm-sh/signal.h | 1 + include/linux/fs.h | 2 - include/linux/if_arp.h | 2 +- include/linux/netdevice.h | 1 - include/linux/pci_ids.h | 72 ++- include/linux/sched.h | 2 +- include/linux/serial.h | 22 +- include/linux/serialP.h | 20 +- include/linux/vmalloc.h | 6 +- include/net/ip.h | 16 + kernel/ksyms.c | 1 + mm/vmalloc.c | 5 +- net/802/tr.c | 17 +- net/atm/mpoa_proc.c | 52 +- net/atm/proc.c | 426 ++++++------- net/atm/resources.h | 2 - net/ipv4/arp.c | 26 +- net/netsyms.c | 8 +- 109 files changed, 2795 insertions(+), 1689 deletions(-) create mode 100644 Documentation/networking/sis900.txt delete mode 100644 drivers/isdn/avmb1/compat.h create mode 100644 fs/proc/openprom-dev.c diff --git a/Documentation/Configure.help b/Documentation/Configure.help index 587b99ff7c16..e197613092dd 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -6499,10 +6499,16 @@ CONFIG_RTL8139 SiS 900 PCI Fast Ethernet Adapter support CONFIG_SIS900 - This is a driver for the Silicon Integrated System Corporation 900 - Fast Ethernet PCI network card. If you have one of those, say Y and - read the Ethernet-HOWTO, available from - http://metalab.unc.edu/mdw/linux.html#howto . + This is a driver for the Fast Ethernet PCI network cards based on + the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in + SiS 630 and SiS 540 chipsets. If you have one of those, say Y and + read the Ethernet-HOWTO, available via FTP (user: anonymous) in + ftp://metalab.unc.edu/pub/Linux/docs/HOWTO. Please read + Documentation/networking/sis900.txt and comments at the beginning + of drivers/net/sis900.c for more information. + + This driver also supports AMD 79C901 HomePNA such that you can use + your phone line as network cable. If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -11128,10 +11134,10 @@ CONFIG_ISDN_AUDIO is the only voice-supporting driver. See Documentation/isdn/README.audio for more information. -X.25 PLP on top of ISDN (EXPERIMENTAL) +X.25 PLP on top of ISDN CONFIG_ISDN_X25 - This experimental feature provides the X.25 protocol over ISDN - connections. See Documentation/isdn/README.x25 for more information + This feature provides the X.25 protocol over ISDN connections. + See Documentation/isdn/README.x25 for more information if you are thinking about using this. ISDN diversion services support @@ -11193,6 +11199,28 @@ CONFIG_ISDN_DRV_HISAX called hisax.o. See Documentation/isdn/README.HiSax for more information on using this driver. +HiSax Support for EURO/DSS1 +CONFIG_HISAX_EURO + Enable this if you have a EURO ISDN line. + +Support for german chargeinfo +CONFIG_DE_AOC + If you have german AOC, you can enable this to get the charginfo. + +Disable sending complete +CONFIG_HISAX_NO_SENDCOMPLETE + If you have trouble with some ugly exchanges or you live in + Australia select this option. + +Disable sending low layer compatibility +CONFIG_HISAX_NO_LLC + If you have trouble with some ugly exchanges try to select this + option. + +HiSax Support for german 1TR6 +CONFIG_HISAX_1TR6 + Enable this if you have a old german 1TR6 line. + HiSax Support for Teles 16.0/8.0 CONFIG_HISAX_16_0 This enables HiSax support for the Teles ISDN-cards S0-16.0, S0-8 @@ -11211,13 +11239,15 @@ CONFIG_HISAX_16_3 different cards, a different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for Teles 16.3c -CONFIG_HISAX_TELES3C - This enables HiSax support for the Teles ISDN-cards 16.3c. - - See Documentation/isdn/README.HiSax on how to configure it using the - different cards, a different D-channel protocol, or non-standard - IRQ/port settings. +HiSax Support for Teles PCI +CONFIG_HISAX_TELESPCI + This enables HiSax support for the Teles PCI. + See Documentation/isdn/README.HiSax on how to configure it. + +HiSax Support for Teles S0Box +CONFIG_HISAX_S0BOX + This enables HiSax support for the Teles/Creatix parallel port + S0BOX. See Documentation/isdn/README.HiSax on how to configure it. HiSax Support for AVM A1 (Fritz) CONFIG_HISAX_AVM_A1 @@ -11227,7 +11257,17 @@ CONFIG_HISAX_AVM_A1 different cards, a different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for Elsa ISA cards +HiSax Support for AVM PnP/PCI (Fritz!PNP/PCI) +CONFIG_HISAX_FRITZPCI + This enables HiSax support for the AVM "Fritz!PnP" and "Fritz!PCI". + See Documentation/isdn/README.HiSax on how to configure it. + +HiSax Support for AVM A1 PCMCIA (Fritz) +CONFIG_HISAX_AVM_A1_PCMCIA + This enables HiSax support for the AVM A1 "Fritz!PCMCIA"). + See Documentation/isdn/README.HiSax on how to configure it. + +HiSax Support for Elsa cards CONFIG_HISAX_ELSA This enables HiSax support for the Elsa Mircolink ISA cards, for the Elsa Quickstep series cards and Elsa PCMCIA. @@ -11270,7 +11310,16 @@ CONFIG_HISAX_TELEINT different cards, a different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for Sedlbauer speed card/win-star +HiSax Support for HFC-S based cards +CONFIG_HISAX_HFCS + This enables HiSax support for the HFC-S 2BDS0 based cards, like + teles 16.3c. + + See Documentation/isdn/README.HiSax on how to configure it using the + different cards, a different D-channel protocol, or non-standard + IRQ/port settings. + +HiSax Support for Sedlbauer cards CONFIG_HISAX_SEDLBAUER This enables HiSax support for the Sedlbauer passive ISDN cards. @@ -11307,50 +11356,58 @@ CONFIG_HISAX_NICCY See Documentation/isdn/README.HiSax on how to configure it using a different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for Am7930 (EXPERIMENTAL) -CONFIG_HISAX_AMD7930 - This enables HiSax support for the AMD7930 chips on some SPARCs. - This code is not finished yet. +HiSax Support for Siemens I-Surf card +CONFIG_HISAX_ISURF + This enables HiSax support for the Siemens I-Talk/I-Surf card with + ISAR chip. + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for EURO/DSS1 -CONFIG_HISAX_EURO - Say Y or N according to the D-channel protocol which your local - telephone service company provides. +HiSax Support for HST Saphir card +CONFIG_HISAX_HSTSAPHIR + This enables HiSax support for the HST Saphir card. + + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. - NOTE: If you say Y here and you have only one ISDN card installed, - you cannot say Y to "HiSax Support for German 1TR6", below. And vice - versa. +HiSax Support for Telekom A4T card +CONFIG_HISAX_BKM_A4T + This enables HiSax support for the Telekom A4T card. + + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. -Support for German tariff info -CONFIG_DE_AOC - If you want that the HiSax hardware driver sends messages to the - upper level of the isdn code on each AOCD (Advice Of Charge, During - the call -- transmission of the fee information during a call) and - on each AOCE (Advice Of Charge, at the End of the call -- - transmission of fee information at the end of the call), say Y here. - This works only in Germany. - -Support for Australian Microlink service (not for std. EURO) -CONFIG_HISAX_ML - If you are in Australia and connected to the Microlink telephone - network, enable this, because there are little differences in - protocol. +HiSax Support for Scitel Quadro card +CONFIG_HISAX_SCT_QUADRO + This enables HiSax support for the Scitel Quadro card. - Please don't enable this in other countries. + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. -HiSax Support for US/NI-1 (not released yet) -CONFIG_HISAX_NI1 - Say Y or N according to the D-channel protocol which your local - telephone service company provides. +HiSax Support for Gazel cards +CONFIG_HISAX_GAZEL + This enables HiSax support for the Gazel cards. -HiSax Support for German 1TR6 -CONFIG_HISAX_1TR6 - Say Y or N according to the D-channel protocol which your local - telephone service company provides. + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. + +HiSax Support for HFC PCI-Bus cards +CONFIG_HISAX_HFC_PCI + This enables HiSax support for the HFC-S PCI 2BDS0 based cards. + + For more informations see under Documentation/isdn/README.hfc-pci. + +HiSax Support for Winbond W6692 based cards +CONFIG_HISAX_W6692 + This enables HiSax support for Winbond W6692 based PCI ISDN cards. + + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. - NOTE: If you say Y here and you have only one ISDN card installed, - you cannot say Y to "HiSax Support for EURO/DSS1", above. And vice - versa. +HiSax Support for Am7930 (EXPERIMENTAL) +CONFIG_HISAX_AMD7930 + This enables HiSax support for the AMD7930 chips on some SPARCs. + This code is not finished yet. PCBIT-D support CONFIG_ISDN_DRV_PCBIT @@ -11399,27 +11456,52 @@ CONFIG_ISDN_TTY_FAX an ISDN-fax-machine. This must be supported by the lowlevel driver also. See Documentation/isdn/README.fax for more information. -AVM-B1 with CAPI2.0 support +AVM CAPI2.0 support CONFIG_ISDN_DRV_AVMB1 - This enables support for the AVM B1 ISDN networking cards. In + This enables support for the AVM B1/T1 ISDN networking cards.In addition, a CAPI (Common ISDN Application Programming Interface, a standard making it easy for programs to access ISDN hardware, see - http://www.capi.org/ ) interface for this card is provided. In order - to use this card, additional firmware is necessary, which has to be - downloaded into the card using a utility which is distributed - separately. Please read the file Documentation/isdn/README.avmb1. - + http://www.capi.org/; to browse the WWW, you need to have access to + a machine on the Internet that has a program like lynx or netscape) + interface for this card is provided. In order to use this card, + additional firmware is necessary, which has to be downloaded into + the card using a utility which is distributed separately. Please + read the file Documentation/isdn/README.avmb1. + This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). The module will be called avmb1.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +AVM B1 ISA support +CONFIG_ISDN_DRV_AVMB1_B1ISA + Enable support for the ISA version of the AVM B1 card. + +AVM B1 PCI support +CONFIG_ISDN_DRV_AVMB1_B1PCI + Enable support for the PCI version of the AVM B1 card. + +AVM T1/T1-B ISA support +CONFIG_ISDN_DRV_AVMB1_T1ISA + Enable support for the AVM T1 T1B card. + Note: This is a PRI card and handle 30 B-channels. + +AVM B1/M1/M2 PCMCIA support +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA + Enable support for the PCMCIA version of the AVM B1 card. + +AVM T1/T1-B PCI support +CONFIG_ISDN_DRV_AVMB1_T1PCI + Enable support for the AVM T1 T1B card. + Note: This is a PRI card and handle 30 B-channels. + Verbose reason code reporting (kernel size +=7K) CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON If you say Y here, the AVM B1 driver will give verbose reasons for disconnecting. This will increase the size of the kernel by 7 KB. If unsure, say Y. + IBM Active 2000 support (EXPERIMENTAL) CONFIG_ISDN_DRV_ACT2000 Say Y here if you have an IBM Active 2000 ISDN card. In order to use diff --git a/Documentation/networking/sis900.txt b/Documentation/networking/sis900.txt new file mode 100644 index 000000000000..474d3c081287 --- /dev/null +++ b/Documentation/networking/sis900.txt @@ -0,0 +1,460 @@ + SiS 900/7016 Fast Ethernet Device Driver + by Ollie Lho (ollie@sis.com.tw) + November 4, 1999. Document Revision: 0.1 + + This document gives some information on installation and usage of SiS + 900/7016 device driver under Linux. + ______________________________________________________________________ + + Table of Contents + + + 1. Introduction + + 2. License + + 3. Changes + + 4. Tested Environment + + 5. Files in This Rackage + + 6. Installation + + 6.1 Kernel version later than 2.2.11 and 2.3.15 + 6.1.1 Building the driver as loadable module + 6.1.2 Building the driver into kernel + 6.2 Earlier Kernel Version in 2.2.x and 2.3.x Series + + 7. Known Problems and Bugs + + 8. Revision History + + 9. Acknowledgements + + + + ______________________________________________________________________ + + 1. Introduction + + This document describes the revision 1.06 of SiS 900/7016 Fast + Ethernet device driver under Linux. The driver is developed by Silicon + Integrated System Corp. and distributed freely under the GNU General + Public License (GPL). The driver can be compiled as a loadable module + and used under Linux kernel version 2.2.x. With minimal changes, the + driver can also be used under 2.3.x kernel, please see section + ``Installation''. If you are intended to use the driver for earlier + kernels, you are on your own. + + The driver is tested with usual TCP/IP applications including FTP, + Telnet, Netscape etc. and is used constantly by the developers. + + Please send all comments/fixes/questions to Ollie Lho. + + + 2. License + + + + + + + + + + + Copyright (C) 1999 Silicon Integrated System Corp. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + + + + 3. Changes + + Changes made in Revision 1.06 + + 1. Separation of sis900.c and sis900.h in order to move most constant + definition to sis900.h (many of those constants were corrected) + + 2. Clean up PCI detection, the pci-scan from Donald Becker were not + used, just simple pci_find_*. + + 3. MII detection is modified to support multiple mii transceiver. + + 4. Bugs in read_eeprom, mdio_* were removed. + + 5. Lot of sis900 irrelevant comments were removed/changed and more + comments were added to reflect the real situation. + + 6. Clean up of physical/virtual address space mess in buffer + descriptors. + + 7. Better transmit/receive error handling. + + 8. The driver now uses zero-copy single buffer management scheme to + improve performance. + + 9. Names of variables were changed to be more consistent. + + 10. Clean up of auo-negotiation and timer code. + + 11. Automatic detection and change of PHY on the fly. + + + 4. Tested Environment + + This driver is developed on the following hardware + + o Intel Celeron 336 with SiS 620 (rev 02) chipset + + o SiS 900 (rev 01) and SiS 7016/7014 Fast Ethernet Card + + and tested with these software environments + + o Red Hat Linux version 6.0 + + o Linux kernel version 2.2.13 + + o Netscape version 4.6 + + o NcFTP 3.0.0 beta 18 + + o Samba version 2.0.3 + + + 5. Files in This Rackage + + In the package you can find these files: + + + sis900-2.2.x.c + Driver source for kernel 2.2.x + + sis900-2.3.x.c + Driver source for kernel 2.3.x + + sis900.h + Header file for both 2.2.x and 2.3.x kernel + + sis900.sgml + Linux-Doc SGML source of the document + + + 6. Installation + + Before trying to install the driver, be sure to get the latest + revision from SiS' Home Page. If you have no prior experience in + networking under Linux, please read Ethernet HOWTO and Networking + HOWTO available from Linux Documentation Project (LDP). + + The installation procedure are different according to your kernel + versions. + + + 6.1. Kernel version later than 2.2.11 and 2.3.15 + + The driver is bundled in release later than 2.2.11 and 2.3.15 so this + is the most easy case. Be sure you have the appropriate packages for + compiling kernel source. Those packages are listed in + Document/Changes in kernel source distribution. There are two + alternative ways to install the driver + + + 6.1.1. Building the driver as loadable module + + To build the driver as a loadable kernel module you have to + reconfigure the kernel to activate network support by + + + + make config + + + + + Choose "Network Device Support" to "Y" and "Ethernet Support" to "Y". + Then you have to choose "SiS 900 Fast Ethernet Adapter Support" to + "M". + + After reconfiguring the kernel, you can make the driver module by + + + make modules + + + + + The driver should be compiled with no errors. After compiling the + driver, the driver can be installed to proper place by + + + + make modules_install + + + + + Load the driver into kernel by + + + + insmod sis900 + + + + + When loading the driver into memory, some information message can be + view by + + + + dmesg + + + + + or + + + cat /var/log/message + + + + + If the driver is loaded properly you will have messages similar to + this: + + + + sis900.c: v1.06 11/04/99 + eth0: SiS 900 PCI Fast Ethernet at 0xd000, IRQ 10, 00:00:e8:83:7f:a4. + eth0: SiS 900 Internal MII PHY transceiver found at address 1. + + + + + showing the version of the driver and the results of probing routine. + + Once the driver is loaded, network can be brought up by + + + + /sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK + + + + + + where IPADDR, BROADCAST, NETMASK are your IP address, broadcast + address and netmask respectively. For more information on how to + configure network interface, please refer to Networking HOWTO. + + The link status is also shown by kernel messages. For example, after + the network interface is activated, you may have the message: + + + + eth0: Using SiS 900 Internal MII PHY as default + eth0: Media Link On 100mbps full-duplex + + + + + If you try to unplug the twist pair (TP) cable you will get + + + + eth0: Media Link Off + + + + + indicating that the link is failed. + + + 6.1.2. Building the driver into kernel + + If you want to make the driver into kernel, choose "Y" rather than "M" + on "SiS 900 Fast Ethernet Adapter Support" when configuring the + kernel. Build the kernel image in the usual way + + + + make dep + + make clean + + make bzlilo + + + + + Next time the system reboot, you have the driver in memory. + + + 6.2. Earlier Kernel Version in 2.2.x and 2.3.x Series + + Installing the driver for earlier kernels in 2.2.x and 2.3.x series + requires a little bit more work. First you have to copy sis900-2.x.x.c + to /usr/src/linux/drivers/net/ and you have to modify some files + manually (sorry !! no patch available !!) + + in Space.c, add + + + extern int sis900_probe(struct device *dev); + + ... + + #ifdef CONFIG_SIS900 + {sis900_probe,0}, + #endif + + + in Config.in add + + + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + ... //other adapter drivers + tristate 'SiS 900 PCI Fast Ethernet Adapter Support' CONFIG_SIS900 + ... //other adapter drivers + fi + + + + + in Makefile add + + + ifeq ($(CONFIG_SIS900),y) + L_OBJS += sis900.o + else + ifeq ($(CONFIG_SIS900),m) + M_OBJS += sis900.o + endif + endif + + + + + After modifying these files, the driver can be build as described in + the previous section. + + + 7. Known Problems and Bugs + + There are some known problems and bugs. If you find any other bugs + please mail to ollie@sis.com.tw + + 1. AM79C901 HomePNA PHY is not thoroughly tested, there may be some + bugs in the "on the fly" change of transceiver. + + 2. A bug is hidden somewhere in the receive buffer management code, + the bug causes NULL pointer reference in the kernel. This fault is + caught before bad things happen and reported with the message: + + + eth0: NULL pointer encountered in Rx ring, skipping + + + + + which can be viewed with dmesg or cat /var/log/message. + + + 8. Revision History + + + o November 4, 1999, Revision 1.06, Second release, lots of clean up + and optimization. + + o August 8, 1999, Revision 1.05, Initial Public Release + + + 9. Acknowledgements + + This driver was originally derived form Donald Becker's pci-skeleton + and rtl8139 drivers. Donald also provided various suggestion regarded + with improvements made in revision 1.06. + + The 1.05 revision was created by Jim Huang, AMD 79c901 support was + added by Chin-Shan Li. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAINTAINERS b/MAINTAINERS index 57c707116bd7..50098a0992a1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -800,6 +800,12 @@ P: Ingo Molnar M: mingo@redhat.com S: Maintained +SIS 900/7016 FAST ETHERNET DRIVER +P: Ollie Lho +M: ollie@sis.com.tw +L: linux-net@vger.rutgers.edu +S: Supported + SMB FILESYSTEM P: Andrew Tridgell M: tridge@samba.org diff --git a/Makefile b/Makefile index 8c468ac3c567..33fc41a19716 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 3 -SUBLEVEL = 28 +SUBLEVEL = 29 EXTRAVERSION = ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) @@ -112,6 +112,7 @@ NETWORKS =net/network.a DRIVERS =drivers/block/block.a \ drivers/char/char.o \ drivers/misc/misc.o \ + drivers/net/net.o \ drivers/parport/parport.a LIBS =$(TOPDIR)/lib/lib.a SUBDIRS =kernel drivers mm fs net ipc lib @@ -124,8 +125,6 @@ ifeq ($(CONFIG_ISDN),y) DRIVERS := $(DRIVERS) drivers/isdn/isdn.a endif -DRIVERS := $(DRIVERS) drivers/net/net.a - ifdef CONFIG_NET_FC DRIVERS := $(DRIVERS) drivers/net/fc/fc.a endif diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index cd8f6e0adb10..cc5d8b16b870 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c @@ -688,6 +688,7 @@ do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw, case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/alpha/kernel/sys_sio.c b/arch/alpha/kernel/sys_sio.c index a6575de9c3f7..481463ed40f1 100644 --- a/arch/alpha/kernel/sys_sio.c +++ b/arch/alpha/kernel/sys_sio.c @@ -238,8 +238,8 @@ p2k_map_irq(struct pci_dev *dev, u8 slot, u8 pin) static inline void __init noname_init_pci(void) { - sio_pci_route(); common_init_pci(); + sio_pci_route(); sio_fixup_irq_levels(sio_collect_irq_levels()); ns87312_enable_ide(0x26e); } @@ -250,8 +250,8 @@ alphabook1_init_pci(void) struct pci_dev *dev; unsigned char orig, config; - sio_pci_route(); common_init_pci(); + sio_pci_route(); /* * On the AlphaBook1, the PCMCIA chip (Cirrus 6729) diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 3f86f47407f6..a8a1b71fec5e 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -545,6 +545,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 141644ae2c17..7edd289d2bc0 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -136,7 +136,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag /* * Ok, go for it.. */ - area = get_vm_area(size); + area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; addr = area->addr; diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile index 58a75a4b2cb8..e01672fe9c00 100644 --- a/arch/i386/boot/Makefile +++ b/arch/i386/boot/Makefile @@ -51,8 +51,11 @@ bootsect.o: bootsect.s bootsect.s: bootsect.S Makefile $(BOOT_INCL) $(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ -bbootsect: bbootsect.o bsetup.o - $(LD) -Ttext 0x0 -R bsetup.o -s -oformat binary $< -o $@ +bbootsect: bbootsect.o bbootsect_kludge.o + $(LD) -Ttext 0x0 -R bbootsect_kludge.o -s -oformat binary $< -o $@ + +bbootsect_kludge.o: bbootsect.o bsetup.o + $(LD) -r $^ -o $@ bbootsect.o: bbootsect.s $(AS) -o $@ $< @@ -84,4 +87,5 @@ clean: rm -f tools/build rm -f setup bootsect zImage compressed/vmlinux.out rm -f bsetup bbootsect bzImage compressed/bvmlinux.out + rm -f bbootsect_kludge.o @$(MAKE) -C compressed clean diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 6aa8412c121b..e57332b14f6e 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -267,6 +267,7 @@ CONFIG_EEXPRESS_PRO100=y # CONFIG_NE2K_PCI is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set +# CONFIG_SIS900 is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set # CONFIG_PPP is not set diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index e10277255bb7..93283dfb9334 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -449,6 +449,9 @@ void __init setup_memory_region(void) case E820_ACPI: printk("(ACPI data)\n"); break; + case E820_NVS: + printk("(ACPI NVS)\n"); + break; default: printk("type %lu\n", e820.map[i].type); break; } diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index cc9a992da75c..a973746b9582 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -687,6 +687,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 7a05654d87d4..e6d35cce188e 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -518,6 +518,11 @@ static inline int page_is_ram (unsigned long pagenr) if (e820.map[i].type != E820_RAM) /* not usable memory */ continue; + /* + * !!!FIXME!!! Some BIOSen report areas as RAM that + * are not. Notably the 640->1Mb area. We need a sanity + * check here. + */ addr = (e820.map[i].addr+PAGE_SIZE-1) >> PAGE_SHIFT; size = e820.map[i].size >> PAGE_SHIFT; if ((pagenr >= addr) && (pagenr < addr+size)) diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index d694553100bc..630d628cf045 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c @@ -131,7 +131,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag /* * Ok, go for it.. */ - area = get_vm_area(size); + area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; addr = area->addr; diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index f35dd94c521c..81014d9c8ce7 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -1093,6 +1093,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGIOT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 60912a5b7752..86041c37311c 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -39,7 +39,7 @@ static inline struct vm_struct *get_io_area(unsigned long size) { - return get_vm_area(size); + return get_vm_area(size, VM_IOREMAP); } diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index c58f1e7cae9f..a00fc9469f8b 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -492,7 +492,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - case SIGBUS: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c index 0d55bcefc827..1ca3a65f8e14 100644 --- a/arch/ppc/kernel/signal.c +++ b/arch/ppc/kernel/signal.c @@ -444,6 +444,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c index 025145d71aad..b0a376c8e411 100644 --- a/arch/ppc/mm/init.c +++ b/arch/ppc/mm/init.c @@ -422,7 +422,7 @@ __ioremap(unsigned long addr, unsigned long size, unsigned long flags) if (mem_init_done) { struct vm_struct *area; - area = get_vm_area(size); + area = get_vm_area(size, VM_IOREMAP); if (area == 0) return NULL; v = VMALLOC_VMADDR(area->addr); diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 8583afff15a8..7c9fbbf008ba 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -566,6 +566,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 90fd190eff9b..c12b97d185b0 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -123,7 +123,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag /* * Ok, go for it.. */ - area = get_vm_area(size); + area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; addr = area->addr; diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index 7fb43e35468b..f2065d20ea05 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c @@ -1162,7 +1162,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, continue; case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: + case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; #ifdef DEBUG_SIGNALS diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index f784e3b9ef61..f618ab85ca16 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -726,7 +726,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, continue; case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: + case SIGABRT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; #ifdef DEBUG_SIGNALS diff --git a/drivers/acorn/char/serial-card.c b/drivers/acorn/char/serial-card.c index a1ea1c61f673..6a8ee528f9b3 100644 --- a/drivers/acorn/char/serial-card.c +++ b/drivers/acorn/char/serial-card.c @@ -55,6 +55,8 @@ static inline int serial_register_onedev (unsigned long port, int irq) { struct serial_struct req; + memset(&req, 0, sizeof(serial_struct)); + req.baud_base = MY_BAUD_BASE; req.irq = irq; req.port = port; diff --git a/drivers/block/Config.in b/drivers/block/Config.in index 39a122dc40d7..8f128700f7e8 100644 --- a/drivers/block/Config.in +++ b/drivers/block/Config.in @@ -54,7 +54,7 @@ else bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD bool ' AEC6210 chipset support' CONFIG_BLK_DEV_AEC6210 if [ "$CONFIG_IDEDMA_PCI_EXPERIMENTAL" = "y" -a "$CONFIG_BLK_DEV_AEC6210" = "y" ]; then - bool ' AEC6210 Tuning support' CONFIG_BLK_DEV_AEC6210_TUNING + bool ' AEC6210 Tuning support (EXPERIMENTAL)' CONFIG_BLK_DEV_AEC6210_TUNING fi if [ "$CONFIG_IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then if [ "$CONFIG_X86" = "y" ]; then @@ -90,7 +90,7 @@ else if [ "$CONFIG_BLK_DEV_PDC202XX" = "y" ]; then bool ' Special UDMA Feature' CONFIG_PDC202XX_FORCE_BURST_BIT if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool ' Special Mode Feature (EXPERIMENTAL)' CONFIG_PDC202XX_FORCE_MASTER_MODE + bool ' Special Mode Feature (EXPERIMENTAL)' CONFIG_PDC202XX_FORCE_MASTER_MODE fi fi if [ "$CONFIG_X86" = "y" ]; then diff --git a/drivers/block/aec6210.c b/drivers/block/aec6210.c index d66ef747821d..c3e51052f5d1 100644 --- a/drivers/block/aec6210.c +++ b/drivers/block/aec6210.c @@ -34,6 +34,7 @@ * 50: ff ff ff ff 00 06 00 00 00 00 00 00 00 00 00 00 */ +#include #include #include #include diff --git a/drivers/block/ide-cd.c b/drivers/block/ide-cd.c index 9247bcfea757..88d5b9739f68 100644 --- a/drivers/block/ide-cd.c +++ b/drivers/block/ide-cd.c @@ -1253,20 +1253,10 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) /* Figure out how much data to transfer. */ thislen = pc->buflen; - if (thislen < 0) thislen = -thislen; if (thislen > len) thislen = len; /* The drive wants to be written to. */ if ((ireason & 3) == 0) { - /* Check that we want to write. */ - if (pc->buflen > 0) { - printk ("%s: cdrom_pc_intr: Drive wants " - "to transfer data the wrong way!\n", - drive->name); - pc->stat = 1; - thislen = 0; - } - /* Transfer the data. */ atapi_output_bytes (drive, pc->buffer, thislen); @@ -1285,14 +1275,6 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) /* Same drill for reading. */ else if ((ireason & 3) == 2) { - /* Check that we want to read. */ - if (pc->buflen < 0) { - printk ("%s: cdrom_pc_intr: Drive wants to " - "transfer data the wrong way!\n", - drive->name); - pc->stat = 1; - thislen = 0; - } /* Transfer the data. */ atapi_input_bytes (drive, pc->buffer, thislen); diff --git a/drivers/block/ide-features.c b/drivers/block/ide-features.c index 0499331a78a4..a5acdca5a323 100644 --- a/drivers/block/ide-features.c +++ b/drivers/block/ide-features.c @@ -13,7 +13,6 @@ * Gadi Oxman */ -#include #include #include #include diff --git a/drivers/block/ide-geometry.c b/drivers/block/ide-geometry.c index db589ec0e0f8..79abaca2be68 100644 --- a/drivers/block/ide-geometry.c +++ b/drivers/block/ide-geometry.c @@ -66,7 +66,6 @@ void probe_cmos_for_drives (ide_hwif_t *hwif) drive->head = drive->bios_head = *(BIOS+2); drive->sect = drive->bios_sect = *(BIOS+14); drive->ctl = *(BIOS+8); - drive->present = 1; } BIOS += 16; } diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 9fec26361ea2..9f4beeb846a4 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -339,6 +339,24 @@ static struct file_operations fd_fops = { block_fsync /* fsync */ }; +#ifdef MODULE +#define rd_init init_module + +/* Before freeing the module, invalidate all of the protected buffers! */ +void cleanup_module(void) +{ + int i; + + for (i = 0 ; i < NUM_RAMDISKS; i++) + invalidate_buffers(MKDEV(MAJOR_NR, i)); + + unregister_blkdev( MAJOR_NR, "ramdisk" ); + blk_dev[MAJOR_NR].request_fn = 0; +} + +#endif /* MODULE */ + + /* This is the registration and initialization section of the RAM disk driver */ int __init rd_init(void) { @@ -380,35 +398,11 @@ int __init rd_init(void) /* loadable module support */ -#ifdef MODULE - MODULE_PARM (rd_size, "1i"); MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); MODULE_PARM (rd_blocksize, "i"); MODULE_PARM_DESC(rd_blocksize, "Blocksize of each RAM disk in bytes."); -int init_module(void) -{ - int error = rd_init(); - if (!error) - printk(KERN_INFO "RAMDISK: Loaded as module.\n"); - return error; -} - -/* Before freeing the module, invalidate all of the protected buffers! */ -void cleanup_module(void) -{ - int i; - - for (i = 0 ; i < NUM_RAMDISKS; i++) - invalidate_buffers(MKDEV(MAJOR_NR, i)); - - unregister_blkdev( MAJOR_NR, "ramdisk" ); - blk_dev[MAJOR_NR].request_fn = 0; -} - -#endif /* MODULE */ - /* End of non-loading portions of the RAM disk driver */ #ifdef RD_LOADER diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 44e8317f0dad..56b4d63cfbf8 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c @@ -207,7 +207,7 @@ static u_char __init xd_detect (u_char *controller, unsigned int *address) for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])) && !found; i++) for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])) && !found; j++) - if (check_signature(xd_bases[i] + xd_sigs[j].offset,xd_sigs[j].string,strlen(xd_sigs[j].string))) { + if (isa_check_signature(xd_bases[i] + xd_sigs[j].offset,xd_sigs[j].string,strlen(xd_sigs[j].string))) { *controller = j; xd_type = j; *address = xd_bases[i]; diff --git a/drivers/char/bttv.c b/drivers/char/bttv.c index 17e87e7f8fc9..a1e6c9e70c14 100644 --- a/drivers/char/bttv.c +++ b/drivers/char/bttv.c @@ -551,7 +551,9 @@ static struct tvcard tvcards[] = /* Lucky Star Image World ConferenceTV */ {3, 1, 0, 2, 16777215, { 2, 3, 1, 1}, { 131072, 1, 1638400, 3, 4}}, /* Phoebe Tv Master + FM */ - { 3, 1, 0, 2, 0xc00, { 2, 3, 1, 1},{0, 1, 0x800, 0x400, 0xc00, 0}} + { 3, 1, 0, 2, 0xc00, { 2, 3, 1, 1},{0, 1, 0x800, 0x400, 0xc00, 0}}, + /* Modular Technology MM205 PCTV, bt878 */ + { 2, 1, 0, -1, 7, { 2, 3 }, { 0, 0, 0, 0, 0 }}, }; #define TVCARDS (sizeof(tvcards)/sizeof(tvcard)) @@ -2729,37 +2731,41 @@ static void idcard(int i) } /* board specific initialisations */ - if (btv->type == BTTV_MIRO || btv->type == BTTV_MIROPRO) { - /* auto detect tuner for MIRO cards */ - btv->tuner_type=((btread(BT848_GPIO_DATA)>>10)-1)&7; - } - if (btv->type == BTTV_HAUPPAUGE || btv->type == BTTV_HAUPPAUGE878) { - hauppauge_msp_reset(btv); - hauppauge_eeprom(&(btv->i2c)); - if (btv->type == BTTV_HAUPPAUGE878) { - /* all bt878 hauppauge boards use this ... */ + + switch(btv->type) + { + case BTTV_MIRO: + case BTTV_MIROPRO: + /* auto detect tuner for MIRO cards */ + btv->tuner_type=((btread(BT848_GPIO_DATA)>>10)-1)&7; + break; + + case BTTV_HAUPPAUGE: + case BTTV_HAUPPAUGE878: + hauppauge_msp_reset(btv); + hauppauge_eeprom(&(btv->i2c)); + if (btv->type == BTTV_HAUPPAUGE878) { + /* all bt878 hauppauge boards use this ... */ + btv->pll.pll_ifreq=28636363; + btv->pll.pll_crystal=BT848_IFORM_XT0; + } + break; + + case BTTV_CONFERENCETV: + btv->tuner_type = 1; + btv->pll.pll_ifreq=28636363; + btv->pll.pll_crystal=BT848_IFORM_XT0; + break; + + case BTTV_PIXVIEWPLAYTV: + case BTTV_AVERMEDIA98: + case BTTV_MODTEC_205: btv->pll.pll_ifreq=28636363; btv->pll.pll_crystal=BT848_IFORM_XT0; - } - } - - if (btv->type == BTTV_CONFERENCETV) { - btv->tuner_type = 1; - btv->pll.pll_ifreq=28636363; - btv->pll.pll_crystal=BT848_IFORM_XT0; - } - - if (btv->type == BTTV_PIXVIEWPLAYTV) { - btv->pll.pll_ifreq=28636363; - btv->pll.pll_crystal=BT848_IFORM_XT0; - } + break; - if(btv->type==BTTV_AVERMEDIA98) - { - btv->pll.pll_ifreq=28636363; - btv->pll.pll_crystal=BT848_IFORM_XT0; - } - + } + if (btv->have_tuner && btv->tuner_type != -1) i2c_control_device(&(btv->i2c), I2C_DRIVERID_TUNER, @@ -2864,6 +2870,9 @@ static void idcard(int i) case BTTV_PHOEBE_TVMAS: strcpy(btv->video_dev.name,"(Phoebe TV Master)"); break; + case BTTV_MODTEC_205: + strcpy(btv->video_dev.name,"(Modtec MM205)"); + break; } printk("%s\n",btv->video_dev.name); audio(btv, AUDIO_INTERN); diff --git a/drivers/char/bttv.h b/drivers/char/bttv.h index 3126cce57003..79096e51ded4 100644 --- a/drivers/char/bttv.h +++ b/drivers/char/bttv.h @@ -217,6 +217,7 @@ struct bttv #define BTTV_CEI_RAFFLES 0x14 #define BTTV_CONFERENCETV 0x15 #define BTTV_PHOEBE_TVMAS 0x16 +#define BTTV_MODTEC_205 0x17 #define AUDIO_TUNER 0x00 #define AUDIO_RADIO 0x01 diff --git a/drivers/char/serial.c b/drivers/char/serial.c index a87622c8e529..25d89c555b7f 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -44,6 +44,9 @@ * int rs_init(void); */ +static char *serial_version = "4.91"; +static char *serial_revdate = "1999-11-17"; + /* * Serial driver configuration section. Here are the various options: * @@ -88,8 +91,13 @@ #if (defined(CONFIG_PCI) && (LINUX_VERSION_CODE >= 131072)) #define ENABLE_SERIAL_PCI +#ifndef CONFIG_SERIAL_SHARE_IRQ #define CONFIG_SERIAL_SHARE_IRQ #endif +#ifndef CONFIG_SERIAL_MANY_PORTS +#define CONFIG_SERIAL_MANY_PORTS +#endif +#endif /* Set of debugging defines */ @@ -98,6 +106,7 @@ #undef SERIAL_DEBUG_FLOW #undef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT #undef SERIAL_DEBUG_PCI +#undef SERIAL_DEBUG_AUTOCONF /* Sanity checks */ @@ -119,10 +128,9 @@ #define RS_STROBE_TIME (10*HZ) #define RS_ISR_PASS_LIMIT 256 -#define IRQ_T(state) \ - ((state->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) - +#if (defined(__i386__) && (CPU==386 || CPU==486)) #define SERIAL_INLINE +#endif #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT) #define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ @@ -146,12 +154,14 @@ #ifdef MODVERSIONS #include #endif +#include #else /* !NEW_MODULES */ #ifdef MODVERSIONS #define MODULE #endif -#endif /* NEW_MODULES */ #include +#endif /* NEW_MODULES */ + #include #ifdef LOCAL_HEADERS #include "serial_local.h" @@ -160,7 +170,7 @@ #include #include #include -static char *serial_version = "4.30"; +#define LOCAL_VERSTRING "" #endif #include @@ -177,10 +187,11 @@ static char *serial_version = "4.30"; #include #include #include -#if (LINUX_VERSION_CODE >= 131343) /* 2.1.15 -- XX get correct version */ +#if (LINUX_VERSION_CODE >= 131343) #include -#else -#define __initfunc(x) x +#endif +#if (LINUX_VERSION_CODE >= 131336) +#include #endif #include #ifdef CONFIG_SERIAL_CONSOLE @@ -190,6 +201,14 @@ static char *serial_version = "4.30"; #include #endif +/* + * All of the compatibilty code so we can compile serial.c against + * older kernels is hidden in serial_compat.h + */ +#if (LINUX_VERSION_CODE < 0x020317) /* 2.3.23 */ +#include "serial_compat.h" +#endif + #include #include #include @@ -203,6 +222,8 @@ static char *serial_version = "4.30"; #ifdef SERIAL_INLINE #define _INLINE_ inline +#else +#define _INLINE_ #endif static char *serial_name = "Serial driver"; @@ -233,6 +254,7 @@ static struct rs_multiport_struct rs_multiport[NR_IRQS]; static int IRQ_timeout[NR_IRQS]; #ifdef CONFIG_SERIAL_CONSOLE static struct console sercons; +static unsigned long break_pressed; /* break, really ... */ #endif static unsigned detect_uart_irq (struct serial_state * state); @@ -274,7 +296,11 @@ static struct serial_state rs_table[RS_TABLE_SIZE] = { #define NR_PCI_BOARDS 8 static struct pci_board_inst serial_pci_board[NR_PCI_BOARDS]; static int serial_pci_board_idx = 0; +#ifdef PCI_NUM_RESOURCES #define PCI_BASE_ADDRESS(dev, r) ((dev)->resource[r].start) +#else +#define PCI_BASE_ADDRESS(dev, r) ((dev)->base_address[r]) +#endif #endif /* ENABLE_SERIAL_PCI */ static struct tty_struct *serial_table[NR_PORTS]; @@ -301,87 +327,6 @@ static DECLARE_MUTEX(tmp_buf_sem); static struct semaphore tmp_buf_sem = MUTEX; #endif -/* - * Provide backwards compatibility for kernels prior to 2.1.XX. - */ -#if (LINUX_VERSION_CODE < 0x20000) -typedef dev_t kdev_t; -#endif - -#if (LINUX_VERSION_CODE < 0x02017E) -static signed long schedule_timeout(signed long timeout) -{ - unsigned long expire; - - expire = timeout + jiffies; - - current->timeout = jiffies + timeout; - schedule(); - - timeout = expire - jiffies; - return timeout < 0 ? 0 : timeout; -} -#endif - -#ifndef time_after -#define time_after(a,b) ((long)(b) - (long)(a) < 0) -#endif - -#if (LINUX_VERSION_CODE < 0x020100) -static inline int irq_cannonicalize(int irq) -{ - return ((irq == 2) ? 9 : irq); -} -#endif - -#if (LINUX_VERSION_CODE < 131336) -static int copy_from_user(void *to, const void *from_user, unsigned long len) -{ - int error; - - error = verify_area(VERIFY_READ, from_user, len); - if (error) - return len; - memcpy_fromfs(to, from_user, len); - return 0; -} - -static int copy_to_user(void *to_user, const void *from, unsigned long len) -{ - int error; - - error = verify_area(VERIFY_WRITE, to_user, len); - if (error) - return len; - memcpy_tofs(to_user, from, len); - return 0; -} - -static inline int signal_pending(struct task_struct *p) -{ - return (p->signal & (~p->blocked != 0)); -} - -#else -#include -#endif - -#ifdef CAP_SYS_ADMIN -#define serial_isroot() (capable(CAP_SYS_ADMIN)) -#else -#define serial_isroot() (suser()) -#endif - -#if (LINUX_VERSION_CODE < 131394) /* 2.1.66 */ -#define test_and_clear_bit(x,y) clear_bit(x,y) - -static inline void remove_bh(int nr) -{ - bh_base[nr] = NULL; - bh_mask &= ~(1 << nr); -} -#endif - static inline int serial_paranoia_check(struct async_struct *info, kdev_t device, const char *routine) @@ -404,78 +349,63 @@ static inline int serial_paranoia_check(struct async_struct *info, return 0; } -static inline unsigned int serial_in(struct async_struct *info, int offset) +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset) { + switch (info->io_type) { #ifdef CONFIG_HUB6 - if (info->hub6) { - outb(info->hub6 - 1 + offset, info->port); - return inb(info->port+1); - } else + case SERIAL_IO_HUB6: + outb(info->hub6 - 1 + offset, info->port); + return inb(info->port+1); #endif #ifdef CONFIG_SERIAL_PCI_MEMMAPPED - if (info->iomem_base) - return readb(info->iomem_base + (offset<iomem_reg_shift)); - else + case SERIAL_IO_MEM: + return readb(info->iomem_base + + (offset<iomem_reg_shift)); #endif - return inb(info->port + offset); +#ifdef CONFIG_SERIAL_GSC + case SERIAL_IO_GSC: + return gsc_readb(info->iomem_base + offset); +#endif + default: + return inb(info->port + offset); + } } -static inline unsigned int serial_inp(struct async_struct *info, int offset) +static _INLINE_ void serial_out(struct async_struct *info, int offset, + int value) { + switch (info->io_type) { #ifdef CONFIG_HUB6 - if (info->hub6) { - outb(info->hub6 - 1 + offset, info->port); - return inb_p(info->port+1); - } else + case SERIAL_IO_HUB6: + outb(info->hub6 - 1 + offset, info->port); + outb(value, info->port+1); + break; #endif #ifdef CONFIG_SERIAL_PCI_MEMMAPPED - if (info->iomem_base) - return readb(info->iomem_base + (offset<iomem_reg_shift)); - else + case SERIAL_IO_MEM: + writeb(value, info->iomem_base + + (offset<iomem_reg_shift)); + break; #endif -#ifdef CONFIG_SERIAL_NOPAUSE_IO - return inb(info->port + offset); -#else - return inb_p(info->port + offset); +#ifdef CONFIG_SERIAL_GSC + case SERIAL_IO_GSC: + gsc_writeb(value, info->iomem_base + offset); + break; #endif + default: + outb(value, info->port+offset); + } } -static inline void serial_out(struct async_struct *info, int offset, int value) -{ -#ifdef CONFIG_HUB6 - if (info->hub6) { - outb(info->hub6 - 1 + offset, info->port); - outb(value, info->port+1); - } else -#endif -#ifdef CONFIG_SERIAL_PCI_MEMMAPPED - if (info->iomem_base) - writeb(value, info->iomem_base + (offset<iomem_reg_shift)); - else -#endif - outb(value, info->port+offset); -} +/* + * We used to support using pause I/O for certain machines. We + * haven't supported this for a while, but just in case it's badly + * needed for certain old 386 machines, I've left these #define's + * in.... + */ +#define serial_inp(info, offset) serial_in(info, offset) +#define serial_outp(info, offset, value) serial_out(info, offset, value) -static inline void serial_outp(struct async_struct *info, int offset, - int value) -{ -#ifdef CONFIG_HUB6 - if (info->hub6) { - outb(info->hub6 - 1 + offset, info->port); - outb_p(value, info->port+1); - } else -#endif -#ifdef CONFIG_SERIAL_PCI_MEMMAPPED - if (info->iomem_base) - writeb(value, info->iomem_base + (offset<iomem_reg_shift)); - else -#endif -#ifdef CONFIG_SERIAL_NOPAUSE_IO - outb(value, info->port+offset); -#else - outb_p(value, info->port+offset); -#endif -} /* * For the 16C950 @@ -579,7 +509,7 @@ static _INLINE_ void rs_sched_event(struct async_struct *info, } static _INLINE_ void receive_chars(struct async_struct *info, - int *status) + int *status, struct pt_regs * regs) { struct tty_struct *tty = info->tty; unsigned char ch; @@ -590,7 +520,7 @@ static _INLINE_ void receive_chars(struct async_struct *info, do { ch = serial_inp(info, UART_RX); if (tty->flip.count >= TTY_FLIPBUF_SIZE) - break; + goto ignore_char; *tty->flip.char_buf_ptr = ch; icount->rx++; @@ -628,6 +558,15 @@ static _INLINE_ void receive_chars(struct async_struct *info, if (*status & (UART_LSR_BI)) { #ifdef SERIAL_DEBUG_INTR printk("handling break...."); +#endif +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE) + if (info->line == sercons.index) { + if (!break_pressed) { + break_pressed = jiffies; + goto ignore_char; + } + break_pressed = 0; + } #endif *tty->flip.flag_buf_ptr = TTY_BREAK; if (info->flags & ASYNC_SAK) @@ -642,14 +581,25 @@ static _INLINE_ void receive_chars(struct async_struct *info, * reported immediately, and doesn't * affect the current character */ - if (tty->flip.count < TTY_FLIPBUF_SIZE) { - tty->flip.count++; - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - *tty->flip.flag_buf_ptr = TTY_OVERRUN; - } + tty->flip.count++; + tty->flip.flag_buf_ptr++; + tty->flip.char_buf_ptr++; + *tty->flip.flag_buf_ptr = TTY_OVERRUN; + if (tty->flip.count >= TTY_FLIPBUF_SIZE) + goto ignore_char; + } + } +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE) + if (break_pressed && info->line == sercons.index) { + if (ch != 0 && + time_before(jiffies, break_pressed + HZ*5)) { + handle_sysrq(ch, regs, NULL, NULL); + break_pressed = 0; + goto ignore_char; } + break_pressed = 0; } +#endif tty->flip.flag_buf_ptr++; tty->flip.char_buf_ptr++; tty->flip.count++; @@ -819,7 +769,7 @@ static void rs_interrupt(int irq, void *dev_id, struct pt_regs * regs) printk("status = %x...", status); #endif if (status & UART_LSR_DR) - receive_chars(info, &status); + receive_chars(info, &status, regs); check_modem_status(info); if (status & UART_LSR_THRE) transmit_chars(info, 0); @@ -883,7 +833,7 @@ static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) printk("status = %x...", status); #endif if (status & UART_LSR_DR) - receive_chars(info, &status); + receive_chars(info, &status, regs); check_modem_status(info); if (status & UART_LSR_THRE) transmit_chars(info, 0); @@ -946,7 +896,7 @@ static void rs_interrupt_multi(int irq, void *dev_id, struct pt_regs * regs) printk("status = %x...", status); #endif if (status & UART_LSR_DR) - receive_chars(info, &status); + receive_chars(info, &status, regs); check_modem_status(info); if (status & UART_LSR_THRE) transmit_chars(info, 0); @@ -1041,7 +991,7 @@ static void rs_timer(void) unsigned long flags; if ((jiffies - last_strobe) >= RS_STROBE_TIME) { - for (i=1; i < NR_IRQS; i++) { + for (i=0; i < NR_IRQS; i++) { info = IRQ_ports[i]; if (!info) continue; @@ -1228,7 +1178,7 @@ static int startup(struct async_struct * info) */ if (serial_inp(info, UART_LSR) == 0xff) { printk("LSR safety check engaged!\n"); - if (serial_isroot()) { + if (capable(CAP_SYS_ADMIN)) { if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); } else @@ -1243,7 +1193,7 @@ static int startup(struct async_struct * info) !IRQ_ports[state->irq]->next_port)) { if (IRQ_ports[state->irq]) { #ifdef CONFIG_SERIAL_SHARE_IRQ - free_irq(state->irq, NULL); + free_irq(state->irq, &IRQ_ports[state->irq]); #ifdef CONFIG_SERIAL_MULTIPORT if (rs_multiport[state->irq].port1) handler = rs_interrupt_multi; @@ -1257,10 +1207,10 @@ static int startup(struct async_struct * info) } else handler = rs_interrupt_single; - retval = request_irq(state->irq, handler, IRQ_T(state), - "serial", NULL); + retval = request_irq(state->irq, handler, SA_SHIRQ, + "serial", &IRQ_ports[state->irq]); if (retval) { - if (serial_isroot()) { + if (capable(CAP_SYS_ADMIN)) { if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); @@ -1409,15 +1359,16 @@ static void shutdown(struct async_struct * info) if (state->irq && (!IRQ_ports[state->irq] || !IRQ_ports[state->irq]->next_port)) { if (IRQ_ports[state->irq]) { - free_irq(state->irq, NULL); + free_irq(state->irq, &IRQ_ports[state->irq]); retval = request_irq(state->irq, rs_interrupt_single, - IRQ_T(state), "serial", NULL); + SA_SHIRQ, "serial", + &IRQ_ports[state->irq]); if (retval) printk("serial shutdown: request_irq: error %d" " Couldn't reacquire IRQ.\n", retval); } else - free_irq(state->irq, NULL); + free_irq(state->irq, &IRQ_ports[state->irq]); } if (info->xmit_buf) { @@ -1445,8 +1396,11 @@ static void shutdown(struct async_struct * info) serial_outp(info, UART_MCR, info->MCR); /* disable FIFO's */ - serial_outp(info, UART_FCR, (UART_FCR_CLEAR_RCVR | + serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO | + UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT)); + serial_outp(info, UART_FCR, 0); + (void)serial_in(info, UART_RX); /* read data port to reset things */ if (info->tty) @@ -1922,6 +1876,7 @@ static int get_serial_info(struct async_struct * info, tmp.closing_wait = state->closing_wait; tmp.custom_divisor = state->custom_divisor; tmp.hub6 = state->hub6; + tmp.io_type = state->io_type; if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) return -EFAULT; return 0; @@ -1944,7 +1899,7 @@ static int set_serial_info(struct async_struct * info, change_port = (new_serial.port != state->port) || (new_serial.hub6 != state->hub6); - if (!serial_isroot()) { + if (!capable(CAP_SYS_ADMIN)) { if (change_irq || change_port || (new_serial.baud_base != state->baud_base) || (new_serial.type != state->type) || @@ -1963,7 +1918,7 @@ static int set_serial_info(struct async_struct * info, new_serial.irq = irq_cannonicalize(new_serial.irq); - if ((new_serial.irq >= NR_IRQS) || (new_serial.port > 0xffff) || + if ((new_serial.irq >= NR_IRQS) || (new_serial.baud_base < 9600)|| (new_serial.type < PORT_UNKNOWN) || (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) || (new_serial.type == PORT_STARTECH)) { @@ -1973,7 +1928,7 @@ static int set_serial_info(struct async_struct * info, if ((new_serial.type != state->type) || (new_serial.xmit_fifo_size <= 0)) new_serial.xmit_fifo_size = - uart_config[state->type].dfl_xmit_fifo_size; + uart_config[new_serial.type].dfl_xmit_fifo_size; /* Make sure address is not already in use */ if (new_serial.type) { @@ -1998,17 +1953,17 @@ static int set_serial_info(struct async_struct * info, info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) | (info->flags & ASYNC_INTERNAL_FLAGS)); state->custom_divisor = new_serial.custom_divisor; - state->type = new_serial.type; state->close_delay = new_serial.close_delay * HZ/100; state->closing_wait = new_serial.closing_wait * HZ/100; -#if (LINUX_VERSION_CODE > 0x200100) +#if (LINUX_VERSION_CODE > 0x20100) info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; #endif info->xmit_fifo_size = state->xmit_fifo_size = new_serial.xmit_fifo_size; - if (state->type != PORT_UNKNOWN && state->port) + if ((state->type != PORT_UNKNOWN) && state->port) release_region(state->port,8); + state->type = new_serial.type; if (change_port || change_irq) { /* * We need to shutdown the serial port at the old @@ -2018,6 +1973,10 @@ static int set_serial_info(struct async_struct * info, state->irq = new_serial.irq; info->port = state->port = new_serial.port; info->hub6 = state->hub6 = new_serial.hub6; + if (info->hub6) + info->io_type = state->io_type = SERIAL_IO_HUB6; + else if (info->io_type == SERIAL_IO_HUB6) + info->io_type = state->io_type = SERIAL_IO_PORT; } if ((state->type != PORT_UNKNOWN) && state->port) request_region(state->port,8,"serial(set)"); @@ -2068,6 +2027,18 @@ static int get_lsr_info(struct async_struct * info, unsigned int *value) status = serial_in(info, UART_LSR); restore_flags(flags); result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); + + /* + * If we're about to load something into the transmit + * register, we'll pretend the transmitter isn't empty to + * avoid a race condition (depending on when the transmit + * interrupt happens). + */ + if (info->x_char || + ((info->xmit_cnt > 0) && !info->tty->stopped && + !info->tty->hw_stopped)) + result &= TIOCSER_TEMT; + if (copy_to_user(value, &result, sizeof(int))) return -EFAULT; return 0; @@ -2162,7 +2133,7 @@ static int do_autoconfig(struct async_struct * info) { int retval; - if (!serial_isroot()) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; if (info->state->count > 1) @@ -2265,7 +2236,7 @@ static int set_multiport_struct(struct async_struct * info, int retval; void (*handler)(int, void *, struct pt_regs *); - if (!serial_isroot()) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; state = info->state; @@ -2318,14 +2289,14 @@ static int set_multiport_struct(struct async_struct * info, if (IRQ_ports[state->irq]->next_port && (was_multi != now_multi)) { - free_irq(state->irq, NULL); + free_irq(state->irq, &IRQ_ports[state->irq]); if (now_multi) handler = rs_interrupt_multi; else handler = rs_interrupt; - retval = request_irq(state->irq, handler, IRQ_T(state), - "serial", NULL); + retval = request_irq(state->irq, handler, SA_SHIRQ, + "serial", &IRQ_ports[state->irq]); if (retval) { printk("Couldn't reallocate serial interrupt " "driver!!\n"); @@ -2652,7 +2623,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) info->tty = 0; if (info->blocked_open) { if (info->close_delay) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(info->close_delay); } wake_up_interruptible(&info->open_wait); @@ -2716,14 +2687,14 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...", lsr, jiffies); #endif - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); if (signal_pending(current)) break; if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); #endif @@ -2759,11 +2730,7 @@ static void rs_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct async_struct *info) { -#ifdef DECLARE_WAITQUEUE DECLARE_WAITQUEUE(wait, current); -#else - struct wait_queue wait = { current, NULL }; -#endif struct serial_state *state = info->state; int retval; int do_clocal = 0, extra_count = 0; @@ -2880,7 +2847,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, #endif schedule(); } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); remove_wait_queue(&info->open_wait, &wait); if (extra_count) state->count++; @@ -2912,14 +2879,13 @@ static int get_async_struct(int line, struct async_struct **ret_info) return -ENOMEM; } memset(info, 0, sizeof(struct async_struct)); -#ifdef DECLARE_WAITQUEUE init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); init_waitqueue_head(&info->delta_msr_wait); -#endif info->magic = SERIAL_MAGIC; info->port = sstate->port; info->flags = sstate->flags; + info->io_type = sstate->io_type; #ifdef CONFIG_SERIAL_PCI_MEMMAPPED info->iomem_base = sstate->iomem_base; info->iomem_reg_shift = sstate->iomem_reg_shift; @@ -3126,7 +3092,8 @@ int rs_read_proc(char *page, char **start, off_t off, int count, int i, len = 0, l; off_t begin = 0; - len += sprintf(page, "serinfo:1.0 driver:%s\n", serial_version); + len += sprintf(page, "serinfo:1.0 driver:%s%s revision:%s\n", + serial_version, LOCAL_VERSTRING, serial_revdate); for (i = 0; i < NR_PORTS && len < 4000; i++) { l = line_info(page + len, &rs_table[i]); len += l; @@ -3160,7 +3127,8 @@ done: */ static _INLINE_ void show_serial_version(void) { - printk(KERN_INFO "%s version %s with", serial_name, serial_version); + printk(KERN_INFO "%s version %s%s (%s) with", serial_name, + serial_version, LOCAL_VERSTRING, serial_revdate); #ifdef CONFIG_HUB6 printk(" HUB-6"); #define SERIAL_OPT @@ -3298,11 +3266,11 @@ static int size_fifo(struct async_struct *info) } /* - * This is a helper routine to autodetect StarTech/Exar UART's. When - * this function is called we know it is at least a StarTech 16650 V2, - * but it might be one of several StarTech UARTs, or one of its - * clones. (We treat the broken original StarTech 16650 V1 as a - * 16550A, and why not? Startech doesn't seem to even acknowledge its + * This is a helper routine to autodetect StarTech/Exar/Oxsemi UART's. + * When this function is called we know it is at least a StarTech + * 16650 V2, but it might be one of several StarTech UARTs, or one of + * its clones. (We treat the broken original StarTech 16650 V1 as a + * 16550, and why not? Startech doesn't seem to even acknowledge its * existence.) * * What evil have men's minds wrought... @@ -3311,39 +3279,48 @@ static void autoconfig_startech_uarts(struct async_struct *info, struct serial_state *state, unsigned long flags) { - unsigned char scratch, status1, status2, old_fctr, old_emsr; + unsigned char scratch, scratch2, scratch3; /* - * Here we check for the XR16C85x family. We do this by - * checking for to see if we can replace the scratch register - * with the receive FIFO count register. + * First we check to see if it's an Oxford Semiconductor UART. * - * XXX I don't have one of these chips, but it should also be - * possible to check for them by setting DLL and DLM to 0, and - * then reading back DLL and DLM. If the DLM reads back as - * 0x10, then the UART is a XR16C850 and the DLL contains the - * chip revision. + * If we have to do this here because some non-National + * Semiconductor clone chips lock up if you try writing to the + * LSR register (which serial_icr_read does) */ - old_fctr = serial_inp(info, UART_FCTR); - serial_outp(info, UART_FCTR, old_fctr | UART_FCTR_SCR_SWAP); - old_emsr = serial_inp(info, UART_EMSR); - serial_outp(info, UART_EMSR, 0x00); - serial_outp(info, UART_LCR, 0x00); - scratch = serial_in(info, UART_SCR); - serial_outp(info, UART_SCR, 0xa5); - status1 = serial_in(info, UART_SCR); - serial_outp(info, UART_SCR, 0x5a); - status2 = serial_in(info, UART_SCR); - serial_outp(info, UART_SCR, scratch); - if ((status1 != 0xa5) || (status2 != 0x5a)) { - serial_outp(info, UART_LCR, 0xBF); - serial_outp(info, UART_FCTR, old_fctr | UART_FCTR_SCR_SWAP); - serial_outp(info, UART_EMSR, old_emsr); - serial_outp(info, UART_FCTR, old_fctr); + if (state->type == PORT_16550A) { + /* Check for Oxford Semiconductor 16C950 */ + scratch = serial_icr_read(info, UART_ID1); + scratch2 = serial_icr_read(info, UART_ID2); + scratch3 = serial_icr_read(info, UART_ID3); + + if (scratch == 0x16 && scratch2 == 0xC9 && + (scratch3 == 0x50 || scratch3 == 0x52 || + scratch3 == 0x54)) { + state->type = PORT_16C950; + state->revision = serial_icr_read(info, UART_REV); + return; + } + } + + /* + * We check for a XR16C850 by setting DLL and DLM to 0, and + * then reading back DLL and DLM. If DLM reads back 0x10, + * then the UART is a XR16C850 and the DLL contains the chip + * revision. If DLM reads back 0x14, then the UART is a + * XR16C854. + * + */ + serial_outp(info, UART_LCR, UART_LCR_DLAB); + serial_outp(info, UART_DLL, 0); + serial_outp(info, UART_DLM, 0); + state->revision = serial_inp(info, UART_DLL); + scratch = serial_inp(info, UART_DLM); + serial_outp(info, UART_LCR, 0); + if (scratch == 0x10 || scratch == 0x14) { state->type = PORT_16850; return; } - serial_outp(info, UART_IER, old_fctr); /* * We distinguish between the '654 and the '650 by counting @@ -3368,10 +3345,16 @@ static void autoconfig_startech_uarts(struct async_struct *info, static void autoconfig(struct serial_state * state) { unsigned char status1, status2, scratch, scratch2, scratch3; + unsigned char save_lcr, save_mcr; struct async_struct *info, scr_info; unsigned long flags; state->type = PORT_UNKNOWN; + +#ifdef SERIAL_DEBUG_AUTOCONF + printk("Testing ttyS%d (0x%04x, 0x%04x)...\n", state->line, + state->port, (unsigned) state->iomem_base); +#endif if (!CONFIGURED_SERIAL_PORT(state)) return; @@ -3385,6 +3368,7 @@ static void autoconfig(struct serial_state * state) #ifdef CONFIG_HUB6 info->hub6 = state->hub6; #endif + info->io_type = state->io_type; #ifdef CONFIG_SERIAL_PCI_MEMMAPPED info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; @@ -3405,15 +3389,29 @@ static void autoconfig(struct serial_state * state) */ scratch = serial_inp(info, UART_IER); serial_outp(info, UART_IER, 0); +#ifdef __i386__ outb(0xff, 0x080); +#endif scratch2 = serial_inp(info, UART_IER); + serial_outp(info, UART_IER, 0x0F); +#ifdef __i386__ + outb(0, 0x080); +#endif + scratch3 = serial_inp(info, UART_IER); serial_outp(info, UART_IER, scratch); - if (scratch2) { + if (scratch2 || scratch3 != 0x0F) { +#ifdef SERIAL_DEBUG_AUTOCONF + printk("serial: ttyS%d: simple autoconfig failed\n", + state->line); +#endif restore_flags(flags); return; /* We failed; there's nothing here */ } } + save_mcr = serial_in(info, UART_MCR); + save_lcr = serial_in(info, UART_LCR); + /* * Check to see if a UART is really there. Certain broken * internal modems based on the Rockwell chipset fail this @@ -3424,18 +3422,18 @@ static void autoconfig(struct serial_state * state) * that conflicts with COM 1-4 --- we hope! */ if (!(state->flags & ASYNC_SKIP_TEST)) { - scratch = serial_inp(info, UART_MCR); - serial_outp(info, UART_MCR, UART_MCR_LOOP | scratch); serial_outp(info, UART_MCR, UART_MCR_LOOP | 0x0A); status1 = serial_inp(info, UART_MSR) & 0xF0; - serial_outp(info, UART_MCR, scratch); + serial_outp(info, UART_MCR, save_mcr); if (status1 != 0x90) { +#ifdef SERIAL_DEBUG_AUTOCONF + printk("serial: ttyS%d: no UART loopback failed\n", + state->line); +#endif restore_flags(flags); return; } - } - - scratch2 = serial_in(info, UART_LCR); + } serial_outp(info, UART_LCR, 0xBF); /* set up for StarTech test */ serial_outp(info, UART_EFR, 0); /* EFR is the same as FCR */ serial_outp(info, UART_LCR, 0); @@ -3455,21 +3453,6 @@ static void autoconfig(struct serial_state * state) state->type = PORT_16550A; break; } - if (state->type == PORT_16550A) { - /* Check for Oxford Semiconductor 16C950 */ - unsigned char scratch4; - - scratch = serial_icr_read(info, UART_ID1); - scratch4 = serial_icr_read(info, UART_ID2); - scratch3 = serial_icr_read(info, UART_ID3); - - if (scratch == 0x16 && scratch4 == 0xC9 && - (scratch3 == 0x50 || scratch3 == 0x52 || - scratch3 == 0x54)) { - state->type = PORT_16C950; - state->revision = serial_icr_read(info, UART_REV); - } - } if (state->type == PORT_16550A) { /* Check for Startech UART's */ serial_outp(info, UART_LCR, UART_LCR_DLAB); @@ -3483,7 +3466,7 @@ static void autoconfig(struct serial_state * state) } if (state->type == PORT_16550A) { /* Check for TI 16750 */ - serial_outp(info, UART_LCR, scratch2 | UART_LCR_DLAB); + serial_outp(info, UART_LCR, save_lcr | UART_LCR_DLAB); serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); scratch = serial_in(info, UART_IIR) >> 5; @@ -3504,7 +3487,7 @@ static void autoconfig(struct serial_state * state) } serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO); } - serial_outp(info, UART_LCR, scratch2); + serial_outp(info, UART_LCR, save_lcr); if (state->type == PORT_16450) { scratch = serial_in(info, UART_SCR); serial_outp(info, UART_SCR, 0xa5); @@ -3529,9 +3512,11 @@ static void autoconfig(struct serial_state * state) /* * Reset the UART. */ - serial_outp(info, UART_MCR, 0x00 | ALPHA_KLUDGE_MCR); /* Don't ask */ - serial_outp(info, UART_FCR, (UART_FCR_CLEAR_RCVR | + serial_outp(info, UART_MCR, save_mcr); + serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO | + UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT)); + serial_outp(info, UART_FCR, 0); (void)serial_in(info, UART_RX); serial_outp(info, UART_IER, 0); @@ -3562,11 +3547,11 @@ static struct symbol_table serial_syms = { * * Note that __init is a no-op if MODULE is defined; we depend on this. */ -static void __init pci_plx9050_fn(struct pci_dev *dev, +static int __init pci_plx9050_fn(struct pci_dev *dev, struct pci_board *board, int enable) { - u8 data, *p; + u8 data, *p, scratch; pci_read_config_byte(dev, PCI_COMMAND, &data); @@ -3576,12 +3561,94 @@ static void __init pci_plx9050_fn(struct pci_dev *dev, /* enable/disable interrupts */ p = ioremap(PCI_BASE_ADDRESS(dev, 0), 0x80); - writel(enable ? 0x41 : 0x00, p + 0x4c); + if (board->vendor == PCI_VENDOR_ID_PANACOM) { + scratch = readl(p + 0x4c); + if (enable) + scratch |= 0x40; + else + scratch &= ~0x40; + writel(scratch, p + 0x4c); + } else + writel(enable ? 0x41 : 0x00, p + 0x4c); iounmap(p); if (!enable) pci_write_config_byte(dev, PCI_COMMAND, data & ~PCI_COMMAND_MEMORY); + return 0; +} + +/* + * SIIG serial cards have an PCI interface chip which also controls + * the UART clocking frequency. Each UART can be clocked independently + * (except cards equiped with 4 UARTs) and initial clocking settings + * are stored in the EEPROM chip. It can cause problems because this + * version of serial driver doesn't support differently clocked UART's + * on single PCI card. To prevent this, initialization functions set + * high frequency clocking for all UART's on given card. It is safe (I + * hope) because it doesn't touch EEPROM settings to prevent conflicts + * with other OSes (like M$ DOS). + * + * SIIG support added by Andrey Panin , 10/1999 + * + * There is two family of SIIG serial cards with different PCI + * interface chip and different configuration methods: + * - 10x cards have control registers in IO and/or memory space; + * - 20x cards have control registers in standard PCI configuration space. + */ + +#define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc) +#define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8) + +static int __init pci_siig10x_fn(struct pci_dev *dev, + struct pci_board *board, + int enable) +{ + u16 data, *p; + + if (!enable) return 0; + + p = ioremap(PCI_BASE_ADDRESS(dev, 0), 0x80); + + switch (dev->device & 0xfff8) { + case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */ + data = 0xffdf; + break; + case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */ + data = 0xf7ff; + break; + default: /* 1S1P, 4S */ + data = 0xfffb; + break; + } + + writew(readw(p + 0x28) & data, p + 0x28); + iounmap(p); + return 0; +} + +#define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc) +#define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc) + +static int __init pci_siig20x_fn(struct pci_dev *dev, + struct pci_board *board, + int enable) +{ + u8 data; + + if (!enable) return 0; + + /* Change clock frequency for the first UART. */ + pci_read_config_byte(dev, 0x6f, &data); + pci_write_config_byte(dev, 0x6f, data & 0xef); + + /* If this card has 2 UART, we have to do the same with second UART. */ + if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) || + ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) { + pci_read_config_byte(dev, 0x73, &data); + pci_write_config_byte(dev, 0x73, data & 0xef); + } + return 0; } /* @@ -3592,9 +3659,9 @@ static struct pci_board pci_boards[] = { /* * Vendor ID, Device ID, * Subvendor ID, Subdevice ID, - * Number of Ports, Base (Maximum) Baud Rate, - * Offset of register holding Uart register offset - * Mask to apply to above register's value + * PCI Flags, Number of Ports, Base (Maximum) Baud Rate, + * Offset to get to next UART's registers + * Register shift to use for memory-mapped I/O */ { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960, PCI_SUBVENDOR_ID_CONNECT_TECH, @@ -3677,7 +3744,7 @@ static struct pci_board pci_boards[] = { SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 115200 }, { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8, PCI_ANY_ID, PCI_ANY_ID, - SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 8, 115200 }, + SPCI_FL_BASE2, 8, 115200 }, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2, PCI_ANY_ID, PCI_ANY_ID, SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 115200 }, @@ -3691,12 +3758,226 @@ static struct pci_board pci_boards[] = { 0x400, 7, pci_plx9050_fn }, { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM, PCI_ANY_ID, PCI_ANY_ID, - SPCI_FL_BASE2 | SPCI_FL_IOMEM, 4, 921600, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600, 0x400, 7, pci_plx9050_fn }, { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM, PCI_ANY_ID, PCI_ANY_ID, - SPCI_FL_BASE2 | SPCI_FL_IOMEM, 2, 921600, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, 0x400, 7, pci_plx9050_fn }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIFAST, + PCI_SUBDEVICE_ID_CHASE_PCIFAST4, + SPCI_FL_BASE2, 4, 460800 }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIFAST, + PCI_SUBDEVICE_ID_CHASE_PCIFAST8, + SPCI_FL_BASE2, 8, 460800 }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIFAST, + PCI_SUBDEVICE_ID_CHASE_PCIFAST16, + SPCI_FL_BASE2, 16, 460800 }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIFAST, + PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, + SPCI_FL_BASE2, 16, 460800 }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIRAS, + PCI_SUBDEVICE_ID_CHASE_PCIRAS4, + SPCI_FL_BASE2, 4, 460800 }, + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + PCI_SUBVENDOR_ID_CHASE_PCIRAS, + PCI_SUBDEVICE_ID_CHASE_PCIRAS8, + SPCI_FL_BASE2, 8, 460800 }, + { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 4, 115200 }, + { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 2, 115200 }, + { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 8, 115200 }, + { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 8, 115200 }, + { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954, + PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4, + SPCI_FL_BASE0 , 4, 115200 }, + { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954, + PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4, + SPCI_FL_BASE0 , 4, 921600 }, + { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 , 2, 921600 }, + { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_SERIAL, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 460800, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 460800, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 460800, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2, 1, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig10x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0, 1, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig20x_fn }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 921600, + 0, 0, pci_siig20x_fn }, + /* Computone devices submitted by Doug McNash dmcnash@computone.com */ + { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG, + PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4, + SPCI_FL_IOMEM | SPCI_FL_BASE0, 4, 921600, + 0x40, 2, NULL, 0x200 }, + { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG, + PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8, + SPCI_FL_IOMEM | SPCI_FL_BASE0, 8, 921600, + 0x40, 2, NULL, 0x200 }, + { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG, + PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6, + SPCI_FL_IOMEM | SPCI_FL_BASE0, 6, 921600, + 0x40, 2, NULL, 0x200 }, + /* + * Untested PCI modems, sent in from various folks... + */ + /* at+t zoom 56K faxmodem, from dougd@shieldsbag.com */ + { PCI_VENDOR_ID_ATT, 0x442, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 1, 115200 }, + /* at&t unknown modem, from jimd@esoft.com */ + { PCI_VENDOR_ID_ATT, 0x480, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 1, 115200 }, + /* Elsa Model 56K PCI Modem, from Andreas Rath */ + { PCI_VENDOR_ID_ROCKWELL, 0x1004, + 0x1048, 0x1500, + SPCI_FL_BASE1, 1, 115200 }, + /* 3Com US Robotics 56k* Voice Internal PCI, model# 2884 */ + /* from evidal@iti.upv.es */ + /* XXX complete guess this may not work!!! */ + { PCI_VENDOR_ID_USR, 0x1006, + 0x12b9, 0x0060, + SPCI_FL_BASE1 | SPCI_FL_IOMEM, 1, 115200 }, { 0, } }; @@ -3767,18 +4048,22 @@ static void probe_serial_pci(void) * Run the initialization function, if any */ if (board->init_fn) - (board->init_fn)(dev, board, 1); + if ((board->init_fn)(dev, board, 1) != 0) + continue; /* * Register the serial board in the array so we can * shutdown the board later, if necessary. */ + if (serial_pci_board_idx >= NR_PCI_BOARDS) + continue; serial_pci_board[serial_pci_board_idx].board = board; serial_pci_board[serial_pci_board_idx].dev = dev; serial_pci_board_idx++; base_idx = board->flags & SPCI_FL_BASE_MASK; - port = PCI_BASE_ADDRESS(dev, base_idx); + port = PCI_BASE_ADDRESS(dev, base_idx) + + board->first_uart_offset; if (board->flags & SPCI_FL_IOMEM) port &= PCI_BASE_ADDRESS_MEM_MASK; else @@ -3829,6 +4114,7 @@ static void probe_serial_pci(void) fake_state.port = port; #ifdef CONFIG_SERIAL_PCI_MEMMAPPED if (board->flags & SPCI_FL_IOMEM) { + fake_state.io_type = SERIAL_IO_MEM; fake_state.iomem_base = ioremap(port, board->uart_offset); fake_state.iomem_reg_shift = board->reg_shift; @@ -3869,6 +4155,16 @@ int __init rs_init(void) dualsp_serial_init (); #endif + if (timer_table[RS_TIMER].fn) { + printk("RS_TIMER already set, another serial driver " + "already loaded?\n"); +#ifdef MODULE + printk("Can't load serial driver module over built-in " + "serial driver\n"); +#endif + return -EBUSY; + } + init_bh(SERIAL_BH, do_serial_bh); timer_table[RS_TIMER].fn = rs_timer; timer_table[RS_TIMER].expires = 0; @@ -3974,6 +4270,8 @@ int __init rs_init(void) state->icount.frame = state->icount.parity = 0; state->icount.overrun = state->icount.brk = 0; state->irq = irq_cannonicalize(state->irq); + if (state->hub6) + state->io_type = SERIAL_IO_HUB6; if (state->port && check_region(state->port,8)) continue; if (state->flags & ASYNC_BOOT_AUTOCONF) @@ -4035,10 +4333,13 @@ int register_serial(struct serial_struct *req) state->irq = req->irq; state->port = req->port; state->flags = req->flags; + state->io_type = req->io_type; #ifdef CONFIG_SERIAL_PCI_MEMMAPPED state->iomem_base = req->iomem_base; state->iomem_reg_shift = req->iomem_reg_shift; #endif + if (req->baud_base) + state->baud_base = req->baud_base; autoconfig(state); if (state->type == PORT_UNKNOWN) { @@ -4103,13 +4404,12 @@ void cleanup_module(void) restore_flags(flags); for (i = 0; i < NR_PORTS; i++) { + if ((info = rs_table[i].info)) { + rs_table[i].info = NULL; + kfree_s(info, sizeof(struct async_struct)); + } if ((rs_table[i].type != PORT_UNKNOWN) && rs_table[i].port) release_region(rs_table[i].port, 8); - info = rs_table[i].info; - if (info) { - rs_table[i].info = NULL; - kfree_s(info, sizeof(struct async_struct)); - } #if defined(ENABLE_SERIAL_PCI) && defined (CONFIG_SERIAL_PCI_MEMMAPPED) if (rs_table[i].iomem_base) iounmap(rs_table[i].iomem_base); @@ -4140,20 +4440,20 @@ void cleanup_module(void) #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) +static struct async_struct async_sercons; + /* * Wait for transmitter & holding register to empty */ -static inline void wait_for_xmitr(struct serial_state *ser) +static inline void wait_for_xmitr(struct async_struct *info) { - int lsr; unsigned int tmout = 1000000; - do { - lsr = inb(ser->port + UART_LSR); - if (--tmout == 0) break; - } while ((lsr & BOTH_EMPTY) != BOTH_EMPTY); + while (--tmout && + ((serial_in(info, UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)); } + /* * Print a string to the serial port trying not to disturb * any possible real use of the port... @@ -4161,31 +4461,30 @@ static inline void wait_for_xmitr(struct serial_state *ser) static void serial_console_write(struct console *co, const char *s, unsigned count) { - struct serial_state *ser; + static struct async_struct *info = &async_sercons; int ier; unsigned i; - ser = rs_table + co->index; /* * First save the IER then disable the interrupts */ - ier = inb(ser->port + UART_IER); - outb(0x00, ser->port + UART_IER); + ier = serial_in(info, UART_IER); + serial_out(info, UART_IER, 0x00); /* * Now, do each character */ for (i = 0; i < count; i++, s++) { - wait_for_xmitr(ser); + wait_for_xmitr(info); /* * Send the character out. * If a LF, also do CR... */ - outb(*s, ser->port + UART_TX); + serial_out(info, UART_TX, *s); if (*s == 10) { - wait_for_xmitr(ser); - outb(13, ser->port + UART_TX); + wait_for_xmitr(info); + serial_out(info, UART_TX, 13); } } @@ -4193,8 +4492,8 @@ static void serial_console_write(struct console *co, const char *s, * Finally, Wait for transmitter & holding register to empty * and restore the IER */ - wait_for_xmitr(ser); - outb(ier, ser->port + UART_IER); + wait_for_xmitr(info); + serial_out(info, UART_IER, ier); } /* @@ -4202,30 +4501,26 @@ static void serial_console_write(struct console *co, const char *s, */ static int serial_console_wait_key(struct console *co) { - struct serial_state *ser; - int ier; - int lsr; - int c; + static struct async_struct *info; + int ier, c; - ser = rs_table + co->index; + info = &async_sercons; /* * First save the IER then disable the interrupts so * that the real driver for the port does not get the * character. */ - ier = inb(ser->port + UART_IER); - outb(0x00, ser->port + UART_IER); - - do { - lsr = inb(ser->port + UART_LSR); - } while (!(lsr & UART_LSR_DR)); - c = inb(ser->port + UART_RX); + ier = serial_in(info, UART_IER); + serial_out(info, UART_IER, 0x00); + + while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0); + c = serial_in(info, UART_RX); /* * Restore the interrupts */ - outb(ier, ser->port + UART_IER); + serial_out(info, UART_IER, ier); return c; } @@ -4243,7 +4538,8 @@ static kdev_t serial_console_device(struct console *c) */ static int __init serial_console_setup(struct console *co, char *options) { - struct serial_state *ser; + static struct async_struct *info; + struct serial_state *state; unsigned cval; int baud = 9600; int bits = 8; @@ -4251,6 +4547,9 @@ static int __init serial_console_setup(struct console *co, char *options) int cflag = CREAD | HUPCL | CLOCAL; int quot = 0; char *s; +#if defined(CONFIG_KDB) + extern int kdb_port; +#endif if (options) { baud = simple_strtoul(options, NULL, 10); @@ -4313,8 +4612,21 @@ static int __init serial_console_setup(struct console *co, char *options) /* * Divisor, bytesize and parity */ - ser = rs_table + co->index; - quot = ser->baud_base / baud; + state = rs_table + co->index; + info = &async_sercons; + info->magic = SERIAL_MAGIC; + info->state = state; + info->port = state->port; + info->flags = state->flags; +#ifdef CONFIG_HUB6 + info->hub6 = state->hub6; +#endif + info->io_type = state->io_type; +#ifdef CONFIG_SERIAL_PCI_MEMMAPPED + info->iomem_base = state->iomem_base; + info->iomem_reg_shift = state->iomem_reg_shift; +#endif + quot = state->baud_base / baud; cval = cflag & (CSIZE | CSTOPB); #if defined(__powerpc__) || defined(__alpha__) cval >>= 8; @@ -4330,18 +4642,27 @@ static int __init serial_console_setup(struct console *co, char *options) * Disable UART interrupts, set DTR and RTS high * and set speed. */ - outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */ - outb(quot & 0xff, ser->port + UART_DLL); /* LS of divisor */ - outb(quot >> 8, ser->port + UART_DLM); /* MS of divisor */ - outb(cval, ser->port + UART_LCR); /* reset DLAB */ - outb(0, ser->port + UART_IER); - outb(UART_MCR_DTR | UART_MCR_RTS, ser->port + UART_MCR); + serial_out(info, UART_LCR, cval | UART_LCR_DLAB); /* set DLAB */ + serial_out(info, UART_DLL, quot & 0xff); /* LS of divisor */ + serial_out(info, UART_DLM, quot >> 8); /* MS of divisor */ + serial_out(info, UART_LCR, cval); /* reset DLAB */ + serial_out(info, UART_IER, 0); + serial_out(info, UART_MCR, UART_MCR_DTR | UART_MCR_RTS); /* * If we read 0xff from the LSR, there is no UART here. */ - if (inb(ser->port + UART_LSR) == 0xff) + if (serial_in(info, UART_LSR) == 0xff) return -1; + +#if defined(CONFIG_KDB) + /* + * Remember I/O port for kdb + */ + if (kdb_port == 0 ) + kdb_port = ser->port; +#endif /* CONFIG_KDB */ + return 0; } diff --git a/drivers/char/tuner.c b/drivers/char/tuner.c index bb8dd3a7be23..01bfdea068ad 100644 --- a/drivers/char/tuner.c +++ b/drivers/char/tuner.c @@ -96,6 +96,12 @@ static struct tunertype tuners[] = { 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,0xc2,732}, {"Alps TSBE1",TEMIC,PAL, 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,0xc2,732}, + {"Alps TSBB5", Alps, PAL_I, /* tested (UK UHF) with Modtec MM205 */ + 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,0xc0,632}, + {"Alps TSBE5", Alps, PAL,/* untested - data sheet guess. Only IF differs. */ + 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,0xc0,622}, + {"Alps TSBC5", Alps, PAL,/* untested - data sheet guess. Only IF differs. */ + 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,0xc0,608}, }; /* ---------------------------------------------------------------------- */ diff --git a/drivers/char/tuner.h b/drivers/char/tuner.h index f5c8edc2d996..96fcd3021b4b 100644 --- a/drivers/char/tuner.h +++ b/drivers/char/tuner.h @@ -31,7 +31,11 @@ #define TUNER_TEMIC_NTSC 6 #define TUNER_TEMIC_PAL_I 7 #define TUNER_TEMIC_4036FY5_NTSC 8 -#define TUNER_ALPS_TSBH1_NTSC 9 +#define TUNER_ALPS_TSBH1_NTSC 9 +#define TUNER_ALPS_TSBE1_PAL 10 +#define TUNER_ALPS_TSBB5_PAL_I 11 +#define TUNER_ALPS_TSBE5_PAL 12 +#define TUNER_ALPS_TSBC5_PAL 13 #define NOTUNER 0 #define PAL 1 @@ -43,6 +47,7 @@ #define Philips 1 #define TEMIC 2 #define Sony 3 +#define Alps 4 #define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ #define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */ diff --git a/drivers/isdn/Config.in b/drivers/isdn/Config.in index 98b11349a4b8..2081f12fe68b 100644 --- a/drivers/isdn/Config.in +++ b/drivers/isdn/Config.in @@ -13,8 +13,8 @@ if [ "$CONFIG_ISDN_AUDIO" != "n" ]; then bool ' Support AT-Fax Class 2 commands' CONFIG_ISDN_TTY_FAX fi bool ' Support isdn diversion services' CONFIG_ISDN_DIVERSION -if [ "$CONFIG_X25" != "n" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool ' X.25 PLP on top of ISDN (EXPERIMENTAL)' CONFIG_ISDN_X25 +if [ "$CONFIG_X25" != "n" ]; then + bool ' X.25 PLP on top of ISDN' CONFIG_ISDN_X25 fi dep_tristate ' ICN 2B and 4B support' CONFIG_ISDN_DRV_ICN $CONFIG_ISDN dep_tristate ' isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN @@ -52,15 +52,15 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then bool ' HiSax Support for Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO bool ' HiSax Support for Gazel cards' CONFIG_HISAX_GAZEL bool ' HiSax Support for HFC PCI-Bus cards' CONFIG_HISAX_HFC_PCI - if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool ' HiSax Support for Winbond W6692 based cards (EXPERIMENTAL)' CONFIG_HISAX_W6692 + bool ' HiSax Support for Winbond W6692 based cards' CONFIG_HISAX_W6692 + if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then # bool ' HiSax Support for TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then bool ' HiSax Support for Am7930' CONFIG_HISAX_AMD7930 fi fi fi -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then +if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then dep_tristate ' Spellcaster support (EXPERIMENTAL)' CONFIG_ISDN_DRV_SC $CONFIG_ISDN dep_tristate ' IBM Active 2000 support (EXPERIMENTAL)' CONFIG_ISDN_DRV_ACT2000 $CONFIG_ISDN fi diff --git a/drivers/isdn/avmb1/capi.c b/drivers/isdn/avmb1/capi.c index 6d1159d5617a..c214b0b28dab 100644 --- a/drivers/isdn/avmb1/capi.c +++ b/drivers/isdn/avmb1/capi.c @@ -1,11 +1,14 @@ /* - * $Id: capi.c,v 1.21 1999/09/10 17:24:18 calle Exp $ + * $Id: capi.c,v 1.22 1999/11/13 21:27:16 keil Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capi.c,v $ + * Revision 1.22 1999/11/13 21:27:16 keil + * remove KERNELVERSION + * * Revision 1.21 1999/09/10 17:24:18 calle * Changes for proposed standard for CAPI2.0: * - AK148 "Linux Exention" @@ -282,20 +285,13 @@ static unsigned int capi_poll(struct file *file, poll_table * wait) { unsigned int mask = 0; -#if (LINUX_VERSION_CODE >= 0x02012d) unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); -#else - unsigned int minor = MINOR(file->f_inode->i_rdev); -#endif struct capidev *cdev; if (!minor || minor > CAPI_MAXMINOR || !capidevs[minor].is_registered) return POLLERR; cdev = &capidevs[minor]; -#if (LINUX_VERSION_CODE < 0x020159) /* 2.1.89 */ -#define poll_wait(f,wq,w) poll_wait((wq),(w)) -#endif poll_wait(file, &(cdev->recv_wait), wait); mask = POLLOUT | POLLWRNORM; if (!skb_queue_empty(&cdev->recv_queue)) @@ -523,9 +519,7 @@ static struct file_operations capi_fops = capi_ioctl, NULL, /* capi_mmap */ capi_open, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,118) NULL, /* capi_flush */ -#endif capi_release, NULL, /* capi_fsync */ NULL, /* capi_fasync */ diff --git a/drivers/isdn/avmb1/compat.h b/drivers/isdn/avmb1/compat.h deleted file mode 100644 index 15f4715596fe..000000000000 --- a/drivers/isdn/avmb1/compat.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * $Id: compat.h,v 1.4 1998/10/25 14:39:02 fritz Exp $ - * - * Headerfile for Compartibility between different kernel versions - * - * (c) Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) - * - * $Log: compat.h,v $ - * Revision 1.4 1998/10/25 14:39:02 fritz - * Backported from MIPS (Cobalt). - * - * Revision 1.3 1997/11/04 06:12:15 calle - * capi.c: new read/write in file_ops since 2.1.60 - * capidrv.c: prepared isdnlog interface for d2-trace in newer firmware. - * capiutil.c: needs config.h (CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON) - * compat.h: added #define LinuxVersionCode - * - * Revision 1.2 1997/10/01 09:21:22 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.1 1997/03/04 21:50:36 calle - * Frirst version in isdn4linux - * - * Revision 2.2 1997/02/12 09:31:39 calle - * new version - * - * Revision 1.1 1997/01/31 10:32:20 calle - * Initial revision - * - * - */ -#ifndef __COMPAT_H__ -#define __COMPAT_H__ - -#include -#include -#include - -#ifndef LinuxVersionCode -#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) -#endif - -#endif /* __COMPAT_H__ */ diff --git a/drivers/isdn/avmb1/t1pci.c b/drivers/isdn/avmb1/t1pci.c index ad73e71cde04..d77340bffa20 100644 --- a/drivers/isdn/avmb1/t1pci.c +++ b/drivers/isdn/avmb1/t1pci.c @@ -1,11 +1,14 @@ /* - * $Id: t1pci.c,v 1.2 1999/11/05 16:38:02 calle Exp $ + * $Id: t1pci.c,v 1.3 1999/11/13 21:27:16 keil Exp $ * * Module for AVM T1 PCI-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: t1pci.c,v $ + * Revision 1.3 1999/11/13 21:27:16 keil + * remove KERNELVERSION + * * Revision 1.2 1999/11/05 16:38:02 calle * Cleanups before kernel 2.4: * - Changed all messages to use card->name or driver->name instead of @@ -30,13 +33,12 @@ #include #include #include -#include "compat.h" #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.2 $"; +static char *revision = "$Revision: 1.3 $"; #undef CONFIG_T1PCI_DEBUG #undef CONFIG_T1PCI_POLLDEBUG diff --git a/drivers/isdn/eicon/eicon_isa.h b/drivers/isdn/eicon/eicon_isa.h index 92f67a1ec222..b0d0b0eb9e1c 100644 --- a/drivers/isdn/eicon/eicon_isa.h +++ b/drivers/isdn/eicon/eicon_isa.h @@ -1,4 +1,4 @@ -/* $Id: eicon_isa.h,v 1.5 1999/09/08 20:17:31 armin Exp $ +/* $Id: eicon_isa.h,v 1.6 1999/11/15 19:37:04 keil Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * @@ -21,6 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_isa.h,v $ + * Revision 1.6 1999/11/15 19:37:04 keil + * need config.h + * * Revision 1.5 1999/09/08 20:17:31 armin * Added microchannel patch from Erik Weber. * diff --git a/drivers/isdn/eicon/eicon_mod.c b/drivers/isdn/eicon/eicon_mod.c index 2cad8a504a5f..8797e6aed3f2 100644 --- a/drivers/isdn/eicon/eicon_mod.c +++ b/drivers/isdn/eicon/eicon_mod.c @@ -1,4 +1,4 @@ -/* $Id: eicon_mod.c,v 1.18 1999/10/11 18:13:25 armin Exp $ +/* $Id: eicon_mod.c,v 1.19 1999/11/12 13:21:44 armin Exp $ * * ISDN lowlevel-module for Eicon.Diehl active cards. * @@ -31,6 +31,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_mod.c,v $ + * Revision 1.19 1999/11/12 13:21:44 armin + * Bugfix of undefined reference with CONFIG_MCA + * * Revision 1.18 1999/10/11 18:13:25 armin * Added fax capabilities for Eicon Diva Server cards. * @@ -120,7 +123,7 @@ static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains start of card-list */ -static char *eicon_revision = "$Revision: 1.18 $"; +static char *eicon_revision = "$Revision: 1.19 $"; extern char *eicon_pci_revision; extern char *eicon_isa_revision; @@ -1382,7 +1385,7 @@ eicon_init(void) printk(KERN_INFO "eicon: No MCA bus, ISDN-interfaces not probed.\n"); } else { - eicon_log(card, 8, + eicon_log(NULL, 8, "eicon_mca_find_card, irq=%d.\n", irq); if (!eicon_mca_find_card(0, membase, irq, id)) @@ -1511,7 +1514,7 @@ int eicon_mca_find_card(int type, /* type-idx of eicon-card */ { int j, curr_slot = 0; - eicon_log(card, 8, + eicon_log(NULL, 8, "eicon_mca_find_card type: %d, membase: %#x, irq %d \n", type, membase, irq); /* find a no-driver-assigned eicon card */ @@ -1578,7 +1581,7 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ int irq_array1[]={3,4,0,0,2,10,11,12}; adf_pos0 = mca_read_stored_pos(slot,2); - eicon_log(card, 8, + eicon_log(NULL, 8, "eicon_mca_probe irq=%d, membase=%d\n", irq, membase); @@ -1636,7 +1639,7 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ default: return ENODEV; }; - /* Uebereinstimmung vorgegebener membase & irq */ + /* matching membase & irq */ if ( 1 == eicon_addcard(type, membase, irq, id)) { mca_set_adapter_name(slot, eicon_mca_adapters[a_idx].name); mca_set_adapter_procfn(slot, (MCA_ProcFn) eicon_info, cards); @@ -1649,9 +1652,9 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ /* reset card */ outb_p(0,cards_io+1); - eicon_log(card, 8, "eicon_addcard: successful for slot # %d.\n", + eicon_log(NULL, 8, "eicon_addcard: successful for slot # %d.\n", cards->mca_slot+1); - return 0 ; /* eicon_addcard hat eine Karte zugefuegt */ + return 0 ; /* eicon_addcard added a card */ } else { return ENODEV; }; diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 230628486bbc..0c67d5c4a213 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1,8 +1,11 @@ -/* $Id: hisax.h,v 2.37 1999/10/14 20:25:28 keil Exp $ +/* $Id: hisax.h,v 2.38 1999/11/14 23:37:03 keil Exp $ * Basic declarations, defines and prototypes * * $Log: hisax.h,v $ + * Revision 2.38 1999/11/14 23:37:03 keil + * new ISA memory mapped IO + * * Revision 2.37 1999/10/14 20:25:28 keil * add a statistic for error monitoring * @@ -663,7 +666,8 @@ struct teles3_hw { struct teles0_hw { unsigned int cfg_reg; - unsigned int membase; + unsigned long membase; + unsigned long phymem; }; struct avm_hw { @@ -803,8 +807,9 @@ struct hfcD_hw { struct isurf_hw { unsigned int reset; - unsigned int isac; - unsigned int isar; + unsigned long phymem; + unsigned long isac; + unsigned long isar; struct isar_reg isar_r; }; diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c index 245b40bc083a..4ee5831fed52 100644 --- a/drivers/isdn/hisax/isurf.c +++ b/drivers/isdn/hisax/isurf.c @@ -1,10 +1,13 @@ -/* $Id: isurf.c,v 1.6 1999/09/04 06:20:06 keil Exp $ +/* $Id: isurf.c,v 1.7 1999/11/14 23:37:03 keil Exp $ * isurf.c low level stuff for Siemens I-Surf/I-Talk cards * * Author Karsten Keil (keil@isdn4linux.de) * * $Log: isurf.c,v $ + * Revision 1.7 1999/11/14 23:37:03 keil + * new ISA memory mapped IO + * * Revision 1.6 1999/09/04 06:20:06 keil * Changes from kernel set_current_state() * @@ -37,7 +40,7 @@ extern const char *CardType[]; -static const char *ISurf_revision = "$Revision: 1.6 $"; +static const char *ISurf_revision = "$Revision: 1.7 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -50,7 +53,7 @@ static const char *ISurf_revision = "$Revision: 1.6 $"; #define ISURF_ISAR_OFFSET 0 #define ISURF_ISAC_OFFSET 0x100 - +#define ISURF_IOMEM_SIZE 0x400 /* Interface functions */ static u_char @@ -145,6 +148,8 @@ void release_io_isurf(struct IsdnCardState *cs) { release_region(cs->hw.isurf.reset, 1); + iounmap((unsigned char *)cs->hw.isurf.isar); + release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE); } static void @@ -223,8 +228,7 @@ setup_isurf(struct IsdnCard *card)) return(0); if (card->para[1] && card->para[2]) { cs->hw.isurf.reset = card->para[1]; - cs->hw.isurf.isar = card->para[2] + ISURF_ISAR_OFFSET; - cs->hw.isurf.isac = card->para[2] + ISURF_ISAC_OFFSET; + cs->hw.isurf.phymem = card->para[2]; cs->irq = card->para[0]; } else { printk(KERN_WARNING "HiSax: %s port/mem not set\n", @@ -240,11 +244,25 @@ setup_isurf(struct IsdnCard *card)) } else { request_region(cs->hw.isurf.reset, 1, "isurf isdn"); } - + if (check_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE)) { + printk(KERN_WARNING + "HiSax: %s memory region %lx-%lx already in use\n", + CardType[card->typ], + cs->hw.isurf.phymem, + cs->hw.isurf.phymem + ISURF_IOMEM_SIZE); + release_region(cs->hw.isurf.reset, 1); + return (0); + } else { + request_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, + "isurf iomem"); + } + cs->hw.isurf.isar = + (unsigned long) ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE); + cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET; printk(KERN_INFO - "ISurf: defined at 0x%x 0x%x IRQ %d\n", + "ISurf: defined at 0x%x 0x%lx IRQ %d\n", cs->hw.isurf.reset, - cs->hw.isurf.isar, + cs->hw.isurf.phymem, cs->irq); cs->cardmsg = &ISurf_card_msg; diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index daa7953d9033..b93895ea19bc 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -1,4 +1,4 @@ -/* $Id: sedlbauer.c,v 1.17 1999/09/04 06:20:06 keil Exp $ +/* $Id: sedlbauer.c,v 1.18 1999/11/13 21:25:03 keil Exp $ * sedlbauer.c low level stuff for Sedlbauer cards * includes support for the Sedlbauer speed star (speed star II), @@ -17,6 +17,9 @@ * Edgar Toernig * * $Log: sedlbauer.c,v $ + * Revision 1.18 1999/11/13 21:25:03 keil + * Support for Speedfax+ PCI + * * Revision 1.17 1999/09/04 06:20:06 keil * Changes from kernel set_current_state() * @@ -79,12 +82,13 @@ * --------------------------------------------------------------------- * Speed Card ISAC_HSCX DIP-SWITCH * Speed Win ISAC_HSCX ISAPNP - * Speed Fax+ ISAC_ISAR ISAPNP #HDLC works# + * Speed Fax+ ISAC_ISAR ISAPNP Full analog support * Speed Star ISAC_HSCX CARDMGR * Speed Win2 IPAC ISAPNP * ISDN PC/104 IPAC DIP-SWITCH * Speed Star2 IPAC CARDMGR - * Speed PCI IPAC PNP + * Speed PCI IPAC PCI PNP + * Speed Fax+ ISAC_ISAR PCI PNP Full analog support * * Important: * For the sedlbauer speed fax+ to work properly you have to download @@ -106,15 +110,18 @@ extern const char *CardType[]; -const char *Sedlbauer_revision = "$Revision: 1.17 $"; +const char *Sedlbauer_revision = "$Revision: 1.18 $"; const char *Sedlbauer_Types[] = {"None", "speed card/win", "speed star", "speed fax+", - "speed win II / ISDN PC/104", "speed star II", "speed pci"}; + "speed win II / ISDN PC/104", "speed star II", "speed pci", + "speed fax+ pci"}; #ifdef SEDLBAUER_PCI #define PCI_VENDOR_SEDLBAUER 0xe159 -#define PCI_SPEEDPCI_ID 0x02 +#define PCI_SPEEDPCI_ID 0x02 +#define PCI_SUBVENDOR_SEDLBAUER 0x51 +#define PCI_SUB_ID_SPEEDFAXP 0x01 #endif #define SEDL_SPEED_CARD_WIN 1 @@ -123,6 +130,7 @@ const char *Sedlbauer_Types[] = #define SEDL_SPEED_WIN2_PC104 4 #define SEDL_SPEED_STAR2 5 #define SEDL_SPEED_PCI 6 +#define SEDL_SPEEDFAX_PCI 7 #define SEDL_CHIP_TEST 0 #define SEDL_CHIP_ISAC_HSCX 1 @@ -153,12 +161,19 @@ const char *Sedlbauer_Types[] = #define SEDL_ISAR_ISA_ISAR_RESET_ON 10 #define SEDL_ISAR_ISA_ISAR_RESET_OFF 12 -#define SEDL_IPAC_ANY_ADR 0 -#define SEDL_IPAC_ANY_IPAC 2 +#define SEDL_IPAC_ANY_ADR 0 +#define SEDL_IPAC_ANY_IPAC 2 -#define SEDL_IPAC_PCI_BASE 0 -#define SEDL_IPAC_PCI_ADR 0xc0 -#define SEDL_IPAC_PCI_IPAC 0xc8 +#define SEDL_IPAC_PCI_BASE 0 +#define SEDL_IPAC_PCI_ADR 0xc0 +#define SEDL_IPAC_PCI_IPAC 0xc8 +#define SEDL_ISAR_PCI_ADR 0xc8 +#define SEDL_ISAR_PCI_ISAC 0xd0 +#define SEDL_ISAR_PCI_ISAR 0xe0 +#define SEDL_ISAR_PCI_ISAR_RESET_ON 0x01 +#define SEDL_ISAR_PCI_ISAR_RESET_OFF 0x18 +#define SEDL_ISAR_PCI_LED1 0x08 +#define SEDL_ISAR_PCI_LED2 0x10 #define SEDL_RESET 0x3 /* same as DOS driver */ @@ -235,24 +250,25 @@ WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) static u_char ReadISAC_IPAC(struct IsdnCardState *cs, u_char offset) { - return (readreg(cs->hw.sedl.adr, cs->hw.sedl.isac, offset|0x80));} + return (readreg(cs->hw.sedl.adr, cs->hw.sedl.isac, offset|0x80)); +} static void WriteISAC_IPAC(struct IsdnCardState *cs, u_char offset, u_char value) { - writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, offset|0x80, value); + writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, offset|0x80, value); } static void ReadISACfifo_IPAC(struct IsdnCardState *cs, u_char * data, int size) { - readfifo(cs->hw.sedl.adr, cs->hw.sedl.isac, 0x80, data, size); + readfifo(cs->hw.sedl.adr, cs->hw.sedl.isac, 0x80, data, size); } static void WriteISACfifo_IPAC(struct IsdnCardState *cs, u_char * data, int size) { - writefifo(cs->hw.sedl.adr, cs->hw.sedl.isac, 0x80, data, size); + writefifo(cs->hw.sedl.adr, cs->hw.sedl.isac, 0x80, data, size); } static u_char @@ -485,6 +501,17 @@ reset_sedlbauer(struct IsdnCardState *cs) writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_MASK, 0xc0); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_PCFG, 0x12); restore_flags(flags); + } else if ((cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) && + (cs->hw.sedl.bus == SEDL_BUS_PCI)) { + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on); + save_flags(flags); + sti(); + current->state = TASK_INTERRUPTIBLE; + schedule_timeout((20*HZ)/1000); + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); + current->state = TASK_INTERRUPTIBLE; + schedule_timeout((20*HZ)/1000); + restore_flags(flags); } else { byteout(cs->hw.sedl.reset_on, SEDL_RESET); /* Reset On */ save_flags(flags); @@ -537,6 +564,24 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); case CARD_TEST: return(0); + case MDL_INFO_CONN: + if (cs->subtyp != SEDL_SPEEDFAX_PCI) + return(0); + if ((long) arg) + cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED2; + else + cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED1; + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); + break; + case MDL_INFO_REL: + if (cs->subtyp != SEDL_SPEEDFAX_PCI) + return(0); + if ((long) arg) + cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED2; + else + cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED1; + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); + break; } return(0); } @@ -551,6 +596,8 @@ setup_sedlbauer(struct IsdnCard *card)) int bytecnt, ver, val; struct IsdnCardState *cs = card->cs; char tmp[64]; + u16 sub_vendor_id, sub_id; + long flags; strcpy(tmp, Sedlbauer_revision); printk(KERN_INFO "HiSax: Sedlbauer driver Rev. %s\n", HiSax_getrev(tmp)); @@ -598,15 +645,40 @@ setup_sedlbauer(struct IsdnCard *card)) printk(KERN_WARNING "Sedlbauer: No PCI card found\n"); return(0); } - cs->irq_flags |= SA_SHIRQ; + cs->irq_flags |= SA_SHIRQ; cs->hw.sedl.bus = SEDL_BUS_PCI; - cs->hw.sedl.chip = SEDL_CHIP_IPAC; - cs->subtyp = SEDL_SPEED_PCI; + pci_read_config_word(dev_sedl, PCI_SUBSYSTEM_VENDOR_ID, + &sub_vendor_id); + pci_read_config_word(dev_sedl, PCI_SUBSYSTEM_ID, + &sub_id); + printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n", + sub_vendor_id, sub_id); + printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n", + cs->hw.sedl.cfg_reg); + if ((sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER) && + (sub_id == PCI_SUB_ID_SPEEDFAXP)) { + cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR; + cs->subtyp = SEDL_SPEEDFAX_PCI; + cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + + SEDL_ISAR_PCI_ISAR_RESET_ON; + cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + + SEDL_ISAR_PCI_ISAR_RESET_OFF; + } else { + cs->hw.sedl.chip = SEDL_CHIP_IPAC; + cs->subtyp = SEDL_SPEED_PCI; + } bytecnt = 256; byteout(cs->hw.sedl.cfg_reg, 0xff); byteout(cs->hw.sedl.cfg_reg, 0x00); byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd); byteout(cs->hw.sedl.cfg_reg+ 5, 0x02); + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on); + save_flags(flags); + sti(); + current->state = TASK_INTERRUPTIBLE; + schedule_timeout((10*HZ)/1000); + byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); + restore_flags(flags); #else printk(KERN_WARNING "Sedlbauer: NO_PCI_BIOS\n"); return (0); @@ -688,7 +760,7 @@ setup_sedlbauer(struct IsdnCard *card)) cs->writeisacfifo = &WriteISACfifo_IPAC; cs->irq_func = &sedlbauer_interrupt_ipac; - val = readreg(cs->hw.sedl.adr,cs->hw.sedl.isac, IPAC_ID); + val = readreg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_ID); printk(KERN_INFO "Sedlbauer: IPAC version %x\n", val); reset_sedlbauer(cs); } else { @@ -698,18 +770,31 @@ setup_sedlbauer(struct IsdnCard *card)) cs->readisacfifo = &ReadISACfifo; cs->writeisacfifo = &WriteISACfifo; if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) { - cs->hw.sedl.adr = cs->hw.sedl.cfg_reg + SEDL_ISAR_ISA_ADR; - cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + SEDL_ISAR_ISA_ISAC; - cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + SEDL_ISAR_ISA_ISAR; - cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + SEDL_ISAR_ISA_ISAR_RESET_ON; - cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + SEDL_ISAR_ISA_ISAR_RESET_OFF; + if (cs->hw.sedl.bus == SEDL_BUS_PCI) { + cs->hw.sedl.adr = cs->hw.sedl.cfg_reg + + SEDL_ISAR_PCI_ADR; + cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + + SEDL_ISAR_PCI_ISAC; + cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + + SEDL_ISAR_PCI_ISAR; + } else { + cs->hw.sedl.adr = cs->hw.sedl.cfg_reg + + SEDL_ISAR_ISA_ADR; + cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + + SEDL_ISAR_ISA_ISAC; + cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + + SEDL_ISAR_ISA_ISAR; + cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + + SEDL_ISAR_ISA_ISAR_RESET_ON; + cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + + SEDL_ISAR_ISA_ISAR_RESET_OFF; + } cs->bcs[0].hw.isar.reg = &cs->hw.sedl.isar; cs->bcs[1].hw.isar.reg = &cs->hw.sedl.isar; test_and_set_bit(HW_ISAR, &cs->HW_Flags); cs->irq_func = &sedlbauer_interrupt_isar; cs->auxcmd = &isar_auxcmd; ISACVersion(cs, "Sedlbauer:"); - cs->BC_Read_Reg = &ReadISAR; cs->BC_Write_Reg = &WriteISAR; cs->BC_Send_Data = &isar_fill_fifo; diff --git a/drivers/isdn/hisax/teles0.c b/drivers/isdn/hisax/teles0.c index 866e8dac5eff..8e8017bbb5af 100644 --- a/drivers/isdn/hisax/teles0.c +++ b/drivers/isdn/hisax/teles0.c @@ -1,4 +1,4 @@ -/* $Id: teles0.c,v 2.9 1999/07/12 21:05:31 keil Exp $ +/* $Id: teles0.c,v 2.10 1999/11/14 23:37:03 keil Exp $ * teles0.c low level stuff for Teles Memory IO isdn cards * based on the teles driver from Jan den Ouden @@ -10,6 +10,9 @@ * Beat Doebeli * * $Log: teles0.c,v $ + * Revision 2.10 1999/11/14 23:37:03 keil + * new ISA memory mapped IO + * * Revision 2.9 1999/07/12 21:05:31 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -58,71 +61,72 @@ extern const char *CardType[]; -const char *teles0_revision = "$Revision: 2.9 $"; +const char *teles0_revision = "$Revision: 2.10 $"; +#define TELES_IOMEM_SIZE 0x400 #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) static inline u_char -readisac(unsigned int adr, u_char off) +readisac(unsigned long adr, u_char off) { return readb(adr + ((off & 1) ? 0x2ff : 0x100) + off); } static inline void -writeisac(unsigned int adr, u_char off, u_char data) +writeisac(unsigned long adr, u_char off, u_char data) { writeb(data, adr + ((off & 1) ? 0x2ff : 0x100) + off); mb(); } static inline u_char -readhscx(unsigned int adr, int hscx, u_char off) +readhscx(unsigned long adr, int hscx, u_char off) { return readb(adr + (hscx ? 0x1c0 : 0x180) + ((off & 1) ? 0x1ff : 0) + off); } static inline void -writehscx(unsigned int adr, int hscx, u_char off, u_char data) +writehscx(unsigned long adr, int hscx, u_char off, u_char data) { writeb(data, adr + (hscx ? 0x1c0 : 0x180) + ((off & 1) ? 0x1ff : 0) + off); mb(); } static inline void -read_fifo_isac(unsigned int adr, u_char * data, int size) +read_fifo_isac(unsigned long adr, u_char * data, int size) { register int i; - register u_char *ad = (u_char *) ((long)adr + 0x100); + register u_char *ad = (u_char *)adr + 0x100; for (i = 0; i < size; i++) data[i] = readb(ad); } static inline void -write_fifo_isac(unsigned int adr, u_char * data, int size) +write_fifo_isac(unsigned long adr, u_char * data, int size) { register int i; - register u_char *ad = (u_char *) ((long)adr + 0x100); + register u_char *ad = (u_char *)adr + 0x100; for (i = 0; i < size; i++) { writeb(data[i], ad); mb(); } } static inline void -read_fifo_hscx(unsigned int adr, int hscx, u_char * data, int size) +read_fifo_hscx(unsigned long adr, int hscx, u_char * data, int size) { register int i; - register u_char *ad = (u_char *) ((long)adr + (hscx ? 0x1c0 : 0x180)); + register u_char *ad = (u_char *) (adr + (hscx ? 0x1c0 : 0x180)); for (i = 0; i < size; i++) data[i] = readb(ad); } static inline void -write_fifo_hscx(unsigned int adr, int hscx, u_char * data, int size) +write_fifo_hscx(unsigned long adr, int hscx, u_char * data, int size) { int i; - register u_char *ad = (u_char *) ((long)adr + (hscx ? 0x1c0 : 0x180)); + register u_char *ad = (u_char *) (adr + (hscx ? 0x1c0 : 0x180)); for (i = 0; i < size; i++) { writeb(data[i], ad); mb(); } @@ -222,6 +226,8 @@ release_io_teles0(struct IsdnCardState *cs) { if (cs->hw.teles0.cfg_reg) release_region(cs->hw.teles0.cfg_reg, 8); + iounmap((unsigned char *)cs->hw.teles0.membase); + release_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE); } static int @@ -262,7 +268,7 @@ reset_teles0(struct IsdnCardState *cs) default: return(1); } - cfval |= ((cs->hw.teles0.membase >> 9) & 0xF0); + cfval |= ((cs->hw.teles0.phymem >> 9) & 0xF0); byteout(cs->hw.teles0.cfg_reg + 4, cfval); HZDELAY(HZ / 10 + 1); byteout(cs->hw.teles0.cfg_reg + 4, cfval | 1); @@ -318,10 +324,9 @@ setup_teles0(struct IsdnCard *card)) "Teles0: membase configured DOSish, assuming 0x%lx\n", (unsigned long) card->para[1]); } - cs->hw.teles0.membase = card->para[1]; cs->irq = card->para[0]; if (cs->hw.teles0.cfg_reg) { - if (check_region((cs->hw.teles0.cfg_reg), 8)) { + if (check_region(cs->hw.teles0.cfg_reg, 8)) { printk(KERN_WARNING "HiSax: %s config port %x-%x already in use\n", CardType[card->typ], @@ -358,8 +363,24 @@ setup_teles0(struct IsdnCard *card)) } /* 16.0 and 8.0 designed for IOM1 */ test_and_set_bit(HW_IOM1, &cs->HW_Flags); + cs->hw.teles0.phymem = card->para[1]; + if (check_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE)) { + printk(KERN_WARNING + "HiSax: %s memory region %lx-%lx already in use\n", + CardType[card->typ], + cs->hw.teles0.phymem, + cs->hw.teles0.phymem + TELES_IOMEM_SIZE); + if (cs->hw.teles0.cfg_reg) + release_region(cs->hw.teles0.cfg_reg, 8); + return (0); + } else { + request_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE, + "teles iomem"); + } + cs->hw.teles0.membase = + (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE); printk(KERN_INFO - "HiSax: %s config irq:%d mem:0x%X cfg:0x%X\n", + "HiSax: %s config irq:%d mem:0x%lX cfg:0x%X\n", CardType[cs->typ], cs->irq, cs->hw.teles0.membase, cs->hw.teles0.cfg_reg); if (reset_teles0(cs)) { diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c index eee4ba322b56..3486b470ad83 100644 --- a/drivers/isdn/hisax/telespci.c +++ b/drivers/isdn/hisax/telespci.c @@ -1,4 +1,4 @@ -/* $Id: telespci.c,v 2.9 1999/08/11 21:01:34 keil Exp $ +/* $Id: telespci.c,v 2.10 1999/11/15 14:20:05 keil Exp $ * telespci.c low level stuff for Teles PCI isdn cards * @@ -7,6 +7,9 @@ * * * $Log: telespci.c,v $ + * Revision 2.10 1999/11/15 14:20:05 keil + * 64Bit compatibility + * * Revision 2.9 1999/08/11 21:01:34 keil * new PCI codefix * @@ -44,7 +47,7 @@ #include extern const char *CardType[]; -const char *telespci_revision = "$Revision: 2.9 $"; +const char *telespci_revision = "$Revision: 2.10 $"; #define ZORAN_PO_RQ_PEN 0x02000000 #define ZORAN_PO_WR 0x00800000 @@ -66,7 +69,7 @@ const char *telespci_revision = "$Revision: 2.9 $"; } while (portdata & ZORAN_PO_RQ_PEN) static inline u_char -readisac(unsigned int adr, u_char off) +readisac(unsigned long adr, u_char off) { register unsigned int portdata; @@ -83,7 +86,7 @@ readisac(unsigned int adr, u_char off) } static inline void -writeisac(unsigned int adr, u_char off, u_char data) +writeisac(unsigned long adr, u_char off, u_char data) { register unsigned int portdata; @@ -99,7 +102,7 @@ writeisac(unsigned int adr, u_char off, u_char data) } static inline u_char -readhscx(unsigned int adr, int hscx, u_char off) +readhscx(unsigned long adr, int hscx, u_char off) { register unsigned int portdata; @@ -115,7 +118,7 @@ readhscx(unsigned int adr, int hscx, u_char off) } static inline void -writehscx(unsigned int adr, int hscx, u_char off, u_char data) +writehscx(unsigned long adr, int hscx, u_char off, u_char data) { register unsigned int portdata; @@ -130,7 +133,7 @@ writehscx(unsigned int adr, int hscx, u_char off, u_char data) } static inline void -read_fifo_isac(unsigned int adr, u_char * data, int size) +read_fifo_isac(unsigned long adr, u_char * data, int size) { register unsigned int portdata; register int i; @@ -148,7 +151,7 @@ read_fifo_isac(unsigned int adr, u_char * data, int size) } static void -write_fifo_isac(unsigned int adr, u_char * data, int size) +write_fifo_isac(unsigned long adr, u_char * data, int size) { register unsigned int portdata; register int i; @@ -165,7 +168,7 @@ write_fifo_isac(unsigned int adr, u_char * data, int size) } static inline void -read_fifo_hscx(unsigned int adr, int hscx, u_char * data, int size) +read_fifo_hscx(unsigned long adr, int hscx, u_char * data, int size) { register unsigned int portdata; register int i; @@ -183,7 +186,7 @@ read_fifo_hscx(unsigned int adr, int hscx, u_char * data, int size) } static inline void -write_fifo_hscx(unsigned int adr, int hscx, u_char * data, int size) +write_fifo_hscx(unsigned long adr, int hscx, u_char * data, int size) { unsigned int portdata; register int i; @@ -324,7 +327,7 @@ setup_telespci(struct IsdnCard *card)) printk(KERN_WARNING "Teles: No IRQ for PCI card found\n"); return(0); } - cs->hw.teles0.membase = (u_int) ioremap(dev_tel->resource[ 0].start, + cs->hw.teles0.membase = (u_long) ioremap(dev_tel->resource[ 0].start, PAGE_SIZE); printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n", dev_tel->resource[ 0].start, dev_tel->irq); @@ -348,7 +351,7 @@ setup_telespci(struct IsdnCard *card)) /* writel(0x00800000, cs->hw.teles0.membase + 0x200); */ printk(KERN_INFO - "HiSax: %s config irq:%d mem:%x\n", + "HiSax: %s config irq:%d mem:%lx\n", CardType[cs->typ], cs->irq, cs->hw.teles0.membase); diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 679aaddeb46e..3c21adb9f26f 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "pcbit.h" #include "edss1.h" @@ -88,9 +89,21 @@ int pcbit_init_dev(int board, int mem_base, int irq) memset(dev, 0, sizeof(struct pcbit_dev)); init_waitqueue_head(&dev->set_running_wq); - if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) - dev->sh_mem = (unsigned char*) mem_base; - else + if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) { + dev->ph_mem = mem_base; + if (check_mem_region(dev->ph_mem, 4096)) { + printk(KERN_WARNING + "PCBIT: memory region %lx-%lx already in use\n", + dev->ph_mem, dev->ph_mem + 4096); + kfree(dev); + dev_pcbit[board] = NULL; + return -EACCES; + } else { + request_mem_region(dev->ph_mem, 4096, "PCBIT mem"); + } + dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096); + } + else { printk("memory address invalid"); kfree(dev); @@ -102,6 +115,8 @@ int pcbit_init_dev(int board, int mem_base, int irq) if (!dev->b1) { printk("pcbit_init: couldn't malloc pcbit_chan struct\n"); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); return -ENOMEM; } @@ -110,6 +125,8 @@ int pcbit_init_dev(int board, int mem_base, int irq) printk("pcbit_init: couldn't malloc pcbit_chan struct\n"); kfree(dev->b1); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); return -ENOMEM; } @@ -132,6 +149,8 @@ int pcbit_init_dev(int board, int mem_base, int irq) kfree(dev->b1); kfree(dev->b2); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); dev_pcbit[board] = NULL; return -EIO; } @@ -152,6 +171,8 @@ int pcbit_init_dev(int board, int mem_base, int irq) kfree(dev->b1); kfree(dev->b2); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); dev_pcbit[board] = NULL; return -EIO; } @@ -181,6 +202,8 @@ int pcbit_init_dev(int board, int mem_base, int irq) kfree(dev->b1); kfree(dev->b2); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); dev_pcbit[board] = NULL; return -EIO; } @@ -217,6 +240,8 @@ void pcbit_terminate(int board) kfree(dev->b1); kfree(dev->b2); kfree(dev); + iounmap((unsigned char*)dev->sh_mem); + release_mem_region(dev->ph_mem, 4096); } } #endif diff --git a/drivers/isdn/pcbit/pcbit.h b/drivers/isdn/pcbit/pcbit.h index d284cc70f0d5..99aab08ccfee 100644 --- a/drivers/isdn/pcbit/pcbit.h +++ b/drivers/isdn/pcbit/pcbit.h @@ -46,6 +46,7 @@ struct pcbit_dev { /* board */ volatile unsigned char* sh_mem; /* RDP address */ + unsigned long ph_mem; unsigned int irq; unsigned int id; unsigned int interrupt; /* set during interrupt @@ -166,10 +167,3 @@ struct pcbit_ioctl { #define L2_ERROR 6 #endif - - - - - - - diff --git a/drivers/net/8390.c b/drivers/net/8390.c index 1d27b5d3bf3c..dde3b12a99aa 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c @@ -1090,10 +1090,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length, int start_page) { long e8390_base = dev->base_addr; -#if defined(CONFIG_MAC) || defined(CONFIG_AMIGA_PCMCIA) || \ - defined(CONFIG_ARIADNE2) || defined(CONFIG_ARIADNE2_MODULE) - struct ei_device *ei_local = (struct ei_device *) dev->priv; -#endif + struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) dev->priv; outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD); diff --git a/drivers/net/Config.in b/drivers/net/Config.in index c8a2024d8ef6..3dc7e9ae3826 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -98,7 +98,6 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then # tristate ' Packet Engines Hamachi GNIC-II support (EXPERIMENTAL)' CONFIG_HAMACHI tristate ' Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)' CONFIG_YELLOWFIN tristate ' RealTek 8129/8139 (not 8019/8029!) support (EXPERIMENTAL)' CONFIG_RTL8139 - tristate ' SiS 900 PCI Fast Ethernet Adapter support (EXPERIMENTAL)' CONFIG_SIS900 tristate ' DM9102 PCI Fast Ethernet Adapter support (EXPERIMENTAL)' CONFIG_DM9102 fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then @@ -156,6 +155,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then # tristate ' Sundance Alta support' CONFIG_ALTA tristate ' TI ThunderLAN support' CONFIG_TLAN tristate ' VIA Rhine support' CONFIG_VIA_RHINE + tristate ' SiS 900/7016 PCI Fast Ethernet Adapter support' CONFIG_SIS900 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then tristate ' Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 tristate ' SMC EtherPower II (EXPERIMENTAL)' CONFIG_EPIC100 diff --git a/drivers/net/Makefile b/drivers/net/Makefile index a68c55dfb7c0..54f4594660bc 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -19,8 +19,8 @@ MOD_SUB_DIRS := MOD_IN_SUB_DIRS := ALL_SUB_DIRS := $(SUB_DIRS) fc hamradio irda pcmcia tokenring wan -L_TARGET := net.a -L_OBJS := auto_irq.o +O_TARGET := net.o +O_OBJS := M_OBJS := MOD_LIST_NAME := NET_MODULES @@ -263,8 +263,9 @@ OX_OBJS := $(filter $(export-objs), $(obj-y)) M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -L_OBJS += $(O_OBJS) -L_OBJS += $(OX_OBJS) +O_OBJS += $(O_OBJS) +O_OBJS += $(OX_OBJS) +O_OBJS += auto_irq.o include $(TOPDIR)/Rules.make diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 4f613e7ea18f..bd5749a004cb 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -160,6 +160,9 @@ static int __init probe_list(struct net_device *dev, struct devprobe *plist) * EISA only driver probes, and also the legacy PCI probes */ struct devprobe eisa_probes[] __initdata = { +#ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ + {de4x5_probe, 0}, +#endif #ifdef CONFIG_TLAN {tlan_probe, 0}, #endif diff --git a/drivers/net/setup.c b/drivers/net/setup.c index 62964e0c3d85..d70038767a21 100644 --- a/drivers/net/setup.c +++ b/drivers/net/setup.c @@ -13,6 +13,7 @@ extern int ppp_init(void); extern int slip_init_ctrl_dev(void); extern int strip_init_ctrl_dev(void); extern int x25_asy_init_ctrl_dev(void); +extern int slhc_install(void); extern int bpq_init(void); extern int dmascc_init(void); @@ -181,9 +182,6 @@ struct net_probe pci_probes[] __initdata = { #ifdef CONFIG_DEC_ELCP {tulip_probe, 0}, #endif -#ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ - {de4x5_probe, 0}, -#endif #ifdef CONFIG_EPIC100 {epic100_probe, 0}, #endif @@ -367,5 +365,3 @@ void __init net_device_init(void) special_device_init(); /* That kicks off the legacy init functions */ } - - diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 8f796e51f93e..ccc8a93d662c 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -752,8 +752,9 @@ void cleanup_module(void) } #else /* MODULE */ -void __init slhc_install(void) +int __init slhc_install(void) { + return 0; } #endif /* MODULE */ diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index f4d99257e3d5..37eb785f9faf 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c @@ -31,9 +31,9 @@ * - David Hein at Texas Instruments * * Maintainer(s): - * JS Jay Schulist jschlst@samba.anu.edu.au + * JS Jay Schulist jschlst@samba.anu.edu.au * CG Christoph Goos cgoos@syskonnect.de - * AF Adam Fritzler mid@auk.cx + * AF Adam Fritzler mid@auk.cx * * Modification History: * 29-Aug-97 CG Created @@ -42,10 +42,10 @@ * 27-May-98 JS Formated to Linux Kernel Format * 31-May-98 JS Hacked in PCI support * 16-Jun-98 JS Modulized for multiple cards with one driver - * Sep-99 AF Renamed to tms380tr (supports more than SK's) - * 23-Sep-99 AF Added Compaq and Thomas-Conrad PCI support - * Fixed a bug causing double copies on PCI - * Fixed for new multicast stuff (2.2/2.3) + * Sep-99 AF Renamed to tms380tr (supports more than SK's) + * 23-Sep-99 AF Added Compaq and Thomas-Conrad PCI support + * Fixed a bug causing double copies on PCI + * Fixed for new multicast stuff (2.2/2.3) * 25-Sep-99 AF Uped TPL_NUM from 3 to 9 * Removed extraneous 'No free TPL' * @@ -226,18 +226,22 @@ int __init tms380tr_probe(struct net_device *dev) else if(base_addr != 0) /* Don't probe at all. */ return (-ENXIO); + /* + * Let's check for pci adapters first + */ + if (tms380tr_probe1(dev,0) == 0) /* Success */ + return 0 ; + + /* + * No pci cards found, let's check for isa + */ + for(i = 0; tms380tr_portlist[i]; i++) { int ioaddr = tms380tr_portlist[i]; - if(check_region(ioaddr, TMS380TR_IO_EXTENT)) + if(check_region(ioaddr, TMS380TR_IO_EXTENT)) /* Region already used */ continue; - if(tms380tr_probe1(dev, ioaddr)) - { -#ifndef MODULE - tr_freedev(dev); -#endif - } - else + if(!tms380tr_probe1(dev, ioaddr)) return (0); } @@ -248,7 +252,6 @@ struct cardinfo_table * __init tms380tr_pci_getcardinfo(unsigned short vendor, unsigned short device) { int cur; - for (cur = 1; cardinfo[cur].name != NULL; cur++) { if (cardinfo[cur].type == 2) /* PCI */ { @@ -266,65 +269,39 @@ struct cardinfo_table * __init tms380tr_pci_getcardinfo(unsigned short vendor, static int __init tms380tr_pci_chk_card(struct net_device *dev, struct cardinfo_table **outcard) { - static int pci_index = 0; - unsigned char pci_bus, pci_device_fn; + struct pci_dev *pci_device = NULL ; struct cardinfo_table *card; int i; if(!pci_present()) return (-1); /* No PCI present. */ + + while ( (pci_device=pci_find_class(PCI_CLASS_NETWORK_TOKEN_RING<<8, pci_device))) { - for(; pci_index < 0xff; pci_index++) - { unsigned int pci_irq_line; - struct pci_dev *pdev; - unsigned short pci_command, new_command, vendor, device; unsigned int pci_ioaddr; - if(pcibios_find_class(PCI_CLASS_NETWORK_TOKEN_RING << 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); - - pdev = pci_find_slot(pci_bus, pci_device_fn); - pci_irq_line = pdev->irq; - pci_ioaddr = pdev->resource[0].start; - - pcibios_read_config_word(pci_bus, pci_device_fn, - PCI_COMMAND, &pci_command); - /* Remove I/O space marker in bit 0. */ - pci_ioaddr &= ~3; + pci_irq_line = pci_device->irq ; + pci_ioaddr = pci_device->resource[0].start ; +/* pci_ioaddr &= ~3; */ + + /* Don't return from here, just continue on the card discovery loop - MLP */ + if (!(card = tms380tr_pci_getcardinfo(pci_device->vendor, pci_device->device))) + continue ; - if (!(card = tms380tr_pci_getcardinfo(vendor, device))) - return -ENODEV; - if(check_region(pci_ioaddr, TMS380TR_IO_EXTENT)) continue; + request_region(pci_ioaddr, TMS380TR_IO_EXTENT, card->name); - if(request_irq(pdev->irq, tms380tr_interrupt, SA_SHIRQ, - card->name, dev)) + if(request_irq(pci_device->irq, tms380tr_interrupt, SA_SHIRQ, + card->name, dev)) { + release_region(pci_ioaddr, TMS380TR_IO_EXTENT) ; return (-ENODEV); /* continue; ?? */ - - new_command = (pci_command|PCI_COMMAND_MASTER|PCI_COMMAND_IO); - - if(pci_command != new_command) - { - printk("The PCI BIOS has not enabled this" - "device! Updating PCI command %4.4x->%4.4x.\n", - pci_command, new_command); - pcibios_write_config_word(pci_bus, pci_device_fn, - PCI_COMMAND, new_command); } + /* At this point we have found a valid tms380tr PCI TR card. */ - /* At this point we have found a valid PCI TR card. */ + pci_ioaddr &= ~3 ; dev->base_addr = pci_ioaddr; dev->irq = pci_irq_line; dev->dma = 0; @@ -342,10 +319,10 @@ static int __init tms380tr_pci_chk_card(struct net_device *dev, if (outcard) *outcard = card; - return (0); + return 0 ; } - return (-1); + return (-1); } /* @@ -362,85 +339,85 @@ static int __init tms380tr_isa_chk_card(struct net_device *dev, int ioaddr, if(err < 0) return (-ENODEV); - if(virt_to_bus((void*)((unsigned long)dev->priv+sizeof(struct net_local))) + if(virt_to_bus((void*)((unsigned long)dev->priv+sizeof(struct net_local))) > ISA_MAX_ADDRESS) - { - printk("%s: Memory not accessible for DMA\n", dev->name); - kfree(dev->priv); - return (-EAGAIN); - } + { + printk("%s: Memory not accessible for DMA\n", dev->name); + kfree(dev->priv); + return (-EAGAIN); + } /* FIXME */ card = &cardinfo[1]; - /* Grab the region so that no one else tries to probe our ioports. */ - request_region(ioaddr, TMS380TR_IO_EXTENT, card->name); - dev->base_addr = ioaddr; - - /* Autoselect IRQ and DMA if dev->irq == 0 */ - if(dev->irq == 0) - { - for(i = 0; tms380tr_irqlist[i] != 0; i++) - { - dev->irq = tms380tr_irqlist[i]; - err = request_irq(dev->irq, &tms380tr_interrupt, 0, card->name, dev); - if(!err) + /* Grab the region so that no one else tries to probe our ioports. */ + request_region(ioaddr, TMS380TR_IO_EXTENT, card->name); + dev->base_addr = ioaddr; + + /* Autoselect IRQ and DMA if dev->irq == 0 */ + if(dev->irq == 0) + { + for(i = 0; tms380tr_irqlist[i] != 0; i++) + { + dev->irq = tms380tr_irqlist[i]; + err = request_irq(dev->irq, &tms380tr_interrupt, 0, card->name, dev); + if(!err) break; - } - - if(tms380tr_irqlist[i] == 0) - { - printk("%s: AutoSelect no IRQ available\n", dev->name); - return (-EAGAIN); - } - } - else - { - err = request_irq(dev->irq, &tms380tr_interrupt, 0, card->name, dev); + } + + if(tms380tr_irqlist[i] == 0) + { + printk("%s: AutoSelect no IRQ available\n", dev->name); + return (-EAGAIN); + } + } + else + { + err = request_irq(dev->irq, &tms380tr_interrupt, 0, card->name, dev); if(err) - { - printk("%s: Selected IRQ not available\n", dev->name); - return (-EAGAIN); - } - } - - /* Always allocate the DMA channel after IRQ and clean up on failure */ - if(dev->dma == 0) - { - for(i = 0; tms380tr_dmalist[i] != 0; i++) - { + { + printk("%s: Selected IRQ not available\n", dev->name); + return (-EAGAIN); + } + } + + /* Always allocate the DMA channel after IRQ and clean up on failure */ + if(dev->dma == 0) + { + for(i = 0; tms380tr_dmalist[i] != 0; i++) + { dev->dma = tms380tr_dmalist[i]; - err = request_dma(dev->dma, card->name); - if(!err) - break; - } - - if(dev->dma == 0) - { - printk("%s: AutoSelect no DMA available\n", dev->name); - free_irq(dev->irq, NULL); - return (-EAGAIN); - } - } - else - { - err = request_dma(dev->dma, card->name); - if(err) - { - printk("%s: Selected DMA not available\n", dev->name); - free_irq(dev->irq, NULL); - return (-EAGAIN); - } - } + err = request_dma(dev->dma, card->name); + if(!err) + break; + } + + if(dev->dma == 0) + { + printk("%s: AutoSelect no DMA available\n", dev->name); + free_irq(dev->irq, NULL); + return (-EAGAIN); + } + } + else + { + err = request_dma(dev->dma, card->name); + if(err) + { + printk("%s: Selected DMA not available\n", dev->name); + free_irq(dev->irq, NULL); + return (-EAGAIN); + } + } flags=claim_dma_lock(); disable_dma(dev->dma); - set_dma_mode(dev->dma, DMA_MODE_CASCADE); - enable_dma(dev->dma); - release_dma_lock(flags); + set_dma_mode(dev->dma, DMA_MODE_CASCADE); + enable_dma(dev->dma); + release_dma_lock(flags); printk("%s: %s found at %#4x, using IRQ %d and DMA %d.\n", - dev->name, card->name, ioaddr, dev->irq, dev->dma); + dev->name, card->name, ioaddr, dev->irq, dev->dma); if (outcard) *outcard = card; @@ -448,6 +425,10 @@ static int __init tms380tr_isa_chk_card(struct net_device *dev, int ioaddr, return (0); } +/* + * Passing an ioaddr of 0 tells us to do a pci card search + */ + static int __init tms380tr_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed = 0; @@ -463,14 +444,13 @@ static int __init tms380tr_probe1(struct net_device *dev, int ioaddr) if(dev == NULL) return (-ENOMEM); #endif - - err = tms380tr_pci_chk_card(dev, &card); - if(err < 0) - { + if (ioaddr == 0) { + err = tms380tr_pci_chk_card(dev, &card); + } else { err = tms380tr_isa_chk_card(dev, ioaddr, &card); - if(err < 0) - return (-ENODEV); } + if(err < 0) + return (-ENODEV); /* Setup this devices private information structure */ tp = (struct net_local *)kmalloc(sizeof(struct net_local), GFP_KERNEL | GFP_DMA); @@ -481,14 +461,14 @@ static int __init tms380tr_probe1(struct net_device *dev, int ioaddr) tp->CardType = card; dev->priv = tp; - dev->init = tms380tr_init_card; - dev->open = tms380tr_open; - dev->stop = tms380tr_close; - dev->hard_start_xmit = tms380tr_send_packet; - dev->get_stats = tms380tr_get_stats; - dev->set_multicast_list = &tms380tr_set_multicast_list; - - return (0); + dev->init = tms380tr_init_card; + dev->open = tms380tr_open; + dev->stop = tms380tr_close; + dev->do_ioctl = NULL ; + dev->hard_start_xmit = tms380tr_send_packet; + dev->get_stats = tms380tr_get_stats; + dev->set_multicast_list = &tms380tr_set_multicast_list; + return (0); } /* Dummy function */ @@ -568,6 +548,7 @@ static int tms380tr_open(struct net_device *dev) printk(KERN_INFO "%s: Adapter RAM size: %dK\n", dev->name, tms380tr_read_ptr(dev)); + tms380tr_enable_interrupts(dev); tms380tr_open_adapter(dev); @@ -664,15 +645,12 @@ static int tms380tr_chipset_init(struct net_device *dev) if((Tmp & ~CYCLE_TIME) != (PosReg & ~CYCLE_TIME)) printk(KERN_INFO "%s: POSREG error\n", dev->name); } - err = tms380tr_reset_adapter(dev); if(err < 0) return (-1); - err = tms380tr_bringup_diags(dev); if(err < 0) return (-1); - err = tms380tr_init_adapter(dev); if(err < 0) return (-1); @@ -1461,7 +1439,6 @@ static void tms380tr_cmd_status_irq(struct net_device *dev) static int tms380tr_close(struct net_device *dev) { struct net_local *tp = (struct net_local *)dev->priv; - dev->tbusy = 1; dev->start = 0; @@ -1522,52 +1499,51 @@ static struct enet_statistics *tms380tr_get_stats(struct net_device *dev) static void tms380tr_set_multicast_list(struct net_device *dev) { struct net_local *tp = (struct net_local *)dev->priv; - unsigned int OpenOptions; + unsigned int OpenOptions; - OpenOptions = tp->ocpl.OPENOptions & - ~(PASS_ADAPTER_MAC_FRAMES + OpenOptions = tp->ocpl.OPENOptions & + ~(PASS_ADAPTER_MAC_FRAMES | PASS_ATTENTION_FRAMES | PASS_BEACON_MAC_FRAMES | COPY_ALL_MAC_FRAMES | COPY_ALL_NON_MAC_FRAMES); - tp->ocpl.FunctAddr = 0; + tp->ocpl.FunctAddr = 0; - if(dev->flags & IFF_PROMISC) - /* Enable promiscuous mode */ - OpenOptions |= COPY_ALL_NON_MAC_FRAMES | + if(dev->flags & IFF_PROMISC) + /* Enable promiscuous mode */ + OpenOptions |= COPY_ALL_NON_MAC_FRAMES | COPY_ALL_MAC_FRAMES; - else - { - if(dev->flags & IFF_ALLMULTI) - { - /* Disable promiscuous mode, use normal mode. */ - tp->ocpl.FunctAddr = 0xFFFFFFFF; - - } - else - { - int i; - struct dev_mc_list *mclist = dev->mc_list; - for (i=0; i< dev->mc_count; i++) - { - ((char *)(&tp->ocpl.FunctAddr))[0] |= + else + { + if(dev->flags & IFF_ALLMULTI) + { + /* Disable promiscuous mode, use normal mode. */ + tp->ocpl.FunctAddr = 0xFFFFFFFF; + } + else + { + int i; + struct dev_mc_list *mclist = dev->mc_list; + for (i=0; i< dev->mc_count; i++) + { + ((char *)(&tp->ocpl.FunctAddr))[0] |= mclist->dmi_addr[2]; - ((char *)(&tp->ocpl.FunctAddr))[1] |= + ((char *)(&tp->ocpl.FunctAddr))[1] |= mclist->dmi_addr[3]; - ((char *)(&tp->ocpl.FunctAddr))[2] |= + ((char *)(&tp->ocpl.FunctAddr))[2] |= mclist->dmi_addr[4]; - ((char *)(&tp->ocpl.FunctAddr))[3] |= + ((char *)(&tp->ocpl.FunctAddr))[3] |= mclist->dmi_addr[5]; - mclist = mclist->next; - } - } - tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR); - } + mclist = mclist->next; + } + } + tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR); + } - tp->ocpl.OPENOptions = OpenOptions; - tms380tr_exec_cmd(dev, OC_MODIFY_OPEN_PARMS); - return; + tp->ocpl.OPENOptions = OpenOptions; + tms380tr_exec_cmd(dev, OC_MODIFY_OPEN_PARMS); + return; } /* @@ -2259,8 +2235,7 @@ static int tms380tr_read_ptr(struct net_device *dev) ADAPTER_INT_PTRS, 16); tms380tr_read_ram(dev, (unsigned char *)&adapterram, (unsigned short)SWAPB(tp->intptrs.AdapterRAMPtr), 2); - - return SWAPB(adapterram); + return SWAPB(adapterram); } /* @@ -2428,7 +2403,7 @@ static void tms380tr_tx_status_irq(struct net_device *dev) } } - tp->MacStat.tx_packets++; + tp->MacStat.tx_packets++; dev_kfree_skb(tpl->Skb); tpl->BusyFlag = 0; /* "free" TPL */ } @@ -2669,16 +2644,16 @@ static unsigned char tms380tr_chk_frame(struct net_device *dev, unsigned char *A */ static void tms380tr_dump(unsigned char *Data, int length) { - int i, j; + int i, j; - for (i = 0, j = 0; i < length / 8; i++, j += 8) - { + for (i = 0, j = 0; i < length / 8; i++, j += 8) + { printk(KERN_DEBUG "%02x %02x %02x %02x %02x %02x %02x %02x\n", Data[j+0],Data[j+1],Data[j+2],Data[j+3], - Data[j+4],Data[j+5],Data[j+6],Data[j+7]); - } + Data[j+4],Data[j+5],Data[j+6],Data[j+7]); + } - return; + return; } #endif @@ -2699,40 +2674,41 @@ int init_module(void) for(i = 0; i < TMS380TR_MAX_ADAPTERS; i++) { - irq[i] = 0; - mem[i] = 0; - dev_tms380tr[i] = NULL; - dev_tms380tr[i] = init_trdev(dev_tms380tr[i], 0); - if(dev_tms380tr[i] == NULL) - return (-ENOMEM); + irq[i] = 0; + mem[i] = 0; + dev_tms380tr[i] = NULL; + dev_tms380tr[i] = init_trdev(dev_tms380tr[i], 0); + if(dev_tms380tr[i] == NULL) + return (-ENOMEM); dev_tms380tr[i]->base_addr = io[i]; - dev_tms380tr[i]->irq = irq[i]; - dev_tms380tr[i]->mem_start = mem[i]; - dev_tms380tr[i]->init = &tms380tr_probe; + dev_tms380tr[i]->irq = irq[i]; + dev_tms380tr[i]->mem_start = mem[i]; + dev_tms380tr[i]->init = &tms380tr_probe; - if(register_trdev(dev_tms380tr[i]) != 0) + if(register_trdev(dev_tms380tr[i]) != 0) { - kfree_s(dev_tms380tr[i], sizeof(struct net_device)); - dev_tms380tr[i] = NULL; - if(i == 0) + kfree_s(dev_tms380tr[i], sizeof(struct net_device)); + dev_tms380tr[i] = NULL; + if(i == 0) { - printk("tms380tr: register_trdev() returned non-zero.\n"); - return (-EIO); - } + printk("tms380tr: register_trdev() returned non-zero.\n"); + return (-EIO); + } else - return (0); - } - } + return (0); + } - return (0); + } + + return (0); } void cleanup_module(void) { int i; - for(i = 0; i < TMS380TR_MAX_ADAPTERS; i++) + for(i = 0; i < TMS380TR_MAX_ADAPTERS; i++) { if(dev_tms380tr[i]) { @@ -2746,7 +2722,7 @@ void cleanup_module(void) kfree_s(dev_tms380tr[i]->priv, sizeof(struct net_local)); kfree_s(dev_tms380tr[i], sizeof(struct net_device)); dev_tms380tr[i] = NULL; - } + } } } #endif /* MODULE */ diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h index 9b1150e8a23c..2aeb0e967e7e 100644 --- a/drivers/scsi/BusLogic.h +++ b/drivers/scsi/BusLogic.h @@ -35,7 +35,6 @@ */ typedef kdev_t KernelDevice_T; -typedef struct proc_dir_entry PROC_DirectoryEntry_T; typedef unsigned long ProcessorFlags_T; typedef struct pt_regs Registers_T; typedef struct partition PartitionTable_T; diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 243b0b96f8d7..67c026bc29ed 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -952,7 +952,7 @@ int aha152x_detect(Scsi_Host_Template * tpnt) ok = 0; for (i = 0; i < ADDRESS_COUNT && !ok; i++) for (j = 0; (j < SIGNATURE_COUNT) && !ok; j++) - ok = check_signature(addresses[i] + signatures[j].sig_offset, + ok = isa_check_signature(addresses[i] + signatures[j].sig_offset, signatures[j].signature, signatures[j].sig_length); if (!ok && setup_count == 0) diff --git a/drivers/scsi/aic7xxx.c b/drivers/scsi/aic7xxx.c index 21e252eb441c..9f48fce9840e 100644 --- a/drivers/scsi/aic7xxx.c +++ b/drivers/scsi/aic7xxx.c @@ -263,7 +263,7 @@ */ #define VIRT_TO_BUS(a) (unsigned int)virt_to_bus((void *)(a)) -#define AIC7XXX_C_VERSION "5.1.20" +#define AIC7XXX_C_VERSION "5.1.21" #define NUMBER(arr) (sizeof(arr) / sizeof(arr[0])) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) @@ -1354,6 +1354,18 @@ static int aic7xxx_no_probe = 0; * off and give a command line option to enable it. */ static int aic7xxx_scbram = 0; +/* + * So that we can set how long each device is given as a selection timeout. + * The table of values goes like this: + * 0 - 256ms + * 1 - 128ms + * 2 - 64ms + * 3 - 32ms + * We default to 64ms because it's fast. Some old SCSI-I devices need a + * longer time. The final value has to be left shifted by 3, hence 0x10 + * is the final value. + */ +static int aic7xxx_seltime = 0x10; /* * So that insmod can find the variable and make it point to something */ @@ -1515,6 +1527,7 @@ aic7xxx_setup(char *s, int *dummy) { "dump_card", &aic7xxx_dump_card }, { "dump_sequencer", &aic7xxx_dump_sequencer }, { "scbram", &aic7xxx_scbram }, + { "seltime", &aic7xxx_seltime }, { "tag_info", NULL } }; @@ -1608,6 +1621,10 @@ aic7xxx_setup(char *s, int *dummy) else if (p[n] == ':') { *(options[i].flag) = simple_strtoul(p + n + 1, NULL, 0); + if(!strncmp(p, "seltime", n)) + { + *(options[i].flag) = (*(options[i].flag) % 4) << 3; + } } else if (!strncmp(p, "verbose", n)) { @@ -1616,6 +1633,10 @@ aic7xxx_setup(char *s, int *dummy) else { *(options[i].flag) = ~(*(options[i].flag)); + if(!strncmp(p, "seltime", n)) + { + *(options[i].flag) = (*(options[i].flag) % 4) << 3; + } } } } @@ -1850,10 +1871,13 @@ aic7xxx_download_instr(struct aic7xxx_host *p, int instrptr, } } aic_outb(p, (instr.integer & 0xff), SEQRAM); + udelay(50); aic_outb(p, ((instr.integer >> 8) & 0xff), SEQRAM); + udelay(50); aic_outb(p, ((instr.integer >> 16) & 0xff), SEQRAM); + udelay(50); aic_outb(p, ((instr.integer >> 24) & 0xff), SEQRAM); - udelay(15); + udelay(50); break; default: @@ -8117,7 +8141,7 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, aic_outb(p, p->scsi_id_b, SCSIID); scsi_conf = aic_inb(p, SCSICONF + 1); aic_outb(p, DFON | SPIOEN, SXFRCTL0); - aic_outb(p, (scsi_conf & ENSPCHK) | STIMESEL | term | + aic_outb(p, (scsi_conf & ENSPCHK) | aic7xxx_seltime | term | ENSTIMER | ACTNEGEN, SXFRCTL1); aic_outb(p, 0, SIMODE0); aic_outb(p, ENSELTIMO | ENSCSIRST | ENSCSIPERR, SIMODE1); @@ -8141,7 +8165,7 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, term = ((p->flags & (AHC_TERM_ENB_A|AHC_TERM_ENB_LVD)) ? STPWEN : 0); scsi_conf = aic_inb(p, SCSICONF); aic_outb(p, DFON | SPIOEN, SXFRCTL0); - aic_outb(p, (scsi_conf & ENSPCHK) | STIMESEL | term | + aic_outb(p, (scsi_conf & ENSPCHK) | aic7xxx_seltime | term | ENSTIMER | ACTNEGEN, SXFRCTL1); aic_outb(p, 0, SIMODE0); aic_outb(p, ENSELTIMO | ENSCSIRST | ENSCSIPERR, SIMODE1); diff --git a/drivers/scsi/aic7xxx/aic7xxx.seq b/drivers/scsi/aic7xxx/aic7xxx.seq index 4cb8e82c0416..07729599f5fc 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.seq +++ b/drivers/scsi/aic7xxx/aic7xxx.seq @@ -446,7 +446,8 @@ clear_target_state: data_phase_reinit: if ((p->features & AHC_CMD_CHAN) != 0) { if ((p->features & AHC_ULTRA2) != 0) { - bmov HCNT, SCB_RESID_DCNT, 3; + bmov HADDR, SHADDR, 4; + bmov HCNT, SCB_RESID_DCNT, 3; } bmov STCNT, SCB_RESID_DCNT, 3; } else { @@ -658,11 +659,25 @@ ultra2_dmafinish: test DFCNTRL, DIRECTION jnz ultra2_dmahalt; and DFCNTRL, ~SCSIEN; test DFCNTRL, SCSIEN jnz .; +ultra2_dmafifoflush: or DFCNTRL, FIFOFLUSH; test DFSTATUS, FIFOEMP jz . - 1; + /* + * hardware bug alert! This needless set of jumps is to + * protect against a FIFOEMP status bit glitch in the + * silicon. + */ + test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush; + test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush; + test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush; + test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush; + test DFSTATUS, FIFOEMP jz ultra2_dmafifoflush; + test DFSTATUS, MREQPEND jnz .; ultra2_dmahalt: - and DFCNTRL, ~(SCSIEN|HDMAEN); + and DFCNTRL, ~HDMAEN; test DFCNTRL, HDMAEN jnz .; + and DFCNTRL, ~SCSIEN; + test DFCNTRL, SCSIEN jnz .; bmov SCB_RESID_DCNT, STCNT, 3; mov SCB_RESID_SGCNT, SG_COUNT; or SXFRCTL0, CLRSTCNT|CLRCHN; @@ -701,8 +716,10 @@ p_command_dma_loop: test SSTAT0, DMADONE jnz p_command_ultra2_dma_done; test SSTAT1,PHASEMIS jz p_command_dma_loop; /* ie. underrun */ p_command_ultra2_dma_done: - and DFCNTRL, ~(SCSIEN|HDMAEN); + and DFCNTRL, ~HDMAEN; test DFCNTRL, HDMAEN jnz .; + and DFCNTRL, ~SCSIEN; + test DFCNTRL, SCSIEN jnz .; or SXFRCTL0, CLRSTCNT|CLRCHN; } jmp ITloop; diff --git a/drivers/scsi/aic7xxx_proc.c b/drivers/scsi/aic7xxx_proc.c index a986c5e805d6..1fb00893e3cc 100644 --- a/drivers/scsi/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx_proc.c @@ -224,6 +224,11 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length, { size += sprintf(BLS, " BIOS Memory Address: 0x%08x\n", p->bios_address); } + if( p->chip & AHC_PCI ) + { + size += sprintf(BLS, " PCI Bus 0x%02x Device 0x%02x\n", p->pci_bus, + p->pci_device_fn); + } size += sprintf(BLS, " Adapter SEEPROM Config: %s\n", (p->flags & AHC_SEEPROM_FOUND) ? "SEEPROM found and used." : ((p->flags & AHC_USEDEFAULTS) ? "SEEPROM not found, using defaults." : @@ -373,11 +378,9 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length, } else { - *start = &aic7xxx_buffer[offset]; /* Start of wanted data */ - if (size - offset < length) - { - length = size - offset; - } + *start = buffer; + length = MIN(length, size - offset); + memcpy(buffer, &aic7xxx_buffer[offset], length); } return (length); diff --git a/drivers/scsi/aic7xxx_seq.c b/drivers/scsi/aic7xxx_seq.c index f11373fef153..49502b6cd5bc 100644 --- a/drivers/scsi/aic7xxx_seq.c +++ b/drivers/scsi/aic7xxx_seq.c @@ -26,12 +26,12 @@ static unsigned char seqprog[] = { 0x00, 0x4d, 0x12, 0x70, 0x01, 0x4e, 0x9c, 0x18, 0xbf, 0x60, 0xc0, 0x08, - 0x00, 0x6a, 0x92, 0x5c, + 0x00, 0x6a, 0xa8, 0x5c, 0xff, 0x4e, 0xc8, 0x18, - 0x02, 0x6a, 0xa8, 0x5b, + 0x02, 0x6a, 0xbe, 0x5b, 0xff, 0x52, 0x20, 0x09, 0x0d, 0x6a, 0x6a, 0x00, - 0x00, 0x52, 0x1e, 0x5c, + 0x00, 0x52, 0x34, 0x5c, 0x03, 0xb0, 0x52, 0x31, 0xff, 0xb0, 0x52, 0x09, 0xff, 0xb1, 0x54, 0x09, @@ -76,7 +76,7 @@ static unsigned char seqprog[] = { 0x10, 0x03, 0xfc, 0x78, 0xff, 0x50, 0xc8, 0x08, 0x88, 0x6a, 0xcc, 0x00, - 0x49, 0x6a, 0x0e, 0x5c, + 0x49, 0x6a, 0x24, 0x5c, 0x01, 0x6a, 0x26, 0x01, 0xff, 0x6a, 0xca, 0x08, 0x08, 0x01, 0x02, 0x00, @@ -117,11 +117,11 @@ static unsigned char seqprog[] = { 0xff, 0x65, 0xca, 0x18, 0xff, 0x65, 0xd8, 0x68, 0x0a, 0x93, 0x26, 0x01, - 0x00, 0x65, 0x84, 0x5c, + 0x00, 0x65, 0x9a, 0x5c, 0x40, 0x51, 0xf0, 0x78, 0xe4, 0x6a, 0x06, 0x00, 0x08, 0x01, 0x02, 0x00, - 0x04, 0x6a, 0x40, 0x5b, + 0x04, 0x6a, 0x56, 0x5b, 0x01, 0x50, 0xa0, 0x18, 0x00, 0x50, 0xf6, 0xe0, 0xff, 0x6a, 0xa0, 0x08, @@ -147,13 +147,13 @@ static unsigned char seqprog[] = { 0x08, 0x6a, 0x66, 0x58, 0x80, 0x6a, 0x68, 0x00, 0x80, 0x36, 0x6c, 0x00, - 0x00, 0x65, 0xf2, 0x5b, + 0x00, 0x65, 0x08, 0x5c, 0xff, 0x3d, 0xc8, 0x08, - 0xbf, 0x64, 0x58, 0x79, - 0x80, 0x64, 0x0e, 0x72, - 0xa0, 0x64, 0x3a, 0x72, - 0xc0, 0x64, 0x32, 0x72, - 0xe0, 0x64, 0x7a, 0x72, + 0xbf, 0x64, 0x5a, 0x79, + 0x80, 0x64, 0x20, 0x72, + 0xa0, 0x64, 0x50, 0x72, + 0xc0, 0x64, 0x48, 0x72, + 0xe0, 0x64, 0x90, 0x72, 0x01, 0x6a, 0x22, 0x01, 0x00, 0x65, 0x22, 0x41, 0xf7, 0x11, 0x22, 0x08, @@ -169,16 +169,17 @@ static unsigned char seqprog[] = { 0xdf, 0x01, 0x02, 0x08, 0x01, 0x6a, 0x7a, 0x00, 0xff, 0x6a, 0x6c, 0x0c, + 0x04, 0x14, 0x10, 0x31, 0x03, 0xa9, 0x18, 0x31, 0x03, 0xa9, 0x10, 0x30, 0x08, 0x6a, 0xcc, 0x00, - 0xa9, 0x6a, 0x08, 0x5c, - 0x00, 0x65, 0x78, 0x41, + 0xa9, 0x6a, 0x1e, 0x5c, + 0x00, 0x65, 0x7a, 0x41, 0xa8, 0x6a, 0x6a, 0x00, 0x79, 0x6a, 0x6a, 0x00, - 0x40, 0x3d, 0x60, 0x69, + 0x40, 0x3d, 0x62, 0x69, 0x04, 0x35, 0x6a, 0x00, - 0x00, 0x65, 0x62, 0x5b, + 0x00, 0x65, 0x78, 0x5b, 0x80, 0x6a, 0xd4, 0x01, 0x10, 0x36, 0x4e, 0x69, 0x10, 0x36, 0x6c, 0x00, @@ -186,11 +187,11 @@ static unsigned char seqprog[] = { 0x03, 0x8c, 0x10, 0x30, 0x05, 0xa3, 0x70, 0x30, 0x88, 0x6a, 0xcc, 0x00, - 0xac, 0x6a, 0x00, 0x5c, - 0x00, 0x65, 0xfa, 0x5b, + 0xac, 0x6a, 0x16, 0x5c, + 0x00, 0x65, 0x10, 0x5c, 0x38, 0x6a, 0xcc, 0x00, - 0xa3, 0x6a, 0x04, 0x5c, - 0xff, 0x38, 0x88, 0x69, + 0xa3, 0x6a, 0x1a, 0x5c, + 0xff, 0x38, 0x8a, 0x69, 0x80, 0x02, 0x04, 0x00, 0xe7, 0x35, 0x6a, 0x08, 0x03, 0x69, 0x18, 0x31, @@ -198,51 +199,51 @@ static unsigned char seqprog[] = { 0xff, 0x6a, 0x10, 0x00, 0xff, 0x6a, 0x12, 0x00, 0xff, 0x6a, 0x14, 0x00, - 0x01, 0x38, 0x8c, 0x61, + 0x01, 0x38, 0x8e, 0x61, 0xbf, 0x35, 0x6a, 0x08, 0xff, 0x69, 0xca, 0x08, 0xff, 0x35, 0x26, 0x09, - 0x04, 0x0b, 0x90, 0x69, + 0x04, 0x0b, 0x92, 0x69, + 0x04, 0x0b, 0x9e, 0x69, + 0x10, 0x0c, 0x94, 0x79, 0x04, 0x0b, 0x9c, 0x69, - 0x10, 0x0c, 0x92, 0x79, - 0x04, 0x0b, 0x9a, 0x69, 0xff, 0x6a, 0xca, 0x08, - 0x00, 0x35, 0x4a, 0x5b, - 0x80, 0x02, 0xf0, 0x69, - 0xff, 0x65, 0xe0, 0x79, + 0x00, 0x35, 0x60, 0x5b, + 0x80, 0x02, 0xf2, 0x69, + 0xff, 0x65, 0xe2, 0x79, 0xff, 0x38, 0x70, 0x18, - 0xff, 0x38, 0xe0, 0x79, - 0x80, 0xea, 0xbc, 0x61, + 0xff, 0x38, 0xe2, 0x79, + 0x80, 0xea, 0xbe, 0x61, 0xef, 0x38, 0xc8, 0x18, 0x80, 0x6a, 0xc8, 0x00, - 0x00, 0x65, 0xae, 0x49, + 0x00, 0x65, 0xb0, 0x49, 0x33, 0x38, 0xc8, 0x28, 0xff, 0x64, 0xd0, 0x09, 0x04, 0x39, 0xc0, 0x31, 0x09, 0x6a, 0xd6, 0x01, - 0x80, 0xeb, 0xb4, 0x79, + 0x80, 0xeb, 0xb6, 0x79, 0xf7, 0xeb, 0xd6, 0x09, - 0x08, 0xeb, 0xb8, 0x69, + 0x08, 0xeb, 0xba, 0x69, 0x01, 0x6a, 0xd6, 0x01, 0x08, 0xe9, 0x10, 0x31, 0x03, 0x8c, 0x10, 0x30, 0x88, 0x6a, 0xcc, 0x00, - 0x39, 0x6a, 0x06, 0x5c, + 0x39, 0x6a, 0x1c, 0x5c, 0x08, 0x6a, 0x18, 0x01, 0xff, 0x6a, 0x1a, 0x09, 0xff, 0x6a, 0x1c, 0x09, 0x0d, 0x93, 0x26, 0x01, - 0x00, 0x65, 0x84, 0x5c, - 0x88, 0x6a, 0x74, 0x5c, - 0x00, 0x65, 0xfa, 0x5b, + 0x00, 0x65, 0x9a, 0x5c, + 0x88, 0x6a, 0x8a, 0x5c, + 0x00, 0x65, 0x10, 0x5c, 0xff, 0x6a, 0xc8, 0x08, 0x08, 0x39, 0x72, 0x18, 0x00, 0x3a, 0x74, 0x20, - 0x01, 0x0c, 0xd8, 0x79, - 0x10, 0x0c, 0x78, 0x79, + 0x01, 0x0c, 0xda, 0x79, + 0x10, 0x0c, 0x7a, 0x79, 0xff, 0x35, 0x26, 0x09, - 0x04, 0x0b, 0xde, 0x69, - 0x00, 0x65, 0xf8, 0x59, + 0x04, 0x0b, 0xe0, 0x69, + 0x00, 0x65, 0xfa, 0x59, 0x03, 0x08, 0x52, 0x31, 0xff, 0x38, 0x50, 0x09, 0xff, 0x08, 0x52, 0x09, @@ -250,265 +251,275 @@ static unsigned char seqprog[] = { 0xff, 0x0a, 0x56, 0x09, 0xff, 0x38, 0x50, 0x09, 0x00, 0x65, 0x22, 0x41, - 0x00, 0x65, 0xf8, 0x59, + 0x00, 0x65, 0xfa, 0x59, 0x7f, 0x02, 0x04, 0x08, 0xe1, 0x6a, 0x22, 0x01, 0x00, 0x65, 0x22, 0x41, - 0x04, 0x93, 0x02, 0x6a, + 0x04, 0x93, 0x10, 0x6a, 0xdf, 0x93, 0x26, 0x09, - 0x20, 0x93, 0xfc, 0x69, + 0x20, 0x93, 0xfe, 0x69, 0x02, 0x93, 0x26, 0x01, - 0x01, 0x94, 0xfe, 0x79, - 0xd7, 0x93, 0x26, 0x09, - 0x08, 0x93, 0x04, 0x6a, + 0x01, 0x94, 0x00, 0x7a, + 0x01, 0x94, 0x00, 0x7a, + 0x01, 0x94, 0x00, 0x7a, + 0x01, 0x94, 0x00, 0x7a, + 0x01, 0x94, 0x00, 0x7a, + 0x01, 0x94, 0x00, 0x7a, + 0x10, 0x94, 0x0e, 0x6a, + 0xf7, 0x93, 0x26, 0x09, + 0x08, 0x93, 0x12, 0x6a, + 0xdf, 0x93, 0x26, 0x09, + 0x20, 0x93, 0x16, 0x6a, 0x03, 0x08, 0x52, 0x31, 0xff, 0x38, 0x50, 0x09, 0x12, 0x01, 0x02, 0x00, 0xff, 0x6a, 0xd4, 0x0c, - 0x00, 0x65, 0x62, 0x5b, + 0x00, 0x65, 0x78, 0x5b, 0x05, 0xb4, 0x10, 0x31, 0x02, 0x6a, 0x1a, 0x31, 0x03, 0x8c, 0x10, 0x30, 0x88, 0x6a, 0xcc, 0x00, - 0xb4, 0x6a, 0x04, 0x5c, + 0xb4, 0x6a, 0x1a, 0x5c, 0xff, 0x6a, 0x1a, 0x09, 0xff, 0x6a, 0x1c, 0x09, - 0x00, 0x65, 0xfa, 0x5b, - 0x3d, 0x6a, 0x4a, 0x5b, + 0x00, 0x65, 0x10, 0x5c, + 0x3d, 0x6a, 0x60, 0x5b, 0xac, 0x6a, 0x26, 0x01, - 0x04, 0x0b, 0x24, 0x6a, - 0x01, 0x0b, 0x2a, 0x6a, - 0x10, 0x0c, 0x26, 0x7a, - 0xd7, 0x93, 0x26, 0x09, - 0x08, 0x93, 0x2c, 0x6a, + 0x04, 0x0b, 0x36, 0x6a, + 0x01, 0x0b, 0x3c, 0x6a, + 0x10, 0x0c, 0x38, 0x7a, + 0xf7, 0x93, 0x26, 0x09, + 0x08, 0x93, 0x3e, 0x6a, + 0xdf, 0x93, 0x26, 0x09, + 0x20, 0x93, 0x42, 0x6a, 0x12, 0x01, 0x02, 0x00, 0x00, 0x65, 0x22, 0x41, - 0x00, 0x65, 0x62, 0x5b, + 0x00, 0x65, 0x78, 0x5b, 0xff, 0x06, 0x44, 0x09, 0x00, 0x65, 0x22, 0x41, 0x10, 0x3d, 0x06, 0x00, 0xff, 0x34, 0xca, 0x08, - 0x80, 0x65, 0x5e, 0x62, + 0x80, 0x65, 0x74, 0x62, 0x0f, 0xa1, 0xca, 0x08, 0x07, 0xa1, 0xca, 0x08, 0x40, 0xa0, 0xc8, 0x08, 0x00, 0x65, 0xca, 0x00, 0x80, 0x65, 0xca, 0x00, - 0x80, 0xa0, 0x4e, 0x7a, + 0x80, 0xa0, 0x64, 0x7a, 0xff, 0x65, 0x0c, 0x08, - 0x00, 0x65, 0x60, 0x42, - 0x20, 0xa0, 0x66, 0x7a, + 0x00, 0x65, 0x76, 0x42, + 0x20, 0xa0, 0x7c, 0x7a, 0xff, 0x65, 0x0c, 0x08, - 0x00, 0x65, 0xf2, 0x5b, - 0xa0, 0x3d, 0x6e, 0x62, + 0x00, 0x65, 0x08, 0x5c, + 0xa0, 0x3d, 0x84, 0x62, 0x23, 0xa0, 0x0c, 0x08, - 0x00, 0x65, 0xf2, 0x5b, - 0xa0, 0x3d, 0x6e, 0x62, - 0x00, 0xb9, 0x66, 0x42, - 0xff, 0x65, 0x66, 0x62, + 0x00, 0x65, 0x08, 0x5c, + 0xa0, 0x3d, 0x84, 0x62, + 0x00, 0xb9, 0x7c, 0x42, + 0xff, 0x65, 0x7c, 0x62, 0xa1, 0x6a, 0x22, 0x01, 0xff, 0x6a, 0xd4, 0x08, - 0x10, 0x51, 0x6e, 0x72, + 0x10, 0x51, 0x84, 0x72, 0x40, 0x6a, 0x18, 0x00, 0xff, 0x65, 0x0c, 0x08, - 0x00, 0x65, 0xf2, 0x5b, - 0xa0, 0x3d, 0x38, 0x72, + 0x00, 0x65, 0x08, 0x5c, + 0xa0, 0x3d, 0x4e, 0x72, 0x40, 0x6a, 0x18, 0x00, 0xff, 0x34, 0xa6, 0x08, - 0x80, 0x34, 0x76, 0x62, + 0x80, 0x34, 0x8c, 0x62, 0x7f, 0xa0, 0x40, 0x09, 0x08, 0x6a, 0x68, 0x00, 0x00, 0x65, 0x22, 0x41, - 0x64, 0x6a, 0x3a, 0x5b, - 0x80, 0x64, 0xea, 0x6a, - 0x04, 0x64, 0xcc, 0x72, - 0x02, 0x64, 0xd2, 0x72, - 0x00, 0x6a, 0x94, 0x72, - 0x03, 0x64, 0xe6, 0x72, - 0x01, 0x64, 0xc8, 0x72, - 0x07, 0x64, 0x28, 0x73, - 0x08, 0x64, 0x90, 0x72, + 0x64, 0x6a, 0x50, 0x5b, + 0x80, 0x64, 0x00, 0x6b, + 0x04, 0x64, 0xe2, 0x72, + 0x02, 0x64, 0xe8, 0x72, + 0x00, 0x6a, 0xaa, 0x72, + 0x03, 0x64, 0xfc, 0x72, + 0x01, 0x64, 0xde, 0x72, + 0x07, 0x64, 0x3e, 0x73, + 0x08, 0x64, 0xa6, 0x72, 0x11, 0x6a, 0x22, 0x01, - 0x07, 0x6a, 0x2c, 0x5b, + 0x07, 0x6a, 0x42, 0x5b, 0xff, 0x06, 0xd4, 0x08, 0x00, 0x65, 0x22, 0x41, - 0xff, 0xa8, 0x98, 0x6a, - 0xff, 0xa2, 0xb0, 0x7a, + 0xff, 0xa8, 0xae, 0x6a, + 0xff, 0xa2, 0xc6, 0x7a, 0x01, 0x6a, 0x6a, 0x00, - 0x00, 0xb9, 0x1e, 0x5c, - 0xff, 0xa2, 0xb0, 0x7a, + 0x00, 0xb9, 0x34, 0x5c, + 0xff, 0xa2, 0xc6, 0x7a, 0x71, 0x6a, 0x22, 0x01, 0xff, 0x6a, 0xd4, 0x08, - 0x40, 0x51, 0xb0, 0x62, + 0x40, 0x51, 0xc6, 0x62, 0x0d, 0x6a, 0x6a, 0x00, - 0x00, 0xb9, 0x1e, 0x5c, + 0x00, 0xb9, 0x34, 0x5c, 0xff, 0x3e, 0x74, 0x09, 0xff, 0x90, 0x7c, 0x08, 0x00, 0x65, 0x50, 0x58, 0x00, 0x65, 0x34, 0x41, - 0x20, 0xa0, 0xb8, 0x6a, + 0x20, 0xa0, 0xce, 0x6a, 0xff, 0x37, 0xc8, 0x08, - 0x00, 0x6a, 0xc8, 0x5b, - 0xff, 0x6a, 0xde, 0x5b, + 0x00, 0x6a, 0xde, 0x5b, + 0xff, 0x6a, 0xf4, 0x5b, 0xff, 0xf8, 0xc8, 0x08, 0xff, 0x4f, 0xc8, 0x08, - 0x01, 0x6a, 0xc8, 0x5b, - 0x00, 0xb9, 0xde, 0x5b, + 0x01, 0x6a, 0xde, 0x5b, + 0x00, 0xb9, 0xf4, 0x5b, 0x01, 0x4f, 0x9e, 0x18, 0x02, 0x6a, 0x22, 0x01, - 0x00, 0x65, 0x8c, 0x5c, + 0x00, 0x65, 0xa2, 0x5c, 0x00, 0x65, 0x34, 0x41, 0x41, 0x6a, 0x22, 0x01, 0x00, 0x65, 0x22, 0x41, 0x04, 0xa0, 0x40, 0x01, - 0x00, 0x65, 0xa4, 0x5c, + 0x00, 0x65, 0xba, 0x5c, 0x00, 0x65, 0x34, 0x41, - 0x10, 0x36, 0x90, 0x7a, + 0x10, 0x36, 0xa6, 0x7a, 0x05, 0x38, 0x46, 0x31, 0x04, 0x14, 0x58, 0x31, 0x03, 0xa9, 0x60, 0x31, 0xa3, 0x6a, 0xcc, 0x00, - 0x38, 0x6a, 0x04, 0x5c, + 0x38, 0x6a, 0x1a, 0x5c, 0xac, 0x6a, 0xcc, 0x00, - 0x14, 0x6a, 0x06, 0x5c, - 0xa9, 0x6a, 0x08, 0x5c, - 0x00, 0x65, 0x90, 0x42, + 0x14, 0x6a, 0x1c, 0x5c, + 0xa9, 0x6a, 0x1e, 0x5c, + 0x00, 0x65, 0xa6, 0x42, 0xef, 0x36, 0x6c, 0x08, - 0x00, 0x65, 0x90, 0x42, + 0x00, 0x65, 0xa6, 0x42, 0x0f, 0x64, 0xc8, 0x08, 0x07, 0x64, 0xc8, 0x08, 0x00, 0x37, 0x6e, 0x00, 0xff, 0x6a, 0xa4, 0x00, - 0x00, 0x65, 0x98, 0x5b, - 0xff, 0x51, 0xfc, 0x72, - 0x20, 0x36, 0x06, 0x7b, - 0x00, 0x90, 0x86, 0x5b, - 0x00, 0x65, 0x08, 0x43, + 0x00, 0x65, 0xae, 0x5b, + 0xff, 0x51, 0x12, 0x73, + 0x20, 0x36, 0x1c, 0x7b, + 0x00, 0x90, 0x9c, 0x5b, + 0x00, 0x65, 0x1e, 0x43, 0xff, 0x06, 0xd4, 0x08, - 0x00, 0x65, 0xf2, 0x5b, - 0xe0, 0x3d, 0x22, 0x63, - 0x20, 0x12, 0x22, 0x63, - 0x51, 0x6a, 0x30, 0x5b, - 0x00, 0x65, 0x80, 0x5b, + 0x00, 0x65, 0x08, 0x5c, + 0xe0, 0x3d, 0x38, 0x63, + 0x20, 0x12, 0x38, 0x63, + 0x51, 0x6a, 0x46, 0x5b, + 0x00, 0x65, 0x96, 0x5b, 0xff, 0x37, 0xc8, 0x08, - 0x00, 0xa1, 0x1a, 0x63, - 0x04, 0xa0, 0x1a, 0x7b, + 0x00, 0xa1, 0x30, 0x63, + 0x04, 0xa0, 0x30, 0x7b, 0xfb, 0xa0, 0x40, 0x09, 0x80, 0x36, 0x6c, 0x00, - 0x80, 0xa0, 0x90, 0x7a, + 0x80, 0xa0, 0xa6, 0x7a, 0x7f, 0xa0, 0x40, 0x09, - 0xff, 0x6a, 0x2c, 0x5b, - 0x00, 0x65, 0x90, 0x42, - 0x04, 0xa0, 0x20, 0x7b, - 0x00, 0x65, 0xa4, 0x5c, - 0x00, 0x65, 0x22, 0x43, - 0x00, 0x65, 0x8c, 0x5c, + 0xff, 0x6a, 0x42, 0x5b, + 0x00, 0x65, 0xa6, 0x42, + 0x04, 0xa0, 0x36, 0x7b, + 0x00, 0x65, 0xba, 0x5c, + 0x00, 0x65, 0x38, 0x43, + 0x00, 0x65, 0xa2, 0x5c, 0x31, 0x6a, 0x22, 0x01, - 0x0c, 0x6a, 0x2c, 0x5b, - 0x00, 0x65, 0x90, 0x42, + 0x0c, 0x6a, 0x42, 0x5b, + 0x00, 0x65, 0xa6, 0x42, 0x61, 0x6a, 0x22, 0x01, - 0x00, 0x65, 0x90, 0x42, + 0x00, 0x65, 0xa6, 0x42, 0x10, 0x3d, 0x06, 0x00, 0xff, 0x65, 0x68, 0x0c, 0xff, 0x06, 0xd4, 0x08, - 0x01, 0x0c, 0x32, 0x7b, - 0x04, 0x0c, 0x32, 0x6b, + 0x01, 0x0c, 0x48, 0x7b, + 0x04, 0x0c, 0x48, 0x6b, 0xe0, 0x03, 0x7a, 0x08, - 0xe0, 0x3d, 0x46, 0x63, + 0xe0, 0x3d, 0x5c, 0x63, 0xff, 0x65, 0xcc, 0x08, 0xff, 0x12, 0xda, 0x0c, 0xff, 0x06, 0xd4, 0x0c, 0xff, 0x65, 0x0c, 0x08, - 0x02, 0x0b, 0x42, 0x7b, + 0x02, 0x0b, 0x58, 0x7b, 0xff, 0x6a, 0xd4, 0x0c, 0xd1, 0x6a, 0x22, 0x01, 0x00, 0x65, 0x22, 0x41, 0xff, 0x65, 0x26, 0x09, - 0x01, 0x0b, 0x5a, 0x6b, - 0x10, 0x0c, 0x4c, 0x7b, - 0x04, 0x0b, 0x54, 0x6b, + 0x01, 0x0b, 0x70, 0x6b, + 0x10, 0x0c, 0x62, 0x7b, + 0x04, 0x0b, 0x6a, 0x6b, 0xff, 0x6a, 0xca, 0x08, - 0x04, 0x93, 0x58, 0x6b, - 0x01, 0x94, 0x56, 0x7b, - 0x10, 0x94, 0x58, 0x6b, + 0x04, 0x93, 0x6e, 0x6b, + 0x01, 0x94, 0x6c, 0x7b, + 0x10, 0x94, 0x6e, 0x6b, 0xc7, 0x93, 0x26, 0x09, 0xff, 0x99, 0xd4, 0x08, - 0x38, 0x93, 0x5c, 0x6b, + 0x38, 0x93, 0x72, 0x6b, 0xff, 0x6a, 0xd4, 0x0c, - 0x80, 0x36, 0x60, 0x6b, + 0x80, 0x36, 0x76, 0x6b, 0x21, 0x6a, 0x22, 0x05, 0xff, 0x65, 0x20, 0x09, - 0xff, 0x51, 0x6e, 0x63, + 0xff, 0x51, 0x84, 0x63, 0xff, 0x37, 0xc8, 0x08, - 0xa1, 0x6a, 0x7a, 0x43, + 0xa1, 0x6a, 0x90, 0x43, 0xff, 0x51, 0xc8, 0x08, - 0xb9, 0x6a, 0x7a, 0x43, + 0xb9, 0x6a, 0x90, 0x43, 0xff, 0x90, 0xa4, 0x08, - 0xff, 0xba, 0x7e, 0x73, + 0xff, 0xba, 0x94, 0x73, 0xff, 0xba, 0x20, 0x09, 0xff, 0x65, 0xca, 0x18, - 0x00, 0x6c, 0x72, 0x63, + 0x00, 0x6c, 0x88, 0x63, 0xff, 0x90, 0xca, 0x0c, 0xff, 0x6a, 0xca, 0x04, - 0x20, 0x36, 0x92, 0x7b, - 0x00, 0x90, 0x66, 0x5b, - 0xff, 0x65, 0x92, 0x73, - 0xff, 0x52, 0x90, 0x73, + 0x20, 0x36, 0xa8, 0x7b, + 0x00, 0x90, 0x7c, 0x5b, + 0xff, 0x65, 0xa8, 0x73, + 0xff, 0x52, 0xa6, 0x73, 0xff, 0xba, 0xcc, 0x08, 0xff, 0x52, 0x20, 0x09, 0xff, 0x66, 0x74, 0x09, 0xff, 0x65, 0x20, 0x0d, 0xff, 0xba, 0x7e, 0x0c, - 0x00, 0x6a, 0x92, 0x5c, + 0x00, 0x6a, 0xa8, 0x5c, 0x0d, 0x6a, 0x6a, 0x00, - 0x00, 0x51, 0x1e, 0x44, - 0xff, 0x3f, 0xec, 0x73, + 0x00, 0x51, 0x34, 0x44, + 0xff, 0x3f, 0x02, 0x74, 0xff, 0x6a, 0xa2, 0x00, - 0x00, 0x3f, 0x66, 0x5b, - 0xff, 0x65, 0xec, 0x73, + 0x00, 0x3f, 0x7c, 0x5b, + 0xff, 0x65, 0x02, 0x74, 0x20, 0x36, 0x6c, 0x00, - 0x20, 0xa0, 0xa6, 0x6b, + 0x20, 0xa0, 0xbc, 0x6b, 0xff, 0xb9, 0xa2, 0x0c, 0xff, 0x6a, 0xa2, 0x04, 0xff, 0x65, 0xa4, 0x08, 0xe0, 0x6a, 0xcc, 0x00, - 0x45, 0x6a, 0x12, 0x5c, + 0x45, 0x6a, 0x28, 0x5c, 0x01, 0x6a, 0xd0, 0x01, 0x09, 0x6a, 0xd6, 0x01, - 0x80, 0xeb, 0xb2, 0x7b, + 0x80, 0xeb, 0xc8, 0x7b, 0x01, 0x6a, 0xd6, 0x01, 0x01, 0xe9, 0xa4, 0x34, 0x88, 0x6a, 0xcc, 0x00, - 0x45, 0x6a, 0x12, 0x5c, + 0x45, 0x6a, 0x28, 0x5c, 0x01, 0x6a, 0x18, 0x01, 0xff, 0x6a, 0x1a, 0x09, 0xff, 0x6a, 0x1c, 0x09, 0x0d, 0x6a, 0x26, 0x01, - 0x00, 0x65, 0x84, 0x5c, + 0x00, 0x65, 0x9a, 0x5c, 0xff, 0x99, 0xa4, 0x0c, 0xff, 0x65, 0xa4, 0x08, 0xe0, 0x6a, 0xcc, 0x00, - 0x45, 0x6a, 0x12, 0x5c, + 0x45, 0x6a, 0x28, 0x5c, 0x01, 0x6a, 0xd0, 0x01, 0x01, 0x6a, 0xdc, 0x05, 0x88, 0x6a, 0xcc, 0x00, - 0x45, 0x6a, 0x12, 0x5c, + 0x45, 0x6a, 0x28, 0x5c, 0x01, 0x6a, 0x18, 0x01, 0xff, 0x6a, 0x1a, 0x09, 0xff, 0x6a, 0x1c, 0x09, 0x01, 0x6a, 0x26, 0x05, 0x01, 0x65, 0xd8, 0x31, 0x09, 0xee, 0xdc, 0x01, - 0x80, 0xee, 0xe2, 0x7b, + 0x80, 0xee, 0xf8, 0x7b, 0xff, 0x6a, 0xdc, 0x0d, 0xff, 0x65, 0x32, 0x09, 0x0a, 0x93, 0x26, 0x01, - 0x00, 0x65, 0x84, 0x44, + 0x00, 0x65, 0x9a, 0x44, 0xff, 0x37, 0xc8, 0x08, - 0x00, 0x6a, 0xa8, 0x5b, + 0x00, 0x6a, 0xbe, 0x5b, 0xff, 0x52, 0xa2, 0x0c, - 0x01, 0x0c, 0xf2, 0x7b, - 0x04, 0x0c, 0xf2, 0x6b, + 0x01, 0x0c, 0x08, 0x7c, + 0x04, 0x0c, 0x08, 0x6c, 0xe0, 0x03, 0x06, 0x08, 0xe0, 0x03, 0x7a, 0x0c, 0xff, 0x8c, 0x10, 0x08, @@ -531,29 +542,29 @@ static unsigned char seqprog[] = { 0x00, 0x6c, 0xda, 0x24, 0xff, 0x65, 0xc8, 0x08, 0xe0, 0x6a, 0xcc, 0x00, - 0x41, 0x6a, 0x0e, 0x5c, + 0x41, 0x6a, 0x24, 0x5c, 0xff, 0x90, 0xe2, 0x09, 0x20, 0x6a, 0xd0, 0x01, - 0x04, 0x35, 0x30, 0x7c, + 0x04, 0x35, 0x46, 0x7c, 0x1d, 0x6a, 0xdc, 0x01, - 0xdc, 0xee, 0x2c, 0x64, - 0x00, 0x65, 0x3c, 0x44, + 0xdc, 0xee, 0x42, 0x64, + 0x00, 0x65, 0x52, 0x44, 0x01, 0x6a, 0xdc, 0x01, 0x20, 0xa0, 0xd8, 0x31, 0x09, 0xee, 0xdc, 0x01, - 0x80, 0xee, 0x36, 0x7c, + 0x80, 0xee, 0x4c, 0x7c, 0x19, 0x6a, 0xdc, 0x01, - 0xd8, 0xee, 0x3a, 0x64, + 0xd8, 0xee, 0x50, 0x64, 0xff, 0x6a, 0xdc, 0x09, - 0x18, 0xee, 0x3e, 0x6c, + 0x18, 0xee, 0x54, 0x6c, 0xff, 0x6a, 0xd4, 0x0c, 0x88, 0x6a, 0xcc, 0x00, - 0x41, 0x6a, 0x0e, 0x5c, + 0x41, 0x6a, 0x24, 0x5c, 0x20, 0x6a, 0x18, 0x01, 0xff, 0x6a, 0x1a, 0x09, 0xff, 0x6a, 0x1c, 0x09, 0xff, 0x35, 0x26, 0x09, - 0x04, 0x35, 0x68, 0x6c, + 0x04, 0x35, 0x7e, 0x6c, 0xa0, 0x6a, 0xca, 0x00, 0x20, 0x65, 0xc8, 0x18, 0xff, 0x6c, 0x32, 0x09, @@ -564,14 +575,14 @@ static unsigned char seqprog[] = { 0xff, 0x6c, 0x32, 0x09, 0xff, 0x6c, 0x32, 0x09, 0xff, 0x6c, 0x32, 0x09, - 0x00, 0x65, 0x54, 0x64, + 0x00, 0x65, 0x6a, 0x64, 0x0a, 0x93, 0x26, 0x01, - 0x00, 0x65, 0x84, 0x5c, - 0x04, 0x35, 0x60, 0x7b, - 0xa0, 0x6a, 0x74, 0x5c, - 0x00, 0x65, 0x76, 0x5c, - 0x00, 0x65, 0x76, 0x5c, - 0x00, 0x65, 0x76, 0x44, + 0x00, 0x65, 0x9a, 0x5c, + 0x04, 0x35, 0x76, 0x7b, + 0xa0, 0x6a, 0x8a, 0x5c, + 0x00, 0x65, 0x8c, 0x5c, + 0x00, 0x65, 0x8c, 0x5c, + 0x00, 0x65, 0x8c, 0x44, 0xff, 0x65, 0xcc, 0x08, 0xff, 0x99, 0xda, 0x08, 0xff, 0x99, 0xda, 0x08, @@ -580,19 +591,19 @@ static unsigned char seqprog[] = { 0xff, 0x99, 0xda, 0x08, 0xff, 0x99, 0xda, 0x08, 0xff, 0x99, 0xda, 0x0c, - 0x08, 0x94, 0x84, 0x7c, + 0x08, 0x94, 0x9a, 0x7c, 0xf7, 0x93, 0x26, 0x09, - 0x08, 0x93, 0x88, 0x6c, + 0x08, 0x93, 0x9e, 0x6c, 0xff, 0x6a, 0xd4, 0x0c, 0xff, 0x40, 0x74, 0x09, 0xff, 0x90, 0x80, 0x08, 0xff, 0x6a, 0x72, 0x05, - 0xff, 0x40, 0xa0, 0x64, - 0xff, 0x3f, 0x98, 0x64, + 0xff, 0x40, 0xb6, 0x64, + 0xff, 0x3f, 0xae, 0x64, 0xff, 0x6a, 0xca, 0x04, 0xff, 0x3f, 0x20, 0x09, 0x01, 0x6a, 0x6a, 0x00, - 0x00, 0xb9, 0x1e, 0x5c, + 0x00, 0xb9, 0x34, 0x5c, 0xff, 0xba, 0x7e, 0x0c, 0xff, 0x40, 0x20, 0x09, 0xff, 0xba, 0x80, 0x0c, @@ -739,60 +750,60 @@ struct sequencer_patch { { aic7xxx_patch1_func, 68, 60, 1 }, { aic7xxx_patch8_func, 162, 1, 2 }, { aic7xxx_patch0_func, 163, 2, 1 }, - { aic7xxx_patch2_func, 167, 2, 3 }, - { aic7xxx_patch8_func, 167, 1, 1 }, - { aic7xxx_patch0_func, 169, 2, 1 }, - { aic7xxx_patch8_func, 172, 1, 2 }, - { aic7xxx_patch0_func, 173, 1, 1 }, - { aic7xxx_patch2_func, 177, 1, 1 }, - { aic7xxx_patch2_func, 180, 3, 2 }, - { aic7xxx_patch0_func, 183, 5, 1 }, - { aic7xxx_patch2_func, 191, 2, 3 }, - { aic7xxx_patch8_func, 191, 1, 1 }, - { aic7xxx_patch0_func, 193, 3, 1 }, - { aic7xxx_patch10_func, 196, 2, 1 }, - { aic7xxx_patch8_func, 198, 7, 2 }, - { aic7xxx_patch0_func, 205, 1, 1 }, - { aic7xxx_patch2_func, 210, 14, 3 }, - { aic7xxx_patch10_func, 223, 1, 1 }, - { aic7xxx_patch0_func, 224, 9, 1 }, - { aic7xxx_patch8_func, 238, 2, 1 }, - { aic7xxx_patch8_func, 240, 1, 1 }, - { aic7xxx_patch10_func, 241, 6, 3 }, - { aic7xxx_patch2_func, 241, 2, 2 }, - { aic7xxx_patch0_func, 243, 4, 1 }, - { aic7xxx_patch8_func, 248, 1, 1 }, - { aic7xxx_patch8_func, 252, 11, 1 }, - { aic7xxx_patch2_func, 264, 3, 3 }, - { aic7xxx_patch10_func, 266, 1, 1 }, - { aic7xxx_patch0_func, 267, 5, 1 }, - { aic7xxx_patch10_func, 272, 1, 2 }, - { aic7xxx_patch0_func, 273, 7, 1 }, - { aic7xxx_patch11_func, 287, 1, 2 }, - { aic7xxx_patch0_func, 288, 1, 1 }, - { aic7xxx_patch5_func, 348, 1, 2 }, - { aic7xxx_patch0_func, 349, 1, 1 }, - { aic7xxx_patch3_func, 352, 1, 1 }, - { aic7xxx_patch2_func, 362, 3, 2 }, - { aic7xxx_patch0_func, 365, 5, 1 }, - { aic7xxx_patch11_func, 373, 1, 2 }, - { aic7xxx_patch0_func, 374, 1, 1 }, - { aic7xxx_patch6_func, 379, 1, 1 }, - { aic7xxx_patch1_func, 416, 3, 1 }, - { aic7xxx_patch10_func, 421, 11, 1 }, - { aic7xxx_patch2_func, 469, 7, 2 }, - { aic7xxx_patch0_func, 476, 8, 1 }, - { aic7xxx_patch2_func, 485, 4, 2 }, - { aic7xxx_patch0_func, 489, 6, 1 }, - { aic7xxx_patch2_func, 495, 4, 2 }, - { aic7xxx_patch0_func, 499, 3, 1 }, - { aic7xxx_patch12_func, 509, 10, 1 }, - { aic7xxx_patch2_func, 528, 17, 4 }, - { aic7xxx_patch13_func, 536, 4, 2 }, - { aic7xxx_patch0_func, 540, 2, 1 }, - { aic7xxx_patch0_func, 545, 33, 1 }, - { aic7xxx_patch12_func, 578, 4, 1 }, - { aic7xxx_patch6_func, 582, 2, 1 }, - { aic7xxx_patch6_func, 585, 9, 1 }, + { aic7xxx_patch2_func, 167, 3, 3 }, + { aic7xxx_patch8_func, 167, 2, 1 }, + { aic7xxx_patch0_func, 170, 2, 1 }, + { aic7xxx_patch8_func, 173, 1, 2 }, + { aic7xxx_patch0_func, 174, 1, 1 }, + { aic7xxx_patch2_func, 178, 1, 1 }, + { aic7xxx_patch2_func, 181, 3, 2 }, + { aic7xxx_patch0_func, 184, 5, 1 }, + { aic7xxx_patch2_func, 192, 2, 3 }, + { aic7xxx_patch8_func, 192, 1, 1 }, + { aic7xxx_patch0_func, 194, 3, 1 }, + { aic7xxx_patch10_func, 197, 2, 1 }, + { aic7xxx_patch8_func, 199, 7, 2 }, + { aic7xxx_patch0_func, 206, 1, 1 }, + { aic7xxx_patch2_func, 211, 14, 3 }, + { aic7xxx_patch10_func, 224, 1, 1 }, + { aic7xxx_patch0_func, 225, 9, 1 }, + { aic7xxx_patch8_func, 239, 2, 1 }, + { aic7xxx_patch8_func, 241, 1, 1 }, + { aic7xxx_patch10_func, 242, 6, 3 }, + { aic7xxx_patch2_func, 242, 2, 2 }, + { aic7xxx_patch0_func, 244, 4, 1 }, + { aic7xxx_patch8_func, 249, 1, 1 }, + { aic7xxx_patch8_func, 253, 19, 1 }, + { aic7xxx_patch2_func, 273, 3, 3 }, + { aic7xxx_patch10_func, 275, 1, 1 }, + { aic7xxx_patch0_func, 276, 5, 1 }, + { aic7xxx_patch10_func, 281, 1, 2 }, + { aic7xxx_patch0_func, 282, 9, 1 }, + { aic7xxx_patch11_func, 298, 1, 2 }, + { aic7xxx_patch0_func, 299, 1, 1 }, + { aic7xxx_patch5_func, 359, 1, 2 }, + { aic7xxx_patch0_func, 360, 1, 1 }, + { aic7xxx_patch3_func, 363, 1, 1 }, + { aic7xxx_patch2_func, 373, 3, 2 }, + { aic7xxx_patch0_func, 376, 5, 1 }, + { aic7xxx_patch11_func, 384, 1, 2 }, + { aic7xxx_patch0_func, 385, 1, 1 }, + { aic7xxx_patch6_func, 390, 1, 1 }, + { aic7xxx_patch1_func, 427, 3, 1 }, + { aic7xxx_patch10_func, 432, 11, 1 }, + { aic7xxx_patch2_func, 480, 7, 2 }, + { aic7xxx_patch0_func, 487, 8, 1 }, + { aic7xxx_patch2_func, 496, 4, 2 }, + { aic7xxx_patch0_func, 500, 6, 1 }, + { aic7xxx_patch2_func, 506, 4, 2 }, + { aic7xxx_patch0_func, 510, 3, 1 }, + { aic7xxx_patch12_func, 520, 10, 1 }, + { aic7xxx_patch2_func, 539, 17, 4 }, + { aic7xxx_patch13_func, 547, 4, 2 }, + { aic7xxx_patch0_func, 551, 2, 1 }, + { aic7xxx_patch0_func, 556, 33, 1 }, + { aic7xxx_patch12_func, 589, 4, 1 }, + { aic7xxx_patch6_func, 593, 2, 1 }, + { aic7xxx_patch6_func, 596, 9, 1 }, }; diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c index 0a2e943003b2..3ca182501d60 100644 --- a/drivers/scsi/dtc.c +++ b/drivers/scsi/dtc.c @@ -222,7 +222,7 @@ int __init dtc_detect(Scsi_Host_Template * tpnt){ #endif for (sig = 0; sig < NO_SIGNATURES; ++sig) if (!bases[current_base].noauto && - check_signature(bases[current_base].address + + isa_check_signature(bases[current_base].address + signatures[sig].offset, signatures[sig].string, strlen(signatures[sig].string))) { base = bases[current_base].address; diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 6bed707e94c5..d6166894cd2e 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -699,7 +699,7 @@ static int fdomain_isa_detect( int *irq, int *iobase ) printk( " %lx(%lx),", addresses[i], bios_base ); #endif for (j = 0; !bios_base && j < SIGNATURE_COUNT; j++) { - if (check_signature(addresses[i] + signatures[j].sig_offset, + if (isa_check_signature(addresses[i] + signatures[j].sig_offset, signatures[j].signature, signatures[j].sig_length )) { bios_major = signatures[j].major_bios_version; diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 4b3a4ddc2060..59a6bee98f9e 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -703,8 +703,6 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){ retval->loaded_as_module = scsi_loadable_module_flag; retval->host_no = max_scsi_hosts++; /* never reuse host_no (DB) */ next_scsi_host++; - /* FIXME: what with overflows? Old code suffered from the same, BTW */ - sprintf(retval->proc_name, "%d", retval->host_no); retval->host_queue = NULL; init_waitqueue_head(&retval->host_wait); retval->resetting = 0; diff --git a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h index ae3d13c662f8..9c4c37bb54d6 100644 --- a/drivers/scsi/hosts.h +++ b/drivers/scsi/hosts.h @@ -327,7 +327,6 @@ struct Scsi_Host /* public: */ unsigned short extra_bytes; unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ - char proc_name[4]; int resetting; /* if set, it means that last_reset is a valid value */ unsigned long last_reset; diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 6f7d51dbb0f2..30fe2666675e 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -243,6 +243,7 @@ static struct dev_info device_list[] = {"TEAC", "CD-ROM", "1.06", BLIST_NOLUN}, /* causes failed REQUEST SENSE on lun 1 * for seagate controller, which causes * SCSI code to reset bus.*/ + {"TEAC", "MT-2ST/45S2-27", "RV M", BLIST_NOLUN}, /* Responds to all lun */ {"TEXEL", "CD-ROM", "1.06", BLIST_NOLUN}, /* causes failed REQUEST SENSE on lun 1 * for seagate controller, which causes * SCSI code to reset bus.*/ @@ -254,7 +255,9 @@ static struct dev_info device_list[] = {"HP", "C1750A", "3226", BLIST_NOLUN}, /* scanjet iic */ {"HP", "C1790A", "", BLIST_NOLUN}, /* scanjet iip */ {"HP", "C2500A", "", BLIST_NOLUN}, /* scanjet iicx */ - {"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* extra reset */ + {"YAMAHA", "CDR100", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ + {"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 + * extra reset */ {"RELISYS", "Scorpio", "*", BLIST_NOLUN}, /* responds to all LUN */ /* @@ -278,8 +281,6 @@ static struct dev_info device_list[] = {"nCipher", "Fastness Crypto", "*", BLIST_FORCELUN}, {"NEC", "PD-1 ODX654P", "*", BLIST_FORCELUN | BLIST_SINGLELUN}, {"MATSHITA", "PD", "*", BLIST_FORCELUN | BLIST_SINGLELUN}, - {"YAMAHA", "CDR100", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ - {"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN}, /* @@ -1201,9 +1202,14 @@ Scsi_Cmnd *scsi_allocate_device(struct request ** reqp, Scsi_Device * device, } if (!SCpnt || SCpnt->request.rq_status != RQ_INACTIVE) { /* Might have changed */ if (wait && SCwait && SCwait->request.rq_status != RQ_INACTIVE) { - spin_unlock(&io_request_lock); /* FIXME!!!! */ - sleep_on(&device->device_wait); - spin_lock_irq(&io_request_lock); /* FIXME!!!! */ + DECLARE_WAITQUEUE(wait,current); + add_wait_queue(&device->device_wait,&wait); + current->state=TASK_UNINTERRUPTIBLE; + spin_unlock(&io_request_lock); + schedule(); + current->state=TASK_RUNNING; + remove_wait_queue(&device->device_wait,&wait); + spin_lock_irq(&io_request_lock); } else { if (!wait) return NULL; @@ -2746,6 +2752,7 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) struct Scsi_Host *shpnt; Scsi_Host_Template *SHT; Scsi_Host_Template *SHTp; + char name[10]; /* host_no>=10^9? I don't think so. */ /* * First verify that this host adapter is completely free with no pending @@ -2887,7 +2894,8 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) continue; pcount = next_scsi_host; /* Remove the /proc/scsi directory entry */ - remove_proc_entry(shpnt->proc_name, tpnt->proc_dir); + sprintf(name,"%d",shpnt->host_no); + remove_proc_entry(name, tpnt->proc_dir); if (tpnt->release) (*tpnt->release) (shpnt); else { diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 6ea86256d939..ea500241cfb6 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -118,6 +118,7 @@ static ssize_t proc_scsi_write(struct file * file, const char * buf, void build_proc_dir_entries(Scsi_Host_Template * tpnt) { struct Scsi_Host *hpnt; + char name[10]; /* see scsi_unregister_host() */ tpnt->proc_dir = create_proc_entry(tpnt->proc_name, S_IFDIR, proc_scsi); tpnt->proc_dir->owner = tpnt->module; @@ -126,7 +127,8 @@ void build_proc_dir_entries(Scsi_Host_Template * tpnt) while (hpnt) { if (tpnt == hpnt->hostt) { struct proc_dir_entry *p; - p = create_proc_read_entry(hpnt->proc_name, + sprintf(name,"%d",hpnt->host_no); + p = create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR, tpnt->proc_dir, proc_scsi_read, diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index 13b2bd580afc..9a7c32e23461 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c @@ -42,18 +42,20 @@ int scsicam_bios_param(Disk * disk, /* SCSI disk */ kdev_t dev, /* Device major, minor */ int *ip /* Heads, sectors, cylinders in that order */ ) { - struct buffer_head *bh; int ret_code; int size = disk->capacity; unsigned long temp_cyl; + int ma = MAJOR(dev); + int mi = (MINOR(dev) & ~0xf); + int block = 1024; - if(blksize_size[MAJOR(dev)]) - block = blksize_size[MAJOR(dev)][MINOR(dev)]; + if(blksize_size[ma]) + block = blksize_size[ma][mi]; - if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev) & ~0xf), 0, block))) + if (!(bh = bread(MKDEV(ma,mi), 0, block))) return -1; /* try to infer mapping from partition table */ diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index 3047f9552131..05f49569e688 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c @@ -447,7 +447,7 @@ int __init seagate_st0x_detect (Scsi_Host_Template * tpnt) for (i = 0; i < (sizeof (seagate_bases) / sizeof (unsigned int)); ++i) for (j = 0; !base_address && j < NUM_SIGNATURES; ++j) - if (check_signature (seagate_bases[i] + signatures[j].offset, + if (isa_check_signature (seagate_bases[i] + signatures[j].offset, signatures[j].signature, signatures[j].length)) { base_address = seagate_bases[i]; diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c index 2a71173e3205..c8bab6983969 100644 --- a/drivers/scsi/t128.c +++ b/drivers/scsi/t128.c @@ -214,7 +214,7 @@ int __init t128_detect(Scsi_Host_Template * tpnt){ #endif for (sig = 0; sig < NO_SIGNATURES; ++sig) if (!bases[current_base].noauto && - check_signature(bases[current_base].address + + isa_check_signature(bases[current_base].address + signatures[sig].offset, signatures[sig].string, strlen(signatures[sig].string))) { diff --git a/drivers/usb/README.dc2xx b/drivers/usb/README.dc2xx index 48910d1b92f5..25b024123370 100644 --- a/drivers/usb/README.dc2xx +++ b/drivers/usb/README.dc2xx @@ -1,4 +1,4 @@ -3 November 1999 +13 November 1999 david-b@pacbell.net This is an overview of how to use the "dc2xx" USB driver with certain @@ -15,13 +15,14 @@ You'll most likely want to hook it up to recent versions of "gPhoto" (www.gphoto.org), since version 0.4 and later know how to use it to talk to Kodak DC-240 and DC-280 cameras over USB. -The DC-260 is currently recognized. However, like other cameras using the -"Digita OS" (from www.flashpoint.com) there is no application software -(such as gPhoto) support for this camera. Until it's available, those -cameras aren't much use with Linux; when it's available, this driver -should be able to handle the cameras' communication requirements. Today, -that's six more cameras. From Kodak: DC-220, DC-260, DC-265, DC-290. -Minolta has the Dimage EX-1500; HP, the PhotoSmart C500. +In addition the DC-260, DC-265, and DC-290 are currently recognized. +However, like other cameras using the "Digita OS" (from www.flashpoint.com) +there is no gPhoto support for this camera. At this writing the best +known support for these cameras is a Python script that supports image +downloading from those cameras. (See archives of the linux-usb mailing +list.) The DC-220 should also work with this driver, given information +about the USB product IDs. When it becomes available, the HP PhotoSmart +C500 should also work ... it's another Digita OS camera with USB support.) It's likely that other digital still cameras can also use this USB driver, even if they're not from Kodak and don't use Digita. The reason is that @@ -34,7 +35,11 @@ USB HARDWARE This has been shown to work on x86 OHCI and UHCI (Intel) chipsets. OHCI has been trouble free; not so with UHCI, which was first seen to be happy with -2.3.24 kernels. +2.3.24 kernels, and has not been as fast as OHCI. + +Note that in some cases changes in BIOS settings may be needed before +your USB works. At least one user has reported a need for SMP-related +settings as well. As yet, no reports have come from Linux users on non-Intel hardware. (You could color coordinate your iMac with a DC-240i ... :-) @@ -88,7 +93,7 @@ by the driver? USB new device connect, assigned device number 1 Manufacturer: Eastman Kodak Company Product: KODAK DC240 Zoom Digital Camera - USB Camera (Kodak DC-240) is connected + USB Camera is connected usbcore: dc2xx driver claimed interface c3a68600 ohci-control thread sleeping diff --git a/drivers/usb/dc2xx.c b/drivers/usb/dc2xx.c index ff3eedf34a7a..1c4a4812a8d8 100644 --- a/drivers/usb/dc2xx.c +++ b/drivers/usb/dc2xx.c @@ -41,6 +41,9 @@ * 12 Oct, 1999 -- handle DC-280 interface class (0xff not 0x0); * added timeouts to bulk_msg calls. Minor updates, docs. * 03 Nov, 1999 -- update for 2.3.25 kernel API changes. + * + * Thanks to: the folk who've provided USB product IDs, sent in + * patches, and shared their sucesses! */ #include @@ -74,33 +77,30 @@ /* table of cameras that work through this driver */ -static struct camera { +static const struct camera { short idVendor; short idProduct; - - /* should get this name from the USB subsystem */ - const char *nameProduct; + /* plus hooks for camera-specific info if needed */ } cameras [] = { - { 0x040a, 0x0120, "Kodak DC-240" }, - { 0x040a, 0x0130, "Kodak DC-280" }, + { 0x040a, 0x0120 }, // Kodak DC-240 + { 0x040a, 0x0130 }, // Kodak DC-280 /* Kodak has several other USB-enabled devices, which (along with * models from other vendors) all use the Flashpoint "Digita - * OS" and its wire protocol. This driver should work with such - * devices, which need different application level protocol code - * from the DC-240/280 models. Note that Digita isn't just for - * cameras -- Epson has a non-USB Digita photo printer. + * OS" and its wire protocol. These use a different application + * level protocol from the DC-240/280 models. Note that Digita + * isn't just for cameras -- Epson has a non-USB Digita printer. */ -/* { 0x040a, 0x0100, "Kodak DC-220" }, */ - { 0x040a, 0x0110, "Kodak DC-260" }, -/* { 0x040a, 0x0115, "Kodak DC-265" }, */ -/* { 0x040a, 0x0140, "Kodak DC-290" }, */ +// { 0x040a, 0x0100 }, // Kodak DC-220 + { 0x040a, 0x0110 }, // Kodak DC-260 + { 0x040a, 0x0111 }, // Kodak DC-265 + { 0x040a, 0x0112 }, // Kodak DC-290 -/* { 0xffff, 0xffff, "Minolta Dimage EX 1500" }, */ -/* { 0x03f0, 0xffff, "HP PhotoSmart C500" }, */ +// { 0x03f0, 0xffff }, // HP PhotoSmart C500 /* Other USB cameras may well work here too, so long as they - * just stick to half duplex packet exchanges. + * just stick to half duplex packet exchanges and bulk messages. + * Some non-camera devices have also been shown to work. */ }; @@ -110,7 +110,7 @@ struct camera_state { struct usb_device *dev; /* USB device handle */ char inEP; /* read endpoint */ char outEP; /* write endpoint */ - struct camera *info; /* DC-240, etc */ + const struct camera *info; /* DC-240, etc */ /* valid iff isOpen */ int isOpen; /* device opened? */ @@ -159,9 +159,10 @@ static ssize_t camera_read (struct file *file, return -ENODEV; } - result = camera->dev->bus->op->bulk_msg (camera->dev, + result = usb_bulk_msg (camera->dev, usb_rcvbulkpipe (camera->dev, camera->inEP), camera->buf, len, &count, HZ*10); + #ifdef CAMERA_DEBUG printk ("camera.r (%d) - 0x%x %ld\n", len, result, count); #endif @@ -205,7 +206,6 @@ static ssize_t camera_write (struct file *file, /* it's not clear that retrying can do any good ... or that * fragmenting application packets into N writes is correct. - * consider those mechanisms mostly untested legacy code */ thistime = copy_size = len; if (copy_from_user (obuf, buf, copy_size)) { @@ -227,7 +227,7 @@ static ssize_t camera_write (struct file *file, goto done; } - result = camera->dev->bus->op->bulk_msg (camera->dev, + result = usb_bulk_msg (camera->dev, usb_sndbulkpipe (camera->dev, camera->outEP), obuf, thistime, &count, HZ*10); #ifdef CAMERA_DEBUG @@ -311,7 +311,7 @@ static int camera_release (struct inode *inode, struct file *file) * to applications ... what USB exposes should suffice. * apps should be able to see the camera type. */ -static struct file_operations usb_camera_fops = { +static /* const */ struct file_operations usb_camera_fops = { NULL, /* llseek */ camera_read, camera_write, @@ -333,6 +333,7 @@ static struct miscdevice usb_camera = { USB_CAMERA_MINOR, "USB camera (Kodak DC-2xx)", &usb_camera_fops + // next, prev }; @@ -340,9 +341,10 @@ static struct miscdevice usb_camera = { static void * camera_probe(struct usb_device *dev, unsigned int ifnum) { int i; - struct camera *camera_info = NULL; + const struct camera *camera_info = NULL; struct usb_interface_descriptor *interface; struct usb_endpoint_descriptor *endpoint; + int direction, ep; struct camera_state *camera = &static_camera_state; @@ -365,13 +367,10 @@ static void * camera_probe(struct usb_device *dev, unsigned int ifnum) return NULL; } - /* the interface class bit is odd -- the dc240 and dc260 return - * a zero there, and at least some dc280s report 0xff - */ - // interface = &dev->config[0].interface[0].altsetting[0]; + /* models differ in how they report themselves */ interface = &dev->actconfig->interface[ifnum].altsetting[0]; - if ((interface->bInterfaceClass != 0 - && interface->bInterfaceClass != 0xff) + if ((interface->bInterfaceClass != USB_CLASS_PER_INTERFACE + && interface->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || interface->bInterfaceSubClass != 0 || interface->bInterfaceProtocol != 0 || interface->bNumEndpoints != 2 @@ -383,31 +382,33 @@ static void * camera_probe(struct usb_device *dev, unsigned int ifnum) /* can only show one camera at a time through /dev ... */ if (!camera->dev) { camera->dev = dev; - printk(KERN_INFO "USB Camera (%s) is connected\n", - camera_info->nameProduct); + printk(KERN_INFO "USB Camera is connected\n"); } else { - printk(KERN_INFO "Ignoring additional USB Camera (%s)\n", - camera_info->nameProduct); + printk(KERN_INFO "Ignoring additional USB Camera\n"); return NULL; } -// XXX there are now masks for these constants ... see printer.c - /* get input and output endpoints (either order) */ endpoint = interface->endpoint; camera->outEP = camera->inEP = -1; - if ((endpoint [0].bEndpointAddress & 0x80) == 0x80) - camera->inEP = endpoint [0].bEndpointAddress & 0x7f; + + ep = endpoint [0].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; + direction = endpoint [0].bEndpointAddress & USB_ENDPOINT_DIR_MASK; + if (direction == USB_DIR_IN) + camera->inEP = ep; else - camera->outEP = endpoint [0].bEndpointAddress; + camera->outEP = ep; - if ((endpoint [1].bEndpointAddress & 0x80) == 0x80) - camera->inEP = endpoint [1].bEndpointAddress & 0x7f; + ep = endpoint [1].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; + direction = endpoint [1].bEndpointAddress & USB_ENDPOINT_DIR_MASK; + if (direction == USB_DIR_IN) + camera->inEP = ep; else - camera->outEP = endpoint [1].bEndpointAddress; + camera->outEP = ep; + if (camera->outEP == -1 || camera->inEP == -1 - || endpoint [0].bmAttributes != 0x02 - || endpoint [1].bmAttributes != 0x02 + || endpoint [0].bmAttributes != USB_ENDPOINT_XFER_BULK + || endpoint [1].bmAttributes != USB_ENDPOINT_XFER_BULK ) { printk (KERN_INFO "Bogus camera endpoints\n"); camera->dev = NULL; @@ -428,7 +429,6 @@ static void * camera_probe(struct usb_device *dev, unsigned int ifnum) static void camera_disconnect(struct usb_device *dev, void *ptr) { struct camera_state *camera = (struct camera_state *) ptr; - struct camera *info = camera->info; if (camera->dev != dev) return; @@ -443,10 +443,10 @@ static void camera_disconnect(struct usb_device *dev, void *ptr) camera->info = NULL; camera->dev = NULL; - printk (KERN_INFO "USB Camera (%s) disconnected\n", info->nameProduct); + printk (KERN_INFO "USB Camera disconnected\n"); } -static struct usb_driver camera_driver = { +static /* const */ struct usb_driver camera_driver = { "dc2xx", camera_probe, camera_disconnect, diff --git a/drivers/usb/uhci.c b/drivers/usb/uhci.c index b4582693782b..4c82d50b5880 100644 --- a/drivers/usb/uhci.c +++ b/drivers/usb/uhci.c @@ -156,7 +156,8 @@ static int uhci_td_result(struct uhci_device *dev, struct uhci_td *td, unsigned if (rval) *rval += actlength; - if (explength != actlength && tmp->pipetype == PIPE_BULK) { + if (explength != actlength && + ((tmp->pipetype == PIPE_BULK) || (tmp->pipetype == PIPE_CONTROL))) { /* If the packet is short, none of the */ /* packets after this were processed, so */ /* fix the DT accordingly */ diff --git a/drivers/usb/usb_scsi.c b/drivers/usb/usb_scsi.c index b3efa29b9fc4..cb6ce5031b43 100644 --- a/drivers/usb/usb_scsi.c +++ b/drivers/usb/usb_scsi.c @@ -114,15 +114,6 @@ struct us_data { #define US_ACT_BUS_RESET 4 #define US_ACT_HOST_RESET 5 -static struct proc_dir_entry proc_usb_scsi = -{ - PROC_SCSI_USB_SCSI, /* It's currently b0rken */ - 0, - NULL, - S_IFDIR | S_IRUGO | S_IXUGO, - 2 -}; - static struct us_data *us_list; static struct usb_scsi_filter *filters; @@ -615,26 +606,19 @@ static int us_detect(struct SHT *sht) char name[32]; sprintf(name, "usbscsi%d", us->host_number); - proc_usb_scsi.namelen = strlen(name); - proc_usb_scsi.name = kmalloc(proc_usb_scsi.namelen+1, GFP_KERNEL); - if (!proc_usb_scsi.name) + sht->name = sht->proc_name = kmalloc(strlen(name)+1, GFP_KERNEL); + if (!sht->proc_name) return 0; - strcpy((char *)proc_usb_scsi.name, name); - sht->proc_dir = kmalloc(sizeof(*sht->proc_dir), GFP_KERNEL); - if (!sht->proc_dir) { - kfree(proc_usb_scsi.name); - return 0; - } - *sht->proc_dir = proc_usb_scsi; - sht->name = proc_usb_scsi.name; + strcpy(sht->proc_name, name); + sht->proc_dir = NULL; us->host = scsi_register(sht, sizeof(us)); if (us->host) { us->host->hostdata[0] = (unsigned long)us; us->host_no = us->host->host_no; return 1; } - kfree(proc_usb_scsi.name); - kfree(sht->proc_dir); + kfree(sht->proc_name); + sht->proc_name = sht->name = NULL; return 0; } diff --git a/fs/inode.c b/fs/inode.c index 49770bdd9449..0dcdf2a87f48 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -4,6 +4,7 @@ * (C) 1997 Linus Torvalds */ +#include #include #include #include diff --git a/fs/proc/Makefile b/fs/proc/Makefile index 8ff6cd5223d4..e8bb4774f56c 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -18,9 +18,11 @@ M_OBJS := ifeq ($(CONFIG_SUN_OPENPROMFS),y) O_OBJS += openpromfs.o +OX_OBJS := openprom-dev.o else ifeq ($(CONFIG_SUN_OPENPROMFS),m) M_OBJS += openpromfs.o + OX_OBJS := openprom-dev.o endif endif diff --git a/fs/proc/inode.c b/fs/proc/inode.c index e2c5dab7ea95..b2828ec9da50 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -52,10 +52,6 @@ void de_put(struct proc_dir_entry *de) static void proc_put_inode(struct inode *inode) { -#ifdef CONFIG_SUN_OPENPROMFS_MODULE - if (PROC_INODE_OPENPROM(inode) && proc_openprom_use) - (*proc_openprom_use)(inode, 0); -#endif /* * Kill off unused inodes ... VFS will unhash and * delete the inode if we set i_nlink to zero. @@ -75,9 +71,6 @@ static void proc_delete_inode(struct inode *inode) proc_pid_delete_inode(inode); return; } - if (PROC_INODE_OPENPROM(inode)) - return; - if (de) { if (de->owner) __MOD_DEC_USE_COUNT(de->owner); @@ -159,11 +152,6 @@ printk("proc_iget: using deleted entry %s, count=%d\n", de->name, de->count); if (!inode) goto out_fail; -#ifdef CONFIG_SUN_OPENPROMFS_MODULE - if (PROC_INODE_OPENPROM(inode) && proc_openprom_use) - (*proc_openprom_use)(inode, 1); -#endif - inode->u.generic_ip = (void *) de; if (de) { if (de->mode) { diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 80d36aecc448..28635ff14142 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -3,9 +3,9 @@ * * Modelled on fs/exec.c:aout_core_dump() * Jeremy Fitzhardinge - * Implemented by David Howells + * ELF version written by David Howells * Modified and incorporated into 2.3.x by Tigran Aivazian - * Support to dump vmalloc'd data structures (ELF only), Tigran Aivazian + * Support to dump vmalloc'd areas (ELF only), Tigran Aivazian */ #include @@ -42,8 +42,7 @@ struct inode_operations proc_kcore_inode_operations = { }; #ifdef CONFIG_KCORE_AOUT -static ssize_t read_kcore(struct file * file, char * buf, - size_t count, loff_t *ppos) +static ssize_t read_kcore(struct file *file, char *buf, size_t count, loff_t *ppos) { unsigned long long p = *ppos, memsize; ssize_t read; @@ -78,7 +77,8 @@ static ssize_t read_kcore(struct file * file, char * buf, if (p + count1 > sizeof(struct user)) count1 = sizeof(struct user)-p; pnt = (char *) &dump + p; - copy_to_user(buf,(void *) pnt, count1); + if (copy_to_user(buf,(void *) pnt, count1)) + return -EFAULT; buf += count1; p += count1; count -= count1; @@ -89,14 +89,16 @@ static ssize_t read_kcore(struct file * file, char * buf, count1 = PAGE_SIZE + FIRST_MAPPED - p; if (count1 > count) count1 = count; - clear_user(buf, count1); + if (clear_user(buf, count1)) + return -EFAULT; buf += count1; p += count1; count -= count1; read += count1; } if (count > 0) { - copy_to_user(buf, (void *) (PAGE_OFFSET+p-PAGE_SIZE), count); + if (copy_to_user(buf, (void *) (PAGE_OFFSET+p-PAGE_SIZE), count)) + return -EFAULT; read += count; } *ppos += read; @@ -129,6 +131,8 @@ static size_t get_kcore_size(int *num_vma, int *elf_buflen) } for (m=vmlist; m; m=m->next) { + if (m->flags & VM_IOREMAP) /* don't dump ioremap'd stuff! (TA) */ + continue; try = (size_t)m->addr + m->size; if (try > size) size = try; @@ -247,8 +251,11 @@ static void elf_kcore_store_hdr(char *bufp, int num_vma, int dataoff) phdr->p_filesz = phdr->p_memsz = ((unsigned long)high_memory - PAGE_OFFSET); phdr->p_align = PAGE_SIZE; - /* setup ELF PT_LOAD program headers, one for every kvma range */ + /* setup ELF PT_LOAD program header for every vmalloc'd area */ for (m=vmlist; m; m=m->next) { + if (m->flags & VM_IOREMAP) /* don't dump ioremap'd stuff! (TA) */ + continue; + phdr = (struct elf_phdr *) bufp; bufp += sizeof(struct elf_phdr); offset += sizeof(struct elf_phdr); @@ -315,12 +322,8 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t { ssize_t acc = 0; size_t size, tsz; - char * elf_buffer; - size_t elf_buflen = 0; - int num_vma = 0; - - if (verify_area(VERIFY_WRITE, buffer, buflen)) - return -EFAULT; + size_t elf_buflen; + int num_vma; /* XXX we need to somehow lock vmlist between here * and after elf_kcore_store_hdr() returns. @@ -336,16 +339,21 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t /* construct an ELF core header if we'll need some of it */ if (*fpos < elf_buflen) { + char * elf_buf; + tsz = elf_buflen - *fpos; if (buflen < tsz) tsz = buflen; - elf_buffer = kmalloc(elf_buflen, GFP_KERNEL); - if (!elf_buffer) + elf_buf = kmalloc(elf_buflen, GFP_ATOMIC); + if (!elf_buf) return -ENOMEM; - memset(elf_buffer, 0, elf_buflen); - elf_kcore_store_hdr(elf_buffer, num_vma, elf_buflen); - copy_to_user(buffer, elf_buffer + *fpos, tsz); - kfree(elf_buffer); + memset(elf_buf, 0, elf_buflen); + elf_kcore_store_hdr(elf_buf, num_vma, elf_buflen); + if (copy_to_user(buffer, elf_buf + *fpos, tsz)) { + kfree(elf_buf); + return -EFAULT; + } + kfree(elf_buf); buflen -= tsz; *fpos += tsz; buffer += tsz; @@ -365,7 +373,8 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t tsz = buflen; /* write zeros to buffer */ - clear_user(buffer, tsz); + if (clear_user(buffer, tsz)) + return -EFAULT; buflen -= tsz; *fpos += tsz; buffer += tsz; @@ -376,13 +385,12 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t return tsz; } #endif - /* fill the remainder of the buffer from kernel VM space */ - copy_to_user(buffer, __va(*fpos - elf_buflen), buflen); + if (copy_to_user(buffer, __va(*fpos - elf_buflen), buflen)) + return -EFAULT; acc += buflen; *fpos += buflen; return acc; - } #endif /* CONFIG_KCORE_AOUT */ diff --git a/fs/proc/openprom-dev.c b/fs/proc/openprom-dev.c new file mode 100644 index 000000000000..79ef8d54963f --- /dev/null +++ b/fs/proc/openprom-dev.c @@ -0,0 +1,46 @@ +/* + * linux/fs/proc/openprom-dev.c + * + * handling of devices attached to openpromfs. + */ + +#include +#include +#include +#include +#include +#include +#include + +struct openpromfs_dev *openprom_devices = NULL; +static ino_t openpromdev_ino = PROC_OPENPROMD_FIRST; + +int proc_openprom_regdev(struct openpromfs_dev *d) +{ + if (openpromdev_ino == PROC_OPENPROMD_FIRST + PROC_NOPENPROMD) + return -1; + d->next = openprom_devices; + d->inode = openpromdev_ino++; + openprom_devices = d; + return 0; +} + +int proc_openprom_unregdev(struct openpromfs_dev *d) +{ + if (d == openprom_devices) { + openprom_devices = d->next; + } else if (!openprom_devices) + return -1; + else { + struct openpromfs_dev *p; + + for (p = openprom_devices; p->next != d && p->next; p = p->next); + if (!p->next) return -1; + p->next = d->next; + } + return 0; +} + +#if defined(CONFIG_SUN_OPENPROMFS_MODULE) +EXPORT_SYMBOL(openprom_devices); +#endif diff --git a/fs/proc/openpromfs.c b/fs/proc/openpromfs.c index c9553ea244e8..51ced2dcd8a6 100644 --- a/fs/proc/openpromfs.c +++ b/fs/proc/openpromfs.c @@ -50,8 +50,7 @@ static u16 options = 0xffff; static u16 aliases = 0xffff; static int aliases_nodes = 0; static char *alias_names [ALIASES_NNODES]; -static struct inode_operations *proc_openprom_iops = 0; -static struct openpromfs_dev **devices; +extern struct openpromfs_dev *openprom_devices; #define NODE(ino) nodes[ino - PROC_OPENPROM_FIRST] #define NODE2INO(node) (node + PROC_OPENPROM_FIRST) @@ -661,6 +660,8 @@ static struct inode_operations openprom_alias_inode_operations = { NULL /* revalidate */ }; +extern struct inode_operations openprom_inode_operations; + static int lookup_children(u16 n, const char * name, int len) { int ret; @@ -772,7 +773,7 @@ static struct dentry *openpromfs_lookup(struct inode * dir, struct dentry *dentr } } if (!ino) { - for (d = *devices; d; d = d->next) + for (d = openprom_devices; d; d = d->next) if ((d->node == n) && (strlen (d->name) == len) && !strncmp (d->name, name, len)) { ino = d->inode; @@ -787,7 +788,7 @@ static struct dentry *openpromfs_lookup(struct inode * dir, struct dentry *dentr else return ERR_PTR(-ENOENT); } - inode = proc_get_inode (dir->i_sb, ino, 0); + inode = iget (dir->i_sb, ino, 0); if (!inode) return ERR_PTR(-EINVAL); switch (type) { @@ -797,7 +798,7 @@ static struct dentry *openpromfs_lookup(struct inode * dir, struct dentry *dentr inode->i_mode |= S_IWUSR; inode->i_op = &openprom_alias_inode_operations; } else - inode->i_op = proc_openprom_iops; + inode->i_op = &openprom_inode_operations; inode->i_nlink = 2; break; case OPFSL_NODENUM: @@ -825,11 +826,7 @@ static struct dentry *openpromfs_lookup(struct inode * dir, struct dentry *dentr (((u16)(ino - NODEP2INO(NODE(dir->i_ino).first_prop) - 1)) << 16)); break; case OPFSL_DEVICE: - inode->i_mode = d->mode; - inode->i_op = &chrdev_inode_operations; - inode->i_nlink = 1; - inode->i_rdev = d->rdev; - break; + init_special_inode(d->mode, kdev_to_nr(d->rdev)); } inode->i_gid = 0; @@ -914,7 +911,7 @@ static int openpromfs_readdir(struct file * filp, void * dirent, filldir_t filld } } } - for (d = *devices; d; d = d->next) { + for (d = openprom_devices; d; d = d->next) { if (d->node == n) { if (i) i--; else { @@ -1090,25 +1087,6 @@ void openpromfs_use (struct inode *inode, int inc) { static int root_fresh = 1; static int dec_first = 1; -#ifdef OPENPROM_DEBUGGING - static int usec = 0; - - if (inc) { - if (inode->i_count == 1) - usec++; - else if (root_fresh && inode->i_ino == PROC_OPENPROM_FIRST) { - root_fresh = 0; - usec++; - } - } else { - if (inode->i_ino == PROC_OPENPROM_FIRST) - root_fresh = 0; - if (!dec_first) - usec--; - } - printk ("openpromfs_use: %d %d %d %d\n", - inode->i_ino, inc, usec, inode->i_count); -#else if (inc) { if (inode->i_count == 1) MOD_INC_USE_COUNT; @@ -1122,7 +1100,6 @@ void openpromfs_use (struct inode *inode, int inc) if (!dec_first) MOD_DEC_USE_COUNT; } -#endif dec_first = 0; } @@ -1130,39 +1107,131 @@ void openpromfs_use (struct inode *inode, int inc) #define openpromfs_use 0 #endif -#ifndef MODULE -#define RET(x) -void __init openpromfs_init (void) -#else +static struct file_operations openprom_operations = { + NULL, /* lseek - default */ + NULL, /* read - bad */ + NULL, /* write - bad */ + openpromfs_readdir, /* readdir */ +}; -EXPORT_NO_SYMBOLS; +static struct inode_operations openprom_inode_operations = { + &openprom_operations,/* default net directory file-ops */ + NULL, /* create */ + openpromfs_lookup, /* lookup */ +}; -#define RET(x) -x -int init_module (void) -#endif +static void openprom_read_inode(struct inode * inode) +{ + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + if (inode->i_ino == PROC_OPENPROM) { + inode->i_op = &openprom_inode_operations; + } +} + +static void openprom_put_super(struct super_block *sb) +{ + MOD_DEC_USE_COUNT; +} + +static int openprom_statfs(struct super_block *sb, struct statfs *buf, int bufsiz) +{ + struct statfs tmp; + + tmp.f_type = PROC_SUPER_MAGIC; /* FIXME */ + tmp.f_bsize = PAGE_SIZE/sizeof(long); /* ??? */ + tmp.f_blocks = 0; + tmp.f_bfree = 0; + tmp.f_bavail = 0; + tmp.f_files = 0; + tmp.f_ffree = 0; + tmp.f_namelen = NAME_MAX; + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0; +} + +static struct super_operations openprom_sops = { + openprom_read_inode, + NULL, + NULL, + NULL, + NULL, + openprom_put_super, + NULL, + openprom_statfs, + NULL +}; + +struct super_block *openprom_read_super(struct super_block *s,void *data, + int silent) +{ + struct inode * root_inode; + + MOD_INC_USE_COUNT; + lock_super(s); + s->s_blocksize = 1024; + s->s_blocksize_bits = 10; + s->s_magic = PROC_SUPER_MAGIC; /* FIXME */ + s->s_op = &openprom_sops; + root_inode = iget(s, PROC_OPENPROM); + if (!root_inode) + goto out_no_root; + s->s_root = d_alloc_root(root_inode); + if (!s->s_root) + goto out_no_root; + unlock_super(s); + return s; + +out_no_root: + printk("proc_read_super: get root inode failed\n"); + iput(root_inode); + s->s_dev = 0; + unlock_super(s); + return NULL; +} + +static struct file_system_type openprom_fs_type = { + "openprom", + 0, + openprom_read_super, + NULL +}; + +static int init_openprom_fs(void) { nodes = (openpromfs_node *)__get_free_pages(GFP_KERNEL, 0); if (!nodes) { printk (KERN_WARNING "/proc/openprom: can't get free page\n"); - return RET(EIO); + return -EIO; } if (get_nodes (0xffff, prom_root_node) == 0xffff) { printk (KERN_WARNING "/proc/openprom: couldn't setup tree\n"); - return RET(EIO); + return -EIO; } nodes[last_node].first_prop = first_prop; - proc_openprom_iops = proc_openprom_register (openpromfs_readdir, - openpromfs_lookup, - openpromfs_use, - &devices); - return RET(0); + return register_filesystem(&openprom_fs_type); +} + +#ifdef MODULE + +EXPORT_NO_SYMBOLS; + +int init_module (void) +{ + return init_openprom_fs(); +} + +#else + +void __init openpromfs_init (void) +{ + init_openprom_fs(); } +#endif #ifdef MODULE void cleanup_module (void) { int i; - proc_openprom_deregister (); + unregister_filesystem(&openprom_fs_type); free_pages ((unsigned long)nodes, alloced); for (i = 0; i < aliases_nodes; i++) if (alias_names [i]) diff --git a/fs/proc/procfs_syms.c b/fs/proc/procfs_syms.c index fa2ee362ee0c..6d5f4852381f 100644 --- a/fs/proc/procfs_syms.c +++ b/fs/proc/procfs_syms.c @@ -14,16 +14,9 @@ EXPORT_SYMBOL(create_proc_entry); EXPORT_SYMBOL(remove_proc_entry); EXPORT_SYMBOL(proc_root); EXPORT_SYMBOL(proc_root_fs); -EXPORT_SYMBOL(proc_get_inode); -EXPORT_SYMBOL(proc_dir_inode_operations); EXPORT_SYMBOL(proc_net); EXPORT_SYMBOL(proc_bus); -#if defined(CONFIG_SUN_OPENPROMFS_MODULE) -EXPORT_SYMBOL(proc_openprom_register); -EXPORT_SYMBOL(proc_openprom_deregister); -#endif - static struct file_system_type proc_fs_type = { "proc", 0 /* FS_NO_DCACHE doesn't work correctly */, diff --git a/fs/proc/root.c b/fs/proc/root.c index b87b0fb4fd83..4b94b2d1d14f 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -15,12 +15,6 @@ #include #include #include -#ifdef CONFIG_KMOD -#include -#endif -#ifdef CONFIG_ZORRO -#include -#endif static int proc_root_readdir(struct file *, void *, filldir_t); static struct dentry *proc_root_lookup(struct inode *,struct dentry *); @@ -103,119 +97,6 @@ struct proc_dir_entry *proc_mca; struct proc_dir_entry *proc_sys_root; #endif -#if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) - -static int (*proc_openprom_defreaddir_ptr)(struct file *, void *, filldir_t); -static struct dentry * (*proc_openprom_deflookup_ptr)(struct inode *, struct dentry *); -void (*proc_openprom_use)(struct inode *, int) = 0; -static struct openpromfs_dev *proc_openprom_devices = NULL; -static ino_t proc_openpromdev_ino = PROC_OPENPROMD_FIRST; - -struct inode_operations * -proc_openprom_register(int (*readdir)(struct file *, void *, filldir_t), - struct dentry * (*lookup)(struct inode *, struct dentry *), - void (*use)(struct inode *, int), - struct openpromfs_dev ***devices) -{ - proc_openprom_defreaddir_ptr = (proc_openprom_inode_operations.default_file_ops)->readdir; - proc_openprom_deflookup_ptr = proc_openprom_inode_operations.lookup; - (proc_openprom_inode_operations.default_file_ops)->readdir = readdir; - proc_openprom_inode_operations.lookup = lookup; - proc_openprom_use = use; - *devices = &proc_openprom_devices; - return &proc_openprom_inode_operations; -} - -int proc_openprom_regdev(struct openpromfs_dev *d) -{ - if (proc_openpromdev_ino == PROC_OPENPROMD_FIRST + PROC_NOPENPROMD) - return -1; - d->next = proc_openprom_devices; - d->inode = proc_openpromdev_ino++; - proc_openprom_devices = d; - return 0; -} - -int proc_openprom_unregdev(struct openpromfs_dev *d) -{ - if (d == proc_openprom_devices) { - proc_openprom_devices = d->next; - } else if (!proc_openprom_devices) - return -1; - else { - struct openpromfs_dev *p; - - for (p = proc_openprom_devices; p->next != d && p->next; p = p->next); - if (!p->next) return -1; - p->next = d->next; - } - return 0; -} - -#ifdef CONFIG_SUN_OPENPROMFS_MODULE -void -proc_openprom_deregister(void) -{ - (proc_openprom_inode_operations.default_file_ops)->readdir = proc_openprom_defreaddir_ptr; - proc_openprom_inode_operations.lookup = proc_openprom_deflookup_ptr; - proc_openprom_use = 0; -} -#endif - -#if defined(CONFIG_SUN_OPENPROMFS_MODULE) && defined(CONFIG_KMOD) -static int -proc_openprom_defreaddir(struct file * filp, void * dirent, filldir_t filldir) -{ - request_module("openpromfs"); - if ((proc_openprom_inode_operations.default_file_ops)->readdir != - proc_openprom_defreaddir) - return (proc_openprom_inode_operations.default_file_ops)->readdir - (filp, dirent, filldir); - return -EINVAL; -} -#define OPENPROM_DEFREADDIR proc_openprom_defreaddir - -static struct dentry * -proc_openprom_deflookup(struct inode * dir, struct dentry *dentry) -{ - request_module("openpromfs"); - if (proc_openprom_inode_operations.lookup != - proc_openprom_deflookup) - return proc_openprom_inode_operations.lookup - (dir, dentry); - return ERR_PTR(-ENOENT); -} -#define OPENPROM_DEFLOOKUP proc_openprom_deflookup -#else -#define OPENPROM_DEFREADDIR NULL -#define OPENPROM_DEFLOOKUP NULL -#endif - -static struct file_operations proc_openprom_operations = { - NULL, /* lseek - default */ - NULL, /* read - bad */ - NULL, /* write - bad */ - OPENPROM_DEFREADDIR, /* readdir */ -}; - -struct inode_operations proc_openprom_inode_operations = { - &proc_openprom_operations,/* default net directory file-ops */ - NULL, /* create */ - OPENPROM_DEFLOOKUP, /* lookup */ -}; - -struct proc_dir_entry proc_openprom = { - PROC_OPENPROM, 8, "openprom", - S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0, - 0, &proc_openprom_inode_operations, - NULL, NULL, - NULL, - &proc_root, NULL -}; - -extern void openpromfs_init (void); -#endif /* CONFIG_SUN_OPENPROMFS */ - static int make_inode_number(void) { int i = find_first_zero_bit((void *) proc_alloc_map, PROC_NDYNAMIC); @@ -435,7 +316,7 @@ static struct proc_dir_entry proc_root_self = { #ifdef __powerpc__ static struct proc_dir_entry proc_root_ppc_htab = { 0, 8, "ppc_htab", - S_IFREG | S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, 1, 0, 0, + S_IFREG | S_IRUGO|S_IWUSR, 1, 0, 0, 0, &proc_ppc_htab_inode_operations, }; #endif @@ -460,7 +341,8 @@ void __init proc_root_init(void) #ifdef CONFIG_SUN_OPENPROMFS openpromfs_init (); #endif - proc_register(&proc_root, &proc_openprom); + /* just give it a mountpoint */ + create_proc_entry("openprom", S_IFDIR, 0); #endif proc_tty_init(); #ifdef __powerpc__ diff --git a/fs/super.c b/fs/super.c index 7b1b15e3c63b..eb66df0d0548 100644 --- a/fs/super.c +++ b/fs/super.c @@ -567,7 +567,6 @@ static struct super_block * read_super(kdev_t dev,const char *name,int flags, if (!type->read_super(s, data, silent)) goto out_fail; s->s_dev = dev; /* N.B. why do this again?? */ - s->s_rd_only = 0; s->s_type = type; out: return s; diff --git a/fs/udf/super.c b/fs/udf/super.c index e3d22c6a78a3..497887825e13 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1366,7 +1366,6 @@ udf_read_super(struct super_block *sb, void *options, int silent) /* Fill in the rest of the superblock */ sb->s_op = &udf_sb_ops; - sb->s_time = 0; sb->dq_op = NULL; sb->s_dirt = 0; sb->s_magic = UDF_SUPER_MAGIC; diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h index 12ec642aaf1c..afca084cb856 100644 --- a/include/asm-arm/signal.h +++ b/include/asm-arm/signal.h @@ -63,6 +63,7 @@ typedef unsigned long sigset_t; #define SIGLOST 29 */ #define SIGPWR 30 +#define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h index 50b708d91af0..47cd4856cae6 100644 --- a/include/asm-i386/e820.h +++ b/include/asm-i386/e820.h @@ -18,7 +18,8 @@ #define E820_RAM 1 #define E820_RESERVED 2 -#define E820_ACPI 3 +#define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */ +#define E820_NVS 4 #define HIGH_MEMORY (1024*1024) diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index 75cfb939b5bd..3f198d67e813 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h @@ -228,6 +228,25 @@ out: return retval; } +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; +} + + + + /* Nothing to do */ #define dma_cache_inv(_start,_size) do { } while (0) diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h index b6823738b079..b2b8a76f0b33 100644 --- a/include/asm-i386/signal.h +++ b/include/asm-i386/signal.h @@ -63,6 +63,7 @@ typedef unsigned long sigset_t; #define SIGLOST 29 */ #define SIGPWR 30 +#define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index 3524a0bf3125..228e95c97b53 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h @@ -63,6 +63,7 @@ typedef unsigned long sigset_t; #define SIGLOST 29 */ #define SIGPWR 30 +#define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h index 7e14071d9762..f5025a1611a7 100644 --- a/include/asm-ppc/signal.h +++ b/include/asm-ppc/signal.h @@ -54,6 +54,7 @@ typedef struct { #define SIGLOST 29 */ #define SIGPWR 30 +#define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ diff --git a/include/asm-sh/signal.h b/include/asm-sh/signal.h index ab466321082b..0a6ebb3baae9 100644 --- a/include/asm-sh/signal.h +++ b/include/asm-sh/signal.h @@ -51,6 +51,7 @@ typedef struct { #define SIGLOST 29 */ #define SIGPWR 30 +#define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ diff --git a/include/linux/fs.h b/include/linux/fs.h index ff14cf67d53f..4068a2da60b8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -543,14 +543,12 @@ struct super_block { unsigned long s_blocksize; unsigned char s_blocksize_bits; unsigned char s_lock; - unsigned char s_rd_only; unsigned char s_dirt; struct file_system_type *s_type; struct super_operations *s_op; struct dquot_operations *dq_op; unsigned long s_flags; unsigned long s_magic; - unsigned long s_time; struct dentry *s_root; wait_queue_head_t s_wait; diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 18873a97f8b6..817449276734 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -76,7 +76,7 @@ #define ARPHRD_FCPL 786 /* Fibrechannel public loop */ #define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ /* 787->799 reserved for fibrechannel media types */ - +#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ /* ARP protocol opcodes. */ #define ARPOP_REQUEST 1 /* ARP request */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 75d6f872dd9e..b092b10d684f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -423,7 +423,6 @@ extern void ether_setup(struct net_device *dev); extern void fddi_setup(struct net_device *dev); extern void tr_setup(struct net_device *dev); extern void fc_setup(struct net_device *dev); -extern void tr_freedev(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 */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 147bed35a412..8b665e7de0db 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -434,6 +434,10 @@ #define PCI_VENDOR_ID_LEADTEK 0x107d #define PCI_DEVICE_ID_LEADTEK_805 0x0000 +#define PCI_VENDOR_ID_INTERPHASE 0x107e +#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 +#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 + #define PCI_VENDOR_ID_CONTAQ 0x1080 #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 #define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 @@ -783,6 +787,7 @@ #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 #define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000 #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 +#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 #define PCI_VENDOR_ID_AURAVISION 0x11d1 #define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7 @@ -874,9 +879,13 @@ #define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000 #define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 +#define PCI_VENDOR_ID_ROCKWELL 0x127A + #define PCI_VENDOR_ID_ALTEON 0x12ae #define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001 +#define PCI_VENDOR_ID_USR 0x12B9 + #define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002 @@ -893,30 +902,65 @@ #define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 +#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E0 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x0031 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x0021 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16 0x0011 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC 0x0041 +#define PCI_SUBVENDOR_ID_CHASE_PCIRAS 0x124D +#define PCI_SUBDEVICE_ID_CHASE_PCIRAS4 0xF001 +#define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010 + #define PCI_VENDOR_ID_CBOARDS 0x1307 #define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 #define PCI_VENDOR_ID_SIIG 0x131f +#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 +#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001 +#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002 #define PCI_DEVICE_ID_SIIG_1S1P_10x_550 0x1010 #define PCI_DEVICE_ID_SIIG_1S1P_10x_650 0x1011 #define PCI_DEVICE_ID_SIIG_1S1P_10x_850 0x1012 #define PCI_DEVICE_ID_SIIG_1P_10x 0x1020 #define PCI_DEVICE_ID_SIIG_2P_10x 0x1021 +#define PCI_DEVICE_ID_SIIG_2S_10x_550 0x1030 +#define PCI_DEVICE_ID_SIIG_2S_10x_650 0x1031 +#define PCI_DEVICE_ID_SIIG_2S_10x_850 0x1032 #define PCI_DEVICE_ID_SIIG_2S1P_10x_550 0x1034 #define PCI_DEVICE_ID_SIIG_2S1P_10x_650 0x1035 #define PCI_DEVICE_ID_SIIG_2S1P_10x_850 0x1036 +#define PCI_DEVICE_ID_SIIG_4S_10x_550 0x1050 +#define PCI_DEVICE_ID_SIIG_4S_10x_650 0x1051 +#define PCI_DEVICE_ID_SIIG_4S_10x_850 0x1052 +#define PCI_DEVICE_ID_SIIG_1S_20x_550 0x2000 +#define PCI_DEVICE_ID_SIIG_1S_20x_650 0x2001 +#define PCI_DEVICE_ID_SIIG_1S_20x_850 0x2002 #define PCI_DEVICE_ID_SIIG_1P_20x 0x2020 #define PCI_DEVICE_ID_SIIG_2P_20x 0x2021 +#define PCI_DEVICE_ID_SIIG_2S_20x_550 0x2030 +#define PCI_DEVICE_ID_SIIG_2S_20x_650 0x2031 +#define PCI_DEVICE_ID_SIIG_2S_20x_850 0x2032 #define PCI_DEVICE_ID_SIIG_2P1S_20x_550 0x2040 #define PCI_DEVICE_ID_SIIG_2P1S_20x_650 0x2041 #define PCI_DEVICE_ID_SIIG_2P1S_20x_850 0x2042 #define PCI_DEVICE_ID_SIIG_1S1P_20x_550 0x2010 #define PCI_DEVICE_ID_SIIG_1S1P_20x_650 0x2011 #define PCI_DEVICE_ID_SIIG_1S1P_20x_850 0x2012 +#define PCI_DEVICE_ID_SIIG_4S_20x_550 0x2050 +#define PCI_DEVICE_ID_SIIG_4S_20x_650 0x2051 +#define PCI_DEVICE_ID_SIIG_4S_20x_850 0x2052 #define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 +#define PCI_VENDOR_ID_QUATECH 0x135C +#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 +#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 +#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030 +#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040 +#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 +#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 + #define PCI_VENDOR_ID_SEALEVEL 0x135e #define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 #define PCI_DEVICE_ID_SEALEVEL_UCOMM2 0x7201 @@ -929,11 +973,18 @@ #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a #define PCI_VENDOR_ID_LAVA 0x1407 +#define PCI_DEVICE_ID_LAVA_DUAL_SERIAL 0x0100 #define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000 #define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */ #define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */ #define PCI_DEVICE_ID_LAVA_BOCA_IOPPAR 0x8800 +#define PCI_VENDOR_ID_TIMEDIA 0x1409 +#define PCI_DEVICE_ID_TIMEDIA_1889 0x7168 + +#define PCI_VENDOR_ID_OXSEMI 0x1415 +#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501 + #define PCI_VENDOR_ID_PANACOM 0x14d4 #define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 #define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 @@ -1022,8 +1073,6 @@ #define PCI_DEVICE_ID_INTEL_82371AB 0x7111 #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 -#define PCI_VENDOR_ID_COMPUTONE 0x8e0e -#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291 #define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180 #define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181 @@ -1034,6 +1083,14 @@ #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca +#define PCI_VENDOR_ID_COMPUTONE 0x8e0e +#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291 +#define PCI_DEVICE_ID_COMPUTONE_PG 0x0302 +#define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e +#define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001 +#define PCI_SUBDEVICE_ID_COMPUTONE_PG8 0x0002 +#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003 + #define PCI_VENDOR_ID_KTI 0x8e2e #define PCI_DEVICE_ID_KTI_ET32P2 0x3000 @@ -1099,15 +1156,4 @@ #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 -#define PCI_VENDOR_ID_INTERPHASE 0x107e -#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 -#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 - -#define PCI_VENDOR_ID_INTERPHASE 0x107e -#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 -#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 - -#define PCI_VENDOR_ID_INTERPHASE 0x107e -#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 -#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 diff --git a/include/linux/sched.h b/include/linux/sched.h index 191de76af9af..69e2f615594a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -845,7 +845,7 @@ static inline int task_lock(struct task_struct *p) down(&p->exit_sem); if (p->p_pptr) return 1; - /* He's dead, Jim. You take his wallet, I'll take tricoder... */ + /* He's dead, Jim. You take his wallet, I'll take the tricorder... */ up(&p->exit_sem); return 0; } diff --git a/include/linux/serial.h b/include/linux/serial.h index baa253e76235..d16ef2583be3 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -20,7 +20,8 @@ struct serial_struct { int custom_divisor; int baud_base; unsigned short close_delay; - char reserved_char[2]; + char io_type; + char reserved_char[1]; int hub6; unsigned short closing_wait; /* time to wait before closing */ unsigned short closing_wait2; /* no longer used... */ @@ -36,20 +37,6 @@ struct serial_struct { #define ASYNC_CLOSING_WAIT_INF 0 #define ASYNC_CLOSING_WAIT_NONE 65535 -/* - * The size of the serial xmit buffer is 1 page, or 4096 bytes - */ -#define SERIAL_XMIT_SIZE 4096 - -/* - * Counters of the input lines (CTS, DSR, RI, CD) interrupts - */ -struct async_icount { - __u32 cts, dsr, rng, dcd, tx, rx; - __u32 frame, parity, overrun, brk; - __u32 buf_overrun; -}; - /* * These are the supported serial types. */ @@ -68,6 +55,11 @@ struct async_icount { #define PORT_16850 12 #define PORT_MAX 12 +#define SERIAL_IO_PORT 0 +#define SERIAL_IO_HUB6 1 +#define SERIAL_IO_MEM 2 +#define SERIAL_IO_GSC 3 + struct serial_uart_config { char *name; int dfl_xmit_fifo_size; diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 98560874f8cc..25fb7d353d27 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -19,11 +19,18 @@ * For definitions of the flags field, see tty.h */ -#include #include #include #include +/* + * Counters of the input lines (CTS, DSR, RI, CD) interrupts + */ +struct async_icount { + __u32 cts, dsr, rng, dcd, tx, rx; + __u32 frame, parity, overrun, brk; + __u32 buf_overrun; +}; struct serial_state { int magic; @@ -45,6 +52,7 @@ struct serial_state { struct async_icount icount; struct termios normal_termios; struct termios callout_termios; + int io_type; struct async_struct *info; }; @@ -80,6 +88,7 @@ struct async_struct { int xmit_cnt; u8 *iomem_base; u16 iomem_reg_shift; + int io_type; struct tq_struct tqueue; #ifdef DECLARE_WAITQUEUE wait_queue_head_t open_wait; @@ -99,6 +108,10 @@ struct async_struct { #define SERIAL_MAGIC 0x5301 #define SSTATE_MAGIC 0x5302 +/* + * The size of the serial xmit buffer is 1 page, or 4096 bytes + */ +#define SERIAL_XMIT_SIZE 4096 /* * Events are used to schedule things to happen at timer-interrupt @@ -132,7 +145,6 @@ struct rs_multiport_struct { #define ALPHA_KLUDGE_MCR 0 #endif -#ifdef CONFIG_PCI /* * Structures and definitions for PCI support */ @@ -147,8 +159,9 @@ struct pci_board { int base_baud; int uart_offset; int reg_shift; - void (*init_fn)(struct pci_dev *dev, struct pci_board *board, + int (*init_fn)(struct pci_dev *dev, struct pci_board *board, int enable); + int first_uart_offset; }; struct pci_board_inst { @@ -159,7 +172,6 @@ struct pci_board_inst { #ifndef PCI_ANY_ID #define PCI_ANY_ID (~0) #endif -#endif #define SPCI_FL_BASE_MASK 0x0007 #define SPCI_FL_BASE0 0x0000 diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index b89c788f3adb..612ce337d41b 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -6,6 +6,10 @@ #include +/* bits in vm_struct->flags */ +#define VM_IOREMAP 0x00000001 /* ioremap() and friends */ +#define VM_ALLOC 0x00000002 /* vmalloc() */ + struct vm_struct { unsigned long flags; void * addr; @@ -13,7 +17,7 @@ struct vm_struct { struct vm_struct * next; }; -struct vm_struct * get_vm_area(unsigned long size); +struct vm_struct * get_vm_area(unsigned long size, unsigned long flags); void vfree(void * addr); void * vmalloc(unsigned long size); long vread(char *buf, char *addr, unsigned long count); diff --git a/include/net/ip.h b/include/net/ip.h index 5ed73f643598..e14ad1445509 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -110,6 +110,22 @@ extern int ip_build_xmit(struct sock *sk, struct rtable *rt, int flags); +/* + * Map a multicast IP onto multicast MAC for type Token Ring. + * This conforms to RFC1469 Option 2 Multicasting i.e. + * using a functional address to transmit / receive + * multicast packets. + */ + +extern __inline__ void ip_tr_mc_map(u32 addr, char *buf) +{ + buf[0]=0xC0; + buf[1]=0x00; + buf[2]=0x00; + buf[3]=0x04; + buf[4]=0x00; + buf[5]=0x00; +} struct ip_reply_arg { struct iovec iov[2]; diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 22a7b1ea9e1a..925f7aa37f0d 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -94,6 +94,7 @@ EXPORT_SYMBOL(exit_sighand); /* internal kernel memory management */ EXPORT_SYMBOL(__get_free_pages); EXPORT_SYMBOL(free_pages); +EXPORT_SYMBOL(alloc_pages); EXPORT_SYMBOL(__free_page); EXPORT_SYMBOL(kmem_find_general_cachep); EXPORT_SYMBOL(kmem_cache_create); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 310613cc4dbe..cfe60ab4062c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -152,7 +152,7 @@ int vmalloc_area_pages(unsigned long address, unsigned long size) return 0; } -struct vm_struct * get_vm_area(unsigned long size) +struct vm_struct * get_vm_area(unsigned long size, unsigned long flags) { unsigned long addr; struct vm_struct **p, *tmp, *area; @@ -170,6 +170,7 @@ struct vm_struct * get_vm_area(unsigned long size) return NULL; } } + area->flags = flags; area->addr = (void *)addr; area->size = size + PAGE_SIZE; area->next = *p; @@ -208,7 +209,7 @@ void * vmalloc(unsigned long size) BUG(); return NULL; } - area = get_vm_area(size); + area = get_vm_area(size, VM_ALLOC); if (!area) { BUG(); return NULL; diff --git a/net/802/tr.c b/net/802/tr.c index bf0b8452ead8..fe96fc696ef3 100644 --- a/net/802/tr.c +++ b/net/802/tr.c @@ -189,22 +189,27 @@ unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev) skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen); - tr_add_rif_info(trh, dev); - - if(*trh->daddr & 1) + if(*trh->daddr & 0x80) { if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN)) skb->pkt_type=PACKET_BROADCAST; else skb->pkt_type=PACKET_MULTICAST; } - + else if ( (trh->daddr[0] & 0x01) && (trh->daddr[1] & 0x00) && (trh->daddr[2] & 0x5E)) + { + skb->pkt_type=PACKET_MULTICAST; + } else if(dev->flags & IFF_PROMISC) { if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN)) skb->pkt_type=PACKET_OTHERHOST; } + if ((skb->pkt_type != PACKET_BROADCAST) && + (skb->pkt_type != PACKET_MULTICAST)) + tr_add_rif_info(trh,dev) ; + /* * Strip the SNAP header from ARP packets since we don't * pass them through to the 802.2/SNAP layers. @@ -231,13 +236,15 @@ static void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_d unsigned int hash; rif_cache entry; unsigned char *olddata; + unsigned char mcast_func_addr[] = {0xC0,0x00,0x00,0x04,0x00,0x00}; spin_lock_bh(&rif_lock); /* * Broadcasts are single route as stated in RFC 1042 */ - if(!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) + if( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) || + (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN)) ) { trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK) | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST); diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c index fc51bdd0aae6..63ca5016fe9d 100644 --- a/net/atm/mpoa_proc.c +++ b/net/atm/mpoa_proc.c @@ -27,7 +27,7 @@ #define STAT_FILE_NAME "mpc" /* Our statistic file's name */ extern struct mpoa_client *mpcs; -extern struct proc_dir_entry atm_proc_root; /* from proc.c. */ +extern struct proc_dir_entry *atm_proc_root; /* from proc.c. */ static ssize_t proc_mpc_read(struct file *file, char *buff, size_t count, loff_t *pos); @@ -44,13 +44,6 @@ static struct file_operations mpc_file_operations = { NULL, /* lseek */ proc_mpc_read, /* read */ proc_mpc_write, /* write */ - NULL, /* readdir */ - NULL, /* poll - default */ - NULL, /* ioctl - default */ - NULL, /* mmap */ - NULL, /* no special open code */ - NULL, /* no special release code */ - NULL /* no fsync */ }; /* @@ -58,41 +51,8 @@ static struct file_operations mpc_file_operations = { */ static struct inode_operations mpc_inode_operations = { &mpc_file_operations, - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - NULL, /* readlink */ - NULL, /* follow_link */ - NULL, /* readpage */ - NULL, /* writepage */ - NULL, /* bmap */ - NULL, /* truncate */ - NULL /* permission */ }; -/* - * Our statistics file - */ -static struct proc_dir_entry mpc_stats = { - 0, /* low_ino */ - sizeof(STAT_FILE_NAME)-1, /* name length */ - STAT_FILE_NAME, /* name */ - S_IFREG | S_IRUGO, /* mode */ - 1, /* 1=file */ - 0, /* UID */ - 0, /* GID */ - 0, /* size */ - &mpc_inode_operations, /* inode operations */ - NULL /* get_info func-ptr */ - -}; - static int print_header(char *buff,struct mpoa_client *mpc){ if(mpc != NULL){ return sprintf(buff,"\nInterface %d:\n\n",mpc->dev_num); @@ -364,12 +324,14 @@ static int parse_qos(const char *buff, int len) */ int mpc_proc_init(void) { - int retval = 0; + struct proc_dir_entry *p; - if ( (retval = proc_register(&atm_proc_root,&mpc_stats)) != 0 ) { + p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root); + if (!p) { printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); - return retval; + return -ENOMEM; } + p->ops = &mpc_inode_operations; return 0; } @@ -378,7 +340,7 @@ int mpc_proc_init(void) */ void mpc_proc_clean(void) { - proc_unregister(&atm_proc_root,mpc_stats.low_ino); + remove_proc_entry(STAT_FILE_NAME,atm_proc_root); } diff --git a/net/atm/proc.c b/net/atm/proc.c index 7875d9dfd2c4..6b69defa584c 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c @@ -50,88 +50,28 @@ extern void clip_push(struct atm_vcc *vcc,struct sk_buff *skb); extern struct atm_lane_ops atm_lane_ops; /* in common.c */ #endif - -static ssize_t proc_atm_read(struct file *file,char *buf,size_t count, +static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, + loff_t *pos); +static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, loff_t *pos); - -static struct file_operations proc_atm_operations = { +static struct file_operations proc_dev_atm_operations = { NULL, /* lseek */ - proc_atm_read, /* read */ - NULL, /* write */ - NULL, /* readdir */ - NULL, /* select */ - NULL, /* ioctl */ - NULL, /* mmap */ - NULL, /* no special open code */ - NULL, /* no special release */ - NULL /* can't fsync */ + proc_dev_atm_read, /* read */ }; -struct inode_operations proc_atm_inode_operations = { - &proc_atm_operations, /* default ATM directory file-ops */ - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - NULL, /* readlink */ - NULL, /* follow_link */ - NULL, /* readpage */ - NULL, /* writepage */ - NULL, /* bmap */ - NULL, /* truncate */ - NULL /* permission */ +static struct file_operations proc_spec_atm_operations = { + NULL, /* lseek */ + proc_spec_atm_read, /* read */ }; +static struct inode_operations proc_dev_atm_inode_operations = { + &proc_dev_atm_operations, /* default ATM directory file-ops */ +}; -#define ENTRY(name) static struct proc_dir_entry atm_proc_entry_##name = \ - { 0, sizeof(#name)-1, #name, S_IFREG | S_IRUGO, 1, 0, 0, 0, \ - &proc_atm_inode_operations, NULL } -#define REG(name) if (!error) error = proc_register(&atm_proc_root, \ - &atm_proc_entry_##name) -#define INO(name) (atm_proc_entry_##name.low_ino) - - -ENTRY(devices); -ENTRY(pvc); -ENTRY(svc); -#ifdef CONFIG_ATM_CLIP -ENTRY(arp); -#endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -ENTRY(lec); -#endif - - -static int atm_header(ino_t ino,char *buf) -{ - if (ino == INO(devices)) - return sprintf(buf,"Itf Type ESI/\"MAC\"addr " - "AAL(TX,err,RX,err,drop) ...\n"); - if (ino == INO(pvc)) - return sprintf(buf,"Itf VPI VCI AAL RX(PCR,Class) " - "TX(PCR,Class)\n"); - if (ino == INO(svc)) - return sprintf(buf,"Itf VPI VCI State Remote\n"); -#ifdef CONFIG_ATM_CLIP - if (ino == INO(arp)) - return sprintf(buf,"IPitf TypeEncp Idle IP address " - "ATM address\n"); -#endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - if (ino == INO(lec)) - return sprintf(buf,"Itf MAC ATM destination" - " Status Flags " - "VPI/VCI Recv VPI/VCI\n"); -#endif - return -EINVAL; -} - +static struct inode_operations proc_spec_atm_inode_operations = { + &proc_spec_atm_operations, /* default ATM directory file-ops */ +}; static void add_stats(char *buf,const char *aal, const struct atm_aal_stats *stats) @@ -340,154 +280,182 @@ lec_info(struct lec_arp_table *entry, char *buf) #endif +static int atm_devices_info(loff_t pos,char *buf) +{ + struct atm_dev *dev; + int left; + + if (!pos) { + return sprintf(buf,"Itf Type ESI/\"MAC\"addr " + "AAL(TX,err,RX,err,drop) ...\n"); + } + left = pos-1; + for (dev = atm_devs; dev && left; dev = dev->next) left--; + if (!dev) return 0; + dev_info(dev,buf); + return strlen(buf); +} /* * FIXME: it isn't safe to walk the VCC list without turning off interrupts. * What is really needed is some lock on the devices. Ditto for ATMARP. */ -static int atm_info(ino_t ino,loff_t *pos,char *buf) +static int atm_pvc_info(loff_t pos,char *buf) { struct atm_dev *dev; struct atm_vcc *vcc; int left; - if (ino == INO(devices)) { - left = *pos-1; - for (dev = atm_devs; dev && left; dev = dev->next) left--; - if (!dev) return 0; - dev_info(dev,buf); - return strlen(buf); - } - if (ino == INO(pvc)) { - left = *pos-1; - for (dev = atm_devs; dev; dev = dev->next) - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->family == PF_ATMPVC && - vcc->dev && !left--) { - pvc_info(vcc,buf); - return strlen(buf); - } - return 0; + if (!pos) { + return sprintf(buf,"Itf VPI VCI AAL RX(PCR,Class) " + "TX(PCR,Class)\n"); } - if (ino == INO(svc)) { - left = *pos-1; - for (dev = atm_devs; dev; dev = dev->next) - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->family == PF_ATMSVC && !left--) { - svc_info(vcc,buf); - return strlen(buf); - } - for (vcc = nodev_vccs; vcc; vcc = vcc->next) + left = pos-1; + for (dev = atm_devs; dev; dev = dev->next) + for (vcc = dev->vccs; vcc; vcc = vcc->next) + if (vcc->family == PF_ATMPVC && + vcc->dev && !left--) { + pvc_info(vcc,buf); + return strlen(buf); + } + return 0; +} + +static int atm_svc_info(loff_t pos,char *buf) +{ + struct atm_dev *dev; + struct atm_vcc *vcc; + int left; + + if (!pos) + return sprintf(buf,"Itf VPI VCI State Remote\n"); + left = pos-1; + for (dev = atm_devs; dev; dev = dev->next) + for (vcc = dev->vccs; vcc; vcc = vcc->next) if (vcc->family == PF_ATMSVC && !left--) { svc_info(vcc,buf); return strlen(buf); } - return 0; - } + for (vcc = nodev_vccs; vcc; vcc = vcc->next) + if (vcc->family == PF_ATMSVC && !left--) { + svc_info(vcc,buf); + return strlen(buf); + } + return 0; +} + #ifdef CONFIG_ATM_CLIP - if (ino == INO(arp)) { - struct neighbour *n; - int i,count; - - count = *pos; - read_lock_bh(&clip_tbl.lock); - for (i = 0; i <= NEIGH_HASHMASK; i++) - for (n = clip_tbl.hash_buckets[i]; n; n = n->next) { - struct atmarp_entry *entry = NEIGH2ENTRY(n); - struct clip_vcc *vcc; - - if (!entry->vccs) { - if (--count) continue; - atmarp_info(n->dev,entry,NULL,buf); - read_unlock_bh(&clip_tbl.lock); - return strlen(buf); - } - for (vcc = entry->vccs; vcc; - vcc = vcc->next) { - if (--count) continue; - atmarp_info(n->dev,entry,vcc,buf); - read_unlock_bh(&clip_tbl.lock); - return strlen(buf); - } - } - read_unlock_bh(&clip_tbl.lock); - return 0; +static int atm_arp_info(loff_t pos,char *buf) +{ + struct neighbour *n; + int i,count; + + if (!pos) { + return sprintf(buf,"IPitf TypeEncp Idle IP address " + "ATM address\n"); } -#endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - if (ino == INO(lec)) { - struct lec_priv *priv; - struct lec_arp_table *entry; - int i, count, d, e; - struct net_device **dev_lec; - - if (atm_lane_ops.get_lecs == NULL) - return 0; /* the lane module is not there yet */ - else - dev_lec = atm_lane_ops.get_lecs(); - - count = *pos; - for(d=0;dpriv)) continue; - for(i=0;ilec_arp_tables[i]; - for(;entry;entry=entry->next) { - if (--count) continue; - e=sprintf(buf,"%s ", - dev_lec[d]->name); - lec_info(entry,buf+e); - return strlen(buf); - } - } - for(entry=priv->lec_arp_empty_ones; entry; - entry=entry->next) { + count = pos; + read_lock_bh(&clip_tbl.lock); + for (i = 0; i <= NEIGH_HASHMASK; i++) + for (n = clip_tbl.hash_buckets[i]; n; n = n->next) { + struct atmarp_entry *entry = NEIGH2ENTRY(n); + struct clip_vcc *vcc; + + if (!entry->vccs) { if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); - lec_info(entry, buf+e); + atmarp_info(n->dev,entry,NULL,buf); + read_unlock_bh(&clip_tbl.lock); return strlen(buf); } - for(entry=priv->lec_no_forward; entry; - entry=entry->next) { + for (vcc = entry->vccs; vcc; + vcc = vcc->next) { if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); - lec_info(entry, buf+e); + atmarp_info(n->dev,entry,vcc,buf); + read_unlock_bh(&clip_tbl.lock); return strlen(buf); } - for(entry=priv->mcast_fwds; entry; - entry=entry->next) { + } + read_unlock_bh(&clip_tbl.lock); + return 0; +} +#endif + +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) +static int atm_lec_info(loff_t pos,char *buf) +{ + struct lec_priv *priv; + struct lec_arp_table *entry; + int i, count, d, e; + struct net_device **dev_lec; + if (!pos) { + return sprintf(buf,"Itf MAC ATM destination" + " Status Flags " + "VPI/VCI Recv VPI/VCI\n"); + } + if (atm_lane_ops.get_lecs == NULL) + return 0; /* the lane module is not there yet */ + else + dev_lec = atm_lane_ops.get_lecs(); + + count = pos; + for(d=0;dpriv)) continue; + for(i=0;ilec_arp_tables[i]; + for(;entry;entry=entry->next) { if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); - lec_info(entry, buf+e); + e=sprintf(buf,"%s ", + dev_lec[d]->name); + lec_info(entry,buf+e); return strlen(buf); } } - return 0; + for(entry=priv->lec_arp_empty_ones; entry; + entry=entry->next) { + if (--count) continue; + e=sprintf(buf,"%s ",dev_lec[d]->name); + lec_info(entry, buf+e); + return strlen(buf); + } + for(entry=priv->lec_no_forward; entry; + entry=entry->next) { + if (--count) continue; + e=sprintf(buf,"%s ",dev_lec[d]->name); + lec_info(entry, buf+e); + return strlen(buf); + } + for(entry=priv->mcast_fwds; entry; + entry=entry->next) { + if (--count) continue; + e=sprintf(buf,"%s ",dev_lec[d]->name); + lec_info(entry, buf+e); + return strlen(buf); + } } -#endif - return -EINVAL; + return 0; } +#endif -static ssize_t proc_atm_read(struct file *file,char *buf,size_t count, +static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos) { struct atm_dev *dev; unsigned long page; - int ino = file->f_dentry->d_inode->i_ino; int length; if (count < 0) return -EINVAL; page = get_free_page(GFP_KERNEL); if (!page) return -ENOMEM; - for (dev = atm_devs; dev; dev = dev->next) - if (dev->ops->proc_read && dev->proc_entry->low_ino == ino) - break; - if (dev) length = dev->ops->proc_read(dev,pos,(char *) page); - else if (*pos) length = atm_info(ino,pos,(char *) page); - else length = atm_header(ino,(char *) page); - if (length > count) length = -EINVAL; + dev = ((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data; + if (!dev->ops->proc_read) + length = -EINVAL; + else { + length = dev->ops->proc_read(dev,pos,(char *) page); + if (length > count) length = -EINVAL; + } if (length >= 0) { if (copy_to_user(buf,(char *) page,length)) length = -EFAULT; (*pos)++; @@ -496,18 +464,32 @@ static ssize_t proc_atm_read(struct file *file,char *buf,size_t count, return length; } +static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, + loff_t *pos) +{ + unsigned long page; + int length; + int (*info)(loff_t,char *); + info = ((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data; -struct proc_dir_entry atm_proc_root = { 0, 3, "atm", - S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0, 0, &proc_dir_inode_operations, - NULL, NULL, NULL, NULL, NULL }; - + if (count < 0) return -EINVAL; + page = get_free_page(GFP_KERNEL); + if (!page) return -ENOMEM; + length = (*info)(*pos,(char *) page); + if (length > count) length = -EINVAL; + if (length >= 0) { + if (copy_to_user(buf,(char *) page,length)) length = -EFAULT; + (*pos)++; + } + free_page(page); + return length; +} +struct proc_dir_entry *atm_proc_root; EXPORT_SYMBOL(atm_proc_root); - int atm_proc_dev_register(struct atm_dev *dev) { - ENTRY(template); int digits,num; int error; @@ -515,45 +497,71 @@ int atm_proc_dev_register(struct atm_dev *dev) digits = 0; for (num = dev->number; num; num /= 10) digits++; if (!digits) digits++; - dev->proc_entry = kmalloc(sizeof(*dev->proc_entry),GFP_KERNEL); - if (!dev->proc_entry) goto fail0; dev->proc_name = kmalloc(strlen(dev->type)+digits+2,GFP_KERNEL); if (!dev->proc_name) goto fail1; - *dev->proc_entry = atm_proc_entry_template; - dev->proc_entry->name = dev->proc_name; - dev->proc_entry->namelen = sprintf(dev->proc_name,"%s:%d",dev->type, - dev->number); - error = proc_register(&atm_proc_root,dev->proc_entry); - if (!error) return 0; - kfree(dev->proc_name); -fail1: + sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); + dev->proc_entry = create_proc_entry(dev->proc_name, 0, atm_proc_root); + if (!dev->proc_entry) + goto fail0; + dev->proc_entry->data = dev; + dev->proc_entry->ops = &proc_dev_atm_inode_operations; + return 0; kfree(dev->proc_entry); fail0: + kfree(dev->proc_name); +fail1: return error; } void atm_proc_dev_deregister(struct atm_dev *dev) { - proc_unregister(&atm_proc_root,dev->proc_entry->low_ino); - kfree(dev->proc_entry); + remove_proc_entry(dev->proc_name, atm_proc_root); kfree(dev->proc_name); } - int __init atm_proc_init(void) { - int error; - - error = proc_register(&proc_root,&atm_proc_root); - REG(devices); - REG(pvc); - REG(svc); + struct proc_dir_entry *dev=NULL,*pvc=NULL,*svc=NULL,*arp=NULL,*lec=NULL; + atm_proc_root = create_proc_entry("atm", S_IFDIR, &proc_root); + if (!atm_proc_root) + return -ENOMEM; + dev = create_proc_entry("devices",0,atm_proc_root); + if (!dev) + goto cleanup; + dev->data = atm_devices_info; + dev->ops = &proc_spec_atm_inode_operations; + pvc = create_proc_entry("pvc",0,atm_proc_root); + if (!pvc) + goto cleanup; + pvc->data = atm_pvc_info; + pvc->ops = &proc_spec_atm_inode_operations; + svc = create_proc_entry("svc",0,atm_proc_root); + if (!svc) + goto cleanup; + svc->data = atm_svc_info; + svc->ops = &proc_spec_atm_inode_operations; #ifdef CONFIG_ATM_CLIP - REG(arp); + arp = create_proc_entry("arp",0,atm_proc_root); + if (!arp) + goto cleanup; + arp->data = atm_arp_info; + arp->ops = &proc_spec_atm_inode_operations; #endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - REG(lec); + lec = create_proc_entry("lec",0,atm_proc_root); + if (!lec) + goto cleanup; + lec->data = atm_lec_info; + lec->ops = &proc_spec_atm_inode_operations; #endif - return error; + return 0; +cleanup: + if (dev) remove_proc_entry("devices",atm_proc_root); + if (pvc) remove_proc_entry("pvc",atm_proc_root); + if (svc) remove_proc_entry("svc",atm_proc_root); + if (arp) remove_proc_entry("arp",atm_proc_root); + if (lec) remove_proc_entry("lec",atm_proc_root); + remove_proc_entry("atm",&proc_root); + return -ENOMEM; } diff --git a/net/atm/resources.h b/net/atm/resources.h index a612bdf4b297..b9709371cbad 100644 --- a/net/atm/resources.h +++ b/net/atm/resources.h @@ -22,8 +22,6 @@ void free_atm_vcc_sk(struct sock *sk); #include -extern struct proc_dir_entry atm_proc_root; /* @@@ move elsewhere */ - int atm_proc_dev_register(struct atm_dev *dev); void atm_proc_dev_deregister(struct atm_dev *dev); diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 263cd36e0ff0..b60cd3650daa 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -205,9 +205,12 @@ int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir) { switch (dev->type) { case ARPHRD_ETHER: - case ARPHRD_IEEE802: case ARPHRD_FDDI: - ip_eth_mc_map(addr, haddr); + case ARPHRD_IEEE802: + ip_eth_mc_map(addr, haddr) ; + return 0 ; + case ARPHRD_IEEE802_TR: + ip_tr_mc_map(addr, haddr) ; return 0; default: if (dir) { @@ -521,6 +524,12 @@ void arp_send(int type, int ptype, u32 dest_ip, arp->ar_hrd = __constant_htons(ARPHRD_ETHER); arp->ar_pro = __constant_htons(ETH_P_IP); break; +#endif +#ifdef CONFIG_TR + case ARPHRD_IEEE802_TR: + arp->ar_hrd = __constant_htons(ARPHRD_IEEE802); + arp->ar_pro = __constant_htons(ETH_P_IP); + break; #endif } @@ -604,6 +613,19 @@ int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) goto out; break; #endif +#ifdef CONFIG_TR + case ARPHRD_IEEE802_TR: + /* + * Token ring devices will accept ARP hardware types of either + * 1 (Ethernet) or 6 (IEEE 802.2). + */ + if (arp->ar_hrd != __constant_htons(ARPHRD_ETHER) && + arp->ar_hrd != __constant_htons(ARPHRD_IEEE802)) + goto out; + if (arp->ar_pro != __constant_htons(ETH_P_IP)) + goto out; + break; +#endif #ifdef CONFIG_FDDI case ARPHRD_FDDI: /* diff --git a/net/netsyms.c b/net/netsyms.c index a4cb35bf6e16..a6e577158634 100644 --- a/net/netsyms.c +++ b/net/netsyms.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -444,7 +445,12 @@ EXPORT_SYMBOL(tr_type_trans); EXPORT_SYMBOL(register_trdev); EXPORT_SYMBOL(unregister_trdev); EXPORT_SYMBOL(init_trdev); -EXPORT_SYMBOL(tr_freedev); +#endif + +#ifdef CONFIG_NET_FC +EXPORT_SYMBOL(register_fcdev); +EXPORT_SYMBOL(unregister_fcdev); +EXPORT_SYMBOL(init_fcdev); #endif /* Device callback registration */ -- 2.39.5