diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/CREDITS linux.20p9/CREDITS --- linux.vanilla/CREDITS Sun Mar 25 17:37:29 2001 +++ linux.20p9/CREDITS Wed Jul 4 16:06:28 2001 @@ -420,6 +420,12 @@ S: Las Heras, Mendoza CP 5539 S: Argentina +N: Steven P. Cole +E: scole@lanl.gov +E: elenstev@mesatop.com +D: Configure.help and ver_linux additions/fixes. +S: Los Alamos, New Mexico + N: Hamish Coleman E: hamish@zot.apana.org.au D: SEEQ8005 network driver @@ -1833,14 +1839,15 @@ S: France N: Rik van Riel -E: riel@nl.linux.org -W: http://www.nl.linux.org/~riel/ +E: riel@conectiva.com.br +W: http://www.surriel.com/ D: Linux-MM site, Documentation/sysctl/*, swap/mm readaround D: clustering contributor, kswapd fixes, random kernel hacker, -D: nl.linux.org maintainer, minor scheduler additions -S: IJsselstraat 23a -S: 9725 GA Groningen -S: The Netherlands +D: nl.linux.org administrator, minor scheduler additions +S: Conectiva S.A. +S: R. Tocantins, 89 - Cristo Rei +S: 80050-430 - Curitiba - Paraná +S: Brazil N: William E. Roadcap E: roadcapw@cfw.com @@ -2299,7 +2306,7 @@ S: The Netherlands N: Tim Waugh -E: tim@cyberelk.demon.co.uk +E: tim@cyberelk.net D: Co-architect of the parallel-port sharing system S: 17 Curling Vale S: GUILDFORD @@ -2398,8 +2405,8 @@ E: jwoithe@physics.adelaide.edu.au W: http://www.physics.adelaide.edu.au/~jwoithe D: ALS-007 sound card extensions to Sound Blaster driver -S: 4/36 Trevelyan St -S: Wayville SA 5034 +S: 20 Jordan St +S: Valley View, SA 5093 S: Australia N: Clifford Wolf diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/Configure.help linux.20p9/Documentation/Configure.help --- linux.vanilla/Documentation/Configure.help Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/Configure.help Thu Jul 26 15:50:16 2001 @@ -758,6 +758,45 @@ say M here and read Documentation/modules.txt. The module will be called DAC960.o. +3ware Hardware ATA-RAID support +CONFIG_BLK_DEV_3W_XXXX_RAID + 3ware is the only hardware ATA-Raid product in Linux to date. + This card is 2,4, or 8 channel master mode support only. + SCSI support required!!! + + + + Please read the comments at the top of drivers/scsi/3w-xxxx.c + +RapIDE interface support +CONFIG_BLK_DEV_IDE_RAPIDE + Say Y here if you want to support the Yellowstone RapIDE controller + manufactured for use with Acorn computers. + +WarpEngine SCSI support +CONFIG_WARPENGINE_SCSI + Support for MacroSystem Development's WarpEngine Amiga SCSI-2 controller. + Info at . + +Builtin PowerMac IDE support +CONFIG_BLK_DEV_IDE_PMAC + This driver provides support for the built-in IDE controller on most + of the recent Apple Power Macintoshes and PowerBooks. + If unsure, say Y. + +PowerMac IDE DMA support +CONFIG_BLK_DEV_IDEDMA_PMAC + This option allows the driver for the built-in IDE controller on + Power Macintoshes and PowerBooks to use DMA (direct memory access) + to transfer data to and from memory. Saying Y is safe and improves + performance. + +ICS IDE interface support +CONFIG_BLK_DEV_IDE_ICSIDE + On Acorn systems, say Y here if you wish to use the ICS IDE + interface card. This is not required for ICS partition support. + If you are unsure, say N to this. + Parallel port IDE device support CONFIG_PARIDE There are many external CD-ROM and disk devices that connect through @@ -1123,6 +1162,34 @@ board uses the R4300 and a R5230 CPUs. For more information about this board see http://www.algor.co.uk. +Support for BAGET MIPS series +CONFIG_BAGET_MIPS + This enables support for the Baget, a Russian embedded system. For + more details about the Baget see the Linux/MIPS FAQ on + . + +Baget AMD LANCE support +CONFIG_BAGETLANCE + Say Y to enable kernel support for AMD Lance Ethernet cards on the + MIPS-32-based Baget embedded system. This chipset is better known + via the NE2100 cards. + +Support for DECstations +CONFIG_DECSTATION + This enables support for DEC's MIPS based workstations. For details + see the Linux/MIPS FAQ on and the + DECstation porting pages on . + + If you have one of the following DECstation Models you definitely + want to choose R4xx0 for the CPU Type: + + DECstation 5000/50 + DECstation 5000/150 + DECstation 5000/260 + DECsystem 5900/260 + + otherwise choose R3000. + IDE card support CONFIG_BLK_DEV_IDE_CARDS On Acorn systems, enable this if you wish to use an IDE interface @@ -1157,6 +1224,44 @@ http://lena.fnet.fr/ (To browse the WWW, you need to have access to a machine on the Internet that has a program like lynx or netscape). +Support for SNI RM200 PCI +CONFIG_SNI_RM200_PCI + The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens + Nixdorf Informationssysteme (SNI), parent company of Pyramid Technology + and now in turn merged with Fujitsu. Say Y here to support this machine + type. + +MIPS JAZZ onboard SONIC Ethernet support +CONFIG_MIPS_JAZZ_SONIC + This is the driver for the onboard card of MIPS Magnum 4000, + Acer PICA, Olivetti M700-10 and a few other identical OEM systems. + +MIPS JAZZ FAS216 SCSI support +CONFIG_JAZZ_ESP + This is the driver for the onboard SCSI host adapter of MIPS Magnum + 4000, Acer PICA, Olivetti M700-10 and a few other identical OEM + systems. + +SGI PROM Console Support +CONFIG_SGI_PROM_CONSOLE + Say Y here to set up the boot console on serial port 0. + +DZ11 Serial Support +CONFIG_DZ + DZ11-family serial controllers for VAXstations, including the DC7085, + M7814, and M7819. + +TURBOchannel support +CONFIG_TC + TurboChannel is a DEC (now Compaq) bus for Alpha and MIPS processors. + Documentation on writing device drivers for TurboChannel is available at: + . + +Z85C30 Serial Support +CONFIG_ZS + Documentation on the Zilog 85C350 serial communications controller is + downloadable at . + CPU type CONFIG_CPU_R3000 Give the type of your machine's MIPS CPU. For this question, it @@ -1164,6 +1269,55 @@ In case of doubt select the R3000 CPU. The kernel will then run on other MIPS machines but with slightly reduced performance. + R3000 MIPS Technologies R3000-series processors, + including the 3041, 3051, and 3081. + + R6000 MIPS Technologies R6000-series processors, + including the 64474, 64475, 64574 and 64575. + + R4300 MIPS Technologies R4300-series processors. + + R4x00 MIPS Technologies R4000-series processors other than 4300, + including the 4640, 4650, and 4700. + + R5000 MIPS Technologies R5000-series processors other than the Nevada. + + R52xx MIPS Technologies R52x0-series ("Nevada") processors. + + R8000 MIPS Technologies R8000-series processors. + + R10000 MIPS Technologies R10000-series processors. + +R6000 +CONFIG_CPU_R6000 + MIPS Technologies R6000-series processors, including the 64474, + 64475, 64574 and 64575. + +R4300 +CONFIG_CPU_R4300 + MIPS Technologies R4300-series processors. + +R4x00 +CONFIG_CPU_R4X00 + MIPS Technologies R4000-series processors other than 4300, including + the 4640, 4650, and 4700. + +R5000 +CONFIG_CPU_R5000 + MIPS Technologies R5000-series processors other than the Nevada. + +R52xx +CONFIG_CPU_NEVADA + MIPS Technologies R52x0-series ("Nevada") processors. + +R8000 +CONFIG_CPU_R8000 + MIPS Technologies R8000-series processors. + +R10000 +CONFIG_CPU_R10000 + MIPS Technologies R10000-series processors. + Compile the kernel into the ECOFF object format CONFIG_ECOFF_KERNEL Some machines require a kernel in the ECOFF format. You will have to @@ -1176,6 +1330,12 @@ byte order. These modes require different kernels. Say Y if your machine is little endian, N if it's a big endian machine. +Use power LED as a heartbeat +CONFIG_HEARTBEAT + Use the power-on LED on your machine as a load meter. The exact + behavior is platform-dependent, but normally the flash frequency is a + hyperbolic function of the 5-minute load average. + Kernel support for IRIX binaries CONFIG_BINFMT_IRIX If you say Y here, the kernel will support running of IRIX binaries. @@ -1323,6 +1483,136 @@ If you don't know what to do, choose "generic". +# Most of the information on these variants is from +# http://www.alphalinux.org/docs/alpha-howto.html +Alcor/Alpha-XLT +CONFIG_ALPHA_ALCOR + For systems using the Digital ALCOR chipset: 5 chips (4, 64-bit data slices + (Data Switch, DSW) - 208-pin PQFP and 1 control (Control, I/O Address, CIA) + - a 383 pin plastic PGA). It provides a DRAM controller (256-bit memory + bus) and a PCI interface. It also does all the work required to support an + external Bcache and to maintain memory coherence when a PCI device DMAs + into (or out of) memory. + +Alpha-XL +CONFIG_ALPHA_XL + XL-233 and XL-266-based Alpha systems. + +AlphaBook1 +CONFIG_ALPHA_BOOK1 + Dec AlphaBook1/Burns Alpha-based laptops. + +Avanti +CONFIG_ALPHA_AVANTI + Avanti AS 200, AS 205, AS 250, AS 255, AS 300, and AS 400-based Alphas. + Info at . + +Cabriolet +CONFIG_ALPHA_CABRIOLET + Cabriolet AlphaPC64, AlphaPCI64 systems. Derived from EB64+ but now + baby-AT with Flash boot ROM, no on-board SCSI or Ethernet. 3 ISA slots, + 4 PCI slots (one pair are on a shared slot), uses plug-in Bcache SIMMs. + Requires power supply with 3.3V output. + +DP264 +CONFIG_ALPHA_DP264 + Hard Data HD-DP264-based Alpha systems. There is a Hard Data website at + . + +EB164 +CONFIG_ALPHA_EB164 + EB164 21164 evaluation board from DEC. Uses 21164 and ALCOR. Has ISA and + PCI expansion (3 ISA slots, 2 64-bit PCI slots (one is shared with an ISA + slot) and 2 32-bit PCI slots. Uses plus-in Bcache SIMMs. I/O sub-system + provides SuperI/O (2S, 1P, FD), KBD, MOUSE (PS2 style), RTC/NVRAM. Boot + ROM is Flash. PC-AT-sized motherboard. Requires power supply with 3.3V + output. + +EB64+ +CONFIG_ALPHA_EB64P + Uses 21064 or 21064A and APECs. Has ISA and PCI expansion (3 ISA, 2 PCI, + one pair are on a shared slot). Supports 36-bit DRAM SIMs. ISA bus + generated by Intel SaturnI/O PCI-ISA bridge. On-board SCSI (NCR 810 on + PCI) Ethernet (Digital 21040), KBD, MOUSE (PS2 style), SuperI/O (2S, + 1P, FD), RTC/NVRAM. Boot ROM is EPROM. PC-AT size. Runs from standard + PC power supply. + +EB66 +CONFIG_ALPHA_EB66 + A Digital DS group board. Uses 21066 or 21066A. I/O sub-system is identical + to EB64+. Baby PC-AT size. Runs from standard PC power supply. The EB66 + schematic was published as a marketing poster advertising the 21066 as "the + first microprocessor in the world with embedded PCI" + +EB66+ +CONFIG_ALPHA_EB66P + Later variant of the EB66 board. + +Eiger +CONFIG_ALPHA_EIGER + Apparently an obscure OEM single-board computer based on the + Typhoon/Tsunami chipset family. Information on it is scanty. + +Jensen +CONFIG_ALPHA_JENSEN + DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one + of the first-generation Alpha systems. A number of these systems + seem to be available on the second- hand market. The Jensen is a + floor-standing tower system which originally used a 150MHz 21064 It + used programmable logic to interface a 486 EISA I/O bridge to the + CPU. + +LX164 +CONFIG_ALPHA_LX164 + A technical overview of this board is available at + . + +Miata +CONFIG_ALPHA_MIATA + The Digital PersonalWorkStation (PWS 433a, 433au, 500a, 500au, 600a, + or 600au). There is an Installation HOWTO for this hardware at + . + +Mikasa +CONFIG_ALPHA_MIKASA + AlphaServer 1000-based Alpha systems. + +Nautilus +CONFIG_ALPHA_NAUTILUS + Alpha systems based on the AMD 751 & ALI 1543C chipsets. + +Noname +CONFIG_ALPHA_NONAME + The AXPpci33 (aka NoName), is based on the EB66 (includes the Multia + UDB). This design was produced by Digital's Technical OEM (TOEM) + group. It uses the 21066 processor running at 166MHz or 233MHz. It + is a baby-AT size, and runs from a standard PC power supply. It has + 5 ISA slots and 3 PCI slots (one pair are a shared slot). There are + 2 versions, with either PS/2 or large DIN connectors for the + keyboard. + +Noritake +CONFIG_ALPHA_NORITAKE + AlphaServer 1000A, AlphaServer 600A, and AlphaServer 800-based systems. + +Rawhide +CONFIG_ALPHA_RAWHIDE + AlphaServer 1200, AlphaServer 4000 and AlphaServer 4100 machines. + See HOWTO at . + +Ruffian +CONFIG_ALPHA_RUFFIAN + Samsung APC164UX. There is a page on known problems and workarounds + at . + +Sable +CONFIG_ALPHA_SABLE + Digital AlphaServer 2000 and 2100-based systems. + +Takara +CONFIG_ALPHA_TAKARA + Alpha 11164-based OEM single-board computer. + EV5 CPU daughtercard CONFIG_ALPHA_PRIMO Say Y if you have an AS 1000 5/xxx or an AS 1000A 5/xxx. @@ -1426,6 +1716,27 @@ If you want to use your SGI's built-in serial ports under Linux, answer Y. +SGI Newport Graphics support +CONFIG_SGI_NEWPORT_GFX + If you have an SGI machine and you want to compile the graphics + drivers, say Y here. This will include the code for the + /dev/graphics and /dev/gfx drivers into the kernel for supporting + virtualized access to your graphics hardware. + +SGI Newport Console support +CONFIG_SGI_NEWPORT_CONSOLE + Say Y here if you want the console on the Newport aka XL graphics + card of your Indy. Most people say Y here. + +SGI DS1286 RTC support +CONFIG_SGI_DS1286 + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you + will get access to the real time clock built into your computer. + Every SGI has such a clock built in. It reports status information + via the file /proc/rtc and its behaviour is set by various ioctls on + /dev/rtc. + SGI graphics support CONFIG_SGI_GRAPHICS If you have an SGI machine and you want to compile the graphics @@ -1744,6 +2055,15 @@ The module will be called solaris.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +SUN SME environment monitoring +CONFIG_ENVCTRL + Kernel support for temperature and fan monitoring on Sun SME machines. + + 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 envctrl.o. If you want to compile it as a + module, say M here and read . + Processor family CONFIG_M386 This is the processor type of your CPU. This information is used for @@ -1757,20 +2077,47 @@ a i486). Here are the settings recommended for greatest speed: - - "386" for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI - 486DLC/DLC2 and UMC 486SX-S. Only "386" kernels will run on a 386 - class machine. - - "486" for the AMD/Cyrix/IBM/Intel DX4 or 486DX/DX2/SL/SX/SX2, - AMD/Cyrix 5x86, NexGen Nx586 and UMC U5D or U5S. - - "586" for generic Pentium CPUs, possibly lacking the TSC - (time stamp counter) register. - - "Pentium" for the Intel Pentium/Pentium MMX, AMD K5, K6 and - K6-3D, as well as the Cyrix/VIA CyrixIII - - "PPro" for the Cyrix/IBM/National Semiconductor 6x86MX, MII and - Intel Pentium II/Pentium Pro. + + "386" Select this for the AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, + Cyrix/TI, 486DLC/DLC2 and UMC 486SX-S. Only "386" kernels + will run on a 386 class machine. + + "486/Cx486" Select this for a x486 processor, ether Intel or one + of the compatible processors from AMD, Cyrix, IBM, or Intel. + Includes DX, DX2, and DX4 variants. + Also SL/SLC/SLC2/SLC3/SX/SX2, NexGen Nx586 and UMC U5D or U5S. + + "586/K5/5x86/6x86" Select this for an x586 or x686 processor such + as the AMD K5, the Intel 5x86 or 6x86, or the Intel 6x86MX. + This choice does not assume the RDTSC (time stamp counter) + instruction. + + "Pentium/K6/TSC/CyrixIII" Select this for a Pentium Classic, + Pentium MMX, AMD K5, K5 and K6-3D, as well as the Cyrix/VIA, + CyrixIII with the RDTSC (Read Time Stamp Counter) instruction. + + "PPro/6X86MX" Select this for the Cyrix/IBM/National Semiconductor + 6x86MX/MII and Intel Pentium II/Pentium Pro. If you don't know what to do, choose "386". +486 +CONFIG_M486 + Select this for a x486 processor, ether Intel or one of the compatible + processors from AMD, Cyrix, IBM, or Intel. Includes DX, DX2, and DX4 + variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or U5S. + +586/K5/5x86/6x86/6x86MX +CONFIG_M586 + Select this for an x586 or x686 processor such as the AMD K5, the Intel + 5x86 or 6x86, or the Intel 6x86MX. This choice does not assume the + RDTSC instruction. + +Pentium Classic +CONFIG_M586TSC + Select this for a Pentium Classic processor with the RDTSC (Read Time Stamp + Counter) instruction for benchmarking. + VGA text console CONFIG_VGA_CONSOLE Saying Y here will allow you to use Linux in text mode through a @@ -1836,6 +2183,26 @@ This is the frame buffer device driver for the Acorn VIDC graphics chipset. +Permedia2 support +CONFIG_FB_PM2 + This is the frame buffer device driver for the Permedia2 AGP frame buffer + card from ASK, aka `Graphic Blaster Exxtreme'. There is a product page + at . + +Enable FIFO disconnect feature +CONFIG_FB_PM2_FIFO_DISCONNECT + Support the Permedia2 FIFOI disconnect feature (see CONFIG_FB_PM2). + +Generic Permedia2 PCI board support +CONFIG_FB_PM2_PCI + Say Y to enable support for Permedia2 AGP frame buffer card from 3Dlabs + (aka `Graphic Blaster Exxtreme') on the PCI bus. + +Phase5 CVisionPPC/BVisionPPC support +CONFIG_FB_PM2_CVPPC + Say Y to enable support for the Amiga Phase 5 CVisionPPC BVisionPPC + framebuffer cards. Phase 5 is no longer with us, alas. + Apollo frame buffer device CONFIG_FB_APOLLO This is the frame buffer device driver for the monochrome graphics @@ -1875,6 +2242,13 @@ kernel. Please note that this driver DOES NOT support the Cybervision 64 3D card, as they use incompatible video chips. +CyberPro 20x0 support +CONFIG_FB_CYBER2000 + This enables support for the Integraphics CyberPro 20x0 and 5000 + VGA chips used in the Rebel.com Netwinder and other machines. + Say Y if you have a NetWinder or a graphics card containing this + device, otherwise say N. + Amiga CyberVision3D support (EXPERIMENTAL) CONFIG_FB_VIRGE This enables support for the Cybervision 64/3D graphics card from @@ -1914,6 +2288,11 @@ This is the frame buffer device driver for the builtin graphics chipset found in Ataris. +Amiga FrameMaster II/Rainbow II support +CONFIG_FB_FM2 + This is the frame buffer device driver for the Amiga FrameMaster + card from BSC (exhibited 1992 but not shipped as a CBM product). + Open Firmware frame buffer device support CONFIG_FB_OF Say Y if you want support with Open Firmware for your graphics @@ -1986,11 +2365,79 @@ You will get a boot time penguin logo at no additional cost. Please read Documentation/fb/vesafb.txt. If unsure, say Y. +VGA 16-color planar support +CONFIG_FBCON_VGA_PLANES + This low level frame buffer console driver enable the kernel to use + the 16-color planar modes of the old VGA cards where the bits of + each pixel are separated into 4 planes. + + Only answer Y here if you have a (very old) VGA card that isn't VESA + 2 compatible. + VGA 16-color graphics console CONFIG_FB_VGA16 This is the frame buffer device driver for VGA 16 color graphic cards. Say Y if you have such a card. +Select other compiled-in fonts +CONFIG_FBCON_FONTS + Say Y here if you would like to use fonts other than the default + your frame buffer console usually use. + + Note that the answer to this question won't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about foreign fonts. + + If unsure, say N (the default choices are safe). + +VGA 8x16 font +CONFIG_FONT_8x16 + This is the "high resolution" font for the VGA frame buffer (the one + provided by the VGA text console 80x25 mode. + + If unsure, say Y. + +Support only 8 pixels wide fonts +CONFIG_FBCON_FONTWIDTH8_ONLY + Answer Y here will make the kernel provide only the 8x8 fonts (these + are the less readable). + + If unsure, say N. + +Sparc console 8x16 font +CONFIG_FONT_SUN8x16 + This is the high resolution console font for Sun machines. Say Y. + +Sparc console 12x22 font (not supported by all drivers) +CONFIG_FONT_SUN12x22 + This is the high resolution console font for Sun machines with very + big letters (like the letters used in the SPARC PROM). If the + standard font is unreadable for you, say Y, otherwise say N. + +VGA 8x8 font +CONFIG_FONT_8x8 + This is the "high resolution" font for the VGA frame buffer (the one + provided by the text console 80x50 (and higher) modes). + + Note that this is a poor quality font. The VGA 8x16 font is quite a + lot more readable. + + Given the resolution provided by the frame buffer device, answer N + here is safe. + +Mac console 6x11 font (not supported by all drivers) +CONFIG_FONT_6x11 + Small console font with Macintosh-style high-half glyphs. Some Mac + framebuffer drivers don't support this one at all. + +Pearl (old m68k) console 8x8 font +CONFIG_FONT_PEARL_8x8 + Small console font with PC-style control-character and high-half glyphs. + +Acorn console 8x8 font +CONFIG_FONT_ACORN_8x8 + Small console font with PC-style control characters and high-half glyphs. + Backward compatibility mode for Xpmac CONFIG_FB_COMPAT_XPMAC If you use the Xpmac X server (common with mklinux), you'll need to @@ -2092,11 +2539,31 @@ CONFIG_FB_CGTHREE This is the frame buffer device driver for the CGthree frame buffer. +CGfourteen (SX) support +CONFIG_FB_CGFOURTEEN + This is the frame buffer device driver for the CGfourteen frame buffer + on Desktop SPARCsystems with the SX graphics option. + +Leo (ZX) support +CONFIG_FB_LEO + This is the frame buffer device driver for the SBUS-based Sun ZX (leo) + frame buffer cards. + +IGA 168x display support +CONFIG_FB_IGA + This is the framebuffer device for the INTERGRAPHICS 1680 and + successor frame buffer cards. + TCX (SS4/SS5 only) support CONFIG_FB_TCX This is the frame buffer device driver for the TCX 24/8bit frame buffer. +IMS Twin Turbo display support +CONFIG_FB_IMSTT + The IMS Twin Turbo is a PCI-based frame buffer card bundled with many + Macintosh and compatible computers. + Virtual Frame Buffer support (ONLY FOR TESTING!) CONFIG_FB_VIRTUAL This is a `virtual' frame buffer device. It operates on a chunk of @@ -3397,12 +3864,12 @@ working properly; please read Documentation/networking/z8530drv.txt for details. If unsure, say N. -#support for TRX that feedback the tx signal to rx -#CONFIG_SCC_TRXECHO -### -### Don't know what's going on here. -### -# +Support for TRX that feedback the tx signal to rx +CONFIG_SCC_TRXECHO + Some transmitters feed the transmitted signal back to the receive line. + Say Y here to foil this by explicitly disabling the receiver during + data transmission. If in doubt, say Y. + YAM driver for AX.25 CONFIG_YAM Support for the YAM modem on serial port. If you want to compile this @@ -3688,32 +4155,38 @@ Kernel/User network link driver CONFIG_NETLINK - This driver allows for two-way communication between certain parts - of the kernel or modules and user processes; the user processes are - able to read from and write to character special files in the /dev - directory having major mode 36. So far, the kernel uses it to - publish some network related information if you say Y to "Routing - messages", below. It is also used by the firewall code to publish - information about possible attacks if you say Y to "IP: firewall - packet netlink device" further down. You also need to say Y here if - you want to use arpd, a daemon that helps keep the internal ARP - cache (a mapping between IP addresses and hardware addresses on the - local network) small. The ethertap device, which lets user space - programs read and write raw Ethernet frames, also needs the network - link driver. If unsure, say Y. + This driver allows for two-way communication between the kernel and + user processes. It does so by creating a new socket family, PF_NETLINK. + Over this socket, the kernel can send and receive datagrams carrying + information. It is documented on many systems in netlink(7), a HOWTO is + provided as well, for example on + http://snafu.freedom.org/linux2.2/docs/netlink-HOWTO.html + + So far, the kernel uses this feature to publish some network related + information if you say Y to "Routing messages", below. You also need + to say Y here if you want to use arpd, a daemon that helps keep the + internal ARP cache (a mapping between IP addresses and hardware + addresses on the local network) small. The ethertap device, which + lets user space programs read and write raw Ethernet frames, also + needs the network link driver. + + If unsure, say Y. Routing messages CONFIG_RTNETLINK - If you say Y here and create a character special file /dev/route - with major number 36 and minor number 0 using mknod ("man mknod"), - you (or some user space utility) can read some network related - routing information from that file. Everything you write to that - file will be discarded. + If you say Y here, user space programs can receive some network + related routing information over the netlink. 'rtmon', supplied + with the iproute2 package (ftp://ftp.inr.ac.ru), can read and + interpret this data. Information sent to the kernel over this link + is ignored. Netlink device emulation CONFIG_NETLINK_DEV + This option will be removed soon. Any programs that want to use + character special nodes like /dev/tap0 or /dev/route (all with major + number 36) need this option, and need to be rewritten soon to use + the real netlink socket. This is a backward compatibility option, choose Y for now. - This option will be removed soon. SCSI support? CONFIG_SCSI @@ -3870,6 +4343,17 @@ there should be no noticeable performance impact as long as you have logging turned off. +SGI WD93C93 SCSI Driver +CONFIG_SCSI_SGIWD93 + Say Y here to support the on-board WD93C93 SCSI controller found (a) on + the Indigo2 and other MIPS-based SGI machines, and (b) on ARCS ARM-based + machines. + +DEC NCR53C94 SCSI Driver +CONFIG_SCSI_DECNCR + Say Y here to support the NCR53C94 SCSI controller chips on IOASIC + based TURBOchannel DECstations and TURBOchannel PMAZ-A cards. + AdvanSys SCSI support CONFIG_SCSI_ADVANSYS This is a driver for all SCSI host adapters manufactured by @@ -4959,10 +5443,35 @@ Optic ports, each of which can be connected to a disk array. Only the SBus incarnation of the adapter is supported at the moment. +Sun SOC+ (aka SOCAL) +CONFIG_FC4_SOCAL + Serial Optical Channel Plus is an interface card with up to two + Fibre Optic ports. This card supports FC Arbitrated Loop (usually + A5000 or internal FC disks in E[3-6]000 machines through the + Interface Board). You'll probably need the microcode from the + Solaris driver to make it work. + + This support is also available as a module called socal.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + SparcSTORAGE Array 100 and 200 series CONFIG_SCSI_PLUTO If you never bought a disk array made by Sun, go with N. +Sun Enterprise Network Array (A5000 and EX500) +CONFIG_SCSI_FCAL + This driver drives FC-AL disks connected through a Fibre Channel + card using the drivers/fc4 layer (currently only SOCAL). The most + common is either A5000 array or internal disks in E[3-6]000 + machines. + + This support is also available as a module called fcal.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . If unsure, say N. + AcornSCSI support CONFIG_SCSI_ACORNSCSI_3 This enables support for the Acorn SCSI card (aka30). If you have an @@ -4985,6 +5494,16 @@ In general, this improves performance; however some SCSI devices don't implement it properly, so the safe answer is N. +ARXE SCSI support +CONFIG_SCSI_ARXESCSI + Around 1991, Arxe Systems Limited released a high density floppy + disc interface for the Acorn Archimedes range, to allow the use of + HD discs from the then new A5000 on earlier models. This interface + was either sold on its own or with an integral SCSI controller. + Technical details on this NCR53c94-based device are available at + + Say Y here to compile in support for the SCSI controller. + Oak SCSI support CONFIG_SCSI_OAK1 This enables support for the Oak SCSI card. If you have an Acorn @@ -5068,6 +5587,26 @@ time, you need to compile this driver as a module. Instead of 'dummy', the devices will then be called 'dummy0', 'dummy1' etc. +Bonding driver support +CONFIG_BONDING + Say 'Y' or 'M' if you wish to be able to 'bond' multiple Ethernet + Channels together. This is called 'Etherchannel' by Cisco, + 'Trunking' by Sun, and 'Bonding' in Linux. + + If you have two Ethernet connections to some other computer, you can + make them behave like one double speed connection using this driver. + Naturally, this has to be supported at the other end as well, either + with a similar Bonding Linux driver, a Cisco 5500 switch or a + SunTrunking SunSoft driver. + + This is similar to the EQL driver, but it merges Ethernet segments + instead of serial lines. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . The module will be + called bonding.o. + SLIP (serial line) support CONFIG_SLIP Say Y if you intend to use SLIP or CSLIP (compressed SLIP) to @@ -5663,27 +6202,70 @@ scheduled to be sent out over a network device be classified in some way. If you say Y here, you will get a choice of several different packet classifiers with the following questions. -# -# Routing tables based classifier -# CONFIG_NET_CLS_ROUTE -# -# Firewall based classifier -# CONFIG_NET_CLS_FW -# -# U32 classifier -# CONFIG_NET_CLS_U32 -# -# Special RSVP classifier -# CONFIG_NET_CLS_RSVP -# -# Special RSVP classifier for IPv6 -# CONFIG_NET_CLS_RSVP6 -# -# Ingres traffic policing -# CONFIG_NET_CLS_POLICE -### -### Some expert please fill these in -### + +Traffic policing (needed for in/egress) +CONFIG_NET_CLS_POLICE + Say Y to support traffic policing (bandwidth limits). Needed for ingress + and egress rate limiting. + +Routing tables based classifier +CONFIG_NET_CLS_ROUTE4 + If you say Y here, you will be able to classify outgoing packets + according to the route table entry they matched. If unsure, say Y. + + This code is also available as a module called cls_route.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +Firewall based classifier +CONFIG_NET_CLS_FW + If you say Y here, you will be able to classify outgoing packets + according to firewall criteria you specified. + + This code is also available as a module called cls_fw.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +U32 classifier +CONFIG_NET_CLS_U32 + If you say Y here, you will be able to classify outgoing packets + according to their destination address. If unsure, say Y. + + This code is also available as a module called cls_u32.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read + +Special RSVP classifier +CONFIG_NET_CLS_RSVP + The Resource Reservation Protocol (RSVP) permits end systems to + request a minimum and maximum data flow rate for a connection; this + is important for real time data such as streaming sound or video. + + Say Y here if you want to be able to classify outgoing packets based + on their RSVP requests. + + This code is also available as a module called cls_rsvp.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read + +Special RSVP classifier for IPv6 +CONFIG_NET_CLS_RSVP6 + The Resource Reservation Protocol (RSVP) permits end systems to + request a minimum and maximum data flow rate for a connection; this + is important for real time data such as streaming sound or video. + + Say Y here if you want to be able to classify outgoing packets based + on their RSVP requests and you are using the new Internet Protocol + IPv6 as opposed to the older and more common IPv4. + + This code is also available as a module called cls_rsvp6.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read Network code profiler CONFIG_NET_PROFILE @@ -5746,6 +6328,26 @@ The module will be called lmc.o. For general information about modules read Documentation/modules.txt. +Fibre Channel driver support +CONFIG_NET_FC + Fibre Channel is a high speed serial protocol mainly used to connect + large storage devices to the computer; it is compatible with and + intended to replace SCSI. + + If you intend to use Fibre Channel, you need to have a Fibre channel + adaptor card in your computer; say Y here and to the driver for your + adaptor below. You also should have said Y to "SCSI support" and + "SCSI generic support". + +Interphase 5526 Tachyon chipset based adaptor support +CONFIG_IPHASE5526 + Say Y here if you have a Fibre Channel adaptor of this kind. + + The driver 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 iph5526.o. For general information about + modules read . + Red Creek Hardware VPN (EXPERIMENTAL) CONFIG_RCPCI This is a driver for hardware which provides a Virtual Private @@ -6224,21 +6826,20 @@ say M here and read Documentation/modules.txt. This is recommended. The module will be called rtl8139.o. -Alternative RealTek 8139 driver (8139too) support +Alternative RealTek 8129/8139 driver (8139too) support CONFIG_RTL8139TOO - This is a sophisticated, multi platform driver for RealTek 8139x - based Fast Ethernet cards. It tries to work around several not + This is a sophisticated, multi platform driver for RealTek 8129 and + 8139x based Fast Ethernet cards. It tries to work around several not well documented hardware bugs in these chips and is also - usually faster than the original driver. However, 8129 is not - supported. - If you are sure you have a RTL8139-based card, choose this driver. + usually faster than the original driver. + If you have one of these cards, choose this driver. You can find more information in the Ethernet-HOWTO, available by anonymous FTP from ftp://metalab.unc.edu/pub/Linux/docs/HOWTO . 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), say M here and read Documentation/modules.txt. This is recommended. - The module will be called rtl8139too.o . + The module will be called 8139too.o . Use PIO instead of MMIO CONFIG_8139TOO_PIO @@ -6255,6 +6856,12 @@ since hardly documented by the manufacturer. If unsure, say n. +Support for RealTek 8129 +CONFIG_8139TOO_8129 + To include 8129 support, say y here. The RTL-8129 chip is basically + the same as the RTL-8139 except for the fact that boards with this + chip use an external Ethernet transceiver. + SiS 900/7016 support CONFIG_SIS900 This is a driver for the Fast Ethernet PCI network cards based on @@ -6353,6 +6960,15 @@ say M here and read Documentation/modules.txt. This is recommended. The module will be called sk98lin.o. +MyriCOM Gigabit Ethernet support +CONFIG_MYRI_SBUS + This driver supports MyriCOM Sbus gigabit Ethernet cards. + + 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), + say M here and read . This is recommended. + The module will be called myri_sbus.o. + AMD LANCE and PCnet (AT1500 and NE2100) support CONFIG_LANCE If you have a network (Ethernet) card of this type, say Y and read @@ -6469,6 +7085,18 @@ Documentation/networking/net-modules.txt. The module will be called 3c509.o. +3c515 ISA Fast EtherLink +CONFIG_3C515 + If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet + network card, say Y and read the Ethernet-HOWTO, available from + . + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read as well as + . The module will be called + 3c515.o. + 3c590 series (592/595/597) "Vortex" support CONFIG_VORTEX If you have a 3Com "Vortex" (Fast EtherLink 3c590/3c592/3c595/3c597) @@ -6709,6 +7337,18 @@ Documentation/networking/net-modules.txt. The module will be called eexpress.o. +Packet Engines Hamachi GNIC-II support +CONFIG_HAMACHI + If you have a Gigabit Ethernet card of this type, say Y and read + the Ethernet-HOWTO, available from + . + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read as well as + . The module will be called + hamachi.o. + HP PCLAN+ (27247B and 27252A) support CONFIG_HPLAN_PLUS If you have a network (Ethernet) card of this type, say Y and read @@ -7034,6 +7674,12 @@ module, say M here and read Documentation/modules.txt as well as Documentation/networking/net-modules.txt. +DEC LANCE Ethernet controller support +CONFIG_DECLANCE + This driver is for the series of Ethernet controllers produced by + DEC (now Compaq) based on the AMD Lance chipset, including the + DEPCA series. (This chipset is better known via the NE2100 cards.) + SGI Seeq ethernet controller support CONFIG_SGISEEQ Say Y here if you have an Seeq based Ethernet network card. This is @@ -7183,6 +7829,51 @@ the Linux-SNA WWW site for the latest information at http://samba.anu.edu.au/linux-sna/documents/drivers/SysKonnect/ +Sun Happy Meal 10/100baseT support +CONFIG_HAPPYMEAL + This driver supports the "hme" interface present on most Ultra + systems and as an option on older Sbus systems. This driver supports + both PCI and Sbus devices. This driver also supports the "qfe" quad + 100baseT device available in both PCI and Sbus configurations. + + This support is also available as a module called sunhme.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +Sun Lance support +CONFIG_SUNLANCE + This driver supports the "le" interface present on all 32-bit Sparc + systems, on some older Ultra systems and as an Sbus option. These + cards are based on the AMD Lance chipset, which is better known + via the NE2100 cards. + + This support is also available as a module called sunlance.o ( = + code which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +Sun BigMAC 10/100baseT support +CONFIG_SUNBMAC + This driver supports the "be" interface available as an Sbus option. + This is Sun's older 100baseT Ethernet device. + + This support is also available as a module called sunbmac.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +Sun QuadEthernet support +CONFIG_SUNQE + This driver supports the "qe" 10baseT Ethernet device, available as + an Sbus option. Note that this is not the same as Quad FastEthernet + "qfe" which is supported by the Happy Meal driver instead. + + This support is also available as a module called sunqe.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + Traffic Shaper (EXPERIMENTAL) CONFIG_SHAPER The traffic shaper is a virtual network device that allows you to @@ -7440,6 +8131,22 @@ linux/include/linux/sbpcd.h before compiling the new kernel. Read the file Documentation/cdrom/sbpcd. +Matsushita/Panasonic, ... third CD-ROM controller support +CONFIG_SBPCD3 + Say Y here only if you have three CD-ROM controller cards of this type + (usually only if you have more than six drives). You should enter + the parameters for the second, third and fourth interface card into + include/linux/sbpcd.h before compiling the new kernel. Read + the file . + +Matsushita/Panasonic, ... fourth CD-ROM controller support +CONFIG_SBPCD4 + Say Y here only if you have four CD-ROM controller cards of this type + (usually only if you have more than eight drives). You should enter + the parameters for the second, third and fourth interface card into + include/linux/sbpcd.h before compiling the new kernel. Read + the file . + Aztech/Orchid/Okano/Wearnes/TXC/CyDROM CDROM support CONFIG_AZTCD This is your driver if you have an Aztech CDA268-01A, Orchid @@ -7710,6 +8417,20 @@ The module will be called wacom.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +Use input layer for ADB devices +CONFIG_INPUT_ADBHID + Say Y here if you want to have ADB (Apple Desktop Bus) HID devices + such as keyboards, mice, joysticks, or graphic tablets handled by the + input layer. If you say Y here, make sure to say Y to the + corresponding drivers "Keyboard support" (CONFIG_INPUT_KEYBDEV), + "Mouse Support" (CONFIG_INPUT_MOUSEDEV) and "Event interface support" + (CONFIG_INPUT_EVDEV) as well. + + If you say N here, you still have the option of using the old ADB + keyboard and mouse drivers. + + If unsure, say Y. + Logitech WingMan Force joystick support CONFIG_USB_WMFORCE Say Y here if you want to use the Logitech WingMan Force with Linux @@ -7854,6 +8575,17 @@ The module will be called visor.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +USB Belkin and Paracom Single Port Serial Driver +CONFIG_USB_SERIAL_BELKIN + Say Y here if you want to use a Belkin USB Serial single port + adaptor (F5U103 is one of the model numbers) or the Peracom single + port USB to serial adapter. + + 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 belkin_sa.o. If you want to compile it as + a module, say M here and read . + USB FTDI Single Port Serial Driver CONFIG_USB_SERIAL_FTDI_SIO Say Y here if you want to use a FTDI SIO single port USB to serial @@ -7913,6 +8645,10 @@ CONFIG_USB_SERIAL_KEYSPAN_USA19W Say Y here to include firmware for the USA-19W converter. +USB Keyspan USA-49W Firmware +CONFIG_USB_SERIAL_KEYSPAN_USA49W + Say Y here to include firmware for the USA-49W converter. + USB ZyXEL omni.net LCD Plus Driver CONFIG_USB_SERIAL_OMNINET Say Y here if you want to use a ZyXEL omni.net LCD ISDN TA. @@ -7947,6 +8683,45 @@ The module will be called empeg.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +USB MCT Single Port Serial Driver +CONFIG_USB_SERIAL_MCT_U232 + Say Y here if you want to use a USB Serial single port adapter from + Magic Control Technology Corp. (U232 is one of the model numbers). + + This driver also works with Sitecom U232-P25 and D-Link DU-H3SP USB + BAY devices. + + 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 mct_u232.o. If you want to compile it as + a module, say M here and read . + +USB Edgeport Serial Driver +CONFIG_USB_SERIAL_EDGEPORT + Say Y here if you want to use any of the following devices from + Inside Out Networks (Digi): + Edgeport/4 + Rapidport/4 + Edgeport/4t + Edgeport/2 + Edgeport/4i + Edgeport/2i + Edgeport/421 + Edgeport/21 + Edgeport/8 + Edgeport/8 Dual + Edgeport/2D8 + Edgeport/4D8 + Edgeport/8i + Edgeport/2 DIN + Edgeport/4 DIN + Edgeport/16 Dual + + 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 io_edgeport.o. If you want to compile it + as a module, say M here and read . + USB Serial Converter verbose debug CONFIG_USB_SERIAL_DEBUG Say Y here if you want verbose debug messages from the USB Serial @@ -8480,6 +9255,20 @@ If you don't know what all this is about, say N. +Provide NFS over TCP server support DEVELOPER ONLY +CONFIG_NFSD_TCP + If you are a developer and want to work on fixing problems with + NFS server over TCP support, say Y here. If unsure, say N. + + Some problems can be found by looking for FIXME in net/sunrpc/svcsock.c + +Provide NFSv3 client support +CONFIG_NFS_V3 + Say Y here if you want your NFS client to be able to speak the newer + version 3 of the NFS protocol. + + If unsure, say N. + Root file system on NFS CONFIG_ROOT_NFS If you want your Linux box to mount its whole root filesystem (the @@ -8649,7 +9438,7 @@ answer N. QNX4 filesystem support (EXPERIMENTAL) -CONFIG_QNX4FS_FS +CONFIG_QNX4FS_FS This is the filesystem used by the operating system QNX 4. Say Y if you intend to mount QNX hard disks or floppies. Unless you say Y to "QNX4FS write support" below, you will only be able to read @@ -9537,6 +10326,21 @@ Also it's possible to say M here and compile this driver as kernel loadable module; the module will be called riscom8.o. +Computone IntelliPort Plus serial support +CONFIG_COMPUTONE + This driver supports the entire family of Intelliport II/Plus + controllers with the exception of the MicroChannel controllers and + products previous to the Intelliport II. These are multiport cards, + which give you many serial ports. You would need something like this + to connect more than two modems to your Linux box, for instance in + order to become a dial-in server. If you have a card like that, say + Y here and read . + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . You will get two + modules called ip2.o and ip2main.o. + Specialix IO8+ card support CONFIG_SPECIALIX This is a driver for the Specialix IO8+ multiport card (both the @@ -9688,6 +10492,24 @@ and read Documentation/modules.txt. The module will be called esp.o. If unsure, say N. +Moxa Intellio support +CONFIG_MOXA_INTELLIO + Say Y here if you have a Moxa Intellio multiport serial card. + + This driver can also be built as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called moxa.o. If you want to do that, say M + here. + +Moxa SmartIO support +CONFIG_MOXA_SMARTIO + Say Y here if you have a Moxa SmartIO multiport serial card. + + This driver can also be built as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called mxser.o. If you want to do that, say M + here. + Multi-Tech multiport card support CONFIG_ISI This is a driver for the Multi-Tech cards which provide several @@ -10061,6 +10883,18 @@ Please read Documentation/ftape.txt for a short description how to control the amount of debugging output. +Excessive +CONFIG_FT_FULL_DEBUG + Extremely verbose output for driver debugging purposes. + +Reduced +CONFIG_FT_NO_TRACE + Reduced tape driver debugging output. + +None +CONFIG_FT_NO_TRACE_AT_ALL + Suppress all debugging output from the tape drive. + The floppy drive controller for ftape CONFIG_FT_STD_FDC Only change this setting if you have a special controller. If you @@ -10231,6 +11065,12 @@ CONFIG_DRM_MGA Choose M here if you have a Matrox g200/g400 AGP graphics card. +Creator/Creator3D/Elite3D +CONFIG_DRM_FFB + Choose this option if you have one of Sun's Creator3D-based graphics + and frame buffer cards. Product page at + . + MTRR control and configuration CONFIG_MTRR On Intel P6 family processors (Pentium Pro, Pentium II and later) @@ -10287,6 +11127,22 @@ running kernel whenever you want), say M here and read Documentation/modules.txt. The module will be called dtlk.o. +Intel Random Number Generator support +CONFIG_INTEL_RNG + This driver provides kernel-side support for the Random Number + Generator hardware found on Intel i8xx-based motherboards. + + Both a character driver, used to read() entropy data, and a timer + function which automatically adds entropy directly into the + kernel pool, are exported by this driver. + + To compile this driver as a module ( = code which can be inserted in + and removed from the running kernel whenever you want), say M here + and read . The module will be called + i810_rng.o. + + If unsure, say N. + Advanced Power Management CONFIG_APM APM is a BIOS specification for saving power using several different @@ -10467,6 +11323,20 @@ say M here and read Documentation/modules.txt. The module will be called wdt.o. +WDT PCI Watchdog timer +CONFIG_WDTPCI + If you have a PCI WDT500/501 watchdog board, say Y here, + otherwise N. It is not possible to probe for this board, which means + that you have to inform the kernel about the IO port and IRQ using + the "wdt=" kernel option (try "man bootparam" or see the + documentation of your boot loader (lilo or loadlin) about how to + pass options to the kernel at boot time). + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . The module will be + called wdt_pci.o. + WDT501 features CONFIG_WDT_501 Saying Y here and creating a character special file /dev/temperature @@ -10523,6 +11393,12 @@ module, say M here and read Documentation/modules.txt. Most people will say N. +Advantech SBC Watchdog Timer +CONFIG_ADVANTECH_WDT + If you are configuring a Linux kernel for the Advantech single-board + computer, say `Y' here to support its built-in watchdog timer feature. + See the help for CONFIG_WATCHDOG for discussion. + SBC-60XX Watchdog Timer CONFIG_60XX_WDT This driver can be used with the watchdog timer found on some @@ -10535,6 +11411,32 @@ You can compile this driver directly into the kernel, or use it as a module. The module will be called sbc60xxwdt.o. +Mixcom Watchdog +CONFIG_MIXCOMWD + This is a driver for the Mixcom hardware watchdog cards. This + watchdog simply watches your kernel to make sure it doesn't freeze, + and if it does, it reboots your computer after a certain amount of + time. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module is called mixcomwd.o. If you want to compile it as a + module, say M here and read . Most people + will say N. + +ZF MachZ Watchdog +CONFIG_MACHZ_WDT + If you are using a ZF Micro MachZ processor, say Y here, otherwise N. + This is the driver for the watchdog timer builtin on that processor + using ZF-Logic interface. This watchdog simply watches your kernel to + make sure it doesn't freeze, and if it does, it reboots your computer + after a certain amount of time. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module is called machzwd.o. If you want to compile it as a module, + say M here and read Documentation/modules.txt. + CONFIG_MICROCODE /dev/cpu/microcode - Intel IA32 CPU microcode support @@ -10941,6 +11843,11 @@ some other card made by Media Vision or Logitech since they are not PAS16 compatible. +Enable PAS16 joystick port +CONFIG_PAS_JOYSTICK + Say Y here to enable the Pro Audio Spectrum 16's auxiliary joystick + port. + 100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support CONFIG_SOUND_SB Answer Y if you have an original Sound Blaster card made by Creative @@ -10961,12 +11868,27 @@ You can say M here to compile this driver as a module; the module is called sb.o. -#Loopback MIDI device support -#CONFIG_SOUND_VMIDI -### -### somebody please fill this in. -### -# +Crystal Sound CS4281 +CONFIG_SOUND_CS4281 + Picture and feature list at . + +VIDC 16-bit sound +CONFIG_SOUND_VIDC + 16-bit support for the VIDC onboard sound hardware found on Acorn machines. + +Loopback MIDI device support +CONFIG_SOUND_VMIDI + Support for MIDI loopback on port 1 or 2. + +Yamaha YMF7xx PCI audio (native mode) +CONFIG_SOUND_YMFPCI + Support for Yamaha cards including the YMF711, YMF715, YMF718, YMF719, + YMF724, Waveforce 192XG, and Waveforce 192 Digital. + +Yamaha PCI legacy ports support +CONFIG_SOUND_YMFPCI_LEGACY + Support for YMF7xx PCI cards emulating an MP401. + Gravis Ultrasound support CONFIG_SOUND_GUS Say Y here for any type of Gravis Ultrasound card, including @@ -11158,6 +12080,18 @@ See Documentation/sound/MultiSound for important information about this driver. +MSND Classic I/O +CONFIG_MSNDCLAS_IO + I/O port address for the MultiSound Classic and related cards. + +MSND Classic IRQ +CONFIG_MSNDCLAS_IRQ + Interrupt Request line for the MultiSound Classic and related cards. + +MSND Classic memory address +CONFIG_MSNDCLAS_MEM + Memory-mapped I/O base address for the MultiSound Classic and related cards. + Full pathname of MSNDINIT.BIN firmware file CONFIG_MSNDCLAS_INIT_FILE The MultiSound cards have two firmware files which are required for @@ -11178,6 +12112,51 @@ See Documentation/sound/MultiSound for important information about this driver. +MSND Pinnacle IDE I/O 0 +CONFIG_MSNDPIN_IDE_IO0 + CD-ROM drive 0 memory-mapped I/O base address for the MultiSound Pinnacle + and Fiji sound cards. + +MSND Pinnacle IDE I/O 1 +CONFIG_MSNDPIN_IDE_IO1 + CD-ROM drive 1 memory-mapped I/O base address for the MultiSound Pinnacle + and Fiji sound cards. + +MSND Pinnacle IDE IRQ +CONFIG_MSNDPIN_IDE_IRQ + Interrupt request number for the IDE CD-ROM interface on the + MultiSound Pinnacle and Fiji sound cards. + +MSND Pinnacle I/O +CONFIG_MSNDPIN_IO + Memory-mapped I/O base address for the primary synthesizer on + MultiSound Pinnacle and Fiji sound cards. + +MSND Pinnacle MPU I/O +CONFIG_MSNDPIN_MPU_IO + Memory-mapped I/O base address for the Kurzweil daughterboard + synthesizer on MultiSound Pinnacle and Fiji sound cards. + +MSND Pinnacle MPU IRQ +CONFIG_MSNDPIN_MPU_IRQ + Iinterrupt request number for the Kurzweil daughterboard + synthesizer on MultiSound Pinnacle and Fiji sound cards. + +MSND Pinnacle IRQ +CONFIG_MSNDPIN_IRQ + Interrupt request line for the primary synthesizer on MultiSound + Pinnacle and Fiji sound cards. + +MSND Pinnacle joystick I/O +CONFIG_MSNDPIN_JOYSTICK_IO + Memory-mapped I/O base address for the joystick port on MultiSound Pinnacle + and Fiji sound cards. + +MSND Pinnacle memory +CONFIG_MSNDPIN_MEM + Memory-mapped I/O base address for the primary synthesizer on + MultiSound Pinnacle and Fiji sound cards. + Full pathname of PNDSPINI.BIN firmware file CONFIG_MSNDPIN_INIT_FILE The MultiSound cards have two firmware files which are required for @@ -11373,6 +12352,17 @@ DSP 16 card. Enter: 0 for Sony, 1 for Panasonic, 2 for IDE, 4 for no CDROM present. +SC-6600 CD-ROM Interface I/O Address +CONFIG_SC6600_CDROMBASE + Base I/O port address for the CD-ROM interface of the Audio Excel + DSP 16 card. + +C-Media PCI (CMI8338/8378) +CONFIG_SOUND_CMPCI + Say Y or M if you have a PCI sound card using the CMI8338 + or the CMI8378 chip.set. Data on this chip is available at + . + Audio Excel DSP 16 (MPU401 emulation) CONFIG_AEDSP16_MPU401 Answer Y if you want your audio card to emulate the MPU-401 midi @@ -11502,6 +12492,11 @@ of PCI sound chips. This includes the Allegro sound chip that is a lighter version of the Maestro3. +Intel ICH audio support +CONFIG_SOUND_ICH + Support for integral audio in Intel's I/O Controller Hub (ICH) chipset, + as used on the 810/820/840 motherboards. + Are you using a crosscompiler CONFIG_CROSSCOMPILE Say Y here if you are compiling the kernel on a different @@ -11580,6 +12575,15 @@ This enables Van Jacobson header compression for synchronous PPP. Say Y if the other end of the connection supports it. +Support BSD compression +CONFIG_ISDN_PPP_BSDCOMP + Support for the BSD-Compress compression method for PPP, which uses + the LZW compression method to compress each PPP packet before it is + sent over the wire. The machine at the other end of the PPP link + (usually your ISP) has to support the BSD-Compress compression + method as well for this to be useful. Even if they don't support it, + it is safe to say Y here. + Support audio via ISDN CONFIG_ISDN_AUDIO If you say Y here, the modem-emulator will support a subset of the @@ -11958,6 +12962,12 @@ Interface), a standard making it easy for programs to access ISDN hardware, see http://www.capi.org/ +CAPI2.0 /dev/capi20 support +CONFIG_ISDN_CAPI_CAPI20 + This option will provide the CAPI 2.0 interface to userspace + applications via /dev/capi20. Applications should use the standardized + libcapi20 to access this functionality. You should say Y/M here. + CAPI2.0 Middleware support CONFIG_ISDN_CAPI_MIDDLEWARE This option enables CAPI2.0 Middleware support @@ -11966,6 +12976,13 @@ CONFIG_ISDN_CAPIFS This option enables CAPI CAPI2.0 filesystem support +CAPI2.0 capidrv interface support +CONFIG_ISDN_CAPI_CAPIDRV + This option provides the glue code to hook up CAPI driven cards to + the legacy isdn4linux link layer. If you have a card which is supported + by a CAPI driver, but still want to use old features like ippp + interfaces or ttyI emulation, say Y/M here. + AVM B1 ISA support CONFIG_ISDN_DRV_AVMB1_B1ISA Enable support for the ISA version of the AVM B1 card. @@ -12020,6 +13037,17 @@ WWW, you need to have access to a machine on the Internet that has a program like lynx or netscape) or mail to hackers@cafe.anu.edu.au +Hypercope HYSDN cards (Champ, Ergo, Metro) support (module) +CONFIG_HYSDN + Say Y here if you have one of Hypercope's active PCI ISDN cards + Champ, Ergo and Metro. You will then get a module called hysdn.o. + Please read the file for more + information. + +HYSDN CAPI 2.0 support +CONFIG_HYSDN_CAPI + Say Y here if you like to use Hypercope's CAPI 2.0 interface + Support for Sun4 architecture CONFIG_SUN4 Say Y here if, and only if, your machine is a Sun4. Note that @@ -12031,6 +13059,23 @@ This is the driver for the Sun ESP SCSI host adapter. The ESP chipset is present in most SPARC-based computers. +PTI Qlogic, ISP Driver +CONFIG_SCSI_QLOGICPTI + This driver supports SBUS SCSI controllers from PTI or QLogic. These + controllers are known under Solaris as qpti and in the openprom as + PTI,ptisp or QLGC,isp. Note that PCI QLogic SCSI controllers are + driven by a different driver. + + This support is also available as a module called qlogicpti.o ( = + code which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + +Sun PROM console +CONFIG_PROM_CONSOLE + Say Y to build a console driver for Sun machines that uses the terminal + emulation built into their console PROMS. + SPARC /dev/openprom compatibility driver CONFIG_SUN_OPENPROMIO This driver provides user programs with an interface to the SPARC @@ -12041,6 +13086,41 @@ inserted in and removed from the running kernel whenever you want), say M and read Documentation/modules.txt. If unsure, say Y. +Openprom tree appears in /proc/openprom +CONFIG_SUN_OPENPROMFS + If you say Y, the OpenPROM device tree will be available as a + virtual file system, which you can mount to /proc/openprom by "mount + -t openpromfs none /proc/openprom". + + If you want to compile the /proc/openprom support as a module ( = + code which can be inserted in and removed from the running kernel + whenever you want), say M here and read . + The module will be called openpromfs.o. If unsure, say M. + +Kernel support for Linux/Sparc 32bit binary compatibility +CONFIG_SPARC32_COMPAT + This allows you to run 32-bit binaries on your Ultra. + Everybody wants this; say Y. + +Kernel support for 32-bit ELF binaries +CONFIG_BINFMT_ELF32 + This allows you to run 32-bit Linux/ELF binaries on your Ultra. + Everybody wants this; say Y. + +Kernel support for 32-bit (ie. SunOS) a.out binaries +CONFIG_BINFMT_AOUT32 + This allows you to run 32-bit a.out format binaries on your Ultra. + If you want to run SunOS binaries (see SunOS binary emulation below) + or other a.out binaries, say Y. If unsure, say N. + +SunOS binary emulation +CONFIG_SUNOS_EMUL + This allows you to run most SunOS binaries. If you want to do this, + say Y here and place appropriate files in /usr/gnemul/sunos. See + for more information. If you want + to run SunOS binaries on an Ultra you must also say Y to "Kernel + support for 32-bit a.out binaries" above. + Mostek real time clock support CONFIG_SUN_MOSTEK_RTC The Mostek RTC chip is used on all knows Sun computers except @@ -12049,12 +13129,69 @@ Say Y here unless you are building a special purpose kernel. -# -#Siemens SAB82532 serial support -#CONFIG_SAB82532 -### -### Please someone fill these in. -### +OBP Flash Device support +CONFIG_OBP_FLASH + The OpenBoot PROM on Ultra systems is flashable. If you want to be + able to upgrade the OBP firmware, say Y here. + +Siemens SAB82532 serial support +CONFIG_SAB82532 + This driver supports the serial ports on newer (PCI) Ultra systems. + Say Y if you want to be able to use your serial ports. + +Videopix Frame Grabber +CONFIG_SUN_VIDEOPIX + Say Y here to support the Videopix Frame Grabber from Sun + Microsystems, commonly found on SPARCstations. This card, which is + based on the Phillips SAA9051, can handle NTSC and PAL/SECAM and + SVIDEO signals. + +Sun bidirectional parallel port support +CONFIG_SUN_BPP + Say Y here to support Sun's obsolete variant of IEEE1284 + bidirectional parallel port protocol as /dev/bppX. Can be built on + x86 machines. + +Aurora Multiboard 1600se +CONFIG_SUN_AURORA + The Aurora Multiboard is a multi-port high-speed serial controller. + If you have one of these, say Y. + +Audio support +CONFIG_SPARCAUDIO + This driver provides support for the build-in sound devices on most + Sun machines. If you want to be able to use this, select this option + and one or more of the lowlevel drivers below. See + for more + information. + +AMD7930 Lowlevel Driver +CONFIG_SPARCAUDIO_AMD7930 + This driver supports the AMD 7930 chip found on sun4c, 4/6xx, and + SparcClassic systems. + +CS4231 Lowlevel Driver +CONFIG_SPARCAUDIO_CS4231 + This driver supports the Crystal Semiconductor CS4231 chip found on + the SS4, SS5, and Ultras. + +DBRI Lowlevel Driver +CONFIG_SPARCAUDIO_DBRI + This driver supports the DBRI audio interface found on the SS10, + SS20, Sparcbook 3, and Voyager systems. + +Dummy Lowlevel Driver +CONFIG_SPARCAUDIO_DUMMY + This is a pseudo-driver used for debugging and testing the + sparcaudio subsystem. Say N unless you want to work on this + subsystem. + +/proc/hardware support +CONFIG_PROC_HARDWARE + Say Y here to support the /proc/hardware file, which gives you + access to information about the machine you're running on, + including the model, CPU, MMU, clock speed, BogoMIPS rating, + and memory size. # # m68k-specific kernel options @@ -12066,6 +13203,16 @@ you plan to use this kernel on an Amiga, say Y here and browse the material available in Documentation/m68k; otherwise say N. +A4000T SCSI support +CONFIG_A4000T_SCSI + Support for the NCR53C710 SCSI controller on the Amiga 4000T. + +A4091 SCSI support +CONFIG_A4091_SCSI + Support for the NCR53C710 chip on the Amiga 4091 Z3 SCSI2 controller + (1993). Very obscure -- the 4091 was part of an Amiga 4000 upgrade plan + at the time the Amiga business was sold to DKB. + Atari support CONFIG_ATARI This option enables support for the 68000-based Atari series of @@ -12094,6 +13241,49 @@ If you plan to try to use the kernel on such a machine say Y here. Everybody else says N. +Q40/Q60 support +CONFIG_Q40 + The Q40 is a Motorola 68040-based successor to the Sinclair QL + manufactured in Germany. There is an official Q40 home page at + . This option enables support for the Q40 and Q60. + Select your CPU below. For 68LC060 don't forget to enable FPU emulation. + +Sun 3 support +CONFIG_SUN3 + This option enables support for the Sun 3 series of workstations. + Currently, only the Sun 3/80 is supported within the Sun 3x family. + You will also want to enable 68030 support. General Linux + information on the Sun 3x series (now discontinued) is at + . + + If you don't want to compile a kernel for a Sun 3, say N. + +Sun 3X support +CONFIG_SUN3X + This option enables support for the Sun 3x series of workstations. + Be warned that this support is very experimental. You will also want + to say Y to 68020 support and N to the other processors below. + General Linux information on the Sun 3x series (now discontinued) + is at . + + If you don't want to compile a kernel for a Sun 3x, say N. + +Sun3x builtin serial support +CONFIG_SUN3X_ZS + ZS refers to a type of asynchronous serial port built in to the Sun3 + and Sun3x workstations; if you have a Sun 3, you probably have + these. Say 'Y' to support ZS ports directly. This option must be + enabled in order to support the + keyboard and mouse ports. + +Sun keyboard support +CONFIG_SUN_KEYBOARD + Say Y here to support the keyboard found on Sun 3 and 3x workstations. + It can also be used support Sun Type-5 keyboards through an adaptor. + See and + for details on the + latter. + 68020 support CONFIG_M68020 If you anticipate running this kernel on a computer with a MC68020 @@ -12144,6 +13334,25 @@ it here. The emulator will then only calculate with a 64 bit mantissa and round slightly incorrect. +Advanced configuration options +CONFIG_ADVANCED + This gives you access to some advanced options for the CPU. The + defaults should be fine for most users, but these options may make + it possible for you to improve performance somewhat if you know what + you are doing. + + Note that the answer to this question won't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about these options. + + Most users should say N to this question. + +Use one physical chunk of memory only +CONFIG_SINGLE_MEMORY_CHUNK + Ignore all but the first contiguous chunk of physical memory for VM + purposes. This will save a few bytes kernel size and may speed up + some operations. Say N if not sure. + Advanced processor options CONFIG_ADVANCED_CPU This gives you access to some advanced options for the CPU. The @@ -12181,6 +13390,11 @@ Include support in the kernel for pcmcia on Amiga 1200 and Amiga 600. If you intend to use pcmcia cards say Y; otherwise say N. +Hisoft Whippet PCMCIA serial support +CONFIG_WHIPPET_SERIAL + HiSoft has a web page at , but there + is no listing for the Whippet in their Amiga section. + Amiga GSP (TMS340x0) support CONFIG_AMIGA_GSP Include support for Amiga graphics cards that use the Texas @@ -12220,6 +13434,11 @@ sound). The probability that such allocations at module load time fail is drastically reduced. +ST-RAM statistics in /proc +CONFIG_STRAM_PROC + Say Y here to report ST-RAM usage statistics in /proc/stram. See the + help for CONFIG_STRAM_SWAP for discussion of ST-RAM and its uses. + Atari ACSI support CONFIG_ATARI_ACSI This enables support for the Atari ACSI interface. The driver @@ -12318,6 +13537,12 @@ If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use one in the near future, say Y to this question. Otherwise, say N. +BSC Oktagon SCSI support +CONFIG_OKTAGON_SCSI + If you have the BSC Oktagon SCSI disk controller for the Amiga, say Y to + this question. If you're in doubt about whether you have one, see the + picture at . + Atari native SCSI support CONFIG_ATARI_SCSI If you have an Atari with built-in NCR5380 SCSI controller (TT, @@ -12338,6 +13563,12 @@ use a Toshiba CD-ROM drive; otherwise, the option is not needed and would impact performance a bit, so say N. +Reset SCSI-devices at boottime +CONFIG_ATARI_SCSI_RESET_BOOT + Reset the devices on your Atari whenever it boots. This makes the boot + process fractionally longer but may assist recovery from errors that + leave the devices with SCSI operations partway completed. + Hades SCSI DMA emulator (EXPERIMENTAL) CONFIG_TT_DMA_EMUL This option enables code which emulates the TT SCSI DMA chip on the @@ -12400,6 +13631,11 @@ want). The module is called hydra.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +Sun3x ESP SCSI driver +CONFIG_SUN3X_ESP + The ESP was an on-board SCSI controller used on Sun 3/80 + machines. Say Y here to compile in support for it. + Pcmcia NE2000 compatible support CONFIG_APNE If you have a pcmcia ne2000 compatible adapter, say Y. Otherwise, @@ -12446,6 +13682,25 @@ LC475/476 models. It is also found in the DuoDock Plus and DuoDock II, as well as many NuBus, LC-PDS, and comm-slot cards. +Macintosh NS8390 based Ethernet support +CONFIG_MAC8390 + If you want to include a driver to support Nubus or LC-PDS + Ethernet cards using an NS8390 chipset or its equivalent, say Y + and read the Ethernet-HOWTO, available from + . + +Macintosh CS89x0 based Ethernet support +CONFIG_MAC89x0 + Support for CS89x0 chipset based Ethernet cards. If you have a Nubus + or LC-PDS network (Ethernet) card of this type, say Y and read the + Ethernet-HOWTO, available from . + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read as well as + . This module will be + called mac89x0.o. + Macintosh (AV) onboard MACE ethernet CONFIG_MACMACE Say Y here if you have a Centris 660AV, a Quadra 660AV, or a Quadra @@ -12542,6 +13797,11 @@ If you want to compile it as a module, say M here and read Documentation/modules.txt. +Support for early boot text console +CONFIG_BOOTX_TEXT + Say Y here to see progress messages from the boot firmware in text mode. + Requires either BootX or Open Firmware. + Amiga builtin serial support CONFIG_AMIGA_BUILTIN_SERIAL If you want to use your Amiga's built-in serial port in Linux, @@ -12557,6 +13817,16 @@ If you want to use a GVP IO-Extender serial card in Linux, say Y. Otherwise, say N. +GVP IO-Extender parallel printer support +CONFIG_GVPIOEXT_LP + Say Y to enable driving a printer from the parallel port on your + GVP IO-Extender card, N otherwise + +GVP IO-Extender PLIP support +CONFIG_GVPIOEXT_PLIP + Say Y to enable doing IP over the parallel port on your GVP IO-Extender + card, N otherwise + Multiface Card III serial support CONFIG_MULTIFACE_III_TTY If you want to use a Multiface III card's serial port in Linux, @@ -12625,6 +13895,99 @@ only supports one type or the other. However, there is very early work on support for CHRP, PReP and PowerMac's from a single binary. +# Choice: ppc6xxtype +Machine Type +CONFIG_ALL_PPC + Linux currently supports several different kinds of PowerPC-based + machines: Apple Power Macintoshes and clones (such as the Motorola + Starmax series), PReP (PowerPC Reference Platform) machines such as + the Motorola PowerStack, CHRP (Common Hardware Reference Platform), + the embedded MBX boards from Motorola and many others. Currently, + the default option is to build a kernel which works on the first + three. Support for other machines is currently incomplete. + + Select PowerMac/PReP/MTX/CHRP if configuring for any of the above. + + Select Gemini if configuring for a Synergy Microsystems' Gemini series + Single Board Computer. + More information is available at: + + + Select APUS if configuring for a PowerUP Amiga. + More information is available at: + + +Gemini +CONFIG_GEMINI + Select Gemini if configuring for a Synergy Microsystems' Gemini series + Single Board Computer. + More information is available at: + + +Apus +CONFIG_APUS + Select APUS if configuring for a PowerUP Amiga. + More information is available at: + + +Power management support for PowerBooks +CONFIG_PMAC_PBOOK + This provides support for putting a PowerBook to sleep; it also + enables media bay support. Power management works on the + PB2400/3400/3500, Wallstreet, Lombard, and Bronze PowerBook G3. You + must get the power management daemon, pmud, to make it work and you + must have the /dev/pmu device (see the pmud README). + + Get pmud from . + + If you have a PowerBook, you should say Y. + + You may also want to compile the dma sound driver as a module and + have it autoloaded. The act of removing the module shuts down the + sound hardware for more power savings. + +MBX +CONFIG_MBX + MBX is a line of Motorola single-board computer based around the MPC821 + and MPC860 processors, and intended for embedded-controller applications. + Say Y here to support these boards directly. + +AltiVec support +CONFIG_ALTIVEC + Say Y here to compile in support for Motorola AltiVec boards. The + AltiVec board is baced on the MPC7400 embedded version of the PowerPC + and adds a SIMD vector-processing unit. Product information at + . + +ADB raw keycode support +CONFIG_MAC_ADBKEYCODES + This provides support for sending raw ADB keycodes to console + devices. This is the default up to 2.4.0, but in future this may be + phased out in favor of generic Linux keycodes. If you say Y here, you + can dynamically switch via the + /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes + sysctl and with the "keyboard_sends_linux_keycodes=" kernel argument. + + If unsure, say Y here. + +Mouse button 2+3 emulation support +CONFIG_MAC_EMUMOUSEBTN + This provides generic support for emulating the 2nd and 3rd mouse + button with keypresses. If you say Y here, the emulation is still + disabled by default. The emulation is controlled by these sysctl entries: + /proc/sys/dev/mac_hid/mouse_button_emulation + /proc/sys/dev/mac_hid/mouse_button2_keycode + /proc/sys/dev/mac_hid/mouse_button3_keycode + +Enhanced Real Time Clock Support (/dev/rtc) +CONFIG_PPC_RTC + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you + will get access to the real time clock (or hardware clock) built + into your computer. + + If unsure, say Y here. + Support for Open Firmware device tree in /proc CONFIG_PROC_DEVICETREE This option adds a device-tree directory under /proc which contains @@ -12704,6 +14067,16 @@ whenever you want). If you want to compile it as a module, say M here and read Documentation/modules.txt. +Symbios 53c885 (Synergy Ethernet) support +CONFIG_NCR885E + This is and Ethernet driver for the dual-function NCR 53C885 + SCSI/Ethernet controller. + + This driver is also available as a module called ncr885e.o ( = code + which can be inserted in and removed from the running kernel + whenever you want). If you want to compile it as a module, say M + here and read . + Video For Linux CONFIG_VIDEO_DEV Support for audio/video capture and overlay devices and FM radio @@ -12990,6 +14363,22 @@ whenever you want). If you want to compile it as a module, say M here and read Documentation/modules.txt. +SGI Vino Video For Linux +CONFIG_VIDEO_VINO + Say Y here to build in support for the Vino video input system found on + SGI Indy machines. + +Zoran ZR36057/36060 Video For Linux +CONFIG_VIDEO_ZORAN + Say Y here to include support for video cards based on the the Zoran + ZR36057/36060 encoder/decoder chip (including the Iomega Buz and the + Miro DC10 and DC30 video capture cards). + +Include support for Iomega Buz +CONFIG_VIDEO_BUZ + Say Y here to include support for the Iomega Buz video card. There is + a Buz/Linux homepage at . + SAA5249 Teletext processor CONFIG_VIDEO_SAA5249 Support for I2C bus based teletext using the SAA5249 chip. At the @@ -13037,6 +14426,32 @@ # # ARM options # +# Choice: armtype +A5000 +CONFIG_ARCH_A5K + Say Y here to to support the Acorn A5000. Linux can support the internal + IDE disk and CD-ROM interface, serial and parallel port, and the floppy + drive. Note that on some A5000s the floppy is plugged into the wrong + socket on the motherboard. + +EBSA-110 +CONFIG_ARCH_EBSA110 + This is an evaluation board for the StrongARM processor available + from Digital. It has limited hardware on-board, including an onboard + Ethernet interface, two PCMCIA sockets, two serial ports and a + parallel port. + +RiscPC +CONFIG_ARCH_RPC + On the Acorn Risc-PC, Linux can support the internal IDE disk and + CD-ROM interface, serial and parallel port, and the floppy drive. + +2MB physical memory +CONFIG_PAGESIZE_16 + Say Y here if your Archimedes or A5000 system has only 2MB of + memory, otherwise say N. The resulting kernel will not run on a + machine with 4MB of memory. + CPU Optimization CONFIG_CPU_ARM2 This selects the processor type of your CPU. This is only used to @@ -13066,6 +14481,16 @@ CONFIG_ARCH_NETWINDER Say Y here if you intend to run this kernel on the NetWinder. +Support StrongARM SA-110 processor +CONFIG_CPU_SA110 + The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and + is available at five speeds ranging from 100 MHz to 233 MHz. + More information is available at + + + Say Y if you want support for the SA-110 processor. + Otherwise, say N. + Math emulation CONFIG_NWFPE Say Y to include the NWFPE floating point emulator in the kernel. This @@ -13121,6 +14546,29 @@ footprint of the running kernel but it can increase the amount of time and disk space needed for compilation. If in doubt say N. +Kernel low-level debugging functions +CONFIG_DEBUG_LL + Say Y here to include definitions of printascii, printchar, printhex + in the kernel. This is helpful if you are debugging code that + executes before the console is initialized. + +Kernel low-level debugging messages via footbridge serial port +CONFIG_DEBUG_DC21285_PORT + Say Y here if you want the low-level print routines to direct their + output to the serial port in the DC21285 (Footbridge). Saying N + will cause the debug messages to appear on the first 16550 + serial port. + +Include kgdb kernel debugger +CONFIG_KGDB + Include in-kernel hooks for kgdb, the Linux kernel source level debugger. + This project has a web page at . + +Include xmon kernel debugger +CONFIG_XMON + Include in-kernel hooks for the xmon kernel monitor/debugger supported + by the PPC port. + Split initialisation functions into discardable section CONFIG_TEXT_SECTIONS Normally code that is only used during initialisation is collected @@ -13219,6 +14667,11 @@ it as a module, say M here and read Documentation/modules.txt. The module will be called +Ultra (connectionless) protocol +CONFIG_IRDA_ULTRA + Say Y here to support the connectionless Ultra IRDA protocol, also + called IrOBEX. + IrDA protocol options CONFIG_IRDA_OPTIONS Say Y here if you want to configure any of the following IrDA options. @@ -13346,6 +14799,24 @@ read Documentation/modules.txt. This chipset is used by the Toshiba Libretto 100CT, and many more laptops. +SMC IrCC +CONFIG_SMC_IRCC_FIR + Say Y here if you want to build support for the SMC Infrared + Communications Controller. It is used in the Fujitsu Lifebook 635t + and Sony PCG-505TX. If you want to compile it as a module, say M + here and read . The module will be called + smc-ircc.o. + +Serial dongle support +CONFIG_DONGLE + Say Y here if you have an infrared device that connects to your + computer's serial port. These devices are called dongles. Then say Y + or M to the driver for your particular dongle below. + + Note that the answer to this question won't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about serial dongles. + ESI JetEye PC Dongle CONFIG_ESI_DONGLE Say Y here if you want to build support for the Extended Systems @@ -13392,8 +14863,8 @@ by IrTTY. To activate support for Parallax dongles you will have to start irattach like this "irattach -d litelink". -Old Belking dongle -CONFIG_OLD_BELKING_DONGLE +Old Belkin dongle +CONFIG_OLD_BELKIN_DONGLE Say Y here if you want to build support for the old Belkin SmartBeam dongle. If you want to compile it as a module, say M here and read Documentation/modules.txt. The Belkin SmartBeam dongle (F5F500) come @@ -13411,6 +14882,13 @@ MVME166, MVME167, MVME172, and MVME177. BVME4000 and BVME6000 boards from BVM Ltd are also supported. +MVME147 support +CONFIG_MVME147 + Say Y to include support for early Motorola VME boards. This will + build a kernel which can run on MVME147 single-board computers. If + you select this option you will have to select the appropriate + drivers for SCSI, Ethernet and serial ports later on. + MVME162, 166 and 167 support CONFIG_MVME16x Say Y to include support for Motorola VME boards. This will build a @@ -13439,6 +14917,23 @@ is hardwired on. The 53c710 SCSI driver is known to suffer from this problem. +WD33C93 SCSI driver for MVME147 +CONFIG_MVME147_SCSI + Support for the on-board SCSI controller on the Motorola MVME147 + single-board computer. + +SCC support for MVME147 serial ports +CONFIG_MVME147_SCC + This is the driver for the serial ports on the Motorola MVME147 + boards. Everyone using one of these boards should say Y here. + +MVME147 (Lance) Ethernet support +CONFIG_MVME147_NET + Support for the on-board Ethernet interface on the Motorola MVME147 + single-board computer. Say Y here to include the + driver for this chip in your kernel. If you want to compile it as + a module, say M here and read . + NCR53C710 SCSI driver for MVME16x CONFIG_MVME16x_SCSI The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710 @@ -13496,6 +14991,13 @@ s390-compiler released by IBM (based on gcc-2.95.1) before. Merge some code into the kernel to make the image IPLable +CONFIG_IPL + If you want to use the produced kernel to IPL directly from a + device, you have to merge a bootsector specific to the device + into the first bytes of the kernel. You will have to select the + IPL device. + +Merge some code into the kernel to make the image IPLable CONFIG_IPLABLE If you want to use the produced kernel to IPL directly from a device, you have to merge a bootsector specific to the device @@ -13551,6 +15053,62 @@ CONFIG_DASD_FBA FBA devices are e.g. the Vitual disk in storage under VM/ESA and others. +Support for 3215 line mode terminal +CONFIG_3215 + Include support for IBM 3215 line-mode terminals. Can't be used + if 3270 console support is chosen. + +Support for console on 3215 line mode terminal +CONFIG_3215_CONSOLE + Include support for using an IBM 3215 line-mode terminal as the Linux + system console. Can't be used if 3270 console support is chosen. + +Support for HWC line mode terminal +CONFIG_HWC + Include support for IBM HWC line-mode terminals. + +Console on HWC line mode terminal +CONFIG_HWC_CONSOLE + Include support for using an IBM HWC line-mode terminal as the Linux + system console. + +CTC device support +CONFIG_CTC + Select this option if you want to use channel-to-channel networking + on IBM S/390 or zSeries. This device driver supports real CTC + coupling using ESCON. It also supports virtual CTCs when running + under VM. It will use the channel device configuration if this is + available. This option is also available as a module which will be + called ctc.o. If you do not know what it is, it's safe to say "Y". + +XPRAM disk support +CONFIG_BLK_DEV_XPRAM + Select this option if you want to use your expanded storage on S/390 + or zSeries as a disk. This is useful as a _fast_ swap device if you + want to access more than 2G of memory when running in 31 bit mode. + This option is also available as a module which will be called + xpram.o. If unsure, say "N". + +Fast IRQ handling +CONFIG_FAST_IRQ + Select this option in order to get the interrupts processed faster + on your S/390 or zSeries machine. If selected, after an interrupt + is processed, the channel subsystem will be asked for other pending + interrupts which will also be processed before leaving the interrupt + context. This speeds up the I/O a lot. Say "Y". + +IUCV device support (VM only) +CONFIG_IUCV + Select this option if you want to use inter-user communication + vehicle networking under VM or VIF. This option is also available + as a module which will be called iucv.o. If unsure, say "Y". + +Show crashed user process info +CONFIG_PROCESS_DEBUG + Say Y to print all process fault locations to the console. This is + a debugging option; you probably do not want to set it unless you + are an S390 port maintainer. + Diag access to CMS formatted minidisk CONFIG_DASD_MDSK By using this access method you can acess any disk supported by VM/ESA. @@ -13567,12 +15125,24 @@ Compaq Smart Array support CONFIG_BLK_CPQ_CISS_DA - This is the driver for Compaq Smart Array controllers. + This is the driver for Compaq Smart Array 5xxx controllers. Everyone using these boards should say Y here. See "linux/Documentation/cciss.txt" for the current list of boards supported by this driver, and for further information on the use of this driver. +Linux telephony support +CONFIG_PHONE + Say Y here if you have a telephony card, which for example allows + you to use a regular phone for voice-over-IP applications. + + Note: this has nothing to do with modems. You do not need to say Y + here in order to be able to use a modem under Linux. + + This support is also available as a module. If you want to compile + it as a module, say M here and read . The + module will be called phonedev.o. + QuickNet Internet LineJack/PhoneJack support CONFIG_PHONE_IXJ Say M if you have a telephony card manufactured by Quicknet @@ -13592,15 +15162,17 @@ ignore this option. Toshiba Laptop support -CONFIG_TOSHIBA - If you intend to run this the kernel on a Toshiba portable say yes - here. This adds a driver to safely access the System Management - Mode of the CPU on Toshiba portables. The System Management Mode +CONFIG_TOSHIBA + This adds a driver to safely access the System Management Mode + of the CPU on Toshiba portables. The System Management Mode is used to set the BIOS and power saving options on Toshiba portables. For information on utilities to make use of this driver see the - Toshiba Linux utilities website at: - http://www.buzzard.org.uk/toshiba/ + Toshiba Linux utilities web site at: + + + Say Y if you intend to run this kernel on a Toshiba portable. + Say N otherwise. CPiA Video For Linux CONFIG_VIDEO_CPIA @@ -13624,6 +15196,14 @@ of these cameras, say Y here, otherwise say N. It is also available as a module (cpia_pp.o). +CPiA USB Lowlevel Support +CONFIG_VIDEO_CPIA_USB + This is the lowlevel USB support for cameras based on Vision's CPiA + (Colour Processor Interface ASIC), such as the Creative Webcam II. + If you have the USB version of one of these cameras, say Y here, + otherwise say N. This will not work with the Creative Webcam III. + It is also available as a module (cpia_usb.o). + CPiA Parallel Port DMA Support CONFIG_VIDEO_CPIA_PP_DMA This will use DMA if possible to reduce CPU usage. If in doubt, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/Debugging390.txt linux.20p9/Documentation/Debugging390.txt --- linux.vanilla/Documentation/Debugging390.txt Sun Mar 25 17:31:59 2001 +++ linux.20p9/Documentation/Debugging390.txt Wed Aug 8 22:12:54 2001 @@ -1,19 +1,21 @@ - Debugging on Linux for 390 + Debugging on Linux for s/390 & zSeries by Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) - Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation + Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation Best viewed with fixed width fonts Overview of Document: ===================== This document is intended to give an good overview of how to debug -Linux for S390 it isn't intended as a complete reference & not a +Linux for s/390 & zSeries it isn't intended as a complete reference & not a tutorial on the fundamentals of C & assembly, it dosen't go into 390 IO in any detail. It is intended to compliment the following books. +z/Architecture Principles of Operation SA22-7832-00 Enterprise Systems Architecture/390 Reference Summary SA22-7209-01 & the Enterprise Systems Architecture/390 Principles of Operation SA22-7201-05 +Linux for zSeries and S/390 Elf Application Binary Interface & any other worthwhile references you get. It is intended like the Enterprise Systems Architecture/390 Reference Summary @@ -22,21 +24,21 @@ Contents ======== -S390 Register Set +Register Set Address Spaces on Linux -Address Spaces on Linux for S390 -The Linux for S390 Kernel Task Structure -Register Usage & Stackframes on Linux for S390 with glossary -Compiling programs for debugging on Linux for S390 +Address Spaces on Linux for s/390 & zSeries +The Linux for s/390 & zSeries Kernel Task Structure +Register Usage & Stackframes on Linux for s/390 & zSeries with glossary +Compiling programs for debugging on Linux for s/390 & zSeries Figuring out gcc compile errors Debugging Tools objdump strace Debugging under VM Stack Tracing under VM -S390 IO Overview -Debugging IO on S390 under VM -GDB on S390 +s/390 & zSeries IO Overview +Debugging IO on s/390 & zSeries under VM +GDB on s/390 & zSeries Stack chaining in gdb by hand Examining core dumps LDD @@ -44,13 +46,13 @@ The proc file system Starting points for debugging scripting languages etc. -S390 Register Set -================ -The current ESA 390 architecture has the following registers. +Register Set +============ +The current architectures have the following registers. -16 32 bit General propose registers ( r0-r15 or gpr0-gpr15) used for arithmetic & addressing +16 General propose registers, 32 bit on s/390 64 bit on zSeries, r0-r15 or gpr0-gpr15 used for arithmetic & addressing. -16 Control registers ( cr0-cr15 kernel usage only ) used for memory managment, +16 Control registers, 32 bit on s/390 64 bit on zSeries, ( cr0-cr15 kernel usage only ) used for memory managment, interrupt control,debugging control etc. 16 Access registers ( ar0-ar15 ) not used by normal programs but potentially could @@ -67,8 +69,8 @@ The PSW is the most important register on the machine it -is 64 bit & serves the roles of a program counter (pc), -condition code register,memory space designator. +is 64 bit on s/390 & 128 bit on zSeries & serves the roles of +a program counter (pc), condition code register,memory space designator. In IBM standard notation I am counting bit 0 as the MSB. It has several advantages over a normal program counter in that you can change address translation & program counter @@ -77,73 +79,98 @@ have a logical=physical mapping for the address you are currently running at. -Bit Value + Bit Value +s/390 zSeries +0 0 Reserved ( must be 0 ) otherwise specification exception occurs. + +1 1 Program Event Recording 1 PER enabled, + PER is used to facilititate debugging e.g. single stepping. -0 Reserved ( must be 0 ) otherwise specification exception occurs. +2-4 2-4 Reserved ( must be 0 ). -1 Program Event Recording 1 PER enabled, - PER is used to facilititate debugging e.g. single stepping. +5 5 Dynamic address translation 1=DAT on. -2-4 Reserved ( must be 0 ). +6 6 Input/Output interrupt Mask -5 Dynamic address translation 1=DAT on. +7 7 External interrupt Mask used primarily for interprocessor signalling & + clock interupts. -6 Input/Output interrupt Mask +8-11 8-11 PSW Key used for complex memory protection mechanism not used under linux -7 External interrupt Mask used primarily for interprocessor signalling & - clock interupts. +12 12 1 on s/390 0 on zSeries -8-12 PSW Key used for complex memory protection mechanism not used under linux +13 13 Machine Check Mask 1=enable machine check interrupts -13 Machine Check Mask 1=enable machine check interrupts +14 14 Wait State set this to 1 to stop the processor except for interrupts & give + time to other LPARS used in CPU idle in the kernel to increase overall + usage of processor resources. -14 Wait State set this to 1 to stop the processor except for interrupts & give - time to other LPARS used in CPU idle in the kernel to increase overall - usage of processor resources. +15 15 Problem state ( if set to 1 certain instructions are disabled ) + all linux user programs run with this bit 1 + ( useful info for debugging under VM ). -15 Problem state ( if set to 1 certain instructions are disabled ) - all linux user programs run with this bit 1 ( useful info for debugging under VM ). +16-17 16-17 Address Space Control -16-17 Address Space Control + 00 Primary Space Mode when DAT on + The linux kernel currently runs in this mode, CR1 is affiliated with + this mode & points to the primary segment table origin etc. - 00 Primary Space Mode when DAT on - The linux kernel currently runs in this mode, CR1 is affiliated with this mode - & points to the primary segment table origin etc. + 01 Access register mode this mode is used in functions to + copy data between kernel & user space. - 01 Access register mode this mode is used in functions to - copy data between kernel & user space. + 10 Secondary space mode not used in linux however CR7 the + register affiliated with this mode is & this & normally + CR13=CR7 to allow us to copy data between kernel & user space. + We do this as follows: + We set ar2 to 0 to designate its + affiliated gpr ( gpr2 )to point to primary=kernel space. + We set ar4 to 1 to designate its + affiliated gpr ( gpr4 ) to point to secondary=home=user space + & then essentially do a memcopy(gpr2,gpr4,size) to + copy data between the address spaces, the reason we use home space for the + kernel & don't keep secondary space free is that code will not run in + secondary space. - 10 Secondary space mode not used in linux however CR7 the - register affiliated with this mode is & this & normally - CR13=CR7 to allow us to copy data between kernel & user space. - We do this as follows: - We set ar2 to 0 to designate its - affiliated gpr ( gpr2 )to point to primary=kernel space. - We set ar4 to 1 to designate its - affiliated gpr ( gpr4 ) to point to secondary=home=user space - & then essentially do a memcopy(gpr2,gpr4,size) to - copy data between the address spaces, the reason we use home space for the - kernel & don't keep secondary space free is that code will not run in secondary space. + 11 Home Space Mode all user programs run in this mode. + it is affiliated with CR13. - 11 Home Space Mode all user programs run in this mode. - it is affiliated with CR13. +18-19 18-19 Condition codes (CC) -18-19 Condition codes (CC) +20 20 Fixed point overflow mask if 1=FPU exceptions for this event + occur ( normally 0 ) -20 Fixed point overflow mask if 1=FPU exceptions for this event occur ( normally 0 ) +21 21 Decimal overflow mask if 1=FPU exceptions for this event occur + ( normally 0 ) -21 Decimal overflow mask if 1=FPU exceptions for this event occur ( normally 0 ) +22 22 Exponent underflow mask if 1=FPU exceptions for this event occur + ( normally 0 ) -22 Exponent underflow mask if 1=FPU exceptions for this event occur ( normally 0 ) +23 23 Significance Mask if 1=FPU exceptions for this event occur + ( normally 0 ) -23 Significance Mask if 1=FPU exceptions for this event occur ( normally 0 ) +24-31 24-30 Reserved Must be 0. -24-31 Reserved Must be 0. + 31 Extended Addressing Mode + 32 Basic Addressing Mode + Used to set addressing mode + PSW 31 PSW 32 + 0 0 24 bit + 0 1 31 bit + 1 1 64 bit -32 1=31 bit addressing mode 0=24 bit addressing mode (for backward compatibility ), - linux always runs with this bit set to 1 +32 1=31 bit addressing mode 0=24 bit addressing mode (for backward + compatibility ), linux always runs with this bit set to 1 -33-64 Instruction address. +33-64 Instruction address. + 33-63 Reserved must be 0 + 64-127 Address + In 24 bits mode bits 64-103=0 bits 104-127 Address + In 31 bits mode bits 64-96=0 bits 97-127 Address + Note: unlike 31 bit mode on s/390 bit 96 must be zero + when loading the address with LPSWE otherwise a + specification exception occurs, LPSW is fully backward + compatible. + Prefix Page ----------- @@ -221,8 +248,8 @@ Our addressing scheme is as follows -Himem 0x7fffffff 2GB ***************** **************** - * User Stack * * * +Himem 0x7fffffff 2GB on s/390 ***************** **************** +2^64 bytes on zSeries * User Stack * * * ***************** * * * Shared Libs * * * ***************** * * @@ -248,6 +275,7 @@ The kernel stack pointer is intimately tied with the task stucture for each processor as follows. + s/390 ************************ * 1 page kernel stack * * ( 4K ) * @@ -256,9 +284,18 @@ * ( 4K ) * 8K aligned ************************ + zSeries + ************************ + * 2 page kernel stack * + * ( 8K ) * + ************************ + * 2 page task_struct * + * ( 8K ) * +16K aligned ************************ + What this means is that we don't need to dedicate any register or global variable to point to the current running process & can retrieve it with the following -very simple construct +very simple construct for s/390 & one very similar for zSeries. static inline struct task_struct * get_current(void) { @@ -290,6 +327,10 @@ Note: To follow stackframes requires a knowledge of C or Pascal & limited knowledge of one assembly language. +It should be noted that there are some differences between the +s/390 & zSeries stack layouts as the zSeries stack layout didn't have +to maintain compatibility with older linkage formats. + Glossary: --------- alloca: @@ -404,8 +445,8 @@ f0 argument 0 / return value ( float/double ) call-clobbered f2 argument 1 call-clobbered -f4 saved -f6 saved +f4 zSeries argument 2 saved +f6 zSeries argument 3 saved The remaining floating points f1,f3,f5 f7-f15 are call-clobbered. @@ -434,33 +475,36 @@ area if crossing this boundary. 6) Floating point parameters are mixed with outgoing args on the outgoing args area in the order the are passed in as parameters. +7) Floating point arguments 2 & 3 are saved in the outgoing args area for zSeries + Stack Frame Layout ================== -0 back chain ( a 0 here signifies end of back chain ) -4 eos ( end of stack, not used on Linux for S390 used in other linkage formats ) -8 glue used in other linkage formats for saved routine descriptors etc. -12 glue used in other linkage formats for saved routine descriptors etc. -16 scratch area -20 scratch area -24 saved r6 of caller function -28 saved r7 of caller function -32 saved r8 of caller function -36 saved r9 of caller function -40 saved r10 of caller function -44 saved r11 of caller function -48 saved r12 of caller function -52 saved r13 of caller function -56 saved r14 of caller function -60 saved r15 of caller function -64 saved f4 of caller function -72 saved f6 of caller function -80 undefined -96 outgoing args passed from caller to callee -96+x possible stack alignment ( 8 bytes desirable ) -96+x+y alloca space of caller ( if used ) -96+x+y+z automatics of caller ( if used ) -0 back-chain +s/390 zSeries +0 0 back chain ( a 0 here signifies end of back chain ) +4 8 eos ( end of stack, not used on Linux for S390 used in other linkage formats ) +8 16 glue used in other s/390 linkage formats for saved routine descriptors etc. +12 24 glue used in other s/390 linkage formats for saved routine descriptors etc. +16 32 scratch area +20 40 scratch area +24 48 saved r6 of caller function +28 56 saved r7 of caller function +32 64 saved r8 of caller function +36 72 saved r9 of caller function +40 80 saved r10 of caller function +44 88 saved r11 of caller function +48 96 saved r12 of caller function +52 104 saved r13 of caller function +56 112 saved r14 of caller function +60 120 saved r15 of caller function +64 128 saved f4 of caller function +72 132 saved f6 of caller function +80 undefined +96 160 outgoing args passed from caller to callee +96+x 160+x possible stack alignment ( 8 bytes desirable ) +96+x+y 160+x+y alloca space of caller ( if used ) +96+x+y+z 160+x+y+z automatics of caller ( if used ) +0 back-chain A sample program with comments. =============================== @@ -551,14 +595,10 @@ -Compiling programs for debugging on Linux for S390 -================================================== -Make sure that the gcc is compiling & linking with the -g flag on -this generates plain old gnu stabs, don't use --ggdb, -gxcoff+ or any other silly option these other options more than -likely don't work ( we haven't tested them ), -gstabs is supposed to add -extra extensions to the debugging info for debugging c++ we haven't got -round to testing this yet. +Compiling programs for debugging on Linux for s/390 & zSeries +============================================================= +-gdwarf2 now works & normal -g debugging works much better now +Thanks to the IBM java compiler developers bug reports. This is typically done adding/appending the flags -g to the CFLAGS & LDFLAGS variables Makefile of the program concerned. @@ -574,6 +614,10 @@ parameters will work, however some larger programs which use inline functions will not compile without optimisation. +Debugging with optimisation has since much improved after fixing +some bugs, please make sure you are using gdb-5.0 or later developed +after Nov'2000. + Figuring out gcc compile errors =============================== If you are getting a lot of syntax errors compiling a program & the problem @@ -931,8 +975,8 @@ as the 390 instructions are easy to decode mentally & you can make a good guess at a lot of them as all the operands are nibble ( half byte aligned ) & if you have an objdump listing also it is quite easy to follow, if you don't have an objdump listing keep a copy of -the ESA Reference Summary & look at between pages 2 & 7 or alternatively the -ESA principles of operation. +the s/390 Reference Summary & look at between pages 2 & 7 or alternatively the +s/390 principles of operation. e.g. even I can guess that 0001AFF8' LR 180F CC 0 is a ( load register ) lr r0,r15 @@ -1085,7 +1129,7 @@ 10=segment translation exception 11=page translation exception -The full list of these is on page 22 of the current ESA Reference Summary. +The full list of these is on page 22 of the current s/390 Reference Summary. e.g. tr prog 10 will trace segment translation exceptions. tr prog on its own will trace all program interruption codes. @@ -1161,7 +1205,7 @@ 000151B0' SVC 0A05 -> 0001909A' CC 0 D 20.8 to check the SVC old psw in the prefix area & see was it from userspace -( for the layout of the prefix area consult P18 of the ESA 390 Reference Summary +( for the layout of the prefix area consult P18 of the s/390 390 Reference Summary if you have it available ). V00000020 070C2000 800151B2 The problem state bit wasn't set & it's also too early in the boot sequence @@ -1334,7 +1378,7 @@ I am not going to give a course in 390 IO architecture as this would take me quite a while & I'm no expert. Instead I'll give a 390 IO architecture summary for Dummies if you have -the ESA principles of operation available read this instead. If nothing else you may find a few +the s/390 principles of operation available read this instead. If nothing else you may find a few useful keywords in here & be able to use them on a web search engine like altavista to find more useful information. @@ -2031,4 +2075,6 @@ Linux & GDB source. Various info & man pages. CMS Help on tracing commands. +Linux for zSeries and S/390 Elf Application Binary Interface ( Highly Recommended ) +z/Architecture Principles of Operation diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/SubmittingDrivers linux.20p9/Documentation/SubmittingDrivers --- linux.vanilla/Documentation/SubmittingDrivers Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/SubmittingDrivers Wed Jul 4 16:03:53 2001 @@ -34,7 +34,7 @@ This kernel tree is under active development. The same rules apply as 2.2 but you may wish to submit your driver via linux-kernel (see resources) and follow that list to track changes in API's. These - should no longer be occuring as we are now in a code freeze. + should no longer be occurring as we are now in a code freeze. The final contact point for Linux 2.4 submissions is . diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/cciss.txt linux.20p9/Documentation/cciss.txt --- linux.vanilla/Documentation/cciss.txt Sun Mar 25 17:31:58 2001 +++ linux.20p9/Documentation/cciss.txt Wed Jul 4 16:03:53 2001 @@ -6,6 +6,8 @@ This driver is known to work with the following cards: * SA 5300 + * SA 5i + * SA 532 If notes are not already created in the /dev/cciss directory diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/filesystems/vfs.txt linux.20p9/Documentation/filesystems/vfs.txt --- linux.vanilla/Documentation/filesystems/vfs.txt Sun Mar 25 17:31:56 2001 +++ linux.20p9/Documentation/filesystems/vfs.txt Wed Jul 4 16:03:53 2001 @@ -129,7 +129,7 @@ name: the name of the filesystem type, such as "ext2", "iso9660", "msdos" and so on - fs_flags: various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.) + fs_flags: various flags (e.g. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.) read_super: the method to call when a new instance of this filesystem should be mounted @@ -403,7 +403,7 @@ d_release: called when a dentry is deallocated - d_iput: called when a dentry looses its inode (just prior to its + d_iput: called when a dentry loses its inode (just prior to its being deallocated). The default when this is NULL is that the VFS calls iput(). If you define this method, you must call iput() yourself @@ -425,11 +425,11 @@ unused list just means that if the system needs some RAM, it goes through the unused list of dentries and deallocates them. If the dentry has already been unhashed and the usage count - drops to 0, in this case the dentry is deallocated after the - "d_delete" method is called + drops to 0, the dentry is deallocated after the "d_delete" + method is called d_drop: this unhashes a dentry from its parents hash list. A - subsequent call to dput() will dellocate the dentry if its + subsequent call to dput() will deallocate the dentry if its usage count drops to 0 d_delete: delete a dentry. If there are no other open references to diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/i810_rng.txt linux.20p9/Documentation/i810_rng.txt --- linux.vanilla/Documentation/i810_rng.txt Thu Jan 1 01:00:00 1970 +++ linux.20p9/Documentation/i810_rng.txt Wed Jul 4 16:03:53 2001 @@ -0,0 +1,126 @@ + Hardware driver for Intel i810 Random Number Generator (RNG) + Copyright 2000,2001 Jeff Garzik + Copyright 2000,2001 Philipp Rumpf + +Introduction: + + The i810_rng device driver is software that makes use of a + special hardware feature on the Intel i8xx-based chipsets, + a Random Number Generator (RNG). + + In order to make effective use of this device driver, you + should download the support software as well. Download the + latest version of the "intel-rng-tools" package from the + i810_rng driver's official Web site: + + http://sourceforge.net/projects/gkernel/ + +About the Intel RNG hardware, from the firmware hub datasheet: + + The Firmware Hub integrates a Random Number Generator (RNG) + using thermal noise generated from inherently random quantum + mechanical properties of silicon. When not generating new random + bits the RNG circuitry will enter a low power state. Intel will + provide a binary software driver to give third party software + access to our RNG for use as a security feature. At this time, + the RNG is only to be used with a system in an OS-present state. + +Theory of operation: + + Character driver. Using the standard open() + and read() system calls, you can read random data from + the i810 RNG device. This data is NOT CHECKED by any + fitness tests, and could potentially be bogus (if the + hardware is faulty or has been tampered with). Data is only + output if the hardware "has-data" flag is set, but nevertheless + a security-conscious person would run fitness tests on the + data before assuming it is truly random. + + /dev/intel_rng is char device major 10, minor 183. + +Driver notes: + + * FIXME: support poll(2) + + NOTE: request_mem_region was removed, for two reasons: + 1) Only one RNG is supported by this driver, 2) The location + used by the RNG is a fixed location in MMIO-addressable memory, + 3) users with properly working BIOS e820 handling will always + have the region in which the RNG is located reserved, so + request_mem_region calls always fail for proper setups. + However, for people who use mem=XX, BIOS e820 information is + -not- in /proc/iomem, and request_mem_region(RNG_ADDR) can + succeed. + +Driver details: + + Based on: + Intel 82802AB/82802AC Firmware Hub (FWH) Datasheet + May 1999 Order Number: 290658-002 R + + Intel 82802 Firmware Hub: Random Number Generator + Programmer's Reference Manual + December 1999 Order Number: 298029-001 R + + Intel 82802 Firmware HUB Random Number Generator Driver + Copyright (c) 2000 Matt Sottek + + Special thanks to Matt Sottek. I did the "guts", he + did the "brains" and all the testing. + +Change history: + + Version 0.9.6: + * Internal driver cleanups, prep for 1.0.0 release. + + Version 0.9.5: + * Rip out entropy injection via timer. It never ever worked, + and a better solution (rngd) is now available. + + Version 0.9.4: + * Fix: Remove request_mem_region + * Fix: Horrible bugs in FIPS calculation and test execution + + Version 0.9.3: + * Clean up rng_read a bit. + * Update i810_rng driver Web site URL. + * Increase default timer interval to 4 samples per second. + * Abort if mem region is not available. + * BSS zero-initialization cleanup. + * Call misc_register() from rng_init_one. + * Fix O_NONBLOCK to occur before we schedule. + + Version 0.9.2: + * Simplify open blocking logic + + Version 0.9.1: + * Support i815 chipsets too (Matt Sottek) + * Fix reference counting when statically compiled (prumpf) + * Rewrite rng_dev_read (prumpf) + * Make module races less likely (prumpf) + * Small miscellaneous bug fixes (prumpf) + * Use pci table for PCI id list + + Version 0.9.0: + * Don't register a pci_driver, because we are really + using PCI bridge vendor/device ids, and someone + may want to register a driver for the bridge. (bug fix) + * Don't let the usage count go negative (bug fix) + * Clean up spinlocks (bug fix) + * Enable PCI device, if necessary (bug fix) + * iounmap on module unload (bug fix) + * If RNG chrdev is already in use when open(2) is called, + sleep until it is available. + * Remove redundant globals rng_allocated, rng_use_count + * Convert numeric globals to unsigned + * Module unload cleanup + + Version 0.6.2: + * Clean up spinlocks. Since we don't have any interrupts + to worry about, but we do have a timer to worry about, + we use spin_lock_bh everywhere except the timer function + itself. + * Fix module load/unload. + * Fix timer function and h/w enable/disable logic + * New timer interval sysctl + * Clean up sysctl names diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/ioctl-number.txt linux.20p9/Documentation/ioctl-number.txt --- linux.vanilla/Documentation/ioctl-number.txt Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/ioctl-number.txt Wed Jul 4 16:03:53 2001 @@ -102,7 +102,7 @@ 'p' 00-3F linux/mc146818rtc.h 'p' 40-7F linux/nvram.h 'p' 80-9F user-space parport in development: - + 'r' all linux/msdos_fs.h 's' all linux/cdk.h 't' 00-7F linux/if_ppp.h diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/isdn/INTERFACE linux.20p9/Documentation/isdn/INTERFACE --- linux.vanilla/Documentation/isdn/INTERFACE Sun Mar 25 17:31:58 2001 +++ linux.20p9/Documentation/isdn/INTERFACE Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -$Id: INTERFACE,v 1.15 1999/08/25 20:02:13 werner Exp $ +$Id: INTERFACE,v 1.15.8.2 2001/03/13 16:17:07 kai Exp $ Description of the Interface between Linklevel and Hardwarelevel of isdn4linux: @@ -480,8 +480,8 @@ Parameter: driver = driver-Id command = ISDN_CMD_PROT_IO - arg = The lower 8 Bits define the adressed protocol as defined - in ISDN_PTYPE..., the upper bits are used to differenciate + arg = The lower 8 Bits define the addressed protocol as defined + in ISDN_PTYPE..., the upper bits are used to differentiate the protocol specific CMD. para = protocol and function specific. See isdnif.h for detail. @@ -734,7 +734,7 @@ Parameter: driver = driver-Id command = ISDN_STAT_PROT - arg = The lower 8 Bits define the adressed protocol as defined + arg = The lower 8 Bits define the addressed protocol as defined in ISDN_PTYPE..., the upper bits are used to differenciate the protocol specific STAT. @@ -748,7 +748,7 @@ loading the driver. The LL has to ignore a disabled channel when searching for free channels. The HL driver itself never delivers STAT callbacks for disabled channels. - The LL returns a nonzero code if the operation was not successfull or the + The LL returns a nonzero code if the operation was not successful or the selected channel is actually regarded as busy. Parameter: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/isdn/README.eicon linux.20p9/Documentation/isdn/README.eicon --- linux.vanilla/Documentation/isdn/README.eicon Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/isdn/README.eicon Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -$Id: README.eicon,v 1.10 2000/08/13 12:19:15 armin Exp $ +$Id: README.eicon,v 1.10.6.1 2001/02/19 10:04:59 armin Exp $ (c) 1999,2000 Armin Schindler (mac@melware.de) (c) 1999,2000 Cytronics & Melware (info@melware.de) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/networking/ip-sysctl.txt linux.20p9/Documentation/networking/ip-sysctl.txt --- linux.vanilla/Documentation/networking/ip-sysctl.txt Sun Mar 25 17:31:57 2001 +++ linux.20p9/Documentation/networking/ip-sysctl.txt Wed Aug 8 22:11:18 2001 @@ -39,6 +39,11 @@ IP Fragmentation: +ip_always_defrag - BOOLEAN + 0 - (DEFAULT) Normal setting for a normal router or host. + 1 - Reassemble all fragments before processing. Useful for + a firewall or transparent proxying hosts. + ipfrag_high_thresh - INTEGER Maximum memory used to reassemble IP fragments. When ipfrag_high_thresh bytes of memory is allocated for this purpose, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/networking/sk98lin.txt linux.20p9/Documentation/networking/sk98lin.txt --- linux.vanilla/Documentation/networking/sk98lin.txt Sun Mar 25 17:31:57 2001 +++ linux.20p9/Documentation/networking/sk98lin.txt Wed Jul 4 16:03:53 2001 @@ -1,16 +1,17 @@ -(C)Copyright 1999 SysKonnect. +(C)Copyright 1999-2001 SysKonnect GmbH. +All rights reserved =========================================================================== -sk98lin.txt created 11-Nov-1999 +sk98lin.txt created 07-Jun-2001 -Readme File for sk98lin.o v3.04 -SK-NET Gigabit Ethernet Adapter SK-98xx Driver for Linux +Readme File for sk98lin v4.07 +SK-NET Gigabit Ethernet PCI driver for LINUX This file contains (1) OVERVIEW (2) REQUIRED FILES (3) INSTALLATION -(4) INCLUSION OF THE ADAPTER AT SYSTEM START +(4) INCLUSION OF ADAPTER AT SYSTEM START (5) DRIVER PARAMETERS (6) LARGE FRAME SUPPORT (7) TROUBLESHOOTING @@ -19,13 +20,12 @@ =========================================================================== - (1) OVERVIEW ============ The sk98lin driver supports the SysKonnect SK-NET Gigabit Ethernet Adapter SK-98xx family on Linux 2.2.x and above. -It has been tested with Linux on Intel/x86, ALPHA and UltraSPARC machines. +It has been tested with Linux on Intel/x86 machines. From v3.02 on, the driver is integrated in the linux kernel source. *** @@ -64,8 +64,8 @@ "make modules_install". Reboot your system. -4) Load the module manually by entering: - insmod sk98lin.o +2) Load the module manually by entering: + modprobe sk98lin If the SysKonnect SK-98xx adapter is installed in your computer and you have a /proc filesystem, running the command 'more /proc/net/dev' should produce an output containing a @@ -84,7 +84,7 @@ for each adapter that is found, containing the corresponding 'ethX'. -5) Select an IP address and assign it to the respective adapter by +3) Select an IP address and assign it to the respective adapter by entering: ifconfig eth0 This causes the adapter to connect to the ethernet. The solitary @@ -99,22 +99,22 @@ NOTE: If you are in doubt about IP addresses, ask your network administrator for assistance. -6) Your adapter should now be fully operational. +4) Your adapter should now be fully operational. Use 'ping ' to verify the connection to other computers on your network. - By entering 'ifconfig', you can check the number of packets sent - and received by your adapter and additional some other information - regarding the adapter configuration. + By viewing /proc/net/sk98lin/[devicename], you can check some + information regarding to the adapter configuration. + -7) The driver module can be stopped and unloaded using the following +5) The driver module can be stopped and unloaded using the following commands: ifconfig eth0 down rmmod sk98lin *** -(4) INCLUSION OF THE ADAPTER AT SYSTEM START -============================================ +(4) INCLUSION OF ADAPTER AT SYSTEM START +======================================== Since a large number of different Linux distributions are available, we are unable to describe a general installation procedure @@ -129,7 +129,7 @@ ===================== Parameters can be set at the command line while loading the -module with 'insmod'. The configuration tools of some distributions +module with 'modprobe'. The configuration tools of some distributions can also give parameters to the driver module. If you use the kernel module loader, you can set driver parameters in the file /etc/modules.conf (or old name: /etc/conf.modules). @@ -138,12 +138,12 @@ options sk98lin ... For "...", use the same syntax as described below for the command -line parameters of insmod. +line paramaters of modprobe. You either have to reboot your computer or unload and reload the driver to activate the new parameters. The syntax of the driver parameters is: -insmod sk98lin parameter=value1[,value2[,value3...]] +modprobe sk98lin parameter=value1[,value2[,value3...]] value1 is for the first adapter, value2 for the second one etc. All Parameters are case sensitive, so write them exactly as @@ -156,7 +156,7 @@ adapter to FULL and on Port A of the second adapter to HALF. You must enter: - insmod sk98lin.o AutoNeg_A=On,Off DupCap_A=Full,Half + modprobe sk98lin AutoNeg_A=On,Off DupCap_A=Full,Half NOTE: The number of adapters that can be configured this way is limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM). @@ -187,7 +187,7 @@ this port is not "Sense". If autonegotiation is "On", all three values are possible. If it is "Off", only "Full" and "Half" are allowed. - It is useful if your link partner does not support all + It is usefull if your link partner does not support all possible combinations. - Flow Control @@ -234,7 +234,7 @@ - RLMT (Redundant Link Management Technology) Mode Parameter: RlmtMode - Values: CheckLinkState,CheckLocalPort, CheckSeg + Values: CheckLinkState,CheckLocalPort, CheckSeg, DualNet Default: CheckLinkState RLMT (the driver part that decides which port to use) knows three @@ -257,6 +257,13 @@ Ethernet switches installed in your network that have been configured to use the Spanning Tree protocol. +-- DualNet - Both ports A and B are used as separate devices at the same + time. So if you have a dual port adapter, port A will show up as eth0 + and port B as eth1. Both ports can be used independend with distinct + IP addresses. + The preferred port setting is not used. Rlmt is turned off. + + NOTE: The modes CheckLocalPort and CheckSeg are meant to operate in configurations where a network path between the ports on one adapter exists. Especially, they are not designed to work where @@ -269,7 +276,7 @@ Large frames (also called jumbo frames) are now supported by the driver. This can result in a greatly improved throughput if -transferring large amounts of data. +transfering large amounts of data. To enable large frames, set the MTU (maximum transfer unit) of the interface to the value you wish (up to 9000). The command for this is: @@ -285,7 +292,7 @@ You can switch back to the standard ethernet frame size with: ifconfig eth0 mtu 1500 -To make this setting persistent, add a script with the 'ifconfig' +To make this setting persitent, add a script with the 'ifconfig' line to the system startup sequence (named something like "S99sk98lin" in /etc/rc.d/rc2.d). *** @@ -373,6 +380,28 @@ (8) HISTORY =========== +VERSION 4.02 (In-Kernel version) +New Features: +- Add Kernel 2.4 changes +Known limitations: +- None + +VERSION 4.01 (In-Kernel version) +Problems fixed: +- Full statistics support for DualNet mode +Known limitations: +- None + +VERSION 4.00 (In-Kernel version) +Problems fixed: +- Memory leak found +New Features: +- Proc filesystem integration +- DualNet functionality integrated +- Rlmt networks added +Known limitations: +- statistics partially incorrect in DualNet mode + VERSION 3.04 (In-Kernel version) Problems fixed: - Driver start failed on UltraSPARC diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/parport.txt linux.20p9/Documentation/parport.txt --- linux.vanilla/Documentation/parport.txt Sun Mar 25 17:31:58 2001 +++ linux.20p9/Documentation/parport.txt Wed Jul 4 16:03:53 2001 @@ -147,4 +147,4 @@ -- Philip.Blundell@pobox.com -tim@cyberelk.demon.co.uk +tim@cyberelk.net diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/proc.txt linux.20p9/Documentation/proc.txt --- linux.vanilla/Documentation/proc.txt Sun Mar 25 17:31:59 2001 +++ linux.20p9/Documentation/proc.txt Wed Aug 8 22:11:52 2001 @@ -35,7 +35,7 @@ 3.6 /proc/sys/dev - Device specific parameters 3.7 /proc/sys/sunrpc - Remote procedure calls 3.8 /proc/sys/net - Networking stuff -3.9 /proc/sys/net/ipv4 - IPV4 settings=20 +3.9 /proc/sys/net/ipv4 - IPV4 settings 3.10 Appletalk 3.11 IPX @@ -861,7 +861,7 @@ sc_age_cluster_fract -------------------- * resident set size - 1024 =20 + 1024 So if you want kswapd to scan the whole process, sc_age_cluster_fract needs to have a value of 1024. The minimum @@ -1050,7 +1050,7 @@ This is automagically enabled when enabling masquerading. -ipfrag_high_trash and ipfrag_low_trash +ipfrag_high_tresh and ipfrag_low_tresh Maximum memory used to reassemble IP fragments. When ipfrag_high_thresh bytes of memory is allocated for this purpose, the fragment handler will toss packets until ipfrag_low_thresh is diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/s390/Debugging390.txt linux.20p9/Documentation/s390/Debugging390.txt --- linux.vanilla/Documentation/s390/Debugging390.txt Thu Jan 1 01:00:00 1970 +++ linux.20p9/Documentation/s390/Debugging390.txt Wed Aug 8 22:12:54 2001 @@ -0,0 +1,2499 @@ + + Debugging on Linux for s/390 & z/Architecture + by + Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) + Copyright (C) 2000-2001 IBM Deutschland Entwicklung GmbH, IBM Corporation + Best viewed with fixed width fonts + +Overview of Document: +===================== +This document is intended to give an good overview of how to debug +Linux for s/390 & z/Architecture it isn't intended as a complete reference & not a +tutorial on the fundamentals of C & assembly, it dosen't go into +390 IO in any detail. It is intended to compliment the documents in the +reference section below & any other worthwhile references you get. + +It is intended like the Enterprise Systems Architecture/390 Reference Summary +to be printed out & used as a quick cheat sheet self help style reference when +problems occur. + +Contents +======== +Register Set +Address Spaces on Intel Linux +Address Spaces on Linux for s/390 & z/Architecture +The Linux for s/390 & z/Architecture Kernel Task Structure +Register Usage & Stackframes on Linux for s/390 & z/Architecture +A sample program with comments +Compiling programs for debugging on Linux for s/390 & z/Architecture +Figuring out gcc compile errors +Debugging Tools +objdump +strace +Performance Debugging +Debugging under VM +s/390 & z/Architecture IO Overview +Debugging IO on s/390 & z/Architecture under VM +GDB on s/390 & z/Architecture +Stack chaining in gdb by hand +Examining core dumps +ldd +Debugging modules +The proc file system +Starting points for debugging scripting languages etc. +SysRq +References +Special Thanks + +Register Set +============ +The current architectures have the following registers. + +16 General propose registers, 32 bit on s/390 64 bit on z/Architecture, r0-r15 or gpr0-gpr15 used for arithmetic & addressing. + +16 Control registers, 32 bit on s/390 64 bit on z/Architecture, ( cr0-cr15 kernel usage only ) used for memory managment, +interrupt control,debugging control etc. + +16 Access registers ( ar0-ar15 ) 32 bit on s/390 & z/Architecture +not used by normal programs but potentially could +be used as temporary storage. Their main purpose is their 1 to 1 +association with general purpose registers and are used in +the kernel for copying data between kernel & user address spaces. +Access register 0 ( & access register 1 on z/Architecture ( needs 64 bit +pointer ) ) is currently used by the pthread library as a pointer to +the current running threads private area. + +16 64 bit floating point registers (fp0-fp15 ) IEEE & HFP floating +point format compliant on G5 upwards & a Floating point control reg (FPC) +4 64 bit registers (fp0,fp2,fp4 & fp6) HFP only on older machines. +Note: +Linux (currently) always uses IEEE & emulates G5 IEEE format on older machines, +( provided the kernel is configured for this ). + + +The PSW is the most important register on the machine it +is 64 bit on s/390 & 128 bit on z/Architecture & serves the roles of +a program counter (pc), condition code register,memory space designator. +In IBM standard notation I am counting bit 0 as the MSB. +It has several advantages over a normal program counter +in that you can change address translation & program counter +in a single instruction. To change address translation, +e.g. switching address translation off requires that you +have a logical=physical mapping for the address you are +currently running at. + + Bit Value +s/390 z/Architecture +0 0 Reserved ( must be 0 ) otherwise specification exception occurs. + +1 1 Program Event Recording 1 PER enabled, + PER is used to facilititate debugging e.g. single stepping. + +2-4 2-4 Reserved ( must be 0 ). + +5 5 Dynamic address translation 1=DAT on. + +6 6 Input/Output interrupt Mask + +7 7 External interrupt Mask used primarily for interprocessor signalling & + clock interupts. + +8-11 8-11 PSW Key used for complex memory protection mechanism not used under linux + +12 12 1 on s/390 0 on z/Architecture + +13 13 Machine Check Mask 1=enable machine check interrupts + +14 14 Wait State set this to 1 to stop the processor except for interrupts & give + time to other LPARS used in CPU idle in the kernel to increase overall + usage of processor resources. + +15 15 Problem state ( if set to 1 certain instructions are disabled ) + all linux user programs run with this bit 1 + ( useful info for debugging under VM ). + +16-17 16-17 Address Space Control + + 00 Primary Space Mode when DAT on + The linux kernel currently runs in this mode, CR1 is affiliated with + this mode & points to the primary segment table origin etc. + + 01 Access register mode this mode is used in functions to + copy data between kernel & user space. + + 10 Secondary space mode not used in linux however CR7 the + register affiliated with this mode is & this & normally + CR13=CR7 to allow us to copy data between kernel & user space. + We do this as follows: + We set ar2 to 0 to designate its + affiliated gpr ( gpr2 )to point to primary=kernel space. + We set ar4 to 1 to designate its + affiliated gpr ( gpr4 ) to point to secondary=home=user space + & then essentially do a memcopy(gpr2,gpr4,size) to + copy data between the address spaces, the reason we use home space for the + kernel & don't keep secondary space free is that code will not run in + secondary space. + + 11 Home Space Mode all user programs run in this mode. + it is affiliated with CR13. + +18-19 18-19 Condition codes (CC) + +20 20 Fixed point overflow mask if 1=FPU exceptions for this event + occur ( normally 0 ) + +21 21 Decimal overflow mask if 1=FPU exceptions for this event occur + ( normally 0 ) + +22 22 Exponent underflow mask if 1=FPU exceptions for this event occur + ( normally 0 ) + +23 23 Significance Mask if 1=FPU exceptions for this event occur + ( normally 0 ) + +24-31 24-30 Reserved Must be 0. + + 31 Extended Addressing Mode + 32 Basic Addressing Mode + Used to set addressing mode + PSW 31 PSW 32 + 0 0 24 bit + 0 1 31 bit + 1 1 64 bit + +32 1=31 bit addressing mode 0=24 bit addressing mode (for backward + compatibility ), linux always runs with this bit set to 1 + +33-64 Instruction address. + 33-63 Reserved must be 0 + 64-127 Address + In 24 bits mode bits 64-103=0 bits 104-127 Address + In 31 bits mode bits 64-96=0 bits 97-127 Address + Note: unlike 31 bit mode on s/390 bit 96 must be zero + when loading the address with LPSWE otherwise a + specification exception occurs, LPSW is fully backward + compatible. + + +Prefix Page(s) +-------------- +This per cpu memory area is too intimately tied to the processor not to mention. +It exists between the real addresses 0-4096 on s/390 & 0-8192 z/Architecture & is exchanged +with a 1 page on s/390 or 2 pages on z/Architecture in absolute storage by the set +prefix instruction in linux'es startup. +This page is mapped to a different prefix for each processor in an SMP configuration +( assuming the os designer is sane of course :-) ). +Bytes 0-512 ( 200 hex ) on s/390 & 0-512,4096-4544,4604-5119 currently on z/Architecture +are used by the processor itself for holding such information as exception indications & +entry points for exceptions. +Bytes after 0xc00 hex are used by linux for per processor globals on s/390 & z/Architecture +( there is a gap on z/Architecure too currently between 0xc00 & 1000 which linux uses ). +The closest thing to this on traditional architectures is the interrupt +vector table. This is a good thing & does simplify some of the kernel coding +however it means that we now cannot catch stray NULL pointers in the +kernel without hard coded checks. + + + +Address Spaces on Intel Linux +============================= + +The traditional Intel Linux is approximately mapped as follows forgive +the ascii art. +0xFFFFFFFF 4GB Himem ***************** + * * + * Kernel Space * + * * + ***************** **************** +User Space Himem (typically 0xC0000000 3GB )* User Stack * * * + ***************** * * + * Shared Libs * * Next Process * + ***************** * to * + * * <== * Run * <== + * User Program * * * + * Data BSS * * * + * Text * * * + * Sections * * * +0x00000000 ***************** **************** + +Now it is easy to see that on Intel it is quite easy to recognise a kernel address +as being one greater than user space himem ( in this case 0xC0000000). +& addresses of less than this are the ones in the current running program on this +processor ( if an smp box ). +If using the virtual machine ( VM ) as a debugger it is quite difficult to +know which user process is running as the address space you are looking at +could be from any process in the run queue. + +The limitation of Intels addressing technique is that the linux +kernel uses a very simple real address to virtual addressing technique +of Real Address=Virtual Address-User Space Himem. +This means that on Intel the kernel linux can typically only address +Himem=0xFFFFFFFF-0xC0000000=1GB & this is all the RAM these machines +can typically use. +They can lower User Himem to 2GB or lower & thus be +able to use 2GB of RAM however this shrinks the maximum size +of User Space from 3GB to 2GB they have a no win limit of 4GB unless +they go to 64 Bit. + + +On 390 our limitations & strengths make us slightly different. +For backward compatibility we are only allowed use 31 bits (2GB) +of our 32 bit addresses,however, we use entirely separate address +spaces for the user & kernel. + +This means we can support 2GB of non Extended RAM on s/390, & more +with the Extended memory managment swap device & +currently 4TB of physical memory currently on z/Architecture. + + +Address Spaces on Linux for s/390 & z/Architecture +================================================== + +Our addressing scheme is as follows + + +Himem 0x7fffffff 2GB on s/390 ***************** **************** +currently 0x3ffffffffff (2^42)-1 * User Stack * * * +on z/Architecture. ***************** * * + * Shared Libs * * * + ***************** * * + * * * Kernel * + * User Program * * * + * Data BSS * * * + * Text * * * + * Sections * * * +0x00000000 ***************** **************** + +This also means that we need to look at the PSW problem state bit +or the addressing mode to decide whether we are looking at +user or kernel space. + +Virtual Addresses on s/390 & z/Architecture +=========================================== + +A virtual address on s/390 is made up of 3 parts +The SX ( segment index, roughly corresponding to the PGD & PMD in linux terminology ) +being bits 1-11. +The PX ( page index, corresponding to the page table entry (pte) in linux terminology ) +being bits 12-19. +The remaining bits BX (the byte index are the offset in the page ) +i.e. bits 20 to 31. + +On z/Architecture in linux we currently make up an address from 4 parts. +The region index bits (RX) 0-32 we currently use bits 22-32 +The segment index (SX) being bits 33-43 +The page index (PX) being bits 44-51 +The byte index (BX) being bits 52-63 + +Notes: +1) s/390 has no PMD so the PMD is really the PGD also. +A lot of this stuff is defined in pgtable.h. + +2) Also seeing as s/390's page indexes are only 1k in size +(bits 12-19 x 4 bytes per pte ) we use 1 ( page 4k ) +to make the best use of memory by updating 4 segment indices +entries each time we mess with a PMD & use offsets +0,1024,2048 & 3072 in this page as for our segment indexes. +On z/Architecture our page indexes are now 2k in size +( bits 12-19 x 8 bytes per pte ) we do a similar trick +but only mess with 2 segment indices each time we mess with +a PMD. + +3) As z/Architecture supports upto a massive 5-level page table lookup we +can only use 3 currently on Linux ( as this is all the generic kernel +currently supports ) however this may change in future +this allows us to access ( according to my sums ) +4TB of virtual storage per process i.e. +4096*512(PTES)*1024(PMDS)*2048(PGD) = 4398046511104 bytes, +enough for another 2 or 3 of years I think :-). +to do this we use a region-third-table designation type in +our address space control registers. + + +The Linux for s/390 & z/Architecture Kernel Task Structure +========================================================== +Each process/thread under Linux for S390 has its own kernel task_struct +defined in linux/include/linux/sched.h +The S390 on initialisation & resuming of a process on a cpu sets +the __LC_KERNEL_STACK variable in the spare prefix area for this cpu +( which we use for per processor globals). + +The kernel stack pointer is intimately tied with the task stucture for +each processor as follows. + + s/390 + ************************ + * 1 page kernel stack * + * ( 4K ) * + ************************ + * 1 page task_struct * + * ( 4K ) * +8K aligned ************************ + + z/Architecture + ************************ + * 2 page kernel stack * + * ( 8K ) * + ************************ + * 2 page task_struct * + * ( 8K ) * +16K aligned ************************ + +What this means is that we don't need to dedicate any register or global variable +to point to the current running process & can retrieve it with the following +very simple construct for s/390 & one very similar for z/Architecture. + +static inline struct task_struct * get_current(void) +{ + struct task_struct *current; + __asm__("lhi %0,-8192\n\t" + "nr %0,15" + : "=r" (current) ); + return current; +} + +i.e. just anding the current kernel stack pointer with the mask -8192. +Thankfully because Linux dosen't have support for nested IO interrupts +& our devices have large buffers can survive interrupts being shut for +short amounts of time we don't need a separate stack for interrupts. + + + + +Register Usage & Stackframes on Linux for s/390 & z/Architecture +================================================================= +Overview: +--------- +This is the code that gcc produces at the top & the bottom of +each function, it usually is fairly consistent & similar from +function to function & if you know its layout you can probalby +make some headway in finding the ultimate cause of a problem +after a crash without a source level debugger. + +Note: To follow stackframes requires a knowledge of C or Pascal & +limited knowledge of one assembly language. + +It should be noted that there are some differences between the +s/390 & z/Architecture stack layouts as the z/Architecture stack layout didn't have +to maintain compatibility with older linkage formats. + +Glossary: +--------- +alloca: +This is a built in compiler function for runtime allocation +of extra space on the callers stack which is obviously freed +up on function exit ( e.g. the caller may choose to allocate nothing +of a buffer of 4k if required for temporary purposes ), it generates +very efficent code ( a few cycles ) when compared to alternatives +like malloc. + +automatics: These are local variables on the stack, +i.e they aren't in registers & they aren't static. + +back-chain: +This is a pointer to the stack pointer before entering a +framed functions ( see frameless function ) prologue got by +deferencing the address of the current stack pointer, + i.e. got by accessing the 32 bit value at the stack pointers +current location. + +base-pointer: +This is a pointer to the back of the literal pool which +is an area just behind each procedure used to store constants +in each function. + +call-clobbered: The caller probably needs to save these registers if there +is something of value in them, on the stack or elsewhere before making a +call to another procedure so that it can restore it later. + +epilogue: +The code generated by the compiler to return to the caller. + +frameless-function +A frameless function in Linux for s390 & z/Architecture is one which doesn't +need more than the register save area ( 96 bytes on s/390, 160 on z/Architecture ) +given to it by the caller. +A frameless function never: +1) Sets up a back chain. +2) Calls alloca. +3) Calls other normal functions +4) Has automatics. + +GOT-pointer: +This is a pointer to the global-offset-table in ELF +( Executable Linkable Format, Linux'es most common executable format ), +all globals & shared library objects are found using this pointer. + +lazy-binding +ELF shared libraries are typically only loaded when routines in the shared +library are actually first called at runtime. This is lazy binding. + +procedure-linkage-table +This is a table found from the GOT which contains pointers to routines +in other shared libraries which can't be called to by easier means. + +prologue: +The code generated by the compiler to set up the stack frame. + +outgoing-args: +This is extra area allocated on the stack of the calling function if the +parameters for the callee's cannot all be put in registers, the same +area can be reused by each function the caller calls. + +routine-descriptor: +A COFF executable format based concept of a procedure reference +actually being 8 bytes or more as opposed to a simple pointer to the routine. +This is typically defined as follows +Routine Descriptor offset 0=Pointer to Function +Routine Descriptor offset 4=Pointer to Table of Contents +The table of contents/TOC is roughly equivalent to a GOT pointer. +& it means that shared libraries etc. can be shared between several +environments each with their own TOC. + + +static-chain: This is used in nested functions a concept adopted from pascal +by gcc not used in ansi C or C++ ( although quite useful ), basically it +is a pointer used to reference local variables of enclosing functions. +You might come across this stuff once or twice in your lifetime. + +e.g. +The function below should return 11 though gcc may get upset & toss warnings +about unused variables. +int FunctionA(int a) +{ + int b; + FunctionC(int c) + { + b=c+1; + } + FunctionC(10); + return(b); +} + + +s/390 & z/Architecture Register usage +===================================== +r0 used by syscalls/assembly call-clobbered +r1 used by syscalls/assembly call-clobbered +r2 argument 0 / return value 0 call-clobbered +r3 argument 1 / return value 1 (if long long) call-clobbered +r4 argument 2 call-clobbered +r5 argument 3 call-clobbered +r6 argument 5 saved +r7 pointer-to arguments 5 to ... saved +r8 this & that saved +r9 this & that saved +r10 static-chain ( if nested function ) saved +r11 frame-pointer ( if function used alloca ) saved +r12 got-pointer saved +r13 base-pointer saved +r14 return-address saved +r15 stack-pointer saved + +f0 argument 0 / return value ( float/double ) call-clobbered +f2 argument 1 call-clobbered +f4 z/Architecture argument 2 saved +f6 z/Architecture argument 3 saved +The remaining floating points +f1,f3,f5 f7-f15 are call-clobbered. + +Notes: +------ +1) The only requirement is that registers which are used +by the callee are saved, e.g. the compiler is perfectly +capible of using r11 for purposes other than a frame a +frame pointer if a frame pointer is not needed. +2) In functions with variable arguments e.g. printf the calling procedure +is identical to one without variable arguments & the same number of +parameters. However, the prologue of this function is somewhat more +hairy owing to it having to move these parameters to the stack to +get va_start, va_arg & va_end to work. +3) Access registers are currently unused by gcc but are used in +the kernel. Possibilities exist to use them at the moment for +temporary storage but it isn't recommended. +4) Only 4 of the floating point registers are used for +parameter passing as older machines such as G3 only have only 4 +& it keeps the stack frame compatible with other compilers. +However with IEEE floating point emulation under linux on the +older machines you are free to use the other 12. +5) A long long or double parameter cannot be have the +first 4 bytes in a register & the second four bytes in the +outgoing args area. It must be purely in the outgoing args +area if crossing this boundary. +6) Floating point parameters are mixed with outgoing args +on the outgoing args area in the order the are passed in as parameters. +7) Floating point arguments 2 & 3 are saved in the outgoing args area for +z/Architecture + + +Stack Frame Layout +------------------ +s/390 z/Architecture +0 0 back chain ( a 0 here signifies end of back chain ) +4 8 eos ( end of stack, not used on Linux for S390 used in other linkage formats ) +8 16 glue used in other s/390 linkage formats for saved routine descriptors etc. +12 24 glue used in other s/390 linkage formats for saved routine descriptors etc. +16 32 scratch area +20 40 scratch area +24 48 saved r6 of caller function +28 56 saved r7 of caller function +32 64 saved r8 of caller function +36 72 saved r9 of caller function +40 80 saved r10 of caller function +44 88 saved r11 of caller function +48 96 saved r12 of caller function +52 104 saved r13 of caller function +56 112 saved r14 of caller function +60 120 saved r15 of caller function +64 128 saved f4 of caller function +72 132 saved f6 of caller function +80 undefined +96 160 outgoing args passed from caller to callee +96+x 160+x possible stack alignment ( 8 bytes desirable ) +96+x+y 160+x+y alloca space of caller ( if used ) +96+x+y+z 160+x+y+z automatics of caller ( if used ) +0 back-chain + +A sample program with comments. +=============================== + +Comments on the function test +----------------------------- +1) It didn't need to set up a pointer to the constant pool gpr13 as it isn't used +( :-( ). +2) This is a frameless function & no stack is bought. +3) The compiler was clever enough to recognise that it could return the +value in r2 as well as use it for the passed in parameter ( :-) ). +4) The basr ( branch relative & save ) trick works as follows the instruction +has a special case with r0,r0 with some instruction operands is understood as +the literal value 0, some risc architectures also do this ). So now +we are branching to the next address & the address new program counter is +in r13,so now we subtract the size of the function prologue we have executed ++ the size of the literal pool to get to the top of the literal pool +0040037c int test(int b) +{ # Function prologue below + 40037c: 90 de f0 34 stm %r13,%r14,52(%r15) # Save registers r13 & r14 + 400380: 0d d0 basr %r13,%r0 # Set up pointer to constant pool using + 400382: a7 da ff fa ahi %r13,-6 # basr trick + return(5+b); + # Huge main program + 400386: a7 2a 00 05 ahi %r2,5 # add 5 to r2 + + # Function epilogue below + 40038a: 98 de f0 34 lm %r13,%r14,52(%r15) # restore registers r13 & 14 + 40038e: 07 fe br %r14 # return +} + +Comments on the function main +----------------------------- +1) The compiler did this function optimally ( 8-) ) + +Literal pool for main. +400390: ff ff ff ec .long 0xffffffec +main(int argc,char *argv[]) +{ # Function prologue below + 400394: 90 bf f0 2c stm %r11,%r15,44(%r15) # Save necessary registers + 400398: 18 0f lr %r0,%r15 # copy stack pointer to r0 + 40039a: a7 fa ff a0 ahi %r15,-96 # Make area for callee saving + 40039e: 0d d0 basr %r13,%r0 # Set up r13 to point to + 4003a0: a7 da ff f0 ahi %r13,-16 # literal pool + 4003a4: 50 00 f0 00 st %r0,0(%r15) # Save backchain + + return(test(5)); # Main Program Below + 4003a8: 58 e0 d0 00 l %r14,0(%r13) # load relative address of test from + # literal pool + 4003ac: a7 28 00 05 lhi %r2,5 # Set first parameter to 5 + 4003b0: 4d ee d0 00 bas %r14,0(%r14,%r13) # jump to test setting r14 as return + # address using branch & save instruction. + + # Function Epilogue below + 4003b4: 98 bf f0 8c lm %r11,%r15,140(%r15)# Restore necessary registers. + 4003b8: 07 fe br %r14 # return to do program exit +} + + +Compiler updates +---------------- + +main(int argc,char *argv[]) +{ + 4004fc: 90 7f f0 1c stm %r7,%r15,28(%r15) + 400500: a7 d5 00 04 bras %r13,400508 + 400504: 00 40 04 f4 .long 0x004004f4 + # compiler now puts constant pool in code to so it saves an instruction + 400508: 18 0f lr %r0,%r15 + 40050a: a7 fa ff a0 ahi %r15,-96 + 40050e: 50 00 f0 00 st %r0,0(%r15) + return(test(5)); + 400512: 58 10 d0 00 l %r1,0(%r13) + 400516: a7 28 00 05 lhi %r2,5 + 40051a: 0d e1 basr %r14,%r1 + # compiler adds 1 extra instruction to epilogue this is done to + # avoid processor pipeline stalls owing to data dependencies on g5 & + # above as register 14 in the old code was needed directly after being loaded + # by the lm %r11,%r15,140(%r15) for the br %14. + 40051c: 58 40 f0 98 l %r4,152(%r15) + 400520: 98 7f f0 7c lm %r7,%r15,124(%r15) + 400524: 07 f4 br %r4 +} + + +Hartmut ( our compiler developer ) also has been threatening to take out the +stack backchain in optimised code as this also causes pipeline stalls, you +have been warned. + +64 bit z/Architecture code disassembly +-------------------------------------- + +If you understand the stuff above you'll understand the stuff +below too so I'll avoid repeating myself & just say that +some of the instructions have g's on the end of them to indicate +they are 64 bit & the stack offsets are a bigger, +the only other difference you'll find between 32 & 64 bit is that +we now use f4 & f6 for floating point arguments on 64 bit. +00000000800005b0 : +int test(int b) +{ + return(5+b); + 800005b0: a7 2a 00 05 ahi %r2,5 + 800005b4: b9 14 00 22 lgfr %r2,%r2 # downcast to integer + 800005b8: 07 fe br %r14 + 800005ba: 07 07 bcr 0,%r7 + + +} + +00000000800005bc
: +main(int argc,char *argv[]) +{ + 800005bc: eb bf f0 58 00 24 stmg %r11,%r15,88(%r15) + 800005c2: b9 04 00 1f lgr %r1,%r15 + 800005c6: a7 fb ff 60 aghi %r15,-160 + 800005ca: e3 10 f0 00 00 24 stg %r1,0(%r15) + return(test(5)); + 800005d0: a7 29 00 05 lghi %r2,5 + # brasl allows jumps > 64k & is overkill here bras would do fune + 800005d4: c0 e5 ff ff ff ee brasl %r14,800005b0 + 800005da: e3 40 f1 10 00 04 lg %r4,272(%r15) + 800005e0: eb bf f0 f8 00 04 lmg %r11,%r15,248(%r15) + 800005e6: 07 f4 br %r4 +} + + + +Compiling programs for debugging on Linux for s/390 & z/Architecture +==================================================================== +-gdwarf-2 now works it should be considered the default debugging +format for s/390 & z/Architecture as it is more reliable for debugging +shared libraries, normal -g debugging works much better now +Thanks to the IBM java compiler developers bug reports. + +This is typically done adding/appending the flags -g or -gdwarf-2 to the +CFLAGS & LDFLAGS variables Makefile of the program concerned. + +If using gdb & you would like accurate displays of registers & + stack traces compile without optimisation i.e make sure +that there is no -O2 or similar on the CFLAGS line of the Makefile & +the emitted gcc commands, obviously this will produce worse code +( not advisable for shipment ) but it is an aid to the debugging process. + +This aids debugging because the compiler will copy parameters passed in +in registers onto the stack so backtracing & looking at passed in +parameters will work, however some larger programs which use inline functions +will not compile without optimisation. + +Debugging with optimisation has since much improved after fixing +some bugs, please make sure you are using gdb-5.0 or later developed +after Nov'2000. + +Figuring out gcc compile errors +=============================== +If you are getting a lot of syntax errors compiling a program & the problem +isn't blatantly obvious from the source. +It often helps to just preprocess the file, this is done with the -E +option in gcc. +What this does is that it runs through the very first phase of compilation +( compilation in gcc is done in several stages & gcc calls many programs to +achieve its end result ) with the -E option gcc just calls the gcc preprocessor (cpp). +The c preprocessor does the following, it joins all the files #included together +recursively ( #include files can #include other files ) & also the c file you wish to compile. +It puts a fully qualified path of the #included files in a comment & it +does macro expansion. +This is useful for debugging because +1) You can double check whether the files you expect to be included are the ones +that are being included ( e.g. double check that you aren't going to the i386 asm directory ). +2) Check that macro definitions aren't clashing with typedefs, +3) Check that definitons aren't being used before they are being included. +4) Helps put the line emitting the error under the microscope if it contains macros. + +For convenience the Linux kernel's makefile will do preprocessing automatically for you +by suffixing the file you want built with .i ( instead of .o ) + +e.g. +from the linux directory type +make arch/s390/kernel/signal.i +this will build + +s390-gcc -D__KERNEL__ -I/home1/barrow/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +-fno-strict-aliasing -D__SMP__ -pipe -fno-strength-reduce -E arch/s390/kernel/signal.c +> arch/s390/kernel/signal.i + +Now look at signal.i you should see something like. + + +# 1 "/home1/barrow/linux/include/asm/types.h" 1 +typedef unsigned short umode_t; +typedef __signed__ char __s8; +typedef unsigned char __u8; +typedef __signed__ short __s16; +typedef unsigned short __u16; + +If instead you are getting errors further down e.g. +unknown instruction:2515 "move.l" or better still unknown instruction:2515 +"Fixme not implemented yet, call Martin" you are probably are attempting to compile some code +meant for another architecture or code that is simply not implemented, with a fixme statement +stuck into the inline assembly code so that the author of the file now knows he has work to do. +To look at the assembly emitted by gcc just before it is about to call gas ( the gnu assembler ) +use the -S option. +Again for your convenience the Linux kernel's Makefile will hold your hand & +do all this donkey work for you also by building the file with the .s suffix. +e.g. +from the Linux directory type +make arch/s390/kernel/signal.s + +s390-gcc -D__KERNEL__ -I/home1/barrow/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +-fno-strict-aliasing -D__SMP__ -pipe -fno-strength-reduce -S arch/s390/kernel/signal.c +-o arch/s390/kernel/signal.s + + +This will output something like, ( please note the constant pool & the useful comments +in the prologue to give you a hand at interpreting it ). + +.LC54: + .string "misaligned (__u16 *) in __xchg\n" +.LC57: + .string "misaligned (__u32 *) in __xchg\n" +.L$PG1: # Pool sys_sigsuspend +.LC192: + .long -262401 +.LC193: + .long -1 +.LC194: + .long schedule-.L$PG1 +.LC195: + .long do_signal-.L$PG1 + .align 4 +.globl sys_sigsuspend + .type sys_sigsuspend,@function +sys_sigsuspend: +# leaf function 0 +# automatics 16 +# outgoing args 0 +# need frame pointer 0 +# call alloca 0 +# has varargs 0 +# incoming args (stack) 0 +# function length 168 + STM 8,15,32(15) + LR 0,15 + AHI 15,-112 + BASR 13,0 +.L$CO1: AHI 13,.L$PG1-.L$CO1 + ST 0,0(15) + LR 8,2 + N 5,.LC192-.L$PG1(13) + +Adding -g to the above output makes the output even more useful +e.g. typing +make CC:="s390-gcc -g" kernel/sched.s + +which compiles. +s390-gcc -g -D__KERNEL__ -I/home/barrow/linux-2.3/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -S kernel/sched.c -o kernel/sched.s + +also outputs stabs ( debugger ) info, from this info you can find out the +offsets & sizes of various elements in structures. +e.g. the stab for the structure +struct rlimit { + unsigned long rlim_cur; + unsigned long rlim_max; +}; +is +.stabs "rlimit:T(151,2)=s8rlim_cur:(0,5),0,32;rlim_max:(0,5),32,32;;",128,0,0,0 +from this stab you can see that +rlimit_cur starts at bit offset 0 & is 32 bits in size +rlimit_max starts at bit offset 32 & is 32 bits in size. + + +Debugging Tools: +================ + +objdump +======= +This is a tool with many options the most useful being ( if compiled with -g). +objdump --source > + + +The whole kernel can be compiled like this ( Doing this will make a 17MB kernel +& a 200 MB listing ) however you have to strip it before building the image +using the strip command to make it a more reasonable size to boot it. + +A source/assembly mixed dump of the kernel can be done with the line +objdump --source vmlinux > vmlinux.lst +Also if the file isn't compiled -g this will output as much debugging information +as it can ( e.g. function names ), however, this is very slow as it spends lots +of time searching for debugging info, the following self explanitory line should be used +instead if the code isn't compiled -g. +objdump --disassemble-all --syms vmlinux > vmlinux.lst +as it is much faster + +As hard drive space is valuble most of us use the following approach. +1) Look at the emitted psw on the console to find the crash address in the kernel. +2) Look at the file System.map ( in the linux directory ) produced when building +the kernel to find the closest address less than the current PSW to find the +offending function. +3) use grep or similar to search the source tree looking for the source file + with this function if you don't know where it is. +4) rebuild this object file with -g on, as an example suppose the file was +( /arch/s390/kernel/signal.o ) +5) Assuming the file with the erroneous function is signal.c Move to the base of the +Linux source tree. +6) rm /arch/s390/kernel/signal.o +7) make /arch/s390/kernel/signal.o +8) watch the gcc command line emitted +9) type it in again or alernatively cut & paste it on the console adding the -g option. +10) objdump --source arch/s390/kernel/signal.o > signal.lst +This will output the source & the assembly intermixed, as the snippet below shows +This will unfortunately output addresses which aren't the same +as the kernel ones you should be able to get around the mental arithmetic +by playing with the --adjust-vma parameter to objdump. + + + + +extern inline void spin_lock(spinlock_t *lp) +{ + a0: 18 34 lr %r3,%r4 + a2: a7 3a 03 bc ahi %r3,956 + __asm__ __volatile(" lhi 1,-1\n" + a6: a7 18 ff ff lhi %r1,-1 + aa: 1f 00 slr %r0,%r0 + ac: ba 01 30 00 cs %r0,%r1,0(%r3) + b0: a7 44 ff fd jm aa + saveset = current->blocked; + b4: d2 07 f0 68 mvc 104(8,%r15),972(%r4) + b8: 43 cc + return (set->sig[0] & mask) != 0; +} + +6) If debugging under VM go down to that section in the document for more info. + + +I now have a tool which takes the pain out of --adjust-vma +& you are able to do something like +make /arch/s390/kernel/traps.lst +& it automatically generates the correctly relocated entries for +the text segment in traps.lst. +This tool is now standard in linux distro's in scripts/makelst + +strace: +------- +Q. What is it ? +A. It is a tool for intercepting calls to the kernel & logging them +to a file & on the screen. + +Q. What use is it ? +A. You can used it to find out what files a particular program opens. + + + +Example 1 +--------- +If you wanted to know does ping work but didn't have the source +strace ping -c 1 127.0.0.1 +& then look at the man pages for each of the syscalls below, +( In fact this is sometimes easier than looking at some spagetti +source which conditionally compiles for several architectures ) +Not everything that it throws out needs to make sense immeadiately + +Just looking quickly you can see that it is making up a RAW socket +for the ICMP protocol. +Doing an alarm(10) for a 10 second timeout +& doing a gettimeofday call before & after each read to see +how long the replies took, & writing some text to stdout so the user +has an idea what is going on. + +socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3 +getuid() = 0 +setuid(0) = 0 +stat("/usr/share/locale/C/libc.cat", 0xbffff134) = -1 ENOENT (No such file or directory) +stat("/usr/share/locale/libc/C", 0xbffff134) = -1 ENOENT (No such file or directory) +stat("/usr/local/share/locale/C/libc.cat", 0xbffff134) = -1 ENOENT (No such file or directory) +getpid() = 353 +setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0 +setsockopt(3, SOL_SOCKET, SO_RCVBUF, [49152], 4) = 0 +fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(3, 1), ...}) = 0 +mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40008000 +ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0 +write(1, "PING 127.0.0.1 (127.0.0.1): 56 d"..., 42PING 127.0.0.1 (127.0.0.1): 56 data bytes +) = 42 +sigaction(SIGINT, {0x8049ba0, [], SA_RESTART}, {SIG_DFL}) = 0 +sigaction(SIGALRM, {0x8049600, [], SA_RESTART}, {SIG_DFL}) = 0 +gettimeofday({948904719, 138951}, NULL) = 0 +sendto(3, "\10\0D\201a\1\0\0\17#\2178\307\36"..., 64, 0, {sin_family=AF_INET, +sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 64 +sigaction(SIGALRM, {0x8049600, [], SA_RESTART}, {0x8049600, [], SA_RESTART}) = 0 +sigaction(SIGALRM, {0x8049ba0, [], SA_RESTART}, {0x8049600, [], SA_RESTART}) = 0 +alarm(10) = 0 +recvfrom(3, "E\0\0T\0005\0\0@\1|r\177\0\0\1\177"..., 192, 0, +{sin_family=AF_INET, sin_port=htons(50882), sin_addr=inet_addr("127.0.0.1")}, [16]) = 84 +gettimeofday({948904719, 160224}, NULL) = 0 +recvfrom(3, "E\0\0T\0006\0\0\377\1\275p\177\0"..., 192, 0, +{sin_family=AF_INET, sin_port=htons(50882), sin_addr=inet_addr("127.0.0.1")}, [16]) = 84 +gettimeofday({948904719, 166952}, NULL) = 0 +write(1, "64 bytes from 127.0.0.1: icmp_se"..., +5764 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=28.0 ms + +Example 2 +--------- +strace passwd 2>&1 | grep open +produces the following output +open("/etc/ld.so.cache", O_RDONLY) = 3 +open("/opt/kde/lib/libc.so.5", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/lib/libc.so.5", O_RDONLY) = 3 +open("/dev", O_RDONLY) = 3 +open("/var/run/utmp", O_RDONLY) = 3 +open("/etc/passwd", O_RDONLY) = 3 +open("/etc/shadow", O_RDONLY) = 3 +open("/etc/login.defs", O_RDONLY) = 4 +open("/dev/tty", O_RDONLY) = 4 + +The 2>&1 is done to redirect stderr to stdout & grep is then filtering this input +through the pipe for each line containing the string open. + + +Example 3 +--------- +Getting sophistocated +telnetd crashes on & I don't know why +Steps +----- +1) Replace the following line in /etc/inetd.conf +telnet stream tcp nowait root /usr/sbin/in.telnetd -h +with +telnet stream tcp nowait root /blah + +2) Create the file /blah with the following contents to start tracing telnetd +#!/bin/bash +/usr/bin/strace -o/t1 -f /usr/sbin/in.telnetd -h +3) chmod 700 /blah to make it executable only to root +4) +killall -HUP inetd +or ps aux | grep inetd +get inetd's process id +& kill -HUP inetd to restart it. + +Important options +----------------- +-o is used to tell strace to output to a file in our case t1 in the root directory +-f is to follow children i.e. +e.g in our case above telnetd will start the login process & subsequently a shell like bash. +You will be able to tell which is which from the process ID's listed on the left hand side +of the strace output. +-p will tell strace to attach to a running process, yup this can be done provided + it isn't being traced or debugged already & you have enough privileges, +the reason 2 processes cannot trace or debug the same program is that strace +becomes the parent process of the one being debugged & processes ( unlike people ) +can have only one parent. + + +However the file /t1 will get big quite quickly +to test it telnet 127.0.0.1 + +now look at what files in.telnetd execve'd +413 execve("/usr/sbin/in.telnetd", ["/usr/sbin/in.telnetd", "-h"], [/* 17 vars */]) = 0 +414 execve("/bin/login", ["/bin/login", "-h", "localhost", "-p"], [/* 2 vars */]) = 0 + +Whey it worked!. + + +Other hints: +------------ +If the program is not very interactive ( i.e. not much keyboard input ) +& is crashing in one architecture but not in another you can do +an strace of both programs under as identical a scenario as you can +on both architectures outputting to a file then. +do a diff of the two traces using the diff program +i.e. +diff output1 output2 +& maybe you'll be able to see where the call paths differed, this +is possibly near the cause of the crash. + +More info +--------- +Look at man pages for strace & the various syscalls +e.g. man strace, man alarm, man socket. + + +Performance Debugging +===================== +gcc is capible of compiling in profiling code just add the -p option +to the CFLAGS, this obviously affects program size & performance. +This can be used by the gprof gnu profiling tool or the +gcov the gnu code coverage tool ( code coverage is a means of testing +code quality by checking if all the code in an executable in exercised by +a tester ). + + +Using top to find out where processes are sleeping in the kernel +---------------------------------------------------------------- +To do this copy the System.map from the root directory where +the linux kernel was built to the /boot directory on your +linux machine. +Start top +Now type fU +You should see a new field called WCHAN which +tells you where each process is sleeping here is a typical output. + + 6:59pm up 41 min, 1 user, load average: 0.00, 0.00, 0.00 +28 processes: 27 sleeping, 1 running, 0 zombie, 0 stopped +CPU states: 0.0% user, 0.1% system, 0.0% nice, 99.8% idle +Mem: 254900K av, 45976K used, 208924K free, 0K shrd, 28636K buff +Swap: 0K av, 0K used, 0K free 8620K cached + + PID USER PRI NI SIZE RSS SHARE WCHAN STAT LIB %CPU %MEM TIME COMMAND + 750 root 12 0 848 848 700 do_select S 0 0.1 0.3 0:00 in.telnetd + 767 root 16 0 1140 1140 964 R 0 0.1 0.4 0:00 top + 1 root 8 0 212 212 180 do_select S 0 0.0 0.0 0:00 init + 2 root 9 0 0 0 0 down_inte SW 0 0.0 0.0 0:00 kmcheck + +The time command +---------------- +Another related command is the time command which gives you an indication +of where a process is spending the majority of its time. +e.g. +time ping -c 5 nc +outputs +real 0m4.054s +user 0m0.010s +sys 0m0.010s + +Debugging under VM +================== + +Notes +----- +Addresses & values in the VM debugger are always hex never decimal +Address ranges are of the format - or . +e.g. The address range 0x2000 to 0x3000 can be described described as +2000-3000 or 2000.1000 + +The VM Debugger is case insensitive. + +VM's strengths are usually other debuggers weaknesses you can get at any resource +no matter how sensitive e.g. memory managment resources,change address translation +in the PSW. For kernel hacking you will reap dividends if you get good at it. + +The VM Debugger displays operators but not operands, probably because some +of it was written when memory was expensive & the programmer was probably proud that +it fitted into 2k of memory & the programmers & didn't want to shock hardcore VM'ers by +changing the interface :-), also the debugger displays useful information on the same line & +the author of the code probably felt that it was a good idea not to go over +the 80 columns on the screen. + +As some of you are probably in a panic now this isn't as unintuitive as it may seem +as the 390 instructions are easy to decode mentally & you can make a good guess at a lot +of them as all the operands are nibble ( half byte aligned ) & if you have an objdump listing +also it is quite easy to follow, if you don't have an objdump listing keep a copy of +the s/390 Reference Summary & look at between pages 2 & 7 or alternatively the +s/390 principles of operation. +e.g. even I can guess that +0001AFF8' LR 180F CC 0 +is a ( load register ) lr r0,r15 + +Also it is very easy to tell the length of a 390 instruction from the 2 most significant +bits in the instruction ( not that this info is really useful except if you are trying to +make sense of a hexdump of code ). +Here is a table +Bits Instruction Length +------------------------------------------ +00 2 Bytes +01 4 Bytes +10 4 Bytes +11 6 Bytes + + + + +The debugger also displays other useful info on the same line such as the +addresses being operated on destination addresses of branches & condition codes. +e.g. +00019736' AHI A7DAFF0E CC 1 +000198BA' BRC A7840004 -> 000198C2' CC 0 +000198CE' STM 900EF068 >> 0FA95E78 CC 2 + + + +Useful VM debugger commands +--------------------------- + +I suppose I'd better mention this before I start +to list the current active traces do +Q TR +there can be a maximum of 255 of these per set +( more about trace sets later ). +To stop traces issue a +TR END. +To delete a particular breakpoint issue +TR DEL + +The PA1 key drops to CP mode so you can issue debugger commands, +Doing alt c (on my 3270 console at least ) clears the screen. +hitting b comes back to the running operating system +from cp mode ( in our case linux ). +It is typically useful to add shortcuts to your profile.exec file +if you have one ( this is roughly equivalent to autoexec.bat in DOS ). +file here are a few from mine. +/* this gives me command history on issuing f12 */ +set pf12 retrieve +/* this continues */ +set pf8 imm b +/* goes to trace set a */ +set pf1 imm tr goto a +/* goes to trace set b */ +set pf2 imm tr goto b +/* goes to trace set c */ +set pf3 imm tr goto c + + + +Instruction Tracing +------------------- +Setting a simple breakpoint +TR I PSWA
+To debug a particular function try +TR I R +TR I on its own will single step. +TR I DATA will trace for particular mnemonics +e.g. +TR I DATA 4D R 0197BC.4000 +will trace for BAS'es ( opcode 4D ) in the range 0197BC.4000 +if you were inclined you could add traces for all branch instructions & +suffix them with the run prefix so you would have a backtrace on screen +when a program crashes. +TR BR will trace branches into or out of an address. +e.g. +TR BR INTO 0 is often quite useful if a program is getting awkward & deciding +to branch to 0 & crashing as this will stop at the address before in jumps to 0. +TR I R
RUN cmd d g +single steps a range of addresses but stays running & +displays the gprs on each step. + + + +Displaying & modifying Registers +-------------------------------- +D G will display all the gprs +Adding a extra G to all the commands is neccessary to access the full 64 bit +content in VM on z/Architecture obviously this isn't required for access registers +as these are still 32 bit. +e.g. DGG instead of DG +D X will display all the control registers +D AR will display all the access registers +D AR4-7 will display access registers 4 to 7 +CPU ALL D G will display the GRPS of all CPUS in the configuration +D PSW will display the current PSW +st PSW 2000 will put the value 2000 into the PSW & +cause crash your machine. +D PREFIX displays the prefix offset + + +Displaying Memory +----------------- +To display memory mapped using the current PSW's mapping try +D +To make VM display a message each time it hits a particular address & continue try +D I will disassemble/display a range of instructions. +ST addr 32 bit word will store a 32 bit aligned address +D T will display the EBCDIC in an address ( if you are that way inclined ) +D R will display real addresses ( without DAT ) but with prefixing. +There are other complex options to display if you need to get at say home space +but are in primary space the easiest thing to do is to temporarily +modify the PSW to the other addressing mode, display the stuff & then +restore it. + + + +Hints +----- +If you want to issue a debugger command without halting your virtual machine with the +PA1 key try prefixing the command with #CP e.g. +#cp tr i pswa 2000 +also suffixing most debugger commands with RUN will cause them not +to stop just display the mnemonic at the current instruction on the console. +If you have several breakpoints you want to put into your program & +you get fed up of cross referencing with System.map +you can do the following trick for several symbols. +grep do_signal System.map +which emits the following among other things +0001f4e0 T do_signal +now you can do + +TR I PSWA 0001f4e0 cmd msg * do_signal +This sends a message to your own console each time do_signal is entered. +( As an aside I wrote a perl script once which automatically generated a REXX +script with breakpoints on every kernel procedure, this isn't a good idea +because there are thousands of these routines & VM can only set 255 breakpoints +at a time so you nearly had to spend as long pruning the file down as you would +entering the msg's by hand ),however, the trick might be useful for a single object file. +On linux'es 3270 emulator x3270 there is a very useful option under the file ment +Save Screens In File this is very good of keeping a copy of traces. + +From CMS help will give you online help on a particular command. +e.g. +HELP DISPLAY + +Also CP has a file called profile.exec which automatically gets called +on startup of CMS ( like autoexec.bat ), keeping on a DOS analogy session +CP has a feature similar to doskey, it may be useful for you to +use profile.exec to define some keystrokes. +e.g. +SET PF9 IMM B +This does a single step in VM on pressing F8. +SET PF10 ^ +This sets up the ^ key. +which can be used for ^c (ctrl-c),^z (ctrl-z) which can't be typed directly into some 3270 consoles. +SET PF11 ^- +This types the starting keystrokes for a sysrq see SysRq below. +SET PF12 RETRIEVE +This retrieves command history on pressing F12. + + +Sometimes in VM the display is set up to scroll automatically this +can be very annoying if there are messages you wish to look at +to stop this do +TERM MORE 255 255 +This will nearly stop automatic screen updates, however it will +cause a denial of service if lots of messages go to the 3270 console, +so it would be foolish to use this as the default on a production machine. + + +Tracing particular processes +---------------------------- +The kernels text segment is intentionally at an address in memory that it will +very seldom collide with text segments of user programs ( thanks Martin ), +this simplifies debugging the kernel. +However it is quite common for user processes to have addresses which collide +this can make debugging a particular process under VM painful under normal +circumstances as the process may change when doing a +TR I R
. +Thankfully after reading VM's online help I figured out how to debug +I particular process. + +Your first problem is to find the STD ( segment table designation ) +of the program you wish to debug. +There are several ways you can do this here are a few +1) objdump --syms | grep main +To get the address of main in the program. +tr i pswa
+Start the program, if VM drops to CP on what looks like the entry +point of the main function this is most likely the process you wish to debug. +Now do a D X13 or D XG13 on z/Architecture. +On 31 bit the STD is bits 1-19 ( the STO segment table origin ) +& 25-31 ( the STL segment table length ) of CR13. +now type +TR I R STD 0.7fffffff +e.g. +TR I R STD 8F32E1FF 0.7fffffff +Another very useful variation is +TR STORE INTO STD
+for finding out when a particular variable changes. + +An alternative way of finding the STD of a currently running process +is to do the following, ( this method is more complex but +could be quite convient if you aren't updating the kernel much & +so your kernel structures will stay constant for a reasonable period of +time ). + +grep task /proc//status +from this you should see something like +task: 0f160000 ksp: 0f161de8 pt_regs: 0f161f68 +This now gives you a pointer to the task structure. +Now make CC:="s390-gcc -g" kernel/sched.s +To get the task_struct stabinfo. +( task_struct is defined in include/linux/sched.h ). +Now we want to look at +task->active_mm->pgd +on my machine the active_mm in the task structure stab is +active_mm:(4,12),672,32 +its offset is 672/8=84=0x54 +the pgd member in the mm_struct stab is +pgd:(4,6)=*(29,5),96,32 +so its offset is 96/8=12=0xc + +so we'll +hexdump -s 0xf160054 /dev/mem | more +i.e. task_struct+active_mm offset +to look at the active_mm member +f160054 0fee cc60 0019 e334 0000 0000 0000 0011 +hexdump -s 0x0feecc6c /dev/mem | more +i.e. active_mm+pgd offset +feecc6c 0f2c 0000 0000 0001 0000 0001 0000 0010 +we get something like +now do +TR I R STD 0.7fffffff +i.e. the 0x7f is added because the pgd only +gives the page table origin & we need to set the low bits +to the maximum possible segment table length. +TR I R STD 0f2c007f 0.7fffffff +on z/Architecture you'll probably need to do +TR I R STD 0.ffffffffffffffff +to set the TableType to 0x1 & the Table length to 3. + + + +Tracing Program Exceptions +-------------------------- +If you get a crash which says something like +illegal operation or specification exception followed by a register dump +You can restart linux & trace these using the tr prog trace option. + + + +The most common ones you will normally be tracing for is +1=operation exception +2=privileged operation exception +4=protection exception +5=addressing exception +6=specification exception +10=segment translation exception +11=page translation exception + +The full list of these is on page 22 of the current s/390 Reference Summary. +e.g. +tr prog 10 will trace segment translation exceptions. +tr prog on its own will trace all program interruption codes. + +Trace Sets +---------- +On starting VM you are initially in the INITIAL trace set. +You can do a Q TR to verify this. +If you have a complex tracing situation where you wish to wait for instance +till a driver is open before you start tracing IO, but know in your +heart that you are going to have to make several runs through the code till you +have a clue whats going on. + +What you can do is +TR I PSWA +hit b to continue till breakpoint +reach the breakpoint +now do your +TR GOTO B +TR IO 7c08-7c09 inst int run +or whatever the IO channels you wish to trace are & hit b + +To got back to the initial trace set do +TR GOTO INITIAL +& the TR I PSWA will be the only active breakpoint again. + + +Tracing linux syscalls under VM +------------------------------- +Syscalls are implemented on Linux for S390 by the Supervisor call instruction (SVC) there 256 +possibilities of these as the instruction is made up of a 0xA opcode & the second byte being +the syscall number. They are traced using the simple command. +TR SVC +the syscalls are defined in linux/include/asm-s390/unistd.h +e.g. to trace all file opens just do +TR SVC 5 ( as this is the syscall number of open ) + + +SMP Specific commands +--------------------- +To find out how many cpus you have +Q CPUS displays all the CPU's available to your virtual machine +To find the cpu that the current cpu VM debugger commands are being directed at do +Q CPU to change the current cpu cpu VM debugger commands are being directed at do +CPU + +On a SMP guest issue a command to all CPUs try prefixing the command with cpu all. +To issue a command to a particular cpu try cpu e.g. +CPU 01 TR I R 2000.3000 +If you are running on a guest with several cpus & you have a IO related problem +& cannot follow the flow of code but you know it isnt smp related. +from the bash prompt issue +shutdown -h now or halt. +do a Q CPUS to find out how many cpus you have +detach each one of them from cp except cpu 0 +by issueing a +DETACH CPU 01-(number of cpus in configuration) +& boot linux again. +TR SIGP will trace inter processor signal processor instructions. +DEFINE CPU 01-(number in configuration) +will get your guests cpus back. + + +Help for displaying ascii textstrings +------------------------------------- +On the very latest VM Nucleus'es VM can now display ascii +( thanks Neale for the hint ) by doing +D TX. +e.g. +D TX0.100 + +Alternatively +============= +Under older VM debuggers ( I love EBDIC too ) you can use this little program I wrote which +will convert a command line of hex digits to ascii text which can be compiled under linux & +you can copy the hex digits from your x3270 terminal to your xterm if you are debugging +from a linuxbox. + +This is quite useful when looking at a parameter passed in as a text string +under VM ( unless you are good at decoding ASCII in your head ). + +e.g. consider tracing an open syscall +TR SVC 5 +We have stopped at a breakpoint +000151B0' SVC 0A05 -> 0001909A' CC 0 + +D 20.8 to check the SVC old psw in the prefix area & see was it from userspace +( for the layout of the prefix area consult P18 of the s/390 390 Reference Summary +if you have it available ). +V00000020 070C2000 800151B2 +The problem state bit wasn't set & it's also too early in the boot sequence +for it to be a userspace SVC if it was we would have to temporarily switch the +psw to user space addressing so we could get at the first parameter of the open in +gpr2. +Next do a +D G2 +GPR 2 = 00014CB4 +Now display what gpr2 is pointing to +D 00014CB4.20 +V00014CB4 2F646576 2F636F6E 736F6C65 00001BF5 +V00014CC4 FC00014C B4001001 E0001000 B8070707 +Now copy the text till the first 00 hex ( which is the end of the string +to an xterm & do hex2ascii on it. +hex2ascii 2F646576 2F636F6E 736F6C65 00 +outputs +Decoded Hex:=/ d e v / c o n s o l e 0x00 +We were opening the console device, + +You can compile the code below yourself for practice :-), +/* + * hex2ascii.c + * a useful little tool for converting a hexadecimal command line to ascii + * + * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) + * (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation. + */ +#include + +int main(int argc,char *argv[]) +{ + int cnt1,cnt2,len,toggle=0; + int startcnt=1; + unsigned char c,hex; + + if(argc>1&&(strcmp(argv[1],"-a")==0)) + startcnt=2; + printf("Decoded Hex:="); + for(cnt1=startcnt;cnt1='0'&&c<='9') + c=c-'0'; + if(c>='A'&&c<='F') + c=c-'A'+10; + if(c>='a'&&c<='F') + c=c-'a'+10; + switch(toggle) + { + case 0: + hex=c<<4; + toggle=1; + break; + case 1: + hex+=c; + if(hex<32||hex>127) + { + if(startcnt==1) + printf("0x%02X ",(int)hex); + else + printf("."); + } + else + { + printf("%c",hex); + if(startcnt==1) + printf(" "); + } + toggle=0; + break; + } + } + } + printf("\n"); +} + + + + +Stack tracing under VM +---------------------- +A basic backtrace +----------------- + +Here are the tricks I use 9 out of 10 times it works pretty well, + +When your backchain reaches a dead end +-------------------------------------- +This can happen when an exception happens in the kernel & the kernel is entered twice +if you reach the NULL pointer at the end of the back chain you should be +able to sniff further back if you follow the following tricks. +1) A kernel address should be easy to recognise since it is in +primary space & the problem state bit isn't set & also +The Hi bit of the address is set. +2) Another backchain should also be easy to recognise since it is an +address pointing to another address approximately 100 bytes or 0x70 hex +behind the current stackpointer. + + +Here is some practice. +boot the kernel & hit PA1 at some random time +d g to display the gprs, this should display something like +GPR 0 = 00000001 00156018 0014359C 00000000 +GPR 4 = 00000001 001B8888 000003E0 00000000 +GPR 8 = 00100080 00100084 00000000 000FE000 +GPR 12 = 00010400 8001B2DC 8001B36A 000FFED8 +Note that GPR14 is a return address but as we are real men we are going to +trace the stack. +display 0x40 bytes after the stack pointer. + +V000FFED8 000FFF38 8001B838 80014C8E 000FFF38 +V000FFEE8 00000000 00000000 000003E0 00000000 +V000FFEF8 00100080 00100084 00000000 000FE000 +V000FFF08 00010400 8001B2DC 8001B36A 000FFED8 + + +Ah now look at whats in sp+56 (sp+0x38) this is 8001B36A our saved r14 if +you look above at our stackframe & also agrees with GPR14. + +now backchain +d 000FFF38.40 +we now are taking the contents of SP to get our first backchain. + +V000FFF38 000FFFA0 00000000 00014995 00147094 +V000FFF48 00147090 001470A0 000003E0 00000000 +V000FFF58 00100080 00100084 00000000 001BF1D0 +V000FFF68 00010400 800149BA 80014CA6 000FFF38 + +This displays a 2nd return address of 80014CA6 + +now do d 000FFFA0.40 for our 3rd backchain + +V000FFFA0 04B52002 0001107F 00000000 00000000 +V000FFFB0 00000000 00000000 FF000000 0001107F +V000FFFC0 00000000 00000000 00000000 00000000 +V000FFFD0 00010400 80010802 8001085A 000FFFA0 + + +our 3rd return address is 8001085A + +as the 04B52002 looks suspiciously like rubbish it is fair to assume that the kernel entry routines +for the sake of optimisation dont set up a backchain. + +now look at System.map to see if the addresses make any sense. + +grep -i 0001b3 System.map +outputs among other things +0001b304 T cpu_idle +so 8001B36A +is cpu_idle+0x66 ( quiet the cpu is asleep, don't wake it ) + + +grep -i 00014 System.map +produces among other things +00014a78 T start_kernel +so 0014CA6 is start_kernel+some hex number I can't add in my head. + +grep -i 00108 System.map +this produces +00010800 T _stext +so 8001085A is _stext+0x5a + +Congrats you've done your first backchain. + + + +s/390 & z/Architecture IO Overview +================================== + +I am not going to give a course in 390 IO architecture as this would take me quite a +while & I'm no expert. Instead I'll give a 390 IO architecture summary for Dummies if you have +the s/390 principles of operation available read this instead. If nothing else you may find a few +useful keywords in here & be able to use them on a web search engine like altavista to find +more useful information. + +Unlike other bus architectures modern 390 systems do their IO using mostly +fibre optics & devices such as tapes & disks can be shared between several mainframes, +also S390 can support upto 65536 devices while a high end PC based system might be choking +with around 64. Here is some of the common IO terminology + +Subchannel: +This is the logical number most IO commands use to talk to an IO device there can be upto +0x10000 (65536) of these in a configuration typically there is a few hundred. Under VM +for simplicity they are allocated contiguously, however on the native hardware they are not +they typically stay consistent between boots provided no new hardware is inserted or removed. +Under Linux for 390 we use these as IRQ's & also when issuing an IO command (CLEAR SUBCHANNEL, +HALT SUBCHANNEL,MODIFY SUBCHANNEL,RESUME SUBCHANNEL,START SUBCHANNEL,STORE SUBCHANNEL & +TEST SUBCHANNEL ) we use this as the ID of the device we wish to talk to, the most +important of these instructions are START SUBCHANNEL ( to start IO ), TEST SUBCHANNEL ( to check +whether the IO completed successfully ), & HALT SUBCHANNEL ( to kill IO ), a subchannel +can have up to 8 channel paths to a device this offers redunancy if one is not available. + + +Device Number: +This number remains static & Is closely tied to the hardware, there are 65536 of these +also they are made up of a CHPID ( Channel Path ID, the most significant 8 bits ) +& another lsb 8 bits. These remain static even if more devices are inserted or removed +from the hardware, there is a 1 to 1 mapping between Subchannels & Device Numbers provided +devices arent inserted or removed. + +Channel Control Words: +CCWS are linked lists of instructions initially pointed to by an operation request block (ORB), +which is initially given to Start Subchannel (SSCH) command along with the subchannel number +for the IO subsystem to process while the CPU continues executing normal code. +These come in two flavours, Format 0 ( 24 bit for backward ) +compatibility & Format 1 ( 31 bit ). These are typically used to issue read & write +( & many other instructions ) they consist of a length field & an absolute address field. +For each IO typically get 1 or 2 interrupts one for channel end ( primary status ) when the +channel is idle & the second for device end ( secondary status ) sometimes you get both +concurrently, you check how the IO went on by issueing a TEST SUBCHANNEL at each interrupt, +from which you receive an Interruption response block (IRB). If you get channel & device end +status in the IRB without channel checks etc. your IO probably went okay. If you didn't you +probably need a doctorto examine the IRB & extended status word etc. +If an error occurs more sophistocated control units have a facitity known as +concurrent sense this means that if an error occurs Extended sense information will +be presented in the Extended status word in the IRB if not you have to issue a +subsequent SENSE CCW command after the test subchannel. + + +TPI( Test pending interrupt) can also be used for polled IO but in multitasking multiprocessor +systems it isn't recommended except for checking special cases ( i.e. non looping checks for +pending IO etc. ). + +Store Subchannel & Modify Subchannel can be used to examine & modify operating characteristics +of a subchannel ( e.g. channel paths ). + +Other IO related Terms: +Sysplex: S390's Clustering Technology +QDIO: S390's new high speed IO architecture to support devices such as gigabit ethernet, +this architecture is also designed to be forward compatible with up & coming 64 bit machines. + + +General Concepts + +Input Output Processors (IOP's) are responsible for communicating between +the mainframe CPU's & the channel & relieve the mainframe CPU's from the +burden of communicating with IO devices directly, this allows the CPU's to +concentrate on data processing. + +IOP's can use one or more links ( known as channel paths ) to talk to each +IO device. It first checks for path availability & chooses an available one, +then starts ( & sometimes terminates IO ). +There are two types of channel path ESCON & the Paralell IO interface. + +IO devices are attached to control units, control units provide the +logic to interface the channel paths & channel path IO protocols to +the IO devices, they can be integrated with the devices or housed separately +& often talk to several similar devices ( typical examples would be raid +controllers or a control unit which connects to 1000 3270 terminals ). + + + +---------------------------------------------------------------+ + | +-----+ +-----+ +-----+ +-----+ +----------+ +----------+ | + | | CPU | | CPU | | CPU | | CPU | | Main | | Expanded | | + | | | | | | | | | | Memory | | Storage | | + | +-----+ +-----+ +-----+ +-----+ +----------+ +----------+ | + |---------------------------------------------------------------+ + | IOP | IOP | IOP | + |--------------------------------------------------------------- + | C | C | C | C | C | C | C | C | C | C | C | C | C | C | C | C | + ---------------------------------------------------------------- + || || + || Bus & Tag Channel Path || ESCON + || ====================== || Channel + || || || || Path + +----------+ +----------+ +----------+ + | | | | | | + | CU | | CU | | CU | + | | | | | | + +----------+ +----------+ +----------+ + | | | | | ++----------+ +----------+ +----------+ +----------+ +----------+ +|I/O Device| |I/O Device| |I/O Device| |I/O Device| |I/O Device| ++----------+ +----------+ +----------+ +----------+ +----------+ + CPU = Central Processing Unit + C = Channel + IOP = IP Processor + CU = Control Unit + +The 390 IO systems come in 2 flavours the current 390 machines support both + +The Older 360 & 370 Interface,sometimes called the paralell I/O interface, +sometimes called Bus-and Tag & sometimes Original Equipment Manufacturers +Interface (OEMI). + +This byte wide paralell channel path/bus has parity & data on the "Bus" cable +& control lines on the "Tag" cable. These can operate in byte multiplex mode for +sharing between several slow devices or burst mode & monopolize the channel for the +whole burst. Upto 256 devices can be addressed on one of these cables. These cables are +about one inch in diameter. The maximum unextended length supported by these cables is +125 Meters but this can be extended up to 2km with a fibre optic channel extended +such as a 3044. The maximum burst speed supported is 4.5 megabytes per second however +some really old processors support only transfer rates of 3.0, 2.0 & 1.0 MB/sec. +One of these paths can be daisy chained to up to 8 control units. + + +ESCON if fibre optic it is also called FICON +Was introduced by IBM in 1990. Has 2 fibre optic cables & uses either leds or lasers +for communication at a signaling rate of upto 200 megabits/sec. As 10bits are transferred +for every 8 bits info this drops to 160 megabits/sec & to 18.6 Megabytes/sec once +control info & CRC are added. ESCON only operates in burst mode. + +ESCONs typical max cable length is 3km for the led version & 20km for the laser version +known as XDF ( extended distance facility ). This can be further extended by using an +ESCON director which triples the above mentioned ranges. Unlike Bus & Tag as ESCON is +serial it uses a packet switching architecture the standard Bus & Tag control protocol +is however present within the packets. Upto 256 devices can be attached to each control +unit that uses one of these interfaces. + +Common 390 Devices include: +Network adapters typically OSA2,3172's,2116's & OSA-E gigabit ethernet adapters, +Consoles 3270 & 3215 ( a teletype emulated under linux for a line mode console ). +DASD's direct access storage devices ( otherwise known as hard disks ). +Tape Drives. +CTC ( Channel to Channel Adapters ), +ESCON or Paralell Cables used as a very high speed serial link +between 2 machines. We use 2 cables under linux to do a bi-directional serial link. + + +Debugging IO on s/390 & z/Architecture under VM +=============================================== + +Now we are ready to go on with IO tracing commands under VM + +A few self explanatory queries: +Q OSA +Q CTC +Q DISK ( This command is CMS specific ) +Q DASD + + + + + + +Q OSA on my machine returns +OSA 7C08 ON OSA 7C08 SUBCHANNEL = 0000 +OSA 7C09 ON OSA 7C09 SUBCHANNEL = 0001 +OSA 7C14 ON OSA 7C14 SUBCHANNEL = 0002 +OSA 7C15 ON OSA 7C15 SUBCHANNEL = 0003 + +If you have a guest with certain priviliges you may be able to see devices +which don't belong to you to avoid this do add the option V. +e.g. +Q V OSA + +Now using the device numbers returned by this command we will +Trace the io starting up on the first device 7c08 & 7c09 +In our simplest case we can trace the +start subchannels +like TR SSCH 7C08-7C09 +or the halt subchannels +or TR HSCH 7C08-7C09 +MSCH's ,STSCH's I think you can guess the rest + +Ingo's favourite trick is tracing all the IO's & CCWS & spooling them into the reader of another +VM guest so he can ftp the logfile back to his own machine.I'll do a small bit of this & give you + a look at the output. + +1) Spool stdout to VM reader +SP PRT TO (another vm guest ) or * for the local vm guest +2) Fill the reader with the trace +TR IO 7c08-7c09 INST INT CCW PRT RUN +3) Start up linux +i 00c +4) Finish the trace +TR END +5) close the reader +C PRT +6) list reader contents +RDRLIST +7) copy it to linux4's minidisk +RECEIVE / LOG TXT A1 ( replace +8) +filel & press F11 to look at it +You should see someting like. + +00020942' SSCH B2334000 0048813C CC 0 SCH 0000 DEV 7C08 + CPA 000FFDF0 PARM 00E2C9C4 KEY 0 FPI C0 LPM 80 + CCW 000FFDF0 E4200100 00487FE8 0000 E4240100 ........ + IDAL 43D8AFE8 + IDAL 0FB76000 +00020B0A' I/O DEV 7C08 -> 000197BC' SCH 0000 PARM 00E2C9C4 +00021628' TSCH B2354000 >> 00488164 CC 0 SCH 0000 DEV 7C08 + CCWA 000FFDF8 DEV STS 0C SCH STS 00 CNT 00EC + KEY 0 FPI C0 CC 0 CTLS 4007 +00022238' STSCH B2344000 >> 00488108 CC 0 SCH 0000 DEV 7C08 + +If you don't like messing up your readed ( because you possibly booted from it ) +you can alternatively spool it to another readers guest. + + +Other common VM device related commands +--------------------------------------------- +These commands are listed only because they have +been of use to me in the past & may be of use to +you too. For more complete info on each of the commands +use type HELP from CMS. +detaching devices +DET +ATT +attach a device to guest * for your own guest +READY cause VM to issue a fake interrupt. + +The VARY command is normally only available to VM administrators. +VARY ON PATH TO +VARY OFF PATH FROM +This is used to switch on or off channel paths to devices. + +Q CHPID +This displays state of devices using this channel path +D SCHIB +This displays the subchannel information SCHIB block for the device. +this I believe is also only available to administrators. +DEFINE CTC +defines a virtual CTC channel to channel connection +2 need to be defined on each guest for the CTC driver to use. +COUPLE devno userid remote devno +Joins a local virtual device to a remote virtual device +( commonly used for the CTC driver ). + +Building a VM ramdisk under CMS which linux can use +def vfb- +blocksize is commonly 4096 for linux. +Formatting it +format (blksize + +Sharing a disk between multiple guests +LINK userid devno1 devno2 mode password + + + +GDB on S390 +=========== +N.B. if compiling for debugging gdb works better without optimisation +( see Compiling programs for debugging ) + +invocation +---------- +gdb + +Online help +----------- +help: gives help on commands +e.g. +help +help display +Note gdb's online help is very good use it. + + +Assembly +-------- +info registers: displays registers other than floating point. +info all-registers: displays floating points as well. +disassemble: dissassembles +e.g. +disassemble without parameters will disassemble the current function +disassemble $pc $pc+10 + +Viewing & modifying variables +----------------------------- +print or p: displays variable or register +e.g. p/x $sp will display the stack pointer + +display: prints variable or register each time program stops +e.g. +display/x $pc will display the program counter +display argc + +undisplay : undo's display's + +info breakpoints: shows all current breakpoints + +info stack: shows stack back trace ( if this dosent work too well, I'll show you the +stacktrace by hand below ). + +info locals: displays local variables. + +info args: display current procedure arguments. + +set args: will set argc & argv each time the victim program is invoked. + +set =value +set argc=100 +set $pc=0 + + + +Modifying execution +------------------- +step: steps n lines of sourcecode +step steps 1 line. +step 100 steps 100 lines of code. + +next: like step except this will not step into subroutines + +stepi: steps a single machine code instruction. +e.g. stepi 100 + +nexti: steps a single machine code instruction but will not step into subroutines. + +finish: will run until exit of the current routine + +run: (re)starts a program + +cont: continues a program + +quit: exits gdb. + + +breakpoints +------------ + +break +sets a breakpoint +e.g. + +break main + +break *$pc + +break *0x400618 + +heres a really useful one for large programs +rbr +Set a breakpoint for all functions matching REGEXP +e.g. +rbr 390 +will set a breakpoint with all functions with 390 in their name. + +info breakpoints +lists all breakpoints + +delete: delete breakpoint by number or delete them all +e.g. +delete 1 will delete the first breakpoint +delete will delete them all + +watch: This will set a watchpoint ( usually hardware assisted ), +This will watch a variable till it changes +e.g. +watch cnt, will watch the variable cnt till it changes. +As an aside unfortunately gdb's, architecture independent watchpoint code +is inconsistent & not very good, watchpoints usually work but not always. + +info watchpoints: Display currently active watchpoints + +condition: ( another useful one ) +Specify breakpoint number N to break only if COND is true. +Usage is `condition N COND', where N is an integer and COND is an +expression to be evaluated whenever breakpoint N is reached. + + + +User defined functions/macros +----------------------------- +define: ( Note this is very very useful,simple & powerful ) +usage define end + +examples which you should consider putting into .gdbinit in your home directory +define d +stepi +disassemble $pc $pc+10 +end + +define e +nexti +disassemble $pc $pc+10 +end + + +Other hard to classify stuff +---------------------------- +signal n: +sends the victim program a signal. +e.g. signal 3 will send a SIGQUIT. + +info signals: +what gdb does when the victim receives certain signals. + +list: +e.g. +list lists current function source +list 1,10 list first 10 lines of curret file. +list test.c:1,10 + + +directory: +Adds directories to be searched for source if gdb cannot find the source. +(note it is a bit sensititive about slashes ) +e.g. To add the root of the filesystem to the searchpath do +directory // + + +call +This calls a function in the victim program, this is pretty powerful +e.g. +(gdb) call printf("hello world") +outputs: +$1 = 11 + +You might now be thinking that the line above didn't work, something extra had to be done. +(gdb) call fflush(stdout) +hello world$2 = 0 +As an aside the debugger also calls malloc & free under the hood +to make space for the "hello world" string. + + + +hints +----- +1) command completion works just like bash +( if you are a bad typist like me this really helps ) +e.g. hit br & cursor up & down :-). + +2) if you have a debugging problem that takes a few steps to recreate +put the steps into a file called .gdbinit in your current working directory +if you have defined a few extra useful user defined commands put these in +your home directory & they will be read each time gdb is launched. + +A typical .gdbinit file might be. +break main +run +break runtime_exception +cont + + +stack chaining in gdb by hand +----------------------------- +This is done using a the same trick described for VM +p/x (*($sp+56))&0x7fffffff get the first backchain. + +For z/Architecture +Replace 56 with 112 & ignore the &0x7fffffff +in the macros below & do nasty casts to longs like the following +as gdb unfortunately deals with printed arguments as ints which +messes up everything. +i.e. here is a 3rd backchain dereference +p/x *(long *)(***(long ***)$sp+112) + + +this outputs +$5 = 0x528f18 +on my machine. +Now you can use +info symbol (*($sp+56))&0x7fffffff +you might see something like. +rl_getc + 36 in section .text telling you what is located at address 0x528f18 +Now do. +p/x (*(*$sp+56))&0x7fffffff +This outputs +$6 = 0x528ed0 +Now do. +info symbol (*(*$sp+56))&0x7fffffff +rl_read_key + 180 in section .text +now do +p/x (*(**$sp+56))&0x7fffffff +& so on. + +Disassembling instructions without debug info +--------------------------------------------- +gdb typically compains if there is a lack of debugging +symbols in the disassemble command with +"No function contains specified address." to get around +this do +x/xi
+e.g. +x/20xi 0x400730 + + + +Note: Remember gdb has history just like bash you don't need to retype the +whole line just use the up & down arrows. + + + +For more info +------------- +From your linuxbox do +man gdb or info gdb. + +core dumps +---------- +What a core dump ?, +A core dump is a file generated by the kernel ( if allowed ) which contains the registers, +& all active pages of the program which has crashed. +From this file gdb will allow you to look at the registers & stack trace & memory of the +program as if it just crashed on your system, it is usually called core & created in the +current working directory. +This is very useful in that a customer can mail a core dump to a technical support department +& the technical support department can reconstruct what happened. +Provided the have an indentical copy of this program with debugging symbols compiled in & +the source base of this build is available. +In short it is far more useful than something like a crash log could ever hope to be. + +In theory all that is missing to restart a core dumped program is a kernel patch which +will do the following. +1) Make a new kernel task structure +2) Reload all the dumped pages back into the kernels memory managment structures. +3) Do the required clock fixups +4) Get all files & network connections for the process back into an identical state ( really difficult ). +5) A few more difficult things I haven't thought of. + + + +Why have I never seen one ?. +Probably because you haven't used the command +ulimit -c unlimited in bash +to allow core dumps, now do +ulimit -a +to verify that the limit was accepted. + +A sample core dump +To create this I'm going to do +ulimit -c unlimited +gdb +to launch gdb (my victim app. ) now be bad & do the following from another +telnet/xterm session to the same machine +ps -aux | grep gdb +kill -SIGSEGV +or alternatively use killall -SIGSEGV gdb if you have the killall command. +Now look at the core dump. +./gdb ./gdb core +Displays the following +GNU gdb 4.18 +Copyright 1998 Free Software Foundation, Inc. +GDB is free software, covered by the GNU General Public License, and you are +welcome to change it and/or distribute copies of it under certain conditions. +Type "show copying" to see the conditions. +There is absolutely no warranty for GDB. Type "show warranty" for details. +This GDB was configured as "s390-ibm-linux"... +Core was generated by `./gdb'. +Program terminated with signal 11, Segmentation fault. +Reading symbols from /usr/lib/libncurses.so.4...done. +Reading symbols from /lib/libm.so.6...done. +Reading symbols from /lib/libc.so.6...done. +Reading symbols from /lib/ld-linux.so.2...done. +#0 0x40126d1a in read () from /lib/libc.so.6 +Setting up the environment for debugging gdb. +Breakpoint 1 at 0x4dc6f8: file utils.c, line 471. +Breakpoint 2 at 0x4d87a4: file top.c, line 2609. +(top-gdb) info stack +#0 0x40126d1a in read () from /lib/libc.so.6 +#1 0x528f26 in rl_getc (stream=0x7ffffde8) at input.c:402 +#2 0x528ed0 in rl_read_key () at input.c:381 +#3 0x5167e6 in readline_internal_char () at readline.c:454 +#4 0x5168ee in readline_internal_charloop () at readline.c:507 +#5 0x51692c in readline_internal () at readline.c:521 +#6 0x5164fe in readline (prompt=0x7ffff810 "\177˙řx\177˙÷Ř\177˙řxŔ") + at readline.c:349 +#7 0x4d7a8a in command_line_input (prrompt=0x564420 "(gdb) ", repeat=1, + annotation_suffix=0x4d6b44 "prompt") at top.c:2091 +#8 0x4d6cf0 in command_loop () at top.c:1345 +#9 0x4e25bc in main (argc=1, argv=0x7ffffdf4) at main.c:635 + + +LDD +=== +This is a program which lists the shared libraries which a library needs, +Note you also get the relocations of the shared library text segments which +help when using objdump --source. +e.g. + ldd ./gdb +outputs +libncurses.so.4 => /usr/lib/libncurses.so.4 (0x40018000) +libm.so.6 => /lib/libm.so.6 (0x4005e000) +libc.so.6 => /lib/libc.so.6 (0x40084000) +/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) + + +Debugging shared libraries +========================== +Most programs use shared libraries, however it can be very painful +when you single step instruction into a function like printf for the +first time & you end up in functions like _dl_runtime_resolve this is +the ld.so doing lazy binding, lazy binding is a concept in ELF where +shared library functions are not loaded into memory unless they are +actually used, great for saving memory but a pain to debug. +To get around this either relink the program -static or exit gdb type +export LD_BIND_NOW=true this will stop lazy binding & restart the gdb'ing +the program in question. + + + +Debugging modules +================= +As modules are dynamically loaded into the kernel their address can be +anywhere to get around this use the -m option with insmod to emit a load +map which can be piped into a file if required. + +The proc file system +==================== +What is it ?. +It is a filesystem created by the kernel with files which are created on demand +by the kernel if read, or can be used to modify kernel parameters, +it is a powerful concept. + +e.g. + +cat /proc/sys/net/ipv4/ip_forward +On my machine outputs +0 +telling me ip_forwarding is not on to switch it on I can do +echo 1 > /proc/sys/net/ipv4/ip_forward +cat it again +cat /proc/sys/net/ipv4/ip_forward +On my machine now outputs +1 +IP forwarding is on. +There is a lot of useful info in here best found by going in & having a look around, +so I'll take you through some entries I consider important. + +All the processes running on the machine have there own entry defined by +/proc/ +So lets have a look at the init process +cd /proc/1 + +cat cmdline +emits +init [2] + +cd /proc/1/fd +This contains numerical entries of all the open files, +some of these you can cat e.g. stdout (2) + +cat /proc/29/maps +on my machine emits + +00400000-00478000 r-xp 00000000 5f:00 4103 /bin/bash +00478000-0047e000 rw-p 00077000 5f:00 4103 /bin/bash +0047e000-00492000 rwxp 00000000 00:00 0 +40000000-40015000 r-xp 00000000 5f:00 14382 /lib/ld-2.1.2.so +40015000-40016000 rw-p 00014000 5f:00 14382 /lib/ld-2.1.2.so +40016000-40017000 rwxp 00000000 00:00 0 +40017000-40018000 rw-p 00000000 00:00 0 +40018000-4001b000 r-xp 00000000 5f:00 14435 /lib/libtermcap.so.2.0.8 +4001b000-4001c000 rw-p 00002000 5f:00 14435 /lib/libtermcap.so.2.0.8 +4001c000-4010d000 r-xp 00000000 5f:00 14387 /lib/libc-2.1.2.so +4010d000-40111000 rw-p 000f0000 5f:00 14387 /lib/libc-2.1.2.so +40111000-40114000 rw-p 00000000 00:00 0 +40114000-4011e000 r-xp 00000000 5f:00 14408 /lib/libnss_files-2.1.2.so +4011e000-4011f000 rw-p 00009000 5f:00 14408 /lib/libnss_files-2.1.2.so +7fffd000-80000000 rwxp ffffe000 00:00 0 + + +Showing us the shared libraries init uses where they are in memory +& memory access permissions for each virtual memory area. + +/proc/1/cwd is a softlink to the current working directory. +/proc/1/root is the root of the filesystem for this process. + +/proc/1/mem is the current running processes memory which you +can read & write to like a file. +strace uses this sometimes as it is a bit faster than the +rather inefficent ptrace interface for peeking at DATA. + + +cat status + +Name: init +State: S (sleeping) +Pid: 1 +PPid: 0 +Uid: 0 0 0 0 +Gid: 0 0 0 0 +Groups: +VmSize: 408 kB +VmLck: 0 kB +VmRSS: 208 kB +VmData: 24 kB +VmStk: 8 kB +VmExe: 368 kB +VmLib: 0 kB +SigPnd: 0000000000000000 +SigBlk: 0000000000000000 +SigIgn: 7fffffffd7f0d8fc +SigCgt: 00000000280b2603 +CapInh: 00000000fffffeff +CapPrm: 00000000ffffffff +CapEff: 00000000fffffeff + +User PSW: 070de000 80414146 +task: 004b6000 tss: 004b62d8 ksp: 004b7ca8 pt_regs: 004b7f68 +User GPRS: +00000400 00000000 0000000b 7ffffa90 +00000000 00000000 00000000 0045d9f4 +0045cafc 7ffffa90 7fffff18 0045cb08 +00010400 804039e8 80403af8 7ffff8b0 +User ACRS: +00000000 00000000 00000000 00000000 +00000001 00000000 00000000 00000000 +00000000 00000000 00000000 00000000 +00000000 00000000 00000000 00000000 +Kernel BackChain CallChain BackChain CallChain + 004b7ca8 8002bd0c 004b7d18 8002b92c + 004b7db8 8005cd50 004b7e38 8005d12a + 004b7f08 80019114 +Showing among other things memory usage & status of some signals & +the processes'es registers from the kernel task_structure +as well as a backchain which may be useful if a process crashes +in the kernel for some unknown reason. + +Some driver debugging techniques +================================ +debug feature +------------- +Some of our drivers now support a "debug feature" in +/proc/s390dbf see s390dbf.txt in the linux/Documentation directory +for more info. +e.g. +to switch on the lcs "debug feature" +echo 5 > /proc/s390dbf/lcs/level +& then after the error occured. +cat /proc/s390dbf/lcs/sprintf >/logfile +the logfile now contains some information which may help +tech support resolve a problem in the field. + + + +high level debugging network drivers +------------------------------------ +ifconfig is a quite useful command +it gives the current state of network drivers. + +If you suspect your network device driver is dead +one way to check is type +ifconfig +e.g. tr0 +You should see something like +tr0 Link encap:16/4 Mbps Token Ring (New) HWaddr 00:04:AC:20:8E:48 + inet addr:9.164.185.132 Bcast:9.164.191.255 Mask:255.255.224.0 + UP BROADCAST RUNNING MULTICAST MTU:2000 Metric:1 + RX packets:246134 errors:0 dropped:0 overruns:0 frame:0 + TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:100 + +if the device doesn't say up +try +/etc/rc.d/init.d/network start +( this starts the network stack & hopefully calls ifconfig tr0 up ). +ifconfig looks at the output of /proc/net/dev & presents it in a more presentable form +Now ping the device from a machine in the same subnet. +if the RX packets count & TX packets counts don't increment you probably +have problems. +next +cat /proc/net/arp +Do you see any hardware addresses in the cache if not you may have problems. +Next try +ping -c 5 i.e. the Bcast field above in the output of +ifconfig. Do you see any replies from machines other than the local machine +if not you may have problems. also if the TX packets count in ifconfig +hasn't incremented either you have serious problems in your driver +(e.g. the txbusy field of the network device being stuck on ) +or you may have multiple network devices connected. + + +chandev +------- +There is a new device layer for channel devices, some +drivers e.g. lcs are registered with this layer. +If the device uses the channel device layer you'll be +able to find what interupts it uses & the current state +of the device. +See the manpage chandev.8 &type cat /proc/chandev for more info. + + + +Starting points for debugging scripting languages etc. +====================================================== + +bash/sh + +bash -x +e.g. bash -x /usr/bin/bashbug +displays the following lines as it executes them. ++ MACHINE=i586 ++ OS=linux-gnu ++ CC=gcc ++ CFLAGS= -DPROGRAM='bash' -DHOSTTYPE='i586' -DOSTYPE='linux-gnu' -DMACHTYPE='i586-pc-linux-gnu' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./lib -O2 -pipe ++ RELEASE=2.01 ++ PATCHLEVEL=1 ++ RELSTATUS=release ++ MACHTYPE=i586-pc-linux-gnu + +perl -d runs the perlscript in a fully intercative debugger +. +Type 'h' in the debugger for help. + +for debugging java type +jdb another fully interactive gdb style debugger. +& type ? in the debugger for help. + + + +SysRq +===== +This is now supported by linux for s/390 & z/Architecture. +To enable it do compile the kernel with +Kernel Hacking -> Magic SysRq Key Enabled +echo "1" > /proc/sys/kernel/sysrq. +On 390 all commands are prefixed with +^- +e.g. +^-t will show tasks. +^-? or some unknown command will display help. +The sysrq key reading is very picky ( I have to type the keys in an + xterm session & paste them into the x3270 console ) +& it may be wise to predefine the keys as described in the VM hints above + +This is particularly useful for syncing disks unmounting & rebooting +if the machine gets partially hung. + +Read Documentation/sysrq.txt for more info + +References: +=========== +Enterprise Systems Architecture Reference Summary +Enterprise Systems Architecture Principles of Operation +Hartmut Penners s390 stack frame sheet. +IBM Mainframe Channel Attachment a technology brief from a CISCO webpage +Various bits of man & info pages of Linux. +Linux & GDB source. +Various info & man pages. +CMS Help on tracing commands. +Linux for s/390 Elf Application Binary Interface +Linux for z/Series Elf Application Binary Interface ( Both Highly Recommended ) +z/Architecture Principles of Operation SA22-7832-00 +Enterprise Systems Architecture/390 Reference Summary SA22-7209-01 & the +Enterprise Systems Architecture/390 Principles of Operation SA22-7201-05 + +Special Thanks +============== +Special thanks to Neale Ferguson who maintains a much +prettier HTML version of this page at +http://penguinvm.princeton.edu/notes.html#Debug390 + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/s390/TAPE linux.20p9/Documentation/s390/TAPE --- linux.vanilla/Documentation/s390/TAPE Thu Jan 1 01:00:00 1970 +++ linux.20p9/Documentation/s390/TAPE Wed Aug 8 22:14:09 2001 @@ -0,0 +1,122 @@ +Channel attached Tape device driver + +-----------------------------WARNING----------------------------------------- +This driver is considered to be EXPERIMENTAL. Do NOT use it in +production environments. Feel free to test it and report problems back to us. +----------------------------------------------------------------------------- + +The LINUX for zSeries tape device driver manages channel attached tape drives +which are compatible to IBM 3480 or IBM 3490 magnetic tape subsystems. This +includes various models of these devices (for example the 3490E). + + +Tape driver features + +The device driver supports a maximum of 128 tape devices. +No official LINUX device major number is assigned to the zSeries tape device +driver. It allocates major numbers dynamically and reports them on system +startup. +Typically it will get major number 254 for both the character device front-end +and the block device front-end. + +The tape device driver needs no kernel parameters. All supported devices +present are detected on driver initialization at system startup or module load. +The devices detected are ordered by their subchannel numbers. The device with +the lowest subchannel number becomes device 0, the next one will be device 1 +and so on. + + +Tape character device front-end + +The usual way to read or write to the tape device is through the character +device front-end. The zSeries tape device driver provides two character devices +for each physical device -- the first of these will rewind automatically when +it is closed, the second will not rewind automatically. + +The character device nodes are named /dev/rtibm0 (rewinding) and /dev/ntibm0 +(non-rewinding) for the first device, /dev/rtibm1 and /dev/ntibm1 for the +second, and so on. + +The character device front-end can be used as any other LINUX tape device. You +can write to it and read from it using LINUX facilities such as GNU tar. The +tool mt can be used to perform control operations, such as rewinding the tape +or skipping a file. + +Most LINUX tape software should work with either tape character device. + + +Tape block device front-end + +The tape device may also be accessed as a block device in read-only mode. +This could be used for software installation in the same way as it is used with +other operation systems on the zSeries platform (and most LINUX +distributions are shipped on compact disk using ISO9660 filesystems). + +One block device node is provided for each physical device. These are named +/dev/btibm0 for the first device, /dev/btibm1 for the second and so on. +You should only use the ISO9660 filesystem on LINUX for zSeries tapes because +the physical tape devices cannot perform fast seeks and the ISO9660 system is +optimized for this situation. + + +Tape block device example + +In this example a tape with an ISO9660 filesystem is created using the first +tape device. ISO9660 filesystem support must be built into your system kernel +for this. +The mt command is used to issue tape commands and the mkisofs command to +create an ISO9660 filesystem: + +- create a LINUX directory (somedir) with the contents of the filesystem + mkdir somedir + cp contents somedir + +- insert a tape + +- ensure the tape is at the beginning + mt -f /dev/ntibm0 rewind + +- set the blocksize of the character driver. The blocksize 2048 bytes + is commonly used on ISO9660 CD-Roms + mt -f /dev/ntibm0 setblk 2048 + +- write the filesystem to the character device driver + mkisofs -o /dev/ntibm0 somedir + +- rewind the tape again + mt -f /dev/ntibm0 rewind + +- Now you can mount your new filesystem as a block device: + mount -t iso9660 -o ro,block=2048 /dev/btibm0 /mnt + +TODO List + + - Driver has to be stabelized still + +BUGS + +This driver is considered BETA, which means some weaknesses may still +be in it. +If an error occurs which cannot be handled by the code you will get a +sense-data dump.In that case please do the following: + +1. set the tape driver debug level to maximum: + echo 6 >/proc/s390dbf/tape/level + +2. re-perform the actions which produced the bug. (Hopefully the bug will + reappear.) + +3. get a snapshot from the debug-feature: + cat /proc/s390dbf/tape/hex_ascii >somefile + +4. Now put the snapshot together with a detailed description of the situation + that led to the bug: + - Which tool did you use? + - Which hardware do you have? + - Was your tape unit online? + - Is it a shared tape unit? + +5. Send an email with your bug report to: + mailto:Linux390@de.ibm.com + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/s390/cds.txt linux.20p9/Documentation/s390/cds.txt --- linux.vanilla/Documentation/s390/cds.txt Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/s390/cds.txt Wed Jul 4 16:03:53 2001 @@ -317,7 +317,7 @@ 0 - successful completion -ENODEV - irq doesn't specify a valid subchannel number -EINVAL - an invalid parameter was detected --EBUSY - an irrecoverable I/O error occured or the device is not +-EBUSY - an irrecoverable I/O error occurred or the device is not operational. Usage Notes : @@ -549,7 +549,7 @@ typedef struct { char cmd_code; /* command code */ - char flags; /* flags, like IDA adressing, etc. */ + char flags; /* flags, like IDA addressing, etc. */ unsigned short count; /* byte count */ void *cda; /* data address */ } ccw1_t __attribute__ ((aligned(8))); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/s390/s390dump.txt linux.20p9/Documentation/s390/s390dump.txt --- linux.vanilla/Documentation/s390/s390dump.txt Thu Jan 1 01:00:00 1970 +++ linux.20p9/Documentation/s390/s390dump.txt Wed Aug 8 22:14:04 2001 @@ -0,0 +1,177 @@ +L/390 stand alone dump tools for Linux 2.2.x + +-----------------------------WARNING----------------------------------------- +This driver is considered to be EXPERIMENTAL. Do NOT use it in +production environments. Feel free to test it and report problems back to us. +----------------------------------------------------------------------------- + +1. Overview + +Two stand alone dump tools are provided for generating system memory dumps +on dasd volumes and tapes: dumpeckd.boot and dumptape.boot +respectively. The tools should be installed on the device which will +be used for dumping the system memory; We shall refer to this device as +dump device. A system memory dump can be initiated by the operator +at any time. Normally this should be done after a system crash. +In order to take a dump an ipl of the dump device is required. +This is destructive which means that the actual running Linux Operating +System will be killed. +The ipl process then writes the system memory to the ipl device (either tape +or dasd). + + +2. Build the dump utilities + +The dump tools are compiled with the Kernel: +> make menuconfig +> make dep +> make image + +Then under linux/arch/s390/boot the following two files are built: +- dumpeckd.boot +- dumptape.boot + + + +3. Install the Dump utilities + +Make sure that there is enough space (memory-size + 1MB) on your dump device +to hold all your system memory. + +3.1 Install DASD dump utility + +You have to have an unused dasd partition for dumping. The dump utility is +installed there and dumps are written afterwards to this dasd. This is how +to install the dump tool on dasd: + + 1. Format dasd with 4K blocksize: + > dasdfmt -f /dev/dasdx -b 4096 + + 2. Copy dump utility to dasd (e.g. /dev/dasdx) by issuing the following + two commands: + > dd if=dumpeckd.boot of=/dev/dasdx + > sync + +3.2 Install tape dump utility + + 1. Insert empty dump cartridge into your tapedevice (e.g. /dev/ntibm0). + 2. Ensure the tape is rewound (e.g mt -f /dev/ntibm0 rewind) + 3. Copy dump utility to tape: + > dd if=/boot/dumptape.boot of=/dev/ntibm0 bs=4096 + + + +4. Taking the dump + +The operator has to do the following tasks in order to take a dump: + - Ensure that tape is rewound (if using tapedump.boot) + - Stop all cpus (only under VM) + - Store status on ipl cpu + - IPL the dump tool on ipl cpu + +The dump process can take several minutes, depending on the devicetype you are +using and the amount of your system memory. +After the dump has completed, the ipl CPU should go into disabled wait. + +The following PSW indicates that the dump has been taken successfully: + +PSW: 000A0000 00000000 + +Any other disabled wait PSW indicates an error. + +On VM (a three processor machine in this example) this could look like the +following: + + #cp cpu all stop + #cp store status + #cp I 193 (if 193 is the dump device) + 01: The virtual machine is placed in CP mode due to a SIGP stop from CPU 00. + 02: The virtual machine is placed in CP mode due to a SIGP stop from CPU 00. + "CP entered; disabled wait PSW 000A0000 00000000" + #cp I 192 (the linux dasd) + +When initiating the dump process e.g. from a service element check the +"Store Status" checkbox of the ipl panel. + +For detailed information on the actual steps to be performed please consult the +appropriate manual of your processor. + + + +5. Copying the dump to a filesystem + +After the dump has been created by one of the dump utilities the dump should +normally be copied over to a filesystem in order to send it e.g. +to a service organization for analysis. + +To copy the dump to a filesystem, you can use command dd as illustrated below: + +5.1 Dasd: + +Copying the dump from dasd to a filesystem is only necessary, if the dump +cannot be analyzed locally on the system, but must be e.g. sent to the service +organization. + +- Copy the dump from raw dasd to filesystem (e.g. Dump dasd is /dev/dasdx): + + > dd if=/dev/dasdx1 of=/DUMPDIR/mydump bs=1M \ + count= + + or if you want to compress the dump: + + > dd if=/dev/dasdx1 bs=1M count= | bzip2 \ + > /DUMPDIR/dump.bz2 + +5.2 Tape: + + 1. Rewind the tape: + + > mt -f /dev/ntibm0 rewind + + 2. Skip first file on tape (first file is the dump utility itself): + + > mt -f /dev/ntibm0 fsf + + 3. Copy dump from tape to filesystem: + + > dd if=/dev/ntibm0 of=/DUMPDIR/mydump bs=32k + + or if you want to compress the dump: + + > dd if=/dev/ntibm0 bs=32k | bzip2 > /DUMPDIR/mydump.bz2 + +Note: mt is a tape utility which has be be installed first. You can use +any other available tape tool to skip the first file. + +6. Analyzing the dumps + +The dump analysis tool 'lcrash' can be used to analyze the generated dumps. +The required version of the lkcdutilities is 3.1.2 +(see ftp://oss.sgi.com/projects/lkcd/download/3.1.2/lkcdutils/) + +lcrash gets three input files: +- System.map of the crashed kernel +- the dump +- Kerntypes file of the crashed kernel with Kernel type information + There is provided a patch for the Kerntypes file under + http://oss.software.ibm.com/developerworks/opensource/linux390 + +Call lcrash: +> lcrash System.map mydump Kerntypes + +Note: If you used dumpeckd.boot to take the dump it is possible to specify +the /dev/dasdx1 dump device directly as input file to lcrash instead of +a copy in the filesystem: +> lcrash System.map /dev/dasdx1 Kerntypes + +7. Supported Devices + +The dump tools should work with the following devices: + +- ECKD Dasds: + + 3380 + + 3390 + +- Tape units: + + 3480 + + 3490 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/usb/usb-serial.txt linux.20p9/Documentation/usb/usb-serial.txt --- linux.vanilla/Documentation/usb/usb-serial.txt Sun Mar 25 17:37:29 2001 +++ linux.20p9/Documentation/usb/usb-serial.txt Wed Aug 8 22:24:06 2001 @@ -73,6 +73,11 @@ the port to use for the HotSync transfer. The "Generic" port can be used for other device communication, such as a PPP link. + If after pressing the sync button, nothing shows up in the system log, + try resetting the Visor, first a hot reset, and then a cold reset if + necessary. Some Visors need this before they can talk to the USB port + properly. + There is a webpage and mailing lists for this portion of the driver at: http://usbvisor.sourceforge.net/ @@ -103,22 +108,22 @@ Keyspan USA-series Serial Adapters - Single and Dual port adapters - driver uses Keyspan supplied + Single, Dual and Quad port adapters - driver uses Keyspan supplied firmware and is being developed with their support. - Driver isn't as far advanced as Keyspan PDA driver mentioned above. - Current status: - Things that work: - Firmware upload for USA-18X, USA-28, USA-28X, USA-19 and USA-19W - Simple character I/O fixed at 9600 baud on USA-19 only - - Things that don't: - Everything else. (for now...) + The USA-18X, USA-28X, USA-19, USA-19W and USA-49W are supported and + have been pretty throughly tested at various baud rates with 8-N-1 + character settings. Other character lengths and parity setups are + presently untested. + + The USA-28 isn't yet supported though doing so should be pretty + straightforward. Contact the maintainer if you require this + functionality. + + More information is available at: + http://www.linuxcare.com.au/hugh/keyspan.html - Big Things on the todo list: - Driver is in infancy, much functionality remains to be added - FTDI Single Port Serial Driver @@ -139,8 +144,8 @@ (plus a parallel port) and 4 port USB serial converters. The driver does NOT yet support the Digi AccelePort USB 8. - This driver works under SMP with the usb-uhci driver. It does not work - under SMP with the uhci driver. + This driver works under SMP with the usb-uhci driver. It does not + work under SMP with the uhci driver. The driver is generally working, though we still have a few more ioctls to implement and final testing and debugging to do. The paralled port @@ -157,6 +162,7 @@ Belkin USB Serial Adapter F5U103 Single port DB-9/PS-2 serial adapter from Belkin with firmware by eTEK Labs. + The Peracom single port serial adapter also works with this driver. Current status: The following have been tested and work: @@ -190,10 +196,55 @@ This is an experimental driver to provide connectivity support for the client synchronization tools for an Empeg empeg-car mp3 player. + Tips: + + * Don't forget to create the device nodes for ttyUSB{0,1,2,...} + * modprobe empeg (modprobe is your friend) + * emptool --usb /dev/ttyUSB0 (or whatever you named your device node) + The driver is still pretty new, so some testing 'in the wild' would be helpful. :) +MCT USB Single Port Serial Adapter U232 + + This driver is for the MCT USB-RS232 Converter (25 pin, Model No. + U232-P25) from Magic Control Technology Corp. (there is also a 9 pin + Model No. U232-P9). More information about this device can be found + at the manufacture's web-site: http://www.mct.com.tw. + + The driver is generally working, though it still needs some more + testing. It is derived from the Belkin USB Serial Adapter F5U103 + driver and its TODO list is valid for this driver as well. + + This driver has also been found to work for other products, which have + the same Vendor ID but different Product IDs. Sitecom's U232-P25 + serial converter uses Product ID 0x230 and Vendor ID 0x711 and works with + this driver. Also, D-Link's DU-H3SP USB BAY also works with this driver. + + +Inside Out Networks Edgeport Driver + + This driver supports all devices made by Inside Out Networks, specifically + the following models: + Edgeport/4 + Rapidport/4 + Edgeport/4t + Edgeport/2 + Edgeport/4i + Edgeport/2i + Edgeport/421 + Edgeport/21 + Edgeport/8 + Edgeport/8 Dual + Edgeport/2D8 + Edgeport/4D8 + Edgeport/8i + Edgeport/2 DIN + Edgeport/4 DIN + Edgeport/16 Dual + + Generic Serial driver If your device is not one of the above listed devices, compatible with @@ -205,7 +256,7 @@ To enable the generic driver to recognize your device, build the driver as a module and load it by the following invocation: - insmod usb-serial vendor=0x#### product=0x#### + insmod usbserial vendor=0x#### product=0x#### where the #### is replaced with the hex representation of your device's vendor id and product id. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Documentation/video4linux/API.html linux.20p9/Documentation/video4linux/API.html --- linux.vanilla/Documentation/video4linux/API.html Sun Mar 25 17:31:59 2001 +++ linux.20p9/Documentation/video4linux/API.html Wed Jul 4 16:03:53 2001 @@ -362,7 +362,7 @@ First OctetLeast Siginificant Byte of RDS Block Second OctetMost Siginificant Byte of RDS Block Third OctetBit 7:Error bit. Indicates that -an uncorrectable error occured during reception of this block. +an uncorrectable error occurred during reception of this block.  Bit 6:Corrected bit. Indicates that an error was corrected for this data block.  Bits 5-3:Reeived Offset. Indicates the diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/MAINTAINERS linux.20p9/MAINTAINERS --- linux.vanilla/MAINTAINERS Sun Mar 25 17:37:29 2001 +++ linux.20p9/MAINTAINERS Wed Aug 8 22:21:15 2001 @@ -211,7 +211,8 @@ CONFIGURE, MENUCONFIG, XCONFIG P: Michael Elizabeth Chastain M: mec@shout.net -L: linux-kbuild@torque.net +L: kbuild-devel@lists.sourceforge.net +W: http://kbuild.sourceforge.net S: Maintained CONFIGURE.HELP @@ -242,8 +243,8 @@ S: Supported CYCLADES PC300 DRIVER -P: Ivan Passos -M: ivan@cyclades.com +P: Daniela Squassoni +M: daniela@cyclades.com W: http://www.cyclades.com/ S: Supported @@ -532,17 +533,13 @@ W: http://www.cs.uit.no/linux-irda/ S: Maintained -ISDN SUBSYSTEM (general) -P: Fritz Elfert -M: fritz@isdn4linux.de -L: isdn4linux@listserv.isdn4linux.de -W: www.isdn4linux.de -S: Maintained - -ISDN SUBSYSTEM (HiSax) +ISDN SUBSYSTEM P: Karsten Keil -M: keil@isdn4linux.de +M: kkeil@suse.de +P: Kai Germaschewski +M: kai.germaschewski@gmx.de L: isdn4linux@listserv.isdn4linux.de +W: http://www.isdn4linux.de S: Maintained ISDN SUBSYSTEM (Eicon active card driver) @@ -764,13 +761,13 @@ P: Phil Blundell M: Philip.Blundell@pobox.com P: Tim Waugh -M: tim@cyberelk.demon.co.uk +M: tim@cyberelk.net P: David Campbell M: campbell@torque.net P: Andrea Arcangeli M: andrea@e-mind.com L: linux-parport@torque.net -W: http://www.cyberelk.demon.co.uk/parport.html +W: http://people.redhat.com/twaugh/parport/ S: Maintained PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Makefile linux.20p9/Makefile --- linux.vanilla/Makefile Sun Mar 25 17:39:55 2001 +++ linux.20p9/Makefile Wed Aug 8 23:26:59 2001 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 -SUBLEVEL = 19 -EXTRAVERSION = +SUBLEVEL = 20 +EXTRAVERSION = pre9 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) @@ -200,6 +200,10 @@ ifeq ($(CONFIG_USB),y) DRIVERS := $(DRIVERS) drivers/usb/usbdrv.o +else + ifdef CONFIG_INPUT_ADBHID + DRIVERS := $(DRIVERS) drivers/usb/usbdrv.o + endif endif ifeq ($(CONFIG_I2O),y) @@ -423,7 +427,8 @@ rm -rf modules distclean: mrproper - rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ + rm -f core `find . \( -not -type d \) -and \ + \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/entry.S linux.20p9/arch/alpha/kernel/entry.S --- linux.vanilla/arch/alpha/kernel/entry.S Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/alpha/kernel/entry.S Wed Jul 4 16:03:53 2001 @@ -32,11 +32,12 @@ #define TASK_ADDR_LIMIT 24 #define TASK_EXEC_DOMAIN 32 #define TASK_NEED_RESCHED 40 +#define TASK_PTRACE 48 /* * task flags (must match include/linux/sched.h): */ -#define PF_PTRACED 0x00000010 +#define PT_PTRACED 0x00000001 /* * This defines the normal kernel pt-regs layout. @@ -558,7 +559,7 @@ ldq $3,TASK_FLAGS($8) stq $17,SP_OFF+32($30) s8addq $0,$5,$5 - and $3,PF_PTRACED,$3 + and $3,PT_PTRACED,$3 stq $18,SP_OFF+40($30) bne $3,strace beq $4,1f diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/ptrace.c linux.20p9/arch/alpha/kernel/ptrace.c --- linux.vanilla/arch/alpha/kernel/ptrace.c Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/alpha/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -527,10 +527,10 @@ ret = -EPERM; if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -553,9 +553,9 @@ && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; if (child->p_pptr != current) { REMOVE_LINKS(child); child->p_pptr = current; @@ -566,7 +566,7 @@ goto out; } ret = -ESRCH; - if (!(child->flags & PF_PTRACED)) { + if (!(child->ptrace & PT_PTRACED)) { DBG(DBG_MEM, ("child not traced\n")); goto out; } @@ -622,9 +622,9 @@ if ((unsigned long) data > _NSIG) goto out; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; wake_up_process(child); /* make sure single-step breakpoint is gone. */ @@ -652,7 +652,7 @@ if ((unsigned long) data > _NSIG) goto out; child->tss.bpt_nsaved = -1; /* mark single-stepping */ - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; wake_up_process(child); child->exit_code = data; /* give it a chance to run. */ @@ -663,7 +663,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); wake_up_process(child); child->exit_code = data; REMOVE_LINKS(child); @@ -686,8 +686,8 @@ asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/signal.c linux.20p9/arch/alpha/kernel/signal.c --- linux.vanilla/arch/alpha/kernel/signal.c Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/alpha/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -621,7 +621,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -692,12 +692,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/sys_alcor.c linux.20p9/arch/alpha/kernel/sys_alcor.c --- linux.vanilla/arch/alpha/kernel/sys_alcor.c Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/alpha/kernel/sys_alcor.c Wed Jul 4 16:03:53 2001 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -186,13 +187,21 @@ static void alcor_kill_arch (int mode, char *reboot_cmd) { - /* Who said DEC engineer's have no sense of humor? ;-) */ - if (alpha_using_srm) { - *(vuip) GRU_RESET = 0x0000dead; - mb(); + switch(mode) { + case LINUX_REBOOT_CMD_RESTART: + /* Who said DEC engineer's have no sense of humor? ;-) */ + if (alpha_using_srm) { + *(vuip) GRU_RESET = 0x0000dead; + mb(); + } + break; + case LINUX_REBOOT_CMD_HALT: + break; + case LINUX_REBOOT_CMD_POWER_OFF: + break; } - generic_kill_arch(mode, reboot_cmd); + halt(); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/sys_miata.c linux.20p9/arch/alpha/kernel/sys_miata.c --- linux.vanilla/arch/alpha/kernel/sys_miata.c Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/alpha/kernel/sys_miata.c Wed Jul 4 16:03:53 2001 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -274,12 +275,22 @@ static void miata_kill_arch (int mode, char *reboot_cmd) { - /* Who said DEC engineers have no sense of humor? ;-) */ - if (alpha_using_srm) { - *(vuip) PYXIS_RESET = 0x0000dead; - mb(); - } - generic_kill_arch(mode, reboot_cmd); + switch(mode) { + case LINUX_REBOOT_CMD_HALT: + break; + case LINUX_REBOOT_CMD_RESTART: + /* Who said DEC engineers have no sense of humor? ;-) */ + if (alpha_using_srm) { + *(vuip) PYXIS_RESET = 0x0000dead; + mb(); + } + generic_kill_arch(mode, reboot_cmd); + break; + case LINUX_REBOOT_CMD_POWER_OFF: + break; + } + + halt(); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/traps.c linux.20p9/arch/alpha/kernel/traps.c --- linux.vanilla/arch/alpha/kernel/traps.c Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/alpha/kernel/traps.c Thu Jul 26 15:58:15 2001 @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "proto.h" @@ -98,6 +100,30 @@ static alist * int_name[] = {inta_name, intl_name, ints_name, intm_name}; +static int opDEC_testing = 0; +static int opDEC_fix = 0; +static unsigned long opDEC_test_pc = 0; + +static void +opDEC_check(void) +{ + unsigned long test_pc; + + lock_kernel(); + opDEC_testing = 1; + + __asm__ __volatile__( + " br %0,1f\n" + "1: addq %0,8,%0\n" + " stq %0,%1\n" + " cvttq/svm $f31,$f31\n" + : "=&r"(test_pc), "=m"(opDEC_test_pc) + : ); + + opDEC_testing = 0; + unlock_kernel(); +} + static char * assoc(int fcode, alist * a) { @@ -358,7 +384,9 @@ unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, struct pt_regs regs) { - die_if_kernel("Instruction fault", ®s, type, 0); + if (!opDEC_testing || type != 4) { + die_if_kernel("Instruction fault", ®s, type, 0); + } switch (type) { case 0: /* breakpoint */ if (ptrace_cancel_bpt(current)) { @@ -414,6 +442,22 @@ case 4: /* opDEC */ if (implver() == IMPLVER_EV4) { + /* The some versions of SRM do not handle + the opDEC properly - they return the PC of the + opDEC fault, not the instruction after as the + Alpha architecture requires. Here we fix it up. + We do this by intentionally causing an opDEC + fault during the boot sequence and testing if + we get the correct PC. If not, we set a flag + to correct it every time through. + */ + if (opDEC_testing && regs.pc == opDEC_test_pc) { + opDEC_fix = 4; + printk("opDEC fixup enabled.\n"); + } + + regs.pc += opDEC_fix; + /* EV4 does not implement anything except normal rounding. Everything else will come here as an illegal instruction. Emulate them. */ @@ -1105,4 +1149,11 @@ wrent(entUna, 4); wrent(entSys, 5); wrent(entDbg, 6); + + /* Hack for Multia (UDB) and JENSEN: some of their SRMs have + * a bug in the handling of the opDEC fault. Fix it up. + */ + if (implver() == IMPLVER_EV4) { + opDEC_check(); + } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/arm/kernel/ptrace.c linux.20p9/arch/arm/kernel/ptrace.c --- linux.vanilla/arch/arm/kernel/ptrace.c Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/arm/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -662,9 +662,9 @@ if ((unsigned long) data > _NSIG) break; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* make sure single-step breakpoint is gone. */ ptrace_cancel_bpt(child); @@ -697,7 +697,7 @@ if ((unsigned long) data > _NSIG) break; child->tss.debug.nsaved = -1; - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* give it a chance to run. */ wake_up_process(child); @@ -711,7 +711,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) break; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; REMOVE_LINKS(child); child->p_pptr = child->p_opptr; @@ -799,10 +799,10 @@ ret = -EPERM; if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -826,9 +826,9 @@ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; if (child->p_pptr != current) { REMOVE_LINKS(child); @@ -841,7 +841,7 @@ goto out; } ret = -ESRCH; - if (!(child->flags & PF_PTRACED)) + if (!(child->ptrace & PT_PTRACED)) goto out; if (child->state != TASK_STOPPED && request != PTRACE_KILL) goto out; @@ -857,8 +857,8 @@ asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/arm/kernel/signal.c linux.20p9/arch/arm/kernel/signal.c --- linux.vanilla/arch/arm/kernel/signal.c Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/arm/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -474,7 +474,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -544,12 +544,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/compressed/head.S linux.20p9/arch/i386/boot/compressed/head.S --- linux.vanilla/arch/i386/boot/compressed/head.S Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/boot/compressed/head.S Wed Jul 4 16:03:53 2001 @@ -65,6 +65,7 @@ movl %eax,0x000000 # loop forever if it isn't cmpl %eax,0x100000 je 1b + /* * Initialize eflags. Some BIOS's leave bits like NT set. This would * confuse the debugger if this code is traced. @@ -86,10 +87,14 @@ * Do the decompression, and jump to the new kernel.. */ subl $16,%esp # place for structure on the stack - pushl %esp # address of structure as first arg + movl %esp,%eax + pushl %esi # real mode pointer as second arg + pushl %eax # address of structure as first arg call SYMBOL_NAME(decompress_kernel) orl %eax,%eax jnz 3f + popl %esi # discard address + popl %esi # real mode pointer xorl %ebx,%ebx ljmp $(__KERNEL_CS), $0x100000 @@ -104,11 +109,14 @@ movl $0x1000,%edi movl $move_routine_end,%ecx subl %esi,%ecx + addl $3,%ecx + shrl $2,%ecx cld rep - movsb + movsl popl %esi # discard the address + popl %ebx # real mode pointer popl %esi # low_buffer_start popl %ecx # lcount popl %edx # high_buffer_start @@ -122,18 +130,21 @@ * if we were high loaded. This _must_ PIC-code ! */ move_routine_start: + movl %ecx,%ebp + shrl $2,%ecx + rep + movsl + movl %ebp,%ecx + andl $3,%ecx rep movsb movl %edx,%esi movl %eax,%ecx # NOTE: rep movsb won't move if %ecx == 0 + addl $3,%ecx + shrl $2,%ecx rep - movsb + movsl + movl %ebx,%esi # Restore setup pointer xorl %ebx,%ebx -/* - * Well, the kernel relies on %esp pointing into low mem, - * with the decompressor loaded high this is no longer true, - * so we set esp here. - */ - mov $0x90000,%esp ljmp $(__KERNEL_CS), $0x100000 move_routine_end: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/compressed/misc.c linux.20p9/arch/i386/boot/compressed/misc.c --- linux.vanilla/arch/i386/boot/compressed/misc.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/boot/compressed/misc.c Wed Jul 4 16:03:53 2001 @@ -74,11 +74,13 @@ /* * This is set up by the setup-routine at boot-time */ -#define EXT_MEM_K (*(unsigned short *)0x90002) +static unsigned char *real_mode; /* Pointer to real-mode data */ + +#define EXT_MEM_K (*(unsigned short *)(real_mode + 0x2)) #ifndef STANDARD_MEMORY_BIOS_CALL -#define ALT_MEM_K (*(unsigned long *) 0x901e0) +#define ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0)) #endif -#define SCREEN_INFO (*(struct screen_info *)0x90000) +#define SCREEN_INFO (*(struct screen_info *)(real_mode+0)) extern char input_data[]; extern int input_len; @@ -98,13 +100,13 @@ extern int end; static long free_mem_ptr = (long)&end; -static long free_mem_end_ptr = 0x90000; +static long free_mem_end_ptr; #define INPLACE_MOVE_ROUTINE 0x1000 #define LOW_BUFFER_START 0x2000 -#define LOW_BUFFER_END 0x90000 -#define LOW_BUFFER_SIZE ( LOW_BUFFER_END - LOW_BUFFER_START ) +#define LOW_BUFFER_MAX 0x90000 #define HEAP_SIZE 0x2400 +static unsigned int low_buffer_end, low_buffer_size; static int high_loaded =0; static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/; @@ -255,7 +257,7 @@ in = window; for (n = 0; n < outcnt; n++) { ch = *output_data++ = *in++; - if ((ulg)output_data == LOW_BUFFER_END) output_data=high_buffer_start; + if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start; c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); } crc = c; @@ -311,10 +313,13 @@ if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n"); #endif mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START; + low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX + ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff; + low_buffer_size = low_buffer_end - LOW_BUFFER_START; high_loaded = 1; free_mem_end_ptr = (long)high_buffer_start; - if ( (0x100000 + LOW_BUFFER_SIZE) > ((ulg)high_buffer_start)) { - high_buffer_start = (uch *)(0x100000 + LOW_BUFFER_SIZE); + if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) { + high_buffer_start = (uch *)(0x100000 + low_buffer_size); mv->hcount = 0; /* say: we need not to move high_buffer */ } else mv->hcount = -1; @@ -323,17 +328,21 @@ void close_output_buffer_if_we_run_high(struct moveparams *mv) { - mv->lcount = bytes_out; - if (bytes_out > LOW_BUFFER_SIZE) { - mv->lcount = LOW_BUFFER_SIZE; - if (mv->hcount) mv->hcount = bytes_out - LOW_BUFFER_SIZE; + if (bytes_out > low_buffer_size) { + mv->lcount = low_buffer_size; + if (mv->hcount) + mv->hcount = bytes_out - low_buffer_size; + } else { + mv->lcount = bytes_out; + mv->hcount = 0; } - else mv->hcount = 0; } -int decompress_kernel(struct moveparams *mv) +int decompress_kernel(struct moveparams *mv, void *rmode) { + real_mode = rmode; + if (SCREEN_INFO.orig_video_mode == 7) { vidmem = (char *) 0xb0000; vidport = 0x3b4; @@ -355,4 +364,3 @@ if (high_loaded) close_output_buffer_if_we_run_high(mv); return high_loaded; } - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/setup.S linux.20p9/arch/i386/boot/setup.S --- linux.vanilla/arch/i386/boot/setup.S Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/i386/boot/setup.S Wed Jul 4 16:03:53 2001 @@ -69,7 +69,7 @@ ! SETUP-header, must start at CS:2 (old 0x9020:2) ! .ascii "HdrS" ! Signature for SETUP-header - .word 0x0201 ! Version number of header format + .word 0x0202 ! Version number of header format ! (must be >= 0x0105 ! else old loadlin-1.5 will fail) realmode_swtch: .word 0,0 ! default_switch,SETUPSEG @@ -120,9 +120,28 @@ ramdisk_size: .long 0 ! its size in bytes bootsect_kludge: .word bootsect_helper,SETUPSEG -heap_end_ptr: .word modelist+1024 ! space from here (exclusive) down to - ! end of setup code can be used by setup - ! for local heap purposes. +heap_end_ptr: .word modelist+1024 ! (Header version 0x0201 or later) + ! space from here (exclusive) down to + ! end of setup code can be used by setup + ! for local heap purposes. + +pad1: .word 0 ! Reserved for future use + +cmd_line_ptr: .long 0 ! (Header version 0x0202 or later) + ! If nonzero, a 32-bit pointer + ! to the kernel command line. + ! The command line should be + ! located between the start of + ! setup and the end of low + ! memory (0xa0000), or it may + ! get overwritten before it + ! gets read. If this field is + ! used, there is no longer + ! anything magical about the + ! 0x90000 segment; the setup + ! can be located anywhere in + ! low memory 0x10000 or higher. + ! ------------------------ end of header ---------------------------------- start_of_setup: @@ -534,6 +553,13 @@ mov ax,cs ! aka #SETUPSEG ! right, forgot this at first. didn't work :-) mov ds,ax +! Check whether we need to be downward compatible with version <= 0x0201 + cmp dword ptr [cmd_line_ptr],#0 + jne end_move_self + cmp byte ptr [type_of_loader],#0x20 + je end_move_self + +! Boot loader does not support boot protocol version 2.02. ! If we have our code not at 0x90000, we need to move it there now. ! We also then need to move the parameters behind it (command line) ! Because we would overwrite the code on the current IP, we move @@ -572,9 +598,14 @@ mov ds,ax mov ss,dx ! now we are at the right place -end_move_self: +end_move_self: lidt idt_48 ! load idt with 0,0 + xor eax,eax + mov ax,ds + shl eax,#4 + add eax,#gdt + mov [gdt_48+2],eax lgdt gdt_48 ! load gdt with whatever appropriate ! that was painless, now we enable A20 @@ -679,7 +710,11 @@ jmp flush_instr flush_instr: xor bx,bx ! Flag to indicate a boot - + xor esi,esi ! Pointer to real-mode code + mov si,cs + sub si,#DELTA_INITSEG + shl esi,#4 ! Convert to 32-bit pointer + ! NOTE: For high loaded big kernels we need a ! jmpi 0x100000,__KERNEL_CS ! @@ -873,7 +908,7 @@ gdt_48: .word 0x800 ! gdt limit=2048, 256 GDT entries - .word 512+gdt,0x9 ! gdt base = 0X9xxxx + .word 0, 0 ! gdt base (filled in later) ! ! Include video setup & detection code diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/config.in linux.20p9/arch/i386/config.in --- linux.vanilla/arch/i386/config.in Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/i386/config.in Thu Jul 26 15:41:04 2001 @@ -4,6 +4,8 @@ # mainmenu_name "Linux Kernel Configuration" +define_bool CONFIG_X86 y + mainmenu_option next_comment comment 'Code maturity level options' bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/bluesmoke.c linux.20p9/arch/i386/kernel/bluesmoke.c --- linux.vanilla/arch/i386/kernel/bluesmoke.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/bluesmoke.c Wed Jul 4 16:03:53 2001 @@ -46,6 +46,7 @@ printk(" at %08x%08x", high, low); } + printk("\n"); /* Clear it */ wrmsr(0x401+i*4, 0UL, 0UL); /* Serialize */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/entry.S linux.20p9/arch/i386/kernel/entry.S --- linux.vanilla/arch/i386/kernel/entry.S Sun Mar 25 17:37:29 2001 +++ linux.20p9/arch/i386/kernel/entry.S Wed Jul 4 16:03:53 2001 @@ -76,6 +76,7 @@ addr_limit = 12 exec_domain = 16 need_resched = 20 +ptrace = 24 ENOSYS = 38 @@ -174,7 +175,7 @@ GET_CURRENT(%ebx) cmpl $(NR_syscalls),%eax jae badsys - testb $0x20,flags(%ebx) # PF_TRACESYS + testb $0x02,ptrace(%ebx) # PT_TRACESYS jne tracesys call *SYMBOL_NAME(sys_call_table)(,%eax,4) movl %eax,EAX(%esp) # save the return value diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/head.S linux.20p9/arch/i386/kernel/head.S --- linux.vanilla/arch/i386/kernel/head.S Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/head.S Wed Jul 4 16:03:53 2001 @@ -14,11 +14,11 @@ #include #include - -#define CL_MAGIC_ADDR 0x90020 -#define CL_MAGIC 0xA33F -#define CL_BASE_ADDR 0x90000 -#define CL_OFFSET 0x90022 +#define OLD_CL_MAGIC_ADDR 0x90020 +#define OLD_CL_MAGIC 0xA33F +#define OLD_CL_BASE_ADDR 0x90000 +#define OLD_CL_OFFSET 0x90022 +#define NEW_CL_POINTER 0x228 /* Relative to real mode data */ /* * References to members of the boot_cpu_data structure. @@ -36,6 +36,8 @@ /* * swapper_pg_dir is the main page directory, address 0x00101000 + * + * On entry, %esi points to the real-mode code as a 32-bit pointer. */ ENTRY(stext) ENTRY(_stext) @@ -52,6 +54,9 @@ #ifdef __SMP__ orw %bx,%bx jz 1f +#endif + +#ifdef __SMP__ /* * New page tables may be in 4Mbyte page mode and may * be using the global pages. @@ -89,6 +94,7 @@ jmp checkCPUtype 1: #endif __SMP__ + /* * Clear BSS first so that there are no surprises... */ @@ -99,6 +105,7 @@ cld rep stosb + /* * start system 32-bit setup. We need to re-do some of the things done * in 16-bit mode for the "real" operations. @@ -115,8 +122,9 @@ * Copy bootup parameters out of the way. First 2kB of * _empty_zero_page is for boot parameters, second 2kB * is for the command line. + * + * Note: %esi still has the pointer to the real-mode data. */ - movl $0x90000,%esi movl $ SYMBOL_NAME(empty_zero_page),%edi movl $512,%ecx cld @@ -126,11 +134,15 @@ movl $512,%ecx rep stosl - cmpw $(CL_MAGIC),CL_MAGIC_ADDR + movl SYMBOL_NAME(empty_zero_page)+NEW_CL_POINTER,%esi + andl %esi,%esi + jnz 2f + cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR jne 1f + movzwl OLD_CL_OFFSET,%esi + addl $(OLD_CL_BASE_ADDR),%esi +2: movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi - movzwl CL_OFFSET,%esi - addl $(CL_BASE_ADDR),%esi movl $2048,%ecx rep movsb diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/io_apic.c linux.20p9/arch/i386/kernel/io_apic.c --- linux.vanilla/arch/i386/kernel/io_apic.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/io_apic.c Wed Aug 8 22:16:31 2001 @@ -199,9 +199,9 @@ /* * We disable IO-APIC IRQs by setting their 'destination CPU mask' to * zero. Trick by Ramesh Nalluri. + * Not anymore. This causes problems on some IO-APIC's, notably AMD 760MP's + * So we do it a more 2.4 kind of way now which should be safer -jerdfelt */ -DO_ACTION( disable, 1, &= 0x00ffffff, io_apic_sync(entry->apic))/* destination = 0x00 */ -DO_ACTION( enable, 1, |= 0xff000000, ) /* destination = 0xff */ DO_ACTION( mask, 0, |= 0x00010000, io_apic_sync(entry->apic))/* mask = 1 */ DO_ACTION( unmask, 0, &= 0xfffeffff, ) /* mask = 0 */ @@ -611,8 +611,8 @@ entry.delivery_mode = dest_LowestPrio; entry.dest_mode = 1; /* logical delivery */ - entry.mask = 0; /* enable IRQ */ - entry.dest.logical.logical_dest = 0; /* but no route */ + entry.mask = 1; /* disable IRQ */ + entry.dest.logical.logical_dest = 0xff; idx = find_irq_entry(apic,pin,mp_INT); if (idx == -1) { @@ -931,18 +931,60 @@ panic("could not set ID"); } +static int __init ELCR_trigger(unsigned int irq) +{ + unsigned int port; + + port = 0x4d0 + (irq >> 3); + return (inb(port) >> (irq & 7)) & 1; +} + static void __init construct_default_ISA_mptable(void) { int i, pos = 0; + int ELCR_fallback = 0; const int bus_type = (mpc_default_type == 2 || mpc_default_type == 3 || mpc_default_type == 6) ? MP_BUS_EISA : MP_BUS_ISA; + /* + * If true, we have an ISA/PCI system with no IRQ entries + * in the MP table. To prevent the PCI interrupts from being set up + * incorrectly, we try to use the ELCR. The sanity check to see if + * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can + * never be level sensitive, so we simply see if the ELCR agrees. + * If it does, we assume it's valid. + */ + if (mpc_default_type == 5) { + printk("ISA/PCI bus type with no IRQ information... falling back to ELCR\n"); + + if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || ELCR_trigger(13)) + printk("ELCR contains invalid data... not using ELCR\n"); + else { + printk("Using ELCR to identify PCI interrupts\n"); + ELCR_fallback = 1; + } + } + for (i = 0; i < 16; i++) { if (!IO_APIC_IRQ(i)) continue; mp_irqs[pos].mpc_irqtype = mp_INT; - mp_irqs[pos].mpc_irqflag = 0; /* default */ + + if (ELCR_fallback) { + /* + * If the ELCR indicates a level-sensitive interrupt, we + * copy that information over to the MP table in the + * irqflag field (level sensitive, active high polarity). + */ + if (ELCR_trigger(i)) + mp_irqs[pos].mpc_irqflag = 13; + else + mp_irqs[pos].mpc_irqflag = 0; + } + else + mp_irqs[pos].mpc_irqflag = 0; /* default */ + mp_irqs[pos].mpc_srcbus = 0; mp_irqs[pos].mpc_srcbusirq = i; mp_irqs[pos].mpc_dstapic = 0; @@ -1017,13 +1059,10 @@ static void enable_edge_ioapic_irq(unsigned int irq) { self_IPI(irq); - enable_IO_APIC_irq(irq); + unmask_IO_APIC_irq(irq); } -static void disable_edge_ioapic_irq(unsigned int irq) -{ - disable_IO_APIC_irq(irq); -} +static void disable_edge_ioapic_irq(unsigned int irq) { /* nothing */ } /* * Starting up a edge-triggered IO-APIC interrupt is @@ -1239,7 +1278,7 @@ pin1 = find_timer_pin(mp_INT); pin2 = find_timer_pin(mp_ExtINT); - enable_IO_APIC_irq(0); + unmask_IO_APIC_irq(0); if (!timer_irq_works()) { if (pin1 != -1) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/irq.h linux.20p9/arch/i386/kernel/irq.h --- linux.vanilla/arch/i386/kernel/irq.h Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/irq.h Thu Jul 26 17:51:35 2001 @@ -85,6 +85,7 @@ extern void init_IRQ_SMP(void); extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); extern int setup_x86_irq(unsigned int, struct irqaction *); +extern void release_x86_irqs(struct task_struct *); /* * Various low-level irq details needed by irq.c, process.c, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/process.c linux.20p9/arch/i386/kernel/process.c --- linux.vanilla/arch/i386/kernel/process.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/process.c Wed Jul 4 16:10:31 2001 @@ -544,6 +544,7 @@ void release_thread(struct task_struct *dead_task) { + release_x86_irqs(dead_task); } /* @@ -808,7 +809,7 @@ goto out; error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s); if (error == 0) - current->flags &= ~PF_DTRACE; + current->ptrace &= ~PT_DTRACE; putname(filename); out: unlock_kernel(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/ptrace.c linux.20p9/arch/i386/kernel/ptrace.c --- linux.vanilla/arch/i386/kernel/ptrace.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -394,10 +394,10 @@ ret = -EPERM; if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -423,9 +423,9 @@ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if (child->p_pptr != current) { @@ -440,7 +440,7 @@ goto out; } ret = -ESRCH; - if (!(child->flags & PF_PTRACED)) + if (!(child->ptrace & PT_PTRACED)) goto out; if (child->state != TASK_STOPPED) { if (request != PTRACE_KILL) @@ -542,9 +542,9 @@ if ((unsigned long) data > _NSIG) goto out; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* make sure the single step bit is not set. */ tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; @@ -579,10 +579,10 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~PF_TRACESYS; - if ((child->flags & PF_DTRACE) == 0) { + child->ptrace &= ~PT_TRACESYS; + if ((child->ptrace & PT_DTRACE) == 0) { /* Spurious delayed TF traps may occur */ - child->flags |= PF_DTRACE; + child->ptrace |= PT_DTRACE; } tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG; put_stack_long(child, EFL_OFFSET, tmp); @@ -599,7 +599,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; write_lock_irqsave(&tasklist_lock, flags); REMOVE_LINKS(child); @@ -710,8 +710,8 @@ asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/signal.c linux.20p9/arch/i386/kernel/signal.c --- linux.vanilla/arch/i386/kernel/signal.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -629,7 +629,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -697,12 +697,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/traps.c linux.20p9/arch/i386/kernel/traps.c --- linux.vanilla/arch/i386/kernel/traps.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/i386/kernel/traps.c Wed Jul 4 16:03:53 2001 @@ -375,12 +375,12 @@ * The TF error should be masked out only if the current * process is not traced and if the TRAP flag has been set * previously by a tracing process (condition detected by - * the PF_DTRACE flag); remember that the i386 TRAP flag + * the PT_DTRACE flag); remember that the i386 TRAP flag * can be modified by the process itself in user mode, * allowing programs to debug themselves without the ptrace() * interface. */ - if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE) + if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE) goto clear_TF; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/vm86.c linux.20p9/arch/i386/kernel/vm86.c --- linux.vanilla/arch/i386/kernel/vm86.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/kernel/vm86.c Wed Jul 4 16:10:31 2001 @@ -439,7 +439,7 @@ } if (trapno !=1) return 1; /* we let this handle by the calling routine */ - if (current->flags & PF_PTRACED) { + if (current->ptrace & PT_PTRACED) { unsigned long flags; spin_lock_irqsave(¤t->sigmask_lock, flags); sigdelset(¤t->blocked, SIGTRAP); @@ -620,6 +620,14 @@ return ret; } +void release_x86_irqs(struct task_struct *task) +{ + int i; + for (i=3; i<16; i++) + if (vm86_irqs[i].tsk == task) + free_vm86_irq(i); +} + static inline void handle_irq_zombies(void) { int i; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/math-emu/fpu_entry.c linux.20p9/arch/i386/math-emu/fpu_entry.c --- linux.vanilla/arch/i386/math-emu/fpu_entry.c Sun Mar 25 17:31:45 2001 +++ linux.20p9/arch/i386/math-emu/fpu_entry.c Wed Jul 4 16:03:53 2001 @@ -210,7 +210,7 @@ } FPU_lookahead = 1; - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) FPU_lookahead = 0; if ( !valid_prefix(&byte1, (u_char **)&FPU_EIP, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/ptrace.c linux.20p9/arch/m68k/kernel/ptrace.c --- linux.vanilla/arch/m68k/kernel/ptrace.c Sun Mar 25 17:31:50 2001 +++ linux.20p9/arch/m68k/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -320,10 +320,10 @@ ret = -EPERM; if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -349,9 +349,9 @@ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if (child->p_pptr != current) { @@ -366,7 +366,7 @@ goto out; } ret = -ESRCH; - if (!(child->flags & PF_PTRACED)) + if (!(child->ptrace & PT_PTRACED)) goto out; if (child->state != TASK_STOPPED) { if (request != PTRACE_KILL) @@ -473,9 +473,9 @@ if ((unsigned long) data > _NSIG) goto out; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* make sure the single step bit is not set. */ tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); @@ -510,7 +510,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); put_reg(child, PT_SR, tmp); @@ -527,7 +527,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; write_lock_irqsave(&tasklist_lock, flags); REMOVE_LINKS(child); @@ -607,8 +607,8 @@ asmlinkage void syscall_trace(void) { lock_kernel(); - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) goto out; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/signal.c linux.20p9/arch/m68k/kernel/signal.c --- linux.vanilla/arch/m68k/kernel/signal.c Sun Mar 25 17:31:50 2001 +++ linux.20p9/arch/m68k/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -1007,7 +1007,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { current->exit_code = signr; current->state = TASK_STOPPED; regs->sr &= ~PS_T; @@ -1093,9 +1093,7 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGIOT: case SIGFPE: case SIGSEGV: - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/traps.c linux.20p9/arch/m68k/kernel/traps.c --- linux.vanilla/arch/m68k/kernel/traps.c Sun Mar 25 17:31:50 2001 +++ linux.20p9/arch/m68k/kernel/traps.c Wed Jul 4 16:03:53 2001 @@ -921,7 +921,7 @@ if (fp->ptregs.sr & PS_S) { if ((fp->ptregs.vector >> 2) == VEC_TRACE) { /* traced a trapping instruction */ - current->flags |= PF_DTRACE; + current->ptrace |= PT_DTRACE; } else bad_super_trap(fp); return; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/baget/irq.c linux.20p9/arch/mips/baget/irq.c --- linux.vanilla/arch/mips/baget/irq.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/baget/irq.c Wed Jul 4 16:03:53 2001 @@ -212,7 +212,7 @@ add_interrupt_randomness(irq); __cli(); } else { - printk("do_IRQ: Unregistered IRQ (0x%X) occured\n", irq); + printk("do_IRQ: Unregistered IRQ (0x%X) occurred\n", irq); } unmask_irq(irq); hardirq_exit(cpu); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/dec/prom/memory.c linux.20p9/arch/mips/dec/prom/memory.c --- linux.vanilla/arch/mips/dec/prom/memory.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/dec/prom/memory.c Wed Jul 4 16:03:53 2001 @@ -25,7 +25,7 @@ extern unsigned long mips_memory_upper; -volatile unsigned long mem_err = 0; /* So we know an error occured */ +volatile unsigned long mem_err = 0; /* So we know an error occurred */ /* * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/irixelf.c linux.20p9/arch/mips/kernel/irixelf.c --- linux.vanilla/arch/mips/kernel/irixelf.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/kernel/irixelf.c Thu Jul 26 15:53:46 2001 @@ -43,16 +43,16 @@ #undef DEBUG_ELF static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs); -static int load_irix_library(int fd); -static int irix_core_dump(long signr, struct pt_regs * regs); +static int load_irix_library(struct file *file); +static int irix_core_dump(long signr, struct pt_regs * regs, struct file *); extern int dump_fpu (elf_fpregset_t *); static struct linux_binfmt irix_format = { -#ifndef MODULE - NULL, NULL, load_irix_binary, load_irix_library, irix_core_dump -#else - NULL, &__this_module.usecount, load_irix_binary, load_irix_library, irix_core_dump -#endif + module: THIS_MODULE, + load_binary: load_irix_binary, + load_shlib: load_irix_library, + core_dump: irix_core_dump, + min_coredump: PAGE_SIZE, }; #ifndef elf_addr_t @@ -610,8 +610,7 @@ /* These are the functions used to load ELF style executables and shared * libraries. There is no binary dependent code anywhere else. */ -static inline int do_load_irix_binary(struct linux_binprm * bprm, - struct pt_regs * regs) +static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct elfhdr elf_ex, interp_elf_ex; struct dentry *interpreter_dentry; @@ -750,16 +749,12 @@ sys_close(elf_exec_fileno); current->personality = PER_IRIX32; + set_binfmt(&irix_format); if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); - current->binfmt = &irix_format; if (current->exec_domain && current->exec_domain->module) __MOD_INC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_INC_USE_COUNT(current->binfmt->module); compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; @@ -806,7 +801,7 @@ #endif start_thread(regs, elf_entry, bprm->p); - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); return 0; @@ -822,20 +817,10 @@ return retval; } -static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_irix_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* This is really simpleminded and specialized - we are loading an * a.out library that is given an ELF header. */ -static inline int do_load_irix_library(struct file *file) +static int load_irix_library(struct file *file) { struct elfhdr elf_ex; struct elf_phdr *elf_phdata = NULL; @@ -931,21 +916,6 @@ return 0; } -static int load_irix_library(int fd) -{ - int retval = -EACCES; - struct file *file; - - MOD_INC_USE_COUNT; - file = fget(fd); - if (file) { - retval = do_load_irix_library(file); - fput(file); - } - MOD_DEC_USE_COUNT; - return retval; -} - /* Called through irix_syssgi() to map an elf image given an FD, * a phdr ptr USER_PHDRP in userspace, and a count CNT telling how many * phdrs there are in the USER_PHDRP array. We return the vaddr the @@ -1128,14 +1098,10 @@ * and then they are actually written out. If we run out of core limit * we just truncate. */ -static int irix_core_dump(long signr, struct pt_regs * regs) +static int irix_core_dump(long signr, struct pt_regs * regs, struct file * file) { int has_dumped = 0; - struct file *file; - struct dentry *dentry; - struct inode *inode; mm_segment_t fs; - char corefile[6+sizeof(current->comm)]; int segs; int i; size_t size; @@ -1148,14 +1114,6 @@ struct elf_prstatus prstatus; /* NT_PRSTATUS */ elf_fpregset_t fpu; /* NT_PRFPREG */ struct elf_prpsinfo psinfo; /* NT_PRPSINFO */ - - if (!current->dumpable || limit < PAGE_SIZE) - return 0; - current->dumpable = 0; - -#ifndef CONFIG_BINFMT_IRIX - MOD_INC_USE_COUNT; -#endif /* Count what's needed to dump, up to the limit of coredump size. */ segs = 0; @@ -1201,27 +1159,6 @@ fs = get_fs(); set_fs(KERNEL_DS); - memcpy(corefile,"core.", 5); -#if 0 - memcpy(corefile+5,current->comm,sizeof(current->comm)); -#else - corefile[4] = '\0'; -#endif - file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); - if (IS_ERR(file)) - goto end_coredump; - dentry = file->f_dentry; - inode = dentry->d_inode; - if (inode->i_nlink > 1) - goto close_coredump; /* multiple links - don't dump */ - - if (!S_ISREG(inode->i_mode)) - goto close_coredump; - if (!inode->i_op || !inode->i_op->default_file_ops) - goto close_coredump; - if (!file->f_op->write) - goto close_coredump; - has_dumped = 1; current->flags |= PF_DUMPCORE; @@ -1386,13 +1323,7 @@ } close_coredump: - filp_close(file, NULL); - - end_coredump: set_fs(fs); -#ifndef CONFIG_BINFMT_ELF - MOD_DEC_USE_COUNT; -#endif return has_dumped; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/irixsig.c linux.20p9/arch/mips/kernel/irixsig.c --- linux.vanilla/arch/mips/kernel/irixsig.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/kernel/irixsig.c Wed Jul 4 16:03:53 2001 @@ -193,7 +193,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -261,12 +261,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: @@ -707,7 +703,7 @@ if (!p->exit_code) continue; if (!(options & (W_TRAPPED|W_STOPPED)) && - !(p->flags & PF_PTRACED)) + !(p->ptrace & PT_PTRACED)) continue; if (ru != NULL) getrusage(p, RUSAGE_BOTH, ru); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/ptrace.c linux.20p9/arch/mips/kernel/ptrace.c --- linux.vanilla/arch/mips/kernel/ptrace.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -270,12 +270,12 @@ #endif if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) { + if (current->ptrace & PT_PTRACED) { res = -EPERM; goto out; } /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; res = 0; goto out; } @@ -306,9 +306,9 @@ goto out; } /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if (child->p_pptr != current) { @@ -322,7 +322,7 @@ res = 0; goto out; } - if (!(child->flags & PF_PTRACED)) { + if (!(child->ptrace & PT_PTRACED)) { res = -ESRCH; goto out; } @@ -473,9 +473,9 @@ goto out; } if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; wake_up_process(child); res = data; @@ -501,7 +501,7 @@ res = -EIO; goto out; } - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; REMOVE_LINKS(child); child->p_pptr = child->p_opptr; @@ -522,8 +522,8 @@ asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/scall_o32.S linux.20p9/arch/mips/kernel/scall_o32.S --- linux.vanilla/arch/mips/kernel/scall_o32.S Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/kernel/scall_o32.S Wed Jul 4 16:03:53 2001 @@ -15,7 +15,7 @@ #include /* This duplicates the definition from */ -#define PF_TRACESYS 0x00000020 /* tracing system calls */ +#define PT_TRACESYS 0x00000002 /* tracing system calls */ /* This duplicates the definition from */ #define SIGILL 4 /* Illegal instruction (ANSI). */ @@ -48,8 +48,8 @@ bgez t0, stackargs stack_done: - lw t0, TASK_FLAGS($28) # syscall tracing enabled? - andi t0, PF_TRACESYS + lw t0, TASK_PTRACE($28) # syscall tracing enabled? + andi t0, PT_TRACESYS bnez t0, trace_a_syscall jalr t2 # Do The Real Thing (TM) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/signal.c linux.20p9/arch/mips/kernel/signal.c --- linux.vanilla/arch/mips/kernel/signal.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/mips/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -424,7 +424,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -493,12 +493,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/config.in linux.20p9/arch/ppc/config.in --- linux.vanilla/arch/ppc/config.in Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/ppc/config.in Wed Aug 8 22:18:17 2001 @@ -179,12 +179,10 @@ mainmenu_option next_comment comment 'Mac device drivers' -if [ "$CONFIG_INPUT_KEYBDEV" = "y" -o "$CONFIG_INPUT_MOUSEDEV" = "y" ]; then - bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID -fi +bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID if [ "$CONFIG_INPUT_ADBHID" = "y" ]; then - define_bool CONFIG_INPUT_KEYBDEV $CONFIG_VT - define_bool CONFIG_INPUT_MOUSEDEV y + define_bool CONFIG_INPUT_KEYBDEV $CONFIG_INPUT_ADBHID $CONFIG_VT + define_bool CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT_ADBHID define_bool CONFIG_MAC_HID y bool ' Support for ADB raw keycodes' CONFIG_MAC_ADBKEYCODES bool ' Support for mouse button 2+3 emulation' CONFIG_MAC_EMUMOUSEBTN diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/head.S linux.20p9/arch/ppc/kernel/head.S --- linux.vanilla/arch/ppc/kernel/head.S Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/ppc/kernel/head.S Wed Jul 4 16:03:53 2001 @@ -2129,8 +2129,8 @@ cmpi 1,r0,0x6666 /* Special case for 'sys_rt_sigreturn' */ beq- 10f beq- cr1,16f - lwz r10,TASK_FLAGS(r2) - andi. r10,r10,PF_TRACESYS + lwz r10,TASK_PTRACE(r2) + andi. r10,r10,PT_TRACESYS bne- 50f cmpli 0,r0,NR_syscalls bge- 66f diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/mk_defs.c linux.20p9/arch/ppc/kernel/mk_defs.c --- linux.vanilla/arch/ppc/kernel/mk_defs.c Sun Mar 25 17:31:48 2001 +++ linux.20p9/arch/ppc/kernel/mk_defs.c Wed Jul 4 16:03:53 2001 @@ -43,8 +43,9 @@ DEFINE(PGD, offsetof(struct mm_struct, pgd)); DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall)); DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); - DEFINE(PF_TRACESYS, PF_TRACESYS); + DEFINE(PT_TRACESYS, PT_TRACESYS); DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched)); DEFINE(TSS_FPR0, offsetof(struct thread_struct, fpr[0])); DEFINE(TSS_FPSCR, offsetof(struct thread_struct, fpscr)); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/openpic.c linux.20p9/arch/ppc/kernel/openpic.c --- linux.vanilla/arch/ppc/kernel/openpic.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/ppc/kernel/openpic.c Wed Jul 4 16:03:53 2001 @@ -242,8 +242,8 @@ openpic_mapirq(i, 1<<0); } } else { - /* Prevent any interrupt from occuring during initialisation. - * Hum... I beleive this is not necessary, Apple does that in + /* Prevent any interrupt from occurring during initialisation. + * Hum... I believe this is not necessary, Apple does that in * Darwin's PowerExpress code. */ openpic_set_priority(0, 0xf); @@ -635,4 +635,4 @@ for (i=0; iProcessor[i].Current_Task_Priority, save_cpu_task_pri[i]); } -#endif /* CONFIG_PMAC_PBOOK */ \ No newline at end of file +#endif /* CONFIG_PMAC_PBOOK */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/pmac_pci.c linux.20p9/arch/ppc/kernel/pmac_pci.c --- linux.vanilla/arch/ppc/kernel/pmac_pci.c Sun Mar 25 17:31:49 2001 +++ linux.20p9/arch/ppc/kernel/pmac_pci.c Wed Jul 4 16:03:53 2001 @@ -109,7 +109,7 @@ bridge_node = NULL; node = find_pci_device_OFnode(bus, dev_fn & 0xf8); if (node) { - /* note: we don't stop on the first occurence since we need to go + /* note: we don't stop on the first occurrence since we need to go * up to the root bridge */ do { if (node->type && !strcmp(node->type, "pci") diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/ptrace.c linux.20p9/arch/ppc/kernel/ptrace.c --- linux.vanilla/arch/ppc/kernel/ptrace.c Sun Mar 25 17:31:49 2001 +++ linux.20p9/arch/ppc/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -341,10 +341,10 @@ lock_kernel(); if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -370,9 +370,9 @@ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if (child->p_pptr != current) { @@ -387,7 +387,7 @@ goto out; } ret = -ESRCH; - if (!(child->flags & PF_PTRACED)) + if (!(child->ptrace & PT_PTRACED)) goto out; if (child->state != TASK_STOPPED) { if (request != PTRACE_KILL) @@ -472,9 +472,9 @@ if ((unsigned long) data > _NSIG) goto out; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* make sure the single step bit is not set. */ clear_single_step(child); @@ -503,7 +503,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; set_single_step(child); child->exit_code = data; /* give it a chance to run. */ @@ -516,7 +516,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) goto out; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; write_lock_irqsave(&tasklist_lock, flags); REMOVE_LINKS(child); @@ -541,8 +541,8 @@ asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/signal.c linux.20p9/arch/ppc/kernel/signal.c --- linux.vanilla/arch/ppc/kernel/signal.c Sun Mar 25 17:31:49 2001 +++ linux.20p9/arch/ppc/kernel/signal.c Wed Jul 4 16:03:53 2001 @@ -558,7 +558,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -626,12 +626,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/Makefile linux.20p9/arch/s390/boot/Makefile --- linux.vanilla/arch/s390/boot/Makefile Sun Mar 25 17:31:54 2001 +++ linux.20p9/arch/s390/boot/Makefile Wed Aug 8 22:14:04 2001 @@ -24,15 +24,27 @@ $(OBJCOPY) -O binary $< $@ image: $(CONFIGURE) $(TOPDIR)/vmlinux \ - iplfba.boot ipleckd.boot ipldump.boot + iplfba.boot ipleckd.boot dumptape.boot dumpeckd.boot $(OBJCOPY) -O binary $(TOPDIR)/vmlinux image $(NM) $(TOPDIR)/vmlinux | grep -v '\(compiled\)\|\( [aU] \)\|\(\.\)\|\(LASH[RL]DI\)' | sort > $(TOPDIR)/System.map +dumptape.lnk: dumptape.o + $(LD) -Ttext 0x2000 -o $@ $< + +dumpeckd.boot: dumpeckd.lnk + $(OBJCOPY) -O binary $< dumpeckd.boot2 + dd if=dumpeckd.boot2 > dumpeckd.boot + dd if=dumpeckd.boot2 >> dumpeckd.boot + rm dumpeckd.boot2 + +dumpeckd.lnk: dumpeckd.o + $(LD) -Ttext 0x2000 -o $@ $< + listing: ../../../vmlinux $(OBJDUMP) --disassemble --disassemble-all --disassemble-zeroes --reloc $(TOPDIR)/vmlinux > listing dep: clean: - rm -f image listing iplfba.boot ipleckd.boot ipldump.boot + rm -f image listing iplfba.boot ipleckd.boot dumptape.boot dumpeckd.boot *.lnk *.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/common.S linux.20p9/arch/s390/boot/common.S --- linux.vanilla/arch/s390/boot/common.S Thu Jan 1 01:00:00 1970 +++ linux.20p9/arch/s390/boot/common.S Wed Aug 8 22:14:04 2001 @@ -0,0 +1,298 @@ +# +# Common code for the different second stage boot loaders +# Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation +# Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), +# + +# some definitions from kernel land +__LC_IPLDEV = 0xC6C +IPL_DEVICE = 0x10404 +INITRD_START = 0x1040C +INITRD_SIZE = 0x10414 +COMMAND_LINE = 0x10480 + +# error codes shown as address in disabled wait psw + +EENABLE_DEV = 0x00000100 # enable device failed +EDISABLE_DEV = 0x00000101 # disable device failed +ESSCH = 0x00000102 # start subchannel failed + + .macro stage2_start +# +# Function entry point at 0x2000 is called with C linkage +# %r2-%r3: load descriptor +# %r3 : device subchannel id +# %r4 : load address +# + basr %r1,0 + b _load_blocklist-.(%r1) + .align 8 + +# +# Program execution of the second stage boot loader starts at 0x1008 +# + .globl _start +_start: stm %r0,%r15,0x180 # store all registers + basr %r13,0 +0: l %r15,3f-0b(%r13) # load end of stack address + l %r11,0xb8 # load ipl device subchannel id + lr %r2,%r11 + bas %r14,_enable_device-0b(%r13) + lm %r2,%r3,STAGE2_DESC # get block with load descriptors + lr %r4,%r11 + l %r5,4f-0b(%r13) + la %r12,0(%r5) # FIXME: provide the correct offset + bas %r14,_load_direct-0b(%r13) +1: lm %r2,%r5,0(%r12) # load 16 bytes = one load descriptor + cl %r4,6f-0b(%r13) # check type range + bh 2f + sll %r4,2 + l %r1,5f-0b(%r4,%r13) # function pointer according to type + lr %r4,%r11 # pass subchannel id + bas %r14,0(%r1) +2: la %r12,16(%r12) # next load descriptor + b 1b-0b(%r13) +3: .long 0x10000-96 +4: .long 0x8000 +5: .long _load_kernel # type 0: kernel image + .long _load_parmfile # type 1: parameter file + .long _load_ramdisk # type 2: initial ramdisk + .long _jump_target # type 3: jump to target +6: .long 3 # highest index in list + +_load_kernel: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,1f-0b(%r13) # create stack frame + lr %r12,%r4 + bas %r14,_load_blocklist-0b(%r13) + st %r12,__LC_IPLDEV # old ipl device storage location + l %r6,2f-0b(%r13) # load address of IPL_DEVICE + st %r12,0(%r6) # new ipl device storage location + l %r6,3f-0b(%r13) # load address of INITRD_START + xc 0(4,%r6),0(%r6) # clear INITRD_START + l %r6,4f-0b(%r13) # load address of INITRD_SIZE + xc 0(4,%r6),0(%r6) # clear INITRD_SIZE + lm %r6,%r15,120(%r15) + br %r14 +1: .long 96 +2: .long IPL_DEVICE +3: .long INITRD_START +4: .long INITRD_SIZE + +_load_parmfile: # load parameter file to 0x10480 + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,1f-0b(%r13) # create stack frame + bas %r14,_load_blocklist-0b(%r13) + l %r1,12(%r12) + l %r2,2f-0b(%r13) # load address of kernel command line + mvc 0x0(256,%r2),0(%r1) # move command line to 0x10480 + mvc 0x100(256,%r2),0x100(%r1) + mvc 0x200(256,%r2),0x200(%r1) + mvc 0x300(127,%r2),0x300(%r1) + xc 0x37f(1,%r2),0x37f(%r2) + lm %r6,%r15,120(%r15) + br %r14 +1: .long 96 +2: .long COMMAND_LINE + +_load_ramdisk: # load initial ramdisk + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,1f-0b(%r13) # create stack frame + lr %r12,%r5 # save load address + bas %r14,_load_blocklist-0b(%r13) + l %r1,2f-0b(%r13) # ramdisk start storage location + st %r12,0(%r1) # store start of ramdisk + slr %r2,%r12 + l %r1,3f-0b(%r13) # ramdisk size storage location + st %r2,0(%r1) # store size of ramdisk + lm %r6,%r15,120(%r15) + br %r14 +1: .long 96 +2: .long INITRD_START +3: .long INITRD_SIZE + +_jump_target: + basr %r1,0 +0: lr %r2,%r11 + lr %r14,%r5 # make branch target return address + b _disable_device-0b(%r1) + + .endm + +# +# The load descriptor is 16 bytes in length and contains 3 entries: +# offset 0 : a blocklist descriptor (fba or eckd) +# offset 8 : a type +# offset 12: an address +# The meaning of the address and the validity of the blocklst +# depends on the type. +# type = 0 : kernel image, blocklist valid, address = load address +# type = 1 : parameter line, blocklist valid, address = load address +# type = 2 : initial ramdisk, blocklist valid, address = load address +# type = 3 : jump command, blocklist invalid, address = branch address +# + .macro blocklist_traverser +# parameter +# %r2+%r3: blocklist head descriptor +# %r4 : device subchannel id +# %r5 : load address +_load_blocklist: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,4f-0b(%r13) # create stack frame +1: lr %r12,%r4 # save device subchannel id + lr %r11,%r5 # save load address + lr %r8,%r2 # save descriptor + lr %r9,%r3 + bas %r14,_extract_length-0b(%r13) # get length from descriptor + lr %r10,%r2 # save returned length + lr %r2,%r8 # reload descriptor to %r2/%r3 + lr %r3,%r9 + lr %r4,%r12 # reload device id to %r4 + l %r5,6f-0b(%r13) # get memory area for indirect block + bas %r14,_load_direct-0b(%r13) # load indirect block + lr %r5,%r11 # restore load address + lr %r9,%r10 # (length / 8 - 1) = # direct descr. + srl %r9,3 + bctr %r9,0 + l %r8,6f-0b(%r13) +2: clc 0(8,%r8),5f-0b(%r13) # test block descriptor + be 3f-0b(%r13) # descriptor == 0 -> done + lm %r2,%r3,0(%r8) # pass block descriptor + lr %r4,%r12 # pass device subchannel id + bas %r14,_load_direct-0b(%r13) # load indirect block + lr %r5,%r2 # move updated load address + la %r8,8(%r8) # next descriptor + bct %r9,2b-0b(%r13) + lm %r2,%r3,0(%r8) # load continuation descriptor + lr %r4,%r12 # move device id for next round + clc 0(8,%r8),5f-0b(%r13) # test continuation descriptor + bne 1b-0b(%r13) # != 0 -> load next indirect block +3: lr %r2,%r5 # return updated load address + lm %r6,%r15,120(%r15) + br %r14 +4: .long 96 +5: .long 0,0 +6: .long 0x8200 # memory address for indirect blocks + + .endm + + .macro device_fn +# +# Enable I/O on the ipl device. +# %r2 : device subchannel id +# +_enable_device: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,1f-0b(%r13) + lr %r1,%r2 + l %r2,4f-0b(%r13) # set panik code early + stsch 2f-0b(%r13) + oi 2f-0b+5(%r13),0x84 # enable ssch and multipath mode + msch 2f-0b(%r13) + bnz _panik-0b(%r13) # subchannel busy or in error ? + lctl %c6,%c6,3f-0b(%r13) # enable all interrupt classes + lm %r6,%r15,120(%r15) + br %r14 +1: .long 96 + .align 8 +2: .fill 64,1,0 +3: .long 0xff000000 # CR6 initial value +4: .long EENABLE_DEV + +# +# Disable I/O on the ipl device. +# %r2 : device subchannel id +# +_disable_device: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,1f-0b(%r13) + lr %r1,%r2 + l %r2,3f-0b(%r13) # set panik code early + lctl %c6,%c6,2f-0b(%r13) # disable all interrupt classes + stsch 2f-0b(%r13) + ni 2f-0b+5(%r13),0x7B # disable ssch and multipath mode + msch 2f-0b(%r13) + bnz _panik-0b(%r13) # subchannel busy or in error ? + lm %r6,%r15,120(%r15) + br %r14 +1: .long 96 + .align 8 +2: .long 0x00000000 # CR6 (all interrupts classes disabled) +3: .long EDISABLE_DEV + .endm + + .macro io_subroutines +# +# Start I/O +# %r2 : device subchannel id +# %r3 : address of orb +# %r4 : address of irb +# %r5 : retry count +# +_ssch: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,6f-0b(%r13) # create stack frame + lr %r12,%r2 # save subchannel id + lr %r11,%r3 # save orb + lr %r10,%r4 # save irb + lr %r9,%r5 # save retry count +1: lr %r1,%r12 + ssch 0(%r11) # go + bnz 4f-0b(%r13) # houston, we have a problem +2: lr %r2,%r12 # call _wait4de with subchannel id + lr %r3,%r10 # and irb address as parameters + bas %r14,_wait4de-0b(%r13) # wait until DE or error + tm 9(%r10),0xff # test channel status + bnz 4f-0b(%r13) + tm 8(%r10),0xf3 # test device status + bz 5f-0b(%r13) + bct %r9,1b-0b(%r13) # something went wrong, retry. +4: l %r2,7f-0b(%r13) + bas %r4,_panik-0b(%r13) # won't return +5: lm %r6,%r15,120(%r15) + br %r14 +6: .long 96 +7: .long ESSCH + +# +# Wait for interrupt subroutine +# %r2 : device subchannel id +# %r3 : address of irb +# +_wait4de: + lr %r1,%r2 + basr %r4,0 +0: mvc 0x78(8),5f-0b(%r4) # set i/o new psw +1: lpsw 4f-0b(%r4) +2: c %r1,0xb8 # compare subchannel id + bne 1b-0b(%r4) # unequal -> continue waiting + tsch 0(%r3) + tm 9(%r3),0xff # test channel status + bnz 3f-0b(%r4) + tm 8(%r3),0xf3 # got something unusual ? + bnz 3f-0b(%r4) + tm 8(%r3),0x04 # got device end ? + bz 1b-0b(%r4) # still busy -> continue waiting +3: br %r14 + .align 8 +4: .long 0x020a0000,0x80000000+1b +5: .long 0x00080000,0x80000000+2b # io new psw + +# +# Panik routine. Loads a disabled wait psw +# %r2 : panik code +# +_panik: + basr %r1,0 +0: st %r2,1f-0b+4(%r1) # store code in address part of psw + lpsw 1f-0b(%r1) + .align 8 +1: .long 0x000a0000,0x00000000 + .endm diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumpcommon.S linux.20p9/arch/s390/boot/dumpcommon.S --- linux.vanilla/arch/s390/boot/dumpcommon.S Thu Jan 1 01:00:00 1970 +++ linux.20p9/arch/s390/boot/dumpcommon.S Wed Aug 8 22:14:04 2001 @@ -0,0 +1,220 @@ +/* + * dumpcommon.S + * + * Common routines for dump records + * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Author(s): Michael Holzheu + * + * Uses extern functions: + * - _dump_mem (device dependent function to write dump) + * + * Functions: + * - _take_dump + */ + + +.include "common.S" + +/* General defines */ +#define PAGE_SIZE 0x1000 /* 4096 */ +#define HEADER_SIZE 0x1000 /* 4096 */ +#define END_MARKER_SIZE 0x10 +#define DUMP_END_MARKER 0x44554d50,0x5f454e44 /* DUMP_END */ +#define IPL_SC 0xb8 /* Address of ipl subchannel */ +#define S390_DUMP_MAGIC 0xa8190173,0x618f23fd /* magic number */ +#define ARCH_S390 0x1 /* arch flag for s390 */ + +/* Error codes */ +#define OK 0x00000000 /* Dump completed successfully */ +#define EMEM 0x00000001 /* Device too small for dump */ +#define EDEV_INVAL 0x00000002 /* Device not supported */ + +################################################################################ +# Take the dump +################################################################################ + +.macro dump_common_fn: + +_take_dump: + stm %r6,%r15,24(%r15) + basr %r13,0 +.Lbase: s %r15,.Lc96-.Lbase(%r13) # create stack frame + bas %r14,_store_status-.Lbase(%r13) # store status + bas %r14,_count_mem-.Lbase(%r13) # count memory + l %r14,.Ldump_mem-.Lbase(%r13) + basr %r14,%r14 # dump memory + la %r2,OK + bas %r14,_panik-.Lbase(%r13) # everything ok: stop now + +################################################################################ +# Find out memory size: +# When accessing a page which is not there, we get a program check +################################################################################ + +_count_mem: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + slr %r9,%r9 # base register for zero page + mvc 104(8,%r9),.Lcount_mem_psw-0b(%r13) # setup program check new psw + slr %r10,%r10 + la %r11,1 + sll %r11,20 # 1 MB +.Lloop0: + l %r12,0(%r10) # test page + ar %r10,%r11 # add 1M + bnm .Lloop0-0b(%r13) # r10 < 0x80000000 -> loop +.Lchkmem0: + n %r10,.L4malign0-0b(%r13) # align to multiples of 4M + st %r10,.Ldh_mem_size+4-0b(%r13) # store memory size + st %r10,.Ldh_mem_end+4-0b(%r13) # store memory end + srl %r10,12 # calculate page count (/ 4096) + st %r10,.Ldh_num_pages-0b(%r13) # store page count + mvc 88(32,%r9),.Lnew_psws-0b(%r13) # restore disabled wait new psws + lm %r6,%r15,120(%r15) + br %r14 +.Lcount_mem_psw: .long 0x00080000,0x80000000 + .Lchkmem0 +.Lnew_psws: +.long 0x000a0000,0x00000058 # external new psw +.long 0x000a0000,0x00000060 # svc new psw +.long 0x000a0000,0x00000068 # program check new psw +.long 0x000a0000,0x00000070 # machine check new psw +.L4malign0: +.long 0xffc00000 + +################################################################################ +# store status of all cpus in their lowcores +################################################################################ + + +_store_status: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) + la %r7,0x0 # base register for 0 page + + ######## move lowcore info (assume user has made store ######## + ######## status) to prefix-page ######## + + lr %r2,%r7 # zero page (source) + bas %r14,_copy_lowcore-0b(%r13) + + ######## stop all cpus and store status in prefix pages ######## + +.Lstore_all: + la %r8,0 # first cpu + stap .Lcurrent_cpu+2-0b(%r13) # store current cpu address + +.Lstatus_loop: + cl %r8,.Lcurrent_cpu-0b(%r13) # is ipl cpu ? + be .Lnext_cpu-0b(%r13) # if yes get next cpu +.Lstop_loop: + sigp %r9,%r8,0x5 # stop cpu + bc 8,.Lcpu_stopped-0b(%r13) # accepted + bc 4,.Lnext_cpu-0b(%r13) # status stored in register: + # next cpu + bc 2,.Lstop_loop-0b(%r13) # busy: try again + bc 1,.Lnext_cpu-0b(%r13) # not op: next cpu +.Lcpu_stopped: + lr %r9,%r7 + sigp %r9,%r8,0xe # store status of cpu + bc 8,.Lcpu_stored-0b(%r13) # accepted + bc 4,.Lnext_cpu-0b(%r13) # status stored: next cpu + bc 2,.Lcpu_stopped-0b(%r13) # busy: try again + bc 1,.Lnext_cpu-0b(%r13) # not op: next cpu +.Lcpu_stored: + lr %r2,%r7 # zero page (source) + bas %r14,_copy_lowcore-0b(%r13) +.Lnext_cpu: + la %r8,1(%r8) # next cpu (r8 +=1) + cl %r8,.Llast_cpu-0b(%r13) # is last possible cpu ? + bl .Lstatus_loop-0b(%r13) # jump if not last cpu +.Lstore_status_exit: + lm %r6,%r15,120(%r15) + br %r14 # return to caller +.Lcurrent_cpu: + .long 0x0 +.Llast_cpu: + .long 0x0000ffff + +############1################################################################### +# copy lowcore to prefix page +# r2: address of source lowcore (input by caller) +################################################################################ + +_copy_lowcore: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) + + l %r3,0x108(%r2) # get prefix page from lowcore + + ###### check if lowcore address looks valid ###### + + cl %r3,.Llinux_start-0b(%r13) # looks valid ? + bl .Lcpy_locore_exit-0b(%r13) # if < linux-start addr + l %r6,.Lpage_align-0b(%r13) # check page alignment + nr %r3,%r6 + cl %r3,0x108(%r2) + bnz .Lcpy_locore_exit-0b(%r13) # if not page aligned + + ###### copy lowcore ###### + + # |-----------------------------------------------------------| + # | Decimal | Length | Data | + # | Address | in Bytes | | + # |_________|___________|_____________________________________| + # | 212 | 4 | Extended save area address | + # | 216 | 8 | CPU timer | + # | 224 | 8 | Clock comparator | + # | 256 | 8 | Current PSW | + # | 264 | 4 | Prefix register | + # | 288 | 64 | Access registers 0 through 15 | + # | 352 | 32 | Floating-point registers 0 through 6| + # | 384 | 64 | General registers 0 through 15 | + # | 448 | 64 | Control registers 0 through 15 | + # |_________|___________|_____________________________________| + + mvc 212(20,%r3),212(%r2) + mvc 256(12,%r3),256(%r2) + mvc 288(224,%r3),288(%r2) + +.Lcpy_locore_exit: + lm %r6,%r15,120(%r15) + br %r14 # return to caller +.Lpage_align: + .long -4096 + +.align 4 +.Ldump_mem: .long _dump_mem # address of function + +.Llinux_start: + .long 0x10000 +.Lc96: .long 96 # for creating stackframes +.align 8 +# +# The Dump header +# +.Ldh_dumpheader: +.Ldh_magic_number:.long S390_DUMP_MAGIC +.Ldh_version: .long 0x00000001 +.Ldh_header_size: .long HEADER_SIZE +.Ldh_dump_level: .long 0x00000004 # DUMP_ALL +.Ldh_page_size: .long PAGE_SIZE +.Ldh_mem_size: .long 0x00000000,0x00000000 +.Ldh_mem_start: .long 0x00000000,0x00000000 +.Ldh_mem_end: .long 0x00000000,0x00000000 +.Ldh_num_pages: .long 0x00000000 +.Ldh_pad: .long 0x00000000 +.Ldh_time: .long 0x00000000,0x00000000 +.Ldh_cpuid: .long 0x00000000,0x00000000 +.Ldh_arch: .long ARCH_S390 +.Ldh_free: .long 0x00000000 +# +# Dump End Marker +# +.align 8 +.Ld_endmarker: .long DUMP_END_MARKER +.Ld_end_time: .long 0x00000000,0x00000000 + +.endm diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumpeckd.S linux.20p9/arch/s390/boot/dumpeckd.S --- linux.vanilla/arch/s390/boot/dumpeckd.S Thu Jan 1 01:00:00 1970 +++ linux.20p9/arch/s390/boot/dumpeckd.S Wed Aug 8 22:14:04 2001 @@ -0,0 +1,548 @@ +/* + * Dump boot loader for 3380/3390 DASDs + * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Author(s): Michael Holzheu + * Holger Smolinski + * + * Uses extern functions: + * - _panik + * - _enable_device + * - _take_dump + * + * Functions: + * - _dump_mem + */ + +#include "dumpcommon.S" + +/* General defines */ + +#define IPL_BS 0x1000 +#define BLOCKS_PER_WRITE 64 /* makes 256K with 4K blksize */ + +#ifdef ZIPL + +################################################################################ +# Function entry point at 0x2000 (not used for dump) is called with C linkage +# %r2-%r3: load descriptor +# %r3 : device subchannel id +# %r4 : load address +################################################################################ + + basr %r1,0 + b _not_implemented-.(%r1) + .align 8 + +#else + +#define DUMP_TOOL_START 0x2000 + +################################################################################ +# one psw and two ccws: +# Re-Read enough of bootsector to start +################################################################################ + +.psw: .long 0x00080000,0x80000000+_start +.ccw1: .long 0x06000000 + DUMP_TOOL_START,0x00000000 + IPL_BS +.ccw2: .long 0x00000000,0x00000000 + +#endif /* ZIPL */ + +################################################################################ +# Program execution of the second stage boot loader starts at 0x2008 +################################################################################ + + .globl _start +_start: basr %r13,0 +0: l %r15,1f-0b(%r13) # load end of stack address + l %r11,IPL_SC # load ipl device subchannel id + lr %r2,%r11 + l %r14,.Lenable_device-0b(%r13) + basr %r14,%r14 + bas %r14,_get_device_characteristics-0b(%r13) + l %r5,.Ldev_end_rec-0b(%r13) # endblock (first block = nr 1) + st %r5,.Ldev_bpt-0b(%r13) + l %r5,.Ldev_blk_size-0b(%r13) # get blocksize + stcm %r5,3,.Lwrccw+2-0b(%r13) # store blocksize into wr template + stcm %r5,3,.Llodata+14-0b(%r13) # store blocksize into lodata + l %r14,.Ltake_dump-0b(%r13) + basr %r14,%r14 +1: .long 0x10000-96 # end of stack + +#ifdef ZIPL + +################################################################################ +# Get the device characteristics: +# +# Get device characteristics from zipl parameters (at 0x218) +# The following parameter format is expected 2x8 byte: +# +# Dump Start: CCHH RBBN +# Dump End: CCHH RBBX +# +# - CC: Start/End Cylinder Number +# - HH: Start/End Head Number +# - R : Start/End Record Number +# - BB: Blocksize +# - N : Number of Heads of DASD +# - X : Unused +# +# Cylinder, Heads are counted starting with 0. +# Records are counted starting with 1. +# We assume that the End Record Number is at track boundary. +# This allows us to determine the number of Blocks Per Track. +################################################################################ + +_get_device_characteristics: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + la %r12,0 # load base register + mvc .Ldev_start_cyl-0b+2(2,%r13),0x218(%r12) + mvc .Ldev_start_hd-0b+2(2,%r13),0x21a(%r12) + mvc .Ldev_start_rec-0b+3(1,%r13),0x21c(%r12) + mvc .Ldev_blk_size-0b+2(2,%r13),0x21d(%r12) + mvc .Ldev_nr_hds-0b+3(1,%r13),0x21f(%r12) + mvc .Ldev_end_cyl-0b+2(2,%r13),0x220(%r12) + mvc .Ldev_end_hd-0b+2(2,%r13),0x222(%r12) + mvc .Ldev_end_rec-0b+3(1,%r13),0x224(%r12) + lm %r6,%r15,120(%r15) + br %r14 + +#else + +################################################################################ +# Get the device characteristics: +# +# The following is fix: +# - blocksize = 4K +# - start cylinder = 0 +# - start head = 0 +# - start record = 4 +# - end cylinder = unlimited +# - end head = nr of heads +# - end record = blocks per track +# +# The following is read from the device characteristics +# +# - model 3380/90 ==> blocks per track +# - nr of heads +# +################################################################################ + +_get_device_characteristics: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + la %r6,.Lrdcccw-0b(%r13) + st %r6,.Lorb+8-0b(%r13) # store cp-address to orb + l %r2,IPL_SC + la %r3,.Lorb-0b(%r13) + la %r4,.Lirb-0b(%r13) + la %r5,2 + bas %r14,_ssch-0b(%r13) # start I/O: Read device characteristic + + # find out blocks per track (bpt) + + la %r6,9 + clc .Lrdcdata+3-0b(2,%r13),.L9345-0b(%r13) + be 1f-0b(%r13) + la %r6,10 + clc .Lrdcdata+3-0b(2,%r13),.L3380-0b(%r13) + be 1f-0b(%r13) + la %r6,12 + clc .Lrdcdata+3-0b(2,%r13),.L3390-0b(%r13) + be 1f-0b(%r13) + + # not supported device panik + + la %r2,EDEV_INVAL + l %r14,.Lpanik-0b(%r13) + basr %r14,%r14 + +1: + # store dev characteristic + + st %r6,.Ldev_end_rec-0b(%r13) + + slr %r6,%r6 + icm %r6,3,.Lrdcdata+14-0b(%r13) + st %r6,.Ldev_end_hd-0b(%r13) + st %r6,.Ldev_nr_hds-0b(%r13) + + la %r6,0 + st %r6,.Ldev_start_cyl-0b(%r13) + la %r6,0 + st %r6,.Ldev_start_hd-0b(%r13) + la %r6,4 + st %r6,.Ldev_start_rec-0b(%r13) + l %r6,.Lblk_size-0b(%r13) + st %r6,.Ldev_blk_size-0b(%r13) + l %r6,.Lend_cyl-0b(%r13) + st %r6,.Ldev_end_cyl-0b(%r13) + + lm %r6,%r15,120(%r15) + br %r14 +.L3390: + .word 0x3390 +.L9345: + .word 0x9345 +.L3380: + .word 0x3380 +.Lend_cyl: + .long 0x0000ffff +.Lblk_size: + .long 0x1000 +.align 8 + +.Lrdcdata: + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 +.Lrdcccw: + .long 0x64000040,0x00000000+.Lrdcdata # read device characteristics + +#endif /* ZIPL */ + +################################################################################ +# Dump memory +################################################################################ + +_dump_mem: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + + # calculate start and end block + + la %r6,0 + l %r7,.Ldev_start_cyl-0b(%r13) + la %r8,0 + l %r9,.Ldev_start_hd-0b(%r13) + l %r10,.Ldev_start_rec-0b(%r13) + l %r11,.Ldev_nr_hds-0b(%r13) + l %r12,.Ldev_bpt-0b(%r13) # = blocks per track + + # calculate start block + ####################### + + # cyl * nr_hds * blkptr + + mr %r6,%r11 + mr %r6,%r12 + + # hd * recs + + mr %r8,%r12 + + # start block = cyl * nr_hds * bptr + hd * bptr + rec + + ar %r7,%r9 + ar %r7,%r10 + + bctr %r7,0 # decrement, we start counting + # beginning with block 0 + + st %r7,.Ldev_start_blk-0b(%r13) + + + + # calculate end block + ####################### + + l %r7,.Ldev_end_cyl-0b(%r13) + l %r9,.Ldev_end_hd-0b(%r13) + + # cyl * nr_hds * blkptr + + mr %r6,%r11 + mr %r6,%r12 + + # hd * recs + + mr %r8,%r12 + + # end block = cyl * nr_hds * bptr + hd * bptr + rec + + ar %r7,%r9 + ar %r7,%r12 + + bctr %r7,0 # decrement, we start counting + # beginning with block 0 + + st %r7,.Ldev_end_blk-0b(%r13) + + # calculate bytes per write (blksize * blwr) + + l %r11,.Ldev_blk_size-0b(%r13) + mh %r11,.Lblocks_per_write-0b(%r13) + st %r11,.Lbytes_per_write-0b(%r13) + +# write header + +.Lheaders: # write dump headers + stck .Ldh_time-0b(%r13) # store time + stidp .Ldh_cpuid-0b(%r13) # store cpu id + + l %r11,.Ldev_start_blk-0b(%r13) # start block + + lr %r2,%r11 + la %r3,.Ldh_dumpheader-0b(%r13) # address of dump header + + l %r4,.Lheader_size-0b(%r13) + srda %r4,32 # shift ==> 64 bit number + l %r6,.Ldev_blk_size-0b(%r13) # get blocksize + + dr %r4,%r6 # nr of blocks for header = + # HEADER_SIZE / BLOCKSIZE = r5 + lr %r4,%r5 + lr %r12,%r5 # save nr of blocks + bas %r14,_writeblock-0b(%r13) # write block to disk + ar %r11,%r12 # update block counter + +.Lmemory: # write memory + +# write memory + + la %r10,0 # start at address 0 + +.Lmloop: + la %r4,BLOCKS_PER_WRITE # write so many blocks at a time + lr %r2,%r11 # restore r2 + lr %r3,%r10 # restore r3 + bas %r14,_writeblock-0b(%r13) # write block to disk + l %r2,.Lbytes_per_write-0b(%r13) + ar %r10,%r2 # update data address + ah %r11,.Lblocks_per_write-0b(%r13) # skip to next block + l %r3,.Ldh_mem_size+4-0b(%r13) # get memsize + clr %r10,%r3 # enough ? + bl .Lmloop-0b(%r13) # branch if r10 < r3 + +# write end marker + +.lendmarker: # terminate dump file + la %r4,1 # write endmaker with one block + stck .Ld_end_time-0b(%r13) # store end time + lr %r2,%r11 # restore r2 + la %r3,.Ld_endmarker-0b(%r13) # address of dump end marker + la %r4,1 # write 4k at a time + bas %r14,_writeblock-0b(%r13) # write block to disk + + lm %r6,%r15,120(%r15) + br %r14 # return to caller +.Lbytes_per_write: .long 0x00000000 +.Lheader_size: .long HEADER_SIZE +.Lblocks_per_write: .word BLOCKS_PER_WRITE + +################################################################################ +# This function writes a block number given in r2 to disk +# r2: number of first block to write ( input by caller ) +# We start counting with Block Nr 0 !!! +# r3: address to write data from ( input by caller ) +# r4: number of blocks to write ( input by caller ) +################################################################################ + +_writeblock: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + + # check if blocks are within range: + + lr %r11,%r2 + ar %r11,%r4 # End block + l %r12,.Ldev_end_blk-0b(%r13) + clr %r11,%r12 # End block < dev_end_blk ? + bl 1f-0b(%r13) # no + la %r2,EMEM # if yes panik + l %r14,.Lpanik-0b(%r13) + basr %r14,%r14 + +1: la %r12,.Ldeccw-0b(%r13) + st %r12,8+.Lorb-0b(%r13) # store cpaddr to orb + la %r12,.Lwrccw-0b(%r13) + oi 1(%r12),0x40 # set CC in wr template + + # first setup the write channel program + + lr %r11,%r4 # save number of blocks + + l %r6,.Ldev_bpt-0b(%r13) # load bpt to r6 + l %r7,.Ldev_nr_hds-0b(%r13) # load heads to r7 + la %r5,.Lwrloop-0b(%r13) + br %r5 /* FIXME */ + +2: # loop for number of block (nbl) time + + # switch to next write CCW + + l %r5,.Ldev_blk_size-0b(%r13) + ar %r3,%r5 # add blksize to destination addr + ah %r12,.Lccw_size-0b(%r13) # add sizeof(ccw) to base address + mvc 0(8,%r12),.Lwrccw-0b(%r13) # copy template to this ccw + +.Lwrloop: + + # build up next write CCW + + st %r3,4(%r12) # store target addr to this ccw + bct %r4,2b-0b(%r13) # decrement no of blks still to do + ni 1(%r12),0x3f # no command chaining for last ccw + + # write CCWs are setup now + + lr %r4,%r11 # restore number of blocks + stcm %r4,3,.Llodata+2-0b(%r13) # store number of blocks to lodata + + # compute end block + + ar %r4,%r2 # r4: ebl = blk + nbl + bctr %r4,0 # decrement r4 (last blk touched) + + # compute start track and start block on track + + srda %r2,32 # shift ==> 64 bit number + dr %r2,%r6 # trk = blk / bpt, bot = blk % bpt + # r3: trk, r2: bot + la %r2,1(%r2) # bot++ ( we start counting at 1 ) + stcm %r2,1,.Llodata+12-0b(%r13) # store bot to lodata + + # compute start cylinder and head + + xr %r2,%r2 # clear bot + dr %r2,%r7 # cy=trk / heads, hd=trk % heads + # r3: cy, r2: hd + sll %r3,16 # combine to CCHH in r3 + or %r3,%r2 + st %r3,.Ldedata+8-0b(%r13) # store cchh to dedata + st %r3,.Llodata+4-0b(%r13) # store cchh to lodata + st %r3,.Llodata+8-0b(%r13) # store cchh to lodata + + # compute end track and end block on track + + lr %r11,%r5 # save r5 + srda %r4,32 # shift ==> 64 bit number + dr %r4,%r6 # tr2 = ebl / bpt + # r5: tr2, r4: bot2 + # compute end cylinder and head + + xr %r4,%r4 # cy2=tr2/heads, hd2=hd2 % heads + dr %r4,%r7 # r5: cy2, r4: hd2 + stcm %r5,3,.Ldedata+12-0b(%r13) # store cy2,hd2 to dedata + stcm %r4,3,.Ldedata+14-0b(%r13) # store cy2,hd2 to dedata + lr %r5,%r11 # restore r5 + + # CCWs are setup now, arent they? + + l %r2,IPL_SC # subchannel id + la %r3,.Lorb-0b(%r13) + la %r4,.Lirb-0b(%r13) + la %r5,10 # initialize retries + + bas %r14,_ssch-0b(%r13) # start I/O + + lm %r6,%r15,120(%r15) + br %r14 # return to caller +.Lccw_size: + .word 0x8 +.align 8 +.Lorb: + .long 0x0049504c,0x0080ff00 # intparm is " IPL" + .long 0x00000000,0x00000000 +.Lirb: + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 + .long 0x00000000,0x00000000 +.Ldedata: + .long 0x80c00000,0x00000000 + .long 0x00000000,0x00000000 +.Llodata: + .long 0x01800001,0x00000000 + .long 0x00000000,0x03000000 + .long 0x12345678,0x00000000 + +################################################################################ +# read function not implemented: return EINVAL +################################################################################ + +_not_implemented: + la %r2,22 /* EINVAL */ + lcr %r2,%r2 /* -EINVAL */ + br %r14 + +################################################################################ +# expand Macros +################################################################################ + + dump_common_fn + device_fn + io_subroutines + + +################################################################################ +# DATA +################################################################################ + +# extern functions + +.Lpanik: + .long _panik +.Lenable_device: + .long _enable_device +.Ltake_dump: + .long _take_dump + +# device characteristics +.align 8 +.Ldev_start_cyl: + .long 0x00000000 +.Ldev_start_hd: + .long 0x00000000 +.Ldev_start_rec: + .long 0x00000000 +.Ldev_blk_size: + .long 0x00000000 +.Ldev_nr_hds: + .long 0x00000000 +.Ldev_end_cyl: + .long 0x00000000 +.Ldev_end_hd: + .long 0x00000000 +.Ldev_end_rec: + .long 0x00000000 + + +.Ldev_start_blk: + .long 0x00000000 +.Ldev_end_blk: + .long 0x00000000 +.Ldev_bpt: + .long 0x00000000 + + +# +# CCWs +# + +.align 8 + +# channel program for one write + +.Ldeccw: + .long 0x63400010,0x00000000+.Ldedata # define extent +.Lloccw: + .long 0x47400010,0x00000000+.Llodata # locate record +.Lwrccw: + .long 0x8d000000,0x00000000 # update Key & data + +.org IPL_BS diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumptape.S linux.20p9/arch/s390/boot/dumptape.S --- linux.vanilla/arch/s390/boot/dumptape.S Thu Jan 1 01:00:00 1970 +++ linux.20p9/arch/s390/boot/dumptape.S Wed Aug 8 22:14:04 2001 @@ -0,0 +1,183 @@ +/* + * Dump boot loader for 3480/3490 tape devices + * Copyright (C) 1999-2001 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Author(s): Michael Holzheu (holzheu@de.ibm.com), + * Martin Schwidefsky (schwidefsky@de.ibm.com) + * + * Uses extern functions: + * - _panik + * - _enable_device + * - _take_dump + * + * Functions: + * - _dump_mem + */ + +#include "dumpcommon.S" + +#define IPL_BS 0x1000 +#define BLOCK_SIZE 0x8000 /* 32 KB */ +#define DUMP_TOOL_START 0x2000 /* tool is loaded to this address in order */ + /* not to overwrite page 0 */ + +################################################################################ +# The first 24 bytes are loaded by ipl to addresses 0-23. (a PSW and two CCWs) +################################################################################ + + # psw + .long 0x00080000,0x80000000+_start + # rewind ccw + .long 0x07000000,0x60000001 + # ccw to load dump utility to 0x1000 + .long 0x02000000+DUMP_TOOL_START ,0x20000000+IPL_BS + +.globl _start +_start: basr %r13,0 +0: l %r15,1f-0b(%r13) # load end of stack address + l %r11,IPL_SC # load ipl device subchannel id + lr %r2,%r11 + l %r14,.Lenable_device-0b(%r13) + basr %r14,%r14 + l %r14,.Ltake_dump-0b(%r13) + basr %r14,%r14 +1: .long 0x10000-96 # end of stack + +################################################################################ +# Dump memory +################################################################################ + +_dump_mem: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame +# +# first write a tape mark +# + bas %r14,_tapemark-0b(%r13) +# +# write header +# + stck .Ldh_time-0b(%r13) # store time + stidp .Ldh_cpuid-0b(%r13) # store cpu id + la %r2,.Ldh_dumpheader-0b(%r13) # start of header + l %r3,.Lheader_size-0b(%r13) # size of header + lr %r4,%r3 # blocksize + bas %r14,_writer-0b(%r13) + +# +# write real storage to tape +# + + la %r2,0 # start + l %r3,.Ldh_mem_size+4-0b(%r13) # length + l %r4,.Lblock_size-0b(%r13) # blocksize + bas %r14,_writer-0b(%r13) # write page +# +# write end marker +# + stck .Ld_end_time-0b(%r13) # store end time + la %r2,.Ld_endmarker-0b(%r13) # address of end marker + la %r3,END_MARKER_SIZE # size of end marker + la %r4,END_MARKER_SIZE # blocksize + bas %r14,_writer-0b(%r13) +# +# write another tape mark +# + bas %r14,_tapemark-0b(%r13) + + lm %r6,%r15,120(%r15) + br %r14 # return to caller +.Lheader_size: .long HEADER_SIZE +.Lblock_size: .long BLOCK_SIZE + +################################################################################ +# subroutine for writing to tape +# Parameters: +# -r2: start address +# -r3: length +# -r4: blocksize +################################################################################ + +_writer: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + + lr %r10,%r2 # save start address + lr %r11,%r3 # save length + ar %r11,%r2 # end address + lr %r12,%r4 # save blocksize + + st %r10,.Lccwwrite+4-0b(%r13) # initialize CCW data addresses + sth %r12,.Lccwwrite+2-0b(%r13) # setup blocksize +.Lldlp: + l %r2,IPL_SC # subchannel id + la %r3,.Lorbwrite-0b(%r13) # address of orb + la %r4,.Lirb-0b(%r13) # address of irb + la %r5,10 # 10 retries + bas %r14,_ssch-0b(%r13) # write chunk of PAGE_SIZE bytes + + l %r0,.Lccwwrite+4-0b(%r13) # update CCW data addresses + ar %r0,%r12 # add block size + st %r0,.Lccwwrite+4-0b(%r13) + clr %r0,%r11 # enough ? + bl .Lldlp-0b(%r13) + + lm %r6,%r15,120(%r15) + br %r14 + +################################################################################ +# write tapemark +################################################################################ + +_tapemark: + stm %r6,%r15,24(%r15) + basr %r13,0 # base register +0: s %r15,.Lc96-0b(%r13) # create stack frame + + l %r2,IPL_SC # subchannel id + la %r3,.Lorbmark-0b(%r13) # r12 = address of orb + la %r4,.Lirb-0b(%r13) # r5 = address of irb + la %r5,10 # retries + bas %r14,_ssch-0b(%r13) # write a tape mark + + lm %r6,%r15,120(%r15) + br %r14 # return to caller + +################################################################################ +# expand Macros +################################################################################ + +dump_common_fn +device_fn +io_subroutines + +################################################################################ +# DATA +################################################################################ + +# extern functions + +.Lpanik: + .long _panik +.Lenable_device: + .long _enable_device +.Ltake_dump: + .long _take_dump + +# irbs, orbs etc. + + .align 8 +.Lorbwrite: + .long 0x00000000,0x0080ff00,.Lccwwrite + .align 8 +.Lorbmark: + .long 0x00000000,0x0080ff00,.Lccwmark + .align 8 +.Lccwwrite: + .long 0x01200000,0x00000000 +.Lccwmark: + .long 0x1f200001,0x00000000 + +.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.org IPL_BS diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/ipldump.S linux.20p9/arch/s390/boot/ipldump.S --- linux.vanilla/arch/s390/boot/ipldump.S Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/boot/ipldump.S Thu Jan 1 01:00:00 1970 @@ -1,179 +0,0 @@ -/* - * arch/s390/boot/ipldump.S - * - * S390 version - * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), - * - * Tape dump ipl record. Put it on a tape and ipl from it and it will - * write a dump of the real storage after the ipl record on that tape. - */ - -#include -#include -#include - -#define IPL_BS 1024 - .org 0 - .long 0x00080000,0x80000000+_start # The first 24 bytes are loaded - .long 0x07000000,0x60000001 # by ipl to addresses 0-23. - .long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs). - .long 0x00000000,0x00000000 - .long 0x00000000,0x00000000 # svc old psw - .long 0x00000000,0x00000000 # program check old psw - .long 0x00000000,0x00000000 # machine check old psw - .long 0x00000000,0x00000000 # io old psw - .long 0x00000000,0x00000000 - .long 0x00000000,0x00000000 - .long 0x00000000,0x00000000 - .long 0x000a0000,0x00000058 # external new psw - .long 0x000a0000,0x00000060 # svc new psw - .long 0x000a0000,0x00000068 # program check new psw - .long 0x000a0000,0x00000070 # machine check new psw - .long 0x00080000,0x80000000+.Lioint # io new psw - - .org 0x100 - .globl _start -_start: - l %r1,0xb8 # load ipl subchannel number -# -# find out memory size -# - mvc 104(8,0),.Lpcmem0 # setup program check handler - slr %r3,%r3 - lhi %r2,1 - sll %r2,20 -.Lloop0: - l %r0,0(%r3) # test page - ar %r3,%r2 # add 1M - jnm .Lloop0 # r1 < 0x80000000 -> loop -.Lchkmem0: - n %r3,.L4malign0 # align to multiples of 4M - st %r3,.Lmemsize # store memory size -.Lmemok: - -# -# first write a tape mark -# - bras %r14,.Ltapemark -# -# write real storage to tape -# - slr %r2,%r2 # start at address 0 - bras %r14,.Lwriter # load ramdisk -# -# write another tape mark -# - bras %r14,.Ltapemark -# -# everything written, stop processor -# - lpsw .Lstopped -# -# subroutine for writing to tape -# Paramters: -# R1 = device number -# R2 = start address -# R3 = length -.Lwriter: - st %r14,.Lldret - la %r12,.Lorbread # r12 = address of orb - la %r5,.Lirb # r5 = address of irb - st %r2,.Lccwwrite+4 # initialize CCW data addresses - lctl %c6,%c6,.Lcr6 - slr %r2,%r2 -.Lldlp: - lhi %r6,3 # 3 retries -.Lssch: - ssch 0(%r12) # write chunk of IPL_BS bytes - jnz .Llderr -.Lw4end: - bras %r14,.Lwait4io - tm 8(%r5),0x82 # do we have a problem ? - jnz .Lrecov - l %r0,.Lccwwrite+4 # update CCW data addresses - ahi %r0,IPL_BS - st %r0,.Lccwwrite+4 - clr %r0,%r3 # enough ? - jl .Lldlp -.Ldone: - l %r14,.Lldret - br %r14 # r2 contains the total size -.Lrecov: - bras %r14,.Lsense # do the sensing - brct %r6,.Lssch # dec. retry count & branch - j .Llderr -.Ltapemark: - st %r14,.Lldret - la %r12,.Lorbmark # r12 = address of orb - la %r5,.Lirb # r5 = address of irb - lctl %c6,%c6,.Lcr6 - ssch 0(%r12) # write a tape mark - jnz .Llderr - bras %r14,.Lwait4io - l %r14,.Lldret - br %r14 -# -# Sense subroutine -# -.Lsense: - st %r14,.Lsnsret - la %r7,.Lorbsense - ssch 0(%r7) # start sense command - jnz .Llderr - bras %r14,.Lwait4io - l %r14,.Lsnsret - tm 8(%r5),0x82 # do we have a problem ? - jnz .Llderr - br %r14 -# -# Wait for interrupt subroutine -# -.Lwait4io: - lpsw .Lwaitpsw -.Lioint: - c %r1,0xb8 # compare subchannel number - jne .Lwait4io - tsch 0(%r5) - slr %r0,%r0 - tm 8(%r5),0x82 # do we have a problem ? - jnz .Lwtexit - tm 8(%r5),0x04 # got device end ? - jz .Lwait4io -.Lwtexit: - br %r14 -.Llderr: - lpsw .Lcrash - - .align 8 -.Lorbread: - .long 0x00000000,0x0080ff00,.Lccwwrite - .align 8 -.Lorbsense: - .long 0x00000000,0x0080ff00,.Lccwsense - .align 8 -.Lorbmark: - .long 0x00000000,0x0080ff00,.Lccwmark - .align 8 -.Lccwwrite: - .long 0x01200000+IPL_BS,0x00000000 -.Lccwsense: - .long 0x04200001,0x00000000 -.Lccwmark: - .long 0x1f200001,0x00000000 -.Lwaitpsw: - .long 0x020a0000,0x80000000+.Lioint - -.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -.Lcr6: .long 0xff000000 - .align 8 -.Lcrash:.long 0x000a0000,0x00000000 -.Lstopped: .long 0x000a0000,0x00001234 -.Lpcmem0:.long 0x00080000,0x80000000 + .Lchkmem0 -.L4malign0:.long 0xffc00000 -.Lmemsize:.long 0 -.Lldret:.long 0 -.Lsnsret: .long 0 - - .org IPL_BS - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/defconfig linux.20p9/arch/s390/defconfig --- linux.vanilla/arch/s390/defconfig Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/defconfig Wed Aug 8 22:14:20 2001 @@ -1,5 +1,5 @@ # -# Automatically generated by make menuconfig: don't edit +# Automatically generated make config: don't edit # CONFIG_ARCH_S390=y @@ -7,7 +7,7 @@ # Code maturity level options # CONFIG_EXPERIMENTAL=y -CONFIG_PROCESS_DEBUG=n +# CONFIG_PROCESS_DEBUG is not set # # Processor type and features @@ -42,11 +42,15 @@ # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_RAM_SIZE=24576 CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_XPRAM=m # CONFIG_MDISK is not set CONFIG_DASD=y + +# +# DASD disciplines +# CONFIG_DASD_ECKD=y CONFIG_DASD_FBA=y CONFIG_DASD_MDSK=y @@ -55,6 +59,10 @@ # S/390 Network device support # CONFIG_NETDEVICES=y + +# +# S390 Network devices +# CONFIG_CTC=y CONFIG_IUCV=y # CONFIG_DUMMY is not set @@ -68,6 +76,15 @@ CONFIG_3215_CONSOLE=y CONFIG_HWC=y CONFIG_HWC_CONSOLE=y + +# +# S/390 character device drivers +# +# CONFIG_S390_TAPE is not set + +# +# Character devices +# CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 @@ -88,16 +105,26 @@ # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set # CONFIG_IP_ALIAS is not set # CONFIG_SYN_COOKIES is not set + +# +# (it is safe to leave these untouched) +# # CONFIG_INET_RARP is not set CONFIG_SKB_LARGE=y # CONFIG_IPV6 is not set + +# +# +# # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set +# CONFIG_NET_DIVERT is not set # CONFIG_LLC is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -141,8 +168,10 @@ # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_NFSD=y -# CONFIG_NFSD_SUN is not set +# CONFIG_NFSD_V3 is not set +# CONFIG_NFSD_TCP is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set @@ -153,6 +182,7 @@ # # CONFIG_BSD_DISKLABEL is not set # CONFIG_MAC_PARTITION is not set +# CONFIG_MINIX_SUBPARTITION is not set # CONFIG_SMD_DISKLABEL is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/entry.S linux.20p9/arch/s390/kernel/entry.S --- linux.vanilla/arch/s390/kernel/entry.S Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/entry.S Wed Aug 8 22:14:11 2001 @@ -657,11 +657,10 @@ lh %r7,__LC_PGM_ILC # load instruction length pgm_no_sv: lh %r8,__LC_PGM_INT_CODE # N.B. saved int code used later KEEP it - stosm 24(%r15),0x03 # reenable interrupts lr %r3,%r8 la %r0,0x7f nr %r3,%r0 # clear per-event-bit - be BASED(pgm_dn) # none of Martins exceptions occured bypass + be BASED(pgm_dn) # none of Martins exceptions occurred bypass l %r9,BASED(.Ljump_table) sll %r3,2 l %r9,0(%r3,%r9) # load address of handler routine @@ -672,6 +671,9 @@ l %r5,SP_PSW+4(15) # load psw addr sr %r5,%r7 # substract ilc from psw st %r5,SP_PSW+4(15) # store corrected psw addr +pgm_per:cl %r3,BASED(.Lc20) # pseudo page fault ? + be BASED(pgm_go) # if yes then don't reenable interrupts + stosm 24(%r15),0x03 # reenable interrupts pgm_go: basr %r14,%r9 # branch to interrupt-handler pgm_dn: la %r0,0x80 nr %r8,%r0 # check for per exception @@ -834,6 +836,7 @@ .Lc_ac: .long 0,0,1 .Lc_ENOSYS: .long -ENOSYS .Lc4: .long 4 +.Lc20: .long 20 .Lc0x1202: .long 0x1202 .Lc0x1004: .long 0x1004 .Lc0x2401: .long 0x2401 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/process.c linux.20p9/arch/s390/kernel/process.c --- linux.vanilla/arch/s390/kernel/process.c Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/kernel/process.c Wed Jul 4 16:03:53 2001 @@ -404,7 +404,7 @@ error = do_execve(filename, (char **) regs.gprs[3], (char **) regs.gprs[4], ®s); if (error == 0) { - current->flags &= ~PF_DTRACE; + current->ptrace &= ~PT_DTRACE; current->tss.fp_regs.fpc=0; if(MACHINE_HAS_IEEE) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/ptrace.c linux.20p9/arch/s390/kernel/ptrace.c --- linux.vanilla/arch/s390/kernel/ptrace.c Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -435,10 +435,10 @@ if (request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) goto out; /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; ret = 0; goto out; } @@ -459,9 +459,9 @@ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) + if (child->ptrace & PT_PTRACED) goto out; - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; if (child->p_pptr != current) { REMOVE_LINKS(child); @@ -478,7 +478,7 @@ /* ieee_instruction_pointer from the user structure DJB */ if(child!=current) { - if (!(child->flags & PF_PTRACED)) + if (!(child->ptrace & PT_PTRACED)) goto out; if (child->state != TASK_STOPPED) { @@ -524,9 +524,9 @@ if ((unsigned long) data >= _NSIG) break; if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; /* make sure the single step bit is not set. */ clear_single_step(child); @@ -553,7 +553,7 @@ ret = -EIO; if ((unsigned long) data >= _NSIG) break; - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; set_single_step(child); /* give it a chance to run. */ @@ -565,7 +565,7 @@ ret = -EIO; if ((unsigned long) data >= _NSIG) break; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); wake_up_process(child); child->exit_code = data; REMOVE_LINKS(child); @@ -593,8 +593,8 @@ asmlinkage void syscall_trace(void) { lock_kernel(); - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) goto out; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/reipl.S linux.20p9/arch/s390/kernel/reipl.S --- linux.vanilla/arch/s390/kernel/reipl.S Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/reipl.S Wed Aug 8 22:14:20 2001 @@ -55,7 +55,7 @@ .Ldispsw: .long 0x000a0000,0x00000000 .Liplccws: .long 0x02000000,0x60000018 .long 0x08000008,0x20000001 -.Liplorb: .long 0x0049504c,0x0000ff80 +.Liplorb: .long 0x0049504c,0x0040ff80 .long 0x00000000+.Liplccws .Lschib: .long 0x00000000,0x00000000 .long 0x00000000,0x00000000 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/s390io.c linux.20p9/arch/s390/kernel/s390io.c --- linux.vanilla/arch/s390/kernel/s390io.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/s390io.c Wed Aug 8 22:14:20 2001 @@ -6,6 +6,9 @@ * Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (adlung@de.ibm.com) + * + * ChangeLog : 03/14/2001 Ingo Adlung Save not_oper func pointer prior + * to wipe it out */ #include @@ -121,7 +124,10 @@ } } - +/* + * Note : internal use of irqflags SA_PROBE for NOT path grouping + * + */ int s390_request_irq_special( int irq, io_handler_func_t io_handler, not_oper_handler_func_t not_oper_handler, @@ -172,7 +178,8 @@ { if ( !retval ) { - s390_DevicePathVerification( irq, 0 ); + if ( !(irqflags & SA_PROBE)) + s390_DevicePathVerification( irq, 0 ); } else { @@ -1947,6 +1954,7 @@ int new_irq; #endif int use_irq = irq; + int cpu = smp_processor_id(); // // fix me !!! @@ -1974,6 +1982,7 @@ } /* endif */ + irq_enter(cpu, use_irq); s390irq_spin_lock(use_irq); #ifdef CONFIG_FAST_IRQ @@ -2012,6 +2021,7 @@ #endif /* CONFIG_FAST_IRQ */ s390irq_spin_unlock(use_irq); + irq_exit(cpu, use_irq); return; } @@ -2141,9 +2151,28 @@ * secondary status are presented with different interrupts. */ if ( ioinfo[irq]->devstat.ii.irb.scsw.stctl - & ( SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_INTER_STATUS ) ) - { - ioinfo[irq]->devstat.rescnt = ioinfo[irq]->devstat.ii.irb.scsw.count; + & ( SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_INTER_STATUS ) ) { + + /* + * If the subchannel status shows status pending + * and we received a check condition, the count + * information is not meaningful. + */ + + if ( !( (dp->ii.irb.scsw.stctl & SCSW_STCTL_STATUS_PEND) + && ( dp->ii.irb.scsw.cstat + & ( SCHN_STAT_CHN_DATA_CHK + | SCHN_STAT_CHN_CTRL_CHK + | SCHN_STAT_INTF_CTRL_CHK + | SCHN_STAT_PROG_CHECK + | SCHN_STAT_PROT_CHECK + | SCHN_STAT_CHAIN_CHECK )))) { + + dp->rescnt = dp->ii.irb.scsw.count; + } else { + dp->rescnt = SENSE_MAX_COUNT; + } + ioinfo[irq]->devstat.cpa = ioinfo[irq]->devstat.ii.irb.scsw.cpa; #ifdef CONFIG_DEBUG_IO @@ -3363,7 +3392,7 @@ { ret = request_irq( irq, init_IRQ_handler, - 0, "RDC", &devstat ); + SA_PROBE, "RDC", &devstat ); if ( !ret ) { @@ -3519,7 +3548,7 @@ pdevstat = &devstat; ret = request_irq( irq, init_IRQ_handler, - 0, "RCD", pdevstat ); + SA_PROBE, "RCD", pdevstat ); if ( !ret ) { @@ -3961,9 +3990,9 @@ int irq_ret; devstat_t devstat; - irq_ret = request_irq( irq, + irq_ret = request_irq( irq, init_IRQ_handler, - 0, + SA_PROBE, "INIT", &devstat); @@ -4028,8 +4057,6 @@ } /* endif */ #endif - s390_DevicePathVerification( irq, 0 ); - disable_cpu_sync_isc( irq ); ioinfo[irq]->ui.flags.syncio = 0; // global @@ -4463,7 +4490,7 @@ * requests and evaluate the devstat area on return therefore * we don't need a real I/O handler in place. */ - irq_ret = request_irq( irq, init_IRQ_handler, 0, "SID", &devstat); + irq_ret = request_irq( irq, init_IRQ_handler, SA_PROBE, "SID", &devstat); if ( irq_ret == 0 ) inlreq = 1; @@ -4972,6 +4999,7 @@ ccw1_t spid_ccw[2]; /* ccw area for SPID command */ devstat_t devstat; /* required by request_irq() */ devstat_t *pdevstat = &devstat; + unsigned long flags; int irq_ret = 0; /* return code */ int retry = 5; /* retry count */ @@ -5005,7 +5033,7 @@ */ irq_ret = request_irq( irq, init_IRQ_handler, - 0, + SA_PROBE, "SPID", pdevstat); @@ -5020,7 +5048,7 @@ if ( irq_ret == 0 ) { - s390irq_spin_lock( irq); + s390irq_spin_lock_irqsave( irq, flags); spid_ccw[0].cmd_code = 0x5B; /* suspend multipath reconnect */ spid_ccw[0].cda = 0; @@ -5093,9 +5121,9 @@ } /* endif */ } -#ifdef CONFIG_DEBUG_IO else { +#ifdef CONFIG_DEBUG_IO printk( "SPID - device %04X," " unit check," " retry %d, cnt %02d," @@ -5112,9 +5140,10 @@ pdevstat->ii.sense.data[5], pdevstat->ii.sense.data[6], pdevstat->ii.sense.data[7]); - - } /* endif */ #endif + retry--; + } /* endif */ + } else if ( pdevstat->flag & DEVSTAT_NOT_OPER ) { @@ -5140,7 +5169,7 @@ } while ( retry > 0 ); - s390irq_spin_unlock( irq); + s390irq_spin_unlock_irqrestore( irq, flags); /* * If we installed the irq action handler we have to @@ -5170,6 +5199,7 @@ int irq_ret = 0; /* return code */ int retry = 5; /* retry count */ int inlreq = 0; /* inline request_irq() */ + unsigned long flags; if ( (irq > highest_subchannel) || (irq < 0 ) ) { @@ -5198,7 +5228,7 @@ */ irq_ret = request_irq( irq, init_IRQ_handler, - 0, + SA_PROBE, "SNID", pdevstat); @@ -5214,7 +5244,7 @@ if ( irq_ret == 0 ) { - s390irq_spin_lock( irq); + s390irq_spin_lock_irqsave( irq, flags); snid_ccw.cmd_code = CCW_CMD_SENSE_PGID; snid_ccw.cda = (__u32)virt_to_phys( pgid ); @@ -5324,7 +5354,7 @@ } while ( retry > 0 ); - s390irq_spin_unlock( irq); + s390irq_spin_unlock_irqrestore( irq, flags); /* * If we installed the irq action handler we have to @@ -5372,10 +5402,10 @@ * If the device isn't known yet * we can't lock it ... */ - if ( ioinfo[irq] != INVALID_STORAGE_AREA ) + if ( ioinfo[irq] != INVALID_STORAGE_AREA ) { s390irq_spin_lock( irq ); - lock = 1; + lock = 1; dev_oper = ioinfo[irq]->ui.flags.oper; @@ -5417,20 +5447,21 @@ if ( ioinfo[irq] != INVALID_STORAGE_AREA ) { + not_oper_handler_func_t nopfunc = ioinfo[irq]->nopfunc; + if ( ioinfo[irq]->ui.flags.oper == 0 ) - { - /* - * If the device has gone - * call not oper handler - */ - if ( ( dev_oper == 1 ) - && ( ioinfo[irq]->nopfunc != NULL ) ) - { + { + /* + * If the device has gone + * call not oper handler + */ + if ( ( dev_oper == 1 ) + && ( nopfunc != NULL ) ) { - free_irq( irq, + free_irq( irq, ioinfo[irq]->irq_desc.action->dev_id ); - ioinfo[irq]->nopfunc( irq, - DEVSTAT_DEVICE_GONE ); + nopfunc( irq, DEVSTAT_DEVICE_GONE ); + } /* endif */ } else @@ -5466,10 +5497,10 @@ * ... it is and was operational, but * the devno may have changed */ - else if ( ioinfo[irq]->devno != dev_no ) + else if ( ( ioinfo[irq]->devno != dev_no ) + && ( nopfunc != NULL ) ) { - ioinfo[irq]->nopfunc( irq, - DEVSTAT_REVALIDATE ); + nopfunc( irq, DEVSTAT_REVALIDATE ); } /* endif */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/setup.c linux.20p9/arch/s390/kernel/setup.c --- linux.vanilla/arch/s390/kernel/setup.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/setup.c Wed Aug 8 22:14:20 2001 @@ -273,6 +273,8 @@ break; if (cn == '\n') cn = ' '; /* replace newlines with space */ + if (cn == 0x0d) + cn = ' '; /* replace 0x0d with space */ if (cn == ' ' && c == ' ') continue; /* remove additional spaces */ c = cn; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/signal.c linux.20p9/arch/s390/kernel/signal.c --- linux.vanilla/arch/s390/kernel/signal.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/signal.c Wed Aug 8 22:14:20 2001 @@ -301,6 +301,7 @@ /* Set up registers for signal handler */ regs->gprs[15] = (addr_t)frame; regs->psw.addr = FIX_PSW(ka->sa.sa_handler); + regs->psw.mask = _USER_PSW_MASK; } /* Set up to return from userspace. If provided, use a stub already in userspace. */ @@ -461,7 +462,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; @@ -529,12 +530,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: - lock_kernel(); - if (current->binfmt - && current->binfmt->core_dump - && current->binfmt->core_dump(signr, regs)) + if (do_coredump(signr, regs)) exit_code |= 0x80; - unlock_kernel(); /* FALLTHRU */ default: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/smp.c linux.20p9/arch/s390/kernel/smp.c --- linux.vanilla/arch/s390/kernel/smp.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/kernel/smp.c Wed Aug 8 22:14:20 2001 @@ -426,7 +426,33 @@ void smp_send_stop(void) { - smp_signal_others(sigp_stop_and_store_status, 0, TRUE, NULL); + int i; + u32 dummy; + unsigned long low_core_addr; + + /* write magic number to zero page (absolute 0) */ + + get_cpu_lowcore(smp_processor_id()).panic_magic = __PANIC_MAGIC; + + /* stop all processors */ + + smp_signal_others(sigp_stop, 0, TRUE, NULL); + + /* store status of all processors in their lowcores (real 0) */ + + for (i = 0; i < smp_num_cpus; i++) { + if (smp_processor_id() != i) { + int ccode; + low_core_addr = (unsigned long)&get_cpu_lowcore(i); + do { + ccode = signal_processor_ps( + &dummy, + low_core_addr, + i, + sigp_store_status_at_address); + } while(ccode == sigp_busy); + } + } } /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/traps.c linux.20p9/arch/s390/kernel/traps.c --- linux.vanilla/arch/s390/kernel/traps.c Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/kernel/traps.c Wed Aug 8 22:14:11 2001 @@ -37,6 +37,8 @@ #include #endif +#include "cpcmd.h" + /* Called from entry.S only */ extern void handle_per_exception(struct pt_regs *regs); @@ -44,6 +46,7 @@ pgm_check_handler_t *pgm_check_table[128]; extern pgm_check_handler_t do_page_fault; +extern pgm_check_handler_t do_pseudo_page_fault; static inline void console_verbose(void) { @@ -94,7 +97,7 @@ { if(regs->psw.mask&PSW_PROBLEM_STATE) { - if(current->flags & PF_PTRACED) + if(current->ptrace & PT_PTRACED) force_sig(signal,current); else return(TRUE); @@ -113,7 +116,7 @@ return(FALSE); } -DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler); +DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler) DO_ERROR(SIGILL, "privileged operation", privileged_op) DO_ERROR(SIGILL, "execute exception", execute_exception) DO_ERROR(SIGSEGV, "addressing exception", addressing_exception) @@ -317,18 +320,20 @@ pgm_check_table[1] = &illegal_op; pgm_check_table[2] = &privileged_op; pgm_check_table[3] = &execute_exception; + pgm_check_table[4] = &do_page_fault; pgm_check_table[5] = &addressing_exception; pgm_check_table[6] = &specification_exception; pgm_check_table[7] = &data_exception; pgm_check_table[9] = ÷_exception; + pgm_check_table[0x10] = &do_page_fault; + pgm_check_table[0x11] = &do_page_fault; pgm_check_table[0x12] = &translation_exception; pgm_check_table[0x13] = &special_op_exception; + pgm_check_table[0x14] = &do_pseudo_page_fault; pgm_check_table[0x15] = &operand_exception; - pgm_check_table[4] = &do_page_fault; - pgm_check_table[0x10] = &do_page_fault; - pgm_check_table[0x11] = &do_page_fault; pgm_check_table[0x1C] = &privileged_op; - + if (MACHINE_IS_VM) + cpcmd("SET PAGEX ON", NULL, 0); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/mm/fault.c linux.20p9/arch/s390/mm/fault.c --- linux.vanilla/arch/s390/mm/fault.c Sun Mar 25 17:31:55 2001 +++ linux.20p9/arch/s390/mm/fault.c Wed Aug 8 22:14:11 2001 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -243,3 +244,123 @@ goto no_context; } +typedef struct _pseudo_wait_t { + struct _pseudo_wait_t *next; + wait_queue_head_t queue; + unsigned long address; + int resolved; +} pseudo_wait_t; + +static pseudo_wait_t *pseudo_lock_queue = NULL; +static spinlock_t pseudo_wait_spinlock; /* spinlock to protect lock queue */ + +/* + * This routine handles pseudo page faults. + */ +asmlinkage void +do_pseudo_page_fault(struct pt_regs *regs, unsigned long error_code) +{ + DECLARE_WAITQUEUE(wait, current); + pseudo_wait_t wait_struct; + pseudo_wait_t *ptr, *last, *next; + unsigned long psw_mask; + unsigned long address; + int kernel_address; + + /* + * get psw mask of Program old psw to find out, + * if user or kernel mode + */ + psw_mask = S390_lowcore.program_old_psw.mask; + + /* + * get the failing address + * more specific the segment and page table portion of + * the address + */ + address = S390_lowcore.trans_exc_code & 0xfffff000; + + if (address & 0x80000000) { + /* high bit set -> a page has been swapped in by VM */ + address &= 0x7fffffff; + spin_lock(&pseudo_wait_spinlock); + last = NULL; + ptr = pseudo_lock_queue; + while (ptr != NULL) { + next = ptr->next; + if (address == ptr->address) { + /* + * This is one of the processes waiting + * for the page. Unchain from the queue. + * There can be more than one process + * waiting for the same page. VM presents + * an initial and a completion interrupt for + * every process that tries to access a + * page swapped out by VM. + */ + if (last == NULL) + pseudo_lock_queue = next; + else + last->next = next; + /* now wake up the process */ + ptr->resolved = 1; + wake_up(&ptr->queue); + } else + last = ptr; + ptr = next; + } + spin_unlock(&pseudo_wait_spinlock); + } else { + /* Pseudo page faults in kernel mode is a bad idea */ + if (!(psw_mask & PSW_PROBLEM_STATE)) { + /* + * VM presents pseudo page faults if the interrupted + * state was not disabled for interrupts. So we can + * get pseudo page fault interrupts while running + * in kernel mode. We simply access the page here + * while we are running disabled. VM will then swap + * in the page synchronously. + */ + kernel_address = 0; + switch (S390_lowcore.trans_exc_code & 3) { + case 0: /* Primary Segment Table Descriptor */ + kernel_address = 1; + break; + case 1: /* STD determined via access register */ + if (S390_lowcore.exc_access_id == 0 || + regs->acrs[S390_lowcore.exc_access_id]==0) + kernel_address = 1; + break; + case 2: /* Secondary Segment Table Descriptor */ + case 3: /* Home Segment Table Descriptor */ + break; + } + if (kernel_address) + /* dereference a virtual kernel address */ + __asm__ __volatile__ ( + " ic 0,0(%0)" + : : "a" (address) : "0"); + else + /* dereference a virtual user address */ + __asm__ __volatile__ ( + " la 2,0(%0)\n" + " sacf 512\n" + " ic 2,0(2)\n" + " sacf 0" + : : "a" (address) : "2" ); + + return; + } + /* initialize and add element to pseudo_lock_queue */ + init_waitqueue_head (&wait_struct.queue); + wait_struct.address = address; + wait_struct.resolved = 0; + spin_lock(&pseudo_wait_spinlock); + wait_struct.next = pseudo_lock_queue; + pseudo_lock_queue = &wait_struct; + spin_unlock(&pseudo_wait_spinlock); + /* go to sleep */ + wait_event(wait_struct.queue, wait_struct.resolved); + } +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c linux.20p9/arch/s390/tools/dasdfmt/dasdfmt.c --- linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/s390/tools/dasdfmt/dasdfmt.c Wed Jul 4 16:03:53 2001 @@ -479,7 +479,7 @@ rc=stat(dev_name,&stat_buf); if (rc) { - ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \ + ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \ "%s\n",prog_name,strerror(errno)); } else { if (!S_ISBLK(stat_buf.st_mode)) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/entry.S linux.20p9/arch/sparc/kernel/entry.S --- linux.vanilla/arch/sparc/kernel/entry.S Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/sparc/kernel/entry.S Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.159.2.8 2000/10/05 04:17:17 anton Exp $ +/* $Id: entry.S,v 1.159.2.9 2001/06/18 12:26:13 davem Exp $ * arch/sparc/kernel/entry.S: Sparc trap low-level entry points. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -1237,8 +1237,8 @@ call C_LABEL(do_ptrace) add %sp, REGWIN_SZ, %o0 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1287,8 +1287,8 @@ call C_LABEL(do_sigpause) add %sp, REGWIN_SZ, %o1 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1305,8 +1305,8 @@ call C_LABEL(do_sigsuspend) add %sp, REGWIN_SZ, %o0 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1324,8 +1324,8 @@ call C_LABEL(do_rt_sigsuspend) add %sp, REGWIN_SZ, %o2 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1342,8 +1342,8 @@ call C_LABEL(do_sigreturn) add %sp, REGWIN_SZ, %o0 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1362,8 +1362,8 @@ call C_LABEL(do_rt_sigreturn) add %sp, REGWIN_SZ, %o0 - ld [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 + ld [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be 1f nop @@ -1500,9 +1500,9 @@ mov %i1, %o1 mov %i2, %o2 - ld [%curptr + AOFF_task_flags], %l5 + ld [%curptr + AOFF_task_ptrace], %l5 mov %i3, %o3 - andcc %l5, 0x20, %g0 + andcc %l5, 0x02, %g0 mov %i4, %o4 bne linux_syscall_trace mov %i0, %l5 @@ -1514,12 +1514,12 @@ .globl C_LABEL(ret_sys_call) C_LABEL(ret_sys_call): - ld [%curptr + AOFF_task_flags], %l6 + ld [%curptr + AOFF_task_ptrace], %l6 cmp %o0, -ENOIOCTLCMD ld [%sp + REGWIN_SZ + PT_PSR], %g3 set PSR_C, %g2 bgeu 1f - andcc %l6, 0x20, %l6 + andcc %l6, 0x02, %l6 /* System call success, clear Carry condition code. */ andn %g3, %g2, %g3 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/ptrace.c linux.20p9/arch/sparc/kernel/ptrace.c --- linux.vanilla/arch/sparc/kernel/ptrace.c Sun Mar 25 17:31:47 2001 +++ linux.20p9/arch/sparc/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -535,12 +535,12 @@ #endif if(request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) { + if (current->ptrace & PT_PTRACED) { pt_error_return(regs, EPERM); goto out; } /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; pt_succ_return(regs, 0); goto out; } @@ -578,11 +578,11 @@ goto out; } /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) { + if (child->ptrace & PT_PTRACED) { pt_error_return(regs, EPERM); goto out; } - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if(child->p_pptr != current) { REMOVE_LINKS(child); @@ -594,7 +594,7 @@ pt_succ_return(regs, 0); goto out; } - if (!(child->flags & PF_PTRACED) + if (!(child->ptrace & PT_PTRACED) && ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH)) && (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) { pt_error_return(regs, ESRCH); @@ -861,9 +861,9 @@ } if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; #ifdef DEBUG_PTRACE @@ -900,7 +900,7 @@ pt_error_return(regs, EIO); goto out; } - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); wake_up_process(child); child->exit_code = data; write_lock_irqsave(&tasklist_lock, flags); @@ -927,8 +927,8 @@ #ifdef DEBUG_PTRACE printk("%s [%d]: syscall_trace\n", current->comm, current->pid); #endif - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/signal.c linux.20p9/arch/sparc/kernel/signal.c --- linux.vanilla/arch/sparc/kernel/signal.c Sun Mar 25 17:31:46 2001 +++ linux.20p9/arch/sparc/kernel/signal.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.91.2.2 2000/05/28 19:13:21 ecd Exp $ +/* $Id: signal.c,v 1.91.2.4 2001/06/19 16:49:41 davem Exp $ * linux/arch/sparc/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -1139,7 +1139,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { current->exit_code = signr; current->state = TASK_STOPPED; @@ -1203,7 +1203,7 @@ continue; case SIGSTOP: - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) continue; current->state = TASK_STOPPED; current->exit_code = signr; @@ -1217,14 +1217,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: - if(current->binfmt && current->binfmt->core_dump) { - lock_kernel(); - if(current->binfmt && - current->binfmt->core_dump && - current->binfmt->core_dump(signr, regs)) - exit_code |= 0x80; - unlock_kernel(); - } + if (do_coredump(signr, regs)) + exit_code |= 0x80; #ifdef DEBUG_SIGNALS /* Very useful to debug dynamic linker problems */ printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/lib/memset.S linux.20p9/arch/sparc/lib/memset.S --- linux.vanilla/arch/sparc/lib/memset.S Sun Mar 25 17:31:47 2001 +++ linux.20p9/arch/sparc/lib/memset.S Wed Jul 4 16:03:53 2001 @@ -185,7 +185,7 @@ b 30f add %o0, %o1, %o0 30: -/* %o4 is faulting address, %o5 is %pc where fault occured */ +/* %o4 is faulting address, %o5 is %pc where fault occurred */ save %sp, -104, %sp mov %i5, %o0 mov %i7, %o1 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c linux.20p9/arch/sparc64/kernel/binfmt_aout32.c --- linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/binfmt_aout32.c Thu Jul 26 15:53:51 2001 @@ -33,13 +33,17 @@ #include static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs); -static int load_aout32_library(int fd); -static int aout32_core_dump(long signr, struct pt_regs * regs); +static int load_aout32_library(struct file *file); +static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *); extern void dump_thread(struct pt_regs *, struct user *); static struct linux_binfmt aout32_format = { - NULL, NULL, load_aout32_binary, load_aout32_library, aout32_core_dump + module: THIS_MODULE, + load_binary: load_aout32_binary, + load_shlib: load_aout32_library, + core_dump: aout32_core_dump, + min_coredump: PAGE_SIZE, }; static void set_brk(unsigned long start, unsigned long end) @@ -87,46 +91,18 @@ * dumping of the process results in another error.. */ -static inline int -do_aout32_core_dump(long signr, struct pt_regs * regs) +static int +aout32_core_dump(long signr, struct pt_regs * regs, struct file * file) { - struct dentry * dentry = NULL; - struct inode * inode = NULL; - struct file * file; mm_segment_t fs; int has_dumped = 0; - char corefile[6+sizeof(current->comm)]; unsigned long dump_start, dump_size; struct user dump; # define START_DATA(u) (u.u_tsize) # define START_STACK(u) ((regs->u_regs[UREG_FP]) & ~(PAGE_SIZE - 1)) - if (!current->dumpable || atomic_read(¤t->mm->count) != 1) - return 0; - current->dumpable = 0; - -/* See if we have enough room to write the upage. */ - if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE) - return 0; fs = get_fs(); set_fs(KERNEL_DS); - memcpy(corefile,"core.",5); -#if 0 - memcpy(corefile+5,current->comm,sizeof(current->comm)); -#else - corefile[4] = '\0'; -#endif - file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); - if (IS_ERR(file)) - goto end_coredump; - dentry = file->f_dentry; - inode = dentry->d_inode; - if (!S_ISREG(inode->i_mode)) - goto close_coredump; - if (!inode->i_op || !inode->i_op->default_file_ops) - goto close_coredump; - if (!file->f_op->write) - goto close_coredump; has_dumped = 1; current->flags |= PF_DUMPCORE; strncpy(dump.u_comm, current->comm, sizeof(current->comm)); @@ -172,23 +148,10 @@ set_fs(KERNEL_DS); DUMP_WRITE(current,sizeof(*current)); close_coredump: - filp_close(file, NULL); -end_coredump: set_fs(fs); return has_dumped; } -static int -aout32_core_dump(long signr, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_aout32_core_dump(signr, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* * create_aout32_tables() parses the env- and arg-strings in new user * memory and creates the pointer tables from them, and puts their @@ -242,8 +205,7 @@ * libraries. There is no binary dependent code anywhere else. */ -static inline int do_load_aout32_binary(struct linux_binprm * bprm, - struct pt_regs * regs) +static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct exec ex; struct file * file; @@ -357,16 +319,12 @@ } } beyond_if: + set_binfmt(&aout32_format); if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); - current->binfmt = &aout32_format; if (current->exec_domain && current->exec_domain->module) __MOD_INC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_INC_USE_COUNT(current->binfmt->module); set_brk(current->mm->start_brk, current->mm->brk); @@ -375,28 +333,14 @@ p = (unsigned long) create_aout32_tables((char *)p, bprm); current->mm->start_stack = p; start_thread32(regs, ex.a_entry, p); - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); return 0; } - -static int -load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout32_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* N.B. Move to .h file and use code in fs/binfmt_aout.c? */ -static inline int -do_load_aout32_library(int fd) +static int load_aout32_library(struct file *file) { - struct file * file; struct inode * inode; unsigned long bss, start_addr, len; unsigned long error; @@ -404,12 +348,6 @@ loff_t offset = 0; struct exec ex; - retval = -EACCES; - file = fget(fd); - if (!file) - goto out; - if (!file->f_op) - goto out_putf; inode = file->f_dentry->d_inode; retval = -ENOEXEC; @@ -463,23 +401,9 @@ retval = 0; out_putf: - fput(file); -out: - return retval; -} - -static int -load_aout32_library(int fd) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout32_library(fd); - MOD_DEC_USE_COUNT; return retval; } - __initfunc(int init_aout32_binfmt(void)) { return register_binfmt(&aout32_format); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/devices.c linux.20p9/arch/sparc64/kernel/devices.c --- linux.vanilla/arch/sparc64/kernel/devices.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/devices.c Wed Jul 4 16:03:53 2001 @@ -73,6 +73,15 @@ prom_cpu_nodes[0] = prom_node_cpu; +#ifndef __SMP__ + { + extern unsigned int up_clock_tick; + up_clock_tick = prom_getintdefault(prom_node_cpu, + "clock-frequency", + 0); + } +#endif + mem_start = central_probe(mem_start); cpu_probe(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/entry.S linux.20p9/arch/sparc64/kernel/entry.S --- linux.vanilla/arch/sparc64/kernel/entry.S Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/entry.S Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.103.2.6 2000/09/08 14:00:04 jj Exp $ +/* $Id: entry.S,v 1.103.2.7 2001/06/18 12:26:13 davem Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -880,8 +880,8 @@ add %o7, 1f-.-4, %o7 nop .align 32 -1: ldx [%curptr + AOFF_task_flags], %l5 - andcc %l5, 0x20, %g0 +1: ldx [%curptr + AOFF_task_ptrace], %l5 + andcc %l5, 0x02, %g0 be,pt %icc, rtrap clr %l6 call syscall_trace @@ -1015,12 +1015,12 @@ mov %i4, %o4 ! IEU1 lduw [%l7 + %l4], %l7 ! Load srl %i1, 0, %o1 ! IEU0 Group - ldx [%curptr + AOFF_task_flags], %l0 ! Load + ldx [%curptr + AOFF_task_ptrace], %l0 ! Load mov %i5, %o5 ! IEU1 srl %i2, 0, %o2 ! IEU0 Group mov %i0, %l5 ! IEU1 - andcc %l0, 0x20, %g0 ! IEU1 Group + andcc %l0, 0x02, %g0 ! IEU1 Group bne,pn %icc, linux_syscall_trace32 ! CTI srl %i3, 0, %o3 ! IEU0 call %l7 ! CTI Group brk forced @@ -1044,11 +1044,11 @@ mov %i1, %o1 ! IEU1 lduw [%l7 + %l4], %l7 ! Load 4: mov %i2, %o2 ! IEU0 Group - ldx [%curptr + AOFF_task_flags], %l0 ! Load + ldx [%curptr + AOFF_task_ptrace], %l0 ! Load mov %i3, %o3 ! IEU1 mov %i4, %o4 ! IEU0 Group - andcc %l0, 0x20, %g0 ! IEU1 Group+1 bubble + andcc %l0, 0x02, %g0 ! IEU1 Group+1 bubble bne,pn %icc, linux_syscall_trace ! CTI Group mov %i0, %l5 ! IEU0 2: call %l7 ! CTI Group brk forced @@ -1059,14 +1059,14 @@ call syscall_trace_exit add %sp, STACK_BIAS + REGWIN_SZ, %o1 #endif - ldx [%curptr + AOFF_task_flags], %l6 + ldx [%curptr + AOFF_task_ptrace], %l6 sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3 cmp %o0, -ENOIOCTLCMD sllx %g2, 32, %g2 bgeu,pn %xcc, 1f - andcc %l6, 0x20, %l6 + andcc %l6, 0x02, %l6 /* System call success, clear Carry condition code. */ andn %g3, %g2, %g3 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/ioctl32.c linux.20p9/arch/sparc64/kernel/ioctl32.c --- linux.vanilla/arch/sparc64/kernel/ioctl32.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/sparc64/kernel/ioctl32.c Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.62.2.18 2001/01/26 22:26:07 davem Exp $ +/* $Id: ioctl32.c,v 1.62.2.21 2001/06/08 01:34:11 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -492,10 +493,19 @@ } } if (!err) { - if (i <= ifc32.ifc_len) + if (ifc32.ifcbuf == 0) { + /* Translate from 64-bit structure multiple to + * a 32-bit one. + */ + i = ifc.ifc_len; + i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32)); ifc32.ifc_len = i; - else - ifc32.ifc_len = i - sizeof (struct ifreq32); + } else { + if (i <= ifc32.ifc_len) + ifc32.ifc_len = i; + else + ifc32.ifc_len = i - sizeof (struct ifreq32); + } if (copy_to_user((struct ifconf32 *)arg, &ifc32, sizeof(struct ifconf32))) err = -EFAULT; } @@ -2682,6 +2692,8 @@ case /* STOP_ARRAY */ _IO (MD_MAJOR, 0x32): case /* STOP_ARRAY_RO */ _IO (MD_MAJOR, 0x33): case /* RESTART_ARRAY_RW */ _IO (MD_MAJOR, 0x34): + case /* PRINT_RAID_DEBUG */ _IO (MD_MAJOR, 0x13): + case /* SET_DISK_FAULTY */ _IO (MD_MAJOR, 0x29): /* Big K */ case PIO_FONT: @@ -3136,6 +3148,13 @@ case DRM_IOCTL_FINISH: #endif /* DRM */ + /* Misc. */ + case 0x41545900: /* ATYIO_CLKR */ + case 0x41545901: /* ATYIO_CLKW */ + case PCIIOC_CONTROLLER: + case PCIIOC_MMAP_IS_IO: + case PCIIOC_MMAP_IS_MEM: + case PCIIOC_WRITE_COMBINE: error = sys_ioctl (fd, cmd, arg); goto out; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/irq.c linux.20p9/arch/sparc64/kernel/irq.c --- linux.vanilla/arch/sparc64/kernel/irq.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/irq.c Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.76.2.3 2000/03/02 02:03:27 davem Exp $ +/* $Id: irq.c,v 1.76.2.4 2001/06/04 06:51:17 ecd Exp $ * irq.c: UltraSparc IRQ handling/init/registry. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -1048,6 +1048,8 @@ unsigned char flags = bp->flags; nbp = __bucket(bp->irq_chain); + bp->irq_chain = 0; + if((flags & IBF_ACTIVE) != 0) { if((flags & IBF_MULTI) == 0) { struct irqaction *ap = bp->irq_info; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/process.c linux.20p9/arch/sparc64/kernel/process.c --- linux.vanilla/arch/sparc64/kernel/process.c Sun Mar 25 17:31:52 2001 +++ linux.20p9/arch/sparc64/kernel/process.c Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.92.2.3 1999/12/05 07:24:38 davem Exp $ +/* $Id: process.c,v 1.92.2.4 2001/06/03 13:41:48 ecd Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) @@ -116,6 +116,7 @@ extern void (*prom_palette)(int); extern int serial_console; #endif +extern void (*prom_keyboard)(void); void machine_halt(void) { @@ -126,6 +127,8 @@ if (!serial_console && prom_palette) prom_palette (1); #endif + if (prom_keyboard) + prom_keyboard(); prom_halt(); panic("Halt failed!"); } @@ -144,6 +147,8 @@ if (!serial_console && prom_palette) prom_palette (1); #endif + if (prom_keyboard) + prom_keyboard(); if (cmd) prom_reboot(cmd); if (*reboot_command) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/psycho.c linux.20p9/arch/sparc64/kernel/psycho.c --- linux.vanilla/arch/sparc64/kernel/psycho.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/psycho.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: psycho.c,v 1.85.2.11 2000/10/24 21:00:53 davem Exp $ +/* $Id: psycho.c,v 1.85.2.13 2001/06/28 01:31:12 davem Exp $ * psycho.c: Ultra/AX U2P PCI controller support. * * Copyright (C) 1997 David S. Miller (davem@caipfs.rutgers.edu) @@ -682,12 +682,26 @@ static inline struct pci_vma *pci_vma_alloc(void) { - return kmalloc(sizeof(struct pci_vma), GFP_ATOMIC); + struct pci_vma *vma = kmalloc(sizeof(struct pci_vma), GFP_ATOMIC); + + if (!vma) { + prom_printf("PCI: Critical error, cannot allocate PCI_VMA.\n"); + prom_halt(); + } + + return vma; } static inline struct pcidev_cookie *pci_devcookie_alloc(void) { - return kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC); + struct pcidev_cookie *cookie = kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC); + + if (!cookie) { + prom_printf("PCI: Critical error, cannot allocate PCIDEV_COOKIE.\n"); + prom_halt(); + } + + return cookie; } @@ -804,18 +818,48 @@ } } +static void __init pci_fixup_host_bridge_self(struct pci_bus *pbus) +{ + struct pci_dev *pdev; + + for (pdev = pbus->devices; pdev; pdev = pdev->sibling) { + if (pdev->class >> 8 == PCI_CLASS_BRIDGE_HOST) { + pbus->self = pdev; + return; + } + } + + prom_printf("PCI: Critical error, cannot find host bridge PDEV.\n"); + prom_halt(); +} + +static struct pcidev_cookie * __init pci_alloc_hostbridge_cookie(struct linux_pbm_info *pbm) +{ + struct pcidev_cookie *cookie = pci_devcookie_alloc(); + + memset(cookie, 0, sizeof(*cookie)); + cookie->pbm = pbm; + + return cookie; +} + static void __init sabre_probe(struct linux_psycho *sabre) { struct pci_bus *pbus = sabre->pci_bus; static unsigned char busno = 0; + sabre->pbms_same_domain = 1; + pbus->number = pbus->secondary = busno; pbus->sysdata = sabre; pbus->subordinate = pci_scan_bus(pbus); busno = pbus->subordinate + 1; - for(pbus = pbus->children; pbus; pbus = pbus->next) { + pci_fixup_host_bridge_self(pbus); + pbus->self->sysdata = pci_alloc_hostbridge_cookie(&sabre->pbm_A); + + for (pbus = pbus->children; pbus; pbus = pbus->next) { if (pbus->number == sabre->pbm_A.pci_first_busno) memcpy(&sabre->pbm_A.pci_bus, pbus, sizeof(*pbus)); if (pbus->number == sabre->pbm_B.pci_first_busno) @@ -845,6 +889,9 @@ pbus->subordinate = pci_scan_bus(pbus); + pci_fixup_host_bridge_self(pbus); + pbus->self->sysdata = pci_alloc_hostbridge_cookie(pbm); + /* * Set the maximum subordinate bus of this pbm. */ @@ -1852,20 +1899,21 @@ /* Slot determination is only slightly complex. Handle * the easy case first. + * + * Basically, device number zero on the top-level bus is + * always the PCI host controller. Slot 0 is then device 1. + * PBM A supports two external slots (0 and 1), and PBM B + * supports 4 external slots (0, 1, 2, and 3). On-board PCI + * devices are wired to device numbers outside of these + * ranges. -DaveM */ if(pdev->bus->number == pbm->pci_first_busno) { - if(pbm == &pbm->parent->pbm_A) - slot = (pdev->devfn >> 3) - 1; - else - slot = (pdev->devfn >> 3) - 2; + slot = (pdev->devfn >> 3) - 1; } else { /* Underneath a bridge, use slot number of parent * bridge. */ - if(pbm == &pbm->parent->pbm_A) - slot = (pdev->bus->self->devfn >> 3) - 1; - else - slot = (pdev->bus->self->devfn >> 3) - 2; + slot = (pdev->bus->self->devfn >> 3) - 1; /* Use low slot number bits of child as IRQ line. */ line = (pdev->devfn >> 3) & 0x03; @@ -2082,6 +2130,8 @@ if (apb_present(psycho)) { sabre_probe(psycho); } else { + psycho->pbms_same_domain = 0; + /* Probe busses under PBM B. */ pbm_probe(&psycho->pbm_B); @@ -2656,4 +2706,148 @@ return str; } +/* Platform support for /proc/bus/pci/X/Y mmap()s. */ + +/* Adjust vm_offset of VMA such that it is the physical page offset corresponding + * to the 32-bit pci bus offset for DEV requested by the user. + * + * Basically, the user finds the base address for his device which he wishes + * to mmap. They read the 32-bit value from the config space base register, + * add whatever PAGE_SIZE multiple offset they wish, and feed this into the + * offset parameter of mmap on /proc/bus/pci/XXX for that device. + * + * Returns negative error code on failure, zero on success. + */ +static __inline__ int __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state) +{ + unsigned long user_offset = vma->vm_offset; + unsigned long user32 = user_offset & 0xffffffffUL; + unsigned long largest_base, this_base, addr32; + int i; + + /* Figure out which base address this is for. */ + largest_base = 0UL; + for (i = 0; i <= 6; i++) { + unsigned long base = dev->base_address[i]; + + /* Active? */ + if (!base) + continue; + + /* Same type? */ + if (i == 6) { + if (mmap_state != pci_mmap_mem) + continue; + } else { + if ((mmap_state == pci_mmap_io && + (base & PCI_BASE_ADDRESS_SPACE_IO) == 0) || + (mmap_state == pci_mmap_mem && + (base & PCI_BASE_ADDRESS_SPACE_IO) != 0)) + continue; + } + + this_base = base; + + addr32 = (this_base & PAGE_MASK) & 0xffffffffUL; + + if (mmap_state == pci_mmap_io) + addr32 &= 0xffffff; + + if (addr32 <= user32 && this_base > largest_base) + largest_base = this_base; + } + + if (largest_base == 0UL) + return -EINVAL; + + largest_base = __pa(largest_base); + + /* Now construct the final physical address. */ + if (mmap_state == pci_mmap_io) + vma->vm_offset = (((largest_base & ~0xffffffUL) | user32) & PAGE_MASK); + else + vma->vm_offset = (((largest_base & ~0xffffffffUL) | user32) & PAGE_MASK); + + return 0; +} + +/* Set vm_flags of VMA, as appropriate for this architecture, for a pci device + * mapping. + */ +static __inline__ void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state) +{ + vma->vm_flags |= (VM_SHM | VM_LOCKED); +} + +/* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci + * device mapping. + */ +static __inline__ void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state) +{ + /* Our io_remap_page_range takes care of this, do nothing. */ +} + +extern int io_remap_page_range(unsigned long from, unsigned long offset, + unsigned long size, pgprot_t prot, int space); + +/* Perform the actual remap of the pages for a PCI device mapping, as appropriate + * for this architecture. The region in the process to map is described by vm_start + * and vm_end members of VMA, the base physical address is found in vm_pgoff. + * The pci device structure is provided so that architectures may make mapping + * decisions on a per-device or per-bus basis. + * + * Returns a negative error code on failure, zero on success. + */ +int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, + int write_combine) +{ + int ret; + + ret = __pci_mmap_make_offset(dev, vma, mmap_state); + if (ret < 0) + return ret; + + __pci_mmap_set_flags(dev, vma, mmap_state); + __pci_mmap_set_pgprot(dev, vma, mmap_state); + + ret = io_remap_page_range(vma->vm_start, + (vma->vm_offset | + (write_combine ? 0x1UL : 0x0UL)), + vma->vm_end - vma->vm_start, vma->vm_page_prot, 0); + if (ret) + return ret; + + vma->vm_flags |= VM_IO; + return 0; +} + +/* Return the index of the PCI controller for device PDEV. */ + +int pci_controller_num(struct pci_dev *pdev) +{ + struct pcidev_cookie *cookie = pdev->sysdata; + int ret; + + if (cookie != NULL) { + struct linux_pbm_info *pbm = cookie->pbm; + + if (pbm == NULL || pbm->parent == NULL) { + ret = -ENXIO; + } else { + ret = pbm->parent->index; + if (!pbm->parent->pbms_same_domain) + ret = ((ret << 1) + + ((pbm == &pbm->parent->pbm_B) ? 1 : 0)); + } + } else { + ret = -ENXIO; + } + + return ret; +} + #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/ptrace.c linux.20p9/arch/sparc64/kernel/ptrace.c --- linux.vanilla/arch/sparc64/kernel/ptrace.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/ptrace.c Wed Jul 4 16:03:53 2001 @@ -569,12 +569,12 @@ #endif if(request == PTRACE_TRACEME) { /* are we already being traced? */ - if (current->flags & PF_PTRACED) { + if (current->ptrace & PT_PTRACED) { pt_error_return(regs, EPERM); goto out; } /* set the ptrace bit in the process flags. */ - current->flags |= PF_PTRACED; + current->ptrace |= PT_PTRACED; pt_succ_return(regs, 0); goto out; } @@ -616,11 +616,11 @@ goto out; } /* the same process cannot be attached many times */ - if (child->flags & PF_PTRACED) { + if (child->ptrace & PT_PTRACED) { pt_error_return(regs, EPERM); goto out; } - child->flags |= PF_PTRACED; + child->ptrace |= PT_PTRACED; write_lock_irqsave(&tasklist_lock, flags); if(child->p_pptr != current) { REMOVE_LINKS(child); @@ -632,7 +632,7 @@ pt_succ_return(regs, 0); goto out; } - if (!(child->flags & PF_PTRACED) + if (!(child->ptrace & PT_PTRACED) && ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH)) && (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) { pt_error_return(regs, ESRCH); @@ -1064,9 +1064,9 @@ } if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; + child->ptrace |= PT_TRACESYS; else - child->flags &= ~PF_TRACESYS; + child->ptrace &= ~PT_TRACESYS; child->exit_code = data; #ifdef DEBUG_PTRACE @@ -1104,7 +1104,7 @@ pt_error_return(regs, EIO); goto out; } - child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; write_lock_irqsave(&tasklist_lock, flags); @@ -1139,8 +1139,8 @@ #ifdef DEBUG_PTRACE printk("%s [%d]: syscall_trace\n", current->comm, current->pid); #endif - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) + != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/setup.c linux.20p9/arch/sparc64/kernel/setup.c --- linux.vanilla/arch/sparc64/kernel/setup.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/setup.c Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.43.2.5 2000/10/02 02:05:37 anton Exp $ +/* $Id: setup.c,v 1.43.2.7 2001/06/03 13:41:48 ecd Exp $ * linux/arch/sparc64/kernel/setup.c * * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) @@ -65,6 +65,7 @@ #if CONFIG_SUN_CONSOLE void (*prom_palette)(int); #endif +void (*prom_keyboard)(void); asmlinkage void sys_sync(void); /* it's really int */ static void @@ -620,6 +621,10 @@ extern int smp_bogo(char *); extern int mmu_info(char *); +#ifndef __SMP__ +unsigned int up_clock_tick; +#endif + int get_cpuinfo(char *buffer) { int cpuid=smp_processor_id(); @@ -634,7 +639,8 @@ "ncpus probed\t: %d\n" "ncpus active\t: %d\n" #ifndef __SMP__ - "BogoMips\t: %lu.%02lu\n" + "Cpu0Bogo\t: %lu.%02lu\n" + "Cpu0ClkTck\t: %016lx\n" #endif , sparc_cpu_type[cpuid], @@ -642,7 +648,8 @@ prom_rev, prom_prev >> 16, (prom_prev >> 8) & 0xff, prom_prev & 0xff, linux_num_cpus, smp_num_cpus #ifndef __SMP__ - , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100 + , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100, + (unsigned long) up_clock_tick #endif ); #ifdef __SMP__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/signal.c linux.20p9/arch/sparc64/kernel/signal.c --- linux.vanilla/arch/sparc64/kernel/signal.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/signal.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.38.2.1 1999/06/14 00:36:21 davem Exp $ +/* $Id: signal.c,v 1.38.2.3 2001/06/19 16:49:41 davem Exp $ * arch/sparc64/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -850,7 +850,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { current->exit_code = signr; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); @@ -906,7 +906,7 @@ continue; case SIGSTOP: - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) continue; current->state = TASK_STOPPED; current->exit_code = signr; @@ -918,12 +918,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: - if(current->binfmt && current->binfmt->core_dump) { - lock_kernel(); - if(current->binfmt->core_dump(signr, regs)) - exit_code |= 0x80; - unlock_kernel(); - } + if (do_coredump(signr, regs)) + exit_code |= 0x80; #ifdef DEBUG_SIGNALS /* Very useful to debug the dynamic linker */ printk ("Sig %d going...\n", (int)signr); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/signal32.c linux.20p9/arch/sparc64/kernel/signal32.c --- linux.vanilla/arch/sparc64/kernel/signal32.c Sun Mar 25 17:31:52 2001 +++ linux.20p9/arch/sparc64/kernel/signal32.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: signal32.c,v 1.47.2.3 1999/12/20 01:14:06 davem Exp $ +/* $Id: signal32.c,v 1.47.2.5 2001/06/19 16:49:42 davem Exp $ * arch/sparc64/kernel/signal32.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -1279,7 +1279,7 @@ if (!signr) break; - if ((current->flags & PF_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { current->exit_code = signr; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); @@ -1335,7 +1335,7 @@ continue; case SIGSTOP: - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) continue; current->state = TASK_STOPPED; current->exit_code = signr; @@ -1347,14 +1347,8 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: - if(current->binfmt && current->binfmt->core_dump) { - lock_kernel(); - if(current->binfmt && - current->binfmt->core_dump && - current->binfmt->core_dump(signr, regs)) - exit_code |= 0x80; - unlock_kernel(); - } + if (do_coredump(signr, regs)) + exit_code |= 0x80; #ifdef DEBUG_SIGNALS /* Very useful to debug dynamic linker problems */ printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/smp.c linux.20p9/arch/sparc64/kernel/smp.c --- linux.vanilla/arch/sparc64/kernel/smp.c Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/kernel/smp.c Wed Jul 4 16:03:53 2001 @@ -77,15 +77,17 @@ for (i = 0; i < NR_CPUS; i++) if(cpu_present_map & (1UL << i)) len += sprintf(buf + len, - "Cpu%dBogo\t: %lu.%02lu\n", + "Cpu%dBogo\t: %lu.%02lu\n" + "Cpu%dClkTck\t: %016lx\n", i, cpu_data[i].udelay_val / (500000/HZ), - (cpu_data[i].udelay_val / (5000/HZ)) % 100); + (cpu_data[i].udelay_val / (5000/HZ)) % 100, + i, (unsigned long) cpu_data[i].clock_tick); return len; } __initfunc(void smp_store_cpu_info(int id)) { - int i; + int i, no; cpu_data[id].irq_count = 0; cpu_data[id].bh_count = 0; @@ -93,6 +95,13 @@ smp_setup_percpu_timer() */ cpu_data[id].udelay_val = loops_per_jiffy; + + for (no = 0; no < linux_num_cpus; no++) + if (linux_cpus[no].mid == id) + break; + + cpu_data[id].clock_tick = prom_getintdefault(linux_cpus[no].prom_node, + "clock-frequency", 0); cpu_data[id].pgcache_size = 0; cpu_data[id].pte_cache[0] = NULL; cpu_data[id].pte_cache[1] = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c linux.20p9/arch/sparc64/kernel/sparc64_ksyms.c --- linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/sparc64/kernel/sparc64_ksyms.c Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: sparc64_ksyms.c,v 1.58.2.13 2001/01/03 22:05:54 anton Exp $ +/* $Id: sparc64_ksyms.c,v 1.58.2.14 2001/03/01 00:48:59 davem Exp $ * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/sys_sparc32.c linux.20p9/arch/sparc64/kernel/sys_sparc32.c --- linux.vanilla/arch/sparc64/kernel/sys_sparc32.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/arch/sparc64/kernel/sys_sparc32.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: sys_sparc32.c,v 1.107.2.16 2000/12/20 02:45:00 anton Exp $ +/* $Id: sys_sparc32.c,v 1.107.2.17 2001/07/06 05:04:31 davem Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -3002,6 +3002,7 @@ { struct linux_binprm bprm; struct dentry * dentry; + int was_dumpable; int retval; int i; @@ -3029,6 +3030,9 @@ return bprm.envc; } + was_dumpable = current->dumpable; + current->dumpable = 0; + retval = prepare_binprm(&bprm); if(retval>=0) { @@ -3042,9 +3046,12 @@ if (retval >= 0) retval = search_binary_handler(&bprm,regs); - if(retval>=0) + + if (retval >= 0) { /* execve success */ + current->dumpable = bprm.dumpable; return retval; + } /* Something went wrong, return the inode and free the argument pages*/ if(bprm.dentry) @@ -3052,7 +3059,10 @@ for (i=0 ; idumpable = was_dumpable; + + return retval; } /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/solaris/entry64.S linux.20p9/arch/sparc64/solaris/entry64.S --- linux.vanilla/arch/sparc64/solaris/entry64.S Sun Mar 25 17:31:53 2001 +++ linux.20p9/arch/sparc64/solaris/entry64.S Wed Jul 4 16:03:53 2001 @@ -1,4 +1,4 @@ -/* $Id: entry64.S,v 1.5 1998/03/26 08:46:15 jj Exp $ +/* $Id: entry64.S,v 1.5.2.1 2001/06/18 12:26:13 davem Exp $ * entry64.S: Solaris syscall emulation entry point. * * Copyright (C) 1996,1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -83,7 +83,7 @@ 1: srl %i0, 0, %o0 lduw [%l7 + %l4], %l3 srl %i1, 0, %o1 - ldx [%g6 + AOFF_task_flags], %l5 + ldx [%g6 + AOFF_task_ptrace], %l5 cmp %l3, NR_SYSCALLS bleu,a,pn %xcc, linux_syscall_for_solaris sethi %hi(sys_call_table32), %l6 @@ -93,21 +93,21 @@ 10: srl %i2, 0, %o2 mov %i5, %o5 andn %l3, 3, %l7 - andcc %l5, 0x20, %g0 + andcc %l5, 0x02, %g0 bne,pn %icc, solaris_syscall_trace mov %i0, %l5 2: call %l7 srl %i3, 0, %o3 ret_from_solaris: stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] - ldx [%g6 + AOFF_task_flags], %l6 + ldx [%g6 + AOFF_task_ptrace], %l6 sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3 cmp %o0, -ENOIOCTLCMD sllx %g2, 32, %g2 bgeu,pn %xcc, 1f - andcc %l6, 0x20, %l6 + andcc %l6, 0x02, %l6 /* System call success, clear Carry condition code. */ andn %g3, %g2, %g3 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/Makefile linux.20p9/drivers/Makefile --- linux.vanilla/drivers/Makefile Sun Mar 25 17:31:34 2001 +++ linux.20p9/drivers/Makefile Wed Aug 8 22:18:17 2001 @@ -54,6 +54,10 @@ else ifeq ($(CONFIG_USB),m) MOD_SUB_DIRS += usb + else + ifdef CONFIG_INPUT_ADBHID + SUB_DIRS += usb + endif endif endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/Config.in linux.20p9/drivers/block/Config.in --- linux.vanilla/drivers/block/Config.in Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/block/Config.in Wed Jul 4 16:03:53 2001 @@ -140,7 +140,7 @@ tristate 'Compaq SMART2 support' CONFIG_BLK_CPQ_DA fi if [ "$CONFIG_PCI" = "y" ]; then - tristate 'Compaq CISS Array support' CONFIG_BLK_CPQ_CISS_DA + tristate 'Compaq Smart Array 5xxx support' CONFIG_BLK_CPQ_CISS_DA fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cciss.c linux.20p9/drivers/block/cciss.c --- linux.vanilla/drivers/block/cciss.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/cciss.c Wed Jul 4 16:03:53 2001 @@ -42,12 +42,12 @@ #include #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) -#define DRIVER_NAME "Compaq CISS Driver (v 1.0.0)" -#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,0) +#define DRIVER_NAME "Compaq CISS Driver (v 1.0.4)" +#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,4) /* Embedded module documentation macros - see modules.h */ MODULE_AUTHOR("Charles M. White III - Compaq Computer Corporation"); -MODULE_DESCRIPTION("Driver for Compaq Smart Array Controller 5300"); +MODULE_DESCRIPTION("Driver for Compaq Smart Array 5xxx Controllers "); #include "cciss_cmd.h" #include "cciss.h" @@ -61,6 +61,8 @@ */ static struct board_type products[] = { { 0x40700E11, "Smart Array 5300", &SA5_access }, + { 0x40800E11, "Smart Array 5i", &SA5B_access}, + { 0x40820E11, "Smart Array 532", &SA5B_access}, }; /* How long to wait (in millesconds) for board to go into simple mode */ @@ -135,10 +137,10 @@ ctlr = h->ctlr; size = sprintf(buffer, "%s: Compaq %s Controller\n" - " Board ID: %08lx\n" + " Board ID: 0x%08lx\n" " Firmware Version: %c%c%c%c\n" - " Memory Address: %08lx\n" - " IRQ: 0x%x\n" + " Memory Address: 0x%08lx\n" + " IRQ: %d\n" " Logical drives: %d\n" " Current Q depth: %d\n" " Current # commands on controller %d\n" @@ -416,6 +418,8 @@ put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg); return 0; case BLKRRPART: + if(!capable(CAP_SYS_ADMIN)) + return -EPERM; return revalidate_logvol(inode->i_rdev, 1); case CCISS_GETPCIINFO: @@ -719,7 +723,7 @@ spin_lock_irqsave(&io_request_lock, flags); if (hba[ctlr]->drv[target].usage_count > maxusage) { spin_unlock_irqrestore(&io_request_lock, flags); - printk(KERN_WARNING "cpqarray: Device busy for " + printk(KERN_WARNING "cciss: Device busy for " "revalidation (usage=%d)\n", hba[ctlr]->drv[target].usage_count); return -EBUSY; @@ -730,7 +734,7 @@ max_p = gdev->max_p; start = target << gdev->minor_shift; - for(i=max_p; i>=0; i--) { + for(i=max_p-1; i>=0; i--) { int minor = start+i; kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor); struct super_block *sb = get_super(devi); @@ -1125,7 +1129,7 @@ if (timeout) status = 0; if(cmd->err_info->CommandStatus != 0) - { /* an error has occured */ + { /* an error has occurred */ switch(cmd->err_info->CommandStatus) { case CMD_TARGET_STATUS: @@ -1369,7 +1373,7 @@ a &= ~3; if ((c = h->cmpQ) == NULL) { - printk(KERN_WARNING "cpqarray: Completion of %08lx ignored\n", (unsigned long)a1); + printk(KERN_WARNING "cciss: Completion of %08lx ignored\n", (unsigned long)a1); continue; } while(c->busaddr != a) { @@ -1437,7 +1441,7 @@ printk(" Heartbeat Counter = 0x%x\n\n\n", readl(&(tb->HeartBeat))); } -#endif /* CCISS_DEBUG */ +#endif /* CCISS_DEBUG */ static int cciss_pci_init(ctlr_info_t *c, unchar bus, unchar device_fn) { @@ -1447,7 +1451,9 @@ uint addr[6]; __u32 board_id; struct pci_dev *pdev; - + int cfg_offset; + int cfg_base_addr; + int cfg_base_addr_index; int i; pdev = pci_find_slot(bus, device_fn); @@ -1487,15 +1493,36 @@ * Memory base addr is first addr , the second points to the config * table */ - c->paddr = addr[0]; - c->vaddr = remap_pci_mem(c->paddr, 128); - c->cfgtable = (CfgTable_struct *) remap_pci_mem(addr[1], - sizeof(CfgTable_struct)); - c->board_id = board_id; + c->paddr = addr[0] & 0xfffffff0; /* remove the addressing mode bits */ +#ifdef CCISS_DEBUG + printk("address 0 = %x\n", c->paddr); +#endif /* CCISS_DEBUG */ + c->vaddr = remap_pci_mem(c->paddr, 200); + /* get the address index number */ + cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET); + /* I am not prepared to deal with a 64 bit address value */ + cfg_base_addr &= 0xffff; #ifdef CCISS_DEBUG - print_cfg_table(c->cfgtable); + printk("cfg base address = %x\n", cfg_base_addr); +#endif /* CCISS_DEBUG */ + cfg_base_addr_index = (cfg_base_addr - PCI_BASE_ADDRESS_0)/4; +#ifdef CCISS_DEBUG + printk("cfg base address index = %x\n", cfg_base_addr_index); +#endif /* CCISS_DEBUG */ + + cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); +#ifdef CCISS_DEBUG + printk("cfg offset = %x\n", cfg_offset); #endif /* CCISS_DEBUG */ + c->cfgtable = (CfgTable_struct *) + remap_pci_mem((addr[cfg_base_addr_index] & 0xfffffff0) + + cfg_offset, sizeof(CfgTable_struct)); + c->board_id = board_id; + +#ifdef CCISS_DEBUG + print_cfg_table(c->cfgtable); +#endif CCISS_DEBUG for(i=0; iproduct_name = products[i].product_name; @@ -1509,6 +1536,14 @@ (unsigned long)board_id); return -1; } + if ( (readb(&c->cfgtable->Signature[0]) != 'C') || + (readb(&c->cfgtable->Signature[1]) != 'I') || + (readb(&c->cfgtable->Signature[2]) != 'S') || + (readb(&c->cfgtable->Signature[3]) != 'S') ) + { + printk("Does not appear to be a valid CISS config table\n"); + return -1; + } #ifdef CCISS_DEBUG printk("Trying to put board into Simple mode\n"); #endif /* CCISS_DEBUG */ @@ -1550,14 +1585,22 @@ int index; unchar bus=0, dev_fn=0; - + + #define CCISS_BOARD_TYPES 2 + static int cciss_device_id[CCISS_BOARD_TYPES] = { + PCI_DEVICE_ID_COMPAQ_CISS, PCI_DEVICE_ID_COMPAQ_CISSB}; + int brdtype; + + /* search for all PCI board types that could be for this driver */ + for(brdtype=0; brdtypevaddr + SA5_REPLY_INTR_MASK_OFFSET); + } else /* Turn them off */ + { + writel( SA5B_INTR_OFF, + h->vaddr + SA5_REPLY_INTR_MASK_OFFSET); + } +} +/* * Returns true if fifo is full. * */ @@ -183,6 +204,21 @@ return 0 ; } +/* + * Returns true if an interrupt is pending.. + */ +static unsigned long SA5B_intr_pending(ctlr_info_t *h) +{ + unsigned long register_value = + readl(h->vaddr + SA5_INTR_STATUS); +#ifdef CCISS_DEBUG + printk("cciss: intr_pending %lx\n", register_value); +#endif /* CCISS_DEBUG */ + if( register_value & SA5B_INTR_PENDING) + return 1; + return 0 ; +} + static struct access_method SA5_access = { SA5_submit_command, @@ -192,6 +228,14 @@ SA5_completed, }; +static struct access_method SA5B_access = { + SA5_submit_command, + SA5B_intr_mask, + SA5_fifo_full, + SA5B_intr_pending, + SA5_completed, +}; + struct board_type { __u32 board_id; char *product_name; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cciss_cmd.h linux.20p9/drivers/block/cciss_cmd.h --- linux.vanilla/drivers/block/cciss_cmd.h Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/cciss_cmd.h Wed Jul 4 16:03:53 2001 @@ -125,20 +125,20 @@ //Command List Structure typedef union _SCSI3Addr_struct { struct { + BYTE Dev; BYTE Bus:6; BYTE Mode:2; // b00 - BYTE Dev; } PeripDev; struct { + BYTE DevLSB; BYTE DevMSB:6; BYTE Mode:2; // b01 - BYTE DevLSB; } LogDev; struct { - BYTE Targ:6; - BYTE Mode:2; // b10 BYTE Dev:5; BYTE Bus:3; + BYTE Targ:6; + BYTE Mode:2; // b10 } LogUnit; } SCSI3Addr_struct; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cpqarray.c linux.20p9/drivers/block/cpqarray.c --- linux.vanilla/drivers/block/cpqarray.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/cpqarray.c Wed Jul 4 16:03:53 2001 @@ -41,8 +41,8 @@ #define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) -#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.11)" -#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,11) +#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.12)" +#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,12) /* Embedded module documentation macros - see modules.h */ /* Original author Chris Frantz - Compaq Computer Corporation */ @@ -1167,6 +1167,8 @@ put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg); return 0; case BLKRRPART: + if(!capable(CAP_SYS_ADMIN)) + return -EPERM; return revalidate_logvol(inode->i_rdev, 1); case IDAPASSTHRU: if (!suser()) return -EPERM; @@ -1556,7 +1558,7 @@ max_p = gdev->max_p; start = target << gdev->minor_shift; - for(i=max_p; i>=0; i--) { + for(i=max_p-1; i>=0; i--) { int minor = start+i; kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor); struct super_block *sb = get_super(devi); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/genhd.c linux.20p9/drivers/block/genhd.c --- linux.vanilla/drivers/block/genhd.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/block/genhd.c Wed Jul 4 16:03:53 2001 @@ -336,7 +336,8 @@ goto done; /* nothing left to do */ hd->part[current_minor].nr_sects = NR_SECTS(p) * sector_size; /* JSt */ - hd->part[current_minor].start_sect = first_sector + START_SECT(p) * sector_size; + hd->part[current_minor].start_sect = + first_sector + START_SECT(p) * sector_size; this_sector = first_sector + START_SECT(p) * sector_size; dev = MKDEV(hd->major, current_minor); brelse(bh); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-cd.c linux.20p9/drivers/block/ide-cd.c --- linux.vanilla/drivers/block/ide-cd.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/block/ide-cd.c Wed Jul 4 16:03:53 2001 @@ -254,7 +254,7 @@ * They will disappear later when I get the time to * do it cleanly. * - Minimize the TOC reading - only do it when we - * know a media change has occured. + * know a media change has occurred. * - Moved all the CDROMREADx ioctls to the Uniform layer. * - Heiko Eissfeldt supplied * some fixes for CDI. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-dma.c linux.20p9/drivers/block/ide-dma.c --- linux.vanilla/drivers/block/ide-dma.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/ide-dma.c Wed Jul 4 16:03:53 2001 @@ -217,6 +217,20 @@ xcount = bcount & 0xffff; if (is_trm290_chipset) xcount = ((xcount >> 2) - 1) << 16; + if (xcount == 0x0000) { + /* + * Most chipsets correctly interpret a length of 0x0000 as 64KB, + * but at least one (e.g. CS5530) misinterprets it as zero (!). + * So here we break the 64KB entry into two 32KB entries instead. + */ + if (count++ >= PRD_ENTRIES) { + printk("%s: DMA table too small\n", drive->name); + return 0; /* revert to PIO for this request */ + } + *table++ = cpu_to_le32(0x8000); + *table++ = cpu_to_le32(addr + 0x8000); + xcount = 0x8000; + } *table++ = cpu_to_le32(xcount); addr += bcount; size -= bcount; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-floppy.c linux.20p9/drivers/block/ide-floppy.c --- linux.vanilla/drivers/block/ide-floppy.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/ide-floppy.c Wed Jul 4 16:03:54 2001 @@ -125,7 +125,7 @@ byte *current_position; /* Pointer into the above buffer */ void (*callback) (ide_drive_t *); /* Called when this packet command is completed */ byte pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */ - unsigned int flags; /* Status/Action bit flags */ + unsigned long flags; /* Status/Action bit flags */ } idefloppy_pc_t; /* @@ -259,7 +259,7 @@ idefloppy_flexible_disk_page_t flexible_disk_page; /* Copy of the flexible disk page */ int wp; /* Write protect */ - unsigned int flags; /* Status/Action flags */ + unsigned long flags; /* Status/Action flags */ } idefloppy_floppy_t; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-pmac.c linux.20p9/drivers/block/ide-pmac.c --- linux.vanilla/drivers/block/ide-pmac.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/block/ide-pmac.c Wed Aug 8 22:17:37 2001 @@ -97,7 +97,7 @@ /* Wait 2s for disk to answer on IDE bus after * enable operation. * NOTE: There is at least one case I know of a disk that needs about 10sec - * before anwering on the bus. I beleive we could add a kernel command + * before anwering on the bus. I believe we could add a kernel command * line arg to override this delay for such cases. */ #define IDE_WAKEUP_DELAY_MS 2000 @@ -192,9 +192,10 @@ } #endif -/* Setup timings for the selected drive (master/slave). I still need to verify if this - * is enough, I beleive selectproc will be called whenever an IDE command is started, - * but... */ +/* Setup timings for the selected drive (master/slave). I still need to + * verify if this is enough, I believe selectproc will be called whenever + * an IDE command is started, but... + */ static void pmac_ide_selectproc(ide_drive_t *drive) { @@ -905,7 +906,7 @@ * Problem: This can schedule. I moved the block device * wakeup almost late by priority because of that. */ - if (DRIVER(drive)) + if (DRIVER(drive) && DRIVER(drive)->media_change) DRIVER(drive)->media_change(drive); /* We kick the VFS too (see fix in ide.c revalidate) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide.c linux.20p9/drivers/block/ide.c --- linux.vanilla/drivers/block/ide.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/ide.c Wed Jul 4 16:03:54 2001 @@ -1298,9 +1298,10 @@ del_timer(&hwgroup->timer); if ((handler = hwgroup->handler) == NULL) { /* - * Either a marginal timeout occured (got the interrupt just as timer expired), - * or we were "sleeping" to give other devices a chance. Either way, we don't - * really want to complain about anything. + * Either a marginal timeout occurred (got the interrupt + * just as timer expired), or we were "sleeping" to give + * other devices a chance. Either way, we don't really + * want to complain about anything. */ if (hwgroup->sleeping) { hwgroup->sleeping = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ll_rw_blk.c linux.20p9/drivers/block/ll_rw_blk.c --- linux.vanilla/drivers/block/ll_rw_blk.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/block/ll_rw_blk.c Wed Aug 8 22:14:09 2001 @@ -1063,6 +1063,9 @@ #ifdef CONFIG_DASD dasd_init(); #endif +#if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_BLOCK) + tapeblock_init(); +#endif #ifdef CONFIG_BLK_DEV_XPRAM xpram_init(); #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/paride/pt.c linux.20p9/drivers/block/paride/pt.c --- linux.vanilla/drivers/block/paride/pt.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/block/paride/pt.c Thu Jul 26 15:04:24 2001 @@ -753,6 +753,10 @@ pt_rewind(unit); return 0; + case MTWEOF: + pt_write_fm(unit); + return 0; + default: printk("%s: Unimplemented mt_op %d\n",PT.name, mtop.mt_op); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/cdrom/cdrom.c linux.20p9/drivers/cdrom/cdrom.c --- linux.vanilla/drivers/cdrom/cdrom.c Sun Mar 25 18:44:42 2001 +++ linux.20p9/drivers/cdrom/cdrom.c Wed Jul 4 16:03:54 2001 @@ -514,12 +514,12 @@ couldn't close the tray. We only care that there is no disc in the drive, since that is the _REAL_ problem here.*/ - ret=-ENOMEDIUM; + ret = -ENOMEDIUM; goto clean_up_and_return; } } else { cdinfo(CD_OPEN, "bummer. this drive can't close the tray.\n"); - ret=-ENOMEDIUM; + ret = -ENOMEDIUM; goto clean_up_and_return; } /* Ok, the door should be closed now.. Check again */ @@ -527,7 +527,7 @@ if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) { cdinfo(CD_OPEN, "bummer. the tray is still not closed.\n"); cdinfo(CD_OPEN, "tray might not contain a medium.\n"); - ret=-ENOMEDIUM; + ret = -ENOMEDIUM; goto clean_up_and_return; } cdinfo(CD_OPEN, "the tray is now closed.\n"); @@ -540,7 +540,7 @@ cdrom_count_tracks(cdi, &tracks); if (tracks.error == CDS_NO_DISC) { cdinfo(CD_OPEN, "bummer. no disc.\n"); - ret=-ENOMEDIUM; + ret = -ENOMEDIUM; goto clean_up_and_return; } /* CD-Players which don't use O_NONBLOCK, workman @@ -1952,6 +1952,7 @@ ra.buf += (CD_FRAMESIZE_RAW * frames); ra.nframes -= frames; lba += frames; + if (frames>ra.nframes) frames=ra.nframes; } kfree(cgc.buffer); return ret; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/cdrom/sbpcd.c linux.20p9/drivers/cdrom/sbpcd.c --- linux.vanilla/drivers/cdrom/sbpcd.c Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/cdrom/sbpcd.c Thu Jul 26 14:56:04 2001 @@ -4261,7 +4261,7 @@ i=verify_area(VERIFY_READ, (void *) arg, sizeof(struct cdrom_read_audio)); if (i) RETURN_UP(i); copy_from_user(&read_audio, (void *) arg, sizeof(struct cdrom_read_audio)); - if (read_audio.nframes>D_S[d].sbp_audsiz) RETURN_UP(-EINVAL); + if (read_audio.nframes < 0 || read_audio.nframes>D_S[d].sbp_audsiz) RETURN_UP(-EINVAL); i=verify_area(VERIFY_WRITE, read_audio.buf, read_audio.nframes*CD_FRAMESIZE_RAW); if (i) RETURN_UP(i); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/Config.in linux.20p9/drivers/char/Config.in --- linux.vanilla/drivers/char/Config.in Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/char/Config.in Thu Jul 26 15:39:36 2001 @@ -53,8 +53,8 @@ tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION fi - dep_tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK m - dep_tristate 'HDLC line discipline support' CONFIG_N_HDLC m + tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK + tristate 'HDLC line discipline support' CONFIG_N_HDLC fi bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then @@ -102,7 +102,7 @@ tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT tristate ' Advantech SBC Watchdog Timer' CONFIG_ADVANTECH_WDT tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG - tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO + tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT tristate ' Software Watchdog' CONFIG_SOFT_WATCHDOG @@ -114,6 +114,7 @@ fi fi tristate ' WDT PCI Watchdog timer' CONFIG_WDTPCI + tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT endmenu fi @@ -136,6 +137,7 @@ bool ' AMD Irongate support' CONFIG_AGP_AMD bool ' Generic SiS support' CONFIG_AGP_SIS bool ' ALI M1541 support' CONFIG_AGP_ALI + bool ' Serverworks LE/HE support' CONFIG_AGP_SWORKS fi source drivers/char/drm/Config.in fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/Makefile linux.20p9/drivers/char/Makefile --- linux.vanilla/drivers/char/Makefile Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/char/Makefile Wed Jul 4 16:03:54 2001 @@ -184,12 +184,20 @@ endif endif -ifeq ($(CONFIG_SYNCLINK),m) +ifeq ($(CONFIG_SYNCLINK),y) +O_OBJS += synclink.o +else + ifeq ($(CONFIG_SYNCLINK),m) M_OBJS += synclink.o + endif endif -ifeq ($(CONFIG_N_HDLC),m) +ifeq ($(CONFIG_N_HDLC),y) +O_OBJS += n_hdlc.o +else + ifeq ($(CONFIG_N_HDLC),m) M_OBJS += n_hdlc.o + endif endif ifeq ($(CONFIG_SPECIALIX),y) @@ -373,6 +381,14 @@ endif endif +ifeq ($(CONFIG_MACHZ_WDT),y) +O_OBJS += machzwd.o +else + ifeq ($(CONFIG_MACHZ_WDT),m) + M_OBJS += machzwd.o + endif +endif + ifeq ($(CONFIG_RTC),y) O_OBJS += rtc.o endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/acquirewdt.c linux.20p9/drivers/char/acquirewdt.c --- linux.vanilla/drivers/char/acquirewdt.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/acquirewdt.c Thu Jul 26 15:24:25 2001 @@ -107,7 +107,7 @@ break; default: - return -ENOIOCTLCMD; + return -ENOTTY; } return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/advantechwdt.c linux.20p9/drivers/char/advantechwdt.c --- linux.vanilla/drivers/char/advantechwdt.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/char/advantechwdt.c Thu Jul 26 15:24:33 2001 @@ -119,7 +119,7 @@ break; default: - return -ENOIOCTLCMD; + return -ENOTTY; } return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agp.h linux.20p9/drivers/char/agp/agp.h --- linux.vanilla/drivers/char/agp/agp.h Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/agp/agp.h Thu Jul 26 18:03:50 2001 @@ -94,7 +94,7 @@ u32 mode; enum chipset_type type; enum aper_size_type size_type; - u32 *key_list; + unsigned long *key_list; atomic_t current_memory_agp; atomic_t agp_in_use; int max_memory_agp; /* in number of pages */ @@ -119,15 +119,17 @@ int (*remove_memory) (agp_memory *, off_t, int); agp_memory *(*alloc_by_type) (size_t, int); void (*free_by_type) (agp_memory *); + unsigned long (*agp_alloc_page) (void); + void (*agp_destroy_page) (unsigned long); }; #define OUTREG32(mmap, addr, val) writel((val),(mmap + (addr))) #define OUTREG16(mmap, addr, val) writew((val),(mmap + (addr))) -#define OUTREG8 (mmap, addr, val) writeb((val),(mmap + (addr))) +#define OUTREG8(mmap, addr, val) writeb((val),(mmap + (addr))) #define INREG32(mmap, addr) readl(mmap + (addr)) #define INREG16(mmap, addr) readw(mmap + (addr)) -#define INREG8 (mmap, addr) readb(mmap + (addr)) +#define INREG8(mmap, addr) readb(mmap + (addr)) #define CACHE_FLUSH agp_bridge.cache_flush #define A_SIZE_8(x) ((aper_size_info_8 *) x) @@ -222,6 +224,24 @@ #ifndef PCI_DEVICE_ID_VIA_8363_0 #define PCI_DEVICE_ID_VIA_8363_0 0x0305 #endif +#ifndef PCI_DEVICE_ID_AL_M1621_0 +#define PCI_DEVICE_ID_AL_M1621_0 0x1621 +#endif +#ifndef PCI_DEVICE_ID_AL_M1631_0 +#define PCI_DEVICE_ID_AL_M1631_0 0x1631 +#endif +#ifndef PCI_DEVICE_ID_AL_M1632_0 +#define PCI_DEVICE_ID_AL_M1632_0 0x1632 +#endif +#ifndef PCI_DEVICE_ID_AL_M1641_0 +#define PCI_DEVICE_ID_AL_M1641_0 0x1641 +#endif +#ifndef PCI_DEVICE_ID_AL_M1647_0 +#define PCI_DEVICE_ID_AL_M1647_0 0x1647 +#endif +#ifndef PCI_DEVICE_ID_AL_M1651_0 +#define PCI_DEVICE_ID_AL_M1651_0 0x1651 +#endif /* intel register */ @@ -283,5 +303,29 @@ #define ALI_AGPCTRL 0xb8 #define ALI_ATTBASE 0xbc #define ALI_TLBCTRL 0xc0 +#define ALI_TAGCTRL 0xc4 +#define ALI_CACHE_FLUSH_CTRL 0xD0 +#define ALI_CACHE_FLUSH_ADDR_MASK 0xFFFFF000 +#define ALI_CACHE_FLUSH_EN 0x100 + + +/* Serverworks Registers */ +#define SVWRKS_APSIZE 0x10 +#define SVWRKS_SIZE_MASK 0xfe000000 + +#define SVWRKS_MMBASE 0x14 +#define SVWRKS_CACHING 0x4b +#define SVWRKS_FEATURE 0x68 + +/* func 1 registers */ +#define SVWRKS_AGP_ENABLE 0x60 +#define SVWRKS_COMMAND 0x04 + +/* Memory mapped registers */ +#define SVWRKS_GART_CACHE 0x02 +#define SVWRKS_GATTBASE 0x04 +#define SVWRKS_TLBFLUSH 0x10 +#define SVWRKS_POSTFLUSH 0x14 +#define SVWRKS_DIRFLUSH 0x0c #endif /* _AGP_BACKEND_PRIV_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agpgart_be.c linux.20p9/drivers/char/agp/agpgart_be.c --- linux.vanilla/drivers/char/agp/agpgart_be.c Sun Mar 25 17:37:30 2001 +++ linux.20p9/drivers/char/agp/agpgart_be.c Thu Jul 26 18:02:17 2001 @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -67,7 +67,7 @@ { #if defined(__i386__) asm volatile ("wbinvd":::"memory"); -#elif defined(__alpha__) +#elif defined(__alpha__) || defined(__ia64__) || defined(__sparc__) /* ??? I wonder if we'll really need to flush caches, or if the core logic can manage to keep the system coherent. The ARM speaks only of using `cflush' to get things in memory in @@ -125,47 +125,6 @@ } /* - * Basic Page Allocation Routines - - * These routines handle page allocation - * and by default they reserve the allocated - * memory. They also handle incrementing the - * current_memory_agp value, Which is checked - * against a maximum value. - */ - -static unsigned long agp_alloc_page(void) -{ - void *pt; - - pt = (void *) __get_free_page(GFP_KERNEL); - if (pt == NULL) { - return 0; - } - atomic_inc(&mem_map[MAP_NR(pt)].count); - set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); - atomic_inc(&agp_bridge.current_memory_agp); - return (unsigned long) pt; -} - -static void agp_destroy_page(unsigned long page) -{ - void *pt = (void *) page; - - if (pt == NULL) { - return; - } - atomic_dec(&mem_map[MAP_NR(pt)].count); - clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); -#if 0 - wake_up(&mem_map[MAP_NR(pt)].wait); -#endif - free_page((unsigned long) pt); - atomic_dec(&agp_bridge.current_memory_agp); -} - -/* End Basic Page Allocation Routines */ - -/* * Generic routines for handling agp_memory structures - * They use the basic page allocation routines to do the * brunt of the work. @@ -239,7 +198,7 @@ if (curr->page_count != 0) { for (i = 0; i < curr->page_count; i++) { curr->memory[i] &= ~(0x00000fff); - agp_destroy_page((unsigned long) + agp_bridge.agp_destroy_page((unsigned long) phys_to_virt(curr->memory[i])); } } @@ -281,7 +240,7 @@ return NULL; } for (i = 0; i < page_count; i++) { - new->memory[i] = agp_alloc_page(); + new->memory[i] = agp_bridge.agp_alloc_page(); if (new->memory[i] == 0) { /* Free this structure */ @@ -782,6 +741,44 @@ kfree(curr); } +/* + * Basic Page Allocation Routines - + * These routines handle page allocation + * and by default they reserve the allocated + * memory. They also handle incrementing the + * current_memory_agp value, Which is checked + * against a maximum value. + */ + +static unsigned long agp_generic_alloc_page(void) +{ + void *pt; + + pt = (void *) __get_free_page(GFP_KERNEL); + if (pt == NULL) { + return 0; + } + atomic_inc(&mem_map[MAP_NR(pt)].count); + set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); + atomic_inc(&agp_bridge.current_memory_agp); + return (unsigned long) pt; +} + +static void agp_generic_destroy_page(unsigned long page) +{ + void *pt = (void *) page; + + if (pt == NULL) { + return; + } + atomic_dec(&mem_map[MAP_NR(pt)].count); + clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); + free_page((unsigned long) pt); + atomic_dec(&agp_bridge.current_memory_agp); +} + +/* End Basic Page Allocation Routines */ + void agp_enable(u32 mode) { agp_bridge.agp_enable(mode); @@ -998,7 +995,7 @@ return NULL; } MOD_INC_USE_COUNT; - new->memory[0] = agp_alloc_page(); + new->memory[0] = agp_bridge.agp_alloc_page(); if (new->memory[0] == 0) { /* Free this structure */ @@ -1023,7 +1020,7 @@ { agp_free_key(curr->key); if(curr->type == AGP_PHYS_MEMORY) { - agp_destroy_page((unsigned long) + agp_bridge.agp_destroy_page((unsigned long) phys_to_virt(curr->memory[0])); vfree(curr->memory); } @@ -1061,6 +1058,8 @@ agp_bridge.remove_memory = intel_i810_remove_entries; agp_bridge.alloc_by_type = intel_i810_alloc_by_type; agp_bridge.free_by_type = intel_i810_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; return 0; } @@ -1247,6 +1246,12 @@ agp_bridge.remove_memory = agp_generic_remove_memory; agp_bridge.alloc_by_type = agp_generic_alloc_by_type; agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; return 0; @@ -1360,6 +1365,8 @@ agp_bridge.remove_memory = agp_generic_remove_memory; agp_bridge.alloc_by_type = agp_generic_alloc_by_type; agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; return 0; @@ -1469,6 +1476,8 @@ agp_bridge.remove_memory = agp_generic_remove_memory; agp_bridge.alloc_by_type = agp_generic_alloc_by_type; agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; return 0; } @@ -1830,6 +1839,8 @@ agp_bridge.remove_memory = amd_remove_memory; agp_bridge.alloc_by_type = agp_generic_alloc_by_type; agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; return 0; @@ -1867,10 +1878,9 @@ u32 temp; pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, - ((temp & 0xffffff00) | 0x00000090)); - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, - ((temp & 0xffffff00) | 0x00000010)); +// clear tag + pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL, + ((temp & 0xfffffff0) | 0x00000001|0x00000002)); } static void ali_cleanup(void) @@ -1881,10 +1891,13 @@ previous_size = A_SIZE_32(agp_bridge.previous_size); pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, - ((temp & 0xffffff00) | 0x00000090)); +// clear tag + pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL, + ((temp & 0xffffff00) | 0x00000001|0x00000002)); + + pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp); pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, - previous_size->size_value); + ((temp & 0x00000ff0) | previous_size->size_value)); } static int ali_configure(void) @@ -1895,17 +1908,62 @@ current_size = A_SIZE_32(agp_bridge.current_size); /* aperture size and gatt addr */ - pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, - agp_bridge.gatt_bus_addr | current_size->size_value); + pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp); + temp = (((temp & 0x00000ff0) | (agp_bridge.gatt_bus_addr & 0xfffff000)) + | (current_size->size_value & 0xf)); + pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, temp); /* tlb control */ - pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, - ((temp & 0xffffff00) | 0x00000010)); + + /* + * Question: Jeff, ALi's patch deletes this: + * + * pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); + * pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, + * ((temp & 0xffffff00) | 0x00000010)); + * + * and replaces it with the following, which seems to duplicate the + * next couple of lines below it. I suspect this was an oversight, + * but you might want to check up on this? + */ + + pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp); + agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); /* address to map to */ pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp); agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); + +#if 0 + if (agp_bridge.type == ALI_M1541) { + u32 nlvm_addr = 0; + + switch (current_size->size_value) { + case 0: break; + case 1: nlvm_addr = 0x100000;break; + case 2: nlvm_addr = 0x200000;break; + case 3: nlvm_addr = 0x400000;break; + case 4: nlvm_addr = 0x800000;break; + case 6: nlvm_addr = 0x1000000;break; + case 7: nlvm_addr = 0x2000000;break; + case 8: nlvm_addr = 0x4000000;break; + case 9: nlvm_addr = 0x8000000;break; + case 10: nlvm_addr = 0x10000000;break; + default: break; + } + nlvm_addr--; + nlvm_addr&=0xfff00000; + + nlvm_addr+= agp_bridge.gart_bus_addr; + nlvm_addr|=(agp_bridge.gart_bus_addr>>12); + printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr); + } +#endif + + pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); + temp &= 0xffffff7f; //enable TLB + pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, temp); + return 0; } @@ -1916,6 +1974,73 @@ return addr | agp_bridge.masks[0].mask; } +static void ali_cache_flush(void) +{ + global_cache_flush(); + + if (agp_bridge.type == ALI_M1541) { + int i, page_count; + u32 temp; + + page_count = 1 << A_SIZE_32(agp_bridge.current_size)->page_order; + for (i = 0; i < PAGE_SIZE * page_count; i += PAGE_SIZE) { + pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | + (agp_bridge.gatt_bus_addr + i)) | + ALI_CACHE_FLUSH_EN)); + } + } +} + +static unsigned long ali_alloc_page(void) +{ + void *pt; + u32 temp; + + pt = (void *) __get_free_page(GFP_KERNEL); + if (pt == NULL) + return 0; + + atomic_inc(&mem_map[MAP_NR(pt)].count); + set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); + atomic_inc(&agp_bridge.current_memory_agp); + + global_cache_flush(); + + if (agp_bridge.type == ALI_M1541) { + pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | + virt_to_phys((void *)pt)) | + ALI_CACHE_FLUSH_EN )); + } + return (unsigned long) pt; +} + +static void ali_destroy_page(unsigned long page) +{ + u32 temp; + void *pt = (void *) page; + + if (pt == NULL) + return; + + global_cache_flush(); + + if (agp_bridge.type == ALI_M1541) { + pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | + virt_to_phys((void *)pt)) | + ALI_CACHE_FLUSH_EN)); + } + + atomic_dec(&mem_map[MAP_NR(pt)].count); + clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags); + free_page((unsigned long) pt); + atomic_dec(&agp_bridge.current_memory_agp); +} /* Setup function */ static gatt_mask ali_generic_masks[] = @@ -1949,13 +2074,15 @@ agp_bridge.tlb_flush = ali_tlbflush; agp_bridge.mask_memory = ali_mask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; - agp_bridge.cache_flush = global_cache_flush; + agp_bridge.cache_flush = ali_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; agp_bridge.free_gatt_table = agp_generic_free_gatt_table; agp_bridge.insert_memory = agp_generic_insert_memory; agp_bridge.remove_memory = agp_generic_remove_memory; agp_bridge.alloc_by_type = agp_generic_alloc_by_type; agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = ali_alloc_page; + agp_bridge.agp_destroy_page = ali_destroy_page; return 0; @@ -1964,122 +2091,773 @@ #endif /* CONFIG_AGP_ALI */ +#ifdef CONFIG_AGP_SWORKS +typedef struct _serverworks_page_map { + unsigned long *real; + unsigned long *remapped; +} serverworks_page_map; -/* per-chipset initialization data. - * note -- all chipsets for a single vendor MUST be grouped together - */ -static struct { - unsigned short device_id; /* first, to make table easier to read */ - unsigned short vendor_id; - enum chipset_type chipset; - const char *vendor_name; - const char *chipset_name; - int (*chipset_setup) (struct pci_dev *pdev); -} agp_bridge_info[] __initdata = { +static struct _serverworks_private { + struct pci_dev *svrwrks_dev; /* device one */ + volatile u8 *registers; + serverworks_page_map **gatt_pages; + int num_tables; + serverworks_page_map scratch_dir; -#ifdef CONFIG_AGP_ALI - { PCI_DEVICE_ID_AL_M1541_0, - PCI_VENDOR_ID_AL, - ALI_M1541, - "Ali", - "M1541", - ali_generic_setup }, - { 0, - PCI_VENDOR_ID_AL, - ALI_GENERIC, - "Ali", - "Generic", - ali_generic_setup }, -#endif /* CONFIG_AGP_ALI */ + int gart_addr_ofs; + int mm_addr_ofs; +} serverworks_private; -#ifdef CONFIG_AGP_AMD - { PCI_DEVICE_ID_AMD_IRONGATE_0, - PCI_VENDOR_ID_AMD, - AMD_IRONGATE, - "AMD", - "Irongate", - amd_irongate_setup }, - { 0, - PCI_VENDOR_ID_AMD, - AMD_GENERIC, - "AMD", - "Generic", - amd_irongate_setup }, -#endif /* CONFIG_AGP_AMD */ +static int serverworks_create_page_map(serverworks_page_map *page_map) +{ + int i; -#ifdef CONFIG_AGP_INTEL - { PCI_DEVICE_ID_INTEL_82443LX_0, - PCI_VENDOR_ID_INTEL, - INTEL_LX, - "Intel", - "440LX", - intel_generic_setup }, - { PCI_DEVICE_ID_INTEL_82443BX_0, - PCI_VENDOR_ID_INTEL, - INTEL_BX, - "Intel", - "440BX", - intel_generic_setup }, - { PCI_DEVICE_ID_INTEL_82443GX_0, - PCI_VENDOR_ID_INTEL, - INTEL_GX, - "Intel", - "440GX", - intel_generic_setup }, - /* could we add support for PCI_DEVICE_ID_INTEL_815_1 too ? */ - { PCI_DEVICE_ID_INTEL_815_0, - PCI_VENDOR_ID_INTEL, - INTEL_I815, - "Intel", - "i815", - intel_generic_setup }, - { PCI_DEVICE_ID_INTEL_840_0, - PCI_VENDOR_ID_INTEL, - INTEL_I840, - "Intel", - "i840", - intel_840_setup }, - { 0, - PCI_VENDOR_ID_INTEL, - INTEL_GENERIC, - "Intel", - "Generic", - intel_generic_setup }, -#endif /* CONFIG_AGP_INTEL */ + page_map->real = (unsigned long *) __get_free_page(GFP_KERNEL); + if (page_map->real == NULL) { + return -ENOMEM; + } + set_bit(PG_reserved, &mem_map[MAP_NR(page_map->real)].flags); + CACHE_FLUSH(); + page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), + PAGE_SIZE); + if (page_map->remapped == NULL) { + clear_bit(PG_reserved, + &mem_map[MAP_NR(page_map->real)].flags); + free_page((unsigned long) page_map->real); + page_map->real = NULL; + return -ENOMEM; + } + CACHE_FLUSH(); -#ifdef CONFIG_AGP_SIS - { PCI_DEVICE_ID_SI_630, - PCI_VENDOR_ID_SI, - SIS_GENERIC, - "SiS", - "630", - sis_generic_setup }, - { PCI_DEVICE_ID_SI_540, - PCI_VENDOR_ID_SI, - SIS_GENERIC, - "SiS", - "540", - sis_generic_setup }, - { PCI_DEVICE_ID_SI_620, - PCI_VENDOR_ID_SI, - SIS_GENERIC, - "SiS", - "620", - sis_generic_setup }, - { PCI_DEVICE_ID_SI_530, - PCI_VENDOR_ID_SI, - SIS_GENERIC, - "SiS", - "530", - sis_generic_setup }, - { PCI_DEVICE_ID_SI_630, - PCI_VENDOR_ID_SI, - SIS_GENERIC, - "SiS", - "Generic", - sis_generic_setup }, - { PCI_DEVICE_ID_SI_540, - PCI_VENDOR_ID_SI, + for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { + page_map->remapped[i] = agp_bridge.scratch_page; + } + + return 0; +} + +static void serverworks_free_page_map(serverworks_page_map *page_map) +{ + iounmap(page_map->remapped); + clear_bit(PG_reserved, + &mem_map[MAP_NR(page_map->real)].flags); + free_page((unsigned long) page_map->real); +} + +static void serverworks_free_gatt_pages(void) +{ + int i; + serverworks_page_map **tables; + serverworks_page_map *entry; + + tables = serverworks_private.gatt_pages; + for(i = 0; i < serverworks_private.num_tables; i++) { + entry = tables[i]; + if (entry != NULL) { + if (entry->real != NULL) { + serverworks_free_page_map(entry); + } + kfree(entry); + } + } + kfree(tables); +} + +static int serverworks_create_gatt_pages(int nr_tables) +{ + serverworks_page_map **tables; + serverworks_page_map *entry; + int retval = 0; + int i; + + tables = kmalloc((nr_tables + 1) * sizeof(serverworks_page_map *), + GFP_KERNEL); + if (tables == NULL) { + return -ENOMEM; + } + memset(tables, 0, sizeof(serverworks_page_map *) * (nr_tables + 1)); + for (i = 0; i < nr_tables; i++) { + entry = kmalloc(sizeof(serverworks_page_map), GFP_KERNEL); + if (entry == NULL) { + retval = -ENOMEM; + break; + } + memset(entry, 0, sizeof(serverworks_page_map)); + tables[i] = entry; + retval = serverworks_create_page_map(entry); + if (retval != 0) break; + } + serverworks_private.num_tables = nr_tables; + serverworks_private.gatt_pages = tables; + + if (retval != 0) serverworks_free_gatt_pages(); + + return retval; +} + +#define SVRWRKS_GET_GATT(addr) (serverworks_private.gatt_pages[\ + GET_PAGE_DIR_IDX(addr)]->remapped) + +#ifndef GET_PAGE_DIR_OFF +#define GET_PAGE_DIR_OFF(addr) (addr >> 22) +#endif + +#ifndef GET_PAGE_DIR_IDX +#define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \ + GET_PAGE_DIR_OFF(agp_bridge.gart_bus_addr)) +#endif + +#ifndef GET_GATT_OFF +#define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12) +#endif + +static int serverworks_create_gatt_table(void) +{ + aper_size_info_lvl2 *value; + serverworks_page_map page_dir; + int retval; + u32 temp; + int i; + + value = A_SIZE_LVL2(agp_bridge.current_size); + retval = serverworks_create_page_map(&page_dir); + if (retval != 0) { + return retval; + } + retval = serverworks_create_page_map(&serverworks_private.scratch_dir); + if (retval != 0) { + serverworks_free_page_map(&page_dir); + return retval; + } + /* Create a fake scratch directory */ + for(i = 0; i < 1024; i++) { + serverworks_private.scratch_dir.remapped[i] = (unsigned long) agp_bridge.scratch_page; + page_dir.remapped[i] = + virt_to_bus(serverworks_private.scratch_dir.real); + page_dir.remapped[i] |= 0x00000001; + } + + retval = serverworks_create_gatt_pages(value->num_entries / 1024); + if (retval != 0) { + serverworks_free_page_map(&page_dir); + return retval; + } + + agp_bridge.gatt_table_real = page_dir.real; + agp_bridge.gatt_table = page_dir.remapped; + agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real); + + /* Get the address for the gart region. + * This is a bus address even on the alpha, b/c its + * used to program the agp master not the cpu + */ + + pci_read_config_dword(agp_bridge.dev, + serverworks_private.gart_addr_ofs, + &temp); + agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); + + /* Calculate the agp offset */ + + for(i = 0; i < value->num_entries / 1024; i++) { + page_dir.remapped[i] = + virt_to_bus(serverworks_private.gatt_pages[i]->real); + page_dir.remapped[i] |= 0x00000001; + } + + return 0; +} + +static int serverworks_free_gatt_table(void) +{ + serverworks_page_map page_dir; + + page_dir.real = agp_bridge.gatt_table_real; + page_dir.remapped = agp_bridge.gatt_table; + + serverworks_free_gatt_pages(); + serverworks_free_page_map(&page_dir); + return 0; +} + +static int serverworks_fetch_size(void) +{ + int i; + u32 temp; + u32 temp2; + aper_size_info_lvl2 *values; + + values = A_SIZE_LVL2(agp_bridge.aperture_sizes); + pci_read_config_dword(agp_bridge.dev, + serverworks_private.gart_addr_ofs, + &temp); + pci_write_config_dword(agp_bridge.dev, + serverworks_private.gart_addr_ofs, + 0xfe000000); + pci_read_config_dword(agp_bridge.dev, + serverworks_private.gart_addr_ofs, + &temp2); + pci_write_config_dword(agp_bridge.dev, + serverworks_private.gart_addr_ofs, + temp); + temp2 &= SVWRKS_SIZE_MASK; + + for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { + if (temp2 == values[i].size_value) { + agp_bridge.previous_size = + agp_bridge.current_size = (void *) (values + i); + + agp_bridge.aperture_size_idx = i; + return values[i].size; + } + } + + return 0; +} + +static int serverworks_configure(void) +{ + aper_size_info_lvl2 *current_size; + u32 temp; + u8 enable_reg; + u8 cap_ptr; + u32 cap_id; + u16 cap_reg; + + current_size = A_SIZE_LVL2(agp_bridge.current_size); + + /* Get the memory mapped registers */ + pci_read_config_dword(agp_bridge.dev, + serverworks_private.mm_addr_ofs, + &temp); + temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); + serverworks_private.registers = (volatile u8 *) ioremap(temp, 4096); + + OUTREG8(serverworks_private.registers, SVWRKS_GART_CACHE, 0x0a); + + OUTREG32(serverworks_private.registers, SVWRKS_GATTBASE, + agp_bridge.gatt_bus_addr); + + cap_reg = INREG16(serverworks_private.registers, SVWRKS_COMMAND); + cap_reg &= ~0x0007; + cap_reg |= 0x4; + OUTREG16(serverworks_private.registers, SVWRKS_COMMAND, cap_reg); + + pci_read_config_byte(serverworks_private.svrwrks_dev, + SVWRKS_AGP_ENABLE, &enable_reg); + enable_reg |= 0x1; /* Agp Enable bit */ + pci_write_config_byte(serverworks_private.svrwrks_dev, + SVWRKS_AGP_ENABLE, enable_reg); + agp_bridge.tlb_flush(NULL); + + pci_read_config_byte(serverworks_private.svrwrks_dev, 0x34, &cap_ptr); + if (cap_ptr != 0x00) { + do { + pci_read_config_dword(serverworks_private.svrwrks_dev, + cap_ptr, &cap_id); + + if ((cap_id & 0xff) != 0x02) + cap_ptr = (cap_id >> 8) & 0xff; + } + while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00)); + } + agp_bridge.capndx = cap_ptr; + + /* Fill in the mode register */ + pci_read_config_dword(serverworks_private.svrwrks_dev, + agp_bridge.capndx + 4, + &agp_bridge.mode); + + pci_read_config_byte(agp_bridge.dev, + SVWRKS_CACHING, + &enable_reg); + enable_reg &= ~0x3; + pci_write_config_byte(agp_bridge.dev, + SVWRKS_CACHING, + enable_reg); + + pci_read_config_byte(agp_bridge.dev, + SVWRKS_FEATURE, + &enable_reg); + enable_reg |= (1<<6); + pci_write_config_byte(agp_bridge.dev, + SVWRKS_FEATURE, + enable_reg); + + return 0; +} + +static void serverworks_cleanup(void) +{ + iounmap((void *) serverworks_private.registers); +} + +/* + * This routine could be implemented by taking the addresses + * written to the GATT, and flushing them individually. However + * currently it just flushes the whole table. Which is probably + * more efficent, since agp_memory blocks can be a large number of + * entries. + */ + +static void serverworks_tlbflush(agp_memory * temp) +{ + unsigned long end; + + OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 0x01); + end = jiffies + 3*HZ; + while(INREG8(serverworks_private.registers, + SVWRKS_POSTFLUSH) == 0x01) { + if((signed)(end - jiffies) <= 0) { + printk(KERN_ERR "Posted write buffer flush took more" + "then 3 seconds\n"); + } + } + OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 0x00000001); + end = jiffies + 3*HZ; + while(INREG32(serverworks_private.registers, + SVWRKS_DIRFLUSH) == 0x00000001) { + if((signed)(end - jiffies) <= 0) { + printk(KERN_ERR "TLB flush took more" + "then 3 seconds\n"); + } + } +} + +static unsigned long serverworks_mask_memory(unsigned long addr, int type) +{ + /* Only type 0 is supported by the serverworks chipsets */ + + return addr | agp_bridge.masks[0].mask; +} + +static int serverworks_insert_memory(agp_memory * mem, + off_t pg_start, int type) +{ + int i, j, num_entries; + unsigned long *cur_gatt; + unsigned long addr; + + num_entries = A_SIZE_LVL2(agp_bridge.current_size)->num_entries; + + if (type != 0 || mem->type != 0) { + return -EINVAL; + } + if ((pg_start + mem->page_count) > num_entries) { + return -EINVAL; + } + + j = pg_start; + while (j < (pg_start + mem->page_count)) { + addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; + cur_gatt = SVRWRKS_GET_GATT(addr); + if (!PGE_EMPTY(cur_gatt[GET_GATT_OFF(addr)])) { + return -EBUSY; + } + j++; + } + + if (mem->is_flushed == FALSE) { + CACHE_FLUSH(); + mem->is_flushed = TRUE; + } + + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { + addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; + cur_gatt = SVRWRKS_GET_GATT(addr); + cur_gatt[GET_GATT_OFF(addr)] = mem->memory[i]; + } + agp_bridge.tlb_flush(mem); + return 0; +} + +static int serverworks_remove_memory(agp_memory * mem, off_t pg_start, + int type) +{ + int i; + unsigned long *cur_gatt; + unsigned long addr; + + if (type != 0 || mem->type != 0) { + return -EINVAL; + } + + CACHE_FLUSH(); + agp_bridge.tlb_flush(mem); + + for (i = pg_start; i < (mem->page_count + pg_start); i++) { + addr = (i * PAGE_SIZE) + agp_bridge.gart_bus_addr; + cur_gatt = SVRWRKS_GET_GATT(addr); + cur_gatt[GET_GATT_OFF(addr)] = + (unsigned long) agp_bridge.scratch_page; + } + + agp_bridge.tlb_flush(mem); + return 0; +} + +static gatt_mask serverworks_masks[] = +{ + {0x00000001, 0} +}; + +static aper_size_info_lvl2 serverworks_sizes[7] = +{ + {2048, 524288, 0x80000000}, + {1024, 262144, 0xc0000000}, + {512, 131072, 0xe0000000}, + {256, 65536, 0xf0000000}, + {128, 32768, 0xf8000000}, + {64, 16384, 0xfc000000}, + {32, 8192, 0xfe000000} +}; + +static void serverworks_agp_enable(u32 mode) +{ + struct pci_dev *device = NULL; + u32 command, scratch, cap_id; + u8 cap_ptr; + + pci_read_config_dword(serverworks_private.svrwrks_dev, + agp_bridge.capndx + 4, + &command); + + /* + * PASS1: go throu all devices that claim to be + * AGP devices and collect their data. + */ + + while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, + device)) != NULL) { + pci_read_config_dword(device, 0x04, &scratch); + + if (!(scratch & 0x00100000)) + continue; + + pci_read_config_byte(device, 0x34, &cap_ptr); + + if (cap_ptr != 0x00) { + do { + pci_read_config_dword(device, + cap_ptr, &cap_id); + + if ((cap_id & 0xff) != 0x02) + cap_ptr = (cap_id >> 8) & 0xff; + } + while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00)); + } + if (cap_ptr != 0x00) { + /* + * Ok, here we have a AGP device. Disable impossible + * settings, and adjust the readqueue to the minimum. + */ + + pci_read_config_dword(device, cap_ptr + 4, &scratch); + + /* adjust RQ depth */ + command = + ((command & ~0xff000000) | + min((mode & 0xff000000), + min((command & 0xff000000), + (scratch & 0xff000000)))); + + /* disable SBA if it's not supported */ + if (!((command & 0x00000200) && + (scratch & 0x00000200) && + (mode & 0x00000200))) + command &= ~0x00000200; + + /* disable FW */ + command &= ~0x00000010; + + command &= ~0x00000008; + + if (!((command & 4) && + (scratch & 4) && + (mode & 4))) + command &= ~0x00000004; + + if (!((command & 2) && + (scratch & 2) && + (mode & 2))) + command &= ~0x00000002; + + if (!((command & 1) && + (scratch & 1) && + (mode & 1))) + command &= ~0x00000001; + } + } + /* + * PASS2: Figure out the 4X/2X/1X setting and enable the + * target (our motherboard chipset). + */ + + if (command & 4) { + command &= ~3; /* 4X */ + } + if (command & 2) { + command &= ~5; /* 2X */ + } + if (command & 1) { + command &= ~6; /* 1X */ + } + command |= 0x00000100; + + pci_write_config_dword(serverworks_private.svrwrks_dev, + agp_bridge.capndx + 8, + command); + + /* + * PASS3: Go throu all AGP devices and update the + * command registers. + */ + + while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, + device)) != NULL) { + pci_read_config_dword(device, 0x04, &scratch); + + if (!(scratch & 0x00100000)) + continue; + + pci_read_config_byte(device, 0x34, &cap_ptr); + + if (cap_ptr != 0x00) { + do { + pci_read_config_dword(device, + cap_ptr, &cap_id); + + if ((cap_id & 0xff) != 0x02) + cap_ptr = (cap_id >> 8) & 0xff; + } + while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00)); + } + if (cap_ptr != 0x00) + pci_write_config_dword(device, cap_ptr + 8, command); + } +} + +static int __init serverworks_setup (struct pci_dev *pdev) +{ + u32 temp; + u32 temp2; + + serverworks_private.svrwrks_dev = pdev; + + agp_bridge.masks = serverworks_masks; + agp_bridge.num_of_masks = 1; + agp_bridge.aperture_sizes = (void *) serverworks_sizes; + agp_bridge.size_type = LVL2_APER_SIZE; + agp_bridge.num_aperture_sizes = 7; + agp_bridge.dev_private_data = (void *) &serverworks_private; + agp_bridge.needs_scratch_page = TRUE; + agp_bridge.configure = serverworks_configure; + agp_bridge.fetch_size = serverworks_fetch_size; + agp_bridge.cleanup = serverworks_cleanup; + agp_bridge.tlb_flush = serverworks_tlbflush; + agp_bridge.mask_memory = serverworks_mask_memory; + agp_bridge.agp_enable = serverworks_agp_enable; + agp_bridge.cache_flush = global_cache_flush; + agp_bridge.create_gatt_table = serverworks_create_gatt_table; + agp_bridge.free_gatt_table = serverworks_free_gatt_table; + agp_bridge.insert_memory = serverworks_insert_memory; + agp_bridge.remove_memory = serverworks_remove_memory; + agp_bridge.alloc_by_type = agp_generic_alloc_by_type; + agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; + + pci_read_config_dword(agp_bridge.dev, + SVWRKS_APSIZE, + &temp); + + serverworks_private.gart_addr_ofs = 0x10; + + if(temp & PCI_BASE_ADDRESS_MEM_TYPE_64) { + pci_read_config_dword(agp_bridge.dev, + SVWRKS_APSIZE + 4, + &temp2); + if(temp2 != 0) { + printk("Detected 64 bit aperture address, but top " + "bits are not zero. Disabling agp\n"); + return -ENODEV; + } + serverworks_private.mm_addr_ofs = 0x18; + } else { + serverworks_private.mm_addr_ofs = 0x14; + } + + pci_read_config_dword(agp_bridge.dev, + serverworks_private.mm_addr_ofs, + &temp); + if(temp & PCI_BASE_ADDRESS_MEM_TYPE_64) { + pci_read_config_dword(agp_bridge.dev, + serverworks_private.mm_addr_ofs + 4, + &temp2); + if(temp2 != 0) { + printk("Detected 64 bit MMIO address, but top " + "bits are not zero. Disabling agp\n"); + return -ENODEV; + } + } + + return 0; +} + +#endif /* CONFIG_AGP_SWORKS */ + + +/* per-chipset initialization data. + * note -- all chipsets for a single vendor MUST be grouped together + */ +static struct { + unsigned short device_id; /* first, to make table easier to read */ + unsigned short vendor_id; + enum chipset_type chipset; + const char *vendor_name; + const char *chipset_name; + int (*chipset_setup) (struct pci_dev *pdev); +} agp_bridge_info[] __initdata = { + +#ifdef CONFIG_AGP_ALI + { PCI_DEVICE_ID_AL_M1541_0, + PCI_VENDOR_ID_AL, + ALI_M1541, + "Ali", + "M1541", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1621_0, + PCI_VENDOR_ID_AL, + ALI_M1621, + "Ali", + "M1621", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1631_0, + PCI_VENDOR_ID_AL, + ALI_M1631, + "Ali", + "M1631", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1632_0, + PCI_VENDOR_ID_AL, + ALI_M1632, + "Ali", + "M1632", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1641_0, + PCI_VENDOR_ID_AL, + ALI_M1641, + "Ali", + "M1641", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1647_0, + PCI_VENDOR_ID_AL, + ALI_M1647, + "Ali", + "M1647", + ali_generic_setup }, + { PCI_DEVICE_ID_AL_M1651_0, + PCI_VENDOR_ID_AL, + ALI_M1651, + "Ali", + "M1651", + ali_generic_setup }, + { 0, + PCI_VENDOR_ID_AL, + ALI_GENERIC, + "Ali", + "Generic", + ali_generic_setup }, +#endif /* CONFIG_AGP_ALI */ + +#ifdef CONFIG_AGP_AMD + { PCI_DEVICE_ID_AMD_IRONGATE_0, + PCI_VENDOR_ID_AMD, + AMD_IRONGATE, + "AMD", + "Irongate", + amd_irongate_setup }, + { 0, + PCI_VENDOR_ID_AMD, + AMD_GENERIC, + "AMD", + "Generic", + amd_irongate_setup }, +#endif /* CONFIG_AGP_AMD */ + +#ifdef CONFIG_AGP_INTEL + { PCI_DEVICE_ID_INTEL_82443LX_0, + PCI_VENDOR_ID_INTEL, + INTEL_LX, + "Intel", + "440LX", + intel_generic_setup }, + { PCI_DEVICE_ID_INTEL_82443BX_0, + PCI_VENDOR_ID_INTEL, + INTEL_BX, + "Intel", + "440BX", + intel_generic_setup }, + { PCI_DEVICE_ID_INTEL_82443GX_0, + PCI_VENDOR_ID_INTEL, + INTEL_GX, + "Intel", + "440GX", + intel_generic_setup }, + /* could we add support for PCI_DEVICE_ID_INTEL_815_1 too ? */ + { PCI_DEVICE_ID_INTEL_815_0, + PCI_VENDOR_ID_INTEL, + INTEL_I815, + "Intel", + "i815", + intel_generic_setup }, + { PCI_DEVICE_ID_INTEL_840_0, + PCI_VENDOR_ID_INTEL, + INTEL_I840, + "Intel", + "i840", + intel_840_setup }, + { 0, + PCI_VENDOR_ID_INTEL, + INTEL_GENERIC, + "Intel", + "Generic", + intel_generic_setup }, +#endif /* CONFIG_AGP_INTEL */ + +#ifdef CONFIG_AGP_SIS + { PCI_DEVICE_ID_SI_630, + PCI_VENDOR_ID_SI, + SIS_GENERIC, + "SiS", + "630", + sis_generic_setup }, + { PCI_DEVICE_ID_SI_540, + PCI_VENDOR_ID_SI, + SIS_GENERIC, + "SiS", + "540", + sis_generic_setup }, + { PCI_DEVICE_ID_SI_620, + PCI_VENDOR_ID_SI, + SIS_GENERIC, + "SiS", + "620", + sis_generic_setup }, + { PCI_DEVICE_ID_SI_530, + PCI_VENDOR_ID_SI, + SIS_GENERIC, + "SiS", + "530", + sis_generic_setup }, + { PCI_DEVICE_ID_SI_630, + PCI_VENDOR_ID_SI, + SIS_GENERIC, + "SiS", + "Generic", + sis_generic_setup }, + { PCI_DEVICE_ID_SI_540, + PCI_VENDOR_ID_SI, SIS_GENERIC, "SiS", "Generic", @@ -2170,6 +2948,35 @@ while ((i < arraysize (agp_bridge_info)) && (agp_bridge_info[i].vendor_id == pdev->vendor)) { if (pdev->device == agp_bridge_info[i].device_id) { +#ifdef CONFIG_AGP_ALI + if (pdev->device == PCI_DEVICE_ID_AL_M1621_0) { + u8 hidden_1621_id; + + pci_read_config_byte(pdev, 0xFB, &hidden_1621_id); + switch (hidden_1621_id) { + case 0x31: + agp_bridge_info[i].chipset_name="M1631"; + break; + case 0x32: + agp_bridge_info[i].chipset_name="M1632"; + break; + case 0x41: + agp_bridge_info[i].chipset_name="M1641"; + break; + case 0x43: + break; + case 0x47: + agp_bridge_info[i].chipset_name="M1647"; + break; + case 0x51: + agp_bridge_info[i].chipset_name="M1651"; + break; + default: + break; + } + } +#endif + printk (KERN_INFO PFX "Detected %s %s chipset\n", agp_bridge_info[i].vendor_name, agp_bridge_info[i].chipset_name); @@ -2275,7 +3082,8 @@ if (i810_dev == NULL) { printk(KERN_ERR PFX "agpgart: Detected an " "Intel i815, but could not find the" - " secondary device.\n"); + " secondary device. Assuming a " + "non-integrated video card.\n"); agp_bridge.type = NOT_SUPPORTED; return -ENODEV; } @@ -2290,6 +3098,41 @@ } #endif /* CONFIG_AGP_I810 */ +#ifdef CONFIG_AGP_SWORKS + /* Everything is on func 1 here so we are hardcoding function one */ + if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS) { + struct pci_dev *bridge_dev; + + bridge_dev = pci_find_slot ((unsigned int)dev->bus->number, + PCI_DEVFN(0, 1)); + if(bridge_dev == NULL) { + printk(KERN_INFO PFX "agpgart: Detected a Serverworks " + "Chipset, but could not find the secondary " + "device.\n"); + return -ENODEV; + } + + switch (dev->device) { + case PCI_DEVICE_ID_SERVERWORKS_HE: + agp_bridge.type = SVWRKS_HE; + return serverworks_setup(bridge_dev); + + case PCI_DEVICE_ID_SERVERWORKS_LE: + case 0x0007: + agp_bridge.type = SVWRKS_LE; + return serverworks_setup(bridge_dev); + + default: + if(agp_try_unsupported) { + agp_bridge.type = SVWRKS_GENERIC; + return serverworks_setup(bridge_dev); + } + break; + } + } + +#endif /* CONFIG_AGP_SWORKS */ + /* find capndx */ pci_read_config_dword(dev, 0x04, &scratch); if (!(scratch & 0x00100000)) @@ -2385,7 +3228,7 @@ } if (agp_bridge.needs_scratch_page == TRUE) { - agp_bridge.scratch_page = agp_alloc_page(); + agp_bridge.scratch_page = agp_bridge.agp_alloc_page(); if (agp_bridge.scratch_page == 0) { printk(KERN_ERR PFX "unable to get memory for " @@ -2438,7 +3281,7 @@ err_out: if (agp_bridge.needs_scratch_page == TRUE) { agp_bridge.scratch_page &= ~(0x00000fff); - agp_destroy_page((unsigned long) + agp_bridge.agp_destroy_page((unsigned long) phys_to_virt(agp_bridge.scratch_page)); } if (got_gatt) @@ -2458,7 +3301,7 @@ if (agp_bridge.needs_scratch_page == TRUE) { agp_bridge.scratch_page &= ~(0x00000fff); - agp_destroy_page((unsigned long) + agp_bridge.agp_destroy_page((unsigned long) phys_to_virt(agp_bridge.scratch_page)); } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agpgart_fe.c linux.20p9/drivers/char/agp/agpgart_fe.c --- linux.vanilla/drivers/char/agp/agpgart_fe.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/agp/agpgart_fe.c Thu Jul 26 15:24:33 2001 @@ -840,6 +840,9 @@ if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) { return -EFAULT; } + if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment)) + return -EFAULT; + client = agp_find_client_by_pid(reserve.pid); if (reserve.seg_count == 0) { @@ -860,6 +863,9 @@ } else { agp_segment *segment; + if (reserve.seg_count >= 16384) + return -EINVAL; + segment = kmalloc((sizeof(agp_segment) * reserve.seg_count), GFP_KERNEL); @@ -867,7 +873,7 @@ return -ENOMEM; } if (copy_from_user(segment, (void *) reserve.seg_list, - GFP_KERNEL)) { + sizeof(agp_segment) * reserve.seg_count)) { kfree(segment); return -EFAULT; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/atari_SCC.README linux.20p9/drivers/char/atari_SCC.README --- linux.vanilla/drivers/char/atari_SCC.README Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/atari_SCC.README Wed Jul 4 16:03:54 2001 @@ -96,7 +96,7 @@ If you should see a message like: -Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occured, data lost! +Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occurred, data lost! that means that the timer routine itself has been delayed so long that the DMA counter went to zero already. There's not very much to do about this, because diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/atari_SCC.c linux.20p9/drivers/char/atari_SCC.c --- linux.vanilla/drivers/char/atari_SCC.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/atari_SCC.c Wed Jul 4 16:03:54 2001 @@ -1453,11 +1453,11 @@ } -/* DMA finished before timer occured? +/* DMA finished before timer occurred? */ static void SCC_dma_int (int irq, void *data, struct pt_regs *fp) { - printk ("SCC-A: DMA-INT occured, data lost!\n"); + printk ("SCC-A: DMA-INT occurred, data lost!\n"); #if 0 /* is there any reason why we should call this? if the timer INT was * delayed so long that this happened then this INT was delayed too, so diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/bttv.c linux.20p9/drivers/char/bttv.c --- linux.vanilla/drivers/char/bttv.c Sun Mar 25 17:31:25 2001 +++ linux.20p9/drivers/char/bttv.c Thu Jul 26 14:59:52 2001 @@ -1979,7 +1979,9 @@ vfree(vcp); return -EFAULT; } - } else if (vw.clipcount) { + } else if (vw.clipcount > 2048) + return -ENOMEM; + else { if((vcp=vmalloc(sizeof(struct video_clip)* (vw.clipcount))) == NULL) return -ENOMEM; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/cyclades.c linux.20p9/drivers/char/cyclades.c --- linux.vanilla/drivers/char/cyclades.c Sun Mar 25 17:31:25 2001 +++ linux.20p9/drivers/char/cyclades.c Wed Jul 4 16:03:54 2001 @@ -149,7 +149,7 @@ * Revision 2.2.1.4 1998/08/04 11:02:50 ivan * /proc/cyclades implementation with great collaboration of * Marc Lewis ; - * cyy_interrupt was changed to avoid occurence of kernel oopses + * cyy_interrupt was changed to avoid occurrence of kernel oopses * during PPP operation. * * Revision 2.2.1.3 1998/06/01 12:09:10 ivan diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/agpsupport.c linux.20p9/drivers/char/drm/agpsupport.c --- linux.vanilla/drivers/char/drm/agpsupport.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/agpsupport.c Thu Jul 26 18:06:00 2001 @@ -319,6 +319,16 @@ case ALI_GENERIC: head->chipset = "ALi"; break; case ALI_M1541: head->chipset = "ALi M1541"; break; + case ALI_M1621: head->chipset = "ALi M1621"; break; + case ALI_M1631: head->chipset = "ALi M1631"; break; + case ALI_M1632: head->chipset = "ALi M1632"; break; + case ALI_M1641: head->chipset = "ALi M1641"; break; + case ALI_M1647: head->chipset = "ALi M1647"; break; + case ALI_M1651: head->chipset = "ALi M1651"; break; + case SVWRKS_GENERIC: head->chipset = "Serverworks Generic"; + break; + case SVWRKS_HE: head->chipset = "Serverworks HE"; break; + case SVWRKS_LE: head->chipset = "Serverworks LE"; break; default: head->chipset = "Unknown"; break; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/bufs.c linux.20p9/drivers/char/drm/bufs.c --- linux.vanilla/drivers/char/drm/bufs.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/bufs.c Thu Jul 26 14:51:37 2001 @@ -201,6 +201,12 @@ return -ENOMEM; /* May only call once for each order */ } + if(count < 0 || count > 4096) + { + up(&dev->struct_sem); + return -EINVAL; + } + entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/context.c linux.20p9/drivers/char/drm/context.c --- linux.vanilla/drivers/char/drm/context.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/context.c Thu Jul 26 15:11:00 2001 @@ -91,10 +91,13 @@ atomic_dec(&dev->queuelist[i]->use_count); } /* Allocate a new queue */ - down(&dev->struct_sem); queue = drm_alloc(sizeof(*queue), DRM_MEM_QUEUES); + if(queue == NULL) + return -ENOMEM; + memset(queue, 0, sizeof(*queue)); + down(&dev->struct_sem); atomic_set(&queue->use_count, 1); ++dev->queue_count; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/dma.c linux.20p9/drivers/char/drm/dma.c --- linux.vanilla/drivers/char/drm/dma.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/dma.c Thu Jul 26 15:11:05 2001 @@ -38,7 +38,10 @@ { int i; - dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER); + if (!(dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER))) { + printk(KERN_ERR "drm_dma_setup: can't drm_alloc dev->dma"); + return; + } memset(dev->dma, 0, sizeof(*dev->dma)); for (i = 0; i <= DRM_MAX_ORDER; i++) memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0])); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/fops.c linux.20p9/drivers/char/drm/fops.c --- linux.vanilla/drivers/char/drm/fops.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/fops.c Thu Jul 26 15:24:45 2001 @@ -47,7 +47,10 @@ DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor); priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES); + if(priv == NULL) + return -ENOMEM; memset(priv, 0, sizeof(*priv)); + filp->private_data = priv; priv->uid = current->euid; priv->pid = current->pid; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/i810_bufs.c linux.20p9/drivers/char/drm/i810_bufs.c --- linux.vanilla/drivers/char/drm/i810_bufs.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/i810_bufs.c Thu Jul 26 14:51:37 2001 @@ -87,7 +87,14 @@ atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } - + + if(count < 0 || count > 4096) + { + up(&dev->struct_sem); + atomic_dec(&dev->buf_alloc); + return -EINVAL; + } + entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/i810_dma.c linux.20p9/drivers/char/drm/i810_dma.c --- linux.vanilla/drivers/char/drm/i810_dma.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/i810_dma.c Thu Jul 26 14:53:07 2001 @@ -1402,6 +1402,11 @@ buf_priv = buf->dev_private; if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM; + /* Stopping end users copying their data to the entire kernel + is good.. */ + if (d.used < 0 || d.used > buf->total) + return -EINVAL; + copy_from_user_ret(buf_priv->virtual, d.address, d.used, -EFAULT); sarea_priv->last_dispatch = (int) hw_status[5]; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/ioctl.c linux.20p9/drivers/char/drm/ioctl.c --- linux.vanilla/drivers/char/drm/ioctl.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/ioctl.c Thu Jul 26 14:53:45 2001 @@ -75,7 +75,7 @@ if (dev->unique_len || dev->unique) return -EBUSY; copy_from_user_ret(&u, (drm_unique_t *)arg, sizeof(u), -EFAULT); - if (!u.unique_len) return -EINVAL; + if (!u.unique_len || u.unique_len > 1024) dev->unique_len = u.unique_len; dev->unique = drm_alloc(u.unique_len + 1, DRM_MEM_DRIVER); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/mga_bufs.c linux.20p9/drivers/char/drm/mga_bufs.c --- linux.vanilla/drivers/char/drm/mga_bufs.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/mga_bufs.c Thu Jul 26 14:51:37 2001 @@ -97,7 +97,17 @@ atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } - + + /* This isnt neccessarily a good limit, but we have to stop a dumb + 32 bit overflow problem below */ + + if ( count < 0 || count > 4096) + { + up(&dev->struct_sem); + atomic_dec(&dev->buf_alloc); + return -EINVAL; + } + entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { @@ -254,6 +264,13 @@ return -ENOMEM; /* May only call once for each order */ } + if(count < 0 || count > 4096) + { + up(&dev->struct_sem); + atomic_dec(&dev->buf_alloc); + return -EINVAL; + } + entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/r128_bufs.c linux.20p9/drivers/char/drm/r128_bufs.c --- linux.vanilla/drivers/char/drm/r128_bufs.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/drm/r128_bufs.c Thu Jul 26 14:54:27 2001 @@ -102,7 +102,17 @@ atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } - + + /* Might be a poor limit, but take that up with XFree86 + if its a problem */ + + if(count < 0 || count > 4096) + { + up(&dev->struct_sem); + atomic_dec(&dev->buf_alloc); + return -EINVAL; + } + entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/epca.c linux.20p9/drivers/char/epca.c --- linux.vanilla/drivers/char/epca.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/epca.c Thu Jul 26 15:24:52 2001 @@ -928,6 +928,9 @@ /* First we read the data in from the file system into a temp buffer */ + memoff(ch); + restore_flags(flags); + if (bytesAvailable) { /* Begin bytesAvailable */ @@ -953,7 +956,7 @@ Remember copy_from_user WILL generate a page fault if the user memory being accessed has been swapped out. This can cause this routine to temporarily sleep while this page - fault is occuring. + fault is occurring. ----------------------------------------------------------------- */ @@ -968,8 +971,6 @@ post_fep_init. --------------------------------------------------------------------- */ buf = ch->tmp_buf; - memoff(ch); - restore_flags(flags); } /* End from_user */ @@ -3601,7 +3602,7 @@ /* ------------------------------------------------------------------ The below routines pc_throttle and pc_unthrottle are used to slow (And resume) the receipt of data into the kernels - receive buffers. The exact occurence of this depends on the + receive buffers. The exact occurrence of this depends on the size of the kernels receive buffer and what the 'watermarks' are set to for that buffer. See the n_ttys.c file for more details. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/hfmodem/refclock.c linux.20p9/drivers/char/hfmodem/refclock.c --- linux.vanilla/drivers/char/hfmodem/refclock.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/hfmodem/refclock.c Wed Jul 4 16:03:54 2001 @@ -133,7 +133,7 @@ "subl %2,%%eax\n\t" "sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1) : "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi)); - __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0) : "ax"); + __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0)); __asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx"); curtime = tmp2 + tmp3; goto time_known; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/hfmodem/tables.h linux.20p9/drivers/char/hfmodem/tables.h --- linux.vanilla/drivers/char/hfmodem/tables.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/char/hfmodem/tables.h Wed Jul 4 16:17:17 2001 @@ -0,0 +1,90 @@ +/* + * This file is automatically generated by ./gentbl, DO NOT EDIT! +*/ + +#define SINTABBITS 9 +#define SINTABSIZE (1< + Copyright 2000,2001 Jeff Garzik + Copyright 2000,2001 Philipp Rumpf - Driver Web site: http://gtf.org/garzik/drivers/i810_rng/ + Driver Web site: http://sourceforge.net/projects/gkernel/ - - - Based on: - Intel 82802AB/82802AC Firmware Hub (FWH) Datasheet - May 1999 Order Number: 290658-002 R - - Intel 82802 Firmware Hub: Random Number Generator - Programmer's Reference Manual - December 1999 Order Number: 298029-001 R - - Intel 82802 Firmware HUB Random Number Generator Driver - Copyright (c) 2000 Matt Sottek - - Special thanks to Matt Sottek. I did the "guts", he - did the "brains" and all the testing. (Anybody wanna send - me an i810 or i820?) + Please read Documentation/i810_rng.txt for details on use. ---------------------------------------------------------- This software may be used and distributed according to the terms - of the GNU Public License, incorporated herein by reference. - - ---------------------------------------------------------- - - From the firmware hub datasheet: - - The Firmware Hub integrates a Random Number Generator (RNG) - using thermal noise generated from inherently random quantum - mechanical properties of silicon. When not generating new random - bits the RNG circuitry will enter a low power state. Intel will - provide a binary software driver to give third party software - access to our RNG for use as a security feature. At this time, - the RNG is only to be used with a system in an OS-present state. - - ---------------------------------------------------------- - - Theory of operation: - - Character driver. Using the standard open() - and read() system calls, you can read random data from - the i810 RNG device. This data is NOT CHECKED by any - fitness tests, and could potentially be bogus (if the - hardware is faulty or has been tampered with). - - /dev/intel_rng is char device major 10, minor 183. - - - ---------------------------------------------------------- - - Driver notes: - - * In order to unload the i810_rng module, you must first - make sure all users of the character device have closed - - * FIXME: Currently only one open() of the character device is allowed. - If another user tries to open() the device, they will get an - -EBUSY error. Instead, this really should either support - multiple simultaneous users of the character device (not hard), - or simply block open() until the current user of the chrdev - calls close(). - - * FIXME: support poll() - - * FIXME: should we be crazy and support mmap()? - - ---------------------------------------------------------- + of the GNU General Public License, incorporated herein by reference. */ @@ -80,20 +21,19 @@ #include #include #include -#include #include -#include #include #include #include #include +#include /* * core module and version information */ -#define RNG_VERSION "0.6.2-2.2.x" +#define RNG_VERSION "0.9.6-2.2" #define RNG_MODULE_NAME "i810_rng" #define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION #define PFX RNG_MODULE_NAME ": " @@ -102,7 +42,7 @@ /* * debugging macros */ -#undef RNG_DEBUG /* define to 1 to enable copious debugging info */ +#undef RNG_DEBUG /* define to enable copious debugging info */ #ifdef RNG_DEBUG /* note: prints function name for you */ @@ -111,8 +51,8 @@ #define DPRINTK(fmt, args...) #endif -#define RNG_NDEBUG 0 /* define to 1 to disable lightweight runtime checks */ -#if RNG_NDEBUG +#undef RNG_NDEBUG /* define to disable lightweight runtime checks */ +#ifdef RNG_NDEBUG #define assert(expr) #else #define assert(expr) \ @@ -124,12 +64,6 @@ /* - * misc helper macros - */ -#define arraysize(x) (sizeof(x)/sizeof(*(x))) - - -/* * RNG registers (offsets from rng_mem) */ #define RNG_HW_STATUS 0 @@ -139,22 +73,21 @@ #define RNG_DATA_PRESENT 0x01 #define RNG_DATA 2 +/* + * Magic address at which Intel PCI bridges locate the RNG + */ #define RNG_ADDR 0xFFBC015F #define RNG_ADDR_LEN 3 #define RNG_MISCDEV_MINOR 183 /* official */ - /* * various RNG status variables. they are globals * as we only support a single RNG device */ -static int rng_allocated; /* is someone using the RNG region? */ -static int rng_hw_enabled; /* is the RNG h/w enabled? */ -static int rng_use_count; /* number of times RNG has been enabled */ static void *rng_mem; /* token to our ioremap'd RNG register area */ -static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; /* hardware lock */ -static int rng_open; /* boolean, 0 (false) if chrdev is closed, 1 (true) if open */ +static struct semaphore rng_open_sem; /* Semaphore for serializing rng_open/release */ + /* * inlined helper functions for accessing RNG registers @@ -165,18 +98,17 @@ return readb (rng_mem + RNG_HW_STATUS); } - -static inline void rng_hwstatus_set (u8 hw_status) +static inline u8 rng_hwstatus_set (u8 hw_status) { assert (rng_mem != NULL); writeb (hw_status, rng_mem + RNG_HW_STATUS); + return rng_hwstatus (); } static inline int rng_data_present (void) { assert (rng_mem != NULL); - assert (rng_hw_enabled == 1); return (readb (rng_mem + RNG_STATUS) & RNG_DATA_PRESENT) ? 1 : 0; } @@ -185,176 +117,157 @@ static inline int rng_data_read (void) { assert (rng_mem != NULL); - assert (rng_hw_enabled == 1); return readb (rng_mem + RNG_DATA); } - /* - * rng_enable - enable or disable the RNG hardware + * rng_enable - enable the RNG hardware */ -static int rng_enable (int enable) + +static int rng_enable (void) { int rc = 0; - u8 hw_status; + u8 hw_status, new_status; DPRINTK ("ENTER\n"); - spin_lock (&rng_lock); - hw_status = rng_hwstatus (); - if (enable) { - rng_hw_enabled = 1; - rng_use_count++; - MOD_INC_USE_COUNT; - } else { - rng_use_count--; - if (rng_use_count == 0) - rng_hw_enabled = 0; - MOD_DEC_USE_COUNT; - } + if ((hw_status & RNG_ENABLED) == 0) { + new_status = rng_hwstatus_set (hw_status | RNG_ENABLED); - if (rng_hw_enabled && ((hw_status & RNG_ENABLED) == 0)) { - rng_hwstatus_set (hw_status | RNG_ENABLED); - printk (KERN_INFO PFX "RNG h/w enabled\n"); + if (new_status & RNG_ENABLED) + printk (KERN_INFO PFX "RNG h/w enabled\n"); + else { + printk (KERN_ERR PFX "Unable to enable the RNG\n"); + rc = -EIO; + } } - else if (!rng_hw_enabled && (hw_status & RNG_ENABLED)) { - rng_hwstatus_set (hw_status & ~RNG_ENABLED); - printk (KERN_INFO PFX "RNG h/w disabled\n"); - } + DPRINTK ("EXIT, returning %d\n", rc); + return rc; +} + +/* + * rng_disable - disable the RNG hardware + */ - spin_unlock (&rng_lock); +static void rng_disable(void) +{ + u8 hw_status, new_status; + + DPRINTK ("ENTER\n"); + + hw_status = rng_hwstatus (); - if ((!!enable) != (!!(rng_hwstatus () & RNG_ENABLED))) { - printk (KERN_ERR PFX "Unable to %sable the RNG\n", - enable ? "en" : "dis"); - rc = -EIO; + if (hw_status & RNG_ENABLED) { + new_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED); + + if ((new_status & RNG_ENABLED) == 0) + printk (KERN_INFO PFX "RNG h/w disabled\n"); + else { + printk (KERN_ERR PFX "Unable to disable the RNG\n"); + } } - DPRINTK ("EXIT, returning %d\n", rc); - return rc; + DPRINTK ("EXIT\n"); } - static int rng_dev_open (struct inode *inode, struct file *filp) { - int rc = -EINVAL; - - MOD_INC_USE_COUNT; + int rc; if ((filp->f_mode & FMODE_READ) == 0) - goto err_out; + return -EINVAL; if (filp->f_mode & FMODE_WRITE) - goto err_out; - - spin_lock (&rng_lock); + return -EINVAL; - /* only allow one open of this device, exit with -EBUSY if already open */ - /* FIXME: we should sleep on a semaphore here, unless O_NONBLOCK */ - if (rng_open) { - spin_unlock (&rng_lock); - rc = -EBUSY; - goto err_out; + /* wait for device to become free */ + if (filp->f_flags & O_NONBLOCK) { + if (down_trylock (&rng_open_sem)) + return -EAGAIN; + } else { + if (down_interruptible (&rng_open_sem)) + return -ERESTARTSYS; } - rng_open = 1; - - spin_unlock (&rng_lock); - - if (rng_enable(1) != 0) { - spin_lock (&rng_lock); - rng_open = 0; - spin_unlock (&rng_lock); - rc = -EIO; - goto err_out; + rc = rng_enable (); + if (rc) { + up (&rng_open_sem); + return rc; } + MOD_INC_USE_COUNT; return 0; - -err_out: - MOD_DEC_USE_COUNT; - return rc; } static int rng_dev_release (struct inode *inode, struct file *filp) { - - if (rng_enable(0) != 0) - return -EIO; - - spin_lock (&rng_lock); - rng_open = 0; - spin_unlock (&rng_lock); - + rng_disable (); + up (&rng_open_sem); MOD_DEC_USE_COUNT; return 0; } -static ssize_t rng_dev_read (struct file *filp, char * buf, size_t size, - loff_t *offp) +static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size, + loff_t * offp) { - int have_data, copied = 0; - u8 data=0; - u8 *page; - - if (size < 1) - return 0; - - page = (unsigned char *) get_free_page (GFP_KERNEL); - if (!page) - return -ENOMEM; - -read_loop: - /* using the fact that read() can return >0 but - * less than the requested amount, we simply - * read up to PAGE_SIZE or buffer size, whichever - * is smaller, and return that data. - */ - if ((copied == size) || (copied == PAGE_SIZE)) { - size_t tmpsize = (copied == size) ? size : PAGE_SIZE; - int rc = copy_to_user (buf, page, tmpsize); - free_page ((long)page); - if (rc) return rc; - return tmpsize; - } + static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; + int have_data; + u8 data = 0; + ssize_t ret = 0; - spin_lock (&rng_lock); + while (size) { + spin_lock (&rng_lock); - have_data = 0; - if (rng_data_present ()) { - data = rng_data_read (); - have_data = 1; - } + have_data = 0; + if (rng_data_present ()) { + data = rng_data_read (); + have_data = 1; + } - spin_unlock (&rng_lock); + spin_unlock (&rng_lock); - if (have_data) { - page[copied] = data; - copied++; - } else { - if (filp->f_flags & O_NONBLOCK) { - free_page ((long)page); - return -EAGAIN; + if (have_data) { + if (put_user (data, buf++)) { + ret = ret ? : -EFAULT; + break; + } + size--; + ret++; } - } - if (current->need_resched) - schedule (); + if (filp->f_flags & O_NONBLOCK) + return ret ? : -EAGAIN; + + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(1); - if (signal_pending (current)) { - free_page ((long)page); - return -ERESTARTSYS; + if (signal_pending (current)) + return ret ? : -ERESTARTSYS; } - goto read_loop; + return ret; } +static struct file_operations rng_chrdev_ops = { + open: rng_dev_open, + release: rng_dev_release, + read: rng_dev_read, +}; + + +static struct miscdevice rng_miscdev = { + RNG_MISCDEV_MINOR, + RNG_MODULE_NAME, + &rng_chrdev_ops, +}; + + /* * rng_init_one - look for and attempt to init a single RNG */ @@ -365,10 +278,11 @@ DPRINTK ("ENTER\n"); - if (rng_allocated) { - printk (KERN_ERR PFX "this driver only supports one RNG\n"); - DPRINTK ("EXIT, returning -EBUSY\n"); - return -EBUSY; + rc = misc_register (&rng_miscdev); + if (rc) { + printk (KERN_ERR PFX "cannot register misc device\n"); + DPRINTK ("EXIT, returning %d\n", rc); + goto err_out; } rng_mem = ioremap (RNG_ADDR, RNG_ADDR_LEN); @@ -376,7 +290,7 @@ printk (KERN_ERR PFX "cannot ioremap RNG Memory\n"); DPRINTK ("EXIT, returning -EBUSY\n"); rc = -EBUSY; - goto err_out; + goto err_out_free_miscdev; } /* Check for Intel 82802 */ @@ -385,80 +299,59 @@ printk (KERN_ERR PFX "RNG not detected\n"); DPRINTK ("EXIT, returning -ENODEV\n"); rc = -ENODEV; - goto err_out; + goto err_out_free_map; } - rng_allocated = 1; - - rc = rng_enable (0); - if (rc) { + /* turn RNG h/w off, if it's on */ + if (hw_status & RNG_ENABLED) + hw_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED); + if (hw_status & RNG_ENABLED) { printk (KERN_ERR PFX "cannot disable RNG, aborting\n"); - goto err_out; + goto err_out_free_map; } DPRINTK ("EXIT, returning 0\n"); return 0; +err_out_free_map: + iounmap (rng_mem); +err_out_free_miscdev: + misc_deregister (&rng_miscdev); err_out: - if (rng_mem) - iounmap (rng_mem); return rc; } -/* - * Data for PCI driver interface - */ - -MODULE_AUTHOR("Jeff Garzik, Matt Sottek"); +MODULE_AUTHOR("Jeff Garzik, Philipp Rumpf, Matt Sottek"); MODULE_DESCRIPTION("Intel i8xx chipset Random Number Generator (RNG) driver"); -static struct file_operations rng_chrdev_ops = { - open: rng_dev_open, - release: rng_dev_release, - read: rng_dev_read, -}; - - -static struct miscdevice rng_miscdev = { - RNG_MISCDEV_MINOR, - RNG_MODULE_NAME, - &rng_chrdev_ops, -}; - - /* * rng_init - initialize RNG module */ -int __init rng_init (void) +static int __init rng_init (void) { int rc; struct pci_dev *pdev; - - pdev = pci_find_device (0x8086, 0x2418, NULL); - if (!pdev) - pdev = pci_find_device (0x8086, 0x2428, NULL); - if (!pdev) - pdev = pci_find_device (0x8086, 0x1130, NULL); - if (!pdev) - return -ENODEV; DPRINTK ("ENTER\n"); - rc = rng_init_one(pdev); - if (rc) { - DPRINTK ("EXIT, returning -ENODEV\n"); - return rc; - } + init_MUTEX (&rng_open_sem); - rc = misc_register (&rng_miscdev); - if (rc) { - if (rng_mem) - iounmap (rng_mem); - DPRINTK ("EXIT, returning %d\n", rc); + pdev = pci_find_device (0x8086, 0x2418, NULL); + if (pdev) goto match; + pdev = pci_find_device (0x8086, 0x2428, NULL); + if (pdev) goto match; + pdev = pci_find_device (0x8086, 0x1130, NULL); + if (pdev) goto match; + + DPRINTK ("EXIT, returning -ENODEV\n"); + return -ENODEV; + +match: + rc = rng_init_one (pdev); + if (rc) return rc; - } printk (KERN_INFO RNG_DRIVER_NAME " loaded\n"); @@ -466,24 +359,21 @@ return 0; } -#ifdef MODULE - -int init_module (void) { return rng_init (); } /* * rng_init - shutdown RNG module */ -void cleanup_module (void) +static void rng_cleanup (void) { DPRINTK ("ENTER\n"); - - iounmap (rng_mem); - - rng_hwstatus_set (rng_hwstatus() & ~RNG_ENABLED); misc_deregister (&rng_miscdev); + iounmap (rng_mem); + DPRINTK ("EXIT\n"); } -#endif /* MODULE */ + +module_init (rng_init); +module_exit (rng_cleanup); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/lp.c linux.20p9/drivers/char/lp.c --- linux.vanilla/drivers/char/lp.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/char/lp.c Wed Jul 4 16:03:54 2001 @@ -306,7 +306,7 @@ } /* * NOTE: if you run with irqs you _must_ use - * `tunelp /dev/lp? -c 1' to be rasonable efficient! + * `tunelp /dev/lp? -c 1' to be reasonably efficient! * * ..but beware that data corruption can happen that way. -Tim */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/machzwd.c linux.20p9/drivers/char/machzwd.c --- linux.vanilla/drivers/char/machzwd.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/char/machzwd.c Thu Jul 26 15:25:50 2001 @@ -0,0 +1,545 @@ +/* + * MachZ ZF-Logic Watchdog Timer driver for Linux + * + * + * 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. + * + * The author does NOT admit liability nor provide warranty for + * any of this software. This material is provided "AS-IS" in + * the hope that it may be useful for others. + * + * Author: Fernando Fuganti + * + * Based on sbc60xxwdt.c by Jakob Oestergaard + * + * + * We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the + * following periods: + * wd#1 - 2 seconds; + * wd#2 - 7.2 ms; + * After the expiration of wd#1, it can generate a NMI, SCI, SMI, or + * a system RESET and it starts wd#2 that unconditionaly will RESET + * the system when the counter reaches zero. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* ports */ +#define ZF_IOBASE 0x218 +#define INDEX 0x218 +#define DATA_B 0x219 +#define DATA_W 0x21A +#define DATA_D 0x21A + +/* indexes */ /* size */ +#define ZFL_VERSION 0x02 /* 16 */ +#define CONTROL 0x10 /* 16 */ +#define STATUS 0x12 /* 8 */ +#define COUNTER_1 0x0C /* 16 */ +#define COUNTER_2 0x0E /* 8 */ +#define PULSE_LEN 0x0F /* 8 */ + +/* controls */ +#define ENABLE_WD1 0x0001 +#define ENABLE_WD2 0x0002 +#define RESET_WD1 0x0010 +#define RESET_WD2 0x0020 +#define GEN_SCI 0x0100 +#define GEN_NMI 0x0200 +#define GEN_SMI 0x0400 +#define GEN_RESET 0x0800 + + +/* utilities */ + +#define WD1 0 +#define WD2 1 + +#define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); } +#define zf_writeb(port, data) { outb(port, INDEX); outb(data, DATA_B); } +#define zf_get_ZFL_version() zf_readw(ZFL_VERSION) + + +static unsigned short zf_readw(unsigned char port) +{ + outb(port, INDEX); + return inw(DATA_W); +} + +static unsigned short zf_readb(unsigned char port) +{ + outb(port, INDEX); + return inb(DATA_B); +} + + +MODULE_AUTHOR("Fernando Fuganti "); +MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); +MODULE_PARM(action, "i"); +MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"); + +#define PFX "machzwd" + +static struct watchdog_info zf_info = { + options: WDIOF_KEEPALIVEPING, + firmware_version: 1, + identity: "ZF-Logic watchdog" +}; + + +/* + * action refers to action taken when watchdog resets + * 0 = GEN_RESET + * 1 = GEN_SMI + * 2 = GEN_NMI + * 3 = GEN_SCI + * defaults to GEN_RESET (0) + */ +static int action = 0; +static int zf_action = GEN_RESET; +static int zf_is_open = 0; +static int zf_expect_close = 0; +static spinlock_t zf_lock; +static struct timer_list zf_timer; +static unsigned long next_heartbeat = 0; + + +/* timeout for user land heart beat (10 seconds) */ +#define ZF_USER_TIMEO (HZ*10) + +/* timeout for hardware watchdog (~500ms) */ +#define ZF_HW_TIMEO (HZ/2) + +/* number of ticks on WD#1 (driven by a 32KHz clock, 2s) */ +#define ZF_CTIMEOUT 0xffff + +#ifndef ZF_DEBUG +# define dprintk(format, args...) +#else +# define dprintk(format, args...) printk(KERN_DEBUG PFX ":" __FUNCTION__ ":%d: " format, __LINE__ , ## args) +#endif + + +/* STATUS register functions */ + +static inline unsigned char zf_get_status(void) +{ + return zf_readb(STATUS); +} + +static inline void zf_set_status(unsigned char new) +{ + zf_writeb(STATUS, new); +} + + +/* CONTROL register functions */ + +static inline unsigned short zf_get_control(void) +{ + return zf_readw(CONTROL); +} + +static inline void zf_set_control(unsigned short new) +{ + zf_writew(CONTROL, new); +} + + +/* WD#? counter functions */ +/* + * Just get current counter value + */ + +inline unsigned short zf_get_timer(unsigned char n) +{ + switch(n){ + case WD1: + return zf_readw(COUNTER_1); + case WD2: + return zf_readb(COUNTER_2); + default: + return 0; + } +} + +/* + * Just set counter value + */ + +static inline void zf_set_timer(unsigned short new, unsigned char n) +{ + switch(n){ + case WD1: + zf_writew(COUNTER_1, new); + case WD2: + zf_writeb(COUNTER_2, new > 0xff ? 0xff : new); + default: + return; + } +} + +/* + * stop hardware timer + */ +static void zf_timer_off(void) +{ + unsigned int ctrl_reg = 0; + + /* stop internal ping */ + del_timer(&zf_timer); + + /* stop watchdog timer */ + ctrl_reg = zf_get_control(); + ctrl_reg |= (ENABLE_WD1|ENABLE_WD2); /* disable wd1 and wd2 */ + ctrl_reg &= ~(ENABLE_WD1|ENABLE_WD2); + zf_set_control(ctrl_reg); + + printk(PFX ": Watchdog timer is now disabled\n"); +} + + +/* + * start hardware timer + */ +static void zf_timer_on(void) +{ + unsigned int ctrl_reg = 0; + + zf_writeb(PULSE_LEN, 0xff); + + zf_set_timer(ZF_CTIMEOUT, WD1); + + /* user land ping */ + next_heartbeat = jiffies + ZF_USER_TIMEO; + + /* start the timer for internal ping */ + zf_timer.expires = jiffies + ZF_HW_TIMEO; + + add_timer(&zf_timer); + + /* start watchdog timer */ + ctrl_reg = zf_get_control(); + ctrl_reg |= (ENABLE_WD1|zf_action); + zf_set_control(ctrl_reg); + + printk(PFX ": Watchdog timer is now enabled\n"); +} + + +static void zf_ping(unsigned long data) +{ + unsigned int ctrl_reg = 0; + + zf_writeb(COUNTER_2, 0xff); + + if(time_before(jiffies, next_heartbeat)){ + + dprintk("time_before: %ld\n", next_heartbeat - jiffies); + + /* + * reset event is activated by transition from 0 to 1 on + * RESET_WD1 bit and we assume that it is already zero... + */ + ctrl_reg = zf_get_control(); + ctrl_reg |= RESET_WD1; + zf_set_control(ctrl_reg); + + /* ...and nothing changes until here */ + ctrl_reg &= ~(RESET_WD1); + zf_set_control(ctrl_reg); + + zf_timer.expires = jiffies + ZF_HW_TIMEO; + add_timer(&zf_timer); + }else{ + printk(PFX ": I will reset your machine\n"); + } +} + +static ssize_t zf_write(struct file *file, const char *buf, size_t count, + loff_t *ppos) +{ + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + + /* See if we got the magic character */ + if(count){ + +/* + * no need to check for close confirmation + * no way to disable watchdog ;) + */ +#ifndef CONFIG_WATCHDOG_NOWAYOUT + size_t ofs; + + /* + * note: just in case someone wrote the magic character + * five months ago... + */ + zf_expect_close = 0; + + /* now scan */ + for(ofs = 0; ofs != count; ofs++){ + if(buf[ofs] == 'V'){ + zf_expect_close = 1; + dprintk("zf_expect_close 1\n"); + } + } +#endif + /* + * Well, anyhow someone wrote to us, + * we should return that favour + */ + next_heartbeat = jiffies + ZF_USER_TIMEO; + dprintk("user ping at %ld\n", jiffies); + + return 1; + } + + return 0; +} + +static ssize_t zf_read(struct file *file, char *buf, size_t count, + loff_t *ppos) +{ + return -EINVAL; +} + + + +static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + int ret; + + switch(cmd){ + case WDIOC_GETSUPPORT: + ret = copy_to_user((struct watchdog_info *)arg, + &zf_info, sizeof(zf_info)); + if(ret) + return -EFAULT; + break; + + case WDIOC_GETSTATUS: + ret = copy_to_user((int *)arg, &zf_is_open, + sizeof(int)); + if(ret) + return -EFAULT; + break; + + case WDIOC_KEEPALIVE: + zf_ping(0); + break; + + default: + return -ENOTTY; + } + + return 0; +} + +static int zf_open(struct inode *inode, struct file *file) +{ + switch(MINOR(inode->i_rdev)){ + case WATCHDOG_MINOR: + spin_lock(&zf_lock); + if(zf_is_open){ + spin_unlock(&zf_lock); + return -EBUSY; + } + +#ifdef CONFIG_WATCHDOG_NOWAYOUT + MOD_INC_USE_COUNT; +#endif + zf_is_open = 1; + + spin_unlock(&zf_lock); + + zf_timer_on(); + + return 0; + default: + return -ENODEV; + } +} + +static int zf_close(struct inode *inode, struct file *file) +{ + if(MINOR(inode->i_rdev) == WATCHDOG_MINOR){ + + if(zf_expect_close){ + zf_timer_off(); + } else { + del_timer(&zf_timer); + printk(PFX ": device file closed unexpectedly. Will not stop the WDT!\n"); + } + + spin_lock(&zf_lock); + zf_is_open = 0; + spin_unlock(&zf_lock); + + zf_expect_close = 0; + } + + return 0; +} + +/* + * Notifier for system down + */ + +static int zf_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if(code == SYS_DOWN || code == SYS_HALT){ + zf_timer_off(); + } + + return NOTIFY_DONE; +} + + + + +static struct file_operations zf_fops = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,34) + owner: THIS_MODULE, +#endif + read: zf_read, + write: zf_write, + ioctl: zf_ioctl, + open: zf_open, + release: zf_close, +}; + +static struct miscdevice zf_miscdev = { + WATCHDOG_MINOR, + "watchdog", + &zf_fops +}; + + +/* + * The device needs to learn about soft shutdowns in order to + * turn the timebomb registers off. + */ +static struct notifier_block zf_notifier = { + zf_notify_sys, + NULL, + 0 +}; + +static void __init zf_show_action(int act) +{ + char *str[] = { "RESET", "SMI", "NMI", "SCI" }; + + printk(PFX ": Watchdog using action = %s\n", str[act]); +} + +int __init zf_init(void) +{ + int ret; + + printk(PFX ": MachZ ZF-Logic Watchdog driver initializing.\n"); + + ret = zf_get_ZFL_version(); + printk("%#x\n", ret); + if((!ret) || (ret != 0xffff)){ + printk(PFX ": no ZF-Logic found\n"); + return -ENODEV; + } + + if((action <= 3) && (action >= 0)){ + zf_action = zf_action>>action; + } else + action = 0; + + zf_show_action(action); + + spin_lock_init(&zf_lock); + + ret = misc_register(&zf_miscdev); + if (ret){ + printk(KERN_ERR "can't misc_register on minor=%d\n", + WATCHDOG_MINOR); + goto out; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,3) + if(check_region(ZF_IOBASE, 3)){ +#else + if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){ +#endif + + printk(KERN_ERR "cannot reserve I/O ports at %d\n", + ZF_IOBASE); + ret = -EBUSY; + goto no_region; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,3) + request_region(ZF_IOBASE, 3, "MachZ ZFL WDT"); +#define __exit +#endif + + ret = register_reboot_notifier(&zf_notifier); + if(ret){ + printk(KERN_ERR "can't register reboot notifier (err=%d)\n", + ret); + goto no_reboot; + } + + zf_set_status(0); + zf_set_control(0); + + /* this is the timer that will do the hard work */ + init_timer(&zf_timer); + zf_timer.function = zf_ping; + zf_timer.data = 0; + + return 0; + +no_reboot: + release_region(ZF_IOBASE, 3); +no_region: + misc_deregister(&zf_miscdev); +out: + return ret; +} + + +void __exit zf_exit(void) +{ + zf_timer_off(); + + misc_deregister(&zf_miscdev); + unregister_reboot_notifier(&zf_notifier); + release_region(ZF_IOBASE, 3); +} + +module_init(zf_init); +module_exit(zf_exit); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/mem.c linux.20p9/drivers/char/mem.c --- linux.vanilla/drivers/char/mem.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/char/mem.c Wed Aug 8 22:14:09 2001 @@ -49,6 +49,9 @@ #ifdef CONFIG_MDA_CONSOLE extern void mda_console_init(void); #endif +#ifdef CONFIG_S390_TAPE_CHAR +extern void tapechar_init(void); +#endif static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp, const char * buf, size_t count, loff_t *ppos) @@ -656,5 +659,8 @@ #ifdef CONFIG_PHONE telephony_init(); #endif +#if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR) + tapechar_init(); +#endif return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/misc.c linux.20p9/drivers/char/misc.c --- linux.vanilla/drivers/char/misc.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/char/misc.c Wed Jul 4 16:03:54 2001 @@ -84,7 +84,6 @@ extern int pc110pad_init(void); extern int pmu_device_init(void); extern int tosh_init(void); -extern int rng_init(void); static int misc_read_proc(char *buf, char **start, off_t offset, int len, int *eof, void *private) @@ -287,9 +286,6 @@ #ifdef CONFIG_SGI streamable_init (); #endif -#ifdef CONFIG_INTEL_RNG - rng_init (); -#endif #ifdef CONFIG_TOSHIBA tosh_init(); #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/mixcomwd.c linux.20p9/drivers/char/mixcomwd.c --- linux.vanilla/drivers/char/mixcomwd.c Sun Mar 25 17:31:27 2001 +++ linux.20p9/drivers/char/mixcomwd.c Thu Jul 26 15:26:06 2001 @@ -164,7 +164,7 @@ mixcomwd_ping(); break; default: - return -ENOIOCTLCMD; + return -ENOTTY; } return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/moxa.c linux.20p9/drivers/char/moxa.c --- linux.vanilla/drivers/char/moxa.c Sun Mar 25 17:31:27 2001 +++ linux.20p9/drivers/char/moxa.c Thu Jul 26 15:26:06 2001 @@ -697,21 +697,32 @@ struct moxa_str *ch; int len, port; unsigned long flags; - unsigned char *temp; ch = (struct moxa_str *) tty->driver_data; if (ch == NULL) return (0); port = ch->port; save_flags(flags); - cli(); if (from_user) { - copy_from_user(moxaXmitBuff, buf, count); - temp = moxaXmitBuff; - } else - temp = (unsigned char *) buf; - len = MoxaPortWriteData(port, temp, count); - restore_flags(flags); + if (count > PAGE_SIZE) + count = PAGE_SIZE; + down(&moxaBuffSem); + if (copy_from_user(moxaXmitBuff, buf, count)) { + len = -EFAULT; + } else { + cli(); + len = MoxaPortWriteData(port, moxaXmitBuff, count); + restore_flags(flags); + } + up(&moxaBuffSem); + if (len < 0) + return len; + } else { + cli(); + len = MoxaPortWriteData(port, (unsigned char *) buf, count); + restore_flags(flags); + } + /********************************************* if ( !(ch->statusflags & LOWWAIT) && ((len != count) || (MoxaPortTxFree(port) <= 100)) ) @@ -2905,6 +2916,8 @@ unsigned long baseAddr; int i; + if(len > sizeof(moxaBuff)) + return -EINVAL; if(copy_from_user(moxaBuff, tmp, len)) return -EFAULT; baseAddr = moxaBaseAddr[cardno]; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/n_hdlc.c linux.20p9/drivers/char/n_hdlc.c --- linux.vanilla/drivers/char/n_hdlc.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/char/n_hdlc.c Wed Jul 4 16:03:54 2001 @@ -9,7 +9,7 @@ * Al Longyear , Paul Mackerras * * Original release 01/11/99 - * $Id: n_hdlc.c,v 2.2 2000/11/08 17:08:29 paul Exp $ + * $Id: n_hdlc.c,v 2.3 2001/05/09 14:42:37 paul Exp $ * * This code is released under the GNU General Public License (GPL) * @@ -78,7 +78,7 @@ */ #define HDLC_MAGIC 0x239e -#define HDLC_VERSION "2.2" +#define HDLC_VERSION "$Revision: 2.3 $" #include #include @@ -98,6 +98,7 @@ #include #include #include +#include #include /* used in new tty drivers */ #include /* used in new tty drivers */ #include @@ -986,14 +987,7 @@ } /* end of n_hdlc_buf_get() */ -/* init_module() - * - * called when module is loading to register line discipline - * - * Arguments: None - * Return Value: 0 if success, otherwise error code - */ -int init_module(void) +int __init n_hdlc_init() { static struct tty_ldisc n_hdlc_ldisc; int status; @@ -1031,16 +1025,14 @@ if (status) printk(KERN_INFO"N_HDLC: init failure %d\n", status); return (status); - -} /* end of init_module() */ +} + +#ifdef MODULE +int init_module(void) +{ + return n_hdlc_init(); +} -/* cleanup_module() - * - * called when module is unloading to unregister line discipline - * - * Arguments: None - * Return Value: None - */ void cleanup_module(void) { int status; @@ -1050,3 +1042,4 @@ else printk("N_HDLC: line discipline unregistered\n"); } +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/pc110pad.c linux.20p9/drivers/char/pc110pad.c --- linux.vanilla/drivers/char/pc110pad.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/pc110pad.c Thu Jul 26 15:26:51 2001 @@ -612,7 +612,7 @@ current_params.tap_interval = new.tap_interval; return 0; } - return -ENOIOCTLCMD; + return -ENOTTY; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/pcwd.c linux.20p9/drivers/char/pcwd.c --- linux.vanilla/drivers/char/pcwd.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/pcwd.c Thu Jul 26 15:26:51 2001 @@ -240,7 +240,7 @@ switch(cmd) { default: - return -ENOIOCTLCMD; + return -ENOTTY; case WDIOC_GETSUPPORT: i = copy_to_user((void*)arg, &ident, sizeof(ident)); @@ -476,6 +476,8 @@ char *ret; ret = kmalloc(6, GFP_KERNEL); + if(ret == NULL) + return NULL; while((count < 3) && (!found)) { outb_p(0x80, current_readport + 2); @@ -497,10 +499,8 @@ ten = send_command(0x82); hund = send_command(0x83); minor = send_command(0x84); - } - - if (found) sprintf(ret, "%c.%c%c%c", one, ten, hund, minor); + } else sprintf(ret, "ERROR"); @@ -622,12 +622,12 @@ #ifdef MODULE void cleanup_module(void) { + misc_deregister(&pcwd_miscdev); /* Disable the board */ if (revision == PCWD_REVISION_C) { outb_p(0xA5, current_readport + 3); outb_p(0xA5, current_readport + 3); } - misc_deregister(&pcwd_miscdev); if (supports_temp) misc_deregister(&temp_miscdev); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/rio/linux_compat.h linux.20p9/drivers/char/rio/linux_compat.h --- linux.vanilla/drivers/char/rio/linux_compat.h Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/rio/linux_compat.h Thu Jul 26 17:55:17 2001 @@ -93,6 +93,7 @@ #define RIO_DEBUG_SPINLOCK 0x010000 #define RIO_DEBUG_DELAY 0x020000 #define RIO_DEBUG_MOD_COUNT 0x040000 +#define RIO_DEBUG_IOCTL 0x080000 /* Copied over from riowinif.h . This is ugly. The winif file declares also much other stuff which is incompatible with the headers from diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/rio/rio_linux.c linux.20p9/drivers/char/rio/rio_linux.c --- linux.vanilla/drivers/char/rio/rio_linux.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/rio/rio_linux.c Wed Jul 4 16:03:54 2001 @@ -730,12 +730,31 @@ } +int rio2l (int rio_bits) +{ + return ((rio_bits & MODEM_CD) ?TIOCM_CD :0) | + ((rio_bits & MODEM_DSR)?TIOCM_DSR:0) | + ((rio_bits & MODEM_RTS)?TIOCM_RTS:0) | + ((rio_bits & MODEM_RI) ?TIOCM_RI :0) | + ((rio_bits & MODEM_DTR)?TIOCM_DTR:0) | + ((rio_bits & MODEM_CTS)?TIOCM_CTS:0); +} + +int l2rio (int l_bits) +{ + return ((l_bits & TIOCM_RTS)?MSET_RTS:0) | + ((l_bits & TIOCM_DTR)?MSET_DTR:0); +} + + static int rio_ioctl (struct tty_struct * tty, struct file * filp, unsigned int cmd, unsigned long arg) { int rc; struct Port *PortP; int ival; + int state; + long flags; func_enter(); @@ -766,7 +785,7 @@ break; case TCSBRK: if ( PortP->State & RIO_DELETED ) { - rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n"); + rio_dprintk (RIO_DEBUG_IOCTL, "BREAK on deleted RTA\n"); rc = -EIO; } else { if (RIOShortCommand(p, PortP, SBREAK, 2, 250) == RIO_FAIL) { @@ -777,7 +796,7 @@ break; case TCSBRKP: if ( PortP->State & RIO_DELETED ) { - rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n"); + rio_dprintk (RIO_DEBUG_IOCTL, "BREAK on deleted RTA\n"); rc = -EIO; } else { int l; @@ -794,39 +813,48 @@ sizeof(struct serial_struct))) == 0) rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg); break; -#if 0 case TIOCMGET: - if ((rc = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(unsigned int))) == 0) { - ival = rio_getsignals(port); - put_user(ival, (unsigned int *) arg); - } + rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMGET: %x -> %x \n", + PortP->ModemState, rio2l (PortP->ModemState)); + return put_user (rio2l (PortP->ModemState), (unsigned int *) arg); break; - case TIOCMBIS: - if ((rc = verify_area(VERIFY_READ, (void *) arg, - sizeof(unsigned int))) == 0) { - Get_user(ival, (unsigned int *) arg); - rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1), - ((ival & TIOCM_RTS) ? 1 : -1)); - } + case TIOCMSET: + Get_user(state, (unsigned int *) arg); + rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMSET: %x -> %x\n", + PortP->ModemState, l2rio (state)); + + rio_spin_lock_irqsave(&PortP->portSem, flags); + PortP->ModemState = l2rio (state); + PortP->ModemLines = l2rio (state); + if (RIOPreemptiveCmd(p, PortP, MSET) == RIO_FAIL) + rio_dprintk (RIO_DEBUG_TTY, "MSET command failed\n"); + PortP->State |= RIO_BUSY; + rio_spin_unlock_irqrestore(&PortP->portSem, flags); break; case TIOCMBIC: - if ((rc = verify_area(VERIFY_READ, (void *) arg, - sizeof(unsigned int))) == 0) { - Get_user(ival, (unsigned int *) arg); - rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1), - ((ival & TIOCM_RTS) ? 0 : -1)); - } + rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMBIC\n"); + Get_user(state, (unsigned int *) arg); + + rio_spin_lock_irqsave(&PortP->portSem, flags); + PortP->ModemState &= ~l2rio (state); + PortP->ModemLines = l2rio (state); + if (RIOPreemptiveCmd(p, PortP, MBIC) == RIO_FAIL) + rio_dprintk (RIO_DEBUG_TTY, "TCRIOMBIC command failed\n"); + PortP->State |= RIO_BUSY; + rio_spin_unlock_irqrestore(&PortP->portSem, flags); break; - case TIOCMSET: - if ((rc = verify_area(VERIFY_READ, (void *) arg, - sizeof(unsigned int))) == 0) { - Get_user(ival, (unsigned int *) arg); - rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0), - ((ival & TIOCM_RTS) ? 1 : 0)); - } + case TIOCMBIS: + rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMBIS\n"); + Get_user(state, (unsigned int *) arg); + + rio_spin_lock_irqsave(&PortP->portSem, flags); + PortP->ModemState |= state; + PortP->ModemLines = state; + if (RIOPreemptiveCmd(p, PortP, MBIS) == RIO_FAIL) + rio_dprintk (RIO_DEBUG_TTY, "TCRIOMBIS command failed\n"); + PortP->State |= RIO_BUSY; + rio_spin_unlock_irqrestore(&PortP->portSem, flags); break; -#endif default: rc = -ENOIOCTLCMD; break; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/rio/rio_linux.h linux.20p9/drivers/char/rio/rio_linux.h --- linux.vanilla/drivers/char/rio/rio_linux.h Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/rio/rio_linux.h Thu Jul 26 17:55:17 2001 @@ -190,3 +190,20 @@ #define func_enter2() #endif +/* Documentation says to use these defines. Why aren't they in a + * header then? Hmm. They are in the header "riowinif.h", however + * that file doesn't compile. I give up. Copied here. -- REW + */ + +#define MSET_RTS 0x01 /* RTS modem signal */ +#define MSET_DTR 0x02 /* DTR modem signal */ + +#define MODEM_DSR 0x80 /* Data Set Ready modem state */ +#define MODEM_CTS 0x40 /* Clear To Send modem state */ +#define MODEM_RI 0x20 /* Ring Indicate modem state */ +#define MODEM_CD 0x10 /* Carrier Detect modem state */ +#define MODEM_TSTOP 0x08 /* Transmit Stopped state */ +#define MODEM_TEMPTY 0x04 /* Transmit Empty state */ +#define MODEM_DTR 0x02 /* DTR modem output state */ +#define MODEM_RTS 0x01 /* RTS modem output state */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/rio/riodrvr.h linux.20p9/drivers/char/rio/riodrvr.h --- linux.vanilla/drivers/char/rio/riodrvr.h Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/rio/riodrvr.h Wed Jul 4 16:03:54 2001 @@ -33,12 +33,13 @@ #ifndef __riodrvr_h #define __riodrvr_h +#include /* for HZ */ + #ifdef SCCS_LABELS static char *_riodrvr_h_sccs_ = "@(#)riodrvr.h 1.3"; #endif #define MEMDUMP_SIZE 32 -#define HZ 100 #define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/riscom8.c linux.20p9/drivers/char/riscom8.c --- linux.vanilla/drivers/char/riscom8.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/riscom8.c Thu Jul 26 15:27:30 2001 @@ -1214,33 +1214,58 @@ if (!tty || !port->xmit_buf || !tmp_buf) return 0; - if (from_user) + save_flags(flags); + if (from_user) { down(&tmp_buf_sem); + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) + break; - save_flags(flags); - while (1) { - cli(); - c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - if (c <= 0) - break; + c -= copy_from_user(tmp_buf, buf, c); + if (!c) { + if (!total) + total = -EFAULT; + break; + } - if (from_user) { - copy_from_user(tmp_buf, buf, c); + cli(); c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, SERIAL_XMIT_SIZE - port->xmit_head)); memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c); - } else + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } + up(&tmp_buf_sem); + } else { + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) { + restore_flags(flags); + break; + } + memcpy(port->xmit_buf + port->xmit_head, buf, c); - port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - port->xmit_cnt += c; - restore_flags(flags); - buf += c; - count -= c; - total += c; + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } } - if (from_user) - up(&tmp_buf_sem); + + cli(); if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped && !(port->IER & IER_TXRDY)) { port->IER |= IER_TXRDY; @@ -1248,6 +1273,7 @@ rc_out(bp, CD180_IER, port->IER); } restore_flags(flags); + return total; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/sbc60xxwdt.c linux.20p9/drivers/char/sbc60xxwdt.c --- linux.vanilla/drivers/char/sbc60xxwdt.c Sun Mar 25 17:31:28 2001 +++ linux.20p9/drivers/char/sbc60xxwdt.c Thu Jul 26 17:54:10 2001 @@ -49,7 +49,7 @@ * * Why `V' ? Well, `V' is the character in ASCII for the value 86, * and we all know that 86 is _the_ most random number in the universe. - * Therefore it is the letter that has the slightest chance of occuring + * Therefore it is the letter that has the slightest chance of occurring * by chance, when the system becomes corrupted. * */ @@ -170,9 +170,13 @@ /* now scan */ for(ofs = 0; ofs != count; ofs++) - if(buf[ofs] == 'V') + { + char c; + if(get_user(c, buf+ofs)) + return -EFAULT; + if(c == 'V') wdt_expect_close = 1; - + } /* Well, anyhow someone wrote to us, we should return that favour */ next_heartbeat = jiffies + WDT_HEARTBEAT; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/softdog.c linux.20p9/drivers/char/softdog.c --- linux.vanilla/drivers/char/softdog.c Sun Mar 25 17:31:25 2001 +++ linux.20p9/drivers/char/softdog.c Thu Jul 26 15:28:20 2001 @@ -141,7 +141,7 @@ switch(cmd) { default: - return -ENOIOCTLCMD; + return -ENOTTY; case WDIOC_GETSUPPORT: if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) return -EFAULT; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/specialix.c linux.20p9/drivers/char/specialix.c --- linux.vanilla/drivers/char/specialix.c Sun Mar 25 17:31:26 2001 +++ linux.20p9/drivers/char/specialix.c Thu Jul 26 15:28:35 2001 @@ -1611,33 +1611,56 @@ if (!tty || !port->xmit_buf || !tmp_buf) return 0; - if (from_user) + save_flags(flags); + if (from_user) { down(&tmp_buf_sem); + while (1) { + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) + break; - save_flags(flags); - while (1) { - cli(); - c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - if (c <= 0) - break; + c -= copy_from_user(tmp_buf, buf, c); + if (!c) { + if (!total) + total = -EFAULT; + break; + } - if (from_user) { - copy_from_user(tmp_buf, buf, c); + cli(); c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); + SERIAL_XMIT_SIZE - port->xmit_head)); memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c); - } else + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } + up(&tmp_buf_sem); + } else { + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) { + restore_flags(flags); + break; + } memcpy(port->xmit_buf + port->xmit_head, buf, c); - port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - port->xmit_cnt += c; - restore_flags(flags); - buf += c; - count -= c; - total += c; + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } } - if (from_user) - up(&tmp_buf_sem); + + cli(); if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped && !(port->IER & IER_TXRDY)) { port->IER |= IER_TXRDY; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/synclink.c linux.20p9/drivers/char/synclink.c --- linux.vanilla/drivers/char/synclink.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/char/synclink.c Wed Jul 4 16:03:54 2001 @@ -1,7 +1,7 @@ /* * linux/drivers/char/synclink.c * - * $Id: synclink.c,v 2.4 2000/12/11 20:08:18 paul Exp $ + * $Id: synclink.c,v 2.12 2001/05/10 20:53:04 paulkf Exp $ * * Device driver for Microgate SyncLink ISA and PCI * high speed multiprotocol serial adapters. @@ -54,7 +54,11 @@ */ #define VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq)) -#define BREAKPOINT() asm(" int $3"); +#if defined(__i386__) +# define BREAKPOINT() asm(" int $3"); +#else +# define BREAKPOINT() { } +#endif #define MAX_ISA_DEVICES 10 #define MAX_PCI_DEVICES 10 @@ -182,6 +186,13 @@ int cts_down; }; +/* transmit holding buffer definitions*/ +#define MAX_TX_HOLDING_BUFFERS 5 +struct tx_holding_buffer { + int buffer_size; + unsigned char * buffer; +}; + /* * Device instance data structure */ @@ -247,11 +258,21 @@ DMABUFFERENTRY *rx_buffer_list; /* list of receive buffer entries */ unsigned int current_rx_buffer; + int num_tx_dma_buffers; /* number of tx dma frames required */ + int tx_dma_buffers_used; unsigned int tx_buffer_count; /* count of total allocated Tx buffers */ DMABUFFERENTRY *tx_buffer_list; /* list of transmit buffer entries */ + int start_tx_dma_buffer; /* tx dma buffer to start tx dma operation */ + int current_tx_buffer; /* next tx dma buffer to be loaded */ unsigned char *intermediate_rxbuffer; + int num_tx_holding_buffers; /* number of tx holding buffer allocated */ + int get_tx_holding_index; /* next tx holding buffer for adapter to load */ + int put_tx_holding_index; /* next tx holding buffer to store user request */ + int tx_holding_count; /* number of tx holding buffers waiting */ + struct tx_holding_buffer tx_holding_buffers[MAX_TX_HOLDING_BUFFERS]; + int rx_enabled; int rx_overflow; @@ -691,6 +712,8 @@ #define usc_TCmd(a,b) usc_OutReg((a), TCSR, (u16)((a)->tcsr_value + (b))) #define usc_RCmd(a,b) usc_OutReg((a), RCSR, (b)) +#define usc_SetTransmitSyncChars(a,s0,s1) usc_OutReg((a), TSR, (u16)(((u16)s0<<8)|(u16)s1)) + void usc_process_rxoverrun_sync( struct mgsl_struct *info ); void usc_start_receiver( struct mgsl_struct *info ); void usc_stop_receiver( struct mgsl_struct *info ); @@ -781,7 +804,10 @@ */ void mgsl_free_rx_frame_buffers( struct mgsl_struct *info, unsigned int StartIndex, unsigned int EndIndex ); int mgsl_get_rx_frame( struct mgsl_struct *info ); +int mgsl_get_raw_rx_frame( struct mgsl_struct *info ); void mgsl_reset_rx_dma_buffers( struct mgsl_struct *info ); +void mgsl_reset_tx_dma_buffers( struct mgsl_struct *info ); +int num_free_tx_dma_buffers(struct mgsl_struct *info); void mgsl_load_tx_dma_buffer( struct mgsl_struct *info, const char *Buffer, unsigned int BufferSize); void mgsl_load_pci_memory(char* TargetPtr, const char* SourcePtr, unsigned short count); @@ -796,6 +822,11 @@ void mgsl_free_buffer_list_memory(struct mgsl_struct *info); int mgsl_alloc_intermediate_rxbuffer_memory(struct mgsl_struct *info); void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info); +int mgsl_alloc_intermediate_txbuffer_memory(struct mgsl_struct *info); +void mgsl_free_intermediate_txbuffer_memory(struct mgsl_struct *info); +int load_next_tx_holding_buffer(struct mgsl_struct *info); +int save_tx_buffer_request(struct mgsl_struct *info,const char *Buffer, unsigned int BufferSize); + /* * Bottom half interrupt handlers @@ -816,6 +847,7 @@ void mgsl_isr_io_pin( struct mgsl_struct *info ); void mgsl_isr_misc( struct mgsl_struct *info ); void mgsl_isr_receive_dma( struct mgsl_struct *info ); +void mgsl_isr_transmit_dma( struct mgsl_struct *info ); typedef void (*isr_dispatch_func)(struct mgsl_struct *); @@ -880,6 +912,8 @@ static int debug_level = 0; static int maxframe[MAX_TOTAL_DEVICES] = {0,}; static int dosyncppp[MAX_TOTAL_DEVICES] = {0,}; +static int txdmabufs[MAX_TOTAL_DEVICES] = {0,}; +static int txholdbufs[MAX_TOTAL_DEVICES] = {0,}; MODULE_PARM(break_on_load,"i"); MODULE_PARM(ttymajor,"i"); @@ -890,9 +924,11 @@ MODULE_PARM(debug_level,"i"); MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); +MODULE_PARM(txdmabufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); +MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); static char *driver_name = "SyncLink serial driver"; -static char *driver_version = "2.3"; +static char *driver_version = "$Revision: 2.12 $"; static struct tty_driver serial_driver, callout_driver; static int serial_refcount; @@ -1085,11 +1121,14 @@ void mgsl_bh_receive(struct mgsl_struct *info) { + int (*get_rx_frame)(struct mgsl_struct *info) = + (info->params.mode == MGSL_MODE_HDLC ? mgsl_get_rx_frame : mgsl_get_raw_rx_frame); + if ( debug_level >= DEBUG_LEVEL_BH ) printk( "%s(%d):mgsl_bh_receive(%s)\n", __FILE__,__LINE__,info->device_name); - while( mgsl_get_rx_frame(info) ); + while( (get_rx_frame)(info) ); } void mgsl_bh_transmit(struct mgsl_struct *info) @@ -1594,6 +1633,58 @@ } /* end of mgsl_isr_receive_dma() */ +/* mgsl_isr_transmit_dma() + * + * This function services a transmit DMA channel interrupt. + * + * For this driver there is one source of transmit DMA interrupts + * as identified in the Transmit DMA Mode Register (TDMR): + * + * BIT2 EOB End of Buffer. This interrupt occurs when a + * transmit DMA buffer has been emptied. + * + * The driver maintains enough transmit DMA buffers to hold at least + * one max frame size transmit frame. When operating in a buffered + * transmit mode, there may be enough transmit DMA buffers to hold at + * least two or more max frame size frames. On an EOB condition, + * determine if there are any queued transmit buffers and copy into + * transmit DMA buffers if we have room. + * + * Arguments: info pointer to device instance data + * Return Value: None + */ +void mgsl_isr_transmit_dma( struct mgsl_struct *info ) +{ + u16 status; + + /* clear interrupt pending and IUS bit for Tx DMA IRQ */ + usc_OutDmaReg(info, CDIR, BIT8+BIT0 ); + + /* Read the transmit DMA status to identify interrupt type. */ + /* This also clears the status bits. */ + + status = usc_InDmaReg( info, TDMR ); + + if ( debug_level >= DEBUG_LEVEL_ISR ) + printk("%s(%d):mgsl_isr_transmit_dma(%s) status=%04X\n", + __FILE__,__LINE__,info->device_name,status); + + if ( status & BIT2 ) { + --info->tx_dma_buffers_used; + + /* if there are transmit frames queued, + * try to load the next one + */ + if ( load_next_tx_holding_buffer(info) ) { + /* if call returns non-zero value, we have + * at least one free tx holding buffer + */ + info->pending_bh |= BH_TRANSMIT; + } + } + +} /* end of mgsl_isr_transmit_dma() */ + /* mgsl_interrupt() * * Interrupt service routine entry point. @@ -1637,6 +1728,8 @@ /* Dispatch interrupt vector */ if ( UscVector ) (*UscIsrTable[UscVector])(info); + else if ( (DmaVector&(BIT10|BIT9)) == BIT10) + mgsl_isr_transmit_dma(info); else mgsl_isr_receive_dma(info); @@ -1803,7 +1896,9 @@ usc_stop_transmitter(info); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - if (info->params.mode == MGSL_MODE_HDLC || info->netcount) + if (info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW || + info->netcount) usc_set_sync_mode(info); else usc_set_async_mode(info); @@ -1956,8 +2051,7 @@ spin_lock_irqsave(&info->irq_spinlock,flags); - if ( (info->params.mode != MGSL_MODE_HDLC) || - !info->tx_active ) { + if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) { if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) { info->xmit_buf[info->xmit_head++] = ch; @@ -2001,8 +2095,8 @@ spin_lock_irqsave(&info->irq_spinlock,flags); if (!info->tx_active) { - if ( (info->params.mode == MGSL_MODE_HDLC) && - info->xmit_cnt ) { + if ( (info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW) && info->xmit_cnt ) { /* operating in synchronous (frame oriented) mode */ /* copy data from circular xmit_buf to */ /* transmit DMA buffer. */ @@ -2046,11 +2140,51 @@ if (!tty || !info->xmit_buf || !tmp_buf) goto cleanup; - if ( info->params.mode == MGSL_MODE_HDLC ) { - /* operating in synchronous (frame oriented) mode */ + if ( info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { + /* operating in synchronous (frame oriented) mode */ if (info->tx_active) { - ret = 0; goto cleanup; + + if ( info->params.mode == MGSL_MODE_HDLC ) { + ret = 0; + goto cleanup; + } + /* transmitter is actively sending data - + * if we have multiple transmit dma and + * holding buffers, attempt to queue this + * frame for transmission at a later time. + */ + if (info->tx_holding_count >= info->num_tx_holding_buffers ) { + /* no tx holding buffers available */ + ret = 0; + goto cleanup; + } + + /* queue transmit frame request */ + ret = count; + if (from_user) { + down(&tmp_buf_sem); + COPY_FROM_USER(err,tmp_buf, buf, count); + if (err) { + if ( debug_level >= DEBUG_LEVEL_INFO ) + printk( "%s(%d):mgsl_write(%s) sync user buf copy failed\n", + __FILE__,__LINE__,info->device_name); + ret = -EFAULT; + } else + save_tx_buffer_request(info,tmp_buf,count); + up(&tmp_buf_sem); + } + else + save_tx_buffer_request(info,buf,count); + + /* if we have sufficient tx dma buffers, + * load the next buffered tx request + */ + spin_lock_irqsave(&info->irq_spinlock,flags); + load_next_tx_holding_buffer(info); + spin_unlock_irqrestore(&info->irq_spinlock,flags); + goto cleanup; } /* if operating in HDLC LoopMode and the adapter */ @@ -2058,8 +2192,7 @@ /* transmit */ if ( (info->params.flags & HDLC_FLAG_HDLC_LOOPMODE) && - !usc_loopmode_active(info) ) - { + !usc_loopmode_active(info) ) { ret = 0; goto cleanup; } @@ -2186,7 +2319,8 @@ printk("%s(%d):mgsl_write_room(%s)=%d\n", __FILE__,__LINE__, info->device_name,ret ); - if ( info->params.mode == MGSL_MODE_HDLC ) { + if ( info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { /* operating in synchronous (frame oriented) mode */ if ( info->tx_active ) return 0; @@ -2220,10 +2354,12 @@ printk("%s(%d):mgsl_chars_in_buffer(%s)=%d\n", __FILE__,__LINE__, info->device_name,info->xmit_cnt ); - if ( info->params.mode == MGSL_MODE_HDLC ) { + if ( info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { /* operating in synchronous (frame oriented) mode */ - if ( info->tx_active ) - return info->tx_buffer_list[0].rcc; + if ( info->tx_active ) { + return info->max_frame_size; + } else return 0; } @@ -2613,11 +2749,11 @@ unsigned long flags; int s; int rc=0; - u16 regval; struct mgsl_icount cprev, cnow; - int events = 0; + int events; int mask; - struct _input_signal_events signal_events_prev, signal_events_now; + struct _input_signal_events oldsigs, newsigs; + DECLARE_WAITQUEUE(wait, current); COPY_FROM_USER(rc,&mask, mask_ptr, sizeof(int)); if (rc) { @@ -2630,114 +2766,99 @@ spin_lock_irqsave(&info->irq_spinlock,flags); + /* return immediately if state matches requested events */ usc_get_serial_signals(info); s = info->serial_signals; + events = mask & + ( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) + + ((s & SerialSignal_DCD) ? MgslEvent_DcdActive:MgslEvent_DcdInactive) + + ((s & SerialSignal_CTS) ? MgslEvent_CtsActive:MgslEvent_CtsInactive) + + ((s & SerialSignal_RI) ? MgslEvent_RiActive :MgslEvent_RiInactive) ); + if (events) { + spin_unlock_irqrestore(&info->irq_spinlock,flags); + goto exit; + } - /* note the counters on entry */ + /* save current irq counts */ cprev = info->icount; - signal_events_prev = info->input_signal_events; + oldsigs = info->input_signal_events; - if (mask & MgslEvent_ExitHuntMode) { - /* enable exit hunt mode IRQ */ - regval = usc_InReg(info,RICR); - if (!(regval & RXSTATUS_EXITED_HUNT)) - usc_OutReg(info, RICR, regval | RXSTATUS_EXITED_HUNT); + /* enable hunt and idle irqs if needed */ + if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) { + u16 oldreg = usc_InReg(info,RICR); + u16 newreg = oldreg + + (mask & MgslEvent_ExitHuntMode ? RXSTATUS_EXITED_HUNT:0) + + (mask & MgslEvent_IdleReceived ? RXSTATUS_IDLE_RECEIVED:0); + if (oldreg != newreg) + usc_OutReg(info, RICR, newreg); } - if (mask & MgslEvent_IdleReceived) { - /* enable idle mode received IRQ */ - regval = usc_InReg(info,RICR); - if (!(regval & RXSTATUS_IDLE_RECEIVED)) - usc_OutReg(info, RICR, regval | RXSTATUS_IDLE_RECEIVED); - } + set_current_state(TASK_INTERRUPTIBLE); + add_wait_queue(&info->event_wait_q, &wait); spin_unlock_irqrestore(&info->irq_spinlock,flags); - /* Determine if any user requested events for input signals is currently TRUE */ - - events |= (mask & ((s & SerialSignal_DSR) ? - MgslEvent_DsrActive:MgslEvent_DsrInactive)); - - events |= (mask & ((s & SerialSignal_DCD) ? - MgslEvent_DcdActive:MgslEvent_DcdInactive)); - - events |= (mask & ((s & SerialSignal_CTS) ? - MgslEvent_CtsActive:MgslEvent_CtsInactive)); - - events |= (mask & ((s & SerialSignal_RI) ? - MgslEvent_RiActive:MgslEvent_RiInactive)); - - while(!events) { - /* sleep until event occurs */ - interruptible_sleep_on(&info->event_wait_q); - - /* see if a signal woke us */ + for(;;) { + schedule(); if (signal_pending(current)) { rc = -ERESTARTSYS; break; } + /* get current irq counts */ spin_lock_irqsave(&info->irq_spinlock,flags); - - /* get icount and serial signal states */ cnow = info->icount; - signal_events_now = info->input_signal_events; + newsigs = info->input_signal_events; + set_current_state(TASK_INTERRUPTIBLE); spin_unlock_irqrestore(&info->irq_spinlock,flags); - if (signal_events_now.dsr_up != signal_events_prev.dsr_up && - mask & MgslEvent_DsrActive ) - events |= MgslEvent_DsrActive; - - if (signal_events_now.dsr_down != signal_events_prev.dsr_down && - mask & MgslEvent_DsrInactive ) - events |= MgslEvent_DsrInactive; - - if (signal_events_now.dcd_up != signal_events_prev.dcd_up && - mask & MgslEvent_DcdActive ) - events |= MgslEvent_DcdActive; - - if (signal_events_now.dcd_down != signal_events_prev.dcd_down && - mask & MgslEvent_DcdInactive ) - events |= MgslEvent_DcdInactive; - - if (signal_events_now.cts_up != signal_events_prev.cts_up && - mask & MgslEvent_CtsActive ) - events |= MgslEvent_CtsActive; - - if (signal_events_now.cts_down != signal_events_prev.cts_down && - mask & MgslEvent_CtsInactive ) - events |= MgslEvent_CtsInactive; - - if (signal_events_now.ri_up != signal_events_prev.ri_up && - mask & MgslEvent_RiActive ) - events |= MgslEvent_RiActive; - - if (signal_events_now.ri_down != signal_events_prev.ri_down && - mask & MgslEvent_RiInactive ) - events |= MgslEvent_RiInactive; - - if (cnow.exithunt != cprev.exithunt) - events |= (mask & MgslEvent_ExitHuntMode); + /* if no change, wait aborted for some reason */ + if (newsigs.dsr_up == oldsigs.dsr_up && + newsigs.dsr_down == oldsigs.dsr_down && + newsigs.dcd_up == oldsigs.dcd_up && + newsigs.dcd_down == oldsigs.dcd_down && + newsigs.cts_up == oldsigs.cts_up && + newsigs.cts_down == oldsigs.cts_down && + newsigs.ri_up == oldsigs.ri_up && + newsigs.ri_down == oldsigs.ri_down && + cnow.exithunt == cprev.exithunt && + cnow.rxidle == cprev.rxidle) { + rc = -EIO; + break; + } - if (cnow.rxidle != cprev.rxidle) - events |= (mask & MgslEvent_IdleReceived); + events = mask & + ( (newsigs.dsr_up != oldsigs.dsr_up ? MgslEvent_DsrActive:0) + + (newsigs.dsr_down != oldsigs.dsr_down ? MgslEvent_DsrInactive:0) + + (newsigs.dcd_up != oldsigs.dcd_up ? MgslEvent_DcdActive:0) + + (newsigs.dcd_down != oldsigs.dcd_down ? MgslEvent_DcdInactive:0) + + (newsigs.cts_up != oldsigs.cts_up ? MgslEvent_CtsActive:0) + + (newsigs.cts_down != oldsigs.cts_down ? MgslEvent_CtsInactive:0) + + (newsigs.ri_up != oldsigs.ri_up ? MgslEvent_RiActive:0) + + (newsigs.ri_down != oldsigs.ri_down ? MgslEvent_RiInactive:0) + + (cnow.exithunt != cprev.exithunt ? MgslEvent_ExitHuntMode:0) + + (cnow.rxidle != cprev.rxidle ? MgslEvent_IdleReceived:0) ); + if (events) + break; cprev = cnow; - signal_events_prev = signal_events_now; + oldsigs = newsigs; } + remove_wait_queue(&info->event_wait_q, &wait); + set_current_state(TASK_RUNNING); + if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) { spin_lock_irqsave(&info->irq_spinlock,flags); if (!waitqueue_active(&info->event_wait_q)) { /* disable enable exit hunt mode/idle rcvd IRQs */ - regval = usc_InReg(info,RICR); - usc_OutReg(info, RICR, regval & + usc_OutReg(info, RICR, usc_InReg(info,RICR) & ~(RXSTATUS_EXITED_HUNT + RXSTATUS_IDLE_RECEIVED)); } spin_unlock_irqrestore(&info->irq_spinlock,flags); } - +exit: if ( rc == 0 ) PUT_USER(rc, events, mask_ptr); @@ -2745,6 +2866,56 @@ } /* end of mgsl_wait_event() */ +static int modem_input_wait(struct mgsl_struct *info,int arg) +{ + unsigned long flags; + int rc; + struct mgsl_icount cprev, cnow; + DECLARE_WAITQUEUE(wait, current); + + /* save current irq counts */ + spin_lock_irqsave(&info->irq_spinlock,flags); + cprev = info->icount; + add_wait_queue(&info->status_event_wait_q, &wait); + set_current_state(TASK_INTERRUPTIBLE); + spin_unlock_irqrestore(&info->irq_spinlock,flags); + + for(;;) { + schedule(); + if (signal_pending(current)) { + rc = -ERESTARTSYS; + break; + } + + /* get new irq counts */ + spin_lock_irqsave(&info->irq_spinlock,flags); + cnow = info->icount; + set_current_state(TASK_INTERRUPTIBLE); + spin_unlock_irqrestore(&info->irq_spinlock,flags); + + /* if no change, wait aborted for some reason */ + if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && + cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { + rc = -EIO; + break; + } + + /* check for change in caller specified modem input */ + if ((arg & TIOCM_RNG && cnow.rng != cprev.rng) || + (arg & TIOCM_DSR && cnow.dsr != cprev.dsr) || + (arg & TIOCM_CD && cnow.dcd != cprev.dcd) || + (arg & TIOCM_CTS && cnow.cts != cprev.cts)) { + rc = 0; + break; + } + + cprev = cnow; + } + remove_wait_queue(&info->status_event_wait_q, &wait); + set_current_state(TASK_RUNNING); + return rc; +} + /* get_modem_info() * * Read the state of the serial control and @@ -2912,7 +3083,7 @@ int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg) { int error; - struct mgsl_icount cprev, cnow; /* kernel counter temps */ + struct mgsl_icount cnow; /* kernel counter temps */ struct serial_icounter_struct *p_cuser; /* user space */ unsigned long flags; @@ -2947,37 +3118,12 @@ while(MOD_IN_USE) MOD_DEC_USE_COUNT; return 0; - /* - * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change - * - mask passed in arg for lines of interest - * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) - * Caller should use TIOCGICOUNT to see which one it was + + /* Wait for modem input (DCD,RI,DSR,CTS) change + * as specified by mask in arg (TIOCM_RNG/DSR/CD/CTS) */ case TIOCMIWAIT: - spin_lock_irqsave(&info->irq_spinlock,flags); - /* note the counters on entry */ - cprev = info->icount; - spin_unlock_irqrestore(&info->irq_spinlock,flags); - while (1) { - interruptible_sleep_on(&info->status_event_wait_q); - /* see if a signal did it */ - if (signal_pending(current)) - return -ERESTARTSYS; - save_flags(flags); cli(); - cnow = info->icount; /* atomic copy */ - restore_flags(flags); - if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && - cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) - return -EIO; /* no change => error */ - if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || - ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || - ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || - ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) { - return 0; - } - cprev = cnow; - } - /* NOTREACHED */ + return modem_input_wait(info,(int)arg); /* * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) @@ -3229,7 +3375,8 @@ if (timeout) char_time = MIN(char_time, timeout); - if ( info->params.mode == MGSL_MODE_HDLC ) { + if ( info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { while (info->tx_active) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); @@ -3587,7 +3734,8 @@ if (info->serial_signals & SerialSignal_RI) strcat(stat_buf, "|RI"); - if (info->params.mode == MGSL_MODE_HDLC) { + if (info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { ret += sprintf(buf+ret, " HDLC txok:%d rxok:%d", info->icount.txok, info->icount.rxok); if (info->icount.txunder) @@ -3728,28 +3876,27 @@ * * This leaves 62 4K pages. * - * The next N pages are used for a transmit frame. We - * reserve enough 4K page blocks to hold the configured - * MaxFrameSize + * The next N pages are used for transmit frame(s). We + * reserve enough 4K page blocks to hold the required + * number of transmit dma buffers (num_tx_dma_buffers), + * each of MaxFrameSize size. * * Of the remaining pages (62-N), determine how many can * be used to receive full MaxFrameSize inbound frames */ - - info->tx_buffer_count = BuffersPerFrame; + info->tx_buffer_count = info->num_tx_dma_buffers * BuffersPerFrame; info->rx_buffer_count = 62 - info->tx_buffer_count; } else { /* Calculate the number of PAGE_SIZE buffers needed for */ /* receive and transmit DMA buffers. */ - /* Calculate the number of DMA buffers necessary to */ /* hold 7 max size receive frames and one max size transmit frame. */ /* The receive buffer count is bumped by one so we avoid an */ /* End of List condition if all receive buffers are used when */ /* using linked list DMA buffers. */ - info->tx_buffer_count = BuffersPerFrame; + info->tx_buffer_count = info->num_tx_dma_buffers * BuffersPerFrame; info->rx_buffer_count = (BuffersPerFrame * MAXRXFRAMES) + 6; /* @@ -3769,12 +3916,14 @@ if ( mgsl_alloc_buffer_list_memory( info ) < 0 || mgsl_alloc_frame_memory(info, info->rx_buffer_list, info->rx_buffer_count) < 0 || mgsl_alloc_frame_memory(info, info->tx_buffer_list, info->tx_buffer_count) < 0 || - mgsl_alloc_intermediate_rxbuffer_memory(info) < 0 ) { + mgsl_alloc_intermediate_rxbuffer_memory(info) < 0 || + mgsl_alloc_intermediate_txbuffer_memory(info) < 0 ) { printk("%s(%d):Can't allocate DMA buffer memory\n",__FILE__,__LINE__); return -ENOMEM; } mgsl_reset_rx_dma_buffers( info ); + mgsl_reset_tx_dma_buffers( info ); return 0; @@ -4030,6 +4179,149 @@ } /* end of mgsl_free_intermediate_rxbuffer_memory() */ +/* + * mgsl_alloc_intermediate_txbuffer_memory() + * + * Allocate intermdiate transmit buffer(s) large enough to hold max_frame_size. + * This buffer is used to load transmit frames into the adapter's dma transfer + * buffers when there is sufficient space. + * + * Arguments: + * + * info pointer to device instance data + * + * Return Value: 0 if success, otherwise -ENOMEM + */ +int mgsl_alloc_intermediate_txbuffer_memory(struct mgsl_struct *info) +{ + int i; + + if ( debug_level >= DEBUG_LEVEL_INFO ) + printk("%s %s(%d) allocating %d tx holding buffers\n", + info->device_name, __FILE__,__LINE__,info->num_tx_holding_buffers); + + memset(info->tx_holding_buffers,0,sizeof(info->tx_holding_buffers)); + + for ( i=0; inum_tx_holding_buffers; ++i) { + info->tx_holding_buffers[i].buffer = + kmalloc(info->max_frame_size, GFP_KERNEL); + if ( info->tx_holding_buffers[i].buffer == NULL ) + return -ENOMEM; + } + + return 0; + +} /* end of mgsl_alloc_intermediate_txbuffer_memory() */ + +/* + * mgsl_free_intermediate_txbuffer_memory() + * + * + * Arguments: + * + * info pointer to device instance data + * + * Return Value: None + */ +void mgsl_free_intermediate_txbuffer_memory(struct mgsl_struct *info) +{ + int i; + + for ( i=0; inum_tx_holding_buffers; ++i ) { + if ( info->tx_holding_buffers[i].buffer ) { + kfree(info->tx_holding_buffers[i].buffer); + info->tx_holding_buffers[i].buffer=NULL; + } + } + + info->get_tx_holding_index = 0; + info->put_tx_holding_index = 0; + info->tx_holding_count = 0; + +} /* end of mgsl_free_intermediate_txbuffer_memory() */ + + +/* + * load_next_tx_holding_buffer() + * + * attempts to load the next buffered tx request into the + * tx dma buffers + * + * Arguments: + * + * info pointer to device instance data + * + * Return Value: 1 if next buffered tx request loaded + * into adapter's tx dma buffer, + * 0 otherwise + */ +int load_next_tx_holding_buffer(struct mgsl_struct *info) +{ + int ret = 0; + + if ( info->tx_holding_count ) { + /* determine if we have enough tx dma buffers + * to accomodate the next tx frame + */ + struct tx_holding_buffer *ptx = + &info->tx_holding_buffers[info->get_tx_holding_index]; + int num_free = num_free_tx_dma_buffers(info); + int num_needed = ptx->buffer_size / DMABUFFERSIZE; + if ( ptx->buffer_size % DMABUFFERSIZE ) + ++num_needed; + + if (num_needed <= num_free) { + info->xmit_cnt = ptx->buffer_size; + mgsl_load_tx_dma_buffer(info,ptx->buffer,ptx->buffer_size); + + --info->tx_holding_count; + if ( ++info->get_tx_holding_index >= info->num_tx_holding_buffers) + info->get_tx_holding_index=0; + + /* restart transmit timer */ + del_timer(&info->tx_timer); + info->tx_timer.expires = jiffies + jiffies_from_ms(5000); + add_timer(&info->tx_timer); + + ret = 1; + } + } + + return ret; +} + +/* + * save_tx_buffer_request() + * + * attempt to store transmit frame request for later transmission + * + * Arguments: + * + * info pointer to device instance data + * Buffer pointer to buffer containing frame to load + * BufferSize size in bytes of frame in Buffer + * + * Return Value: 1 if able to store, 0 otherwise + */ +int save_tx_buffer_request(struct mgsl_struct *info,const char *Buffer, unsigned int BufferSize) +{ + struct tx_holding_buffer *ptx; + + if ( info->tx_holding_count >= info->num_tx_holding_buffers ) { + return 0; /* all buffers in use */ + } + + ptx = &info->tx_holding_buffers[info->put_tx_holding_index]; + ptx->buffer_size = BufferSize; + memcpy( ptx->buffer, Buffer, BufferSize); + + ++info->tx_holding_count; + if ( ++info->put_tx_holding_index >= info->num_tx_holding_buffers) + info->put_tx_holding_index=0; + + return 1; +} + int mgsl_claim_resources(struct mgsl_struct *info) { /* claim 16C32 I/O base address */ @@ -4123,6 +4415,7 @@ } mgsl_free_dma_buffers(info); mgsl_free_intermediate_rxbuffer_memory(info); + mgsl_free_intermediate_txbuffer_memory(info); if ( info->io_addr_requested ) { release_region(info->io_base,info->io_addr_size); @@ -4163,6 +4456,21 @@ if (maxframe[info->line]) info->max_frame_size = maxframe[info->line]; info->dosyncppp = dosyncppp[info->line]; + + if (txdmabufs[info->line]) { + info->num_tx_dma_buffers = txdmabufs[info->line]; + if (info->num_tx_dma_buffers < 1) + info->num_tx_dma_buffers = 1; + } + + if (txholdbufs[info->line]) { + info->num_tx_holding_buffers = txholdbufs[info->line]; + if (info->num_tx_holding_buffers < 1) + info->num_tx_holding_buffers = 1; + else if (info->num_tx_holding_buffers > MAX_TX_HOLDING_BUFFERS) + info->num_tx_holding_buffers = MAX_TX_HOLDING_BUFFERS; + } + } mgsl_device_count++; @@ -4182,18 +4490,20 @@ info->max_frame_size = 65535; if ( info->bus_type == MGSL_BUS_TYPE_PCI ) { - printk( "SyncLink device %s added:PCI bus IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n", + printk( "SyncLink device %s:PCI IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n", info->device_name, info->io_base, info->irq_level, info->phys_memory_base, info->phys_lcr_base, info->max_frame_size ); } else { - printk( "SyncLink device %s added:ISA bus IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n", + printk( "SyncLink device %s:ISA IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n", info->device_name, info->io_base, info->irq_level, info->dma_level, info->max_frame_size ); } #ifdef CONFIG_SYNCLINK_SYNCPPP +#ifdef MODULE if (info->dosyncppp) +#endif mgsl_sppp_init(info); #endif } /* end of mgsl_add_device() */ @@ -4231,6 +4541,8 @@ spin_lock_init(&info->netlock); memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS)); info->idle_mode = HDLC_TXIDLE_FLAGS; + info->num_tx_dma_buffers = 1; + info->num_tx_holding_buffers = 0; } return info; @@ -4355,7 +4667,7 @@ EXPORT_NO_SYMBOLS; - printk("%s version %s\n", driver_name, driver_version); + printk("%s %s\n", driver_name, driver_version); /* determine how many SyncLink devices are installed */ mgsl_enumerate_devices(); @@ -4423,7 +4735,7 @@ printk("%s(%d):Couldn't register callout driver\n", __FILE__,__LINE__); - printk("%s version %s, tty major#%d callout major#%d\n", + printk("%s %s, tty major#%d callout major#%d\n", driver_name, driver_version, serial_driver.major, callout_driver.major); @@ -4440,6 +4752,7 @@ } /* end of mgsl_init() */ +#ifdef MODULE int __init init_module(void) { /* Uncomment this to kernel debug module. @@ -4459,6 +4772,7 @@ unsigned long flags; int rc; struct mgsl_struct *info; + struct mgsl_struct *tmp; printk("Unloading %s: version %s\n", driver_name, driver_version); save_flags(flags); @@ -4478,7 +4792,9 @@ mgsl_sppp_delete(info); #endif mgsl_release_resources(info); + tmp = info; info = info->next_device; + kfree(tmp); } if (tmp_buf) { @@ -4487,6 +4803,7 @@ } } /* end of cleanup_module() */ +#endif /* * usc_RTCmd() @@ -4714,7 +5031,27 @@ * * 0000 0110 0000 0110 = 0x0606 */ + if (info->params.mode == MGSL_MODE_RAW) { + RegValue = 0x0001; /* Set Receive mode = external sync */ + usc_OutReg( info, IOCR, /* Set IOCR DCD is RxSync Detect Input */ + (unsigned short)((usc_InReg(info, IOCR) & ~(BIT13|BIT12)) | BIT12)); + + /* + * TxSubMode: + * CMR <15> 0 Don't send CRC on Tx Underrun + * CMR <14> x undefined + * CMR <13> 0 Send preamble before openning sync + * CMR <12> 0 Send 8-bit syncs, 1=send Syncs per TxLength + * + * TxMode: + * CMR <11-8) 0100 MonoSync + * + * 0x00 0100 xxxx xxxx 04xx + */ + RegValue |= 0x0400; + } + else { RegValue = 0x0606; if ( info->params.flags & HDLC_FLAG_UNDERRUN_ABORT15 ) @@ -4723,12 +5060,14 @@ RegValue |= BIT15; else if ( info->params.flags & HDLC_FLAG_UNDERRUN_CRC ) RegValue |= BIT15 + BIT14; + } if ( info->params.preamble != HDLC_PREAMBLE_PATTERN_NONE ) RegValue |= BIT13; } - if ( info->params.flags & HDLC_FLAG_SHARE_ZERO ) + if ( info->params.mode == MGSL_MODE_HDLC && + (info->params.flags & HDLC_FLAG_SHARE_ZERO) ) RegValue |= BIT12; if ( info->params.addr_filter != 0xff ) @@ -4768,9 +5107,9 @@ case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break; } - if ( info->params.crc_type == HDLC_CRC_16_CCITT ) + if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT ) RegValue |= BIT9; - else if ( info->params.crc_type == HDLC_CRC_32_CCITT ) + else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT ) RegValue |= ( BIT12 | BIT10 | BIT9 ); usc_OutReg( info, RMR, RegValue ); @@ -4845,9 +5184,9 @@ case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break; } - if ( info->params.crc_type == HDLC_CRC_16_CCITT ) + if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT ) RegValue |= BIT9 + BIT8; - else if ( info->params.crc_type == HDLC_CRC_32_CCITT ) + else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT ) RegValue |= ( BIT12 | BIT10 | BIT9 | BIT8); usc_OutReg( info, TMR, RegValue ); @@ -5518,7 +5857,8 @@ usc_OutReg( info, CCSR, (u16)(usc_InReg(info,CCSR) | BIT13) ); usc_RTCmd( info, RTCmd_PurgeRxFifo ); - if ( info->params.mode == MGSL_MODE_HDLC ) { + if ( info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW ) { /* DMA mode Transfers */ /* Program the DMA controller. */ /* Enable the DMA controller end of buffer interrupt. */ @@ -5607,9 +5947,14 @@ /* Transmit DMA buffer is loaded, so program USC */ /* to send the frame contained in the buffers. */ + FrameSize = info->tx_buffer_list[info->start_tx_dma_buffer].rcc; - - FrameSize = info->tx_buffer_list[0].rcc; + /* if operating in Raw sync mode, reset the rcc component + * of the tx dma buffer entry, otherwise, the serial controller + * will send a closing sync char after this count. + */ + if ( info->params.mode == MGSL_MODE_RAW ) + info->tx_buffer_list[info->start_tx_dma_buffer].rcc = 0; /* Program the Transmit Character Length Register (TCLR) */ /* and clear FIFO (TCC is loaded with TCLR on FIFO clear) */ @@ -5618,7 +5963,7 @@ usc_RTCmd( info, RTCmd_PurgeTxFifo ); /* Program the address of the 1st DMA Buffer Entry in linked list */ - phys_addr = info->tx_buffer_list[0].phys_entry; + phys_addr = info->tx_buffer_list[info->start_tx_dma_buffer].phys_entry; usc_OutDmaReg( info, NTARL, (u16)phys_addr ); usc_OutDmaReg( info, NTARU, (u16)(phys_addr >> 16) ); @@ -5626,6 +5971,19 @@ usc_ClearIrqPendingBits( info, TRANSMIT_STATUS ); usc_EnableInterrupts( info, TRANSMIT_STATUS ); + if ( info->params.mode == MGSL_MODE_RAW && + info->num_tx_dma_buffers > 1 ) { + /* When running external sync mode, attempt to 'stream' transmit */ + /* by filling tx dma buffers as they become available. To do this */ + /* we need to enable Tx DMA EOB Status interrupts : */ + /* */ + /* 1. Arm End of Buffer (EOB) Transmit DMA Interrupt (BIT2 of TDIAR) */ + /* 2. Enable Transmit DMA Interrupts (BIT0 of DICR) */ + + usc_OutDmaReg( info, TDIAR, BIT2|BIT3 ); + usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT0) ); + } + /* Initialize Transmit DMA Channel */ usc_DmaCmd( info, DmaCmd_InitTxChannel ); @@ -6049,6 +6407,9 @@ void usc_loopback_frame( struct mgsl_struct *info ) { int i; + unsigned long oldmode = info->params.mode; + + info->params.mode = MGSL_MODE_HDLC; usc_DisableMasterIrqBit( info ); @@ -6102,6 +6463,8 @@ usc_EnableMasterIrqBit(info); + info->params.mode = oldmode; + } /* end of usc_loopback_frame() */ /* usc_set_sync_mode() Programs the USC for SDLC communications. @@ -6153,6 +6516,38 @@ info->tcsr_value += usc_idle_mode; usc_OutReg(info, TCSR, info->tcsr_value); + /* + * if SyncLink WAN adapter is running in external sync mode, the + * transmitter has been set to Monosync in order to try to mimic + * a true raw outbound bit stream. Monosync still sends an open/close + * sync char at the start/end of a frame. Try to match those sync + * patterns to the idle mode set here + */ + if ( info->params.mode == MGSL_MODE_RAW ) { + unsigned char syncpat = 0; + switch( info->idle_mode ) { + case HDLC_TXIDLE_FLAGS: + syncpat = 0x7e; + break; + case HDLC_TXIDLE_ALT_ZEROS_ONES: + syncpat = 0x55; + break; + case HDLC_TXIDLE_ZEROS: + case HDLC_TXIDLE_SPACE: + syncpat = 0x00; + break; + case HDLC_TXIDLE_ONES: + case HDLC_TXIDLE_MARK: + syncpat = 0xff; + break; + case HDLC_TXIDLE_ALT_MARK_SPACE: + syncpat = 0xaa; + break; + } + + usc_SetTransmitSyncChars(info,syncpat,syncpat); + } + } /* end of usc_set_txidle() */ /* usc_get_serial_signals() @@ -6330,6 +6725,48 @@ */ /* + * mgsl_reset_tx_dma_buffers() + * + * Set the count for all transmit buffers to 0 to indicate the + * buffer is available for use and set the current buffer to the + * first buffer. This effectively makes all buffers free and + * discards any data in buffers. + * + * Arguments: info pointer to device instance data + * Return Value: None + */ +void mgsl_reset_tx_dma_buffers( struct mgsl_struct *info ) +{ + unsigned int i; + + for ( i = 0; i < info->tx_buffer_count; i++ ) { + *((unsigned long *)&(info->tx_buffer_list[i].count)) = 0; + } + + info->current_tx_buffer = 0; + info->start_tx_dma_buffer = 0; + info->tx_dma_buffers_used = 0; + + info->get_tx_holding_index = 0; + info->put_tx_holding_index = 0; + info->tx_holding_count = 0; + +} /* end of mgsl_reset_tx_dma_buffers() */ + +/* + * num_free_tx_dma_buffers() + * + * returns the number of free tx dma buffers available + * + * Arguments: info pointer to device instance data + * Return Value: number of free tx dma buffers + */ +int num_free_tx_dma_buffers(struct mgsl_struct *info) +{ + return info->tx_buffer_count - info->tx_dma_buffers_used; +} + +/* * mgsl_reset_rx_dma_buffers() * * Set the count for all receive buffers to DMABUFFERSIZE @@ -6415,10 +6852,11 @@ unsigned int StartIndex, EndIndex; /* index of 1st and last buffers of Rx frame */ unsigned short status; DMABUFFERENTRY *pBufEntry; - unsigned int framesize; + unsigned int framesize = 0; int ReturnCode = 0; unsigned long flags; struct tty_struct *tty = info->tty; + int return_frame = 0; /* * current_rx_buffer points to the 1st buffer of the next available @@ -6474,14 +6912,20 @@ info->icount.rxabort++; else if ( status & RXSTATUS_OVERRUN ) info->icount.rxover++; - else + else { info->icount.rxcrc++; + if ( info->params.crc_type & HDLC_CRC_RETURN_EX ) + return_frame = 1; + } framesize = 0; #ifdef CONFIG_SYNCLINK_SYNCPPP info->netstats.rx_errors++; info->netstats.rx_frame_errors++; #endif - } else { + } else + return_frame = 1; + + if ( return_frame ) { /* receive frame has no errors, get frame size. * The frame size is the starting value of the RCC (which was * set to 0xffff) minus the ending value of the RCC (decremented @@ -6506,7 +6950,9 @@ MIN(framesize,DMABUFFERSIZE),0); if (framesize) { - if (framesize > info->max_frame_size) + if ( ( (info->params.crc_type & HDLC_CRC_RETURN_EX) && + ((framesize+1) > info->max_frame_size) ) || + (framesize > info->max_frame_size) ) info->icount.rxlong++; else { /* copy dma buffer(s) to contiguous intermediate buffer */ @@ -6514,6 +6960,7 @@ int index = StartIndex; unsigned char *ptmp = info->intermediate_rxbuffer; + if ( !(status & RXSTATUS_CRC_ERROR)) info->icount.rxok++; while(copy_count) { @@ -6532,6 +6979,19 @@ index = 0; } + if ( info->params.crc_type & HDLC_CRC_RETURN_EX ) { + ++framesize; + *ptmp = (status & RXSTATUS_CRC_ERROR ? + RX_CRC_ERROR : + RX_OK); + + if ( debug_level >= DEBUG_LEVEL_DATA ) + printk("%s(%d):mgsl_get_rx_frame(%s) rx frame status=%d\n", + __FILE__,__LINE__,info->device_name, + *ptmp); + } + + #ifdef CONFIG_SYNCLINK_SYNCPPP if (info->netcount) { /* pass frame to syncppp device */ @@ -6541,6 +7001,7 @@ #endif { /* Call the line discipline receive callback directly. */ + if ( tty && tty->ldisc.receive_buf ) tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize); } } @@ -6570,6 +7031,180 @@ } /* end of mgsl_get_rx_frame() */ +/* mgsl_get_raw_rx_frame() + * + * This function attempts to return a received frame from the + * receive DMA buffers when running in external loop mode. In this mode, + * we will return at most one DMABUFFERSIZE frame to the application. + * The USC receiver is triggering off of DCD going active to start a new + * frame, and DCD going inactive to terminate the frame (similar to + * processing a closing flag character). + * + * In this routine, we will return DMABUFFERSIZE "chunks" at a time. + * If DCD goes inactive, the last Rx DMA Buffer will have a non-zero + * status field and the RCC field will indicate the length of the + * entire received frame. We take this RCC field and get the modulus + * of RCC and DMABUFFERSIZE to determine if number of bytes in the + * last Rx DMA buffer and return that last portion of the frame. + * + * Arguments: info pointer to device extension + * Return Value: 1 if frame returned, otherwise 0 + */ +int mgsl_get_raw_rx_frame(struct mgsl_struct *info) +{ + unsigned int CurrentIndex, NextIndex; + unsigned short status; + DMABUFFERENTRY *pBufEntry; + unsigned int framesize = 0; + int ReturnCode = 0; + unsigned long flags; + struct tty_struct *tty = info->tty; + + /* + * current_rx_buffer points to the 1st buffer of the next available + * receive frame. The status field is set by the 16C32 after + * completing a receive frame. If the status field of this buffer + * is zero, either the USC is still filling this buffer or this + * is one of a series of buffers making up a received frame. + * + * If the count field of this buffer is zero, the USC is either + * using this buffer or has used this buffer. Look at the count + * field of the next buffer. If that next buffer's count is + * non-zero, the USC is still actively using the current buffer. + * Otherwise, if the next buffer's count field is zero, the + * current buffer is complete and the USC is using the next + * buffer. + */ + CurrentIndex = NextIndex = info->current_rx_buffer; + ++NextIndex; + if ( NextIndex == info->rx_buffer_count ) + NextIndex = 0; + + if ( info->rx_buffer_list[CurrentIndex].status != 0 || + (info->rx_buffer_list[CurrentIndex].count == 0 && + info->rx_buffer_list[NextIndex].count == 0)) { + /* + * Either the status field of this dma buffer is non-zero + * (indicating the last buffer of a receive frame) or the next + * buffer is marked as in use -- implying this buffer is complete + * and an intermediate buffer for this received frame. + */ + + status = info->rx_buffer_list[CurrentIndex].status; + + if ( status & (RXSTATUS_SHORT_FRAME + RXSTATUS_OVERRUN + + RXSTATUS_CRC_ERROR + RXSTATUS_ABORT) ) { + if ( status & RXSTATUS_SHORT_FRAME ) + info->icount.rxshort++; + else if ( status & RXSTATUS_ABORT ) + info->icount.rxabort++; + else if ( status & RXSTATUS_OVERRUN ) + info->icount.rxover++; + else + info->icount.rxcrc++; + framesize = 0; + } else { + /* + * A receive frame is available, get frame size and status. + * + * The frame size is the starting value of the RCC (which was + * set to 0xffff) minus the ending value of the RCC (decremented + * once for each receive character) minus 2 or 4 for the 16-bit + * or 32-bit CRC. + * + * If the status field is zero, this is an intermediate buffer. + * It's size is 4K. + * + * If the DMA Buffer Entry's Status field is non-zero, the + * receive operation completed normally (ie: DCD dropped). The + * RCC field is valid and holds the received frame size. + * It is possible that the RCC field will be zero on a DMA buffer + * entry with a non-zero status. This can occur if the total + * frame size (number of bytes between the time DCD goes active + * to the time DCD goes inactive) exceeds 65535 bytes. In this + * case the 16C32 has underrun on the RCC count and appears to + * stop updating this counter to let us know the actual received + * frame size. If this happens (non-zero status and zero RCC), + * simply return the entire RxDMA Buffer + */ + if ( status ) { + /* + * In the event that the final RxDMA Buffer is + * terminated with a non-zero status and the RCC + * field is zero, we interpret this as the RCC + * having underflowed (received frame > 65535 bytes). + * + * Signal the event to the user by passing back + * a status of RxStatus_CrcError returning the full + * buffer and let the app figure out what data is + * actually valid + */ + if ( info->rx_buffer_list[CurrentIndex].rcc ) + framesize = RCLRVALUE - info->rx_buffer_list[CurrentIndex].rcc; + else + framesize = DMABUFFERSIZE; + } + else + framesize = DMABUFFERSIZE; + } + + if ( framesize > DMABUFFERSIZE ) { + /* + * if running in raw sync mode, ISR handler for + * End Of Buffer events terminates all buffers at 4K. + * If this frame size is said to be >4K, get the + * actual number of bytes of the frame in this buffer. + */ + framesize = framesize % DMABUFFERSIZE; + } + + + if ( debug_level >= DEBUG_LEVEL_BH ) + printk("%s(%d):mgsl_get_raw_rx_frame(%s) status=%04X size=%d\n", + __FILE__,__LINE__,info->device_name,status,framesize); + + if ( debug_level >= DEBUG_LEVEL_DATA ) + mgsl_trace_block(info,info->rx_buffer_list[CurrentIndex].virt_addr, + MIN(framesize,DMABUFFERSIZE),0); + + if (framesize) { + /* copy dma buffer(s) to contiguous intermediate buffer */ + /* NOTE: we never copy more than DMABUFFERSIZE bytes */ + + pBufEntry = &(info->rx_buffer_list[CurrentIndex]); + memcpy( info->intermediate_rxbuffer, pBufEntry->virt_addr, framesize); + info->icount.rxok++; + + /* Call the line discipline receive callback directly. */ + if ( tty && tty->ldisc.receive_buf ) + tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize); + } + + /* Free the buffers used by this frame. */ + mgsl_free_rx_frame_buffers( info, CurrentIndex, CurrentIndex ); + + ReturnCode = 1; + } + + + if ( info->rx_enabled && info->rx_overflow ) { + /* The receiver needs to restarted because of + * a receive overflow (buffer or FIFO). If the + * receive buffers are now empty, then restart receiver. + */ + + if ( !info->rx_buffer_list[CurrentIndex].status && + info->rx_buffer_list[CurrentIndex].count ) { + spin_lock_irqsave(&info->irq_spinlock,flags); + usc_start_receiver(info); + spin_unlock_irqrestore(&info->irq_spinlock,flags); + } + } + + return ReturnCode; + +} /* end of mgsl_get_raw_rx_frame() */ + /* mgsl_load_tx_dma_buffer() * * Load the transmit DMA buffer with the specified data. @@ -6599,12 +7234,19 @@ info->cmr_value |= BIT13; } + /* begin loading the frame in the next available tx dma + * buffer, remember it's starting location for setting + * up tx dma operation + */ + i = info->current_tx_buffer; + info->start_tx_dma_buffer = i; + /* Setup the status and RCC (Frame Size) fields of the 1st */ /* buffer entry in the transmit DMA buffer list. */ - info->tx_buffer_list[0].status = info->cmr_value & 0xf000; - info->tx_buffer_list[0].rcc = BufferSize; - info->tx_buffer_list[0].count = BufferSize; + info->tx_buffer_list[i].status = info->cmr_value & 0xf000; + info->tx_buffer_list[i].rcc = BufferSize; + info->tx_buffer_list[i].count = BufferSize; /* Copy frame data from 1st source buffer to the DMA buffers. */ /* The frame data may span multiple DMA buffers. */ @@ -6613,6 +7255,9 @@ /* Get a pointer to next DMA buffer entry. */ pBufEntry = &info->tx_buffer_list[i++]; + if ( i == info->tx_buffer_count ) + i=0; + /* Calculate the number of bytes that can be copied from */ /* the source buffer to this DMA buffer. */ if ( BufferSize > DMABUFFERSIZE ) @@ -6632,8 +7277,13 @@ /* Advance source pointer and reduce remaining data count. */ Buffer += Copycount; BufferSize -= Copycount; + + ++info->tx_dma_buffers_used; } + /* remember next available tx dma buffer */ + info->current_tx_buffer = i; + } /* end of mgsl_load_tx_dma_buffer() */ /* @@ -6764,7 +7414,7 @@ unsigned int i; char *TmpPtr; BOOLEAN rc = TRUE; - unsigned short status; + unsigned short status=0; unsigned long EndTime; unsigned long flags; MGSL_PARAMS tmp_params; @@ -7021,7 +7671,7 @@ status = info->rx_buffer_list[0].status; if ( status & (BIT8 + BIT3 + BIT1) ) { - /* receive error has occured */ + /* receive error has occurred */ rc = FALSE; } else { if ( memcmp( info->tx_buffer_list[0].virt_addr , @@ -7242,7 +7892,9 @@ if ( debug_level >= DEBUG_LEVEL_INFO ) printk( "%s(%d):mgsl_tx_timeout(%s)\n", __FILE__,__LINE__,info->device_name); - if(info->tx_active && info->params.mode == MGSL_MODE_HDLC) { + if(info->tx_active && + (info->params.mode == MGSL_MODE_HDLC || + info->params.mode == MGSL_MODE_RAW) ) { info->icount.txtimeout++; } spin_lock_irqsave(&info->irq_spinlock,flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/toshiba.c linux.20p9/drivers/char/toshiba.c --- linux.vanilla/drivers/char/toshiba.c Sun Mar 25 18:45:19 2001 +++ linux.20p9/drivers/char/toshiba.c Wed Jul 4 16:03:54 2001 @@ -60,10 +60,8 @@ #define TOSH_VERSION "1.9 22/3/2001" #define TOSH_DEBUG 0 -#ifdef MODULE #include #include -#endif #include #include #include @@ -78,7 +76,7 @@ #include #endif -#include"toshiba.h" +#include #define TOSH_MINOR_DEV 181 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/tty_io.c linux.20p9/drivers/char/tty_io.c --- linux.vanilla/drivers/char/tty_io.c Sun Mar 25 17:31:24 2001 +++ linux.20p9/drivers/char/tty_io.c Wed Jul 4 16:03:54 2001 @@ -2244,5 +2244,11 @@ #ifdef CONFIG_VT vcs_init(); #endif +#ifdef CONFIG_SYNCLINK + mgsl_init(); +#endif +#ifdef CONFIG_N_HDLC + n_hdlc_init(); +#endif return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/wdt.c linux.20p9/drivers/char/wdt.c --- linux.vanilla/drivers/char/wdt.c Sun Mar 25 17:31:25 2001 +++ linux.20p9/drivers/char/wdt.c Thu Jul 26 15:28:52 2001 @@ -228,7 +228,7 @@ switch(cmd) { default: - return -ENOIOCTLCMD; + return -ENOTTY; case WDIOC_GETSUPPORT: return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/wdt_pci.c linux.20p9/drivers/char/wdt_pci.c --- linux.vanilla/drivers/char/wdt_pci.c Sun Mar 25 17:31:29 2001 +++ linux.20p9/drivers/char/wdt_pci.c Thu Jul 26 15:29:14 2001 @@ -149,7 +149,7 @@ * * Handle an interrupt from the board. These are raised when the status * map changes in what the board considers an interesting way. That means - * a failure condition occuring. + * a failure condition occurring. */ static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -295,7 +295,7 @@ switch(cmd) { default: - return -ENOIOCTLCMD; + return -ENOTTY; case WDIOC_GETSUPPORT: return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/i2o/i2o_scsi.c linux.20p9/drivers/i2o/i2o_scsi.c --- linux.vanilla/drivers/i2o/i2o_scsi.c Sun Mar 25 17:31:44 2001 +++ linux.20p9/drivers/i2o/i2o_scsi.c Wed Jul 4 16:03:54 2001 @@ -266,7 +266,7 @@ if(st) { - /* An error has occured */ + /* An error has occurred */ dprintk((KERN_DEBUG "SCSI error %08X", m[4])); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/Config.in linux.20p9/drivers/isdn/Config.in --- linux.vanilla/drivers/isdn/Config.in Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/Config.in Wed Jul 4 16:03:54 2001 @@ -132,7 +132,7 @@ dep_tristate ' AVM T1/T1-B ISA support' CONFIG_ISDN_DRV_AVMB1_T1ISA $CONFIG_ISDN_CAPI dep_tristate ' AVM B1/M1/M2 PCMCIA support' CONFIG_ISDN_DRV_AVMB1_B1PCMCIA $CONFIG_ISDN_CAPI $CONFIG_PCMCIA dep_tristate ' AVM T1/T1-B PCI support' CONFIG_ISDN_DRV_AVMB1_T1PCI $CONFIG_ISDN_CAPI $CONFIG_PCI - dep_tristate ' AVM C4 support' CONFIG_ISDN_DRV_AVMB1_C4 $CONFIG_ISDN_CAPI $CONFIG_PCI + dep_tristate ' AVM C4/C2 support' CONFIG_ISDN_DRV_AVMB1_C4 $CONFIG_ISDN_CAPI $CONFIG_PCI fi # HYSDN diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/act2000/act2000.h linux.20p9/drivers/isdn/act2000/act2000.h --- linux.vanilla/drivers/isdn/act2000/act2000.h Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/act2000/act2000.h Wed Aug 8 22:43:58 2001 @@ -1,4 +1,4 @@ -/* $Id: act2000.h,v 1.8.6.1 2001/02/10 14:41:20 kai Exp $ +/* $Id: act2000.h,v 1.8.6.2 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/act2000/capi.c linux.20p9/drivers/isdn/act2000/capi.c --- linux.vanilla/drivers/isdn/act2000/capi.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/act2000/capi.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: capi.c,v 1.9 2000/11/12 16:32:06 kai Exp $ +/* $Id: capi.c,v 1.9.6.1 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * CAPI encoder/decoder @@ -124,7 +124,7 @@ m->hdr.cmd.cmd = c; \ m->hdr.cmd.subcmd = s; \ m->hdr.msgnum = actcapi_nextsmsg(card); \ - } \ + } else m = NULL;\ } #define ACTCAPI_CHKSKB if (!skb) { \ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/act2000/capi.h linux.20p9/drivers/isdn/act2000/capi.h --- linux.vanilla/drivers/isdn/act2000/capi.h Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/act2000/capi.h Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: capi.h,v 1.6 2000/11/12 16:32:06 kai Exp $ +/* $Id: capi.h,v 1.6.6.1 2001/02/16 16:43:23 kai Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * @@ -44,7 +44,7 @@ char *description; } actcapi_msgdsc; -/* CAPI Adress */ +/* CAPI Address */ typedef struct actcapi_addr { __u8 len; /* Length of element */ __u8 tnp; /* Type/Numbering Plan */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/avmcard.h linux.20p9/drivers/isdn/avmb1/avmcard.h --- linux.vanilla/drivers/isdn/avmb1/avmcard.h Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/avmcard.h Wed Jul 4 16:03:54 2001 @@ -1,57 +1,8 @@ /* - * $Id: avmcard.h,v 1.8 2000/10/10 17:44:19 kai Exp $ + * $Id: avmcard.h,v 1.8.6.3 2001/05/17 21:15:33 kai Exp $ * * Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: avmcard.h,v $ - * Revision 1.8 2000/10/10 17:44:19 kai - * changes from/for 2.2.18 - * - * Revision 1.7 2000/01/25 14:33:38 calle - * - Added Support AVM B1 PCI V4.0 (tested with prototype) - * - splitted up t1pci.c into b1dma.c for common function with b1pciv4 - * - support for revision register - * - * Revision 1.6 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.5 1999/09/07 09:02:53 calle - * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and - * DATA_B3_IND is always directly after the CAPI message. The "Data" member - * ist never used inside the kernel. - * - * Revision 1.4 1999/08/04 10:10:08 calle - * Bugfix: corrected /proc functions, added structure for new AVM cards. - * - * Revision 1.3 1999/07/23 08:41:47 calle - * prepared for new AVM cards. - * - * Revision 1.2 1999/07/05 15:09:45 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:22 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * */ #ifndef _AVMCARD_H_ @@ -59,7 +10,6 @@ #define AVMB1_PORTLEN 0x1f #define AVM_MAXVERSION 8 -#define AVM_NAPPS 30 #define AVM_NCCI_PER_CHANNEL 4 /* @@ -83,7 +33,8 @@ avm_m2, avm_t1isa, avm_t1pci, - avm_c4 + avm_c4, + avm_c2 }; typedef struct avmcard_dmainfo { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/b1.c linux.20p9/drivers/isdn/avmb1/b1.c --- linux.vanilla/drivers/isdn/avmb1/b1.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/b1.c Wed Jul 4 16:03:54 2001 @@ -1,105 +1,9 @@ /* - * $Id: b1.c,v 1.20.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: b1.c,v 1.20.6.6 2001/05/17 21:15:33 kai Exp $ * * Common module for AVM B1 cards. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) - * - * $Log: b1.c,v $ - * Revision 1.20.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.20 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.19 2000/11/19 17:02:47 kai - * compatibility cleanup - part 3 - * - * Revision 1.18 2000/11/19 17:01:53 kai - * compatibility cleanup - part 2 - * - * Revision 1.17 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.16 2000/08/04 15:36:31 calle - * copied wrong from file to file :-( - * - * Revision 1.15 2000/08/04 12:20:08 calle - * - Fix unsigned/signed warning in the right way ... - * - * Revision 1.14 2000/06/19 16:51:53 keil - * don't free skb in irq context - * - * Revision 1.13 2000/01/25 14:33:38 calle - * - Added Support AVM B1 PCI V4.0 (tested with prototype) - * - splitted up t1pci.c into b1dma.c for common function with b1pciv4 - * - support for revision register - * - * Revision 1.12 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.11 1999/10/11 22:04:12 keil - * COMPAT_NEED_UACCESS (no include in isdn_compat.h) - * - * Revision 1.10 1999/09/15 08:16:03 calle - * Implementation of 64Bit extention complete. - * - * Revision 1.9 1999/09/07 09:02:53 calle - * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and - * DATA_B3_IND is always directly after the CAPI message. The "Data" member - * ist never used inside the kernel. - * - * Revision 1.8 1999/08/22 20:26:22 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.7 1999/08/04 10:10:09 calle - * Bugfix: corrected /proc functions, added structure for new AVM cards. - * - * Revision 1.6 1999/07/23 08:51:04 calle - * small fix and typo in checkin before. - * - * Revision 1.5 1999/07/23 08:41:48 calle - * prepared for new AVM cards. - * - * Revision 1.4 1999/07/09 15:05:38 keil - * compat.h is now isdn_compat.h - * - * Revision 1.3 1999/07/06 07:41:59 calle - * - changes in /proc interface - * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb. - * - * Revision 1.2 1999/07/05 15:09:47 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:23 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * * */ @@ -111,15 +15,18 @@ #include #include #include +#include #include #include +#include #include +#include #include "capilli.h" #include "avmcard.h" #include "capicmd.h" #include "capiutil.h" -static char *revision = "$Revision: 1.20.6.1 $"; +static char *revision = "$Revision: 1.20.6.6 $"; /* ------------------------------------------------------------- */ @@ -364,7 +271,7 @@ cli(); b1_setinterrupt(port, card->irq, card->cardtype); b1_put_byte(port, SEND_INIT); - b1_put_word(port, AVM_NAPPS); + b1_put_word(port, CAPI_MAXAPPL); b1_put_word(port, AVM_NCCI_PER_CHANNEL*2); b1_put_word(port, ctrl->cnr - 1); restore_flags(flags); @@ -679,6 +586,7 @@ case avm_t1isa: s = "T1 ISA (HEMA)"; break; case avm_t1pci: s = "T1 PCI"; break; case avm_c4: s = "C4"; break; + case avm_c2: s = "C2"; break; default: s = "???"; break; } len += sprintf(page+len, "%-16s %s\n", "type", s); @@ -749,12 +657,13 @@ static int __init b1_init(void) { char *p; - char rev[10]; + char rev[32]; - if ((p = strchr(revision, ':'))) { - strncpy(rev, p + 1, sizeof(rev)); - p = strchr(rev, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else strcpy(rev, "1.0"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/b1dma.c linux.20p9/drivers/isdn/avmb1/b1dma.c --- linux.vanilla/drivers/isdn/avmb1/b1dma.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/b1dma.c Wed Jul 4 16:03:54 2001 @@ -1,50 +1,10 @@ /* - * $Id: b1dma.c,v 1.11.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: b1dma.c,v 1.11.6.6 2001/05/17 21:15:33 kai Exp $ * * Common module for AVM B1 cards that support dma with AMCC * * (c) Copyright 2000 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1dma.c,v $ - * Revision 1.11.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.11 2000/11/19 17:02:47 kai - * compatibility cleanup - part 3 - * - * Revision 1.10 2000/11/19 17:01:53 kai - * compatibility cleanup - part 2 - * - * Revision 1.9 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.8 2000/10/10 17:44:19 kai - * changes from/for 2.2.18 - * - * Revision 1.7 2000/08/04 12:20:08 calle - * - Fix unsigned/signed warning in the right way ... - * - * Revision 1.6 2000/06/29 13:59:06 calle - * Bugfix: reinit txdma without interrupt will confuse some AMCC chips. - * - * Revision 1.5 2000/06/19 16:51:53 keil - * don't free skb in irq context - * - * Revision 1.4 2000/04/03 16:38:05 calle - * made suppress_pollack static. - * - * Revision 1.3 2000/02/26 01:00:53 keil - * changes from 2.3.47 - * - * Revision 1.2 2000/01/25 14:44:47 calle - * typo in b1pciv4_detect(). - * - * Revision 1.1 2000/01/25 14:36:43 calle - * common function for T1 PCI and B1 PCI V4. - * - * */ #include @@ -56,15 +16,18 @@ #include #include #include +#include #include #include +#include #include +#include #include "capilli.h" #include "avmcard.h" #include "capicmd.h" #include "capiutil.h" -static char *revision = "$Revision: 1.11.6.1 $"; +static char *revision = "$Revision: 1.11.6.6 $"; /* ------------------------------------------------------------- */ @@ -721,7 +684,7 @@ _put_byte(&p, 0); _put_byte(&p, 0); _put_byte(&p, SEND_INIT); - _put_word(&p, AVM_NAPPS); + _put_word(&p, CAPI_MAXAPPL); _put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, card->cardnr - 1); skb_put(skb, (__u8 *)p - (__u8 *)skb->data); @@ -900,6 +863,7 @@ case avm_t1isa: s = "T1 ISA (HEMA)"; break; case avm_t1pci: s = "T1 PCI"; break; case avm_c4: s = "C4"; break; + case avm_c2: s = "C2"; break; default: s = "???"; break; } len += sprintf(page+len, "%-16s %s\n", "type", s); @@ -990,12 +954,13 @@ int b1dma_init(void) { char *p; - char rev[10]; + char rev[32]; - if ((p = strchr(revision, ':'))) { - strncpy(rev, p + 1, sizeof(rev)); - p = strchr(rev, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else strcpy(rev, "1.0"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/b1isa.c linux.20p9/drivers/isdn/avmb1/b1isa.c --- linux.vanilla/drivers/isdn/avmb1/b1isa.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/b1isa.c Wed Jul 4 16:03:54 2001 @@ -1,74 +1,10 @@ /* - * $Id: b1isa.c,v 1.10.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: b1isa.c,v 1.10.6.5 2001/05/17 20:41:51 kai Exp $ * * Module for AVM B1 ISA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1isa.c,v $ - * Revision 1.10.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.10 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.9 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.8 2000/04/03 13:29:24 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.7 2000/02/02 18:36:03 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.6 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and - * used resources. - * - * Revision 1.5 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.4 1999/08/22 20:26:24 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.3 1999/07/09 15:05:40 keil - * compat.h is now isdn_compat.h - * - * Revision 1.2 1999/07/05 15:09:49 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:27 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * */ #include @@ -81,12 +17,13 @@ #include #include #include +#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.10.6.1 $"; +static char *revision = "$Revision: 1.10.6.5 $"; /* ------------------------------------------------------------- */ @@ -281,11 +218,12 @@ MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; - } + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; + } printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/b1pci.c linux.20p9/drivers/isdn/avmb1/b1pci.c --- linux.vanilla/drivers/isdn/avmb1/b1pci.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/b1pci.c Wed Jul 4 16:03:54 2001 @@ -1,105 +1,10 @@ /* - * $Id: b1pci.c,v 1.29.6.1 2000/11/28 12:02:45 kai Exp $ + * $Id: b1pci.c,v 1.29.6.4 2001/05/17 20:41:51 kai Exp $ * * Module for AVM B1 PCI-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1pci.c,v $ - * Revision 1.29.6.1 2000/11/28 12:02:45 kai - * MODULE_DEVICE_TABLE for 2.4 - * - * Revision 1.29.2.2 2000/11/26 17:47:53 kai - * added PCI_DEV_TABLE for 2.4 - * - * Revision 1.29.2.1 2000/11/26 17:14:19 kai - * fix device ids - * also needs patches to include/linux/pci_ids.h - * - * Revision 1.29 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.28 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.27 2000/08/08 09:24:19 calle - * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI - * - * Revision 1.26 2000/07/20 10:21:21 calle - * Bugfix: driver will not be unregistered, if not cards were detected. - * this result in an oops in kcapi.c - * - * Revision 1.25 2000/05/29 12:29:18 keil - * make pci_enable_dev compatible to 2.2 kernel versions - * - * Revision 1.24 2000/05/19 15:43:22 calle - * added calls to pci_device_start(). - * - * Revision 1.23 2000/05/06 00:52:36 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.22 2000/04/21 13:01:33 calle - * Revision in b1pciv4 driver was missing. - * - * Revision 1.21 2000/04/03 13:29:24 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.20 2000/02/02 18:36:03 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.19 2000/01/25 14:33:38 calle - * - Added Support AVM B1 PCI V4.0 (tested with prototype) - * - splitted up t1pci.c into b1dma.c for common function with b1pciv4 - * - support for revision register - * - * Revision 1.18 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.17 1999/10/05 06:50:07 calle - * Forgot SA_SHIRQ as argument to request_irq. - * - * Revision 1.16 1999/08/11 21:01:07 keil - * new PCI codefix - * - * Revision 1.15 1999/08/10 16:02:27 calle - * struct pci_dev changed in 2.3.13. Made the necessary changes. - * - * Revision 1.14 1999/07/09 15:05:41 keil - * compat.h is now isdn_compat.h - * - * Revision 1.13 1999/07/05 15:09:50 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.12 1999/07/01 15:26:29 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * */ #include @@ -120,7 +25,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.29.6.1 $"; +static char *revision = "$Revision: 1.29.6.4 $"; /* ------------------------------------------------------------- */ @@ -319,7 +224,7 @@ div4->detach_ctr(ctrl); free_irq(card->irq, card); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); ctrl->driverdata = 0; kfree(card->ctrlinfo); @@ -350,7 +255,6 @@ static int b1pciv4_add_card(struct capi_driver *driver, struct capicardparams *p) { - unsigned long base, page_offset; avmcard *card; avmctrl_info *cinfo; int retval; @@ -401,12 +305,8 @@ return -EBUSY; } - base = card->membase & PAGE_MASK; - page_offset = card->membase - base; - card->mbase = ioremap_nocache(base, page_offset + 64); - if (card->mbase) { - card->mbase += page_offset; - } else { + card->mbase = ioremap_nocache(card->membase, 64); + if (!card->mbase) { printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n", driver->name, card->membase); kfree(card->ctrlinfo); @@ -421,7 +321,7 @@ if ((retval = b1pciv4_detect(card)) != 0) { printk(KERN_NOTICE "%s: NO card at 0x%x (%d)\n", driver->name, card->port, retval); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); kfree(card->ctrlinfo); kfree(card->dma); kfree(card); @@ -437,7 +337,7 @@ if (retval) { printk(KERN_ERR "%s: unable to get IRQ %d.\n", driver->name, card->irq); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); kfree(card->ctrlinfo); kfree(card->dma); @@ -449,7 +349,7 @@ cinfo->capi_ctrl = div4->attach_ctr(driver, card->name, cinfo); if (!cinfo->capi_ctrl) { printk(KERN_ERR "%s: attach controller failed.\n", driver->name); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); free_irq(card->irq, card); release_region(card->port, AVMB1_PORTLEN); kfree(card->ctrlinfo); @@ -500,14 +400,21 @@ struct capicardparams param; int retval; + if (pci_enable_device(dev) < 0) { + printk(KERN_ERR "%s: failed to enable AVM-B1\n", + driver->name); + return -ENODEV; + } + param.irq = dev->irq; + if (dev->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK) { /* B1 PCI V4 */ #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 driver = &b1pciv4_driver; + + pci_set_master(dev); #endif param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK; param.port = dev->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK; - param.irq = dev->irq; - printk(KERN_INFO "%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n", @@ -525,7 +432,6 @@ } else { param.membase = 0; param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; - param.irq = dev->irq; printk(KERN_INFO "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n", @@ -548,69 +454,50 @@ #endif struct pci_dev *dev = NULL; char *p; - int retval; MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; + } #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 - p = strchr(revision, ':'); - strncpy(driverv4->revision, p + 1, sizeof(driverv4->revision)); - p = strchr(driverv4->revision, '$'); - *p = 0; -#endif + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driverv4->revision, p + 2, sizeof(driverv4->revision)); + driverv4->revision[sizeof(driverv4->revision)-1] = 0; + if ((p = strchr(driverv4->revision, '$')) != 0 && p > driverv4->revision) + *(p-1) = 0; } +#endif printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); di = attach_capi_driver(driver); - if (!di) { printk(KERN_ERR "%s: failed to attach capi_driver\n", driver->name); MOD_DEC_USE_COUNT; - return -EIO; + return -ENODEV; } #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 printk(KERN_INFO "%s: revision %s\n", driverv4->name, driverv4->revision); div4 = attach_capi_driver(driverv4); - if (!div4) { detach_capi_driver(driver); printk(KERN_ERR "%s: failed to attach capi_driver\n", driverv4->name); MOD_DEC_USE_COUNT; - return -EIO; + return -ENODEV; } #endif -#ifdef CONFIG_PCI - if (!pci_present()) { - printk(KERN_ERR "%s: no PCI bus present\n", driver->name); - detach_capi_driver(driver); -#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 - detach_capi_driver(driverv4); -#endif - MOD_DEC_USE_COUNT; - return -EIO; - } - while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, dev))) { - retval = add_card(dev); - if (retval != 0) { - detach_capi_driver(driver); -#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 - detach_capi_driver(driverv4); -#endif - MOD_DEC_USE_COUNT; - return retval; - } - ncards++; + if (add_card(dev) == 0) + ncards++; } if (ncards) { printk(KERN_INFO "%s: %d B1-PCI card(s) detected\n", @@ -624,12 +511,7 @@ detach_capi_driver(driverv4); #endif MOD_DEC_USE_COUNT; - return -ESRCH; -#else - printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name); - MOD_DEC_USE_COUNT; - return -EIO; -#endif + return -ENODEV; } static void b1pci_exit(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/b1pcmcia.c linux.20p9/drivers/isdn/avmb1/b1pcmcia.c --- linux.vanilla/drivers/isdn/avmb1/b1pcmcia.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/b1pcmcia.c Wed Jul 4 16:03:54 2001 @@ -1,83 +1,10 @@ /* - * $Id: b1pcmcia.c,v 1.12.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: b1pcmcia.c,v 1.12.6.4 2001/05/17 20:41:51 kai Exp $ * * Module for AVM B1/M1/M2 PCMCIA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1pcmcia.c,v $ - * Revision 1.12.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.12 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.11 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.10 2000/05/06 00:52:36 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.9 2000/04/03 13:29:24 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.8 2000/03/06 18:00:23 calle - * - Middleware extention now working with 2.3.49 (capifs). - * - Fixed typos in debug section of capi.c - * - Bugfix: Makefile corrected for b1pcmcia.c - * - * Revision 1.7 2000/02/02 18:36:03 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.6 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and - * used resources. - * - * Revision 1.5 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.4 1999/08/22 20:26:26 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.3 1999/07/09 15:05:41 keil - * compat.h is now isdn_compat.h - * - * Revision 1.2 1999/07/05 15:09:51 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:30 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * */ #include @@ -96,7 +23,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.12.6.1 $"; +static char *revision = "$Revision: 1.12.6.4 $"; /* ------------------------------------------------------------- */ @@ -321,10 +248,11 @@ MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; } printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/c4.c linux.20p9/drivers/isdn/avmb1/c4.c --- linux.vanilla/drivers/isdn/avmb1/c4.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/c4.c Wed Jul 4 16:03:54 2001 @@ -1,92 +1,9 @@ /* - * $Id: c4.c,v 1.20.6.2 2001/02/13 11:43:29 kai Exp $ + * $Id: c4.c,v 1.20.6.10 2001/06/09 15:14:15 kai Exp $ * - * Module for AVM C4 card. + * Module for AVM C4 & C2 card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) - * - * $Log: c4.c,v $ - * Revision 1.20.6.2 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.20.6.1 2000/11/28 12:02:45 kai - * MODULE_DEVICE_TABLE for 2.4 - * - * Revision 1.20.2.2 2000/11/26 17:47:53 kai - * added PCI_DEV_TABLE for 2.4 - * - * Revision 1.20.2.1 2000/11/26 17:14:19 kai - * fix device ids - * also needs patches to include/linux/pci_ids.h - * - * Revision 1.20 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.19 2000/11/19 17:02:47 kai - * compatibility cleanup - part 3 - * - * Revision 1.18 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.17 2000/10/10 17:44:19 kai - * changes from/for 2.2.18 - * - * Revision 1.16 2000/08/20 07:30:13 keil - * changes for 2.4 - * - * Revision 1.15 2000/08/08 09:24:19 calle - * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI - * - * Revision 1.14 2000/08/04 12:20:08 calle - * - Fix unsigned/signed warning in the right way ... - * - * Revision 1.13 2000/07/20 10:21:21 calle - * Bugfix: driver will not be unregistered, if not cards were detected. - * this result in an oops in kcapi.c - * - * Revision 1.12 2000/06/19 16:51:53 keil - * don't free skb in irq context - * - * Revision 1.11 2000/06/19 15:11:24 keil - * avoid use of freed structs - * changes from 2.4.0-ac21 - * - * Revision 1.10 2000/05/29 12:29:18 keil - * make pci_enable_dev compatible to 2.2 kernel versions - * - * Revision 1.9 2000/05/19 15:43:22 calle - * added calls to pci_device_start(). - * - * Revision 1.8 2000/04/03 16:38:05 calle - * made suppress_pollack static. - * - * Revision 1.7 2000/04/03 13:29:24 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.6 2000/03/17 12:21:08 calle - * send patchvalues now working. - * - * Revision 1.5 2000/03/16 15:21:03 calle - * Bugfix in c4_remove: loop 5 times instead of 4 :-( - * - * Revision 1.4 2000/02/02 18:36:03 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.3 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and - * used resources. - * - * Revision 1.2 2000/01/21 20:52:58 keil - * pci_find_subsys as local function for 2.2.X kernel - * - * Revision 1.1 2000/01/20 10:51:37 calle - * Added driver for C4. - * * */ @@ -101,15 +18,17 @@ #include #include #include +#include #include #include #include +#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.20.6.2 $"; +static char *revision = "$Revision: 1.20.6.10 $"; #undef CONFIG_C4_DEBUG #undef CONFIG_C4_POLLDEBUG @@ -599,7 +518,7 @@ MsgLen = _get_slice(&p, card->msgbuf); DataB3Len = _get_slice(&p, card->databuf); cidx = CAPIMSG_CONTROLLER(card->msgbuf)-card->cardnr; - if (cidx > 3) cidx = 0; + if (cidx >= card->nlogcontr) cidx = 0; ctrl = card->ctrlinfo[cidx].capi_ctrl; if (MsgLen < 30) { /* not CAPI 64Bit */ @@ -622,7 +541,7 @@ ApplId = (unsigned) _get_word(&p); MsgLen = _get_slice(&p, card->msgbuf); cidx = CAPIMSG_CONTROLLER(card->msgbuf)-card->cardnr; - if (cidx > 3) cidx = 0; + if (cidx >= card->nlogcontr) cidx = 0; ctrl = card->ctrlinfo[cidx].capi_ctrl; if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { @@ -640,7 +559,7 @@ NCCI = _get_word(&p); WindowSize = _get_word(&p); cidx = (NCCI&0x7f) - card->cardnr; - if (cidx > 3) cidx = 0; + if (cidx >= card->nlogcontr) cidx = 0; ctrl = card->ctrlinfo[cidx].capi_ctrl; ctrl->new_ncci(ctrl, ApplId, NCCI, WindowSize); @@ -654,13 +573,15 @@ if (NCCI != 0xffffffff) { cidx = (NCCI&0x7f) - card->cardnr; - if (cidx > 3) cidx = 0; + if (cidx >= card->nlogcontr) cidx = 0; ctrl = card->ctrlinfo[cidx].capi_ctrl; - ctrl->free_ncci(ctrl, ApplId, NCCI); + if (ctrl) + ctrl->free_ncci(ctrl, ApplId, NCCI); } else { for (cidx=0; cidx < 4; cidx++) { ctrl = card->ctrlinfo[cidx].capi_ctrl; - ctrl->appl_released(ctrl, ApplId); + if (ctrl) + ctrl->appl_released(ctrl, ApplId); } } break; @@ -673,20 +594,28 @@ queue_pollack(card); for (cidx=0; cidx < 4; cidx++) { ctrl = card->ctrlinfo[cidx].capi_ctrl; - ctrl->resume_output(ctrl); + if (ctrl) + ctrl->resume_output(ctrl); } break; case RECEIVE_STOP: for (cidx=0; cidx < 4; cidx++) { ctrl = card->ctrlinfo[cidx].capi_ctrl; - ctrl->suspend_output(ctrl); + if (ctrl) + ctrl->suspend_output(ctrl); } break; case RECEIVE_INIT: - cidx = card->nlogcontr++; + cidx = card->nlogcontr; + if (cidx >= 4 || !card->ctrlinfo[cidx].capi_ctrl) { + printk(KERN_ERR "%s: card with %d controllers ??\n", + card->name, cidx+1); + break; + } + card->nlogcontr++; cinfo = &card->ctrlinfo[cidx]; ctrl = cinfo->capi_ctrl; cinfo->versionlen = _get_slice(&p, cinfo->versionbuf); @@ -740,6 +669,8 @@ if (status & DBELL_RESET_HOST) { int i; c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c); + if (card->nlogcontr == 0) + return; printk(KERN_ERR "%s: unexpected reset\n", card->name); for (i=0; i < 4; i++) { avmctrl_info *cinfo = &card->ctrlinfo[i]; @@ -747,6 +678,7 @@ if (cinfo->capi_ctrl) cinfo->capi_ctrl->reseted(cinfo->capi_ctrl); } + card->nlogcontr = 0; return; } @@ -815,7 +747,7 @@ _put_byte(&p, 0); _put_byte(&p, 0); _put_byte(&p, SEND_INIT); - _put_word(&p, AVM_NAPPS); + _put_word(&p, CAPI_MAXAPPL); _put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, card->cardnr - 1); skb_put(skb, (__u8 *)p - (__u8 *)skb->data); @@ -978,6 +910,7 @@ if (cinfo->capi_ctrl) cinfo->capi_ctrl->reseted(cinfo->capi_ctrl); } + card->nlogcontr = 0; } static void c4_remove_ctr(struct capi_ctr *ctrl) @@ -997,7 +930,7 @@ } free_irq(card->irq, card); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); ctrl->driverdata = 0; kfree(card->ctrlinfo); @@ -1130,6 +1063,7 @@ case avm_t1isa: s = "T1 ISA (HEMA)"; break; case avm_t1pci: s = "T1 PCI"; break; case avm_c4: s = "C4"; break; + case avm_c2: s = "C2"; break; default: s = "???"; break; } len += sprintf(page+len, "%-16s %s\n", "type", s); @@ -1177,9 +1111,10 @@ /* ------------------------------------------------------------- */ -static int c4_add_card(struct capi_driver *driver, struct capicardparams *p) +static int c4_add_card(struct capi_driver *driver, + struct capicardparams *p, + int nr) { - unsigned long base, page_offset; avmctrl_info *cinfo; avmcard *card; int retval; @@ -1217,11 +1152,11 @@ cinfo = &card->ctrlinfo[i]; cinfo->card = card; } - sprintf(card->name, "c4-%x", p->port); + sprintf(card->name, "%s-%x", driver->name, p->port); card->port = p->port; card->irq = p->irq; card->membase = p->membase; - card->cardtype = avm_c4; + card->cardtype = nr == 4 ? avm_c4 : avm_c2; if (check_region(card->port, AVMB1_PORTLEN)) { printk(KERN_WARNING @@ -1234,12 +1169,8 @@ return -EBUSY; } - base = card->membase & PAGE_MASK; - page_offset = card->membase - base; - card->mbase = ioremap_nocache(base, page_offset + 128); - if (card->mbase) { - card->mbase += page_offset; - } else { + card->mbase = ioremap_nocache(card->membase, 128); + if (card->mbase == 0) { printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n", driver->name, card->membase); kfree(card->ctrlinfo); @@ -1252,7 +1183,7 @@ if ((retval = c4_detect(card)) != 0) { printk(KERN_NOTICE "%s: NO card at 0x%x (%d)\n", driver->name, card->port, retval); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); kfree(card->ctrlinfo); kfree(card->dma); kfree(card); @@ -1267,7 +1198,7 @@ if (retval) { printk(KERN_ERR "%s: unable to get IRQ %d.\n", driver->name, card->irq); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); kfree(card->ctrlinfo); kfree(card->dma); @@ -1276,7 +1207,7 @@ return -EBUSY; } - for (i=0; i < 4; i++) { + for (i=0; i < nr ; i++) { cinfo = &card->ctrlinfo[i]; cinfo->card = card; cinfo->capi_ctrl = di->attach_ctr(driver, card->name, cinfo); @@ -1287,7 +1218,7 @@ cinfo = &card->ctrlinfo[i]; di->detach_ctr(cinfo->capi_ctrl); } - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); free_irq(card->irq, card); release_region(card->port, AVMB1_PORTLEN); kfree(card->dma); @@ -1303,14 +1234,31 @@ skb_queue_head_init(&card->dma->send_queue); printk(KERN_INFO - "%s: AVM C4 at i/o %#x, irq %d, mem %#lx\n", - driver->name, card->port, card->irq, card->membase); + "%s: AVM C%d at i/o %#x, irq %d, mem %#lx\n", + driver->name, nr, card->port, card->irq, card->membase); return 0; } /* ------------------------------------------------------------- */ +static struct capi_driver c2_driver = { + name: "c2", + revision: "0.0", + load_firmware: c4_load_firmware, + reset_ctr: c4_reset_ctr, + remove_ctr: c4_remove_ctr, + register_appl: c4_register_appl, + release_appl: c4_release_appl, + send_message: c4_send_message, + + procinfo: c4_procinfo, + ctr_read_proc: c4_read_proc, + driver_read_proc: 0, /* use standard driver_read_proc */ + + add_card: 0, /* no add_card function */ +}; + static struct capi_driver c4_driver = { name: "c4", revision: "0.0", @@ -1330,83 +1278,114 @@ static int ncards = 0; -static int __init c4_init(void) +static int c4_attach_driver (struct capi_driver * driver) { - struct capi_driver *driver = &c4_driver; - struct pci_dev *dev = NULL; char *p; - int retval; - - MOD_INC_USE_COUNT; - - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; } printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); di = attach_capi_driver(driver); - if (!di) { printk(KERN_ERR "%s: failed to attach capi_driver\n", driver->name); MOD_DEC_USE_COUNT; - return -EIO; + return -ENODEV; } + return 0; +} -#ifdef CONFIG_PCI - if (!pci_present()) { - printk(KERN_ERR "%s: no PCI bus present\n", driver->name); - detach_capi_driver(driver); - MOD_DEC_USE_COUNT; - return -EIO; - } +static int __init search_cards(struct capi_driver * driver, + int pci_id, int nr) +{ + struct pci_dev * dev = NULL; + int retval = 0; while ((dev = pci_find_subsys( PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, - PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4, dev))) { + PCI_VENDOR_ID_AVM, pci_id, dev))) { struct capicardparams param; + if (pci_enable_device(dev) < 0) { + printk(KERN_ERR "%s: failed to enable AVM-C%d\n", + driver->name, nr); + continue; + } + pci_set_master(dev); + param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; param.irq = dev->irq; param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK; - - + printk(KERN_INFO - "%s: PCI BIOS reports AVM-C4 at i/o %#x, irq %d, mem %#x\n", - driver->name, param.port, param.irq, param.membase); - retval = c4_add_card(driver, ¶m); + "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n", + driver->name, nr, param.port, param.irq, param.membase); + retval = c4_add_card(driver, ¶m, nr); if (retval != 0) { printk(KERN_ERR - "%s: no AVM-C4 at i/o %#x, irq %d detected, mem %#x\n", - driver->name, param.port, param.irq, param.membase); - detach_capi_driver(driver); - MOD_DEC_USE_COUNT; - return retval; + "%s: no AVM-C%d at i/o %#x, irq %d detected, mem %#x\n", + driver->name, nr, param.port, param.irq, param.membase); + continue; } ncards++; } + return retval; +} + +static int __init c4_init(void) +{ + int retval; + + MOD_INC_USE_COUNT; + + retval = c4_attach_driver (&c4_driver); + if (retval) { + MOD_DEC_USE_COUNT; + return retval; + } + + retval = c4_attach_driver (&c2_driver); + if (retval) { + MOD_DEC_USE_COUNT; + return retval; + } + + retval = search_cards(&c4_driver, PCI_DEVICE_ID_AVM_C4, 4); + if (retval && ncards == 0) { + detach_capi_driver(&c2_driver); + detach_capi_driver(&c4_driver); + MOD_DEC_USE_COUNT; + return retval; + } + retval = search_cards(&c2_driver, 0x1100, 2); + if (retval && ncards == 0) { + detach_capi_driver(&c2_driver); + detach_capi_driver(&c4_driver); + MOD_DEC_USE_COUNT; + return retval; + } + if (ncards) { - printk(KERN_INFO "%s: %d C4 card(s) detected\n", - driver->name, ncards); + printk(KERN_INFO "%s: %d C4/C2 card(s) detected\n", + c4_driver.name, ncards); MOD_DEC_USE_COUNT; return 0; } - printk(KERN_ERR "%s: NO C4 card detected\n", driver->name); - detach_capi_driver(driver); + printk(KERN_ERR "%s: NO C4/C2 card detected\n", c4_driver.name); + detach_capi_driver(&c4_driver); + detach_capi_driver(&c2_driver); MOD_DEC_USE_COUNT; - return -ESRCH; -#else - printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name); - MOD_DEC_USE_COUNT; - return -EIO; -#endif + return -ENODEV; } static void c4_exit(void) { + detach_capi_driver(&c2_driver); detach_capi_driver(&c4_driver); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capi.c linux.20p9/drivers/isdn/avmb1/capi.c --- linux.vanilla/drivers/isdn/avmb1/capi.c Sun Mar 25 17:37:31 2001 +++ linux.20p9/drivers/isdn/avmb1/capi.c Wed Jul 4 16:03:54 2001 @@ -1,226 +1,10 @@ /* - * $Id: capi.c,v 1.44.6.5 2001/02/13 11:43:29 kai Exp $ + * $Id: capi.c,v 1.44.6.12 2001/06/09 15:14:15 kai Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capi.c,v $ - * Revision 1.44.6.5 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.44.6.4 2001/02/10 14:41:20 kai - * Changes from kernel tree - * - * Revision 1.44.6.3 2000/12/17 22:45:08 kai - * That's hopefully it for test13-4 - * - * Revision 1.44.6.2 2000/12/14 23:04:12 kai - * Makefile changes and the like for 2.4.0-test13-pre1 - * No compatiblity code for older kernels yet, but note the branch - * - * Revision 1.45 2000/12/02 19:47:29 kai - * Change the Makefiles to new style. - * There may be problems there that I missed, so this shouldn't go into - * an offical kernel any time soon. - * However, if I didn't commit it, we wouldn't find the bugs... - * - * Revision 1.44 2000/11/25 17:00:59 kai - * compatibility cleanup - final part for the time being - * - * Revision 1.43 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.42 2000/11/19 17:03:55 kai - * compatibility cleanup - part 5 - * - * Revision 1.41 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.40 2000/10/24 15:15:04 calle - * Workaround: pppd calls restoretty before reseting the ldisc and - * ldisc "ppp_sync" didn't support this. So we call n_tty_ioctl - * in the driver ioctl function. (remember: driver ioctl function is - * only called if ldisc ioctl function did not handle the call) - * - * Revision 1.39 2000/07/24 13:42:50 calle - * - lock_kernel/unlock_kernel for _release functions. (from 2.4) - * - * Revision 1.38 2000/07/24 08:49:09 calle - * - Bugfix: capiminor_del_all_ack completely wrong :-( - * - * Revision 1.37 2000/07/20 10:22:27 calle - * - Made procfs function cleaner and removed variable "begin". - * - * Revision 1.36 2000/06/29 13:59:35 calle - * - call to devfs_register was wrong - * - * Revision 1.35 2000/06/19 15:11:24 keil - * avoid use of freed structs - * changes from 2.4.0-ac21 - * - * Revision 1.34 2000/06/18 16:09:54 keil - * more changes for 2.4 - * - * Revision 1.33 2000/05/18 16:35:43 calle - * Uaaahh. Bad memory leak fixed. - * - * Revision 1.32 2000/04/21 12:38:42 calle - * Bugfix: error in proc_ functions, begin-off => off-begin - * - * Revision 1.31 2000/04/03 13:29:24 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.30 2000/03/19 12:31:36 calle - * PPP over CAPI raw driver disabled for now, ppp_generic has been changed. - * - * Revision 1.29 2000/03/13 17:48:13 calle - * removed unused variable. - * - * Revision 1.28 2000/03/08 17:06:33 calle - * - changes for devfs and 2.3.49 - * - capifs now configurable (no need with devfs) - * - New Middleware ioctl CAPI_NCCI_GETUNIT - * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs) - * - * Revision 1.27 2000/03/06 18:00:23 calle - * - Middleware extention now working with 2.3.49 (capifs). - * - Fixed typos in debug section of capi.c - * - Bugfix: Makefile corrected for b1pcmcia.c - * - * Revision 1.26 2000/03/03 16:48:38 calle - * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI) - * It is now possible to create a connection with a CAPI2.0 applikation - * and than to handle the data connection from /dev/capi/ (capifs) and also - * using async or sync PPP on this connection. - * The two major device number 190 and 191 are not confirmed yet, - * but I want to save the code in cvs, before I go on. - * - * Revision 1.25 2000/03/03 16:37:11 kai - * incorporated some cosmetic changes from the official kernel tree back - * into CVS - * - * Revision 1.24 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.23 2000/02/26 01:00:53 keil - * changes from 2.3.47 - * - * 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" - * - * Revision 1.20 1999/09/07 09:02:53 calle - * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and - * DATA_B3_IND is always directly after the CAPI message. The "Data" member - * ist never used inside the kernel. - * - * Revision 1.19 1999/07/09 15:05:42 keil - * compat.h is now isdn_compat.h - * - * Revision 1.18 1999/07/06 07:42:01 calle - * - changes in /proc interface - * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb. - * - * Revision 1.17 1999/07/01 15:26:30 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * Revision 1.16 1999/07/01 08:22:57 keil - * compatibility macros now in - * - * Revision 1.15 1999/06/21 15:24:11 calle - * extend information in /proc. - * - * Revision 1.14 1999/06/10 16:51:03 calle - * Bugfix: open/release of control device was not handled correct. - * - * Revision 1.13 1998/08/28 04:32:25 calle - * Added patch send by Michael.Mueller4@post.rwth-aachen.de, to get AVM B1 - * driver running with 2.1.118. - * - * Revision 1.12 1998/05/26 22:39:34 he - * sync'ed with 2.1.102 where appropriate (CAPABILITY changes) - * concap typo - * cleared dev.tbusy in isdn_net BCONN status callback - * - * Revision 1.11 1998/03/09 17:46:37 he - * merged in 2.1.89 changes - * - * Revision 1.10 1998/02/13 07:09:13 calle - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.9 1998/01/31 11:14:44 calle - * merged changes to 2.0 tree, prepare 2.1.82 to work. - * - * Revision 1.8 1997/11/04 06:12:08 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.7 1997/10/11 10:29:34 calle - * llseek() parameters changed in 2.1.56. - * - * Revision 1.6 1997/10/01 09:21:15 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.5 1997/08/21 23:11:55 fritz - * Added changes for kernels >= 2.1.45 - * - * Revision 1.4 1997/05/27 15:17:50 fritz - * Added changes for recent 2.1.x kernels: - * changed return type of isdn_close - * queue_task_* -> queue_task - * clear/set_bit -> test_and_... where apropriate. - * changed type of hard_header_cache parameter. - * - * Revision 1.3 1997/05/18 09:24:14 calle - * added verbose disconnect reason reporting to avmb1. - * some fixes in capi20 interface. - * changed info messages for B1-PCI - * - * Revision 1.2 1997/03/05 21:17:59 fritz - * Added capi_poll for compiling under 2.1.27 - * - * Revision 1.1 1997/03/04 21:50:29 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 - * */ #include @@ -237,6 +21,7 @@ #include #include #include +#include #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #include #ifdef CONFIG_PPP @@ -258,7 +43,7 @@ #include "capifs.h" #endif -static char *revision = "$Revision: 1.44.6.5 $"; +static char *revision = "$Revision: 1.44.6.12 $"; MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)"); @@ -465,7 +250,6 @@ void capiminor_free(struct capiminor *mp) { struct capiminor **pp; - struct sk_buff *skb; pp = &minors; while (*pp) { @@ -473,12 +257,9 @@ *pp = (*pp)->next; if (mp->ttyskb) kfree_skb(mp->ttyskb); mp->ttyskb = 0; - while ((skb = skb_dequeue(&mp->recvqueue)) != 0) - kfree_skb(skb); - while ((skb = skb_dequeue(&mp->inqueue)) != 0) - kfree_skb(skb); - while ((skb = skb_dequeue(&mp->outqueue)) != 0) - kfree_skb(skb); + skb_queue_purge(&mp->recvqueue); + skb_queue_purge(&mp->inqueue); + skb_queue_purge(&mp->outqueue); capiminor_del_all_ack(mp); kfree(mp); MOD_DEC_USE_COUNT; @@ -517,9 +298,6 @@ memset(np, 0, sizeof(struct capincci)); np->ncci = ncci; np->cdev = cdev; - for (pp=&cdev->nccis; *pp; pp = &(*pp)->next) - ; - *pp = np; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE mp = 0; if (cdev->userflags & CAPIFLAG_HIGHJACKING) @@ -537,6 +315,9 @@ #endif } #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ + for (pp=&cdev->nccis; *pp; pp = &(*pp)->next) + ; + *pp = np; return np; } @@ -620,15 +401,12 @@ static void capidev_free(struct capidev *cdev) { struct capidev **pp; - struct sk_buff *skb; if (cdev->applid) (*capifuncs->capi_release) (cdev->applid); cdev->applid = 0; - while ((skb = skb_dequeue(&cdev->recvqueue)) != 0) { - kfree_skb(skb); - } + skb_queue_purge(&cdev->recvqueue); pp=&capidev_openlist; while (*pp && *pp != cdev) pp = &(*pp)->next; @@ -985,6 +763,8 @@ return -ENODEV; skb = alloc_skb(count, GFP_USER); + if (!skb) + return -ENOMEM; if ((retval = copy_from_user(skb_put(skb, count), buf, count))) { kfree_skb(skb); @@ -1401,6 +1181,8 @@ return -EINVAL; skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_USER); + if (!skb) + return -ENOMEM; skb_reserve(skb, CAPI_DATA_B3_REQ_LEN); if ((retval = copy_from_user(skb_put(skb, count), buf, count))) { @@ -2028,20 +1810,22 @@ callback: lower_callback, }; -static char rev[10]; +static char rev[32]; static int __init capi_init(void) { char *p; + char *compileinfo; MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 2); - p = strchr(rev, '$'); - *(p-1) = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else - strcpy(rev, "???"); + strcpy(rev, "1.0"); if (register_chrdev(capi_major, "capi20", &capi_fops)) { printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); @@ -2082,8 +1866,17 @@ (void)proc_init(); - printk(KERN_NOTICE "capi20: Rev%s: started up with major %d\n", - rev, capi_major); +#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE +#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE) + compileinfo = " (middleware+capifs)"; +#else + compileinfo = " (no capifs)"; +#endif +#else + compileinfo = " (no middleware)"; +#endif + printk(KERN_NOTICE "capi20: Rev %s: started up with major %d%s\n", + rev, capi_major, compileinfo); MOD_DEC_USE_COUNT; return 0; @@ -2102,7 +1895,7 @@ unregister_chrdev(capi_rawmajor, "capi/r%d"); #endif (void) detach_capi_interface(&cuser); - printk(KERN_NOTICE "capi: Rev%s: unloaded\n", rev); + printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev); } module_init(capi_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capicmd.h linux.20p9/drivers/isdn/avmb1/capicmd.h --- linux.vanilla/drivers/isdn/avmb1/capicmd.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capicmd.h Wed Jul 4 16:03:54 2001 @@ -1,32 +1,10 @@ /* - * $Id: capicmd.h,v 1.2 2000/03/03 15:50:42 calle Exp $ + * $Id: capicmd.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capicmd.h,v $ - * Revision 1.2 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.1 1997/03/04 21:50:30 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 __CAPICMD_H__ #define __CAPICMD_H__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capidev.h linux.20p9/drivers/isdn/avmb1/capidev.h --- linux.vanilla/drivers/isdn/avmb1/capidev.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capidev.h Wed Jul 4 16:03:54 2001 @@ -1,56 +1,10 @@ /* - * $Id: capidev.h,v 1.6 2000/11/25 17:00:59 kai Exp $ + * $Id: capidev.h,v 1.6.6.1 2001/05/17 20:41:51 kai Exp $ * * CAPI 2.0 Interface for Linux * * (c) Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capidev.h,v $ - * Revision 1.6 2000/11/25 17:00:59 kai - * compatibility cleanup - final part for the time being - * - * Revision 1.5 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.4 1999/07/01 15:26:32 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * Revision 1.3 1999/07/01 08:22:58 keil - * compatibility macros now in - * - * Revision 1.2 1999/06/21 15:24:13 calle - * extend information in /proc. - * - * Revision 1.1 1997/03/04 21:50:30 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 - * */ struct capidev { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capidrv.c linux.20p9/drivers/isdn/avmb1/capidrv.c --- linux.vanilla/drivers/isdn/avmb1/capidrv.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capidrv.c Wed Jul 4 16:03:54 2001 @@ -1,202 +1,10 @@ /* - * $Id: capidrv.c,v 1.39.6.2 2001/02/13 11:43:29 kai Exp $ + * $Id: capidrv.c,v 1.39.6.6 2001/05/17 20:41:51 kai Exp $ * * ISDN4Linux Driver, using capi20 interface (kernelcapi) * * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capidrv.c,v $ - * Revision 1.39.6.2 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.39.6.1 2001/02/10 14:41:20 kai - * Changes from kernel tree - * - * Revision 1.39 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.38 2000/11/14 08:43:07 calle - * Bugfix for v110. Connectparamters where setup for sync ... - * - * Revision 1.37 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.36 2000/06/26 15:13:41 keil - * features should be or'ed - * - * Revision 1.35 2000/06/19 15:11:25 keil - * avoid use of freed structs - * changes from 2.4.0-ac21 - * - * Revision 1.34 2000/06/19 13:13:55 calle - * Added Modemsupport! - * - * Revision 1.33 2000/05/06 00:52:36 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.32 2000/04/07 15:19:58 calle - * remove warnings - * - * Revision 1.31 2000/04/06 15:01:25 calle - * Bugfix: crash in capidrv.c when reseting a capi controller. - * - changed code order on remove of controller. - * - using tq_schedule for notifier in kcapi.c. - * - now using spin_lock_irqsave() and spin_unlock_irqrestore(). - * strange: sometimes even MP hang on unload of isdn.o ... - * - * Revision 1.30 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.29 1999/12/06 17:13:06 calle - * Added controller watchdog. - * - * Revision 1.28 1999/11/05 16:22:37 calle - * Bugfix: Missing break in switch on ISDN_CMD_HANGUP. - * - * Revision 1.27 1999/09/16 15:13:04 calle - * forgot to change paramter type of contr for lower_callback ... - * - * Revision 1.26 1999/08/06 07:41:16 calle - * Added the "vbox patch". if (si1 == 1) si2 = 0; - * - * Revision 1.25 1999/08/04 10:10:11 calle - * Bugfix: corrected /proc functions, added structure for new AVM cards. - * - * Revision 1.24 1999/07/20 06:48:02 calle - * Bugfix: firmware version check for D2 trace was too restrictiv. - * - * Revision 1.23 1999/07/09 15:05:44 keil - * compat.h is now isdn_compat.h - * - * Revision 1.22 1999/07/06 07:24:14 calle - * Bugfix: call to kfree_skb in capidrv_signal was too early, - * thanks to Lars Heete . - * - * Revision 1.21 1999/07/01 15:26:34 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * Revision 1.20 1999/07/01 08:22:59 keil - * compatibility macros now in - * - * Revision 1.19 1999/06/29 16:16:54 calle - * Let ISDN_CMD_UNLOAD work with open isdn devices without crash again. - * Also right unlocking (ISDN_CMD_UNLOCK) is done now. - * isdnlog should check returncode of read(2) calls. - * - * Revision 1.18 1999/06/21 15:24:15 calle - * extend information in /proc. - * - * Revision 1.17 1999/06/10 16:53:55 calle - * Removing of module b1pci will now remove card from lower level. - * - * Revision 1.16 1999/05/31 11:50:33 calle - * Bugfix: In if_sendbuf, skb_push'ed DATA_B3 header was not skb_pull'ed - * on failure, result in data block with DATA_B3 header transmitted - * - * Revision 1.15 1999/05/25 21:26:16 calle - * Include CAPI-Channelallocation (leased lines) from the 2.0 tree. - * - * Revision 1.14 1999/05/22 07:55:06 calle - * Added *V110* to AVM B1 driver. - * - * Revision 1.13 1998/06/26 15:12:55 fritz - * Added handling of STAT_ICALL with incomplete CPN. - * Added AT&L for ttyI emulator. - * Added more locking stuff in tty_write. - * - * Revision 1.12 1998/03/29 16:06:03 calle - * changes from 2.0 tree merged. - * - * Revision 1.3.2.10 1998/03/20 14:38:24 calle - * capidrv: prepared state machines for suspend/resume/hold - * capidrv: fix bug in state machine if B1/T1 is out of nccis - * b1capi: changed some errno returns. - * b1capi: detect if you try to add same T1 to different io address. - * b1capi: change number of nccis depending on number of channels. - * b1lli: cosmetics - * - * Revision 1.3.2.9 1998/03/20 09:01:12 calle - * Changes capi_register handling to get full support for 30 bchannels. - * - * Revision 1.3.2.8 1998/03/18 17:51:28 calle - * added controller number to error messages - * - * Revision 1.3.2.7 1998/02/27 15:40:47 calle - * T1 running with slow link. bugfix in capi_release. - * - * Revision 1.11 1998/02/13 07:09:15 calle - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.10 1998/02/02 19:52:23 calle - * Fixed vbox (audio) acceptb. - * - * Revision 1.9 1998/01/31 11:14:45 calle - * merged changes to 2.0 tree, prepare 2.1.82 to work. - * - * Revision 1.8 1997/11/04 06:12:09 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.7 1997/10/11 10:36:34 calle - * Added isdnlog support. patch to isdnlog needed. - * - * Revision 1.6 1997/10/11 10:25:55 calle - * New interface for lowlevel drivers. BSENT with nr. of bytes sent, - * allow sending without ACK. - * - * Revision 1.5 1997/10/01 09:21:16 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.4 1997/07/13 12:22:43 calle - * bug fix for more than one controller in connect_req. - * debugoutput now with contrnr. - * - * Revision 1.3 1997/05/18 09:24:15 calle - * added verbose disconnect reason reporting to avmb1. - * some fixes in capi20 interface. - * changed info messages for B1-PCI - * - * Revision 1.2 1997/03/05 21:19:59 fritz - * Removed include of config.h (mkdep stated this is unneded). - * - * Revision 1.1 1997/03/04 21:50:31 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 - * */ #include @@ -225,7 +33,7 @@ #include "capicmd.h" #include "capidrv.h" -static char *revision = "$Revision: 1.39.6.2 $"; +static char *revision = "$Revision: 1.39.6.6 $"; static int debugmode = 0; MODULE_AUTHOR("Carsten Paeth "); @@ -494,7 +302,7 @@ } -/* -------- controller managment ------------------------------------- */ +/* -------- controller management ------------------------------------- */ static inline capidrv_contr *findcontrbydriverid(int driverid) { @@ -2063,8 +1871,8 @@ __u16 datahandle; if (!card) { - printk(KERN_ERR "capidrv-%d: if_sendbuf called with invalid driverId %d!\n", - card->contrnr, id); + printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n", + id); return 0; } if (debugmode > 1) @@ -2133,8 +1941,8 @@ __u8 *p; if (!card) { - printk(KERN_ERR "capidrv-%d: if_readstat called with invalid driverId %d!\n", - card->contrnr, id); + printk(KERN_ERR "capidrv: if_readstat called with invalid driverId %d!\n", + id); return -ENODEV; } @@ -2490,7 +2298,7 @@ { struct capi_register_params rparam; capi_profile profile; - char rev[10]; + char rev[32]; char *p; __u32 ncontr, contr; __u16 errcode; @@ -2504,12 +2312,13 @@ return -EIO; } - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else - strcpy(rev, " ??? "); + strcpy(rev, "1.0"); rparam.level3cnt = -2; /* number of bchannels twice */ rparam.datablkcnt = 16; @@ -2540,7 +2349,7 @@ } proc_init(); - printk(KERN_NOTICE "capidrv: Rev%s: loaded\n", rev); + printk(KERN_NOTICE "capidrv: Rev %s: loaded\n", rev); MOD_DEC_USE_COUNT; return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capidrv.h linux.20p9/drivers/isdn/avmb1/capidrv.h --- linux.vanilla/drivers/isdn/avmb1/capidrv.h Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/isdn/avmb1/capidrv.h Wed Jul 4 16:03:54 2001 @@ -1,31 +1,10 @@ /* - * $Id: capidrv.h,v 1.2 1998/03/29 16:06:06 calle Exp $ + * $Id: capidrv.h,v 1.2.8.1 2001/05/17 20:41:51 kai Exp $ * * ISDN4Linux Driver, using capi20 interface (kernelcapi) * * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capidrv.h,v $ - * Revision 1.2 1998/03/29 16:06:06 calle - * changes from 2.0 tree merged. - * - * Revision 1.1.2.1 1998/03/20 14:38:28 calle - * capidrv: prepared state machines for suspend/resume/hold - * capidrv: fix bug in state machine if B1/T1 is out of nccis - * b1capi: changed some errno returns. - * b1capi: detect if you try to add same T1 to different io address. - * b1capi: change number of nccis depending on number of channels. - * b1lli: cosmetics - * - * Revision 1.1 1997/03/04 21:50:33 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 __CAPIDRV_H__ #define __CAPIDRV_H__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capifs.c linux.20p9/drivers/isdn/avmb1/capifs.c --- linux.vanilla/drivers/isdn/avmb1/capifs.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capifs.c Wed Jul 4 16:03:54 2001 @@ -1,81 +1,10 @@ /* - * $Id: capifs.c,v 1.14.6.3 2001/02/13 11:43:29 kai Exp $ + * $Id: capifs.c,v 1.14.6.7 2001/05/24 08:29:08 kai Exp $ * * (c) Copyright 2000 by Carsten Paeth (calle@calle.de) * * Heavily based on devpts filesystem from H. Peter Anvin * - * $Log: capifs.c,v $ - * Revision 1.14.6.3 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.14.6.2 2001/02/10 14:41:20 kai - * Changes from kernel tree - * - * Revision 1.14.6.1 2000/11/28 12:02:45 kai - * MODULE_DEVICE_TABLE for 2.4 - * - * Revision 1.14.2.1 2000/11/26 17:47:53 kai - * added PCI_DEV_TABLE for 2.4 - * - * Revision 1.14 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.13 2000/11/18 16:17:25 kai - * change from 2.4 tree - * - * Revision 1.12 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.11 2000/10/24 15:08:47 calle - * Too much includes. - * - * Revision 1.10 2000/10/12 10:12:35 calle - * Bugfix: second iput(inode) on umount, destroies a foreign inode. - * - * Revision 1.9 2000/08/20 07:30:13 keil - * changes for 2.4 - * - * Revision 1.8 2000/07/20 10:23:13 calle - * Include isdn_compat.h for people that don't use -p option of std2kern. - * - * Revision 1.7 2000/06/18 16:09:54 keil - * more changes for 2.4 - * - * Revision 1.6 2000/04/03 13:29:25 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.5 2000/03/13 17:49:52 calle - * make it running with 2.3.51. - * - * Revision 1.4 2000/03/08 17:06:33 calle - * - changes for devfs and 2.3.49 - * - capifs now configurable (no need with devfs) - * - New Middleware ioctl CAPI_NCCI_GETUNIT - * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs) - * - * Revision 1.3 2000/03/06 18:00:23 calle - * - Middleware extention now working with 2.3.49 (capifs). - * - Fixed typos in debug section of capi.c - * - Bugfix: Makefile corrected for b1pcmcia.c - * - * Revision 1.2 2000/03/06 09:17:07 calle - * - capifs: fileoperations now in inode (change for 2.3.49) - * - Config.in: Middleware extention not a tristate, uups. - * - * Revision 1.1 2000/03/03 16:48:38 calle - * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI) - * It is now possible to create a connection with a CAPI2.0 applikation - * and than to handle the data connection from /dev/capi/ (capifs) and also - * using async or sync PPP on this connection. - * The two major device number 190 and 191 are not confirmed yet, - * but I want to save the code in cvs, before I go on. - * - * */ #include @@ -94,12 +23,13 @@ #include #include #include +#include #include #include MODULE_AUTHOR("Carsten Paeth "); -static char *revision = "$Revision: 1.14.6.3 $"; +static char *revision = "$Revision: 1.14.6.7 $"; struct capifs_ncci { struct inode *inode; @@ -279,24 +209,16 @@ kfree(sbi->nccis); kfree(sbi); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) MOD_DEC_USE_COUNT; -#endif } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz); static void capifs_write_inode(struct inode *inode) { }; -#else -static int capifs_statfs(struct super_block *sb, struct statfs *buf); -#endif static void capifs_read_inode(struct inode *inode); static struct super_operations capifs_sops = { read_inode: capifs_read_inode, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) write_inode: capifs_write_inode, -#endif put_super: capifs_put_super, statfs: capifs_statfs, }; @@ -367,10 +289,8 @@ struct dentry * root; struct capifs_sb_info *sbi; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) MOD_INC_USE_COUNT; lock_super(s); -#endif /* Super block already completed? */ if (s->s_root) goto out; @@ -446,19 +366,14 @@ mounts = s; out: /* Success ... somebody else completed the super block for us. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) unlock_super(s); -#endif return s; fail: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) unlock_super(s); MOD_DEC_USE_COUNT; -#endif return NULL; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz) { struct statfs tmp; @@ -473,20 +388,6 @@ tmp.f_namelen = NAME_MAX; return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0; } -#else -static int capifs_statfs(struct super_block *sb, struct statfs *buf) -{ - buf->f_type = CAPIFS_SUPER_MAGIC; - buf->f_bsize = 1024; - buf->f_blocks = 0; - buf->f_bfree = 0; - buf->f_bavail = 0; - buf->f_files = 0; - buf->f_ffree = 0; - buf->f_namelen = NAME_MAX; - return 0; -} -#endif static void capifs_read_inode(struct inode *inode) { @@ -517,16 +418,12 @@ return; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51) static struct file_system_type capifs_fs_type = { "capifs", 0, capifs_read_super, NULL }; -#else -static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0); -#endif void capifs_new_ncci(char type, unsigned int num, kdev_t device) { @@ -547,8 +444,7 @@ break; } } - - if ((np->inode = iget(sb, ino+2)) != 0) { + if ((np->inode = iget(sb, ino+2)) != NULL) { struct inode *inode = np->inode; inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid; inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid; @@ -587,16 +483,17 @@ static int __init capifs_init(void) { - char rev[10]; + char rev[32]; char *p; int err; MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else strcpy(rev, "1.0"); @@ -605,11 +502,7 @@ MOD_DEC_USE_COUNT; return err; } -#ifdef MODULE - printk(KERN_NOTICE "capifs: Rev%s: loaded\n", rev); -#else - printk(KERN_NOTICE "capifs: Rev%s: started\n", rev); -#endif + printk(KERN_NOTICE "capifs: Rev %s\n", rev); MOD_DEC_USE_COUNT; return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capifs.h linux.20p9/drivers/isdn/avmb1/capifs.h --- linux.vanilla/drivers/isdn/avmb1/capifs.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capifs.h Wed Jul 4 16:03:54 2001 @@ -1,24 +1,8 @@ /* - * $Id: capifs.h,v 1.2 2000/03/08 17:06:33 calle Exp $ + * $Id: capifs.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $ * * (c) Copyright 2000 by Carsten Paeth (calle@calle.de) * - * $Log: capifs.h,v $ - * Revision 1.2 2000/03/08 17:06:33 calle - * - changes for devfs and 2.3.49 - * - capifs now configurable (no need with devfs) - * - New Middleware ioctl CAPI_NCCI_GETUNIT - * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs) - * - * Revision 1.1 2000/03/03 16:48:38 calle - * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI) - * It is now possible to create a connection with a CAPI2.0 applikation - * and than to handle the data connection from /dev/capi/ (capifs) and also - * using async or sync PPP on this connection. - * The two major device number 190 and 191 are not confirmed yet, - * but I want to save the code in cvs, before I go on. - * - * */ void capifs_new_ncci(char type, unsigned int num, kdev_t device); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capiutil.c linux.20p9/drivers/isdn/avmb1/capiutil.c --- linux.vanilla/drivers/isdn/avmb1/capiutil.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capiutil.c Wed Jul 4 16:03:54 2001 @@ -1,91 +1,11 @@ /* - * $Id: capiutil.c,v 1.13.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: capiutil.c,v 1.13.6.3 2001/05/17 20:41:51 kai Exp $ * * CAPI 2.0 convert capi message to capi message struct * * From CAPI 2.0 Development Kit AVM 1995 (msg.c) * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capiutil.c,v $ - * Revision 1.13.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.13 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.12 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.11 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.10 1999/08/31 11:19:54 paul - * various spelling corrections (new checksums may be needed, Karsten!) - * - * Revision 1.9 1999/07/09 15:05:46 keil - * compat.h is now isdn_compat.h - * - * Revision 1.8 1999/07/01 15:26:37 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * Revision 1.7 1999/07/01 08:23:01 keil - * compatibility macros now in - * - * Revision 1.6 1997/11/04 06:12:12 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.5 1997/10/01 09:21:19 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.4 1997/08/10 07:43:55 calle - * forgot to export symbol capi_info2str for 2.1.x - * - * Revision 1.3 1997/05/18 09:24:18 calle - * added verbose disconnect reason reporting to avmb1. - * some fixes in capi20 interface. - * changed info messages for B1-PCI - * - * Revision 1.2 1997/03/05 21:22:13 fritz - * Fix: Symbols have to be exported unconditionally. - * - * Revision 1.1 1997/03/04 21:50:34 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 - * */ #include #include @@ -96,7 +16,7 @@ #include #include #include - +#include #include "capiutil.h" /* from CAPI2.0 DDK AVM Berlin GmbH */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/capiutil.h linux.20p9/drivers/isdn/avmb1/capiutil.h --- linux.vanilla/drivers/isdn/avmb1/capiutil.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/capiutil.h Wed Jul 4 16:03:54 2001 @@ -1,46 +1,11 @@ /* - * $Id: capiutil.h,v 1.5 2000/03/03 15:50:42 calle Exp $ + * $Id: capiutil.h,v 1.5.6.1 2001/05/17 20:41:51 kai Exp $ * * CAPI 2.0 defines & types * * From CAPI 2.0 Development Kit AVM 1995 (capi20.h) * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: capiutil.h,v $ - * Revision 1.5 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.4 1999/09/15 08:16:03 calle - * Implementation of 64Bit extention complete. - * - * Revision 1.3 1999/09/07 09:02:53 calle - * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and - * DATA_B3_IND is always directly after the CAPI message. The "Data" member - * ist never used inside the kernel. - * - * Revision 1.2 1997/05/18 09:24:19 calle - * added verbose disconnect reason reporting to avmb1. - * some fixes in capi20 interface. - * changed info messages for B1-PCI - * - * Revision 1.1 1997/03/04 21:50:35 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 __CAPIUTIL_H__ #define __CAPIUTIL_H__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/kcapi.c linux.20p9/drivers/isdn/avmb1/kcapi.c --- linux.vanilla/drivers/isdn/avmb1/kcapi.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/kcapi.c Wed Jul 4 16:03:54 2001 @@ -1,119 +1,10 @@ /* - * $Id: kcapi.c,v 1.21.6.2 2001/02/13 11:43:29 kai Exp $ + * $Id: kcapi.c,v 1.21.6.7 2001/06/09 15:14:15 kai Exp $ * * Kernel CAPI 2.0 Module * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: kcapi.c,v $ - * Revision 1.21.6.2 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.21.6.1 2000/12/10 23:39:19 kai - * in 2.4 we don't have tq_scheduler anymore. - * also add one supported card to hfc_pci.c - * (from main branch) - * - * Revision 1.21 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.20 2000/11/19 17:01:53 kai - * compatibility cleanup - part 2 - * - * Revision 1.19 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.18 2000/07/20 10:22:27 calle - * - Made procfs function cleaner and removed variable "begin". - * - * Revision 1.17 2000/04/21 13:00:56 calle - * Bugfix: driver_proc_info was also wrong. - * - * Revision 1.16 2000/04/21 12:38:42 calle - * Bugfix: error in proc_ functions, begin-off => off-begin - * - * Revision 1.15 2000/04/06 15:01:25 calle - * Bugfix: crash in capidrv.c when reseting a capi controller. - * - changed code order on remove of controller. - * - using tq_schedule for notifier in kcapi.c. - * - now using spin_lock_irqsave() and spin_unlock_irqrestore(). - * strange: sometimes even MP hang on unload of isdn.o ... - * - * Revision 1.14 2000/04/03 13:29:25 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.13 2000/03/03 15:50:42 calle - * - kernel CAPI: - * - Changed parameter "param" in capi_signal from __u32 to void *. - * - rewrote notifier handling in kcapi.c - * - new notifier NCCI_UP and NCCI_DOWN - * - User CAPI: - * - /dev/capi20 is now a cloning device. - * - middleware extentions prepared. - * - capidrv.c - * - locking of list operations and module count updates. - * - * Revision 1.12 2000/01/28 16:45:39 calle - * new manufacturer command KCAPI_CMD_ADDCARD (generic addcard), - * will search named driver and call the add_card function if one exist. - * - * Revision 1.11 1999/11/23 13:29:29 calle - * Bugfix: incoming capi message were never traced. - * - * Revision 1.10 1999/10/26 15:30:32 calle - * Generate error message if user want to add card, but driver module is - * not loaded. - * - * Revision 1.9 1999/10/11 22:04:12 keil - * COMPAT_NEED_UACCESS (no include in isdn_compat.h) - * - * Revision 1.8 1999/09/10 17:24:18 calle - * Changes for proposed standard for CAPI2.0: - * - AK148 "Linux Exention" - * - * Revision 1.7 1999/09/04 06:20:05 keil - * Changes from kernel set_current_state() - * - * Revision 1.6 1999/07/20 06:41:49 calle - * Bugfix: After the redesign of the AVM B1 driver, the driver didn't even - * compile, if not selected as modules. - * - * Revision 1.5 1999/07/09 15:05:48 keil - * compat.h is now isdn_compat.h - * - * Revision 1.4 1999/07/08 14:15:17 calle - * Forgot to count down ncards in drivercb_detach_ctr. - * - * Revision 1.3 1999/07/06 07:42:02 calle - * - changes in /proc interface - * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb. - * - * Revision 1.2 1999/07/05 15:09:52 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:42 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * */ #define CONFIG_AVMB1_COMPAT @@ -127,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -139,7 +31,7 @@ #include #endif -static char *revision = "$Revision: 1.21.6.2 $"; +static char *revision = "$Revision: 1.21.6.7 $"; /* ------------------------------------------------------------- */ @@ -814,7 +706,7 @@ } } /* - * ncci managment + * ncci management */ static void controllercb_new_ncci(struct capi_ctr * card, @@ -1235,14 +1127,12 @@ static __u16 capi_release(__u16 applid) { - struct sk_buff *skb; int i; if (!VALID_APPLID(applid) || APPL(applid)->releasing) return CAPI_ILLAPPNR; APPL(applid)->releasing++; - while ((skb = skb_dequeue(&APPL(applid)->recv_queue)) != 0) - kfree_skb(skb); + skb_queue_purge(&APPL(applid)->recv_queue); for (i = 0; i < CAPI_MAXCONTR; i++) { if (cards[i].cardstate != CARD_RUNNING) continue; @@ -1752,7 +1642,7 @@ static int __init kcapi_init(void) { char *p; - char rev[10]; + char rev[32]; MOD_INC_USE_COUNT; @@ -1766,17 +1656,18 @@ proc_capi_init(); - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(rev, p + 2, sizeof(rev)); + rev[sizeof(rev)-1] = 0; + if ((p = strchr(rev, '$')) != 0 && p > rev) + *(p-1) = 0; } else strcpy(rev, "1.0"); #ifdef MODULE - printk(KERN_NOTICE "CAPI-driver Rev%s: loaded\n", rev); + printk(KERN_NOTICE "CAPI-driver Rev %s: loaded\n", rev); #else - printk(KERN_NOTICE "CAPI-driver Rev%s: started\n", rev); + printk(KERN_NOTICE "CAPI-driver Rev %s: started\n", rev); #endif MOD_DEC_USE_COUNT; return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/t1isa.c linux.20p9/drivers/isdn/avmb1/t1isa.c --- linux.vanilla/drivers/isdn/avmb1/t1isa.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/t1isa.c Wed Jul 4 16:03:54 2001 @@ -1,95 +1,10 @@ /* - * $Id: t1isa.c,v 1.16.6.1 2001/02/13 11:43:29 kai Exp $ + * $Id: t1isa.c,v 1.16.6.6 2001/05/17 21:15:33 kai Exp $ * * Module for AVM T1 HEMA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: t1isa.c,v $ - * Revision 1.16.6.1 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.16 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.15 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.14 2000/10/10 17:44:19 kai - * changes from/for 2.2.18 - * - * Revision 1.13 2000/08/04 15:36:31 calle - * copied wrong from file to file :-( - * - * Revision 1.12 2000/08/04 12:20:08 calle - * - Fix unsigned/signed warning in the right way ... - * - * Revision 1.11 2000/04/03 13:29:25 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.10 2000/02/02 18:36:04 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.9 2000/01/25 14:37:39 calle - * new message after successfull detection including card revision and - * used resources. - * - * Revision 1.8 1999/11/05 16:38:01 calle - * Cleanups before kernel 2.4: - * - Changed all messages to use card->name or driver->name instead of - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.7 1999/09/15 08:16:03 calle - * Implementation of 64Bit extention complete. - * - * Revision 1.6 1999/09/07 09:02:53 calle - * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and - * DATA_B3_IND is always directly after the CAPI message. The "Data" member - * ist never used inside the kernel. - * - * Revision 1.5 1999/08/22 20:26:28 calle - * backported changes from kernel 2.3.14: - * - several #include "config.h" gone, others come. - * - "struct device" changed to "struct net_device" in 2.3.14, added a - * define in isdn_compat.h for older kernel versions. - * - * Revision 1.4 1999/07/09 15:05:50 keil - * compat.h is now isdn_compat.h - * - * Revision 1.3 1999/07/06 07:42:04 calle - * - changes in /proc interface - * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb. - * - * Revision 1.2 1999/07/05 15:09:54 calle - * - renamed "appl_release" to "appl_released". - * - version und profile data now cleared on controller reset - * - extended /proc interface, to allow driver and controller specific - * informations to include by driver hackers. - * - * Revision 1.1 1999/07/01 15:26:44 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * */ #include @@ -100,14 +15,16 @@ #include #include #include +#include #include +#include #include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.16.6.1 $"; +static char *revision = "$Revision: 1.16.6.6 $"; /* ------------------------------------------------------------- */ @@ -401,7 +318,7 @@ cli(); b1_setinterrupt(port, card->irq, card->cardtype); b1_put_byte(port, SEND_INIT); - b1_put_word(port, AVM_NAPPS); + b1_put_word(port, CAPI_MAXAPPL); b1_put_word(port, AVM_NCCI_PER_CHANNEL*30); b1_put_word(port, ctrl->cnr - 1); restore_flags(flags); @@ -628,10 +545,11 @@ MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; } printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/avmb1/t1pci.c linux.20p9/drivers/isdn/avmb1/t1pci.c --- linux.vanilla/drivers/isdn/avmb1/t1pci.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/avmb1/t1pci.c Wed Jul 4 16:03:54 2001 @@ -1,77 +1,10 @@ /* - * $Id: t1pci.c,v 1.13.6.2 2001/02/13 11:43:29 kai Exp $ + * $Id: t1pci.c,v 1.13.6.5 2001/05/17 20:41:51 kai Exp $ * * Module for AVM T1 PCI-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: t1pci.c,v $ - * Revision 1.13.6.2 2001/02/13 11:43:29 kai - * more compatility changes for 2.2.19 - * - * Revision 1.13.6.1 2000/11/28 12:02:45 kai - * MODULE_DEVICE_TABLE for 2.4 - * - * Revision 1.13.2.2 2000/11/26 17:47:53 kai - * added PCI_DEV_TABLE for 2.4 - * - * Revision 1.13.2.1 2000/11/26 17:14:19 kai - * fix device ids - * also needs patches to include/linux/pci_ids.h - * - * Revision 1.13 2000/11/23 20:45:14 kai - * fixed module_init/exit stuff - * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. - * - * Revision 1.12 2000/11/01 14:05:02 calle - * - use module_init/module_exit from linux/init.h. - * - all static struct variables are initialized with "membername:" now. - * - avm_cs.c, let it work with newer pcmcia-cs. - * - * Revision 1.11 2000/08/08 09:24:19 calle - * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI - * - * Revision 1.10 2000/07/20 10:21:21 calle - * Bugfix: driver will not be unregistered, if not cards were detected. - * this result in an oops in kcapi.c - * - * Revision 1.9 2000/05/19 15:43:22 calle - * added calls to pci_device_start(). - * - * Revision 1.8 2000/05/06 00:52:36 kai - * merged changes from kernel tree - * fixed timer and net_device->name breakage - * - * Revision 1.7 2000/04/07 15:26:55 calle - * better error message if cabel not connected or T1 has no power. - * - * Revision 1.6 2000/04/03 13:29:25 calle - * make Tim Waugh happy (module unload races in 2.3.99-pre3). - * no real problem there, but now it is much cleaner ... - * - * Revision 1.5 2000/02/02 18:36:04 calle - * - Modules are now locked while init_module is running - * - fixed problem with memory mapping if address is not aligned - * - * Revision 1.4 2000/01/25 14:33:38 calle - * - Added Support AVM B1 PCI V4.0 (tested with prototype) - * - splitted up t1pci.c into b1dma.c for common function with b1pciv4 - * - support for revision register - * - * 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 - * constant string. - * - Moved some data from struct avmcard into new struct avmctrl_info. - * Changed all lowlevel capi driver to match the new structur. - * - * Revision 1.1 1999/10/26 15:31:42 calle - * Added driver for T1-PCI card. - * - * */ #include @@ -92,7 +25,7 @@ #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.13.6.2 $"; +static char *revision = "$Revision: 1.13.6.5 $"; #undef CONFIG_T1PCI_DEBUG #undef CONFIG_T1PCI_POLLDEBUG @@ -116,7 +49,7 @@ di->detach_ctr(ctrl); free_irq(card->irq, card); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); ctrl->driverdata = 0; kfree(card->ctrlinfo); @@ -130,7 +63,6 @@ static int t1pci_add_card(struct capi_driver *driver, struct capicardparams *p) { - unsigned long base, page_offset; avmcard *card; avmctrl_info *cinfo; int retval; @@ -181,12 +113,8 @@ return -EBUSY; } - base = card->membase & PAGE_MASK; - page_offset = card->membase - base; - card->mbase = ioremap_nocache(base, page_offset + 64); - if (card->mbase) { - card->mbase += page_offset; - } else { + card->mbase = ioremap_nocache(card->membase, 64); + if (!card->mbase) { printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n", driver->name, card->membase); kfree(card->ctrlinfo); @@ -205,7 +133,7 @@ else printk(KERN_NOTICE "%s: card at 0x%x, but cabel not connected or T1 has no power (%d)\n", driver->name, card->port, retval); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); kfree(card->ctrlinfo); kfree(card->dma); kfree(card); @@ -220,7 +148,7 @@ if (retval) { printk(KERN_ERR "%s: unable to get IRQ %d.\n", driver->name, card->irq); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); release_region(card->port, AVMB1_PORTLEN); kfree(card->ctrlinfo); kfree(card->dma); @@ -232,7 +160,7 @@ cinfo->capi_ctrl = di->attach_ctr(driver, card->name, cinfo); if (!cinfo->capi_ctrl) { printk(KERN_ERR "%s: attach controller failed.\n", driver->name); - iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK)); + iounmap(card->mbase); free_irq(card->irq, card); release_region(card->port, AVMB1_PORTLEN); kfree(card->ctrlinfo); @@ -300,16 +228,16 @@ MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':'))) { - strncpy(driver->revision, p + 1, sizeof(driver->revision)); - p = strchr(driver->revision, '$'); - *p = 0; + if ((p = strchr(revision, ':')) != 0 && p[1]) { + strncpy(driver->revision, p + 2, sizeof(driver->revision)); + driver->revision[sizeof(driver->revision)-1] = 0; + if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision) + *(p-1) = 0; } printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision); di = attach_capi_driver(driver); - if (!di) { printk(KERN_ERR "%s: failed to attach capi_driver\n", driver->name); @@ -317,22 +245,20 @@ return -EIO; } -#ifdef CONFIG_PCI - if (!pci_present()) { - printk(KERN_ERR "%s: no PCI bus present\n", driver->name); - detach_capi_driver(driver); - MOD_DEC_USE_COUNT; - return -EIO; - } - while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, dev))) { struct capicardparams param; + if (pci_enable_device(dev) < 0) { + printk(KERN_ERR "%s: failed to enable AVM-T1-PCI\n", + driver->name); + continue; + } + pci_set_master(dev); + param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; param.irq = dev->irq; param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK; - printk(KERN_INFO "%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n", driver->name, param.port, param.irq, param.membase); @@ -341,9 +267,7 @@ printk(KERN_ERR "%s: no AVM-T1-PCI at i/o %#x, irq %d detected, mem %#x\n", driver->name, param.port, param.irq, param.membase); - detach_capi_driver(&t1pci_driver); - MOD_DEC_USE_COUNT; - return retval; + continue; } ncards++; } @@ -356,12 +280,7 @@ printk(KERN_ERR "%s: NO T1-PCI card detected\n", driver->name); detach_capi_driver(&t1pci_driver); MOD_DEC_USE_COUNT; - return -ESRCH; -#else - printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name); - MOD_DEC_USE_COUNT; - return -EIO; -#endif + return -ENODEV; } static void t1pci_exit(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/divert/isdn_divert.c linux.20p9/drivers/isdn/divert/isdn_divert.c --- linux.vanilla/drivers/isdn/divert/isdn_divert.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/divert/isdn_divert.c Wed Jul 4 16:03:54 2001 @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.c,v 1.6.6.1 2001/02/07 11:31:31 kai Exp $ + * $Id: isdn_divert.c,v 1.6.6.2 2001/02/16 16:43:25 kai Exp $ * * DSS1 main diversion supplementary handling for i4l. * @@ -290,7 +290,7 @@ /* insert a new rule before idx */ /********************************/ int insertrule(int idx, divert_rule *newrule) -{ struct deflect_struc *ds,*ds1; +{ struct deflect_struc *ds,*ds1=NULL; int flags; if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/bri.c linux.20p9/drivers/isdn/eicon/bri.c --- linux.vanilla/drivers/isdn/eicon/bri.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/bri.c Thu Jul 26 15:37:58 2001 @@ -21,8 +21,7 @@ * */ -#include - +#include "eicon.h" #include "sys.h" #include "idi.h" #include "divas.h" @@ -33,9 +32,6 @@ #include "adapter.h" #include "uxio.h" -#define PCI_COMMAND 0x04 -#define PCI_STATUS 0x06 -#define PCI_LATENCY 0x0D #define PCI_BADDR0 0x10 #define PCI_BADDR1 0x14 #define PCI_BADDR2 0x18 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/common.c linux.20p9/drivers/isdn/eicon/common.c --- linux.vanilla/drivers/isdn/eicon/common.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/common.c Thu Jul 26 15:37:58 2001 @@ -22,6 +22,7 @@ */ +#include "eicon.h" #include "sys.h" #include "idi.h" #include "constant.h" @@ -30,20 +31,12 @@ #include "pr_pc.h" #include "uxio.h" -#include - -#define MAX_ADDR_LEN #define DIVAS_LOAD_CMD 0x02 #define DIVAS_START_CMD 0x03 #define DIVAS_IRQ_RESET 0xC18 #define DIVAS_IRQ_RESET_VAL 0xFE -#define PCI_COMMAND 0x04 -#define PCI_STATUS 0x06 -#define PCI_LATENCY 0x0D -#define PCI_INTERRUPT 0x3C - #define TEST_INT_DIVAS 0x11 #define TEST_INT_DIVAS_BRI 0x12 #define TEST_INT_DIVAS_Q 0x13 @@ -82,7 +75,7 @@ void DIVA_DIDD_Read( DESCRIPTOR *table, int tablelength ) { - bzero(table, tablelength); + memset(table, 0, tablelength); if (tablelength > sizeof(DIDD_Table)) tablelength = sizeof(DIDD_Table); @@ -93,7 +86,7 @@ } if (tablelength > 0) - bcopy((caddr_t)DIDD_Table, (caddr_t)table, tablelength); + bcopy((void *)DIDD_Table, (void *)table, tablelength); return; } @@ -103,7 +96,7 @@ if (tablelength > sizeof(DIDD_Table)) tablelength = sizeof(DIDD_Table); - bcopy((caddr_t)table, (caddr_t)DIDD_Table, tablelength); + bcopy((void *)table, (void *)DIDD_Table, tablelength); return; } @@ -113,7 +106,7 @@ { DESCRIPTOR d[32]; - bzero(d, sizeof(d)); + memset(d, 0, sizeof(d)); d[0].type = IDI_DIMAINT; /* identify the DIMAINT entry */ d[0].channels = 0; /* zero channels associated with dimaint*/ @@ -482,7 +475,6 @@ int DivasCardNew(dia_card_t *card_info) { card_t *card; - byte b; static boolean_t first_call = TRUE; boolean_t NeedISRandReset = FALSE; @@ -571,10 +563,6 @@ return -1; } - b = card->cfg.irq; - - UxPciConfigWrite(card->hw, sizeof(b), PCI_INTERRUPT, &b); - if (card_info->card_type != DIA_CARD_TYPE_DIVA_SERVER_Q) { if ((*card->card_reset)(card)) @@ -674,7 +662,7 @@ return -1; } - bzero(card->e_tbl, sizeof(E_INFO) * num_entities); + memset(card->e_tbl, 0, sizeof(E_INFO) * num_entities); card->e_max = num_entities; DIVA_DIDD_Read(d, sizeof(d)); @@ -861,7 +849,7 @@ { int i; - bzero(card_list, sizeof(dia_card_list_t)); + memset(card_list, 0, sizeof(dia_card_list_t)); for(i = 0; i < DivasCardNext; i++) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/eicon.h linux.20p9/drivers/isdn/eicon/eicon.h --- linux.vanilla/drivers/isdn/eicon/eicon.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/eicon.h Wed Aug 8 22:44:26 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon.h,v 1.23.6.2 2001/02/13 11:43:30 kai Exp $ +/* $Id: eicon.h,v 1.23.6.4 2001/06/09 15:14:16 kai Exp $ * * ISDN low-level module for Eicon active ISDN-Cards. * @@ -147,6 +147,7 @@ #include #include #include +#include #include #include diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/eicon_idi.c linux.20p9/drivers/isdn/eicon/eicon_idi.c --- linux.vanilla/drivers/isdn/eicon/eicon_idi.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/eicon_idi.c Wed Jul 4 16:03:54 2001 @@ -2221,7 +2221,10 @@ static char *connmsg[] = {"", "V.21", "V.23", "V.22", "V.22bis", "V.32bis", "V.34", "V.8", "Bell 212A", "Bell 103", "V.29 Leased", "V.33 Leased", "V.90", - "V.21 CH2", "V.27ter", "V.29", "V.33", "V.17"}; + "V.21 CH2", "V.27ter", "V.29", "V.33", "V.17", "V.32", "K56Flex", + "X2", "V.18", "V.18LH", "V.18HL", "V.21LH", "V.21HL", + "Bell 103LH", "Bell 103HL", "V.23", "V.23", "EDT 110", + "Baudot45", "Baudot47", "Baudot50", "DTMF" }; static u_char dtmf_code[] = { '1','4','7','*','2','5','8','0','3','6','9','#','A','B','C','D' }; @@ -2243,7 +2246,11 @@ cmd.driver = ccard->myid; cmd.command = ISDN_STAT_BCONN; cmd.arg = chan->No; - sprintf(cmd.parm.num, "%d/%s", p->speed, connmsg[p->norm]); + if (p->norm > 34) { + sprintf(cmd.parm.num, "%d/(%d)", p->speed, p->norm); + } else { + sprintf(cmd.parm.num, "%d/%s", p->speed, connmsg[p->norm]); + } ccard->interface.statcallb(&cmd); } eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DCD_ON time %d\n", chan->No, p->time); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/eicon_mod.c linux.20p9/drivers/isdn/eicon/eicon_mod.c --- linux.vanilla/drivers/isdn/eicon/eicon_mod.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/eicon_mod.c Thu Jul 26 15:37:58 2001 @@ -1,4 +1,4 @@ -/* $Id: eicon_mod.c,v 1.37.6.4 2001/02/16 09:09:50 armin Exp $ +/* $Id: eicon_mod.c,v 1.37.6.5 2001/07/17 19:42:31 armin Exp $ * * ISDN lowlevel-module for Eicon active cards. * @@ -55,7 +55,7 @@ static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains start of card-list */ -static char *eicon_revision = "$Revision: 1.37.6.4 $"; +static char *eicon_revision = "$Revision: 1.37.6.5 $"; extern char *eicon_pci_revision; extern char *eicon_isa_revision; @@ -1200,24 +1200,16 @@ static void eicon_freecard(eicon_card *card) { int i; - struct sk_buff *skb; for(i = 0; i < (card->nchannels + 1); i++) { - while((skb = skb_dequeue(&card->bch[i].e.X))) - dev_kfree_skb(skb); - while((skb = skb_dequeue(&card->bch[i].e.R))) - dev_kfree_skb(skb); + skb_queue_purge(&card->bch[i].e.X); + skb_queue_purge(&card->bch[i].e.R); } - while((skb = skb_dequeue(&card->sndq))) - dev_kfree_skb(skb); - while((skb = skb_dequeue(&card->rcvq))) - dev_kfree_skb(skb); - while((skb = skb_dequeue(&card->rackq))) - dev_kfree_skb(skb); - while((skb = skb_dequeue(&card->sackq))) - dev_kfree_skb(skb); - while((skb = skb_dequeue(&card->statq))) - dev_kfree_skb(skb); + skb_queue_purge(&card->sndq); + skb_queue_purge(&card->rcvq); + skb_queue_purge(&card->rackq); + skb_queue_purge(&card->sackq); + skb_queue_purge(&card->statq); #ifdef CONFIG_ISDN_DRV_EICON_PCI kfree(card->sbufp); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/idi.h linux.20p9/drivers/isdn/eicon/idi.h --- linux.vanilla/drivers/isdn/eicon/idi.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/idi.h Thu Jul 26 18:24:54 2001 @@ -62,7 +62,7 @@ struct postcall_s { word command; /* command = 0x0300 */ word dummy; /* not used */ - IDI_CALL callback; /* routine adress to call back */ + IDI_CALL callback; /* routine address to call back */ ENTITY *contxt; /* ptr to entity to use */ }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/kprintf.c linux.20p9/drivers/isdn/eicon/kprintf.c --- linux.vanilla/drivers/isdn/eicon/kprintf.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/kprintf.c Thu Jul 26 15:37:58 2001 @@ -27,14 +27,12 @@ */ +#include "eicon.h" #include "sys.h" #include #undef MAX #undef MIN -#include -#include - #include "divas.h" #include "divalog.h" #include "uxio.h" @@ -512,7 +510,7 @@ /* clear log entry */ - bzero((caddr_t) &log, sizeof(klog_t)); + memset((void *) &log, 0, sizeof(klog_t)); log.card = -1; log.type = KLOG_TEXT_MSG; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/lincfg.c linux.20p9/drivers/isdn/eicon/lincfg.c --- linux.vanilla/drivers/isdn/eicon/lincfg.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/lincfg.c Thu Jul 26 15:37:58 2001 @@ -43,12 +43,6 @@ #include #include -#define HW_ID_EICON_PCI 0x1133 -#define HW_ID_DIVA_SERVER_P 0xE014 -#define HW_ID_DIVA_SERVER_B_ST 0xE010 -#define HW_ID_DIVA_SERVER_B_U 0xE013 -#define HW_ID_DIVA_SERVER_Q 0xE012 - struct file_operations Divas_fops; int Divas_major; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/linsys.c linux.20p9/drivers/isdn/eicon/linsys.c --- linux.vanilla/drivers/isdn/eicon/linsys.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/linsys.c Thu Jul 26 15:37:58 2001 @@ -45,11 +45,6 @@ } #endif -void bzero(void *pDataArea, dword dwLength) -{ - memset(pDataArea, 0, dwLength); -} - int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg) { /* Use UxPciConfigWrite routines to initialise PCI config space */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/log.c linux.20p9/drivers/isdn/eicon/log.c --- linux.vanilla/drivers/isdn/eicon/log.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/log.c Thu Jul 26 15:37:58 2001 @@ -96,7 +96,7 @@ } m_count++; - bzero(new_klog,sizeof(KNODE)); + memset(new_klog, 0, sizeof(KNODE)); /* Set head & tail to point to the new Msg Struct */ head=tail=new_klog; @@ -112,7 +112,7 @@ } m_count++; - bzero(new_klog,sizeof(KNODE)); + memset(new_klog, 0, sizeof(KNODE)); /* Let last Msg Struct point to new Msg Struct & inc tail */ tail->next=new_klog; @@ -155,7 +155,7 @@ { klog_t klog; - bzero(&klog, sizeof(klog)); + memset(&klog, 0, sizeof(klog)); klog.time_stamp = UxTimeGet(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/uxio.h linux.20p9/drivers/isdn/eicon/uxio.h --- linux.vanilla/drivers/isdn/eicon/uxio.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/uxio.h Thu Jul 26 18:24:54 2001 @@ -59,7 +59,6 @@ }; void bcopy(void *pSource, void *pDest, dword dwLength); -void bzero(void *pDataArea, dword dwLength); /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/eicon/xlog.c linux.20p9/drivers/isdn/eicon/xlog.c --- linux.vanilla/drivers/isdn/eicon/xlog.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/eicon/xlog.c Thu Jul 26 15:37:58 2001 @@ -59,7 +59,7 @@ x = (card_xlog_t *) b; - bzero(&klog, sizeof(klog)); + memset(&klog, 0, sizeof(klog)); klog.time_stamp = (dword) x->time_hi; klog.time_stamp = (klog.time_stamp << 16) | (dword) x->time_lo; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/amd7930.c linux.20p9/drivers/isdn/hisax/amd7930.c --- linux.vanilla/drivers/isdn/hisax/amd7930.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/amd7930.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: amd7930.c,v 1.5 2000/11/24 17:05:37 kai Exp $ +/* $Id: amd7930.c,v 1.5.6.3 2001/06/11 22:08:37 kai Exp $ * * HiSax ISDN driver - chip specific routines for AMD 7930 * @@ -14,7 +14,7 @@ * * The code is unreliable enough to be consider alpha * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the * SparcStation 1+. The chip provides microphone and speaker interfaces @@ -94,7 +94,7 @@ #include "rawhdlc.h" #include -static const char *amd7930_revision = "$Revision: 1.5 $"; +static const char *amd7930_revision = "$Revision: 1.5.6.3 $"; #define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */ #define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into @@ -362,12 +362,8 @@ amd7930_bclose(0, bcs->channel); if (test_bit(BC_FLG_INIT, &bcs->Flag)) { - while ((skb = skb_dequeue(&bcs->rqueue))) { - dev_kfree_skb(skb); - } - while ((skb = skb_dequeue(&bcs->squeue))) { - dev_kfree_skb(skb); - } + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); } test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/arcofi.c linux.20p9/drivers/isdn/hisax/arcofi.c --- linux.vanilla/drivers/isdn/hisax/arcofi.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/arcofi.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: arcofi.c,v 1.12 2000/11/25 17:01:00 kai Exp $ +/* $Id: arcofi.c,v 1.12.6.1 2001/02/16 16:43:25 kai Exp $ * * arcofi.c Ansteuerung ARCOFI 2165 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/arcofi.h linux.20p9/drivers/isdn/hisax/arcofi.h --- linux.vanilla/drivers/isdn/hisax/arcofi.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/arcofi.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: arcofi.h,v 1.6 2000/06/26 08:59:12 keil Exp $ +/* $Id: arcofi.h,v 1.6.6.1 2001/02/16 16:43:25 kai Exp $ * * arcofi.h Ansteuerung ARCOFI 2165 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/asuscom.c linux.20p9/drivers/isdn/hisax/asuscom.c --- linux.vanilla/drivers/isdn/hisax/asuscom.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/asuscom.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: asuscom.c,v 1.11 2000/11/24 17:05:37 kai Exp $ +/* $Id: asuscom.c,v 1.11.6.1 2001/02/16 16:43:25 kai Exp $ * * asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards * @@ -6,7 +6,7 @@ * * Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -20,7 +20,7 @@ extern const char *CardType[]; -const char *Asuscom_revision = "$Revision: 1.11 $"; +const char *Asuscom_revision = "$Revision: 1.11.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/avm_a1.c linux.20p9/drivers/isdn/hisax/avm_a1.c --- linux.vanilla/drivers/isdn/hisax/avm_a1.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/avm_a1.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: avm_a1.c,v 2.13 2000/11/24 17:05:37 kai Exp $ +/* $Id: avm_a1.c,v 2.13.6.1 2001/02/16 16:43:25 kai Exp $ * * avm_a1.c low level stuff for AVM A1 (Fritz) isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -15,7 +15,7 @@ #include "isdnl1.h" extern const char *CardType[]; -static const char *avm_revision = "$Revision: 2.13 $"; +static const char *avm_revision = "$Revision: 2.13.6.1 $"; #define AVM_A1_STAT_ISAC 0x01 #define AVM_A1_STAT_HSCX 0x02 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/avm_a1p.c linux.20p9/drivers/isdn/hisax/avm_a1p.c --- linux.vanilla/drivers/isdn/hisax/avm_a1p.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/avm_a1p.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: avm_a1p.c,v 2.7 2000/11/24 17:05:37 kai Exp $ +/* $Id: avm_a1p.c,v 2.7.6.1 2001/02/16 16:43:25 kai Exp $ * * avm_a1p.c low level stuff for the following AVM cards: * A1 PCMCIA @@ -7,7 +7,7 @@ * * Author Carsten Paeth (calle@calle.in-berlin.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License */ #define __NO_VERSION__ #include @@ -53,7 +53,7 @@ #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) -static const char *avm_revision = "$Revision: 2.7 $"; +static const char *avm_revision = "$Revision: 2.7.6.1 $"; static inline u_char ReadISAC(struct IsdnCardState *cs, u_char offset) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/avm_pci.c linux.20p9/drivers/isdn/hisax/avm_pci.c --- linux.vanilla/drivers/isdn/hisax/avm_pci.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/avm_pci.c Wed Jul 4 16:03:54 2001 @@ -1,11 +1,11 @@ -/* $Id: avm_pci.c,v 1.22.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: avm_pci.c,v 1.22.6.5 2001/06/09 15:14:16 kai Exp $ * * avm_pci.c low level stuff for AVM Fritz!PCI and ISA PnP isdn cards * Thanks to AVM, Berlin for informations * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -19,7 +19,7 @@ #include extern const char *CardType[]; -static const char *avm_pci_rev = "$Revision: 1.22.6.3 $"; +static const char *avm_pci_rev = "$Revision: 1.22.6.5 $"; #define AVM_FRITZ_PCI 1 #define AVM_FRITZ_PNP 2 @@ -592,8 +592,8 @@ kfree(bcs->blog); bcs->blog = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/bkm_a4t.c linux.20p9/drivers/isdn/hisax/bkm_a4t.c --- linux.vanilla/drivers/isdn/hisax/bkm_a4t.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/bkm_a4t.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: bkm_a4t.c,v 1.13.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: bkm_a4t.c,v 1.13.6.4 2001/02/16 16:43:25 kai Exp $ * bkm_a4t.c low level stuff for T-Berkom A4T * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -6,7 +6,7 @@ * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -25,7 +25,7 @@ extern const char *CardType[]; -const char *bkm_a4t_revision = "$Revision: 1.13.6.3 $"; +const char *bkm_a4t_revision = "$Revision: 1.13.6.4 $"; static inline u_char diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/bkm_a8.c linux.20p9/drivers/isdn/hisax/bkm_a8.c --- linux.vanilla/drivers/isdn/hisax/bkm_a8.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/bkm_a8.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: bkm_a8.c,v 1.14.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: bkm_a8.c,v 1.14.6.5 2001/04/15 14:51:09 keil Exp $ * bkm_a8.c low level stuff for Scitel Quadro (4*S0, passive) * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -6,7 +6,7 @@ * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -28,7 +28,7 @@ extern const char *CardType[]; -const char sct_quadro_revision[] = "$Revision: 1.14.6.3 $"; +const char sct_quadro_revision[] = "$Revision: 1.14.6.5 $"; static const char *sct_quadro_subtypes[] = { @@ -206,9 +206,9 @@ void release_io_sct_quadro(struct IsdnCardState *cs) { - release_region(cs->hw.ax.base & 0xffffffc0, 256); + release_region(cs->hw.ax.base & 0xffffffc0, 128); if (cs->subtyp == SCT_1) - release_region(cs->hw.ax.plx_adr, 256); + release_region(cs->hw.ax.plx_adr, 64); } static void @@ -404,9 +404,9 @@ switch(cs->subtyp) { case 1: cs->hw.ax.base = pci_ioaddr5 + 0x00; - if (sct_alloc_io(pci_ioaddr1, 256)) + if (sct_alloc_io(pci_ioaddr1, 128)) return(0); - if (sct_alloc_io(pci_ioaddr5, 256)) + if (sct_alloc_io(pci_ioaddr5, 64)) return(0); /* disable all IPAC */ writereg(pci_ioaddr5, pci_ioaddr5 + 4, @@ -420,17 +420,17 @@ break; case 2: cs->hw.ax.base = pci_ioaddr4 + 0x08; - if (sct_alloc_io(pci_ioaddr4, 256)) + if (sct_alloc_io(pci_ioaddr4, 64)) return(0); break; case 3: cs->hw.ax.base = pci_ioaddr3 + 0x10; - if (sct_alloc_io(pci_ioaddr3, 256)) + if (sct_alloc_io(pci_ioaddr3, 64)) return(0); break; case 4: cs->hw.ax.base = pci_ioaddr2 + 0x20; - if (sct_alloc_io(pci_ioaddr2, 256)) + if (sct_alloc_io(pci_ioaddr2, 64)) return(0); break; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/bkm_ax.h linux.20p9/drivers/isdn/hisax/bkm_ax.h --- linux.vanilla/drivers/isdn/hisax/bkm_ax.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/bkm_ax.h Wed Jul 4 16:03:54 2001 @@ -1,9 +1,9 @@ -/* $Id: bkm_ax.h,v 1.5.6.1 2000/11/28 12:02:46 kai Exp $ +/* $Id: bkm_ax.h,v 1.5.6.2 2001/02/16 16:43:25 kai Exp $ * bkm_ax.h low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive) * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/callc.c linux.20p9/drivers/isdn/hisax/callc.c --- linux.vanilla/drivers/isdn/hisax/callc.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/callc.c Wed Jul 4 16:03:54 2001 @@ -1,9 +1,9 @@ -/* $Id: callc.c,v 2.51 2000/11/24 17:05:37 kai Exp $ +/* $Id: callc.c,v 2.51.6.4 2001/06/09 15:14:17 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -20,7 +20,7 @@ #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module)) #endif /* MODULE */ -const char *lli_revision = "$Revision: 2.51 $"; +const char *lli_revision = "$Revision: 2.51.6.4 $"; extern struct IsdnCard cards[]; extern int nrcards; @@ -66,19 +66,6 @@ return (struct IsdnCardState *) 0; } -int -discard_queue(struct sk_buff_head *q) -{ - struct sk_buff *skb; - int ret=0; - - while ((skb = skb_dequeue(q))) { - dev_kfree_skb(skb); - ret++; - } - return(ret); -} - static void link_debug(struct Channel *chanp, int direction, char *fmt, ...) { @@ -337,7 +324,7 @@ * RESUME */ -/* incomming call */ +/* incoming call */ static void lli_deliver_call(struct FsmInst *fi, int event, void *arg) @@ -850,14 +837,14 @@ #define FNCOUNT (sizeof(fnlist)/sizeof(struct FsmNode)) -void __init +int __init CallcNew(void) { callcfsm.state_count = STATE_COUNT; callcfsm.event_count = EVENT_COUNT; callcfsm.strEvent = strEvent; callcfsm.strState = strState; - FsmNew(&callcfsm, fnlist, FNCOUNT); + return FsmNew(&callcfsm, fnlist, FNCOUNT); } void @@ -1026,9 +1013,11 @@ printk(KERN_WARNING"call to dummy_pstack pr=%04x arg %lx\n", pr, (long)arg); } -static void +static int init_PStack(struct PStack **stp) { *stp = kmalloc(sizeof(struct PStack), GFP_ATOMIC); + if (!*stp) + return -ENOMEM; (*stp)->next = NULL; (*stp)->l1.l1l2 = dummy_pstack; (*stp)->l1.l1hw = dummy_pstack; @@ -1041,16 +1030,20 @@ (*stp)->l3.l3l4 = dummy_pstack; (*stp)->lli.l4l3 = dummy_pstack; (*stp)->ma.layer = dummy_pstack; + return 0; } -static void +static int init_d_st(struct Channel *chanp) { struct PStack *st; struct IsdnCardState *cs = chanp->cs; char tmp[16]; + int err; - init_PStack(&chanp->d_st); + err = init_PStack(&chanp->d_st); + if (err) + return err; st = chanp->d_st; st->next = NULL; HiSax_addlist(cs, st); @@ -1075,6 +1068,8 @@ st->lli.userdata = chanp; st->lli.l2writewakeup = NULL; st->l3.l3l4 = dchan_l3l4; + + return 0; } static void @@ -1090,10 +1085,11 @@ va_end(args); } -static void +static int init_chan(int chan, struct IsdnCardState *csta) { struct Channel *chanp = csta->channel + chan; + int err; chanp->cs = csta; chanp->bcs = csta->bcs + chan; @@ -1102,7 +1098,9 @@ chanp->debug = 0; chanp->Flags = 0; chanp->leased = 0; - init_PStack(&chanp->b_st); + err = init_PStack(&chanp->b_st); + if (err) + return err; chanp->b_st->l1.delay = DEFAULT_B_DELAY; chanp->fi.fsm = &callcfsm; chanp->fi.state = ST_NULL; @@ -1112,31 +1110,41 @@ FsmInitTimer(&chanp->fi, &chanp->dial_timer); FsmInitTimer(&chanp->fi, &chanp->drel_timer); if (!chan || (test_bit(FLG_TWO_DCHAN, &csta->HW_Flags) && chan < 2)) { - init_d_st(chanp); + err = init_d_st(chanp); + if (err) + return err; } else { chanp->d_st = csta->channel->d_st; } chanp->data_open = 0; + return 0; } int CallcNewChan(struct IsdnCardState *csta) { - int i; + int i, err; chancount += 2; - init_chan(0, csta); - init_chan(1, csta); + err = init_chan(0, csta); + if (err) + return err; + err = init_chan(1, csta); + if (err) + return err; printk(KERN_INFO "HiSax: 2 channels added\n"); - for (i = 0; i < MAX_WAITING_CALLS; i++) - init_chan(i+2,csta); + for (i = 0; i < MAX_WAITING_CALLS; i++) { + err = init_chan(i+2,csta); + if (err) + return err; + } printk(KERN_INFO "HiSax: MAX_WAITING_CALLS added\n"); if (test_bit(FLG_PTP, &csta->channel->d_st->l2.flag)) { printk(KERN_INFO "LAYER2 WATCHING ESTABLISH\n"); csta->channel->d_st->lli.l4l3(csta->channel->d_st, DL_ESTABLISH | REQUEST, NULL); } - return (2); + return (0); } static void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/cert.c linux.20p9/drivers/isdn/hisax/cert.c --- linux.vanilla/drivers/isdn/hisax/cert.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/cert.c Wed Jul 4 16:03:54 2001 @@ -1,8 +1,8 @@ -/* $Id: cert.c,v 2.3 2000/06/26 08:59:12 keil Exp $ +/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/config.c linux.20p9/drivers/isdn/hisax/config.c --- linux.vanilla/drivers/isdn/hisax/config.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/config.c Wed Jul 4 16:03:54 2001 @@ -1,9 +1,9 @@ -/* $Id: config.c,v 2.57.6.9 2001/02/13 10:33:58 kai Exp $ +/* $Id: config.c,v 2.57.6.15 2001/06/09 15:14:17 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -436,7 +436,7 @@ } #ifndef MODULE -void __init +static void __init HiSax_setup(char *str, int *ints) { int i, j, argc; @@ -829,8 +829,8 @@ csta->bcs->BC_Close(csta->bcs); } - discard_queue(&csta->rq); - discard_queue(&csta->sq); + skb_queue_purge(&csta->rq); + skb_queue_purge(&csta->sq); if (csta->rcvbuf) { kfree(csta->rcvbuf); csta->rcvbuf = NULL; @@ -906,13 +906,12 @@ save_flags(flags); cli(); - if (!(cs = (struct IsdnCardState *) - kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC))) { + cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); + if (!cs) { printk(KERN_WARNING "HiSax: No memory for IsdnCardState(card %d)\n", cardnr + 1); - restore_flags(flags); - return (0); + goto out; } memset(cs, 0, sizeof(struct IsdnCardState)); card->cs = cs; @@ -931,241 +930,235 @@ #endif cs->protocol = card->protocol; - if ((card->typ > 0) && (card->typ <= ISDN_CTYPE_COUNT)) { - if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) { - printk(KERN_WARNING - "HiSax: No memory for dlog(card %d)\n", - cardnr + 1); - restore_flags(flags); - return (0); - } - if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) { - printk(KERN_WARNING - "HiSax: No memory for status_buf(card %d)\n", - cardnr + 1); - kfree(cs->dlog); - restore_flags(flags); - return (0); - } - cs->stlist = NULL; - cs->status_read = cs->status_buf; - cs->status_write = cs->status_buf; - cs->status_end = cs->status_buf + HISAX_STATUS_BUFSIZE - 1; - cs->typ = card->typ; - strcpy(cs->iif.id, id); - cs->iif.channels = 2; - cs->iif.maxbufsize = MAX_DATA_SIZE; - cs->iif.hl_hdrlen = MAX_HEADER_LEN; - cs->iif.features = - ISDN_FEATURE_L2_X75I | - ISDN_FEATURE_L2_HDLC | - ISDN_FEATURE_L2_HDLC_56K | - ISDN_FEATURE_L2_TRANS | - ISDN_FEATURE_L3_TRANS | + if (card->typ <= 0 || card->typ > ISDN_CTYPE_COUNT) { + printk(KERN_WARNING + "HiSax: Card Type %d out of range\n", + card->typ); + goto outf_cs; + } + if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) { + printk(KERN_WARNING + "HiSax: No memory for dlog(card %d)\n", + cardnr + 1); + goto outf_cs; + } + if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) { + printk(KERN_WARNING + "HiSax: No memory for status_buf(card %d)\n", + cardnr + 1); + goto outf_dlog; + } + cs->stlist = NULL; + cs->status_read = cs->status_buf; + cs->status_write = cs->status_buf; + cs->status_end = cs->status_buf + HISAX_STATUS_BUFSIZE - 1; + cs->typ = card->typ; + strcpy(cs->iif.id, id); + cs->iif.channels = 2; + cs->iif.maxbufsize = MAX_DATA_SIZE; + cs->iif.hl_hdrlen = MAX_HEADER_LEN; + cs->iif.features = + ISDN_FEATURE_L2_X75I | + ISDN_FEATURE_L2_HDLC | + ISDN_FEATURE_L2_HDLC_56K | + ISDN_FEATURE_L2_TRANS | + ISDN_FEATURE_L3_TRANS | #ifdef CONFIG_HISAX_1TR6 - ISDN_FEATURE_P_1TR6 | + ISDN_FEATURE_P_1TR6 | #endif #ifdef CONFIG_HISAX_EURO - ISDN_FEATURE_P_EURO | + ISDN_FEATURE_P_EURO | #endif #ifdef CONFIG_HISAX_NI1 - ISDN_FEATURE_P_NI1 | + ISDN_FEATURE_P_NI1 | #endif - 0; - - cs->iif.command = HiSax_command; - cs->iif.writecmd = NULL; - cs->iif.writebuf_skb = HiSax_writebuf_skb; - cs->iif.readstat = HiSax_readstatus; - register_isdn(&cs->iif); - cs->myid = cs->iif.channels; - printk(KERN_INFO - "HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1, - (card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" : - (card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" : - (card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" : - (card->protocol == ISDN_PTYPE_NI1) ? "NI1" : - "NONE", cs->iif.id, cs->myid); - switch (card->typ) { + 0; + + cs->iif.command = HiSax_command; + cs->iif.writecmd = NULL; + cs->iif.writebuf_skb = HiSax_writebuf_skb; + cs->iif.readstat = HiSax_readstatus; + register_isdn(&cs->iif); + cs->myid = cs->iif.channels; + printk(KERN_INFO + "HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1, + (card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" : + (card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" : + (card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" : + (card->protocol == ISDN_PTYPE_NI1) ? "NI1" : + "NONE", cs->iif.id, cs->myid); + switch (card->typ) { #if CARD_TELES0 - case ISDN_CTYPE_16_0: - case ISDN_CTYPE_8_0: - ret = setup_teles0(card); - break; + case ISDN_CTYPE_16_0: + case ISDN_CTYPE_8_0: + ret = setup_teles0(card); + break; #endif #if CARD_TELES3 - case ISDN_CTYPE_16_3: - case ISDN_CTYPE_PNP: - case ISDN_CTYPE_TELESPCMCIA: - case ISDN_CTYPE_COMPAQ_ISA: - ret = setup_teles3(card); - break; + case ISDN_CTYPE_16_3: + case ISDN_CTYPE_PNP: + case ISDN_CTYPE_TELESPCMCIA: + case ISDN_CTYPE_COMPAQ_ISA: + ret = setup_teles3(card); + break; #endif #if CARD_S0BOX - case ISDN_CTYPE_S0BOX: - ret = setup_s0box(card); - break; + case ISDN_CTYPE_S0BOX: + ret = setup_s0box(card); + break; #endif #if CARD_TELESPCI - case ISDN_CTYPE_TELESPCI: - ret = setup_telespci(card); - break; + case ISDN_CTYPE_TELESPCI: + ret = setup_telespci(card); + break; #endif #if CARD_AVM_A1 - case ISDN_CTYPE_A1: - ret = setup_avm_a1(card); - break; + case ISDN_CTYPE_A1: + ret = setup_avm_a1(card); + break; #endif #if CARD_AVM_A1_PCMCIA - case ISDN_CTYPE_A1_PCMCIA: - ret = setup_avm_a1_pcmcia(card); - break; + case ISDN_CTYPE_A1_PCMCIA: + ret = setup_avm_a1_pcmcia(card); + break; #endif #if CARD_FRITZPCI - case ISDN_CTYPE_FRITZPCI: - ret = setup_avm_pcipnp(card); - break; + case ISDN_CTYPE_FRITZPCI: + ret = setup_avm_pcipnp(card); + break; #endif #if CARD_ELSA - case ISDN_CTYPE_ELSA: - case ISDN_CTYPE_ELSA_PNP: - case ISDN_CTYPE_ELSA_PCMCIA: - case ISDN_CTYPE_ELSA_PCI: - ret = setup_elsa(card); - break; + case ISDN_CTYPE_ELSA: + case ISDN_CTYPE_ELSA_PNP: + case ISDN_CTYPE_ELSA_PCMCIA: + case ISDN_CTYPE_ELSA_PCI: + ret = setup_elsa(card); + break; #endif #if CARD_IX1MICROR2 - case ISDN_CTYPE_IX1MICROR2: - ret = setup_ix1micro(card); - break; + case ISDN_CTYPE_IX1MICROR2: + ret = setup_ix1micro(card); + break; #endif #if CARD_DIEHLDIVA - case ISDN_CTYPE_DIEHLDIVA: - ret = setup_diva(card); - break; + case ISDN_CTYPE_DIEHLDIVA: + ret = setup_diva(card); + break; #endif #if CARD_ASUSCOM - case ISDN_CTYPE_ASUSCOM: - ret = setup_asuscom(card); - break; + case ISDN_CTYPE_ASUSCOM: + ret = setup_asuscom(card); + break; #endif #if CARD_TELEINT - case ISDN_CTYPE_TELEINT: - ret = setup_TeleInt(card); - break; + case ISDN_CTYPE_TELEINT: + ret = setup_TeleInt(card); + break; #endif #if CARD_SEDLBAUER - case ISDN_CTYPE_SEDLBAUER: - case ISDN_CTYPE_SEDLBAUER_PCMCIA: - case ISDN_CTYPE_SEDLBAUER_FAX: - ret = setup_sedlbauer(card); - break; + case ISDN_CTYPE_SEDLBAUER: + case ISDN_CTYPE_SEDLBAUER_PCMCIA: + case ISDN_CTYPE_SEDLBAUER_FAX: + ret = setup_sedlbauer(card); + break; #endif #if CARD_SPORTSTER - case ISDN_CTYPE_SPORTSTER: - ret = setup_sportster(card); - break; + case ISDN_CTYPE_SPORTSTER: + ret = setup_sportster(card); + break; #endif #if CARD_MIC - case ISDN_CTYPE_MIC: - ret = setup_mic(card); - break; + case ISDN_CTYPE_MIC: + ret = setup_mic(card); + break; #endif #if CARD_NETJET_S - case ISDN_CTYPE_NETJET_S: - ret = setup_netjet_s(card); - break; + case ISDN_CTYPE_NETJET_S: + ret = setup_netjet_s(card); + break; #endif #if CARD_HFCS - case ISDN_CTYPE_TELES3C: - case ISDN_CTYPE_ACERP10: - ret = setup_hfcs(card); - break; + case ISDN_CTYPE_TELES3C: + case ISDN_CTYPE_ACERP10: + ret = setup_hfcs(card); + break; #endif #if CARD_HFC_PCI - case ISDN_CTYPE_HFC_PCI: - ret = setup_hfcpci(card); - break; + case ISDN_CTYPE_HFC_PCI: + ret = setup_hfcpci(card); + break; #endif #if CARD_HFC_SX - case ISDN_CTYPE_HFC_SX: - ret = setup_hfcsx(card); - break; + case ISDN_CTYPE_HFC_SX: + ret = setup_hfcsx(card); + break; #endif #if CARD_NICCY - case ISDN_CTYPE_NICCY: - ret = setup_niccy(card); - break; + case ISDN_CTYPE_NICCY: + ret = setup_niccy(card); + break; #endif #if CARD_AMD7930 - case ISDN_CTYPE_AMD7930: - ret = setup_amd7930(card); - break; + case ISDN_CTYPE_AMD7930: + ret = setup_amd7930(card); + break; #endif #if CARD_ISURF - case ISDN_CTYPE_ISURF: - ret = setup_isurf(card); - break; + case ISDN_CTYPE_ISURF: + ret = setup_isurf(card); + break; #endif #if CARD_HSTSAPHIR - case ISDN_CTYPE_HSTSAPHIR: - ret = setup_saphir(card); - break; + case ISDN_CTYPE_HSTSAPHIR: + ret = setup_saphir(card); + break; #endif #if CARD_TESTEMU - case ISDN_CTYPE_TESTEMU: - ret = setup_testemu(card); - break; + case ISDN_CTYPE_TESTEMU: + ret = setup_testemu(card); + break; #endif #if CARD_BKM_A4T - case ISDN_CTYPE_BKM_A4T: - ret = setup_bkm_a4t(card); - break; + case ISDN_CTYPE_BKM_A4T: + ret = setup_bkm_a4t(card); + break; #endif #if CARD_SCT_QUADRO - case ISDN_CTYPE_SCT_QUADRO: - ret = setup_sct_quadro(card); - break; + case ISDN_CTYPE_SCT_QUADRO: + ret = setup_sct_quadro(card); + break; #endif #if CARD_GAZEL - case ISDN_CTYPE_GAZEL: - ret = setup_gazel(card); - break; + case ISDN_CTYPE_GAZEL: + ret = setup_gazel(card); + break; #endif #if CARD_W6692 - case ISDN_CTYPE_W6692: - ret = setup_w6692(card); - break; + case ISDN_CTYPE_W6692: + ret = setup_w6692(card); + break; #endif #if CARD_NETJET_U - case ISDN_CTYPE_NETJET_U: - ret = setup_netjet_u(card); - break; + case ISDN_CTYPE_NETJET_U: + ret = setup_netjet_u(card); + break; #endif - default: - printk(KERN_WARNING - "HiSax: Support for %s Card not selected\n", - CardType[card->typ]); - ll_unload(cs); - restore_flags(flags); - return (0); - } - } else { + default: printk(KERN_WARNING - "HiSax: Card Type %d out of range\n", - card->typ); - restore_flags(flags); - return (0); + "HiSax: Support for %s Card not selected\n", + CardType[card->typ]); + ll_unload(cs); + goto outf_cs; } if (!ret) { ll_unload(cs); - restore_flags(flags); - return (0); + goto outf_cs; } if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) { printk(KERN_WARNING "HiSax: No memory for isac rcvbuf\n"); - return (1); + ll_unload(cs); + goto outf_cs; } cs->rcvidx = 0; cs->tx_skb = NULL; @@ -1182,16 +1175,31 @@ ret = init_card(cs); if (ret) { closecard(cardnr); - restore_flags(flags); - return (0); + ret = 0; + goto outf_cs; } init_tei(cs, cs->protocol); - CallcNewChan(cs); + ret = CallcNewChan(cs); + if (ret) { + closecard(cardnr); + ret = 0; + goto outf_cs; + } /* ISAR needs firmware download first */ if (!test_bit(HW_ISAR, &cs->HW_Flags)) ll_run(cs, 0); + + ret = 1; + goto out; + + outf_dlog: + kfree(cs->dlog); + outf_cs: + kfree(cs); + card->cs = NULL; + out: restore_flags(flags); - return (1); + return ret; } void @@ -1240,9 +1248,6 @@ } else { printk(KERN_WARNING "HiSax: Card %s not installed !\n", CardType[cards[i].typ]); - if (cards[i].cs) - kfree((void *) cards[i].cs); - cards[i].cs = NULL; HiSax_shiftcards(i); nrcards--; } @@ -1319,15 +1324,28 @@ static int __init HiSax_init(void) { - int i,j; + int i, retval; +#ifdef MODULE + int j; int nzproto = 0; +#endif HiSaxVersion(); - CallcNew(); - Isdnl3New(); - Isdnl2New(); - TeiNew(); - Isdnl1New(); + retval = CallcNew(); + if (retval) + goto out; + retval = Isdnl3New(); + if (retval) + goto out_callc; + retval = Isdnl2New(); + if (retval) + goto out_isdnl3; + retval = TeiNew(); + if (retval) + goto out_isdnl2; + retval = Isdnl1New(); + if (retval) + goto out_tei; #ifdef MODULE if (!type[0]) { @@ -1474,17 +1492,26 @@ printk(KERN_DEBUG "HiSax: Total %d card%s defined\n", nrcards, (nrcards > 1) ? "s" : ""); - if (HiSax_inithardware(NULL)) { - /* Install only, if at least one card found */ - return (0); - } else { - Isdnl1Free(); - TeiFree(); - Isdnl2Free(); - Isdnl3Free(); - CallcFree(); - return -EIO; + /* Install only, if at least one card found */ + if (!HiSax_inithardware(NULL)) { + retval = -EIO; + goto out_isdnl1; } + + return 0; + + out_isdnl1: + Isdnl1Free(); + out_tei: + TeiFree(); + out_isdnl2: + Isdnl2Free(); + out_isdnl3: + Isdnl3Free(); + out_callc: + CallcFree(); + out: + return retval; } static void HiSax_exit(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/diva.c linux.20p9/drivers/isdn/hisax/diva.c --- linux.vanilla/drivers/isdn/hisax/diva.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/diva.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: diva.c,v 1.25.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: diva.c,v 1.25.6.4 2001/02/16 16:43:25 kai Exp $ * * diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -25,7 +25,7 @@ extern const char *CardType[]; -const char *Diva_revision = "$Revision: 1.25.6.3 $"; +const char *Diva_revision = "$Revision: 1.25.6.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/elsa.c linux.20p9/drivers/isdn/hisax/elsa.c --- linux.vanilla/drivers/isdn/hisax/elsa.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/elsa.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: elsa.c,v 2.26.6.2 2001/02/13 10:33:58 kai Exp $ +/* $Id: elsa.c,v 2.26.6.3 2001/02/16 16:43:25 kai Exp $ * * elsa.c low level stuff for Elsa isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -31,7 +31,7 @@ extern const char *CardType[]; -const char *Elsa_revision = "$Revision: 2.26.6.2 $"; +const char *Elsa_revision = "$Revision: 2.26.6.3 $"; const char *Elsa_Types[] = {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/elsa_ser.c linux.20p9/drivers/isdn/hisax/elsa_ser.c --- linux.vanilla/drivers/isdn/hisax/elsa_ser.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/elsa_ser.c Wed Jul 4 16:03:54 2001 @@ -1,8 +1,8 @@ -/* $Id: elsa_ser.c,v 2.10 2000/11/19 17:02:47 kai Exp $ +/* $Id: elsa_ser.c,v 2.10.6.2 2001/06/09 15:14:17 kai Exp $ * * stuff for the serial modem on ELSA cards * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -439,8 +439,6 @@ void close_elsastate(struct BCState *bcs) { - struct sk_buff *skb; - modehscx(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { if (bcs->hw.hscx.rcvbuf) { @@ -448,12 +446,8 @@ kfree(bcs->hw.hscx.rcvbuf); bcs->hw.hscx.rcvbuf = NULL; } - while ((skb = skb_dequeue(&bcs->rqueue))) { - dev_kfree_skb(skb); - } - while ((skb = skb_dequeue(&bcs->squeue))) { - dev_kfree_skb(skb); - } + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/fsm.c linux.20p9/drivers/isdn/hisax/fsm.c --- linux.vanilla/drivers/isdn/hisax/fsm.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/fsm.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: fsm.c,v 1.14 2000/11/24 17:05:37 kai Exp $ +/* $Id: fsm.c,v 1.14.6.2 2001/05/26 15:19:57 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden @@ -6,7 +6,7 @@ * Thanks to Jan den Ouden * Fritz Elfert * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -15,13 +15,16 @@ #define FSM_TIMER_DEBUG 0 -void __init +int __init FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount) { int i; fsm->jumpmatrix = (FSMFNPTR *) kmalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL); + if (!fsm->jumpmatrix) + return -ENOMEM; + memset(fsm->jumpmatrix, 0, sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count); for (i = 0; i < fncount; i++) @@ -32,6 +35,7 @@ } else fsm->jumpmatrix[fsm->state_count * fnlist[i].event + fnlist[i].state] = (FSMFNPTR) fnlist[i].routine; + return 0; } void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/gazel.c linux.20p9/drivers/isdn/hisax/gazel.c --- linux.vanilla/drivers/isdn/hisax/gazel.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/gazel.c Wed Jul 4 16:03:54 2001 @@ -1,11 +1,11 @@ -/* $Id: gazel.c,v 2.11.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: gazel.c,v 2.11.6.6 2001/06/08 08:48:46 kai Exp $ * * gazel.c low level stuff for Gazel isdn cards * * Author BeWan Systems * based on source code from Karsten Keil * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -20,7 +20,7 @@ #include extern const char *CardType[]; -const char *gazel_revision = "$Revision: 2.11.6.3 $"; +const char *gazel_revision = "$Revision: 2.11.6.6 $"; #define R647 1 #define R685 2 @@ -440,10 +440,6 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs) { unsigned int i, base = 0, adr = 0, len = 0; - long flags; - - save_flags(flags); - cli(); switch (cs->subtyp) { case R647: @@ -488,17 +484,15 @@ break; } - restore_flags(flags); return 0; error: - restore_flags(flags); printk(KERN_WARNING "Gazel: %s io ports 0x%x-0x%x already in use\n", CardType[cs->typ], adr, adr + len); return 1; } -static int +static int __init setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) { printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n"); @@ -547,7 +541,7 @@ static struct pci_dev *dev_tel __initdata = NULL; -static int +static int __init setup_gazelpci(struct IsdnCardState *cs) { u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_2bds0.c linux.20p9/drivers/isdn/hisax/hfc_2bds0.c --- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_2bds0.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bds0.c,v 1.15 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfc_2bds0.c,v 1.15.6.2 2001/06/09 15:14:17 kai Exp $ * * specific routines for CCD's HFC 2BDS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -568,8 +568,8 @@ { mode_2bs0(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_2bds0.h linux.20p9/drivers/isdn/hisax/hfc_2bds0.h --- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_2bds0.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bds0.h,v 1.4 2000/06/26 08:59:12 keil Exp $ +/* $Id: hfc_2bds0.h,v 1.4.6.1 2001/02/16 16:43:27 kai Exp $ * * specific defines for CCD's HFC 2BDS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_2bs0.c linux.20p9/drivers/isdn/hisax/hfc_2bs0.c --- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_2bs0.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bs0.c,v 1.17 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfc_2bs0.c,v 1.17.6.2 2001/06/09 15:14:17 kai Exp $ * * specific routines for CCD's HFC 2BS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -532,8 +532,8 @@ { mode_hfc(bcs, 0, bcs->channel); if (test_bit(BC_FLG_INIT, &bcs->Flag)) { - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_2bs0.h linux.20p9/drivers/isdn/hisax/hfc_2bs0.h --- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_2bs0.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hfc_2bs0.h,v 1.3 2000/06/26 08:59:13 keil Exp $ +/* $Id: hfc_2bs0.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * * specific defines for CCD's HFC 2BS0 * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_pci.c linux.20p9/drivers/isdn/hisax/hfc_pci.c --- linux.vanilla/drivers/isdn/hisax/hfc_pci.c Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_pci.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: hfc_pci.c,v 1.34.6.4 2001/02/13 10:33:58 kai Exp $ +/* $Id: hfc_pci.c,v 1.34.6.6 2001/06/09 15:14:17 kai Exp $ * hfc_pci.c low level driver for CCD´s hfc-pci based cards * @@ -36,7 +36,7 @@ extern const char *CardType[]; -static const char *hfcpci_revision = "$Revision: 1.34.6.4 $"; +static const char *hfcpci_revision = "$Revision: 1.34.6.6 $"; /* table entry in the PCI devices list */ typedef struct { @@ -236,6 +236,59 @@ return (NULL); } +/***************************************/ +/* clear the desired B-channel rx fifo */ +/***************************************/ +static void hfcpci_clear_fifo_rx(struct IsdnCardState *cs, int fifo) +{ u_char fifo_state; + bzfifo_type *bzr; + + if (fifo) { + bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2; + fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B2RX; + } else { + bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1; + fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B1RX; + } + if (fifo_state) + cs->hw.hfcpci.fifo_en ^= fifo_state; + Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en); + cs->hw.hfcpci.last_bfifo_cnt[fifo] = 0; + bzr->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; + bzr->za[MAX_B_FRAMES].z2 = bzr->za[MAX_B_FRAMES].z1; + bzr->f1 = MAX_B_FRAMES; + bzr->f2 = bzr->f1; /* init F pointers to remain constant */ + if (fifo_state) + cs->hw.hfcpci.fifo_en |= fifo_state; + Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en); +} + +/***************************************/ +/* clear the desired B-channel tx fifo */ +/***************************************/ +static void hfcpci_clear_fifo_tx(struct IsdnCardState *cs, int fifo) +{ u_char fifo_state; + bzfifo_type *bzt; + + if (fifo) { + bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b2; + fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B2TX; + } else { + bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b1; + fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B1TX; + } + if (fifo_state) + cs->hw.hfcpci.fifo_en ^= fifo_state; + Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en); + bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; + bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1; + bzt->f1 = MAX_B_FRAMES; + bzt->f2 = bzt->f1; /* init F pointers to remain constant */ + if (fifo_state) + cs->hw.hfcpci.fifo_en |= fifo_state; + Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en); +} + /*********************************************/ /* read a complete B-frame out of the buffer */ /*********************************************/ @@ -429,7 +482,7 @@ { long flags; struct IsdnCardState *cs = bcs->cs; - int rcnt; + int rcnt, real_fifo; int receive, count = 5; struct sk_buff *skb; bzfifo_type *bz; @@ -441,9 +494,11 @@ if ((bcs->channel) && (!cs->hw.hfcpci.bswapped)) { bz = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2; bdata = ((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxdat_b2; + real_fifo = 1; } else { bz = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1; bdata = ((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxdat_b1; + real_fifo = 0; } Begin: count--; @@ -476,6 +531,11 @@ rcnt = bz->f1 - bz->f2; if (rcnt < 0) rcnt += MAX_B_FRAMES + 1; + if (cs->hw.hfcpci.last_bfifo_cnt[real_fifo] > rcnt + 1) { + rcnt = 0; + hfcpci_clear_fifo_rx(cs, real_fifo); + } + cs->hw.hfcpci.last_bfifo_cnt[real_fifo] = rcnt; if (rcnt > 1) receive = 1; else @@ -1254,7 +1314,6 @@ mode_hfcpci(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; - bzfifo_type *bzr, *bzt; int flags, fifo2; if (cs->debug & L1_DEB_HSCX) @@ -1301,6 +1360,8 @@ } break; case (L1_MODE_TRANS): + hfcpci_clear_fifo_rx(cs, fifo2); + hfcpci_clear_fifo_tx(cs, fifo2); if (bc) { cs->hw.hfcpci.sctrl |= SCTRL_B2_ENA; cs->hw.hfcpci.sctrl_r |= SCTRL_B2_ENA; @@ -1313,26 +1374,16 @@ cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B2TRANS + HFCPCI_INTS_B2REC); cs->hw.hfcpci.ctmt |= 2; cs->hw.hfcpci.conn &= ~0x18; - bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2; - bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b2; } else { cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B1; cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B1TRANS + HFCPCI_INTS_B1REC); cs->hw.hfcpci.ctmt |= 1; cs->hw.hfcpci.conn &= ~0x03; - bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1; - bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b1; } - bzr->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; - bzr->za[MAX_B_FRAMES].z2 = bzr->za[MAX_B_FRAMES].z1; - bzr->f1 = MAX_B_FRAMES; - bzr->f2 = bzr->f1; /* init F pointers to remain constant */ - bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; - bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1; - bzt->f1 = MAX_B_FRAMES; - bzt->f2 = bzt->f1; /* init F pointers to remain constant */ break; case (L1_MODE_HDLC): + hfcpci_clear_fifo_rx(cs, fifo2); + hfcpci_clear_fifo_tx(cs, fifo2); if (bc) { cs->hw.hfcpci.sctrl |= SCTRL_B2_ENA; cs->hw.hfcpci.sctrl_r |= SCTRL_B2_ENA; @@ -1341,11 +1392,13 @@ cs->hw.hfcpci.sctrl_r |= SCTRL_B1_ENA; } if (fifo2) { + cs->hw.hfcpci.last_bfifo_cnt[1] = 0; cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B2; cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B2TRANS + HFCPCI_INTS_B2REC); cs->hw.hfcpci.ctmt &= ~2; cs->hw.hfcpci.conn &= ~0x18; } else { + cs->hw.hfcpci.last_bfifo_cnt[0] = 0; cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B1; cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B1TRANS + HFCPCI_INTS_B1REC); cs->hw.hfcpci.ctmt &= ~1; @@ -1445,8 +1498,8 @@ { mode_hfcpci(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; @@ -1634,7 +1687,8 @@ #endif /* CONFIG_PCI */ -int __init setup_hfcpci(struct IsdnCard *card) +int __init +setup_hfcpci(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; char tmp[64]; @@ -1646,7 +1700,7 @@ #endif strcpy(tmp, hfcpci_revision); printk(KERN_INFO "HiSax: HFC-PCI driver Rev. %s\n", HiSax_getrev(tmp)); -#ifdef CONFIG_PCI +#if CONFIG_PCI cs->hw.hfcpci.int_s1 = 0; cs->dc.hfcpci.ph_state = 0; cs->hw.hfcpci.fifo = 255; @@ -1660,6 +1714,7 @@ if (tmp_hfcpci) { if (pci_enable_device(tmp_hfcpci)) continue; + pci_set_master(tmp_hfcpci); if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK))) continue; else diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_pci.h linux.20p9/drivers/isdn/hisax/hfc_pci.h --- linux.vanilla/drivers/isdn/hisax/hfc_pci.h Sun Mar 25 17:37:32 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_pci.h Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: hfc_pci.h,v 1.8 2000/06/26 08:59:13 keil Exp $ +/* $Id: hfc_pci.h,v 1.8.6.1 2001/04/08 19:32:26 kai Exp $ * * specific defines for CCD's HFC 2BDS0 PCI chips * @@ -178,6 +178,9 @@ #define HFCPCI_FIFOEN_B1 0x03 #define HFCPCI_FIFOEN_B2 0x0C #define HFCPCI_FIFOEN_DTX 0x10 +#define HFCPCI_FIFOEN_B1TX 0x01 +#define HFCPCI_FIFOEN_B1RX 0x02 +#define HFCPCI_FIFOEN_B2TX 0x04 #define HFCPCI_FIFOEN_B2RX 0x08 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfc_sx.c linux.20p9/drivers/isdn/hisax/hfc_sx.c --- linux.vanilla/drivers/isdn/hisax/hfc_sx.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hfc_sx.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: hfc_sx.c,v 1.9 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfc_sx.c,v 1.9.6.1 2001/06/09 15:14:17 kai Exp $ * hfc_sx.c low level driver for CCD´s hfc-s+/sp based cards * @@ -32,7 +32,7 @@ extern const char *CardType[]; -static const char *hfcsx_revision = "$Revision: 1.9 $"; +static const char *hfcsx_revision = "$Revision: 1.9.6.1 $"; /***************************************/ /* IRQ-table for CCDs demo board */ @@ -1288,8 +1288,8 @@ { mode_hfcsx(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hfcscard.c linux.20p9/drivers/isdn/hisax/hfcscard.c --- linux.vanilla/drivers/isdn/hisax/hfcscard.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hfcscard.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hfcscard.c,v 1.8 2000/11/24 17:05:37 kai Exp $ +/* $Id: hfcscard.c,v 1.8.6.1 2001/02/16 16:43:27 kai Exp $ * * hfcscard.c low level stuff for hfcs based cards (Teles3c, ACER P10) * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -16,7 +16,7 @@ extern const char *CardType[]; -static const char *hfcs_revision = "$Revision: 1.8 $"; +static const char *hfcs_revision = "$Revision: 1.8.6.1 $"; static void hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hisax.h linux.20p9/drivers/isdn/hisax/hisax.h --- linux.vanilla/drivers/isdn/hisax/hisax.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hisax.h Wed Aug 8 22:49:38 2001 @@ -1,8 +1,8 @@ -/* $Id: hisax.h,v 2.52.6.2 2001/02/10 14:41:22 kai Exp $ +/* $Id: hisax.h,v 2.52.6.6 2001/06/09 15:14:17 kai Exp $ * * Basic declarations, defines and prototypes * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #include @@ -125,13 +125,13 @@ #define l3dss1_process #include "l3dss1.h" #undef l3dss1_process -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 #define l3ni1_process #include "l3ni1.h" #undef l3ni1_process -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ #define MAX_DFRAME_LEN 260 #define MAX_DFRAME_LEN_L1 300 @@ -317,10 +317,10 @@ { u_char uuuu; /* only as dummy */ #ifdef CONFIG_HISAX_EURO dss1_stk_priv dss1; /* private dss1 data */ -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 ni1_stk_priv ni1; /* private ni1 data */ -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ } prot; }; @@ -341,10 +341,10 @@ { u_char uuuu; /* only when euro not defined, avoiding empty union */ #ifdef CONFIG_HISAX_EURO dss1_proc_priv dss1; /* private dss1 data */ -#endif CONFIG_HISAX_EURO +#endif /* CONFIG_HISAX_EURO */ #ifdef CONFIG_HISAX_NI1 ni1_proc_priv ni1; /* private ni1 data */ -#endif CONFIG_HISAX_NI1 +#endif /* CONFIG_HISAX_NI1 */ } prot; }; @@ -686,6 +686,7 @@ unsigned char *pci_io; /* start of PCI IO memory */ void *share_start; /* shared memory for Fifos start */ void *fifos; /* FIFO memory */ + int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */ struct timer_list timer; }; @@ -1302,7 +1303,7 @@ int getcallref(u_char * p); int newcallref(void); -void FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount); +int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount); void FsmFree(struct Fsm *fsm); int FsmEvent(struct FsmInst *fi, int event, void *arg); void FsmChangeState(struct FsmInst *fi, int newstate); @@ -1323,7 +1324,6 @@ void LogFrame(struct IsdnCardState *cs, u_char * p, int size); void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir); void iecpy(u_char * dest, u_char * iestart, int ieoffset); -int discard_queue(struct sk_buff_head *q); #ifdef ISDN_CHIP_ISAC void setstack_isac(struct PStack *st, struct IsdnCardState *cs); #endif /* ISDN_CHIP_ISAC */ @@ -1333,19 +1333,19 @@ int ll_run(struct IsdnCardState *cs, int addfeatures); void ll_stop(struct IsdnCardState *cs); -void CallcNew(void); +int CallcNew(void); void CallcFree(void); int CallcNewChan(struct IsdnCardState *cs); void CallcFreeChan(struct IsdnCardState *cs); -void Isdnl1New(void); +int Isdnl1New(void); void Isdnl1Free(void); -void Isdnl2New(void); +int Isdnl2New(void); void Isdnl2Free(void); -void Isdnl3New(void); +int Isdnl3New(void); void Isdnl3Free(void); void init_tei(struct IsdnCardState *cs, int protocol); void release_tei(struct IsdnCardState *cs); char *HiSax_getrev(const char *revision); -void TeiNew(void); +int TeiNew(void); void TeiFree(void); int certification_check(int output); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hscx.c linux.20p9/drivers/isdn/hisax/hscx.c --- linux.vanilla/drivers/isdn/hisax/hscx.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hscx.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hscx.c,v 1.21 2000/11/24 17:05:37 kai Exp $ +/* $Id: hscx.c,v 1.21.6.2 2001/06/09 15:14:17 kai Exp $ * * hscx.c HSCX specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -166,8 +166,8 @@ kfree(bcs->blog); bcs->blog = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hscx.h linux.20p9/drivers/isdn/hisax/hscx.h --- linux.vanilla/drivers/isdn/hisax/hscx.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hscx.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: hscx.h,v 1.6 2000/06/26 08:59:13 keil Exp $ +/* $Id: hscx.h,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $ * * hscx.h HSCX specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/hscx_irq.c linux.20p9/drivers/isdn/hisax/hscx_irq.c --- linux.vanilla/drivers/isdn/hisax/hscx_irq.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/hscx_irq.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -/* $Id: hscx_irq.c,v 1.16 2000/11/19 17:02:47 kai Exp $ +/* $Id: hscx_irq.c,v 1.16.6.1 2001/02/16 16:43:27 kai Exp $ * * hscx_irq.c low level b-channel stuff for Siemens HSCX * @@ -6,7 +6,7 @@ * * This is an include file for fast inline IRQ stuff * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/icc.c linux.20p9/drivers/isdn/hisax/icc.c --- linux.vanilla/drivers/isdn/hisax/icc.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/icc.c Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -// $Id: icc.c,v 1.5 2000/11/24 17:05:37 kai Exp $ +// $Id: icc.c,v 1.5.6.3 2001/06/09 15:14:17 kai Exp $ //----------------------------------------------------------------------------- // // ICC specific routines @@ -7,10 +7,10 @@ // www.traverse.com.au // // 1999.6.25 Initial implementation of routines for Siemens ISDN -// Communication Controler PEB 2070 based on the ISAC routines +// Communication Controller PEB 2070 based on the ISAC routines // written by Karsten Keil. // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- @@ -551,8 +551,8 @@ } break; case (HW_DEACTIVATE | RESPONSE): - discard_queue(&cs->rq); - discard_queue(&cs->sq); + skb_queue_purge(&cs->rq); + skb_queue_purge(&cs->sq); if (cs->tx_skb) { dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/icc.h linux.20p9/drivers/isdn/hisax/icc.h --- linux.vanilla/drivers/isdn/hisax/icc.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/icc.h Wed Jul 4 16:03:54 2001 @@ -1,4 +1,4 @@ -// $Id: icc.h,v 1.2 2000/06/26 08:59:13 keil Exp $ +// $Id: icc.h,v 1.2.6.2 2001/03/13 16:17:08 kai Exp $ //----------------------------------------------------------------------------- // // ICC specific routines @@ -7,10 +7,10 @@ // www.traverse.com.au // // 1999.7.14 Initial implementation of routines for Siemens ISDN -// Communication Controler PEB 2070 based on the ISAC routines +// Communication Controller PEB 2070 based on the ISAC routines // written by Karsten Keil. // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/ipac.h linux.20p9/drivers/isdn/hisax/ipac.h --- linux.vanilla/drivers/isdn/hisax/ipac.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/ipac.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: ipac.h,v 1.5 2000/06/26 08:59:13 keil Exp $ +/* $Id: ipac.h,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $ * * ipac.h IPAC specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isac.c linux.20p9/drivers/isdn/hisax/isac.c --- linux.vanilla/drivers/isdn/hisax/isac.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isac.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: isac.c,v 1.28 2000/11/24 17:05:37 kai Exp $ +/* $Id: isac.c,v 1.28.6.2 2001/06/09 15:14:17 kai Exp $ * * isac.c ISAC specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert */ @@ -445,7 +445,7 @@ if (cs->debug & L1_DEB_MONITOR) debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp -1]); } - AfterMOX1: + AfterMOX1:; #endif } } @@ -549,8 +549,8 @@ } break; case (HW_DEACTIVATE | RESPONSE): - discard_queue(&cs->rq); - discard_queue(&cs->sq); + skb_queue_purge(&cs->rq); + skb_queue_purge(&cs->sq); if (cs->tx_skb) { dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isac.h linux.20p9/drivers/isdn/hisax/isac.h --- linux.vanilla/drivers/isdn/hisax/isac.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isac.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: isac.h,v 1.7 2000/06/26 08:59:13 keil Exp $ +/* $Id: isac.h,v 1.7.6.1 2001/02/16 16:43:27 kai Exp $ * * isac.h ISAC specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isar.c linux.20p9/drivers/isdn/hisax/isar.c --- linux.vanilla/drivers/isdn/hisax/isar.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isar.c Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: isar.c,v 1.17 2000/11/24 17:05:37 kai Exp $ +/* $Id: isar.c,v 1.17.6.3 2001/06/09 15:14:17 kai Exp $ * * isar.c ISAR (Siemens PSB 7110) specific routines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -383,12 +383,12 @@ } else { printk(KERN_DEBUG"isar selftest not OK %x/%x/%x\n", ireg->cmsb, ireg->clsb, ireg->par[0]); - ret = 1;goto reterror; + ret = 1;goto reterrflg; } ireg->iis = 0; if (!sendmsg(cs, ISAR_HIS_DIAG, ISAR_CTRL_SWVER, 0, NULL)) { printk(KERN_ERR"isar RQST SVN failed\n"); - ret = 1;goto reterror; + ret = 1;goto reterrflg; } cnt = 30000; /* max 300 ms */ while ((ireg->iis != ISAR_IIS_DIAG) && cnt) { @@ -1650,8 +1650,8 @@ kfree(bcs->hw.isar.rcvbuf); bcs->hw.isar.rcvbuf = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isar.h linux.20p9/drivers/isdn/hisax/isar.h --- linux.vanilla/drivers/isdn/hisax/isar.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isar.h Wed Jul 4 16:03:54 2001 @@ -1,10 +1,10 @@ -/* $Id: isar.h,v 1.9 2000/06/26 08:59:13 keil Exp $ +/* $Id: isar.h,v 1.9.6.1 2001/02/16 16:43:27 kai Exp $ * * isar.h ISAR (Siemens PSB 7110) specific defines * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl1.c linux.20p9/drivers/isdn/hisax/isdnl1.c --- linux.vanilla/drivers/isdn/hisax/isdnl1.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl1.c Wed Jul 4 16:03:54 2001 @@ -1,11 +1,11 @@ -/* $Id: isdnl1.c,v 2.41.6.1 2000/12/10 22:01:04 kai Exp $ +/* $Id: isdnl1.c,v 2.41.6.3 2001/05/26 15:19:57 kai Exp $ * * isdnl1.c common low level stuff for Siemens Chipsetbased isdn cards * based on the teles driver from Jan den Ouden * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -15,7 +15,7 @@ * */ -const char *l1_revision = "$Revision: 2.41.6.1 $"; +const char *l1_revision = "$Revision: 2.41.6.3 $"; #define __NO_VERSION__ #include @@ -736,26 +736,41 @@ #define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode)) -void __init +int __init Isdnl1New(void) { -#ifdef HISAX_UINTERFACE - l1fsm_u.state_count = L1U_STATE_COUNT; - l1fsm_u.event_count = L1_EVENT_COUNT; - l1fsm_u.strEvent = strL1Event; - l1fsm_u.strState = strL1UState; - FsmNew(&l1fsm_u, L1UFnList, L1U_FN_COUNT); -#endif + int retval; + l1fsm_s.state_count = L1S_STATE_COUNT; l1fsm_s.event_count = L1_EVENT_COUNT; l1fsm_s.strEvent = strL1Event; l1fsm_s.strState = strL1SState; - FsmNew(&l1fsm_s, L1SFnList, L1S_FN_COUNT); + retval = FsmNew(&l1fsm_s, L1SFnList, L1S_FN_COUNT); + if (retval) + return retval; + l1fsm_b.state_count = L1B_STATE_COUNT; l1fsm_b.event_count = L1_EVENT_COUNT; l1fsm_b.strEvent = strL1Event; l1fsm_b.strState = strL1BState; - FsmNew(&l1fsm_b, L1BFnList, L1B_FN_COUNT); + retval = FsmNew(&l1fsm_b, L1BFnList, L1B_FN_COUNT); + if (retval) { + FsmFree(&l1fsm_s); + return retval; + } +#ifdef HISAX_UINTERFACE + l1fsm_u.state_count = L1U_STATE_COUNT; + l1fsm_u.event_count = L1_EVENT_COUNT; + l1fsm_u.strEvent = strL1Event; + l1fsm_u.strState = strL1UState; + retval = FsmNew(&l1fsm_u, L1UFnList, L1U_FN_COUNT); + if (retval) { + FsmFree(&l1fsm_s); + FsmFree(&l1fsm_b); + return retval; + } +#endif + return 0; } void Isdnl1Free(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl1.h linux.20p9/drivers/isdn/hisax/isdnl1.h --- linux.vanilla/drivers/isdn/hisax/isdnl1.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl1.h Wed Jul 4 16:03:54 2001 @@ -1,8 +1,8 @@ -/* $Id: isdnl1.h,v 2.9 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl1.h,v 2.9.6.1 2001/02/16 16:43:27 kai Exp $ * * Layer 1 defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl2.c linux.20p9/drivers/isdn/hisax/isdnl2.c --- linux.vanilla/drivers/isdn/hisax/isdnl2.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl2.c Wed Jul 4 16:03:55 2001 @@ -1,9 +1,9 @@ -/* $Id: isdnl2.c,v 2.25 2000/11/24 17:05:38 kai Exp $ +/* $Id: isdnl2.c,v 2.25.6.3 2001/06/09 15:14:17 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -16,7 +16,7 @@ #include "hisax.h" #include "isdnl2.h" -const char *l2_revision = "$Revision: 2.25 $"; +const char *l2_revision = "$Revision: 2.25.6.3 $"; static void l2m_debug(struct FsmInst *fi, char *fmt, ...); @@ -649,7 +649,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); test_and_set_bit(FLG_L3_INIT, &st->l2.flag); test_and_clear_bit(FLG_PEND_REL, &st->l2.flag); } @@ -659,7 +659,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); establishlink(fi); test_and_set_bit(FLG_L3_INIT, &st->l2.flag); } @@ -685,7 +685,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); freewin(st); FsmChangeState(fi, ST_L2_6); st->l2.rc = 0; @@ -745,7 +745,7 @@ st->ma.layer(st, MDL_ERROR | INDICATION, (void *) 'F'); if (st->l2.vs != st->l2.va) { - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); est = 1; } @@ -778,7 +778,7 @@ send_uframe(st, UA | get_PollFlagFree(st, skb), RSP); - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); freewin(st); lapb_dl_release_l2l3(st, INDICATION); } @@ -802,7 +802,7 @@ if (test_and_clear_bit(FLG_L3_INIT, &st->l2.flag)) { pr = DL_ESTABLISH | CONFIRM; } else if (st->l2.vs != st->l2.va) { - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); pr = DL_ESTABLISH | INDICATION; } @@ -860,7 +860,7 @@ if (get_PollFlagFree(st, skb)) { stop_t200(st, 7); if (!test_bit(FLG_L3_INIT, &st->l2.flag)) - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); if (test_bit(FLG_LAPB, &st->l2.flag)) st->l2.l2l1(st, PH_DEACTIVATE | REQUEST, NULL); st5_dl_release_l2l3(st); @@ -1156,7 +1156,7 @@ } else if (st->l2.rc == st->l2.N200) { FsmChangeState(fi, ST_L2_4); test_and_clear_bit(FLG_T200_RUN, &st->l2.flag); - discard_queue(&st->l2.i_queue); + skb_queue_purge(&st->l2.i_queue); st->ma.layer(st, MDL_ERROR | INDICATION, (void *) 'G'); if (test_bit(FLG_LAPB, &st->l2.flag)) st->l2.l2l1(st, PH_DEACTIVATE | REQUEST, NULL); @@ -1388,7 +1388,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.ui_queue); st->l2.tei = -1; FsmChangeState(fi, ST_L2_1); } @@ -1398,7 +1398,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.ui_queue); st->l2.tei = -1; st->l2.l2l3(st, DL_RELEASE | INDICATION, NULL); FsmChangeState(fi, ST_L2_1); @@ -1409,8 +1409,8 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); freewin(st); st->l2.tei = -1; stop_t200(st, 17); @@ -1423,7 +1423,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.ui_queue); st->l2.tei = -1; stop_t200(st, 18); st->l2.l2l3(st, DL_RELEASE | CONFIRM, NULL); @@ -1435,8 +1435,8 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); freewin(st); st->l2.tei = -1; stop_t200(st, 17); @@ -1450,8 +1450,8 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); if (test_and_clear_bit(FLG_ESTAB_PEND, &st->l2.flag)) st->l2.l2l3(st, DL_RELEASE | INDICATION, NULL); } @@ -1461,8 +1461,8 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); freewin(st); stop_t200(st, 19); st5_dl_release_l2l3(st); @@ -1474,7 +1474,7 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.ui_queue); stop_t200(st, 20); st->l2.l2l3(st, DL_RELEASE | CONFIRM, NULL); FsmChangeState(fi, ST_L2_4); @@ -1485,8 +1485,8 @@ { struct PStack *st = fi->userdata; - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); freewin(st); stop_t200(st, 19); FsmDelTimer(&st->l2.t203, 19); @@ -1761,8 +1761,8 @@ { FsmDelTimer(&st->l2.t200, 21); FsmDelTimer(&st->l2.t203, 16); - discard_queue(&st->l2.i_queue); - discard_queue(&st->l2.ui_queue); + skb_queue_purge(&st->l2.i_queue); + skb_queue_purge(&st->l2.ui_queue); ReleaseWin(&st->l2); } @@ -1831,14 +1831,14 @@ { } -void __init +int __init Isdnl2New(void) { l2fsm.state_count = L2_STATE_COUNT; l2fsm.event_count = L2_EVENT_COUNT; l2fsm.strEvent = strL2Event; l2fsm.strState = strL2State; - FsmNew(&l2fsm, L2FnList, L2_FN_COUNT); + return FsmNew(&l2fsm, L2FnList, L2_FN_COUNT); } void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl2.h linux.20p9/drivers/isdn/hisax/isdnl2.h --- linux.vanilla/drivers/isdn/hisax/isdnl2.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl2.h Wed Jul 4 16:03:55 2001 @@ -1,8 +1,8 @@ -/* $Id: isdnl2.h,v 1.3 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl2.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * * Layer 2 defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl3.c linux.20p9/drivers/isdn/hisax/isdnl3.c --- linux.vanilla/drivers/isdn/hisax/isdnl3.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl3.c Wed Jul 4 16:03:55 2001 @@ -1,9 +1,9 @@ -/* $Id: isdnl3.c,v 2.17.6.1 2001/01/08 17:09:20 kai Exp $ +/* $Id: isdnl3.c,v 2.17.6.4 2001/06/09 15:14:17 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -18,7 +18,7 @@ #include "isdnl3.h" #include -const char *l3_revision = "$Revision: 2.17.6.1 $"; +const char *l3_revision = "$Revision: 2.17.6.4 $"; static struct Fsm l3fsm; @@ -404,7 +404,7 @@ st->l3.global = NULL; } FsmDelTimer(&st->l3.l3m_timer, 54); - discard_queue(&st->l3.squeue); + skb_queue_purge(&st->l3.squeue); } void @@ -520,7 +520,7 @@ FsmDelTimer(&st->l3.l3m_timer, 52); FsmChangeState(fi, ST_L3_LC_REL); - discard_queue(&st->l3.squeue); + skb_queue_purge(&st->l3.squeue); l3ml3p(st, DL_RELEASE | INDICATION); } @@ -530,7 +530,7 @@ struct PStack *st = fi->userdata; FsmChangeState(fi, ST_L3_LC_REL); - discard_queue(&st->l3.squeue); + skb_queue_purge(&st->l3.squeue); l3ml3p(st, DL_RELEASE | CONFIRM); } @@ -591,14 +591,14 @@ } } -void __init +int __init Isdnl3New(void) { l3fsm.state_count = L3_STATE_COUNT; l3fsm.event_count = L3_EVENT_COUNT; l3fsm.strEvent = strL3Event; l3fsm.strState = strL3State; - FsmNew(&l3fsm, L3FnList, L3_FN_COUNT); + return FsmNew(&l3fsm, L3FnList, L3_FN_COUNT); } void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isdnl3.h linux.20p9/drivers/isdn/hisax/isdnl3.h --- linux.vanilla/drivers/isdn/hisax/isdnl3.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isdnl3.h Wed Jul 4 16:03:55 2001 @@ -1,6 +1,6 @@ -/* $Id: isdnl3.h,v 2.6 2000/06/26 08:59:13 keil Exp $ +/* $Id: isdnl3.h,v 2.6.6.1 2001/02/16 16:43:27 kai Exp $ * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/isurf.c linux.20p9/drivers/isdn/hisax/isurf.c --- linux.vanilla/drivers/isdn/hisax/isurf.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/isurf.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: isurf.c,v 1.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: isurf.c,v 1.10.6.1 2001/02/16 16:43:27 kai Exp $ * * isurf.c low level stuff for Siemens I-Surf/I-Talk cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -17,7 +17,7 @@ extern const char *CardType[]; -static const char *ISurf_revision = "$Revision: 1.10 $"; +static const char *ISurf_revision = "$Revision: 1.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/ix1_micro.c linux.20p9/drivers/isdn/hisax/ix1_micro.c --- linux.vanilla/drivers/isdn/hisax/ix1_micro.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/ix1_micro.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: ix1_micro.c,v 2.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: ix1_micro.c,v 2.10.6.1 2001/02/16 16:43:27 kai Exp $ * * ix1_micro.c low level stuff for ITK ix1-micro Rev.2 isdn cards * derived from the original file teles3.c from Karsten Keil @@ -14,7 +14,7 @@ /* For the modification done by the author the following terms and conditions - apply (GNU PUBLIC LICENSE) + apply (GNU General Public License) This program is free software; you can redistribute it and/or modify @@ -50,7 +50,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *ix1_revision = "$Revision: 2.10 $"; +const char *ix1_revision = "$Revision: 2.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/jade.c linux.20p9/drivers/isdn/hisax/jade.c --- linux.vanilla/drivers/isdn/hisax/jade.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/jade.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: jade.c,v 1.6 2000/11/24 17:05:38 kai Exp $ +/* $Id: jade.c,v 1.6.6.2 2001/06/09 15:14:18 kai Exp $ * * jade.c JADE stuff (derived from original hscx.c) * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -209,8 +209,8 @@ kfree(bcs->blog); bcs->blog = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/jade.h linux.20p9/drivers/isdn/hisax/jade.h --- linux.vanilla/drivers/isdn/hisax/jade.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/jade.h Wed Jul 4 16:03:55 2001 @@ -1,9 +1,9 @@ -/* $Id: jade.h,v 1.3 2000/06/26 08:59:14 keil Exp $ +/* $Id: jade.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $ * jade.h JADE specific defines * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/jade_irq.c linux.20p9/drivers/isdn/hisax/jade_irq.c --- linux.vanilla/drivers/isdn/hisax/jade_irq.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/jade_irq.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: jade_irq.c,v 1.5 2000/11/19 17:02:48 kai Exp $ +/* $Id: jade_irq.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $ * * jade_irq.c Low level JADE IRQ stuff (derived from original hscx_irq.c) * * Author Roland Klabunde (R.Klabunde@Berkom.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3_1tr6.c linux.20p9/drivers/isdn/hisax/l3_1tr6.c --- linux.vanilla/drivers/isdn/hisax/l3_1tr6.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3_1tr6.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: l3_1tr6.c,v 2.13 2000/11/19 17:02:48 kai Exp $ +/* $Id: l3_1tr6.c,v 2.13.6.1 2001/02/16 16:43:27 kai Exp $ * * German 1TR6 D-channel protocol * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -17,7 +17,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *l3_1tr6_revision = "$Revision: 2.13 $"; +const char *l3_1tr6_revision = "$Revision: 2.13.6.1 $"; #define MsgHead(ptr, cref, mty, dis) \ *ptr++ = dis; \ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3_1tr6.h linux.20p9/drivers/isdn/hisax/l3_1tr6.h --- linux.vanilla/drivers/isdn/hisax/l3_1tr6.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3_1tr6.h Wed Jul 4 16:03:55 2001 @@ -1,8 +1,8 @@ -/* $Id: l3_1tr6.h,v 2.2 2000/06/26 08:59:14 keil Exp $ +/* $Id: l3_1tr6.h,v 2.2.6.1 2001/02/16 16:43:27 kai Exp $ * * German 1TR6 D-channel protocol defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #ifndef l3_1tr6 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3dss1.c linux.20p9/drivers/isdn/hisax/l3dss1.c --- linux.vanilla/drivers/isdn/hisax/l3dss1.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3dss1.c Wed Jul 4 16:03:55 2001 @@ -1,11 +1,11 @@ -/* $Id: l3dss1.c,v 2.30 2000/11/19 17:02:48 kai Exp $ +/* $Id: l3dss1.c,v 2.30.6.1 2001/02/16 16:43:27 kai Exp $ * * EURO/DSS1 D-channel protocol * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -22,7 +22,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *dss1_revision = "$Revision: 2.30 $"; +const char *dss1_revision = "$Revision: 2.30.6.1 $"; #define EXT_BEARER_CAPS 1 @@ -426,9 +426,9 @@ #undef FOO1 } -#else not HISAX_DE_AOC +#else /* not HISAX_DE_AOC */ l3_debug(st, "invoke break"); -#endif not HISAX_DE_AOC +#endif /* not HISAX_DE_AOC */ break; case 2: /* return result */ /* if no process available handle separately */ @@ -438,12 +438,12 @@ return; } if ((pc->prot.dss1.invoke_id) && (pc->prot.dss1.invoke_id == id)) - { /* Diversion successfull */ + { /* Diversion successful */ free_invoke_id(st,pc->prot.dss1.invoke_id); pc->prot.dss1.remote_result = 0; /* success */ pc->prot.dss1.invoke_id = 0; pc->redir_result = pc->prot.dss1.remote_result; - st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */ + st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */ else l3_debug(st,"return error unknown identifier"); break; @@ -2112,7 +2112,7 @@ MsgHead(p, pc->callref, MT_FACILITY); for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */ - if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ + if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ *p++ = 0x1c; /* Facility info element */ *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */ @@ -2138,7 +2138,7 @@ *p++ = pc->chan->setup.phone[l]; if (len_sub) - { *p++ = 0x04; /* called party subadress */ + { *p++ = 0x04; /* called party subaddress */ *p++ = len_sub - 2; while (*subp) *p++ = *subp++; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3dss1.h linux.20p9/drivers/isdn/hisax/l3dss1.h --- linux.vanilla/drivers/isdn/hisax/l3dss1.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3dss1.h Wed Jul 4 16:03:55 2001 @@ -1,8 +1,8 @@ -/* $Id: l3dss1.h,v 1.10 2000/06/26 08:59:14 keil Exp $ +/* $Id: l3dss1.h,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $ * * DSS1 (Euro) D-channel protocol defines * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3ni1.c linux.20p9/drivers/isdn/hisax/l3ni1.c --- linux.vanilla/drivers/isdn/hisax/l3ni1.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3ni1.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -// $Id: l3ni1.c,v 2.5.6.1 2000/12/06 16:59:19 kai Exp $ +// $Id: l3ni1.c,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $ // //----------------------------------------------------------------------------- // @@ -16,7 +16,7 @@ // Will Scales - beta tester extraordinaire // Brett Whittacre - beta tester and remote devel system in Vegas // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- #define __NO_VERSION__ @@ -26,7 +26,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *ni1_revision = "$Revision: 2.5.6.1 $"; +const char *ni1_revision = "$Revision: 2.5.6.2 $"; #define EXT_BEARER_CAPS 1 @@ -372,12 +372,12 @@ return; } if ((pc->prot.ni1.invoke_id) && (pc->prot.ni1.invoke_id == id)) - { /* Diversion successfull */ + { /* Diversion successful */ free_invoke_id(st,pc->prot.ni1.invoke_id); pc->prot.ni1.remote_result = 0; /* success */ pc->prot.ni1.invoke_id = 0; pc->redir_result = pc->prot.ni1.remote_result; - st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */ + st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */ else l3_debug(st,"return error unknown identifier"); break; @@ -1973,7 +1973,7 @@ MsgHead(p, pc->callref, MT_FACILITY); for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */ - if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */ + if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */ *p++ = 0x1c; /* Facility info element */ *p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */ @@ -1999,7 +1999,7 @@ *p++ = pc->chan->setup.phone[l]; if (len_sub) - { *p++ = 0x04; /* called party subadress */ + { *p++ = 0x04; /* called party subaddress */ *p++ = len_sub - 2; while (*subp) *p++ = *subp++; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/l3ni1.h linux.20p9/drivers/isdn/hisax/l3ni1.h --- linux.vanilla/drivers/isdn/hisax/l3ni1.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/l3ni1.h Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -// $Id: l3ni1.h,v 2.3 2000/11/16 13:50:43 keil Exp $ +// $Id: l3ni1.h,v 2.3.6.1 2001/02/16 16:43:28 kai Exp $ //----------------------------------------------------------------------------- // // NI1 D-channel protocol @@ -12,7 +12,7 @@ // code provided by Ragnar Paulson. // // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/lmgr.c linux.20p9/drivers/isdn/hisax/lmgr.c --- linux.vanilla/drivers/isdn/hisax/lmgr.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/lmgr.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: lmgr.c,v 1.7 2000/06/26 08:59:14 keil Exp $ +/* $Id: lmgr.c,v 1.7.6.1 2001/02/16 16:43:28 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * * Layermanagement module * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/mic.c linux.20p9/drivers/isdn/hisax/mic.c --- linux.vanilla/drivers/isdn/hisax/mic.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/mic.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: mic.c,v 1.10 2000/11/24 17:05:38 kai Exp $ +/* $Id: mic.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $ * * mic.c low level stuff for mic cards * @@ -6,7 +6,7 @@ * * Author Stephan von Krawczynski * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -19,7 +19,7 @@ extern const char *CardType[]; -const char *mic_revision = "$Revision: 1.10 $"; +const char *mic_revision = "$Revision: 1.10.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/netjet.c linux.20p9/drivers/isdn/hisax/netjet.c --- linux.vanilla/drivers/isdn/hisax/netjet.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/netjet.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: netjet.c,v 1.24.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: netjet.c,v 1.24.6.5 2001/06/09 15:14:18 kai Exp $ * * netjet.c low level stuff for Traverse Technologie NETJet ISDN cards * @@ -6,7 +6,7 @@ * * Thanks to Traverse Technologie Australia for documents and informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -16,12 +16,13 @@ #include "isac.h" #include "hscx.h" #include "isdnl1.h" +#include #include #include #include #include "netjet.h" -const char *NETjet_revision = "$Revision: 1.24.6.3 $"; +const char *NETjet_revision = "$Revision: 1.24.6.5 $"; /* Interface functions */ @@ -879,8 +880,8 @@ kfree(bcs->hw.tiger.sendbuf); bcs->hw.tiger.sendbuf = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/netjet.h linux.20p9/drivers/isdn/hisax/netjet.h --- linux.vanilla/drivers/isdn/hisax/netjet.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/netjet.h Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -// $Id: netjet.h,v 2.5.6.1 2000/11/28 12:02:46 kai Exp $ +// $Id: netjet.h,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $ //----------------------------------------------------------------------------- // // NETjet common header file @@ -6,7 +6,7 @@ // Author Kerstern Keil repackaged by // Matt Henderson - Traverse Technologies P/L www.traverse.com.au // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // //----------------------------------------------------------------------------- diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/niccy.c linux.20p9/drivers/isdn/hisax/niccy.c --- linux.vanilla/drivers/isdn/hisax/niccy.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/niccy.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: niccy.c,v 1.15.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: niccy.c,v 1.15.6.4 2001/02/16 16:43:28 kai Exp $ * * niccy.c low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and * compatible (SAGEM cybermodem) @@ -7,7 +7,7 @@ * * Thanks to Dr. Neuhaus and SAGEM for informations * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -23,7 +23,7 @@ #include extern const char *CardType[]; -const char *niccy_revision = "$Revision: 1.15.6.3 $"; +const char *niccy_revision = "$Revision: 1.15.6.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/nj_s.c linux.20p9/drivers/isdn/hisax/nj_s.c --- linux.vanilla/drivers/isdn/hisax/nj_s.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/nj_s.c Wed Jul 4 16:03:55 2001 @@ -1,6 +1,6 @@ -// $Id: nj_s.c,v 2.7.6.3 2001/02/13 10:33:58 kai Exp $ +// $Id: nj_s.c,v 2.7.6.4 2001/02/16 16:43:28 kai Exp $ // -// This file is (c) under GNU PUBLIC LICENSE +// This file is (c) under GNU General Public License // #define __NO_VERSION__ @@ -15,7 +15,7 @@ #include #include "netjet.h" -const char *NETjet_S_revision = "$Revision: 2.7.6.3 $"; +const char *NETjet_S_revision = "$Revision: 2.7.6.4 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/nj_u.c linux.20p9/drivers/isdn/hisax/nj_u.c --- linux.vanilla/drivers/isdn/hisax/nj_u.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/nj_u.c Wed Jul 4 16:03:55 2001 @@ -1,6 +1,6 @@ -/* $Id: nj_u.c,v 2.8.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: nj_u.c,v 2.8.6.4 2001/02/16 16:43:28 kai Exp $ * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -16,7 +16,7 @@ #include #include "netjet.h" -const char *NETjet_U_revision = "$Revision: 2.8.6.3 $"; +const char *NETjet_U_revision = "$Revision: 2.8.6.4 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/q931.c linux.20p9/drivers/isdn/hisax/q931.c --- linux.vanilla/drivers/isdn/hisax/q931.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/q931.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: q931.c,v 1.10 2000/06/26 08:59:14 keil Exp $ +/* $Id: q931.c,v 1.10.6.2 2001/03/13 16:17:08 kai Exp $ * * q931.c code to decode ITU Q.931 call control messages * * Author Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Changelog * @@ -1228,7 +1228,7 @@ finish = 1; } } else if (sapi == TEI_SAPI) { - dp += sprintf(dp, "tei managment\n"); + dp += sprintf(dp, "tei management\n"); finish = 1; } else { dp += sprintf(dp, "unknown sapi %d broadcast\n", sapi); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/rawhdlc.c linux.20p9/drivers/isdn/hisax/rawhdlc.c --- linux.vanilla/drivers/isdn/hisax/rawhdlc.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/rawhdlc.c Wed Jul 4 16:03:55 2001 @@ -1,11 +1,11 @@ -/* $Id: rawhdlc.c,v 1.5 2000/06/26 08:59:14 keil Exp $ +/* $Id: rawhdlc.c,v 1.5.6.1 2001/02/16 16:43:28 kai Exp $ * * rawhdlc.c support routines for cards that don't support HDLC * * Author Karsten Keil (keil@isdn4linux.de) * Brent Baccala * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930, * don't perform HDLC encapsulation over the B channel. Drivers for diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/rawhdlc.h linux.20p9/drivers/isdn/hisax/rawhdlc.h --- linux.vanilla/drivers/isdn/hisax/rawhdlc.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/rawhdlc.h Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: rawhdlc.h,v 1.3 2000/06/26 08:59:14 keil Exp $ +/* $Id: rawhdlc.h,v 1.3.6.1 2001/02/16 16:43:29 kai Exp $ * * rawhdlc.h support routines for cards that don't support HDLC * * Author Brent Baccala * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/s0box.c linux.20p9/drivers/isdn/hisax/s0box.c --- linux.vanilla/drivers/isdn/hisax/s0box.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/s0box.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: s0box.c,v 2.4 2000/11/24 17:05:38 kai Exp $ +/* $Id: s0box.c,v 2.4.6.1 2001/02/16 16:43:29 kai Exp $ * * s0box.c low level stuff for Creatix S0BOX * * Author S0BOX specific stuff: Enrik Berkhan (enrik@starfleet.inka.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -15,7 +15,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *s0box_revision = "$Revision: 2.4 $"; +const char *s0box_revision = "$Revision: 2.4.6.1 $"; static inline void writereg(unsigned int padr, signed int addr, u_char off, u_char val) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/saphir.c linux.20p9/drivers/isdn/hisax/saphir.c --- linux.vanilla/drivers/isdn/hisax/saphir.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/saphir.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: saphir.c,v 1.8 2000/11/24 17:05:38 kai Exp $ +/* $Id: saphir.c,v 1.8.6.1 2001/02/16 16:43:29 kai Exp $ * * saphir.c low level stuff for HST Saphir 1 * @@ -6,7 +6,7 @@ * * Thanks to HST High Soft Tech GmbH * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -19,7 +19,7 @@ #include "isdnl1.h" extern const char *CardType[]; -static char *saphir_rev = "$Revision: 1.8 $"; +static char *saphir_rev = "$Revision: 1.8.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/sedlbauer.c linux.20p9/drivers/isdn/hisax/sedlbauer.c --- linux.vanilla/drivers/isdn/hisax/sedlbauer.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/sedlbauer.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: sedlbauer.c,v 1.25.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: sedlbauer.c,v 1.25.6.4 2001/02/16 16:43:29 kai Exp $ * * sedlbauer.c low level stuff for Sedlbauer cards * includes support for the Sedlbauer speed star (speed star II), @@ -16,7 +16,7 @@ * Sedlbauer AG for informations * Edgar Toernig * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -53,7 +53,7 @@ extern const char *CardType[]; -const char *Sedlbauer_revision = "$Revision: 1.25.6.3 $"; +const char *Sedlbauer_revision = "$Revision: 1.25.6.4 $"; const char *Sedlbauer_Types[] = {"None", "speed card/win", "speed star", "speed fax+", diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/sportster.c linux.20p9/drivers/isdn/hisax/sportster.c --- linux.vanilla/drivers/isdn/hisax/sportster.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/sportster.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: sportster.c,v 1.14 2000/11/24 17:05:38 kai Exp $ +/* $Id: sportster.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $ * * sportster.c low level stuff for USR Sportster internal TA * @@ -6,7 +6,7 @@ * * Thanks to Christian "naddy" Weisgerber (3Com, US Robotics) for documentation * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -17,7 +17,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *sportster_revision = "$Revision: 1.14 $"; +const char *sportster_revision = "$Revision: 1.14.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/tei.c linux.20p9/drivers/isdn/hisax/tei.c --- linux.vanilla/drivers/isdn/hisax/tei.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/tei.c Wed Jul 4 16:03:55 2001 @@ -1,9 +1,9 @@ -/* $Id: tei.c,v 2.17 2000/11/24 17:05:38 kai Exp $ +/* $Id: tei.c,v 2.17.6.2 2001/05/26 15:19:57 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * For changes and modifications please read * ../../../Documentation/isdn/HiSax.cert * @@ -17,7 +17,7 @@ #include #include -const char *tei_revision = "$Revision: 2.17 $"; +const char *tei_revision = "$Revision: 2.17.6.2 $"; #define ID_REQUEST 1 #define ID_ASSIGNED 2 @@ -446,14 +446,14 @@ #define TEI_FN_COUNT (sizeof(TeiFnList)/sizeof(struct FsmNode)) -void __init +int __init TeiNew(void) { teifsm.state_count = TEI_STATE_COUNT; teifsm.event_count = TEI_EVENT_COUNT; teifsm.strEvent = strTeiEvent; teifsm.strState = strTeiState; - FsmNew(&teifsm, TeiFnList, TEI_FN_COUNT); + return FsmNew(&teifsm, TeiFnList, TEI_FN_COUNT); } void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/teleint.c linux.20p9/drivers/isdn/hisax/teleint.c --- linux.vanilla/drivers/isdn/hisax/teleint.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/teleint.c Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: teleint.c,v 1.14 2000/11/24 17:05:38 kai Exp $ +/* $Id: teleint.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $ * * teleint.c low level stuff for TeleInt isdn cards * * Author Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -17,7 +17,7 @@ extern const char *CardType[]; -const char *TeleInt_revision = "$Revision: 1.14 $"; +const char *TeleInt_revision = "$Revision: 1.14.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/teles0.c linux.20p9/drivers/isdn/hisax/teles0.c --- linux.vanilla/drivers/isdn/hisax/teles0.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/teles0.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: teles0.c,v 2.13 2000/11/24 17:05:38 kai Exp $ +/* $Id: teles0.c,v 2.13.6.1 2001/02/16 16:43:29 kai Exp $ * * teles0.c low level stuff for Teles Memory IO isdn cards * based on the teles driver from Jan den Ouden @@ -9,7 +9,7 @@ * Fritz Elfert * Beat Doebeli * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -21,7 +21,7 @@ extern const char *CardType[]; -const char *teles0_revision = "$Revision: 2.13 $"; +const char *teles0_revision = "$Revision: 2.13.6.1 $"; #define TELES_IOMEM_SIZE 0x400 #define byteout(addr,val) outb(val,addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/teles3.c linux.20p9/drivers/isdn/hisax/teles3.c --- linux.vanilla/drivers/isdn/hisax/teles3.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/teles3.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: teles3.c,v 2.17 2000/11/24 17:05:38 kai Exp $ +/* $Id: teles3.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $ * * teles3.c low level stuff for Teles 16.3 & PNP isdn cards * @@ -10,7 +10,7 @@ * Fritz Elfert * Beat Doebeli * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -21,7 +21,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *teles3_revision = "$Revision: 2.17 $"; +const char *teles3_revision = "$Revision: 2.17.6.1 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/telespci.c linux.20p9/drivers/isdn/hisax/telespci.c --- linux.vanilla/drivers/isdn/hisax/telespci.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/telespci.c Wed Jul 4 16:03:55 2001 @@ -1,11 +1,11 @@ -/* $Id: telespci.c,v 2.16.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: telespci.c,v 2.16.6.4 2001/02/16 16:43:29 kai Exp $ * * telespci.c low level stuff for Teles PCI isdn cards * * Author Ton van Rosmalen * Karsten Keil (keil@isdn4linux.de) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ #define __NO_VERSION__ @@ -19,7 +19,7 @@ #include extern const char *CardType[]; -const char *telespci_revision = "$Revision: 2.16.6.3 $"; +const char *telespci_revision = "$Revision: 2.16.6.4 $"; #define ZORAN_PO_RQ_PEN 0x02000000 #define ZORAN_PO_WR 0x00800000 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/w6692.c linux.20p9/drivers/isdn/hisax/w6692.c --- linux.vanilla/drivers/isdn/hisax/w6692.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/w6692.c Wed Jul 4 16:03:55 2001 @@ -1,11 +1,11 @@ -/* $Id: w6692.c,v 1.12.6.3 2001/02/13 10:33:58 kai Exp $ +/* $Id: w6692.c,v 1.12.6.5 2001/06/09 15:14:18 kai Exp $ * * w6692.c Winbond W6692 specific routines * * Author Petr Novak * (based on HiSax driver by Karsten Keil) * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ @@ -36,7 +36,7 @@ extern const char *CardType[]; -const char *w6692_revision = "$Revision: 1.12.6.3 $"; +const char *w6692_revision = "$Revision: 1.12.6.5 $"; #define DBUSY_TIMER_VALUE 80 @@ -642,8 +642,8 @@ /* !!! not implemented yet */ break; case (HW_DEACTIVATE | RESPONSE): - discard_queue(&cs->rq); - discard_queue(&cs->sq); + skb_queue_purge(&cs->rq); + skb_queue_purge(&cs->sq); if (cs->tx_skb) { dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; @@ -806,8 +806,8 @@ kfree(bcs->blog); bcs->blog = NULL; } - discard_queue(&bcs->rqueue); - discard_queue(&bcs->squeue); + skb_queue_purge(&bcs->rqueue); + skb_queue_purge(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hisax/w6692.h linux.20p9/drivers/isdn/hisax/w6692.h --- linux.vanilla/drivers/isdn/hisax/w6692.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hisax/w6692.h Wed Jul 4 16:03:55 2001 @@ -1,10 +1,10 @@ -/* $Id: w6692.h,v 1.2 2000/06/26 08:59:15 keil Exp $ +/* $Id: w6692.h,v 1.2.6.1 2001/02/16 16:43:29 kai Exp $ * * w6692.h Winbond W6692 specific defines * * Author Petr Novak * - * This file is (c) under GNU PUBLIC LICENSE + * This file is (c) under GNU General Public License * */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/boardergo.c linux.20p9/drivers/isdn/hysdn/boardergo.c --- linux.vanilla/drivers/isdn/hysdn/boardergo.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/boardergo.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: boardergo.c,v 1.5.6.1 2000/12/10 22:01:04 kai Exp $ +/* $Id: boardergo.c,v 1.5.6.3 2001/03/13 16:17:09 kai Exp $ * Linux driver for HYSDN cards, specific routines for ergo type boards. * @@ -270,7 +270,7 @@ return (-ERR_BOOTIMG_FAIL); } } /* start_boot_img */ - return (0); /* successfull */ + return (0); /* successful */ } /* ergo_writebootimg */ /********************************************************************************/ @@ -337,7 +337,7 @@ /***********************************************************************************/ /* ergo_waitpofready waits for a maximum of 10 seconds for the completition of the */ -/* boot process. If the process has been successfull 0 is returned otherwise a */ +/* boot process. If the process has been successful 0 is returned otherwise a */ /* negative error code is returned. */ /***********************************************************************************/ static int @@ -361,7 +361,7 @@ (dpr->ToPcSize < MIN_RDY_MSG_SIZE) || (dpr->ToPcSize > MAX_RDY_MSG_SIZE) || ((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC)) - break; /* an error occured */ + break; /* an error occurred */ /* Check for additional data delivered during SysReady */ msg_size = dpr->ToPcSize - RDY_MAGIC_SIZE; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hycapi.c linux.20p9/drivers/isdn/hysdn/hycapi.c --- linux.vanilla/drivers/isdn/hysdn/hycapi.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hycapi.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hycapi.c,v 1.8 2000/11/22 17:13:13 kai Exp $ +/* $Id: hycapi.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $ * * Linux driver for HYSDN cards, CAPI2.0-Interface. * written by Ulrich Albrecht (u.albrecht@hypercope.de) for Hypercope GmbH @@ -41,7 +41,7 @@ #include "hysdn_defs.h" #include -static char hycapi_revision[]="$Revision: 1.8 $"; +static char hycapi_revision[]="$Revision: 1.8.6.1 $"; typedef struct _hycapi_appl { unsigned int ctrl_mask; @@ -522,7 +522,7 @@ /****************************************************************** hycapi_rx_capipkt -Recieve a capi-message. +Receive a capi-message. All B3_DATA_IND are converted to 64K-extension compatible format. New nccis are created if neccessary. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hysdn_boot.c linux.20p9/drivers/isdn/hysdn/hysdn_boot.c --- linux.vanilla/drivers/isdn/hysdn/hysdn_boot.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hysdn_boot.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_boot.c,v 1.4.6.1 2001/02/10 14:41:22 kai Exp $ +/* $Id: hysdn_boot.c,v 1.4.6.3 2001/03/13 16:17:09 kai Exp $ * Linux driver for HYSDN cards, specific routines for booting and pof handling. * @@ -49,7 +49,7 @@ uchar pof_state; /* actual state of read handler */ uchar is_crypted; /* card data is crypted */ int BufSize; /* actual number of bytes bufferd */ - int last_error; /* last occured error */ + int last_error; /* last occurred error */ word pof_recid; /* actual pof recid */ ulong pof_reclen; /* total length of pof record data */ ulong pof_recoffset; /* actual offset inside pof record */ @@ -62,7 +62,7 @@ }; /*****************************************************/ -/* start decryption of sucessive POF file chuncks. */ +/* start decryption of successive POF file chuncks. */ /* */ /* to be called at start of POF file reading, */ /* before starting any decryption on any POF record. */ @@ -93,7 +93,7 @@ /********************************************************************************/ /* pof_handle_data executes the required actions dependant on the active record */ -/* id. If successfull 0 is returned, a negative value shows an error. */ +/* id. If successful 0 is returned, a negative value shows an error. */ /********************************************************************************/ static int pof_handle_data(hysdn_card * card, int datlen) @@ -182,7 +182,7 @@ /* number of data bytes. The number delivered is additionally supplied for */ /* verification. The functions handles the data and returns the needed number */ /* of bytes for the next action. If the returned value is 0 or less an error */ -/* occured and booting must be aborted. */ +/* occurred and booting must be aborted. */ /******************************************************************************/ int pof_write_buffer(hysdn_card * card, int datlen) @@ -253,7 +253,7 @@ break; } if ((boot->last_error = pof_handle_data(card, datlen)) < 0) - return (boot->last_error); /* an error occured */ + return (boot->last_error); /* an error occurred */ boot->pof_recoffset += datlen; if (boot->pof_recoffset >= boot->pof_reclen) { boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ @@ -346,7 +346,7 @@ /*********************************************************************************/ /* EvalSysrTokData checks additional records delivered with the Sysready Message */ -/* when POF has been booted. A return value of 0 is used if no error occured. */ +/* when POF has been booted. A return value of 0 is used if no error occurred. */ /*********************************************************************************/ int EvalSysrTokData(hysdn_card * card, uchar * cp, int len) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hysdn_init.c linux.20p9/drivers/isdn/hysdn/hysdn_init.c --- linux.vanilla/drivers/isdn/hysdn/hysdn_init.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hysdn_init.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_init.c,v 1.6.6.4 2001/02/10 14:41:22 kai Exp $ +/* $Id: hysdn_init.c,v 1.6.6.5 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, init functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -32,7 +32,7 @@ #include "hysdn_defs.h" -static char *hysdn_init_revision = "$Revision: 1.6.6.4 $"; +static char *hysdn_init_revision = "$Revision: 1.6.6.5 $"; int cardmax; /* number of found cards */ hysdn_card *card_root = NULL; /* pointer to first card */ @@ -189,7 +189,7 @@ /****************************************************************************/ /* init_module is called once when the module is loaded to do all necessary */ /* things like autodetect... */ -/* If the return value of this function is 0 the init has been successfull */ +/* If the return value of this function is 0 the init has been successful */ /* and the module is added to the list in /proc/modules, otherwise an error */ /* is assumed and the module will not be kept in memory. */ /****************************************************************************/ @@ -227,7 +227,7 @@ /***********************************************************************/ /* cleanup_module is called when the module is released by the kernel. */ -/* The routine is only called if init_module has been successfull and */ +/* The routine is only called if init_module has been successful and */ /* the module counter has a value of 0. Otherwise this function will */ /* not be called. This function must release all resources still allo- */ /* cated as after the return from this function the module code will */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hysdn_net.c linux.20p9/drivers/isdn/hysdn/hysdn_net.c --- linux.vanilla/drivers/isdn/hysdn/hysdn_net.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hysdn_net.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_net.c,v 1.8 2000/11/13 22:51:47 kai Exp $ +/* $Id: hysdn_net.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $ * Linux driver for HYSDN cards, net (ethernet type) handling routines. * @@ -38,7 +38,7 @@ #include "hysdn_defs.h" /* store the actual version for log reporting */ -char *hysdn_net_revision = "$Revision: 1.8 $"; +char *hysdn_net_revision = "$Revision: 1.8.6.1 $"; #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */ @@ -317,7 +317,7 @@ if (card->debug_flags & LOG_NET_INIT) hysdn_addlog(card, "network device deleted"); - return (0); /* always successfull */ + return (0); /* always successful */ } /* hysdn_net_release */ /*****************************************************************************/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hysdn_procconf.c linux.20p9/drivers/isdn/hysdn/hysdn_procconf.c --- linux.vanilla/drivers/isdn/hysdn/hysdn_procconf.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hysdn_procconf.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_procconf.c,v 1.8 2000/11/13 22:51:47 kai Exp $ +/* $Id: hysdn_procconf.c,v 1.8.6.1 2001/03/13 16:17:09 kai Exp $ * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -30,7 +30,7 @@ #include "hysdn_defs.h" -static char *hysdn_procconf_revision = "$Revision: 1.8 $"; +static char *hysdn_procconf_revision = "$Revision: 1.8.6.1 $"; #define INFO_OUT_LEN 80 /* length of info line including lf */ @@ -55,7 +55,7 @@ /***********************************************************************/ /* process_line parses one config line and transfers it to the card if */ /* necessary. */ -/* if the return value is negative an error occured. */ +/* if the return value is negative an error occurred. */ /***********************************************************************/ static int process_line(struct conf_writedata *cnf) @@ -129,7 +129,7 @@ if (ch == 0x1A) { /* we detected a pof file */ if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0) - return (cnf->needed_size); /* an error occured -> exit */ + return (cnf->needed_size); /* an error occurred -> exit */ cnf->buf_size = 0; /* buffer is empty */ cnf->state = CONF_STATE_POF; /* new state */ } else { @@ -157,7 +157,7 @@ cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size); /* write data */ if (cnf->needed_size <= 0) { cnf->card->state = CARD_STATE_BOOTERR; /* show boot error */ - return (cnf->needed_size); /* an error occured */ + return (cnf->needed_size); /* an error occurred */ } cnf->buf_size = 0; /* buffer is empty again */ } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/hysdn/hysdn_sched.c linux.20p9/drivers/isdn/hysdn/hysdn_sched.c --- linux.vanilla/drivers/isdn/hysdn/hysdn_sched.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/hysdn/hysdn_sched.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_sched.c,v 1.5 2000/11/22 17:13:13 kai Exp $ +/* $Id: hysdn_sched.c,v 1.5.6.1 2001/03/13 16:17:09 kai Exp $ * Linux driver for HYSDN cards, scheduler routines for handling exchange card <-> pc. * @@ -141,7 +141,7 @@ /*****************************************************************************/ -/* send one config line to the card and return 0 if successfull, otherwise a */ +/* send one config line to the card and return 0 if successful, otherwise a */ /* negative error code. */ /* The function works with timeouts perhaps not giving the greatest speed */ /* sending the line, but this should be meaningless beacuse only some lines */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/icn/icn.c linux.20p9/drivers/isdn/icn/icn.c --- linux.vanilla/drivers/isdn/icn/icn.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/icn/icn.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: icn.c,v 1.65.6.2 2000/12/17 22:45:13 kai Exp $ +/* $Id: icn.c,v 1.65.6.5 2001/06/09 15:14:19 kai Exp $ * ISDN low-level module for the ICN active ISDN-Card. * @@ -34,7 +34,7 @@ #undef MAP_DEBUG static char -*revision = "$Revision: 1.65.6.2 $"; +*revision = "$Revision: 1.65.6.5 $"; static int icn_addcard(int, char *, char *); @@ -51,8 +51,7 @@ struct sk_buff *skb; unsigned long flags; - while ((skb = skb_dequeue(queue))) - dev_kfree_skb(skb); + skb_queue_purge(queue); save_flags(flags); cli(); card->xlen[channel] = 0; @@ -838,23 +837,23 @@ card->other->rvalid = 1; } if (!dev.mvalid) { - if (check_shmem((ulong) dev.shmem, 0x4000)) { + if (check_mem_region(dev.memaddr, 0x4000)) { printk(KERN_WARNING - "icn: memory at 0x%08lx in use.\n", - (ulong) dev.shmem); + "icn: memory at 0x%08lx in use.\n", dev.memaddr); restore_flags(flags); return -EBUSY; } - request_shmem((ulong) dev.shmem, 0x4000, "icn"); + request_mem_region(dev.memaddr, 0x4000, "icn-isdn (all cards)"); + dev.shmem = ioremap(dev.memaddr, 0x4000); dev.mvalid = 1; } restore_flags(flags); OUTB_P(0, ICN_RUN); /* Reset Controller */ OUTB_P(0, ICN_MAPRAM); /* Disable RAM */ icn_shiftout(ICN_CFG, 0x0f, 3, 4); /* Windowsize= 16k */ - icn_shiftout(ICN_CFG, (unsigned long) dev.shmem, 23, 10); /* Set RAM-Addr. */ + icn_shiftout(ICN_CFG, dev.memaddr, 23, 10); /* Set RAM-Addr. */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "shmem=%08lx\n", (ulong) dev.shmem); + printk(KERN_DEBUG "shmem=%08lx\n", dev.memaddr); #endif SLEEP(1); #ifdef BOOT_DEBUG @@ -868,7 +867,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif if (card->doubleS0) { SLEEP(1); @@ -884,7 +883,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif } kfree(codebuf); @@ -1177,29 +1176,31 @@ memcpy(&a, c->parm.num, sizeof(ulong)); switch (c->arg) { case ICN_IOCTL_SETMMIO: - if ((unsigned long) dev.shmem != (a & 0x0ffc000)) { - if (check_shmem((ulong) (a & 0x0ffc000), 0x4000)) { + if (dev.memaddr != (a & 0x0ffc000)) { + if (check_mem_region(a & 0x0ffc000, 0x4000)) { printk(KERN_WARNING "icn: memory at 0x%08lx in use.\n", - (ulong) (a & 0x0ffc000)); + a & 0x0ffc000); return -EINVAL; } icn_stopallcards(); save_flags(flags); cli(); - if (dev.mvalid) - release_shmem((ulong) dev.shmem, 0x4000); + if (dev.mvalid) { + iounmap(dev.shmem); + release_mem_region(dev.memaddr, 0x4000); + } dev.mvalid = 0; - dev.shmem = (icn_shmem *) (a & 0x0ffc000); + dev.memaddr = a & 0x0ffc000; restore_flags(flags); printk(KERN_INFO "icn: (%s) mmio set to 0x%08lx\n", CID, - (unsigned long) dev.shmem); + dev.memaddr); } break; case ICN_IOCTL_GETMMIO: - return (long) dev.shmem; + return (long) dev.memaddr; case ICN_IOCTL_SETPORT: if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330 || a == 0x340 || a == 0x350 || a == 0x360 || @@ -1649,7 +1650,7 @@ if (ints[0]) portbase = ints[1]; if (ints[0] > 1) - membase = ints[2]; + membase = (unsigned long)ints[2]; if (str && *str) { strcpy(sid, str); icn_id = sid; @@ -1668,7 +1669,7 @@ char rev[10]; memset(&dev, 0, sizeof(icn_dev)); - dev.shmem = (icn_shmem *) ((unsigned long) membase & 0x0ffc000); + dev.memaddr = (membase & 0x0ffc000); dev.channel = -1; dev.mcard = NULL; dev.firstload = 1; @@ -1680,7 +1681,7 @@ } else strcpy(rev, " ??? "); printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev, - (ulong) dev.shmem); + dev.memaddr); return (icn_addcard(portbase, icn_id, icn_id2)); } @@ -1714,8 +1715,10 @@ card = card->next; kfree(last); } - if (dev.mvalid) - release_shmem((ulong) dev.shmem, 0x4000); + if (dev.mvalid) { + iounmap(dev.shmem); + release_mem_region(dev.memaddr, 0x4000); + } printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n"); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/icn/icn.h linux.20p9/drivers/isdn/icn/icn.h --- linux.vanilla/drivers/isdn/icn/icn.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/icn/icn.h Wed Aug 8 22:50:03 2001 @@ -1,4 +1,4 @@ -/* $Id: icn.h,v 1.30.6.1 2001/02/10 14:41:23 kai Exp $ +/* $Id: icn.h,v 1.30.6.3 2001/04/20 02:42:01 keil Exp $ * ISDN lowlevel-module for the ICN active ISDN-Card. * @@ -187,6 +187,7 @@ * Main driver data */ typedef struct icn_dev { + unsigned long memaddr; /* Address of memory mapped buffers */ icn_shmem *shmem; /* Pointer to memory-mapped-buffers */ int mvalid; /* IO-shmem has been requested */ int channel; /* Currently mapped channel */ @@ -210,16 +211,16 @@ * integers. */ static int portbase = ICN_BASEADDR; -static int membase = ICN_MEMADDR; +static unsigned long membase = ICN_MEMADDR; static char *icn_id = "\0"; static char *icn_id2 = "\0"; #ifdef MODULE MODULE_AUTHOR("Fritz Elfert"); MODULE_PARM(portbase, "i"); -MODULE_PARM_DESC(portbase, "Port adress of first card"); -MODULE_PARM(membase, "i"); -MODULE_PARM_DESC(membase, "Shared memory adress of all cards"); +MODULE_PARM_DESC(portbase, "Port address of first card"); +MODULE_PARM(membase, "l"); +MODULE_PARM_DESC(membase, "Shared memory address of all cards"); MODULE_PARM(icn_id, "s"); MODULE_PARM_DESC(icn_id, "ID-String of first card"); MODULE_PARM(icn_id2, "s"); @@ -287,13 +288,5 @@ #define MIN(a,b) ((ab)?a:b) -/* Hopefully, a separate resource-registration-scheme for shared-memory - * will be introduced into the kernel. Until then, we use the normal - * routines, designed for port-registration. - */ -#define check_shmem check_region -#define release_shmem release_region -#define request_shmem request_region - #endif /* defined(__KERNEL__) || defined(__DEBUGVAR__) */ #endif /* icn_h */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_bsdcomp.c linux.20p9/drivers/isdn/isdn_bsdcomp.c --- linux.vanilla/drivers/isdn/isdn_bsdcomp.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_bsdcomp.c Thu Jul 26 15:58:58 2001 @@ -76,6 +76,7 @@ #include #include #include +#include #include diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_common.c linux.20p9/drivers/isdn/isdn_common.c --- linux.vanilla/drivers/isdn/isdn_common.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_common.c Thu Jul 26 15:34:08 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_common.c,v 1.114.6.7 2001/02/10 14:41:19 kai Exp $ +/* $Id: isdn_common.c,v 1.114.6.12 2001/06/09 15:14:15 kai Exp $ * Linux ISDN subsystem, common used functions (linklevel). * @@ -42,7 +42,7 @@ #endif #ifdef CONFIG_ISDN_DIVERSION #include -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ #include "isdn_v110.h" /* Debugflags */ @@ -50,7 +50,7 @@ isdn_dev *dev; -static char *isdn_revision = "$Revision: 1.114.6.7 $"; +static char *isdn_revision = "$Revision: 1.114.6.12 $"; extern char *isdn_net_revision; extern char *isdn_tty_revision; @@ -68,7 +68,7 @@ #ifdef CONFIG_ISDN_DIVERSION static isdn_divert_if *divert_if; /* = NULL */ -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ static int isdn_writebuf_stub(int, int, const u_char *, int, int); @@ -230,20 +230,6 @@ return isdn_wildmat( TmpMsn1, TmpMsn2 ); } -static void -isdn_free_queue(struct sk_buff_head *queue) -{ - struct sk_buff *skb; - unsigned long flags; - - save_flags(flags); - cli(); - if (skb_queue_len(queue)) - while ((skb = skb_dequeue(queue))) - dev_kfree_skb(skb); - restore_flags(flags); -} - int isdn_dc2minor(int di, int ch) { @@ -257,7 +243,6 @@ static int isdn_timer_cnt1 = 0; static int isdn_timer_cnt2 = 0; static int isdn_timer_cnt3 = 0; -static int isdn_timer_cnt4 = 0; static void isdn_timer_funct(ulong dummy) @@ -281,16 +266,11 @@ isdn_timer_cnt2 = 0; if (tf & ISDN_TIMER_NETHANGUP) isdn_net_autohup(); - if (++isdn_timer_cnt3 > ISDN_TIMER_RINGING) { + if (++isdn_timer_cnt3 >= ISDN_TIMER_RINGING) { isdn_timer_cnt3 = 0; if (tf & ISDN_TIMER_MODEMRING) isdn_tty_modem_ring(); } - if (++isdn_timer_cnt4 > ISDN_TIMER_KEEPINT) { - isdn_timer_cnt4 = 0; - if (tf & ISDN_TIMER_KEEPALIVE) - isdn_net_slarp_out(); - } if (tf & ISDN_TIMER_CARRIER) isdn_tty_carrier_timeout(); } @@ -309,7 +289,7 @@ void isdn_timer_ctrl(int tf, int onoff) { - int flags; + int flags, old_tflags; save_flags(flags); cli(); @@ -318,11 +298,12 @@ isdn_timer_cnt1 = 0; isdn_timer_cnt2 = 0; } + old_tflags = dev->tflags; if (onoff) dev->tflags |= tf; else dev->tflags &= ~tf; - if (dev->tflags) + if (dev->tflags && !old_tflags) mod_timer(&dev->timer, jiffies+ISDN_TIMER_RES); restore_flags(flags); } @@ -516,7 +497,7 @@ if (divert_if) if ((retval = divert_if->stat_callback(c))) return(retval); /* processed */ -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ if ((!retval) && (dev->drv[di]->flags & DRV_FLAG_REJBUS)) { /* No tty responding */ cmd.driver = di; @@ -589,7 +570,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; case ISDN_STAT_DISPLAY: #ifdef ISDN_DEBUG_STATCALLB @@ -599,7 +580,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; case ISDN_STAT_DCONN: if (i < 0) @@ -641,7 +622,7 @@ #ifdef CONFIG_ISDN_DIVERSION if (divert_if) divert_if->stat_callback(c); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ break; break; case ISDN_STAT_BCONN: @@ -740,7 +721,7 @@ kfree(dev->drv[di]->rcverr); kfree(dev->drv[di]->rcvcount); for (i = 0; i < dev->drv[di]->channels; i++) - isdn_free_queue(&dev->drv[di]->rpqueue[i]); + skb_queue_purge(&dev->drv[di]->rpqueue[i]); kfree(dev->drv[di]->rpqueue); kfree(dev->drv[di]->rcv_waitq); kfree(dev->drv[di]); @@ -769,7 +750,7 @@ case ISDN_STAT_REDIR: if (divert_if) return(divert_if->stat_callback(c)); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ default: return -1; } @@ -1021,7 +1002,7 @@ retval = -ENODEV; goto out; } - if (minor < ISDN_MINOR_CTRL) { + if (minor <= ISDN_MINOR_BMAX) { printk(KERN_WARNING "isdn_read minor %d obsolete!\n", minor); drvidx = isdn_minor2drv(minor); if (drvidx < 0) { @@ -1112,7 +1093,7 @@ if (!dev->drivers) return -ENODEV; - if (minor < ISDN_MINOR_CTRL) { + if (minor <= ISDN_MINOR_BMAX) { printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor); drvidx = isdn_minor2drv(minor); if (drvidx < 0) { @@ -1262,7 +1243,7 @@ } if (!dev->drivers) return -ENODEV; - if (minor < ISDN_MINOR_CTRL) { + if (minor <= ISDN_MINOR_BMAX) { drvidx = isdn_minor2drv(minor); if (drvidx < 0) return -ENODEV; @@ -1678,7 +1659,7 @@ } if (!dev->channels) goto out; - if (minor < ISDN_MINOR_CTRL) { + if (minor <= ISDN_MINOR_BMAX) { printk(KERN_WARNING "isdn_open minor %d obsolete!\n", minor); drvidx = isdn_minor2drv(minor); if (drvidx < 0) @@ -1739,7 +1720,7 @@ goto out; } isdn_unlock_drivers(); - if (minor < ISDN_MINOR_CTRL) + if (minor <= ISDN_MINOR_BMAX) goto out; if (minor <= ISDN_MINOR_CTRLMAX) { if (dev->profd == current) @@ -1869,7 +1850,7 @@ dev->v110[i] = NULL; // 20.10.99 JIM, try to reinitialize v110 ! isdn_info_update(); - isdn_free_queue(&dev->drv[di]->rpqueue[ch]); + skb_queue_purge(&dev->drv[di]->rpqueue[ch]); } restore_flags(flags); } @@ -2032,7 +2013,7 @@ if ((adding) && (d->rpqueue)) { for (j = 0; j < d->channels; j++) - isdn_free_queue(&d->rpqueue[j]); + skb_queue_purge(&d->rpqueue[j]); kfree(d->rpqueue); } if (!(d->rpqueue = @@ -2149,7 +2130,7 @@ EXPORT_SYMBOL(DIVERT_REG_NAME); -#endif CONFIG_ISDN_DIVERSION +#endif /* CONFIG_ISDN_DIVERSION */ EXPORT_SYMBOL(register_isdn); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_net.c linux.20p9/drivers/isdn/isdn_net.c --- linux.vanilla/drivers/isdn/isdn_net.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_net.c Thu Jul 26 15:37:36 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_net.c,v 1.140.6.3 2001/02/07 11:31:30 kai Exp $ +/* $Id: isdn_net.c,v 1.140.6.6 2001/06/11 22:08:37 kai Exp $ * Linux ISDN subsystem, network interfaces and related functions (linklevel). * @@ -22,6 +22,11 @@ * */ +/* Jan 2001: fix CISCO HDLC Bjoern A. Zeeb + * for info on the protocol, see + * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt + */ + #include #define __NO_VERSION__ #include @@ -30,9 +35,9 @@ #include #include #include -#include #include "isdn_common.h" #include "isdn_net.h" +#include #ifdef CONFIG_ISDN_PPP #include "isdn_ppp.h" #endif @@ -183,7 +188,10 @@ int isdn_net_force_dial_lp(isdn_net_local *); static int isdn_net_start_xmit(struct sk_buff *, struct device *); -char *isdn_net_revision = "$Revision: 1.140.6.3 $"; +static void isdn_net_ciscohdlck_connected(isdn_net_local *lp); +static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp); + +char *isdn_net_revision = "$Revision: 1.140.6.6 $"; /* * Code for raw-networking over ISDN @@ -294,13 +302,11 @@ isdn_net_unbind_channel(isdn_net_local * lp) { ulong flags; - struct sk_buff *skb; save_flags(flags); cli(); - while ((skb = skb_dequeue(&lp->super_tx_queue))) { - kfree_skb(skb); - } + skb_queue_purge(&lp->super_tx_queue); + if (!lp->master) { /* reset only master device */ /* Moral equivalent of dev_purge_queues(): BEWARE! This chunk of code cannot be called from hardware @@ -455,6 +461,8 @@ pops -> disconn_ind(cprot); #endif /* CONFIG_ISDN_X25 */ if ((!lp->dialstate) && (lp->flags & ISDN_NET_CONNECTED)) { + if (lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK) + isdn_net_ciscohdlck_disconnected(lp); #ifdef CONFIG_ISDN_PPP if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) isdn_ppp_free(lp); @@ -499,7 +507,7 @@ lp->dialstate = 0; isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 1); if (lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK) - isdn_timer_ctrl(ISDN_TIMER_KEEPALIVE, 1); + isdn_net_ciscohdlck_connected(lp); if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) { if (lp->master) { /* is lp a slave? */ isdn_net_dev *nd = ((isdn_net_local *)lp->master->priv)->netdev; @@ -661,7 +669,7 @@ isdn_net_hangup(&p->dev); break; } - if (!strcmp(lp->dial->num, "LEASED")) { + if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) { restore_flags(flags); lp->dialstate = 4; printk(KERN_INFO "%s: Open leased line ...\n", lp->name); @@ -1403,92 +1411,347 @@ return htons(ETH_P_802_2); } -static void -isdn_net_slarp_send(isdn_net_local *lp, int is_reply) + +/* + * CISCO HDLC keepalive specific stuff + */ +static struct sk_buff* +isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len) { unsigned short hl = dev->drv[lp->isdn_device]->interface->hl_hdrlen; - struct sk_buff *skb = alloc_skb(hl + sizeof(cisco_hdr) + sizeof(cisco_slarp), GFP_ATOMIC); - unsigned long t = (jiffies / HZ * 1000000); - cisco_hdr *ch; - cisco_slarp *s; + struct sk_buff *skb; + skb = alloc_skb(hl + len, GFP_ATOMIC); if (!skb) { - printk(KERN_WARNING - "%s: Could not allocate SLARP reply\n", lp->name); - return; + printk("isdn out of mem at %s:%d!\n", __FILE__, __LINE__); + return 0; } skb_reserve(skb, hl); - ch = (cisco_hdr *)skb_put(skb, sizeof(cisco_hdr)); - ch->addr = CISCO_ADDR_UNICAST; - ch->ctrl = 0; - ch->type = htons(CISCO_TYPE_SLARP); - s = (cisco_slarp *)skb_put(skb, sizeof(cisco_slarp)); - if (is_reply) { - s->code = htonl(CISCO_SLARP_REPLY); - memset(&s->slarp.reply.ifaddr, 0, sizeof(__u32)); - memset(&s->slarp.reply.netmask, 0, sizeof(__u32)); - } else { - lp->cisco_myseq++; - s->code = htonl(CISCO_SLARP_KEEPALIVE); - s->slarp.keepalive.my_seq = htonl(lp->cisco_myseq); - s->slarp.keepalive.your_seq = htonl(lp->cisco_yourseq); - } - s->rel = 0xffff; - s->t1 = t >> 16; - s->t0 = t & 0xffff; - isdn_net_write_super(lp, skb); + return skb; } -static void -isdn_net_slarp_in(isdn_net_local *lp, struct sk_buff *skb) +/* cisco hdlck device private ioctls */ +static int +isdn_ciscohdlck_dev_ioctl(struct device *dev, struct ifreq *ifr, int cmd) { - cisco_slarp *s = (cisco_slarp *)skb->data; + isdn_net_local *lp = (isdn_net_local *) dev->priv; + unsigned long len = 0; + unsigned long expires = 0; + int tmp = 0; + int period = lp->cisco_keepalive_period; + char debserint = lp->cisco_debserint; + int rc = 0; + + if (lp->p_encap != ISDN_NET_ENCAP_CISCOHDLCK) + return -EINVAL; + + switch (cmd) { + /* get/set keepalive period */ + case SIOCGKEEPPERIOD: + len = (unsigned long)sizeof(lp->cisco_keepalive_period); + if (copy_to_user((char *)ifr->ifr_ifru.ifru_data, + (int *)&lp->cisco_keepalive_period, len)) + rc = -EFAULT; + break; + case SIOCSKEEPPERIOD: + tmp = lp->cisco_keepalive_period; + len = (unsigned long)sizeof(lp->cisco_keepalive_period); + if (copy_from_user((int *)&period, + (char *)ifr->ifr_ifru.ifru_data, len)) + rc = -EFAULT; + if ((period > 0) && (period <= 32767)) + lp->cisco_keepalive_period = period; + else + rc = -EINVAL; + if (!rc && (tmp != lp->cisco_keepalive_period)) { + expires = (unsigned long)(jiffies + + lp->cisco_keepalive_period * HZ); + mod_timer(&lp->cisco_timer, expires); + printk(KERN_INFO "%s: Keepalive period set " + "to %d seconds.\n", + lp->name, lp->cisco_keepalive_period); + } + break; - switch (ntohl(s->code)) { - case CISCO_SLARP_REQUEST: - isdn_net_slarp_send(lp, 1); - break; - case CISCO_SLARP_REPLY: - /* Ignore replies */ - break; - case CISCO_SLARP_KEEPALIVE: - lp->cisco_yourseq = s->slarp.keepalive.my_seq; - if (ntohl(s->slarp.keepalive.my_seq == lp->cisco_myseq)) { - if (lp->cisco_loop++ == 2) { - printk(KERN_WARNING "%s: Keepalive Loop\n", - lp->name); - lp->cisco_myseq ^= jiffies; - } - } else - lp->cisco_loop = 0; + /* get/set debugging */ + case SIOCGDEBSERINT: + len = (unsigned long)sizeof(lp->cisco_debserint); + if (copy_to_user((char *)ifr->ifr_ifru.ifru_data, + (char *)&lp->cisco_debserint, len)) + rc = -EFAULT; + break; + case SIOCSDEBSERINT: + len = (unsigned long)sizeof(lp->cisco_debserint); + if (copy_from_user((char *)&debserint, + (char *)ifr->ifr_ifru.ifru_data, len)) + rc = -EFAULT; + if ((debserint >= 0) && (debserint <= 64)) + lp->cisco_debserint = debserint; + else + rc = -EINVAL; + break; + + default: + rc = -EINVAL; break; } - kfree_skb(skb); + return (rc); } -/* - * Called every 10 sec. via timer-interrupt if - * any network-interface has Cisco-Keepalive-Encapsulation - * and is online. - * Send Keepalive-Packet and re-schedule. - */ -void -isdn_net_slarp_out(void) +/* called via cisco_timer.function */ +static void +isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data) { - isdn_net_dev *p = dev->netdev; - int anymore = 0; + isdn_net_local *lp = (isdn_net_local *) data; + struct sk_buff *skb; + unsigned char *p; + unsigned long last_cisco_myseq = lp->cisco_myseq; + int myseq_diff = 0; - while (p) { - isdn_net_local *l = p->local; - if ((l->p_encap == ISDN_NET_ENCAP_CISCOHDLCK) && - (l->flags & ISDN_NET_CONNECTED) && - (!l->dialstate) ) { - anymore = 1; - isdn_net_slarp_send(l, 0); + if (!(lp->flags & ISDN_NET_CONNECTED) || lp->dialstate) { + printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__); + return; + } + lp->cisco_myseq++; + + myseq_diff = (lp->cisco_myseq - lp->cisco_mineseen); + if ((lp->cisco_line_state) && ((myseq_diff >= 3)||(myseq_diff <= -3))) { + /* line up -> down */ + lp->cisco_line_state = 0; + printk (KERN_WARNING + "UPDOWN: Line protocol on Interface %s," + " changed state to down\n", lp->name); + /* should stop routing higher-level data accross */ + } else if ((!lp->cisco_line_state) && + (myseq_diff >= 0) && (myseq_diff <= 2)) { + /* line down -> up */ + lp->cisco_line_state = 1; + printk (KERN_WARNING + "UPDOWN: Line protocol on Interface %s," + " changed state to up\n", lp->name); + /* restart routing higher-level data accross */ + } + + if (lp->cisco_debserint) + printk (KERN_DEBUG "%s: HDLC " + "myseq %lu, mineseen %lu%c, yourseen %lu, %s\n", + lp->name, last_cisco_myseq, lp->cisco_mineseen, + ((last_cisco_myseq == lp->cisco_mineseen) ? '*' : 040), + lp->cisco_yourseq, + ((lp->cisco_line_state) ? "line up" : "line down")); + + skb = isdn_net_ciscohdlck_alloc_skb(lp, 4 + 14); + if (!skb) + return; + + p = skb_put(skb, 4 + 14); + + /* cisco header */ + p += put_u8 (p, CISCO_ADDR_UNICAST); + p += put_u8 (p, CISCO_CTRL); + p += put_u16(p, CISCO_TYPE_SLARP); + + /* slarp keepalive */ + p += put_u32(p, CISCO_SLARP_KEEPALIVE); + p += put_u32(p, lp->cisco_myseq); + p += put_u32(p, lp->cisco_yourseq); + p += put_u16(p, 0xffff); // reliablity, always 0xffff + + isdn_net_write_super(lp, skb); + + lp->cisco_timer.expires = jiffies + lp->cisco_keepalive_period * HZ; + + add_timer(&lp->cisco_timer); +} + +static void +isdn_net_ciscohdlck_slarp_send_request(isdn_net_local *lp) +{ + struct sk_buff *skb; + unsigned char *p; + + skb = isdn_net_ciscohdlck_alloc_skb(lp, 4 + 14); + if (!skb) + return; + + p = skb_put(skb, 4 + 14); + + /* cisco header */ + p += put_u8 (p, CISCO_ADDR_UNICAST); + p += put_u8 (p, CISCO_CTRL); + p += put_u16(p, CISCO_TYPE_SLARP); + + /* slarp request */ + p += put_u32(p, CISCO_SLARP_REQUEST); + p += put_u32(p, 0); // address + p += put_u32(p, 0); // netmask + p += put_u16(p, 0); // unused + + isdn_net_write_super(lp, skb); +} + +static void +isdn_net_ciscohdlck_connected(isdn_net_local *lp) +{ + lp->cisco_myseq = 0; + lp->cisco_mineseen = 0; + lp->cisco_yourseq = 0; + lp->cisco_keepalive_period = ISDN_TIMER_KEEPINT; + lp->cisco_last_slarp_in = 0; + lp->cisco_line_state = 0; + lp->cisco_debserint = 0; + + /* send slarp request because interface/seq.no.s reset */ + isdn_net_ciscohdlck_slarp_send_request(lp); + + init_timer(&lp->cisco_timer); + lp->cisco_timer.data = (unsigned long) lp; + lp->cisco_timer.function = isdn_net_ciscohdlck_slarp_send_keepalive; + lp->cisco_timer.expires = jiffies + lp->cisco_keepalive_period * HZ; + add_timer(&lp->cisco_timer); +} + +static void +isdn_net_ciscohdlck_disconnected(isdn_net_local *lp) +{ + del_timer(&lp->cisco_timer); +} + +static void +isdn_net_ciscohdlck_slarp_send_reply(isdn_net_local *lp) +{ + struct sk_buff *skb; + unsigned char *p; + struct in_device *in_dev = NULL; + u32 addr = 0; /* local ipv4 address */ + u32 mask = 0; /* local netmask */ + + if ((in_dev = lp->netdev->dev.ip_ptr) != NULL) { + /* take primary(first) address of interface */ + struct in_ifaddr *ifa = in_dev->ifa_list; + if (ifa != NULL) { + addr = ifa->ifa_local; + mask = ifa->ifa_mask; } - p = (isdn_net_dev *) p->next; } - isdn_timer_ctrl(ISDN_TIMER_KEEPALIVE, anymore); + + skb = isdn_net_ciscohdlck_alloc_skb(lp, 4 + 14); + if (!skb) + return; + + p = skb_put(skb, 4 + 14); + + /* cisco header */ + p += put_u8 (p, CISCO_ADDR_UNICAST); + p += put_u8 (p, CISCO_CTRL); + p += put_u16(p, CISCO_TYPE_SLARP); + + /* slarp reply, send own ip/netmask; if values are nonsense remote + * should think we are unable to provide it with an address via SLARP */ + p += put_u32(p, CISCO_SLARP_REPLY); + p += put_u32(p, addr); // address + p += put_u32(p, mask); // netmask + p += put_u16(p, 0); // unused + + isdn_net_write_super(lp, skb); +} + +static void +isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) +{ + unsigned char *p; + int period; + __u32 code; + __u32 my_seq, addr; + __u32 your_seq, mask; + __u16 unused; + + if (skb->len < 14) + return; + + p = skb->data; + p += get_u32(p, &code); + + switch (code) { + case CISCO_SLARP_REQUEST: + lp->cisco_yourseq = 0; + isdn_net_ciscohdlck_slarp_send_reply(lp); + break; + case CISCO_SLARP_REPLY: + /* Ignore replies - at least for now */ + if (lp->cisco_debserint) { + p += get_u32(p, &addr); + p += get_u32(p, &mask); + p += get_u16(p, &unused); + printk(KERN_DEBUG "%s: got slarp reply (%ul/%ul) - " + "ignored\n", lp->name, addr, mask); + } + break; + case CISCO_SLARP_KEEPALIVE: + period = (int)((jiffies - lp->cisco_last_slarp_in + + HZ/2 - 1) / HZ); + if (lp->cisco_debserint && + (period != lp->cisco_keepalive_period) && + lp->cisco_last_slarp_in) { + printk(KERN_DEBUG "%s: Keepalive period mismatch - " + "is %d but should be %d.\n", + lp->name, period, lp->cisco_keepalive_period); + } + lp->cisco_last_slarp_in = jiffies; + p += get_u32(p, &my_seq); + p += get_u32(p, &your_seq); + p += get_u16(p, &unused); + lp->cisco_yourseq = my_seq; + lp->cisco_mineseen = your_seq; + break; + } +} + +static void +isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb) +{ + unsigned char *p; + __u8 addr; + __u8 ctrl; + __u16 type; + + if (skb->len < 4) + goto out_free; + + p = skb->data; + p += get_u8 (p, &addr); + p += get_u8 (p, &ctrl); + p += get_u16(p, &type); + skb_pull(skb, 4); + + if (addr != CISCO_ADDR_UNICAST && addr != CISCO_ADDR_BROADCAST) { + printk(KERN_WARNING "%s: Unknown Cisco addr 0x%02x\n", + lp->name, addr); + goto out_free; + } + if (ctrl != CISCO_CTRL) { + printk(KERN_WARNING "%s: Unknown Cisco ctrl 0x%02x\n", + lp->name, ctrl); + goto out_free; + } + + switch (type) { + case CISCO_TYPE_INET: + skb->protocol = htons(ETH_P_IP); + netif_rx(skb); + break; + case CISCO_TYPE_SLARP: + isdn_net_ciscohdlck_slarp_in(lp, skb); + goto out_free; + default: + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n", + lp->name, type); + goto out_free; + } + return; + + out_free: + kfree_skb(skb); } /* @@ -1505,8 +1768,6 @@ #ifdef CONFIG_ISDN_X25 struct concap_proto *cprot = lp -> netdev -> cprot; #endif - cisco_hdr *ch; - lp->transcount += skb->len; lp->stats.rx_packets++; @@ -1546,36 +1807,8 @@ skb->protocol = htons(ETH_P_IP); break; case ISDN_NET_ENCAP_CISCOHDLCK: - ch = (cisco_hdr *)skb->data; - if ((ch->addr != CISCO_ADDR_UNICAST) && - (ch->addr != CISCO_ADDR_BROADCAST) ) { - printk(KERN_WARNING "%s: Unknown Cisco addr 0x%02x\n", - lp->name, ch->addr); - kfree_skb(skb); - return; - } - if (ch->ctrl != 0) { - printk(KERN_WARNING "%s: Unknown Cisco ctrl 0x%02x\n", - lp->name, ch->ctrl); - kfree_skb(skb); - return; - } - switch (ntohs(ch->type)) { - case CISCO_TYPE_INET: - skb_pull(skb, 4); - skb->protocol = htons(ETH_P_IP); - break; - case CISCO_TYPE_SLARP: - skb_pull(skb, 4); - isdn_net_slarp_in(olp, skb); - return; - default: - printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n", - lp->name, ch->type); - kfree_skb(skb); - return; - } - break; + isdn_net_ciscohdlck_receive(lp, skb); + return; case ISDN_NET_ENCAP_CISCOHDLC: /* CISCO-HDLC IP with type field and fake I-frame-header */ skb_pull(skb, 2); @@ -1693,6 +1926,7 @@ void *daddr, void *saddr, unsigned plen) { isdn_net_local *lp = dev->priv; + unsigned char *p; ushort len = 0; switch (lp->p_encap) { @@ -1721,10 +1955,11 @@ len = 2; break; case ISDN_NET_ENCAP_CISCOHDLC: - skb_push(skb, 4); - skb->data[0] = 0x0f; - skb->data[1] = 0x00; - *((ushort *) & skb->data[2]) = htons(type); + case ISDN_NET_ENCAP_CISCOHDLCK: + p = skb_push(skb, 4); + p += put_u8 (p, CISCO_ADDR_UNICAST); + p += put_u8 (p, CISCO_CTRL); + p += put_u16(p, type); len = 4; break; #ifdef CONFIG_ISDN_X25 @@ -1830,9 +2065,7 @@ ndev->stop = &isdn_net_close; ndev->get_stats = &isdn_net_get_stats; ndev->rebuild_header = &isdn_net_rebuild_header; -#ifdef CONFIG_ISDN_PPP - ndev->do_ioctl = isdn_ppp_dev_ioctl; -#endif + ndev->do_ioctl = NULL; return 0; } @@ -2491,6 +2724,7 @@ #else p->dev.type = ARPHRD_PPP; /* change ARP type */ p->dev.addr_len = 0; + p->dev.do_ioctl = isdn_ppp_dev_ioctl; #endif break; case ISDN_NET_ENCAP_X25IFACE: @@ -2503,6 +2737,9 @@ p->dev.addr_len = 0; #endif break; + case ISDN_NET_ENCAP_CISCOHDLCK: + p->dev.do_ioctl = isdn_ciscohdlck_dev_ioctl; + break; default: if( cfg->p_encap >= 0 && cfg->p_encap <= ISDN_NET_ENCAP_MAX_ENCAP ) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_net.h linux.20p9/drivers/isdn/isdn_net.h --- linux.vanilla/drivers/isdn/isdn_net.h Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_net.h Thu Jul 26 15:33:01 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_net.h,v 1.19 2000/06/21 09:54:29 keil Exp $ +/* $Id: isdn_net.h,v 1.19.6.1 2001/04/20 02:41:58 keil Exp $ * header for Linux ISDN subsystem, network related functions (linklevel). * @@ -33,31 +33,9 @@ * Definitions for Cisco-HDLC header. */ -typedef struct cisco_hdr { - __u8 addr; /* unicast/broadcast */ - __u8 ctrl; /* Always 0 */ - __u16 type; /* IP-typefield */ -} cisco_hdr; - -typedef struct cisco_slarp { - __u32 code; /* SLREQ/SLREPLY/KEEPALIVE */ - union { - struct { - __u32 ifaddr; /* My interface address */ - __u32 netmask; /* My interface netmask */ - } reply; - struct { - __u32 my_seq; /* Packet sequence number */ - __u32 your_seq; - } keepalive; - } slarp; - __u16 rel; /* Always 0xffff */ - __u16 t1; /* Uptime in usec >> 16 */ - __u16 t0; /* Uptime in usec & 0xffff */ -} cisco_slarp; - #define CISCO_ADDR_UNICAST 0x0f #define CISCO_ADDR_BROADCAST 0x8f +#define CISCO_CTRL 0x00 #define CISCO_TYPE_INET 0x0800 #define CISCO_TYPE_SLARP 0x8035 #define CISCO_SLARP_REPLY 0 @@ -83,7 +61,6 @@ extern int isdn_net_force_dial(char *); extern isdn_net_dev *isdn_net_findif(char *); extern int isdn_net_rcv_skb(int, struct sk_buff *); -extern void isdn_net_slarp_out(void); extern int isdn_net_dial_req(isdn_net_local *); extern void isdn_net_writebuf_skb(isdn_net_local *lp, struct sk_buff *skb); extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb); @@ -165,4 +142,50 @@ spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags); } +static inline int +put_u8(unsigned char *p, __u8 x) +{ + p[0] = x; + return 1; +} + +static inline int +put_u16(unsigned char *p, __u16 x) +{ + p[0] = x >> 8; + p[1] = x; + return 2; +} + +static inline int +put_u32(unsigned char *p, __u32 x) +{ + p[0] = x >> 24; + p[1] = x >> 16; + p[2] = x >> 8; + p[3] = x; + return 4; +} + +static inline int +get_u8(unsigned char *p, __u8 *x) +{ + *x = p[0]; + return 1; +} + +static inline int +get_u16(unsigned char *p, __u16 *x) +{ + *x = (p[0] << 8) + p[1]; + return 2; +} + +static inline int +get_u32(unsigned char *p, __u32 *x) +{ + *x = (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3]; + return 4; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_ppp.c linux.20p9/drivers/isdn/isdn_ppp.c --- linux.vanilla/drivers/isdn/isdn_ppp.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_ppp.c Thu Jul 26 15:58:58 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_ppp.c,v 1.85.6.2 2001/01/23 17:45:02 kai Exp $ +/* $Id: isdn_ppp.c,v 1.85.6.5 2001/05/26 15:19:56 kai Exp $ * * Linux ISDN subsystem, functions for synchronous PPP (linklevel). * @@ -84,7 +84,7 @@ static int isdn_ppp_bundle(struct ippp_struct *, int unit); #endif /* CONFIG_ISDN_MPP */ -char *isdn_ppp_revision = "$Revision: 1.85.6.2 $"; +char *isdn_ppp_revision = "$Revision: 1.85.6.5 $"; static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS]; @@ -166,6 +166,7 @@ int unit = 0; long flags; struct ippp_struct *is; + int retval; save_flags(flags); cli(); @@ -198,12 +199,14 @@ if (i >= ISDN_MAX_CHANNELS) { restore_flags(flags); printk(KERN_WARNING "isdn_ppp_bind: Can't find a (free) connection to the ipppd daemon.\n"); - return -1; + retval = -1; + goto out; } unit = isdn_ppp_if_get_unit(lp->name); /* get unit number from interface name .. ugly! */ if (unit < 0) { printk(KERN_ERR "isdn_ppp_bind: illegal interface name %s.\n", lp->name); - return -1; + retval = -1; + goto out; } lp->ppp_slot = i; @@ -212,13 +215,16 @@ is->unit = unit; is->state = IPPP_OPEN | IPPP_ASSIGNED; /* assigned to a netdevice but not connected */ #ifdef CONFIG_ISDN_MPP - if (isdn_ppp_mp_init(lp, NULL) < 0) - return -ENOMEM; + retval = isdn_ppp_mp_init(lp, NULL); + if (retval < 0) + goto out; #endif /* CONFIG_ISDN_MPP */ - restore_flags(flags); + retval = lp->ppp_slot; - return lp->ppp_slot; + out: + restore_flags(flags); + return retval; } /* @@ -780,7 +786,10 @@ } skb_reserve(skb, hl); if (copy_from_user(skb_put(skb, count), buf, count)) + { + kfree_skb(skb); return -EFAULT; + } if (is->debug & 0x40) { printk(KERN_DEBUG "ppp xmit: len %d\n", (int) skb->len); isdn_ppp_frame_log("xmit", skb->data, skb->len, 32,is->unit,lp->ppp_slot); @@ -814,7 +823,7 @@ kmalloc(sizeof(struct ippp_struct), GFP_KERNEL))) { printk(KERN_WARNING "isdn_ppp_init: Could not alloc ippp_table\n"); for (j = 0; j < i; j++) - kfree(ippp_table[i]); + kfree(ippp_table[j]); return -1; } memset((char *) ippp_table[i], 0, sizeof(struct ippp_struct)); @@ -2431,6 +2440,13 @@ switch(skb->data[0]) { case CCP_CONFREQ: + if(is->debug & 0x10) + printk(KERN_DEBUG "Disable compression here!\n"); + if(proto == PPP_CCP) + mis->compflags &= ~SC_COMP_ON; + else + is->compflags &= ~SC_LINK_COMP_ON; + break; case CCP_TERMREQ: case CCP_TERMACK: if(is->debug & 0x10) @@ -2546,6 +2562,17 @@ /* TODO: Clean this up with new Reset semantics */ +/* I believe the CCP handling as-is is done wrong. Compressed frames + * should only be sent/received after CCP reaches UP state, which means + * both sides have sent CONF_ACK. Currently, we handle both directions + * independently, which means we may accept compressed frames too early + * (supposedly not a problem), but may also mean we send compressed frames + * too early, which may turn out to be a problem. + * This part of state machine should actually be handled by (i)pppd, but + * that's too big of a change now. --kai + */ + + static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb) { struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot]; @@ -2580,6 +2607,13 @@ switch(data[2]) { case CCP_CONFREQ: + if(is->debug & 0x10) + printk(KERN_DEBUG "Disable decompression here!\n"); + if(proto == PPP_CCP) + is->compflags &= ~SC_DECOMP_ON; + else + is->compflags &= ~SC_LINK_DECOMP_ON; + break; case CCP_TERMREQ: case CCP_TERMACK: if(is->debug & 0x10) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_tty.c linux.20p9/drivers/isdn/isdn_tty.c --- linux.vanilla/drivers/isdn/isdn_tty.c Sun Mar 25 17:37:33 2001 +++ linux.20p9/drivers/isdn/isdn_tty.c Thu Jul 26 15:37:00 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_tty.c,v 1.94 2000/11/25 17:00:59 kai Exp $ +/* $Id: isdn_tty.c,v 1.94.6.3 2001/07/03 14:48:25 kai Exp $ * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel). * @@ -66,7 +66,7 @@ static int si2bit[8] = {4, 1, 4, 4, 4, 4, 4, 4}; -char *isdn_tty_revision = "$Revision: 1.94 $"; +char *isdn_tty_revision = "$Revision: 1.94.6.3 $"; /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb() @@ -307,18 +307,13 @@ void isdn_tty_cleanup_xmit(modem_info * info) { - struct sk_buff *skb; unsigned long flags; save_flags(flags); cli(); - if (skb_queue_len(&info->xmit_queue)) - while ((skb = skb_dequeue(&info->xmit_queue))) - kfree_skb(skb); -#ifdef CONFIG_ISDN_AUDIO - if (skb_queue_len(&info->dtmf_queue)) - while ((skb = skb_dequeue(&info->dtmf_queue))) - kfree_skb(skb); + skb_queue_purge(&info->xmit_queue); +#ifdef CONFIG_ISDN_AUDIO + skb_queue_purge(&info->dtmf_queue); #endif restore_flags(flags); } @@ -1425,8 +1420,7 @@ status = info->lsr; restore_flags(flags); result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); - put_user(result, (uint *) value); - return 0; + return put_user(result, (uint *) value); } @@ -1449,8 +1443,7 @@ | ((status & UART_MSR_RI) ? TIOCM_RNG : 0) | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0) | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0); - put_user(result, (uint *) value); - return 0; + return put_user(result, (uint *) value); } static int @@ -1459,7 +1452,8 @@ uint arg; int pre_dtr; - get_user(arg, (uint *) value); + if (get_user(arg, (uint *) value)) + return -EFAULT; switch (cmd) { case TIOCMBIS: #ifdef ISDN_DEBUG_MODEM_IOCTL @@ -1527,7 +1521,6 @@ uint cmd, ulong arg) { modem_info *info = (modem_info *) tty->driver_data; - int error; int retval; if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_ioctl")) @@ -1557,19 +1550,13 @@ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line); #endif - error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(long)); - if (error) - return error; - put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg); - return 0; + return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg); case TIOCSSOFTCAR: #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line); #endif - error = verify_area(VERIFY_READ, (void *) arg, sizeof(long)); - if (error) - return error; - get_user(arg, (ulong *) arg); + if (get_user(arg, (ulong *) arg)) + return -EFAULT; tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0)); @@ -1578,26 +1565,16 @@ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line); #endif - error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint)); - if (error) - return error; return isdn_tty_get_modem_info(info, (uint *) arg); case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - error = verify_area(VERIFY_READ, (void *) arg, sizeof(uint)); - if (error) - return error; return isdn_tty_set_modem_info(info, cmd, (uint *) arg); case TIOCSERGETLSR: /* Get line status register */ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); #endif - error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint)); - if (error) - return error; - else - return isdn_tty_get_lsr_info(info, (uint *) arg); + return isdn_tty_get_lsr_info(info, (uint *) arg); default: #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "UNKNOWN ioctl 0x%08x on ttyi%d\n", cmd, info->line); @@ -3773,7 +3750,7 @@ sprintf(ds, "\r\n%d", info->emu.charge); isdn_tty_at_cout(ds, info); break; - default: + default:; } break; #ifdef DUMMY_HAYES_AT diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdn_v110.c linux.20p9/drivers/isdn/isdn_v110.c --- linux.vanilla/drivers/isdn/isdn_v110.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/isdn_v110.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: isdn_v110.c,v 1.5.6.2 2001/02/10 14:41:19 kai Exp $ +/* $Id: isdn_v110.c,v 1.5.6.3 2001/02/16 16:43:23 kai Exp $ * Linux ISDN subsystem, V.110 related functions (linklevel). * @@ -30,7 +30,7 @@ #undef ISDN_V110_DEBUG -char *isdn_v110_revision = "$Revision: 1.5.6.2 $"; +char *isdn_v110_revision = "$Revision: 1.5.6.3 $"; #define V110_38400 255 #define V110_19200 15 @@ -70,7 +70,7 @@ * FlipBits reorders sequences of keylen bits in one byte. * E.g. source order 7654321 will be converted to 45670123 when keylen = 4, * and to 67452301 when keylen = 2. This is necessary because ordering on - * the isdn line is the the other way. + * the isdn line is the other way. */ static __inline unsigned char FlipBits(unsigned char c, int keylen) @@ -600,7 +600,7 @@ case ISDN_PROTO_L2_V11038: dev->v110[idx] = isdn_v110_open(V110_38400, hdrlen, maxsize); break; - default: + default:; } if ((v = dev->v110[idx])) { while (v->SyncInit) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/isdnloop/isdnloop.c linux.20p9/drivers/isdn/isdnloop/isdnloop.c --- linux.vanilla/drivers/isdn/isdnloop/isdnloop.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/isdnloop/isdnloop.c Wed Jul 4 16:03:55 2001 @@ -1,4 +1,4 @@ -/* $Id: isdnloop.c,v 1.11.6.1 2000/12/17 16:47:18 kai Exp $ +/* $Id: isdnloop.c,v 1.11.6.3 2001/06/09 15:14:19 kai Exp $ * ISDN low-level module implementing a dummy loop driver. * @@ -26,7 +26,7 @@ #include "isdnloop.h" static char -*revision = "$Revision: 1.11.6.1 $"; +*revision = "$Revision: 1.11.6.3 $"; static int isdnloop_addcard(char *); @@ -41,10 +41,8 @@ isdnloop_free_queue(isdnloop_card * card, int channel) { struct sk_buff_head *queue = &card->bqueue[channel]; - struct sk_buff *skb; - while ((skb = skb_dequeue(queue))) - dev_kfree_skb(skb); + skb_queue_purge(queue); card->sndcount[channel] = 0; } @@ -977,7 +975,7 @@ * user = flag: 1 = called form userlevel, 0 called from kernel. * card = pointer to card struct. * Return: - * number of bytes transfered (currently always equals len). + * number of bytes transferred (currently always equals len). */ static int isdnloop_writecmd(const u_char * buf, int len, int user, isdnloop_card * card) @@ -1574,11 +1572,8 @@ } card = cards; while (card) { - struct sk_buff *skb; - last = card; - while ((skb = skb_dequeue(&card->dqueue))) - dev_kfree_skb(skb); + skb_queue_purge(&card->dqueue); card = card->next; kfree(last); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/callbacks.c linux.20p9/drivers/isdn/pcbit/callbacks.c --- linux.vanilla/drivers/isdn/pcbit/callbacks.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/callbacks.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/callbacks.h linux.20p9/drivers/isdn/pcbit/callbacks.h --- linux.vanilla/drivers/isdn/pcbit/callbacks.h Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/isdn/pcbit/callbacks.h Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/capi.c linux.20p9/drivers/isdn/pcbit/capi.c --- linux.vanilla/drivers/isdn/pcbit/capi.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/capi.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/capi.h linux.20p9/drivers/isdn/pcbit/capi.h --- linux.vanilla/drivers/isdn/pcbit/capi.h Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/isdn/pcbit/capi.h Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/drv.c linux.20p9/drivers/isdn/pcbit/drv.c --- linux.vanilla/drivers/isdn/pcbit/drv.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/drv.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/edss1.c linux.20p9/drivers/isdn/pcbit/edss1.c --- linux.vanilla/drivers/isdn/pcbit/edss1.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/edss1.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/edss1.h linux.20p9/drivers/isdn/pcbit/edss1.h --- linux.vanilla/drivers/isdn/pcbit/edss1.h Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/isdn/pcbit/edss1.h Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/layer2.c linux.20p9/drivers/isdn/pcbit/layer2.c --- linux.vanilla/drivers/isdn/pcbit/layer2.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/layer2.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/layer2.h linux.20p9/drivers/isdn/pcbit/layer2.h --- linux.vanilla/drivers/isdn/pcbit/layer2.h Sun Mar 25 17:31:37 2001 +++ linux.20p9/drivers/isdn/pcbit/layer2.h Thu Jul 26 18:26:06 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/module.c linux.20p9/drivers/isdn/pcbit/module.c --- linux.vanilla/drivers/isdn/pcbit/module.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/module.c Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/pcbit/pcbit.h linux.20p9/drivers/isdn/pcbit/pcbit.h --- linux.vanilla/drivers/isdn/pcbit/pcbit.h Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/pcbit/pcbit.h Wed Jul 4 16:03:55 2001 @@ -4,7 +4,7 @@ * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/sc/interrupt.c linux.20p9/drivers/isdn/sc/interrupt.c --- linux.vanilla/drivers/isdn/sc/interrupt.c Sun Mar 25 17:31:38 2001 +++ linux.20p9/drivers/isdn/sc/interrupt.c Wed Jul 4 16:03:55 2001 @@ -1,5 +1,5 @@ /* - * $Id: interrupt.c,v 1.4 1998/01/31 22:10:52 keil Exp $ + * $Id: interrupt.c,v 1.4.8.2 2001/04/08 17:51:43 kai Exp $ * Copyright (C) 1996 SpellCaster Telecommunications Inc. * * This program is free software; you can redistribute it and/or modify @@ -34,7 +34,6 @@ extern int indicate_status(int, int, ulong, char *); extern void check_phystat(unsigned long); -extern void dump_messages(int); extern int receivemessage(int, RspMessage *); extern int sendmessage(int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int *); @@ -141,7 +140,7 @@ } else if(callid>=0x0000 && callid<=0x7FFF) { - pr_debug("%s: Got Incomming Call\n", adapter[card]->devicename); + pr_debug("%s: Got Incoming Call\n", adapter[card]->devicename); strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4])); strcpy(setup.eazmsn,adapter[card]->channel[rcvmsg.phy_link_no-1].dn); setup.si1 = 7; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/isdn/sc/message.c linux.20p9/drivers/isdn/sc/message.c --- linux.vanilla/drivers/isdn/sc/message.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/isdn/sc/message.c Wed Jul 4 16:03:55 2001 @@ -1,5 +1,5 @@ /* - * $Id: message.c,v 1.5 1999/09/04 06:20:07 keil Exp $ + * $Id: message.c,v 1.5.8.1 2001/04/08 17:51:43 kai Exp $ * Copyright (C) 1996 SpellCaster Telecommunications Inc. * * message.c - functions for sending and receiving control messages @@ -38,55 +38,12 @@ extern unsigned int cinst; /* - * Obligitory function prototypes + * Obligatory function prototypes */ extern int indicate_status(int,ulong,char*); extern int scm_command(isdn_ctrl *); extern void *memcpy_fromshmem(int, void *, const void *, size_t); -/* - * Dump message queue in shared memory to screen - */ -void dump_messages(int card) -{ - DualPortMemory dpm; - unsigned long flags; - - int i =0; - - if (!IS_VALID_CARD(card)) { - pr_debug("Invalid param: %d is not a valid card id\n", card); - } - - save_flags(flags); - cli(); - outb(adapter[card]->ioport[adapter[card]->shmem_pgport], - (adapter[card]->shmem_magic >> 14) | 0x80); - memcpy_fromshmem(card, &dpm, 0, sizeof(dpm)); - restore_flags(flags); - - pr_debug("%s: Dumping Request Queue\n", adapter[card]->devicename); - for (i = 0; i < dpm.req_head; i++) { - pr_debug("%s: Message #%d: (%d,%d,%d), link: %d\n", - adapter[card]->devicename, i, - dpm.req_queue[i].type, - dpm.req_queue[i].class, - dpm.req_queue[i].code, - dpm.req_queue[i].phy_link_no); - } - - pr_debug("%s: Dumping Response Queue\n", adapter[card]->devicename); - for (i = 0; i < dpm.rsp_head; i++) { - pr_debug("%s: Message #%d: (%d,%d,%d), link: %d, status: %d\n", - adapter[card]->devicename, i, - dpm.rsp_queue[i].type, - dpm.rsp_queue[i].class, - dpm.rsp_queue[i].code, - dpm.rsp_queue[i].phy_link_no, - dpm.rsp_queue[i].rsp_status); - } - -} /* * receive a message from the board diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/macintosh/via-pmu.c linux.20p9/drivers/macintosh/via-pmu.c --- linux.vanilla/drivers/macintosh/via-pmu.c Sun Mar 25 17:31:41 2001 +++ linux.20p9/drivers/macintosh/via-pmu.c Wed Jul 4 16:03:55 2001 @@ -1356,7 +1356,7 @@ /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occuring while we did + /* Make sure any pending DEC interrupt occurring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); @@ -1509,7 +1509,7 @@ /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occuring while we did + /* Make sure any pending DEC interrupt occurring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/misc/parport_pc.c linux.20p9/drivers/misc/parport_pc.c --- linux.vanilla/drivers/misc/parport_pc.c Sun Mar 25 17:31:41 2001 +++ linux.20p9/drivers/misc/parport_pc.c Wed Jul 4 16:03:55 2001 @@ -966,7 +966,7 @@ printk (KERN_INFO "Unknown PCI parallel I/O card (%04x/%04x)\n" "Please send 'lspci' output to " - "tim@cyberelk.demon.co.uk\n", + "tim@cyberelk.net\n", pcidev->vendor, pcidev->device); } #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/3c505.c linux.20p9/drivers/net/3c505.c --- linux.vanilla/drivers/net/3c505.c Sun Mar 25 17:31:16 2001 +++ linux.20p9/drivers/net/3c505.c Wed Aug 8 22:22:59 2001 @@ -617,7 +617,7 @@ } else { skb_reserve(skb, 2); target = skb_put(skb, rlen); - if (virt_to_bus(target + rlen) >= MAX_DMA_ADDRESS) { + if ((unsigned long)(target + rlen) >= MAX_DMA_ADDRESS) { adapter->current_dma.target = target; target = adapter->dma_buffer; } else { @@ -1062,11 +1062,13 @@ adapter->current_dma.direction = 1; adapter->current_dma.start_time = jiffies; - target = virt_to_bus(skb->data); - if ((target + nlen) >= MAX_DMA_ADDRESS) { + if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS) { memcpy(adapter->dma_buffer, skb->data, nlen); target = virt_to_bus(adapter->dma_buffer); } + else { + target = virt_to_bus(skb->data); + } adapter->current_dma.skb = skb; flags=claim_dma_lock(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/3c509.c linux.20p9/drivers/net/3c509.c --- linux.vanilla/drivers/net/3c509.c Sun Mar 25 17:31:15 2001 +++ linux.20p9/drivers/net/3c509.c Wed Jul 4 16:03:55 2001 @@ -180,6 +180,8 @@ if (EISA_bus) { static int eisa_addr = 0x1000; while (eisa_addr < 0x9000) { + int device_id; + ioaddr = eisa_addr; eisa_addr += 0x1000; @@ -187,6 +189,12 @@ if (inw(ioaddr + 0xC80) != 0x6d50) continue; + /* Avoid conflict with 3c590, 3c592, 3c597, etc */ + device_id = (inb(ioaddr + 0xC82)<<8) + inb(ioaddr + 0xC83); + if ((device_id & 0xFF00) == 0x5900) { + continue; + } + /* Change the register set to the configuration window 0. */ outw(SelectWindow | 0, ioaddr + 0xC80 + EL3_CMD); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/8139too.c linux.20p9/drivers/net/8139too.c --- linux.vanilla/drivers/net/8139too.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/8139too.c Thu Jul 26 15:50:16 2001 @@ -2,40 +2,41 @@ 8139too.c: A RealTek RTL-8139 Fast Ethernet driver for Linux. - Maintained by Jeff Garzik - - Much code comes from Donald Becker's rtl8139.c driver, - versions 1.13 and older. This driver was originally based - on rtl8139.c version 1.07. Header of rtl8139.c version 1.13: - - ---------- - - Written 1997-2001 by Donald Becker. - This software may be used and distributed according to the - terms of the GNU General Public License (GPL), incorporated - herein by reference. Drivers based on or derived from this - code fall under the GPL and must retain the authorship, - copyright and license notice. This file is not a complete - program and may only be used when the entire operating - system is licensed under the GPL. - - This driver is for boards based on the RTL8129 and RTL8139 - PCI ethernet chips. - - The author may be reached as becker@scyld.com, or C/O Scyld - Computing Corporation 410 Severn Ave., Suite 210 Annapolis - MD 21403 - - Support and updates available at - http://www.scyld.com/network/rtl8139.html - - Twister-tuning table provided by Kinston - . - - ---------- + Maintained by Jeff Garzik + Copyright 2000,2001 Jeff Garzik + + Much code comes from Donald Becker's rtl8139.c driver, + versions 1.13 and older. This driver was originally based + on rtl8139.c version 1.07. Header of rtl8139.c version 1.13: + + ---------- + + Written 1997-2001 by Donald Becker. + This software may be used and distributed according to the + terms of the GNU General Public License (GPL), incorporated + herein by reference. Drivers based on or derived from this + code fall under the GPL and must retain the authorship, + copyright and license notice. This file is not a complete + program and may only be used when the entire operating + system is licensed under the GPL. + + This driver is for boards based on the RTL8129 and RTL8139 + PCI ethernet chips. + + The author may be reached as becker@scyld.com, or C/O Scyld + Computing Corporation 410 Severn Ave., Suite 210 Annapolis + MD 21403 + + Support and updates available at + http://www.scyld.com/network/rtl8139.html + + Twister-tuning table provided by Kinston + . + + ---------- This software may be used and distributed according to the terms - of the GNU Public License, incorporated herein by reference. + of the GNU General Public License, incorporated herein by reference. Contributors: @@ -133,10 +134,12 @@ problem by having an MMIO register write be immediately followed by an MMIO register read. -2) The RTL-8129 is only supported in Donald Becker's rtl8139 driver. - */ +#define DRV_NAME "8139too" +#define DRV_VERSION "0.9.18-pre4" + + #include #include #include @@ -148,13 +151,10 @@ #include #include #include +#include - -#define RTL8139_VERSION "0.9.14-2.2" -#define MODNAME "8139too" -#define RTL8139_DRIVER_NAME MODNAME " FastEthernet driver " RTL8139_VERSION -#define RTL8139_AUTHOR "Jeff Garzik " -#define PFX MODNAME ": " +#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION +#define PFX DRV_NAME ": " /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */ @@ -171,15 +171,15 @@ #ifdef RTL8139_DEBUG /* note: prints function name for you */ -#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args) +# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args) #else -#define DPRINTK(fmt, args...) +# define DPRINTK(fmt, args...) #endif #ifdef RTL8139_NDEBUG -#define assert(expr) do {} while (0) +# define assert(expr) do {} while (0) #else -#define assert(expr) \ +# define assert(expr) \ if(!(expr)) { \ printk( "Assertion failed! %s,%s,%s,line=%d\n", \ #expr,__FILE__,__FUNCTION__,__LINE__); \ @@ -187,7 +187,7 @@ #endif #define dev_kfree_skb_irq(a) dev_kfree_skb(a) -#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy) +#define netif_wake_queue(dev) do { clear_bit(0, &dev->tbusy); mark_bh(NET_BH); } while (0); #define netif_stop_queue(dev) set_bit(0, &dev->tbusy) static inline void netif_start_queue(struct device *dev) @@ -282,7 +282,46 @@ (rtl8139_pci_resource_end((dev_priv),(bar)) - \ rtl8139_pci_resource_start((dev_priv),(bar)) + 1)) +#define RTL8139_PCI_ANY_ID 0xffff +static inline struct pci_dev *rtl8139_pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from) +{ + if (!from) + from = pci_devices; + else + from = from->next; + while (from && (!(from->vendor == vendor || vendor==RTL8139_PCI_ANY_ID) || !(from->device == device || device==RTL8139_PCI_ANY_ID))) + from = from->next; + return from; +} + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define SIOCETHTOOL 0x8946 /* Ethtool interface */ +#define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */ +#define SIOCGMIIREG 0x8948 /* Read MII PHY register. */ +#define SIOCSMIIREG 0x8949 /* Write MII PHY register. */ +#define ETHTOOL_GSET 0x00000001 /* Get settings. */ +#define ETHTOOL_SSET 0x00000002 /* Set settings, privileged. */ +#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */ + +/* these strings are set to whatever the driver author decides... */ +struct ethtool_drvinfo { + u32 cmd; + char driver[32]; /* driver short name, "tulip", "eepro100" */ + char version[32]; /* driver version string */ + char fw_version[32]; /* firmware version string, if applicable */ + char bus_info[32]; /* Bus info for this interface. For PCI + * devices, use pci_dev->slot_name. */ + char reserved1[32]; + char reserved2[32]; +}; + +/* This structure is used in all SIOCxMIIxxx ioctl calls */ +struct mii_ioctl_data { + u16 phy_id; + u16 reg_num; + u16 val_in; + u16 val_out; +}; /* A few user-configurable values. */ /* media options */ @@ -303,6 +342,7 @@ #define RX_BUF_PAD 16 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ #define RX_BUF_TOT_LEN (RX_BUF_LEN + RX_BUF_PAD + RX_BUF_WRAP_PAD) +#define RX_EARLY_THRESH 2 /* Number of Tx descriptor registers. */ #define NUM_TX_DESC 4 @@ -319,17 +359,18 @@ #define TX_FIFO_THRESH 256 /* In bytes, rounded down to 32 byte units. */ /* The following settings are log_2(bytes)-4: 0 == 16 bytes .. 6==1024, 7==end of packet. */ -#define RX_FIFO_THRESH 6 /* Rx buffer level before first PCI xfer. */ -#define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ +#define RX_FIFO_THRESH 7 /* Rx buffer level before first PCI xfer. */ +#define RX_DMA_BURST 7 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ /* Operational parameters that usually are not changed. */ /* Time in jiffies before concluding the transmitter is hung. */ -#define TX_TIMEOUT (HZ/2) +#define TX_TIMEOUT (6*HZ) enum { + RTL_PCI_64BIT = 0x0100, HAS_MII_XCVR = 0x010000, HAS_CHIP_XCVR = 0x020000, HAS_LNK_CHNG = 0x040000, @@ -345,7 +386,7 @@ RTL8139 = 0, RTL8139_CB, SMC1211TX, - /*MPX5030,*/ + MPX5030, DELTA8139, ADDTRON8139, DFE538TX, @@ -360,11 +401,11 @@ } board_info[] = { { "RealTek RTL8139 Fast Ethernet", RTL8139_CAPS }, { "RealTek RTL8139B PCI/CardBus", RTL8139_CAPS }, - { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", RTL8139_CAPS }, -/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)", RTL8139_CAPS },*/ + { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", RTL8139_CAPS | (RTL_PCI_64BIT | 2)}, + { "Accton MPX5030 (RealTek RTL8139)", RTL8139_CAPS | (RTL_PCI_64BIT | 2)}, { "Delta Electronics 8139 10/100BaseTX", RTL8139_CAPS }, { "Addtron Technolgy 8139 10/100BaseTX", RTL8139_CAPS }, - { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS }, + { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS | (RTL_PCI_64BIT | 1)}, { "RealTek RTL8129", RTL8129_CAPS }, }; @@ -377,11 +418,18 @@ {0x10ec, 0x8139, RTL8139 }, {0x10ec, 0x8138, RTL8139_CB }, {0x1113, 0x1211, SMC1211TX }, -/* {0x1113, 0x1211, MPX5030 },*/ + {0x1113, 0x1211, MPX5030 }, {0x1500, 0x1360, DELTA8139 }, {0x4033, 0x1360, ADDTRON8139 }, {0x1186, 0x1300, DFE538TX }, +#ifdef CONFIG_8139TOO_8129 {0x10ec, 0x8129, RTL8129 }, +#endif + /* some crazy card report invalid vendor IDs, + * catch this. RTL8139_PCI_ANY_ID means match anything + * 1KJD 2001-04-08 + */ + {RTL8139_PCI_ANY_ID, 0x8139, RTL8139 }, {0,} }; @@ -457,7 +505,10 @@ TxOK = 0x04, RxErr = 0x02, RxOK = 0x01, + + RxAckBits = RxFIFOOver | RxOverflow | RxOK, }; + enum TxStatusBits { TxHostOwns = 0x2000, TxUnderrun = 0x4000, @@ -506,10 +557,17 @@ Cfg1_VPD_Enable = 0x02, Cfg1_PIO = 0x04, Cfg1_MMIO = 0x08, - Cfg1_LWAKE = 0x10, + LWAKE = 0x10, /* not on 8139, 8139A */ Cfg1_Driver_Load = 0x20, Cfg1_LED0 = 0x40, Cfg1_LED1 = 0x80, + SLEEP = (1 << 1), /* only on 8139, 8139A */ + PWRDN = (1 << 0), /* only on 8139, 8139A */ +}; + +/* Bits in Config4 */ +enum Config4Bits { + LWPTN = (1 << 2), /* not on 8139, 8139A */ }; enum RxConfigBits { @@ -577,45 +635,62 @@ CH_8139C, } chip_t; +enum chip_flags { + HasHltClk = (1 << 0), + HasLWake = (1 << 1), +}; + /* directly indexed by chip_t, above */ const static struct { const char *name; u8 version; /* from RTL8139C docs */ u32 RxConfigMask; /* should clear the bits supported by this chip */ + u32 flags; } rtl_chip_info[] = { { "RTL-8139", 0x40, 0xf0fe0040, /* XXX copied from RTL8139A, verify */ + HasHltClk, }, { "RTL-8139 rev K", 0x60, 0xf0fe0040, + HasHltClk, }, { "RTL-8139A", 0x70, 0xf0fe0040, + HasHltClk, /* XXX undocumented? */ }, { "RTL-8139B", 0x78, - 0xf0fc0040 + 0xf0fc0040, + HasLWake, }, { "RTL-8130", 0x7C, 0xf0fe0040, /* XXX copied from RTL8139A, verify */ + HasLWake, }, { "RTL-8139C", 0x74, 0xf0fc0040, /* XXX copied from RTL8139B, verify */ + HasLWake, }, }; +struct rtl_extra_stats { + unsigned long early_rx; + unsigned long tx_buf_mapped; + unsigned long tx_timeouts; +}; struct rtl8139_private { void *mmio_addr; @@ -634,7 +709,7 @@ unsigned char *tx_bufs; /* Tx bounce buffer region. */ dma_addr_t rx_ring_dma; dma_addr_t tx_bufs_dma; - char phys[4]; /* MII device addresses. */ + signed char phys[4]; /* MII device addresses. */ u16 advertising; /* NWay media advertisement */ char twistie, twist_row, twist_col; /* Twister tune state. */ unsigned int full_duplex:1; /* Full-duplex operation requested. */ @@ -648,9 +723,21 @@ pid_t thr_pid; wait_queue_head_t thr_wait; struct semaphore thr_exited; + u32 rx_config; + struct rtl_extra_stats xstats; }; - +#define RTL8139_AUTHOR "Jeff Garzik " +MODULE_AUTHOR (RTL8139_AUTHOR); +MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver"); +MODULE_PARM (multicast_filter_limit, "i"); +MODULE_PARM (max_interrupt_work, "i"); +MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); +MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt"); +MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); +MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); static int read_eeprom (void *ioaddr, int location, int addr_len); static int rtl8139_open (struct device *dev); @@ -665,7 +752,7 @@ static void rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct device *dev); -static int mii_ioctl (struct device *dev, struct ifreq *rq, int cmd); +static int netdev_ioctl (struct device *dev, struct ifreq *rq, int cmd); static struct net_device_stats *rtl8139_get_stats (struct device *dev); static inline u32 ether_crc (int length, unsigned char *data); static void rtl8139_set_rx_mode (struct device *dev); @@ -704,6 +791,7 @@ #define RTL_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0) +#define MMIO_FLUSH_AUDIT_COMPLETE 1 #if MMIO_FLUSH_AUDIT_COMPLETE /* write MMIO register */ @@ -733,40 +821,86 @@ TxErr | TxOK | RxErr | RxOK; static const unsigned int rtl8139_rx_config = - RxCfgEarlyRxNone | RxCfgRcv32K | RxNoWrap | + (RX_EARLY_THRESH << RxCfgEarlyRxShift) | RxCfgRcv32K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); -static int rtl8139_init_board (struct pci_dev *pdev, struct device **dev_out, - void **ioaddr_out) +static void __rtl8139_cleanup_dev (struct device *dev) +{ + struct rtl8139_private *tp; + struct pci_dev *pdev; + + assert (dev != NULL); + assert (dev->priv != NULL); + + tp = dev->priv; + assert (tp->pci_dev != NULL); + pdev = tp->pci_dev; + +#ifndef USE_IO_OPS + if (tp->mmio_addr) + iounmap (tp->mmio_addr); +#endif /* !USE_IO_OPS */ + +#ifndef RTL8139_NDEBUG + /* poison memory before freeing */ + memset (dev, 0xBC, + sizeof (struct device) + + sizeof (struct rtl8139_private)); +#endif /* RTL8139_NDEBUG */ + + kfree (dev); +} + + +static void rtl8139_chip_reset (void *ioaddr) +{ + int i; + + /* Soft reset the chip. */ + RTL_W8 (ChipCmd, CmdReset); + + /* Check that the chip has finished the reset. */ + for (i = 1000; i > 0; i--) { + barrier(); + if ((RTL_R8 (ChipCmd) & CmdReset) == 0) + break; + udelay (10); + } +} + + +static int rtl8139_init_board (struct pci_dev *pdev, + struct device **dev_out, + u32 hwflags) { - void *ioaddr = NULL; + void *ioaddr; struct device *dev; struct rtl8139_private *tp; u8 tmp8; - int rc, i; + int rc; + unsigned int i; u32 pio_start, pio_end, pio_flags, pio_len; unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; + unsigned short pci_command, new_command; u32 tmp; - u16 pci_command, new_command; DPRINTK ("ENTER\n"); assert (pdev != NULL); - assert (ioaddr_out != NULL); - *ioaddr_out = NULL; *dev_out = NULL; - /* dev zeroed in init_etherdev */ + /* dev and dev->priv zeroed in init_etherdev */ dev = init_etherdev (NULL, sizeof (*tp)); if (dev == NULL) { - printk (KERN_ERR PFX "unable to alloc new ethernet\n"); + printk (KERN_ERR PFX "Unable to alloc new ethernet device\n"); DPRINTK ("EXIT, returning -ENOMEM\n"); return -ENOMEM; } tp = dev->priv; + tp->pci_dev = pdev; rtl8139_read_pci_resources(pdev, &tp->rtl8139_pci_resource[0]); @@ -779,96 +913,84 @@ mmio_end = rtl8139_pci_resource_end (tp, 1); mmio_flags = rtl8139_pci_resource_flags (tp, 1); mmio_len = rtl8139_pci_resource_len (tp, 1); +#ifdef __alpha__ + /* handle 64 bit address space mapping */ + if (hwflags & RTL_PCI_64BIT) { + u32 pci_ext64; + pcibios_read_config_dword(PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), + ((hwflags & 0x0f) << 2) + 0x10, &pci_ext64); + pio_start |= (unsigned long) pci_ext64 << 32; + pio_end |= (unsigned long) pci_ext64 << 32; + mmio_start |= (unsigned long) pci_ext64 << 32; + mmio_end |= (unsigned long) pci_ext64 << 32; + } +#endif /* set this immediately, we need to know before * we talk to the chip directly */ - DPRINTK("PIO region size == 0x%02X\n", pio_len); - DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); - if (pio_len == RTL8139B_IO_SIZE) - tp->chipset = CH_8139B; + DPRINTK("PIO region size at 0x%08lx == 0x%02X\n", (unsigned long) pio_start, pio_len); + DPRINTK("MMIO region size at 0x%08lx == 0x%02lX\n", (unsigned long) mmio_start, mmio_len); +#ifdef USE_IO_OPS /* make sure PCI base addr 0 is PIO */ if (!(pio_flags & IORESOURCE_IO)) { - printk (KERN_ERR PFX "region #0 not a PIO resource, aborting\n"); + printk (KERN_ERR PFX "8139too: region #0 not a PIO resource, aborting\n"); rc = -ENODEV; goto err_out; } - - /* make sure PCI base addr 1 is MMIO */ - if (!(mmio_flags & IORESOURCE_MEM)) { - printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); + /* check for weird/broken PCI region reporting */ + if (pio_len < RTL_MIN_IO_SIZE) { + printk (KERN_ERR PFX "8139too: Invalid PCI I/O region size(s), aborting\n"); rc = -ENODEV; goto err_out; } - - /* check for weird/broken PCI region reporting */ - if ((pio_len < RTL_MIN_IO_SIZE) || - (mmio_len < RTL_MIN_IO_SIZE)) { - printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); +#else + /* make sure PCI base addr 1 is MMIO */ + if (!(mmio_flags & IORESOURCE_MEM)) { + printk (KERN_ERR PFX "8139too: region #1 not an MMIO resource, aborting\n"); rc = -ENODEV; goto err_out; } - - /* make sure our PIO region in PCI space is available */ - if (check_region(pio_start, pio_len)) { - printk (KERN_ERR PFX "no I/O resource available, aborting\n"); - rc = -EBUSY; + if (mmio_len < RTL_MIN_IO_SIZE) { + printk (KERN_ERR PFX "8139too: Invalid PCI mem region size(s), aborting\n"); + rc = -ENODEV; goto err_out; } +#endif request_region(pio_start, pio_len, dev->name); pci_set_master (pdev); #ifdef USE_IO_OPS ioaddr = (void *) pio_start; + dev->base_addr = pio_start; #else /* ioremap MMIO region */ - ioaddr = ioremap_nocache(mmio_start, mmio_len); - + ioaddr = ioremap_nocache(mmio_start, mmio_len); if (ioaddr == NULL) { printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); rc = -EIO; - goto err_out_free_mmio; + goto err_out; } + dev->base_addr = (long) ioaddr; #endif /* USE_IO_OPS */ + tp->mmio_addr = ioaddr; /* Activate the card: fix for brain-damaged Win98 BIOSes. */ pci_read_config_word(pdev, PCI_COMMAND, &pci_command); new_command = pci_command | PCI_USES_IO | PCI_USES_MEM | PCI_USES_MASTER; if (pci_command != new_command) pci_write_config_word(pdev, PCI_COMMAND, new_command); - - /* Soft reset the chip. */ - RTL_W8 (ChipCmd, (RTL_R8 (ChipCmd) & ChipCmdClear) | CmdReset); - - /* Check that the chip has finished the reset. */ - for (i = 10000; i > 0; i--) - if ((RTL_R8 (ChipCmd) & CmdReset) == 0) - break; - else - udelay (10); - /* Bring the chip out of low-power mode. */ - if (tp->chipset == CH_8139B) { - RTL_W8 (Config1, RTL_R8 (Config1) & ~(1<<4)); - RTL_W8 (Config4, RTL_R8 (Config4) & ~(1<<2)); - } else { - /* handle RTL8139A and RTL8139 cases */ - /* XXX from becker driver. is this right?? */ - RTL_W8 (Config1, 0); - } + /* Bring old chips out of low-power mode. */ + RTL_W8 (HltClk, 'R'); - /* make sure chip thinks PIO and MMIO are enabled */ - tmp8 = RTL_R8 (Config1); - if ((tmp8 & Cfg1_PIO) == 0) { - printk (KERN_ERR PFX "PIO not enabled, Cfg1=%02X, aborting\n", tmp8); + /* check for missing/broken hardware */ + if (RTL_R32 (TxConfig) == 0xFFFFFFFF) { + printk (KERN_ERR PFX "slot %u: Chip not responding, ignoring board\n", + PCI_SLOT(pdev->devfn)); rc = -EIO; - goto err_out_iounmap; - } - if ((tmp8 & Cfg1_MMIO) == 0) { - printk (KERN_ERR PFX "MMIO not enabled, Cfg1=%02X, aborting\n", tmp8); - rc = -EIO; - goto err_out_iounmap; + goto err_out; } /* identify chip attached to board */ @@ -891,21 +1013,38 @@ tp->chipset, rtl_chip_info[tp->chipset].name); + if (tp->chipset >= CH_8139B) { + u8 new_tmp8 = tmp8 = RTL_R8 (Config1); + DPRINTK("PCI PM wakeup\n"); + if ((rtl_chip_info[tp->chipset].flags & HasLWake) && + (tmp8 & LWAKE)) + new_tmp8 &= ~LWAKE; + new_tmp8 |= Cfg1_PM_Enable; + if (new_tmp8 != tmp8) { + RTL_W8 (Cfg9346, Cfg9346_Unlock); + RTL_W8 (Config1, tmp8); + RTL_W8 (Cfg9346, Cfg9346_Lock); + } + if (rtl_chip_info[tp->chipset].flags & HasLWake) { + tmp8 = RTL_R8 (Config4); + if (tmp8 & LWPTN) + RTL_W8 (Config4, tmp8 & ~LWPTN); + } + } else { + DPRINTK("Old chip wakeup\n"); + tmp8 = RTL_R8 (Config1); + tmp8 &= ~(SLEEP | PWRDN); + RTL_W8 (Config1, tmp8); + } + + rtl8139_chip_reset (ioaddr); + DPRINTK ("EXIT, returning 0\n"); - *ioaddr_out = ioaddr; *dev_out = dev; return 0; -err_out_iounmap: - assert (ioaddr > 0); -#ifndef USE_IO_OPS - iounmap (ioaddr); -#endif /* !USE_IO_OPS */ -err_out_free_mmio: - release_region (pio_start, pio_len); err_out: - unregister_netdev (dev); - kfree (dev); + __rtl8139_cleanup_dev (dev); DPRINTK ("EXIT, returning %d\n", rc); return rc; } @@ -915,9 +1054,8 @@ struct device *dev = NULL; struct rtl8139_private *tp; int i, addr_len, option; - void *ioaddr = NULL; + void *ioaddr; static int board_idx = -1; - u8 tmp; DPRINTK ("ENTER\n"); @@ -926,13 +1064,14 @@ board_idx++; - i = rtl8139_init_board (pdev, &dev, &ioaddr); + i = rtl8139_init_board (pdev, &dev, board_info[ent->board].hw_flags); if (i < 0) { DPRINTK ("EXIT, returning %d\n", i); return i; } tp = dev->priv; + ioaddr = tp->mmio_addr; assert (ioaddr != NULL); assert (dev != NULL); @@ -949,17 +1088,15 @@ dev->stop = rtl8139_close; dev->get_stats = rtl8139_get_stats; dev->set_multicast_list = rtl8139_set_rx_mode; - dev->do_ioctl = mii_ioctl; + dev->do_ioctl = netdev_ioctl; dev->irq = pdev->irq; - dev->base_addr = (unsigned long) ioaddr; /* dev->priv/tp zeroed and aligned in init_etherdev */ tp = dev->priv; /* note: tp->chipset set in rtl8139_init_board */ tp->drv_flags = board_info[ent->board].hw_flags; - tp->pci_dev = pdev; tp->mmio_addr = ioaddr; spin_lock_init (&tp->lock); init_waitqueue_head (&tp->thr_wait); @@ -984,16 +1121,17 @@ /* Find the connected MII xcvrs. Doing this in open() would allow detecting external xcvrs later, but takes too much time. */ +#ifdef CONFIG_8139TOO_8129 if (tp->drv_flags & HAS_MII_XCVR) { int phy, phy_idx = 0; for (phy = 0; phy < 32 && phy_idx < sizeof(tp->phys); phy++) { int mii_status = mdio_read(dev, phy, 1); if (mii_status != 0xffff && mii_status != 0x0000) { + u16 advertising = mdio_read(dev, phy, 4); tp->phys[phy_idx++] = phy; - tp->advertising = mdio_read(dev, phy, 4); printk(KERN_INFO "%s: MII transceiver %d status 0x%4.4x " "advertising %4.4x.\n", - dev->name, phy, mii_status, tp->advertising); + dev->name, phy, mii_status, advertising); } } if (phy_idx == 0) { @@ -1003,17 +1141,9 @@ tp->phys[0] = 32; } } else +#endif tp->phys[0] = 32; - /* Put the chip into low-power mode. */ - RTL_W8_F (Cfg9346, Cfg9346_Unlock); - - tmp = RTL_R8 (Config1) & Config1Clear; - tmp |= (tp->chipset == CH_8139B) ? 3 : 1; /* Enable PM/VPD */ - RTL_W8_F (Config1, tmp); - - RTL_W8_F (HltClk, 'H'); /* 'R' would leave the clock running. */ - /* The lower four bits are the media type. */ option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx]; if (option > 0) { @@ -1025,7 +1155,7 @@ if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) tp->full_duplex = full_duplex[board_idx]; if (tp->full_duplex) { - printk (KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); + printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); /* Changing the MII-advertised media because might prevent re-connection. */ tp->duplex_lock = 1; @@ -1040,7 +1170,10 @@ } rtl8139_device_tab[rtl8139_device_count++] = dev; - + /* Put the chip into low-power mode. */ + if (rtl_chip_info[tp->chipset].flags & HasHltClk) + RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ + DPRINTK ("EXIT - returning 0\n"); return 0; } @@ -1062,24 +1195,12 @@ unregister_netdev (dev); -#ifndef USE_IO_OPS - iounmap (np->mmio_addr); -#endif /* !USE_IO_OPS */ - - release_region (rtl8139_pci_resource_start (np, 0), - rtl8139_pci_resource_len (np, 0)); -#ifndef RTL8139_NDEBUG - /* poison memory before freeing */ - memset (dev, 0xBC, - sizeof (struct device) + - sizeof (struct rtl8139_private)); -#endif /* RTL8139_NDEBUG */ - - kfree (dev); + __rtl8139_cleanup_dev (dev); DPRINTK ("EXIT\n"); } + /* Serial EEPROM section. */ /* EEPROM_Ctrl bits. */ @@ -1171,7 +1292,7 @@ 0 }; - +#ifdef CONFIG_8139TOO_8129 /* Syncronize the MII management interface by shifting 32 one bits out. */ static void mdio_sync (void *mdio_addr) { @@ -1188,15 +1309,17 @@ DPRINTK ("EXIT\n"); } - +#endif static int mdio_read (struct device *dev, int phy_id, int location) { struct rtl8139_private *tp = dev->priv; - void *mdio_addr = tp->mmio_addr + Config4; - int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; int retval = 0; +#ifdef CONFIG_8139TOO_8129 int i; + void *mdio_addr = tp->mmio_addr + Config4; + int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; +#endif DPRINTK ("ENTER\n"); @@ -1205,6 +1328,8 @@ return location < 8 && mii_2_8139_map[location] ? readw (tp->mmio_addr + mii_2_8139_map[location]) : 0; } + +#ifdef CONFIG_8139TOO_8129 mdio_sync (mdio_addr); /* Shift the read command bits out. */ for (i = 15; i >= 0; i--) { @@ -1224,6 +1349,7 @@ writeb (MDIO_CLK, mdio_addr); mdio_delay (mdio_addr); } +#endif DPRINTK ("EXIT, returning %d\n", (retval >> 1) & 0xffff); return (retval >> 1) & 0xffff; @@ -1234,22 +1360,26 @@ int value) { struct rtl8139_private *tp = dev->priv; +#ifdef CONFIG_8139TOO_8129 + int i; void *mdio_addr = tp->mmio_addr + Config4; int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; - int i; +#endif DPRINTK ("ENTER\n"); if (phy_id > 31) { /* Really a 8139. Use internal registers. */ void *ioaddr = tp->mmio_addr; if (location == 0) { - RTL_W8_F (Cfg9346, Cfg9346_Unlock); - RTL_W16_F (BasicModeCtrl, value); - RTL_W8_F (Cfg9346, Cfg9346_Lock); + RTL_W8 (Cfg9346, Cfg9346_Unlock); + RTL_W16 (BasicModeCtrl, value); + RTL_W8 (Cfg9346, Cfg9346_Lock); } else if (location < 8 && mii_2_8139_map[location]) - RTL_W16_F (mii_2_8139_map[location], value); + RTL_W16 (mii_2_8139_map[location], value); return; } + +#ifdef CONFIG_8139TOO_8129 mdio_sync (mdio_addr); /* Shift the command bits out. */ @@ -1261,7 +1391,6 @@ writeb (dataval | MDIO_CLK, mdio_addr); mdio_delay (mdio_addr); } - /* Clear out extra bits. */ for (i = 2; i > 0; i--) { writeb (0, mdio_addr); @@ -1269,7 +1398,7 @@ writeb (MDIO_CLK, mdio_addr); mdio_delay (mdio_addr); } - return; +#endif } @@ -1318,7 +1447,7 @@ DPRINTK ("%s: rtl8139_open() ioaddr %#lx IRQ %d" " GP Pins %2.2x %s-duplex.\n", - dev->name, pci_resource_start (tp, 1), + dev->name, (unsigned long) tp->mmio_addr, dev->irq, RTL_R8 (MediaStatus), tp->full_duplex ? "full" : "half"); @@ -1332,6 +1461,28 @@ } +static void rtl_check_media (struct device *dev) +{ + struct rtl8139_private *tp = dev->priv; + + DPRINTK("ENTER\n"); + + if (tp->phys[0] >= 0) { + u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5); + if (mii_reg5 == 0xffff) + ; /* Not there */ + else if ((mii_reg5 & 0x0100) == 0x0100 + || (mii_reg5 & 0x00C0) == 0x0040) + tp->full_duplex = 1; + + printk (KERN_INFO"%s: Setting %s%s-duplex based on" + " auto-negotiated partner ability %4.4x.\n", + dev->name, mii_reg5 == 0 ? "" : + (mii_reg5 & 0x0180) ? "100mbps " : "10mbps ", + tp->full_duplex ? "full" : "half", mii_reg5); + } +} + /* Start the hardware at open or resume. */ static void rtl8139_hw_start (struct device *dev) { @@ -1342,14 +1493,11 @@ DPRINTK ("ENTER\n"); - /* Soft reset the chip. */ - RTL_W8 (ChipCmd, (RTL_R8 (ChipCmd) & ChipCmdClear) | CmdReset); - udelay (100); + /* Bring old chips out of low-power mode. */ + if (rtl_chip_info[tp->chipset].flags & HasHltClk) + RTL_W8 (HltClk, 'R'); - /* Check that the chip has finished the reset. */ - for (i = 1000; i > 0; i--) - if ((RTL_R8 (ChipCmd) & CmdReset) == 0) - break; + rtl8139_chip_reset (ioaddr); /* unlock Config[01234] and BMCR register writes */ RTL_W8_F (Cfg9346, Cfg9346_Unlock); @@ -1358,57 +1506,28 @@ RTL_W32_F (MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4))); /* Must enable Tx/Rx before setting transfer thresholds! */ - RTL_W8_F (ChipCmd, (RTL_R8 (ChipCmd) & ChipCmdClear) | - CmdRxEnb | CmdTxEnb); + RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb); - i = rtl8139_rx_config | - (RTL_R32 (RxConfig) & rtl_chip_info[tp->chipset].RxConfigMask); - RTL_W32_F (RxConfig, i); + tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; + RTL_W32 (RxConfig, tp->rx_config); /* Check this value: the documentation for IFG contradicts ifself. */ RTL_W32 (TxConfig, (TX_DMA_BURST << TxDMAShift)); tp->cur_rx = 0; - - /* This is check_duplex() */ - if (tp->phys[0] >= 0 || (tp->drv_flags & HAS_MII_XCVR)) { - u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5); - if (mii_reg5 == 0xffff) - ; /* Not there */ - else if ((mii_reg5 & 0x0100) == 0x0100 - || (mii_reg5 & 0x00C0) == 0x0040) - tp->full_duplex = 1; - printk(KERN_INFO"%s: Setting %s%s-duplex based on" - " auto-negotiated partner ability %4.4x.\n", dev->name, - mii_reg5 == 0 ? "" : - (mii_reg5 & 0x0180) ? "100Mbps " : "10Mbps ", - tp->full_duplex ? "full" : "half", mii_reg5); - } - - if (tp->chipset >= CH_8139A) { - tmp = RTL_R8 (Config1) & Config1Clear; - tmp |= Cfg1_Driver_Load; - tmp |= (tp->chipset == CH_8139B) ? 3 : 1; /* Enable PM/VPD */ - RTL_W8_F (Config1, tmp); - } else { - u8 foo = RTL_R8 (Config1) & Config1Clear; - RTL_W8 (Config1, tp->full_duplex ? (foo|0x60) : (foo|0x20)); - } + + rtl_check_media (dev); if (tp->chipset >= CH_8139B) { - tmp = RTL_R8 (Config4) & ~(1<<2); - /* chip will clear Rx FIFO overflow automatically */ - tmp |= (1<<7); - RTL_W8 (Config4, tmp); - /* disable magic packet scanning, which is enabled - * when PM is enabled above (Config1) */ + * when PM is enabled in Config1 */ RTL_W8 (Config3, RTL_R8 (Config3) & ~(1<<5)); } + DPRINTK("init buffer addresses\n"); + /* Lock Config[01234] and BMCR register writes */ - RTL_W8_F (Cfg9346, Cfg9346_Lock); - udelay (10); + RTL_W8 (Cfg9346, Cfg9346_Lock); /* init Rx ring buffer DMA address */ RTL_W32_F (RxBuf, tp->rx_ring_dma); @@ -1417,7 +1536,7 @@ for (i = 0; i < NUM_TX_DESC; i++) RTL_W32_F (TxAddr0 + (i * 4), tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs)); - RTL_W32_F (RxMissed, 0); + RTL_W32 (RxMissed, 0); rtl8139_set_rx_mode (dev); @@ -1425,11 +1544,12 @@ RTL_W16 (MultiIntr, RTL_R16 (MultiIntr) & MultiIntrClear); /* make sure RxTx has started */ - RTL_W8_F (ChipCmd, (RTL_R8 (ChipCmd) & ChipCmdClear) | - CmdRxEnb | CmdTxEnb); + tmp = RTL_R8 (ChipCmd); + if ((!(tmp & CmdRxEnb)) || (!(tmp & CmdTxEnb))) + RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb); /* Enable all known interrupts by setting the interrupt mask. */ - RTL_W16_F (IntrMask, rtl8139_intr_mask); + RTL_W16 (IntrMask, rtl8139_intr_mask); netif_start_queue (dev); @@ -1569,14 +1689,23 @@ || (mii_reg5 & 0x01C0) == 0x0040; if (tp->full_duplex != duplex) { tp->full_duplex = duplex; - printk (KERN_INFO - "%s: Setting %s-duplex based on MII #%d link" - " partner ability of %4.4x.\n", dev->name, - tp->full_duplex ? "full" : "half", - tp->phys[0], mii_reg5); + + if (mii_reg5) { + printk (KERN_INFO + "%s: Setting %s-duplex based on MII #%d link" + " partner ability of %4.4x.\n", + dev->name, + tp->full_duplex ? "full" : "half", + tp->phys[0], mii_reg5); + } else { + printk(KERN_INFO"%s: media is unconnected, link down, or incompatible connection\n", + dev->name); + } +#if 0 RTL_W8 (Cfg9346, Cfg9346_Unlock); RTL_W8 (Config1, tp->full_duplex ? 0x60 : 0x20); RTL_W8 (Cfg9346, Cfg9346_Lock); +#endif } } @@ -1603,6 +1732,7 @@ struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv; unsigned long timeout; + exit_files(current); daemonize (); spin_lock_irq(¤t->sigmask_lock); sigemptyset(¤t->blocked); @@ -1613,6 +1743,7 @@ current->comm[sizeof(current->comm) - 1] = '\0'; while (1) { + rtl8139_thread_iter (dev, tp, tp->mmio_addr); timeout = next_tick; do { timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout); @@ -1622,7 +1753,6 @@ break; rtnl_lock (); - rtl8139_thread_iter (dev, tp, tp->mmio_addr); rtnl_unlock (); } @@ -1656,6 +1786,7 @@ void *ioaddr = tp->mmio_addr; int i; u8 tmp8; + unsigned long flags; DPRINTK ("%s: Transmit timeout, status %2.2x %4.4x " "media %2.2x.\n", dev->name, @@ -1663,16 +1794,18 @@ RTL_R16 (IntrStatus), RTL_R8 (MediaStatus)); + tp->xstats.tx_timeouts++; + /* disable Tx ASAP, if not already */ tmp8 = RTL_R8 (ChipCmd); if (tmp8 & CmdTxEnb) - RTL_W8 (ChipCmd, tmp8 & ~CmdTxEnb); + RTL_W8 (ChipCmd, CmdRxEnb); /* Disable interrupts by clearing the interrupt mask. */ RTL_W16 (IntrMask, 0x0000); /* Emit info to figure out what went wrong. */ - printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", + printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", dev->name, tp->cur_tx, tp->dirty_tx); for (i = 0; i < NUM_TX_DESC; i++) printk (KERN_DEBUG "%s: Tx descriptor %d is %8.8lx.%s\n", @@ -1681,12 +1814,14 @@ " (queue head)" : ""); /* Stop a shared interrupt from scavenging while we are. */ - spin_lock_irq (&tp->lock); + spin_lock_irqsave (&tp->lock, flags); rtl8139_tx_clear (tp); - spin_unlock_irq (&tp->lock); + spin_unlock_irqrestore (&tp->lock, flags); /* ...and finally, reset everything */ rtl8139_hw_start (dev); + + netif_wake_queue (dev); } @@ -1694,13 +1829,18 @@ { struct rtl8139_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; - int entry; + unsigned int entry; + u32 dma_addr; if (dev->tbusy) { /* If this happens network layer tells us we're broken. */ - if (jiffies - dev->trans_start > TX_TIMEOUT) + if (jiffies - dev->trans_start > TX_TIMEOUT) { rtl8139_tx_timeout(dev); + if (skb) kfree_skb(skb); + return 0; + } } + mb(); /* Calculate the next Tx descriptor entry. */ entry = tp->cur_tx % NUM_TX_DESC; @@ -1708,29 +1848,28 @@ assert (tp->tx_info[entry].skb == NULL); tp->tx_info[entry].skb = skb; - if ((long) skb->data & 3) { /* Must use alignment buffer. */ - /* tp->tx_info[entry].mapping = 0 */ + if ((long) skb->data & 3) { /* Must use alignment buffer. */ + /* tp->tx_info[entry].mapping = 0; */ memcpy (tp->tx_buf[entry], skb->data, skb->len); - RTL_W32 (TxAddr0 + (entry * 4), - tp->tx_bufs_dma + (tp->tx_buf[entry] - tp->tx_bufs)); + dma_addr = tp->tx_bufs_dma + (tp->tx_buf[entry] - tp->tx_bufs); } else { - RTL_W32 (TxAddr0 + (entry * 4), virt_to_bus(skb->data)); + dma_addr = virt_to_bus(skb->data); } /* Note: the chip doesn't have auto-pad! */ - RTL_W32 (TxStatus0 + (entry * sizeof(u32)), - tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); + spin_lock_irq(&tp->lock); + RTL_W32_F (TxAddr0 + (entry * 4), dma_addr); + RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), + tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); + spin_unlock_irq(&tp->lock); dev->trans_start = jiffies; - spin_lock_irq (&tp->lock); - tp->cur_tx++; + mb(); if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) netif_stop_queue (dev); - spin_unlock_irq (&tp->lock); - DPRINTK ("%s: Queued Tx packet at %p size %u to slot %d.\n", dev->name, skb->data, skb->len, entry); @@ -1767,7 +1906,7 @@ tp->stats.tx_errors++; if (txstatus & TxAborted) { tp->stats.tx_aborted_errors++; - RTL_W32 (TxConfig, TxClearAbt | (TX_DMA_BURST << TxDMAShift)); + RTL_W32_F (TxConfig, TxClearAbt | (TX_DMA_BURST << TxDMAShift)); } if (txstatus & TxCarrierLost) tp->stats.tx_carrier_errors++; @@ -1798,7 +1937,7 @@ #ifndef RTL8139_NDEBUG if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { printk (KERN_ERR "%s: Out-of-sync dirty pointer, %ld vs. %ld.\n", - dev->name, dirty_tx, tp->cur_tx); + dev->name, dirty_tx, tp->cur_tx); dirty_tx += NUM_TX_DESC; } #endif /* RTL8139_NDEBUG */ @@ -1806,11 +1945,13 @@ /* only wake the queue if we did work, and the queue is stopped */ if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; + mb(); if (netif_queue_stopped (dev)) netif_wake_queue (dev); } } + /* TODO: clean this up! Rx reset need not be this intensive */ static void rtl8139_rx_err (u32 rx_status, struct device *dev, struct rtl8139_private *tp, void *ioaddr) @@ -1836,8 +1977,7 @@ tp->cur_rx = 0; /* disable receive */ - tmp8 = RTL_R8 (ChipCmd) & ChipCmdClear; - RTL_W8_F (ChipCmd, tmp8 | CmdTxEnb); + RTL_W8 (ChipCmd, CmdTxEnb); /* A.C.: Reset the multicast list. */ rtl8139_set_rx_mode (dev); @@ -1845,11 +1985,11 @@ /* XXX potentially temporary hack to * restart hung receiver */ while (--tmp_work > 0) { + barrier(); tmp8 = RTL_R8 (ChipCmd); if ((tmp8 & CmdRxEnb) && (tmp8 & CmdTxEnb)) break; - RTL_W8_F (ChipCmd, - (tmp8 & ChipCmdClear) | CmdRxEnb | CmdTxEnb); + RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb); } /* G.S.: Re-enable receiver */ @@ -1861,8 +2001,6 @@ } -/* The data sheet doesn't describe the Rx ring at all, so I'm guessing at the - field alignments and semantics. */ static void rtl8139_rx_interrupt (struct device *dev, struct rtl8139_private *tp, void *ioaddr) { @@ -1888,6 +2026,8 @@ unsigned int pkt_size; struct sk_buff *skb; + rmb(); + /* read size+status of next frame from DMA ring buffer */ rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset)); rx_size = rx_status >> 16; @@ -1907,17 +2047,10 @@ } #endif - /* E. Gill */ - /* Note from BSD driver: - * Here's a totally undocumented fact for you. When the - * RealTek chip is in the process of copying a packet into - * RAM for you, the length will be 0xfff0. If you spot a - * packet header with this value, you need to stop. The - * datasheet makes absolutely no mention of this and - * RealTek should be shot for this. - */ - if (rx_size == 0xfff0) + if (rx_size == 0xfff0) { /* Early Rx in progress */ + tp->xstats.early_rx++; break; + } /* If Rx err or invalid rx_size/rx_status received * (which happens if we get lost in the ring), @@ -1925,6 +2058,7 @@ * Rx processing. */ if ((rx_size > (MAX_ETH_FRAME_SIZE+4)) || + (rx_size < 8) || (!(rx_status & RxStatusOK))) { rtl8139_rx_err (rx_status, dev, tp, ioaddr); return; @@ -1951,6 +2085,7 @@ netif_rx (skb); mark_bh(NET_BH); tp->stats.rx_bytes += pkt_size ; + dev->last_rx = jiffies; tp->stats.rx_packets++; } else { printk (KERN_WARNING @@ -1960,15 +2095,22 @@ } cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; - RTL_W16_F (RxBufPtr, cur_rx - 16); + RTL_W16 (RxBufPtr, cur_rx - 16); + + if (RTL_R16 (IntrStatus) & RxAckBits) + RTL_W16_F (IntrStatus, RxAckBits); } DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," - " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, - RTL_R16 (RxBufAddr), - RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); + " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, + RTL_R16 (RxBufAddr), + RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); tp->cur_rx = cur_rx; + + if ((RTL_R8 (ChipCmd) & RxBufEmpty) && + (RTL_R16 (IntrStatus) & RxAckBits)) + RTL_W16_F (IntrStatus, RxAckBits); } @@ -1977,8 +2119,8 @@ void *ioaddr, int status, int link_changed) { - printk (KERN_DEBUG "%s: Abnormal interrupt, status %8.8x.\n", - dev->name, status); + DPRINTK ("%s: Abnormal interrupt, status %8.8x.\n", + dev->name, status); assert (dev != NULL); assert (tp != NULL); @@ -1996,9 +2138,11 @@ || tp->duplex_lock; if (tp->full_duplex != duplex) { tp->full_duplex = duplex; +#if 0 RTL_W8 (Cfg9346, Cfg9346_Unlock); RTL_W8 (Config1, tp->full_duplex ? 0x60 : 0x20); RTL_W8 (Cfg9346, Cfg9346_Lock); +#endif } status &= ~RxUnderrun; } @@ -2012,11 +2156,6 @@ tp->stats.rx_length_errors++; if (status & (RxUnderrun | RxFIFOOver)) tp->stats.rx_fifo_errors++; - if (status & RxOverflow) { - tp->stats.rx_over_errors++; - tp->cur_rx = RTL_R16 (RxBufAddr) % RX_BUF_LEN; - RTL_W16_F (RxBufPtr, tp->cur_rx - 16); - } if (status & PCIErr) { u16 pci_cmd_status; pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); @@ -2036,7 +2175,10 @@ struct rtl8139_private *tp = dev->priv; int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; - int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */ + int ackstat, status; + int link_changed = 0; /* avoid bogus "uninit" warning */ + + spin_lock (&tp->lock); do { status = RTL_R16 (IntrStatus); @@ -2050,63 +2192,45 @@ if (status & RxUnderrun) link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - /* E. Gill */ - /* In case of an RxFIFOOver we must also clear the RxOverflow - bit to avoid dropping frames for ever. Believe me, I got a - lot of troubles copying huge data (approximately 2 RxFIFOOver - errors per 1GB data transfer). - The following is written in the 'p-guide.pdf' file (RTL8139(A/B) - Programming guide V0.1, from 1999/1/15) on page 9 from REALTEC. - ----------------------------------------------------------- - 2. RxFIFOOvw handling: - When RxFIFOOvw occurs, all incoming packets are discarded. - Clear ISR(RxFIFOOvw) doesn't dismiss RxFIFOOvw event. To - dismiss RxFIFOOvw event, the ISR(RxBufOvw) must be written - with a '1'. - ----------------------------------------------------------- - Unfortunately I was not able to find any reason for the - RxFIFOOver error (I got the feeling this depends on the - CPU speed, lower CPU speed --> more errors). - After clearing the RxOverflow bit the transfer of the - packet was repeated and all data are error free transfered */ - RTL_W16_F (IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status); - - DPRINTK ("%s: interrupt status=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, - RTL_R16 (IntrStatus)); + /* The chip takes special action when we clear RxAckBits, + * so we clear them later in rtl8139_rx_interrupt + */ + ackstat = status & ~RxAckBits; + RTL_W16 (IntrStatus, ackstat); + + DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", + dev->name, ackstat, status, RTL_R16 (IntrStatus)); - if ((status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow - | RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) + if ((status & + (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | + RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) break; + if (netif_running (dev) && (status & RxAckBits)) + rtl8139_rx_interrupt (dev, tp, ioaddr); + /* Check uncommon events with one test. */ if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | RxErr)) rtl8139_weird_interrupt (dev, tp, ioaddr, status, link_changed); - if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver)) /* Rx interrupt */ - rtl8139_rx_interrupt (dev, tp, ioaddr); - - if (status & (TxOK | TxErr)) { - spin_lock (&tp->lock); + if (netif_running (dev) && (status & (TxOK | TxErr))) rtl8139_tx_interrupt (dev, tp, ioaddr); - spin_unlock (&tp->lock); - } boguscnt--; } while (boguscnt > 0); if (boguscnt <= 0) { - printk (KERN_WARNING - "%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", dev->name, - status); + printk (KERN_WARNING "%s: Too much work at interrupt, " + "IntrStatus=0x%4.4x.\n", dev->name, status); /* Clear all interrupt sources. */ RTL_W16 (IntrStatus, 0xffff); } + spin_unlock (&tp->lock); + DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, RTL_R16 (IntrStatus)); } @@ -2116,8 +2240,9 @@ { struct rtl8139_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; - int i; int ret = 0; + int i; + unsigned long flags; DPRINTK ("ENTER\n"); @@ -2135,26 +2260,21 @@ DPRINTK ("%s: Shutting down ethercard, status was 0x%4.4x.\n", dev->name, RTL_R16 (IntrStatus)); - spin_lock_irq(&tp->lock); + spin_lock_irqsave (&tp->lock, flags); /* Stop the chip's Tx and Rx DMA processes. */ - RTL_W8 (ChipCmd, (RTL_R8 (ChipCmd) & ChipCmdClear)); + RTL_W8 (ChipCmd, 0); /* Disable interrupts by clearing the interrupt mask. */ - RTL_W16 (IntrMask, 0x0000); + RTL_W16 (IntrMask, 0); /* Update the error counts. */ tp->stats.rx_missed_errors += RTL_R32 (RxMissed); RTL_W32 (RxMissed, 0); - spin_unlock_irq (&tp->lock); + spin_unlock_irqrestore (&tp->lock, flags); synchronize_irq (); - - /* snooze for a small bit */ - if (current->need_resched) - schedule (); - free_irq (dev->irq, dev); rtl8139_tx_clear (tp); @@ -2176,53 +2296,92 @@ /* Green! Put the chip in low-power mode. */ RTL_W8 (Cfg9346, Cfg9346_Unlock); - RTL_W8 (Config1, 0x03); - RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - MOD_DEC_USE_COUNT; + if (rtl_chip_info[tp->chipset].flags & HasHltClk) + RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ + MOD_DEC_USE_COUNT; DPRINTK ("EXIT\n"); return 0; } -static int mii_ioctl (struct device *dev, struct ifreq *rq, int cmd) +static int netdev_ethtool_ioctl (struct device *dev, void *useraddr) +{ + struct rtl8139_private *np = dev->priv; + u32 ethcmd; + + if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO: + { + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy (info.driver, DRV_NAME); + strcpy (info.version, DRV_VERSION); + sprintf(info.bus_info, "PCI slot #%u", PCI_SLOT(np->pci_dev->devfn)); + if (copy_to_user (useraddr, &info, sizeof (info))) + return -EFAULT; + return 0; + } + + default: + break; + } + + return -EOPNOTSUPP; +} + +static int netdev_ioctl (struct device *dev, struct ifreq *rq, int cmd) { struct rtl8139_private *tp = dev->priv; - u16 *data = (u16 *) & rq->ifr_data; + struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; int rc = 0; + int phy = tp->phys[0] & 0x3f; DPRINTK ("ENTER\n"); +#ifdef notdef + data->phy_id &= 0x1f; + data->reg_num &= 0x1f; +#endif + switch (cmd) { - case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ - data[0] = tp->phys[0] & 0x3f; + case SIOCETHTOOL: + return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); + + case SIOCGMIIPHY: /* Get the address of the PHY in use. */ + case SIOCDEVPRIVATE: /* binary compat, remove in 2.5 */ + data->phy_id = phy; /* Fall Through */ - case SIOCDEVPRIVATE + 1: /* Read the specified MII register. */ - data[3] = mdio_read (dev, data[0], data[1] & 0x1f); + case SIOCGMIIREG: /* Read the specified MII register. */ + case SIOCDEVPRIVATE+1: /* binary compat, remove in 2.5 */ + data->val_out = mdio_read (dev, data->phy_id, data->reg_num); break; - case SIOCDEVPRIVATE + 2: /* Write the specified MII register */ + case SIOCSMIIREG: /* Write the specified MII register */ + case SIOCDEVPRIVATE+2: /* binary compat, remove in 2.5 */ if (!capable (CAP_NET_ADMIN)) { rc = -EPERM; break; } - if (data[0] == tp->phys[0]) { - u16 value = data[2]; - switch (data[1]) { + if (data->phy_id == phy) { + u16 value = data->val_in; + switch (data->reg_num) { case 0: /* Check for autonegotiation on or reset. */ tp->medialock = (value & 0x9000) ? 0 : 1; if (tp->medialock) tp->full_duplex = (value & 0x0100) ? 1 : 0; break; - case 4: tp->advertising = value; break; + case 4: /* tp->advertising = value; */ break; } } - mdio_write(dev, data[0], data[1] & 0x1f, data[2]); - break; + mdio_write(dev, data->phy_id, data->reg_num, data->val_in); + break; default: rc = -EOPNOTSUPP; @@ -2238,22 +2397,21 @@ { struct rtl8139_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; + unsigned long flags; DPRINTK ("ENTER\n"); if (netif_running(dev)) { - spin_lock_irq(&tp->lock); + spin_lock_irqsave (&tp->lock, flags); tp->stats.rx_missed_errors += RTL_R32 (RxMissed); RTL_W32 (RxMissed, 0); - spin_unlock_irq(&tp->lock); + spin_unlock_irqrestore (&tp->lock, flags); } DPRINTK ("EXIT\n"); return &tp->stats; } - - /* Set or clear the multicast filter for this adaptor. This routine is not state sensitive and need not be SMP locked. */ @@ -2272,7 +2430,7 @@ ethernet_polynomial : 0); } - DPRINTK ("EXIT\n"); + DPRINTK ("EXIT, returning %u\n", crc); return crc; } @@ -2307,20 +2465,25 @@ mc_filter[1] = mc_filter[0] = 0xffffffff; } else { struct dev_mc_list *mclist; - rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; + rx_mode = AcceptBroadcast | AcceptMyPhys; mc_filter[1] = mc_filter[0] = 0; for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26, - mc_filter); + i++, mclist = mclist->next) { + int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; + + mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31)); + rx_mode |= AcceptMulticast; + } } spin_lock_irqsave (&tp->lock, flags); /* We can safely update without stopping the chip. */ - tmp = rtl8139_rx_config | rx_mode | - (RTL_R32 (RxConfig) & rtl_chip_info[tp->chipset].RxConfigMask); - RTL_W32_F (RxConfig, tmp); + tmp = rtl8139_rx_config | rx_mode; + if (tp->rx_config != tmp) { + RTL_W32 (RxConfig, tmp); + tp->rx_config = tmp; + } RTL_W32_F (MAR0 + 0, mc_filter[0]); RTL_W32_F (MAR0 + 4, mc_filter[1]); @@ -2334,13 +2497,21 @@ { struct pci_dev *pcidev; struct pci_device_id *pdid; + struct rtl8139_private *tp; + int i, initialized; if (rtl8139_initialized) return -ENODEV; for (pdid=&rtl8139_pci_tbl[0]; pdid->vendor != 0; pdid++) { - for (pcidev = pci_find_device(pdid->vendor, pdid->device, NULL); pcidev != NULL; pcidev = pci_find_device(pdid->vendor, pdid->device, pcidev)) { - if (rtl8139_init_one(pcidev, pdid) != 0) { - printk(KERN_ERR "Error initializing PCI device %08lX.\n", (unsigned long) pcidev); + for (pcidev = rtl8139_pci_find_device(pdid->vendor, pdid->device, NULL); pcidev != NULL; pcidev = rtl8139_pci_find_device(pdid->vendor, pdid->device, pcidev)) { + initialized = 0; + for (i=0; ipriv; + if (tp->pci_dev == pcidev) + initialized = 1; } + if (!initialized) + if (rtl8139_init_one(pcidev, pdid) != 0) + printk(KERN_ERR "Error initializing PCI device %08lX.\n", (unsigned long) pcidev); } } rtl8139_initialized++; @@ -2361,13 +2532,6 @@ #ifdef MODULE -MODULE_AUTHOR (RTL8139_AUTHOR); -MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver"); -MODULE_PARM (multicast_filter_limit, "i"); -MODULE_PARM (max_interrupt_work, "i"); -MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); - int init_module(void) { return rtl8139_init(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/82596.c linux.20p9/drivers/net/82596.c --- linux.vanilla/drivers/net/82596.c Sun Mar 25 17:31:20 2001 +++ linux.20p9/drivers/net/82596.c Wed Jul 4 16:03:55 2001 @@ -1106,7 +1106,7 @@ { int i; struct i596_private *lp; - char eth_addr[6]; + char eth_addr[8]; static int probed = 0; if (probed) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/Config.in linux.20p9/drivers/net/Config.in --- linux.vanilla/drivers/net/Config.in Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/Config.in Thu Jul 26 15:50:16 2001 @@ -101,10 +101,11 @@ tristate 'RealTek 8129/8139 (not 8019/8029!) support' CONFIG_RTL8139 fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Alternative RealTek 8139 driver (8139too) support' CONFIG_RTL8139TOO + tristate 'Alternative RealTek 8129/8139 driver (8139too) support' CONFIG_RTL8139TOO if [ "$CONFIG_RTL8139TOO" != "n" ]; then bool ' Use PIO instead of MMIO' CONFIG_8139TOO_PIO bool ' Support for automatic channel equalization' CONFIG_8139TOO_TUNE_TWISTER + bool ' Support for 8129' CONFIG_8139TOO_8129 fi fi bool 'Other ISA cards' CONFIG_NET_ISA @@ -135,8 +136,8 @@ bool 'EISA, VLB, PCI and on board controllers' CONFIG_NET_EISA if [ "$CONFIG_NET_EISA" = "y" ]; then tristate 'AMD PCnet32 (VLB and PCI) support' CONFIG_PCNET32 + tristate 'Adaptec Starfire/DuraLAN support' CONFIG_ADAPTEC_STARFIRE if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Adaptec Starfire support (EXPERIMENTAL)' CONFIG_ADAPTEC_STARFIRE tristate 'Ansel Communications EISA 3200 support (EXPERIMENTAL)' CONFIG_AC3200 fi tristate 'Apricot Xen-II on board Ethernet' CONFIG_APRICOT @@ -301,7 +302,7 @@ # # Microgate Synclink HDLC/SYNCPPP support # -dep_tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP m +tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP # # Lan Media's board. Currently 1000, 1200, 5200, 5245 @@ -344,6 +345,11 @@ fi fi +if [ "$CONFIG_HDLC" = "y" -o "$CONFIG_SYNCLINK_SYNCPPP" = "y" -o \ + "$CONFIG_LANMEDIA" = "y" ] ; then + define_bool CONFIG_SYNCPPP y +fi + tristate 'Frame relay DLCI support' CONFIG_DLCI if [ "$CONFIG_DLCI" != "n" ]; then int ' Max open DLCI' CONFIG_DLCI_COUNT 24 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/Makefile linux.20p9/drivers/net/Makefile --- linux.vanilla/drivers/net/Makefile Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/Makefile Wed Jul 4 16:03:55 2001 @@ -1445,7 +1445,7 @@ rm -f core *.o *.a *.s wanpipe.o: $(WANPIPE_OBJS) - ld -r -o $@ $(WANPIPE_OBJS) + $(LD) -r -o $@ $(WANPIPE_OBJS) rcpci.o: rcpci45.o rclanmtl.o $(LD) -r -o rcpci.o rcpci45.o rclanmtl.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/daynaport.c linux.20p9/drivers/net/daynaport.c --- linux.vanilla/drivers/net/daynaport.c Sun Mar 25 17:31:20 2001 +++ linux.20p9/drivers/net/daynaport.c Wed Jul 4 16:03:55 2001 @@ -447,7 +447,7 @@ } /* We should hopefully not get here */ - printk(KERN_ERR "Probe unsucessful.\n"); + printk(KERN_ERR "Probe unsuccessful.\n"); return -ENODEV; membad: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/falc-lh.h linux.20p9/drivers/net/falc-lh.h --- linux.vanilla/drivers/net/falc-lh.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/falc-lh.h Wed Jul 4 16:03:55 2001 @@ -0,0 +1,1232 @@ +/* + * falc.h Description of the Siemens FALC T1/E1 framer. + * + * Author: Ivan Passos + * + * Copyright: (c) 2000-2001 Cyclades 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. + * + * $Log: falc.h,v $ + * Revision 1.1 2000/05/15 ivan + * Included DJA bits for the LIM2 register. + * + * Revision 1.0 2000/02/22 ivan + * Initial version. + * + */ + +#ifndef _FALC_LH_H +#define _FALC_LH_H + +#define NUM_OF_T1_CHANNELS 24 +#define NUM_OF_E1_CHANNELS 32 + +/*>>>>>>>>>>>>>>>>> FALC Register Bits (Transmit Mode) <<<<<<<<<<<<<<<<<<< */ + +/* CMDR (Command Register) + ---------------- E1 & T1 ------------------------------ */ +#define CMDR_RMC 0x80 +#define CMDR_RRES 0x40 +#define CMDR_XREP 0x20 +#define CMDR_XRES 0x10 +#define CMDR_XHF 0x08 +#define CMDR_XTF 0x04 +#define CMDR_XME 0x02 +#define CMDR_SRES 0x01 + +/* MODE (Mode Register) + ----------------- E1 & T1 ----------------------------- */ +#define MODE_MDS2 0x80 +#define MODE_MDS1 0x40 +#define MODE_MDS0 0x20 +#define MODE_BRAC 0x10 +#define MODE_HRAC 0x08 + +/* IPC (Interrupt Port Configuration) + ----------------- E1 & T1 ----------------------------- */ +#define IPC_VIS 0x80 +#define IPC_SCI 0x04 +#define IPC_IC1 0x02 +#define IPC_IC0 0x01 + +/* CCR1 (Common Configuration Register 1) + ----------------- E1 & T1 ----------------------------- */ +#define CCR1_SFLG 0x80 +#define CCR1_XTS16RA 0x40 +#define CCR1_BRM 0x40 +#define CCR1_CASSYM 0x20 +#define CCR1_EDLX 0x20 +#define CCR1_EITS 0x10 +#define CCR1_ITF 0x08 +#define CCR1_RFT1 0x02 +#define CCR1_RFT0 0x01 + +/* CCR3 (Common Configuration Register 3) + ---------------- E1 & T1 ------------------------------ */ + +#define CCR3_PRE1 0x80 +#define CCR3_PRE0 0x40 +#define CCR3_EPT 0x20 +#define CCR3_RADD 0x10 +#define CCR3_RCRC 0x04 +#define CCR3_XCRC 0x02 + + +/* RTR1-4 (Receive Timeslot Register 1-4) + ---------------- E1 & T1 ------------------------------ */ + +#define RTR1_TS0 0x80 +#define RTR1_TS1 0x40 +#define RTR1_TS2 0x20 +#define RTR1_TS3 0x10 +#define RTR1_TS4 0x08 +#define RTR1_TS5 0x04 +#define RTR1_TS6 0x02 +#define RTR1_TS7 0x01 + +#define RTR2_TS8 0x80 +#define RTR2_TS9 0x40 +#define RTR2_TS10 0x20 +#define RTR2_TS11 0x10 +#define RTR2_TS12 0x08 +#define RTR2_TS13 0x04 +#define RTR2_TS14 0x02 +#define RTR2_TS15 0x01 + +#define RTR3_TS16 0x80 +#define RTR3_TS17 0x40 +#define RTR3_TS18 0x20 +#define RTR3_TS19 0x10 +#define RTR3_TS20 0x08 +#define RTR3_TS21 0x04 +#define RTR3_TS22 0x02 +#define RTR3_TS23 0x01 + +#define RTR4_TS24 0x80 +#define RTR4_TS25 0x40 +#define RTR4_TS26 0x20 +#define RTR4_TS27 0x10 +#define RTR4_TS28 0x08 +#define RTR4_TS29 0x04 +#define RTR4_TS30 0x02 +#define RTR4_TS31 0x01 + + +/* TTR1-4 (Transmit Timeslot Register 1-4) + ---------------- E1 & T1 ------------------------------ */ + +#define TTR1_TS0 0x80 +#define TTR1_TS1 0x40 +#define TTR1_TS2 0x20 +#define TTR1_TS3 0x10 +#define TTR1_TS4 0x08 +#define TTR1_TS5 0x04 +#define TTR1_TS6 0x02 +#define TTR1_TS7 0x01 + +#define TTR2_TS8 0x80 +#define TTR2_TS9 0x40 +#define TTR2_TS10 0x20 +#define TTR2_TS11 0x10 +#define TTR2_TS12 0x08 +#define TTR2_TS13 0x04 +#define TTR2_TS14 0x02 +#define TTR2_TS15 0x01 + +#define TTR3_TS16 0x80 +#define TTR3_TS17 0x40 +#define TTR3_TS18 0x20 +#define TTR3_TS19 0x10 +#define TTR3_TS20 0x08 +#define TTR3_TS21 0x04 +#define TTR3_TS22 0x02 +#define TTR3_TS23 0x01 + +#define TTR4_TS24 0x80 +#define TTR4_TS25 0x40 +#define TTR4_TS26 0x20 +#define TTR4_TS27 0x10 +#define TTR4_TS28 0x08 +#define TTR4_TS29 0x04 +#define TTR4_TS30 0x02 +#define TTR4_TS31 0x01 + + + +/* IMR0-4 (Interrupt Mask Register 0-4) + + ----------------- E1 & T1 ----------------------------- */ + +#define IMR0_RME 0x80 +#define IMR0_RFS 0x40 +#define IMR0_T8MS 0x20 +#define IMR0_ISF 0x20 +#define IMR0_RMB 0x10 +#define IMR0_CASC 0x08 +#define IMR0_RSC 0x08 +#define IMR0_CRC6 0x04 +#define IMR0_CRC4 0x04 +#define IMR0_PDEN 0x02 +#define IMR0_RPF 0x01 + +#define IMR1_CASE 0x80 +#define IMR1_RDO 0x40 +#define IMR1_ALLS 0x20 +#define IMR1_XDU 0x10 +#define IMR1_XMB 0x08 +#define IMR1_XLSC 0x02 +#define IMR1_XPR 0x01 +#define IMR1_LLBSC 0x80 + +#define IMR2_FAR 0x80 +#define IMR2_LFA 0x40 +#define IMR2_MFAR 0x20 +#define IMR2_T400MS 0x10 +#define IMR2_LMFA 0x10 +#define IMR2_AIS 0x08 +#define IMR2_LOS 0x04 +#define IMR2_RAR 0x02 +#define IMR2_RA 0x01 + +#define IMR3_ES 0x80 +#define IMR3_SEC 0x40 +#define IMR3_LMFA16 0x20 +#define IMR3_AIS16 0x10 +#define IMR3_RA16 0x08 +#define IMR3_API 0x04 +#define IMR3_XSLP 0x20 +#define IMR3_XSLN 0x10 +#define IMR3_LLBSC 0x08 +#define IMR3_XRS 0x04 +#define IMR3_SLN 0x02 +#define IMR3_SLP 0x01 + +#define IMR4_LFA 0x80 +#define IMR4_FER 0x40 +#define IMR4_CER 0x20 +#define IMR4_AIS 0x10 +#define IMR4_LOS 0x08 +#define IMR4_CVE 0x04 +#define IMR4_SLIP 0x02 +#define IMR4_EBE 0x01 + +/* FMR0-5 for E1 and T1 (Framer Mode Register ) */ + +#define FMR0_XC1 0x80 +#define FMR0_XC0 0x40 +#define FMR0_RC1 0x20 +#define FMR0_RC0 0x10 +#define FMR0_EXTD 0x08 +#define FMR0_ALM 0x04 +#define E1_FMR0_FRS 0x02 +#define T1_FMR0_FRS 0x08 +#define FMR0_SRAF 0x04 +#define FMR0_EXLS 0x02 +#define FMR0_SIM 0x01 + +#define FMR1_MFCS 0x80 +#define FMR1_AFR 0x40 +#define FMR1_ENSA 0x20 +#define FMR1_CTM 0x80 +#define FMR1_SIGM 0x40 +#define FMR1_EDL 0x20 +#define FMR1_PMOD 0x10 +#define FMR1_XFS 0x08 +#define FMR1_CRC 0x08 +#define FMR1_ECM 0x04 +#define FMR1_IMOD 0x02 +#define FMR1_XAIS 0x01 + +#define FMR2_RFS1 0x80 +#define FMR2_RFS0 0x40 +#define FMR2_MCSP 0x40 +#define FMR2_RTM 0x20 +#define FMR2_SSP 0x20 +#define FMR2_DAIS 0x10 +#define FMR2_SAIS 0x08 +#define FMR2_PLB 0x04 +#define FMR2_AXRA 0x02 +#define FMR2_ALMF 0x01 +#define FMR2_EXZE 0x01 + +#define LOOP_RTM 0x40 +#define LOOP_SFM 0x40 +#define LOOP_ECLB 0x20 +#define LOOP_CLA 0x1f + +/*--------------------- E1 ----------------------------*/ +#define FMR3_XLD 0x20 +#define FMR3_XLU 0x10 + +/*--------------------- T1 ----------------------------*/ +#define FMR4_AIS3 0x80 +#define FMR4_TM 0x40 +#define FMR4_XRA 0x20 +#define FMR4_SSC1 0x10 +#define FMR4_SSC0 0x08 +#define FMR4_AUTO 0x04 +#define FMR4_FM1 0x02 +#define FMR4_FM0 0x01 + +#define FMR5_SRS 0x80 +#define FMR5_EIBR 0x40 +#define FMR5_XLD 0x20 +#define FMR5_XLU 0x10 + + +/* LOOP (Channel Loop Back) + + ------------------ E1 & T1 ---------------------------- */ + +#define LOOP_SFM 0x40 +#define LOOP_ECLB 0x20 +#define LOOP_CLA4 0x10 +#define LOOP_CLA3 0x08 +#define LOOP_CLA2 0x04 +#define LOOP_CLA1 0x02 +#define LOOP_CLA0 0x01 + + + +/* XSW (Transmit Service Word Pulseframe) + + ------------------- E1 --------------------------- */ + +#define XSW_XSIS 0x80 +#define XSW_XTM 0x40 +#define XSW_XRA 0x20 +#define XSW_XY0 0x10 +#define XSW_XY1 0x08 +#define XSW_XY2 0x04 +#define XSW_XY3 0x02 +#define XSW_XY4 0x01 + + +/* XSP (Transmit Spare Bits) + + ------------------- E1 --------------------------- */ + +#define XSP_XAP 0x80 +#define XSP_CASEN 0x40 +#define XSP_TT0 0x20 +#define XSP_EBP 0x10 +#define XSP_AXS 0x08 +#define XSP_XSIF 0x04 +#define XSP_XS13 0x02 +#define XSP_XS15 0x01 + + +/* XC0/1 (Transmit Control 0/1) + ------------------ E1 & T1 ---------------------------- */ + +#define XC0_SA8E 0x80 +#define XC0_SA7E 0x40 +#define XC0_SA6E 0x20 +#define XC0_SA5E 0x10 +#define XC0_SA4E 0x08 +#define XC0_BRM 0x80 +#define XC0_MFBS 0x40 +#define XC0_SFRZ 0x10 +#define XC0_XCO2 0x04 +#define XC0_XCO1 0x02 +#define XC0_XCO0 0x01 + +#define XC1_XTO5 0x20 +#define XC1_XTO4 0x10 +#define XC1_XTO3 0x08 +#define XC1_XTO2 0x04 +#define XC1_XTO1 0x02 +#define XC1_XTO0 0x01 + + +/* RC0/1 (Receive Control 0/1) + ------------------ E1 & T1 ---------------------------- */ + +#define RC0_SICS 0x40 +#define RC0_CRCI 0x20 +#define RC0_XCRCI 0x10 +#define RC0_RDIS 0x08 +#define RC0_RCO2 0x04 +#define RC0_RCO1 0x02 +#define RC0_RCO0 0x01 + +#define RC1_SWD 0x80 +#define RC1_ASY4 0x40 +#define RC1_RRAM 0x40 +#define RC1_RTO5 0x20 +#define RC1_RTO4 0x10 +#define RC1_RTO3 0x08 +#define RC1_RTO2 0x04 +#define RC1_RTO1 0x02 +#define RC1_RTO0 0x01 + + + +/* XPM0-2 (Transmit Pulse Mask 0-2) + --------------------- E1 & T1 ------------------------- */ + +#define XPM0_XP12 0x80 +#define XPM0_XP11 0x40 +#define XPM0_XP10 0x20 +#define XPM0_XP04 0x10 +#define XPM0_XP03 0x08 +#define XPM0_XP02 0x04 +#define XPM0_XP01 0x02 +#define XPM0_XP00 0x01 + +#define XPM1_XP30 0x80 +#define XPM1_XP24 0x40 +#define XPM1_XP23 0x20 +#define XPM1_XP22 0x10 +#define XPM1_XP21 0x08 +#define XPM1_XP20 0x04 +#define XPM1_XP14 0x02 +#define XPM1_XP13 0x01 + +#define XPM2_XLHP 0x80 +#define XPM2_XLT 0x40 +#define XPM2_DAXLT 0x20 +#define XPM2_XP34 0x08 +#define XPM2_XP33 0x04 +#define XPM2_XP32 0x02 +#define XPM2_XP31 0x01 + + +/* TSWM (Transparent Service Word Mask) + ------------------ E1 ---------------------------- */ + +#define TSWM_TSIS 0x80 +#define TSWM_TSIF 0x40 +#define TSWM_TRA 0x20 +#define TSWM_TSA4 0x10 +#define TSWM_TSA5 0x08 +#define TSWM_TSA6 0x04 +#define TSWM_TSA7 0x02 +#define TSWM_TSA8 0x01 + +/* IDLE + + ------------------ E1 & T1 ----------------------- */ + +#define IDLE_IDL7 0x80 +#define IDLE_IDL6 0x40 +#define IDLE_IDL5 0x20 +#define IDLE_IDL4 0x10 +#define IDLE_IDL3 0x08 +#define IDLE_IDL2 0x04 +#define IDLE_IDL1 0x02 +#define IDLE_IDL0 0x01 + + +/* XSA4-8 + -------------------E1 ----------------------------- */ + +#define XSA4_XS47 0x80 +#define XSA4_XS46 0x40 +#define XSA4_XS45 0x20 +#define XSA4_XS44 0x10 +#define XSA4_XS43 0x08 +#define XSA4_XS42 0x04 +#define XSA4_XS41 0x02 +#define XSA4_XS40 0x01 + +#define XSA5_XS57 0x80 +#define XSA5_XS56 0x40 +#define XSA5_XS55 0x20 +#define XSA5_XS54 0x10 +#define XSA5_XS53 0x08 +#define XSA5_XS52 0x04 +#define XSA5_XS51 0x02 +#define XSA5_XS50 0x01 + +#define XSA6_XS67 0x80 +#define XSA6_XS66 0x40 +#define XSA6_XS65 0x20 +#define XSA6_XS64 0x10 +#define XSA6_XS63 0x08 +#define XSA6_XS62 0x04 +#define XSA6_XS61 0x02 +#define XSA6_XS60 0x01 + +#define XSA7_XS77 0x80 +#define XSA7_XS76 0x40 +#define XSA7_XS75 0x20 +#define XSA7_XS74 0x10 +#define XSA7_XS73 0x08 +#define XSA7_XS72 0x04 +#define XSA7_XS71 0x02 +#define XSA7_XS70 0x01 + +#define XSA8_XS87 0x80 +#define XSA8_XS86 0x40 +#define XSA8_XS85 0x20 +#define XSA8_XS84 0x10 +#define XSA8_XS83 0x08 +#define XSA8_XS82 0x04 +#define XSA8_XS81 0x02 +#define XSA8_XS80 0x01 + + +/* XDL1-3 (Transmit DL-Bit Register1-3 (read/write)) + ----------------------- T1 --------------------- */ + +#define XDL1_XDL17 0x80 +#define XDL1_XDL16 0x40 +#define XDL1_XDL15 0x20 +#define XDL1_XDL14 0x10 +#define XDL1_XDL13 0x08 +#define XDL1_XDL12 0x04 +#define XDL1_XDL11 0x02 +#define XDL1_XDL10 0x01 + +#define XDL2_XDL27 0x80 +#define XDL2_XDL26 0x40 +#define XDL2_XDL25 0x20 +#define XDL2_XDL24 0x10 +#define XDL2_XDL23 0x08 +#define XDL2_XDL22 0x04 +#define XDL2_XDL21 0x02 +#define XDL2_XDL20 0x01 + +#define XDL3_XDL37 0x80 +#define XDL3_XDL36 0x40 +#define XDL3_XDL35 0x20 +#define XDL3_XDL34 0x10 +#define XDL3_XDL33 0x08 +#define XDL3_XDL32 0x04 +#define XDL3_XDL31 0x02 +#define XDL3_XDL30 0x01 + + +/* ICB1-4 (Idle Channel Register 1-4) + ------------------ E1 ---------------------------- */ + +#define E1_ICB1_IC0 0x80 +#define E1_ICB1_IC1 0x40 +#define E1_ICB1_IC2 0x20 +#define E1_ICB1_IC3 0x10 +#define E1_ICB1_IC4 0x08 +#define E1_ICB1_IC5 0x04 +#define E1_ICB1_IC6 0x02 +#define E1_ICB1_IC7 0x01 + +#define E1_ICB2_IC8 0x80 +#define E1_ICB2_IC9 0x40 +#define E1_ICB2_IC10 0x20 +#define E1_ICB2_IC11 0x10 +#define E1_ICB2_IC12 0x08 +#define E1_ICB2_IC13 0x04 +#define E1_ICB2_IC14 0x02 +#define E1_ICB2_IC15 0x01 + +#define E1_ICB3_IC16 0x80 +#define E1_ICB3_IC17 0x40 +#define E1_ICB3_IC18 0x20 +#define E1_ICB3_IC19 0x10 +#define E1_ICB3_IC20 0x08 +#define E1_ICB3_IC21 0x04 +#define E1_ICB3_IC22 0x02 +#define E1_ICB3_IC23 0x01 + +#define E1_ICB4_IC24 0x80 +#define E1_ICB4_IC25 0x40 +#define E1_ICB4_IC26 0x20 +#define E1_ICB4_IC27 0x10 +#define E1_ICB4_IC28 0x08 +#define E1_ICB4_IC29 0x04 +#define E1_ICB4_IC30 0x02 +#define E1_ICB4_IC31 0x01 + +/* ICB1-4 (Idle Channel Register 1-4) + ------------------ T1 ---------------------------- */ + +#define T1_ICB1_IC1 0x80 +#define T1_ICB1_IC2 0x40 +#define T1_ICB1_IC3 0x20 +#define T1_ICB1_IC4 0x10 +#define T1_ICB1_IC5 0x08 +#define T1_ICB1_IC6 0x04 +#define T1_ICB1_IC7 0x02 +#define T1_ICB1_IC8 0x01 + +#define T1_ICB2_IC9 0x80 +#define T1_ICB2_IC10 0x40 +#define T1_ICB2_IC11 0x20 +#define T1_ICB2_IC12 0x10 +#define T1_ICB2_IC13 0x08 +#define T1_ICB2_IC14 0x04 +#define T1_ICB2_IC15 0x02 +#define T1_ICB2_IC16 0x01 + +#define T1_ICB3_IC17 0x80 +#define T1_ICB3_IC18 0x40 +#define T1_ICB3_IC19 0x20 +#define T1_ICB3_IC20 0x10 +#define T1_ICB3_IC21 0x08 +#define T1_ICB3_IC22 0x04 +#define T1_ICB3_IC23 0x02 +#define T1_ICB3_IC24 0x01 + +/* FMR3 (Framer Mode Register 3) + --------------------E1------------------------ */ + +#define FMR3_CMI 0x08 +#define FMR3_SYNSA 0x04 +#define FMR3_CFRZ 0x02 +#define FMR3_EXTIW 0x01 + + + +/* CCB1-3 (Clear Channel Register) + ------------------- T1 ----------------------- */ + +#define CCB1_CH1 0x80 +#define CCB1_CH2 0x40 +#define CCB1_CH3 0x20 +#define CCB1_CH4 0x10 +#define CCB1_CH5 0x08 +#define CCB1_CH6 0x04 +#define CCB1_CH7 0x02 +#define CCB1_CH8 0x01 + +#define CCB2_CH9 0x80 +#define CCB2_CH10 0x40 +#define CCB2_CH11 0x20 +#define CCB2_CH12 0x10 +#define CCB2_CH13 0x08 +#define CCB2_CH14 0x04 +#define CCB2_CH15 0x02 +#define CCB2_CH16 0x01 + +#define CCB3_CH17 0x80 +#define CCB3_CH18 0x40 +#define CCB3_CH19 0x20 +#define CCB3_CH20 0x10 +#define CCB3_CH21 0x08 +#define CCB3_CH22 0x04 +#define CCB3_CH23 0x02 +#define CCB3_CH24 0x01 + + +/* LIM0/1 (Line Interface Mode 0/1) + ------------------- E1 & T1 --------------------------- */ + +#define LIM0_XFB 0x80 +#define LIM0_XDOS 0x40 +#define LIM0_SCL1 0x20 +#define LIM0_SCL0 0x10 +#define LIM0_EQON 0x08 +#define LIM0_ELOS 0x04 +#define LIM0_LL 0x02 +#define LIM0_MAS 0x01 + +#define LIM1_EFSC 0x80 +#define LIM1_RIL2 0x40 +#define LIM1_RIL1 0x20 +#define LIM1_RIL0 0x10 +#define LIM1_DCOC 0x08 +#define LIM1_JATT 0x04 +#define LIM1_RL 0x02 +#define LIM1_DRS 0x01 + + +/* PCDR (Pulse Count Detection Register(Read/Write)) + ------------------ E1 & T1 ------------------------- */ + +#define PCDR_PCD7 0x80 +#define PCDR_PCD6 0x40 +#define PCDR_PCD5 0x20 +#define PCDR_PCD4 0x10 +#define PCDR_PCD3 0x08 +#define PCDR_PCD2 0x04 +#define PCDR_PCD1 0x02 +#define PCDR_PCD0 0x01 + +#define PCRR_PCR7 0x80 +#define PCRR_PCR6 0x40 +#define PCRR_PCR5 0x20 +#define PCRR_PCR4 0x10 +#define PCRR_PCR3 0x08 +#define PCRR_PCR2 0x04 +#define PCRR_PCR1 0x02 +#define PCRR_PCR0 0x01 + + +/* LIM2 (Line Interface Mode 2) + + ------------------ E1 & T1 ---------------------------- */ + +#define LIM2_DJA2 0x20 +#define LIM2_DJA1 0x10 +#define LIM2_LOS2 0x02 +#define LIM2_LOS1 0x01 + +/* LCR1 (Loop Code Register 1) */ + +#define LCR1_EPRM 0x80 +#define LCR1_XPRBS 0x40 + +/* SIC1 (System Interface Control 1) */ +#define SIC1_SRSC 0x80 +#define SIC1_RBS1 0x20 +#define SIC1_RBS0 0x10 +#define SIC1_SXSC 0x08 +#define SIC1_XBS1 0x02 +#define SIC1_XBS0 0x01 + +/* DEC (Disable Error Counter) + ------------------ E1 & T1 ---------------------------- */ + +#define DEC_DCEC3 0x20 +#define DEC_DBEC 0x10 +#define DEC_DCEC1 0x08 +#define DEC_DCEC 0x08 +#define DEC_DEBC 0x04 +#define DEC_DCVC 0x02 +#define DEC_DFEC 0x01 + + +/* FALC Register Bits (Receive Mode) + ---------------------------------------------------------------------------- */ + + +/* FRS0/1 (Framer Receive Status Register 0/1) + ----------------- E1 & T1 ---------------------------------- */ + +#define FRS0_LOS 0x80 +#define FRS0_AIS 0x40 +#define FRS0_LFA 0x20 +#define FRS0_RRA 0x10 +#define FRS0_API 0x08 +#define FRS0_NMF 0x04 +#define FRS0_LMFA 0x02 +#define FRS0_FSRF 0x01 + +#define FRS1_TS16RA 0x40 +#define FRS1_TS16LOS 0x20 +#define FRS1_TS16AIS 0x10 +#define FRS1_TS16LFA 0x08 +#define FRS1_EXZD 0x80 +#define FRS1_LLBDD 0x10 +#define FRS1_LLBAD 0x08 +#define FRS1_XLS 0x02 +#define FRS1_XLO 0x01 +#define FRS1_PDEN 0x40 + +/* FRS2/3 (Framer Receive Status Register 2/3) + ----------------- T1 ---------------------------------- */ + +#define FRS2_ESC2 0x80 +#define FRS2_ESC1 0x40 +#define FRS2_ESC0 0x20 + +#define FRS3_FEH5 0x20 +#define FRS3_FEH4 0x10 +#define FRS3_FEH3 0x08 +#define FRS3_FEH2 0x04 +#define FRS3_FEH1 0x02 +#define FRS3_FEH0 0x01 + + +/* RSW (Receive Service Word Pulseframe) + ----------------- E1 ------------------------------ */ + +#define RSW_RSI 0x80 +#define RSW_RRA 0x20 +#define RSW_RYO 0x10 +#define RSW_RY1 0x08 +#define RSW_RY2 0x04 +#define RSW_RY3 0x02 +#define RSW_RY4 0x01 + + +/* RSP (Receive Spare Bits / Additional Status) + ---------------- E1 ------------------------------- */ + +#define RSP_SI1 0x80 +#define RSP_SI2 0x40 +#define RSP_LLBDD 0x10 +#define RSP_LLBAD 0x08 +#define RSP_RSIF 0x04 +#define RSP_RS13 0x02 +#define RSP_RS15 0x01 + + +/* FECL (Framing Error Counter) + ---------------- E1 & T1 -------------------------- */ + +#define FECL_FE7 0x80 +#define FECL_FE6 0x40 +#define FECL_FE5 0x20 +#define FECL_FE4 0x10 +#define FECL_FE3 0x08 +#define FECL_FE2 0x04 +#define FECL_FE1 0x02 +#define FECL_FE0 0x01 + +#define FECH_FE15 0x80 +#define FECH_FE14 0x40 +#define FECH_FE13 0x20 +#define FECH_FE12 0x10 +#define FECH_FE11 0x08 +#define FECH_FE10 0x04 +#define FECH_FE9 0x02 +#define FECH_FE8 0x01 + + +/* CVCl (Code Violation Counter) + ----------------- E1 ------------------------- */ + +#define CVCL_CV7 0x80 +#define CVCL_CV6 0x40 +#define CVCL_CV5 0x20 +#define CVCL_CV4 0x10 +#define CVCL_CV3 0x08 +#define CVCL_CV2 0x04 +#define CVCL_CV1 0x02 +#define CVCL_CV0 0x01 + +#define CVCH_CV15 0x80 +#define CVCH_CV14 0x40 +#define CVCH_CV13 0x20 +#define CVCH_CV12 0x10 +#define CVCH_CV11 0x08 +#define CVCH_CV10 0x04 +#define CVCH_CV9 0x02 +#define CVCH_CV8 0x01 + + +/* CEC1-3L (CRC Error Counter) + ------------------ E1 ----------------------------- */ + +#define CEC1L_CR7 0x80 +#define CEC1L_CR6 0x40 +#define CEC1L_CR5 0x20 +#define CEC1L_CR4 0x10 +#define CEC1L_CR3 0x08 +#define CEC1L_CR2 0x04 +#define CEC1L_CR1 0x02 +#define CEC1L_CR0 0x01 + +#define CEC1H_CR15 0x80 +#define CEC1H_CR14 0x40 +#define CEC1H_CR13 0x20 +#define CEC1H_CR12 0x10 +#define CEC1H_CR11 0x08 +#define CEC1H_CR10 0x04 +#define CEC1H_CR9 0x02 +#define CEC1H_CR8 0x01 + +#define CEC2L_CR7 0x80 +#define CEC2L_CR6 0x40 +#define CEC2L_CR5 0x20 +#define CEC2L_CR4 0x10 +#define CEC2L_CR3 0x08 +#define CEC2L_CR2 0x04 +#define CEC2L_CR1 0x02 +#define CEC2L_CR0 0x01 + +#define CEC2H_CR15 0x80 +#define CEC2H_CR14 0x40 +#define CEC2H_CR13 0x20 +#define CEC2H_CR12 0x10 +#define CEC2H_CR11 0x08 +#define CEC2H_CR10 0x04 +#define CEC2H_CR9 0x02 +#define CEC2H_CR8 0x01 + +#define CEC3L_CR7 0x80 +#define CEC3L_CR6 0x40 +#define CEC3L_CR5 0x20 +#define CEC3L_CR4 0x10 +#define CEC3L_CR3 0x08 +#define CEC3L_CR2 0x04 +#define CEC3L_CR1 0x02 +#define CEC3L_CR0 0x01 + +#define CEC3H_CR15 0x80 +#define CEC3H_CR14 0x40 +#define CEC3H_CR13 0x20 +#define CEC3H_CR12 0x10 +#define CEC3H_CR11 0x08 +#define CEC3H_CR10 0x04 +#define CEC3H_CR9 0x02 +#define CEC3H_CR8 0x01 + + +/* CECL (CRC Error Counter) + + ------------------ T1 ----------------------------- */ + +#define CECL_CR7 0x80 +#define CECL_CR6 0x40 +#define CECL_CR5 0x20 +#define CECL_CR4 0x10 +#define CECL_CR3 0x08 +#define CECL_CR2 0x04 +#define CECL_CR1 0x02 +#define CECL_CR0 0x01 + +#define CECH_CR15 0x80 +#define CECH_CR14 0x40 +#define CECH_CR13 0x20 +#define CECH_CR12 0x10 +#define CECH_CR11 0x08 +#define CECH_CR10 0x04 +#define CECH_CR9 0x02 +#define CECH_CR8 0x01 + +/* EBCL (E Bit Error Counter) + ------------------- E1 & T1 ------------------------- */ + +#define EBCL_EB7 0x80 +#define EBCL_EB6 0x40 +#define EBCL_EB5 0x20 +#define EBCL_EB4 0x10 +#define EBCL_EB3 0x08 +#define EBCL_EB2 0x04 +#define EBCL_EB1 0x02 +#define EBCL_EB0 0x01 + +#define EBCH_EB15 0x80 +#define EBCH_EB14 0x40 +#define EBCH_EB13 0x20 +#define EBCH_EB12 0x10 +#define EBCH_EB11 0x08 +#define EBCH_EB10 0x04 +#define EBCH_EB9 0x02 +#define EBCH_EB8 0x01 + + +/* RSA4-8 (Receive Sa4-8-Bit Register) + -------------------- E1 --------------------------- */ + +#define RSA4_RS47 0x80 +#define RSA4_RS46 0x40 +#define RSA4_RS45 0x20 +#define RSA4_RS44 0x10 +#define RSA4_RS43 0x08 +#define RSA4_RS42 0x04 +#define RSA4_RS41 0x02 +#define RSA4_RS40 0x01 + +#define RSA5_RS57 0x80 +#define RSA5_RS56 0x40 +#define RSA5_RS55 0x20 +#define RSA5_RS54 0x10 +#define RSA5_RS53 0x08 +#define RSA5_RS52 0x04 +#define RSA5_RS51 0x02 +#define RSA5_RS50 0x01 + +#define RSA6_RS67 0x80 +#define RSA6_RS66 0x40 +#define RSA6_RS65 0x20 +#define RSA6_RS64 0x10 +#define RSA6_RS63 0x08 +#define RSA6_RS62 0x04 +#define RSA6_RS61 0x02 +#define RSA6_RS60 0x01 + +#define RSA7_RS77 0x80 +#define RSA7_RS76 0x40 +#define RSA7_RS75 0x20 +#define RSA7_RS74 0x10 +#define RSA7_RS73 0x08 +#define RSA7_RS72 0x04 +#define RSA7_RS71 0x02 +#define RSA7_RS70 0x01 + +#define RSA8_RS87 0x80 +#define RSA8_RS86 0x40 +#define RSA8_RS85 0x20 +#define RSA8_RS84 0x10 +#define RSA8_RS83 0x08 +#define RSA8_RS82 0x04 +#define RSA8_RS81 0x02 +#define RSA8_RS80 0x01 + +/* RSA6S (Receive Sa6 Bit Status Register) + ------------------------ T1 ------------------------- */ + +#define RSA6S_SX 0x20 +#define RSA6S_SF 0x10 +#define RSA6S_SE 0x08 +#define RSA6S_SC 0x04 +#define RSA6S_SA 0x02 +#define RSA6S_S8 0x01 + + +/* RDL1-3 Receive DL-Bit Register1-3) + ------------------------ T1 ------------------------- */ + +#define RDL1_RDL17 0x80 +#define RDL1_RDL16 0x40 +#define RDL1_RDL15 0x20 +#define RDL1_RDL14 0x10 +#define RDL1_RDL13 0x08 +#define RDL1_RDL12 0x04 +#define RDL1_RDL11 0x02 +#define RDL1_RDL10 0x01 + +#define RDL2_RDL27 0x80 +#define RDL2_RDL26 0x40 +#define RDL2_RDL25 0x20 +#define RDL2_RDL24 0x10 +#define RDL2_RDL23 0x08 +#define RDL2_RDL22 0x04 +#define RDL2_RDL21 0x02 +#define RDL2_RDL20 0x01 + +#define RDL3_RDL37 0x80 +#define RDL3_RDL36 0x40 +#define RDL3_RDL35 0x20 +#define RDL3_RDL34 0x10 +#define RDL3_RDL33 0x08 +#define RDL3_RDL32 0x04 +#define RDL3_RDL31 0x02 +#define RDL3_RDL30 0x01 + + +/* SIS (Signaling Status Register) + + -------------------- E1 & T1 -------------------------- */ + +#define SIS_XDOV 0x80 +#define SIS_XFW 0x40 +#define SIS_XREP 0x20 +#define SIS_RLI 0x08 +#define SIS_CEC 0x04 +#define SIS_BOM 0x01 + + +/* RSIS (Receive Signaling Status Register) + + -------------------- E1 & T1 --------------------------- */ + +#define RSIS_VFR 0x80 +#define RSIS_RDO 0x40 +#define RSIS_CRC16 0x20 +#define RSIS_RAB 0x10 +#define RSIS_HA1 0x08 +#define RSIS_HA0 0x04 +#define RSIS_HFR 0x02 +#define RSIS_LA 0x01 + + +/* RBCL/H (Receive Byte Count Low/High) + + ------------------- E1 & T1 ----------------------- */ + +#define RBCL_RBC7 0x80 +#define RBCL_RBC6 0x40 +#define RBCL_RBC5 0x20 +#define RBCL_RBC4 0x10 +#define RBCL_RBC3 0x08 +#define RBCL_RBC2 0x04 +#define RBCL_RBC1 0x02 +#define RBCL_RBC0 0x01 + +#define RBCH_OV 0x10 +#define RBCH_RBC11 0x08 +#define RBCH_RBC10 0x04 +#define RBCH_RBC9 0x02 +#define RBCH_RBC8 0x01 + + +/* ISR1-3 (Interrupt Status Register 1-3) + + ------------------ E1 & T1 ------------------------------ */ + +#define FISR0_RME 0x80 +#define FISR0_RFS 0x40 +#define FISR0_T8MS 0x20 +#define FISR0_ISF 0x20 +#define FISR0_RMB 0x10 +#define FISR0_CASC 0x08 +#define FISR0_RSC 0x08 +#define FISR0_CRC6 0x04 +#define FISR0_CRC4 0x04 +#define FISR0_PDEN 0x02 +#define FISR0_RPF 0x01 + +#define FISR1_CASE 0x80 +#define FISR1_LLBSC 0x80 +#define FISR1_RDO 0x40 +#define FISR1_ALLS 0x20 +#define FISR1_XDU 0x10 +#define FISR1_XMB 0x08 +#define FISR1_XLSC 0x02 +#define FISR1_XPR 0x01 + +#define FISR2_FAR 0x80 +#define FISR2_LFA 0x40 +#define FISR2_MFAR 0x20 +#define FISR2_T400MS 0x10 +#define FISR2_LMFA 0x10 +#define FISR2_AIS 0x08 +#define FISR2_LOS 0x04 +#define FISR2_RAR 0x02 +#define FISR2_RA 0x01 + +#define FISR3_ES 0x80 +#define FISR3_SEC 0x40 +#define FISR3_LMFA16 0x20 +#define FISR3_AIS16 0x10 +#define FISR3_RA16 0x08 +#define FISR3_API 0x04 +#define FISR3_XSLP 0x20 +#define FISR3_XSLN 0x10 +#define FISR3_LLBSC 0x08 +#define FISR3_XRS 0x04 +#define FISR3_SLN 0x02 +#define FISR3_SLP 0x01 + + +/* GIS (Global Interrupt Status Register) + + --------------------- E1 & T1 --------------------- */ + +#define GIS_ISR3 0x08 +#define GIS_ISR2 0x04 +#define GIS_ISR1 0x02 +#define GIS_ISR0 0x01 + + +/* VSTR (Version Status Register) + + --------------------- E1 & T1 --------------------- */ + +#define VSTR_VN3 0x08 +#define VSTR_VN2 0x04 +#define VSTR_VN1 0x02 +#define VSTR_VN0 0x01 + + +/*>>>>>>>>>>>>>>>>>>>>> Local Control Structures <<<<<<<<<<<<<<<<<<<<<<<<< */ + +/* Write-only Registers (E1/T1 control mode write registers) */ +#define XFIFOH 0x00 /* Tx FIFO High Byte */ +#define XFIFOL 0x01 /* Tx FIFO Low Byte */ +#define CMDR 0x02 /* Command Reg */ +#define DEC 0x60 /* Disable Error Counter */ +#define TEST2 0x62 /* Manuf. Test Reg 2 */ +#define XS(nbr) (0x70 + (nbr)) /* Tx CAS Reg (0 to 15) */ + +/* Read-write Registers (E1/T1 status mode read registers) */ +#define MODE 0x03 /* Mode Reg */ +#define RAH1 0x04 /* Receive Address High 1 */ +#define RAH2 0x05 /* Receive Address High 2 */ +#define RAL1 0x06 /* Receive Address Low 1 */ +#define RAL2 0x07 /* Receive Address Low 2 */ +#define IPC 0x08 /* Interrupt Port Configuration */ +#define CCR1 0x09 /* Common Configuration Reg 1 */ +#define CCR3 0x0A /* Common Configuration Reg 3 */ +#define PRE 0x0B /* Preamble Reg */ +#define RTR1 0x0C /* Receive Timeslot Reg 1 */ +#define RTR2 0x0D /* Receive Timeslot Reg 2 */ +#define RTR3 0x0E /* Receive Timeslot Reg 3 */ +#define RTR4 0x0F /* Receive Timeslot Reg 4 */ +#define TTR1 0x10 /* Transmit Timeslot Reg 1 */ +#define TTR2 0x11 /* Transmit Timeslot Reg 2 */ +#define TTR3 0x12 /* Transmit Timeslot Reg 3 */ +#define TTR4 0x13 /* Transmit Timeslot Reg 4 */ +#define IMR0 0x14 /* Interrupt Mask Reg 0 */ +#define IMR1 0x15 /* Interrupt Mask Reg 1 */ +#define IMR2 0x16 /* Interrupt Mask Reg 2 */ +#define IMR3 0x17 /* Interrupt Mask Reg 3 */ +#define IMR4 0x18 /* Interrupt Mask Reg 4 */ +#define IMR5 0x19 /* Interrupt Mask Reg 5 */ +#define FMR0 0x1A /* Framer Mode Reigster 0 */ +#define FMR1 0x1B /* Framer Mode Reigster 1 */ +#define FMR2 0x1C /* Framer Mode Reigster 2 */ +#define LOOP 0x1D /* Channel Loop Back */ +#define XSW 0x1E /* Transmit Service Word */ +#define FMR4 0x1E /* Framer Mode Reg 4 */ +#define XSP 0x1F /* Transmit Spare Bits */ +#define FMR5 0x1F /* Framer Mode Reg 5 */ +#define XC0 0x20 /* Transmit Control 0 */ +#define XC1 0x21 /* Transmit Control 1 */ +#define RC0 0x22 /* Receive Control 0 */ +#define RC1 0x23 /* Receive Control 1 */ +#define XPM0 0x24 /* Transmit Pulse Mask 0 */ +#define XPM1 0x25 /* Transmit Pulse Mask 1 */ +#define XPM2 0x26 /* Transmit Pulse Mask 2 */ +#define TSWM 0x27 /* Transparent Service Word Mask */ +#define TEST1 0x28 /* Manuf. Test Reg 1 */ +#define IDLE 0x29 /* Idle Channel Code */ +#define XSA4 0x2A /* Transmit SA4 Bit Reg */ +#define XDL1 0x2A /* Transmit DL-Bit Reg 2 */ +#define XSA5 0x2B /* Transmit SA4 Bit Reg */ +#define XDL2 0x2B /* Transmit DL-Bit Reg 2 */ +#define XSA6 0x2C /* Transmit SA4 Bit Reg */ +#define XDL3 0x2C /* Transmit DL-Bit Reg 2 */ +#define XSA7 0x2D /* Transmit SA4 Bit Reg */ +#define CCB1 0x2D /* Clear Channel Reg 1 */ +#define XSA8 0x2E /* Transmit SA4 Bit Reg */ +#define CCB2 0x2E /* Clear Channel Reg 2 */ +#define FMR3 0x2F /* Framer Mode Reg. 3 */ +#define CCB3 0x2F /* Clear Channel Reg 3 */ +#define ICB1 0x30 /* Idle Channel Reg 1 */ +#define ICB2 0x31 /* Idle Channel Reg 2 */ +#define ICB3 0x32 /* Idle Channel Reg 3 */ +#define ICB4 0x33 /* Idle Channel Reg 4 */ +#define LIM0 0x34 /* Line Interface Mode 0 */ +#define LIM1 0x35 /* Line Interface Mode 1 */ +#define PCDR 0x36 /* Pulse Count Detection */ +#define PCRR 0x37 /* Pulse Count Recovery */ +#define LIM2 0x38 /* Line Interface Mode Reg 2 */ +#define LCR1 0x39 /* Loop Code Reg 1 */ +#define LCR2 0x3A /* Loop Code Reg 2 */ +#define LCR3 0x3B /* Loop Code Reg 3 */ +#define SIC1 0x3C /* System Interface Control 1 */ + +/* Read-only Registers (E1/T1 control mode read registers) */ +#define RFIFOH 0x00 /* Receive FIFO */ +#define RFIFOL 0x01 /* Receive FIFO */ +#define FRS0 0x4C /* Framer Receive Status 0 */ +#define FRS1 0x4D /* Framer Receive Status 1 */ +#define RSW 0x4E /* Receive Service Word */ +#define FRS2 0x4E /* Framer Receive Status 2 */ +#define RSP 0x4F /* Receive Spare Bits */ +#define FRS3 0x4F /* Framer Receive Status 3 */ +#define FECL 0x50 /* Framing Error Counter */ +#define FECH 0x51 /* Framing Error Counter */ +#define CVCL 0x52 /* Code Violation Counter */ +#define CVCH 0x53 /* Code Violation Counter */ +#define CECL 0x54 /* CRC Error Counter 1 */ +#define CECH 0x55 /* CRC Error Counter 1 */ +#define EBCL 0x56 /* E-Bit Error Counter */ +#define EBCH 0x57 /* E-Bit Error Counter */ +#define BECL 0x58 /* Bit Error Counter Low */ +#define BECH 0x59 /* Bit Error Counter Low */ +#define CEC3 0x5A /* CRC Error Counter 3 (16-bit) */ +#define RSA4 0x5C /* Receive SA4 Bit Reg */ +#define RDL1 0x5C /* Receive DL-Bit Reg 1 */ +#define RSA5 0x5D /* Receive SA5 Bit Reg */ +#define RDL2 0x5D /* Receive DL-Bit Reg 2 */ +#define RSA6 0x5E /* Receive SA6 Bit Reg */ +#define RDL3 0x5E /* Receive DL-Bit Reg 3 */ +#define RSA7 0x5F /* Receive SA7 Bit Reg */ +#define RSA8 0x60 /* Receive SA8 Bit Reg */ +#define RSA6S 0x61 /* Receive SA6 Bit Status Reg */ +#define TSR0 0x62 /* Manuf. Test Reg 0 */ +#define TSR1 0x63 /* Manuf. Test Reg 1 */ +#define SIS 0x64 /* Signaling Status Reg */ +#define RSIS 0x65 /* Receive Signaling Status Reg */ +#define RBCL 0x66 /* Receive Byte Control */ +#define RBCH 0x67 /* Receive Byte Control */ +#define FISR0 0x68 /* Interrupt Status Reg 0 */ +#define FISR1 0x69 /* Interrupt Status Reg 1 */ +#define FISR2 0x6A /* Interrupt Status Reg 2 */ +#define FISR3 0x6B /* Interrupt Status Reg 3 */ +#define GIS 0x6E /* Global Interrupt Status */ +#define VSTR 0x6F /* Version Status */ +#define RS(nbr) (0x70 + (nbr)) /* Rx CAS Reg (0 to 15) */ + +#endif /* _FALC_LH_H */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/hamradio/bpqether.c linux.20p9/drivers/net/hamradio/bpqether.c --- linux.vanilla/drivers/net/hamradio/bpqether.c Sun Mar 25 17:31:18 2001 +++ linux.20p9/drivers/net/hamradio/bpqether.c Thu Jul 26 15:16:51 2001 @@ -169,7 +169,7 @@ */ static int bpq_check_devices(struct device *dev) { - struct bpqdev *bpq, *bpq_prev; + struct bpqdev *bpq, *bpq_prev, *bpq_next; int result = 0; unsigned long flags; @@ -178,7 +178,8 @@ bpq_prev = NULL; - for (bpq = bpq_devices; bpq != NULL; bpq = bpq->next) { + for (bpq = bpq_devices; bpq != NULL; bpq = bpq_next) { + bpq_next = bpq->next; if (!dev_get(bpq->ethname)) { if (bpq_prev) bpq_prev->next = bpq->next; @@ -195,8 +196,8 @@ unregister_netdevice(&bpq->axdev); kfree(bpq); } - - bpq_prev = bpq; + else + bpq_prev = bpq; } restore_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/hamradio/scc.c linux.20p9/drivers/net/hamradio/scc.c --- linux.vanilla/drivers/net/hamradio/scc.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/hamradio/scc.c Thu Jul 26 15:16:58 2001 @@ -222,7 +222,7 @@ static unsigned char *SCC_DriverName = "scc"; -static struct irqflags { unsigned char used : 1; } Ivec[16]; +static struct irqflags { unsigned char used : 1; } Ivec[NR_IRQS]; static struct scc_channel SCC_Info[2 * SCC_MAXCHIPS]; /* information per channel */ @@ -1547,7 +1547,7 @@ printk(KERN_INFO "Init Z8530 driver: %u channels, IRQ", Nchips*2); flag=" "; - for (k = 0; k < 16; k++) + for (k = 0; k < NR_IRQS; k++) if (Ivec[k].used) { printk("%s%d", flag, k); @@ -1873,6 +1873,9 @@ if (hwcfg.irq == 2) hwcfg.irq = 9; + if (hwcfg.irq <0 || hwcfg.irq > NR_IRQS) + return -EINVAL; + if (!Ivec[hwcfg.irq].used && hwcfg.irq) { if (request_irq(hwcfg.irq, scc_isr, SA_INTERRUPT, "AX.25 SCC", NULL)) @@ -2323,7 +2326,7 @@ } } - for (k=0; k < 16 ; k++) + for (k=0; k < NR_IRQS ; k++) if (Ivec[k].used) free_irq(k, NULL); restore_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/hamradio/soundmodem/sm_wss.c linux.20p9/drivers/net/hamradio/soundmodem/sm_wss.c --- linux.vanilla/drivers/net/hamradio/soundmodem/sm_wss.c Sun Mar 25 17:31:18 2001 +++ linux.20p9/drivers/net/hamradio/soundmodem/sm_wss.c Thu Jul 26 15:17:29 2001 @@ -172,8 +172,10 @@ /* MCE and interface config reg */ write_codec(dev, 0x49, fdx ? 0x8 : 0xc); outb(0xb, WSS_CODEC_IA(dev->base_addr)); /* leave MCE */ - if (SCSTATE->crystal && !fullcalib) + if (SCSTATE->crystal && !fullcalib) { + restore_flags(flags); return 0; + } /* * wait for ACI start */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/hd64572.h linux.20p9/drivers/net/hd64572.h --- linux.vanilla/drivers/net/hd64572.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/hd64572.h Wed Jul 4 16:03:55 2001 @@ -0,0 +1,437 @@ +/* + * hd64572.h Description of the Hitachi HD64572 (SCA-II), valid for + * CPU modes 0 & 2. + * + * Author: Ivan Passos + * + * Copyright: (c) 2000-2001 Cyclades 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. + * + * $Log: hd64572.h,v $ + * Revision 1.0 2000/01/25 ivan + * Initial version. + * + */ + +#ifndef _HD64572_H +#define _HD64572_H + +/* Illegal Access Register */ +#define ILAR 0x00 + +/* Wait Controller Registers */ +#define PABR0L 0x20 /* Physical Addr Boundary Register 0 L */ +#define PABR0H 0x21 /* Physical Addr Boundary Register 0 H */ +#define PABR1L 0x22 /* Physical Addr Boundary Register 1 L */ +#define PABR1H 0x23 /* Physical Addr Boundary Register 1 H */ +#define WCRL 0x24 /* Wait Control Register L */ +#define WCRM 0x25 /* Wait Control Register M */ +#define WCRH 0x26 /* Wait Control Register H */ + +/* Interrupt Registers */ +#define IVR 0x60 /* Interrupt Vector Register */ +#define IMVR 0x64 /* Interrupt Modified Vector Register */ +#define ITCR 0x68 /* Interrupt Control Register */ +#define ISR0 0x6c /* Interrupt Status Register 0 */ +#define ISR1 0x70 /* Interrupt Status Register 1 */ +#define IER0 0x74 /* Interrupt Enable Register 0 */ +#define IER1 0x78 /* Interrupt Enable Register 1 */ + +/* Register Access Macros (chan is 0 or 1 in _any_ case) */ +#define M_REG(reg, chan) (reg + 0x80*chan) /* MSCI */ +#define DRX_REG(reg, chan) (reg + 0x40*chan) /* DMA Rx */ +#define DTX_REG(reg, chan) (reg + 0x20*(2*chan + 1)) /* DMA Tx */ +#define TRX_REG(reg, chan) (reg + 0x20*chan) /* Timer Rx */ +#define TTX_REG(reg, chan) (reg + 0x10*(2*chan + 1)) /* Timer Tx */ +#define ST_REG(reg, chan) (reg + 0x80*chan) /* Status Cnt */ +#define IR0_DRX(val, chan) ((val)<<(8*(chan))) /* Int DMA Rx */ +#define IR0_DTX(val, chan) ((val)<<(4*(2*chan + 1))) /* Int DMA Tx */ +#define IR0_M(val, chan) ((val)<<(8*(chan))) /* Int MSCI */ + +/* MSCI Channel Registers */ +#define MD0 0x138 /* Mode reg 0 */ +#define MD1 0x139 /* Mode reg 1 */ +#define MD2 0x13a /* Mode reg 2 */ +#define MD3 0x13b /* Mode reg 3 */ +#define CTL 0x130 /* Control reg */ +#define RXS 0x13c /* RX clock source */ +#define TXS 0x13d /* TX clock source */ +#define EXS 0x13e /* External clock input selection */ +#define TMCT 0x144 /* Time constant (Tx) */ +#define TMCR 0x145 /* Time constant (Rx) */ +#define CMD 0x128 /* Command reg */ +#define ST0 0x118 /* Status reg 0 */ +#define ST1 0x119 /* Status reg 1 */ +#define ST2 0x11a /* Status reg 2 */ +#define ST3 0x11b /* Status reg 3 */ +#define ST4 0x11c /* Status reg 4 */ +#define FST 0x11d /* frame Status reg */ +#define IE0 0x120 /* Interrupt enable reg 0 */ +#define IE1 0x121 /* Interrupt enable reg 1 */ +#define IE2 0x122 /* Interrupt enable reg 2 */ +#define IE4 0x124 /* Interrupt enable reg 4 */ +#define FIE 0x125 /* Frame Interrupt enable reg */ +#define SA0 0x140 /* Syn Address reg 0 */ +#define SA1 0x141 /* Syn Address reg 1 */ +#define IDL 0x142 /* Idle register */ +#define TRBL 0x100 /* TX/RX buffer reg L */ +#define TRBK 0x101 /* TX/RX buffer reg K */ +#define TRBJ 0x102 /* TX/RX buffer reg J */ +#define TRBH 0x103 /* TX/RX buffer reg H */ +#define TRC0 0x148 /* TX Ready control reg 0 */ +#define TRC1 0x149 /* TX Ready control reg 1 */ +#define RRC 0x14a /* RX Ready control reg */ +#define CST0 0x108 /* Current Status Register 0 */ +#define CST1 0x109 /* Current Status Register 1 */ +#define CST2 0x10a /* Current Status Register 2 */ +#define CST3 0x10b /* Current Status Register 3 */ +#define GPO 0x131 /* General Purpose Output Pin Ctl Reg */ +#define TFS 0x14b /* Tx Start Threshold Ctl Reg */ +#define TFN 0x143 /* Inter-transmit-frame Time Fill Ctl Reg */ +#define TBN 0x110 /* Tx Buffer Number Reg */ +#define RBN 0x111 /* Rx Buffer Number Reg */ +#define TNR0 0x150 /* Tx DMA Request Ctl Reg 0 */ +#define TNR1 0x151 /* Tx DMA Request Ctl Reg 1 */ +#define TCR 0x152 /* Tx DMA Critical Request Reg */ +#define RNR 0x154 /* Rx DMA Request Ctl Reg */ +#define RCR 0x156 /* Rx DMA Critical Request Reg */ + +/* Timer Registers */ +#define TCNTL 0x200 /* Timer Upcounter L */ +#define TCNTH 0x201 /* Timer Upcounter H */ +#define TCONRL 0x204 /* Timer Constant Register L */ +#define TCONRH 0x205 /* Timer Constant Register H */ +#define TCSR 0x206 /* Timer Control/Status Register */ +#define TEPR 0x207 /* Timer Expand Prescale Register */ + +/* DMA registers */ +#define PCR 0x40 /* DMA priority control reg */ +#define DRR 0x44 /* DMA reset reg */ +#define DMER 0x07 /* DMA Master Enable reg */ +#define BTCR 0x08 /* Burst Tx Ctl Reg */ +#define BOLR 0x0c /* Back-off Length Reg */ +#define DSR_RX(chan) (0x48 + 2*chan) /* DMA Status Reg (Rx) */ +#define DSR_TX(chan) (0x49 + 2*chan) /* DMA Status Reg (Tx) */ +#define DIR_RX(chan) (0x4c + 2*chan) /* DMA Interrupt Enable Reg (Rx) */ +#define DIR_TX(chan) (0x4d + 2*chan) /* DMA Interrupt Enable Reg (Tx) */ +#define FCT_RX(chan) (0x50 + 2*chan) /* Frame End Interrupt Counter (Rx) */ +#define FCT_TX(chan) (0x51 + 2*chan) /* Frame End Interrupt Counter (Tx) */ +#define DMR_RX(chan) (0x54 + 2*chan) /* DMA Mode Reg (Rx) */ +#define DMR_TX(chan) (0x55 + 2*chan) /* DMA Mode Reg (Tx) */ +#define DCR_RX(chan) (0x58 + 2*chan) /* DMA Command Reg (Rx) */ +#define DCR_TX(chan) (0x59 + 2*chan) /* DMA Command Reg (Tx) */ + +/* DMA Channel Registers */ +#define DARL 0x80 /* Dest Addr Register L (single-block, RX only) */ +#define DARH 0x81 /* Dest Addr Register H (single-block, RX only) */ +#define DARB 0x82 /* Dest Addr Register B (single-block, RX only) */ +#define DARBH 0x83 /* Dest Addr Register BH (single-block, RX only) */ +#define SARL 0x80 /* Source Addr Register L (single-block, TX only) */ +#define SARH 0x81 /* Source Addr Register H (single-block, TX only) */ +#define SARB 0x82 /* Source Addr Register B (single-block, TX only) */ +#define DARBH 0x83 /* Source Addr Register BH (single-block, TX only) */ +#define BARL 0x80 /* Buffer Addr Register L (chained-block) */ +#define BARH 0x81 /* Buffer Addr Register H (chained-block) */ +#define BARB 0x82 /* Buffer Addr Register B (chained-block) */ +#define BARBH 0x83 /* Buffer Addr Register BH (chained-block) */ +#define CDAL 0x84 /* Current Descriptor Addr Register L */ +#define CDAH 0x85 /* Current Descriptor Addr Register H */ +#define CDAB 0x86 /* Current Descriptor Addr Register B */ +#define CDABH 0x87 /* Current Descriptor Addr Register BH */ +#define EDAL 0x88 /* Error Descriptor Addr Register L */ +#define EDAH 0x89 /* Error Descriptor Addr Register H */ +#define EDAB 0x8a /* Error Descriptor Addr Register B */ +#define EDABH 0x8b /* Error Descriptor Addr Register BH */ +#define BFLL 0x90 /* RX Buffer Length L (only RX) */ +#define BFLH 0x91 /* RX Buffer Length H (only RX) */ +#define BCRL 0x8c /* Byte Count Register L */ +#define BCRH 0x8d /* Byte Count Register H */ + +/* Block Descriptor Structure */ +typedef struct { + unsigned long next; /* pointer to next block descriptor */ + unsigned long ptbuf; /* buffer pointer */ + unsigned short len; /* data length */ + unsigned char status; /* status */ + unsigned char filler[5]; /* alignment filler (16 bytes) */ +} pcsca_bd_t; + +/* + Descriptor Status definitions: + + Bit Transmission Reception + + 7 EOM EOM + 6 - Short Frame + 5 - Abort + 4 - Residual bit + 3 Underrun Overrun + 2 - CRC + 1 Ownership Ownership + 0 EOT - +*/ +#define DST_EOT 0x01 /* End of transmit command */ +#define DST_OSB 0x02 /* Ownership bit */ +#define DST_CRC 0x04 /* CRC Error */ +#define DST_OVR 0x08 /* Overrun */ +#define DST_UDR 0x08 /* Underrun */ +#define DST_RBIT 0x10 /* Residual bit */ +#define DST_ABT 0x20 /* Abort */ +#define DST_SHRT 0x40 /* Short Frame */ +#define DST_EOM 0x80 /* End of Message */ + +/* Status Counter Registers */ +#define CMCR 0x158 /* Counter Master Ctl Reg */ +#define TECNTL 0x160 /* Tx EOM Counter L */ +#define TECNTM 0x161 /* Tx EOM Counter M */ +#define TECNTH 0x162 /* Tx EOM Counter H */ +#define TECCR 0x163 /* Tx EOM Counter Ctl Reg */ +#define URCNTL 0x164 /* Underrun Counter L */ +#define URCNTH 0x165 /* Underrun Counter H */ +#define URCCR 0x167 /* Underrun Counter Ctl Reg */ +#define RECNTL 0x168 /* Rx EOM Counter L */ +#define RECNTM 0x169 /* Rx EOM Counter M */ +#define RECNTH 0x16a /* Rx EOM Counter H */ +#define RECCR 0x16b /* Rx EOM Counter Ctl Reg */ +#define ORCNTL 0x16c /* Overrun Counter L */ +#define ORCNTH 0x16d /* Overrun Counter H */ +#define ORCCR 0x16f /* Overrun Counter Ctl Reg */ +#define CECNTL 0x170 /* CRC Counter L */ +#define CECNTH 0x171 /* CRC Counter H */ +#define CECCR 0x173 /* CRC Counter Ctl Reg */ +#define ABCNTL 0x174 /* Abort frame Counter L */ +#define ABCNTH 0x175 /* Abort frame Counter H */ +#define ABCCR 0x177 /* Abort frame Counter Ctl Reg */ +#define SHCNTL 0x178 /* Short frame Counter L */ +#define SHCNTH 0x179 /* Short frame Counter H */ +#define SHCCR 0x17b /* Short frame Counter Ctl Reg */ +#define RSCNTL 0x17c /* Residual bit Counter L */ +#define RSCNTH 0x17d /* Residual bit Counter H */ +#define RSCCR 0x17f /* Residual bit Counter Ctl Reg */ + +/* Register Programming Constants */ + +#define IR0_DMIC 0x00000001 +#define IR0_DMIB 0x00000002 +#define IR0_DMIA 0x00000004 +#define IR0_EFT 0x00000008 +#define IR0_DMAREQ 0x00010000 +#define IR0_TXINT 0x00020000 +#define IR0_RXINTB 0x00040000 +#define IR0_RXINTA 0x00080000 +#define IR0_TXRDY 0x00100000 +#define IR0_RXRDY 0x00200000 + +#define MD0_CRC16_0 0x00 +#define MD0_CRC16_1 0x01 +#define MD0_CRC32 0x02 +#define MD0_CRC_CCITT 0x03 +#define MD0_CRCC0 0x04 +#define MD0_CRCC1 0x08 +#define MD0_AUTO_ENA 0x10 +#define MD0_ASYNC 0x00 +#define MD0_BY_MSYNC 0x20 +#define MD0_BY_BISYNC 0x40 +#define MD0_BY_EXT 0x60 +#define MD0_BIT_SYNC 0x80 +#define MD0_TRANSP 0xc0 + +#define MD1_NOADDR 0x00 +#define MD1_SADDR1 0x40 +#define MD1_SADDR2 0x80 +#define MD1_DADDR 0xc0 + +#define MD2_F_DUPLEX 0x00 +#define MD2_AUTO_ECHO 0x01 +#define MD2_LOOP_HI_Z 0x02 +#define MD2_LOOP_MIR 0x03 +#define MD2_ADPLL_X8 0x00 +#define MD2_ADPLL_X16 0x08 +#define MD2_ADPLL_X32 0x10 +#define MD2_NRZ 0x00 +#define MD2_NRZI 0x20 +#define MD2_NRZ_IEEE 0x40 +#define MD2_MANCH 0x00 +#define MD2_FM1 0x20 +#define MD2_FM0 0x40 +#define MD2_FM 0x80 + +#define CTL_RTS 0x01 +#define CTL_DTR 0x02 +#define CTL_SYN 0x04 +#define CTL_IDLC 0x10 +#define CTL_UDRNC 0x20 +#define CTL_URSKP 0x40 +#define CTL_URCT 0x80 + +#define RXS_BR0 0x01 +#define RXS_BR1 0x02 +#define RXS_BR2 0x04 +#define RXS_BR3 0x08 +#define RXS_ECLK 0x00 +#define RXS_ECLK_NS 0x20 +#define RXS_IBRG 0x40 +#define RXS_PLL1 0x50 +#define RXS_PLL2 0x60 +#define RXS_PLL3 0x70 +#define RXS_DRTXC 0x80 + +#define TXS_BR0 0x01 +#define TXS_BR1 0x02 +#define TXS_BR2 0x04 +#define TXS_BR3 0x08 +#define TXS_ECLK 0x00 +#define TXS_IBRG 0x40 +#define TXS_RCLK 0x60 +#define TXS_DTRXC 0x80 + +#define EXS_RES0 0x01 +#define EXS_RES1 0x02 +#define EXS_RES2 0x04 +#define EXS_TES0 0x10 +#define EXS_TES1 0x20 +#define EXS_TES2 0x40 + +#define CMD_RX_RST 0x11 +#define CMD_RX_ENA 0x12 +#define CMD_RX_DIS 0x13 +#define CMD_RX_CRC_INIT 0x14 +#define CMD_RX_MSG_REJ 0x15 +#define CMD_RX_MP_SRCH 0x16 +#define CMD_RX_CRC_EXC 0x17 +#define CMD_RX_CRC_FRC 0x18 +#define CMD_TX_RST 0x01 +#define CMD_TX_ENA 0x02 +#define CMD_TX_DISA 0x03 +#define CMD_TX_CRC_INIT 0x04 +#define CMD_TX_CRC_EXC 0x05 +#define CMD_TX_EOM 0x06 +#define CMD_TX_ABORT 0x07 +#define CMD_TX_MP_ON 0x08 +#define CMD_TX_BUF_CLR 0x09 +#define CMD_TX_DISB 0x0b +#define CMD_CH_RST 0x21 +#define CMD_SRCH_MODE 0x31 +#define CMD_NOP 0x00 + +#define ST0_RXRDY 0x01 +#define ST0_TXRDY 0x02 +#define ST0_RXINTB 0x20 +#define ST0_RXINTA 0x40 +#define ST0_TXINT 0x80 + +#define ST1_IDLE 0x01 +#define ST1_ABORT 0x02 +#define ST1_CDCD 0x04 +#define ST1_CCTS 0x08 +#define ST1_SYN_FLAG 0x10 +#define ST1_CLMD 0x20 +#define ST1_TXIDLE 0x40 +#define ST1_UDRN 0x80 + +#define ST2_CRCE 0x04 +#define ST2_ONRN 0x08 +#define ST2_RBIT 0x10 +#define ST2_ABORT 0x20 +#define ST2_SHORT 0x40 +#define ST2_EOM 0x80 + +#define ST3_RX_ENA 0x01 +#define ST3_TX_ENA 0x02 +#define ST3_DCD 0x04 +#define ST3_CTS 0x08 +#define ST3_SRCH_MODE 0x10 +#define ST3_SLOOP 0x20 +#define ST3_GPI 0x80 + +#define ST4_RDNR 0x01 +#define ST4_RDCR 0x02 +#define ST4_TDNR 0x04 +#define ST4_TDCR 0x08 +#define ST4_OCLM 0x20 +#define ST4_CFT 0x40 +#define ST4_CGPI 0x80 + +#define FST_CRCEF 0x04 +#define FST_OVRNF 0x08 +#define FST_RBIF 0x10 +#define FST_ABTF 0x20 +#define FST_SHRTF 0x40 +#define FST_EOMF 0x80 + +#define IE0_RXRDY 0x01 +#define IE0_TXRDY 0x02 +#define IE0_RXINTB 0x20 +#define IE0_RXINTA 0x40 +#define IE0_TXINT 0x80 + +#define IE1_IDLD 0x01 +#define IE1_ABTD 0x02 +#define IE1_CDCD 0x04 +#define IE1_CCTS 0x08 +#define IE1_SYNCD 0x10 +#define IE1_CLMD 0x20 +#define IE1_IDL 0x40 +#define IE1_UDRN 0x80 + +#define IE2_CRCE 0x04 +#define IE2_OVRN 0x08 +#define IE2_RBIT 0x10 +#define IE2_ABT 0x20 +#define IE2_SHRT 0x40 +#define IE2_EOM 0x80 + +#define IE4_RDNR 0x01 +#define IE4_RDCR 0x02 +#define IE4_TDNR 0x04 +#define IE4_TDCR 0x08 +#define IE4_OCLM 0x20 +#define IE4_CFT 0x40 +#define IE4_CGPI 0x80 + +#define FIE_CRCEF 0x04 +#define FIE_OVRNF 0x08 +#define FIE_RBIF 0x10 +#define FIE_ABTF 0x20 +#define FIE_SHRTF 0x40 +#define FIE_EOMF 0x80 + +#define DSR_DWE 0x01 +#define DSR_DE 0x02 +#define DSR_REF 0x04 +#define DSR_UDRF 0x04 +#define DSR_COA 0x08 +#define DSR_COF 0x10 +#define DSR_BOF 0x20 +#define DSR_EOM 0x40 +#define DSR_EOT 0x80 + +#define DIR_REF 0x04 +#define DIR_UDRF 0x04 +#define DIR_COA 0x08 +#define DIR_COF 0x10 +#define DIR_BOF 0x20 +#define DIR_EOM 0x40 +#define DIR_EOT 0x80 + +#define DMR_CNTE 0x02 +#define DMR_NF 0x04 +#define DMR_SEOME 0x08 +#define DMR_TMOD 0x10 + +#define DCR_SW_ABT 0x01 +#define DCR_FCT_CLR 0x02 + +#define PCR_PR0 0x01 +#define PCR_PR1 0x02 +#define PCR_PR2 0x04 +#define PCR_CCC 0x08 +#define PCR_BRC 0x10 +#define PCR_OSB 0x40 +#define PCR_BURST 0x80 + +#endif /* (_HD64572_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/lapbether.c linux.20p9/drivers/net/lapbether.c --- linux.vanilla/drivers/net/lapbether.c Sun Mar 25 17:31:19 2001 +++ linux.20p9/drivers/net/lapbether.c Thu Jul 26 15:15:24 2001 @@ -116,7 +116,7 @@ */ static int lapbeth_check_devices(struct device *dev) { - struct lapbethdev *lapbeth, *lapbeth_prev; + struct lapbethdev *lapbeth, *lapbeth_prev, *lapbeth_next; int result = 0; unsigned long flags; @@ -125,7 +125,8 @@ lapbeth_prev = NULL; - for (lapbeth = lapbeth_devices; lapbeth != NULL; lapbeth = lapbeth->next) { + for (lapbeth = lapbeth_devices; lapbeth != NULL; lapbeth = lapbeth_next) { + lapbeth_next = lapbeth->next; if (!dev_get(lapbeth->ethname)) { if (lapbeth_prev) lapbeth_prev->next = lapbeth->next; @@ -138,8 +139,8 @@ unregister_netdev(&lapbeth->axdev); kfree(lapbeth); } - - lapbeth_prev = lapbeth; + else + lapbeth_prev = lapbeth; } restore_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/lmc/lmc_main.c linux.20p9/drivers/net/lmc/lmc_main.c --- linux.vanilla/drivers/net/lmc/lmc_main.c Sun Mar 25 17:31:21 2001 +++ linux.20p9/drivers/net/lmc/lmc_main.c Thu Jul 26 15:15:51 2001 @@ -488,7 +488,12 @@ break; } - LMC_COPY_FROM_USER(data, xc.data, xc.len); + if(copy_from_user(data, xc.data, xc.len)) + { + kfree(data); + ret = -ENOMEM; + break; + } printk("%s: Starting load of data Len: %d at 0x%p == 0x%p\n", dev->name, xc.len, xc.data, data); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/macmace.c linux.20p9/drivers/net/macmace.c --- linux.vanilla/drivers/net/macmace.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/macmace.c Wed Jul 4 16:03:55 2001 @@ -607,7 +607,7 @@ } /* - * A transmit error has occured. (We kick the transmit side from + * A transmit error has occurred. (We kick the transmit side from * the DMA completion) */ @@ -636,7 +636,7 @@ } /* - * A receive interrupt occured. + * A receive interrupt occurred. */ static void mace68k_recv_interrupt(struct device *dev) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/net_init.c linux.20p9/drivers/net/net_init.c --- linux.vanilla/drivers/net/net_init.c Sun Mar 25 17:31:16 2001 +++ linux.20p9/drivers/net/net_init.c Wed Jul 4 16:03:55 2001 @@ -292,8 +292,8 @@ void ether_setup(struct device *dev) { int i; - /* Fill in the fields of the device structure with ethernet-generic values. - This should be in a common file instead of per-driver. */ + /* Fill in the fields of the device structure with + ethernet-generic values. */ /* register boot-defined "eth" devices */ if (dev->name && (strncmp(dev->name, "eth", 3) == 0)) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/ni52.c linux.20p9/drivers/net/ni52.c --- linux.vanilla/drivers/net/ni52.c Sun Mar 25 17:31:16 2001 +++ linux.20p9/drivers/net/ni52.c Wed Jul 4 16:03:55 2001 @@ -33,20 +33,20 @@ * I have also done a look in the following sources: (mail me if you need them) * crynwr-packet-driver by Russ Nelson * Garret A. Wollman's (fourth) i82586-driver for BSD - * (before getting an i82596 (yes 596 not 586) manual, the existing drivers helped - * me a lot to understand this tricky chip.) + * (before getting an i82596 (yes 596 not 586) manual, the existing drivers + * helped me a lot to understand this tricky chip.) * * Known Problems: * The internal sysbus seems to be slow. So we often lose packets because of * overruns while receiving from a fast remote host. - * This can slow down TCP connections. Maybe the newer ni5210 cards are better. - * my experience is, that if a machine sends with more then about 500-600K/s - * the fifo/sysbus overflows. + * This can slow down TCP connections. Maybe the newer ni5210 cards are + * better. My experience is, that if a machine sends with more than + * about 500-600K/s the fifo/sysbus overflows. * * IMPORTANT NOTE: * On fast networks, it's a (very) good idea to have 16K shared memory. With - * 8K, we can store only 4 receive frames, so it can (easily) happen that a remote - * machine 'overruns' our system. + * 8K, we can store only 4 receive frames, so it can (easily) happen that a + * remote machine 'overruns' our system. * * Known i82586/card problems (I'm sure, there are many more!): * Running the NOP-mode, the i82586 sometimes seems to forget to report @@ -60,7 +60,8 @@ * * results from ftp performance tests with Linux 1.2.5 * send and receive about 350-400 KByte/s (peak up to 460 kbytes/s) - * sending in NOP-mode: peak performance up to 530K/s (but better don't run this mode) + * sending in NOP-mode: peak performance up to 530K/s (but better + * don't run this mode) */ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/pc300.c linux.20p9/drivers/net/pc300.c --- linux.vanilla/drivers/net/pc300.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/pc300.c Wed Jul 4 16:03:55 2001 @@ -1,13 +1,13 @@ #define USE_PCI_CLOCK static char rcsid[] = -"$Revision: 3.1.0.2 $$Date: 2000/06/27 $"; +"$Revision: 3.1.0.6 $$Date: 2001/03/02 $"; /* * pc300.c Cyclades-PC300(tm) Driver. * * Author: Ivan Passos * - * Copyright: (c) 1999-2000 Cyclades Corp. + * Copyright: (c) 1999-2001 Cyclades Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,6 +15,23 @@ * 2 of the License, or (at your option) any later version. * * $Log: pc300.c,v $ + * Revision 3.1.0.6 2001/03/02 daniela + * Changed SIOCGPC300CONF ioctl, to give hw information to pc300util. + * + * Revision 3.1.0.5 2001/02/23 daniela + * Fixed falc_check_status for Unframed E1. + * + * Revision 3.1.0.4 2000/12/22 daniela,ivan + * Added support for Unframed E1. + * Implemented pc300util support: trace, statistics, status and loopback + * tests for the PC300 TE boards. + * Implemented monitor mode. + * Fixed DCD sensitivity on the second channel. + * + * Revision 3.1.0.3 2000/09/28 daniela,ivan + * Implemented DCD sensitivity. + * Changed location of pc300.h . + * * Revision 3.1.0.2 2000/06/27 ivan * Previous bugfix for the framing errors with external clock made X21 * boards stop working. This version fixes it. @@ -73,7 +90,7 @@ * Fixed bug in ch_config that would disable interrupts on a previously * enabled channel if the other channel on the same board was enabled later. * - * Revision 0.3.0.0 1999/11/16 Daniela Squassoni + * Revision 0.3.0.0 1999/11/16 daniela * X.25 support. * * Revision 0.2.3.0 1999/11/15 ivan @@ -127,16 +144,14 @@ #include #include #include +#include #ifdef CONFIG_PC300_X25 #include #endif /* CONFIG_PC300_X25 */ #include "syncppp.h" - -#include - -#include +#include "pc300.h" #define CPC_LOCK(card,flags) \ do { \ @@ -475,28 +490,36 @@ /* Enable SEC and ES interrupts */ cpc_writeb(falcbase + F_REG(IMR3, ch), cpc_readb(falcbase + F_REG(IMR3, ch)) & ~(IMR3_SEC | IMR3_ES)); - cpc_writeb(falcbase + F_REG(IMR4, ch), - cpc_readb(falcbase + F_REG(IMR4, ch)) & - ~(IMR4_LFA | IMR4_AIS | IMR4_LOS | IMR4_SLIP)); + if (conf->fr_mode == PC300_FR_UNFRAMED) { + cpc_writeb(falcbase + F_REG(IMR4, ch), + cpc_readb(falcbase + F_REG(IMR4, ch)) & ~(IMR4_LOS)); + } else { + cpc_writeb(falcbase + F_REG(IMR4, ch), + cpc_readb(falcbase + F_REG(IMR4, ch)) & + ~(IMR4_LFA | IMR4_AIS | IMR4_LOS | IMR4_SLIP)); + } if (conf->media == LINE_T1) { cpc_writeb(falcbase + F_REG(IMR3, ch), cpc_readb(falcbase + F_REG(IMR3, ch)) & ~IMR3_LLBSC); } else { cpc_writeb(falcbase + F_REG(IPC, ch), cpc_readb(falcbase + F_REG(IPC, ch)) | IPC_SCI); - cpc_writeb(falcbase + F_REG(IMR2, ch), - cpc_readb(falcbase + F_REG(IMR2, ch)) & - ~(IMR2_FAR | IMR2_LFA | IMR2_AIS | IMR2_LOS)); - cpc_writeb(falcbase + F_REG(IMR1, ch), - cpc_readb(falcbase + F_REG(IMR1, ch)) & ~IMR1_LLBSC); - if (pfalc->multiframe_mode) { - cpc_writeb(falcbase + F_REG(IMR2, ch), - cpc_readb(falcbase + F_REG(IMR2, ch)) & - ~(IMR2_T400MS | IMR2_MFAR)); + if (conf->fr_mode == PC300_FR_UNFRAMED) { + cpc_writeb(falcbase + F_REG(IMR2, ch), + cpc_readb(falcbase + F_REG(IMR2, ch)) & ~(IMR2_LOS)); } else { - cpc_writeb(falcbase + F_REG(IMR2, ch), - cpc_readb(falcbase + F_REG(IMR2, ch)) | - IMR2_T400MS | IMR2_MFAR); + cpc_writeb(falcbase + F_REG(IMR2, ch), + cpc_readb(falcbase + F_REG(IMR2, ch)) & + ~(IMR2_FAR | IMR2_LFA | IMR2_AIS | IMR2_LOS)); + if (pfalc->multiframe_mode) { + cpc_writeb(falcbase + F_REG(IMR2, ch), + cpc_readb(falcbase + F_REG(IMR2, ch)) & + ~(IMR2_T400MS | IMR2_MFAR)); + } else { + cpc_writeb(falcbase + F_REG(IMR2, ch), + cpc_readb(falcbase + F_REG(IMR2, ch)) | + IMR2_T400MS | IMR2_MFAR); + } } } } @@ -565,10 +588,15 @@ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; uclong falcbase = card->hw.falcbase; - /* Timeslot 0 is never enabled */ cpc_writeb(falcbase + F_REG(ICB1, ch), 0); - cpc_writeb(falcbase + F_REG(TTR1, ch), 0x7f); - cpc_writeb(falcbase + F_REG(RTR1, ch), 0x7f); + if (conf->fr_mode == PC300_FR_UNFRAMED) { + cpc_writeb(falcbase + F_REG(TTR1, ch), 0xff); + cpc_writeb(falcbase + F_REG(RTR1, ch), 0xff); + } else { + /* Timeslot 0 is never enabled */ + cpc_writeb(falcbase + F_REG(TTR1, ch), 0x7f); + cpc_writeb(falcbase + F_REG(RTR1, ch), 0x7f); + } cpc_writeb(falcbase + F_REG(ICB2, ch), 0); cpc_writeb(falcbase + F_REG(TTR2, ch), 0xff); cpc_writeb(falcbase + F_REG(RTR2, ch), 0xff); @@ -617,9 +645,9 @@ falc_init_timeslot(card, ch); } // CTS/DCD ON - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) | - ((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch))); + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) & + ~((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch))); } void @@ -632,9 +660,9 @@ falc_close_all_timeslots(card, ch); } // CTS/DCD OFF - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) & - ~((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch))); + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) | + ((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch))); } void @@ -831,7 +859,7 @@ cpc_readb(falcbase + F_REG(LIM0, ch)) & ~LIM0_MAS); } cpc_writeb(falcbase + F_REG(LOOP, ch), - cpc_readb(falcbase + F_REG(LOOP, ch)) & ~LOOP_RTM); + cpc_readb(falcbase + F_REG(LOOP, ch)) & ~LOOP_SFM); cpc_writeb(falcbase + F_REG(IPC, ch), IPC_SCI); cpc_writeb(falcbase + F_REG(FMR0, ch), @@ -894,6 +922,19 @@ cpc_writeb(falcbase + F_REG(XSP, ch), cpc_readb(falcbase + F_REG(XSP, ch)) | XSP_XS13 | XSP_XS15); + + /* Automatic Force Resynchronization */ + cpc_writeb(falcbase + F_REG(FMR1, ch), + cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR); + + /* Transmit Automatic Remote Alarm */ + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA); + + /* Transmit Spare Bits for National Use (Y, Sn, Sa) */ + cpc_writeb(falcbase + F_REG(XSW, ch), + cpc_readb(falcbase + F_REG(XSW, ch)) | + XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4); break; case PC300_FR_MF_NON_CRC4: @@ -902,23 +943,53 @@ cpc_writeb(falcbase + F_REG(FMR1, ch), cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_XFS); cpc_writeb(falcbase + F_REG(FMR2, ch), - cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_RFS1); - cpc_writeb(falcbase + F_REG(FMR2, ch), - cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_RFS0); + cpc_readb(falcbase + F_REG(FMR2, ch)) & + ~(FMR2_RFS1|FMR2_RFS0)); cpc_writeb(falcbase + F_REG(XSW, ch), cpc_readb(falcbase + F_REG(XSW, ch)) | XSW_XSIS); cpc_writeb(falcbase + F_REG(XSP, ch), cpc_readb(falcbase + F_REG(XSP, ch)) | XSP_XSIF); - break; - } - /* Automatic Force Resynchronization */ - cpc_writeb(falcbase + F_REG(FMR1, ch), - cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR); + /* Automatic Force Resynchronization */ + cpc_writeb(falcbase + F_REG(FMR1, ch), + cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR); - /* Transmit Automatic Remote Alarm */ - cpc_writeb(falcbase + F_REG(FMR2, ch), - cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA); + /* Transmit Automatic Remote Alarm */ + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA); + + /* Transmit Spare Bits for National Use (Y, Sn, Sa) */ + cpc_writeb(falcbase + F_REG(XSW, ch), + cpc_readb(falcbase + F_REG(XSW, ch)) | + XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4); + break; + + case PC300_FR_UNFRAMED: + pfalc->multiframe_mode = 0; + cpc_writeb(falcbase + F_REG(FMR1, ch), + cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_XFS); + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) & + ~(FMR2_RFS1|FMR2_RFS0)); + cpc_writeb(falcbase + F_REG(XSP, ch), + cpc_readb(falcbase + F_REG(XSP, ch)) | XSP_TT0); + cpc_writeb(falcbase + F_REG(XSW, ch), + cpc_readb(falcbase + F_REG(XSW, ch)) & + ~(XSW_XTM|XSW_XY0|XSW_XY1|XSW_XY2|XSW_XY3|XSW_XY4)); + cpc_writeb(falcbase + F_REG(TSWM, ch), 0xff); + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) | + (FMR2_RTM|FMR2_DAIS)); + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_AXRA); + cpc_writeb(falcbase + F_REG(FMR1, ch), + cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_AFR); + pfalc->sync = 1; + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) | + (CPLD_REG2_FALC_LED2 << (2*ch))); + break; + } /* No signaling */ cpc_writeb(falcbase + F_REG(XSP, ch), @@ -944,11 +1015,6 @@ /* LOS Recovery after 22 ones in the time window of PCD */ cpc_writeb(falcbase + F_REG(PCRR, ch), 0x15); - /* Transmit Spare Bits for National Use (Y-Bits, Sn-Bits, Sa-Bits) */ - cpc_writeb(falcbase + F_REG(XSW, ch), - cpc_readb(falcbase + F_REG(XSW, ch)) | - XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4); - cpc_writeb(falcbase + F_REG(IDLE, ch), 0x7f); falc_close_all_timeslots(card, ch); @@ -958,14 +1024,21 @@ falc_init_hdlc(pc300_t *card, int ch) { uclong falcbase = card->hw.falcbase; + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; /* Enable transparent data transfer */ - cpc_writeb(falcbase + F_REG(MODE, ch), - cpc_readb(falcbase + F_REG(MODE, ch)) | MODE_HRAC | MODE_MDS2); - cpc_writeb(falcbase + F_REG(RAH2, ch), 0xff); - cpc_writeb(falcbase + F_REG(RAH1, ch), 0xff); - cpc_writeb(falcbase + F_REG(RAL2, ch), 0xff); - cpc_writeb(falcbase + F_REG(RAL1, ch), 0xff); + if (conf->fr_mode == PC300_FR_UNFRAMED) { + cpc_writeb(falcbase + F_REG(MODE, ch), 0); + } else { + cpc_writeb(falcbase + F_REG(MODE, ch), + cpc_readb(falcbase + F_REG(MODE, ch)) | + (MODE_HRAC|MODE_MDS2)); + cpc_writeb(falcbase + F_REG(RAH2, ch), 0xff); + cpc_writeb(falcbase + F_REG(RAH1, ch), 0xff); + cpc_writeb(falcbase + F_REG(RAL2, ch), 0xff); + cpc_writeb(falcbase + F_REG(RAL1, ch), 0xff); + } /* Tx/Rx reset */ falc_issue_cmd(card, ch, CMDR_RRES | CMDR_XRES | CMDR_SRES); @@ -1002,12 +1075,12 @@ CPC_LOCK(card, flags); /* Reset the FALC chip */ - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) | + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) | (CPLD_REG1_FALC_RESET << (2*ch))); udelay(10000); - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) & + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) & ~(CPLD_REG1_FALC_RESET << (2*ch))); if (conf->media == LINE_T1) { @@ -1023,8 +1096,8 @@ cpc_writeb(falcbase + F_REG(LIM0, ch), cpc_readb(falcbase + F_REG(LIM0, ch)) | LIM0_EQON); } - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) | + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) | ((CPLD_REG2_FALC_TX_CLK | CPLD_REG2_FALC_RX_CLK) << (2*ch))); /* Clear all interrupt registers */ @@ -1043,132 +1116,138 @@ falc_t *pfalc = (falc_t *)&chan->falc; uclong falcbase = card->hw.falcbase; - /* Verify AIS alarm */ - if (frs0 & FRS0_AIS) { - if (!pfalc->blue_alarm) { - pfalc->blue_alarm = 1; - pfalc->ais++; - // EVENT_AIS - if (conf->media == LINE_T1) { - /* Disable this interrupt as it may otherwise interfere with - other working boards. */ - cpc_writeb(falcbase + F_REG(IMR0, ch), - cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN); - } - falc_disable_comm(card, ch); - // EVENT_AIS - } - } else { - pfalc->blue_alarm = 0; - } - - /* Verify LOS */ - if (frs0 & FRS0_LOS) { - if (! pfalc->red_alarm) { - pfalc->red_alarm = 1; - pfalc->los++; + if (conf->fr_mode != PC300_FR_UNFRAMED) { + /* Verify AIS alarm */ + if (frs0 & FRS0_AIS) { if (!pfalc->blue_alarm) { - // EVENT_FALC_ABNORMAL + pfalc->blue_alarm = 1; + pfalc->ais++; + // EVENT_AIS if (conf->media == LINE_T1) { - /* Disable this interrupt as it may otherwise interfere - with other working boards. */ + /* Disable this interrupt as it may otherwise interfere with + other working boards. */ cpc_writeb(falcbase + F_REG(IMR0, ch), - cpc_readb(falcbase + F_REG(IMR0, ch)) | + cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN); } falc_disable_comm(card, ch); - // EVENT_FALC_ABNORMAL + // EVENT_AIS } - } - } else { - if (pfalc->red_alarm) { - pfalc->red_alarm = 0; - pfalc->losr++; - } - } + } else { + pfalc->blue_alarm = 0; + } - /* Verify LFA */ - if (frs0 & FRS0_LFA) { - if (!pfalc->loss_fa) { - pfalc->loss_fa = 1; - pfalc->lfa++; - if (!pfalc->blue_alarm && !pfalc->red_alarm) { - // EVENT_FALC_ABNORMAL - if (conf->media == LINE_T1) { - /* Disable this interrupt as it may otherwise interfere - with other working boards. */ - cpc_writeb(falcbase + F_REG(IMR0, ch), - cpc_readb(falcbase + F_REG(IMR0, ch)) | - IMR0_PDEN); + /* Verify LOS */ + if (frs0 & FRS0_LOS) { + if (!pfalc->red_alarm) { + pfalc->red_alarm = 1; + pfalc->los++; + if (!pfalc->blue_alarm) { + // EVENT_FALC_ABNORMAL + if (conf->media == LINE_T1) { + /* Disable this interrupt as it may otherwise interfere + with other working boards. */ + cpc_writeb(falcbase + F_REG(IMR0, ch), + cpc_readb(falcbase + F_REG(IMR0, ch)) | + IMR0_PDEN); + } + falc_disable_comm(card, ch); + // EVENT_FALC_ABNORMAL } - falc_disable_comm(card, ch); - // EVENT_FALC_ABNORMAL + } + } else { + if (pfalc->red_alarm) { + pfalc->red_alarm = 0; + pfalc->losr++; } } - } else { - if (pfalc->loss_fa) { - pfalc->loss_fa = 0; - pfalc->farec++; + + /* Verify LFA */ + if (frs0 & FRS0_LFA) { + if (!pfalc->loss_fa) { + pfalc->loss_fa = 1; + pfalc->lfa++; + if (!pfalc->blue_alarm && !pfalc->red_alarm) { + // EVENT_FALC_ABNORMAL + if (conf->media == LINE_T1) { + /* Disable this interrupt as it may otherwise + interfere with other working boards. */ + cpc_writeb(falcbase + F_REG(IMR0, ch), + cpc_readb(falcbase + F_REG(IMR0, ch)) | + IMR0_PDEN); + } + falc_disable_comm(card, ch); + // EVENT_FALC_ABNORMAL + } + } + } else { + if (pfalc->loss_fa) { + pfalc->loss_fa = 0; + pfalc->farec++; + } } - } - /* Verify LMFA */ - if ((pfalc->multiframe_mode) && (frs0 & FRS0_LMFA)) { - /* D4 or CRC4 frame mode */ - if (! pfalc->loss_mfa) { - pfalc->loss_mfa = 1; - pfalc->lmfa++; - if (!pfalc->blue_alarm && !pfalc->red_alarm && !pfalc->loss_fa) { - // EVENT_FALC_ABNORMAL - if (conf->media == LINE_T1) { - /* Disable this interrupt as it may otherwise interfere - with other working boards. */ - cpc_writeb(falcbase + F_REG(IMR0, ch), - cpc_readb(falcbase + F_REG(IMR0, ch)) | - IMR0_PDEN); + /* Verify LMFA */ + if (pfalc->multiframe_mode && (frs0 & FRS0_LMFA)) { + /* D4 or CRC4 frame mode */ + if (!pfalc->loss_mfa) { + pfalc->loss_mfa = 1; + pfalc->lmfa++; + if (!pfalc->blue_alarm && !pfalc->red_alarm && + !pfalc->loss_fa) { + // EVENT_FALC_ABNORMAL + if (conf->media == LINE_T1) { + /* Disable this interrupt as it may otherwise + interfere with other working boards. */ + cpc_writeb(falcbase + F_REG(IMR0, ch), + cpc_readb(falcbase + F_REG(IMR0, ch)) | + IMR0_PDEN); + } + falc_disable_comm(card, ch); + // EVENT_FALC_ABNORMAL } - falc_disable_comm(card, ch); - // EVENT_FALC_ABNORMAL } + } else { + pfalc->loss_mfa = 0; } - } else { - pfalc->loss_mfa = 0; - } - if (pfalc->red_alarm || pfalc->loss_fa || - pfalc->loss_mfa || pfalc->blue_alarm) { - if (pfalc->sync) { - pfalc->sync = 0; - cpc_writeb(falcbase + CPLD_REG2, - cpc_readb(falcbase + CPLD_REG2) & - ~(CPLD_REG2_FALC_LED2 << (2*ch))); - } - } else { - if ((!pfalc->sync)) { - pfalc->sync = 1; - cpc_writeb(falcbase + CPLD_REG2, - cpc_readb(falcbase + CPLD_REG2) | - (CPLD_REG2_FALC_LED2 << (2*ch))); + if (pfalc->red_alarm || pfalc->loss_fa || + pfalc->loss_mfa || pfalc->blue_alarm) { + if (pfalc->sync) { + pfalc->sync = 0; + chan->d.line_off++; + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) & + ~(CPLD_REG2_FALC_LED2 << (2*ch))); + } + } else { + if (!pfalc->sync) { + pfalc->sync = 1; + chan->d.line_on++; + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) | + (CPLD_REG2_FALC_LED2 << (2*ch))); + } } - } - /* Verify Remote Alarm */ - if (frs0 & FRS0_RRA) { - if (! pfalc->yellow_alarm) { - pfalc->yellow_alarm = 1; - pfalc->rai++; - if (pfalc->sync) { - // EVENT_RAI - falc_disable_comm(card, ch); - // EVENT_RAI + /* Verify Remote Alarm */ + if (frs0 & FRS0_RRA) { + if (!pfalc->yellow_alarm) { + pfalc->yellow_alarm = 1; + pfalc->rai++; + if (pfalc->sync) { + // EVENT_RAI + falc_disable_comm(card, ch); + // EVENT_RAI + } } + } else { + pfalc->yellow_alarm = 0; } - } else { - pfalc->yellow_alarm = 0; - } + } /* if !PC300_UNFRAMED */ - if ((pfalc->sync) && (!(pfalc->yellow_alarm))) { - if (! pfalc->active) { + if (pfalc->sync && !pfalc->yellow_alarm) { + if (!pfalc->active) { // EVENT_FALC_NORMAL if (pfalc->loop_active) { return; @@ -1214,6 +1293,7 @@ pfalc->ebc += counter; if (cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) { + mdelay (10); counter = cpc_readb(falcbase + F_REG(BECL, ch)); counter |= cpc_readb(falcbase + F_REG(BECH, ch)) << 8; pfalc->bec += counter; @@ -1231,6 +1311,16 @@ } } +/*---------------------------------------------------------------------------- + * falc_remote_loop + *---------------------------------------------------------------------------- + * Description: In the remote loopback mode the clock and data recovered + * from the line inputs RL1/2 or RDIP/RDIN are routed back + * to the line outputs XL1/2 or XDOP/XDON via the analog + * transmitter. As in normal mode they are processsed by + * the synchronizer and then sent to the system interface. + *---------------------------------------------------------------------------- + */ void falc_remote_loop(pc300_t *card, int ch, int loop_on) { @@ -1256,8 +1346,98 @@ cpc_writeb(falcbase + F_REG(LIM1, ch), cpc_readb(falcbase + F_REG(LIM1, ch)) & ~LIM1_RL); pfalc->sync = 0; - cpc_writeb(falcbase + CPLD_REG2, - cpc_readb(falcbase + CPLD_REG2) & + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) & + ~(CPLD_REG2_FALC_LED2 << (2*ch))); + pfalc->active = 0; + falc_issue_cmd(card, ch, CMDR_XRES); + pfalc->loop_active = 0; + } +} + +/*---------------------------------------------------------------------------- + * falc_local_loop + *---------------------------------------------------------------------------- + * Description: The local loopback mode disconnects the receive lines + * RL1/RL2 resp. RDIP/RDIN from the receiver. Instead of the + * signals coming from the line the data provided by system + * interface are routed through the analog receiver back to + * the system interface. The unipolar bit stream will be + * undisturbed transmitted on the line. Receiver and transmitter + * coding must be identical. + *---------------------------------------------------------------------------- + */ +void +falc_local_loop(pc300_t *card, int ch, int loop_on) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + falc_t *pfalc = (falc_t *)&chan->falc; + uclong falcbase = card->hw.falcbase; + + if (loop_on) { + cpc_writeb(falcbase + F_REG(LIM0, ch), + cpc_readb(falcbase + F_REG(LIM0, ch)) | LIM0_LL); + pfalc->loop_active = 1; + } + else { + cpc_writeb(falcbase + F_REG(LIM0, ch), + cpc_readb(falcbase + F_REG(LIM0, ch)) & ~LIM0_LL); + pfalc->loop_active = 0; + } +} + +/*---------------------------------------------------------------------------- + * falc_payload_loop + *---------------------------------------------------------------------------- + * Description: This routine allows to enable/disable payload loopback. + * When the payload loop is activated, the received 192 bits + * of payload data will be looped back to the transmit + * direction. The framing bits, CRC6 and DL bits are not + * looped. They are originated by the FALC-LH transmitter. + *---------------------------------------------------------------------------- + */ +void +falc_payload_loop(pc300_t *card, int ch, int loop_on) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + falc_t *pfalc = (falc_t *)&chan->falc; + uclong falcbase = card->hw.falcbase; + + if (loop_on) { + // EVENT_FALC_ABNORMAL + if (conf->media == LINE_T1) { + /* Disable this interrupt as it may otherwise interfere with + other working boards. */ + cpc_writeb(falcbase + F_REG(IMR0, ch), + cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN); + } + falc_disable_comm(card, ch); + // EVENT_FALC_ABNORMAL + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_PLB); + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR4, ch), + cpc_readb(falcbase + F_REG(FMR4, ch)) | FMR4_TM); + } else { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) | XSP_TT0); + } + falc_open_all_timeslots(card, ch); + pfalc->loop_active = 2; + } else { + cpc_writeb(falcbase + F_REG(FMR2, ch), + cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_PLB); + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR4, ch), + cpc_readb(falcbase + F_REG(FMR4, ch)) & ~FMR4_TM); + } else { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) & ~XSP_TT0); + } + pfalc->sync = 0; + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) & ~(CPLD_REG2_FALC_LED2 << (2*ch))); pfalc->active = 0; falc_issue_cmd(card, ch, CMDR_XRES); @@ -1265,15 +1445,213 @@ } } +/*---------------------------------------------------------------------------- + * turn_off_xlu + *---------------------------------------------------------------------------- + * Description: Turns XLU bit off in the proper register + *---------------------------------------------------------------------------- + */ +void +turn_off_xlu(pc300_t *card, int ch) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + uclong falcbase = card->hw.falcbase; + + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) & ~FMR5_XLU); + } else { + cpc_writeb(falcbase + F_REG(FMR3, ch), + cpc_readb(falcbase + F_REG(FMR3, ch)) & ~FMR3_XLU); + } +} + +/*---------------------------------------------------------------------------- + * turn_off_xld + *---------------------------------------------------------------------------- + * Description: Turns XLD bit off in the proper register + *---------------------------------------------------------------------------- + */ +void +turn_off_xld (pc300_t *card, int ch) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + uclong falcbase = card->hw.falcbase; + + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) & ~FMR5_XLD); + } else { + cpc_writeb(falcbase + F_REG(FMR3, ch), + cpc_readb(falcbase + F_REG(FMR3, ch)) & ~FMR3_XLD); + } +} + +/*---------------------------------------------------------------------------- + * falc_generate_loop_up_code + *---------------------------------------------------------------------------- + * Description: This routine writes the proper FALC chip register in order + * to generate a LOOP activation code over a T1/E1 line. + *---------------------------------------------------------------------------- + */ +void +falc_generate_loop_up_code (pc300_t *card, int ch) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + falc_t *pfalc = (falc_t *)&chan->falc; + uclong falcbase = card->hw.falcbase; + + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) | FMR5_XLU); + } else { + cpc_writeb(falcbase + F_REG(FMR3, ch), + cpc_readb(falcbase + F_REG(FMR3, ch)) | FMR3_XLU); + } + // EVENT_FALC_ABNORMAL + if (conf->media == LINE_T1) { + /* Disable this interrupt as it may otherwise interfere with + other working boards. */ + cpc_writeb(falcbase + F_REG(IMR0, ch), + cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN); + } + falc_disable_comm(card, ch); + // EVENT_FALC_ABNORMAL + pfalc->loop_gen = 1; +} + +/*---------------------------------------------------------------------------- + * falc_generate_loop_down_code + *---------------------------------------------------------------------------- + * Description: This routine writes the proper FALC chip register in order + * to generate a LOOP deactivation code over a T1/E1 line. + *---------------------------------------------------------------------------- + */ +void +falc_generate_loop_down_code(pc300_t *card, int ch) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + falc_t *pfalc = (falc_t *)&chan->falc; + uclong falcbase = card->hw.falcbase; + + if (conf->media == LINE_T1) { + cpc_writeb(falcbase + F_REG(FMR5, ch), + cpc_readb(falcbase + F_REG(FMR5, ch)) | FMR5_XLD); + } else { + cpc_writeb(falcbase + F_REG(FMR3, ch), + cpc_readb(falcbase + F_REG(FMR3, ch)) | FMR3_XLD); + } + pfalc->sync = 0; + cpc_writeb(falcbase + card->hw.cpld_reg2, + cpc_readb(falcbase + card->hw.cpld_reg2) & + ~(CPLD_REG2_FALC_LED2 << (2*ch))); + pfalc->active = 0; +//? falc_issue_cmd(card, ch, CMDR_XRES); + pfalc->loop_gen = 0; +} + +/*---------------------------------------------------------------------------- + * falc_pattern_test + *---------------------------------------------------------------------------- + * Description: This routine generates a pattern code and checks + * it on the reception side. + *---------------------------------------------------------------------------- + */ +void +falc_pattern_test(pc300_t *card, int ch, unsigned int activate) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; + falc_t *pfalc = (falc_t *)&chan->falc; + uclong falcbase = card->hw.falcbase; + + if (activate) { + pfalc->prbs = 1; + pfalc->bec = 0; + if (conf->media == LINE_T1) { + /* Disable local loop activation/deactivation detect */ + cpc_writeb(falcbase + F_REG(IMR3, ch), + cpc_readb(falcbase + F_REG(IMR3, ch)) | IMR3_LLBSC); + } else { + /* Disable local loop activation/deactivation detect */ + cpc_writeb(falcbase + F_REG(IMR1, ch), + cpc_readb(falcbase + F_REG(IMR1, ch)) | IMR1_LLBSC); + } + /* Activates generation and monitoring of PRBS + * (Pseudo Random Bit Sequence) */ + cpc_writeb(falcbase + F_REG(LCR1, ch), + cpc_readb(falcbase + F_REG(LCR1, ch)) | LCR1_EPRM | LCR1_XPRBS); + } else { + pfalc->prbs = 0; + /* Deactivates generation and monitoring of PRBS + * (Pseudo Random Bit Sequence) */ + cpc_writeb(falcbase + F_REG(LCR1, ch), + cpc_readb(falcbase + F_REG(LCR1, ch)) & ~(LCR1_EPRM | LCR1_XPRBS)); + if (conf->media == LINE_T1) { + /* Enable local loop activation/deactivation detect */ + cpc_writeb(falcbase + F_REG(IMR3, ch), + cpc_readb(falcbase + F_REG(IMR3, ch)) & ~IMR3_LLBSC); + } else { + /* Enable local loop activation/deactivation detect */ + cpc_writeb(falcbase + F_REG(IMR1, ch), + cpc_readb(falcbase + F_REG(IMR1, ch)) & ~IMR1_LLBSC); + } + } +} + +/*---------------------------------------------------------------------------- + * falc_pattern_test_error + *---------------------------------------------------------------------------- + * Description: This routine returns the bit error counter value + *---------------------------------------------------------------------------- + */ +ucshort falc_pattern_test_error(pc300_t *card, int ch) +{ + pc300ch_t *chan = (pc300ch_t *)&card->chan[ch]; + falc_t *pfalc = (falc_t *)&chan->falc; + + return (pfalc->bec); +} + /**********************************/ /*** Net Interface Routines ***/ /**********************************/ -int cpc_queue_xmit(struct sk_buff *skb, struct device *dev) +static void +cpc_trace (struct device *dev, struct sk_buff *skb_main, char rx_tx) +{ + struct sk_buff *skb; + + if ((skb = dev_alloc_skb(3 + skb_main->len)) == NULL) { + printk("%s: out of memory\n", dev->name); + return; + } + skb_put (skb, 3 + skb_main->len); + + skb->dev = dev; + skb->protocol = htons(ETH_P_CUST); + skb->mac.raw = skb->data; + skb->pkt_type = PACKET_HOST; + skb->len = 3 + skb_main->len; + + skb->data[0] = rx_tx; + skb->data[1] = ':'; + skb->data[2] = ' '; + memcpy(&skb->data[3], skb_main->data, skb_main->len); + + netif_rx(skb); +} + +int +cpc_queue_xmit(struct sk_buff *skb, struct device *dev) { pc300dev_t *d = (pc300dev_t *)dev->priv; pc300ch_t *chan = (pc300ch_t *)d->chan; pc300_t *card = (pc300_t *)chan->card; - struct enet_statistics *stats = &d->hdlc->stats; + struct net_device_stats *stats = &d->hdlc->stats; int ch = chan->channel; volatile pcsca_bd_t *ptdescr; uclong flags; @@ -1281,6 +1659,38 @@ int i; #endif + if (chan->conf.monitor) { + /* In monitor mode no Tx is done: ignore packet */ + dev_kfree_skb(skb); + return 0; + } else if (!(dev->flags & IFF_RUNNING)) { + /* DCD must be OFF: drop packet */ + dev_kfree_skb(skb); + stats->tx_errors++; + stats->tx_carrier_errors++; + return 0; + } else if (cpc_readb(card->hw.scabase + M_REG(ST3, ch)) & ST3_DCD) { + printk("%s: DCD is OFF. Going admnistrative down.\n", dev->name); + stats->tx_errors++; + stats->tx_carrier_errors++; + dev_kfree_skb(skb); + dev->flags &= ~IFF_RUNNING; + CPC_LOCK(card, flags); + if (d->tx_skb) { + dev_kfree_skb(d->tx_skb); + d->tx_skb = NULL; + } + cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_BUF_CLR); + if (card->hw.type == PC300_TE) { + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & + ~(CPLD_REG2_FALC_LED1 << (2*ch))); + } + dev->tbusy = 0; + CPC_UNLOCK(card, flags); + return 0; + } + if (dev->tbusy) { ucchar ilar; @@ -1303,8 +1713,8 @@ d->tx_skb = NULL; } if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) & + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & ~(CPLD_REG2_FALC_LED1 << (2*ch))); } CPC_UNLOCK(card, flags); @@ -1345,6 +1755,9 @@ printk("\n"); #endif + if (d->trace_on) { + cpc_trace (dev, skb, 'T'); + } d->tx_skb = skb; dev->trans_start = jiffies; @@ -1355,8 +1768,8 @@ cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_ENA); cpc_writeb(card->hw.scabase + DSR_TX(ch), DSR_DE); if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) | + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) | (CPLD_REG2_FALC_LED1 << (2*ch))); } CPC_UNLOCK(card, flags); @@ -1371,7 +1784,7 @@ pc300dev_t *d = (pc300dev_t *)dev->priv; pc300ch_t *chan = (pc300ch_t *)d->chan; pc300_t *card = (pc300_t *)chan->card; - struct enet_statistics *stats = &hdlc->stats; + struct net_device_stats *stats = &hdlc->stats; int ch = chan->channel; #ifdef PC300_DEBUG_RX int i; @@ -1416,6 +1829,9 @@ printk(" %02x", *(skb->data + i)); printk("\n"); #endif + if (d->trace_on) { + cpc_trace (dev, skb, 'R'); + } switch(hdlc->mode & ~MODE_SOFT) { #ifdef CONFIG_PC300_X25 @@ -1591,6 +2007,7 @@ hdlc_device *hdlc = d->hdlc; struct device *dev = hdlc_to_dev(hdlc); + spin_lock(&card->card_lock); dev->interrupt = 1; /**** Reception ****/ @@ -1619,14 +2036,16 @@ if (status & IR0_DRX(IR0_DMIB, ch)) { if (drx_stat & DSR_EOM) { if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + + card->hw.cpld_reg2) | (CPLD_REG2_FALC_LED1 << (2*ch))); } cpc_net_rx(hdlc); if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + + card->hw.cpld_reg2) & ~(CPLD_REG2_FALC_LED1 << (2*ch))); } } @@ -1651,8 +2070,9 @@ CMD_TX_BUF_CLR); } if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + + card->hw.cpld_reg2) & ~(CPLD_REG2_FALC_LED1 << (2*ch))); } if (d->tx_skb) { @@ -1676,8 +2096,9 @@ if (status & IR0_DTX(IR0_DMIB, ch)) { if (dtx_stat & DSR_EOM) { if (card->hw.type == PC300_TE) { - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + + card->hw.cpld_reg2) & ~(CPLD_REG2_FALC_LED1 << (2*ch))); } if (d->tx_skb) { @@ -1695,7 +2116,34 @@ } } } + + /**** MSCI ****/ + if (status & IR0_M(IR0_RXINTA, ch)) { + ucchar st1 = cpc_readb(scabase + M_REG(ST1, ch)); + + /* Clear MSCI interrupts */ + cpc_writeb(scabase + M_REG(ST1, ch), st1); + +#ifdef PC300_DEBUG_INTR + printk("sca_intr: MSCI intr (st=0x%08lx, st1=0x%02x)\n", + status, st1); +#endif + if (st1 & ST1_CDCD) { /* DCD changed */ + if (cpc_readb(scabase + M_REG(ST3, ch)) & ST3_DCD) { + printk("%s: DCD is OFF. Going administrative down.\n", + dev->name); + dev->flags &= ~IFF_RUNNING; + card->chan[ch].d.line_off++; + } else { /* DCD = 1 */ + printk("%s: DCD is ON. Going administrative up.\n", + dev->name); + dev->flags |= IFF_RUNNING; + card->chan[ch].d.line_on++; + } + } + } dev->interrupt = 0; + spin_unlock(&card->card_lock); } if (++intr_count == 10) /* Too much work at this board. Force exit */ @@ -1713,14 +2161,14 @@ if (((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_XPRBS) == 0) && !pfalc->loop_gen) { if (frs1 & FRS1_LLBDD) { - // A Line Loop Back Deactuation signal detected + // A Line Loop Back Deactivation signal detected if (pfalc->loop_active) { falc_remote_loop(card, ch, 0); } } else { if ((frs1 & FRS1_LLBAD) && ((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) == 0)) { - // A Line Loop Back Actuation signal detected + // A Line Loop Back Activation signal detected if (!pfalc->loop_active) { falc_remote_loop(card, ch, 1); } @@ -1739,14 +2187,14 @@ if (((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_XPRBS) == 0) && !pfalc->loop_gen) { if (rsp & RSP_LLBDD) { - // A Line Loop Back Deactuation signal detected + // A Line Loop Back Deactivation signal detected if (pfalc->loop_active) { falc_remote_loop(card, ch, 0); } } else { if ((rsp & RSP_LLBAD) && ((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) == 0)) { - // A Line Loop Back Actuation signal detected + // A Line Loop Back Activation signal detected if (!pfalc->loop_active) { falc_remote_loop(card, ch, 1); } @@ -2056,10 +2504,12 @@ pc300dev_t *d = (pc300dev_t *)dev->priv; pc300ch_t *chan = (pc300ch_t *)d->chan; pc300_t *card = (pc300_t *)chan->card; + pc300conf_t conf_aux; pc300chconf_t *conf = (pc300chconf_t *)&chan->conf; int ch = chan->channel; int value; void *arg = (void *) ifr->ifr_data; + uclong scabase = card->hw.scabase; if(!capable(CAP_NET_ADMIN)) return -EPERM; @@ -2067,14 +2517,24 @@ switch(cmd) { case SIOCGPC300CONF: conf->proto = hdlc->mode; - if (!arg || copy_to_user(arg, conf, sizeof(pc300chconf_t))) + memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t)); + memcpy(&conf_aux.hw, &card->hw, sizeof(pc300hw_t)); + if (!arg || copy_to_user(arg, &conf_aux, sizeof(pc300conf_t))) return -EINVAL; return 0; case SIOCSPC300CONF: if (!suser()) return -EPERM; - if (!arg || copy_from_user(conf, arg, sizeof(pc300chconf_t))) + if (!arg || copy_from_user(&conf_aux.conf, arg, + sizeof(pc300chconf_t))) return -EINVAL; + if (card->hw.cpld_id < 0x02 && + conf_aux.conf.fr_mode == PC300_FR_UNFRAMED) { + /* CPLD_ID < 0x02 doesn't support Unframed E1 */ + return -EINVAL; + } + memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t)); + hdlc->mode = conf->proto; return 0; case SIOCGPC300STATUS: cpc_sca_status(card, ch); @@ -2113,7 +2573,135 @@ conf->clkrate = value; return 0; } - + + case SIOCGPC300UTILSTATS: + { + pc300stats_t pc300stats; + + memset(&pc300stats, 0, sizeof(pc300stats_t)); + pc300stats.hw_type = card->hw.type; + pc300stats.line_on = card->chan[ch].d.line_on; + pc300stats.line_off = card->chan[ch].d.line_off; + memcpy(&pc300stats.gen_stats, &d->hdlc->stats, + sizeof(struct net_device_stats)); + if (card->hw.type == PC300_TE) + memcpy(&pc300stats.te_stats, &chan->falc, sizeof(falc_t)); + if (!arg || copy_to_user(arg, &pc300stats, sizeof(pc300stats_t))) + return -EINVAL; + return 0; + } + + case SIOCGPC300UTILSTATUS: + { + struct pc300status pc300status; + + pc300status.hw_type = card->hw.type; + if (card->hw.type == PC300_TE) { + pc300status.te_status.sync = chan->falc.sync; + pc300status.te_status.red_alarm = chan->falc.red_alarm; + pc300status.te_status.blue_alarm = chan->falc.blue_alarm; + pc300status.te_status.loss_fa = chan->falc.loss_fa; + pc300status.te_status.yellow_alarm = chan->falc.yellow_alarm; + pc300status.te_status.loss_mfa = chan->falc.loss_mfa; + pc300status.te_status.prbs = chan->falc.prbs; + } else { + pc300status.gen_status.dcd = + !(cpc_readb(scabase + M_REG(ST3, ch)) & ST3_DCD); + pc300status.gen_status.cts = + !(cpc_readb(scabase + M_REG(ST3, ch)) & ST3_CTS); + pc300status.gen_status.rts = + !(cpc_readb(scabase + M_REG(CTL, ch)) & CTL_RTS); + pc300status.gen_status.dtr = + !(cpc_readb(scabase + M_REG(CTL, ch)) & CTL_DTR); + /* There is no DSR in HD64572 */ + } + if (!arg || copy_to_user(arg, &pc300status, sizeof(pc300status_t))) + return -EINVAL; + return 0; + } + + case SIOCSPC300TRACE: + /* Sets/resets a trace_flag for the respective device */ + if (!arg || copy_from_user(&d->trace_on, arg, + sizeof(unsigned char))) + return -EINVAL; + return 0; + + case SIOCSPC300LOOPBACK: + { + struct pc300loopback pc300loop; + + /* TE boards only */ + if (card->hw.type != PC300_TE) + return -EINVAL; + + if (!arg || copy_from_user(&pc300loop, arg, + sizeof(pc300loopback_t))) + return -EINVAL; + switch (pc300loop.loop_type) { + case PC300LOCLOOP: /* Turn the local loop on/off */ + falc_local_loop(card, ch, pc300loop.loop_on); + return 0; + + case PC300REMLOOP: /* Turn the remote loop on/off */ + falc_remote_loop(card, ch, pc300loop.loop_on); + return 0; + + case PC300PAYLOADLOOP: /* Turn the payload loop on/off */ + falc_payload_loop(card, ch, pc300loop.loop_on); + return 0; + + case PC300GENLOOPUP: /* Generate loop UP */ + if (pc300loop.loop_on) { + falc_generate_loop_up_code(card, ch); + } else { + turn_off_xlu(card, ch); + } + return 0; + + case PC300GENLOOPDOWN: /* Generate loop DOWN */ + if (pc300loop.loop_on) { + falc_generate_loop_down_code(card, ch); + } else { + turn_off_xld(card, ch); + } + return 0; + + default: + return -EINVAL; + } + } + + case SIOCSPC300PATTERNTEST: + /* Turn the pattern test on/off and show the errors counter */ + { + struct pc300patterntst pc300patrntst; + + /* TE boards only */ + if (card->hw.type != PC300_TE) + return -EINVAL; + + if (card->hw.cpld_id < 0x02) { + /* CPLD_ID < 0x02 doesn't support pattern test */ + return -EINVAL; + } + if (!arg || copy_from_user(&pc300patrntst, arg, + sizeof(pc300patterntst_t))) + return -EINVAL; + if (pc300patrntst.patrntst_on == 2) { + if (chan->falc.prbs == 0) { + falc_pattern_test(card, ch, 1); + } + pc300patrntst.num_errors = falc_pattern_test_error(card, ch); + if (!arg || copy_to_user(arg, &pc300patrntst, + sizeof(pc300patterntst_t))) + return -EINVAL; + } else { + falc_pattern_test(card, ch, pc300patrntst.patrntst_on); + } + return 0; + } + default: switch(hdlc->mode & ~MODE_SOFT) { #ifdef CONFIG_PC300_X25 @@ -2203,7 +2791,7 @@ case PC300_RSV: case PC300_X21: if (clkrate) { - /* Calculate the clkrate rate parameters */ + /* Calculate the clkrate parameters */ tmc = clock_rate_calc(clkrate, card->hw.clock, &br); cpc_writeb(scabase + M_REG(TMCT, ch), tmc); cpc_writeb(scabase + M_REG(TXS, ch), (TXS_DTRXC|TXS_IBRG|br)); @@ -2241,10 +2829,14 @@ /* Enable Interrupts */ cpc_writel(scabase + IER0, - cpc_readl(scabase + IER0) | - IR0_DRX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) | - IR0_DTX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) ); - + cpc_readl(scabase + IER0) | + IR0_M(IR0_RXINTA, ch) | + IR0_DRX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) | + IR0_DTX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch)); + cpc_writel(scabase + M_REG(IE0, ch), + cpc_readl(scabase + M_REG(IE0, ch)) | IE0_RXINTA); + cpc_writel(scabase + M_REG(IE1, ch), + cpc_readl(scabase + M_REG(IE1, ch)) | IE1_CDCD); return 0; } @@ -2355,17 +2947,17 @@ cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_CH_RST); if (card->hw.type == PC300_TE) { memset(pfalc, 0, sizeof(falc_t)); - cpc_writeb(card->hw.falcbase + CPLD_REG2, - cpc_readb(card->hw.falcbase + CPLD_REG2) & + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & ~((CPLD_REG2_FALC_TX_CLK | CPLD_REG2_FALC_RX_CLK | CPLD_REG2_FALC_LED2) << (2*ch))); /* Reset the FALC chip */ - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) | + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) | (CPLD_REG1_FALC_RESET << (2*ch))); udelay(10000); - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) & + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) & ~(CPLD_REG1_FALC_RESET << (2*ch))); } } @@ -2664,14 +3256,35 @@ /* Set board type */ switch(device_id) { case PCI_DEVICE_ID_PC300_TE_1: - case PCI_DEVICE_ID_PC300_TE_2: + case PCI_DEVICE_ID_PC300_TE_2: { + ucchar reg1; + card->hw.type = PC300_TE; + + /* Check CPLD version */ + reg1 = cpc_readb(card->hw.falcbase + CPLD_REG1); + cpc_writeb(card->hw.falcbase + CPLD_REG1, (reg1 + 0x5a)); + if (cpc_readb(card->hw.falcbase + CPLD_REG1) == reg1) { + /* New CPLD */ + card->hw.cpld_id = cpc_readb(card->hw.falcbase + + CPLD_ID_REG); + card->hw.cpld_reg1 = CPLD_V2_REG1; + card->hw.cpld_reg2 = CPLD_V2_REG2; + } else { + /* old CPLD */ + card->hw.cpld_id = 0; + card->hw.cpld_reg1 = CPLD_REG1; + card->hw.cpld_reg2 = CPLD_REG2; + cpc_writeb(card->hw.falcbase + CPLD_REG1, reg1); + } + /* Enable the board's global clock */ - cpc_writeb(card->hw.falcbase + CPLD_REG1, - cpc_readb(card->hw.falcbase + CPLD_REG1) | + cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1, + cpc_readb(card->hw.falcbase + + card->hw.cpld_reg1) | CPLD_REG1_GLOBAL_CLK); break; - + } case PCI_DEVICE_ID_PC300_RX_1: case PCI_DEVICE_ID_PC300_RX_2: default: @@ -2765,6 +3378,9 @@ d->chan = chan; d->tx_skb = NULL; + d->trace_on = 0; + d->line_on = 0; + d->line_off = 0; d->hdlc = (hdlc_device *) kmalloc(sizeof(hdlc_device), GFP_KERNEL); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/pc300.h linux.20p9/drivers/net/pc300.h --- linux.vanilla/drivers/net/pc300.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/pc300.h Wed Aug 8 22:37:10 2001 @@ -0,0 +1,466 @@ +/* + * pc300.h Cyclades-PC300(tm) Kernel API Definitions. + * + * Author: Ivan Passos + * + * Copyright: (c) 1999-2001 Cyclades 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. + * + * $Log: pc300.h,v $ + * Revision 2.5 2001/03/02 daniela + * Created struct pc300conf, to provide the hardware information to pc300util. + * + * Revision 2.4 2000/12/22 daniela + * Structures and defines to support pc300util: statistics, status, + * loopback tests, trace. + * + * Revision 2.3 2000/09/28 ivan + * Changed location of include files. + * + * Revision 2.2 2000/06/23 ivan + * Inclusion of 'loopback' field on structure 'pc300chconf', to allow + * loopback mode operation. + * + * Revision 2.1 2000/06/09 ivan + * Changes to use the new generic HDLC layer in the driver. + * + * Revision 2.0 2000/03/27 ivan + * Added support for the PC300/TE cards. + * + * Revision 1.1 2000/01/31 ivan + * Replaced 'pc300[drv|sca].h' former PC300 driver include files. + * + * Revision 1.0 1999/12/16 ivan + * First official release. + * Inclusion of 'nchan' field on structure 'pc300hw', to allow variable + * number of ports per card. + * Inclusion of 'if_ptr' field on structure 'pc300dev'. + * + * Revision 0.6 1999/11/17 ivan + * Changed X.25-specific function names to comply with adopted convention. + * + * Revision 0.5 1999/11/16 Daniela Squassoni + * X.25 support. + * + * Revision 0.4 1999/11/15 ivan + * Inclusion of 'clock' field on structure 'pc300hw'. + * + * Revision 0.3 1999/11/10 ivan + * IOCTL name changing. + * Inclusion of driver function prototypes. + * + * Revision 0.2 1999/11/03 ivan + * Inclusion of 'tx_skb' and union 'ifu' on structure 'pc300dev'. + * + * Revision 0.1 1999/01/15 ivan + * Initial version. + * + */ + +#ifndef _PC300_H +#define _PC300_H + +#ifndef __HDLC_H +#include +#endif +#ifndef _HD64572_H +#include "hd64572.h" +#endif +#ifndef _FALC_LH_H +#include "falc-lh.h" +#endif + +#ifndef CY_TYPES +#define CY_TYPES +#if defined(__alpha__) +typedef unsigned long ucdouble; /* 64 bits, unsigned */ +typedef unsigned int uclong; /* 32 bits, unsigned */ +#else +typedef unsigned long uclong; /* 32 bits, unsigned */ +#endif +typedef unsigned short ucshort; /* 16 bits, unsigned */ +typedef unsigned char ucchar; /* 8 bits, unsigned */ +#endif /* CY_TYPES */ + +#define PC300_DEVNAME "hdlc" /* Dev. name base (for hdlc0, hdlc1, etc.) */ +#define PC300_MAXINDEX 100 /* Max dev. name index (the '0' in hdlc0) */ + +#define PC300_MAXCARDS 4 /* Max number of cards per system */ +#define PC300_MAXCHAN 2 /* Number of channels per card */ + +#define PC300_PLX_WIN 0x80 /* PLX control window size (128b) */ +#define PC300_RAMSIZE 0x80000 /* RAM window size (512Kb) */ +#define PC300_SCASIZE 0x400 /* SCA window size (1Kb) */ +#define PC300_FALCSIZE 0x400 /* FALC window size (1Kb) */ + +#define PC300_OSC_CLOCK 24576000 +#define PC300_PCI_CLOCK 33000000 + +#define BD_DEF_LEN 0x0800 /* DMA buffer length (2KB) */ +#define DMA_TX_MEMSZ 0x8000 /* Total DMA Tx memory size (32KB/ch) */ +#define DMA_RX_MEMSZ 0x10000 /* Total DMA Rx memory size (64KB/ch) */ + +#define N_DMA_TX_BUF (DMA_TX_MEMSZ / BD_DEF_LEN) /* DMA Tx buffers */ +#define N_DMA_RX_BUF (DMA_RX_MEMSZ / BD_DEF_LEN) /* DMA Rx buffers */ + +/* DMA Buffer Offsets */ +#define DMA_TX_BASE ((N_DMA_TX_BUF + N_DMA_RX_BUF) * \ + PC300_MAXCHAN * sizeof(pcsca_bd_t)) +#define DMA_RX_BASE (DMA_TX_BASE + PC300_MAXCHAN*DMA_TX_MEMSZ) + +/* DMA Descriptor Offsets */ +#define DMA_TX_BD_BASE 0x0000 +#define DMA_RX_BD_BASE (DMA_TX_BD_BASE + ((PC300_MAXCHAN*DMA_TX_MEMSZ / \ + BD_DEF_LEN) * sizeof(pcsca_bd_t))) + +/* DMA Descriptor Macros */ +#define TX_BD_ADDR(chan, n) (DMA_TX_BD_BASE + \ + ((N_DMA_TX_BUF*chan) + n) * sizeof(pcsca_bd_t)) +#define RX_BD_ADDR(chan, n) (DMA_RX_BD_BASE + \ + ((N_DMA_RX_BUF*chan) + n) * sizeof(pcsca_bd_t)) + +/* Macro to access the FALC registers (TE only) */ +#define F_REG(reg, chan) (0x200*(chan) + ((reg)<<2)) + +/*************************************** + * Memory access functions/macros * + * (required to support Alpha systems) * + ***************************************/ +#ifdef __KERNEL__ +#define cpc_writeb(port,val) {writeb((ucchar)(val),(ulong)(port)); mb();} +#define cpc_writew(port,val) {writew((ushort)(val),(ulong)(port)); mb();} +#define cpc_writel(port,val) {writel((uclong)(val),(ulong)(port)); mb();} + +#define cpc_readb(port) readb(port) +#define cpc_readw(port) readw(port) +#define cpc_readl(port) readl(port) + +#else /* __KERNEL__ */ +#define cpc_writeb(port,val) (*(volatile ucchar *)(port) = (ucchar)(val)) +#define cpc_writew(port,val) (*(volatile ucshort *)(port) = (ucshort)(val)) +#define cpc_writel(port,val) (*(volatile uclong *)(port) = (uclong)(val)) + +#define cpc_readb(port) (*(volatile ucchar *)(port)) +#define cpc_readw(port) (*(volatile ucshort *)(port)) +#define cpc_readl(port) (*(volatile uclong *)(port)) + +#endif /* __KERNEL__ */ + +/****** Data Structures *****************************************************/ + +/* + * RUNTIME_9050 - PLX PCI9050-1 local configuration and shared runtime + * registers. This structure can be used to access the 9050 registers + * (memory mapped). + */ +struct RUNTIME_9050 { + uclong loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */ + uclong loc_rom_range; /* 10h : Local ROM Range */ + uclong loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */ + uclong loc_rom_base; /* 24h : Local ROM Base */ + uclong loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */ + uclong rom_bus_descr; /* 38h : ROM Bus Descriptor */ + uclong cs_base[4]; /* 3C-48h : Chip Select Base Addrs */ + uclong intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */ + uclong init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */ +}; + +#define PLX_9050_LINT1_ENABLE 0x01 +#define PLX_9050_LINT1_POL 0x02 +#define PLX_9050_LINT1_STATUS 0x04 +#define PLX_9050_LINT2_ENABLE 0x08 +#define PLX_9050_LINT2_POL 0x10 +#define PLX_9050_LINT2_STATUS 0x20 +#define PLX_9050_INTR_ENABLE 0x40 +#define PLX_9050_SW_INTR 0x80 + +/* Masks to access the init_ctrl PLX register */ +#define PC300_CLKSEL_MASK (0x00000004UL) +#define PC300_CHMEDIA_MASK(chan) (0x00000020UL<<(chan*3)) +#define PC300_CTYPE_MASK (0x00000800UL) + +/* CPLD Registers (base addr = falcbase, TE only) */ +/* CPLD v. 0 */ +#define CPLD_REG1 0x140 /* Chip resets, DCD/CTS status */ +#define CPLD_REG2 0x144 /* Clock enable , LED control */ +/* CPLD v. 2 or higher */ +#define CPLD_V2_REG1 0x100 /* Chip resets, DCD/CTS status */ +#define CPLD_V2_REG2 0x104 /* Clock enable , LED control */ +#define CPLD_ID_REG 0x108 /* CPLD version */ + +/* CPLD Register bit description: for the FALC bits, they should always be + set based on the channel (use (bit<<(2*ch)) to access the correct bit for + that channel) */ +#define CPLD_REG1_FALC_RESET 0x01 +#define CPLD_REG1_SCA_RESET 0x02 +#define CPLD_REG1_GLOBAL_CLK 0x08 +#define CPLD_REG1_FALC_DCD 0x10 +#define CPLD_REG1_FALC_CTS 0x20 + +#define CPLD_REG2_FALC_TX_CLK 0x01 +#define CPLD_REG2_FALC_RX_CLK 0x02 +#define CPLD_REG2_FALC_LED1 0x10 +#define CPLD_REG2_FALC_LED2 0x20 + +/* Structure with FALC-related fields (TE only) */ +#define PC300_FALC_MAXLOOP 0x0000ffff /* for falc_issue_cmd() */ + +typedef struct falc { + ucchar sync; /* If true FALC is synchronized */ + ucchar active; /* if TRUE then already active */ + ucchar loop_active; /* if TRUE a line loopback UP was received */ + ucchar loop_gen; /* if TRUE a line loopback UP was issued */ + + ucchar num_channels; + ucchar offset; /* 1 for T1, 0 for E1 */ + ucchar full_bandwidth; + + ucchar xmb_cause; + ucchar multiframe_mode; + + /* Statistics */ + ucshort pden; /* Pulse Density violation count */ + ucshort los; /* Loss of Signal count */ + ucshort losr; /* Loss of Signal recovery count */ + ucshort lfa; /* Loss of frame alignment count */ + ucshort farec; /* Frame Alignment Recovery count */ + ucshort lmfa; /* Loss of multiframe alignment count */ + ucshort ais; /* Remote Alarm indication Signal count */ + ucshort sec; /* One-second timer */ + ucshort es; /* Errored second */ + ucshort rai; /* remote alarm received */ + ucshort bec; + ucshort fec; + ucshort cvc; + ucshort cec; + ucshort ebc; + + /* Status */ + ucchar red_alarm; + ucchar blue_alarm; + ucchar loss_fa; + ucchar yellow_alarm; + ucchar loss_mfa; + ucchar prbs; +} falc_t; + +typedef struct falc_status { + ucchar sync; /* If true FALC is synchronized */ + ucchar red_alarm; + ucchar blue_alarm; + ucchar loss_fa; + ucchar yellow_alarm; + ucchar loss_mfa; + ucchar prbs; +} falc_status_t; + +typedef struct rsv_x21_status { + ucchar dcd; + ucchar dsr; + ucchar cts; + ucchar rts; + ucchar dtr; +} rsv_x21_status_t; + +typedef struct pc300stats { + int hw_type; + uclong line_on; + uclong line_off; + struct net_device_stats gen_stats; + falc_t te_stats; +} pc300stats_t; + +typedef struct pc300status { + int hw_type; + rsv_x21_status_t gen_status; + falc_status_t te_status; +} pc300status_t; + +typedef struct pc300loopback { + char loop_type; + char loop_on; +} pc300loopback_t; + +typedef struct pc300patterntst { + char patrntst_on; /* 0 - off; 1 - on; 2 - read num_errors */ + ucshort num_errors; +} pc300patterntst_t; + +typedef struct pc300dev { + void *if_ptr; /* General purpose pointer */ + struct pc300ch *chan; + ucchar trace_on; + uclong line_on; /* DCD(X.21, RSV) / sync(TE) change counters */ + uclong line_off; +#ifdef __KERNEL__ + char name[16]; + void *private; + hdlc_device *hdlc; + struct sk_buff *tx_skb; +#endif /* __KERNEL__ */ +}pc300dev_t; + +typedef struct pc300hw { + int type; /* RSV, X21, etc. */ + int nchan; /* number of channels */ + int irq; /* interrupt request level */ + uclong clock; /* Board clock */ + ucchar cpld_id; /* CPLD ID (TE only) */ + ucshort cpld_reg1; /* CPLD reg 1 (TE only) */ + ucshort cpld_reg2; /* CPLD reg 2 (TE only) */ + uclong plxphys; /* PLX registers MMIO base (physical) */ + uclong plxbase; /* PLX registers MMIO base (virtual) */ + uclong plxsize; /* PLX registers MMIO size */ + uclong scaphys; /* SCA registers MMIO base (physical) */ + uclong scabase; /* SCA registers MMIO base (virtual) */ + uclong scasize; /* SCA registers MMIO size */ + uclong ramphys; /* On-board RAM MMIO base (physical) */ + uclong rambase; /* On-board RAM MMIO base (virtual) */ + uclong ramsize; /* On-board RAM MMIO size */ + uclong falcphys; /* FALC registers MMIO base (physical) */ + uclong falcbase; /* FALC registers MMIO base (virtual) */ + uclong falcsize; /* FALC registers MMIO size */ +} pc300hw_t; + +typedef struct pc300chconf { + ucchar media; /* HW media (RS232, V.35, etc.) */ + uclong proto; /* Protocol (PPP, X.25, etc.) */ + uclong clkrate; /* Clock rate (in bps, 0 = ext. clock) */ + ucchar loopback; /* Loopback mode */ + ucchar monitor; /* Monitor mode (0 = off, !0 = on) */ + + /* TE-specific parameters */ + ucchar lcode; /* Line Code (AMI, B8ZS, etc.) */ + ucchar fr_mode; /* Frame Mode (ESF, D4, etc.) */ + ucchar lbo; /* Line Build Out */ + ucchar rx_sens; /* Rx Sensitivity (long- or short-haul) */ + uclong tslot_bitmap; /* bit[i]=1 => timeslot _i_ is active */ +} pc300chconf_t; + +typedef struct pc300ch { + struct pc300 *card; + int channel; + pc300dev_t d; + pc300chconf_t conf; + ucchar tx_first_bd; /* First TX DMA block descr. w/ data */ + ucchar tx_next_bd; /* Next free TX DMA block descriptor */ + ucchar rx_first_bd; /* First free RX DMA block descriptor */ + ucchar rx_last_bd; /* Last free RX DMA block descriptor */ + falc_t falc; /* FALC structure (TE only) */ +} pc300ch_t; + +typedef struct pc300 { + pc300hw_t hw; /* hardware config. */ + pc300ch_t chan[PC300_MAXCHAN]; +#ifdef __KERNEL__ + spinlock_t card_lock; +#endif /* __KERNEL__ */ +} pc300_t; + +typedef struct pc300conf { + pc300hw_t hw; + pc300chconf_t conf; +} pc300conf_t; + +/* DEV ioctl() commands */ +#define N_SPPP_IOCTLS 2 + +enum pc300_ioctl_cmds { + SIOCCPCRESERVED = (SIOCDEVPRIVATE + N_SPPP_IOCTLS), + SIOCGPC300CONF, + SIOCSPC300CONF, + SIOCGPC300STATUS, + SIOCGPC300FALCSTATUS, + SIOCGPC300UTILSTATS, + SIOCGPC300UTILSTATUS, + SIOCSPC300TRACE, + SIOCSPC300LOOPBACK, + SIOCSPC300PATTERNTEST, +}; + +/* Loopback types - PC300/TE boards */ +enum pc300_loopback_cmds { + PC300LOCLOOP = 1, + PC300REMLOOP, + PC300PAYLOADLOOP, + PC300GENLOOPUP, + PC300GENLOOPDOWN, +}; + +/* Control Constant Definitions */ +#define PC300_RSV 0x01 +#define PC300_X21 0x02 +#define PC300_TE 0x03 + +#define PC300_LC_AMI 0x01 +#define PC300_LC_B8ZS 0x02 +#define PC300_LC_NRZ 0x03 +#define PC300_LC_HDB3 0x04 + +/* Framing (T1) */ +#define PC300_FR_ESF 0x01 +#define PC300_FR_D4 0x02 +#define PC300_FR_ESF_JAPAN 0x03 + +/* Framing (E1) */ +#define PC300_FR_MF_CRC4 0x04 +#define PC300_FR_MF_NON_CRC4 0x05 +#define PC300_FR_UNFRAMED 0x06 + +#define PC300_LBO_0_DB 0x00 +#define PC300_LBO_7_5_DB 0x01 +#define PC300_LBO_15_DB 0x02 +#define PC300_LBO_22_5_DB 0x03 + +#define PC300_RX_SENS_SH 0x01 +#define PC300_RX_SENS_LH 0x02 + +#define PC300_TX_TIMEOUT (2*HZ) +#define PC300_TX_QUEUE_LEN 10 +#define PC300_DEF_MTU 1500 + +#ifdef __KERNEL__ +/* Function Prototypes */ +static void tx_dma_buf_pt_init(pc300_t *, int); +static void tx_dma_buf_init(pc300_t *, int); +static void rx_dma_buf_pt_init(pc300_t *, int); +static void rx_dma_buf_init(pc300_t *, int); +static void tx_dma_buf_check(pc300_t *, int); +static void rx_dma_buf_check(pc300_t *, int); +int dma_buf_write(pc300_t *, int, ucchar *, int); +int dma_buf_read(pc300_t *, int, struct sk_buff *); +void tx_dma_start(pc300_t *, int); +void rx_dma_start(pc300_t *, int); +void tx_dma_stop(pc300_t *, int); +void rx_dma_stop(pc300_t *, int); +int cpc_queue_xmit(struct sk_buff *, struct device *); +void cpc_net_rx(hdlc_device *); +#ifdef CONFIG_PC300_X25 +int cpc_x25_packetlayer_xmit(struct sk_buff *, struct device *); +void cpc_lapb_connected(void *, int); +void cpc_lapb_disconnected(void *, int); +void cpc_lapb_data_indication(void *, struct sk_buff *); +void cpc_lapb_data_transmit(void *, struct sk_buff *); +#endif /* CONFIG_PC300_X25 */ +static void cpc_intr(int, void *, struct pt_regs *); +void cpc_sca_status(pc300_t *, int); +int cpc_ioctl(hdlc_device *, struct ifreq *, int); +static int clock_rate_calc(uclong, uclong, int *); +int ch_config(pc300dev_t *); +int rx_config(pc300dev_t *); +int tx_config(pc300dev_t *); +int cpc_opench(pc300dev_t *); +void cpc_closech(pc300dev_t *); +int cpc_open(hdlc_device *); +void cpc_close(hdlc_device *); +static uclong detect_ram(pc300_t *); +static void plx_init(pc300_t *); +static int cpc_detect(void); +static void cpc_trace(struct device *, struct sk_buff *, char); +#endif /* __KERNEL__ */ + +#endif /* _PC300_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/rtl8139.c linux.20p9/drivers/net/rtl8139.c --- linux.vanilla/drivers/net/rtl8139.c Sun Mar 25 17:31:20 2001 +++ linux.20p9/drivers/net/rtl8139.c Wed Jul 4 16:03:55 2001 @@ -1425,8 +1425,11 @@ rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; mc_filter[1] = mc_filter[0] = 0; for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter); + i++, mclist = mclist->next) { + int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; + + mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31)); + } } /* We can safely update without stopping the chip. */ outb(rx_mode, ioaddr + RxConfig); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sbni.c linux.20p9/drivers/net/sbni.c --- linux.vanilla/drivers/net/sbni.c Sun Mar 25 17:31:21 2001 +++ linux.20p9/drivers/net/sbni.c Wed Jul 4 16:03:55 2001 @@ -758,7 +758,7 @@ */ DP( printk("%s: sbni_recv SendComplete\n",dev->name); ); /* - * We sucessfully sent current packet + * We successfully sent current packet */ if(lp->waitack) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sdla_fr.c linux.20p9/drivers/net/sdla_fr.c --- linux.vanilla/drivers/net/sdla_fr.c Sun Mar 25 17:31:19 2001 +++ linux.20p9/drivers/net/sdla_fr.c Wed Jul 4 16:03:55 2001 @@ -77,7 +77,7 @@ * the if clause for it(0,dev->tbusy) * forever. * The code got into this stage due to an -* interrupt occuring within the if clause for +* interrupt occurring within the if clause for * set_bit(0,dev->tbusy). Since an interrupt * disables furhter transmit interrupt and * makes dev->tbusy = 0, this effect was undone @@ -1329,7 +1329,7 @@ /*============================================================================ - * Setup so that a frame can be transmitted on the occurence of a transmit + * Setup so that a frame can be transmitted on the occurrence of a transmit * interrupt. */ static void setup_for_delayed_transmit (struct device* dev, void* buf, @@ -1647,7 +1647,7 @@ ++card->statistics.isr_intr_test; break; - case FR_INTR_DLC: /* Event interrupt occured */ + case FR_INTR_DLC: /* Event interrupt occurred */ mbox->cmd.command = FR_READ_STATUS; mbox->cmd.length = 0; err = sdla_exec(mbox) ? mbox->cmd.result : CMD_TIMEOUT; @@ -1684,7 +1684,7 @@ /*============================================================================ * Receive interrupt handler. * When a receive interrupt occurs do the following: - * 1- Find the structure for the dlci that the interrupt occured on + * 1- Find the structure for the dlci that the interrupt occurred on * 2- If it doesn't exist then print appropriate msg and goto step 8. * 3- If it exist then copy data to a skb. * 4- If skb contains Sangoma UDP data then process them diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sis900.c linux.20p9/drivers/net/sis900.c --- linux.vanilla/drivers/net/sis900.c Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/sis900.c Wed Jul 4 16:03:55 2001 @@ -1,6 +1,6 @@ /* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux. Copyright 1999 Silicon Integrated System Corporation - Revision: 1.06.07 Jan. 8 2001 + Revision: 1.06.08 Apr. 3 2001 Modified from the driver which is originally written by Donald Becker. @@ -18,6 +18,7 @@ preliminary Rev. 1.0 Jan. 18, 1998 http://www.sis.com.tw/support/databook.htm + Rev 1.06.08 Mar. 2 2001 Hui-Fen Hsu (hfhsu@sis.com.tw) some bug fix & 635M/B support Rev 1.06.07 Jan. 8 2001 Lei-Chun Chang added RTL8201 PHY support Rev 1.06.06 Sep. 6 2000 Lei-Chun Chang added ICS1893 PHY support Rev 1.06.05 Aug. 22 2000 Lei-Chun Chang (lcchang@sis.com.tw) modified 630E equalier workaroung rule @@ -53,7 +54,7 @@ #include "sis900.h" static const char *version = -"sis900.c: v1.06.07 01/08/01\n"; +"sis900.c: v1.06.08 04/03/2001\n"; static int max_interrupt_work = 20; static int multicast_filter_limit = 128; @@ -79,34 +80,36 @@ PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE, sis900_mac_probe}, { "SiS 7016 PCI Fast Ethernet",PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016, PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE, sis900_mac_probe}, - {0,}, /* 0 terminated list. */ + {0,}, /* 0 terminatted list. */ }; -static void sis900_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex); -static void amd79c901_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex); -static void ics1893_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex); -static void rtl8201_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex); +static void sis900_read_mode(struct device *net_dev, int *speed, int *duplex); static struct mii_chip_info { const char * name; u16 phy_id0; u16 phy_id1; - void (*read_mode) (struct device *net_dev, int phy_addr, int *speed, int *duplex); + u8 phy_types; +#define HOME 0x0001 +#define LAN 0x0002 +#define MIX 0x0003 } mii_chip_table[] = { - {"SiS 900 Internal MII PHY", 0x001d, 0x8000, sis900_read_mode}, - {"SiS 7014 Physical Layer Solution", 0x0016, 0xf830,sis900_read_mode}, - {"AMD 79C901 10BASE-T PHY", 0x0000, 0x35b9, amd79c901_read_mode}, - {"AMD 79C901 HomePNA PHY", 0x0000, 0x35c8, amd79c901_read_mode}, - {"ICS 1893 Integrated PHYceiver" , 0x0015, 0xf441,ics1893_read_mode}, - {"RTL 8201 10/100Mbps Phyceiver" , 0x0000, 0x8201,rtl8201_read_mode}, + { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN }, + { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN }, + { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN }, + { "AMD 79C901 HomePNA PHY", 0x0000, 0x6B90, HOME}, + { "ICS LAN PHY", 0x0015, 0xF440, LAN }, + { "NS 83851 PHY", 0x2000, 0x5C20, MIX }, {0,}, }; struct mii_phy { struct mii_phy * next; - struct mii_chip_info * chip_info; int phy_addr; + u16 phy_id0; + u16 phy_id1; u16 status; + u8 phy_types; }; typedef struct _BufferDesc { @@ -122,9 +125,11 @@ struct mac_chip_info * mac; struct mii_phy * mii; + struct mii_phy * first_mii; /* record the first mii structure */ unsigned int cur_phy; - struct timer_list timer; /* Link status detection timer. */ + struct timer_list timer; /* Link status detection timer. */ + u8 autong_complete; /* 1: auto-negotiate complete */ unsigned int cur_rx, dirty_rx; /* producer/comsumer pointers for Tx/Rx ring */ unsigned int cur_tx, dirty_tx; @@ -167,10 +172,15 @@ static int sis900_close(struct device *net_dev); static int mii_ioctl(struct device *net_dev, struct ifreq *rq, int cmd); static struct enet_statistics *sis900_get_stats(struct device *net_dev); -static u16 sis900_compute_hashtable_index(u8 *addr); +static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision); static void set_rx_mode(struct device *net_dev); static void sis900_reset(struct device *net_dev); -static void sis630e_set_eq(struct device *net_dev); +static void sis630_set_eq(struct device *net_dev, u8 revision); +static u16 sis900_default_phy(struct device * net_dev); +static void sis900_set_capability( struct device *net_dev ,struct mii_phy *phy); +static u16 sis900_reset_phy(struct device *net_dev, int phy_addr); +static void sis900_auto_negotiate(struct device *net_dev, int phy_addr); +static void sis900_set_mode (long ioaddr, int speed, int duplex); /* A list of all installed SiS900 devices, for removing the driver module. */ static struct device *root_sis900_dev = NULL; @@ -265,26 +275,30 @@ return 1; } -/* SiS630E A1, The Mac address is hardcoded in the RFCR register so it is actually not necessary to - probe the MAC address */ -static int sis630ea1_get_mac_addr(struct pci_dev * pci_dev, struct device *net_dev) +/* 635 model : set Mac reload bit and get mac address from rfdr */ +static int sis635_get_mac_addr(struct pci_dev * pci_dev, struct device *net_dev) { - long ioaddr = pci_dev->base_address[0] & ~3; - u32 reg; - int i; + long ioaddr = net_dev->base_addr; + u32 rfcrSave; + u32 i; - /* reload MAC address */ - reg = inl(ioaddr + cr); - outl(reg | RELOAD, ioaddr + cr); + rfcrSave = inl(rfcr + ioaddr); - reg = inl(ioaddr + cr); - outl(reg & ~RELOAD, ioaddr + cr); + outl(rfcrSave | RELOAD, ioaddr + cr); + outl(0, ioaddr + cr); - for (i = 0; i < 3; i++) { - outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr); - ((u16 *)(net_dev->dev_addr))[i] = inl(ioaddr + rfdr); + /* disable packet filtering before setting filter */ + outl(rfcrSave & ~RFEN, rfcr + ioaddr); + + /* load MAC addr to filter data register */ + for (i = 0 ; i < 3 ; i++) { + outl((i << RFADDR_shift), ioaddr + rfcr); + *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); } + /* enable packet filitering */ + outl(rfcrSave | RFEN, rfcr + ioaddr); + return 1; } @@ -304,16 +318,31 @@ if ((net_dev = init_etherdev(net_dev, 0)) == NULL) return NULL; + if ((net_dev->priv = kmalloc(sizeof(struct sis900_private), GFP_KERNEL)) == NULL) { + unregister_netdev(net_dev); + return NULL; + } + + sis_priv = net_dev->priv; + memset(sis_priv, 0, sizeof(struct sis900_private)); + + /* We do a request_region() to register /proc/ioports info. */ + request_region(ioaddr, mac->io_size, net_dev->name); + net_dev->base_addr = ioaddr; + net_dev->irq = irq; + sis_priv->pci_dev = pci_dev; + sis_priv->mac = mac; + pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_REV || revision == SIS630EA1_REV) - ret = sis630e_get_mac_addr(pci_dev, net_dev); - else if (revision == SIS630S_REV) + if ( revision == SIS630E_900_REV ) ret = sis630e_get_mac_addr(pci_dev, net_dev); + else if ((revision > 0x81) && (revision <= 0x90)) + ret = sis635_get_mac_addr(pci_dev, net_dev); else ret = sis900_get_mac_addr(pci_dev, net_dev); if (ret == 0) { - unregister_netdevice(net_dev); + unregister_netdev(net_dev); return NULL; } @@ -324,21 +353,6 @@ printk("%2.2x:", (u8)net_dev->dev_addr[i]); printk("%2.2x.\n", net_dev->dev_addr[i]); - if ((net_dev->priv = kmalloc(sizeof(struct sis900_private), GFP_KERNEL)) == NULL) { - unregister_netdevice(net_dev); - return NULL; - } - - sis_priv = net_dev->priv; - memset(sis_priv, 0, sizeof(struct sis900_private)); - - /* We do a request_region() to register /proc/ioports info. */ - request_region(ioaddr, mac->io_size, net_dev->name); - net_dev->base_addr = ioaddr; - net_dev->irq = irq; - sis_priv->pci_dev = pci_dev; - sis_priv->mac = mac; - /* probe for mii transciver */ if (sis900_mii_probe(net_dev) == 0) { unregister_netdev(net_dev); @@ -361,81 +375,171 @@ return net_dev; } +/* sis900_mii_probe: - Probe MII PHY for sis900 */ static int sis900_mii_probe (struct device * net_dev) { struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv; + u16 poll_bit = MII_STAT_LINK, status = 0; + unsigned int timeout = jiffies + 5 * HZ; int phy_addr; u8 revision; sis_priv->mii = NULL; /* search for total of 32 possible mii phy addresses */ - for (phy_addr = 0; phy_addr < 32; phy_addr++) { + for (phy_addr = 0; phy_addr < 32; phy_addr++) { + struct mii_phy * mii_phy = NULL; u16 mii_status; - u16 phy_id0, phy_id1; int i; - mii_status = mdio_read(net_dev, phy_addr, MII_STATUS); + for(i=0; i<2; i++) + mii_status = mdio_read(net_dev, phy_addr, MII_STATUS); + if (mii_status == 0xffff || mii_status == 0x0000) /* the mii is not accessable, try next one */ continue; - - phy_id0 = mdio_read(net_dev, phy_addr, MII_PHY_ID0); - phy_id1 = mdio_read(net_dev, phy_addr, MII_PHY_ID1); - - /* search our mii table for the current mii */ - for (i = 0; mii_chip_table[i].phy_id1; i++) - if (phy_id0 == mii_chip_table[i].phy_id0 && - phy_id1 == mii_chip_table[i].phy_id1) { - struct mii_phy * mii_phy; - - printk(KERN_INFO - "%s: %s transceiver found at address %d.\n", - net_dev->name, mii_chip_table[i].name, - phy_addr);; - if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) != NULL) { - mii_phy->chip_info = mii_chip_table+i; - mii_phy->phy_addr = phy_addr; - mii_phy->status = mdio_read(net_dev, phy_addr, - MII_STATUS); - mii_phy->next = sis_priv->mii; - sis_priv->mii = mii_phy; - } - /* the current mii is on our mii_info_table, - try next address */ + + if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { + printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n"); + return 0; + } + + mii_phy->phy_id0 = mdio_read(net_dev, phy_addr, MII_PHY_ID0); + mii_phy->phy_id1 = mdio_read(net_dev, phy_addr, MII_PHY_ID1); + mii_phy->phy_addr = phy_addr; + mii_phy->status = mii_status; + mii_phy->next = sis_priv->mii; + sis_priv->mii = mii_phy; + sis_priv->first_mii = mii_phy; + + for (i=0; mii_chip_table[i].phy_id1; i++) + if ( ( mii_phy->phy_id0 == mii_chip_table[i].phy_id0 ) && + ( (mii_phy->phy_id1 & 0xFFF0) == mii_chip_table[i].phy_id1 )){ + + mii_phy->phy_types = mii_chip_table[i].phy_types; + if(mii_chip_table[i].phy_types == MIX) + mii_phy->phy_types = + (mii_status & (MII_STAT_CAN_TX_FDX | MII_STAT_CAN_TX))?LAN:HOME; + printk(KERN_INFO "%s: %s transceiver found at address %d.\n", + net_dev->name, mii_chip_table[i].name, phy_addr); break; } - } + if( !mii_chip_table[i].phy_id1 ) + printk(KERN_INFO "%s: Unknown PHY transceiver found at address %d.\n", + net_dev->name, phy_addr); + } + if (sis_priv->mii == NULL) { printk(KERN_INFO "%s: No MII transceivers found!\n", net_dev->name); return 0; } - /* arbitrary choose that last PHY as current PHY */ - sis_priv->cur_phy = sis_priv->mii->phy_addr; - printk(KERN_INFO "%s: Using %s as default\n", net_dev->name, - sis_priv->mii->chip_info->name); + /* Slect Default PHY to put in sis_priv->mii & sis_priv->cur_phy */ + sis_priv->mii = NULL; + sis900_default_phy( net_dev ); + + /* Reset PHY if default PHY is internal sis900 */ + if( (sis_priv->mii->phy_id0 == 0x001D) && + ( (sis_priv->mii->phy_id1&0xFFF0) == 0x8000) ) + status = sis900_reset_phy( net_dev, sis_priv->cur_phy ); + + if( status & MII_STAT_LINK ){ + while (poll_bit) { + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(0); + poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit); + if (jiffies >= timeout) { + printk(KERN_WARNING "%s: reset phy and link down\n", net_dev->name); + return -ETIME; + } + } + } pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_REV) { + if (revision == SIS630E_900_REV) { /* SiS 630E has some bugs on default value of PHY registers */ mdio_write(net_dev, sis_priv->cur_phy, MII_ANADV, 0x05e1); mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG1, 0x22); mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG2, 0xff00); mdio_write(net_dev, sis_priv->cur_phy, MII_MASK, 0xffc0); - mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, 0x1000); + //mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, 0x1000); } if (sis_priv->mii->status & MII_STAT_LINK) sis_priv->LinkOn = TRUE; else sis_priv->LinkOn = FALSE; - + return 1; } + +/* sis900_default_phy : Select one default PHY for sis900 mac */ +static u16 sis900_default_phy(struct device * net_dev) +{ + struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv; + struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL; + u16 status; + + for( phy=sis_priv->first_mii; phy; phy=phy->next ){ + status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); + status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); + + /* Link ON & Not select deafalut PHY */ + if ( (status & MII_STAT_LINK) && !(default_phy) ) + default_phy = phy; + else{ + status = mdio_read(net_dev, phy->phy_addr, MII_CONTROL); + mdio_write(net_dev, phy->phy_addr, MII_CONTROL, + status | MII_CNTL_AUTO | MII_CNTL_ISOLATE); + if( phy->phy_types == HOME ) + phy_home = phy; + } + } + + if( (!default_phy) && phy_home ) + default_phy = phy_home; + else if(!default_phy) + default_phy = sis_priv->first_mii; + + if( sis_priv->mii != default_phy ){ + sis_priv->mii = default_phy; + sis_priv->cur_phy = default_phy->phy_addr; + printk(KERN_INFO "%s: Using transceiver found at address %d as default\n", net_dev->name,sis_priv->cur_phy); + } + + status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); + status &= (~MII_CNTL_ISOLATE); + + mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, status); + status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); + status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); + + return status; +} + + +/* sis900_set_capability : set the media capability of network adapter */ +static void sis900_set_capability( struct device *net_dev , struct mii_phy *phy ) +{ + u16 cap; + u16 status; + + status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); + status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); + + cap = MII_NWAY_CSMA_CD | + ((phy->status & MII_STAT_CAN_TX_FDX)? MII_NWAY_TX_FDX:0) | + ((phy->status & MII_STAT_CAN_TX) ? MII_NWAY_TX:0) | + ((phy->status & MII_STAT_CAN_T_FDX) ? MII_NWAY_T_FDX:0)| + ((phy->status & MII_STAT_CAN_T) ? MII_NWAY_T:0); + + mdio_write( net_dev, phy->phy_addr, MII_ANADV, cap ); +} + + /* Delay between EEPROM clock transitions. */ #define eeprom_delay() inl(ee_addr) @@ -580,6 +684,19 @@ return; } +static u16 sis900_reset_phy(struct device *net_dev, int phy_addr) +{ + int i = 0; + u16 status; + + while (i++ < 2) + status = mdio_read(net_dev, phy_addr, MII_STATUS); + + mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET ); + + return status; +} + static int sis900_open(struct device *net_dev) { @@ -592,8 +709,7 @@ /* Equalizer workaroung Rule */ pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_REV || revision == SIS630EA1_REV) - sis630e_set_eq(net_dev); + sis630_set_eq(net_dev, revision); if (request_irq(net_dev->irq, &sis900_interrupt, SA_SHIRQ, net_dev->name, net_dev)) { return -EAGAIN; @@ -641,7 +757,7 @@ rfcrSave = inl(rfcr + ioaddr); /* disable packet filtering before setting filter */ - outl(rfcrSave & ~RFEN, rfcr); + outl(rfcrSave & ~RFEN, rfcr + ioaddr); /* load MAC addr to filter data register */ for (i = 0 ; i < 3 ; i++) { @@ -734,51 +850,76 @@ net_dev->name, inl(ioaddr + rxdp)); } -/* 630E equalizer workaroung rule(Cyrus Huang 08/15) - PHY register 14h(Test) - Bit 14: 0 -- Automatically dectect (default) - 1 -- Manually set Equalizer filter - Bit 13: 0 -- (Default) - 1 -- Speed up convergence of equalizer setting - Bit 9 : 0 -- (Default) - 1 -- Disable Baseline Wander - Bit 3~7 -- Equalizer filter setting - - Link ON: Set Bit 9, 13 to 1, Bit 14 to 0 - Then calculate equalizer value - Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0 - Link Off:Set Bit 13 to 1, Bit 14 to 0 - - Calculate Equalizer value: - When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value. - When the equalizer is stable, this value is not a fixed value. It will be within - a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9) - 0 <= max <= 4 --> set equalizer to max - 5 <= max <= 14 --> set equalizer to max+1 or - set equalizer to max+2 if max == min - max >= 15 --> set equalizer to max+5 or - set equalizer to max+6 if max == min -*/ -static void sis630e_set_eq(struct device *net_dev) +/** + * sis630_set_eq: - set phy equalizer value for 630 LAN + * @net_dev: the net device to set equalizer value + * @revision: 630 LAN revision number + * + * 630E equalizer workaround rule(Cyrus Huang 08/15) + * PHY register 14h(Test) + * Bit 14: 0 -- Automatically dectect (default) + * 1 -- Manually set Equalizer filter + * Bit 13: 0 -- (Default) + * 1 -- Speed up convergence of equalizer setting + * Bit 9 : 0 -- (Default) + * 1 -- Disable Baseline Wander + * Bit 3~7 -- Equalizer filter setting + * Link ON: Set Bit 9, 13 to 1, Bit 14 to 0 + * Then calculate equalizer value + * Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0 + * Link Off:Set Bit 13 to 1, Bit 14 to 0 + * Calculate Equalizer value: + * When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value. + * When the equalizer is stable, this value is not a fixed value. It will be within + * a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9) + * 0 <= max <= 4 --> set equalizer to max + * 5 <= max <= 14 --> set equalizer to max+1 or set equalizer to max+2 if max == min + * max >= 15 --> set equalizer to max+5 or set equalizer to max+6 if max == min + */ + +static void sis630_set_eq(struct device *net_dev, u8 revision) { struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv; u16 reg14h, eq_value, max_value=0, min_value=0; + u8 host_bridge_rev; int i, maxcount=10; + struct pci_dev *dev=NULL; + + if ( !(revision == SIS630E_900_REV || revision == SIS630EA1_900_REV || + revision == SIS630A_900_REV) ) + return; + + if ((dev = pci_find_device(SIS630_VENDOR_ID, SIS630_DEVICE_ID, dev))) + pci_read_config_byte(dev, PCI_CLASS_REVISION, &host_bridge_rev); - if (sis_priv->LinkOn == TRUE) { + if (sis_priv->LinkOn) { reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (0x2200 | reg14h) & 0xBFFF); for (i=0; i < maxcount; i++) { eq_value=(0x00F8 & mdio_read(net_dev, sis_priv->cur_phy, MII_RESV)) >> 3; + if (i == 0) + max_value=min_value=eq_value; max_value=(eq_value > max_value) ? eq_value : max_value; min_value=(eq_value < min_value) ? eq_value : min_value; - } - if (max_value < 5) - eq_value=max_value; - else if (max_value >= 5 && max_value < 15) - eq_value=(max_value == min_value) ? max_value+2 : max_value+1; - else if (max_value >= 15) - eq_value=(max_value == min_value) ? max_value+6 : max_value+5; + } + /* 630E rule to determine the equalizer value */ + if (revision == SIS630E_900_REV || revision == SIS630EA1_900_REV) { + if (max_value < 5) + eq_value=max_value; + else if (max_value >= 5 && max_value < 15) + eq_value=(max_value == min_value) ? max_value+2 : max_value+1; + else if (max_value >= 15) + eq_value=(max_value == min_value) ? max_value+6 : max_value+5; + } + /* 630B0&B1 rule to determine the equalizer value */ + if (revision == SIS630A_900_REV && + (host_bridge_rev == SIS630B0 || host_bridge_rev == SIS630B1)) { + if (max_value == 0) + eq_value=3; + else + eq_value=(max_value+min_value+1)/2; + } + /* write equalizer value and setting */ reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); reg14h=(reg14h & 0xFF07) | ((eq_value << 3) & 0x00F8); reg14h=(reg14h | 0x6000) & 0xFDFF; @@ -786,14 +927,19 @@ } else { reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); - mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2000) & 0xBFFF); + if (revision == SIS630A_900_REV && + (host_bridge_rev == SIS630B0 || host_bridge_rev == SIS630B1)) + mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2200) & 0xBFFF); + else + mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2000) & 0xBFFF); } return; } + /* on each timer ticks we check two things, Link Status (ON/OFF) and - Link Mode (10/100/Full/Half) - */ + Link Mode (10/100/Full/Half) +*/ static void sis900_timer(unsigned long data) { struct device *net_dev = (struct device *)data; @@ -801,77 +947,91 @@ struct mii_phy *mii_phy = sis_priv->mii; static int next_tick = 5*HZ; u16 status; - u8 revision; - - status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); - status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); + u8 revision; - /* current mii phy is failed to link, try another one */ - while (!(status & MII_STAT_LINK)) { - if (mii_phy->next == NULL) { - if (sis_priv->LinkOn) { - /* link stat change from ON to OFF */ - next_tick = HZ; - sis_priv->LinkOn = FALSE; - - /* Equalizer workaroung Rule */ - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_REV || revision == SIS630EA1_REV) - sis630e_set_eq(net_dev); + if(!sis_priv->autong_complete){ + int speed, duplex = 0; - printk(KERN_INFO "%s: Media Link Off\n", - net_dev->name); - } - sis_priv->timer.expires = jiffies + next_tick; - add_timer(&sis_priv->timer); - return; + sis900_read_mode(net_dev, &speed, &duplex); + if(duplex){ + sis900_set_mode(net_dev->base_addr, speed, duplex); + pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); + sis630_set_eq(net_dev, revision); } - mii_phy = mii_phy->next; - status = mdio_read(net_dev, mii_phy->phy_addr, MII_STATUS); + + sis_priv->timer.expires = jiffies + HZ; + add_timer(&sis_priv->timer); + return; } - if (!sis_priv->LinkOn) { - /* link stat change forn OFF to ON, read and report link mode */ - sis_priv->LinkOn = TRUE; - next_tick = 5*HZ; - - /* Equalizer workaroung Rule */ - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_REV || revision == SIS630EA1_REV) - sis630e_set_eq(net_dev); - - /* change what cur_phy means */ - if (mii_phy->phy_addr != sis_priv->cur_phy) { - printk(KERN_INFO "%s: Changing transceiver to %s\n", - net_dev->name, mii_phy->chip_info->name); - /* disable previous PHY */ - status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); - mdio_write(net_dev, sis_priv->cur_phy, - MII_CONTROL, status | MII_CNTL_ISOLATE); - /* enable next PHY */ - status = mdio_read(net_dev, mii_phy->phy_addr, MII_CONTROL); - mdio_write(net_dev, mii_phy->phy_addr, - MII_CONTROL, status & ~MII_CNTL_ISOLATE); - sis_priv->cur_phy = mii_phy->phy_addr; - } - sis900_check_mode(net_dev, mii_phy); + status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); + status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); + /* Link OFF -> ON */ + if ( !sis_priv->LinkOn ) { +LookForLink: + /* Search for new PHY */ + status = sis900_default_phy( net_dev ); + mii_phy = sis_priv->mii; + + if( status & MII_STAT_LINK ){ + sis900_check_mode(net_dev, mii_phy); + sis_priv->LinkOn = TRUE; + } + } + /* Link ON -> OFF */ + else{ + if( !(status & MII_STAT_LINK) ){ + sis_priv->LinkOn = FALSE; + printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); + + /* Change mode issue */ + if( (mii_phy->phy_id0 == 0x001D) && + ( (mii_phy->phy_id1 & 0xFFF0) == 0x8000 )) + sis900_reset_phy( net_dev, sis_priv->cur_phy ); + + pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); + sis630_set_eq(net_dev, revision); + + goto LookForLink; + } } sis_priv->timer.expires = jiffies + next_tick; add_timer(&sis_priv->timer); } + static void sis900_check_mode (struct device *net_dev, struct mii_phy *mii_phy) { struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv; long ioaddr = net_dev->base_addr; int speed, duplex; - u32 tx_flags = 0, rx_flags = 0; - mii_phy->chip_info->read_mode(net_dev, sis_priv->cur_phy, &speed, &duplex); + if( mii_phy->phy_types == LAN ){ + outl( ~EXD & inl( ioaddr + cfg ), ioaddr + cfg); + sis900_set_capability(net_dev , mii_phy); + sis900_auto_negotiate(net_dev, sis_priv->cur_phy); + }else{ + outl(EXD | inl( ioaddr + cfg ), ioaddr + cfg); + speed = HW_SPEED_HOME; + duplex = FDX_CAPABLE_HALF_SELECTED; + sis900_set_mode(net_dev->base_addr, speed, duplex); + sis_priv->autong_complete = 1; + } +} - tx_flags = TxATP | (TX_DMA_BURST << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift); - rx_flags = RX_DMA_BURST << RxMXDMA_shift; +static void sis900_set_mode (long ioaddr, int speed, int duplex) +{ + u32 tx_flags = 0, rx_flags = 0; + + if( inl(ioaddr + cfg) & EDB_MASTER_EN ){ + tx_flags = TxATP | (DMA_BURST_64 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift); + rx_flags = DMA_BURST_64 << RxMXDMA_shift; + } + else{ + tx_flags = TxATP | (DMA_BURST_512 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift); + rx_flags = DMA_BURST_512 << RxMXDMA_shift; + } if (speed == HW_SPEED_HOME || speed == HW_SPEED_10_MBPS ) { rx_flags |= (RxDRNT_10 << RxDRNT_shift); @@ -890,141 +1050,68 @@ outl (tx_flags, ioaddr + txcfg); outl (rx_flags, ioaddr + rxcfg); } -static void sis900_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex) + + +static void sis900_auto_negotiate(struct device *net_dev, int phy_addr) { + struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv; int i = 0; u32 status; - - /* STSOUT register is Latched on Transition, read operation updates it */ + while (i++ < 2) - status = mdio_read(net_dev, phy_addr, MII_STSOUT); - - if (status & MII_STSOUT_SPD) - *speed = HW_SPEED_100_MBPS; - else - *speed = HW_SPEED_10_MBPS; - - if (status & MII_STSOUT_DPLX) - *duplex = FDX_CAPABLE_FULL_SELECTED; - else - *duplex = FDX_CAPABLE_HALF_SELECTED; + status = mdio_read(net_dev, phy_addr, MII_STATUS); - if (status & MII_STSOUT_LINK_FAIL) + if (!(status & MII_STAT_LINK)){ printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); - else - printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", - net_dev->name, - *speed == HW_SPEED_100_MBPS ? - "100mbps" : "10mbps", - *duplex == FDX_CAPABLE_FULL_SELECTED ? - "full" : "half"); -} -static void amd79c901_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex) -{ - int i; - u16 status; + sis_priv->autong_complete = 1; + sis_priv->LinkOn = FALSE; + return; + } - for (i = 0; i < 2; i++) - status = mdio_read(net_dev, phy_addr, MII_STATUS); + /* (Re)start AutoNegotiate */ + mdio_write(net_dev, phy_addr, MII_CONTROL, + MII_CNTL_AUTO | MII_CNTL_RST_AUTO); + sis_priv->autong_complete = 0; +} - if (status & MII_STAT_CAN_AUTO) { - /* 10BASE-T PHY */ - for (i = 0; i < 2; i++) - status = mdio_read(net_dev, phy_addr, MII_STATUS_SUMMARY); - if (status & MII_STSSUM_SPD) - *speed = HW_SPEED_100_MBPS; - else - *speed = HW_SPEED_10_MBPS; - if (status & MII_STSSUM_DPLX) - *duplex = FDX_CAPABLE_FULL_SELECTED; - else - *duplex = FDX_CAPABLE_HALF_SELECTED; - if (status & MII_STSSUM_LINK) - printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", - net_dev->name, - *speed == HW_SPEED_100_MBPS ? - "100mbps" : "10mbps", - *duplex == FDX_CAPABLE_FULL_SELECTED ? - "full" : "half"); - else - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); - } - else { - /* HomePNA */ - *speed = HW_SPEED_HOME; - *duplex = FDX_CAPABLE_HALF_SELECTED; - if (status & MII_STAT_LINK) - printk(KERN_INFO "%s: Media Link On 1mbps half-duplex \n", - net_dev->name); - else - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); - } -} -/* ICS1893 PHY use Quick Poll Detailed Status Register to get its status */ -static void ics1893_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex) +static void sis900_read_mode(struct device *net_dev, int *speed, int *duplex) { - int i = 0; + struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv; + int phy_addr = sis_priv->cur_phy; u32 status; + u16 autoadv, autorec; + int i = 0; + + while (i++ < 2) + status = mdio_read(net_dev, phy_addr, MII_STATUS); - /* MII_QPDSTS is Latched, read twice in succession will reflect the current state */ - for (i = 0; i < 2; i++) - status = mdio_read(net_dev, phy_addr, MII_QPDSTS); + if (!(status & MII_STAT_LINK)) return; + + /* AutoNegotiate completed */ + autoadv = mdio_read(net_dev, phy_addr, MII_ANADV); + autorec = mdio_read(net_dev, phy_addr, MII_ANLPAR); + status = autoadv & autorec; - if (status & MII_STSICS_SPD) + if (status & (MII_NWAY_TX | MII_NWAY_TX_FDX)) *speed = HW_SPEED_100_MBPS; else *speed = HW_SPEED_10_MBPS; - - if (status & MII_STSICS_DPLX) + if (status & ( MII_NWAY_TX_FDX | MII_NWAY_T_FDX)) *duplex = FDX_CAPABLE_FULL_SELECTED; else *duplex = FDX_CAPABLE_HALF_SELECTED; - if (status & MII_STSICS_LINKSTS) - printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", - net_dev->name, - *speed == HW_SPEED_100_MBPS ? - "100mbps" : "10mbps", - *duplex == FDX_CAPABLE_FULL_SELECTED ? - "full" : "half"); - else - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); + sis_priv->autong_complete = 1; + + printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", + net_dev->name, + *speed == HW_SPEED_100_MBPS ? + "100mbps" : "10mbps", + *duplex == FDX_CAPABLE_FULL_SELECTED ? + "full" : "half"); } -static void rtl8201_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex) -{ - u32 status; - - status = mdio_read(net_dev, phy_addr, MII_STATUS); - - if (status & MII_STAT_CAN_TX_FDX) { - *speed = HW_SPEED_100_MBPS; - *duplex = FDX_CAPABLE_FULL_SELECTED; - } - else if (status & MII_STAT_CAN_TX) { - *speed = HW_SPEED_100_MBPS; - *duplex = FDX_CAPABLE_HALF_SELECTED; - } - else if (status & MII_STAT_CAN_T_FDX) { - *speed = HW_SPEED_10_MBPS; - *duplex = FDX_CAPABLE_FULL_SELECTED; - } - else if (status & MII_STAT_CAN_T) { - *speed = HW_SPEED_10_MBPS; - *duplex = FDX_CAPABLE_HALF_SELECTED; - } - - if (status & MII_STAT_LINK) - printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", - net_dev->name, - *speed == HW_SPEED_100_MBPS ? - "100mbps" : "10mbps", - *duplex == FDX_CAPABLE_FULL_SELECTED ? - "full" : "half"); - else - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); -} static void sis900_tx_timeout(struct device *net_dev) { @@ -1308,14 +1395,14 @@ tx_status = sis_priv->tx_ring[entry].cmdsts; if (tx_status & OWN) { - /* The packet is not transmited yet (owned by hardware) ! + /* The packet is not transmitted yet (owned by hardware) ! Note: the interrupt is generated only when Tx Machine is idle, so this is an almost impossible case */ break; } if (tx_status & (ABORT | UNDERRUN | OWCOLL)) { - /* packet unsuccessfully transmited */ + /* packet unsuccessfully transmitted */ if (sis900_debug > 3) printk(KERN_INFO "%s: Transmit " "error, Tx status %8.8x.\n", @@ -1330,7 +1417,7 @@ if (tx_status & OWCOLL) sis_priv->stats.tx_window_errors++; } else { - /* packet successfully transmited */ + /* packet successfully transmitted */ sis_priv->stats.collisions += (tx_status & COLCNT) >> 16; sis_priv->stats.tx_bytes += tx_status & DSIZE; sis_priv->stats.tx_packets++; @@ -1422,9 +1509,13 @@ return &sis_priv->stats; } -/* SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast hash table, which makes - this function a little bit different from other drivers */ -static u16 sis900_compute_hashtable_index(u8 *addr) + +/* SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast + * hash table, which makes this function a little bit different from other drivers + * SiS 900 B0 & 635 M/B uses the most significat 8 bits to index 256 bits + * multicast hash table. + */ +static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision) { /* what is the correct value of the POLYNOMIAL ?? @@ -1447,43 +1538,54 @@ byte >>= 1; } } - /* leave 7 most siginifant bits */ - return ((int)(crc >> 25)); + + /* leave 8 or 7 most siginifant bits */ + if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV)) + return ((int)(crc >> 24)); + else + return ((int)(crc >> 25)); } static void set_rx_mode(struct device *net_dev) { long ioaddr = net_dev->base_addr; - u16 mc_filter[8]; /* 128 bits multicast hash table */ - int i; + struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv; + u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */ + int i, table_entries; u32 rx_mode; + u8 revision; + + /* 635 Hash Table entires = 256(2^16) */ + pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); + if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV)) + table_entries = 16; + else + table_entries = 8; if (net_dev->flags & IFF_PROMISC) { /* Accept any kinds of packets */ rx_mode = RFPromiscuous; - for (i = 0; i < 8; i++) + for (i = 0; i < table_entries; i++) mc_filter[i] = 0xffff; } else if ((net_dev->mc_count > multicast_filter_limit) || (net_dev->flags & IFF_ALLMULTI)) { /* too many multicast addresses or accept all multicast packets */ rx_mode = RFAAB | RFAAM; - for (i = 0; i < 8; i++) + for (i = 0; i < table_entries; i++) mc_filter[i] = 0xffff; } else { /* Accept Broadcast packets, destination addresses match our MAC address, use Receive Filter to reject unwanted MCAST packets */ struct dev_mc_list *mclist; rx_mode = RFAAB; - for (i = 0; i < 8; i++) - mc_filter[i]=0; for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count; i++, mclist = mclist->next) - set_bit(sis900_compute_hashtable_index(mclist->dmi_addr), + set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision), mc_filter); } /* update Multicast Hash Table in Receive Filter */ - for (i = 0; i < 8; i++) { + for (i = 0; i < table_entries; i++) { /* why plus 0x04 ??, That makes the correct value for hash table. */ outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr); outl(mc_filter[i], ioaddr + rfdr); @@ -1510,7 +1612,9 @@ static void sis900_reset(struct device *net_dev) { long ioaddr = net_dev->base_addr; + struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv; int i = 0; + u8 revision; u32 status = TxRCMP | RxRCMP; outl(0, ioaddr + ier); @@ -1524,7 +1628,11 @@ status ^= (inl(isr + ioaddr) & status); } - outl(PESEL, ioaddr + cfg); + pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); + if( (revision == SIS635A_900_REV) || (revision == SIS900B_900_REV) ) + outl(PESEL | RND_CNT, ioaddr + cfg); + else + outl(PESEL, ioaddr + cfg); } #ifdef MODULE @@ -1541,6 +1649,13 @@ struct sis900_private *sis_priv = (struct sis900_private *)root_sis900_dev->priv; struct device *next_dev = sis_priv->next_module; + struct mii_phy *phy = NULL; + + while(sis_priv->first_mii){ + phy = sis_priv->first_mii; + sis_priv->first_mii = phy->next; + kfree(phy); + } unregister_netdev(root_sis900_dev); release_region(root_sis900_dev->base_addr, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sis900.h linux.20p9/drivers/net/sis900.h --- linux.vanilla/drivers/net/sis900.h Sun Mar 25 17:37:34 2001 +++ linux.20p9/drivers/net/sis900.h Wed Jul 4 16:03:55 2001 @@ -47,7 +47,10 @@ enum sis900_configuration_register_bits { DESCRFMT = 0x00000100 /* 7016 specific */, REQALG = 0x00000080, SB = 0x00000040, POW = 0x00000020, EXD = 0x00000010, - PESEL = 0x00000008, LPM = 0x00000004, BEM = 0x00000001 + PESEL = 0x00000008, LPM = 0x00000004, BEM = 0x00000001, + /* 635 & 900B Specific */ + RND_CNT = 0x00000400, FAIR_BACKOFF = 0x00000200, + EDB_MASTER_EN = 0x00002000 }; enum sis900_eeprom_access_reigster_bits { @@ -74,9 +77,11 @@ /* maximum dma burst fro transmission and receive*/ #define MAX_DMA_RANGE 7 /* actually 0 means MAXIMUM !! */ #define TxMXDMA_shift 20 -#define RxMXDMA_shift 20 -#define TX_DMA_BURST 0 -#define RX_DMA_BURST 0 +#define RxMXDMA_shift 20 + +enum sis900_tx_rx_dma{ + DMA_BURST_512 = 0, DMA_BURST_64 = 5 +}; /* transmit FIFO threshholds */ #define TX_FILL_THRESH 16 /* 1/4 FIFO size */ @@ -228,11 +233,17 @@ MII_STSSUM_AUTO = 0x0002, MII_STSSUM_SPD = 0x0001 }; -enum sis630_revision_id { - SIS630E_REV = 0x81, SIS630EA1_REV = 0x83, - SIS630S_REV = 0x82 +enum sis900_revision_id { + SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81, + SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83, + SIS635A_900_REV = 0x90, SIS900B_900_REV = 0x03 }; +enum sis630_revision_id { + SIS630A0 = 0x00, SIS630A1 = 0x01, + SIS630B0 = 0x10, SIS630B1 = 0x11 +}; + #define FDX_CAPABLE_DUPLEX_UNKNOWN 0 #define FDX_CAPABLE_HALF_SELECTED 1 #define FDX_CAPABLE_FULL_SELECTED 2 @@ -258,6 +269,8 @@ /* PCI stuff, should be move to pic.h */ #define PCI_DEVICE_ID_SI_900 0x900 #define PCI_DEVICE_ID_SI_7016 0x7016 +#define SIS630_VENDOR_ID 0x1039 +#define SIS630_DEVICE_ID 0x0630 /* ioctl for accessing MII transveiver */ #define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Get the PHY in use. */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/Makefile linux.20p9/drivers/net/sk98lin/Makefile --- linux.vanilla/drivers/net/sk98lin/Makefile Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/Makefile Wed Jul 4 16:03:55 2001 @@ -3,9 +3,13 @@ # Makefile for the SysKonnect SK-98xx device driver. # +#DEBUG = 1 + + ifeq ($(CONFIG_SK98LIN),y) O_TARGET := sk98lin.o - O_OBJS = skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \ + O_OBJS = skge.o skproc.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o \ + skgesirq.o \ ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \ skxmac2.o skcsum.o else @@ -13,19 +17,20 @@ MOD_LIST_NAME := SK98LIN_MODULES M_OBJS := sk98lin.o O_TARGET := sk98lin.o - O_OBJS = skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \ + O_OBJS = skge.o skproc.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o \ + skgesirq.o \ ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \ skxmac2.o skcsum.o endif endif -# DBGDEF = \ -# -DDEBUG - ifdef DEBUG +DBGDEF = \ + -DDEBUG + DBGDEF += \ --DSK_DEBUG_CHKMOD=0x00000000L \ --DSK_DEBUG_CHKCAT=0x00000000L + -DSK_DEBUG_CHKMOD=0x00000000L \ + -DSK_DEBUG_CHKCAT=0xFFFFFFFF endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/lm80.h linux.20p9/drivers/net/sk98lin/h/lm80.h --- linux.vanilla/drivers/net/sk98lin/h/lm80.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/lm80.h Wed Jul 4 16:03:55 2001 @@ -126,7 +126,7 @@ #define LM80_IS_BTI (1<<1) /* state of BTI# pin */ #define LM80_IS_FAN1 (1<<2) /* count limit exceeded for Fan 1 */ #define LM80_IS_FAN2 (1<<3) /* count limit exceeded for Fan 2 */ -#define LM80_IS_CI (1<<4) /* Chassis Intrusion occured */ +#define LM80_IS_CI (1<<4) /* Chassis Intrusion occurred */ #define LM80_IS_OS (1<<5) /* OS temperature limit exceeded */ /* bit 6 and 7 are reserved in LM80_ISRC_2 */ #define LM80_IS_HT_IRQ_MD (1<<6) /* Hot temperature interrupt mode */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skaddr.h linux.20p9/drivers/net/sk98lin/h/skaddr.h --- linux.vanilla/drivers/net/sk98lin/h/skaddr.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skaddr.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skaddr.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.20 $ - * Date: $Date: 1999/11/22 13:46:14 $ - * Purpose: Header file for Address Management (MC, UC, Prom) + * Version: $Revision: 1.24 $ + * Date: $Date: 2001/01/22 13:41:34 $ + * Purpose: Header file for Address Management (MC, UC, Prom). * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,20 @@ * History: * * $Log: skaddr.h,v $ + * Revision 1.24 2001/01/22 13:41:34 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.23 2000/08/10 11:27:50 rassmann + * Editorial changes. + * Preserving 32-bit alignment in structs for the adapter context. + * + * Revision 1.22 2000/08/07 11:10:40 rassmann + * Editorial changes. + * + * Revision 1.21 2000/05/04 09:39:59 rassmann + * Editorial changes. + * Corrected multicast address hashing. + * * Revision 1.20 1999/11/22 13:46:14 cgoos * Changed license header to GPL. * Allowing overwrite for SK_ADDR_EQUAL. @@ -119,33 +132,36 @@ #define __INC_SKADDR_H #ifdef __cplusplus -xxxx /* not supported yet - force error */ +#error C++ is not yet supported. extern "C" { #endif /* cplusplus */ /* defines ********************************************************************/ -#define SK_MAC_ADDR_LEN 6 /* Length of MAC address. */ -#define SK_MAX_ADDRS 14 /* #Addrs for exact match. */ +#define SK_MAC_ADDR_LEN 6 /* Length of MAC address. */ +#define SK_MAX_ADDRS 14 /* #Addrs for exact match. */ /* ----- Common return values ----- */ -#define SK_ADDR_SUCCESS 0 /* Function returned successfully. */ -#define SK_ADDR_ILLEGAL_PORT 100 /* Port number too high. */ -#define SK_ADDR_TOO_EARLY 101 /* Function called too early. */ +#define SK_ADDR_SUCCESS 0 /* Function returned successfully. */ +#define SK_ADDR_ILLEGAL_PORT 100 /* Port number too high. */ +#define SK_ADDR_TOO_EARLY 101 /* Function called too early. */ /* ----- Clear/Add flag bits ----- */ -#define SK_ADDR_PERMANENT 1 /* RLMT Address */ +#define SK_ADDR_PERMANENT 1 /* RLMT Address */ /* ----- Additional Clear flag bits ----- */ -#define SK_MC_SW_ONLY 2 /* Do not update HW when clearing. */ +#define SK_MC_SW_ONLY 2 /* Do not update HW when clearing. */ /* ----- Override flag bits ----- */ -#define SK_ADDR_VIRTUAL_ADDRESS 0 +#define SK_ADDR_LOGICAL_ADDRESS 0 +#define SK_ADDR_VIRTUAL_ADDRESS (SK_ADDR_LOGICAL_ADDRESS) /* old */ #define SK_ADDR_PHYSICAL_ADDRESS 1 +#define SK_ADDR_CLEAR_LOGICAL 2 +#define SK_ADDR_SET_LOGICAL 4 /* ----- Override return values ----- */ @@ -155,7 +171,7 @@ /* ----- Partitioning of excact match table ----- */ -#define SK_ADDR_EXACT_MATCHES 16 /* #Exact match entries. */ +#define SK_ADDR_EXACT_MATCHES 16 /* #Exact match entries. */ #define SK_ADDR_FIRST_MATCH_RLMT 1 #define SK_ADDR_LAST_MATCH_RLMT 2 @@ -164,39 +180,43 @@ /* ----- SkAddrMcAdd/SkAddrMcUpdate return values ----- */ -#define SK_MC_FILTERING_EXACT 0 /* Exact filtering. */ -#define SK_MC_FILTERING_INEXACT 1 /* Inexact filtering. */ +#define SK_MC_FILTERING_EXACT 0 /* Exact filtering. */ +#define SK_MC_FILTERING_INEXACT 1 /* Inexact filtering. */ /* ----- Additional SkAddrMcAdd return values ----- */ -#define SK_MC_ILLEGAL_ADDRESS 2 /* Illegal address. */ -#define SK_MC_ILLEGAL_PORT 3 /* Illegal port (not the active one). */ -#define SK_MC_RLMT_OVERFLOW 4 /* Too many RLMT mc addresses. */ +#define SK_MC_ILLEGAL_ADDRESS 2 /* Illegal address. */ +#define SK_MC_ILLEGAL_PORT 3 /* Illegal port (not the active one). */ +#define SK_MC_RLMT_OVERFLOW 4 /* Too many RLMT mc addresses. */ /* Promiscuous mode bits ----- */ -#define SK_PROM_MODE_NONE 0 /* Normal receive. */ -#define SK_PROM_MODE_LLC 1 /* Receive all LLC frames. */ -#define SK_PROM_MODE_ALL_MC 2 /* Receive all multicast frames. */ -/* #define SK_PROM_MODE_NON_LLC 4 */ /* Receive all non-LLC frames. */ +#define SK_PROM_MODE_NONE 0 /* Normal receive. */ +#define SK_PROM_MODE_LLC 1 /* Receive all LLC frames. */ +#define SK_PROM_MODE_ALL_MC 2 /* Receive all multicast frames. */ +/* #define SK_PROM_MODE_NON_LLC 4 */ /* Receive all non-LLC frames. */ /* Macros */ #ifndef SK_ADDR_EQUAL +/* + * "&" instead of "&&" allows better optimization on IA-64. + * The replacement is safe here, as all bytes exist. + */ #ifndef SK_ADDR_DWORD_COMPARE #define SK_ADDR_EQUAL(A1,A2) ( \ - ((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5] && \ - ((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4] && \ - ((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3] && \ - ((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2] && \ - ((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1] && \ - ((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0]) + (((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5]) & \ + (((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4]) & \ + (((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3]) & \ + (((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2]) & \ + (((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1]) & \ + (((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0])) #else /* SK_ADDR_DWORD_COMPARE */ #define SK_ADDR_EQUAL(A1,A2) ( \ - *(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2]) && \ - *(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0])) + (*(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2])) & \ + (*(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0]))) #endif /* SK_ADDR_DWORD_COMPARE */ -#endif /* SK_ADDR_EQUAL */ +#endif /* SK_ADDR_EQUAL */ /* typedefs *******************************************************************/ @@ -204,104 +224,120 @@ SK_U8 a[SK_MAC_ADDR_LEN]; } SK_MAC_ADDR; + /* SK_FILTER is used to ensure alignment of the filter. */ typedef union s_InexactFilter { SK_U8 Bytes[8]; - SK_U64 Val; /* Dummy entry for alignment only. */ + SK_U64 Val; /* Dummy entry for alignment only. */ } SK_FILTER64; + +typedef struct s_AddrNet SK_ADDR_NET; + + typedef struct s_AddrPort { /* ----- Public part (read-only) ----- */ - SK_MAC_ADDR PermanentMacAddress; /* Physical MAC Address. */ - SK_MAC_ADDR CurrentMacAddress; /* Physical MAC Address. */ - int PromMode; /* Promiscuous Mode. */ + SK_MAC_ADDR CurrentMacAddress; /* Current physical MAC Address. */ + SK_MAC_ADDR PermanentMacAddress; /* Permanent physical MAC Address. */ + int PromMode; /* Promiscuous Mode. */ /* ----- Private part ----- */ + SK_MAC_ADDR PreviousMacAddress; /* Prev. phys. MAC Address. */ SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */ - SK_MAC_ADDR PreviousMacAddress; /* Prev. phys. MAC Address. */ + SK_U8 Align01; + SK_U32 FirstExactMatchRlmt; SK_U32 NextExactMatchRlmt; SK_U32 FirstExactMatchDrv; SK_U32 NextExactMatchDrv; SK_MAC_ADDR Exact[SK_ADDR_EXACT_MATCHES]; - SK_FILTER64 InexactFilter; /* For 64-bit hash register. */ + SK_FILTER64 InexactFilter; /* For 64-bit hash register. */ } SK_ADDR_PORT; + +struct s_AddrNet { +/* ----- Public part (read-only) ----- */ + + SK_MAC_ADDR CurrentMacAddress; /* Logical MAC Address. */ + SK_MAC_ADDR PermanentMacAddress; /* Logical MAC Address. */ + +/* ----- Private part ----- */ + + SK_U32 ActivePort; /* View of module ADDR. */ + SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */ + SK_U8 Align01; + SK_U16 Align02; +}; + + typedef struct s_Addr { /* ----- Public part (read-only) ----- */ + SK_ADDR_NET Net[SK_MAX_NETS]; SK_ADDR_PORT Port[SK_MAX_MACS]; - SK_MAC_ADDR PermanentMacAddress; /* Logical MAC Address. */ - SK_MAC_ADDR CurrentMacAddress; /* Logical MAC Address. */ /* ----- Private part ----- */ - -#if 0 - SK_BOOL Initialized; /* Flag: Addr module is initialized. */ -#endif /* 0 */ - SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */ - SK_U32 ActivePort; /* Vie of module ADDR. */ } SK_ADDR; /* function prototypes ********************************************************/ #ifndef SK_KR_PROTO -/* Functions provided by SkRlmt */ +/* Functions provided by SkAddr */ /* ANSI/C++ compliant function prototypes */ extern int SkAddrInit( SK_AC *pAC, SK_IOC IoC, - int Level); + int Level); extern int SkAddrMcClear( SK_AC *pAC, SK_IOC IoC, - SK_U32 PortIdx, - int Flags); + SK_U32 PortNumber, + int Flags); extern int SkAddrMcAdd( SK_AC *pAC, SK_IOC IoC, - SK_U32 PortIdx, + SK_U32 PortNumber, SK_MAC_ADDR *pMc, - int Flags); + int Flags); extern int SkAddrMcUpdate( SK_AC *pAC, SK_IOC IoC, - SK_U32 PortIdx); + SK_U32 PortNumber); extern int SkAddrOverride( SK_AC *pAC, SK_IOC IoC, - SK_U32 PortIdx, + SK_U32 PortNumber, SK_MAC_ADDR *pNewAddr, - int Flags); + int Flags); extern int SkAddrPromiscuousChange( SK_AC *pAC, SK_IOC IoC, - SK_U32 PortIdx, - int NewPromMode); + SK_U32 PortNumber, + int NewPromMode); extern int SkAddrSwap( SK_AC *pAC, SK_IOC IoC, - SK_U32 FromPortIdx, - SK_U32 ToPortIdx); + SK_U32 FromPortNumber, + SK_U32 ToPortNumber); #else /* defined(SK_KR_PROTO)) */ /* Non-ANSI/C++ compliant function prototypes */ -xxxx /* not supported yet - force error */ +#error KR-style prototypes are not yet provided. #endif /* defined(SK_KR_PROTO)) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skcsum.h linux.20p9/drivers/net/sk98lin/h/skcsum.h --- linux.vanilla/drivers/net/sk98lin/h/skcsum.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skcsum.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skcsum.h * Project: GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx) - * Version: $Revision: 1.5 $ - * Date: $Date: 2000/02/21 12:10:05 $ + * Version: $Revision: 1.9 $ + * Date: $Date: 2001/02/06 11:21:39 $ * Purpose: Store/verify Internet checksum in send/receive packets. * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,19 @@ * History: * * $Log: skcsum.h,v $ + * Revision 1.9 2001/02/06 11:21:39 rassmann + * Editorial changes. + * + * Revision 1.8 2001/02/06 11:15:36 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.7 2000/06/29 13:17:05 rassmann + * Corrected reception of a packet with UDP checksum == 0 (which means there + * is no UDP checksum). + * + * Revision 1.6 2000/02/28 12:33:44 cgoos + * Changed C++ style comments to C style. + * * Revision 1.5 2000/02/21 12:10:05 cgoos * Fixed license comment. * @@ -110,27 +122,32 @@ * * SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame. * SKCS_STATUS_IP_CSUM_ERROR - IP checksum error. + * SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame. + * SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame * SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok). * SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame). * SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok). * SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok). * SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok. * SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok. + * SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum. */ #ifndef SKCS_OVERWRITE_STATUS /* User overwrite? */ #define SKCS_STATUS int /* Define status type. */ #define SKCS_STATUS_UNKNOWN_IP_VERSION 1 -#define SKCS_STATUS_IP_CSUM_ERROR 2 -#define SKCS_STATUS_IP_FRAGMENT 3 -#define SKCS_STATUS_IP_CSUM_OK 4 -#define SKCS_STATUS_TCP_CSUM_ERROR 5 -#define SKCS_STATUS_UDP_CSUM_ERROR 6 -#define SKCS_STATUS_TCP_CSUM_OK 7 -#define SKCS_STATUS_UDP_CSUM_OK 8 -// needed for Microsoft +#define SKCS_STATUS_IP_CSUM_ERROR 2 +#define SKCS_STATUS_IP_FRAGMENT 3 +#define SKCS_STATUS_IP_CSUM_OK 4 +#define SKCS_STATUS_TCP_CSUM_ERROR 5 +#define SKCS_STATUS_UDP_CSUM_ERROR 6 +#define SKCS_STATUS_TCP_CSUM_OK 7 +#define SKCS_STATUS_UDP_CSUM_OK 8 +/* needed for Microsoft */ #define SKCS_STATUS_IP_CSUM_ERROR_UDP 9 #define SKCS_STATUS_IP_CSUM_ERROR_TCP 10 +/* UDP checksum may be omitted */ +#define SKCS_STATUS_IP_CSUM_OK_NO_UDP 11 #endif /* !SKCS_OVERWRITE_STATUS */ /* Clear protocol statistics event. */ @@ -181,13 +198,13 @@ */ typedef struct s_Csum { /* Enabled receive SK_PROTO_XXX bit flags. */ - unsigned ReceiveFlags; + unsigned ReceiveFlags[SK_MAX_NETS]; #ifdef TX_CSUM - unsigned TransmitFlags; -#endif // TX_CSUM + unsigned TransmitFlags[SK_MAX_NETS]; +#endif /* TX_CSUM */ /* The protocol statistics structure; one per supported protocol. */ - SKCS_PROTO_STATS ProtoStats[SKCS_NUM_PROTOCOLS]; + SKCS_PROTO_STATS ProtoStats[SK_MAX_NETS][SKCS_NUM_PROTOCOLS]; } SK_CSUM; /* @@ -225,17 +242,20 @@ SK_AC *pAc, void *pIpHeader, unsigned Checksum1, - unsigned Checksum2); + unsigned Checksum2, + int NetNumber); extern void SkCsGetSendInfo( - SK_AC *pAc, - void *pIpHeader, - SKCS_PACKET_INFO *pPacketInfo); + SK_AC *pAc, + void *pIpHeader, + SKCS_PACKET_INFO *pPacketInfo, + int NetNumber); extern void SkCsSetReceiveFlags( SK_AC *pAc, unsigned ReceiveFlags, unsigned *pChecksum1Offset, - unsigned *pChecksum2Offset); + unsigned *pChecksum2Offset, + int NetNumber); #endif /* __INC_SKCSUM_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skdrv1st.h linux.20p9/drivers/net/sk98lin/h/skdrv1st.h --- linux.vanilla/drivers/net/sk98lin/h/skdrv1st.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skdrv1st.h Wed Jul 4 16:03:55 2001 @@ -2,8 +2,8 @@ * * Name: skdrv1st.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.8 $ - * Date: $Date: 2000/02/21 12:19:18 $ + * Version: $Revision: 1.9 $ + * Date: $Date: 2001/01/22 14:16:04 $ * Purpose: First header file for driver and all other modules * ******************************************************************************/ @@ -27,6 +27,11 @@ * History: * * $Log: skdrv1st.h,v $ + * Revision 1.9 2001/01/22 14:16:04 mlindner + * added ProcFs functionality + * Dual Net functionality integrated + * Rlmt networks added + * * Revision 1.8 2000/02/21 12:19:18 cgoos * Added default for SK_DEBUG_CHKMOD/_CHKCAT * @@ -140,6 +145,7 @@ // #define SK_RLMT_SLOW_LOOKAHEAD #define SK_MAX_MACS 2 +#define SK_MAX_NETS 2 #define SK_IOC char* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skdrv2nd.h linux.20p9/drivers/net/sk98lin/h/skdrv2nd.h --- linux.vanilla/drivers/net/sk98lin/h/skdrv2nd.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skdrv2nd.h Wed Jul 4 16:03:55 2001 @@ -2,8 +2,8 @@ * * Name: skdrv2nd.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.9 $ - * Date: $Date: 2000/02/21 10:39:55 $ + * Version: $Revision: 1.12 $ + * Date: $Date: 2001/03/01 12:52:15 $ * Purpose: Second header file for driver and all other modules * ******************************************************************************/ @@ -27,6 +27,22 @@ * History: * * $Log: skdrv2nd.h,v $ + * Revision 1.12 2001/03/01 12:52:15 mlindner + * Fixed ring size + * + * Revision 1.11 2001/02/19 13:28:02 mlindner + * Changed PNMI parameter values + * + * Revision 1.10 2001/01/22 14:16:04 mlindner + * added ProcFs functionality + * Dual Net functionality integrated + * Rlmt networks added + * + * Revision 1.1 2000/10/05 19:46:50 phargrov + * Add directory src/vipk_devs_nonlbl/vipk_sk98lin/ + * This is the SysKonnect SK-98xx Gigabit Ethernet driver, + * contributed by SysKonnect. + * * Revision 1.9 2000/02/21 10:39:55 cgoos * Added flag for jumbo support usage. * @@ -139,7 +155,7 @@ */ #define TX_RING_SIZE (8*1024) -#define RX_RING_SIZE (24*1024) +#define RX_RING_SIZE (TX_RING_SIZE*3) /* * Buffer size for ethernet packets @@ -167,6 +183,12 @@ #define SK_DRIVER_RESET(pAC, IoC) 0 #define SK_DRIVER_SENDEVENT(pAC, IoC) 0 #define SK_DRIVER_SELFTEST(pAC, IoC) 0 +/* For get mtu you must add an own function */ +#define SK_DRIVER_GET_MTU(pAc,IoC,i) 0 +#define SK_DRIVER_SET_MTU(pAc,IoC,i,v) 0 +#define SK_DRIVER_PRESET_MTU(pAc,IoC,i,v) 0 + + /* TX and RX descriptors *****************************************************/ @@ -366,6 +388,20 @@ int PortIndex; /* index number of port (0 or 1) */ }; + +typedef struct s_DevNet DEV_NET; + +struct s_DevNet { + int PortNr; + int NetNr; + int Mtu; + int Up; + SK_AC *pAC; +}; + + + + typedef struct s_RxPort RX_PORT; struct s_RxPort { @@ -382,6 +418,7 @@ int PortIndex; /* index number of port (0 or 1) */ }; + typedef struct s_PerStrm PER_STRM; #define SK_ALLOC_IRQ 0x00000001 @@ -404,7 +441,8 @@ SK_RLMT Rlmt; /* for rlmt module */ spinlock_t SlowPathLock; /* Normal IRQ lock */ SK_PNMI_STRUCT_DATA PnmiStruct; /* structure to get all Pnmi-Data */ - int RlmtMode; /* link check mode to set */ + int RlmtMode; /* link check mode to set */ + int RlmtNets; /* Number of nets */ SK_IOC IoBase; /* register set of adapter */ int BoardLevel; /* level of active hw init (0-2) */ @@ -412,11 +450,11 @@ SK_U32 AllocFlag; /* flag allocation of resources */ struct pci_dev PciDev; /* for access to pci config space */ SK_U32 PciDevId; /* pci device id */ - struct device *dev; /* pointer to device struct */ + struct device *dev[2]; /* pointer to device struct */ char Name[30]; /* driver name */ struct device *Next; /* link all devices (for clearing) */ int RxBufSize; /* length of receive buffers */ - struct net_device_stats stats; /* linux 'netstat -i' statistics */ + struct net_device_stats stats; /* linux 'netstat -i' statistics */ int Index; /* internal board index number */ SK_BOOL JumboActivated; /* jumbo support ever activated */ @@ -428,10 +466,11 @@ int PromiscCount; /* promiscuous mode counter */ int AllMultiCount; /* allmulticast mode counter */ int MulticCount; /* number of different MC */ - /* addresses for this board */ - /* (may be more than HW can)*/ + /* addresses for this board */ + /* (may be more than HW can)*/ - int ActivePort; /* the active XMAC port */ + int ActivePort; /* the active XMAC port */ + int MaxPorts; /* number of activated ports */ int TxDescrPerRing; /* # of descriptors per tx ring */ int RxDescrPerRing; /* # of descriptors per rx ring */ @@ -448,6 +487,5 @@ SK_BOOL CheckQueue; /* check event queue soon */ }; - #endif /* __INC_SKDRV2ND_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skgehw.h linux.20p9/drivers/net/sk98lin/h/skgehw.h --- linux.vanilla/drivers/net/sk98lin/h/skgehw.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skgehw.h Wed Jul 4 16:03:55 2001 @@ -2,8 +2,8 @@ * * Name: skgehw.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.34 $ - * Date: $Date: 1999/11/22 13:53:40 $ + * Version: $Revision: 1.36 $ + * Date: $Date: 2000/11/09 12:32:49 $ * Purpose: Defines and Macros for the Gigabit Ethernet Adapter Product * Family * @@ -11,8 +11,7 @@ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2000 SysKonnect GmbH. * * 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 @@ -27,6 +26,12 @@ * * History: * $Log: skgehw.h,v $ + * Revision 1.36 2000/11/09 12:32:49 rassmann + * Renamed variables. + * + * Revision 1.35 2000/05/19 10:17:13 cgoos + * Added inactivity check in PHY_READ (in DEBUG mode only). + * * Revision 1.34 1999/11/22 13:53:40 cgoos * Changed license header to GPL. * @@ -177,27 +182,27 @@ */ #define PCI_VENDOR_ID 0x00 /* 16 bit Vendor ID */ #define PCI_DEVICE_ID 0x02 /* 16 bit Device ID */ -#define PCI_COMMAND 0x04 /* 16 bit Command */ -#define PCI_STATUS 0x06 /* 16 bit Status */ -#define PCI_REV_ID 0x08 /* 8 bit Revision ID */ +#define PCI_COMMAND 0x04 /* 16 bit Command */ +#define PCI_STATUS 0x06 /* 16 bit Status */ +#define PCI_REV_ID 0x08 /* 8 bit Revision ID */ #define PCI_CLASS_CODE 0x09 /* 24 bit Class Code */ #define PCI_CACHE_LSZ 0x0c /* 8 bit Cache Line Size */ -#define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */ +#define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */ #define PCI_HEADER_T 0x0e /* 8 bit Header Type */ -#define PCI_BIST 0x0f /* 8 bit Built-in selftest */ +#define PCI_BIST 0x0f /* 8 bit Built-in selftest */ #define PCI_BASE_1ST 0x10 /* 32 bit 1st Base address */ #define PCI_BASE_2ND 0x14 /* 32 bit 2nd Base address */ /* Byte 18..2b: reserved */ -#define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */ -#define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */ +#define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */ +#define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */ #define PCI_BASE_ROM 0x30 /* 32 bit Expansion ROM Base Address */ /* Byte 34..33: reserved */ -#define PCI_CAP_PTR 0x34 /* 8 bit Capabilities Ptr */ +#define PCI_CAP_PTR 0x34 /* 8 bit Capabilities Ptr */ /* Byte 35..3b: reserved */ #define PCI_IRQ_LINE 0x3c /* 8 bit Interrupt Line */ -#define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */ -#define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */ -#define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */ +#define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */ +#define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */ +#define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */ /* Device Dependent Region */ #define PCI_OUR_REG_1 0x40 /* 32 bit Our Register 1 */ #define PCI_OUR_REG_2 0x44 /* 32 bit Our Register 2 */ @@ -230,34 +235,34 @@ /* PCI_DEVICE_ID 16 bit Device ID */ /* Values for Vendor ID and Device ID shall be patched into the code */ /* PCI_COMMAND 16 bit Command */ - /* Bit 15..10: reserved */ -#define PCI_FBTEN (1<<9) /* Bit 9: Fast Back-To-Back enable */ -#define PCI_SERREN (1<<8) /* Bit 8: SERR enable */ -#define PCI_ADSTEP (1<<7) /* Bit 7: Address Stepping */ -#define PCI_PERREN (1<<6) /* Bit 6: Parity Report Response enable */ + /* Bit 15..10: reserved */ +#define PCI_FBTEN (1<<9) /* Bit 9: Fast Back-To-Back enable */ +#define PCI_SERREN (1<<8) /* Bit 8: SERR enable */ +#define PCI_ADSTEP (1<<7) /* Bit 7: Address Stepping */ +#define PCI_PERREN (1<<6) /* Bit 6: Parity Report Response enable */ #define PCI_VGA_SNOOP (1<<5) /* Bit 5: VGA palette snoop */ -#define PCI_MWIEN (1<<4) /* Bit 4: Memory write an inv cycl ena */ -#define PCI_SCYCEN (1<<3) /* Bit 3: Special Cycle enable */ -#define PCI_BMEN (1<<2) /* Bit 2: Bus Master enable */ -#define PCI_MEMEN (1<<1) /* Bit 1: Memory Space Access enable */ -#define PCI_IOEN (1<<0) /* Bit 0: IO Space Access enable */ +#define PCI_MWIEN (1<<4) /* Bit 4: Memory write an inv cycl ena */ +#define PCI_SCYCEN (1<<3) /* Bit 3: Special Cycle enable */ +#define PCI_BMEN (1<<2) /* Bit 2: Bus Master enable */ +#define PCI_MEMEN (1<<1) /* Bit 1: Memory Space Access enable */ +#define PCI_IOEN (1<<0) /* Bit 0: IO Space Access enable */ /* PCI_STATUS 16 bit Status */ -#define PCI_PERR (1<<15) /* Bit 15: Parity Error */ -#define PCI_SERR (1<<14) /* Bit 14: Signaled SERR */ -#define PCI_RMABORT (1<<13) /* Bit 13: Received Master Abort */ -#define PCI_RTABORT (1<<12) /* Bit 12: Received Target Abort */ - /* Bit 11: reserved */ -#define PCI_DEVSEL (3<<9) /* Bit 10..9: DEVSEL Timing */ +#define PCI_PERR (1<<15) /* Bit 15: Parity Error */ +#define PCI_SERR (1<<14) /* Bit 14: Signaled SERR */ +#define PCI_RMABORT (1<<13) /* Bit 13: Received Master Abort */ +#define PCI_RTABORT (1<<12) /* Bit 12: Received Target Abort */ + /* Bit 11: reserved */ +#define PCI_DEVSEL (3<<9) /* Bit 10..9: DEVSEL Timing */ #define PCI_DEV_FAST (0<<9) /* fast */ #define PCI_DEV_MEDIUM (1<<9) /* medium */ #define PCI_DEV_SLOW (2<<9) /* slow */ #define PCI_DATAPERR (1<<8) /* Bit 8: DATA Parity error detected */ -#define PCI_FB2BCAP (1<<7) /* Bit 7: Fast Back-to-Back Capability */ -#define PCI_UDF (1<<6) /* Bit 6: User Defined Features */ +#define PCI_FB2BCAP (1<<7) /* Bit 7: Fast Back-to-Back Capability */ +#define PCI_UDF (1<<6) /* Bit 6: User Defined Features */ #define PCI_66MHZCAP (1<<5) /* Bit 5: 66 MHz PCI bus clock capable */ -#define PCI_NEWCAP (1<<4) /* Bit 4: New cap. list implemented */ - /* Bit 3..0: reserved */ +#define PCI_NEWCAP (1<<4) /* Bit 4: New cap. list implemented */ + /* Bit 3..0: reserved */ #define PCI_ERRBITS (PCI_PERR | PCI_SERR | PCI_RMABORT | PCI_RTABORT |\ PCI_DATAPERR) @@ -272,59 +277,59 @@ /* PCI_HEADER_T 8 bit Header Type */ #define PCI_HD_MF_DEV (1<<7) /* Bit 7: 0= single, 1= multi-func dev */ -#define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal */ +#define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal */ /* PCI_BIST 8 bit Built-in selftest */ /* Built-in Self test not supported (optional) */ /* PCI_BASE_1ST 32 bit 1st Base address */ -#define PCI_MEMSIZE 0x4000L /* use 16 kB Memory Base */ +#define PCI_MEMSIZE 0x4000L /* use 16 kB Memory Base */ #define PCI_MEMBASE_MSK 0xffffc000L /* Bit 31..14: Memory Base Address */ #define PCI_MEMSIZE_MSK 0x00003ff0L /* Bit 13.. 4: Memory Size Req. */ -#define PCI_PREFEN (1L<<3) /* Bit 3: Prefetchable */ -#define PCI_MEM_TYP (3L<<2) /* Bit 2.. 1: Memory Type */ +#define PCI_PREFEN (1L<<3) /* Bit 3: Prefetchable */ +#define PCI_MEM_TYP (3L<<2) /* Bit 2.. 1: Memory Type */ #define PCI_MEM32BIT (0L<<1) /* Base addr anywhere in 32 Bit range */ -#define PCI_MEM1M (1L<<1) /* Base addr below 1 MegaByte */ +#define PCI_MEM1M (1L<<1) /* Base addr below 1 MegaByte */ #define PCI_MEM64BIT (2L<<1) /* Base addr anywhere in 64 Bit range */ #define PCI_MEMSPACE (1L<<0) /* Bit 0: Memory Space Indic. */ /* PCI_BASE_2ND 32 bit 2nd Base address */ -#define PCI_IOBASE 0xffffff00L /* Bit 31..8: I/O Base address */ -#define PCI_IOSIZE 0x000000fcL /* Bit 7..2: I/O Size Requirements */ - /* Bit 1: reserved */ -#define PCI_IOSPACE (1L<<0) /* Bit 0: I/O Space Indicator */ +#define PCI_IOBASE 0xffffff00L /* Bit 31..8: I/O Base address */ +#define PCI_IOSIZE 0x000000fcL /* Bit 7..2: I/O Size Requirements */ + /* Bit 1: reserved */ +#define PCI_IOSPACE (1L<<0) /* Bit 0: I/O Space Indicator */ /* PCI_BASE_ROM 32 bit Expansion ROM Base Address */ -#define PCI_ROMBASE (0xfffeL<<17) /* Bit 31..17: ROM BASE address (1st)*/ -#define PCI_ROMBASZ (0x1cL<<14) /* Bit 16..14: Treat as BASE or SIZE */ -#define PCI_ROMSIZE (0x38L<<11) /* Bit 13..11: ROM Size Requirements */ - /* Bit 10.. 1: reserved */ -#define PCI_ROMEN (0x1L<<0) /* Bit 0: Address Decode enable */ +#define PCI_ROMBASE (0xfffeL<<17) /* Bit 31..17: ROM BASE address (1st)*/ +#define PCI_ROMBASZ (0x1cL<<14) /* Bit 16..14: Treat as BASE or SIZE */ +#define PCI_ROMSIZE (0x38L<<11) /* Bit 13..11: ROM Size Requirements */ + /* Bit 10.. 1: reserved */ +#define PCI_ROMEN (0x1L<<0) /* Bit 0: Address Decode enable */ /* Device Dependent Region */ /* PCI_OUR_REG_1 32 bit Our Register 1 */ - /* Bit 31..26: reserved */ -#define PCI_VIO (1L<<25) /* Bit 25: PCI IO Voltage, */ - /* 0 = 3.3V / 1 = 5V */ -#define PCI_EN_BOOT (1L<<24) /* Bit 24: Enable BOOT via ROM */ - /* 1 = Don't boot wth ROM*/ - /* 0 = Boot with ROM */ -#define PCI_EN_IO (1L<<23) /* Bit 23: Mapping to IO space */ + /* Bit 31..26: reserved */ +#define PCI_VIO (1L<<25) /* Bit 25: PCI IO Voltage, */ + /* 0 = 3.3V / 1 = 5V */ +#define PCI_EN_BOOT (1L<<24) /* Bit 24: Enable BOOT via ROM */ + /* 1 = Don't boot wth ROM*/ + /* 0 = Boot with ROM */ +#define PCI_EN_IO (1L<<23) /* Bit 23: Mapping to IO space */ #define PCI_EN_FPROM (1L<<22) /* Bit 22: FLASH mapped to mem? */ - /* 1 = Map Flash to Mem */ - /* 0 = Disable addr. dec*/ + /* 1 = Map Flash to Mem */ + /* 0 = Disable addr. dec*/ #define PCI_PAGESIZE (3L<<20) /* Bit 21..20: FLASH Page Size */ -#define PCI_PAGE_16 (0L<<20) /* 16 k pages */ +#define PCI_PAGE_16 (0L<<20) /* 16 k pages */ #define PCI_PAGE_32K (1L<<20) /* 32 k pages */ #define PCI_PAGE_64K (2L<<20) /* 64 k pages */ #define PCI_PAGE_128K (3L<<20) /* 128 k pages */ - /* Bit 19: reserved */ -#define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */ -#define PCI_NOTAR (1L<<15) /* Bit 15: No turnaround cycle */ + /* Bit 19: reserved */ +#define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */ +#define PCI_NOTAR (1L<<15) /* Bit 15: No turnaround cycle */ #define PCI_FORCE_BE (1L<<14) /* Bit 14: Assert all BEs on MR */ -#define PCI_DIS_MRL (1L<<13) /* Bit 13: Disable Mem R Line */ -#define PCI_DIS_MRM (1L<<12) /* Bit 12: Disable Mem R multip */ -#define PCI_DIS_MWI (1L<<11) /* Bit 11: Disable Mem W & inv */ +#define PCI_DIS_MRL (1L<<13) /* Bit 13: Disable Mem R Line */ +#define PCI_DIS_MRM (1L<<12) /* Bit 12: Disable Mem R multip */ +#define PCI_DIS_MWI (1L<<11) /* Bit 11: Disable Mem W & inv */ #define PCI_DISC_CLS (1L<<10) /* Bit 10: Disc: cacheLsz bound */ #define PCI_BURST_DIS (1L<<9) /* Bit 9: Burst Disable */ #define PCI_DIS_PCI_CLK (1L<<8) /* Bit 8: Disable PCI clock driv*/ @@ -334,9 +339,9 @@ /* PCI_OUR_REG_2 32 bit Our Register 2 */ #define PCI_VPD_WR_THR (0xffL<<24) /* Bit 31..24: VPD Write Threshold */ -#define PCI_DEV_SEL (0x7fL<<17) /* Bit 23..17: EEPROM Device Select */ +#define PCI_DEV_SEL (0x7fL<<17) /* Bit 23..17: EEPROM Device Select */ #define PCI_VPD_ROM_SZ (7L<<14) /* Bit 16..14: VPD ROM Size */ - /* Bit 13..12: reserved */ + /* Bit 13..12: reserved */ #define PCI_PATCH_DIR (0xfL<<8) /* Bit 11.. 8: Ext Patchs dir 3..0 */ #define PCI_PATCH_DIR_0 (1L<<8) #define PCI_PATCH_DIR_1 (1L<<9) @@ -349,27 +354,27 @@ #define PCI_EXT_PATCH_3 (1L<<7) #define PCI_EN_DUMMY_RD (1L<<3) /* Bit 3: Enable Dummy Read */ #define PCI_REV_DESC (1L<<2) /* Bit 2: Reverse Desc. Bytes */ - /* Bit 1: reserved */ + /* Bit 1: reserved */ #define PCI_USEDATA64 (1L<<0) /* Bit 0: Use 64Bit Data bus ext*/ /* Power Management Region */ /* PCI_PM_CAP_REG 16 bit Power Management Capabilities */ -#define PCI_PME_SUP (0x1f<<11) /* Bit 15..11: PM Manag. Event Sup */ +#define PCI_PME_SUP (0x1f<<11) /* Bit 15..11: PM Manag. Event Sup */ #define PCI_PM_D2_SUB (1<<10) /* Bit 10: D2 Support Bit */ #define PCI_PM_D1_SUB (1<<9) /* Bit 9: D1 Support Bit */ - /* Bit 8..6: reserved */ -#define PCI_PM_DSI (1<<5) /* Bit 5: Device Specific Init.*/ -#define PCI_PM_APS (1<<4) /* Bit 4: Auxialiary Power Src */ + /* Bit 8..6: reserved */ +#define PCI_PM_DSI (1<<5) /* Bit 5: Device Specific Init.*/ +#define PCI_PM_APS (1<<4) /* Bit 4: Auxialiary Power Src */ #define PCI_PME_CLOCK (1<<3) /* Bit 3: PM Event Clock */ -#define PCI_PM_VER (7<<0) /* Bit 2..0: PM PCI Spec. version */ +#define PCI_PM_VER (7<<0) /* Bit 2..0: PM PCI Spec. version */ /* PCI_PM_CTL_STS 16 bit Power Manag. Control/Status */ #define PCI_PME_STATUS (1<<15) /* Bit 15: PGA doesn't sup. PME# */ #define PCI_PM_DAT_SCL (3<<13) /* Bit 14..13: dat reg Scaling factor*/ #define PCI_PM_DAT_SEL (0xf<<9) /* Bit 12.. 9: PM data selector field*/ -#define PCI_PME_EN (1<<8) /* Bit 8: PGA doesn't sup. PME# */ - /* Bit 7.. 2: reserved */ +#define PCI_PME_EN (1<<8) /* Bit 8: PGA doesn't sup. PME# */ + /* Bit 7.. 2: reserved */ #define PCI_PM_STATE (3<<0) /* Bit 1.. 0: Power Management State*/ #define PCI_PM_STATE_D0 (0<<0) /* D0: Operational (default) */ #define PCI_PM_STATE_D1 (1<<0) /* D1: not supported */ @@ -385,22 +390,22 @@ * Control Register File: * Bank 0 */ -#define B0_RAP 0x0000 /* 8 bit Register Address Port */ +#define B0_RAP 0x0000 /* 8 bit Register Address Port */ /* 0x0001 - 0x0003: reserved */ -#define B0_CTST 0x0004 /* 16 bit Control/Status register */ -#define B0_LED 0x0006 /* 8 Bit LED register */ +#define B0_CTST 0x0004 /* 16 bit Control/Status register */ +#define B0_LED 0x0006 /* 8 Bit LED register */ /* 0x0007: reserved */ -#define B0_ISRC 0x0008 /* 32 bit Interrupt Source Register */ -#define B0_IMSK 0x000c /* 32 bit Interrupt Mask Register */ -#define B0_HWE_ISRC 0x0010 /* 32 bit HW Error Interrupt Src Reg */ -#define B0_HWE_IMSK 0x0014 /* 32 bit HW Error Interrupt Mask Reg */ -#define B0_SP_ISRC 0x0018 /* 32 bit Special Interrupt Source Reg */ +#define B0_ISRC 0x0008 /* 32 bit Interrupt Source Register */ +#define B0_IMSK 0x000c /* 32 bit Interrupt Mask Register */ +#define B0_HWE_ISRC 0x0010 /* 32 bit HW Error Interrupt Src Reg */ +#define B0_HWE_IMSK 0x0014 /* 32 bit HW Error Interrupt Mask Reg */ +#define B0_SP_ISRC 0x0018 /* 32 bit Special Interrupt Source Reg */ /* 0x001c: reserved */ /* B0 XMAC 1 registers */ -#define B0_XM1_IMSK 0x0020 /* 16 bit r/w XMAC 1 Interrupt Mask Register*/ +#define B0_XM1_IMSK 0x0020 /* 16 bit r/w XMAC 1 Interrupt Mask Register*/ /* 0x0022 - 0x0027 reserved */ -#define B0_XM1_ISRC 0x0028 /* 16 bit ro XMAC 1 Interrupt Status Reg */ +#define B0_XM1_ISRC 0x0028 /* 16 bit ro XMAC 1 Interrupt Status Reg */ /* 0x002a - 0x002f reserved */ #define B0_XM1_PHY_ADDR 0x0030 /* 16 bit r/w XMAC 1 PHY Address Register */ /* 0x0032 - 0x0033 reserved */ @@ -408,9 +413,9 @@ /* 0x0036 - 0x003f reserved */ /* B0 XMAC 2 registers */ -#define B0_XM2_IMSK 0x0040 /* 16 bit r/w XMAC 2 Interrupt Mask Register*/ +#define B0_XM2_IMSK 0x0040 /* 16 bit r/w XMAC 2 Interrupt Mask Register*/ /* 0x0042 - 0x0047 reserved */ -#define B0_XM2_ISRC 0x0048 /* 16 bit ro XMAC 2 Interrupt Status Reg */ +#define B0_XM2_ISRC 0x0048 /* 16 bit ro XMAC 2 Interrupt Status Reg */ /* 0x004a - 0x004f reserved */ #define B0_XM2_PHY_ADDR 0x0050 /* 16 bit r/w XMAC 2 PHY Address Register */ /* 0x0052 - 0x0053 reserved */ @@ -418,12 +423,12 @@ /* 0x0056 - 0x005f reserved */ /* BMU Control Status Registers */ -#define B0_R1_CSR 0x0060 /* 32 bit BMU Ctrl/Stat Rx Queue 1 */ -#define B0_R2_CSR 0x0064 /* 32 bit BMU Ctrl/Stat Rx Queue 2 */ -#define B0_XS1_CSR 0x0068 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ -#define B0_XA1_CSR 0x006c /* 32 bit BMU Ctrl/Stat Async Tx Queue 1*/ -#define B0_XS2_CSR 0x0070 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ -#define B0_XA2_CSR 0x0074 /* 32 bit BMU Ctrl/Stat Async Tx Queue 2*/ +#define B0_R1_CSR 0x0060 /* 32 bit BMU Ctrl/Stat Rx Queue 1 */ +#define B0_R2_CSR 0x0064 /* 32 bit BMU Ctrl/Stat Rx Queue 2 */ +#define B0_XS1_CSR 0x0068 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ +#define B0_XA1_CSR 0x006c /* 32 bit BMU Ctrl/Stat Async Tx Queue 1*/ +#define B0_XS2_CSR 0x0070 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ +#define B0_XA2_CSR 0x0074 /* 32 bit BMU Ctrl/Stat Async Tx Queue 2*/ /* x0078 - 0x007f reserved */ /* @@ -437,34 +442,34 @@ */ /* NA reg = 48 bit Network Address Register, 3x16 or 8x8 bit readable */ -#define B2_MAC_1 0x0100 /* NA reg MAC Address 1 */ +#define B2_MAC_1 0x0100 /* NA reg MAC Address 1 */ /* 0x0106 - 0x0107 reserved */ -#define B2_MAC_2 0x0108 /* NA reg MAC Address 2 */ +#define B2_MAC_2 0x0108 /* NA reg MAC Address 2 */ /* 0x010e - 0x010f reserved */ -#define B2_MAC_3 0x0110 /* NA reg MAC Address 3 */ +#define B2_MAC_3 0x0110 /* NA reg MAC Address 3 */ /* 0x0116 - 0x0117 reserved */ -#define B2_CONN_TYP 0x0118 /* 8 bit Connector type */ -#define B2_PMD_TYP 0x0119 /* 8 bit PMD type */ -#define B2_MAC_CFG 0x011a /* 8 bit MAC Configuration */ -#define B2_CHIP_REV 0x011b /* 8 bit Queen Chip Revision Number */ +#define B2_CONN_TYP 0x0118 /* 8 bit Connector type */ +#define B2_PMD_TYP 0x0119 /* 8 bit PMD type */ +#define B2_MAC_CFG 0x011a /* 8 bit MAC Configuration */ +#define B2_CHIP_REV 0x011b /* 8 bit Queen Chip Revision Number */ /* Eprom registers are currently of no use */ -#define B2_E_0 0x011c /* 8 bit EPROM Byte 0 */ -#define B2_E_1 0x011d /* 8 bit EPROM Byte 1 */ -#define B2_E_2 0x011e /* 8 bit EPROM Byte 2 */ -#define B2_E_3 0x011f /* 8 bit EPROM Byte 3 */ -#define B2_FAR 0x0120 /* 32 bit Flash-Prom Addr Reg/Cnt */ -#define B2_FDP 0x0124 /* 8 bit Flash-Prom Data Port */ +#define B2_E_0 0x011c /* 8 bit EPROM Byte 0 */ +#define B2_E_1 0x011d /* 8 bit EPROM Byte 1 */ +#define B2_E_2 0x011e /* 8 bit EPROM Byte 2 */ +#define B2_E_3 0x011f /* 8 bit EPROM Byte 3 */ +#define B2_FAR 0x0120 /* 32 bit Flash-Prom Addr Reg/Cnt */ +#define B2_FDP 0x0124 /* 8 bit Flash-Prom Data Port */ /* 0x0125 - 0x0127: reserved */ -#define B2_LD_CRTL 0x0128 /* 8 bit EPROM loader control register */ -#define B2_LD_TEST 0x0129 /* 8 bit EPROM loader test register */ +#define B2_LD_CRTL 0x0128 /* 8 bit EPROM loader control register */ +#define B2_LD_TEST 0x0129 /* 8 bit EPROM loader test register */ /* 0x012a - 0x012f: reserved */ -#define B2_TI_INI 0x0130 /* 32 bit Timer init value */ -#define B2_TI_VAL 0x0134 /* 32 bit Timer value */ -#define B2_TI_CRTL 0x0138 /* 8 bit Timer control */ -#define B2_TI_TEST 0x0139 /* 8 Bit Timer Test */ +#define B2_TI_INI 0x0130 /* 32 bit Timer init value */ +#define B2_TI_VAL 0x0134 /* 32 bit Timer value */ +#define B2_TI_CRTL 0x0138 /* 8 bit Timer control */ +#define B2_TI_TEST 0x0139 /* 8 Bit Timer Test */ /* 0x013a - 0x013f: reserved */ -#define B2_IRQM_INI 0x0140 /* 32 bit IRQ Moderation Timer Init Reg.*/ -#define B2_IRQM_VAL 0x0144 /* 32 bit IRQ Moderation Timer Value */ +#define B2_IRQM_INI 0x0140 /* 32 bit IRQ Moderation Timer Init Reg.*/ +#define B2_IRQM_VAL 0x0144 /* 32 bit IRQ Moderation Timer Value */ #define B2_IRQM_CTRL 0x0148 /* 8 bit IRQ Moderation Timer Control */ #define B2_IRQM_TEST 0x0149 /* 8 bit IRQ Moderation Timer Test */ #define B2_IRQM_MSK 0x014c /* 32 bit IRQ Moderation Mask */ @@ -473,22 +478,22 @@ #define B2_TST_CTRL1 0x0158 /* 8 bit Test Control Register 1 */ #define B2_TST_CTRL2 0x0159 /* 8 bit Test Control Register 2 */ /* 0x015a - 0x015b: reserved */ -#define B2_GP_IO 0x015c /* 32 bit General Purpose IO Register */ -#define B2_I2C_CTRL 0x0160 /* 32 bit I2C HW Control Register */ -#define B2_I2C_DATA 0x0164 /* 32 bit I2C HW Data Register */ -#define B2_I2C_IRQ 0x0168 /* 32 bit I2C HW IRQ Register */ -#define B2_I2C_SW 0x016c /* 32 bit I2C SW Port Register */ -#define B2_BSC_INI 0x0170 /* 32 bit Blink Source Counter Init Val */ -#define B2_BSC_VAL 0x0174 /* 32 bit Blink Source Counter Value */ -#define B2_BSC_CTRL 0x0178 /* 8 bit Blink Source Counter Control */ -#define B2_BSC_STAT 0x0179 /* 8 bit Blink Source Counter Status */ -#define B2_BSC_TST 0x017a /* 16 bit Blink Source Counter Test Reg */ +#define B2_GP_IO 0x015c /* 32 bit General Purpose IO Register */ +#define B2_I2C_CTRL 0x0160 /* 32 bit I2C HW Control Register */ +#define B2_I2C_DATA 0x0164 /* 32 bit I2C HW Data Register */ +#define B2_I2C_IRQ 0x0168 /* 32 bit I2C HW IRQ Register */ +#define B2_I2C_SW 0x016c /* 32 bit I2C SW Port Register */ +#define B2_BSC_INI 0x0170 /* 32 bit Blink Source Counter Init Val */ +#define B2_BSC_VAL 0x0174 /* 32 bit Blink Source Counter Value */ +#define B2_BSC_CTRL 0x0178 /* 8 bit Blink Source Counter Control */ +#define B2_BSC_STAT 0x0179 /* 8 bit Blink Source Counter Status */ +#define B2_BSC_TST 0x017a /* 16 bit Blink Source Counter Test Reg */ /* 0x017c - 0x017f: reserved */ /* * Bank 3 */ -#define B3_RAM_ADDR 0x0180 /* 32 bit RAM Address, to read or write */ +#define B3_RAM_ADDR 0x0180 /* 32 bit RAM Address, to read or write */ #define B3_RAM_DATA_LO 0x0184 /* 32 bit RAM Data Word (low dWord) */ #define B3_RAM_DATA_HI 0x0188 /* 32 bit RAM Data Word (high dWord) */ /* 0x018c - 0x018f: reserved */ @@ -512,8 +517,8 @@ #define B3_RI_RTO_XS2 0x019b /* 8 bit RAM Iface RD Timeout Queue XS2 (TO11)*/ #define B3_RI_TO_VAL 0x019c /* 8 bit RAM Iface Current Timeout Count Val */ /* 0x019d - 0x019f reserved */ -#define B3_RI_CTRL 0x01a0 /* 16 bit RAM Iface Control Register */ -#define B3_RI_TEST 0x01a2 /* 8 bit RAM Iface Test Register */ +#define B3_RI_CTRL 0x01a0 /* 16 bit RAM Iface Control Register */ +#define B3_RI_TEST 0x01a2 /* 8 bit RAM Iface Test Register */ /* 0x01a3 - 0x01af reserved */ /* MAC Arbiter Registers */ /* Please notice these are the number of qWord tranfered continously and */ @@ -566,42 +571,42 @@ */ /* Transmit Arbiter Registers MAC 1 and 2, user MR_ADDR() to address */ -#define TXA_ITI_INI 0x0200 /* 32 bit Tx Arb Interval Timer Init Val*/ -#define TXA_ITI_VAL 0x0204 /* 32 bit Tx Arb Interval Timer Value */ -#define TXA_LIM_INI 0x0208 /* 32 bit Tx Arb Limit Counter Init Val */ -#define TXA_LIM_VAL 0x020c /* 32 bit Tx Arb Limit Counter Value */ -#define TXA_CTRL 0x0210 /* 8 bit Tx Arbiter Control Register */ -#define TXA_TEST 0x0211 /* 8 bit Tx Arbiter Test Register */ -#define TXA_STAT 0x0212 /* 8 bit Tx Arbiter Status Register */ +#define TXA_ITI_INI 0x0200 /* 32 bit Tx Arb Interval Timer Init Val*/ +#define TXA_ITI_VAL 0x0204 /* 32 bit Tx Arb Interval Timer Value */ +#define TXA_LIM_INI 0x0208 /* 32 bit Tx Arb Limit Counter Init Val */ +#define TXA_LIM_VAL 0x020c /* 32 bit Tx Arb Limit Counter Value */ +#define TXA_CTRL 0x0210 /* 8 bit Tx Arbiter Control Register */ +#define TXA_TEST 0x0211 /* 8 bit Tx Arbiter Test Register */ +#define TXA_STAT 0x0212 /* 8 bit Tx Arbiter Status Register */ /* 0x0213 - 0x027f: reserved */ /* * Bank 6 */ /* External registers */ -#define B6_EXT_REG 0x0300 +#define B6_EXT_REG 0x0300 /* * Bank 7 */ /* This is a copy of the Configuration register file (lower half) */ -#define B7_CFG_SPC 0x0380 +#define B7_CFG_SPC 0x0380 /* * Bank 8 - 15 */ /* Receive and Transmit Queue Registers, use Q_ADDR() to access */ -#define B8_Q_REGS 0x0400 +#define B8_Q_REGS 0x0400 /* Queue Register Offsets, use Q_ADDR() to access */ -#define Q_D 0x00 /* 8*32 bit Current Descriptor */ +#define Q_D 0x00 /* 8*32 bit Current Descriptor */ #define Q_DA_L 0x20 /* 32 bit Current Descriptor Address Low dWord */ #define Q_DA_H 0x24 /* 32 bit Current Descriptor Address High dWord */ #define Q_AC_L 0x28 /* 32 bit Current Address Counter Low dWord */ #define Q_AC_H 0x2c /* 32 bit Current Address Counter High dWord */ #define Q_BC 0x30 /* 32 bit Current Byte Counter */ #define Q_CSR 0x34 /* 32 bit BMU Control/Status Register */ -#define Q_F 0x38 /* 32 bit Flag Register */ +#define Q_F 0x38 /* 32 bit Flag Register */ #define Q_T1 0x3c /* 32 bit Test Register 1 */ #define Q_T1_TR 0x3c /* 8 bit Test Register 1 Transfer SM */ #define Q_T1_WR 0x3d /* 8 bit Test Register 1 Write Descriptor SM */ @@ -639,64 +644,64 @@ * Bank 24 - 25 */ /* Receive MAC FIFO, Receive LED, and Link Sync regs, use MR_ADDR() to address*/ -#define RX_MFF_EA 0x0c00 /* 32 bit Receive MAC FIFO End Address */ -#define RX_MFF_WP 0x0c04 /* 32 bit Receive MAC FIFO Write Pointer*/ +#define RX_MFF_EA 0x0c00 /* 32 bit Receive MAC FIFO End Address */ +#define RX_MFF_WP 0x0c04 /* 32 bit Receive MAC FIFO Write Pointer*/ /* 0x0c08 - 0x0c0b reserved */ -#define RX_MFF_RP 0x0c0c /* 32 bit Receive MAC FIFO Read Pointer */ -#define RX_MFF_PC 0x0c10 /* 32 bit Receive MAC FIFO Packet Cnt */ -#define RX_MFF_LEV 0x0c14 /* 32 bit Receive MAC FIFO Level */ +#define RX_MFF_RP 0x0c0c /* 32 bit Receive MAC FIFO Read Pointer */ +#define RX_MFF_PC 0x0c10 /* 32 bit Receive MAC FIFO Packet Cnt */ +#define RX_MFF_LEV 0x0c14 /* 32 bit Receive MAC FIFO Level */ #define RX_MFF_CTRL1 0x0c18 /* 16 bit Receive MAC FIFO Control Reg 1*/ #define RX_MFF_STAT_TO 0x0c1a /* 8 bit Receive MAC Status Timeout */ #define RX_MFF_TIST_TO 0x0c1b /* 8 bit Receive MAC Timestamp Timeout */ #define RX_MFF_CTRL2 0x0c1c /* 8 bit Receive MAC FIFO Control Reg 2*/ -#define RX_MFF_TST1 0x0c1d /* 8 bit Receive MAC FIFO Test Reg 1 */ -#define RX_MFF_TST2 0x0c1e /* 8 bit Receive MAC FIFO Test Reg 2 */ +#define RX_MFF_TST1 0x0c1d /* 8 bit Receive MAC FIFO Test Reg 1 */ +#define RX_MFF_TST2 0x0c1e /* 8 bit Receive MAC FIFO Test Reg 2 */ /* 0x0c1f reserved */ -#define RX_LED_INI 0x0c20 /* 32 bit Receive LED Cnt Init Value */ -#define RX_LED_VAL 0x0c24 /* 32 bit Receive LED Cnt Current Value */ -#define RX_LED_CTRL 0x0c28 /* 8 bit Receive LED Cnt Control Reg */ -#define RX_LED_TST 0x0c29 /* 8 bit Receive LED Cnt Test Register */ +#define RX_LED_INI 0x0c20 /* 32 bit Receive LED Cnt Init Value */ +#define RX_LED_VAL 0x0c24 /* 32 bit Receive LED Cnt Current Value */ +#define RX_LED_CTRL 0x0c28 /* 8 bit Receive LED Cnt Control Reg */ +#define RX_LED_TST 0x0c29 /* 8 bit Receive LED Cnt Test Register */ /* 0x0c2a - 0x0c2f reserved */ #define LNK_SYNC_INI 0x0c30 /* 32 bit Link Sync Cnt Init Value */ #define LNK_SYNC_VAL 0x0c34 /* 32 bit Link Sync Cnt Current Value */ #define LNK_SYNC_CTRL 0x0c38 /* 8 bit Link Sync Cnt Control Register*/ #define LNK_SYNC_TST 0x0c39 /* 8 bit Link Sync Cnt Test Register */ /* 0x0c3a - 0x0c3b reserved */ -#define LNK_LED_REG 0x0c3c /* 8 bit Link LED Register */ +#define LNK_LED_REG 0x0c3c /* 8 bit Link LED Register */ /* 0x0c3d - 0x0c7f reserved */ /* * Bank 26 - 27 */ /* Transmit MAC FIFO and Transmit LED Registers, use MR_ADDR() to address */ -#define TX_MFF_EA 0x0d00 /* 32 bit Transmit MAC FIFO End Address */ -#define TX_MFF_WP 0x0d04 /* 32 bit Transmit MAC FIFO WR Pointer */ -#define TX_MFF_WSP 0x0d08 /* 32 bit Transmit MAC FIFO WR Shadow Pt*/ -#define TX_MFF_RP 0x0d0c /* 32 bit Transmit MAC FIFO RD Pointer */ -#define TX_MFF_PC 0x0d10 /* 32 bit Transmit MAC FIFO Packet Cnt */ -#define TX_MFF_LEV 0x0d14 /* 32 bit Transmit MAC FIFO Level */ +#define TX_MFF_EA 0x0d00 /* 32 bit Transmit MAC FIFO End Address */ +#define TX_MFF_WP 0x0d04 /* 32 bit Transmit MAC FIFO WR Pointer */ +#define TX_MFF_WSP 0x0d08 /* 32 bit Transmit MAC FIFO WR Shadow Pt*/ +#define TX_MFF_RP 0x0d0c /* 32 bit Transmit MAC FIFO RD Pointer */ +#define TX_MFF_PC 0x0d10 /* 32 bit Transmit MAC FIFO Packet Cnt */ +#define TX_MFF_LEV 0x0d14 /* 32 bit Transmit MAC FIFO Level */ #define TX_MFF_CTRL1 0x0d18 /* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ -#define TX_MFF_WAF 0x0d1a /* 8 bit Transmit MAC Wait after flush*/ +#define TX_MFF_WAF 0x0d1a /* 8 bit Transmit MAC Wait after flush*/ /* 0x0c1b reserved */ #define TX_MFF_CTRL2 0x0d1c /* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ -#define TX_MFF_TST1 0x0d1d /* 8 bit Transmit MAC FIFO Test Reg 1 */ -#define TX_MFF_TST2 0x0d1e /* 8 bit Transmit MAC FIFO Test Reg 2 */ +#define TX_MFF_TST1 0x0d1d /* 8 bit Transmit MAC FIFO Test Reg 1 */ +#define TX_MFF_TST2 0x0d1e /* 8 bit Transmit MAC FIFO Test Reg 2 */ /* 0x0d1f reserved */ -#define TX_LED_INI 0x0d20 /* 32 bit Transmit LED Cnt Init Value */ -#define TX_LED_VAL 0x0d24 /* 32 bit Transmit LED Cnt Current Val */ -#define TX_LED_CTRL 0x0d28 /* 8 bit Transmit LED Cnt Control Reg */ -#define TX_LED_TST 0x0d29 /* 8 bit Transmit LED Cnt Test Register*/ +#define TX_LED_INI 0x0d20 /* 32 bit Transmit LED Cnt Init Value */ +#define TX_LED_VAL 0x0d24 /* 32 bit Transmit LED Cnt Current Val */ +#define TX_LED_CTRL 0x0d28 /* 8 bit Transmit LED Cnt Control Reg */ +#define TX_LED_TST 0x0d29 /* 8 bit Transmit LED Cnt Test Register*/ /* 0x0d2a - 0x0d7f reserved */ /* * Bank 28 */ /* Descriptor Poll Timer Registers */ -#define B28_DPT_INI 0x0e00 /* 32 bit Descriptor Poll Timer Init Val*/ -#define B28_DPT_VAL 0x0e04 /* 32 bit Descriptor Poll Timer Curr Val*/ +#define B28_DPT_INI 0x0e00 /* 32 bit Descriptor Poll Timer Init Val*/ +#define B28_DPT_VAL 0x0e04 /* 32 bit Descriptor Poll Timer Curr Val*/ #define B28_DPT_CTRL 0x0e08 /* 8 bit Descriptor Poll Timer Ctrl Reg*/ /* 0x0e09: reserved */ -#define B28_DPT_TST 0x0e0a /* 8 bit Descriptor Poll Timer Test Reg*/ +#define B28_DPT_TST 0x0e0a /* 8 bit Descriptor Poll Timer Test Reg*/ /* 0x0e0b - 0x0e8f: reserved */ /* @@ -736,7 +741,7 @@ */ /* B0_RAP 8 bit Register Address Port */ /* Bit 7: reserved */ -#define RAP_RAP 0x3f /* Bit 6..0: 0 = block 0, .., 6f = block 6f*/ +#define RAP_RAP 0x3f /* Bit 6..0: 0 = block 0, .., 6f = block 6f*/ /* B0_CTST 16 bit Control/Status register */ /* Bit 15..10: reserved */ @@ -746,70 +751,70 @@ #define CS_CL_SW_IRQ (1<<6) /* Bit 6: Clear IRQ SW Request */ #define CS_STOP_DONE (1<<5) /* Bit 5: Stop Master is finished */ #define CS_STOP_MAST (1<<4) /* Bit 4: Command Bit to stop the master*/ -#define CS_MRST_CLR (1<<3) /* Bit 3: Clear Master reset */ -#define CS_MRST_SET (1<<2) /* Bit 2: Set Master reset */ -#define CS_RST_CLR (1<<1) /* Bit 1: Clear Software reset */ -#define CS_RST_SET (1<<0) /* Bit 0: Set Software reset */ +#define CS_MRST_CLR (1<<3) /* Bit 3: Clear Master reset */ +#define CS_MRST_SET (1<<2) /* Bit 2: Set Master reset */ +#define CS_RST_CLR (1<<1) /* Bit 1: Clear Software reset */ +#define CS_RST_SET (1<<0) /* Bit 0: Set Software reset */ /* B0_LED 8 Bit LED register */ /* Bit 7..2: reserved */ -#define LED_STAT_ON (1<<1) /* Bit 1: Status LED on */ +#define LED_STAT_ON (1<<1) /* Bit 1: Status LED on */ #define LED_STAT_OFF (1<<0) /* Bit 0: Status LED off */ /* B0_ISRC 32 bit Interrupt Source Register */ /* B0_IMSK 32 bit Interrupt Mask Register */ /* B0_SP_ISRC 32 bit Special Interrupt Source Reg */ /* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ -#define IS_ALL_MSK 0xbfffffffL /* All Interrupt bits */ -#define IS_HW_ERR (1UL<<31) /* Bit 31: Interrupt HW Error */ - /* Bit 30: reserved */ +#define IS_ALL_MSK 0xbfffffffL /* All Interrupt bits */ +#define IS_HW_ERR (1UL<<31) /* Bit 31: Interrupt HW Error */ + /* Bit 30: reserved */ #define IS_PA_TO_RX1 (1L<<29) /* Bit 29: Packet Arb Timeout Rx1*/ #define IS_PA_TO_RX2 (1L<<28) /* Bit 28: Packet Arb Timeout Rx2*/ #define IS_PA_TO_TX1 (1L<<27) /* Bit 27: Packet Arb Timeout Tx1*/ #define IS_PA_TO_TX2 (1L<<26) /* Bit 26: Packet Arb Timeout Tx2*/ #define IS_I2C_READY (1L<<25) /* Bit 25: IRQ on end of I2C tx */ -#define IS_IRQ_SW (1L<<24) /* Bit 24: SW forced IRQ */ -#define IS_EXT_REG (1L<<23) /* Bit 23: IRQ from external reg */ -#define IS_TIMINT (1L<<22) /* Bit 22: IRQ from Timer */ -#define IS_MAC1 (1L<<21) /* Bit 21: IRQ from MAC 1 */ +#define IS_IRQ_SW (1L<<24) /* Bit 24: SW forced IRQ */ +#define IS_EXT_REG (1L<<23) /* Bit 23: IRQ from external reg */ +#define IS_TIMINT (1L<<22) /* Bit 22: IRQ from Timer */ +#define IS_MAC1 (1L<<21) /* Bit 21: IRQ from MAC 1 */ #define IS_LNK_SYNC_M1 (1L<<20) /* Bit 20: Link Sync Cnt wrap M1 */ -#define IS_MAC2 (1L<<19) /* Bit 19: IRQ from MAC 2 */ +#define IS_MAC2 (1L<<19) /* Bit 19: IRQ from MAC 2 */ #define IS_LNK_SYNC_M2 (1L<<18) /* Bit 18: Link Sync Cnt wrap M2 */ /* Receive Queue 1 */ -#define IS_R1_B (1L<<17) /* Bit 17: Q_R1 End of Buffer */ -#define IS_R1_F (1L<<16) /* Bit 16: Q_R1 End of Frame */ -#define IS_R1_C (1L<<15) /* Bit 15: Q_R1 Encoding Error */ +#define IS_R1_B (1L<<17) /* Bit 17: Q_R1 End of Buffer */ +#define IS_R1_F (1L<<16) /* Bit 16: Q_R1 End of Frame */ +#define IS_R1_C (1L<<15) /* Bit 15: Q_R1 Encoding Error */ /* Receive Queue 2 */ -#define IS_R2_B (1L<<14) /* Bit 14: Q_R2 End of Buffer */ -#define IS_R2_F (1L<<13) /* Bit 13: Q_R2 End of Frame */ -#define IS_R2_C (1L<<12) /* Bit 12: Q_R2 Encoding Error */ +#define IS_R2_B (1L<<14) /* Bit 14: Q_R2 End of Buffer */ +#define IS_R2_F (1L<<13) /* Bit 13: Q_R2 End of Frame */ +#define IS_R2_C (1L<<12) /* Bit 12: Q_R2 Encoding Error */ /* Synchronous Transmit Queue 1 */ -#define IS_XS1_B (1L<<11) /* Bit 11: Q_XS1 End of Buffer */ -#define IS_XS1_F (1L<<10) /* Bit 10: Q_XS1 End of Frame */ -#define IS_XS1_C (1L<<9) /* Bit 9: Q_XS1 Encoding Error */ +#define IS_XS1_B (1L<<11) /* Bit 11: Q_XS1 End of Buffer */ +#define IS_XS1_F (1L<<10) /* Bit 10: Q_XS1 End of Frame */ +#define IS_XS1_C (1L<<9) /* Bit 9: Q_XS1 Encoding Error */ /* Asynchronous Transmit Queue 1 */ -#define IS_XA1_B (1L<<8) /* Bit 8: Q_XA1 End of Buffer */ -#define IS_XA1_F (1L<<7) /* Bit 7: Q_XA1 End of Frame */ -#define IS_XA1_C (1L<<6) /* Bit 6: Q_XA1 Encoding Error */ +#define IS_XA1_B (1L<<8) /* Bit 8: Q_XA1 End of Buffer */ +#define IS_XA1_F (1L<<7) /* Bit 7: Q_XA1 End of Frame */ +#define IS_XA1_C (1L<<6) /* Bit 6: Q_XA1 Encoding Error */ /* Synchronous Transmit Queue 2 */ -#define IS_XS2_B (1L<<5) /* Bit 5: Q_XS2 End of Buffer */ -#define IS_XS2_F (1L<<4) /* Bit 4: Q_XS2 End of Frame */ -#define IS_XS2_C (1L<<3) /* Bit 3: Q_XS2 Encoding Error */ +#define IS_XS2_B (1L<<5) /* Bit 5: Q_XS2 End of Buffer */ +#define IS_XS2_F (1L<<4) /* Bit 4: Q_XS2 End of Frame */ +#define IS_XS2_C (1L<<3) /* Bit 3: Q_XS2 Encoding Error */ /* Asynchronous Transmit Queue 2 */ -#define IS_XA2_B (1L<<2) /* Bit 2: Q_XA2 End of Buffer */ -#define IS_XA2_F (1L<<1) /* Bit 1: Q_XA2 End of Frame */ -#define IS_XA2_C (1L<<0) /* Bit 0: Q_XA2 Encoding Error */ +#define IS_XA2_B (1L<<2) /* Bit 2: Q_XA2 End of Buffer */ +#define IS_XA2_F (1L<<1) /* Bit 1: Q_XA2 End of Frame */ +#define IS_XA2_C (1L<<0) /* Bit 0: Q_XA2 Encoding Error */ /* B0_HWE_ISRC 32 bit HW Error Interrupt Src Reg */ /* B0_HWE_IMSK 32 bit HW Error Interrupt Mask Reg */ /* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ -#define IS_ERR_MSK 0x00000fffL /* All Error bits */ - /* Bit 31..12: reserved */ +#define IS_ERR_MSK 0x00000fffL /* All Error bits */ + /* Bit 31..12: reserved */ #define IS_IRQ_MST_ERR (1L<<11) /* Bit 11: IRQ master error */ - /* PERR,RMABORT,RTABORT,DATAPERR */ -#define IS_IRQ_STAT (1L<<10) /* Bit 10: IRQ status execption */ - /* RMABORT, RTABORT, DATAPERR */ + /* PERR,RMABORT,RTABORT,DATAPERR */ +#define IS_IRQ_STAT (1L<<10) /* Bit 10: IRQ status execption */ + /* RMABORT, RTABORT, DATAPERR */ #define IS_NO_STAT_M1 (1L<<9) /* Bit 9: No Rx Status from MAC1*/ #define IS_NO_STAT_M2 (1L<<8) /* Bit 8: No Rx Status from MAC2*/ #define IS_NO_TIST_M1 (1L<<7) /* Bit 7: No Timestamp from MAC1*/ @@ -826,53 +831,53 @@ /* Values of connector and PMD type comply to SysKonnect internal std */ /* B2_MAC_CFG 8 bit MAC Configuration */ - /* Bit 7..2: reserved */ + /* Bit 7..2: reserved */ #define CFG_DIS_M2_CLK (1<<1) /* Bit 1: Disable Clock for 2nd MAC */ -#define CFG_SNG_MAC (1<<0) /* Bit 0: MAC Config: 1=2 MACs / 0=1 MAC*/ +#define CFG_SNG_MAC (1<<0) /* Bit 0: MAC Config: 1=2 MACs / 0=1 MAC*/ /* B2_CHIP_REV 8 bit Queen Chip Revision Number */ #define FIRST_CHIP_REV 0x0a /* Initial Revision Value */ /* B2_FAR 32 bit Flash-Prom Addr Reg/Cnt */ -#define FAR_ADDR 0x1ffffL /* Bit 16..0: FPROM Address mask */ +#define FAR_ADDR 0x1ffffL /* Bit 16..0: FPROM Address mask */ /* B2_LD_CRTL 8 bit EPROM loader control register */ /* Bits are currently reserved */ /* B2_LD_TEST 8 bit EPROM loader test register */ - /* Bit 7..4: reserved */ -#define LD_T_ON (1<<3) /* Bit 3: Loader Testmode on */ -#define LD_T_OFF (1<<2) /* Bit 2: Loader Testmode off */ -#define LD_T_STEP (1<<1) /* Bit 1: Decrement FPROM addr. Counter */ -#define LD_START (1<<0) /* Bit 0: Start loading FPROM */ + /* Bit 7..4: reserved */ +#define LD_T_ON (1<<3) /* Bit 3: Loader Testmode on */ +#define LD_T_OFF (1<<2) /* Bit 2: Loader Testmode off */ +#define LD_T_STEP (1<<1) /* Bit 1: Decrement FPROM addr. Counter */ +#define LD_START (1<<0) /* Bit 0: Start loading FPROM */ /* * Timer Section */ /* B2_TI_CRTL 8 bit Timer control */ /* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ - /* Bit 7..3: reserved */ -#define TIM_START (1<<2) /* Bit 2: Start Timer */ -#define TIM_STOP (1<<1) /* Bit 1: Stop Timer */ -#define TIM_CLR_IRQ (1<<0) /* Bit 0: Clear Timer IRQ, (!IRQM) */ + /* Bit 7..3: reserved */ +#define TIM_START (1<<2) /* Bit 2: Start Timer */ +#define TIM_STOP (1<<1) /* Bit 1: Stop Timer */ +#define TIM_CLR_IRQ (1<<0) /* Bit 0: Clear Timer IRQ, (!IRQM) */ /* B2_TI_TEST 8 Bit Timer Test */ /* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ /* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ - /* Bit 7..3: reserved */ -#define TIM_T_ON (1<<2) /* Bit 2: Test mode on */ -#define TIM_T_OFF (1<<1) /* Bit 1: Test mode off */ -#define TIM_T_STEP (1<<0) /* Bit 0: Test step */ + /* Bit 7..3: reserved */ +#define TIM_T_ON (1<<2) /* Bit 2: Test mode on */ +#define TIM_T_OFF (1<<1) /* Bit 1: Test mode off */ +#define TIM_T_STEP (1<<0) /* Bit 0: Test step */ /* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */ /* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */ - /* Bit 31..24: reserved */ -#define DPT_MSK 0x00ffffffL /* Bit 23.. 0: Desc Poll Timer Bits */ + /* Bit 31..24: reserved */ +#define DPT_MSK 0x00ffffffL /* Bit 23.. 0: Desc Poll Timer Bits */ /* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ - /* Bit 7..2: reserved */ -#define DPT_START (1<<1) /* Bit 1: Start Desciptor Poll Timer */ -#define DPT_STOP (1<<0) /* Bit 0: Stop Desciptor Poll Timer */ + /* Bit 7..2: reserved */ +#define DPT_START (1<<1) /* Bit 1: Start Desciptor Poll Timer */ +#define DPT_STOP (1<<0) /* Bit 0: Stop Desciptor Poll Timer */ /* B2_TST_CTRL1 8 bit Test Control Register 1 */ @@ -886,7 +891,7 @@ #define TST_CFG_WRITE_OFF (1<<0) /* Bit 0: Disable Config Reg WR */ /* B2_TST_CTRL2 8 bit Test Control Register 2 */ - /* Bit 7..4: reserved */ + /* Bit 7..4: reserved */ /* force the following error on */ /* the next master read/write */ #define TST_FRC_DPERR_MR64 (1<<3) /* Bit 3: DataPERR RD 64 */ @@ -895,7 +900,7 @@ #define TST_FRC_APERR_2M64 (1<<0) /* Bit 0: AddrPERR on 2. phase */ /* B2_GP_IO 32 bit General Purpose IO Register */ - /* Bit 31..26: reserved */ + /* Bit 31..26: reserved */ #define GP_DIR_9 (1L<<25) /* Bit 25: IO_9 direct, 0=I/1=O */ #define GP_DIR_8 (1L<<24) /* Bit 24: IO_8 direct, 0=I/1=O */ #define GP_DIR_7 (1L<<23) /* Bit 23: IO_7 direct, 0=I/1=O */ @@ -906,7 +911,7 @@ #define GP_DIR_2 (1L<<18) /* Bit 18: IO_2 direct, 0=I/1=O */ #define GP_DIR_1 (1L<<17) /* Bit 17: IO_1 direct, 0=I/1=O */ #define GP_DIR_0 (1L<<16) /* Bit 16: IO_0 direct, 0=I/1=O */ - /* Bit 15..10: reserved */ + /* Bit 15..10: reserved */ #define GP_IO_9 (1L<<9) /* Bit 9: IO_9 pin */ #define GP_IO_8 (1L<<8) /* Bit 8: IO_8 pin */ #define GP_IO_7 (1L<<7) /* Bit 7: IO_7 pin */ @@ -919,31 +924,31 @@ #define GP_IO_0 (1L<<0) /* Bit 0: IO_0 pin */ /* B2_I2C_CTRL 32 bit I2C HW Control Register */ -#define I2C_FLAG (1UL<<31) /* Bit 31: Start read/write if WR*/ +#define I2C_FLAG (1UL<<31) /* Bit 31: Start read/write if WR*/ #define I2C_ADDR (0x7fffL<<16) /* Bit 30..16: Addr to be RD/WR */ -#define I2C_DEV_SEL (0x7fL<<9) /* Bit 15.. 9: I2C Device Select */ - /* Bit 8.. 5: reserved */ +#define I2C_DEV_SEL (0x7fL<<9) /* Bit 15.. 9: I2C Device Select */ + /* Bit 8.. 5: reserved */ #define I2C_BURST_LEN (1L<<4) /* Bit 4: Burst Len, 1/4 bytes */ #define I2C_DEV_SIZE (7L<<1) /* Bit 3.. 1: I2C Device Size */ #define I2C_025K_DEV (0L<<1) /* 0: 256 Bytes or smal. */ -#define I2C_05K_DEV (1L<<1) /* 1: 512 Bytes */ -#define I2C_1K_DEV (2L<<1) /* 2: 1024 Bytes */ -#define I2C_2K_DEV (3L<<1) /* 3: 2048 Bytes */ -#define I2C_4K_DEV (4L<<1) /* 4: 4096 Bytes */ -#define I2C_8K_DEV (5L<<1) /* 5: 8192 Bytes */ -#define I2C_16K_DEV (6L<<1) /* 6: 16384 Bytes */ -#define I2C_32K_DEV (7L<<1) /* 7: 32768 Bytes */ -#define I2C_STOP (1L<<0) /* Bit 0: Interrupt I2C transfer*/ +#define I2C_05K_DEV (1L<<1) /* 1: 512 Bytes */ +#define I2C_1K_DEV (2L<<1) /* 2: 1024 Bytes */ +#define I2C_2K_DEV (3L<<1) /* 3: 2048 Bytes */ +#define I2C_4K_DEV (4L<<1) /* 4: 4096 Bytes */ +#define I2C_8K_DEV (5L<<1) /* 5: 8192 Bytes */ +#define I2C_16K_DEV (6L<<1) /* 6: 16384 Bytes */ +#define I2C_32K_DEV (7L<<1) /* 7: 32768 Bytes */ +#define I2C_STOP (1L<<0) /* Bit 0: Interrupt I2C transfer*/ /* B2_I2C_IRQ 32 bit I2C HW IRQ Register */ - /* Bit 31..1 reserved */ -#define I2C_CLR_IRQ (1<<0) /* Bit 0: Clear I2C IRQ */ + /* Bit 31..1 reserved */ +#define I2C_CLR_IRQ (1<<0) /* Bit 0: Clear I2C IRQ */ /* B2_I2C_SW 32 bit I2C HW SW Port Register */ - /* Bit 7..3: reserved */ + /* Bit 7..3: reserved */ #define I2C_DATA_DIR (1<<2) /* Bit 2: direction of I2C_DATA */ -#define I2C_DATA (1<<1) /* Bit 1: I2C Data Port */ -#define I2C_CLK (1<<0) /* Bit 0: I2C Clock Port */ +#define I2C_DATA (1<<1) /* Bit 1: I2C Data Port */ +#define I2C_CLK (1<<0) /* Bit 0: I2C Clock Port */ /* * I2C Address @@ -952,12 +957,12 @@ /* B2_BSC_CTRL 8 bit Blink Source Counter Control */ - /* Bit 7..2: reserved */ + /* Bit 7..2: reserved */ #define BSC_START (1<<1) /* Bit 1: Start Blink Source Counter */ #define BSC_STOP (1<<0) /* Bit 0: Stop Blink Source Counter */ /* B2_BSC_STAT 8 bit Blink Source Counter Status */ - /* Bit 7..1: reserved */ + /* Bit 7..1: reserved */ #define BSC_SRC (1<<0) /* Bit 0: Blink Source, 0=Off / 1=On */ /* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ @@ -972,30 +977,30 @@ /* RAM Interface Registers */ /* B3_RI_CTRL 16 bit RAM Iface Control Register */ - /* Bit 15..10: reserved */ + /* Bit 15..10: reserved */ #define RI_CLR_RD_PERR (1<<9) /* Bit 9: Clear IRQ RAM Read Parity Err */ #define RI_CLR_WR_PERR (1<<8) /* Bit 8: Clear IRQ RAM Write Parity Err*/ - /* Bit 7..2: reserved */ -#define RI_RST_CLR (1<<1) /* Bit 1: Clear RAM Interface Reset */ -#define RI_RST_SET (1<<0) /* Bit 0: Set RAM Interface Reset */ + /* Bit 7..2: reserved */ +#define RI_RST_CLR (1<<1) /* Bit 1: Clear RAM Interface Reset */ +#define RI_RST_SET (1<<0) /* Bit 0: Set RAM Interface Reset */ /* B3_RI_TEST 8 bit RAM Iface Test Register */ - /* Bit 15..4: reserved */ -#define RI_T_EV (1<<3) /* Bit 3: Timeout Event occured */ -#define RI_T_ON (1<<2) /* Bit 2: Timeout Timer Test On */ -#define RI_T_OFF (1<<1) /* Bit 1: Timeout Timer Test Off */ -#define RI_T_STEP (1<<0) /* Bit 0: Timeout Timer Step */ + /* Bit 15..4: reserved */ +#define RI_T_EV (1<<3) /* Bit 3: Timeout Event occurred */ +#define RI_T_ON (1<<2) /* Bit 2: Timeout Timer Test On */ +#define RI_T_OFF (1<<1) /* Bit 1: Timeout Timer Test Off */ +#define RI_T_STEP (1<<0) /* Bit 0: Timeout Timer Step */ /* MAC Arbiter Registers */ /* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ - /* Bit 15..4: reserved */ -#define MA_FOE_ON (1<<3) /* Bit 3: XMAC Fast Output Enable ON */ -#define MA_FOE_OFF (1<<2) /* Bit 2: XMAC Fast Output Enable OFF */ -#define MA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */ -#define MA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */ + /* Bit 15..4: reserved */ +#define MA_FOE_ON (1<<3) /* Bit 3: XMAC Fast Output Enable ON */ +#define MA_FOE_OFF (1<<2) /* Bit 2: XMAC Fast Output Enable OFF */ +#define MA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */ +#define MA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */ /* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */ - /* Bit 15..8: reserved */ + /* Bit 15..8: reserved */ #define MA_ENA_REC_TX2 (1<<7) /* Bit 7: Enable Recovery Timer TX2 */ #define MA_DIS_REC_TX2 (1<<6) /* Bit 6: Disable Recovery Timer TX2 */ #define MA_ENA_REC_TX1 (1<<5) /* Bit 5: Enable Recovery Timer TX1 */ @@ -1007,7 +1012,7 @@ /* Packet Arbiter Registers */ /* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ - /* Bit 15..14: reserved */ + /* Bit 15..14: reserved */ #define PA_CLR_TO_TX2 (1<<13) /* Bit 13: Clear IRQ Packet Timeout TX2 */ #define PA_CLR_TO_TX1 (1<<12) /* Bit 12: Clear IRQ Packet Timeout TX1 */ #define PA_CLR_TO_RX2 (1<<11) /* Bit 11: Clear IRQ Packet Timeout RX2 */ @@ -1020,30 +1025,30 @@ #define PA_DIS_TO_RX2 (1<<4) /* Bit 4: Disable Timeout Timer RX2 */ #define PA_ENA_TO_RX1 (1<<3) /* Bit 3: Enable Timeout Timer RX1 */ #define PA_DIS_TO_RX1 (1<<2) /* Bit 2: Disable Timeout Timer RX1 */ -#define PA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */ -#define PA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */ +#define PA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */ +#define PA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */ #define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ - PA_ENA_TO_TX1 | PA_ENA_TO_TX2) + PA_ENA_TO_TX1 | PA_ENA_TO_TX2) /* Rx/Tx Path related Arbiter Test Registers */ /* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */ /* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */ /* B3_PA_TEST 16 bit Packet Arbiter Test Register */ /* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */ -#define TX2_T_EV (1<<15) /* Bit 15: TX2 Timeout/Recv Event occured*/ +#define TX2_T_EV (1<<15) /* Bit 15: TX2 Timeout/Recv Event occurred*/ #define TX2_T_ON (1<<14) /* Bit 14: TX2 Timeout/Recv Timer Test On*/ #define TX2_T_OFF (1<<13) /* Bit 13: TX2 Timeout/Recv Timer Tst Off*/ #define TX2_T_STEP (1<<12) /* Bit 12: TX2 Timeout/Recv Timer Step */ -#define TX1_T_EV (1<<11) /* Bit 11: TX1 Timeout/Recv Event occured*/ +#define TX1_T_EV (1<<11) /* Bit 11: TX1 Timeout/Recv Event occurred*/ #define TX1_T_ON (1<<10) /* Bit 10: TX1 Timeout/Recv Timer Test On*/ #define TX1_T_OFF (1<<9) /* Bit 9: TX1 Timeout/Recv Timer Tst Off*/ #define TX1_T_STEP (1<<8) /* Bit 8: TX1 Timeout/Recv Timer Step */ -#define RX2_T_EV (1<<7) /* Bit 7: RX2 Timeout/Recv Event occured*/ +#define RX2_T_EV (1<<7) /* Bit 7: RX2 Timeout/Recv Event occurred*/ #define RX2_T_ON (1<<6) /* Bit 6: RX2 Timeout/Recv Timer Test On*/ #define RX2_T_OFF (1<<5) /* Bit 5: RX2 Timeout/Recv Timer Tst Off*/ #define RX2_T_STEP (1<<4) /* Bit 4: RX2 Timeout/Recv Timer Step */ -#define RX1_T_EV (1<<3) /* Bit 3: RX1 Timeout/Recv Event occured*/ +#define RX1_T_EV (1<<3) /* Bit 3: RX1 Timeout/Recv Event occurred*/ #define RX1_T_ON (1<<2) /* Bit 2: RX1 Timeout/Recv Timer Test On*/ #define RX1_T_OFF (1<<1) /* Bit 1: RX1 Timeout/Recv Timer Tst Off*/ #define RX1_T_STEP (1<<0) /* Bit 0: RX1 Timeout/Recv Timer Step */ @@ -1054,7 +1059,7 @@ /* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ /* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ /* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ - /* Bit 31..24: reserved */ + /* Bit 31..24: reserved */ #define TXA_MAX_VAL 0x00ffffffL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ /* TXA_CTRL 8 bit Tx Arbiter Control Register */ @@ -1063,9 +1068,9 @@ #define TXA_ENA_ALLOC (1<<5) /* Bit 5: Enable alloc of free bandwidth*/ #define TXA_DIS_ALLOC (1<<4) /* Bit 4: Disabl alloc of free bandwidth*/ #define TXA_START_RC (1<<3) /* Bit 3: Start sync Rate Control */ -#define TXA_STOP_RC (1<<2) /* Bit 2: Stop sync Rate Control */ -#define TXA_ENA_ARB (1<<1) /* Bit 1: Enable Tx Arbiter */ -#define TXA_DIS_ARB (1<<0) /* Bit 0: Disable Tx Arbiter */ +#define TXA_STOP_RC (1<<2) /* Bit 2: Stop sync Rate Control */ +#define TXA_ENA_ARB (1<<1) /* Bit 1: Enable Tx Arbiter */ +#define TXA_DIS_ARB (1<<0) /* Bit 0: Disable Tx Arbiter */ /* TXA_TEST 8 bit Tx Arbiter Test Register */ /* Bit 7..6: reserved */ @@ -1077,12 +1082,12 @@ #define TXA_LIM_T_STEP (1<<0) /* Bit 0: Tx Arb Limit Timer Step */ /* TXA_STAT 8 bit Tx Arbiter Status Register */ - /* Bit 7..1: reserved */ -#define TXA_PRIO_XS (1<<0) /* Bit 0: sync queue has prio to send */ + /* Bit 7..1: reserved */ +#define TXA_PRIO_XS (1<<0) /* Bit 0: sync queue has prio to send */ /* Q_BC 32 bit Current Byte Counter */ /* Bit 31..16: reserved */ -#define BC_MAX 0xffff /* Bit 15.. 0: Byte counter */ +#define BC_MAX 0xffff /* Bit 15.. 0: Byte counter */ /* BMU Control Status Registers */ /* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ @@ -1092,47 +1097,47 @@ /* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ /* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ /* Q_CSR 32 bit BMU Control/Status Register */ - /* Bit 31..25: reserved */ -#define CSR_SV_IDLE (1L<<24) /* Bit 24: BMU SM Idle */ - /* Bit 23..22: reserved */ + /* Bit 31..25: reserved */ +#define CSR_SV_IDLE (1L<<24) /* Bit 24: BMU SM Idle */ + /* Bit 23..22: reserved */ #define CSR_DESC_CLR (1L<<21) /* Bit 21: Clear Reset for Descr */ #define CSR_DESC_SET (1L<<20) /* Bit 20: Set Reset for Descr */ #define CSR_FIFO_CLR (1L<<19) /* Bit 19: Clear Reset for FIFO */ #define CSR_FIFO_SET (1L<<18) /* Bit 18: Set Reset for FIFO */ -#define CSR_HPI_RUN (1L<<17) /* Bit 17: Release HPI SM */ -#define CSR_HPI_RST (1L<<16) /* Bit 16: Reset HPI SM to Idle */ -#define CSR_SV_RUN (1L<<15) /* Bit 15: Release Supervisor SM */ -#define CSR_SV_RST (1L<<14) /* Bit 14: Reset Supervisor SM */ +#define CSR_HPI_RUN (1L<<17) /* Bit 17: Release HPI SM */ +#define CSR_HPI_RST (1L<<16) /* Bit 16: Reset HPI SM to Idle */ +#define CSR_SV_RUN (1L<<15) /* Bit 15: Release Supervisor SM */ +#define CSR_SV_RST (1L<<14) /* Bit 14: Reset Supervisor SM */ #define CSR_DREAD_RUN (1L<<13) /* Bit 13: Release Descr Read SM */ #define CSR_DREAD_RST (1L<<12) /* Bit 12: Reset Descr Read SM */ #define CSR_DWRITE_RUN (1L<<11) /* Bit 11: Rel. Descr Write SM */ #define CSR_DWRITE_RST (1L<<10) /* Bit 10: Reset Descr Write SM */ #define CSR_TRANS_RUN (1L<<9) /* Bit 9: Release Transfer SM */ #define CSR_TRANS_RST (1L<<8) /* Bit 8: Reset Transfer SM */ -#define CSR_ENA_POL (1L<<7) /* Bit 7: Enable Descr Polling */ -#define CSR_DIS_POL (1L<<6) /* Bit 6: Disable Descr Polling */ -#define CSR_STOP (1L<<5) /* Bit 5: Stop Rx/Tx Queue */ -#define CSR_START (1L<<4) /* Bit 4: Start Rx/Tx Queue */ +#define CSR_ENA_POL (1L<<7) /* Bit 7: Enable Descr Polling */ +#define CSR_DIS_POL (1L<<6) /* Bit 6: Disable Descr Polling */ +#define CSR_STOP (1L<<5) /* Bit 5: Stop Rx/Tx Queue */ +#define CSR_START (1L<<4) /* Bit 4: Start Rx/Tx Queue */ #define CSR_IRQ_CL_P (1L<<3) /* Bit 3: (Rx) Clear Parity IRQ */ #define CSR_IRQ_CL_B (1L<<2) /* Bit 2: Clear EOB IRQ */ #define CSR_IRQ_CL_F (1L<<1) /* Bit 1: Clear EOF IRQ */ #define CSR_IRQ_CL_C (1L<<0) /* Bit 0: Clear ERR IRQ */ #define CSR_SET_RESET (CSR_DESC_SET|CSR_FIFO_SET|CSR_HPI_RST|CSR_SV_RST|\ - CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST) + CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST) #define CSR_CLR_RESET (CSR_DESC_CLR|CSR_FIFO_CLR|CSR_HPI_RUN|CSR_SV_RUN|\ - CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN) + CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN) /* Q_F 32 bit Flag Register */ /* Bit 28..31: reserved */ -#define F_ALM_FULL (1L<<27) (Rx) /* Bit 27: (Rx) FIFO almost full */ -#define F_EMPTY (1L<<27) (Tx) /* Bit 27: (Tx) FIFO empty flag */ -#define F_FIFO_EOF (1L<<26) /* Bit 26: Fag bit in FIFO */ +#define F_ALM_FULL (1L<<27) (Rx) /* Bit 27: (Rx) FIFO almost full */ +#define F_EMPTY (1L<<27) (Tx) /* Bit 27: (Tx) FIFO empty flag */ +#define F_FIFO_EOF (1L<<26) /* Bit 26: Fag bit in FIFO */ #define F_WM_REACHED (1L<<25) /* Bit 25: Watermark reached */ - /* Bit 24: reserved */ + /* Bit 24: reserved */ #define F_FIFO_LEVEL (0x1fL<<16) /* Bit 23..16: # of Qwords in FIFO */ - /* Bit 15..11: reserved */ + /* Bit 15..11: reserved */ #define F_WATER_MARK 0x0007ffL /* Bit 10.. 0: Watermark */ /* Q_T1 32 bit Test Register 1 */ @@ -1166,9 +1171,9 @@ #define T2_STEP01 (1<<0) /* Bit 0: Inc AC/Dec BC by 1 */ /* Q_T3 32 bit Test Register 3 */ - /* Bit 31..7: reserved */ + /* Bit 31..7: reserved */ #define T3_MUX (7<<4) /* Bit 6.. 4: Mux Position */ - /* Bit 3: reserved */ + /* Bit 3: reserved */ #define T3_VRAM (7<<0) /* Bit 2.. 0: Virtual RAM Buffer Address */ /* RAM Buffer Register Offsets */ @@ -1187,7 +1192,7 @@ #define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ /* RB_TST2 8 bit RAM Buffer Test Register 2 */ - /* Bit 4..7: reserved */ + /* Bit 4..7: reserved */ #define RB_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */ #define RB_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */ #define RB_PC_T_OFF (1<<1) /* Bit 1: Packet Counter Tst Off */ @@ -1198,19 +1203,19 @@ #define RB_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */ #define RB_WP_T_OFF (1<<5) /* Bit 5: Write Pointer Test Off */ #define RB_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */ - /* Bit 3: reserved */ + /* Bit 3: reserved */ #define RB_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */ #define RB_RP_T_OFF (1<<1) /* Bit 1: Read Pointer Test Off */ #define RB_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */ /* RB_CTRL 8 bit RAM Buffer Control Register */ - /* Bit 7..6: reserved */ + /* Bit 7..6: reserved */ #define RB_ENA_STFWD (1<<5) /* Bit 5: Enable Store & Forward */ #define RB_DIS_STFWD (1<<4) /* Bit 4: Disab. Store & Forward */ #define RB_ENA_OP_MD (1<<3) /* Bit 3: Enable Operation Mode */ #define RB_DIS_OP_MD (1<<2) /* Bit 2: Disab. Operation Mode */ -#define RB_RST_CLR (1<<1) /* Bit 1: Clr RAM Buf STM Reset */ -#define RB_RST_SET (1<<0) /* Bit 0: Set RAM Buf STM Reset */ +#define RB_RST_CLR (1<<1) /* Bit 1: Clr RAM Buf STM Reset */ +#define RB_RST_SET (1<<0) /* Bit 0: Set RAM Buf STM Reset */ /* Receive and Transmit MAC FIFO Registers, use MR_ADDR() to address */ @@ -1225,11 +1230,11 @@ /* TX_MFF_RP 32 bit Transmit MAC FIFO Read Pointer */ /* TX_MFF_PC 32 bit Transmit MAC FIFO Packet Cnt */ /* TX_MFF_LEV 32 bit Transmit MAC FIFO Level */ - /* Bit 31..6: reserved */ + /* Bit 31..6: reserved */ #define MFF_MSK 0x007fL /* Bit 5..0: MAC FIFO Address/Pointer Bits */ /* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ - /* Bit 15..14: reserved */ + /* Bit 15..14: reserved */ #define MFF_ENA_RDY_PAT (1<<13) /* Bit 13: Enable Ready Patch */ #define MFF_DIS_RDY_PAT (1<<12) /* Bit 12: Disable Ready Patch */ #define MFF_ENA_TIM_PAT (1<<11) /* Bit 11: Enable Timing Patch */ @@ -1249,15 +1254,15 @@ /* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ #define MFF_CLR_PERR (1<<15) /* Bit 15: Clear Parity Error IRQ*/ - /* Bit 14: reserved */ + /* Bit 14: reserved */ #define MFF_ENA_PKT_REC (1<<13) /* Bit 13: Enable Packet Recovery*/ #define MFF_DIS_PKT_REC (1<<12) /* Bit 12: Disable Packet Recov. */ /* MFF_ENA_TIM_PAT (see RX_MFF_CTRL1)Bit 11: Enable Timing Patch */ /* MFF_DIS_TIM_PAT (see RX_MFF_CTRL1)Bit 10: Disable Timing Patch */ /* MFF_ENA_ALM_FUL (see RX_MFF_CTRL1)Bit 9: Enable AlmostFull Sign*/ /* MFF_DIS_ALM_FUL (see RX_MFF_CTRL1)Bit 8: Disab. AlmostFull Sign*/ -#define MFF_ENA_W4E (1<<7) /* Bit 7: Enable Wait for Empty */ -#define MFF_DIS_W4E (1<<6) /* Bit 6: Disab. Wait for Empty */ +#define MFF_ENA_W4E (1<<7) /* Bit 7: Enable Wait for Empty */ +#define MFF_DIS_W4E (1<<6) /* Bit 6: Disab. Wait for Empty */ /* MFF_ENA_FLUSH (see RX_MFF_CTRL1)Bit 5: Enable Frame Flushing */ /* MFF_DIS_FLUSH (see RX_MFF_CTRL1)Bit 4: Disab. Frame Flushing */ #define MFF_ENA_LOOPB (1<<3) /* Bit 3: Enable Loopback */ @@ -1269,61 +1274,61 @@ /* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ /* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ - /* Bit 7: reserved */ + /* Bit 7: reserved */ #define MFF_WSP_T_ON (1<<6) /* Bit 6: (Tx) Write Shadow Pt TestOn */ #define MFF_WSP_T_OFF (1<<5) /* Bit 5: (Tx) Write Shadow Pt TstOff */ -#define MFF_WSP_INC (1<<4) /* Bit 4: (Tx) Write Shadow Pt Increm */ -#define MFF_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */ -#define MFF_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */ +#define MFF_WSP_INC (1<<4) /* Bit 4: (Tx) Write Shadow Pt Increm */ +#define MFF_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */ +#define MFF_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */ #define MFF_PC_T_OFF (1<<1) /* Bit 1: Packet Counter Tst Off */ -#define MFF_PC_INC (1<<0) /* Bit 0: Packet Counter Increm */ +#define MFF_PC_INC (1<<0) /* Bit 0: Packet Counter Increm */ /* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ /* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ - /* Bit 7: reserved */ -#define MFF_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */ + /* Bit 7: reserved */ +#define MFF_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */ #define MFF_WP_T_OFF (1<<5) /* Bit 5: Write Pointer Test Off */ -#define MFF_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */ - /* Bit 3: reserved */ -#define MFF_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */ +#define MFF_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */ + /* Bit 3: reserved */ +#define MFF_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */ #define MFF_RP_T_OFF (1<<1) /* Bit 1: Read Pointer Test Off */ -#define MFF_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */ +#define MFF_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */ /* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ /* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ - /* Bit 7..4: reserved */ + /* Bit 7..4: reserved */ #define MFF_ENA_OP_MD (1<<3) /* Bit 3: Enable Operation Mode */ #define MFF_DIS_OP_MD (1<<2) /* Bit 2: Disab. Operation Mode */ -#define MFF_RST_CLR (1<<1) /* Bit 1: Clear MAC FIFO Reset */ -#define MFF_RST_SET (1<<0) /* Bit 0: Set MAC FIFO Reset */ +#define MFF_RST_CLR (1<<1) /* Bit 1: Clear MAC FIFO Reset */ +#define MFF_RST_SET (1<<0) /* Bit 0: Set MAC FIFO Reset */ /* Receive, Transmit, and Link LED Counter Registers */ -/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ -/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ -/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ - /* Bit 7..3: reserved */ +/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ +/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ +/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ + /* Bit 7..3: reserved */ #define LED_START (1<<2) /* Bit 2: Start Timer */ #define LED_STOP (1<<1) /* Bit 1: Stop Timer */ #define LED_STATE (1<<0) /* Bit 0:(Rx/Tx)LED State, 1=LED on */ #define LED_CLR_IRQ (1<<0) /* Bit 0:(Lnk) Clear Link IRQ */ -/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ -/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ -/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ - /* Bit 7..3: reserved */ +/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ +/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ +/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ + /* Bit 7..3: reserved */ #define LED_T_ON (1<<2) /* Bit 2: LED Counter Testmode On */ #define LED_T_OFF (1<<1) /* Bit 1: LED Counter Testmode Off */ #define LED_T_STEP (1<<0) /* Bit 0: LED Counter Step */ /* LNK_LED_REG 8 bit Link LED Register */ - /* Bit 7..6: reserved */ -#define LED_BLK_ON (1<<5) /* Bit 5: Link LED Blinking On */ -#define LED_BLK_OFF (1<<4) /* Bit 4: Link LED Blinking Off */ -#define LED_SYNC_ON (1<<3) /* Bit 3: Use Sync Wire to switch LED */ + /* Bit 7..6: reserved */ +#define LED_BLK_ON (1<<5) /* Bit 5: Link LED Blinking On */ +#define LED_BLK_OFF (1<<4) /* Bit 4: Link LED Blinking Off */ +#define LED_SYNC_ON (1<<3) /* Bit 3: Use Sync Wire to switch LED */ #define LED_SYNC_OFF (1<<2) /* Bit 2: Disable Sync Wire Input */ -#define LED_ON (1<<1) /* Bit 1: switch LED on */ -#define LED_OFF (1<<0) /* Bit 0: switch LED off */ +#define LED_ON (1<<1) /* Bit 1: switch LED on */ +#define LED_OFF (1<<0) /* Bit 0: switch LED off */ /* Receive and Transmit Descriptors ******************************************/ @@ -1331,42 +1336,42 @@ /* Transmit Descriptor struct */ typedef struct s_HwTxd { SK_U32 volatile TxCtrl; /* Transmit Buffer Control Field */ - SK_U32 TxNext ; /* Physical Address Pointer to the next TxD */ - SK_U32 TxAdrLo ; /* Physical Tx Buffer Address lower dword */ - SK_U32 TxAdrHi ; /* Physical Tx Buffer Address upper dword */ - SK_U32 TxStat ; /* Transmit Frame Status Word */ + SK_U32 TxNext; /* Physical Address Pointer to the next TxD */ + SK_U32 TxAdrLo; /* Physical Tx Buffer Address lower dword */ + SK_U32 TxAdrHi; /* Physical Tx Buffer Address upper dword */ + SK_U32 TxStat; /* Transmit Frame Status Word */ #ifndef SK_USE_REV_DESC - SK_U16 TxTcpOffs ; /* TCP Checksum Calculation Start Value */ - SK_U16 TxRes1 ; /* 16 bit reserved field */ - SK_U16 TxTcpWp ; /* TCP Checksum Write Position */ - SK_U16 TxTcpSp ; /* TCP Checksum Calculation Start Position */ + SK_U16 TxTcpOffs; /* TCP Checksum Calculation Start Value */ + SK_U16 TxRes1; /* 16 bit reserved field */ + SK_U16 TxTcpWp; /* TCP Checksum Write Position */ + SK_U16 TxTcpSp; /* TCP Checksum Calculation Start Position */ #else /* SK_USE_REV_DESC */ - SK_U16 TxRes1 ; /* 16 bit reserved field */ - SK_U16 TxTcpOffs ; /* TCP Checksum Calculation Start Value */ - SK_U16 TxTcpSp ; /* TCP Checksum Calculation Start Position */ - SK_U16 TxTcpWp ; /* TCP Checksum Write Position */ + SK_U16 TxRes1; /* 16 bit reserved field */ + SK_U16 TxTcpOffs; /* TCP Checksum Calculation Start Value */ + SK_U16 TxTcpSp; /* TCP Checksum Calculation Start Position */ + SK_U16 TxTcpWp; /* TCP Checksum Write Position */ #endif /* SK_USE_REV_DESC */ - SK_U32 TxRes2; /* 32 bit reserved field */ + SK_U32 TxRes2; /* 32 bit reserved field */ } SK_HWTXD; /* Receive Descriptor struct */ typedef struct s_HwRxd { SK_U32 volatile RxCtrl; /* Receive Buffer Control Field */ - SK_U32 RxNext ; /* Physical Address Pointer to the next TxD */ - SK_U32 RxAdrLo ; /* Physical Receive Buffer Address lower dword*/ - SK_U32 RxAdrHi ; /* Physical Receive Buffer Address upper dword*/ - SK_U32 RxStat ; /* Receive Frame Status Word */ - SK_U32 RxTiSt ; /* Receive Timestamp provided by the XMAC */ + SK_U32 RxNext; /* Physical Address Pointer to the next TxD */ + SK_U32 RxAdrLo; /* Physical Receive Buffer Address lower dword*/ + SK_U32 RxAdrHi; /* Physical Receive Buffer Address upper dword*/ + SK_U32 RxStat; /* Receive Frame Status Word */ + SK_U32 RxTiSt; /* Receive Timestamp provided by the XMAC */ #ifndef SK_USE_REV_DESC - SK_U16 RxTcpSum1 ; /* TCP Checksum 1 */ - SK_U16 RxTcpSum2 ; /* TCP Checksum 2 */ - SK_U16 RxTcpSp1 ; /* TCP Checksum Calculation Start Position 1 */ - SK_U16 RxTcpSp2 ; /* TCP Checksum Calculation Start Position 2 */ + SK_U16 RxTcpSum1; /* TCP Checksum 1 */ + SK_U16 RxTcpSum2; /* TCP Checksum 2 */ + SK_U16 RxTcpSp1; /* TCP Checksum Calculation Start Position 1 */ + SK_U16 RxTcpSp2; /* TCP Checksum Calculation Start Position 2 */ #else /* SK_USE_REV_DESC */ - SK_U16 RxTcpSum2 ; /* TCP Checksum 2 */ - SK_U16 RxTcpSum1 ; /* TCP Checksum 1 */ - SK_U16 RxTcpSp2 ; /* TCP Checksum Calculation Start Position 2 */ - SK_U16 RxTcpSp1 ; /* TCP Checksum Calculation Start Position 1 */ + SK_U16 RxTcpSum2; /* TCP Checksum 2 */ + SK_U16 RxTcpSum1; /* TCP Checksum 1 */ + SK_U16 RxTcpSp2; /* TCP Checksum Calculation Start Position 2 */ + SK_U16 RxTcpSp1; /* TCP Checksum Calculation Start Position 1 */ #endif /* SK_USE_REV_DESC */ } SK_HWRXD; @@ -1384,23 +1389,23 @@ /* Descriptor Bit Definition */ /* TxCtrl Transmit Buffer Control Field */ /* RxCtrl Receive Buffer Control Field */ -#define BMU_OWN (1UL<<31) /* Bit 31: OWN bit: 0=host/1=BMU */ -#define BMU_STF (1L<<30) /* Bit 30: Start of Frame ? */ -#define BMU_EOF (1L<<29) /* Bit 29: End of Frame ? */ -#define BMU_IRQ_EOB (1L<<28) /* Bit 28: Req "End of Buff" IRQ */ -#define BMU_IRQ_EOF (1L<<27) /* Bit 27: Req "End of Frame" IRQ*/ +#define BMU_OWN (1UL<<31) /* Bit 31: OWN bit: 0=host/1=BMU */ +#define BMU_STF (1L<<30) /* Bit 30: Start of Frame ? */ +#define BMU_EOF (1L<<29) /* Bit 29: End of Frame ? */ +#define BMU_IRQ_EOB (1L<<28) /* Bit 28: Req "End of Buff" IRQ */ +#define BMU_IRQ_EOF (1L<<27) /* Bit 27: Req "End of Frame" IRQ*/ /* TxCtrl specific bits */ -#define BMU_STFWD (1L<<26) /* Bit 26: (Tx) Store&Forward Frame */ -#define BMU_NO_FCS (1L<<25) /* Bit 25: (Tx) disable XMAC FCS gener*/ -#define BMU_SW (1L<<24) /* Bit 24: (Tx) 1 bit res. for SW use */ +#define BMU_STFWD (1L<<26) /* Bit 26: (Tx) Store&Forward Frame */ +#define BMU_NO_FCS (1L<<25) /* Bit 25: (Tx) disable XMAC FCS gener*/ +#define BMU_SW (1L<<24) /* Bit 24: (Tx) 1 bit res. for SW use */ /* RxCtrl specific bits */ -#define BMU_DEV_0 (1L<<26) /* Bit 26: (Rx) transfer data to Dev0 */ +#define BMU_DEV_0 (1L<<26) /* Bit 26: (Rx) transfer data to Dev0 */ #define BMU_STAT_VAL (1L<<25) /* Bit 25: (Rx) RxStat Valid */ #define BMU_TIST_VAL (1L<<24) /* Bit 24: (Rx) RxTiSt Valid */ - /* Bit 23..16: BMU Check Opcodes */ -#define BMU_CHECK 0x00550000L /* Default BMU check */ + /* Bit 23..16: BMU Check Opcodes */ +#define BMU_CHECK 0x00550000L /* Default BMU check */ #define BMU_TCP_CHECK 0x00560000L /* Descr with TCP ext */ -#define BMU_BBC 0x0000FFFFL /* Bit 15..0: Buffer Byte Counter */ +#define BMU_BBC 0x0000FFFFL /* Bit 15..0: Buffer Byte Counter */ /* TxStat Transmit Frame Status Word */ /* RxStat Receive Frame Status Word */ @@ -1417,8 +1422,8 @@ * FlashProm specification */ #define MAX_PAGES 0x20000L /* Every byte has a single page */ -#define MAX_FADDR 1 /* 1 byte per page */ -#define SKFDDI_PSZ 8 /* address PROM size */ +#define MAX_FADDR 1 /* 1 byte per page */ +#define SKFDDI_PSZ 8 /* address PROM size */ /* macros ********************************************************************/ @@ -1504,7 +1509,7 @@ * (p)Val Value or pointer to the value which should be read or * written. * - * usage: XM_OUT16(IoC, MAC_1, XM_MMU_CMD, Value) ; + * usage: XM_OUT16(IoC, MAC_1, XM_MMU_CMD, Value); */ #ifdef SK_LITTLE_ENDIAN @@ -1517,19 +1522,19 @@ #define XMA(Mac,Reg) (((0x1000 << (Mac)) + 0x1000) | ((Reg) << 1)) -#define XM_IN16(IoC,Mac,Reg,pVal) SK_IN16((IoC),XMA((Mac),(Reg)),(pVal)) -#define XM_OUT16(IoC,Mac,Reg,Val) SK_OUT16((IoC),XMA((Mac),(Reg)),(Val)) +#define XM_IN16(IoC,Mac,Reg,pVal) SK_IN16((IoC), XMA((Mac), (Reg)), (pVal)) +#define XM_OUT16(IoC,Mac,Reg,Val) SK_OUT16((IoC), XMA((Mac), (Reg)), (Val)) -#define XM_IN32(IoC,Mac,Reg,pVal) { \ - SK_IN16((IoC),XMA((Mac),(Reg)), \ +#define XM_IN32(IoC,Mac,Reg,pVal) { \ + SK_IN16((IoC), XMA((Mac), (Reg)), \ (SK_U16 *)&((SK_U16 *)(pVal))[XM_WORD_LO]); \ - SK_IN16((IoC),XMA((Mac),(Reg+2)), \ + SK_IN16((IoC), XMA((Mac), (Reg+2)), \ (SK_U16 *)&((SK_U16 *)(pVal))[XM_WORD_HI]); \ } -#define XM_OUT32(IoC,Mac,Reg,Val) { \ - SK_OUT16((IoC),XMA((Mac),(Reg)), (SK_U16)((Val) & 0x0000ffffL));\ - SK_OUT16((IoC),XMA((Mac),(Reg+2)),(SK_U16)(((Val)>>16) & 0x0000ffffL));\ +#define XM_OUT32(IoC,Mac,Reg,Val) { \ + SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16)((Val) & 0x0000ffffL)); \ + SK_OUT16((IoC), XMA((Mac), (Reg+2)),(SK_U16)(((Val)>>16) & 0x0000ffffL)); \ } /* @@ -1537,67 +1542,67 @@ */ #define XM_INADDR(IoC, Mac, Reg, pVal) { \ - SK_U16 Word; \ - SK_U8 *pByte; \ + SK_U16 Word; \ + SK_U8 *pByte; \ pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \ SK_IN16((IoC), XMA((Mac), (Reg)), &Word); \ - pByte[0] = (SK_U8) (Word & 0x00ff); \ - pByte[1] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[0] = (SK_U8)(Word & 0x00ff); \ + pByte[1] = (SK_U8)((Word >> 8) & 0x00ff); \ SK_IN16((IoC), XMA((Mac), (Reg+2)), &Word); \ - pByte[2] = (SK_U8) (Word & 0x00ff); \ - pByte[3] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[2] = (SK_U8)(Word & 0x00ff); \ + pByte[3] = (SK_U8)((Word >> 8) & 0x00ff); \ SK_IN16((IoC), XMA((Mac), (Reg+4)), &Word); \ - pByte[4] = (SK_U8) (Word & 0x00ff); \ - pByte[5] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[4] = (SK_U8)(Word & 0x00ff); \ + pByte[5] = (SK_U8)((Word >> 8) & 0x00ff); \ } #define XM_OUTADDR(IoC, Mac, Reg, pVal) { \ - SK_U8 *pByte; \ + SK_U8 *pByte; \ pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \ SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16) \ - (((SK_U16)(pByte[0]) & 0x00ff)| \ - (((SK_U16)(pByte[1]) << 8) & 0xff00))); \ - SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \ - (((SK_U16)(pByte[2]) & 0x00ff)| \ - (((SK_U16)(pByte[3]) << 8) & 0xff00))); \ - SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \ - (((SK_U16)(pByte[4]) & 0x00ff)| \ - (((SK_U16)(pByte[5]) << 8) & 0xff00))); \ + (((SK_U16)(pByte[0]) & 0x00ff) | \ + (((SK_U16)(pByte[1]) << 8) & 0xff00))); \ + SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \ + (((SK_U16)(pByte[2]) & 0x00ff) | \ + (((SK_U16)(pByte[3]) << 8) & 0xff00))); \ + SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \ + (((SK_U16)(pByte[4]) & 0x00ff) | \ + (((SK_U16)(pByte[5]) << 8) & 0xff00))); \ } #define XM_INHASH(IoC, Mac, Reg, pVal) { \ - SK_U16 Word; \ - SK_U8 *pByte; \ + SK_U16 Word; \ + SK_U8 *pByte; \ pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \ SK_IN16((IoC), XMA((Mac), (Reg)), &Word); \ - pByte[0] = (SK_U8) (Word & 0x00ff); \ - pByte[1] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[0] = (SK_U8)(Word & 0x00ff); \ + pByte[1] = (SK_U8)((Word >> 8) & 0x00ff); \ SK_IN16((IoC), XMA((Mac), (Reg+2)), &Word); \ - pByte[2] = (SK_U8) (Word & 0x00ff); \ - pByte[3] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[2] = (SK_U8)(Word & 0x00ff); \ + pByte[3] = (SK_U8)((Word >> 8) & 0x00ff); \ SK_IN16((IoC), XMA((Mac), (Reg+4)), &Word); \ - pByte[4] = (SK_U8) (Word & 0x00ff); \ - pByte[5] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[4] = (SK_U8)(Word & 0x00ff); \ + pByte[5] = (SK_U8)((Word >> 8) & 0x00ff); \ SK_IN16((IoC), XMA((Mac), (Reg+6)), &Word); \ - pByte[6] = (SK_U8) (Word & 0x00ff); \ - pByte[7] = (SK_U8) ((Word >> 8) & 0x00ff); \ + pByte[6] = (SK_U8)(Word & 0x00ff); \ + pByte[7] = (SK_U8)((Word >> 8) & 0x00ff); \ } #define XM_OUTHASH(IoC, Mac, Reg, pVal) { \ - SK_U8 *pByte; \ + SK_U8 *pByte; \ pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \ SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16) \ - (((SK_U16)(pByte[0]) & 0x00ff)| \ - (((SK_U16)(pByte[1]) << 8) & 0xff00))); \ - SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \ - (((SK_U16)(pByte[2]) & 0x00ff)| \ - (((SK_U16)(pByte[3]) << 8) & 0xff00))); \ - SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \ - (((SK_U16)(pByte[4]) & 0x00ff)| \ - (((SK_U16)(pByte[5]) << 8) & 0xff00))); \ - SK_OUT16((IoC), XMA((Mac), (Reg+6)), (SK_U16) \ - (((SK_U16)(pByte[6]) & 0x00ff)| \ - (((SK_U16)(pByte[7]) << 8) & 0xff00))); \ + (((SK_U16)(pByte[0]) & 0x00ff)| \ + (((SK_U16)(pByte[1]) << 8) & 0xff00))); \ + SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \ + (((SK_U16)(pByte[2]) & 0x00ff)| \ + (((SK_U16)(pByte[3]) << 8) & 0xff00))); \ + SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \ + (((SK_U16)(pByte[4]) & 0x00ff)| \ + (((SK_U16)(pByte[5]) << 8) & 0xff00))); \ + SK_OUT16((IoC), XMA((Mac), (Reg+6)), (SK_U16) \ + (((SK_U16)(pByte[6]) & 0x00ff)| \ + (((SK_U16)(pByte[7]) << 8) & 0xff00))); \ } /* @@ -1630,35 +1635,60 @@ * written. * * usage: PHY_READ(IoC, pPort, MAC_1, PHY_CTRL, Value); + * Warning: a PHY_READ on an uninitialized PHY (PHY still in reset) never + * comes back. This is checked in DEBUG mode. */ -#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \ - SK_U16 Mmu; \ - \ - XM_OUT16((IoC),(Mac), XM_PHY_ADDR, (PhyReg)|(pPort)->PhyAddr); \ - XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ - if ((pPort)->PhyType != SK_PHY_XMAC) { \ - do { \ - XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ - } while ((Mmu & XM_MMU_PHY_RDY) == 0); \ - XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ - } \ +#ifndef DEBUG +#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \ + SK_U16 Mmu; \ + \ + XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \ + XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ + if ((pPort)->PhyType != SK_PHY_XMAC) { \ + do { \ + XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ + } while ((Mmu & XM_MMU_PHY_RDY) == 0); \ + XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ + } \ +} +#else +#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \ + SK_U16 Mmu; \ + int __i = 0; \ + \ + XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \ + XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ + if ((pPort)->PhyType != SK_PHY_XMAC) { \ + do { \ + XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ + __i++; \ + if (__i > 100000) { \ + SK_DBG_PRINTF("*****************************\n"); \ + SK_DBG_PRINTF("PHY_READ on uninitialized PHY\n"); \ + SK_DBG_PRINTF("*****************************\n"); \ + break; \ + } \ + } while ((Mmu & XM_MMU_PHY_RDY) == 0); \ + XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \ + } \ } +#endif -#define PHY_WRITE(IoC, pPort, Mac, PhyReg, Val) { \ - SK_U16 Mmu; \ - \ - if ((pPort)->PhyType != SK_PHY_XMAC) { \ - do { \ - XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ - } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \ - } \ - XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg)|(pPort)->PhyAddr); \ - XM_OUT16((IoC), (Mac), XM_PHY_DATA, (Val)); \ - if ((pPort)->PhyType != SK_PHY_XMAC) { \ - do { \ - XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ - } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \ - } \ +#define PHY_WRITE(IoC, pPort, Mac, PhyReg, Val) { \ + SK_U16 Mmu; \ + \ + if ((pPort)->PhyType != SK_PHY_XMAC) { \ + do { \ + XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ + } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \ + } \ + XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \ + XM_OUT16((IoC), (Mac), XM_PHY_DATA, (Val)); \ + if ((pPort)->PhyType != SK_PHY_XMAC) { \ + do { \ + XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \ + } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \ + } \ } /* @@ -1703,7 +1733,7 @@ * Mode Mode to set for this LED */ #define SK_HWAC_LINK_LED(pAC, IoC, Port, Mode) \ -SK_OUT8(IoC, MR_ADDR(Port,LNK_LED_REG), Mode); + SK_OUT8(IoC, MR_ADDR(Port,LNK_LED_REG), Mode); /* typedefs *******************************************************************/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skgeinit.h linux.20p9/drivers/net/sk98lin/h/skgeinit.h --- linux.vanilla/drivers/net/sk98lin/h/skgeinit.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skgeinit.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skgeinit.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.45 $ - * Date: $Date: 1999/11/22 13:56:19 $ + * Version: $Revision: 1.51 $ + * Date: $Date: 2001/02/09 12:26:38 $ * Purpose: Structures and prototypes for the GE Init Module * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,26 @@ * History: * * $Log: skgeinit.h,v $ + * Revision 1.51 2001/02/09 12:26:38 cgoos + * Inserted #ifdef DIAG for half duplex workaround timer. + * + * Revision 1.50 2001/02/07 07:56:40 rassmann + * Corrected copyright. + * + * Revision 1.49 2001/01/31 15:32:18 gklug + * fix: problem with autosensing an SR8800 switch + * add: counter for autoneg timeouts + * + * Revision 1.48 2000/11/09 11:30:10 rassmann + * WA: Waiting after releasing reset until BCom chip is accessible. + * + * Revision 1.47 2000/10/18 12:22:40 cgoos + * Added workaround for half duplex hangup. + * + * Revision 1.46 2000/08/10 11:28:00 rassmann + * Editorial changes. + * Preserving 32-bit alignment in structs for the adapter context. + * * Revision 1.45 1999/11/22 13:56:19 cgoos * Changed license header to GPL. * @@ -436,6 +455,12 @@ */ #define SK_MAX_LRESTART 3 /* Max. 3 times the link is restarted */ +/* + * define max. autonegotiation timeouts before link detection in sense mode is + * reset. + */ +#define SK_MAX_ANEG_TO 10 /* Max. 10 times the sense mode is reset */ + /* structures *****************************************************************/ /* @@ -446,61 +471,71 @@ SK_TIMER PWaTimer; /* Workaround Timer */ #endif SK_U64 PPrevShorts; /* Previous short Counter checking */ - SK_U64 PPrevRx; /* Previous RxOk Counter checking */ - SK_U64 PPrevFcs; /* Previous FCS Error Counter checking */ - SK_U64 PRxLim; /* Previous RxOk Counter checking */ - int PLinkResCt; /* Link Restart Counter */ - int PAutoNegTimeOut;/* AutoNegotiation timeout current value */ - int PRxQSize; /* Port Rx Queue Size in kB */ - int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */ - int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB*/ + SK_U64 PPrevRx; /* Previous RxOk Counter checking */ + SK_U64 PPrevFcs; /* Previous FCS Error Counter checking */ + SK_U64 PRxLim; /* Previous RxOk Counter checking */ + SK_U64 LastOctets; /* For half duplex hang check */ +#ifndef SK_DIAG + SK_TIMER HalfDupChkTimer; +#endif + int PLinkResCt; /* Link Restart Counter */ + int PAutoNegTimeOut;/* AutoNegotiation timeout current value */ + int PAutoNegTOCt; /* AutoNeg Timeout Counter */ + int PRxQSize; /* Port Rx Queue Size in kB */ + int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */ + int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB*/ SK_U32 PRxQRamStart; /* Receive Queue RAM Buffer Start Address */ - SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */ + SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */ SK_U32 PXsQRamStart; /* Sync Tx Queue RAM Buffer Start Address */ - SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */ + SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */ SK_U32 PXaQRamStart; /* Async Tx Queue RAM Buffer Start Address */ - SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */ - int PRxQOff; /* Rx Queue Address Offset */ - int PXsQOff; /* Synchronous Tx Queue Address Offset */ - int PXaQOff; /* Asynchronous Tx Queue Address Offset */ - SK_U16 PRxCmd; /* Port Receive Command Configuration Value */ - SK_U16 PIsave; /* Saved Interrupt status word */ - SK_U16 PSsave; /* Saved PHY status word */ - SK_BOOL PHWLinkUp; /* The hardware Link is up (wireing) */ - SK_BOOL PState; /* Is port initialized ? */ + SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */ + int PRxQOff; /* Rx Queue Address Offset */ + int PXsQOff; /* Synchronous Tx Queue Address Offset */ + int PXaQOff; /* Asynchronous Tx Queue Address Offset */ + int PhyType; /* PHY used on this port */ + SK_U16 PhyAddr; /* MDIO/MDC PHY address */ + SK_U16 PRxCmd; /* Port Receive Command Configuration Value */ + SK_U16 PIsave; /* Saved Interrupt status word */ + SK_U16 PSsave; /* Saved PHY status word */ + SK_U16 Align01; + SK_BOOL PHWLinkUp; /* The hardware Link is up (wireing) */ + SK_BOOL PState; /* Is port initialized ? */ SK_BOOL PLinkBroken; /* Is Link broken ? */ - SK_BOOL PCheckPar; /* Do we check for parity errors ? */ - SK_U8 PLinkCap; /* Link Capabilities */ + SK_BOOL PCheckPar; /* Do we check for parity errors ? */ + SK_BOOL HalfDupTimerActive; + SK_U8 PLinkCap; /* Link Capabilities */ SK_U8 PLinkModeConf; /* Link Mode configured */ - SK_U8 PLinkMode; /* Link Mode currently used */ - SK_U8 PLinkModeStatus; /* Link Mode Status */ + SK_U8 PLinkMode; /* Link Mode currently used */ + SK_U8 PLinkModeStatus;/* Link Mode Status */ SK_U8 PFlowCtrlCap; /* Flow Control Capabilities */ SK_U8 PFlowCtrlMode; /* Flow Control Mode */ - SK_U8 PFlowCtrlStatus; /* Flow Control Status */ - SK_U8 PMSCap; /* Master/Slave Capabilities */ - SK_U8 PMSMode; /* Master/Slave Mode */ - SK_U8 PMSStatus; /* Master/Slave Status */ + SK_U8 PFlowCtrlStatus;/* Flow Control Status */ + SK_U8 PMSCap; /* Master/Slave Capabilities */ + SK_U8 PMSMode; /* Master/Slave Mode */ + SK_U8 PMSStatus; /* Master/Slave Status */ SK_U8 PAutoNegFail; /* Autonegotiation fail flag */ SK_U8 PLipaAutoNeg; /* Autonegotiation possible with Link Partner */ - int PhyType; /* PHY used on this port */ - SK_U16 PhyAddr; /* MDIO/MDC PHY address */ + SK_U8 Align02; } SK_GEPORT; /* * Gigabit Ethernet Initalization Struct - * (has to be included in the adapter context + * (has to be included in the adapter context) */ typedef struct s_GeInit { - int GIMacsFound; /* Number of MACs found on this adapter */ - int GIPciHwRev; /* PCI HW Revision Number */ - SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */ - int GIRamSize; /* The RAM size of the adapter in kB */ - int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */ - int GIPortUsage; /* driver port usage: SK_RED_LINK/SK_MUL_LINK */ - SK_U32 GIPollTimerVal; /* Descriptor Poll Timer Init Val in clk ticks*/ - int GILevel; /* Initialization Level Completed */ - SK_BOOL GIAnyPortAct; /* Is True if one or more port is initialized */ - SK_GEPORT GP[SK_MAX_MACS]; /* Port Dependent Information */ + int GIMacsFound; /* Number of MACs found on this adapter */ + int GIPciHwRev; /* PCI HW Revision Number */ + SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */ + int GIRamSize; /* The RAM size of the adapter in kB */ + int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */ + int GIPortUsage; /* driver port usage: SK_RED_LINK/SK_MUL_LINK */ + SK_U32 GIPollTimerVal; /* Descriptor Poll Timer Init Val in clk ticks*/ + int GILevel; /* Initialization Level Completed */ + SK_GEPORT GP[SK_MAX_MACS];/* Port Dependent Information */ + SK_BOOL GIAnyPortAct; /* Is True if one or more port is initialized */ + SK_U8 Align01; + SK_U16 Align02; } SK_GEINIT; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skgepnm2.h linux.20p9/drivers/net/sk98lin/h/skgepnm2.h --- linux.vanilla/drivers/net/sk98lin/h/skgepnm2.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skgepnm2.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skgepnm2.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.25 $ - * Date: $Date: 1999/11/22 13:57:41 $ + * Version: $Revision: 1.30 $ + * Date: $Date: 2001/02/06 10:03:41 $ * Purpose: Defines for Private Network Management Interface * ****************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,24 @@ * History: * * $Log: skgepnm2.h,v $ + * Revision 1.30 2001/02/06 10:03:41 mkunz + * - Pnmi V4 dual net support added. Interface functions and macros extended + * - Vpd bug fixed + * - OID_SKGE_MTU added + * + * Revision 1.29 2001/01/22 13:41:37 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.28 2000/08/03 15:12:48 rwahl + * - Additional comment for MAC statistic data structure. + * + * Revision 1.27 2000/08/01 16:10:18 rwahl + * - Added mac statistic data structure for StatRxLongFrame counter. + * + * Revision 1.26 2000/03/31 13:51:34 rwahl + * Added SK_UPTR cast to offset calculation for PNMI struct fields; + * missing cast caused compiler warnings by Win64 compiler. + * * Revision 1.25 1999/11/22 13:57:41 cgoos * Changed license header to GPL. * Allowing overwrite for SK_PNMI_STORE/_READ defines. @@ -149,8 +166,6 @@ /* * VPD releated defines */ -#define SK_PNMI_VPD_ARR_SIZE 40 -#define SK_PNMI_VPD_STR_SIZE 5 #define SK_PNMI_VPD_RW 1 #define SK_PNMI_VPD_RO 2 @@ -191,7 +206,8 @@ int Access; int (* Func)(SK_AC *pAc, SK_IOC pIo, int action, SK_U32 Id, char* pBuf, unsigned int* pLen, - SK_U32 Instance, unsigned int TableIndex); + SK_U32 Instance, unsigned int TableIndex, + SK_U32 NetNumber); SK_U16 Param; } SK_PNMI_TAB_ENTRY; @@ -207,6 +223,8 @@ /* * MAC statistic data structures + * Only for the first 64 counters: the number relates to the bit in the + * XMAC overflow status register */ #define SK_PNMI_HTX 0 #define SK_PNMI_HTX_OCTET 1 @@ -278,6 +296,8 @@ #define SK_PNMI_HTX_SYNC 64 #define SK_PNMI_HTX_SYNC_OCTET 65 +#define SK_PNMI_HRX_LONGFRAMES 66 + #define SK_PNMI_MAX_IDX (SK_PNMI_CNT_NO) /* @@ -292,25 +312,25 @@ /* * SK_PNMI_STRUCT_DATA copy offset evaluation macros */ -#define SK_PNMI_OFF(e) ((SK_U32)&(((SK_PNMI_STRUCT_DATA *)0)->e)) -#define SK_PNMI_MAI_OFF(e) ((SK_U32)&(((SK_PNMI_STRUCT_DATA *)0)->e)) -#define SK_PNMI_VPD_OFF(e) ((SK_U32)&(((SK_PNMI_VPD *)0)->e)) -#define SK_PNMI_SEN_OFF(e) ((SK_U32)&(((SK_PNMI_SENSOR *)0)->e)) -#define SK_PNMI_CHK_OFF(e) ((SK_U32)&(((SK_PNMI_CHECKSUM *)0)->e)) -#define SK_PNMI_STA_OFF(e) ((SK_U32)&(((SK_PNMI_STAT *)0)->e)) -#define SK_PNMI_CNF_OFF(e) ((SK_U32)&(((SK_PNMI_CONF *)0)->e)) -#define SK_PNMI_RLM_OFF(e) ((SK_U32)&(((SK_PNMI_RLMT *)0)->e)) -#define SK_PNMI_MON_OFF(e) ((SK_U32)&(((SK_PNMI_RLMT_MONITOR *)0)->e)) -#define SK_PNMI_TRP_OFF(e) ((SK_U32)&(((SK_PNMI_TRAP *)0)->e)) +#define SK_PNMI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e)) +#define SK_PNMI_MAI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e)) +#define SK_PNMI_VPD_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_VPD *)0)->e)) +#define SK_PNMI_SEN_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_SENSOR *)0)->e)) +#define SK_PNMI_CHK_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CHECKSUM *)0)->e)) +#define SK_PNMI_STA_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STAT *)0)->e)) +#define SK_PNMI_CNF_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CONF *)0)->e)) +#define SK_PNMI_RLM_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT *)0)->e)) +#define SK_PNMI_MON_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT_MONITOR *)0)->e)) +#define SK_PNMI_TRP_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_TRAP *)0)->e)) #define SK_PNMI_SET_STAT(b,s,o) {SK_U32 Val32; char *pVal; \ Val32 = (s); \ - pVal = (char *)(b) + ((SK_U32) \ + pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \ &(((SK_PNMI_STRUCT_DATA *)0)-> \ ReturnStatus.ErrorStatus)); \ SK_PNMI_STORE_U32(pVal, Val32); \ Val32 = (o); \ - pVal = (char *)(b) + ((SK_U32) \ + pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \ &(((SK_PNMI_STRUCT_DATA *)0)-> \ ReturnStatus.ErrorOffset)); \ SK_PNMI_STORE_U32(pVal, Val32);} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skgepnmi.h linux.20p9/drivers/net/sk98lin/h/skgepnmi.h --- linux.vanilla/drivers/net/sk98lin/h/skgepnmi.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skgepnmi.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skgepnmi.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.39 $ - * Date: $Date: 1999/12/06 10:09:47 $ + * Version: $Revision: 1.48 $ + * Date: $Date: 2001/02/23 14:34:24 $ * Purpose: Defines for Private Network Management Interface * ****************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,12 +26,53 @@ * History: * * $Log: skgepnmi.h,v $ + * Revision 1.48 2001/02/23 14:34:24 mkunz + * Changed macro PHYS2INST. Added pAC to Interface + * + * Revision 1.47 2001/02/07 08:28:23 mkunz + * - Added Oids: OID_SKGE_DIAG_ACTION + * OID_SKGE_DIAG_RESULT + * OID_SKGE_MULTICAST_LIST + * OID_SKGE_CURRENT_PACKET_FILTER + * OID_SKGE_INTERMEDIATE_SUPPORT + * - Changed value of OID_SKGE_MTU + * + * Revision 1.46 2001/02/06 10:01:41 mkunz + * - Pnmi V4 dual net support added. Interface functions and macros extended + * - Vpd bug fixed + * - OID_SKGE_MTU added + * + * Revision 1.45 2001/01/22 13:41:37 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.44 2000/09/07 07:35:27 rwahl + * - removed NDIS counter specific data type. + * - fixed spelling for OID_SKGE_RLMT_PORT_PREFERRED. + * + * Revision 1.43 2000/08/04 11:41:08 rwahl + * - Fixed compiler warning (port is always >= 0) for macros + * SK_PNMI_CNT_RX_LONGFRAMES & SK_PNMI_CNT_SYNC_OCTETS + * + * Revision 1.42 2000/08/03 15:14:07 rwahl + * - Corrected error in driver macros addressing a physical port. + * + * Revision 1.41 2000/08/01 16:22:29 rwahl + * - Changed MDB version to 3.1. + * - Added definitions for StatRxLongFrames counter. + * - Added macro to be used by driver to count long frames received. + * - Added directive to control width (default = 32bit) of NDIS statistic + * counters (SK_NDIS_64BIT_CTR). + * + * Revision 1.40 2000/03/31 13:51:34 rwahl + * Added SK_UPTR cast to offset calculation for PNMI struct fields; + * missing cast caused compiler warnings by Win64 compiler. + * * Revision 1.39 1999/12/06 10:09:47 rwahl * Added new error log message. * * Revision 1.38 1999/11/22 13:57:55 cgoos * Changed license header to GPL. - * + * * Revision 1.37 1999/09/14 14:25:32 rwahl * Set MDB version for 1000Base-T (sensors, Master/Slave) changes. * @@ -90,7 +130,7 @@ * * Revision 1.22 1998/11/03 12:05:51 mhaveman * Added pAC parameter to counter macors. - * + * * Revision 1.21 1998/11/02 10:47:36 mhaveman * Added syslog messages for internal errors. * @@ -165,33 +205,34 @@ #include "h/ski2c.h" #include "h/skaddr.h" #include "h/skrlmt.h" - +#include "h/skvpd.h" /* * Management Database Version */ -#define SK_PNMI_MDB_VERSION 0x00030000 /* 3.0 */ +#define SK_PNMI_MDB_VERSION 0x00030001 /* 3.1 */ /* * Event definitions */ -#define SK_PNMI_EVT_SIRQ_OVERFLOW 1 /* Counter overflow */ -#define SK_PNMI_EVT_SEN_WAR_LOW 2 /* Lower war thres exceeded */ -#define SK_PNMI_EVT_SEN_WAR_UPP 3 /* Upper war thres exceeded */ -#define SK_PNMI_EVT_SEN_ERR_LOW 4 /* Lower err thres exceeded */ -#define SK_PNMI_EVT_SEN_ERR_UPP 5 /* Upper err thres exceeded */ -#define SK_PNMI_EVT_CHG_EST_TIMER 6 /* Timer event for RLMT Chg */ +#define SK_PNMI_EVT_SIRQ_OVERFLOW 1 /* Counter overflow */ +#define SK_PNMI_EVT_SEN_WAR_LOW 2 /* Lower war thres exceeded */ +#define SK_PNMI_EVT_SEN_WAR_UPP 3 /* Upper war thres exceeded */ +#define SK_PNMI_EVT_SEN_ERR_LOW 4 /* Lower err thres exceeded */ +#define SK_PNMI_EVT_SEN_ERR_UPP 5 /* Upper err thres exceeded */ +#define SK_PNMI_EVT_CHG_EST_TIMER 6 /* Timer event for RLMT Chg */ #define SK_PNMI_EVT_UTILIZATION_TIMER 7 /* Timer event for Utiliza. */ -#define SK_PNMI_EVT_CLEAR_COUNTER 8 /* Clear statistic counters */ -#define SK_PNMI_EVT_XMAC_RESET 9 /* XMAC will be reset */ +#define SK_PNMI_EVT_CLEAR_COUNTER 8 /* Clear statistic counters */ +#define SK_PNMI_EVT_XMAC_RESET 9 /* XMAC will be reset */ -#define SK_PNMI_EVT_RLMT_PORT_UP 10 /* Port came logically up */ -#define SK_PNMI_EVT_RLMT_PORT_DOWN 11 /* Port went logically down */ -#define SK_PNMI_EVT_RLMT_PORT_SWITCH 12 /* Switched active port */ +#define SK_PNMI_EVT_RLMT_PORT_UP 10 /* Port came logically up */ +#define SK_PNMI_EVT_RLMT_PORT_DOWN 11 /* Port went logically down */ #define SK_PNMI_EVT_RLMT_SEGMENTATION 13 /* Two SP root bridges found */ #define SK_PNMI_EVT_RLMT_ACTIVE_DOWN 14 /* Port went logically down */ -#define SK_PNMI_EVT_RLMT_ACTIVE_UP 15 /* Port came logically up */ +#define SK_PNMI_EVT_RLMT_ACTIVE_UP 15 /* Port came logically up */ +#define SK_PNMI_EVT_RLMT_SET_NETS 16 /* 1. Parameter is number of nets + 1 = single net; 2 = dual net */ /* * Return values @@ -203,6 +244,7 @@ #define SK_PNMI_ERR_READ_ONLY 4 #define SK_PNMI_ERR_UNKNOWN_OID 5 #define SK_PNMI_ERR_UNKNOWN_INST 6 +#define SK_PNMI_ERR_UNKNOWN_NET 7 /* @@ -333,7 +375,7 @@ #define OID_SKGE_CHKSM_RX_ERR_CTS 0xFF020113 #define OID_SKGE_CHKSM_TX_OK_CTS 0xFF020114 #define OID_SKGE_CHKSM_TX_UNABLE_CTS 0xFF020115 - + #define OID_SKGE_STAT_TX 0xFF020120 #define OID_SKGE_STAT_TX_OCTETS 0xFF020121 #define OID_SKGE_STAT_TX_BROADCAST 0xFF020122 @@ -389,7 +431,11 @@ #define OID_SKGE_STAT_RX_511 0xFF020154 #define OID_SKGE_STAT_RX_1023 0xFF020155 #define OID_SKGE_STAT_RX_MAX 0xFF020156 - +#define OID_SKGE_STAT_RX_LONGFRAMES 0xFF020157 + +#define OID_SKGE_DIAG_ACTION 0xFF01011D +#define OID_SKGE_DIAG_RESULT 0xFF01011E +#define OID_SKGE_MTU 0xFF01011F #define OID_SKGE_PHYS_CUR_ADDR 0xFF010120 #define OID_SKGE_PHYS_FAC_ADDR 0xFF010121 #define OID_SKGE_PMD 0xFF010122 @@ -404,19 +450,22 @@ #define OID_SKGE_PHY_OPERATION_CAP 0xFF01012B #define OID_SKGE_PHY_OPERATION_MODE 0xFF01012C #define OID_SKGE_PHY_OPERATION_STATUS 0xFF01012D - +#define OID_SKGE_MULTICAST_LIST 0xFF01012E +#define OID_SKGE_CURRENT_PACKET_FILTER 0xFF01012F + #define OID_SKGE_TRAP 0xFF010130 #define OID_SKGE_TRAP_NUMBER 0xFF010131 #define OID_SKGE_RLMT_MODE 0xFF010140 #define OID_SKGE_RLMT_PORT_NUMBER 0xFF010141 #define OID_SKGE_RLMT_PORT_ACTIVE 0xFF010142 -#define OID_SKGE_RLMT_PORT_PREFERED 0xFF010143 +#define OID_SKGE_RLMT_PORT_PREFERRED 0xFF010143 +#define OID_SKGE_INTERMEDIATE_SUPPORT 0xFF010160 #define OID_SKGE_RLMT_CHANGE_CTS 0xFF020160 #define OID_SKGE_RLMT_CHANGE_TIME 0xFF020161 #define OID_SKGE_RLMT_CHANGE_ESTIM 0xFF020162 #define OID_SKGE_RLMT_CHANGE_THRES 0xFF020163 - + #define OID_SKGE_RLMT_PORT_INDEX 0xFF020164 #define OID_SKGE_RLMT_STATUS 0xFF020165 #define OID_SKGE_RLMT_TX_HELLO_CTS 0xFF020166 @@ -424,7 +473,7 @@ #define OID_SKGE_RLMT_TX_SP_REQ_CTS 0xFF020168 #define OID_SKGE_RLMT_RX_SP_CTS 0xFF020169 -#define OID_SKGE_RLMT_MONITOR_NUMBER 0xFF010150 +#define OID_SKGE_RLMT_MONITOR_NUMBER 0xFF010150 #define OID_SKGE_RLMT_MONITOR_INDEX 0xFF010151 #define OID_SKGE_RLMT_MONITOR_ADDR 0xFF010152 #define OID_SKGE_RLMT_MONITOR_ERRS 0xFF010153 @@ -448,7 +497,7 @@ #define OID_SKGE_ERR_RECOVERY_CTS 0xFF02017E #define OID_SKGE_SYSUPTIME 0xFF02017F -#define OID_SKGE_ALL_DATA 0xFF020190 +#define OID_SKGE_ALL_DATA 0xFF020190 #define OID_SKGE_TRAP_SEN_WAR_LOW 500 @@ -577,32 +626,40 @@ #define SK_PNMI_SET_DRIVER_VER(pAC,v) ((pAC)->Pnmi.pDriverVersion = \ (char *)(v)) -#define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v) \ + +#define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v,p) \ { \ - (pAC)->Pnmi.TxSwQueueLen = (SK_U64)(v); \ - if ((pAC)->Pnmi.TxSwQueueLen > (pAC)->Pnmi.TxSwQueueMax) { \ - (pAC)->Pnmi.TxSwQueueMax = (pAC)->Pnmi.TxSwQueueLen; \ + (pAC)->Pnmi.Port[p].TxSwQueueLen = (SK_U64)(v); \ + if ((pAC)->Pnmi.Port[p].TxSwQueueLen > (pAC)->Pnmi.Port[p].TxSwQueueMax) { \ + (pAC)->Pnmi.Port[p].TxSwQueueMax = (pAC)->Pnmi.Port[p].TxSwQueueLen; \ } \ } -#define SK_PNMI_CNT_TX_RETRY(pAC) (((pAC)->Pnmi.TxRetryCts)++) -#define SK_PNMI_CNT_RX_INTR(pAC) (((pAC)->Pnmi.RxIntrCts)++) -#define SK_PNMI_CNT_TX_INTR(pAC) (((pAC)->Pnmi.TxIntrCts)++) -#define SK_PNMI_CNT_NO_RX_BUF(pAC) (((pAC)->Pnmi.RxNoBufCts)++) -#define SK_PNMI_CNT_NO_TX_BUF(pAC) (((pAC)->Pnmi.TxNoBufCts)++) -#define SK_PNMI_CNT_USED_TX_DESCR(pAC,v) \ - ((pAC)->Pnmi.TxUsedDescrNo=(SK_U64)(v)); -#define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v) \ +#define SK_PNMI_CNT_TX_RETRY(pAC,p) (((pAC)->Pnmi.Port[p].TxRetryCts)++) +#define SK_PNMI_CNT_RX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].RxIntrCts)++) +#define SK_PNMI_CNT_TX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].TxIntrCts)++) +#define SK_PNMI_CNT_NO_RX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].RxNoBufCts)++) +#define SK_PNMI_CNT_NO_TX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].TxNoBufCts)++) +#define SK_PNMI_CNT_USED_TX_DESCR(pAC,v,p) \ + ((pAC)->Pnmi.Port[p].TxUsedDescrNo=(SK_U64)(v)); +#define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v,p) \ { \ - ((pAC)->Pnmi.RxDeliveredCts)++; \ - (pAC)->Pnmi.RxOctetsDeliveredCts += (SK_U64)(v); \ + ((pAC)->Pnmi.Port[p].RxDeliveredCts)++; \ + (pAC)->Pnmi.Port[p].RxOctetsDeliveredCts += (SK_U64)(v); \ } -#define SK_PNMI_CNT_ERR_RECOVERY(pAC) (((pAC)->Pnmi.ErrRecoveryCts)++); +#define SK_PNMI_CNT_ERR_RECOVERY(pAC,p) (((pAC)->Pnmi.Port[p].ErrRecoveryCts)++); #define SK_PNMI_CNT_SYNC_OCTETS(pAC,p,v) \ { \ - if (((p) >= 0) && ((p) < SK_MAX_MACS)) { \ - ((pAC)->Pnmi.StatSyncCts[p])++; \ - (pAC)->Pnmi.StatSyncOctetsCts[p] += (SK_U64)(v); \ + if ((p) < SK_MAX_MACS) { \ + ((pAC)->Pnmi.Port[p].StatSyncCts)++; \ + (pAC)->Pnmi.Port[p].StatSyncOctetsCts += (SK_U64)(v); \ + } \ + } + +#define SK_PNMI_CNT_RX_LONGFRAMES(pAC,p) \ + { \ + if ((p) < SK_MAX_MACS) { \ + ((pAC)->Pnmi.Port[p].StatRxLongFrameCts)++; \ } \ } @@ -613,14 +670,18 @@ #define SK_PNMI_PORT_LOG2INST(l) ((unsigned int)(l) + 1) #define SK_PNMI_PORT_PHYS2LOG(p) ((unsigned int)(p) + 1) #define SK_PNMI_PORT_LOG2PHYS(pAC,l) ((unsigned int)(l) - 1) -#define SK_PNMI_PORT_PHYS2INST(p) ((unsigned int)(p) + 2) +#define SK_PNMI_PORT_PHYS2INST(pAC,p) \ + (pAC->Pnmi.DualNetActiveFlag ? 2 : ((unsigned int)(p) + 2)) #define SK_PNMI_PORT_INST2PHYS(pAC,i) ((unsigned int)(i) - 2) /* * Structure definition for SkPnmiGetStruct and SkPnmiSetStruct */ -#define SK_PNMI_VPD_ENTRIES 20 -#define SK_PNMI_VPD_DATALEN 128 +#define SK_PNMI_VPD_KEY_SIZE 5 +#define SK_PNMI_VPD_BUFSIZE (VPD_SIZE) +#define SK_PNMI_VPD_ENTRIES (VPD_SIZE / 4) +#define SK_PNMI_VPD_DATALEN 128 /* Number of data bytes */ + #define SK_PNMI_MULTICAST_LISTLEN 64 #define SK_PNMI_SENSOR_ENTRIES (SK_MAX_SENSORS) #define SK_PNMI_CHECKSUM_ENTRIES 3 @@ -633,7 +694,7 @@ #define SK_PNMI_TRAP_QUEUE_LEN 512 typedef struct s_PnmiVpd { - char VpdKey[5]; + char VpdKey[SK_PNMI_VPD_KEY_SIZE]; char VpdValue[SK_PNMI_VPD_DATALEN]; SK_U8 VpdAccess; SK_U8 VpdAction; @@ -695,6 +756,7 @@ SK_U64 StatRxBroadcastOkCts; SK_U64 StatRxMulticastOkCts; SK_U64 StatRxUnicastOkCts; + SK_U64 StatRxLongFramesCts; SK_U64 StatRxPauseMacCtrlCts; SK_U64 StatRxMacCtrlCts; SK_U64 StatRxPauseMacCtrlErrorCts; @@ -764,7 +826,7 @@ SK_U32 MgmtDBVersion; SK_PNMI_REQUEST_STATUS ReturnStatus; SK_U32 VpdFreeBytes; - char VpdEntriesList[SK_PNMI_VPD_DATALEN]; + char VpdEntriesList[SK_PNMI_VPD_ENTRIES * SK_PNMI_VPD_KEY_SIZE]; SK_U32 VpdEntriesNumber; SK_PNMI_VPD Vpd[SK_PNMI_VPD_ENTRIES]; SK_U32 PortNumber; @@ -774,6 +836,7 @@ char HwDescr[SK_PNMI_STRINGLEN1]; char HwVersion[SK_PNMI_STRINGLEN2]; SK_U16 Chipset; + SK_U32 MtuSize; SK_U32 Action; SK_U32 TestResult; SK_U8 BusType; @@ -817,8 +880,9 @@ } SK_PNMI_STRUCT_DATA; #define SK_PNMI_STRUCT_SIZE (sizeof(SK_PNMI_STRUCT_DATA)) -#define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)&(((SK_PNMI_STRUCT_DATA *)0)->\ - VpdFreeBytes)) /* +#define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)(SK_UPTR)\ + &(((SK_PNMI_STRUCT_DATA *)0)->VpdFreeBytes)) + /* * ReturnStatus field * must be located * before VpdFreeBytes @@ -830,7 +894,7 @@ #define SK_PNMI_MAX_PROTOS 3 #define SK_PNMI_SCNT_NOT 64 -#define SK_PNMI_CNT_NO 66 +#define SK_PNMI_CNT_NO 67 /* * Estimate data structure @@ -851,9 +915,26 @@ SK_U64 CounterOffset[SK_PNMI_CNT_NO]; SK_U64 StatSyncCts; SK_U64 StatSyncOctetsCts; + SK_U64 StatRxLongFrameCts; SK_BOOL ActiveFlag; + SK_U64 TxSwQueueLen; + SK_U64 TxSwQueueMax; + SK_U64 TxRetryCts; + SK_U64 RxIntrCts; + SK_U64 TxIntrCts; + SK_U64 RxNoBufCts; + SK_U64 TxNoBufCts; + SK_U64 TxUsedDescrNo; + SK_U64 RxDeliveredCts; + SK_U64 RxOctetsDeliveredCts; + SK_U64 RxHwErrorsCts; + SK_U64 TxHwErrorsCts; + SK_U64 InErrorsCts; + SK_U64 OutErrorsCts; + SK_U64 ErrRecoveryCts; } SK_PNMI_PORT; + typedef struct s_PnmiData { SK_PNMI_PORT Port[SK_MAX_MACS]; SK_U64 VirtualCounterOffset[SK_PNMI_CNT_NO]; @@ -884,19 +965,8 @@ char PciBusWidth; char PMD; char Connector; - - SK_U64 TxSwQueueLen; - SK_U64 TxSwQueueMax; - SK_U64 TxRetryCts; - SK_U64 RxIntrCts; - SK_U64 TxIntrCts; - SK_U64 RxNoBufCts; - SK_U64 TxNoBufCts; - SK_U64 TxUsedDescrNo; - SK_U64 RxDeliveredCts; - SK_U64 RxOctetsDeliveredCts; - SK_U64 ErrRecoveryCts; SK_U64 StartUpTime; + SK_BOOL DualNetActiveFlag; } SK_PNMI; @@ -905,17 +975,17 @@ */ extern int SkPnmiInit(SK_AC *pAc, SK_IOC IoC, int level); extern int SkPnmiGetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id, void* pBuf, - unsigned int* pLen, SK_U32 Instance); + unsigned int* pLen, SK_U32 Instance, SK_U32 NetIndex); extern int SkPnmiPreSetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id, - void* pBuf, unsigned int *pLen, SK_U32 Instance); + void* pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); extern int SkPnmiSetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id, void* pBuf, - unsigned int *pLen, SK_U32 Instance); + unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); extern int SkPnmiGetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf, - unsigned int *pLen); + unsigned int *pLen, SK_U32 NetIndex); extern int SkPnmiPreSetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf, - unsigned int *pLen); + unsigned int *pLen, SK_U32 NetIndex); extern int SkPnmiSetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf, - unsigned int *pLen); + unsigned int *pLen, SK_U32 NetIndex); extern int SkPnmiEvent(SK_AC *pAc, SK_IOC IoC, SK_U32 Event, SK_EVPARA Param); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skgesirq.h linux.20p9/drivers/net/sk98lin/h/skgesirq.h --- linux.vanilla/drivers/net/sk98lin/h/skgesirq.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skgesirq.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skgesirq.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.20 $ - * Date: $Date: 1999/12/06 10:00:44 $ + * Version: $Revision: 1.22 $ + * Date: $Date: 2000/11/09 11:30:10 $ * Purpose: SK specific Gigabit Ethernet special IRQ functions * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2000 SysKonnect GmbH. * * 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 @@ -26,6 +25,12 @@ * * History: * $Log: skgesirq.h,v $ + * Revision 1.22 2000/11/09 11:30:10 rassmann + * WA: Waiting after releasing reset until BCom chip is accessible. + * + * Revision 1.21 2000/10/18 12:22:40 cgoos + * Added workaround for half duplex hangup. + * * Revision 1.20 1999/12/06 10:00:44 cgoos * Added SET event for role. * @@ -106,10 +111,13 @@ #define SK_HWEV_SET_LMODE 6 /* Set Link Mode by PNMI */ #define SK_HWEV_SET_FLOWMODE 7 /* Set Flow Control Mode by PNMI */ #define SK_HWEV_SET_ROLE 8 /* Set Master/Slave (Role) by PNMI */ +#define SK_HWEV_HALFDUP_CHK 9 /* Set Master/Slave (Role) by PNMI */ #define SK_WA_ACT_TIME (5000000L) /* 5 sec */ #define SK_WA_INA_TIME (100000L) /* 100 msec */ +#define SK_HALFDUP_CHK_TIME (10000L) /* 10 msec */ + /* * Define the error numbers and messages */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/ski2c.h linux.20p9/drivers/net/sk98lin/h/ski2c.h --- linux.vanilla/drivers/net/sk98lin/h/ski2c.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/ski2c.h Wed Jul 4 16:03:55 2001 @@ -2,8 +2,8 @@ * * Name: ski2c.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.28 $ - * Date: $Date: 1999/11/22 13:55:46 $ + * Version: $Revision: 1.30 $ + * Date: $Date: 2001/04/05 11:38:09 $ * Purpose: Defines to access Voltage and Temperature Sensor * (taken from Monalisa (taken from Concentrator)) * @@ -28,6 +28,14 @@ * History: * * $Log: ski2c.h,v $ + * Revision 1.30 2001/04/05 11:38:09 rassmann + * Set SenState to idle in SkI2cWaitIrq(). + * Changed error message in SkI2cWaitIrq(). + * + * Revision 1.29 2000/08/03 14:28:17 rassmann + * - Added function to wait for I2C being ready before resetting the board. + * - Replaced one duplicate "out of range" message with correct one. + * * Revision 1.28 1999/11/22 13:55:46 cgoos * Changed license header to GPL. * @@ -178,24 +186,26 @@ #define SKERR_I2C_E014MSG "WARNING: fan sensor out of range" #define SKERR_I2C_E015 (SKERR_I2C_E014+1) #define SKERR_I2C_E015MSG "ERROR: fan sensor out of range" +#define SKERR_I2C_E016 (SKERR_I2C_E015+1) +#define SKERR_I2C_E016MSG "I2C: active transfer does not complete.\n" /* * Define Timeout values */ -#define SK_I2C_TIM_LONG 2000000L /* 2 second */ -#define SK_I2C_TIM_SHORT 100000L /* 100 milli second */ +#define SK_I2C_TIM_LONG 2000000L /* 2 seconds */ +#define SK_I2C_TIM_SHORT 100000L /* 100 milliseconds */ /* * Define trap and error log hold times */ #ifndef SK_SEN_ERR_TR_HOLD -#define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC) +#define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC) #endif #ifndef SK_SEN_ERR_LOG_HOLD -#define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC) +#define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC) #endif #ifndef SK_SEN_WARN_TR_HOLD -#define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC) +#define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC) #endif #ifndef SK_SEN_WARN_LOG_HOLD #define SK_SEN_WARN_LOG_HOLD (15*60*SK_TICKS_PER_SEC) @@ -257,10 +267,11 @@ extern int SkI2cReadSensor(SK_AC *pAC, SK_IOC IoC, SK_SENSOR *pSen); #ifndef SK_DIAG -extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, - SK_EVPARA Para); +extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para); extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level); +extern void SkI2cWaitIrq(SK_AC *pAC, SK_IOC IoC); extern void SkI2cIsr(SK_AC *pAC, SK_IOC IoC); #endif #endif /* n_SKI2C_H */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skrlmt.h linux.20p9/drivers/net/sk98lin/h/skrlmt.h --- linux.vanilla/drivers/net/sk98lin/h/skrlmt.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/skrlmt.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skrlmt.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.27 $ - * Date: $Date: 1999/11/22 13:59:56 $ + * Version: $Revision: 1.32 $ + * Date: $Date: 2001/02/14 14:06:31 $ * Purpose: Header file for Redundant Link ManagemenT. * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,14 +26,26 @@ * History: * * $Log: skrlmt.h,v $ + * Revision 1.32 2001/02/14 14:06:31 rassmann + * Editorial changes. + * + * Revision 1.31 2001/02/05 14:25:26 rassmann + * Prepared RLMT for transparent operation. + * + * Revision 1.30 2001/01/22 13:41:39 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.29 2000/11/17 08:58:00 rassmann + * Moved CheckSwitch from SK_RLMT_PACKET_RECEIVED to SK_RLMT_TIM event. + * + * Revision 1.28 2000/11/09 12:24:34 rassmann + * Editorial changes. + * * Revision 1.27 1999/11/22 13:59:56 cgoos * Changed license header to GPL. * * Revision 1.26 1999/10/04 14:01:19 rassmann - * Corrected reaction to reception of BPDU frames. - * Added parameter descriptions to "For Readme" section skrlmt.txt. - * Clarified usage of lookahead result *pForRlmt. - * Requested driver to present RLMT packets as soon as poosible. + * Corrected reaction to reception of BPDU frames (#10441). * * Revision 1.25 1999/07/20 12:53:39 rassmann * Fixed documentation errors for lookahead macros. @@ -149,7 +160,7 @@ #define __INC_SKRLMT_H #ifdef __cplusplus -xxxx /* not supported yet - force error */ +#error C++ is not yet supported. extern "C" { #endif /* cplusplus */ @@ -169,128 +180,140 @@ /* ----- PORT states ----- */ -#define SK_RLMT_PS_INIT 0 /* Port state: Init. */ +#define SK_RLMT_PS_INIT 0 /* Port state: Init. */ #define SK_RLMT_PS_LINK_DOWN 1 /* Port state: Link down. */ -#define SK_RLMT_PS_DOWN 2 /* Port state: Port down. */ -#define SK_RLMT_PS_GOING_UP 3 /* Port state: Going up. */ -#define SK_RLMT_PS_UP 4 /* Port state: Up. */ +#define SK_RLMT_PS_DOWN 2 /* Port state: Port down. */ +#define SK_RLMT_PS_GOING_UP 3 /* Port state: Going up. */ +#define SK_RLMT_PS_UP 4 /* Port state: Up. */ /* ----- RLMT states ----- */ -#define SK_RLMT_RS_INIT 0 /* RLMT state: Init. */ -#define SK_RLMT_RS_NET_DOWN 1 /* RLMT state: Net down. */ -#define SK_RLMT_RS_NET_UP 2 /* RLMT state: Net up. */ +#define SK_RLMT_RS_INIT 0 /* RLMT state: Init. */ +#define SK_RLMT_RS_NET_DOWN 1 /* RLMT state: Net down. */ +#define SK_RLMT_RS_NET_UP 2 /* RLMT state: Net up. */ /* ----- PORT events ----- */ -#define SK_RLMT_LINK_UP 1001 /* Link came up. */ -#define SK_RLMT_LINK_DOWN 1002 /* Link went down. */ -#define SK_RLMT_PORT_ADDR 1003 /* Port address changed. */ +#define SK_RLMT_LINK_UP 1001 /* Link came up. */ +#define SK_RLMT_LINK_DOWN 1002 /* Link went down. */ +#define SK_RLMT_PORT_ADDR 1003 /* Port address changed. */ /* ----- RLMT events ----- */ -#define SK_RLMT_START 2001 /* Start RLMT. */ -#define SK_RLMT_STOP 2002 /* Stop RLMT. */ +#define SK_RLMT_START 2001 /* Start RLMT. */ +#define SK_RLMT_STOP 2002 /* Stop RLMT. */ #define SK_RLMT_PACKET_RECEIVED 2003 /* Packet was received for RLMT. */ -#define SK_RLMT_STATS_CLEAR 2004 /* Clear statistics. */ +#define SK_RLMT_STATS_CLEAR 2004 /* Clear statistics. */ #define SK_RLMT_STATS_UPDATE 2005 /* Update statistics. */ #define SK_RLMT_PREFPORT_CHANGE 2006 /* Change preferred port. */ -#define SK_RLMT_MODE_CHANGE 2007 /* New RlmtMode. */ +#define SK_RLMT_MODE_CHANGE 2007 /* New RlmtMode. */ +#define SK_RLMT_SET_NETS 2008 /* Number of Nets (1 or 2). */ /* ----- RLMT mode bits ----- */ -#define SK_RLMT_CHECK_LINK 1 /* Check Link. */ -#define SK_RLMT_CHECK_LOC_LINK 2 /* Check other link on same adapter. */ -#define SK_RLMT_CHECK_SEG 4 /* Check segmentation. */ +/* + * CAUTION: These defines are private to RLMT. + * Please use the RLMT mode defines below. + */ + +#define SK_RLMT_CHECK_LINK 1 /* Check Link. */ +#define SK_RLMT_CHECK_LOC_LINK 2 /* Check other link on same adapter. */ +#define SK_RLMT_CHECK_SEG 4 /* Check segmentation. */ #ifndef RLMT_CHECK_REMOTE #define SK_RLMT_CHECK_OTHERS SK_RLMT_CHECK_LOC_LINK #else /* RLMT_CHECK_REMOTE */ -#define SK_RLMT_CHECK_REM_LINK 8 /* Check link(s) on other adapter(s). */ +#define SK_RLMT_CHECK_REM_LINK 8 /* Check link(s) on other adapter(s). */ #define SK_RLMT_MAX_REMOTE_PORTS_CHECKED 3 -#define SK_RLMT_CHECK_OTHERS (SK_RLMT_CHECK_LOC_LINK | \ - SK_RLMT_CHECK_REM_LINK) +#define SK_RLMT_CHECK_OTHERS \ + (SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK) #endif /* RLMT_CHECK_REMOTE */ +#ifndef SK_RLMT_ENABLE_TRANSPARENT +#define SK_RLMT_TRANSPARENT 0 /* RLMT transparent - inactive. */ +#else /* SK_RLMT_ENABLE_TRANSPARENT */ +#define SK_RLMT_TRANSPARENT 128 /* RLMT transparent. */ +#endif /* SK_RLMT_ENABLE_TRANSPARENT */ + /* ----- RLMT modes ----- */ /* Check Link State. */ #define SK_RLMT_MODE_CLS (SK_RLMT_CHECK_LINK) /* Check Local Ports: check other links on the same adapter. */ -#define SK_RLMT_MODE_CLP (SK_RLMT_CHECK_LINK | \ - SK_RLMT_CHECK_LOC_LINK) +#define SK_RLMT_MODE_CLP (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK) /* Check Local Ports and Segmentation Status. */ -#define SK_RLMT_MODE_CLPSS (SK_RLMT_CHECK_LINK | \ - SK_RLMT_CHECK_LOC_LINK | \ - SK_RLMT_CHECK_SEG) +#define SK_RLMT_MODE_CLPSS \ + (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_SEG) #ifdef RLMT_CHECK_REMOTE /* Check Local and Remote Ports: check links (local or remote). */ Name of define TBD! -#define SK_RLMT_MODE_CRP (SK_RLMT_CHECK_LINK | \ - SK_RLMT_CHECK_LOC_LINK | \ - SK_RLMT_CHECK_REM_LINK) +#define SK_RLMT_MODE_CRP \ + (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK) /* Check Local and Remote Ports and Segmentation Status. */ Name of define TBD! -#define SK_RLMT_MODE_CRPSS (SK_RLMT_CHECK_LINK | \ - SK_RLMT_CHECK_LOC_LINK | \ - SK_RLMT_CHECK_REM_LINK | \ - SK_RLMT_CHECK_SEG) +#define SK_RLMT_MODE_CRPSS \ + (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | \ + SK_RLMT_CHECK_REM_LINK | SK_RLMT_CHECK_SEG) #endif /* RLMT_CHECK_REMOTE */ /* ----- RLMT lookahead result bits ----- */ -#define SK_RLMT_RX_RLMT 1 /* Give packet to RLMT. */ -#define SK_RLMT_RX_PROTOCOL 2 /* Give packet to protocol. */ +#define SK_RLMT_RX_RLMT 1 /* Give packet to RLMT. */ +#define SK_RLMT_RX_PROTOCOL 2 /* Give packet to protocol. */ /* Macros */ #if 0 SK_AC *pAC /* adapter context */ -SK_U32 PortIdx /* receiving port */ -unsigned PacketLength /* received packet's length */ -SK_BOOL IsBc /* Flag: broadcast received */ -unsigned *pOffset /* Result: offset of bytes to present - to SK_RLMT_LOOKAHEAD */ -unsigned *pNumBytes /* Result: #Bytes to present - to SK_RLMT_LOOKAHEAD */ +SK_U32 PortNum /* receiving port */ +unsigned PktLen /* received packet's length */ +SK_BOOL IsBc /* Flag: packet is broadcast */ +unsigned *pOffset /* offs. of bytes to present to SK_RLMT_LOOKAHEAD */ +unsigned *pNumBytes /* #Bytes to present to SK_RLMT_LOOKAHEAD */ #endif /* 0 */ - -#define SK_RLMT_PRE_LOOKAHEAD(pAC,PortIdx,PacketLength,IsBc,pOffset,pNumBytes) { \ +#define SK_RLMT_PRE_LOOKAHEAD(pAC,PortNum,PktLen,IsBc,pOffset,pNumBytes) { \ SK_AC *_pAC; \ - SK_U32 _PortIdx; \ + SK_U32 _PortNum; \ _pAC = (pAC); \ - _PortIdx = (SK_U32)(PortIdx); \ - _pAC->Rlmt.Port[_PortIdx].PacketsRx++; \ - _pAC->Rlmt.Port[_PortIdx].PacketsPerTimeSlot++; \ - if ((IsBc) && _pAC->Rlmt.RlmtMode != SK_RLMT_MODE_CLS) { \ - *(pOffset) = 6; \ - *(pNumBytes) = 6; \ + _PortNum = (SK_U32)(PortNum); \ + /* _pAC->Rlmt.Port[_PortNum].PacketsRx++; */ \ + _pAC->Rlmt.Port[_PortNum].PacketsPerTimeSlot++; \ + if ((_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_TRANSPARENT) != 0) { \ + *(pNumBytes) = 0; \ + } \ + else if (IsBc) { \ + if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode != SK_RLMT_MODE_CLS) { \ + *(pNumBytes) = 6; \ + *(pOffset) = 6; \ + } \ + else { \ + *(pNumBytes) = 0; \ + } \ } \ else { \ - *(pOffset) = 0; \ - if ((PacketLength) > SK_RLMT_MAX_TX_BUF_SIZE) { \ - _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \ + if ((PktLen) > SK_RLMT_MAX_TX_BUF_SIZE) { \ + /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \ *(pNumBytes) = 0; \ } \ else { \ *(pNumBytes) = 6; \ + *(pOffset) = 0; \ } \ } \ } #if 0 SK_AC *pAC /* adapter context */ -SK_U32 PortIdx /* receiving port */ +SK_U32 PortNum /* receiving port */ SK_U8 *pLaPacket, /* received packet's data (points to pOffset) */ -SK_BOOL IsBc /* Flag: broadcast received */ -SK_BOOL IsMc /* Flag: multicast received */ -unsigned *pForRlmt /* Result: bits SK_RLMT_RX_RLMT, - SK_RLMT_RX_PROTOCOL */ +SK_BOOL IsBc /* Flag: packet is broadcast */ +SK_BOOL IsMc /* Flag: packet is multicast */ +unsigned *pForRlmt /* Result: bits SK_RLMT_RX_RLMT, SK_RLMT_RX_PROTOCOL */ SK_RLMT_LOOKAHEAD() expects *pNumBytes from packet offset *pOffset (s.a.) at *pLaPacket. @@ -298,29 +321,28 @@ BC, MC, or UC, you should use constants for IsBc and IsMc, so that your compiler can trash unneeded parts of the if construction. #endif /* 0 */ -#define SK_RLMT_LOOKAHEAD(pAC,PortIdx,pLaPacket,IsBc,IsMc,pForRlmt) { \ + +#define SK_RLMT_LOOKAHEAD(pAC,PortNum,pLaPacket,IsBc,IsMc,pForRlmt) { \ SK_AC *_pAC; \ - SK_U32 _PortIdx; \ + SK_U32 _PortNum; \ SK_U8 *_pLaPacket; \ _pAC = (pAC); \ - _PortIdx = (SK_U32)(PortIdx); \ + _PortNum = (SK_U32)(PortNum); \ _pLaPacket = (SK_U8 *)(pLaPacket); \ if (IsBc) {\ - if (!SK_ADDR_EQUAL( \ - _pLaPacket, \ - _pAC->Addr.CurrentMacAddress.a)) { \ - _pAC->Rlmt.Port[_PortIdx].BcTimeStamp = \ - SkOsGetTime(_pAC); \ + if (!SK_ADDR_EQUAL(_pLaPacket, _pAC->Addr.Net[_pAC->Rlmt.Port[ \ + _PortNum].Net->NetNumber].CurrentMacAddress.a)) { \ + _pAC->Rlmt.Port[_PortNum].BcTimeStamp = SkOsGetTime(_pAC); \ + _pAC->Rlmt.CheckSwitch = SK_TRUE; \ } \ - _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \ + /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \ *(pForRlmt) = SK_RLMT_RX_PROTOCOL; \ } \ else if (IsMc) { \ if (SK_ADDR_EQUAL(_pLaPacket, BridgeMcAddr.a)) { \ - _pAC->Rlmt.Port[_PortIdx].BpduPacketsPerTimeSlot++; \ - if (_pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { \ - *(pForRlmt) = SK_RLMT_RX_RLMT | \ - SK_RLMT_RX_PROTOCOL; \ + _pAC->Rlmt.Port[_PortNum].BpduPacketsPerTimeSlot++; \ + if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_CHECK_SEG) { \ + *(pForRlmt) = SK_RLMT_RX_RLMT | SK_RLMT_RX_PROTOCOL; \ } \ else { \ *(pForRlmt) = SK_RLMT_RX_PROTOCOL; \ @@ -330,18 +352,18 @@ *(pForRlmt) = SK_RLMT_RX_RLMT; \ } \ else { \ - _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \ + /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \ *(pForRlmt) = SK_RLMT_RX_PROTOCOL; \ } \ } \ else { \ if (SK_ADDR_EQUAL( \ _pLaPacket, \ - _pAC->Addr.Port[_PortIdx].CurrentMacAddress.a)) { \ + _pAC->Addr.Port[_PortNum].CurrentMacAddress.a)) { \ *(pForRlmt) = SK_RLMT_RX_RLMT; \ } \ else { \ - _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \ + /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \ *(pForRlmt) = SK_RLMT_RX_PROTOCOL; \ } \ } \ @@ -350,107 +372,143 @@ #ifdef SK_RLMT_FAST_LOOKAHEAD Error: SK_RLMT_FAST_LOOKAHEAD no longer used. Use new macros for lookahead. #endif /* SK_RLMT_FAST_LOOKAHEAD */ +#ifdef SK_RLMT_SLOW_LOOKAHEAD +Error: SK_RLMT_SLOW_LOOKAHEAD no longer used. Use new macros for lookahead. +#endif /* SK_RLMT_SLOW_LOOKAHEAD */ /* typedefs *******************************************************************/ +#ifdef SK_RLMT_MBUF_PRIVATE +typedef struct s_RlmtMbuf { + some content +} SK_RLMT_MBUF; +#endif /* SK_RLMT_MBUF_PRIVATE */ + + +#ifdef SK_LA_INFO +typedef struct s_Rlmt_PacketInfo { + unsigned PacketLength; /* Length of packet. */ + unsigned PacketType; /* Directed/Multicast/Broadcast. */ +} SK_RLMT_PINFO; +#endif /* SK_LA_INFO */ + + typedef struct s_RootId { - SK_U8 Id[8]; /* Root Bridge Id. */ + SK_U8 Id[8]; /* Root Bridge Id. */ } SK_RLMT_ROOT_ID; + typedef struct s_port { SK_MAC_ADDR CheckAddr; SK_BOOL SuspectTx; } SK_PORT_CHECK; + +typedef struct s_RlmtNet SK_RLMT_NET; + + typedef struct s_RlmtPort { /* ----- Public part (read-only) ----- */ - SK_U8 PortState; /* Current state of this port. */ + SK_U8 PortState; /* Current state of this port. */ /* For PNMI */ - - SK_BOOL LinkDown; - SK_BOOL PortDown; - - SK_U64 TxHelloCts; - SK_U64 RxHelloCts; - SK_U64 TxSpHelloReqCts; - SK_U64 RxSpHelloCts; + SK_BOOL LinkDown; + SK_BOOL PortDown; + SK_U8 Align01; + + SK_U32 PortNumber; /* Number of port on adapter. */ + SK_RLMT_NET * Net; /* Net port belongs to. */ + + SK_U64 TxHelloCts; + SK_U64 RxHelloCts; + SK_U64 TxSpHelloReqCts; + SK_U64 RxSpHelloCts; /* ----- Private part ----- */ - SK_BOOL PortStarted; /* Port is started. */ - SK_BOOL PortNoRx; /* NoRx for >= 1 time slot. */ - SK_U32 CheckingState; /* Checking State. */ - - SK_U64 PacketsRx; /* Total packets received. */ - SK_U32 PacketsPerTimeSlot; /* Packets rxed between TOs. */ - SK_U32 DataPacketsPerTimeSlot; /* Data packets ... */ -#if 0 - SK_U32 RlmtAcksPerTimeSlot; /* RLMT Acks rxed in TS. */ - SK_U32 RlmtChksPerTimeSlot; /* RLMT Chks rxed in TS. */ -#endif /* 0 */ - SK_U32 BpduPacketsPerTimeSlot; /* BPDU packets rxed in TS. */ - SK_U64 BcTimeStamp; /* Time of last BC receive. */ - SK_U64 GuTimeStamp; /* Time of entering GOING_UP. */ - - SK_TIMER UpTimer; /* Timer struct Link/Port up. */ - SK_TIMER DownRxTimer; /* Timer struct down rx. */ - SK_TIMER DownTxTimer; /* Timer struct down tx. */ - - SK_U8 Random[4]; /* Random value. */ - unsigned PortsChecked; /* #ports checked. */ - unsigned PortsSuspect; /* #ports checked that are s. */ +/* SK_U64 PacketsRx; */ /* Total packets received. */ + SK_U32 PacketsPerTimeSlot; /* Packets rxed between TOs. */ +/* SK_U32 DataPacketsPerTimeSlot; */ /* Data packets ... */ + SK_U32 BpduPacketsPerTimeSlot; /* BPDU packets rxed in TS. */ + SK_U64 BcTimeStamp; /* Time of last BC receive. */ + SK_U64 GuTimeStamp; /* Time of entering GOING_UP. */ + + SK_TIMER UpTimer; /* Timer struct Link/Port up. */ + SK_TIMER DownRxTimer; /* Timer struct down rx. */ + SK_TIMER DownTxTimer; /* Timer struct down tx. */ + + SK_U32 CheckingState; /* Checking State. */ + + SK_ADDR_PORT * AddrPort; + + SK_U8 Random[4]; /* Random value. */ + unsigned PortsChecked; /* #ports checked. */ + unsigned PortsSuspect; /* #ports checked that are s. */ SK_PORT_CHECK PortCheck[1]; /* SK_PORT_CHECK PortCheck[SK_MAX_MACS - 1]; */ - SK_BOOL RootIdSet; - SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */ + SK_BOOL PortStarted; /* Port is started. */ + SK_BOOL PortNoRx; /* NoRx for >= 1 time slot. */ + SK_BOOL RootIdSet; + SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */ } SK_RLMT_PORT; -#ifdef SK_RLMT_MBUF_PRIVATE -typedef struct s_RlmtMbuf { - some content -} SK_RLMT_MBUF; -#endif /* SK_RLMT_MBUF_PRIVATE */ -#ifdef SK_LA_INFO -typedef struct s_Rlmt_PacketInfo { - unsigned PacketLength; /* Length of packet. */ - unsigned PacketType; /* Directed/Multicast/Broadcast. */ -} SK_RLMT_PINFO; -#endif /* SK_LA_INFO */ - -typedef struct s_Rlmt { +struct s_RlmtNet { /* ----- Public part (read-only) ----- */ - SK_U8 RlmtState; /* Current RLMT state. */ - SK_RLMT_PORT Port[SK_MAX_MACS]; /* Array of available ports. */ - SK_U32 PrefPort; /* Preferred port. */ + SK_U32 NetNumber; /* Number of net. */ + + SK_RLMT_PORT * Port[SK_MAX_MACS]; /* Ports that belong to this net. */ + SK_U32 NumPorts; /* Number of ports. */ + SK_U32 PrefPort; /* Preferred port. */ /* For PNMI */ - SK_U32 RlmtMode; /* Check ... */ - SK_U32 MacActive; /* Active port. */ - SK_U32 MacPreferred; /* 0xFFFFFFFF: Automatic. */ + SK_U32 RlmtMode; /* Check ... */ + SK_U32 ActivePort; /* Active port. */ + SK_U32 Preference; /* 0xFFFFFFFF: Automatic. */ + + SK_U8 RlmtState; /* Current RLMT state. */ + +/* ----- Private part ----- */ + SK_BOOL RootIdSet; + SK_U16 Align01; + + int LinksUp; /* #Links up. */ + int PortsUp; /* #Ports up. */ + SK_U32 TimeoutValue; /* RLMT timeout value. */ + + SK_U32 CheckingState; /* Checking State. */ + SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */ + + SK_TIMER LocTimer; /* Timer struct. */ + SK_TIMER SegTimer; /* Timer struct. */ +}; + + +typedef struct s_Rlmt { + +/* ----- Public part (read-only) ----- */ + + SK_U32 NumNets; /* Number of nets. */ + SK_U32 NetsStarted; /* Number of nets started. */ + SK_RLMT_NET Net[SK_MAX_NETS]; /* Array of available nets. */ + SK_RLMT_PORT Port[SK_MAX_MACS]; /* Array of available ports. */ /* ----- Private part ----- */ + SK_BOOL CheckSwitch; + SK_U8 Align01; + SK_U16 Align02; - int LinksUp; /* #Links up. */ - int PortsUp; /* #Ports up. */ - SK_U32 TimeoutValue; /* RLMT timeout value. */ - SK_TIMER LocTimer; /* Timer struct. */ - - SK_U32 CheckingState; /* Checking State. */ - SK_BOOL RootIdSet; - SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */ - SK_TIMER SegTimer; /* Timer struct. */ } SK_RLMT; + extern SK_MAC_ADDR BridgeMcAddr; -extern SK_MAC_ADDR SkRlmtMcAddr; +extern SK_MAC_ADDR SkRlmtMcAddr; /* function prototypes ********************************************************/ @@ -464,16 +522,7 @@ extern void SkRlmtInit( SK_AC *pAC, SK_IOC IoC, - int Level); - -#ifdef SK_RLMT_SLOW_LOOKAHEAD -extern SK_BOOL SkRlmtLookaheadPacket( - SK_AC *pAC, - SK_U32 PortIdx, - SK_U8 *pLaPacket, - unsigned PacketLength, - unsigned LaLength); -#endif /* SK_RLMT_SLOW_LOOKAHEAD */ + int Level); extern int SkRlmtEvent( SK_AC *pAC, @@ -481,11 +530,11 @@ SK_U32 Event, SK_EVPARA Para); -#else /* defined(SK_KR_PROTO)) */ +#else /* defined(SK_KR_PROTO) */ /* Non-ANSI/C++ compliant function prototypes */ -xxxx /* not supported yet - force error */ +#error KR-style function prototypes are not yet provided. #endif /* defined(SK_KR_PROTO)) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/skversion.h linux.20p9/drivers/net/sk98lin/h/skversion.h --- linux.vanilla/drivers/net/sk98lin/h/skversion.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/sk98lin/h/skversion.h Wed Jul 4 16:03:55 2001 @@ -0,0 +1,46 @@ +/****************************************************************************** + * + * Name: version.h + * Project: GEnesis, PCI Gigabit Ethernet Adapter + * Version: $Revision: 1.1 $ + * Date: $Date: 2001/03/06 09:25:00 $ + * Purpose: SK specific Error log support + * + ******************************************************************************/ + +/****************************************************************************** + * + * (C)Copyright 1998,1999 SysKonnect, + * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * + * 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. + * + * The information in this file is provided "AS IS" without warranty. + * + ******************************************************************************/ + +/****************************************************************************** + * + * History: + * $Log: skversion.h,v $ + * Revision 1.1 2001/03/06 09:25:00 mlindner + * first version + * + * + * + ******************************************************************************/ + + +static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect GmbH."; +static const char SysKonnectBuildNumber[] = + "@(#)SK-BUILD: 4.07 PL: 01"; + +#define BOOT_STRING "sk98lin: Network Device Driver v4.07\n" \ + "Copyright (C) 2000-2001 SysKonnect GmbH." + +#define VER_STRING "4.07" + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/h/xmac_ii.h linux.20p9/drivers/net/sk98lin/h/xmac_ii.h --- linux.vanilla/drivers/net/sk98lin/h/xmac_ii.h Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/h/xmac_ii.h Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: xmac_ii.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.26 $ - * Date: $Date: 1999/11/22 14:03:00 $ + * Version: $Revision: 1.28 $ + * Date: $Date: 2000/11/09 12:32:49 $ * Purpose: Defines and Macros for XaQti's Gigabit Ethernet Controller * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2000 SysKonnect GmbH. * * 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 @@ -27,6 +26,12 @@ * History: * * $Log: xmac_ii.h,v $ + * Revision 1.28 2000/11/09 12:32:49 rassmann + * Renamed variables. + * + * Revision 1.27 2000/05/17 11:00:46 malthoff + * Add bit for enable/disable power management in BCOM chip. + * * Revision 1.26 1999/11/22 14:03:00 cgoos * Changed license header to GPL. * @@ -142,40 +147,40 @@ * Note: NA reg = Network Address e.g DA, SA etc. * */ -#define XM_MMU_CMD 0x0000 /* 16 bit r/w MMU Command Register */ +#define XM_MMU_CMD 0x0000 /* 16 bit r/w MMU Command Register */ /* 0x0004: reserved */ -#define XM_POFF 0x0008 /* 32 bit r/w Packet Offset Register */ -#define XM_BURST 0x000c /* 32 bit r/w Burst Register for half duplex*/ +#define XM_POFF 0x0008 /* 32 bit r/w Packet Offset Register */ +#define XM_BURST 0x000c /* 32 bit r/w Burst Register for half duplex*/ #define XM_1L_VLAN_TAG 0x0010 /* 16 bit r/w One Level VLAN Tag ID */ #define XM_2L_VLAN_TAG 0x0014 /* 16 bit r/w Two Level VLAN Tag ID */ /* 0x0018 - 0x001e: reserved */ -#define XM_TX_CMD 0x0020 /* 16 bit r/w Transmit Command Register */ +#define XM_TX_CMD 0x0020 /* 16 bit r/w Transmit Command Register */ #define XM_TX_RT_LIM 0x0024 /* 16 bit r/w Transmit Retry Limit Register */ -#define XM_TX_STIME 0x0028 /* 16 bit r/w Transmit Slottime Register */ -#define XM_TX_IPG 0x002c /* 16 bit r/w Transmit Inter Packet Gap */ -#define XM_RX_CMD 0x0030 /* 16 bit r/w Receive Command Register */ -#define XM_PHY_ADDR 0x0034 /* 16 bit r/w PHY Address Register */ -#define XM_PHY_DATA 0x0038 /* 16 bit r/w PHY Data Register */ +#define XM_TX_STIME 0x0028 /* 16 bit r/w Transmit Slottime Register */ +#define XM_TX_IPG 0x002c /* 16 bit r/w Transmit Inter Packet Gap */ +#define XM_RX_CMD 0x0030 /* 16 bit r/w Receive Command Register */ +#define XM_PHY_ADDR 0x0034 /* 16 bit r/w PHY Address Register */ +#define XM_PHY_DATA 0x0038 /* 16 bit r/w PHY Data Register */ /* 0x003c: reserved */ -#define XM_GP_PORT 0x0040 /* 32 bit r/w General Purpose Port Register */ -#define XM_IMSK 0x0044 /* 16 bit r/w Interrupt Mask Register */ -#define XM_ISRC 0x0048 /* 16 bit ro Interrupt Status Register */ -#define XM_HW_CFG 0x004c /* 16 bit r/w Hardware Config Register */ +#define XM_GP_PORT 0x0040 /* 32 bit r/w General Purpose Port Register */ +#define XM_IMSK 0x0044 /* 16 bit r/w Interrupt Mask Register */ +#define XM_ISRC 0x0048 /* 16 bit ro Interrupt Status Register */ +#define XM_HW_CFG 0x004c /* 16 bit r/w Hardware Config Register */ /* 0x0050 - 0x005e: reserved */ -#define XM_TX_LO_WM 0x0060 /* 16 bit r/w Tx FIFO Low Water Mark */ -#define XM_TX_HI_WM 0x0062 /* 16 bit r/w Tx FIFO High Water Mark */ -#define XM_TX_THR 0x0064 /* 16 bit r/w Tx Request Threshold */ -#define XM_HT_THR 0x0066 /* 16 bit r/w Host Request Threshold */ -#define XM_PAUSE_DA 0x0068 /* NA reg r/w Pause Destination Address */ +#define XM_TX_LO_WM 0x0060 /* 16 bit r/w Tx FIFO Low Water Mark */ +#define XM_TX_HI_WM 0x0062 /* 16 bit r/w Tx FIFO High Water Mark */ +#define XM_TX_THR 0x0064 /* 16 bit r/w Tx Request Threshold */ +#define XM_HT_THR 0x0066 /* 16 bit r/w Host Request Threshold */ +#define XM_PAUSE_DA 0x0068 /* NA reg r/w Pause Destination Address */ /* 0x006e: reserved */ -#define XM_CTL_PARA 0x0070 /* 32 bit r/w Control Parameter Register */ +#define XM_CTL_PARA 0x0070 /* 32 bit r/w Control Parameter Register */ #define XM_MAC_OPCODE 0x0074 /* 16 bit r/w Opcode for MAC control frames */ #define XM_MAC_PTIME 0x0076 /* 16 bit r/w Pause time for MAC ctrl frames*/ -#define XM_TX_STAT 0x0078 /* 32 bit ro Tx Status LIFO Register */ +#define XM_TX_STAT 0x0078 /* 32 bit ro Tx Status LIFO Register */ /* 0x0080 - 0x00fc: 16 NA reg r/w Exakt Match Address Registers */ /* use the XM_EMX() macro to address */ -#define XM_EXM_START 0x0080 /* r/w Start Address of the EXM Regs */ +#define XM_EXM_START 0x0080 /* r/w Start Address of the EXM Regs */ /* * XM_EXM(Reg) @@ -188,18 +193,18 @@ */ #define XM_EXM(Reg) (XM_EXM_START + ((Reg) << 3)) -#define XM_SRC_CHK 0x0100 /* NA reg r/w Source Check Address Register */ -#define XM_SA 0x0108 /* NA reg r/w Station Address Register */ -#define XM_HSM 0x0110 /* 64 bit r/w Hash Match Address Registers */ -#define XM_RX_LO_WM 0x0118 /* 16 bit r/w Receive Low Water Mark */ -#define XM_RX_HI_WM 0x011a /* 16 bit r/w Receive High Water Mark */ -#define XM_RX_THR 0x011c /* 32 bit r/w Receive Request Threshold */ -#define XM_DEV_ID 0x0120 /* 32 bit ro Device ID Register */ -#define XM_MODE 0x0124 /* 32 bit r/w Mode Register */ -#define XM_LSA 0x0128 /* NA reg ro Last Source Register */ +#define XM_SRC_CHK 0x0100 /* NA reg r/w Source Check Address Register */ +#define XM_SA 0x0108 /* NA reg r/w Station Address Register */ +#define XM_HSM 0x0110 /* 64 bit r/w Hash Match Address Registers */ +#define XM_RX_LO_WM 0x0118 /* 16 bit r/w Receive Low Water Mark */ +#define XM_RX_HI_WM 0x011a /* 16 bit r/w Receive High Water Mark */ +#define XM_RX_THR 0x011c /* 32 bit r/w Receive Request Threshold */ +#define XM_DEV_ID 0x0120 /* 32 bit ro Device ID Register */ +#define XM_MODE 0x0124 /* 32 bit r/w Mode Register */ +#define XM_LSA 0x0128 /* NA reg ro Last Source Register */ /* 0x012e: reserved */ -#define XM_TS_READ 0x0130 /* 32 bit ro TimeStamp Read Regeister */ -#define XM_TS_LOAD 0x0134 /* 32 bit ro TimeStamp Load Value */ +#define XM_TS_READ 0x0130 /* 32 bit ro TimeStamp Read Regeister */ +#define XM_TS_LOAD 0x0134 /* 32 bit ro TimeStamp Load Value */ /* 0x0138 - 0x01fe: reserved */ #define XM_STAT_CMD 0x0200 /* 16 bit r/w Statistics Command Register */ #define XM_RX_CNT_EV 0x0204 /* 32 bit ro Rx Counter Event Register */ @@ -207,13 +212,13 @@ #define XM_RX_EV_MSK 0x020c /* 32 bit r/w Rx Counter Event Mask */ #define XM_TX_EV_MSK 0x0210 /* 32 bit r/w Tx Counter Event Mask */ /* 0x0204 - 0x027e: reserved */ -#define XM_TXF_OK 0x0280 /* 32 bit ro Frames Transmitted OK Conuter */ +#define XM_TXF_OK 0x0280 /* 32 bit ro Frames Transmitted OK Conuter */ #define XM_TXO_OK_HI 0x0284 /* 32 bit ro Octets Transmitted OK High Cnt*/ #define XM_TXO_OK_LO 0x0288 /* 32 bit ro Octets Transmitted OK Low Cnt */ #define XM_TXF_BC_OK 0x028c /* 32 bit ro Broadcast Frames Xmitted OK */ #define XM_TXF_MC_OK 0x0290 /* 32 bit ro Multicast Frames Xmitted OK */ #define XM_TXF_UC_OK 0x0294 /* 32 bit ro Unicast Frames Xmitted OK */ -#define XM_TXF_LONG 0x0298 /* 32 bit ro Tx Long Frame Counter */ +#define XM_TXF_LONG 0x0298 /* 32 bit ro Tx Long Frame Counter */ #define XM_TXE_BURST 0x029c /* 32 bit ro Tx Burst Event Counter */ #define XM_TXF_MPAUSE 0x02a0 /* 32 bit ro Tx Pause MAC Ctrl Frame Cnt */ #define XM_TXF_MCTRL 0x02a4 /* 32 bit ro Tx MAC Ctrl Frame Counter */ @@ -221,20 +226,20 @@ #define XM_TXF_MUL_COL 0x02ac /* 32 bit ro Tx Multiple Collision Counter */ #define XM_TXF_ABO_COL 0x02b0 /* 32 bit ro Tx aborted due to Exessive Col*/ #define XM_TXF_LAT_COL 0x02b4 /* 32 bit ro Tx Late Collision Counter */ -#define XM_TXF_DEF 0x02b8 /* 32 bit ro Tx Deferred Frame Counter */ +#define XM_TXF_DEF 0x02b8 /* 32 bit ro Tx Deferred Frame Counter */ #define XM_TXF_EX_DEF 0x02bc /* 32 bit ro Tx Excessive Deferall Counter */ #define XM_TXE_FIFO_UR 0x02c0 /* 32 bit ro Tx FIFO Underrun Event Cnt */ #define XM_TXE_CS_ERR 0x02c4 /* 32 bit ro Tx Carrier Sence Error Cnt */ -#define XM_TXP_UTIL 0x02c8 /* 32 bit ro Tx Utilization in % */ +#define XM_TXP_UTIL 0x02c8 /* 32 bit ro Tx Utilization in % */ /* 0x02cc - 0x02ce: reserved */ -#define XM_TXF_64B 0x02d0 /* 32 bit ro 64 Byte Tx Frame Counter */ -#define XM_TXF_127B 0x02d4 /* 32 bit ro 65-127 Byte Tx Frame Counter */ -#define XM_TXF_255B 0x02d8 /* 32 bit ro 128-255 Byte Tx Frame Counter */ -#define XM_TXF_511B 0x02dc /* 32 bit ro 256-511 Byte Tx Frame Counter */ +#define XM_TXF_64B 0x02d0 /* 32 bit ro 64 Byte Tx Frame Counter */ +#define XM_TXF_127B 0x02d4 /* 32 bit ro 65-127 Byte Tx Frame Counter */ +#define XM_TXF_255B 0x02d8 /* 32 bit ro 128-255 Byte Tx Frame Counter */ +#define XM_TXF_511B 0x02dc /* 32 bit ro 256-511 Byte Tx Frame Counter */ #define XM_TXF_1023B 0x02e0 /* 32 bit ro 512-1023 Byte Tx Frame Counter*/ #define XM_TXF_MAX_SZ 0x02e4 /* 32 bit ro 1024-MaxSize Byte Tx Frame Cnt*/ /* 0x02e8 - 0x02fe: reserved */ -#define XM_RXF_OK 0x0300 /* 32 bit ro Frames Received OK */ +#define XM_RXF_OK 0x0300 /* 32 bit ro Frames Received OK */ #define XM_RXO_OK_HI 0x0304 /* 32 bit ro Octets Received OK High Cnt */ #define XM_RXO_OK_LO 0x0308 /* 32 bit ro Octets Received OK Low Counter*/ #define XM_RXF_BC_OK 0x030c /* 32 bit ro Broadcast Frames Received OK */ @@ -253,17 +258,17 @@ #define XM_RXF_LEN_ERR 0x0340 /* 32 bit ro Rx in Range Length Error */ #define XM_RXE_SYM_ERR 0x0344 /* 32 bit ro Rx Symbol Error Counter */ #define XM_RXE_SHT_ERR 0x0348 /* 32 bit ro Rx Short Event Error Cnt */ -#define XM_RXE_RUNT 0x034c /* 32 bit ro Rx Runt Event Counter */ +#define XM_RXE_RUNT 0x034c /* 32 bit ro Rx Runt Event Counter */ #define XM_RXF_LNG_ERR 0x0350 /* 32 bit ro Rx Frame too Long Error Cnt */ #define XM_RXF_FCS_ERR 0x0354 /* 32 bit ro Rx Frame Check Seq. Error Cnt */ /* 0x0358 - 0x035a: reserved */ #define XM_RXF_CEX_ERR 0x035c /* 32 bit ro Rx Carrier Ext Error Frame Cnt*/ -#define XM_RXP_UTIL 0x0360 /* 32 bit ro Rx Utilization in % */ +#define XM_RXP_UTIL 0x0360 /* 32 bit ro Rx Utilization in % */ /* 0x0364 - 0x0366: reserved */ -#define XM_RXF_64B 0x0368 /* 32 bit ro 64 Byte Rx Frame Counter */ -#define XM_RXF_127B 0x036c /* 32 bit ro 65-127 Byte Rx Frame Counter */ -#define XM_RXF_255B 0x0370 /* 32 bit ro 128-255 Byte Rx Frame Counter */ -#define XM_RXF_511B 0x0374 /* 32 bit ro 256-511 Byte Rx Frame Counter */ +#define XM_RXF_64B 0x0368 /* 32 bit ro 64 Byte Rx Frame Counter */ +#define XM_RXF_127B 0x036c /* 32 bit ro 65-127 Byte Rx Frame Counter */ +#define XM_RXF_255B 0x0370 /* 32 bit ro 128-255 Byte Rx Frame Counter */ +#define XM_RXF_511B 0x0374 /* 32 bit ro 256-511 Byte Rx Frame Counter */ #define XM_RXF_1023B 0x0378 /* 32 bit ro 512-1023 Byte Rx Frame Counter*/ #define XM_RXF_MAX_SZ 0x037c /* 32 bit ro 1024-MaxSize Byte Rx Frame Cnt*/ /* 0x02e8 - 0x02fe: reserved */ @@ -281,12 +286,12 @@ */ /* XM_MMU_CMD 16 bit r/w MMU Comamnd Register */ - /* Bit 15..13: reserved */ + /* Bit 15..13: reserved */ #define XM_MMU_PHY_RDY (1<<12) /* Bit 12: PHY Read Ready */ #define XM_MMU_PHY_BUSY (1<<11) /* Bit 11: PHY Busy */ #define XM_MMU_IGN_PF (1<<10) /* Bit 10: Ignore Pause Frame */ #define XM_MMU_MAC_LB (1<<9) /* Bit 9: Enable MAC Loopback */ - /* Bit 8: reserved */ + /* Bit 8: reserved */ #define XM_MMU_FRC_COL (1<<7) /* Bit 7: Force Collision */ #define XM_MMU_SIM_COL (1<<6) /* Bit 6: Simulate Collision */ #define XM_MMU_NO_PRE (1<<5) /* Bit 5: No MDIO Preamble */ @@ -298,8 +303,8 @@ /* XM_TX_CMD 16 bit r/w Transmit Command Register */ - /* Bit 15..7: reserved */ -#define XM_TX_BK2BK (1<<6) /* Bit 6: Ignor Carrier Sense (tx Bk2Bk)*/ + /* Bit 15..7: reserved */ +#define XM_TX_BK2BK (1<<6) /* Bit 6: Ignor Carrier Sense (tx Bk2Bk)*/ #define XM_TX_ENC_BYP (1<<5) /* Bit 5: Set Encoder in Bypass Mode */ #define XM_TX_SAM_LINE (1<<4) /* Bit 4: (sc) Start utilization calculation */ #define XM_TX_NO_GIG_MD (1<<3) /* Bit 3: Disable Carrier Extension */ @@ -309,28 +314,28 @@ /* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ - /* Bit 15..5: reserved */ + /* Bit 15..5: reserved */ #define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ /* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ - /* Bit 15..7: reserved */ + /* Bit 15..7: reserved */ #define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ /* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ - /* Bit 15..8: reserved */ -#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ + /* Bit 15..8: reserved */ +#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ /* XM_RX_CMD 16 bit r/w Receive Command Register */ - /* Bit 15..9: reserved */ + /* Bit 15..9: reserved */ #define XM_RX_LENERR_OK (1<<8) /* Bit 8 don't set Rx Err bit for */ - /* inrange error packets */ + /* inrange error packets */ #define XM_RX_BIG_PK_OK (1<<7) /* Bit 7 don't set Rx Err bit for */ - /* jumbo packets */ + /* jumbo packets */ #define XM_RX_IPG_CAP (1<<6) /* Bit 6 repl. type field with IPG */ -#define XM_RX_TP_MD (1<<5) /* Bit 5: Enable transparent Mode */ +#define XM_RX_TP_MD (1<<5) /* Bit 5: Enable transparent Mode */ #define XM_RX_STRIP_FCS (1<<4) /* Bit 4: Enable FCS Stripping */ #define XM_RX_SELF_RX (1<<3) /* Bit 3: Enable Rx of own packets */ #define XM_RX_SAM_LINE (1<<2) /* Bit 2: (sc) Start utilization calculation */ @@ -339,24 +344,24 @@ /* XM_PHY_ADDR 16 bit r/w PHY Address Register */ - /* Bit 15..5: reserved */ + /* Bit 15..5: reserved */ #define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */ /* XM_GP_PORT 32 bit r/w General Purpose Port Register */ - /* Bit 31..7: reserved */ -#define XM_GP_ANIP (1L<<6) /* Bit 6: (ro) Auto Negotiation in Progress */ + /* Bit 31..7: reserved */ +#define XM_GP_ANIP (1L<<6) /* Bit 6: (ro) Auto Negotiation in Progress */ #define XM_GP_FRC_INT (1L<<5) /* Bit 5: (sc) Force Interrupt */ - /* Bit 4: reserved */ + /* Bit 4: reserved */ #define XM_GP_RES_MAC (1L<<3) /* Bit 3: (sc) Reset MAC and FIFOs */ #define XM_GP_RES_STAT (1L<<2) /* Bit 2: (sc) Reset the statistics module */ - /* Bit 1: reserved */ + /* Bit 1: reserved */ #define XM_GP_INP_ASS (1L<<0) /* Bit 0: (ro) GP Input Pin asserted */ /* XM_IMSK 16 bit r/w Interrupt Mask Register */ /* XM_ISRC 16 bit ro Interrupt Status Register */ - /* Bit 15: reserved */ + /* Bit 15: reserved */ #define XM_IS_LNK_AE (1<<14) /* Bit 14: Link Asynchronous Event */ #define XM_IS_TX_ABORT (1<<13) /* Bit 13: Transmit Abort, late Col. etc */ #define XM_IS_FRC_INT (1<<12) /* Bit 12: Force INT bit set in GP */ @@ -364,7 +369,7 @@ #define XM_IS_LIPA_RC (1<<10) /* Bit 10: Link Partner requests config */ #define XM_IS_RX_PAGE (1<<9) /* Bit 9: Page Received */ #define XM_IS_TX_PAGE (1<<8) /* Bit 8: Next Page Loaded for Transmit */ -#define XM_IS_AND (1<<7) /* Bit 7: Auto Negotiation Done */ +#define XM_IS_AND (1<<7) /* Bit 7: Auto Negotiation Done */ #define XM_IS_TSC_OV (1<<6) /* Bit 6: Time Stamp Counter Overflow */ #define XM_IS_RXC_OV (1<<5) /* Bit 5: Rx Counter Event Overflow */ #define XM_IS_TXC_OV (1<<4) /* Bit 4: Tx Counter Event Overflow */ @@ -374,42 +379,41 @@ #define XM_IS_RX_COMP (1<<0) /* Bit 0: Frame Rx Complete */ #define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE |\ - XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV |\ - XM_IS_TXF_UR)) + XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | XM_IS_TXF_UR)) /* XM_HW_CFG 16 bit r/w Hardware Config Register */ - /* Bit 15.. 4: reserved */ + /* Bit 15.. 4: reserved */ #define XM_HW_GEN_EOP (1<<3) /* Bit 3: generate End of Packet pulse */ #define XM_HW_COM4SIG (1<<2) /* Bit 2: use Comma Detect for Sig. Det.*/ - /* Bit 1: reserved */ + /* Bit 1: reserved */ #define XM_HW_GMII_MD (1<<0) /* Bit 0: GMII Interface selected */ /* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ /* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ - /* Bit 15..10 reserved */ + /* Bit 15..10 reserved */ #define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ /* XM_TX_THR 16 bit r/w Tx Request Threshold */ /* XM_HT_THR 16 bit r/w Host Request Threshold */ /* XM_RX_THR 16 bit r/w Receive Request Threshold */ - /* Bit 15..11 reserved */ -#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Tx FIFO Watermark bits */ + /* Bit 15..11 reserved */ +#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Tx FIFO Watermark bits */ /* XM_TX_STAT 32 bit ro Tx Status LIFO Register */ -#define XM_ST_VALID (1UL<<31) /* Bit 31: Status Valid */ +#define XM_ST_VALID (1UL<<31) /* Bit 31: Status Valid */ #define XM_ST_BYTE_CNT (0x3fffL<<17) /* Bit 30..17: Tx frame Length */ #define XM_ST_RETRY_CNT (0x1fL<<12) /* Bit 16..12: Retry Count */ #define XM_ST_EX_COL (1L<<11) /* Bit 11: Excessive Collisions */ #define XM_ST_EX_DEF (1L<<10) /* Bit 10: Excessive Deferral */ -#define XM_ST_BURST (1L<<9) /* Bit 9: p. xmitted in burst md*/ -#define XM_ST_DEFER (1L<<8) /* Bit 8: packet was defered */ -#define XM_ST_BC (1L<<7) /* Bit 7: Broadcast packet */ -#define XM_ST_MC (1L<<6) /* Bit 6: Multicast packet */ -#define XM_ST_UC (1L<<5) /* Bit 5: Unicast packet */ -#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occured */ +#define XM_ST_BURST (1L<<9) /* Bit 9: p. xmitted in burst md*/ +#define XM_ST_DEFER (1L<<8) /* Bit 8: packet was defered */ +#define XM_ST_BC (1L<<7) /* Bit 7: Broadcast packet */ +#define XM_ST_MC (1L<<6) /* Bit 6: Multicast packet */ +#define XM_ST_UC (1L<<5) /* Bit 5: Unicast packet */ +#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occurred */ #define XM_ST_CS_ERR (1L<<3) /* Bit 3: Carrier Sense Error */ #define XM_ST_LAT_COL (1L<<2) /* Bit 2: Late Collision Error */ #define XM_ST_MUL_COL (1L<<1) /* Bit 1: Multiple Collisions */ @@ -417,8 +421,8 @@ /* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ /* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ - /* Bit 15..11: reserved */ -#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ + /* Bit 15..11: reserved */ +#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ /* XM_DEV_ID 32 bit ro Device ID Register */ @@ -427,25 +431,25 @@ /* XM_MODE 32 bit r/w Mode Register */ - /* Bit 31..27: reserved */ + /* Bit 31..27: reserved */ #define XM_MD_ENA_REJ (1L<<26) /* Bit 26: Enable Frame Reject */ #define XM_MD_SPOE_E (1L<<25) /* Bit 25: Send Pause on Edge */ - /* extern generated */ + /* extern generated */ #define XM_MD_TX_REP (1L<<24) /* Bit 24: Transmit Repeater Mode*/ #define XM_MD_SPOFF_I (1L<<23) /* Bit 23: Send Pause on FIFOfull*/ - /* intern generated */ + /* intern generated */ #define XM_MD_LE_STW (1L<<22) /* Bit 22: Rx Stat Word in Lit En*/ #define XM_MD_TX_CONT (1L<<21) /* Bit 21: Send Continuous */ #define XM_MD_TX_PAUSE (1L<<20) /* Bit 20: (sc) Send Pause Frame */ -#define XM_MD_ATS (1L<<19) /* Bit 19: Append Time Stamp */ +#define XM_MD_ATS (1L<<19) /* Bit 19: Append Time Stamp */ #define XM_MD_SPOL_I (1L<<18) /* Bit 18: Send Pause on Low */ - /* intern generated */ + /* intern generated */ #define XM_MD_SPOH_I (1L<<17) /* Bit 17: Send Pause on High */ - /* intern generated */ -#define XM_MD_CAP (1L<<16) /* Bit 16: Check Address Pair */ + /* intern generated */ +#define XM_MD_CAP (1L<<16) /* Bit 16: Check Address Pair */ #define XM_MD_ENA_HSH (1L<<15) /* Bit 15: Enable Hashing */ -#define XM_MD_CSA (1L<<14) /* Bit 14: Check Station Address */ -#define XM_MD_CAA (1L<<13) /* Bit 13: Check Address Array */ +#define XM_MD_CSA (1L<<14) /* Bit 14: Check Station Address */ +#define XM_MD_CAA (1L<<13) /* Bit 13: Check Address Array */ #define XM_MD_RX_MCTRL (1L<<12) /* Bit 12: Rx MAC Control Frames */ #define XM_MD_RX_RUNT (1L<<11) /* Bit 11: Rx Runt Frames */ #define XM_MD_RX_IRLE (1L<<10) /* Bit 10: Rx in Range Len Err F */ @@ -457,16 +461,15 @@ #define XM_MD_DIS_BC (1L<<4) /* Bit 4: Disable Rx Boradcast */ #define XM_MD_ENA_PROM (1L<<3) /* Bit 3: Enable Promiscuous */ #define XM_MD_ENA_BE (1L<<2) /* Bit 2: Enable Big Endian */ -#define XM_MD_FTF (1L<<1) /* Bit 1: (sc) Flush Tx FIFO */ -#define XM_MD_FRF (1L<<0) /* Bit 0: (sc) Flush Rx FIFO */ +#define XM_MD_FTF (1L<<1) /* Bit 1: (sc) Flush Tx FIFO */ +#define XM_MD_FRF (1L<<0) /* Bit 0: (sc) Flush Rx FIFO */ #define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) #define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ - XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA |\ - XM_MD_CAA) + XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA) /* XM_STAT_CMD 16 bit r/w Statistics Command Register */ - /* Bit 16..6: reserved */ + /* Bit 16..6: reserved */ #define XM_SC_SNP_RXC (1<<5) /* Bit 5: (sc) Snap Rx Counters */ #define XM_SC_SNP_TXC (1<<4) /* Bit 4: (sc) Snap Tx Counters */ #define XM_SC_CP_RXC (1<<3) /* Bit 3: Copy Rx Counters Continuously */ @@ -479,28 +482,28 @@ /* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ #define XMR_MAX_SZ_OV (1UL<<31) /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ #define XMR_1023B_OV (1L<<30) /* Bit 30: 512-1023Byte Rx Cnt Ov*/ -#define XMR_511B_OV (1L<<29) /* Bit 29: 256-511 Byte Rx Cnt Ov*/ -#define XMR_255B_OV (1L<<28) /* Bit 28: 128-255 Byte Rx Cnt Ov*/ -#define XMR_127B_OV (1L<<27) /* Bit 27: 65-127 Byte Rx Cnt Ov */ -#define XMR_64B_OV (1L<<26) /* Bit 26: 64 Byte Rx Cnt Ov */ -#define XMR_UTIL_OV (1L<<25) /* Bit 25: Rx Util Cnt Overflow */ -#define XMR_UTIL_UR (1L<<24) /* Bit 24: Rx Util Cnt Underrun */ +#define XMR_511B_OV (1L<<29) /* Bit 29: 256-511 Byte Rx Cnt Ov*/ +#define XMR_255B_OV (1L<<28) /* Bit 28: 128-255 Byte Rx Cnt Ov*/ +#define XMR_127B_OV (1L<<27) /* Bit 27: 65-127 Byte Rx Cnt Ov */ +#define XMR_64B_OV (1L<<26) /* Bit 26: 64 Byte Rx Cnt Ov */ +#define XMR_UTIL_OV (1L<<25) /* Bit 25: Rx Util Cnt Overflow */ +#define XMR_UTIL_UR (1L<<24) /* Bit 24: Rx Util Cnt Underrun */ #define XMR_CEX_ERR_OV (1L<<23) /* Bit 23: CEXT Err Cnt Ov */ - /* Bit 22: reserved */ + /* Bit 22: reserved */ #define XMR_FCS_ERR_OV (1L<<21) /* Bit 21: Rx FCS Error Cnt Ov */ #define XMR_LNG_ERR_OV (1L<<20) /* Bit 20: Rx too Long Err Cnt Ov*/ -#define XMR_RUNT_OV (1L<<19) /* Bit 19: Runt Event Cnt Ov */ +#define XMR_RUNT_OV (1L<<19) /* Bit 19: Runt Event Cnt Ov */ #define XMR_SHT_ERR_OV (1L<<18) /* Bit 18: Rx Short Ev Err Cnt Ov*/ #define XMR_SYM_ERR_OV (1L<<17) /* Bit 17: Rx Sym Err Cnt Ov */ - /* Bit 16: reserved */ + /* Bit 16: reserved */ #define XMR_CAR_ERR_OV (1L<<15) /* Bit 15: Rx Carr Ev Err Cnt Ov */ #define XMR_JAB_PKT_OV (1L<<14) /* Bit 14: Rx Jabb Packet Cnt Ov */ -#define XMR_FIFO_OV (1L<<13) /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ +#define XMR_FIFO_OV (1L<<13) /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ #define XMR_FRA_ERR_OV (1L<<12) /* Bit 12: Rx Framing Err Cnt Ov */ #define XMR_FMISS_OV (1L<<11) /* Bit 11: Rx Missed Ev Cnt Ov */ -#define XMR_BURST (1L<<10) /* Bit 10: Rx Burst Event Cnt Ov */ -#define XMR_INV_MOC (1L<<9) /* Bit 9: Rx with inv. MAC OC Ov*/ -#define XMR_INV_MP (1L<<8) /* Bit 8: Rx inv Pause Frame Ov */ +#define XMR_BURST (1L<<10) /* Bit 10: Rx Burst Event Cnt Ov */ +#define XMR_INV_MOC (1L<<9) /* Bit 9: Rx with inv. MAC OC Ov*/ +#define XMR_INV_MP (1L<<8) /* Bit 8: Rx inv Pause Frame Ov */ #define XMR_MCTRL_OV (1L<<7) /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ #define XMR_MPAUSE_OV (1L<<6) /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ #define XMR_UC_OK_OV (1L<<5) /* Bit 5: Rx Unicast Frame CntOv*/ @@ -508,39 +511,39 @@ #define XMR_BC_OK_OV (1L<<3) /* Bit 3: Rx Broadcast Cnt Ov */ #define XMR_OK_LO_OV (1L<<2) /* Bit 2: Octets Rx OK Low CntOv*/ #define XMR_OK_HI_OV (1L<<1) /* Bit 1: Octets Rx OK Hi Cnt Ov*/ -#define XMR_OK_OV (1L<<0) /* Bit 0: Frames Received Ok Ov */ +#define XMR_OK_OV (1L<<0) /* Bit 0: Frames Received Ok Ov */ #define XMR_DEF_MSK 0x00000006L /* all bits excepting 1 and 2 */ /* XM_TX_CNT_EV 32 bit ro Tx Counter Event Register */ /* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ - /* Bit 31..26: reserved */ + /* Bit 31..26: reserved */ #define XMT_MAX_SZ_OV (1L<<25) /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ #define XMT_1023B_OV (1L<<24) /* Bit 24: 512-1023Byte Tx Cnt Ov*/ -#define XMT_511B_OV (1L<<23) /* Bit 23: 256-511 Byte Tx Cnt Ov*/ -#define XMT_255B_OV (1L<<22) /* Bit 22: 128-255 Byte Tx Cnt Ov*/ -#define XMT_127B_OV (1L<<21) /* Bit 21: 65-127 Byte Tx Cnt Ov */ -#define XMT_64B_OV (1L<<20) /* Bit 20: 64 Byte Tx Cnt Ov */ -#define XMT_UTIL_OV (1L<<19) /* Bit 19: Tx Util Cnt Overflow */ -#define XMT_UTIL_UR (1L<<18) /* Bit 18: Tx Util Cnt Underrun */ +#define XMT_511B_OV (1L<<23) /* Bit 23: 256-511 Byte Tx Cnt Ov*/ +#define XMT_255B_OV (1L<<22) /* Bit 22: 128-255 Byte Tx Cnt Ov*/ +#define XMT_127B_OV (1L<<21) /* Bit 21: 65-127 Byte Tx Cnt Ov */ +#define XMT_64B_OV (1L<<20) /* Bit 20: 64 Byte Tx Cnt Ov */ +#define XMT_UTIL_OV (1L<<19) /* Bit 19: Tx Util Cnt Overflow */ +#define XMT_UTIL_UR (1L<<18) /* Bit 18: Tx Util Cnt Underrun */ #define XMT_CS_ERR_OV (1L<<17) /* Bit 17: Tx Carr Sen Err Cnt Ov*/ #define XMT_FIFO_UR_OV (1L<<16) /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ #define XMT_EX_DEF_OV (1L<<15) /* Bit 15: Tx Ex Deferall Cnt Ov */ -#define XMT_DEF (1L<<14) /* Bit 14: Tx Deferred Cnt Ov */ +#define XMT_DEF (1L<<14) /* Bit 14: Tx Deferred Cnt Ov */ #define XMT_LAT_COL_OV (1L<<13) /* Bit 13: Tx Late Col Cnt Ov */ #define XMT_ABO_COL_OV (1L<<12) /* Bit 12: Tx abo dueto Ex Col Ov*/ #define XMT_MUL_COL_OV (1L<<11) /* Bit 11: Tx Mult Col Cnt Ov */ -#define XMT_SNG_COL (1L<<10) /* Bit 10: Tx Single Col Cnt Ov */ +#define XMT_SNG_COL (1L<<10) /* Bit 10: Tx Single Col Cnt Ov */ #define XMT_MCTRL_OV (1L<<9) /* Bit 9: Tx MAC Ctrl Counter Ov*/ -#define XMT_MPAUSE (1L<<8) /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ -#define XMT_BURST (1L<<7) /* Bit 7: Tx Burst Event Cnt Ov */ -#define XMT_LONG (1L<<6) /* Bit 6: Tx Long Frame Cnt Ov */ +#define XMT_MPAUSE (1L<<8) /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ +#define XMT_BURST (1L<<7) /* Bit 7: Tx Burst Event Cnt Ov */ +#define XMT_LONG (1L<<6) /* Bit 6: Tx Long Frame Cnt Ov */ #define XMT_UC_OK_OV (1L<<5) /* Bit 5: Tx Unicast Cnt Ov */ #define XMT_MC_OK_OV (1L<<4) /* Bit 4: Tx Multicast Cnt Ov */ #define XMT_BC_OK_OV (1L<<3) /* Bit 3: Tx Broadcast Cnt Ov */ #define XMT_OK_LO_OV (1L<<2) /* Bit 2: Octets Tx OK Low CntOv*/ #define XMT_OK_HI_OV (1L<<1) /* Bit 1: Octets Tx OK Hi Cnt Ov*/ -#define XMT_OK_OV (1L<<0) /* Bit 0: Frames Tx Ok Ov */ +#define XMT_OK_OV (1L<<0) /* Bit 0: Frames Tx Ok Ov */ #define XMT_DEF_MSK 0x00000006L /* all bits excepting 1 and 2 */ @@ -550,10 +553,10 @@ #define XMR_FS_LEN (0x3fffUL<<18) /* Bit 31..18: Rx Frame Length */ #define XMR_FS_2L_VLAN (1L<<17) /* Bit 17: tagged wh 2Lev VLAN ID*/ #define XMR_FS_1L_VLAN (1L<<16) /* Bit 16: tagged wh 1Lev VLAN ID*/ -#define XMR_FS_BC (1L<<15) /* Bit 15: Broadcast Frame */ -#define XMR_FS_MC (1L<<14) /* Bit 14: Multicast Frame */ -#define XMR_FS_UC (1L<<13) /* Bit 13: Unicast Frame */ - /* Bit 12: reserved */ +#define XMR_FS_BC (1L<<15) /* Bit 15: Broadcast Frame */ +#define XMR_FS_MC (1L<<14) /* Bit 14: Multicast Frame */ +#define XMR_FS_UC (1L<<13) /* Bit 13: Unicast Frame */ + /* Bit 12: reserved */ #define XMR_FS_BURST (1L<<11) /* Bit 11: Burst Mode */ #define XMR_FS_CEX_ERR (1L<<10) /* Bit 10: Carrier Ext. Error */ #define XMR_FS_802_3 (1L<<9) /* Bit 9: 802.3 Frame */ @@ -561,10 +564,10 @@ #define XMR_FS_CAR_ERR (1L<<7) /* Bit 7: Carrier Event Error */ #define XMR_FS_LEN_ERR (1L<<6) /* Bit 6: In-Range Length Error */ #define XMR_FS_FRA_ERR (1L<<5) /* Bit 5: Framing Error */ -#define XMR_FS_RUNT (1L<<4) /* Bit 4: Runt Error */ +#define XMR_FS_RUNT (1L<<4) /* Bit 4: Runt Error */ #define XMR_FS_LNG_ERR (1L<<3) /* Bit 3: Gaint Error */ #define XMR_FS_FCS_ERR (1L<<2) /* Bit 2: Frame Check Sequ Err */ -#define XMR_FS_ERR (1L<<1) /* Bit 1: Frame Error */ +#define XMR_FS_ERR (1L<<1) /* Bit 1: Frame Error */ #define XMR_FS_MCTRL (1L<<0) /* Bit 0: MAC Control Packet */ /* @@ -658,8 +661,8 @@ */ #define PHY_NAT_CTRL 0x00 /* 16 bit r/w PHY Control Register */ #define PHY_NAT_STAT 0x01 /* 16 bit r/w PHY Status Register */ -#define PHY_NAT_ID0 0x02 /* 16 bit ro PHY ID0 Register */ -#define PHY_NAT_ID1 0x03 /* 16 bit ro PHY ID1 Register */ +#define PHY_NAT_ID0 0x02 /* 16 bit ro PHY ID0 Register */ +#define PHY_NAT_ID1 0x03 /* 16 bit ro PHY ID1 Register */ #define PHY_NAT_AUNE_ADV 0x04 /* 16 bit r/w Autonegotiation Advertisement */ #define PHY_NAT_AUNE_LP 0x05 /* 16 bit ro Link Partner Ability Reg */ #define PHY_NAT_AUNE_EXP 0x06 /* 16 bit ro Autonegotiation Expansion Reg */ @@ -692,16 +695,16 @@ /***** PHY_BCOM_CTRL 16 bit r/w PHY Control Register *****/ /***** PHY_LONE_CTRL 16 bit r/w PHY Control Register *****/ #define PHY_CT_RESET (1<<15) /* Bit 15: (sc) clear all PHY releated regs */ -#define PHY_CT_LOOP (1<<14) /* Bit 14: enable Loopback over PHY */ +#define PHY_CT_LOOP (1<<14) /* Bit 14: enable Loopback over PHY */ #define PHY_CT_SPS_LSB (1<<13) /* Bit 13: (BC,L1) Speed select, lower bit */ -#define PHY_CT_ANE (1<<12) /* Bit 12: Autonegotiation Enabled */ +#define PHY_CT_ANE (1<<12) /* Bit 12: Autonegotiation Enabled */ #define PHY_CT_PDOWN (1<<11) /* Bit 11: (BC,L1) Power Down Mode */ -#define PHY_CT_ISOL (1<<10) /* Bit 10: (BC,L1) Isolate Mode */ +#define PHY_CT_ISOL (1<<10) /* Bit 10: (BC,L1) Isolate Mode */ #define PHY_CT_RE_CFG (1<<9) /* Bit 9: (sc) Restart Autonegotiation */ #define PHY_CT_DUP_MD (1<<8) /* Bit 8: Duplex Mode */ #define PHY_CT_COL_TST (1<<7) /* Bit 7: (BC,L1) Collsion Test enabled */ #define PHY_CT_SPS_MSB (1<<6) /* Bit 6: (BC,L1) Speed select, upper bit */ - /* Bit 5..0: reserved */ + /* Bit 5..0: reserved */ #define PHY_B_CT_SP1000 (1<<6) /* Bit 6: enable speed of 1000 MBit/s */ #define PHY_B_CT_SP100 (1<<13) /* Bit 13: enable speed of 100 MBit/s */ @@ -715,10 +718,10 @@ /***** PHY_XMAC_STAT 16 bit r/w PHY Status Register *****/ /***** PHY_BCOM_STAT 16 bit r/w PHY Status Register *****/ /***** PHY_LONE_STAT 16 bit r/w PHY Status Register *****/ - /* Bit 15..9: reserved */ + /* Bit 15..9: reserved */ /* (BC/L1) 100/10 MBit/s cap bits ignored*/ #define PHY_ST_EXT_ST (1<<8) /* Bit 8: Extended Status Present */ - /* Bit 7: reserved */ + /* Bit 7: reserved */ #define PHY_ST_PRE_SUB (1<<6) /* Bit 6: (BC/L1) preamble suppression */ #define PHY_ST_AN_OVER (1<<5) /* Bit 5: Autonegotiation Over */ #define PHY_ST_REM_FLT (1<<4) /* Bit 4: Remode Fault Condition Occured*/ @@ -731,9 +734,9 @@ /* PHY_XMAC_ID1 16 bit ro PHY ID1 Register */ /* PHY_BCOM_ID1 16 bit ro PHY ID1 Register */ /* PHY_LONE_ID1 16 bit ro PHY ID1 Register */ -#define PHY_I1_OUI (0x3f<<10) /* Bit 15..10: Organiz. Unique ID */ +#define PHY_I1_OUI (0x3f<<10) /* Bit 15..10: Organiz. Unique ID */ #define PHY_I1_MOD_NUM (0x3f<<4) /* Bit 9.. 4: Model Number */ -#define PHY_I1_REV (0x0f<<0) /* Bit 3.. 0: Revision Number */ +#define PHY_I1_REV (0x0f<<0) /* Bit 3.. 0: Revision Number */ /***** PHY_XMAC_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/ @@ -741,43 +744,43 @@ #define PHY_AN_NXT_PG (1<<15) /* Bit 15: Request Next Page */ #define PHY_X_AN_ACK (1<<14) /* Bit 14: (ro) Acknowledge Received */ #define PHY_X_AN_RFB (3<<12) /* Bit 13..12: Remode Fault Bits */ - /* Bit 11.. 9: reserved */ + /* Bit 11.. 9: reserved */ #define PHY_X_AN_PAUSE (3<<7) /* Bit 8.. 7: Pause Bits */ -#define PHY_X_AN_HD (1<<6) /* Bit 6: Half Duplex */ -#define PHY_X_AN_FD (1<<5) /* Bit 5: Full Duplex */ - /* Bit 4.. 0: reserved */ +#define PHY_X_AN_HD (1<<6) /* Bit 6: Half Duplex */ +#define PHY_X_AN_FD (1<<5) /* Bit 5: Full Duplex */ + /* Bit 4.. 0: reserved */ /***** PHY_BCOM_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/ /***** PHY_BCOM_AUNE_LP 16 bit ro Link Partner Ability Reg *****/ -/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ - /* Bit 14: reserved */ -#define PHY_B_AN_RF (1<<13) /* Bit 13: Remote Fault */ - /* Bit 12: reserved */ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ + /* Bit 14: reserved */ +#define PHY_B_AN_RF (1<<13) /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ #define PHY_B_AN_ASP (1<<11) /* Bit 11: Asymetric Pause */ -#define PHY_B_AN_PC (1<<10) /* Bit 10: Pause Capable */ - /* Bit 9..5: 100/10 BT cap bits ingnored */ +#define PHY_B_AN_PC (1<<10) /* Bit 10: Pause Capable */ + /* Bit 9..5: 100/10 BT cap bits ingnored */ #define PHY_B_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/ /***** PHY_LONE_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/ /***** PHY_LONE_AUNE_LP 16 bit ro Link Partner Ability Reg *****/ -/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ - /* Bit 14: reserved */ -#define PHY_L_AN_RF (1<<13) /* Bit 13: Remote Fault */ - /* Bit 12: reserved */ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ + /* Bit 14: reserved */ +#define PHY_L_AN_RF (1<<13) /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ #define PHY_L_AN_ASP (1<<11) /* Bit 11: Asymetric Pause */ -#define PHY_L_AN_PC (1<<10) /* Bit 10: Pause Capable */ - /* Bit 9..5: 100/10 BT cap bits ingnored */ +#define PHY_L_AN_PC (1<<10) /* Bit 10: Pause Capable */ + /* Bit 9..5: 100/10 BT cap bits ingnored */ #define PHY_L_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/ /***** PHY_NAT_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/ /***** PHY_NAT_AUNE_LP 16 bit ro Link Partner Ability Reg *****/ -/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ - /* Bit 14: reserved */ -#define PHY_N_AN_RF (1<<13) /* Bit 13: Remote Fault */ - /* Bit 12: reserved */ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ + /* Bit 14: reserved */ +#define PHY_N_AN_RF (1<<13) /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ #define PHY_N_AN_100F (1<<11) /* Bit 11: 100Base-T2 FD Support */ #define PHY_N_AN_100H (1<<10) /* Bit 10: 100Base-T2 HD Support */ - /* Bit 9..5: 100/10 BT cap bits ingnored */ + /* Bit 9..5: 100/10 BT cap bits ingnored */ #define PHY_N_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/ /* field type definition for PHY_x_AN_SEL */ @@ -788,22 +791,22 @@ #define PHY_AN_LP_NP (1<<3) /* Bit 3: Link Partner can Next Page */ #define PHY_AN_LOC_NP (1<<2) /* Bit 2: Local PHY can Next Page */ #define PHY_AN_RX_PG (1<<1) /* Bit 1: Page Received */ - /* Bit 0: reserved */ + /* Bit 0: reserved */ /***** PHY_BCOM_AUNE_EXP 16 bit ro Autoneg Expansion Reg *****/ - /* Bit 15..5: reserved */ + /* Bit 15..5: reserved */ #define PHY_B_AN_PDF (1<<4) /* Bit 4: Parallel Detection Fault */ -/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */ -/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */ -/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */ +/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */ +/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */ +/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */ #define PHY_B_AN_LP_CAP (1<<0) /* Bit 0: Link Partner Autoneg Cap. */ /***** PHY_LONE_AUNE_EXP 16 bit ro Autoneg Expansion Reg *****/ -#define PHY_L_AN_BP (1<<5) /* Bit 5: Base Page Indication */ +#define PHY_L_AN_BP (1<<5) /* Bit 5: Base Page Indication */ #define PHY_L_AN_PDF (1<<4) /* Bit 4: Parallel Detection Fault */ -/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */ -/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */ -/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */ +/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */ +/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */ +/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */ #define PHY_B_AN_LP_CAP (1<<0) /* Bit 0: Link Partner Autoneg Cap. */ @@ -813,35 +816,35 @@ /***** PHY_XMAC_NEPG_LP 16 bit ro Next Page Link Partner *****/ /***** PHY_BCOM_NEPG_LP 16 bit ro Next Page Link Partner *****/ /***** PHY_LONE_NEPG_LP 16 bit ro Next Page Link Partner *****/ -#define PHY_NP_MORE (1<<15) /* Bit 15: More, Next Pages to follow */ -#define PHY_NP_ACK1 (1<<14) /* Bit 14: (ro) Ack 1, for receiving a message*/ +#define PHY_NP_MORE (1<<15) /* Bit 15: More, Next Pages to follow */ +#define PHY_NP_ACK1 (1<<14) /* Bit 14: (ro) Ack 1, for receiving a message*/ #define PHY_NP_MSG_VAL (1<<13) /* Bit 13: Message Page valid */ -#define PHY_NP_ACK2 (1<<12) /* Bit 12: Ack 2, comply with msg content*/ -#define PHY_NP_TOG (1<<11) /* Bit 11: Toggle Bit, ensure sync */ -#define PHY_NP_MSG 0x07ff /* Bit 10..0: Message from/to Link Partner */ +#define PHY_NP_ACK2 (1<<12) /* Bit 12: Ack 2, comply with msg content*/ +#define PHY_NP_TOG (1<<11) /* Bit 11: Toggle Bit, ensure sync */ +#define PHY_NP_MSG 0x07ff /* Bit 10..0: Message from/to Link Partner */ /* * XMAC-Specific */ /***** PHY_XMAC_EXT_STAT 16 bit r/w Extended Status Register *****/ -#define PHY_X_EX_FD (1<<15) /* Bit 15: Device Supports Full Duplex */ -#define PHY_X_EX_HD (1<<14) /* Bit 14: Device Supports Half Duplex */ - /* Bit 13..0: reserved */ +#define PHY_X_EX_FD (1<<15) /* Bit 15: Device Supports Full Duplex */ +#define PHY_X_EX_HD (1<<14) /* Bit 14: Device Supports Half Duplex */ + /* Bit 13..0: reserved */ /***** PHY_XMAC_RES_ABI 16 bit ro PHY Resolved Ability *****/ - /* Bit 15..9: reserved */ + /* Bit 15..9: reserved */ #define PHY_X_RS_PAUSE (3<<7) /* Bit 8..7: selected Pause Mode */ -#define PHY_X_RS_HD (1<<6) /* Bit 6: Half Duplex Mode selected */ -#define PHY_X_RS_FD (1<<5) /* Bit 5: Full Duplex Mode selected */ +#define PHY_X_RS_HD (1<<6) /* Bit 6: Half Duplex Mode selected */ +#define PHY_X_RS_FD (1<<5) /* Bit 5: Full Duplex Mode selected */ #define PHY_X_RS_ABLMIS (1<<4) /* Bit 4: duplex or pause cap mismatch */ #define PHY_X_RS_PAUMIS (1<<3) /* Bit 3: pause capability missmatch */ - /* Bit 2..0: reserved */ + /* Bit 2..0: reserved */ /* * Remote Fault Bits (PHY_X_AN_RFB) encoding */ -#define X_RFB_OK (0<<12) /* Bit 12..13 No errors, Link OK */ -#define X_RFB_LF (1<<12) /* Bit 12..13 Link Failure */ -#define X_RFB_OFF (2<<12) /* Bit 12..13 Offline */ +#define X_RFB_OK (0<<12) /* Bit 12..13 No errors, Link OK */ +#define X_RFB_LF (1<<12) /* Bit 12..13 Link Failure */ +#define X_RFB_OFF (2<<12) /* Bit 12..13 Offline */ #define X_RFB_AN_ERR (3<<12) /* Bit 12..13 Autonegotiation Error */ /* @@ -863,7 +866,7 @@ #define PHY_B_1000C_RD (1<<10) /* Bit 10: Repeater/DTE */ #define PHY_B_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */ #define PHY_B_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */ - /* Bit 7..0: reserved */ + /* Bit 7..0: reserved */ /***** PHY_BCOM_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/ #define PHY_B_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */ @@ -872,7 +875,7 @@ #define PHY_B_1000S_RRS (1<<12) /* Bit 12: Remote Receiver Status */ #define PHY_B_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */ #define PHY_B_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */ - /* Bit 9..8: reserved */ + /* Bit 9..8: reserved */ #define PHY_B_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */ /***** PHY_BCOM_EXT_STAT 16 bit ro Extended Status Register *****/ @@ -880,7 +883,7 @@ #define PHY_B_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */ #define PHY_B_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */ #define PHY_B_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */ - /* Bit 11..0: reserved */ + /* Bit 11..0: reserved */ /***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ #define PHY_B_PEC_MAC_PHY (1<<15) /* Bit 15: 10BIT/GMI-Interface */ @@ -889,36 +892,36 @@ #define PHY_B_PEC_INT_DIS (1<<12) /* Bit 12: Interrupts Disabled */ #define PHY_B_PEC_F_INT (1<<11) /* Bit 11: Force Interrupt */ #define PHY_B_PEC_BY_45 (1<<10) /* Bit 10: Bypass 4B5B-Decoder */ -#define PHY_B_PEC_BY_SCR (1<<9) /* Bit 9: Bypass Scrambler */ -#define PHY_B_PEC_BY_MLT3 (1<<8) /* Bit 8: Bypass MLT3 Encoder */ -#define PHY_B_PEC_BY_RXA (1<<7) /* Bit 7: Bypass Rx Alignm. */ -#define PHY_B_PEC_RES_SCR (1<<6) /* Bit 6: Reset Scrambler */ -#define PHY_B_PEC_EN_LTR (1<<5) /* Bit 5: Ena LED Traffic Mode */ -#define PHY_B_PEC_LED_ON (1<<4) /* Bit 4: Force LED's on */ -#define PHY_B_PEC_LED_OFF (1<<3) /* Bit 3: Force LED's off */ -#define PHY_B_PEC_EX_IPG (1<<2) /* Bit 2: Extend Tx IPG Mode */ -#define PHY_B_PEC_3_LED (1<<1) /* Bit 1: Three Link LED mode */ -#define PHY_B_PEC_HIGH_LA (1<<0) /* Bit 0: GMII Fifo Elasticy */ +#define PHY_B_PEC_BY_SCR (1<<9) /* Bit 9: Bypass Scrambler */ +#define PHY_B_PEC_BY_MLT3 (1<<8) /* Bit 8: Bypass MLT3 Encoder */ +#define PHY_B_PEC_BY_RXA (1<<7) /* Bit 7: Bypass Rx Alignm. */ +#define PHY_B_PEC_RES_SCR (1<<6) /* Bit 6: Reset Scrambler */ +#define PHY_B_PEC_EN_LTR (1<<5) /* Bit 5: Ena LED Traffic Mode */ +#define PHY_B_PEC_LED_ON (1<<4) /* Bit 4: Force LED's on */ +#define PHY_B_PEC_LED_OFF (1<<3) /* Bit 3: Force LED's off */ +#define PHY_B_PEC_EX_IPG (1<<2) /* Bit 2: Extend Tx IPG Mode */ +#define PHY_B_PEC_3_LED (1<<1) /* Bit 1: Three Link LED mode */ +#define PHY_B_PEC_HIGH_LA (1<<0) /* Bit 0: GMII Fifo Elasticy */ /***** PHY_BCOM_P_EXT_STAT 16 bit ro PHY Extended Status Reg *****/ - /* Bit 15..14: reserved */ + /* Bit 15..14: reserved */ #define PHY_B_PES_CROSS_STAT (1<<13) /* Bit 13: MDI Crossover Status */ #define PHY_B_PES_INT_STAT (1<<12) /* Bit 12: Interrupt Status */ #define PHY_B_PES_RRS (1<<11) /* Bit 11: Remote Receiver Stat. */ #define PHY_B_PES_LRS (1<<10) /* Bit 10: Local Receiver Stat. */ -#define PHY_B_PES_LOCKED (1<<9) /* Bit 9: Locked */ -#define PHY_B_PES_LS (1<<8) /* Bit 8: Link Status */ -#define PHY_B_PES_RF (1<<7) /* Bit 7: Remote Fault */ -#define PHY_B_PES_CE_ER (1<<6) /* Bit 6: Carrier Ext Error */ -#define PHY_B_PES_BAD_SSD (1<<5) /* Bit 5: Bad SSD */ -#define PHY_B_PES_BAD_ESD (1<<4) /* Bit 4: Bad ESD */ -#define PHY_B_PES_RX_ER (1<<3) /* Bit 3: Receive Error */ -#define PHY_B_PES_TX_ER (1<<2) /* Bit 2: Transmit Error */ -#define PHY_B_PES_LOCK_ER (1<<1) /* Bit 1: Lock Error */ -#define PHY_B_PES_MLT3_ER (1<<0) /* Bit 0: MLT3 code Error */ +#define PHY_B_PES_LOCKED (1<<9) /* Bit 9: Locked */ +#define PHY_B_PES_LS (1<<8) /* Bit 8: Link Status */ +#define PHY_B_PES_RF (1<<7) /* Bit 7: Remote Fault */ +#define PHY_B_PES_CE_ER (1<<6) /* Bit 6: Carrier Ext Error */ +#define PHY_B_PES_BAD_SSD (1<<5) /* Bit 5: Bad SSD */ +#define PHY_B_PES_BAD_ESD (1<<4) /* Bit 4: Bad ESD */ +#define PHY_B_PES_RX_ER (1<<3) /* Bit 3: Receive Error */ +#define PHY_B_PES_TX_ER (1<<2) /* Bit 2: Transmit Error */ +#define PHY_B_PES_LOCK_ER (1<<1) /* Bit 1: Lock Error */ +#define PHY_B_PES_MLT3_ER (1<<0) /* Bit 0: MLT3 code Error */ /***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ - /* Bit 15..8: reserved */ + /* Bit 15..8: reserved */ #define PHY_B_FC_CTR (255<<0)/* Bit 7..0: False Carrier Counter */ /***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ @@ -929,13 +932,15 @@ #define PHY_B_AC_L_SQE (1<<15) /* Bit 15: Low Squelch */ #define PHY_B_AC_LONG_PACK (1<<14) /* Bit 14: Rx Long Packets */ #define PHY_B_AC_ER_CTRL (3<<12) /* Bit 13..12: Edgerate Control */ - /* Bit 11: reserved */ + /* Bit 11: reserved */ #define PHY_B_AC_TX_TST (1<<10) /* Bit 10: tx test bit, always 1 */ - /* Bit 9.. 8: reserved */ + /* Bit 9.. 8: reserved */ #define PHY_B_AC_DIS_PRF (1<<7) /* Bit 7: dis part resp filter */ - /* Bit 6.. 4: reserved */ + /* Bit 6: reserved */ +#define PHY_B_AC_DIS_PM (1<<5) /* Bit 5: dis power management */ + /* Bit 4: reserved */ #define PHY_B_AC_DIAG (1<<3) /* Bit 3: Diagnostic Mode */ - /* Bit 2.. 0: reserved */ + /* Bit 2.. 0: reserved */ /***** PHY_BCOM_AUX_STAT 16 bit ro Auxiliary Status Reg *****/ #define PHY_B_AS_AN_C (1<<15) /* Bit 15: AutoNeg complete */ @@ -944,37 +949,36 @@ #define PHY_B_AS_ANAB_D (1<<12) /* Bit 12: AN Ability Detect */ #define PHY_B_AS_NPW (1<<11) /* Bit 11: AN Next Page Wait */ #define PHY_B_AS_AN_RES (7<<8) /* Bit 10..8: AN HDC */ -#define PHY_B_AS_PDF (1<<7) /* Bit 7: Parallel Detect. Fault*/ -#define PHY_B_AS_RF (1<<6) /* Bit 6: Remote Fault */ -#define PHY_B_AS_ANP_R (1<<5) /* Bit 5: AN Page Received */ -#define PHY_B_AS_LP_ANAB (1<<4) /* Bit 4: LP AN Ability */ -#define PHY_B_AS_LP_NPAB (1<<3) /* Bit 3: LP Next Page Ability */ -#define PHY_B_AS_LS (1<<2) /* Bit 2: Link Status */ -#define PHY_B_AS_PRR (1<<1) /* Bit 1: Pause Resolution-Rx */ -#define PHY_B_AS_PRT (1<<0) /* Bit 0: Pause Resolution-Tx */ +#define PHY_B_AS_PDF (1<<7) /* Bit 7: Parallel Detect. Fault*/ +#define PHY_B_AS_RF (1<<6) /* Bit 6: Remote Fault */ +#define PHY_B_AS_ANP_R (1<<5) /* Bit 5: AN Page Received */ +#define PHY_B_AS_LP_ANAB (1<<4) /* Bit 4: LP AN Ability */ +#define PHY_B_AS_LP_NPAB (1<<3) /* Bit 3: LP Next Page Ability */ +#define PHY_B_AS_LS (1<<2) /* Bit 2: Link Status */ +#define PHY_B_AS_PRR (1<<1) /* Bit 1: Pause Resolution-Rx */ +#define PHY_B_AS_PRT (1<<0) /* Bit 0: Pause Resolution-Tx */ /***** PHY_BCOM_INT_STAT 16 bit ro Interrupt Status Reg *****/ /***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ - /* Bit 15: reserved */ + /* Bit 15: reserved */ #define PHY_B_IS_PSE (1<<14) /* Bit 14: Pair Swap Error */ #define PHY_B_IS_MDXI_SC (1<<13) /* Bit 13: MDIX Status Change */ #define PHY_B_IS_HCT (1<<12) /* Bit 12: counter above 32k */ -#define PHY_B_IS_LCT (1<<11) /* Bit 11: all counter below 128 */ +#define PHY_B_IS_LCT (1<<11) /* Bit 11: counter above 128 */ #define PHY_B_IS_AN_PR (1<<10) /* Bit 10: Page Received */ -#define PHY_B_IS_NO_HDCL (1<<9) /* Bit 9: No HCD Link */ -#define PHY_B_IS_NO_HDC (1<<8) /* Bit 8: No HCD */ -#define PHY_B_IS_NEG_USHDC (1<<7) /* Bit 7: Negotiated Unsup. HCD */ -#define PHY_B_IS_SCR_S_ER (1<<6) /* Bit 6: Scrambler Sync Error */ -#define PHY_B_IS_RRS_CHANGE (1<<5) /* Bit 5: Remote Rx Stat Change */ -#define PHY_B_IS_LRS_CHANGE (1<<4) /* Bit 4: Local Rx Stat Change */ -#define PHY_B_IS_DUP_CHANGE (1<<3) /* Bit 3: Duplex Mode Change */ -#define PHY_B_IS_LSP_CHANGE (1<<2) /* Bit 2: Link Speed Change */ -#define PHY_B_IS_LST_CHANGE (1<<1) /* Bit 1: Link Status Changed */ -#define PHY_B_IS_CRC_ER (1<<0) /* Bit 0: CRC Error */ +#define PHY_B_IS_NO_HDCL (1<<9) /* Bit 9: No HCD Link */ +#define PHY_B_IS_NO_HDC (1<<8) /* Bit 8: No HCD */ +#define PHY_B_IS_NEG_USHDC (1<<7) /* Bit 7: Negotiated Unsup. HCD */ +#define PHY_B_IS_SCR_S_ER (1<<6) /* Bit 6: Scrambler Sync Error */ +#define PHY_B_IS_RRS_CHANGE (1<<5) /* Bit 5: Remote Rx Stat Change */ +#define PHY_B_IS_LRS_CHANGE (1<<4) /* Bit 4: Local Rx Stat Change */ +#define PHY_B_IS_DUP_CHANGE (1<<3) /* Bit 3: Duplex Mode Change */ +#define PHY_B_IS_LSP_CHANGE (1<<2) /* Bit 2: Link Speed Change */ +#define PHY_B_IS_LST_CHANGE (1<<1) /* Bit 1: Link Status Changed */ +#define PHY_B_IS_CRC_ER (1<<0) /* Bit 0: CRC Error */ #define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) - /* * Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ @@ -1000,7 +1004,7 @@ #define PHY_L_1000C_RD (1<<10) /* Bit 10: Repeater/DTE */ #define PHY_L_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */ #define PHY_L_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */ - /* Bit 7..0: reserved */ + /* Bit 7..0: reserved */ /***** PHY_LONE_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/ #define PHY_L_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */ @@ -1009,7 +1013,7 @@ #define PHY_L_1000S_RRS (1<<12) /* Bit 12: Remote Receiver Status*/ #define PHY_L_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */ #define PHY_L_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */ - /* Bit 9..8: reserved */ + /* Bit 9..8: reserved */ #define PHY_B_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */ /***** PHY_LONE_EXT_STAT 16 bit ro Extended Status Register *****/ @@ -1017,11 +1021,11 @@ #define PHY_L_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */ #define PHY_L_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */ #define PHY_L_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */ - /* Bit 11..0: reserved */ + /* Bit 11..0: reserved */ /***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/ #define PHY_L_PC_REP_MODE (1<<15) /* Bit 15: Repeater Mode */ - /* Bit 14: reserved */ + /* Bit 14: reserved */ #define PHY_L_PC_TX_DIS (1<<13) /* Bit 13: Tx output Disabled */ #define PHY_L_PC_BY_SCR (1<<12) /* Bit 12: Bypass Scrambler */ #define PHY_L_PC_BY_45 (1<<11) /* Bit 11: Bypass 4B5B-Decoder */ @@ -1044,7 +1048,7 @@ #define PHY_L_QS_COL_STAT (1<<11) /* Bit 11: Collision */ #define PHY_L_QS_L_STAT (1<<10) /* Bit 10: Link is up */ #define PHY_L_QS_DUP_MOD (1<<9) /* Bit 9: Full/Half Duplex */ -#define PHY_L_QS_AN (1<<8) /* Bit 8: AutoNeg is On */ +#define PHY_L_QS_AN (1<<8) /* Bit 8: AutoNeg is On */ #define PHY_L_QS_AN_C (1<<7) /* Bit 7: AN is Complete */ #define PHY_L_QS_LLE (7<<4) /* Bit 6: Line Length Estim. */ #define PHY_L_QS_PAUSE (1<<3) /* Bit 3: LP advertised Pause */ @@ -1054,24 +1058,24 @@ /***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/ /***** PHY_LONE_INT_STAT 16 bit ro Interrupt Status Reg *****/ - /* Bit 15..14: reserved */ + /* Bit 15..14: reserved */ #define PHY_L_IS_AN_F (1<<13) /* Bit 13: Autoneg fault */ - /* Bit 12: not described */ + /* Bit 12: not described */ #define PHY_L_IS_CROSS (1<<11) /* Bit 11: Crossover used */ #define PHY_L_IS_POL (1<<10) /* Bit 10: Polarity correct. used*/ -#define PHY_L_IS_SS (1<<9) /* Bit 9: Smart Speed Downgrade*/ +#define PHY_L_IS_SS (1<<9) /* Bit 9: Smart Speed Downgrade*/ #define PHY_L_IS_CFULL (1<<8) /* Bit 8: Counter Full */ #define PHY_L_IS_AN_C (1<<7) /* Bit 7: AutoNeg Complete */ #define PHY_L_IS_SPEED (1<<6) /* Bit 6: Speed Changed */ #define PHY_L_IS_DUP (1<<5) /* Bit 5: Duplex Changed */ -#define PHY_L_IS_LS (1<<4) /* Bit 4: Link Status Changed */ +#define PHY_L_IS_LS (1<<4) /* Bit 4: Link Status Changed */ #define PHY_L_IS_ISOL (1<<3) /* Bit 3: Isolate Occured */ #define PHY_L_IS_MDINT (1<<2) /* Bit 2: (ro) STAT: MII Int Pending */ #define PHY_L_IS_INTEN (1<<1) /* Bit 1: ENAB: Enable IRQs */ #define PHY_L_IS_FORCE (1<<0) /* Bit 0: ENAB: Force Interrupt */ -#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | \ - PHY_L_IS_INTEN) /* int. mask */ +/* int. mask */ +#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN) /***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/ #define PHY_L_LC_LEDC (3<<14) /* Bit 15..14: Col/Blink/On/Off */ @@ -1086,12 +1090,12 @@ /***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/ #define PHY_L_PC_TX_TCLK (1<<15) /* Bit 15: Enable TX_TCLK */ - /* Bit 14: reserved */ + /* Bit 14: reserved */ #define PHY_L_PC_ALT_NP (1<<13) /* Bit 14: Alternate Next Page */ #define PHY_L_PC_GMII_ALT (1<<12) /* Bit 13: Alternate GMII driver */ - /* Bit 11: reserved */ + /* Bit 11: reserved */ #define PHY_L_PC_TEN_CRS (1<<10) /* Bit 10: Extend CRS*/ - /* Bit 9..0: not described */ + /* Bit 9..0: not described */ /***** PHY_LONE_CIM 16 bit ro CIM Reg *****/ #define PHY_L_CIM_ISOL (255<<8)/* Bit 15..8: Isolate Count */ @@ -1118,7 +1122,7 @@ #define PHY_N_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */ #define PHY_N_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */ #define PHY_N_1000C_APC (1<<7) /* Bit 7: Asymetric Pause Cap. */ - /* Bit 6..0: reserved */ + /* Bit 6..0: reserved */ /***** PHY_NAT_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/ #define PHY_N_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */ @@ -1128,7 +1132,7 @@ #define PHY_N_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */ #define PHY_N_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */ #define PHY_N_1000C_LP_APC (1<<9) /* Bit 9: LP Asym. Pause Cap. */ - /* Bit 8: reserved */ + /* Bit 8: reserved */ #define PHY_N_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */ /***** PHY_NAT_EXT_STAT 16 bit ro Extended Status Register *****/ @@ -1136,7 +1140,7 @@ #define PHY_N_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */ #define PHY_N_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */ #define PHY_N_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */ - /* Bit 11..0: reserved */ + /* Bit 11..0: reserved */ /* todo: those are still missing */ /***** PHY_NAT_EXT_CTRL1 16 bit ro Extended Control Reg1 *****/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skaddr.c linux.20p9/drivers/net/sk98lin/skaddr.c --- linux.vanilla/drivers/net/sk98lin/skaddr.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skaddr.c Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skaddr.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.34 $ - * Date: $Date: 1999/11/22 13:23:44 $ - * Purpose: Manage Addresses (Multicast and Unicast) and Promiscuous Mode + * Version: $Revision: 1.40 $ + * Date: $Date: 2001/02/14 14:04:59 $ + * Purpose: Manage Addresses (Multicast and Unicast) and Promiscuous Mode. * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,25 @@ * History: * * $Log: skaddr.c,v $ + * Revision 1.40 2001/02/14 14:04:59 rassmann + * Editorial changes. + * + * Revision 1.39 2001/01/30 10:30:04 rassmann + * Editorial changes. + * + * Revision 1.38 2001/01/25 16:26:52 rassmann + * Ensured that logical address overrides are done on net's active port. + * + * Revision 1.37 2001/01/22 13:41:34 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.36 2000/08/07 11:10:39 rassmann + * Editorial changes. + * + * Revision 1.35 2000/05/04 09:38:41 rassmann + * Editorial changes. + * Corrected multicast address hashing. + * * Revision 1.34 1999/11/22 13:23:44 cgoos * Changed license header to GPL. * @@ -165,13 +183,13 @@ #ifndef lint static const char SysKonnectFileId[] = - "@(#) $Id: skaddr.c,v 1.34 1999/11/22 13:23:44 cgoos Exp $ (C) SysKonnect."; + "@(#) $Id: skaddr.c,v 1.40 2001/02/14 14:04:59 rassmann Exp $ (C) SysKonnect."; #endif /* !defined(lint) */ #define __SKADDR_C #ifdef __cplusplus -xxxx /* not supported yet - force error */ +#error C++ is not yet supported. extern "C" { #endif /* cplusplus */ @@ -180,19 +198,9 @@ /* defines ********************************************************************/ -#define SK_ADDR_CHEAT YES /* Cheat. */ - -/* - * G32: - * POLY equ 04C11DB6h ; CRC polynominal term - * bit-reversed: 6DB88320 - */ #define CRC32_POLY 0xEDB88320UL /* CRC32-Poly - XMAC: Little Endian */ -#if 0 -#define CRC32_POLY 0x6DB88320UL /* CRC32-Poly - XMAC: Little Endian */ -#endif /* 0 */ -#define HASH_BITS 6 /* #bits in hash */ +#define HASH_BITS 6 /* #bits in hash */ #define SK_MC_BIT 0x01 /* Error numbers and messages. */ @@ -220,13 +228,6 @@ /* functions ******************************************************************/ -#if 0 -void SkAddrDummy(void) -{ - SkAddrInit(NULL, NULL, 0); -} /* SkAddrDummy */ -#endif /* 0 */ - /****************************************************************************** * * SkAddrInit - initialize data, set state to init @@ -237,7 +238,7 @@ * ============ * * This routine clears the multicast tables and resets promiscuous mode. - * Some entries are reserved for the "logical board address", the + * Some entries are reserved for the "logical MAC address", the * SK-RLMT multicast address, and the BPDU multicast address. * * @@ -264,12 +265,12 @@ int SkAddrInit( SK_AC *pAC, /* the adapter context */ SK_IOC IoC, /* I/O context */ -int Level) /* initialization level */ +int Level) /* initialization level */ { - int j; - SK_U32 i; - SK_U8 *InAddr; - SK_U16 *OutAddr; + int j; + SK_U32 i; + SK_U8 *InAddr; + SK_U16 *OutAddr; SK_ADDR_PORT *pAPort; switch (Level) { @@ -280,20 +281,15 @@ pAPort = &pAC->Addr.Port[i]; pAPort->PromMode = SK_PROM_MODE_NONE; - pAPort->FirstExactMatchRlmt = - SK_ADDR_FIRST_MATCH_RLMT; - pAPort->FirstExactMatchDrv = - SK_ADDR_FIRST_MATCH_DRV; - pAPort->NextExactMatchRlmt = - SK_ADDR_FIRST_MATCH_RLMT; - pAPort->NextExactMatchDrv = - SK_ADDR_FIRST_MATCH_DRV; + pAPort->FirstExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT; + pAPort->FirstExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV; + pAPort->NextExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT; + pAPort->NextExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV; #if 0 - /* Not here ... */ + /* Don't do this here ... */ /* Reset Promiscuous mode. */ - (void)SkAddrPromiscuousChange( pAC, IoC, @@ -315,7 +311,9 @@ break; case SK_INIT_IO: - pAC->Addr.ActivePort = pAC->Rlmt.MacActive; + for (i = 0; i < SK_MAX_NETS; i++) { + pAC->Addr.Net[i].ActivePort = pAC->Rlmt.Net[i].ActivePort; + } #ifdef DEBUG for (i = 0; i < SK_MAX_MACS; i++) { @@ -326,28 +324,35 @@ } #endif /* DEBUG */ - /* Read permanent virtual address from Control Register File. */ - + /* Read permanent logical MAC address from Control Register File. */ for (j = 0; j < SK_MAC_ADDR_LEN; j++) { - InAddr = (SK_U8 *)&pAC->Addr.PermanentMacAddress.a[j]; + InAddr = (SK_U8 *)&pAC->Addr.Net[0].PermanentMacAddress.a[j]; SK_IN8(IoC, B2_MAC_1 + j, InAddr); } - if (!pAC->Addr.CurrentMacAddressSet) { - /* - * Set the current virtual MAC address - * to the permanent one. - */ - - pAC->Addr.CurrentMacAddress = - pAC->Addr.PermanentMacAddress; - pAC->Addr.CurrentMacAddressSet = SK_TRUE; + if (!pAC->Addr.Net[0].CurrentMacAddressSet) { + /* Set the current logical MAC address to the permanent one. */ + pAC->Addr.Net[0].CurrentMacAddress = + pAC->Addr.Net[0].PermanentMacAddress; + pAC->Addr.Net[0].CurrentMacAddressSet = SK_TRUE; + } + + /* Set the current logical MAC address. */ + pAC->Addr.Port[pAC->Addr.Net[0].ActivePort].Exact[0] = + pAC->Addr.Net[0].CurrentMacAddress; + +#if SK_MAX_NETS > 1 + /* Set logical MAC address for net 2 to (log | 3). */ + if (!pAC->Addr.Net[1].CurrentMacAddressSet) { + pAC->Addr.Net[1].PermanentMacAddress = + pAC->Addr.Net[0].PermanentMacAddress; + pAC->Addr.Net[1].PermanentMacAddress.a[5] |= 3; + /* Set the current logical MAC address to the permanent one. */ + pAC->Addr.Net[1].CurrentMacAddress = + pAC->Addr.Net[1].PermanentMacAddress; + pAC->Addr.Net[1].CurrentMacAddressSet = SK_TRUE; } - - /* Set the current virtual MAC address. */ - - pAC->Addr.Port[pAC->Addr.ActivePort].Exact[0] = - pAC->Addr.CurrentMacAddress; +#endif /* SK_MAX_NETS > 1 */ #ifdef xDEBUG SK_DBG_MSG( @@ -355,27 +360,27 @@ SK_DBGMOD_ADDR, SK_DBGCAT_INIT, ("Permanent MAC Address: %02X %02X %02X %02X %02X %02X\n", - pAC->Addr.PermanentMacAddress.a[0], - pAC->Addr.PermanentMacAddress.a[1], - pAC->Addr.PermanentMacAddress.a[2], - pAC->Addr.PermanentMacAddress.a[3], - pAC->Addr.PermanentMacAddress.a[4], - pAC->Addr.PermanentMacAddress.a[5])) + pAC->Addr.PermanentMacAddress.a[0], + pAC->Addr.PermanentMacAddress.a[1], + pAC->Addr.PermanentMacAddress.a[2], + pAC->Addr.PermanentMacAddress.a[3], + pAC->Addr.PermanentMacAddress.a[4], + pAC->Addr.PermanentMacAddress.a[5])) SK_DBG_MSG( pAC, SK_DBGMOD_ADDR, SK_DBGCAT_INIT, - ("Virtual MAC Address: %02X %02X %02X %02X %02X %02X\n", - pAC->Addr.CurrentMacAddress.a[0], - pAC->Addr.CurrentMacAddress.a[1], - pAC->Addr.CurrentMacAddress.a[2], - pAC->Addr.CurrentMacAddress.a[3], - pAC->Addr.CurrentMacAddress.a[4], - pAC->Addr.CurrentMacAddress.a[5])) + ("Logical MAC Address: %02X %02X %02X %02X %02X %02X\n", + pAC->Addr.CurrentMacAddress.a[0], + pAC->Addr.CurrentMacAddress.a[1], + pAC->Addr.CurrentMacAddress.a[2], + pAC->Addr.CurrentMacAddress.a[3], + pAC->Addr.CurrentMacAddress.a[4], + pAC->Addr.CurrentMacAddress.a[5])) #endif /* DEBUG */ #if 0 - /* Not here ... */ + /* Don't do this here ... */ (void)SkAddrMcUpdate(pAC, IoC, pAC->Addr.ActivePort); #endif /* 0 */ @@ -383,33 +388,23 @@ for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { pAPort = &pAC->Addr.Port[i]; - /* - * Read permanent port addresses from - * Control Register File. - */ - + /* Read permanent port addresses from Control Register File. */ for (j = 0; j < SK_MAC_ADDR_LEN; j++) { - InAddr = (SK_U8 *) - &pAPort->PermanentMacAddress.a[j]; + InAddr = (SK_U8 *)&pAPort->PermanentMacAddress.a[j]; SK_IN8(IoC, B2_MAC_2 + 8 * i + j, InAddr); } if (!pAPort->CurrentMacAddressSet) { /* - * Set the current and previous physical - * MAC address of this port to its permanent - * MAC address. + * Set the current and previous physical MAC address + * of this port to its permanent MAC address. */ - - pAPort->CurrentMacAddress = - pAPort->PermanentMacAddress; - pAPort->PreviousMacAddress = - pAPort->PermanentMacAddress; + pAPort->CurrentMacAddress = pAPort->PermanentMacAddress; + pAPort->PreviousMacAddress = pAPort->PermanentMacAddress; pAPort->CurrentMacAddressSet = SK_TRUE; } /* Set port's current MAC addresses. */ - OutAddr = (SK_U16 *)&pAPort->CurrentMacAddress.a[0]; XM_OUTADDR(IoC, i, XM_SA, OutAddr); @@ -484,45 +479,42 @@ int SkAddrMcClear( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx, /* Index of affected port */ -int Flags) /* permanent/non-perm, sw-only */ +SK_U32 PortNumber, /* Index of affected port */ +int Flags) /* permanent/non-perm, sw-only */ { int i; - if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } if (Flags & SK_ADDR_PERMANENT) { /* Clear RLMT multicast addresses. */ - - pAC->Addr.Port[PortIdx].NextExactMatchRlmt = - SK_ADDR_FIRST_MATCH_RLMT; + pAC->Addr.Port[PortNumber].NextExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT; } else { /* not permanent => DRV */ /* Clear InexactFilter. */ for (i = 0; i < 8; i++) { - pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i] = 0; + pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0; } /* Clear DRV multicast addresses. */ - pAC->Addr.Port[PortIdx].NextExactMatchDrv = - SK_ADDR_FIRST_MATCH_DRV; + pAC->Addr.Port[PortNumber].NextExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV; } if (!(Flags & SK_MC_SW_ONLY)) { - (void)SkAddrMcUpdate(pAC, IoC, PortIdx); + (void)SkAddrMcUpdate(pAC, IoC, PortNumber); } return (SK_ADDR_SUCCESS); } /* SkAddrMcClear */ #ifndef SK_ADDR_CHEAT -// RA;:;: + /****************************************************************************** * * SkCrc32McHash - hash multicast address @@ -549,15 +541,13 @@ Crc = 0xFFFFFFFFUL; for (Idx = 0; Idx < SK_MAC_ADDR_LEN; Idx++) { - Data = *pMc++; + Data = *pMc++; for (Bit = 0; Bit < 8; Bit++, Data >>= 1) { - Crc = (Crc >> 1) ^ - (((Crc ^ Data) & 1) ? CRC32_POLY : 0); + Crc = (Crc >> 1) ^ (((Crc ^ Data) & 1) ? CRC32_POLY : 0); } } return (Crc & ((1 << HASH_BITS) - 1)); - } /* SkCrc32McHash */ #endif /* not SK_ADDR_CHEAT */ @@ -592,9 +582,9 @@ int SkAddrMcAdd( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx, /* Port Index */ +SK_U32 PortNumber, /* Port Number */ SK_MAC_ADDR *pMc, /* multicast address to be added */ -int Flags) /* permanent/non-permanent */ +int Flags) /* permanent/non-permanent */ { int i; SK_U8 Inexact; @@ -602,98 +592,87 @@ unsigned HashBit; #endif /* !defined(SK_ADDR_CHEAT) */ - if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } if (Flags & SK_ADDR_PERMANENT) { #ifdef DEBUG - if (pAC->Addr.Port[PortIdx].NextExactMatchRlmt < + if (pAC->Addr.Port[PortNumber].NextExactMatchRlmt < SK_ADDR_FIRST_MATCH_RLMT) { - Next0[PortIdx] |= 1; + Next0[PortNumber] |= 1; return (SK_MC_RLMT_OVERFLOW); } #endif /* DEBUG */ - if (pAC->Addr.Port[PortIdx].NextExactMatchRlmt > + if (pAC->Addr.Port[PortNumber].NextExactMatchRlmt > SK_ADDR_LAST_MATCH_RLMT) { return (SK_MC_RLMT_OVERFLOW); } /* Set an RLMT multicast address. */ - pAC->Addr.Port[PortIdx].Exact[ - pAC->Addr.Port[PortIdx].NextExactMatchRlmt++] = *pMc; + pAC->Addr.Port[PortNumber].Exact[ + pAC->Addr.Port[PortNumber].NextExactMatchRlmt++] = *pMc; return (SK_MC_FILTERING_EXACT); } +#if 0 /* Not PERMANENT => DRV */ - - if (PortIdx != pAC->Addr.ActivePort) { - + if (PortNumber != pAC->Addr.ActivePort) { /* Only RLMT is allowed to do this. */ - return (SK_MC_ILLEGAL_PORT); } +#endif /* 0 */ #ifdef DEBUG - if (pAC->Addr.Port[PortIdx].NextExactMatchDrv < + if (pAC->Addr.Port[PortNumber].NextExactMatchDrv < SK_ADDR_FIRST_MATCH_DRV) { - Next0[PortIdx] |= 2; + Next0[PortNumber] |= 2; return (SK_MC_RLMT_OVERFLOW); } #endif /* DEBUG */ - if (pAC->Addr.Port[PortIdx].NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) { + if (pAC->Addr.Port[PortNumber].NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) { /* Set exact match entry. */ - - pAC->Addr.Port[PortIdx].Exact[ - pAC->Addr.Port[PortIdx].NextExactMatchDrv++] = *pMc; + pAC->Addr.Port[PortNumber].Exact[ + pAC->Addr.Port[PortNumber].NextExactMatchDrv++] = *pMc; /* Clear InexactFilter. */ - for (i = 0; i < 8; i++) { - pAC->Addr.Port[PortIdx - ].InexactFilter.Bytes[i] = 0; + pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0; } } else { if (!(pMc->a[0] & SK_MC_BIT)) { - /* * Hashing only possible with * multicast addresses. */ - return (SK_MC_ILLEGAL_ADDRESS); } #ifndef SK_ADDR_CHEAT /* Compute hash value of address. */ -RA;:;: untested - HashBit = SkCrc32McHash(&pMc->a[0]); + HashBit = 63 - SkCrc32McHash(&pMc->a[0]); /* Add bit to InexactFilter. */ - - pAC->Addr.Port[PortIdx].InexactFilter.Bytes[HashBit / 8] |= + pAC->Addr.Port[PortNumber].InexactFilter.Bytes[HashBit / 8] |= 1 << (HashBit % 8); - #else /* SK_ADDR_CHEAT */ - /* Set all bits in InexactFilter. */ - for (i = 0; i < 8; i++) { - pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i] = 0xFF; + pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0xFF; } #endif /* SK_ADDR_CHEAT */ } for (Inexact = 0, i = 0; i < 8; i++) { - Inexact |= pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i]; + Inexact |= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i]; } - if (Inexact == 0 && pAC->Addr.Port[PortIdx].PromMode == 0) { + if (Inexact == 0 && pAC->Addr.Port[PortNumber].PromMode == 0) { return (SK_MC_FILTERING_EXACT); } else { @@ -726,15 +705,15 @@ int SkAddrMcUpdate( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) /* Port Index */ +SK_U32 PortNumber) /* Port Number */ { - SK_U32 i; - SK_U8 Inexact; - SK_U16 *OutAddr; - SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Reg. */ + SK_U32 i; + SK_U8 Inexact; + SK_U16 *OutAddr; + SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Reg. */ SK_ADDR_PORT *pAPort; - if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } @@ -742,129 +721,102 @@ pAC, SK_DBGMOD_ADDR, SK_DBGCAT_CTRL, - ("SkAddrMcUpdate on Port %u.\n", PortIdx)) + ("SkAddrMcUpdate on Port %u.\n", PortNumber)) - pAPort = &pAC->Addr.Port[PortIdx]; + pAPort = &pAC->Addr.Port[PortNumber]; #ifdef DEBUG SK_DBG_MSG( pAC, SK_DBGMOD_ADDR, SK_DBGCAT_CTRL, - ("Next0 on Port %d: %d\n", PortIdx, Next0[PortIdx])) + ("Next0 on Port %d: %d\n", PortNumber, Next0[PortNumber])) #endif /* DEBUG */ - for (i = 0; /* Also program the virtual address. */ - i < pAPort->NextExactMatchRlmt; - i++) { - + /* Start with 0 to also program the logical MAC address. */ + for (i = 0; i < pAPort->NextExactMatchRlmt; i++) { /* Set exact match address i on HW. */ - OutAddr = (SK_U16 *)&pAPort->Exact[i].a[0]; - XM_OUTADDR(IoC, PortIdx, XM_EXM(i), OutAddr); + XM_OUTADDR(IoC, PortNumber, XM_EXM(i), OutAddr); } /* Clear other permanent exact match addresses on HW. */ - if (pAPort->NextExactMatchRlmt <= SK_ADDR_LAST_MATCH_RLMT) { SkXmClrExactAddr( pAC, IoC, - PortIdx, + PortNumber, pAPort->NextExactMatchRlmt, SK_ADDR_LAST_MATCH_RLMT); } - for (i = pAPort->FirstExactMatchDrv; - i < pAPort->NextExactMatchDrv; - i++) { - + for (i = pAPort->FirstExactMatchDrv; i < pAPort->NextExactMatchDrv; i++) { OutAddr = (SK_U16 *)&pAPort->Exact[i].a[0]; - XM_OUTADDR(IoC, PortIdx, XM_EXM(i), OutAddr); - + XM_OUTADDR(IoC, PortNumber, XM_EXM(i), OutAddr); } /* Clear other non-permanent exact match addresses on HW. */ - if (pAPort->NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) { SkXmClrExactAddr( pAC, IoC, - PortIdx, + PortNumber, pAPort->NextExactMatchDrv, SK_ADDR_LAST_MATCH_DRV); } - for (Inexact = 0xFF, i = 0; i < 8; i++) { - Inexact &= pAPort->InexactFilter.Bytes[i]; + for (Inexact = 0, i = 0; i < 8; i++) { + Inexact |= pAPort->InexactFilter.Bytes[i]; } - if (pAPort->PromMode & SK_PROM_MODE_ALL_MC) { + if (pAPort->PromMode & SK_PROM_MODE_ALL_MC) { /* Set all bits in 64-bit hash register. */ - - XM_OUTHASH(IoC, PortIdx, XM_HSM, &OnesHash); + XM_OUTHASH(IoC, PortNumber, XM_HSM, &OnesHash); /* Set bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); LoMode |= XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } - else if (Inexact != 0xFF) { - - /* Clear bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); - LoMode &= ~XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); - } - else { + else if (Inexact != 0) { /* Set 64-bit hash register to InexactFilter. */ - - XM_OUTHASH( - IoC, - PortIdx, - XM_HSM, - &pAPort->InexactFilter.Bytes[0]); + XM_OUTHASH(IoC, PortNumber, XM_HSM, &pAPort->InexactFilter.Bytes[0]); /* Set bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); LoMode |= XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); + } + else { + /* Clear bit 15 in mode register. */ + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); + LoMode &= ~XM_MD_ENA_HSH; + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } if (pAPort->PromMode != SK_PROM_MODE_NONE) { - (void)SkAddrPromiscuousChange( - pAC, - IoC, - PortIdx, - pAPort->PromMode); + (void)SkAddrPromiscuousChange(pAC, IoC, PortNumber, pAPort->PromMode); } /* Set port's current MAC address. */ - OutAddr = (SK_U16 *)&pAPort->CurrentMacAddress.a[0]; - XM_OUTADDR(IoC, PortIdx, XM_SA, OutAddr); + XM_OUTADDR(IoC, PortNumber, XM_SA, OutAddr); -#ifdef DEBUG - for (i = 0; /* Also program the virtual address. */ - i < pAPort->NextExactMatchRlmt; - i++) { +#ifdef xDEBUG + for (i = 0; i < pAPort->NextExactMatchRlmt; i++) { SK_U8 InAddr8[6]; SK_U16 *InAddr; - /* Get exact match address i from port PortIdx. */ - + /* Get exact match address i from port PortNumber. */ InAddr = (SK_U16 *)&InAddr8[0]; - XM_INADDR(IoC, PortIdx, XM_EXM(i), InAddr); + XM_INADDR(IoC, PortNumber, XM_EXM(i), InAddr); SK_DBG_MSG( pAC, - SK_DBGMOD_RLMT, + SK_DBGMOD_ADDR, SK_DBGCAT_CTRL, ("MC address %d on Port %u: %02x %02x %02x %02x %02x %02x -- %02x %02x %02x %02x %02x %02x.\n", i, - PortIdx, + PortNumber, InAddr8[0], InAddr8[1], InAddr8[2], @@ -881,10 +833,6 @@ #endif /* DEBUG */ /* Determine return value. */ - - for (Inexact = 0, i = 0; i < 8; i++) { - Inexact |= pAPort->InexactFilter.Bytes[i]; - } if (Inexact == 0 && pAPort->PromMode == 0) { return (SK_MC_FILTERING_EXACT); } @@ -914,52 +862,70 @@ int SkAddrOverride( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx, /* Port Index */ +SK_U32 PortNumber, /* Port Number */ SK_MAC_ADDR *pNewAddr, /* new MAC address */ -int Flags) /* logical/physical address */ +int Flags) /* logical/physical MAC address */ { + SK_EVPARA Para; + SK_U32 NetNumber; SK_U32 i; SK_U16 *OutAddr; - SK_EVPARA Para; -#if 0 - SK_MAC_ADDR NewAddr; /* new MAC address */ - SK_U8 AddrBits; -#endif /* 0 */ - if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + NetNumber = pAC->Rlmt.Port[PortNumber].Net->NetNumber; + + if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } - if (pNewAddr->a[0] & SK_MC_BIT) { + if (pNewAddr != NULL && (pNewAddr->a[0] & SK_MC_BIT) != 0) { return (SK_ADDR_MULTICAST_ADDRESS); } -#if 0 -DANGEROUS! - if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical address. */ - if (!pAC->Addr.Port[PortIdx].CurrentMacAddressSet) { - pAC->Addr.Port[PortIdx].PreviousMacAddress = *pNewAddr; - pAC->Addr.Port[PortIdx].CurrentMacAddress = *pNewAddr; - pAC->Addr.Port[PortIdx].CurrentMacAddressSet = SK_TRUE; - return (SK_ADDR_SUCCESS); - } + if (!pAC->Addr.Net[NetNumber].CurrentMacAddressSet) { + return (SK_ADDR_TOO_EARLY); } - else { - if (!pAC->Addr.CurrentMacAddressSet) { - pAC->Addr.CurrentMacAddress = *pNewAddr; - pAC->Addr.CurrentMacAddressSet = SK_TRUE; - return (SK_ADDR_SUCCESS); + + if (Flags & SK_ADDR_SET_LOGICAL) { /* Activate logical MAC address. */ + /* Parameter *pNewAddr is ignored. */ + for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { + if (!pAC->Addr.Port[i].CurrentMacAddressSet) { + return (SK_ADDR_TOO_EARLY); + } } - } -DANGEROUS! -#endif /* 0 */ - if (!pAC->Addr.CurrentMacAddressSet) { - return (SK_ADDR_TOO_EARLY); + /* Set PortNumber to number of net's active port. */ + PortNumber = pAC->Rlmt.Net[NetNumber]. + Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber; + + pAC->Addr.Port[PortNumber].Exact[0] = + pAC->Addr.Net[NetNumber].CurrentMacAddress; + + /* Write address to first exact match entry of active port. */ + (void)SkAddrMcUpdate(pAC, IoC, PortNumber); } + else if (Flags & SK_ADDR_CLEAR_LOGICAL) { + /* Deactivate logical MAC address. */ + /* Parameter *pNewAddr is ignored. */ + for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { + if (!pAC->Addr.Port[i].CurrentMacAddressSet) { + return (SK_ADDR_TOO_EARLY); + } + } - if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical address. */ - if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.CurrentMacAddress.a)) { + /* Set PortNumber to number of net's active port. */ + PortNumber = pAC->Rlmt.Net[NetNumber]. + Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber; + + for (i = 0; i < SK_MAC_ADDR_LEN; i++ ) { + pAC->Addr.Port[PortNumber].Exact[0].a[i] = 0; + } + + /* Write address to first exact match entry of active port. */ + (void)SkAddrMcUpdate(pAC, IoC, PortNumber); + } + else if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical MAC address. */ + if (SK_ADDR_EQUAL(pNewAddr->a, + pAC->Addr.Net[NetNumber].CurrentMacAddress.a)) { return (SK_ADDR_DUPLICATE_ADDRESS); } @@ -968,10 +934,9 @@ return (SK_ADDR_TOO_EARLY); } - if (SK_ADDR_EQUAL( - pNewAddr->a, + if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.Port[i].CurrentMacAddress.a)) { - if (i == PortIdx) { + if (i == PortNumber) { return (SK_ADDR_SUCCESS); } else { @@ -980,22 +945,22 @@ } } - pAC->Addr.Port[PortIdx].PreviousMacAddress = - pAC->Addr.Port[PortIdx].CurrentMacAddress; - pAC->Addr.Port[PortIdx].CurrentMacAddress = *pNewAddr; + pAC->Addr.Port[PortNumber].PreviousMacAddress = + pAC->Addr.Port[PortNumber].CurrentMacAddress; + pAC->Addr.Port[PortNumber].CurrentMacAddress = *pNewAddr; /* Change port's address. */ - OutAddr = (SK_U16 *)pNewAddr; - XM_OUTADDR(IoC, PortIdx, XM_SA, OutAddr); + XM_OUTADDR(IoC, PortNumber, XM_SA, OutAddr); /* Report address change to RLMT. */ - - Para.Para32[0] = PortIdx; + Para.Para32[0] = PortNumber; + Para.Para32[0] = -1; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_PORT_ADDR, Para); } - else { /* Logical Address. */ - if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.CurrentMacAddress.a)) { + else { /* Logical MAC address. */ + if (SK_ADDR_EQUAL(pNewAddr->a, + pAC->Addr.Net[NetNumber].CurrentMacAddress.a)) { return (SK_ADDR_SUCCESS); } @@ -1004,15 +969,18 @@ return (SK_ADDR_TOO_EARLY); } - if (SK_ADDR_EQUAL( - pNewAddr->a, + if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.Port[i].CurrentMacAddress.a)) { return (SK_ADDR_DUPLICATE_ADDRESS); } } - pAC->Addr.CurrentMacAddress = *pNewAddr; - pAC->Addr.Port[PortIdx].Exact[0] = *pNewAddr; + /* Set PortNumber to number of net's active port. */ + PortNumber = pAC->Rlmt.Net[NetNumber]. + Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber; + + pAC->Addr.Net[NetNumber].CurrentMacAddress = *pNewAddr; + pAC->Addr.Port[PortNumber].Exact[0] = *pNewAddr; #ifdef DEBUG SK_DBG_MSG( @@ -1020,28 +988,27 @@ SK_DBGMOD_ADDR, SK_DBGCAT_CTRL, ("Permanent MAC Address: %02X %02X %02X %02X %02X %02X\n", - pAC->Addr.PermanentMacAddress.a[0], - pAC->Addr.PermanentMacAddress.a[1], - pAC->Addr.PermanentMacAddress.a[2], - pAC->Addr.PermanentMacAddress.a[3], - pAC->Addr.PermanentMacAddress.a[4], - pAC->Addr.PermanentMacAddress.a[5])) + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[0], + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[1], + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[2], + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[3], + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[4], + pAC->Addr.Net[NetNumber].PermanentMacAddress.a[5])) SK_DBG_MSG( pAC, SK_DBGMOD_ADDR, SK_DBGCAT_CTRL, - ("New Virtual MAC Address: %02X %02X %02X %02X %02X %02X\n", - pAC->Addr.CurrentMacAddress.a[0], - pAC->Addr.CurrentMacAddress.a[1], - pAC->Addr.CurrentMacAddress.a[2], - pAC->Addr.CurrentMacAddress.a[3], - pAC->Addr.CurrentMacAddress.a[4], - pAC->Addr.CurrentMacAddress.a[5])) + ("New logical MAC Address: %02X %02X %02X %02X %02X %02X\n", + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[0], + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[1], + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[2], + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[3], + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[4], + pAC->Addr.Net[NetNumber].CurrentMacAddress.a[5])) #endif /* DEBUG */ /* Write address to first exact match entry of active port. */ - - (void)SkAddrMcUpdate(pAC, IoC, PortIdx); + (void)SkAddrMcUpdate(pAC, IoC, PortNumber); } return (SK_ADDR_SUCCESS); @@ -1067,48 +1034,44 @@ * SK_ADDR_ILLEGAL_PORT */ int SkAddrPromiscuousChange( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx, /* port whose promiscuous mode changes */ -int NewPromMode) /* new promiscuous mode */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* I/O context */ +SK_U32 PortNumber, /* port whose promiscuous mode changes */ +int NewPromMode) /* new promiscuous mode */ { - int i; + int i; SK_BOOL InexactModeBit; SK_U8 Inexact; SK_U8 HwInexact; SK_FILTER64 HwInexactFilter; SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Register. */ - int CurPromMode = SK_PROM_MODE_NONE; + int CurPromMode = SK_PROM_MODE_NONE; - if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } /* Read CurPromMode from Hardware. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); if (LoMode & XM_MD_ENA_PROM) { CurPromMode |= SK_PROM_MODE_LLC; } for (Inexact = 0xFF, i = 0; i < 8; i++) { - Inexact &= pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i]; + Inexact &= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i]; } if (Inexact == 0xFF) { - CurPromMode |= (pAC->Addr.Port[PortIdx].PromMode & - SK_PROM_MODE_ALL_MC); + CurPromMode |= (pAC->Addr.Port[PortNumber].PromMode & SK_PROM_MODE_ALL_MC); } else { /* Read InexactModeBit (bit 15 in mode register). */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); - - InexactModeBit = (LoMode & XM_MD_ENA_HSH) != 0; + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); + + InexactModeBit = (LoMode & XM_MD_ENA_HSH) != 0; /* Read 64-bit hash register from HW. */ - - XM_INHASH(IoC, PortIdx, XM_HSM, &HwInexactFilter.Bytes[0]); + XM_INHASH(IoC, PortNumber, XM_HSM, &HwInexactFilter.Bytes[0]); for (HwInexact = 0xFF, i = 0; i < 8; i++) { HwInexact &= HwInexactFilter.Bytes[i]; @@ -1119,7 +1082,7 @@ } } - pAC->Addr.Port[PortIdx].PromMode = NewPromMode; + pAC->Addr.Port[PortNumber].PromMode = NewPromMode; if (NewPromMode == CurPromMode) { return (SK_ADDR_SUCCESS); @@ -1127,76 +1090,65 @@ if ((NewPromMode & SK_PROM_MODE_ALL_MC) && !(CurPromMode & SK_PROM_MODE_ALL_MC)) { /* All MC. */ - /* Set all bits in 64-bit hash register. */ - - XM_OUTHASH(IoC, PortIdx, XM_HSM, &OnesHash); + XM_OUTHASH(IoC, PortNumber, XM_HSM, &OnesHash); /* Set bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); LoMode |= XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } else if ((CurPromMode & SK_PROM_MODE_ALL_MC) && !(NewPromMode & SK_PROM_MODE_ALL_MC)) { /* Norm MC. */ - for (Inexact = 0, i = 0; i < 8; i++) { - Inexact |= - pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i]; + Inexact |= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i]; } if (Inexact == 0) { /* Clear bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); LoMode &= ~XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } else { /* Set 64-bit hash register to InexactFilter. */ - XM_OUTHASH( IoC, - PortIdx, + PortNumber, XM_HSM, - &pAC->Addr.Port[PortIdx - ].InexactFilter.Bytes[0]); + &pAC->Addr.Port[PortNumber].InexactFilter.Bytes[0]); /* Set bit 15 in mode register. */ - - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); LoMode |= XM_MD_ENA_HSH; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } } if ((NewPromMode & SK_PROM_MODE_LLC) && !(CurPromMode & SK_PROM_MODE_LLC)) { /* Prom. LLC */ - /* Set promiscuous bit in mode register. */ + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); #if 0 /* Receive MAC frames. */ - LoMode |= XM_MD_RX_MCTRL; #endif /* 0 */ + LoMode |= XM_MD_ENA_PROM; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } else if ((CurPromMode & SK_PROM_MODE_LLC) && !(NewPromMode & SK_PROM_MODE_LLC)) { /* Norm. LLC. */ - /* Clear promiscuous bit in mode register. */ + XM_IN16(IoC, PortNumber, XM_MODE, &LoMode); - XM_IN16(IoC, PortIdx, XM_MODE, &LoMode); #if 0 /* Don't receive MAC frames. */ - LoMode &= ~XM_MD_RX_MCTRL; #endif /* 0 */ + LoMode &= ~XM_MD_ENA_PROM; - XM_OUT16(IoC, PortIdx, XM_MODE, LoMode); + XM_OUT16(IoC, PortNumber, XM_MODE, LoMode); } return (SK_ADDR_SUCCESS); @@ -1219,21 +1171,25 @@ * SK_ADDR_ILLEGAL_PORT */ int SkAddrSwap( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 FromPortIdx, /* Port1 Index */ -SK_U32 ToPortIdx) /* Port2 Index */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* I/O context */ +SK_U32 FromPortNumber, /* Port1 Index */ +SK_U32 ToPortNumber) /* Port2 Index */ { - int i; + int i; SK_U8 Byte; SK_MAC_ADDR MacAddr; SK_U32 DWord; - if (FromPortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (FromPortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { + return (SK_ADDR_ILLEGAL_PORT); + } + + if (ToPortNumber >= (SK_U32)pAC->GIni.GIMacsFound) { return (SK_ADDR_ILLEGAL_PORT); } - if (ToPortIdx >= (SK_U32)pAC->GIni.GIMacsFound) { + if (pAC->Rlmt.Port[FromPortNumber].Net != pAC->Rlmt.Port[ToPortNumber].Net) { return (SK_ADDR_ILLEGAL_PORT); } @@ -1250,48 +1206,56 @@ */ for (i = 0; i < SK_ADDR_EXACT_MATCHES; i++) { - MacAddr = pAC->Addr.Port[FromPortIdx].Exact[i]; - pAC->Addr.Port[FromPortIdx].Exact[i] = - pAC->Addr.Port[ToPortIdx].Exact[i]; - pAC->Addr.Port[ToPortIdx].Exact[i] = MacAddr; + MacAddr = pAC->Addr.Port[FromPortNumber].Exact[i]; + pAC->Addr.Port[FromPortNumber].Exact[i] = + pAC->Addr.Port[ToPortNumber].Exact[i]; + pAC->Addr.Port[ToPortNumber].Exact[i] = MacAddr; } for (i = 0; i < 8; i++) { - Byte = pAC->Addr.Port[FromPortIdx].InexactFilter.Bytes[i]; - pAC->Addr.Port[FromPortIdx].InexactFilter.Bytes[i] = - pAC->Addr.Port[ToPortIdx].InexactFilter.Bytes[i]; - pAC->Addr.Port[ToPortIdx].InexactFilter.Bytes[i] = Byte; - } - - i = pAC->Addr.Port[FromPortIdx].PromMode; - pAC->Addr.Port[FromPortIdx].PromMode = - pAC->Addr.Port[ToPortIdx].PromMode; - pAC->Addr.Port[ToPortIdx].PromMode = i; - - DWord = pAC->Addr.Port[FromPortIdx].FirstExactMatchRlmt; - pAC->Addr.Port[FromPortIdx].FirstExactMatchRlmt = - pAC->Addr.Port[ToPortIdx].FirstExactMatchRlmt; - pAC->Addr.Port[ToPortIdx].FirstExactMatchRlmt = DWord; - - DWord = pAC->Addr.Port[FromPortIdx].NextExactMatchRlmt; - pAC->Addr.Port[FromPortIdx].NextExactMatchRlmt = - pAC->Addr.Port[ToPortIdx].NextExactMatchRlmt; - pAC->Addr.Port[ToPortIdx].NextExactMatchRlmt = DWord; - - DWord = pAC->Addr.Port[FromPortIdx].FirstExactMatchDrv; - pAC->Addr.Port[FromPortIdx].FirstExactMatchDrv = - pAC->Addr.Port[ToPortIdx].FirstExactMatchDrv; - pAC->Addr.Port[ToPortIdx].FirstExactMatchDrv = DWord; - - DWord = pAC->Addr.Port[FromPortIdx].NextExactMatchDrv; - pAC->Addr.Port[FromPortIdx].NextExactMatchDrv = - pAC->Addr.Port[ToPortIdx].NextExactMatchDrv; - pAC->Addr.Port[ToPortIdx].NextExactMatchDrv = DWord; + Byte = pAC->Addr.Port[FromPortNumber].InexactFilter.Bytes[i]; + pAC->Addr.Port[FromPortNumber].InexactFilter.Bytes[i] = + pAC->Addr.Port[ToPortNumber].InexactFilter.Bytes[i]; + pAC->Addr.Port[ToPortNumber].InexactFilter.Bytes[i] = Byte; + } + + i = pAC->Addr.Port[FromPortNumber].PromMode; + pAC->Addr.Port[FromPortNumber].PromMode = pAC->Addr.Port[ToPortNumber].PromMode; + pAC->Addr.Port[ToPortNumber].PromMode = i; + + DWord = pAC->Addr.Port[FromPortNumber].FirstExactMatchRlmt; + pAC->Addr.Port[FromPortNumber].FirstExactMatchRlmt = + pAC->Addr.Port[ToPortNumber].FirstExactMatchRlmt; + pAC->Addr.Port[ToPortNumber].FirstExactMatchRlmt = DWord; + + DWord = pAC->Addr.Port[FromPortNumber].NextExactMatchRlmt; + pAC->Addr.Port[FromPortNumber].NextExactMatchRlmt = + pAC->Addr.Port[ToPortNumber].NextExactMatchRlmt; + pAC->Addr.Port[ToPortNumber].NextExactMatchRlmt = DWord; + + DWord = pAC->Addr.Port[FromPortNumber].FirstExactMatchDrv; + pAC->Addr.Port[FromPortNumber].FirstExactMatchDrv = + pAC->Addr.Port[ToPortNumber].FirstExactMatchDrv; + pAC->Addr.Port[ToPortNumber].FirstExactMatchDrv = DWord; + + DWord = pAC->Addr.Port[FromPortNumber].NextExactMatchDrv; + pAC->Addr.Port[FromPortNumber].NextExactMatchDrv = + pAC->Addr.Port[ToPortNumber].NextExactMatchDrv; + pAC->Addr.Port[ToPortNumber].NextExactMatchDrv = DWord; + + /* CAUTION: Solution works if only ports of one adapter are in use. */ + for (i = 0; (SK_U32)i < pAC->Rlmt.Net[pAC->Rlmt.Port[ToPortNumber]. + Net->NetNumber].NumPorts; i++) { + if (pAC->Rlmt.Net[pAC->Rlmt.Port[ToPortNumber].Net->NetNumber]. + Port[i]->PortNumber == ToPortNumber) { + pAC->Addr.Net[pAC->Rlmt.Port[ToPortNumber].Net->NetNumber]. + ActivePort = i; + /* 20001207 RA: Was "ToPortNumber;". */ - pAC->Addr.ActivePort = ToPortIdx; - - (void)SkAddrMcUpdate(pAC, IoC, FromPortIdx); - (void)SkAddrMcUpdate(pAC, IoC, ToPortIdx); + } + } + (void)SkAddrMcUpdate(pAC, IoC, FromPortNumber); + (void)SkAddrMcUpdate(pAC, IoC, ToPortNumber); return (SK_ADDR_SUCCESS); } /* SkAddrSwap */ @@ -1299,3 +1263,4 @@ #ifdef __cplusplus } #endif /* __cplusplus */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skcsum.c linux.20p9/drivers/net/sk98lin/skcsum.c --- linux.vanilla/drivers/net/sk98lin/skcsum.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skcsum.c Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skcsum.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.6 $ - * Date: $Date: 2000/02/21 12:35:10 $ + * Version: $Revision: 1.8 $ + * Date: $Date: 2001/02/06 11:15:36 $ * Purpose: Store/verify Internet checksum in send/receive packets. * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,13 @@ * History: * * $Log: skcsum.c,v $ + * Revision 1.8 2001/02/06 11:15:36 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.7 2000/06/29 13:17:05 rassmann + * Corrected reception of a packet with UDP checksum == 0 (which means there + * is no UDP checksum). + * * Revision 1.6 2000/02/21 12:35:10 cgoos * Fixed license header comment. * @@ -59,7 +65,7 @@ #ifndef lint static const char SysKonnectFileId[] = "@(#)" - "$Id: skcsum.c,v 1.6 2000/02/21 12:35:10 cgoos Exp $" + "$Id: skcsum.c,v 1.8 2001/02/06 11:15:36 rassmann Exp $" " (C) SysKonnect."; #endif /* !lint */ @@ -105,13 +111,13 @@ /* defines ********************************************************************/ /* The size of an Ethernet MAC header. */ -#define SKCS_ETHERNET_MAC_HEADER_SIZE (6+6+2) +#define SKCS_ETHERNET_MAC_HEADER_SIZE (6+6+2) /* The size of the used topology's MAC header. */ #define SKCS_MAC_HEADER_SIZE SKCS_ETHERNET_MAC_HEADER_SIZE /* The size of the IP header without any option fields. */ -#define SKCS_IP_HEADER_SIZE 20 +#define SKCS_IP_HEADER_SIZE 20 /* * Field offsets within the IP header. @@ -121,23 +127,31 @@ #define SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH 0 /* "Total Length". */ -#define SKCS_OFS_IP_TOTAL_LENGTH 2 +#define SKCS_OFS_IP_TOTAL_LENGTH 2 /* "Flags" "Fragment Offset". */ #define SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET 6 /* "Next Level Protocol" identifier. */ -#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL 9 +#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL 9 /* Source IP address. */ -#define SKCS_OFS_IP_SOURCE_ADDRESS 12 +#define SKCS_OFS_IP_SOURCE_ADDRESS 12 /* Destination IP address. */ -#define SKCS_OFS_IP_DESTINATION_ADDRESS 16 +#define SKCS_OFS_IP_DESTINATION_ADDRESS 16 + + +/* + * Field offsets within the UDP header. + */ + +/* UDP checksum. */ +#define SKCS_OFS_UDP_CHECKSUM 6 /* IP "Next Level Protocol" identifiers (see RFC 790). */ -#define SKCS_PROTO_ID_TCP 6 /* Transport Control Protocol */ -#define SKCS_PROTO_ID_UDP 17 /* User Datagram Protocol */ +#define SKCS_PROTO_ID_TCP 6 /* Transport Control Protocol */ +#define SKCS_PROTO_ID_UDP 17 /* User Datagram Protocol */ /* IP "Don't Fragment" bit. */ #define SKCS_IP_DONT_FRAGMENT SKCS_HTON16(0x4000) @@ -235,9 +249,10 @@ * of the TCP or UDP pseudo header is returned here. */ void SkCsGetSendInfo( -SK_AC *pAc, /* Adapter context struct. */ -void *pIpHeader, /* IP header. */ -SKCS_PACKET_INFO *pPacketInfo) /* Packet information struct. */ +SK_AC *pAc, /* Adapter context struct. */ +void *pIpHeader, /* IP header. */ +SKCS_PACKET_INFO *pPacketInfo, /* Packet information struct. */ +int NetNumber) /* Net number */ { /* Internet Header Version found in IP header. */ unsigned InternetHeaderVersion; @@ -279,7 +294,7 @@ ("Tx: Unknown Internet Header Version %u.\n", InternetHeaderVersion)); pPacketInfo->ProtocolFlags = 0; - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxUnableCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++; return; } @@ -300,13 +315,13 @@ SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX, ("Tx: Invalid IP Header Length %u.\n", IpHeaderLength)); pPacketInfo->ProtocolFlags = 0; - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxUnableCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++; return; } /* This is an IPv4 frame with a header of valid length. */ - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxOkCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxOkCts++; /* Check if we should calculate the IP header checksum. */ @@ -335,14 +350,14 @@ /* TCP/IP frame. */ ProtocolFlags &= SKCS_PROTO_TCP | SKCS_PROTO_IP; NextLevelProtoStats = - &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_TCP]; + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP]; } else if ((ProtocolFlags & SKCS_PROTO_UDP) != 0 && NextLevelProtocol == SKCS_PROTO_ID_UDP) { /* UDP/IP frame. */ ProtocolFlags &= SKCS_PROTO_UDP | SKCS_PROTO_IP; NextLevelProtoStats = - &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_UDP]; + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP]; } else { /* @@ -408,7 +423,8 @@ SKCS_OC_ADD(pPacketInfo->PseudoHeaderChecksum, PseudoHeaderChecksum, 0); NextLevelProtoStats->TxOkCts++; /* Success. */ -} +} /* SkCsGetSendInfo */ + /****************************************************************************** * @@ -426,7 +442,8 @@ * pAc - Pointer to adapter context struct. * * pIpHeader - Pointer to IP header. Must be at least the length in bytes - * of the received IP header including any option fields. + * of the received IP header including any option fields. For UDP packets, + * 8 additional bytes are needed to access the UDP checksum. * * Note: The actual length of the IP header is stored in the lower four * bits of the first octet of the IP header as the number of 4-byte words, @@ -442,24 +459,27 @@ * Returns: * SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame. * SKCS_STATUS_IP_CSUM_ERROR - IP checksum error. + * SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame. + * SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame * SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok). * SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame). * SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok). * SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok). * SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok. * SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok. + * SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum. * - * Note: The SKCS_STATUS_XXX values returned here are *not* defined by - * the CSUM module but must be defined in some header file by the module - * using CSUM. In this way, the calling module can assign return values - * for its own needs, e.g. by assigning bit flags to the individual - * protocols. + * Note: If SKCS_OVERWRITE_STATUS is defined, the SKCS_STATUS_XXX values + * returned here can be defined in some header file by the module using CSUM. + * In this way, the calling module can assign return values for its own needs, + * e.g. by assigning bit flags to the individual protocols. */ SKCS_STATUS SkCsGetReceiveInfo( SK_AC *pAc, /* Adapter context struct. */ void *pIpHeader, /* IP header. */ unsigned Checksum1, /* Hardware checksum 1. */ -unsigned Checksum2) /* Hardware checksum 2. */ +unsigned Checksum2, /* Hardware checksum 2. */ +int NetNumber) /* Net number */ { /* Internet Header Version found in IP header. */ unsigned InternetHeaderVersion; @@ -506,7 +526,7 @@ SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX, ("Rx: Unknown Internet Header Version %u.\n", InternetHeaderVersion)); - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxUnableCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxUnableCts++; return (SKCS_STATUS_UNKNOWN_IP_VERSION); } @@ -525,7 +545,7 @@ if (IpHeaderLength < 5*4) { SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX, ("Rx: Invalid IP Header Length %u.\n", IpHeaderLength)); - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxErrCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++; return (SKCS_STATUS_IP_CSUM_ERROR); } @@ -555,18 +575,17 @@ /* Adjust the IP header and IP data checksums. */ - SKCS_OC_ADD(IpHeaderChecksum, - IpHeaderChecksum, IpOptionsChecksum); + SKCS_OC_ADD(IpHeaderChecksum, IpHeaderChecksum, IpOptionsChecksum); - SKCS_OC_SUB(IpDataChecksum, - IpDataChecksum, IpOptionsChecksum); + SKCS_OC_SUB(IpDataChecksum, IpDataChecksum, IpOptionsChecksum); } - /* Check if the IP header checksum is ok. */ /* - * NOTE: We must check the IP header checksum even if the caller does - * not want us to do so because we cannot do any further processing of - * the packet without a valid IP checksum. + * Check if the IP header checksum is ok. + * + * NOTE: We must check the IP header checksum even if the caller just wants + * us to check upper-layer checksums, because we cannot do any further + * processing of the packet without a valid IP checksum. */ /* Get the next level protocol identifier. */ @@ -575,7 +594,7 @@ SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL); if (IpHeaderChecksum != 0xFFFF) { - pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxErrCts++; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++; /* the NDIS tester wants to know the upper level protocol too */ if (NextLevelProtocol == SKCS_PROTO_ID_TCP) { return(SKCS_STATUS_IP_CSUM_ERROR_TCP); @@ -586,7 +605,6 @@ return (SKCS_STATUS_IP_CSUM_ERROR); } - /* * Check if this is a TCP or UDP frame and if we should calculate the * TCP/UDP pseudo header checksum. @@ -595,17 +613,17 @@ * frame. */ - if ((pAc->Csum.ReceiveFlags & SKCS_PROTO_TCP) != 0 && + if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_TCP) != 0 && NextLevelProtocol == SKCS_PROTO_ID_TCP) { /* TCP/IP frame. */ NextLevelProtoStats = - &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_TCP]; + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP]; } - else if ((pAc->Csum.ReceiveFlags & SKCS_PROTO_UDP) != 0 && + else if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_UDP) != 0 && NextLevelProtocol == SKCS_PROTO_ID_UDP) { /* UDP/IP frame. */ NextLevelProtoStats = - &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_UDP]; + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP]; } else { /* @@ -634,6 +652,24 @@ } /* + * 08-May-2000 ra + * + * From RFC 768 (UDP) + * If the computed checksum is zero, it is transmitted as all ones (the + * equivalent in one's complement arithmetic). An all zero transmitted + * checksum value means that the transmitter generated no checksum (for + * debugging or for higher level protocols that don't care). + */ + + if (NextLevelProtocol == SKCS_PROTO_ID_UDP && + *(SK_U16*)SKCS_IDX(pIpHeader, IpHeaderLength + 6) == 0x0000) { + + NextLevelProtoStats->RxOkCts++; + + return (SKCS_STATUS_IP_CSUM_OK_NO_UDP); + } + + /* * Calculate the TCP/UDP checksum. */ @@ -691,7 +727,8 @@ return (NextLevelProtocol == SKCS_PROTO_ID_TCP ? SKCS_STATUS_TCP_CSUM_ERROR : SKCS_STATUS_UDP_CSUM_ERROR); -} +} /* SkCsGetReceiveInfo */ + /****************************************************************************** * @@ -721,14 +758,15 @@ * Returns the two hardware checksum start offsets. */ void SkCsSetReceiveFlags( -SK_AC *pAc, /* Adapter context struct. */ +SK_AC *pAc, /* Adapter context struct. */ unsigned ReceiveFlags, /* New receive flags. */ unsigned *pChecksum1Offset, /* Offset for hardware checksum 1. */ -unsigned *pChecksum2Offset) /* Offset for hardware checksum 2. */ +unsigned *pChecksum2Offset, /* Offset for hardware checksum 2. */ +int NetNumber) { /* Save the receive flags. */ - pAc->Csum.ReceiveFlags = ReceiveFlags; + pAc->Csum.ReceiveFlags[NetNumber] = ReceiveFlags; /* First checksum start offset is the IP header. */ *pChecksum1Offset = SKCS_MAC_HEADER_SIZE; @@ -738,9 +776,10 @@ * if there are any IP header options in the actual packet. */ *pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE; -} +} /* SkCsSetReceiveFlags */ #ifndef SkCsCalculateChecksum + /****************************************************************************** * * SkCsCalculateChecksum - calculate checksum for specified data @@ -802,7 +841,8 @@ /* Note: All bits beyond the 16-bit limit are now zero. */ return ((unsigned) Checksum); -} +} /* SkCsCalculateChecksum */ + #endif /* SkCsCalculateChecksum */ /****************************************************************************** @@ -838,29 +878,32 @@ SK_EVPARA Param) /* Event dependent parameter. */ { int ProtoIndex; + int NetNumber; switch (Event) { /* * Clear protocol statistics. * * Param - Protocol index, or -1 for all protocols. + * - Net number. */ case SK_CSUM_EVENT_CLEAR_PROTO_STATS: - ProtoIndex = (int) Param.Para32[0]; + ProtoIndex = (int)Param.Para32[0]; + NetNumber = (int)Param.Para32[1]; if (ProtoIndex < 0) { /* Clear for all protocols. */ - memset(&pAc->Csum.ProtoStats[0], 0, - sizeof(pAc->Csum.ProtoStats)); + memset(&pAc->Csum.ProtoStats[NetNumber][0], 0, + sizeof(pAc->Csum.ProtoStats[NetNumber])); } - else { /* Clear for individual protocol. */ - memset(&pAc->Csum.ProtoStats[ProtoIndex], 0, - sizeof(pAc->Csum.ProtoStats[ProtoIndex])); + else { /* Clear for individual protocol. */ + memset(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0, + sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex])); } break; default: break; } return (0); /* Success. */ -} +} /* SkCsEvent */ #endif /* SK_USE_CSUM */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skge.c linux.20p9/drivers/net/sk98lin/skge.c --- linux.vanilla/drivers/net/sk98lin/skge.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skge.c Wed Jul 4 16:03:55 2001 @@ -1,20 +1,22 @@ /****************************************************************************** * - * Name: skge.c + * Name: skge.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.29 $ - * Date: $Date: 2000/02/21 13:31:56 $ + * Version: $Revision: 1.37 $ + * Date: $Date: 2001/05/08 11:25:40 $ * Purpose: The main driver source module * ******************************************************************************/ + /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * Driver for SysKonnect Gigabit Ethernet Server Adapters: * + * SK-9861 (single link 1000Base-SX, VF45 Volition Plug) + * SK-9862 (dual link 1000Base-SX, VF45 Volition Plug) * SK-9841 (single link 1000Base-LX) * SK-9842 (dual link 1000Base-LX) * SK-9843 (single link 1000Base-SX) @@ -25,6 +27,7 @@ * Created 10-Feb-1999, based on Linux' acenic.c, 3c59x.c and * SysKonnects GEnesis Solaris driver * Author: Christoph Goos (cgoos@syskonnect.de) + * Mirko Lindner (mlindner@syskonnect.de) * * Address all question to: linux@syskonnect.de * @@ -41,11 +44,40 @@ * ******************************************************************************/ + /****************************************************************************** * * History: * * $Log: skge.c,v $ + * Revision 1.37 2001/05/08 11:25:40 mlindner + * fix: removed VLAN error message + * + * Revision 1.36 2001/05/04 12:02:25 gklug + * fix: compilation bug + * + * Revision 1.35 2001/05/04 11:42:12 gklug + * fix: receive IRQ can now handle invalid frames correctly + * + * Revision 1.34 2001/05/04 11:13:49 gklug + * fix: do not free meassage if ring is full on entry. + * + * Revision 1.33 2001/03/20 12:26:08 mlindner + * Fix: Memory problem + * Fix: proc_unregister fixed + * + * Revision 1.32 2001/03/01 12:50:52 mlindner + * Fixed ring size + * + * Revision 1.31 2001/02/19 13:14:16 mlindner + * Changed PNMI parameter values + * Corrected ProcFs functionality + * + * Revision 1.30 2001/01/22 14:15:29 mlindner + * added ProcFs functionality + * Dual Net functionality integrated + * Rlmt networks added + * * Revision 1.29 2000/02/21 13:31:56 cgoos * Fixed "unused" warning for UltraSPARC change. * @@ -233,23 +265,16 @@ * ******************************************************************************/ -static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect."; -static const char SysKonnectBuildNumber[] = - "@(#)SK-BUILD: 3.04 (19991111) PL: 01"; +#include "h/skversion.h" #include +#include #include "h/skdrv1st.h" #include "h/skdrv2nd.h" /* defines ******************************************************************/ -#define BOOT_STRING "sk98lin: Network Device Driver v3.04\n" \ - "Copyright (C) 1999 SysKonnect" - -#define VER_STRING "3.04" - - /* for debuging on x86 only */ /* #define BREAKPOINT() asm(" int $3"); */ @@ -269,6 +294,7 @@ /* number of adapters that can be configured via command line params */ #define SK_MAX_CARD_PARAM 16 + /* * use those defines for a compile-in version of the driver instead * of command line parameters @@ -282,7 +308,8 @@ // #define ROLE_A {"Auto", } // #define ROLE_B {"Auto", } // #define PREF_PORT {"A", } -// #define RLMT_MODE {"CheckLink", } +// #define RLMT_MODE {"CheckLinkState", } + #define DEV_KFREE_SKB(skb) dev_kfree_skb(skb); @@ -314,14 +341,23 @@ static void FillRxRing(SK_AC*, RX_PORT*); static SK_BOOL FillRxDescriptor(SK_AC*, RX_PORT*); static void ReceiveIrq(SK_AC*, RX_PORT*); -static void ClearAndStartRx(SK_AC*, int); +void ClearAndStartRx(SK_AC*, int); static void ClearTxIrq(SK_AC*, int, int); static void ClearRxRing(SK_AC*, RX_PORT*); static void ClearTxRing(SK_AC*, TX_PORT*); static void SetQueueSizes(SK_AC *pAC); static int SkGeChangeMtu(struct device *dev, int new_mtu); static void PortReInitBmu(SK_AC*, int); -static int SkGeIocMib(SK_AC*, unsigned int, int); +static int SkGeIocMib(DEV_NET*, unsigned int, int); +static struct dentry *SkgeProcLookup(struct inode *dir, struct dentry *dentry); +static int SkgeProcFileOpen(struct inode *inode, struct file *file); +static int SkgeProcFileRelease(struct inode *inode, struct file *file); + +/*Extern */ +extern struct proc_dir_entry Our_Proc_Dir; +extern int proc_read(char *buffer, char **buffer_location, + off_t offset, int buffer_length, int *eof, void *data); + #ifdef DEBUG static void DumpMsg(struct sk_buff*, char*); static void DumpData(char*, int); @@ -331,13 +367,27 @@ /* global variables *********************************************************/ static const char *BootString = BOOT_STRING; -static struct device *root_dev = NULL; +struct device *root_dev = NULL; static int probed __initdata = 0; +struct inode_operations SkInodeOps; +static struct file_operations SkFileOps; /* with open/relase */ /* local variables **********************************************************/ static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}}; static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480}; + + +void proc_fill_inode(struct inode *inode, int fill) +{ + if (fill) + MOD_INC_USE_COUNT; + else + MOD_DEC_USE_COUNT; +} + + + /***************************************************************************** * * skge_probe - find all SK-98xx adapters @@ -353,11 +403,13 @@ */ __initfunc(int skge_probe (struct device *dev)) { -int boards_found = 0; -int version_disp = 0; -SK_AC *pAC; -struct pci_dev *pdev = NULL; -unsigned long base_address; +int boards_found = 0; +int DeviceFound = SK_FALSE; +SK_AC *pAC; +DEV_NET *pNet = NULL; +struct pci_dev *pdev = NULL; +unsigned long base_address; +struct proc_dir_entry *pProcFile; #ifdef __sparc_v9__ unsigned short tmp; #endif @@ -366,52 +418,76 @@ return -ENODEV; probed++; - /* display driver info */ - if (!version_disp) - { - /* set display flag to TRUE so that */ - /* we only display this string ONCE */ - version_disp = 1; - printk("%s\n", BootString); - } - if (!pci_present()) /* is PCI support present? */ return -ENODEV; while((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { dev = NULL; + pNet = NULL; if (pdev->vendor != PCI_VENDOR_ID_SYSKONNECT || pdev->device != PCI_DEVICE_ID_SYSKONNECT_GE) { continue; + } + + if ((dev = init_etherdev(dev, sizeof(DEV_NET))) == 0) { + printk(KERN_ERR "Unable to allocate etherdev " + "structure!\n"); + break; } - dev = init_etherdev(dev, sizeof(SK_AC)); - if (dev == NULL){ - printk(KERN_ERR "Unable to allocate etherdev " + if (dev->priv == NULL) + dev->priv = kmalloc(sizeof(DEV_NET), GFP_KERNEL); + + if (dev->priv == NULL) { + printk(KERN_ERR "Unable to allocate adapter " "structure!\n"); break; } - if (!dev->priv) - dev->priv = kmalloc(sizeof(SK_AC), GFP_KERNEL); - if (dev->priv == NULL){ + pNet = dev->priv; + pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); + if (pNet->pAC == NULL){ + kfree(dev->priv); printk(KERN_ERR "Unable to allocate adapter " "structure!\n"); break; } + if (!DeviceFound) { + /* set display flag to TRUE so that */ + /* we only display this string ONCE */ + printk("%s\n", BootString); + + DeviceFound = SK_TRUE; + + /*Create proc (directory)*/ + proc_register(proc_net, &Our_Proc_Dir); + + memcpy(&SkInodeOps, &proc_dir_inode_operations, + sizeof(struct inode_operations)); + SkInodeOps.lookup = &SkgeProcLookup; + SkInodeOps.default_file_ops = &SkFileOps; + + memcpy(&SkFileOps, proc_net_inode_operations.default_file_ops, + sizeof(struct file_operations)); + SkFileOps.open = &SkgeProcFileOpen; + SkFileOps.release = &SkgeProcFileRelease; + } - memset(dev->priv, 0, sizeof(SK_AC)); - - pAC = dev->priv; + memset(pNet->pAC, 0, sizeof(SK_AC)); + pAC = pNet->pAC; pAC->PciDev = *pdev; pAC->PciDevId = pdev->device; - pAC->dev = dev; + pAC->dev[0] = dev; + pAC->dev[1] = dev; sprintf(pAC->Name, "SysKonnect SK-98xx"); pAC->CheckQueue = SK_FALSE; + + pNet->Mtu = 1500; + pNet->Up = 0; dev->irq = pdev->irq; dev->open = &SkGeOpen; @@ -422,7 +498,16 @@ dev->set_mac_address = &SkGeSetMacAddr; dev->do_ioctl = &SkGeIoctl; dev->change_mtu = &SkGeChangeMtu; - + + pProcFile = create_proc_entry(dev->name, + S_IFREG | 0444, &Our_Proc_Dir); + pProcFile->ops = &SkInodeOps; + pProcFile->read_proc = proc_read; + pProcFile->write_proc = NULL; + pProcFile->nlink = 1; + pProcFile->size = sizeof(dev->name+1); + pProcFile->data = (void*)pProcFile; + /* * Dummy value. */ @@ -433,8 +518,9 @@ base_address = pdev->base_address[0]; base_address &= PCI_BASE_ADDRESS_MEM_MASK; + #ifdef __sparc_v9__ - /* SPARC machines do not initialize the chache line size */ + /* SPARC machines do not initialize the cache line size */ pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 64); /* SPARC machines do not set "Memory write and invalidate" */ pci_read_config_word(pdev, PCI_COMMAND, &tmp); @@ -473,17 +559,76 @@ break; } pAC->Index = boards_found; - if (SkGeBoardInit(dev, pAC)) { FreeResources(dev); continue; } - memcpy((caddr_t) &dev->dev_addr, - (caddr_t) &pAC->Addr.CurrentMacAddress, 6); - + memcpy((caddr_t) &dev->dev_addr, + (caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6); + + pNet->PortNr = 0; + pNet->NetNr = 0; + boards_found++; + /* More then one port found */ + if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) { + if ((dev = init_etherdev(NULL, sizeof(DEV_NET))) == 0) { + printk(KERN_ERR "Unable to allocate etherdev " + "structure!\n"); + break; + } + + if (dev->priv == NULL) + dev->priv = kmalloc(sizeof(DEV_NET), GFP_KERNEL); + + if (dev->priv == NULL) { + printk(KERN_ERR "Unable to allocate adapter " + "structure!\n"); + break; + } + + pAC->dev[1] = dev; + pNet = dev->priv; + pNet->PortNr = 1; + pNet->NetNr = 1; + pNet->pAC = pAC; + pNet->Mtu = 1500; + pNet->Up = 0; + + dev->open = &SkGeOpen; + dev->stop = &SkGeClose; + dev->hard_start_xmit = &SkGeXmit; + dev->get_stats = &SkGeStats; + dev->set_multicast_list = &SkGeSetRxMode; + dev->set_mac_address = &SkGeSetMacAddr; + dev->do_ioctl = &SkGeIoctl; + dev->change_mtu = &SkGeChangeMtu; + + + pProcFile = create_proc_entry(dev->name, + S_IFREG | 0444, &Our_Proc_Dir); + pProcFile->ops = &SkInodeOps; + pProcFile->read_proc = proc_read; + pProcFile->write_proc = NULL; + pProcFile->nlink = 1; + pProcFile->size = sizeof(dev->name); + pProcFile->data = (void*)pProcFile; + + memcpy((caddr_t) &dev->dev_addr, + (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); + + printk("%s: %s\n", dev->name, pAC->DeviceStr); + printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); + + SkCsSetReceiveFlags(pAC, + SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP, + &pAC->CsOfs1, &pAC->CsOfs2, 1); + + } + + /* * This is bollocks, but we need to tell the net-init * code that it shall go for the next device. @@ -493,6 +638,9 @@ #endif } + + + /* * If we're at this point we're going through skge_probe() for * the first time. Return success (0) if we've initialized 1 @@ -524,10 +672,13 @@ static void FreeResources(struct device *dev) { SK_U32 AllocFlag; -SK_AC *pAC; + +DEV_NET *pNet; +SK_AC *pAC; if (dev->priv) { - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; AllocFlag = pAC->AllocFlag; if (AllocFlag & SK_ALLOC_IRQ) { free_irq(dev->irq, dev); @@ -542,6 +693,24 @@ } /* FreeResources */ +static struct dentry *SkgeProcLookup(struct inode *dir, struct dentry *dentry) +{ + return NULL; +} + +static int SkgeProcFileOpen(struct inode *inode, struct file *file) +{ + MOD_INC_USE_COUNT; + return 0; +} + +static int SkgeProcFileRelease(struct inode *inode, struct file *file) +{ + MOD_DEC_USE_COUNT; + return 0; +} + + #ifdef MODULE @@ -630,7 +799,6 @@ static int debug = 0; /* not used */ static int options[SK_MAX_CARD_PARAM] = {0, }; /* not used */ - /***************************************************************************** * * init_module - module initialization function @@ -645,7 +813,6 @@ int init_module(void) { int cards; - root_dev = NULL; /* just to avoid warnings ... */ @@ -653,9 +820,6 @@ options[0] = 0; cards = skge_probe(NULL); - if (cards == 0) { - printk("No adapter found\n"); - } return cards ? 0 : -ENODEV; } /* init_module */ @@ -672,21 +836,29 @@ */ void cleanup_module(void) { -SK_AC *pAC; +DEV_NET *pNet; +SK_AC *pAC; struct device *next; unsigned long Flags; SK_EVPARA EvPara; while (root_dev) { - pAC = (SK_AC*)root_dev->priv; + pNet = (DEV_NET*) root_dev->priv; + pAC = pNet->pAC; next = pAC->Next; root_dev->tbusy = 1; SkGeYellowLED(pAC, pAC->IoBase, 0); + remove_proc_entry(pAC->dev[0]->name, &Our_Proc_Dir); if(pAC->BoardLevel == 2) { /* board is still alive */ spin_lock_irqsave(&pAC->SlowPathLock, Flags); + EvPara.Para32[0] = 0; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + EvPara.Para32[0] = 1; + EvPara.Para32[1] = -1; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); SkEventDispatcher(pAC, pAC->IoBase); /* disable interrupts */ @@ -696,25 +868,36 @@ pAC->BoardLevel = 0; /* We do NOT check here, if IRQ was pending, of course*/ } - + if(pAC->BoardLevel == 1) { /* board is still alive */ SkGeDeInit(pAC, pAC->IoBase); pAC->BoardLevel = 0; } - + + if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){ + remove_proc_entry(pAC->dev[1]->name, &Our_Proc_Dir); + unregister_netdev(pAC->dev[1]); + kfree(pAC->dev[1]); + } + FreeResources(root_dev); - + root_dev->get_stats = NULL; /* * otherwise unregister_netdev calls get_stats with * invalid IO ... :-( */ + unregister_netdev(root_dev); kfree(root_dev); - + kfree(pAC); root_dev = next; } + + /* clear proc-dir */ + proc_unregister(proc_net, Our_Proc_Dir.low_ino); + } #endif /* cleanup_module */ @@ -781,8 +964,6 @@ spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); - GetConfiguration(pAC); - /* level 1 init common modules here (HW init) */ spin_lock_irqsave(&pAC->SlowPathLock, Flags); if (SkGeInit(pAC, pAC->IoBase, 1) != 0) { @@ -800,6 +981,12 @@ pAC->BoardLevel = 1; spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + GetConfiguration(pAC); + if (pAC->RlmtNets == 2) { + pAC->GIni.GIPortUsage = SK_MUL_LINK; + } + + if (pAC->GIni.GIMacsFound == 2) { Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); } else if (pAC->GIni.GIMacsFound == 1) { @@ -825,7 +1012,7 @@ SkCsSetReceiveFlags(pAC, SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP, - &pAC->CsOfs1, &pAC->CsOfs2); + &pAC->CsOfs1, &pAC->CsOfs2, 0); pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1; BoardInitMem(pAC); @@ -838,13 +1025,15 @@ /* Print configuration settings */ printk(" PrefPort:%c RlmtMode:%s\n", - 'A' + pAC->Rlmt.PrefPort, - (pAC->RlmtMode==0) ? "ChkLink" : - ((pAC->RlmtMode==1) ? "ChkLink" : - ((pAC->RlmtMode==3) ? "ChkOth" : - ((pAC->RlmtMode==7) ? "ChkSeg" : "Error")))); + 'A' + pAC->Rlmt.Net[0].Port[pAC->Rlmt.Net[0].PrefPort]->PortNumber, + (pAC->RlmtMode==0) ? "Check Link State" : + ((pAC->RlmtMode==1) ? "Check Link State" : + ((pAC->RlmtMode==3) ? "Check Local Port" : + ((pAC->RlmtMode==7) ? "Check Segmentation" : + ((pAC->RlmtMode==17) ? "Dual Check Link State" :"Error"))))); - SkGeYellowLED(pAC, pAC->IoBase, 1); + SkGeYellowLED(pAC, pAC->IoBase, 1); + /* * Register the device here @@ -1028,8 +1217,7 @@ DescrSize = (((sizeof(TXD) - 1) / DESCR_ALIGN) + 1) * DESCR_ALIGN; DescrNum = TX_RING_SIZE / DescrSize; - } - else { + } else { DescrSize = (((sizeof(RXD) - 1) / DESCR_ALIGN) + 1) * DESCR_ALIGN; DescrNum = RX_RING_SIZE / DescrSize; @@ -1048,7 +1236,8 @@ pDescr->VNextRxd = VNextDescr & 0xffffffffULL; pDescr->pNextRxd = pNextDescr; pDescr->TcpSumStarts = pAC->CsOfs; - /* advance on step */ + + /* advance one step */ pPrevDescr = pDescr; pDescr = pNextDescr; pNextDescr = (RXD*) (((char*)pDescr) + DescrSize); @@ -1123,10 +1312,12 @@ static void SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs) { struct device *dev = (struct device *)dev_id; +DEV_NET *pNet; SK_AC *pAC; SK_U32 IntSrc; /* interrupts source register contents */ - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; /* * Check and process if its our interrupt @@ -1149,21 +1340,21 @@ SK_DBGCAT_DRV_INT_SRC, ("EOF RX1 IRQ\n")); ReceiveIrq(pAC, &pAC->RxPort[0]); - SK_PNMI_CNT_RX_INTR(pAC); + SK_PNMI_CNT_RX_INTR(pAC, 0); } if (IntSrc & IRQ_EOF_RX2) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF RX2 IRQ\n")); ReceiveIrq(pAC, &pAC->RxPort[1]); - SK_PNMI_CNT_RX_INTR(pAC); + SK_PNMI_CNT_RX_INTR(pAC, 1); } #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */ if (IntSrc & IRQ_EOF_AS_TX1) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF AS TX1 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 0); spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); @@ -1172,7 +1363,7 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF AS TX2 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 1); spin_lock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); FreeTxDescriptors(pAC, &pAC->TxPort[1][TX_PRIO_LOW]); spin_unlock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); @@ -1182,7 +1373,7 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF SY TX1 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 1); spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); @@ -1192,7 +1383,7 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF SY TX2 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 1); spin_lock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); FreeTxDescriptors(pAC, 1, TX_PRIO_HIGH); spin_unlock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); @@ -1217,11 +1408,12 @@ if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, - ("SPECIAL IRQ\n")); + ("SPECIAL IRQ DP-Cards => %x\n", IntSrc)); pAC->CheckQueue = SK_FALSE; spin_lock(&pAC->SlowPathLock); - if (IntSrc & SPECIAL_IRQS) + if (IntSrc & SPECIAL_IRQS) SkGeSirqIsr(pAC, pAC->IoBase, IntSrc); + SkEventDispatcher(pAC, pAC->IoBase); spin_unlock(&pAC->SlowPathLock); } @@ -1230,29 +1422,10 @@ * came in after handling the ring (OUTs may be delayed * in hardware buffers, but are through after IN) */ - ReceiveIrq(pAC, &pAC->RxPort[pAC->ActivePort]); -// ReceiveIrq(pAC, &pAC->RxPort[1]); +// ReceiveIrq(pAC, &pAC->RxPort[pAC->ActivePort]); + ReceiveIrq(pAC, &pAC->RxPort[0]); + ReceiveIrq(pAC, &pAC->RxPort[1]); -#if 0 -// #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */ - spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); - FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); - spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); - - spin_lock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); - FreeTxDescriptors(pAC, &pAC->TxPort[1][TX_PRIO_LOW]); - spin_unlock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); - -#if 0 /* only if sync. queues used */ - spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); - FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); - spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); - - spin_lock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); - FreeTxDescriptors(pAC, 1, TX_PRIO_HIGH); - spin_unlock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); -#endif /* 0 */ -#endif /* USE_TX_COMPLETE */ /* IRQ is processed - Enable IRQs again*/ SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK); @@ -1277,10 +1450,12 @@ static void SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs) { struct device *dev = (struct device *)dev_id; +DEV_NET *pNet; SK_AC *pAC; SK_U32 IntSrc; /* interrupts source register contents */ - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; /* * Check and process if its our interrupt @@ -1303,14 +1478,14 @@ SK_DBGCAT_DRV_INT_SRC, ("EOF RX1 IRQ\n")); ReceiveIrq(pAC, &pAC->RxPort[0]); - SK_PNMI_CNT_RX_INTR(pAC); + SK_PNMI_CNT_RX_INTR(pAC, 0); } #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */ if (IntSrc & IRQ_EOF_AS_TX1) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF AS TX1 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 0); spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); @@ -1320,7 +1495,7 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, ("EOF SY TX1 IRQ\n")); - SK_PNMI_CNT_TX_INTR(pAC); + SK_PNMI_CNT_TX_INTR(pAC, 0); spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); @@ -1341,11 +1516,12 @@ if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC, - ("SPECIAL IRQ\n")); + ("SPECIAL IRQ SP-Cards => %x\n", IntSrc)); pAC->CheckQueue = SK_FALSE; spin_lock(&pAC->SlowPathLock); - if (IntSrc & SPECIAL_IRQS) + if (IntSrc & SPECIAL_IRQS) SkGeSirqIsr(pAC, pAC->IoBase, IntSrc); + SkEventDispatcher(pAC, pAC->IoBase); spin_unlock(&pAC->SlowPathLock); } @@ -1356,20 +1532,6 @@ */ ReceiveIrq(pAC, &pAC->RxPort[0]); -#if 0 -// #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */ - spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); - FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); - spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); - -#if 0 /* only if sync. queues used */ - spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); - FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); - spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); - -#endif /* 0 */ -#endif /* USE_TX_COMPLETE */ - /* IRQ is processed - Enable IRQs again*/ SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK); @@ -1396,12 +1558,14 @@ static int SkGeOpen( struct device *dev) { -SK_AC *pAC; /* pointer to adapter context struct */ +DEV_NET *pNet; +SK_AC *pAC; unsigned int Flags; /* for spin lock */ int i; -SK_EVPARA EvPara; /* an event parameter union */ +SK_EVPARA EvPara; /* an event parameter union */ - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeOpen: pAC=0x%lX:\n", (unsigned long)pAC)); @@ -1409,7 +1573,7 @@ if (pAC->BoardLevel == 0) { /* level 1 init common modules here */ if (SkGeInit(pAC, pAC->IoBase, 1) != 0) { - printk("%s: HWInit(1) failed\n", pAC->dev->name); + printk("%s: HWInit(1) failed\n", pAC->dev[pNet->PortNr]->name); return (-1); } SkI2cInit (pAC, pAC->IoBase, 1); @@ -1420,26 +1584,30 @@ SkTimerInit (pAC, pAC->IoBase, 1); pAC->BoardLevel = 1; } - - /* level 2 init modules here */ - SkGeInit (pAC, pAC->IoBase, 2); - SkI2cInit (pAC, pAC->IoBase, 2); - SkEventInit (pAC, pAC->IoBase, 2); - SkPnmiInit (pAC, pAC->IoBase, 2); - SkAddrInit (pAC, pAC->IoBase, 2); - SkRlmtInit (pAC, pAC->IoBase, 2); - SkTimerInit (pAC, pAC->IoBase, 2); - pAC->BoardLevel = 2; + + if (pAC->BoardLevel != 2) { + /* level 2 init modules here */ + SkGeInit (pAC, pAC->IoBase, 2); + SkI2cInit (pAC, pAC->IoBase, 2); + SkEventInit (pAC, pAC->IoBase, 2); + SkPnmiInit (pAC, pAC->IoBase, 2); + SkAddrInit (pAC, pAC->IoBase, 2); + SkRlmtInit (pAC, pAC->IoBase, 2); + SkTimerInit (pAC, pAC->IoBase, 2); + pAC->BoardLevel = 2; + } for (i=0; iGIni.GIMacsFound; i++) { - // Enable transmit descriptor polling. + /* Enable transmit descriptor polling. */ SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE); FillRxRing(pAC, &pAC->RxPort[i]); + // Enable rx pad byte stripping + SkXmSetRxCmd(pAC, pAC->IoBase, i, SK_STRIP_PAD_ON); } SkGeYellowLED(pAC, pAC->IoBase, 1); #ifdef USE_INT_MOD -// moderate only TX complete interrupts (these are not time critical) +/* moderate only TX complete interrupts (these are not time critical) */ #define IRQ_MOD_MASK (IRQ_EOF_AS_TX1 | IRQ_EOF_AS_TX2) { unsigned long ModBase; @@ -1455,21 +1623,32 @@ SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK); spin_lock_irqsave(&pAC->SlowPathLock, Flags); - SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); - if (pAC->RlmtMode != 0) { + + if ((pAC->RlmtMode != 0) && (pAC->MaxPorts == 0)) { + EvPara.Para32[0] = pAC->RlmtNets; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS, + EvPara); EvPara.Para32[0] = pAC->RlmtMode; + EvPara.Para32[1] = 0; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_MODE_CHANGE, EvPara); } + + EvPara.Para32[0] = pNet->NetNr; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); SkEventDispatcher(pAC, pAC->IoBase); spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + pAC->MaxPorts++; + pNet->Up = 1; dev->tbusy = 0; dev->interrupt = 0; dev->start = 1; MOD_INC_USE_COUNT; - + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeOpen suceeded\n")); @@ -1491,54 +1670,91 @@ static int SkGeClose( struct device *dev) { +DEV_NET *pNet; SK_AC *pAC; + unsigned int Flags; /* for spin lock */ int i; SK_EVPARA EvPara; +int PortIdx; dev->start = 0; set_bit(0, (void*)&dev->tbusy); - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeClose: pAC=0x%lX ", (unsigned long)pAC)); + if (pAC->RlmtNets == 1) { + PortIdx = pAC->ActivePort; + } + else { + PortIdx = pNet->NetNr; + } /* * Clear multicast table, promiscuous mode .... */ - SkAddrMcClear(pAC, pAC->IoBase, pAC->ActivePort, 0); - SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0); + SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx, SK_PROM_MODE_NONE); + if (pAC->MaxPorts == 1) { + spin_lock_irqsave(&pAC->SlowPathLock, Flags); + /* disable interrupts */ + SK_OUT32(pAC->IoBase, B0_IMSK, 0); + EvPara.Para32[0] = pNet->NetNr; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + SkEventDispatcher(pAC, pAC->IoBase); + SK_OUT32(pAC->IoBase, B0_IMSK, 0); + /* stop the hardware */ + SkGeDeInit(pAC, pAC->IoBase); + pAC->BoardLevel = 0; + spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + } else { - spin_lock_irqsave(&pAC->SlowPathLock, Flags); - /* disable interrupts */ - SK_OUT32(pAC->IoBase, B0_IMSK, 0); - SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); - SkEventDispatcher(pAC, pAC->IoBase); - SK_OUT32(pAC->IoBase, B0_IMSK, 0); - /* stop the hardware */ - SkGeDeInit(pAC, pAC->IoBase); - pAC->BoardLevel = 0; - - spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + spin_lock_irqsave(&pAC->SlowPathLock, Flags); + EvPara.Para32[0] = pNet->NetNr; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + SkEventDispatcher(pAC, pAC->IoBase); + spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + + /* Stop port */ + spin_lock_irqsave(&pAC->TxPort[pNet->PortNr] + [TX_PRIO_LOW].TxDesRingLock, Flags); + SkGeStopPort(pAC, pAC->IoBase, pNet->PortNr, + SK_STOP_ALL, SK_HARD_RST); + spin_unlock_irqrestore(&pAC->TxPort[pNet->PortNr] + [TX_PRIO_LOW].TxDesRingLock, Flags); + } - for (i=0; iGIni.GIMacsFound; i++) { + if (pAC->RlmtNets == 1) { /* clear all descriptor rings */ - ReceiveIrq(pAC, &pAC->RxPort[i]); - ClearRxRing(pAC, &pAC->RxPort[i]); - ClearTxRing(pAC, &pAC->TxPort[i][TX_PRIO_LOW]); + for (i=0; iGIni.GIMacsFound; i++) { + ReceiveIrq(pAC, &pAC->RxPort[i]); + ClearRxRing(pAC, &pAC->RxPort[i]); + ClearTxRing(pAC, &pAC->TxPort[i][TX_PRIO_LOW]); + } + } else { + /* clear port descriptor rings */ + ReceiveIrq(pAC, &pAC->RxPort[pNet->PortNr]); + ClearRxRing(pAC, &pAC->RxPort[pNet->PortNr]); + ClearTxRing(pAC, &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW]); } - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, - ("SkGeClose: done ")); + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,("SkGeClose: done ")); + pAC->MaxPorts--; + pNet->Up = 0; MOD_DEC_USE_COUNT; return (0); } /* SkGeClose */ + /***************************************************************************** * * SkGeXmit - Linux frame transmit function @@ -1556,12 +1772,18 @@ */ static int SkGeXmit(struct sk_buff *skb, struct device *dev) { +DEV_NET *pNet; SK_AC *pAC; -int Rc; /* return code of XmitFrame */ - - pAC = (SK_AC*) dev->priv; +int Rc; /* return code of XmitFrame */ - Rc = XmitFrame(pAC, &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], skb); + + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; + + if (pAC->RlmtNets == 2) + Rc = XmitFrame(pAC, &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW], skb); + else + Rc = XmitFrame(pAC, &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], skb); if (Rc <= 0) { /* transmitter out of resources */ @@ -1618,12 +1840,13 @@ FreeTxDescriptors(pAC, pTxPort); if (pTxPort->TxdRingFree == 0) { spin_unlock_irqrestore(&pTxPort->TxDesRingLock, Flags); - SK_PNMI_CNT_NO_TX_BUF(pAC); + SK_PNMI_CNT_NO_TX_BUF(pAC, pTxPort->PortIndex); SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_TX_PROGRESS, ("XmitFrame failed\n")); /* this message can not be sent now */ - DEV_KFREE_SKB(pMessage); + /* Because tbusy seems to be set, the message should not be freed here */ + /* It will be used by the scheduler of the ethernet handler */ return (-1); } } @@ -1701,9 +1924,11 @@ TXD *pTxd; /* pointer to the checked descriptor */ TXD *pNewTail; /* pointer to 'end' of the ring */ SK_U32 Control; /* TBControl field of descriptor */ +DEV_NET *pNet; pNewTail = pTxPort->pTxdRingTail; pTxd = pNewTail; + pNet = (DEV_NET*) pAC->dev[pTxPort->PortIndex]->priv; /* * loop forever; exits if TX_CTRL_SOFTWARE bit not set in start frame @@ -1719,20 +1944,21 @@ * freed ( -> ring completely free now). */ pTxPort->pTxdRingTail = pTxd; - pAC->dev->tbusy = 0; + pAC->dev[pTxPort->PortIndex]->tbusy = 0; return; } if (Control & TX_CTRL_OWN_BMU) { pTxPort->pTxdRingTail = pTxd; if (pTxPort->TxdRingFree > 0) { - pAC->dev->tbusy = 0; + pAC->dev[pTxPort->PortIndex]->tbusy = 0; } return; } - + DEV_KFREE_SKB(pTxd->pMBuf); /* free message */ + pTxPort->TxdRingFree++; - pTxd->TBControl &= ~TX_CTRL_SOFTWARE; + pTxd->TBControl = 0; /* reset TX_CTRL_SOFTWARE */ pTxd = pTxd->pNextTxd; /* point behind fragment with EOF */ } /* while(forever) */ } /* FreeTxDescriptors */ @@ -1796,8 +2022,8 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("%s: Allocation of rx buffer failed !\n", - pAC->dev->name)); - SK_PNMI_CNT_NO_RX_BUF(pAC); + pAC->dev[pRxPort->PortIndex]->name)); + SK_PNMI_CNT_NO_RX_BUF(pAC, pRxPort->PortIndex); return(SK_FALSE); } skb_reserve(pMsgBlock, 2); /* to align IP frames */ @@ -1887,31 +2113,71 @@ rx_start: /* do forever; exit if RX_CTRL_OWN_BMU found */ - while (pRxPort->RxdRingFree < pAC->RxDescrPerRing) { - pRxd = pRxPort->pRxdRingHead; - + for ( pRxd = pRxPort->pRxdRingHead ; + pRxPort->RxdRingFree < pAC->RxDescrPerRing ; + pRxd = pRxd->pNextRxd, + pRxPort->pRxdRingHead = pRxd, + pRxPort->RxdRingFree ++) { + + /* + * For a better understanding of this loop + * Go through every descriptor beginning at the head + * Please note: the ring might be completely received so the OWN bit + * set is not a good crirteria to leave that loop. + * Therefore the RingFree counter is used. + * On entry of this loop pRxd is a pointer to the Rxd that needs + * to be checked next. + */ + Control = pRxd->RBControl; - + /* check if this descriptor is ready */ if ((Control & RX_CTRL_OWN_BMU) != 0) { /* this descriptor is not yet ready */ + /* This is the usual end of the loop */ + /* We don't need to start the ring again */ FillRxRing(pAC, pRxPort); return; } - + /* get length of frame and check it */ FrameLength = Control & RX_CTRL_LEN_MASK; - if (FrameLength > pAC->RxBufSize) + if (FrameLength > pAC->RxBufSize) { goto rx_failed; + } /* check for STF and EOF */ if ((Control & (RX_CTRL_STF | RX_CTRL_EOF)) != - (RX_CTRL_STF | RX_CTRL_EOF)) + (RX_CTRL_STF | RX_CTRL_EOF)) { goto rx_failed; + } /* here we have a complete frame in the ring */ pMsg = pRxd->pMBuf; + + FrameStat = pRxd->FrameStat; + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0, + ("Received frame of length %d on port %d\n", + FrameLength, PortIndex)); + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0, + ("Number of free rx descriptors: %d\n", + pRxPort->RxdRingFree)); +/*DumpMsg(pMsg, "Rx"); */ + if ((Control & RX_CTRL_STAT_VALID) != RX_CTRL_STAT_VALID || + (FrameStat & (XMR_FS_ANY_ERR | XMR_FS_2L_VLAN)) != 0) { + /* there is a receive error in this frame */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, + SK_DBGCAT_DRV_RX_PROGRESS, + ("skge: Error in received frame, dropped!\n" + "Control: %x\nRxStat: %x\n", + Control, FrameStat)); + ReQueueRxBuffer(pAC, pRxPort, pMsg, + pRxd->VDataHigh, pRxd->VDataLow); + + continue; + } + /* * if short frame then copy data to reduce memory waste */ @@ -1946,7 +2212,7 @@ if ((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) { Result = SkCsGetReceiveInfo(pAC, &pMsg->data[14], - Csum1, Csum2); + Csum1, Csum2, pRxPort->PortIndex); if (Result == SKCS_STATUS_IP_FRAGMENT || Result == @@ -1962,119 +2228,85 @@ } /* IP frame */ } /* frame > SK_COPY_TRESHOLD */ - FrameStat = pRxd->FrameStat; - pRxd = pRxd->pNextRxd; - pRxPort->pRxdRingHead = pRxd; - pRxPort->RxdRingFree ++; - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_RX_PROGRESS, - ("Received frame of length %d on port %d\n", - FrameLength, PortIndex)); - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_RX_PROGRESS, - ("Number of free rx descriptors: %d\n", - pRxPort->RxdRingFree)); - - if ((Control & RX_CTRL_STAT_VALID) == RX_CTRL_STAT_VALID && - (FrameStat & - (XMR_FS_ANY_ERR | XMR_FS_1L_VLAN | XMR_FS_2L_VLAN)) - == 0) { - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS,("V")); - ForRlmt = SK_RLMT_RX_PROTOCOL; - IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC; - SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength, - IsBc, &Offset, &NumBytes); - if (NumBytes != 0) { - IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC; - SK_RLMT_LOOKAHEAD(pAC, PortIndex, - &pMsg->data[Offset], - IsBc, IsMc, &ForRlmt); + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V")); + ForRlmt = SK_RLMT_RX_PROTOCOL; + IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC; + SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength, + IsBc, &Offset, &NumBytes); + if (NumBytes != 0) { + IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC; + SK_RLMT_LOOKAHEAD(pAC, PortIndex, + &pMsg->data[Offset], + IsBc, IsMc, &ForRlmt); + } + if (ForRlmt == SK_RLMT_RX_PROTOCOL) { + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("W")); +/* send up only frames from active port */ + if ((PortIndex == pAC->ActivePort) || + (pAC->RlmtNets == 2)) { + /* frame for upper layer */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("U")); +#ifdef xDEBUG + DumpMsg(pMsg, "Rx"); +#endif + SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC, + FrameLength, pRxPort->PortIndex); + + pMsg->dev = pAC->dev[pRxPort->PortIndex]; + pMsg->protocol = eth_type_trans(pMsg, + pAC->dev[pRxPort->PortIndex]); + netif_rx(pMsg); + pAC->dev[pRxPort->PortIndex]->last_rx = jiffies; } - if (ForRlmt == SK_RLMT_RX_PROTOCOL) { - /* send up only frames from active port */ - if (PortIndex == pAC->ActivePort) { - /* frame for upper layer */ - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS, - ("U")); -#ifdef DUMP_RX - DumpMsg(pMsg, "Rx"); -#endif - pMsg->dev = pAC->dev; - pMsg->protocol = eth_type_trans(pMsg, - pAC->dev); - SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC, - FrameLength); - netif_rx(pMsg); - pAC->dev->last_rx = jiffies; - } - else { - /* drop frame */ - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS, - ("D")); - DEV_KFREE_SKB(pMsg); - } - } /* if not for rlmt */ else { - /* packet for rlmt */ + /* drop frame */ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS, ("R")); - pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC, - pAC->IoBase, FrameLength); - if (pRlmtMbuf != NULL) { - pRlmtMbuf->pNext = NULL; - pRlmtMbuf->Length = FrameLength; - pRlmtMbuf->PortIdx = PortIndex; - EvPara.pParaPtr = pRlmtMbuf; - memcpy((char*)(pRlmtMbuf->pData), - (char*)(pMsg->data), - FrameLength); - SkEventQueue(pAC, SKGE_RLMT, - SK_RLMT_PACKET_RECEIVED, - EvPara); - pAC->CheckQueue = SK_TRUE; - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS, - ("Q")); - } - if ((pAC->dev->flags & - (IFF_PROMISC | IFF_ALLMULTI)) != 0 || - (ForRlmt & SK_RLMT_RX_PROTOCOL) == - SK_RLMT_RX_PROTOCOL) { - pMsg->dev = pAC->dev; - pMsg->protocol = eth_type_trans(pMsg, - pAC->dev); - netif_rx(pMsg); - pAC->dev->last_rx = jiffies; - } - else { - DEV_KFREE_SKB(pMsg); - } - - } /* if packet for rlmt */ - } /* if valid frame */ + SK_DBGCAT_DRV_RX_PROGRESS, + ("D")); + DEV_KFREE_SKB(pMsg); + } + + } /* if not for rlmt */ else { - /* there is a receive error in this frame */ - if ((FrameStat & XMR_FS_1L_VLAN) != 0) { - printk("%s: Received frame" - " with VLAN Level 1 header, check" - " switch configuration\n", - pAC->dev->name); + /* packet for rlmt */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, + SK_DBGCAT_DRV_RX_PROGRESS, ("R")); + pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC, + pAC->IoBase, FrameLength); + if (pRlmtMbuf != NULL) { + pRlmtMbuf->pNext = NULL; + pRlmtMbuf->Length = FrameLength; + pRlmtMbuf->PortIdx = PortIndex; + EvPara.pParaPtr = pRlmtMbuf; + memcpy((char*)(pRlmtMbuf->pData), + (char*)(pMsg->data), + FrameLength); + SkEventQueue(pAC, SKGE_RLMT, + SK_RLMT_PACKET_RECEIVED, + EvPara); + pAC->CheckQueue = SK_TRUE; + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, + SK_DBGCAT_DRV_RX_PROGRESS, + ("Q")); } - if ((FrameStat & XMR_FS_2L_VLAN) != 0) { - printk("%s: Received frame" - " with VLAN Level 2 header, check" - " switch configuration\n", - pAC->dev->name); + if ((pAC->dev[pRxPort->PortIndex]->flags & + (IFF_PROMISC | IFF_ALLMULTI)) != 0 || + (ForRlmt & SK_RLMT_RX_PROTOCOL) == + SK_RLMT_RX_PROTOCOL) { + pMsg->dev = pAC->dev[pRxPort->PortIndex]; + pMsg->protocol = eth_type_trans(pMsg, + pAC->dev[pRxPort->PortIndex]); + netif_rx(pMsg); + pAC->dev[pRxPort->PortIndex]->last_rx = jiffies; } - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, - SK_DBGCAT_DRV_RX_PROGRESS, - ("skge: Error in received frame, dropped!\n" - "Control: %x\nRxStat: %x\n", - Control, FrameStat)); - DEV_KFREE_SKB(pMsg); - } - } /* while */ + else { + DEV_KFREE_SKB(pMsg); + } + + } /* if packet for rlmt */ + } /* for ... scanning the RXD ring */ + + /* RXD ring is empty -> fill and restart */ FillRxRing(pAC, pRxPort); /* do not start if called from Close */ if (pAC->BoardLevel > 0) { @@ -2106,7 +2338,7 @@ * Returns: N/A * none */ -static void ClearAndStartRx( +void ClearAndStartRx( SK_AC *pAC, /* pointer to the adapter context */ int PortIndex) /* index of the receive port (XMAC) */ { @@ -2227,6 +2459,7 @@ int RxRam; /* RAM used for the active port receive queue */ int i; /* loop counter */ +if (pAC->RlmtNets == 1) { StandbyRam = SK_RLMT_STANDBY_QRXSIZE + SK_RLMT_STANDBY_QXASIZE + SK_RLMT_STANDBY_QXSSIZE; RemainingRam = pAC->GIni.GIRamSize - @@ -2247,21 +2480,40 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("queue sizes settings - rx:%d txA:%d txS:%d\n", pAC->RxQueueSize,pAC->TxAQueueSize, pAC->TxSQueueSize)); +} else { + RemainingRam = pAC->GIni.GIRamSize/pAC->GIni.GIMacsFound; + RxRam = (RemainingRam * 8 / 10) & ~7; + for (i=0; iGIni.GIMacsFound; i++) { + pAC->GIni.GP[i].PRxQSize = RxRam; + pAC->GIni.GP[i].PXSQSize = 0; + pAC->GIni.GP[i].PXAQSize = (RemainingRam - RxRam) & ~7; + } + pAC->RxQueueSize = RxRam; + pAC->TxSQueueSize = 0; + pAC->TxAQueueSize = (RemainingRam - RxRam) & ~7; +} for (i=0; iRxPort[i].RxFillLimit = pAC->RxDescrPerRing; } - for (i=0; iGIni.GIMacsFound; i++) { - pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing - 100; + if (pAC->RlmtNets == 2) { + for (i=0; iGIni.GIMacsFound; i++) { + pAC->RxPort[i].RxFillLimit = 1; + } + } else { + for (i=0; iGIni.GIMacsFound; i++) { + pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing - 100; + } + /* + * Do not set the Limit to 0, because this could cause + * wrap around with ReQueue'ed buffers (a buffer could + * be requeued in the same position, made accessable to + * the hardware, and the hardware could change its + * contents! + */ + pAC->RxPort[pAC->ActivePort].RxFillLimit = 1; } - /* - * Do not set the Limit to 0, because this could cause - * wrap around with ReQueue'ed buffers (a buffer could - * be requeued in the same position, made accessable to - * the hardware, and the hardware could change its - * contents! - */ - pAC->RxPort[pAC->ActivePort].RxFillLimit = 1; + #ifdef DEBUG for (i=0; iGIni.GIMacsFound; i++) { @@ -2289,19 +2541,31 @@ */ static int SkGeSetMacAddr(struct device *dev, void *p) { -SK_AC *pAC = (SK_AC*) dev->priv; + +DEV_NET *pNet = (DEV_NET*) dev->priv; +SK_AC *pAC = pNet->pAC; + struct sockaddr *addr = p; unsigned int Flags; +int PortIdx; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeSetMacAddr starts now...\n")); if(dev->start) { return -EBUSY; } + + if (pAC->RlmtNets == 1) { + PortIdx = pAC->ActivePort; + } + else { + PortIdx = pNet->NetNr; + } + memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); spin_lock_irqsave(&pAC->SlowPathLock, Flags); - SkAddrOverride(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrOverride(pAC, pAC->IoBase, PortIdx, (SK_MAC_ADDR*)dev->dev_addr, SK_ADDR_VIRTUAL_ADDRESS); spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); @@ -2325,37 +2589,49 @@ */ static void SkGeSetRxMode(struct device *dev) { -SK_AC *pAC; + +DEV_NET *pNet; +SK_AC *pAC; + struct dev_mc_list *pMcList; int i; unsigned int Flags; +int PortIdx; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeSetRxMode starts now... ")); - pAC = (SK_AC*) dev->priv; + + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; + if (pAC->RlmtNets == 1) { + PortIdx = pAC->ActivePort; + } + else { + PortIdx = pNet->NetNr; + } spin_lock_irqsave(&pAC->SlowPathLock, Flags); if (dev->flags & IFF_PROMISC) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("PROMISCUOUS mode\n")); - SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx, SK_PROM_MODE_LLC); } else if (dev->flags & IFF_ALLMULTI) { SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("ALLMULTI mode\n")); - SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx, SK_PROM_MODE_ALL_MC); } else { - SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx, SK_PROM_MODE_NONE); - SkAddrMcClear(pAC, pAC->IoBase, pAC->ActivePort, 0); + SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0); SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("Number of MC entries: %d ", dev->mc_count)); pMcList = dev->mc_list; for (i=0; imc_count; i++, pMcList = pMcList->next) { - SkAddrMcAdd(pAC, pAC->IoBase, pAC->ActivePort, + SkAddrMcAdd(pAC, pAC->IoBase, PortIdx, (SK_MAC_ADDR*)pMcList->dmi_addr, 0); SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_MCA, ("%02x:%02x:%02x:%02x:%02x:%02x\n", @@ -2366,8 +2642,7 @@ pMcList->dmi_addr[4], pMcList->dmi_addr[5])); } - SkAddrMcUpdate(pAC, pAC->IoBase, pAC->ActivePort); - + SkAddrMcUpdate(pAC, pAC->IoBase, PortIdx); } spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); @@ -2390,6 +2665,8 @@ */ static int SkGeChangeMtu(struct device *dev, int NewMtu) { +DEV_NET *pNet; +DEV_NET *pOtherNet; SK_AC *pAC; unsigned int Flags; int i; @@ -2398,11 +2675,22 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeChangeMtu starts now...\n")); - pAC = (SK_AC*) dev->priv; + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; + if ((NewMtu < 68) || (NewMtu > SK_JUMBO_MTU)) { return -EINVAL; } + pNet->Mtu = NewMtu; + pOtherNet = (DEV_NET*)pAC->dev[1 - pNet->NetNr]->priv; + if ((pOtherNet->Mtu > 1500) && (NewMtu <= 1500) && (pOtherNet->Up==1)) { + return(0); + } + + EvPara.Para32[0] = pNet->NetNr; + EvPara.Para32[1] = -1; + pAC->RxBufSize = NewMtu + 32; dev->mtu = NewMtu; @@ -2414,14 +2702,27 @@ /* disable interrupts */ SK_OUT32(pAC->IoBase, B0_IMSK, 0); spin_lock_irqsave(&pAC->SlowPathLock, Flags); - SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + + /* Found more than one port */ + if ((pAC->GIni.GIMacsFound == 2 ) && + (pAC->RlmtNets == 2)) { + /* Stop both ports */ + EvPara.Para32[0] = 0; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + EvPara.Para32[0] = 1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + } else { + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); + } + SkEventDispatcher(pAC, pAC->IoBase); for (i=0; iGIni.GIMacsFound; i++) { spin_lock_irqsave( &pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags); + pAC->dev[i]->tbusy = 1; } - pAC->dev->tbusy = 1; + /* * adjust number of rx buffers allocated @@ -2429,23 +2730,35 @@ if (NewMtu > 1500) { /* use less rx buffers */ for (i=0; iGIni.GIMacsFound; i++) { - if (i == pAC->ActivePort) - pAC->RxPort[i].RxFillLimit = - pAC->RxDescrPerRing - 100; - else - pAC->RxPort[i].RxFillLimit = - pAC->RxDescrPerRing - 10; - + /* Found more than one port */ + if ((pAC->GIni.GIMacsFound == 2 ) && + (pAC->RlmtNets == 2)) { + pAC->RxPort[i].RxFillLimit = + pAC->RxDescrPerRing - 100; + } else { + if (i == pAC->ActivePort) + pAC->RxPort[i].RxFillLimit = + pAC->RxDescrPerRing - 100; + else + pAC->RxPort[i].RxFillLimit = + pAC->RxDescrPerRing - 10; + } } } else { /* use normal anoumt of rx buffers */ for (i=0; iGIni.GIMacsFound; i++) { - if (i == pAC->ActivePort) - pAC->RxPort[i].RxFillLimit = 1; - else - pAC->RxPort[i].RxFillLimit = - pAC->RxDescrPerRing - 100; + /* Found more than one port */ + if ((pAC->GIni.GIMacsFound == 2 ) && + (pAC->RlmtNets == 2)) { + pAC->RxPort[i].RxFillLimit = 1; + } else { + if (i == pAC->ActivePort) + pAC->RxPort[i].RxFillLimit = 1; + else + pAC->RxPort[i].RxFillLimit = + pAC->RxDescrPerRing - 100; + } } } @@ -2455,7 +2768,7 @@ * enable/disable hardware support for long frames */ if (NewMtu > 1500) { - pAC->JumboActivated = SK_TRUE; // is never set back !!! + pAC->JumboActivated = SK_TRUE; /* is never set back !!! */ pAC->GIni.GIPortUsage = SK_JUMBO_LINK; for (i=0; iGIni.GIMacsFound; i++) { pAC->GIni.GP[i].PRxCmd = @@ -2463,10 +2776,14 @@ } } else { - pAC->GIni.GIPortUsage = SK_RED_LINK; + if ((pAC->GIni.GIMacsFound == 2 ) && + (pAC->RlmtNets == 2)) { + pAC->GIni.GIPortUsage = SK_MUL_LINK; + } else { + pAC->GIni.GIPortUsage = SK_RED_LINK; + } for (i=0; iGIni.GIMacsFound; i++) { - pAC->GIni.GP[i].PRxCmd = - XM_RX_STRIP_FCS | XM_RX_LENERR_OK; + pAC->GIni.GP[i].PRxCmd = XM_RX_STRIP_FCS; } } @@ -2494,9 +2811,8 @@ ClearRxRing(pAC, &pAC->RxPort[i]); FillRxRing(pAC, &pAC->RxPort[i]); - // Enable transmit descriptor polling. + /* Enable transmit descriptor polling. */ SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE); - FillRxRing(pAC, &pAC->RxPort[i]); }; SkGeYellowLED(pAC, pAC->IoBase, 1); @@ -2511,7 +2827,7 @@ } #endif - pAC->dev->tbusy = 0; + pAC->dev[pNet->PortNr]->tbusy = 0; for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) { spin_unlock_irqrestore( &pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags); @@ -2521,7 +2837,31 @@ SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK); SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK); - SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); +/*++++++++++++++++++++++++++++++++++++*/ + + /* Found more than one port */ + if ((pAC->GIni.GIMacsFound == 2 ) && + (pAC->RlmtNets == 2)) { + /* Start both ports */ + EvPara.Para32[0] = pAC->RlmtNets; + EvPara.Para32[1] = -1; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS, + EvPara); + + + EvPara.Para32[1] = -1; + EvPara.Para32[0] = pNet->PortNr; + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); + + if (pOtherNet->Up) { + EvPara.Para32[0] = pOtherNet->PortNr; + SkEventQueue(pAC, SKGE_RLMT, + SK_RLMT_START, EvPara); + } + } else { + SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); + } + SkEventDispatcher(pAC, pAC->IoBase); @@ -2544,9 +2884,11 @@ */ static struct net_device_stats *SkGeStats(struct device *dev) { -SK_AC *pAC = (SK_AC*) dev->priv; +DEV_NET *pNet = (DEV_NET*) dev->priv; +SK_AC *pAC = pNet->pAC; SK_PNMI_STRUCT_DATA *pPnmiStruct; /* structure for all Pnmi-Data */ -SK_PNMI_STAT *pPnmiStat; /* pointer to virtual XMAC stat. data */SK_PNMI_CONF *pPnmiConf; /* pointer to virtual link config. */ +SK_PNMI_STAT *pPnmiStat; /* pointer to virtual XMAC stat. data */ +SK_PNMI_CONF *pPnmiConf; /* pointer to virtual link config. */ unsigned int Size; /* size of pnmi struct */ unsigned int Flags; /* for spin lock */ @@ -2556,14 +2898,14 @@ memset(pPnmiStruct, 0, sizeof(SK_PNMI_STRUCT_DATA)); spin_lock_irqsave(&pAC->SlowPathLock, Flags); Size = SK_PNMI_STRUCT_SIZE; - SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size); + SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, pNet->NetNr); spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); pPnmiStat = &pPnmiStruct->Stat[0]; pPnmiConf = &pPnmiStruct->Conf[0]; - pAC->stats.rx_packets = (SK_U32) pPnmiStruct->RxDeliveredCts & 0xFFFFFFFF; + pAC->stats.rx_packets = (SK_U32) pPnmiStat->StatRxOkCts & 0xFFFFFFFF; pAC->stats.tx_packets = (SK_U32) pPnmiStat->StatTxOkCts & 0xFFFFFFFF; - pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts; + pAC->stats.rx_bytes = (SK_U32) pPnmiStat->StatRxOctetsOkCts; pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts; if (!pAC->JumboActivated) { pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF; @@ -2612,14 +2954,18 @@ */ static int SkGeIoctl(struct device *dev, struct ifreq *rq, int cmd) { +DEV_NET *pNet; SK_AC *pAC; + SK_GE_IOCTL Ioctl; unsigned int Err = 0; int Size; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeIoctl starts now...\n")); - pAC = (SK_AC*) dev->priv; + + pNet = (DEV_NET*) dev->priv; + pAC = pNet->pAC; if(copy_from_user(&Ioctl, rq->ifr_data, sizeof(SK_GE_IOCTL))) { return -EFAULT; @@ -2635,7 +2981,7 @@ Ioctl.Len : sizeof(pAC->PnmiStruct))) { return -EFAULT; } - Size = SkGeIocMib(pAC, Ioctl.Len, cmd); + Size = SkGeIocMib(pNet, Ioctl.Len, cmd); if(copy_to_user(Ioctl.pData, &pAC->PnmiStruct, Ioctl.LenpAC; /* access MIB */ spin_lock_irqsave(&pAC->SlowPathLock, Flags); switch(mode) { case SK_IOCTL_GETMIB: - SkPnmiGetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size); + SkPnmiGetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr); break; case SK_IOCTL_PRESETMIB: - SkPnmiPreSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size); + SkPnmiPreSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr); break; case SK_IOCTL_SETMIB: - SkPnmiSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size); + SkPnmiSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr); break; default: break; @@ -2762,7 +3110,7 @@ AutoNeg = AN_SENS; } else printk("%s: Illegal value for AutoNeg_A\n", - pAC->dev->name); + pAC->dev[0]->name); } DuplexCap = DC_BOTH; @@ -2783,18 +3131,18 @@ DuplexCap = DC_HALF; } else printk("%s: Illegal value for DupCap_A\n", - pAC->dev->name); + pAC->dev[0]->name); } /* check for illegal combinations */ if (AutoSet && AutoNeg==AN_SENS && DupSet) { printk("%s, Port A: DuplexCapabilities" - " ignored using Sense mode\n", pAC->dev->name); + " ignored using Sense mode\n", pAC->dev[0]->name); } if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){ printk("%s, Port A: Illegal combination" " of values AutoNeg. and DuplexCap.\n Using " - "Full Duplex\n", pAC->dev->name); + "Full Duplex\n", pAC->dev[0]->name); DuplexCap = DC_FULL; } @@ -2806,7 +3154,7 @@ printk("%s, Port A: Duplex setting not" " possible in\n default AutoNegotiation mode" " (Sense).\n Using AutoNegotiation On\n", - pAC->dev->name); + pAC->dev[0]->name); AutoNeg = AN_ON; } @@ -2841,7 +3189,7 @@ SK_FLOW_MODE_NONE) { printk("%s, Port A: FlowControl" " impossible without AutoNegotiation," - " disabled\n", pAC->dev->name); + " disabled\n", pAC->dev[0]->name); pAC->GIni.GP[0].PFlowCtrlMode = SK_FLOW_MODE_NONE; } @@ -2860,7 +3208,7 @@ MSMode = SK_MS_MODE_SLAVE; } else printk("%s: Illegal value for Role_A\n", - pAC->dev->name); + pAC->dev[0]->name); } pAC->GIni.GP[0].PMSMode = MSMode; @@ -2909,12 +3257,12 @@ /* check for illegal combinations */ if (AutoSet && AutoNeg==AN_SENS && DupSet) { printk("%s, Port B: DuplexCapabilities" - " ignored using Sense mode\n", pAC->dev->name); + " ignored using Sense mode\n", pAC->dev[1]->name); } if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){ printk("%s, Port B: Illegal combination" " of values AutoNeg. and DuplexCap.\n Using " - "Full Duplex\n", pAC->dev->name); + "Full Duplex\n", pAC->dev[1]->name); DuplexCap = DC_FULL; } @@ -2926,14 +3274,14 @@ printk("%s, Port B: Duplex setting not" " possible in\n default AutoNegotiation mode" " (Sense).\n Using AutoNegotiation On\n", - pAC->dev->name); + pAC->dev[1]->name); AutoNeg = AN_ON; } - + /* set the desired mode */ pAC->GIni.GP[1].PLinkModeConf = Capabilities[AutoNeg][DuplexCap]; - + pAC->GIni.GP[1].PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM; if (FlowCtrl_B != NULL && pAC->IndexIndex] != NULL) { @@ -2961,7 +3309,7 @@ SK_FLOW_MODE_NONE) { printk("%s, Port B: FlowControl" " impossible without AutoNegotiation," - " disabled\n", pAC->dev->name); + " disabled\n", pAC->dev[1]->name); pAC->GIni.GP[1].PFlowCtrlMode = SK_FLOW_MODE_NONE; } @@ -2980,7 +3328,7 @@ MSMode = SK_MS_MODE_SLAVE; } else printk("%s: Illegal value for Role_B\n", - pAC->dev->name); + pAC->dev[1]->name); } pAC->GIni.GP[1].PMSMode = MSMode; @@ -2991,8 +3339,8 @@ PrefPort[pAC->Index] != NULL) { if (strcmp(PrefPort[pAC->Index],"") == 0) { /* Auto */ pAC->ActivePort = 0; - pAC->Rlmt.MacPreferred = -1; /* auto */ - pAC->Rlmt.PrefPort = 0; + pAC->Rlmt.Net[0].Preference = -1; /* auto */ + pAC->Rlmt.Net[0].PrefPort = 0; } else if (strcmp(PrefPort[pAC->Index],"A") == 0) { /* @@ -3000,8 +3348,8 @@ * switch is issued after net up. */ Port = 0; - pAC->Rlmt.MacPreferred = Port; - pAC->Rlmt.PrefPort = Port; + pAC->Rlmt.Net[0].Preference = Port; + pAC->Rlmt.Net[0].PrefPort = Port; } else if (strcmp(PrefPort[pAC->Index],"B") == 0) { /* @@ -3009,13 +3357,16 @@ * switch is issued after net up. */ Port = 1; - pAC->Rlmt.MacPreferred = Port; - pAC->Rlmt.PrefPort = Port; + pAC->Rlmt.Net[0].Preference = Port; + pAC->Rlmt.Net[0].PrefPort = Port; } else printk("%s: Illegal value for PrefPort\n", - pAC->dev->name); + pAC->dev[0]->name); } - + + + pAC->RlmtNets = 1; + if (RlmtMode != NULL && pAC->IndexIndex] != NULL) { if (strcmp(RlmtMode[pAC->Index], "") == 0) { @@ -3033,9 +3384,14 @@ SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_SEG; } + else if ((strcmp(RlmtMode[pAC->Index], "DualNet") == 0) && + (pAC->GIni.GIMacsFound == 2)) { + pAC->RlmtMode = SK_RLMT_CHECK_LINK; + pAC->RlmtNets = 2; + } else { printk("%s: Illegal value for" - " RlmtMode, using default\n", pAC->dev->name); + " RlmtMode, using default\n", pAC->dev[0]->name); pAC->RlmtMode = 0; } } @@ -3337,7 +3693,7 @@ case SK_DRV_ADAP_FAIL: SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("ADAPTER FAIL EVENT\n")); - printk("%s: Adapter failed.\n", pAC->dev->name); + printk("%s: Adapter failed.\n", pAC->dev[0]->name); /* disable interrupts */ SK_OUT32(pAC->IoBase, B0_IMSK, 0); /* cgoos */ @@ -3347,9 +3703,9 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("PORT FAIL EVENT, Port: %d\n", FromPort)); if (FromPort == 0) { - printk("%s: Port A failed.\n", pAC->dev->name); + printk("%s: Port A failed.\n", pAC->dev[0]->name); } else { - printk("%s: Port B failed.\n", pAC->dev->name); + printk("%s: Port B failed.\n", pAC->dev[1]->name); } /* cgoos */ break; @@ -3390,7 +3746,7 @@ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("NET UP EVENT, Port: %d ", Param.Para32[0])); printk("%s: network connection up using" - " port %c\n", pAC->dev->name, 'A'+Param.Para32[0]); + " port %c\n", pAC->dev[Param.Para32[0]]->name, 'A'+Param.Para32[0]); printk(" speed: 1000\n"); Stat = pAC->GIni.GP[FromPort].PLinkModeStatus; if (Stat == SK_LMODE_STAT_AUTOHALF || @@ -3433,7 +3789,8 @@ } } - if (Param.Para32[0] != pAC->ActivePort) { + if ((Param.Para32[0] != pAC->ActivePort) && + (pAC->RlmtNets == 1)) { NewPara.Para32[0] = pAC->ActivePort; NewPara.Para32[1] = Param.Para32[0]; SkEventQueue(pAC, SKGE_DRV, SK_DRV_SWITCH_INTERN, @@ -3444,21 +3801,21 @@ /* action list 7 */ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("NET DOWN EVENT ")); - printk("%s: network connection down\n", pAC->dev->name); + printk("%s: network connection down\n", pAC->dev[Param.Para32[1]]->name); break; case SK_DRV_SWITCH_HARD: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("PORT SWITCH HARD ")); case SK_DRV_SWITCH_SOFT: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */ /* action list 6 */ - printk("%s: switching to port %c\n", pAC->dev->name, + printk("%s: switching to port %c\n", pAC->dev[0]->name, 'A'+Param.Para32[1]); case SK_DRV_SWITCH_INTERN: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */ FromPort = Param.Para32[0]; ToPort = Param.Para32[1]; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("PORT SWITCH EVENT, From: %d To: %d (Pref %d) ", - FromPort, ToPort, pAC->Rlmt.PrefPort)); + FromPort, ToPort, pAC->Rlmt.Net[0].PrefPort)); NewPara.Para64 = FromPort; SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_XMAC_RESET, NewPara); NewPara.Para64 = ToPort; @@ -3510,6 +3867,7 @@ Flags); break; case SK_DRV_RLMT_SEND: /* SK_MBUF *pMb */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, ("RLS ")); pRlmtMbuf = (SK_MBUF*) Param.pParaPtr; @@ -3574,7 +3932,7 @@ break; } printk(KERN_INFO "%s: -- ERROR --\n Class: %s\n" - " Nr: 0x%x\n Msg: %s\n", pAC->dev->name, + " Nr: 0x%x\n Msg: %s\n", pAC->dev[0]->name, ClassStr, ErrNum, pErrorMsg); } /* SkErrorLog */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skgeinit.c linux.20p9/drivers/net/sk98lin/skgeinit.c --- linux.vanilla/drivers/net/sk98lin/skgeinit.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skgeinit.c Wed Jul 4 16:03:55 2001 @@ -2,16 +2,15 @@ * * Name: skgeinit.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.55 $ - * Date: $Date: 1999/11/22 13:32:26 $ + * Version: $Revision: 1.63 $ + * Date: $Date: 2001/04/05 11:02:09 $ * Purpose: Contains functions to initialize the GE HW * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,31 @@ * History: * * $Log: skgeinit.c,v $ + * Revision 1.63 2001/04/05 11:02:09 rassmann + * Stop Port check of the STOP bit did not take 2/18 sec as wanted. + * + * Revision 1.62 2001/02/07 07:54:21 rassmann + * Corrected copyright. + * + * Revision 1.61 2001/01/31 15:31:40 gklug + * fix: problem with autosensing an SR8800 switch + * + * Revision 1.60 2000/10/18 12:22:21 cgoos + * Added workaround for half duplex hangup. + * + * Revision 1.59 2000/10/10 11:22:06 gklug + * add: in manual half duplex mode ignore carrier extension errors + * + * Revision 1.58 2000/10/02 14:10:27 rassmann + * Reading BCOM PHY after releasing reset until it returns a valid value. + * + * Revision 1.57 2000/08/03 14:55:28 rassmann + * Waiting for I2C to be ready before de-initializing adapter + * (prevents sensors from hanging up). + * + * Revision 1.56 2000/07/27 12:16:48 gklug + * fix: Stop Port check of the STOP bit does now take 2/18 sec as wanted + * * Revision 1.55 1999/11/22 13:32:26 cgoos * Changed license header to GPL. * @@ -200,7 +224,7 @@ * DoInitRamQueue(), and SkGeCfgSync(). * Add coding for SkGeInitMacArb(), SkGeInitPktArb(), * SkGeInitMacFifo(), SkGeInitRamBufs(), - * SkGeInitRamIface(), and SkGeInitBmu(). + * SkGeInitRamIface(), and SkGeInitBmu(). * * Revision 1.11 1998/09/29 08:26:29 malthoff * bug fix: SkGeInit0() 'i' should be increment. @@ -276,7 +300,7 @@ /* local variables ************************************************************/ static const char SysKonnectFileId[] = - "@(#)$Id: skgeinit.c,v 1.55 1999/11/22 13:32:26 cgoos Exp $ (C) SK "; + "@(#)$Id: skgeinit.c,v 1.63 2001/04/05 11:02:09 rassmann Exp $ (C) SK "; struct s_QOffTab { int RxQOff; /* Receive Queue Address Offset */ @@ -284,7 +308,7 @@ int XaQOff; /* Async Tx Queue Address Offset */ }; static struct s_QOffTab QOffTab[] = { - { Q_R1, Q_XS1, Q_XA1 }, { Q_R2, Q_XS2, Q_XA2 } + {Q_R1, Q_XS1, Q_XA1}, {Q_R2, Q_XS2, Q_XA2} }; @@ -304,7 +328,7 @@ void SkGePollRxD( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL PollRxD) /* SK_TRUE (enable pol.), SK_FALSE (disable pol.) */ { SK_GEPORT *pPrt; @@ -312,12 +336,13 @@ pPrt = &pAC->GIni.GP[Port]; if (PollRxD) { - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_CSR), CSR_ENA_POL); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_CSR), CSR_ENA_POL); } else { - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_CSR), CSR_DIS_POL); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_CSR), CSR_DIS_POL); } -} +} /* SkGePollRxD */ + /****************************************************************************** * @@ -335,7 +360,7 @@ void SkGePollTxD( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL PollTxD) /* SK_TRUE (enable pol.), SK_FALSE (disable pol.) */ { SK_GEPORT *pPrt; @@ -351,12 +376,12 @@ } if (pPrt->PXSQSize != 0) { - SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff,Q_CSR), DWord); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_CSR), DWord); } if (pPrt->PXAQSize != 0) { - SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff,Q_CSR), DWord); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_CSR), DWord); } -} +} /* SkGePollTxD */ /****************************************************************************** @@ -375,17 +400,18 @@ void SkGeYellowLED( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int State) /* yellow LED state, 0 = OFF, 0 != ON */ +int State) /* yellow LED state, 0 = OFF, 0 != ON */ { if (State == 0) { /* Switch yellow LED OFF */ - SK_OUT8(IoC, B0_LED, LED_STAT_OFF) ; + SK_OUT8(IoC, B0_LED, LED_STAT_OFF); } else { /* Switch yellow LED ON */ - SK_OUT8(IoC, B0_LED, LED_STAT_ON) ; + SK_OUT8(IoC, B0_LED, LED_STAT_ON); } -} +} /* SkGeYellowLED */ + /****************************************************************************** * @@ -399,7 +425,7 @@ * 'Led' must contain the address offset of the LEDs INI register. * * Usage: - * SkGeXmitLED(pAC, IoC, MR_ADDR(Port,TX_LED_INI), SK_LED_ENA); + * SkGeXmitLED(pAC, IoC, MR_ADDR(Port, TX_LED_INI), SK_LED_ENA); * * Returns: * nothing @@ -407,31 +433,31 @@ void SkGeXmitLED( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Led, /* offset to the LED Init Value register */ -int Mode) /* Mode may be SK_LED_DIS, SK_LED_ENA, SK_LED_TST */ +int Led, /* offset to the LED Init Value register */ +int Mode) /* Mode may be SK_LED_DIS, SK_LED_ENA, SK_LED_TST */ { SK_U32 LedIni; switch (Mode) { case SK_LED_ENA: LedIni = SK_XMIT_DUR * (SK_U32)pAC->GIni.GIHstClkFact / 100; - SK_OUT32(IoC, Led+XMIT_LED_INI, LedIni); - SK_OUT8(IoC, Led+XMIT_LED_CTRL, LED_START); - break ; + SK_OUT32(IoC, Led + XMIT_LED_INI, LedIni); + SK_OUT8(IoC, Led + XMIT_LED_CTRL, LED_START); + break; case SK_LED_TST: - SK_OUT8(IoC, Led+XMIT_LED_TST, LED_T_ON); - SK_OUT32(IoC, Led+XMIT_LED_CNT, 100); - SK_OUT8(IoC, Led+XMIT_LED_CTRL, LED_START); - break ; + SK_OUT8(IoC, Led + XMIT_LED_TST, LED_T_ON); + SK_OUT32(IoC, Led + XMIT_LED_CNT, 100); + SK_OUT8(IoC, Led + XMIT_LED_CTRL, LED_START); + break; case SK_LED_DIS: default: /* * Do NOT stop the LED Timer here. The LED might be * in on state. But it needs to go off. */ - SK_OUT32(IoC, Led+XMIT_LED_CNT, 0); - SK_OUT8(IoC, Led+XMIT_LED_TST, LED_T_OFF); - break ; + SK_OUT32(IoC, Led + XMIT_LED_CNT, 0); + SK_OUT8(IoC, Led + XMIT_LED_TST, LED_T_OFF); + break; } /* @@ -441,7 +467,8 @@ * (Broadcom: It may be that PHY_B_PEC_EN_LTR has to be set.) * (In this case it has to be added here. But we will see. XXX) */ -} +} /* SkGeXmitLED */ + /****************************************************************************** * @@ -462,12 +489,12 @@ * 1: configuration error */ static int DoCalcAddr( -SK_AC *pAC, /* adapter context */ -SK_GEPORT *pPrt, /* port index */ -int QuSize, /* size of the queue to configure in kB */ -SK_U32 *StartVal, /* start value for address calculation */ -SK_U32 *QuStartAddr, /* start addr to calculate */ -SK_U32 *QuEndAddr) /* end address to calculate */ +SK_AC *pAC, /* adapter context */ +SK_GEPORT *pPrt, /* port index */ +int QuSize, /* size of the queue to configure in kB */ +SK_U32 *StartVal, /* start value for address calculation */ +SK_U32 *QuStartAddr, /* start addr to calculate */ +SK_U32 *QuEndAddr) /* end address to calculate */ { SK_U32 EndVal; SK_U32 NextStart; @@ -495,7 +522,7 @@ *StartVal = NextStart; return (Rtv); -} +} /* DoCalcAddr */ /****************************************************************************** @@ -522,8 +549,8 @@ * 1: Queue Size Configuration invalid */ static int SkGeCheckQSize( -SK_AC *pAC, /* adapter context */ -int Port) /* port index */ +SK_AC *pAC, /* adapter context */ +int Port) /* port index */ { SK_GEPORT *pPrt; int UsedMem; @@ -541,9 +568,7 @@ (pPrt->PXSQSize & QZ_UNITS) || (pPrt->PXAQSize & QZ_UNITS)) { - SK_ERR_LOG(pAC, SK_ERRCL_SW, - SKERR_HWI_E012, - SKERR_HWI_E012MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E012, SKERR_HWI_E012MSG); Rtv = 1; goto CheckQSizeEnd; } @@ -551,9 +576,7 @@ UsedMem += pPrt->PRxQSize + pPrt->PXSQSize + pPrt->PXAQSize; if (i == Port && pPrt->PRxQSize < SK_MIN_RXQ_SIZE) { - SK_ERR_LOG(pAC, SK_ERRCL_SW, - SKERR_HWI_E011, - SKERR_HWI_E011MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E011, SKERR_HWI_E011MSG); Rtv = 1; goto CheckQSizeEnd; } @@ -585,17 +608,15 @@ Rtv |= Rtv2; if (Rtv) { - SK_ERR_LOG(pAC, SK_ERRCL_SW, - SKERR_HWI_E013, - SKERR_HWI_E013MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E013, SKERR_HWI_E013MSG); break; } } - CheckQSizeEnd: return (Rtv); -} +} /* SkGeCheckQSize */ + /****************************************************************************** * @@ -634,7 +655,8 @@ * There is not start or enable buttom to push, therefore * the MAC arbiter is configured and enabled now. */ -} +} /* SkGeInitMacArb */ + /****************************************************************************** * @@ -661,16 +683,21 @@ SK_OUT16(IoC, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); SK_OUT16(IoC, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); - /* enable timeout timers if jumbo frames not used */ + /* + * enable timeout timers if jumbo frames not used + * NOTE: the packet arbiter timeout interrupt is needed for + * half duplex hangup workaround + */ if (pAC->GIni.GIPortUsage != SK_JUMBO_LINK) { if (pAC->GIni.GIMacsFound == 1) { SK_OUT16(IoC, B3_PA_CTRL, PA_ENA_TO_TX1); } else { - SK_OUT16(IoC, B3_PA_CTRL,(PA_ENA_TO_TX1|PA_ENA_TO_TX2)); + SK_OUT16(IoC, B3_PA_CTRL,(PA_ENA_TO_TX1 | PA_ENA_TO_TX2)); } } -} +} /* SkGeInitPktArb */ + /****************************************************************************** * @@ -685,7 +712,7 @@ static void SkGeInitMacFifo( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { /* * For each FIFO: @@ -708,7 +735,8 @@ if (pAC->GIni.GIPortUsage == SK_JUMBO_LINK) { SK_OUT16(IoC, MR_ADDR(Port, RX_MFF_CTRL1), MFF_ENA_FLUSH); } -} +} /* SkGeInitMacFifo */ + /****************************************************************************** * @@ -732,7 +760,7 @@ void SkGeLoadLnkSyncCnt( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U32 CntVal) /* Counter value */ { SK_U32 OrgIMsk; @@ -741,7 +769,7 @@ SK_BOOL IrqPend; /* stop counter */ - SK_OUT8(IoC, MR_ADDR(Port,LNK_SYNC_CTRL), LED_STOP); + SK_OUT8(IoC, MR_ADDR(Port, LNK_SYNC_CTRL), LED_STOP); /* * ASIC problem: @@ -771,17 +799,18 @@ } /* load counter */ - SK_OUT32(IoC, MR_ADDR(Port,LNK_SYNC_INI), CntVal); + SK_OUT32(IoC, MR_ADDR(Port, LNK_SYNC_INI), CntVal); /* start counter */ - SK_OUT8(IoC, MR_ADDR(Port,LNK_SYNC_CTRL), LED_START); + SK_OUT8(IoC, MR_ADDR(Port, LNK_SYNC_CTRL), LED_START); if (!IrqPend) { /* clear the unexpected IRQ, and restore the interrupt mask */ - SK_OUT8(IoC, MR_ADDR(Port,LNK_SYNC_CTRL), LED_CLR_IRQ); + SK_OUT8(IoC, MR_ADDR(Port, LNK_SYNC_CTRL), LED_CLR_IRQ); SK_OUT32(IoC, B0_IMSK, OrgIMsk); } -} +} /* SkGeLoadLnkSyncCnt*/ + /****************************************************************************** * @@ -814,10 +843,10 @@ int SkGeCfgSync( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U32 IntTime, /* Interval Timer Value in units of 8ns */ SK_U32 LimCount, /* Number of bytes to transfer during IntTime */ -int SyncMode) /* Sync Mode: TXA_ENA_ALLOC | TXA_DIS_ALLOC | 0 */ +int SyncMode) /* Sync Mode: TXA_ENA_ALLOC | TXA_DIS_ALLOC | 0 */ { int Rtv; @@ -837,8 +866,7 @@ IntTime = (IntTime / 2) * pAC->GIni.GIHstClkFact / 100; LimCount = LimCount / 8; if (IntTime > TXA_MAX_VAL || LimCount > TXA_MAX_VAL) { - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E010, - SKERR_HWI_E010MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E010, SKERR_HWI_E010MSG); Rtv = 1; goto CfgSyncEnd; } @@ -853,14 +881,14 @@ * - start 'Rate Control' and disable 'Force Sync' * if Interval Timer or Limit Counter not zero. */ - SK_OUT8(IoC, MR_ADDR(Port,TXA_CTRL), + SK_OUT8(IoC, MR_ADDR(Port, TXA_CTRL), TXA_ENA_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); - SK_OUT32(IoC, MR_ADDR(Port,TXA_ITI_INI), IntTime); - SK_OUT32(IoC, MR_ADDR(Port,TXA_LIM_INI), LimCount); - SK_OUT8(IoC, MR_ADDR(Port,TXA_CTRL), + SK_OUT32(IoC, MR_ADDR(Port, TXA_ITI_INI), IntTime); + SK_OUT32(IoC, MR_ADDR(Port, TXA_LIM_INI), LimCount); + SK_OUT8(IoC, MR_ADDR(Port, TXA_CTRL), (SyncMode & (TXA_ENA_ALLOC|TXA_DIS_ALLOC))); if (IntTime != 0 || LimCount != 0) { - SK_OUT8(IoC, MR_ADDR(Port,TXA_CTRL), + SK_OUT8(IoC, MR_ADDR(Port, TXA_CTRL), TXA_DIS_FSYNC|TXA_START_RC); } } @@ -871,7 +899,8 @@ CfgSyncEnd: return (Rtv); -} +} /* SkGeCfgSync */ + /****************************************************************************** * @@ -885,12 +914,12 @@ * nothing */ static void DoInitRamQueue( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ -int QuIoOffs, /* Queue IO Address Offset */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* IO context */ +int QuIoOffs, /* Queue IO Address Offset */ SK_U32 QuStartAddr, /* Queue Start Address */ -SK_U32 QuEndAddr, /* Queue End Address */ -int QuType) /* Queue Type (SK_RX_SRAM_Q|SK_RX_BRAM_Q|SK_TX_RAM_Q) */ +SK_U32 QuEndAddr, /* Queue End Address */ +int QuType) /* Queue Type (SK_RX_SRAM_Q|SK_RX_BRAM_Q|SK_TX_RAM_Q) */ { SK_U32 RxUpThresVal; SK_U32 RxLoThresVal; @@ -905,13 +934,13 @@ QuEndAddr = QuEndAddr / 8; /* release local reset */ - SK_OUT8(IoC, RB_ADDR(QuIoOffs,RB_CTRL), RB_RST_CLR); + SK_OUT8(IoC, RB_ADDR(QuIoOffs, RB_CTRL), RB_RST_CLR); /* configure addresses */ - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_START), QuStartAddr); - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_END), QuEndAddr); - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_WP), QuStartAddr); - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_RP), QuStartAddr); + SK_OUT32(IoC, RB_ADDR(QuIoOffs, RB_START), QuStartAddr); + SK_OUT32(IoC, RB_ADDR(QuIoOffs, RB_END), QuEndAddr); + SK_OUT32(IoC, RB_ADDR(QuIoOffs, RB_WP), QuStartAddr); + SK_OUT32(IoC, RB_ADDR(QuIoOffs, RB_RP), QuStartAddr); switch (QuType) { case SK_RX_SRAM_Q: @@ -922,10 +951,9 @@ case SK_RX_BRAM_Q: /* write threshold for Rx Queue */ - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_RX_UTPP), - RxUpThresVal); - SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_RX_LTPP), - RxLoThresVal); + SK_OUT32(IoC, RB_ADDR(QuIoOffs, RB_RX_UTPP), RxUpThresVal); + SK_OUT32(IoC, RB_ADDR(QuIoOffs,RB_RX_LTPP), RxLoThresVal); + /* the high priority threshold not used */ break; case SK_TX_RAM_Q: @@ -940,20 +968,20 @@ * enable Store & Forward Mode for the * Tx Side */ - SK_OUT8(IoC, RB_ADDR(QuIoOffs,RB_CTRL), - RB_ENA_STFWD); + SK_OUT8(IoC, RB_ADDR(QuIoOffs, RB_CTRL), RB_ENA_STFWD); } break; } /* set queue operational */ - SK_OUT8(IoC, RB_ADDR(QuIoOffs,RB_CTRL), RB_ENA_OP_MD); + SK_OUT8(IoC, RB_ADDR(QuIoOffs, RB_CTRL), RB_ENA_OP_MD); } else { /* ensure the queue is still disabled */ - SK_OUT8(IoC, RB_ADDR(QuIoOffs,RB_CTRL), RB_RST_SET); + SK_OUT8(IoC, RB_ADDR(QuIoOffs, RB_CTRL), RB_RST_SET); } -} +} /* DoInitRamQueue*/ + /****************************************************************************** * @@ -968,7 +996,7 @@ static void SkGeInitRamBufs( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; int RxQType; @@ -988,7 +1016,8 @@ pPrt->PXsQRamEnd, SK_TX_RAM_Q); DoInitRamQueue(pAC, IoC, pPrt->PXaQOff, pPrt->PXaQRamStart, pPrt->PXaQRamEnd, SK_TX_RAM_Q); -} +} /* SkGeInitRamBufs */ + /****************************************************************************** * @@ -1023,7 +1052,8 @@ SK_OUT8(IoC, B3_RI_RTO_R2, SK_RI_TO_53); SK_OUT8(IoC, B3_RI_RTO_XA2, SK_RI_TO_53); SK_OUT8(IoC, B3_RI_RTO_XS2, SK_RI_TO_53); -} +} /* SkGeInitRamIface */ + /****************************************************************************** * @@ -1038,33 +1068,34 @@ static void SkGeInitBmu( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; pPrt = &pAC->GIni.GP[Port]; /* Rx Queue: Release all local resets and set the watermark */ - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_CSR), CSR_CLR_RESET); - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_F), SK_BMU_RX_WM); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_CSR), CSR_CLR_RESET); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_F), SK_BMU_RX_WM); /* * Tx Queue: Release all local resets if the queue is used! * set watermark */ if (pPrt->PXSQSize != 0) { - SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff,Q_CSR), CSR_CLR_RESET); - SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff,Q_F), SK_BMU_TX_WM); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_CSR), CSR_CLR_RESET); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_F), SK_BMU_TX_WM); } if (pPrt->PXAQSize != 0) { - SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff,Q_CSR), CSR_CLR_RESET); - SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff,Q_F), SK_BMU_TX_WM); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_CSR), CSR_CLR_RESET); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_F), SK_BMU_TX_WM); } /* * Do NOT enable the descriptor poll timers here, because * the descriptor addresses are not specified yet. */ -} +} /* SkGeInitBmu */ + /****************************************************************************** * @@ -1082,17 +1113,18 @@ static SK_U32 TestStopBit( SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int QuIoOffs) /* Queue IO Address Offset */ +int QuIoOffs) /* Queue IO Address Offset */ { SK_U32 QuCsr; /* CSR contents */ - SK_IN32(IoC, Q_ADDR(QuIoOffs,Q_CSR), &QuCsr); + SK_IN32(IoC, Q_ADDR(QuIoOffs, Q_CSR), &QuCsr); if ((QuCsr & (CSR_STOP|CSR_SV_IDLE)) == 0) { - SK_OUT32(IoC, Q_ADDR(QuIoOffs,Q_CSR), CSR_STOP); - SK_IN32(IoC, Q_ADDR(QuIoOffs,Q_CSR), &QuCsr); + SK_OUT32(IoC, Q_ADDR(QuIoOffs, Q_CSR), CSR_STOP); + SK_IN32(IoC, Q_ADDR(QuIoOffs, Q_CSR), &QuCsr); } return (QuCsr); -} +} /* TestStopBit*/ + /****************************************************************************** * @@ -1174,10 +1206,10 @@ */ void SkGeStopPort( SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ -int Port, /* port to stop (MAC_1 + n) */ -int Dir, /* Direction to Stop (SK_STOP_RX, SK_STOP_TX, SK_STOP_ALL) */ -int RstMode)/* Reset Mode (SK_SOFT_RST, SK_HARD_RST) */ +SK_IOC IoC, /* I/O context */ +int Port, /* port to stop (MAC_1 + n) */ +int Dir, /* Direction to Stop (SK_STOP_RX, SK_STOP_TX, SK_STOP_ALL) */ +int RstMode)/* Reset Mode (SK_SOFT_RST, SK_HARD_RST) */ { #ifndef SK_DIAG SK_EVPARA Para; @@ -1187,18 +1219,17 @@ SK_U16 Word; SK_U32 XsCsr; SK_U32 XaCsr; - int i; + int i; SK_BOOL AllPortsDis; SK_U64 ToutStart; - int ToutCnt; + int ToutCnt; pPrt = &pAC->GIni.GP[Port]; if (Dir & SK_STOP_TX) { /* disable the XMACs receiver and transmitter */ XM_IN16(IoC, Port, XM_MMU_CMD, &Word); - XM_OUT16(IoC, Port, XM_MMU_CMD, - Word & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + XM_OUT16(IoC, Port, XM_MMU_CMD, Word & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); /* dummy read to ensure writing */ XM_IN16(IoC, Port, XM_MMU_CMD, &Word); @@ -1208,15 +1239,15 @@ * If the BMU is in the reset state CSR_STOP will terminate * immediately. */ - SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff,Q_CSR), CSR_STOP); - SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff,Q_CSR), CSR_STOP); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_CSR), CSR_STOP); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_CSR), CSR_STOP); ToutStart = SkOsGetTime(pAC); ToutCnt = 0; do { /* * Clear packet arbiter timeout to make sure - * this loop will terminate + * this loop will terminate. */ if (Port == MAC_1) { Word = PA_CLR_TO_TX1; @@ -1227,65 +1258,64 @@ SK_OUT16(IoC, B3_PA_CTRL, Word); /* - * If the transfer stucks at the XMAC the STOP command - * will not terminate if we don't flush the XMACs - * transmit FIFO ! + * If the transfer stucks at the XMAC the STOP command will not + * terminate if we don't flush the XMAC's transmit FIFO! */ XM_IN32(IoC, Port, XM_MODE, &DWord); - DWord |= XM_MD_FTF ; + DWord |= XM_MD_FTF; XM_OUT32(IoC, Port, XM_MODE, DWord); XsCsr = TestStopBit(pAC, IoC, pPrt->PXsQOff); XaCsr = TestStopBit(pAC, IoC, pPrt->PXaQOff); - if (ToutStart + (SK_TICKS_PER_SEC / 18) < - SkOsGetTime(pAC)) { - + if (SkOsGetTime(pAC) - ToutStart > (SK_TICKS_PER_SEC / 18)) { /* * Timeout of 1/18 second reached. + * This needs to be checked at 1/18 sec only. */ ToutCnt++; switch (ToutCnt) { case 1: /* - * Cache Incoherency workaround: - * Assume a start command has been - * lost while sending the frame. + * Cache Incoherency workaround: Assume a start command + * has been lost while sending the frame. */ ToutStart = SkOsGetTime(pAC); if (XsCsr & CSR_STOP) { - SK_OUT32(IoC, - Q_ADDR(pPrt->PXsQOff, - Q_CSR), CSR_START); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_CSR), CSR_START); } if (XaCsr & CSR_STOP) { - SK_OUT32(IoC, - Q_ADDR(pPrt->PXaQOff, - Q_CSR), CSR_START); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_CSR), CSR_START); } break; case 2: - default: /* Fatal Error, Loop aborted */ + default: + /* Might be a problem when the driver event handler + * calls StopPort again. + * XXX. + */ + + /* Fatal Error, Loop aborted */ /* Create an Error Log Entry */ - SK_ERR_LOG(pAC, SK_ERRCL_HW, + SK_ERR_LOG( + pAC, + SK_ERRCL_HW, SKERR_HWI_E018, SKERR_HWI_E018MSG); #ifndef SK_DIAG Para.Para64 = Port; - SkEventQueue(pAC, SKGE_DRV, - SK_DRV_PORT_FAIL, Para); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); #endif /* !SK_DIAG */ return; } } - /* - * because of the ASIC problem report entry from 21.08.98 - * it is required to wait until CSR_STOP is reset and - * CSR_SV_IDLE is set. - */ - } while ((XsCsr & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE || - (XaCsr & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE); + /* + * Because of the ASIC problem report entry from 21.08.1998 it is + * required to wait until CSR_STOP is reset and CSR_SV_IDLE is set. + */ + } while ((XsCsr & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE || + (XaCsr & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE); /* reset the XMAC depending on the RstMode */ if (RstMode == SK_SOFT_RST) { @@ -1299,10 +1329,10 @@ * Stop Interval Timer and Limit Counter of Tx Arbiter, * also disable Force Sync bit and Enable Alloc bit. */ - SK_OUT8(IoC, MR_ADDR(Port,TXA_CTRL), + SK_OUT8(IoC, MR_ADDR(Port, TXA_CTRL), TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); - SK_OUT32(IoC, MR_ADDR(Port,TXA_ITI_INI), 0x00000000L); - SK_OUT32(IoC, MR_ADDR(Port,TXA_LIM_INI), 0x00000000L); + SK_OUT32(IoC, MR_ADDR(Port, TXA_ITI_INI), 0x00000000L); + SK_OUT32(IoC, MR_ADDR(Port, TXA_LIM_INI), 0x00000000L); /* * perform a local reset of the port's tx path @@ -1312,16 +1342,16 @@ * - reset the RAM Butter sync tx queue * - reset the MAC Tx FIFO */ - SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff,Q_CSR), CSR_SET_RESET); - SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff,Q_CSR), CSR_SET_RESET); - SK_OUT8(IoC, RB_ADDR(pPrt->PXaQOff,RB_CTRL), RB_RST_SET); - SK_OUT8(IoC, RB_ADDR(pPrt->PXsQOff,RB_CTRL), RB_RST_SET); + SK_OUT32(IoC, Q_ADDR(pPrt->PXaQOff, Q_CSR), CSR_SET_RESET); + SK_OUT32(IoC, Q_ADDR(pPrt->PXsQOff, Q_CSR), CSR_SET_RESET); + SK_OUT8(IoC, RB_ADDR(pPrt->PXaQOff, RB_CTRL), RB_RST_SET); + SK_OUT8(IoC, RB_ADDR(pPrt->PXsQOff, RB_CTRL), RB_RST_SET); /* Note: MFF_RST_SET does NOT reset the XMAC! */ SK_OUT8(IoC, MR_ADDR(Port, TX_MFF_CTRL2), MFF_RST_SET); /* switch Link and Tx LED off, stop the LED counters */ /* Link LED is switched off by the RLMT and the Diag itself */ - SkGeXmitLED(pAC, IoC, MR_ADDR(Port,TX_LED_INI), SK_LED_DIS); + SkGeXmitLED(pAC, IoC, MR_ADDR(Port, TX_LED_INI), SK_LED_DIS); } if (Dir & SK_STOP_RX) { @@ -1332,7 +1362,7 @@ * stop the transfer of received packets. */ /* stop the port's receive queue */ - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_CSR), CSR_STOP); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_CSR), CSR_STOP); i = 100; do { /* @@ -1352,13 +1382,13 @@ i--; } - /* finish if CSR_STOP is done or CSR_SV_IDLE is true and i==0 */ - /* - * because of the ASIC problem report entry from 21.08.98 - * it is required to wait until CSR_STOP is reset and - * CSR_SV_IDLE is set. - */ - } while ((DWord & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE && + /* finish if CSR_STOP is done or CSR_SV_IDLE is true and i==0 */ + /* + * because of the ASIC problem report entry from 21.08.98 + * it is required to wait until CSR_STOP is reset and + * CSR_SV_IDLE is set. + */ + } while ((DWord & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE && ((DWord & CSR_SV_IDLE) == 0 || i != 0)); /* The path data transfer activity is fully stopped now. */ @@ -1369,12 +1399,12 @@ * - reset the RAM Buffer receive queue * - reset the MAC Rx FIFO */ - SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff,Q_CSR), CSR_SET_RESET); - SK_OUT8(IoC, RB_ADDR(pPrt->PRxQOff,RB_CTRL), RB_RST_SET); + SK_OUT32(IoC, Q_ADDR(pPrt->PRxQOff, Q_CSR), CSR_SET_RESET); + SK_OUT8(IoC, RB_ADDR(pPrt->PRxQOff, RB_CTRL), RB_RST_SET); SK_OUT8(IoC, MR_ADDR(Port, RX_MFF_CTRL2), MFF_RST_SET); /* switch Rx LED off, stop the LED counter */ - SkGeXmitLED(pAC, IoC, MR_ADDR(Port,RX_LED_INI), SK_LED_DIS); + SkGeXmitLED(pAC, IoC, MR_ADDR(Port, RX_LED_INI), SK_LED_DIS); } @@ -1392,7 +1422,8 @@ if (AllPortsDis) { pAC->GIni.GIAnyPortAct = SK_FALSE; } -} +} /* SkGeStopPort */ + /****************************************************************************** * @@ -1422,6 +1453,7 @@ pPrt->PIsave = 0; pPrt->PPrevShorts = 0; pPrt->PLinkResCt = 0; + pPrt->PAutoNegTOCt = 0; pPrt->PPrevRx = 0; pPrt->PPrevFcs = 0; pPrt->PRxLim = SK_DEF_RX_WA_LIM; @@ -1445,7 +1477,88 @@ pAC->GIni.GIPortUsage = SK_RED_LINK; pAC->GIni.GIAnyPortAct = SK_FALSE; -} +} /* SkGeInit0*/ + +#ifdef SK_PCI_RESET + +/****************************************************************************** + * + * SkGePciReset() - Reset PCI interface + * + * Description: + * o Read PCI configuration. + * o Change power state to 3. + * o Change power state to 0. + * o Restore PCI configuration. + * + * Returns: + * 0: Success. + * 1: Power state could not be changed to 3. + */ +static int SkGePciReset( +SK_AC *pAC, /* adapter context */ +SK_IOC IoC) /* IO context */ +{ + int i; + SK_U16 PmCtlSts; + SK_U32 Bp1; + SK_U32 Bp2; + SK_U16 PciCmd; + SK_U8 Cls; + SK_U8 Lat; + SK_U8 ConfigSpace[PCI_CFG_SIZE]; + + /* + * Note: Switching to D3 state is like a software reset. + * Switching from D3 to D0 is a hardware reset. + * We have to save and restore the configuration space. + */ + for (i = 0; i < PCI_CFG_SIZE; i++) { + SkPciReadCfgDWord(pAC, i*4, &ConfigSpace[i]); + } + + /* We know the RAM Interface Arbiter is enabled. */ + SkPciWriteCfgWord(pAC, PCI_PM_CTL_STS, PCI_PM_STATE_D3); + SkPciReadCfgWord(pAC, PCI_PM_CTL_STS, &PmCtlSts); + if ((PmCtlSts & PCI_PM_STATE) != PCI_PM_STATE_D3) { + return (1); + } + + /* + * Return to D0 state. + */ + SkPciWriteCfgWord(pAC, PCI_PM_CTL_STS, PCI_PM_STATE_D0); + + /* Check for D0 state. */ + SkPciReadCfgWord(pAC, PCI_PM_CTL_STS, &PmCtlSts); + if ((PmCtlSts & PCI_PM_STATE) != PCI_PM_STATE_D0) { + return (1); + } + + /* + * Check PCI Config Registers. + */ + SkPciReadCfgWord(pAC, PCI_COMMAND, &PciCmd); + SkPciReadCfgByte(pAC, PCI_CACHE_LSZ, &Cls); + SkPciReadCfgDWord(pAC, PCI_BASE_1ST, &Bp1); + SkPciReadCfgDWord(pAC, PCI_BASE_2ND, &Bp2); + SkPciReadCfgByte(pAC, PCI_LAT_TIM, &lat); + if (PciCmd != 0 || Cls != 0 || (Bp1 & 0xfffffff0L) != 0 || Bp2 != 1 || + Lat != 0 ) { + return (0); + } + + /* + * Restore Config Space. + */ + for (i = 0; i < PCI_CFG_SIZE; i++) { + SkPciWriteCfgDWord(pAC, i*4, ConfigSpace[i]); + } + + return (0); +} /* SkGePciReset */ + +#endif /* SK_PCI_RESET */ /****************************************************************************** * @@ -1478,6 +1591,10 @@ RetVal = 0; +#ifdef SK_PCI_RESET + (void)SkGePciReset(pAC, IoC); +#endif /* SK_PCI_RESET */ + /* Do the reset */ SK_OUT8(IoC, B0_CTST, CS_RST_SET); @@ -1487,7 +1604,7 @@ /* Reset all error bits in the PCI STATUS register */ /* * Note: Cfg cycles cannot be used, because they are not - * available on some platforms after 'boot time'. + * available on some platforms after 'boot time'. */ SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_ON); SK_IN16(IoC, PCI_C(PCI_STATUS), &Word); @@ -1548,12 +1665,13 @@ break; } } - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_INIT, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_INIT, ("PHY type: %d PHY addr: %x\n", pAC->GIni.GP[i].PhyType, - pAC->GIni.GP[i].PhyAddr)) ; + pAC->GIni.GP[i].PhyAddr)); return (RetVal); -} +} /* SkGeInit1*/ + /****************************************************************************** * @@ -1589,8 +1707,7 @@ pAC->GIni.GIPollTimerVal = SK_DPOLL_MAX; /* Create an Error Log Entry */ - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E017, - SKERR_HWI_E017MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E017, SKERR_HWI_E017MSG); } SK_OUT32(IoC, B28_DPT_INI, pAC->GIni.GIPollTimerVal); SK_OUT8(IoC, B28_DPT_CTRL, DPT_START); @@ -1608,9 +1725,9 @@ SkGeInitPktArb(pAC, IoC); /* enable the Tx Arbiters */ - SK_OUT8(IoC, MR_ADDR(MAC_1,TXA_CTRL), TXA_ENA_ARB); + SK_OUT8(IoC, MR_ADDR(MAC_1, TXA_CTRL), TXA_ENA_ARB); if (pAC->GIni.GIMacsFound > 1) { - SK_OUT8(IoC, MR_ADDR(MAC_2,TXA_CTRL), TXA_ENA_ARB); + SK_OUT8(IoC, MR_ADDR(MAC_2, TXA_CTRL), TXA_ENA_ARB); } /* enable the RAM Interface Arbiter */ @@ -1621,8 +1738,19 @@ if (pAC->GIni.GIPortUsage == SK_JUMBO_LINK) { pPrt->PRxCmd |= XM_RX_BIG_PK_OK; } + + if (pPrt->PLinkModeConf == SK_LMODE_HALF) { + /* + * If in manual half duplex mode + * the other side might be in full duplex mode + * so ignore if a carrier extension is not seen on + * frames received + */ + pPrt->PRxCmd |= XM_RX_DIS_CEXT; + } + } -} +} /* SkGeInit2 */ /****************************************************************************** * @@ -1661,24 +1789,24 @@ int SkGeInit( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Level) /* initialization level */ +int Level) /* initialization level */ { int RetVal; /* return value */ SK_U32 DWord; RetVal = 0; - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_INIT, - ("SkGeInit(Level %d)\n",Level)) ; + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_INIT, + ("SkGeInit(Level %d)\n", Level)); switch (Level) { case SK_INIT_DATA: /* Initialization Level 0 */ - SkGeInit0(pAC,IoC) ; + SkGeInit0(pAC, IoC); pAC->GIni.GILevel = SK_INIT_DATA; break; case SK_INIT_IO: /* Initialization Level 1 */ - RetVal = SkGeInit1(pAC,IoC) ; + RetVal = SkGeInit1(pAC, IoC); /* Check if the adapter seems to be accessable */ SK_OUT32(IoC, B2_IRQM_INI, 0x11335577L); @@ -1702,13 +1830,12 @@ /* Initialization Level 2 */ if (pAC->GIni.GILevel != SK_INIT_IO) { #ifndef SK_DIAG - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E002, - SKERR_HWI_E002MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E002, SKERR_HWI_E002MSG); #endif RetVal = 4; break; } - SkGeInit2(pAC,IoC) ; + SkGeInit2(pAC, IoC); /* Level 2 successfully passed */ pAC->GIni.GILevel = SK_INIT_RUN; @@ -1716,12 +1843,13 @@ default: /* Create an Error Log Entry */ SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E003, SKERR_HWI_E003MSG); - RetVal = 3 ; + RetVal = 3; break; } return (RetVal); -} +} /* SkGeInit*/ + /****************************************************************************** * @@ -1741,6 +1869,9 @@ int i; SK_U16 Word; + /* Ensure I2C is ready. */ + SkI2cWaitIrq(pAC, IoC); + /* Stop all current transfer activity */ for (i = 0; i < pAC->GIni.GIMacsFound; i++) { if (pAC->GIni.GP[i].PState != SK_PRT_STOP && @@ -1762,7 +1893,8 @@ /* Do the reset, all LEDs are switched off now */ SK_OUT8(IoC, B0_CTST, CS_RST_SET); -} +} /* SkGeDeInit*/ + /****************************************************************************** * @@ -1791,18 +1923,18 @@ * for PRxQSize, PXSQSize, or PXAQSize are invalid for one * or more queues. The specified port was NOT initialized. * An error log entry was generated. - * 2: The port has to be stopped before it can be initilaized again. + * 2: The port has to be stopped before it can be initialized again. */ int SkGeInitPort( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port to configure */ +int Port) /* Port to configure */ { SK_GEPORT *pPrt; pPrt = &pAC->GIni.GP[Port]; - if (SkGeCheckQSize(pAC,Port) != 0) { + if (SkGeCheckQSize(pAC, Port) != 0) { SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E004, SKERR_HWI_E004MSG); return (1); } @@ -1818,8 +1950,8 @@ * If 1000BT Phy needs LED initialization than swap * LED and XMAC initialization order */ - SkGeXmitLED(pAC, IoC, MR_ADDR(Port,TX_LED_INI), SK_LED_ENA); - SkGeXmitLED(pAC, IoC, MR_ADDR(Port,RX_LED_INI), SK_LED_ENA); + SkGeXmitLED(pAC, IoC, MR_ADDR(Port, TX_LED_INI), SK_LED_ENA); + SkGeXmitLED(pAC, IoC, MR_ADDR(Port, RX_LED_INI), SK_LED_ENA); /* The Link LED is initialized by RLMT or Diagnostics itself */ /* Do NOT initialize the Link Sync Counter */ @@ -1845,4 +1977,4 @@ pAC->GIni.GIAnyPortAct = SK_TRUE; return (0); -} +} /* SkGeInitPort */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skgepnmi.c linux.20p9/drivers/net/sk98lin/skgepnmi.c --- linux.vanilla/drivers/net/sk98lin/skgepnmi.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skgepnmi.c Wed Jul 4 16:03:56 2001 @@ -2,16 +2,15 @@ * * Name: skgepnmi.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.72 $ - * Date: $Date: 1999/12/06 16:15:53 $ + * Version: $Revision: 1.87 $ + * Date: $Date: 2001/04/06 13:35:09 $ * Purpose: Private Network Management Interface * ****************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,6 +26,65 @@ * History: * * $Log: skgepnmi.c,v $ + * Revision 1.87 2001/04/06 13:35:09 mkunz + * -Bugs fixed in handling of OID_SKGE_MTU and the VPD OID's + * + * Revision 1.86 2001/03/09 09:18:03 mkunz + * Changes in SK_DBG_MSG + * + * Revision 1.85 2001/03/08 09:37:31 mkunz + * Bugfix in ResetCounter for Pnmi.Port structure + * + * Revision 1.84 2001/03/06 09:04:55 mkunz + * Made some changes in instance calculation + * C ^VS: + * + * Revision 1.83 2001/02/15 09:15:32 mkunz + * Necessary changes for dual net mode added + * + * Revision 1.82 2001/02/07 08:24:19 mkunz + * -Made changes in handling of OID_SKGE_MTU + * + * Revision 1.81 2001/02/06 09:58:00 mkunz + * -Vpd bug fixed + * -OID_SKGE_MTU added + * -pnmi support for dual net mode. Interface function and macros extended + * + * Revision 1.80 2001/01/22 13:41:35 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.79 2000/12/05 14:57:40 cgoos + * SetStruct failed before first Link Up (link mode of virtual + * port "INDETERMINATED"). + * + * Revision 1.78 2000/09/12 10:44:58 cgoos + * Fixed SK_PNMI_STORE_U32 calls with typecasted argument. + * + * Revision 1.77 2000/09/07 08:10:19 rwahl + * - Modified algorithm for 64bit NDIS statistic counters; + * returns 64bit or 32bit value depending on passed buffer + * size. Indicate capability for 64bit NDIS counter, if passed + * buffer size is zero. OID_GEN_XMIT_ERROR, OID_GEN_RCV_ERROR, + * and OID_GEN_RCV_NO_BUFFER handled as 64bit counter, too. + * - corrected OID_SKGE_RLMT_PORT_PREFERRED. + * + * Revision 1.76 2000/08/03 15:23:39 rwahl + * - Correction for FrameTooLong counter has to be moved to OID handling + * routines (instead of statistic counter routine). + * - Fix in XMAC Reset Event handling: Only offset counter for hardware + * statistic registers are updated. + * + * Revision 1.75 2000/08/01 16:46:05 rwahl + * - Added StatRxLongFrames counter and correction of FrameTooLong counter. + * - Added directive to control width (default = 32bit) of NDIS statistic + * counters (SK_NDIS_64BIT_CTR). + * + * Revision 1.74 2000/07/04 11:41:53 rwahl + * - Added volition connector type. + * + * Revision 1.73 2000/03/15 16:33:10 rwahl + * Fixed bug 10510; wrong reset of virtual port statistic counters. + * * Revision 1.72 1999/12/06 16:15:53 rwahl * Fixed problem of instance range for current and factory MAC address. * @@ -44,7 +102,7 @@ * * Revision 1.67 1999/09/22 09:53:20 rwahl * - Read Broadcom register for updating fcs error counter (1000Base-T). - * + * * Revision 1.66 1999/08/26 13:47:56 rwahl * Added SK_DRIVER_SENDEVENT when queueing RLMT_CHANGE_THRES trap. * @@ -53,7 +111,7 @@ * * Revision 1.64 1999/05/20 09:24:12 cgoos * Changes for 1000Base-T (sensors, Master/Slave). - * + * * Revision 1.63 1999/04/13 15:11:58 mhaveman * Moved include of rlmt.h to header skgepnmi.h because some macros * are needed there. @@ -157,7 +215,7 @@ * Revision 1.43 1998/12/03 14:18:10 mhaveman * -Fixed problem in PnmiSetStruct. It was impossible to set any value. * -Removed VPD key evaluation for VPD_FREE_BYTES and VPD_ACTION. - * + * * Revision 1.42 1998/12/03 11:31:47 mhaveman * Inserted cast to satisfy lint. * @@ -192,7 +250,7 @@ * * Revision 1.35 1998/11/16 07:45:34 mhaveman * SkAddrOverride now returns value and will be checked. - * + * * Revision 1.34 1998/11/10 13:40:37 mhaveman * Needed to change interface, because NT driver needs a return value * of needed buffer space on TOO_SHORT errors. Therefore all @@ -212,7 +270,7 @@ * Revision 1.30 1998/11/03 12:04:46 mhaveman * Fixed problem in SENSOR_VALUE, which wrote beyond the buffer end * Fixed alignment problem with CHIPSET. - * + * * Revision 1.29 1998/11/02 11:23:54 mhaveman * Corrected SK_ERROR_LOG to SK_ERR_LOG. Sorry. * @@ -242,14 +300,14 @@ * -Fixed sequence of error return code (INSTANCE -> ACCESS -> SHORT) * -Changed type of parameter Instance back to SK_U32 because of VPD * -Updated new VPD function calls - * + * * Revision 1.23 1998/10/23 10:16:37 mhaveman * Fixed bugs after buffer test simulation. * * Revision 1.22 1998/10/21 13:23:52 mhaveman * -Call syntax of SkOsGetTime() changed to SkOsGetTime(pAc). * -Changed calculation of hundrets of seconds. - * + * * Revision 1.20 1998/10/20 07:30:45 mhaveman * Made type changes to unsigned integer where possible. * @@ -263,12 +321,12 @@ * to HWACCESS. * -Provided all MEMCPY/MEMSET macros with (char *) pointers, because * Solaris throwed warnings when mapping to bcopy/bset. - * + * * Revision 1.17 1998/10/13 07:42:01 mhaveman * -Added OIDs OID_SKGE_TRAP_NUMBER and OID_SKGE_ALL_DATA * -Removed old cvs history entries * -Renamed MacNumber to PortNumber - * + * * Revision 1.16 1998/10/07 10:52:49 mhaveman * -Inserted handling of some OID_GEN_ Ids for windows * -Fixed problem with 803.2 statistic. @@ -304,7 +362,7 @@ static const char SysKonnectFileId[] = - "@(#) $Id: skgepnmi.c,v 1.72 1999/12/06 16:15:53 rwahl Exp $" + "@(#) $Id: skgepnmi.c,v 1.87 2001/04/06 13:35:09 mkunz Exp $" " (C) SysKonnect."; #include "h/skdrv1st.h" @@ -328,14 +386,17 @@ */ int SkPnmiInit(SK_AC *pAC, SK_IOC IoC, int level); int SkPnmiGetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf, - unsigned int *pLen, SK_U32 Instance); + unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); int SkPnmiPreSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf, - unsigned int *pLen, SK_U32 Instance); + unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); int SkPnmiSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf, - unsigned int *pLen, SK_U32 Instance); -int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen); -int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen); -int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen); + unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); +int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, + unsigned int *pLen, SK_U32 NetIndex); +int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, + unsigned int *pLen, SK_U32 NetIndex); +int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, + unsigned int *pLen, SK_U32 NetIndex); int SkPnmiEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Param); @@ -344,7 +405,7 @@ */ static int Addr(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static SK_U8 CalculateLinkModeStatus(SK_AC *pAC, SK_IOC IoC, unsigned int PhysPortIndex); static SK_U8 CalculateLinkStatus(SK_AC *pAC, SK_IOC IoC, unsigned int @@ -353,14 +414,14 @@ static void CopyTrapQueue(SK_AC *pAC, char *pDstBuf); static int CsumStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int General(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static SK_U64 GetPhysStatVal(SK_AC *pAC, SK_IOC IoC, unsigned int PhysPortIndex, unsigned int StatIndex); static SK_U64 GetStatVal(SK_AC *pAC, SK_IOC IoC, unsigned int LogPortIndex, - unsigned int StatIndex); + unsigned int StatIndex, SK_U32 NetIndex); static char* GetTrapEntry(SK_AC *pAC, SK_U32 TrapId, unsigned int Size); static void GetTrapQueueLen(SK_AC *pAC, unsigned int *pLen, unsigned int *pEntries); @@ -369,50 +430,50 @@ static int LookupId(SK_U32 Id); static int Mac8023Stat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int MacPrivateConf(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int MacPrivateStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int MacUpdate(SK_AC *pAC, SK_IOC IoC, unsigned int FirstMac, unsigned int LastMac); static int Monitor(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int OidStruct(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int Perform(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int* pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int PnmiStruct(SK_AC *pAC, SK_IOC IoC, int Action, char *pBuf, - unsigned int *pLen); + unsigned int *pLen, SK_U32 NetIndex); static int PnmiVar(SK_AC *pAC, SK_IOC IoC, int Action, SK_U32 Id, - char *pBuf, unsigned int *pLen, SK_U32 Instance); + char *pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex); static void QueueRlmtNewMacTrap(SK_AC *pAC, unsigned int ActiveMac); static void QueueRlmtPortTrap(SK_AC *pAC, SK_U32 TrapId, unsigned int PortIndex); static void QueueSensorTrap(SK_AC *pAC, SK_U32 TrapId, unsigned int SensorIndex); static void QueueSimpleTrap(SK_AC *pAC, SK_U32 TrapId); -static void ResetCounter(SK_AC *pAC, SK_IOC IoC); +static void ResetCounter(SK_AC *pAC, SK_IOC IoC, SK_U32 NetIndex); static int Rlmt(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int RlmtStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); -static int RlmtUpdate(SK_AC *pAC, SK_IOC IoC); + unsigned int TableIndex, SK_U32 NetIndex); +static int RlmtUpdate(SK_AC *pAC, SK_IOC IoC, SK_U32 NetIndex); static int SensorStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); static int SirqUpdate(SK_AC *pAC, SK_IOC IoC); static void VirtualConf(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, char *pBuf); static int Vpd(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance, - unsigned int TableIndex); + unsigned int TableIndex, SK_U32 NetIndex); /****************************************************************************** @@ -990,6 +1051,11 @@ sizeof(SK_PNMI_STAT), SK_PNMI_OFF(Stat) + SK_PNMI_STA_OFF(StatRxUnicastOkCts), SK_PNMI_RO, MacPrivateStat, SK_PNMI_HRX_UNICAST}, + {OID_SKGE_STAT_RX_LONGFRAMES, + SK_PNMI_MAC_ENTRIES, + sizeof(SK_PNMI_STAT), + SK_PNMI_OFF(Stat) + SK_PNMI_STA_OFF(StatRxLongFramesCts), + SK_PNMI_RO, MacPrivateStat, SK_PNMI_HRX_LONGFRAMES}, {OID_SKGE_STAT_RX_PFLOWC, SK_PNMI_MAC_ENTRIES, sizeof(SK_PNMI_STAT), @@ -1205,7 +1271,7 @@ 0, SK_PNMI_MAI_OFF(RlmtPortActive), SK_PNMI_RO, Rlmt, 0}, - {OID_SKGE_RLMT_PORT_PREFERED, + {OID_SKGE_RLMT_PORT_PREFERRED, 1, 0, SK_PNMI_MAI_OFF(RlmtPortPreferred), @@ -1290,11 +1356,16 @@ sizeof(SK_PNMI_RLMT_MONITOR), SK_PNMI_OFF(RlmtMonitor) + SK_PNMI_MON_OFF(RlmtMonitorAdmin), SK_PNMI_RW, Monitor, 0}, + {OID_SKGE_MTU, + 1, + 0, + SK_PNMI_MAI_OFF(MtuSize), + SK_PNMI_RW, MacPrivateConf, 0}, }; /* * Table for hardware register saving on resets and port switches -*/ + */ static const SK_PNMI_STATADDR StatAddress[SK_PNMI_MAX_IDX] = { /* 0 */ {TRUE, XM_TXF_OK}, /* 1 */ {TRUE, 0}, @@ -1361,7 +1432,8 @@ /* 62 */ {TRUE, XM_RXF_1023B}, /* 63 */ {TRUE, XM_RXF_MAX_SZ}, /* 64 */ {FALSE, 0}, - /* 65 */ {FALSE, 0} + /* 65 */ {FALSE, 0}, + /* 66 */ {TRUE, 0} }; @@ -1411,6 +1483,7 @@ for (PortIndex = 0; PortIndex < SK_MAX_MACS; PortIndex ++) { pAC->Pnmi.Port[PortIndex].ActiveFlag = SK_FALSE; + pAC->Pnmi.DualNetActiveFlag = SK_FALSE; } break; @@ -1528,6 +1601,10 @@ pAC->Pnmi.Connector = 5; break; + case 'V': + pAC->Pnmi.Connector = 6; + break; + default: pAC->Pnmi.Connector = 1; break; @@ -1562,7 +1639,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed - * SK_PNMI_ERR_GENERAL A general severe internal error occured + * SK_PNMI_ERR_GENERAL A general severe internal error occurred * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to take * the data. * SK_PNMI_ERR_UNKNOWN_OID The requested OID is unknown @@ -1577,14 +1654,15 @@ SK_U32 Id, /* Object ID that is to be processed */ void *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ -SK_U32 Instance) /* Instance (1..n) that is to be queried or -1 */ +SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiGetVar: Called, Id=0x%x, BufLen=%d\n", Id, - *pLen)); + ("PNMI: SkPnmiGetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n", + Id, *pLen, Instance, NetIndex)); return (PnmiVar(pAC, IoC, SK_PNMI_GET, Id, (char *)pBuf, pLen, - Instance)); + Instance, NetIndex)); } /***************************************************************************** @@ -1600,7 +1678,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1619,14 +1697,16 @@ SK_U32 Id, /* Object ID that is to be processed */ void *pBuf, /* Buffer which stores the mgmt data to be set */ unsigned int *pLen, /* Total length of mgmt data */ -SK_U32 Instance) /* Instance (1..n) that is to be set or -1 */ +SK_U32 Instance, /* Instance (1..n) that is to be set or -1 */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiPreSetVar: Called, Id=0x%x, BufLen=%d\n", - Id, *pLen)); + ("PNMI: SkPnmiPreSetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n", + Id, *pLen, Instance, NetIndex)); + return (PnmiVar(pAC, IoC, SK_PNMI_PRESET, Id, (char *)pBuf, pLen, - Instance)); + Instance, NetIndex)); } /***************************************************************************** @@ -1642,7 +1722,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1661,14 +1741,15 @@ SK_U32 Id, /* Object ID that is to be processed */ void *pBuf, /* Buffer which stores the mgmt data to be set */ unsigned int *pLen, /* Total length of mgmt data */ -SK_U32 Instance) /* Instance (1..n) that is to be set or -1 */ +SK_U32 Instance, /* Instance (1..n) that is to be set or -1 */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiSetVar: Called, Id=0x%x, BufLen=%d\n", Id, - *pLen)); + ("PNMI: SkPnmiSetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n", + Id, *pLen, Instance, NetIndex)); return (PnmiVar(pAC, IoC, SK_PNMI_SET, Id, (char *)pBuf, pLen, - Instance)); + Instance, NetIndex)); } /***************************************************************************** @@ -1685,16 +1766,18 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed - * SK_PNMI_ERR_GENERAL A general severe internal error occured + * SK_PNMI_ERR_GENERAL A general severe internal error occurred * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to take * the data. + * SK_PNMI_ERR_UNKNOWN_NET The requested NetIndex doesn't exist */ int SkPnmiGetStruct( SK_AC *pAC, /* Pointer to adapter context */ SK_IOC IoC, /* IO context handle */ void *pBuf, /* Buffer which will store the retrieved data */ -unsigned int *pLen) /* Length of buffer */ +unsigned int *pLen, /* Length of buffer */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; unsigned int TableIndex; @@ -1703,11 +1786,12 @@ unsigned int InstanceCnt; SK_U32 Instance; unsigned int TmpLen; - char KeyArr[SK_PNMI_VPD_ARR_SIZE][SK_PNMI_VPD_STR_SIZE]; + char KeyArr[SK_PNMI_VPD_ENTRIES][SK_PNMI_VPD_KEY_SIZE]; + - SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiGetStruct: Called, BufLen=%d\n", *pLen)); + ("PNMI: SkPnmiGetStruct: Called, BufLen=%d, NetIndex=%d\n", + *pLen, NetIndex)); if (*pLen < SK_PNMI_STRUCT_SIZE) { @@ -1721,6 +1805,13 @@ return (SK_PNMI_ERR_TOO_SHORT); } + /* + * Check NetIndex + */ + if (NetIndex >= pAC->Rlmt.NumNets) { + return (SK_PNMI_ERR_UNKNOWN_NET); + } + /* Update statistic */ SK_PNMI_CHECKFLAGS("SkPnmiGetStruct: On call"); @@ -1732,7 +1823,7 @@ return (Ret); } - if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) { + if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) { SK_PNMI_SET_STAT(pBuf, Ret, (SK_U32)(-1)); *pLen = SK_PNMI_MIN_STRUCT_SIZE; @@ -1774,7 +1865,6 @@ TableIndex ++) { InstanceNo = IdTable[TableIndex].InstanceNo; - for (InstanceCnt = 1; InstanceCnt <= InstanceNo; InstanceCnt ++) { @@ -1792,8 +1882,7 @@ IdTable[TableIndex].Id == OID_SKGE_VPD_ACCESS || IdTable[TableIndex].Id == OID_SKGE_VPD_ACTION) { - SK_PNMI_READ_U32(KeyArr[InstanceCnt - 1], - Instance); + SK_STRNCPY((char *)&Instance, KeyArr[InstanceCnt - 1], 4); } else { Instance = (SK_U32)InstanceCnt; @@ -1802,7 +1891,7 @@ TmpLen = *pLen - DstOffset; Ret = IdTable[TableIndex].Func(pAC, IoC, SK_PNMI_GET, IdTable[TableIndex].Id, (char *)pBuf + - DstOffset, &TmpLen, Instance, TableIndex); + DstOffset, &TmpLen, Instance, TableIndex, NetIndex); /* * An unknown instance error means that we reached @@ -1812,7 +1901,7 @@ */ if (Ret == SK_PNMI_ERR_UNKNOWN_INST) { - break; + break; } if (Ret != SK_PNMI_ERR_OK) { @@ -1855,7 +1944,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1867,12 +1956,15 @@ SK_AC *pAC, /* Pointer to adapter context */ SK_IOC IoC, /* IO context handle */ void *pBuf, /* Buffer which contains the data to be set */ -unsigned int *pLen) /* Length of buffer */ +unsigned int *pLen, /* Length of buffer */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiPreSetStruct: Called, BufLen=%d\n", *pLen)); + ("PNMI: SkPnmiPreSetStruct: Called, BufLen=%d, NetIndex=%d\n", + *pLen, NetIndex)); - return (PnmiStruct(pAC, IoC, SK_PNMI_PRESET, (char *)pBuf, pLen)); + return (PnmiStruct(pAC, IoC, SK_PNMI_PRESET, (char *)pBuf, + pLen, NetIndex)); } /***************************************************************************** @@ -1891,7 +1983,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1903,12 +1995,15 @@ SK_AC *pAC, /* Pointer to adapter context */ SK_IOC IoC, /* IO context handle */ void *pBuf, /* Buffer which contains the data to be set */ -unsigned int *pLen) /* Length of buffer */ +unsigned int *pLen, /* Length of buffer */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, - ("PNMI: SkPnmiSetStruct: Called, BufLen=%d\n", *pLen)); + ("PNMI: SkPnmiSetStruct: Called, BufLen=%d, NetIndex=%d\n", + *pLen, NetIndex)); - return (PnmiStruct(pAC, IoC, SK_PNMI_SET, (char *)pBuf, pLen)); + return (PnmiStruct(pAC, IoC, SK_PNMI_SET, (char *)pBuf, + pLen, NetIndex)); } /***************************************************************************** @@ -1943,11 +2038,6 @@ * SK_PNMI_EVT_RLMT_PORT_DOWN Generated by RLMT to notify that a port * went logically down. A trap message will * be stored to the trap buffer. - * SK_PNMI_EVT_RLMT_PORT_SWITCH Generated by RLMT to notify that the - * active port switched. PNMI will split - * this into two message ACTIVE_DOWN and - * ACTIVE_UP to be future compatible with - * load balancing and card fail over. * SK_PNMI_EVT_RLMT_SEGMENTATION Generated by RLMT to notify that two * spanning tree root bridges were * detected. A trap message will be stored @@ -1959,6 +2049,9 @@ * is now an active port. PNMI will now * add the statistic data of this port to * the virtual port. + * SK_PNMI_EVT_RLMT_SET_NETS Notifies PNMI about the net mode. The first Parameter + * contains the number of nets. 1 means single net, 2 means + * dual net. The second Parameter is -1 * * Returns: * Always 0 @@ -1971,6 +2064,7 @@ SK_EVPARA Param) /* Event dependent parameter */ { unsigned int PhysPortIndex; + unsigned int MaxNetNumber; int CounterIndex; int Ret; SK_U16 MacStatus; @@ -1984,6 +2078,7 @@ SK_U64 OldestValue; SK_U64 Delta; SK_PNMI_ESTIMATE *pEst; + SK_U32 NetIndex; #ifdef DEBUG @@ -2082,8 +2177,13 @@ case SK_PNMI_HRX_OCTETLOW: case SK_PNMI_HRX_IRLENGTH: case SK_PNMI_HRX_RESERVED22: + + /* + * the following counters aren't be handled (id > 63) + */ case SK_PNMI_HTX_SYNC: case SK_PNMI_HTX_SYNC_OCTET: + case SK_PNMI_HRX_LONGFRAMES: break; default: @@ -2241,9 +2341,27 @@ case SK_PNMI_EVT_CLEAR_COUNTER: /* + * Param.Para32[0] contains the NetIndex (0 ..1). + * Param.Para32[1] is reserved, contains -1. + */ + NetIndex = (SK_U32)Param.Para32[0]; + +#ifdef DEBUG + if (NetIndex >= pAC->Rlmt.NumNets) { + + SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, + ("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_CLEAR_COUNTER parameter wrong, NetIndex=%d\n", + NetIndex)); + + return (0); + } +#endif + + /* * Set all counters and timestamps to zero */ - ResetCounter(pAC, IoC); + ResetCounter(pAC, IoC, NetIndex); /* the according NetIndex is required + as a Parameter of the Event */ break; case SK_PNMI_EVT_XMAC_RESET: @@ -2278,7 +2396,7 @@ */ pAC->Pnmi.MacUpdatedFlag ++; - for (CounterIndex = 0; CounterIndex < SK_PNMI_MAX_IDX; + for (CounterIndex = 0; CounterIndex < SK_PNMI_SCNT_NOT; CounterIndex ++) { if (!StatAddress[CounterIndex].GetOffset) { @@ -2308,9 +2426,8 @@ } #endif /* - * Store a trap message in the trap buffer and generate - * an event for user space applications with the - * SK_DRIVER_SENDEVENT macro. + * Store a trap message in the trap buffer and generate an event for + * user space applications with the SK_DRIVER_SENDEVENT macro. */ QueueRlmtPortTrap(pAC, OID_SKGE_TRAP_RLMT_PORT_UP, (unsigned int)Param.Para32[0]); @@ -2329,9 +2446,8 @@ } #endif /* - * Store a trap message in the trap buffer and generate - * an event for user space applications with the - * SK_DRIVER_SENDEVENT macro. + * Store a trap message in the trap buffer and generate an event for + * user space applications with the SK_DRIVER_SENDEVENT macro. */ QueueRlmtPortTrap(pAC, OID_SKGE_TRAP_RLMT_PORT_DOWN, (unsigned int)Param.Para32[0]); @@ -2340,6 +2456,7 @@ case SK_PNMI_EVT_RLMT_ACTIVE_DOWN: PhysPortIndex = (unsigned int)Param.Para32[0]; + NetIndex = (SK_U32)Param.Para32[1]; #ifdef DEBUG if (PhysPortIndex >= SK_MAX_MACS) { @@ -2347,8 +2464,23 @@ ("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_DOWN parameter too high, PhysPort=%d\n", PhysPortIndex)); } + + if (NetIndex >= pAC->Rlmt.NumNets) { + + SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, + ("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_DOWN parameter too high, NetIndex=%d\n", + NetIndex)); + } #endif /* + * For now, ignore event if NetIndex != 0. + */ + if (Param.Para32[1] != 0) { + + return (0); + } + + /* * Nothing to do if port is already inactive */ if (!pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) { @@ -2357,9 +2489,9 @@ } /* - * Update statistic counters to calculate new offset - * for the virtual port and increment semaphore to - * indicate that an update was already done. + * Update statistic counters to calculate new offset for the virtual + * port and increment semaphore to indicate that an update was already + * done. */ if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) != SK_PNMI_ERR_OK) { @@ -2370,13 +2502,12 @@ pAC->Pnmi.MacUpdatedFlag ++; /* - * Calculate new counter offset for virtual port to - * grant continous counting on port switches. The virtual - * port consists of all currently active ports. The port - * down event indicates that a port is removed fromt the - * virtual port. Therefore add the counter value of the - * removed port to the CounterOffset for the virtual port - * to grant the same counter value. + * Calculate new counter offset for virtual port to grant continous + * counting on port switches. The virtual port consists of all currently + * active ports. The port down event indicates that a port is removed + * from the virtual port. Therefore add the counter value of the removed + * port to the CounterOffset for the virtual port to grant the same + * counter value. */ for (CounterIndex = 0; CounterIndex < SK_PNMI_MAX_IDX; CounterIndex ++) { @@ -2386,8 +2517,7 @@ continue; } - Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, - CounterIndex); + Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, CounterIndex); pAC->Pnmi.VirtualCounterOffset[CounterIndex] += Value; } @@ -2402,6 +2532,7 @@ case SK_PNMI_EVT_RLMT_ACTIVE_UP: PhysPortIndex = (unsigned int)Param.Para32[0]; + NetIndex = (SK_U32)Param.Para32[1]; #ifdef DEBUG if (PhysPortIndex >= SK_MAX_MACS) { @@ -2409,8 +2540,23 @@ ("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_UP parameter too high, PhysPort=%d\n", PhysPortIndex)); } + + if (NetIndex >= pAC->Rlmt.NumNets) { + + SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL, + ("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_UP parameter too high, NetIndex=%d\n", + NetIndex)); + } #endif /* + * For now, ignore event if NetIndex != 0. + */ + if (Param.Para32[1] != 0) { + + return (0); + } + + /* * Nothing to do if port is already active */ if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) { @@ -2419,24 +2565,22 @@ } /* - * Statistic maintanence + * Statistic maintenance */ pAC->Pnmi.RlmtChangeCts ++; - pAC->Pnmi.RlmtChangeTime = - SK_PNMI_HUNDREDS_SEC(SkOsGetTime(pAC)); + pAC->Pnmi.RlmtChangeTime = SK_PNMI_HUNDREDS_SEC(SkOsGetTime(pAC)); /* - * Store a trap message in the trap buffer and generate - * an event for user space applications with the - * SK_DRIVER_SENDEVENT macro. + * Store a trap message in the trap buffer and generate an event for + * user space applications with the SK_DRIVER_SENDEVENT macro. */ QueueRlmtNewMacTrap(pAC, PhysPortIndex); (void)SK_DRIVER_SENDEVENT(pAC, IoC); /* - * Update statistic counters to calculate new offset - * for the virtual port and increment semaphore to indicate - * that an update was already done. + * Update statistic counters to calculate new offset for the virtual + * port and increment semaphore to indicate that an update was + * already done. */ if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) != SK_PNMI_ERR_OK) { @@ -2447,11 +2591,10 @@ pAC->Pnmi.MacUpdatedFlag ++; /* - * Calculate new counter offset for virtual port to - * grant continous counting on port switches. A new port - * is added to the virtual port. Therefore substract the - * counter value of the new port from the CounterOffset - * for the virtual port to grant the same value. + * Calculate new counter offset for virtual port to grant continous + * counting on port switches. A new port is added to the virtual port. + * Therefore substract the counter value of the new port from the + * CounterOffset for the virtual port to grant the same value. */ for (CounterIndex = 0; CounterIndex < SK_PNMI_MAX_IDX; CounterIndex ++) { @@ -2461,8 +2604,7 @@ continue; } - Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, - CounterIndex); + Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, CounterIndex); pAC->Pnmi.VirtualCounterOffset[CounterIndex] -= Value; } @@ -2475,40 +2617,41 @@ pAC->Pnmi.MacUpdatedFlag --; break; - case SK_PNMI_EVT_RLMT_PORT_SWITCH: + case SK_PNMI_EVT_RLMT_SEGMENTATION: /* - * This event becomes obsolete if RLMT generates directly - * the events SK_PNMI_EVT_RLMT_ACTIVE_DOWN and - * SK_PNMI_EVT_RLMT_ACTIVE_UP. The events are here emulated. - * PNMI handles that multiple ports may become active. - * Increment semaphore to indicate that an update was - * already done. + * Para.Para32[0] contains the NetIndex. */ - if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) != - SK_PNMI_ERR_OK) { - - SK_PNMI_CHECKFLAGS("SkPnmiEvent: On return"); - return (0); - } - pAC->Pnmi.MacUpdatedFlag ++; - - SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_RLMT_ACTIVE_DOWN, Param); - Param.Para32[0] = Param.Para32[1]; - SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_RLMT_ACTIVE_UP, Param); - - pAC->Pnmi.MacUpdatedFlag --; - break; - case SK_PNMI_EVT_RLMT_SEGMENTATION: /* - * Store a trap message in the trap buffer and generate - * an event for user space applications with the - * SK_DRIVER_SENDEVENT macro. + * Store a trap message in the trap buffer and generate an event for + * user space applications with the SK_DRIVER_SENDEVENT macro. */ QueueSimpleTrap(pAC, OID_SKGE_TRAP_RLMT_SEGMENTATION); (void)SK_DRIVER_SENDEVENT(pAC, IoC); break; + case SK_PNMI_EVT_RLMT_SET_NETS: + /* + * Param.Para32[0] contains the number of Nets. + * Param.Para32[1] is reserved, contains -1. + */ + /* + * Check number of nets + */ + MaxNetNumber = pAC->GIni.GIMacsFound; + if (((unsigned int)Param.Para32[0] < 1) + || ((unsigned int)Param.Para32[0] > MaxNetNumber)) { + return (SK_PNMI_ERR_UNKNOWN_NET); + } + + if((unsigned int)Param.Para32[0] == 1){ /* single net mode */ + pAC->Pnmi.DualNetActiveFlag = SK_FALSE; + } + else { /* dual net mode */ + pAC->Pnmi.DualNetActiveFlag = SK_TRUE; + } + break; + default: break; } @@ -2537,6 +2680,7 @@ * Returns: * SK_PNMI_ERR_XXX. For details have a look to the description of the * calling functions. + * SK_PNMI_ERR_UNKNOWN_NET The requested NetIndex doesn't exist */ static int PnmiVar( @@ -2546,7 +2690,8 @@ SK_U32 Id, /* Object ID that is to be processed */ char *pBuf, /* Buffer which stores the mgmt data to be set */ unsigned int *pLen, /* Total length of mgmt data */ -SK_U32 Instance) /* Instance (1..n) that is to be set or -1 */ +SK_U32 Instance, /* Instance (1..n) that is to be set or -1 */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int TableIndex; int Ret; @@ -2557,11 +2702,18 @@ *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_OID); } + + /* + * Check NetIndex + */ + if (NetIndex >= pAC->Rlmt.NumNets) { + return (SK_PNMI_ERR_UNKNOWN_NET); + } SK_PNMI_CHECKFLAGS("PnmiVar: On call"); Ret = IdTable[TableIndex].Func(pAC, IoC, Action, Id, pBuf, pLen, - Instance, TableIndex); + Instance, TableIndex, NetIndex); SK_PNMI_CHECKFLAGS("PnmiVar: On return"); @@ -2584,6 +2736,7 @@ * * Returns: * SK_PNMI_ERR_XXX. The codes are described in the calling functions. + * SK_PNMI_ERR_UNKNOWN_NET The requested NetIndex doesn't exist */ static int PnmiStruct( @@ -2591,7 +2744,8 @@ SK_IOC IoC, /* IO context handle */ int Action, /* Set action to be performed */ char *pBuf, /* Buffer which contains the data to be set */ -unsigned int *pLen) /* Length of buffer */ +unsigned int *pLen, /* Length of buffer */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; unsigned int TableIndex; @@ -2617,13 +2771,20 @@ return (SK_PNMI_ERR_TOO_SHORT); } + /* + * Check NetIndex + */ + if (NetIndex >= pAC->Rlmt.NumNets) { + return (SK_PNMI_ERR_UNKNOWN_NET); + } + SK_PNMI_CHECKFLAGS("PnmiStruct: On call"); /* * Update the values of RLMT and SIRQ and increment semaphores to * indicate that an update was already done. */ - if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) { + if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) { SK_PNMI_SET_STAT(pBuf, Ret, (SK_U32)(-1)); *pLen = SK_PNMI_MIN_STRUCT_SIZE; @@ -2673,7 +2834,7 @@ Len = 0; Ret = IdTable[TableIndex].Func(pAC, IoC, SK_PNMI_GET, IdTable[TableIndex].Id, - NULL, &Len, Instance, TableIndex); + NULL, &Len, Instance, TableIndex, NetIndex); if (Ret == SK_PNMI_ERR_UNKNOWN_INST) { @@ -2711,7 +2872,7 @@ /* Call the OID handler function */ Ret = IdTable[TableIndex].Func(pAC, IoC, Action, IdTable[TableIndex].Id, pBuf + DstOffset, - &Len, Instance, TableIndex); + &Len, Instance, TableIndex, NetIndex); if (Ret != SK_PNMI_ERR_OK) { @@ -2773,7 +2934,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -2793,7 +2954,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { if (Id != OID_SKGE_ALL_DATA) { @@ -2816,13 +2978,13 @@ switch (Action) { case SK_PNMI_GET: - return (SkPnmiGetStruct(pAC, IoC, pBuf, pLen)); + return (SkPnmiGetStruct(pAC, IoC, pBuf, pLen, NetIndex)); case SK_PNMI_PRESET: - return (SkPnmiPreSetStruct(pAC, IoC, pBuf, pLen)); + return (SkPnmiPreSetStruct(pAC, IoC, pBuf, pLen, NetIndex)); case SK_PNMI_SET: - return (SkPnmiSetStruct(pAC, IoC, pBuf, pLen)); + return (SkPnmiSetStruct(pAC, IoC, pBuf, pLen, NetIndex)); } SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR004, SK_PNMI_ERR004MSG); @@ -2840,7 +3002,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -2860,7 +3022,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; SK_U32 ActionOp; @@ -2949,7 +3112,7 @@ case SK_PNMI_ACT_RESETCNT: /* Set all counters and timestamps to zero */ - ResetCounter(pAC, IoC); + ResetCounter(pAC, IoC, NetIndex); break; default: @@ -2974,7 +3137,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -2991,11 +3154,12 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { - int Ret; - SK_U32 StatVal; - + int Ret; + SK_U64 StatVal; + SK_BOOL Is64BitReq = SK_FALSE; /* * Only the active Mac is returned @@ -3030,11 +3194,28 @@ break; default: - if (*pLen < 4) { +#ifndef SK_NDIS_64BIT_CTR + if (*pLen < sizeof(SK_U32)) { + *pLen = sizeof(SK_U32); + return (SK_PNMI_ERR_TOO_SHORT); + } - *pLen = 4; +#else /* SK_NDIS_64BIT_CTR */ + + /* + * for compatibility, at least 32bit are required for oid + */ + if (*pLen < sizeof(SK_U32)) { + /* + * but indicate handling for 64bit values, + * if insufficient space is provided + */ + *pLen = sizeof(SK_U64); return (SK_PNMI_ERR_TOO_SHORT); } + + Is64BitReq = (*pLen < sizeof(SK_U64)) ? SK_FALSE : SK_TRUE; +#endif /* SK_NDIS_64BIT_CTR */ break; } @@ -3057,20 +3238,31 @@ switch (Id) { case OID_802_3_PERMANENT_ADDRESS: - CopyMac(pBuf, &pAC->Addr.PermanentMacAddress); + CopyMac(pBuf, &pAC->Addr.Net[NetIndex].PermanentMacAddress); *pLen = sizeof(SK_MAC_ADDR); break; case OID_802_3_CURRENT_ADDRESS: - CopyMac(pBuf, &pAC->Addr.CurrentMacAddress); + CopyMac(pBuf, &pAC->Addr.Net[NetIndex].CurrentMacAddress); *pLen = sizeof(SK_MAC_ADDR); break; default: - StatVal = (SK_U32)GetStatVal(pAC, IoC, 0, - IdTable[TableIndex].Param); - SK_PNMI_STORE_U32(pBuf, StatVal); - *pLen = sizeof(SK_U32); + StatVal = GetStatVal(pAC, IoC, 0, IdTable[TableIndex].Param, NetIndex); + + /* + * by default 32bit values are evaluated + */ + if (!Is64BitReq) { + SK_U32 StatVal32; + StatVal32 = (SK_U32)StatVal; + SK_PNMI_STORE_U32(pBuf, StatVal32); + *pLen = sizeof(SK_U32); + } + else { + SK_PNMI_STORE_U64(pBuf, StatVal); + *pLen = sizeof(SK_U64); + } break; } @@ -3088,7 +3280,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3105,7 +3297,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int LogPortMax; unsigned int LogPortIndex; @@ -3123,22 +3316,28 @@ PhysPortMax = pAC->GIni.GIMacsFound; LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax); - if ((Instance != (SK_U32)(-1))) { + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */ + LogPortMax--; + } + if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */ + /* Check instance range */ if ((Instance < 1) || (Instance > LogPortMax)) { *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_INST); } - LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance); Limit = LogPortIndex + 1; } - else { + + else { /* Instance == (SK_U32)(-1), get all Instances of that OID */ + LogPortIndex = 0; Limit = LogPortMax; } + /* * Check action */ @@ -3161,7 +3360,7 @@ * Update XMAC statistic and increment semaphore to indicate that * an update was already done. */ - Ret = MacUpdate(pAC, IoC, 0, PhysPortMax - 1); + Ret = MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1); if (Ret != SK_PNMI_ERR_OK) { *pLen = 0; @@ -3185,9 +3384,23 @@ case OID_SKGE_STAT_RX_UTIL: return (SK_PNMI_ERR_GENERAL); */ + /* + * Frames longer than IEEE 802.3 frame max size are counted + * by XMAC in frame_too_long counter even reception of long + * frames was enabled and the frame was correct. + * So correct the value by subtracting RxLongFrame counter. + */ + case OID_SKGE_STAT_RX_TOO_LONG: + StatVal = GetStatVal(pAC, IoC, LogPortIndex, + IdTable[TableIndex].Param, NetIndex) - + GetStatVal(pAC, IoC, LogPortIndex, + SK_PNMI_HRX_LONGFRAMES, NetIndex); + SK_PNMI_STORE_U64(pBuf + Offset, StatVal); + break; + default: StatVal = GetStatVal(pAC, IoC, LogPortIndex, - IdTable[TableIndex].Param); + IdTable[TableIndex].Param, NetIndex); SK_PNMI_STORE_U64(pBuf + Offset, StatVal); break; } @@ -3214,7 +3427,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3234,7 +3447,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; unsigned int LogPortMax; @@ -3245,24 +3459,31 @@ unsigned int Offset = 0; + /* - * Calculate instance if wished + * Calculate instance if wished. MAC index 0 is the virtual + * MAC. */ PhysPortMax = pAC->GIni.GIMacsFound; LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax); - if ((Instance != (SK_U32)(-1))) { - + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */ + LogPortMax--; + } + + if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */ + /* Check instance range */ if ((Instance < 1) || (Instance > LogPortMax)) { *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_INST); } - LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance); Limit = LogPortIndex + 1; } - else { + + else { /* Instance == (SK_U32)(-1), get all Instances of that OID */ + LogPortIndex = 0; Limit = LogPortMax; } @@ -3290,34 +3511,28 @@ case OID_SKGE_PHYS_CUR_ADDR: if (LogPortIndex == 0) { - - CopyMac(pBuf + Offset, &pAC->Addr. - CurrentMacAddress); + CopyMac(pBuf + Offset, &pAC->Addr.Net[NetIndex].CurrentMacAddress); } else { - PhysPortIndex = SK_PNMI_PORT_LOG2PHYS( - pAC, LogPortIndex); + PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex); - CopyMac(pBuf + Offset, &pAC->Addr. - Port[PhysPortIndex]. - CurrentMacAddress); + CopyMac(pBuf + Offset, + &pAC->Addr.Port[PhysPortIndex].CurrentMacAddress); } Offset += 6; break; case OID_SKGE_PHYS_FAC_ADDR: if (LogPortIndex == 0) { - - CopyMac(pBuf + Offset, &pAC->Addr. - PermanentMacAddress); + CopyMac(pBuf + Offset, + &pAC->Addr.Net[NetIndex].PermanentMacAddress); } else { PhysPortIndex = SK_PNMI_PORT_LOG2PHYS( pAC, LogPortIndex); - CopyMac(pBuf + Offset, &pAC->Addr. - Port[PhysPortIndex]. - PermanentMacAddress); + CopyMac(pBuf + Offset, + &pAC->Addr.Port[PhysPortIndex].PermanentMacAddress); } Offset += 6; break; @@ -3424,7 +3639,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3441,7 +3656,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int Index; unsigned int Limit; @@ -3453,15 +3669,14 @@ * Calculate instance if wished */ if (Instance != (SK_U32)(-1)) { - + if ((Instance < 1) || (Instance > SKCS_NUM_PROTOCOLS)) { *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_INST); } - Index = (unsigned int)Instance - 1; - Limit = (unsigned int)Instance; + Limit = Index + 1; } else { Index = 0; @@ -3494,23 +3709,23 @@ switch (Id) { case OID_SKGE_CHKSM_RX_OK_CTS: - StatVal = pAC->Csum.ProtoStats[Index].RxOkCts; + StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxOkCts; break; case OID_SKGE_CHKSM_RX_UNABLE_CTS: - StatVal = pAC->Csum.ProtoStats[Index].RxUnableCts; + StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxUnableCts; break; case OID_SKGE_CHKSM_RX_ERR_CTS: - StatVal = pAC->Csum.ProtoStats[Index].RxErrCts; + StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxErrCts; break; case OID_SKGE_CHKSM_TX_OK_CTS: - StatVal = pAC->Csum.ProtoStats[Index].TxOkCts; + StatVal = pAC->Csum.ProtoStats[NetIndex][Index].TxOkCts; break; case OID_SKGE_CHKSM_TX_UNABLE_CTS: - StatVal = pAC->Csum.ProtoStats[Index].TxUnableCts; + StatVal = pAC->Csum.ProtoStats[NetIndex][Index].TxUnableCts; break; default: @@ -3543,7 +3758,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3560,7 +3775,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int i; unsigned int Index; @@ -3787,7 +4003,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3807,13 +4023,14 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_VPD_STATUS *pVpdStatus; unsigned int BufLen; char Buf[256]; - char KeyArr[SK_PNMI_VPD_ARR_SIZE][SK_PNMI_VPD_STR_SIZE]; - char KeyStr[SK_PNMI_VPD_STR_SIZE]; + char KeyArr[SK_PNMI_VPD_ENTRIES][SK_PNMI_VPD_KEY_SIZE]; + char KeyStr[SK_PNMI_VPD_KEY_SIZE]; unsigned int KeyNo; unsigned int Offset; unsigned int Index; @@ -3829,7 +4046,6 @@ Ret = GetVpdKeyArr(pAC, IoC, &KeyArr[0][0], sizeof(KeyArr), &KeyNo); if (Ret != SK_PNMI_ERR_OK) { - *pLen = 0; return (Ret); } @@ -3854,7 +4070,6 @@ for (Index = 0; Index < KeyNo; Index ++) { if (SK_STRCMP(KeyStr, KeyArr[Index]) == 0) { - FirstIndex = Index; LastIndex = Index+1; break; @@ -4267,7 +4482,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -4284,7 +4499,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; unsigned int Index; @@ -4297,6 +4513,7 @@ SK_U64 Val64; SK_U64 Val64RxHwErrs = 0; SK_U64 Val64TxHwErrs = 0; + SK_BOOL Is64BitReq = SK_FALSE; char Buf[256]; @@ -4323,13 +4540,37 @@ */ switch (Id) { + case OID_GEN_XMIT_ERROR: + case OID_GEN_RCV_ERROR: + case OID_GEN_RCV_NO_BUFFER: +#ifndef SK_NDIS_64BIT_CTR + if (*pLen < sizeof(SK_U32)) { + *pLen = sizeof(SK_U32); + return (SK_PNMI_ERR_TOO_SHORT); + } + +#else /* SK_NDIS_64BIT_CTR */ + + /* + * for compatibility, at least 32bit are required for oid + */ + if (*pLen < sizeof(SK_U32)) { + /* + * but indicate handling for 64bit values, + * if insufficient space is provided + */ + *pLen = sizeof(SK_U64); + return (SK_PNMI_ERR_TOO_SHORT); + } + + Is64BitReq = (*pLen < sizeof(SK_U64)) ? SK_FALSE : SK_TRUE; +#endif /* SK_NDIS_64BIT_CTR */ + break; + case OID_SKGE_PORT_NUMBER: case OID_SKGE_DEVICE_TYPE: case OID_SKGE_RESULT: case OID_SKGE_RLMT_MONITOR_NUMBER: - case OID_GEN_XMIT_ERROR: - case OID_GEN_RCV_ERROR: - case OID_GEN_RCV_NO_BUFFER: case OID_GEN_TRANSMIT_QUEUE_LENGTH: case OID_SKGE_TRAP_NUMBER: case OID_SKGE_MDB_VERSION: @@ -4419,31 +4660,30 @@ case OID_SKGE_IN_ERRORS_CTS: case OID_GEN_RCV_ERROR: Val64RxHwErrs = - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_MISSED) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FRAMING) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_OVERFLOW)+ - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_JABBER) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CARRIER) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_IRLENGTH)+ - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SYMBOL) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SHORTS) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_RUNT) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_TOO_LONG)+ - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FCS) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CEXT); - break; + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_MISSED, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FRAMING, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_OVERFLOW, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_JABBER, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CARRIER, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_IRLENGTH, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SYMBOL, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SHORTS, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_RUNT, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_TOO_LONG, NetIndex)- + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_LONGFRAMES, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FCS, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CEXT, NetIndex); + break; case OID_SKGE_TX_HW_ERROR_CTS: case OID_SKGE_OUT_ERROR_CTS: case OID_GEN_XMIT_ERROR: Val64TxHwErrs = - GetStatVal(pAC, IoC, 0, - SK_PNMI_HTX_EXCESS_COL) + - GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_LATE_COL)+ - GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_UNDERRUN)+ - GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_CARRIER)+ - GetStatVal(pAC, IoC, 0, - SK_PNMI_HTX_EXCESS_COL); + GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_EXCESS_COL, NetIndex) + + GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_LATE_COL, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_UNDERRUN, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_CARRIER, NetIndex)+ + GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_EXCESS_COL, NetIndex); break; } } @@ -4655,61 +4895,142 @@ break; case OID_SKGE_TX_SW_QUEUE_LEN: - Val64 = pAC->Pnmi.TxSwQueueLen; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxSwQueueLen; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxSwQueueLen + + pAC->Pnmi.Port[1].TxSwQueueLen; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; + case OID_SKGE_TX_SW_QUEUE_MAX: - Val64 = pAC->Pnmi.TxSwQueueMax; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxSwQueueMax; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxSwQueueMax + + pAC->Pnmi.Port[1].TxSwQueueMax; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_TX_RETRY: - Val64 = pAC->Pnmi.TxRetryCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxRetryCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxRetryCts + + pAC->Pnmi.Port[1].TxRetryCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_RX_INTR_CTS: - Val64 = pAC->Pnmi.RxIntrCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].RxIntrCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].RxIntrCts + + pAC->Pnmi.Port[1].RxIntrCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_TX_INTR_CTS: - Val64 = pAC->Pnmi.TxIntrCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxIntrCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxIntrCts + + pAC->Pnmi.Port[1].TxIntrCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_RX_NO_BUF_CTS: - Val64 = pAC->Pnmi.RxNoBufCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].RxNoBufCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].RxNoBufCts + + pAC->Pnmi.Port[1].RxNoBufCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_TX_NO_BUF_CTS: - Val64 = pAC->Pnmi.TxNoBufCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxNoBufCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxNoBufCts + + pAC->Pnmi.Port[1].TxNoBufCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_TX_USED_DESCR_NO: - Val64 = pAC->Pnmi.TxUsedDescrNo; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].TxUsedDescrNo; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].TxUsedDescrNo + + pAC->Pnmi.Port[1].TxUsedDescrNo; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_RX_DELIVERED_CTS: - Val64 = pAC->Pnmi.RxDeliveredCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].RxDeliveredCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].RxDeliveredCts + + pAC->Pnmi.Port[1].RxDeliveredCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_RX_OCTETS_DELIV_CTS: - Val64 = pAC->Pnmi.RxOctetsDeliveredCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].RxOctetsDeliveredCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].RxOctetsDeliveredCts + + pAC->Pnmi.Port[1].RxOctetsDeliveredCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; @@ -4725,19 +5046,45 @@ break; case OID_SKGE_IN_ERRORS_CTS: - Val64 = Val64RxHwErrs + pAC->Pnmi.RxNoBufCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = Val64RxHwErrs + pAC->Pnmi.Port[NetIndex].RxNoBufCts; + } + /* Single net mode */ + else { + Val64 = Val64RxHwErrs + + pAC->Pnmi.Port[0].RxNoBufCts + + pAC->Pnmi.Port[1].RxNoBufCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_OUT_ERROR_CTS: - Val64 = Val64TxHwErrs + pAC->Pnmi.TxNoBufCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = Val64TxHwErrs + pAC->Pnmi.Port[NetIndex].TxNoBufCts; + } + /* Single net mode */ + else { + Val64 = Val64TxHwErrs + + pAC->Pnmi.Port[0].TxNoBufCts + + pAC->Pnmi.Port[1].TxNoBufCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; case OID_SKGE_ERR_RECOVERY_CTS: - Val64 = pAC->Pnmi.ErrRecoveryCts; + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + Val64 = pAC->Pnmi.Port[NetIndex].ErrRecoveryCts; + } + /* Single net mode */ + else { + Val64 = pAC->Pnmi.Port[0].ErrRecoveryCts + + pAC->Pnmi.Port[1].ErrRecoveryCts; + } SK_PNMI_STORE_U64(pBuf, Val64); *pLen = sizeof(SK_U64); break; @@ -4756,25 +5103,58 @@ break; case OID_GEN_RCV_ERROR: - Val32 = (SK_U32)(Val64RxHwErrs + pAC->Pnmi.RxNoBufCts); - SK_PNMI_STORE_U32(pBuf, Val32); - *pLen = sizeof(SK_U32); + Val64 = Val64RxHwErrs + pAC->Pnmi.Port[NetIndex].RxNoBufCts; + + /* + * by default 32bit values are evaluated + */ + if (!Is64BitReq) { + Val32 = (SK_U32)Val64; + SK_PNMI_STORE_U32(pBuf, Val32); + *pLen = sizeof(SK_U32); + } + else { + SK_PNMI_STORE_U64(pBuf, Val64); + *pLen = sizeof(SK_U64); + } break; case OID_GEN_XMIT_ERROR: - Val32 = (SK_U32)(Val64TxHwErrs + pAC->Pnmi.TxNoBufCts); - SK_PNMI_STORE_U32(pBuf, Val32); - *pLen = sizeof(SK_U32); + Val64 = Val64TxHwErrs + pAC->Pnmi.Port[NetIndex].TxNoBufCts; + + /* + * by default 32bit values are evaluated + */ + if (!Is64BitReq) { + Val32 = (SK_U32)Val64; + SK_PNMI_STORE_U32(pBuf, Val32); + *pLen = sizeof(SK_U32); + } + else { + SK_PNMI_STORE_U64(pBuf, Val64); + *pLen = sizeof(SK_U64); + } break; case OID_GEN_RCV_NO_BUFFER: - Val32 = (SK_U32)pAC->Pnmi.RxNoBufCts; - SK_PNMI_STORE_U32(pBuf, Val32); - *pLen = sizeof(SK_U32); + Val64 = pAC->Pnmi.Port[NetIndex].RxNoBufCts; + + /* + * by default 32bit values are evaluated + */ + if (!Is64BitReq) { + Val32 = (SK_U32)Val64; + SK_PNMI_STORE_U32(pBuf, Val32); + *pLen = sizeof(SK_U32); + } + else { + SK_PNMI_STORE_U64(pBuf, Val64); + *pLen = sizeof(SK_U64); + } break; case OID_GEN_TRANSMIT_QUEUE_LENGTH: - Val32 = (SK_U32)pAC->Pnmi.TxSwQueueLen; + Val32 = (SK_U32)pAC->Pnmi.Port[NetIndex].TxSwQueueLen; SK_PNMI_STORE_U32(pBuf, Val32); *pLen = sizeof(SK_U32); break; @@ -4809,7 +5189,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -4829,7 +5209,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { int Ret; unsigned int PhysPortIndex; @@ -4861,7 +5242,7 @@ case OID_SKGE_RLMT_MODE: case OID_SKGE_RLMT_PORT_ACTIVE: - case OID_SKGE_RLMT_PORT_PREFERED: + case OID_SKGE_RLMT_PORT_PREFERRED: if (*pLen < sizeof(SK_U8)) { *pLen = sizeof(SK_U8); @@ -4902,7 +5283,7 @@ * statistic always up to date some time. Then we can * remove this type of call. */ - if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) { + if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) { *pLen = 0; return (Ret); @@ -4915,7 +5296,7 @@ switch (Id) { case OID_SKGE_RLMT_MODE: - *pBuf = (char)pAC->Rlmt.RlmtMode; + *pBuf = (char)pAC->Rlmt.Net[0].RlmtMode; *pLen = sizeof(char); break; @@ -4941,17 +5322,15 @@ if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) { - *pBuf = (char)SK_PNMI_PORT_PHYS2LOG( - PhysPortIndex); + *pBuf = (char)SK_PNMI_PORT_PHYS2LOG(PhysPortIndex); break; } } *pLen = sizeof(char); break; - case OID_SKGE_RLMT_PORT_PREFERED: - *pBuf = (char)SK_PNMI_PORT_PHYS2LOG( - pAC->Rlmt.MacPreferred); + case OID_SKGE_RLMT_PORT_PREFERRED: + *pBuf = (char)SK_PNMI_PORT_PHYS2LOG(pAC->Rlmt.Net[NetIndex].Preference); *pLen = sizeof(char); break; @@ -5018,6 +5397,7 @@ /* Send an event to RLMT to change the mode */ SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam)); EventParam.Para32[0] |= (SK_U32)(*pBuf); + EventParam.Para32[1] = 0; if (SkRlmtEvent(pAC, IoC, SK_RLMT_MODE_CHANGE, EventParam) > 0) { @@ -5029,7 +5409,7 @@ } break; - case OID_SKGE_RLMT_PORT_PREFERED: + case OID_SKGE_RLMT_PORT_PREFERRED: /* Check if the buffer length is plausible */ if (*pLen < sizeof(char)) { @@ -5057,6 +5437,7 @@ */ SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam)); EventParam.Para32[0] = (SK_U32)(*pBuf) - 1; + EventParam.Para32[1] = NetIndex; if (SkRlmtEvent(pAC, IoC, SK_RLMT_PREFPORT_CHANGE, EventParam) > 0) { @@ -5117,7 +5498,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5134,7 +5515,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int PhysPortMax; unsigned int PhysPortIndex; @@ -5144,26 +5526,40 @@ SK_U32 Val32; SK_U64 Val64; - /* * Calculate the port indexes from the instance */ PhysPortMax = pAC->GIni.GIMacsFound; if ((Instance != (SK_U32)(-1))) { - + /* Check instance range */ if ((Instance < 1) || (Instance > PhysPortMax)) { *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_INST); } + /* Single net mode */ PhysPortIndex = Instance - 1; + + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + PhysPortIndex = NetIndex; + } + + /* Both net modes */ Limit = PhysPortIndex + 1; } else { + /* Single net mode */ PhysPortIndex = 0; Limit = PhysPortMax; + + /* Dual net mode */ + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ + PhysPortIndex = NetIndex; + Limit = PhysPortIndex + 1; + } } /* @@ -5213,7 +5609,7 @@ * Update statistic and increment semaphores to indicate that * an update was already done. */ - if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) { + if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) { *pLen = 0; return (Ret); @@ -5302,7 +5698,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5322,7 +5718,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int PhysPortMax; unsigned int PhysPortIndex; @@ -5333,6 +5730,7 @@ char Val8; int Ret; SK_EVPARA EventParam; + SK_U32 Val32; /* @@ -5342,18 +5740,23 @@ PhysPortMax = pAC->GIni.GIMacsFound; LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax); - if ((Instance != (SK_U32)(-1))) { + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */ + LogPortMax--; + } + if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */ + /* Check instance range */ if ((Instance < 1) || (Instance > LogPortMax)) { *pLen = 0; return (SK_PNMI_ERR_UNKNOWN_INST); } - LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance); Limit = LogPortIndex + 1; } - else { + + else { /* Instance == (SK_U32)(-1), get all Instances of that OID */ + LogPortIndex = 0; Limit = LogPortMax; } @@ -5388,10 +5791,17 @@ } break; + case OID_SKGE_MTU: + if (*pLen < sizeof(SK_U32)) { + + *pLen = sizeof(SK_U32); + return (SK_PNMI_ERR_TOO_SHORT); + } + break; + default: SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR041, SK_PNMI_ERR041MSG); - *pLen = 0; return (SK_PNMI_ERR_GENERAL); } @@ -5608,6 +6018,12 @@ Offset += sizeof(char); break; + case OID_SKGE_MTU: + Val32 = SK_DRIVER_GET_MTU(pAC, IoC, NetIndex); + SK_PNMI_STORE_U32(pBuf + Offset, Val32); + Offset += sizeof(SK_U32); + break; + default: SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR042, SK_PNMI_ERR042MSG); @@ -5643,7 +6059,20 @@ } break; - default: + case OID_SKGE_MTU: + if (*pLen < sizeof(SK_U32)) { + + *pLen = sizeof(SK_U32); + return (SK_PNMI_ERR_TOO_SHORT); + } + if (*pLen != sizeof(SK_U32)) { + + *pLen = 0; + return (SK_PNMI_ERR_BAD_VALUE); + } + break; + + default: *pLen = 0; return (SK_PNMI_ERR_READ_ONLY); } @@ -5665,7 +6094,8 @@ break; } if (Val8 < SK_LMODE_HALF || - Val8 > SK_LMODE_AUTOSENSE) { + (LogPortIndex != 0 && Val8 > SK_LMODE_AUTOSENSE) || + (LogPortIndex == 0 && Val8 > SK_LMODE_INDETERMINATED)) { *pLen = 0; return (SK_PNMI_ERR_BAD_VALUE); @@ -5740,7 +6170,8 @@ break; } if (Val8 < SK_FLOW_MODE_NONE || - Val8 > SK_FLOW_MODE_SYM_OR_REM) { + (LogPortIndex != 0 && Val8 > SK_FLOW_MODE_SYM_OR_REM) || + (LogPortIndex == 0 && Val8 > SK_FLOW_MODE_INDETERMINATED)) { *pLen = 0; return (SK_PNMI_ERR_BAD_VALUE); @@ -5816,7 +6247,8 @@ break; } if (Val8 < SK_MS_MODE_AUTO || - Val8 > SK_MS_MODE_SLAVE) { + (LogPortIndex != 0 && Val8 > SK_MS_MODE_SLAVE) || + (LogPortIndex == 0 && Val8 > SK_MS_MODE_INDETERMINATED)) { *pLen = 0; return (SK_PNMI_ERR_BAD_VALUE); @@ -5879,10 +6311,35 @@ return (SK_PNMI_ERR_GENERAL); } } - + Offset += sizeof(char); break; + case OID_SKGE_MTU : + /* Check the value range */ + Val32 = *(SK_U32*)(pBuf + Offset); + if (Val32 == 0) { + /* mtu of this port remains unchanged */ + Offset += sizeof(SK_U32); + break; + } + if (SK_DRIVER_PRESET_MTU(pAC, IoC, NetIndex, Val32) != 0) { + *pLen = 0; + return (SK_PNMI_ERR_BAD_VALUE); + } + + /* The preset ends here */ + if (Action == SK_PNMI_PRESET) { + return (SK_PNMI_ERR_OK); + } + + if (SK_DRIVER_SET_MTU(pAC, IoC, NetIndex, Val32) != 0) { + return (SK_PNMI_ERR_GENERAL); + } + + Offset += sizeof(SK_U32); + break; + default: SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR045, SK_PNMI_ERR045MSG); @@ -5905,7 +6362,7 @@ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5925,7 +6382,8 @@ char *pBuf, /* Buffer to which to mgmt data will be retrieved */ unsigned int *pLen, /* On call: buffer length. On return: used buffer */ SK_U32 Instance, /* Instance (1..n) that is to be queried or -1 */ -unsigned int TableIndex) /* Index to the Id table */ +unsigned int TableIndex, /* Index to the Id table */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int Index; unsigned int Limit; @@ -6419,8 +6877,8 @@ unsigned int KeyArrLen, /* Length of array in bytes */ unsigned int *pKeyNo) /* Number of keys */ { - unsigned int BufKeysLen = 128; - char BufKeys[128]; + unsigned int BufKeysLen = SK_PNMI_VPD_BUFSIZE; + char BufKeys[SK_PNMI_VPD_BUFSIZE]; unsigned int StartOffset; unsigned int Offset; int Index; @@ -6451,12 +6909,12 @@ * errorlog notification. This case should not happen because * the maximum number of keys is limited due to RAM limitations */ - if (*pKeyNo > SK_PNMI_VPD_ARR_SIZE) { + if (*pKeyNo > SK_PNMI_VPD_ENTRIES) { SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR015, SK_PNMI_ERR015MSG); - *pKeyNo = SK_PNMI_VPD_ARR_SIZE; + *pKeyNo = SK_PNMI_VPD_ENTRIES; } /* @@ -6471,15 +6929,15 @@ continue; } - if (Offset - StartOffset > SK_PNMI_VPD_STR_SIZE) { + if (Offset - StartOffset > SK_PNMI_VPD_KEY_SIZE) { SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR016, SK_PNMI_ERR016MSG); return (SK_PNMI_ERR_GENERAL); } - SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_STR_SIZE, - &BufKeys[StartOffset], SK_PNMI_VPD_STR_SIZE); + SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_KEY_SIZE, + &BufKeys[StartOffset], SK_PNMI_VPD_KEY_SIZE); Index ++; StartOffset = Offset + 1; @@ -6488,8 +6946,8 @@ /* Last key not zero terminated? Get it anyway */ if (StartOffset < Offset) { - SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_STR_SIZE, - &BufKeys[StartOffset], SK_PNMI_VPD_STR_SIZE); + SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_KEY_SIZE, + &BufKeys[StartOffset], SK_PNMI_VPD_KEY_SIZE); } return (SK_PNMI_ERR_OK); @@ -6551,7 +7009,8 @@ static int RlmtUpdate( SK_AC *pAC, /* Pointer to adapter context */ -SK_IOC IoC) /* IO context handle */ +SK_IOC IoC, /* IO context handle */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { SK_EVPARA EventParam; @@ -6564,6 +7023,8 @@ /* Send an synchronuous update event to the module */ SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam)); + EventParam.Para32[0] = NetIndex; + EventParam.Para32[1] = (SK_U32)-1; if (SkRlmtEvent(pAC, IoC, SK_RLMT_STATS_UPDATE, EventParam) > 0) { SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR048, @@ -6660,40 +7121,49 @@ */ static SK_U64 GetStatVal( -SK_AC *pAC, /* Pointer to adapter context */ -SK_IOC IoC, /* IO context handle */ +SK_AC *pAC, /* Pointer to adapter context */ +SK_IOC IoC, /* IO context handle */ unsigned int LogPortIndex, /* Index of the logical Port to be processed */ -unsigned int StatIndex) /* Index to statistic value */ +unsigned int StatIndex, /* Index to statistic value */ +SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ { unsigned int PhysPortIndex; unsigned int PhysPortMax; SK_U64 Val = 0; - if (LogPortIndex == 0) { + if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */ - PhysPortMax = pAC->GIni.GIMacsFound; + PhysPortIndex = NetIndex; + Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex); + } /* end of dual net mode */ - /* Add counter of all active ports */ - for (PhysPortIndex = 0; PhysPortIndex < PhysPortMax; - PhysPortIndex ++) { + else { /* single net mode */ - if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) { + if (LogPortIndex == 0) { - Val += GetPhysStatVal(pAC, IoC, PhysPortIndex, - StatIndex); - } - } + PhysPortMax = pAC->GIni.GIMacsFound; - /* Correct value because of port switches */ - Val += pAC->Pnmi.VirtualCounterOffset[StatIndex]; - } - else { - /* Get counter value of physical port */ - PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex); - Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex); - } + /* Add counter of all active ports */ + for (PhysPortIndex = 0; PhysPortIndex < PhysPortMax; + PhysPortIndex ++) { + + if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) { + + Val += GetPhysStatVal(pAC, IoC, PhysPortIndex, + StatIndex); + } + } + /* Correct value because of port switches */ + Val += pAC->Pnmi.VirtualCounterOffset[StatIndex]; + } + else { + /* Get counter value of physical port */ + PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex); + Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex); + } + } /* end of single net mode */ return (Val); } @@ -6715,8 +7185,8 @@ */ static SK_U64 GetPhysStatVal( -SK_AC *pAC, /* Pointer to adapter context */ -SK_IOC IoC, /* IO context handle */ +SK_AC *pAC, /* Pointer to adapter context */ +SK_IOC IoC, /* IO context handle */ unsigned int PhysPortIndex, /* Index of the logical Port to be processed */ unsigned int StatIndex) /* Index to statistic value */ { @@ -6755,6 +7225,12 @@ 32); break; + case SK_PNMI_HRX_LONGFRAMES: + LowVal = (SK_U32)pAC->Pnmi.Port[PhysPortIndex].StatRxLongFrameCts; + HighVal = (SK_U32) + (pAC->Pnmi.Port[PhysPortIndex].StatRxLongFrameCts >> 32); + break; + case SK_PNMI_HRX_FCS: /* * Broadcom filters fcs errors and counts it in @@ -6806,7 +7282,8 @@ static void ResetCounter( SK_AC *pAC, /* Pointer to adapter context */ -SK_IOC IoC) /* IO context handle */ +SK_IOC IoC, /* IO context handle */ +SK_U32 NetIndex) { unsigned int PhysPortIndex; SK_EVPARA EventParam; @@ -6818,7 +7295,10 @@ SkEventQueue(pAC, SKGE_I2C, SK_I2CEV_CLEAR, EventParam); /* Notify RLMT module */ + EventParam.Para32[0] = NetIndex; + EventParam.Para32[1] = (SK_U32)-1; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STATS_CLEAR, EventParam); + EventParam.Para32[1] = 0; /* Notify SIRQ module */ SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_CLEAR_STAT, EventParam); @@ -6850,27 +7330,32 @@ SK_MEMSET((char *)&pAC->Pnmi.Port[PhysPortIndex]. StatSyncOctetsCts, 0, sizeof(pAC->Pnmi.Port[ PhysPortIndex].StatSyncOctetsCts)); + SK_MEMSET((char *)&pAC->Pnmi.Port[PhysPortIndex]. + StatRxLongFrameCts, 0, sizeof(pAC->Pnmi.Port[ + PhysPortIndex].StatRxLongFrameCts)); } /* * Clear local statistics */ + SK_MEMSET((char *)&pAC->Pnmi.VirtualCounterOffset, 0, + sizeof(pAC->Pnmi.VirtualCounterOffset)); pAC->Pnmi.RlmtChangeCts = 0; pAC->Pnmi.RlmtChangeTime = 0; SK_MEMSET((char *)&pAC->Pnmi.RlmtChangeEstimate.EstValue[0], 0, sizeof(pAC->Pnmi.RlmtChangeEstimate.EstValue)); pAC->Pnmi.RlmtChangeEstimate.EstValueIndex = 0; pAC->Pnmi.RlmtChangeEstimate.Estimate = 0; - pAC->Pnmi.TxSwQueueMax = 0; - pAC->Pnmi.TxRetryCts = 0; - pAC->Pnmi.RxIntrCts = 0; - pAC->Pnmi.TxIntrCts = 0; - pAC->Pnmi.RxNoBufCts = 0; - pAC->Pnmi.TxNoBufCts = 0; - pAC->Pnmi.TxUsedDescrNo = 0; - pAC->Pnmi.RxDeliveredCts = 0; - pAC->Pnmi.RxOctetsDeliveredCts = 0; - pAC->Pnmi.ErrRecoveryCts = 0; + pAC->Pnmi.Port[NetIndex].TxSwQueueMax = 0; + pAC->Pnmi.Port[NetIndex].TxRetryCts = 0; + pAC->Pnmi.Port[NetIndex].RxIntrCts = 0; + pAC->Pnmi.Port[NetIndex].TxIntrCts = 0; + pAC->Pnmi.Port[NetIndex].RxNoBufCts = 0; + pAC->Pnmi.Port[NetIndex].TxNoBufCts = 0; + pAC->Pnmi.Port[NetIndex].TxUsedDescrNo = 0; + pAC->Pnmi.Port[NetIndex].RxDeliveredCts = 0; + pAC->Pnmi.Port[NetIndex].RxOctetsDeliveredCts = 0; + pAC->Pnmi.Port[NetIndex].ErrRecoveryCts = 0; } /***************************************************************************** @@ -6879,7 +7364,7 @@ * * Description: * The trap buffer stores various events. A user application somehow - * gets notified that an event occured and retrieves the trap buffer + * gets notified that an event occurred and retrieves the trap buffer * contens (or simply polls the buffer). The buffer is organized as * a ring which stores the newest traps at the beginning. The oldest * traps are overwritten by the newest ones. Each trap entry has a diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skgesirq.c linux.20p9/drivers/net/sk98lin/skgesirq.c --- linux.vanilla/drivers/net/sk98lin/skgesirq.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skgesirq.c Wed Jul 4 16:03:56 2001 @@ -2,16 +2,15 @@ * * Name: skgesirq.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.49 $ - * Date: $Date: 1999/12/17 11:02:50 $ + * Version: $Revision: 1.65 $ + * Date: $Date: 2001/02/23 13:41:51 $ * Purpose: Special IRQ module * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2000 SysKonnect GmbH. * * 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 @@ -27,6 +26,56 @@ * History: * * $Log: skgesirq.c,v $ + * Revision 1.65 2001/02/23 13:41:51 gklug + * fix: PHYS2INST should be used correctly for Dual Net operation + * chg: do no longer work with older PNMI + * + * Revision 1.64 2001/02/15 11:27:04 rassmann + * Working with RLMT v1 if SK_MAX_NETS undefined. + * + * Revision 1.63 2001/02/06 10:44:23 mkunz + * - NetIndex added to interface functions of pnmi V4 with dual net support + * + * Revision 1.62 2001/01/31 15:31:41 gklug + * fix: problem with autosensing an SR8800 switch + * + * Revision 1.61 2000/11/09 11:30:09 rassmann + * WA: Waiting after releasing reset until BCom chip is accessible. + * + * Revision 1.60 2000/10/18 12:37:48 cgoos + * Reinserted the comment for version 1.56. + * + * Revision 1.59 2000/10/18 12:22:20 cgoos + * Added workaround for half duplex hangup. + * + * Revision 1.58 2000/09/28 13:06:04 gklug + * fix: BCOM may NOT be touched if XMAC is in RESET state + * + * Revision 1.57 2000/09/08 12:38:39 cgoos + * Added forgotten variable declaration. + * + * Revision 1.56 2000/09/08 08:12:13 cgoos + * Changed handling of parity errors in SkGeHwErr (correct reset of error). + * + * Revision 1.55 2000/06/19 08:36:25 cgoos + * Changed comment. + * + * Revision 1.54 2000/05/22 08:45:57 malthoff + * Fix: #10523 is valid for all BCom PHYs. + * + * Revision 1.53 2000/05/19 10:20:30 cgoos + * Removed Solaris debug output code. + * + * Revision 1.52 2000/05/19 10:19:37 cgoos + * Added PHY state check in HWLinkDown. + * Move PHY interrupt code to IS_EXT_REG case in SkGeSirqIsr. + * + * Revision 1.51 2000/05/18 05:56:20 cgoos + * Fixed typo. + * + * Revision 1.50 2000/05/17 12:49:49 malthoff + * Fixes BCom link bugs (#10523). + * * Revision 1.49 1999/12/17 11:02:50 gklug * fix: read PHY_STAT of Broadcom chip more often to assure good status * @@ -197,39 +246,38 @@ * ******************************************************************************/ - /* - Special Interrupt handler - - The following abstract should show how this module is included - in the driver path: - - In the ISR of the driver the bits for frame transmission complete and - for receive complete are checked and handled by the driver itself. - The bits of the slow path mask are checked after this and then the - entry into the so-called "slow path" is prepared. It is an implemetors - decision whether this is executed directly or just scheduled by - disabling the mask. In the interrupt service routine events may be - generated, so it would be a good idea to call the EventDispatcher - right after this ISR. - - The Interrupt service register of the adapter is NOT read by this - module. SO if the drivers implemetor needs a while loop around the - slow data paths Interrupt bits, he needs to call the SkGeIsr() for - each loop entered. - - However, the XMAC Interrupt status registers are read in a while loop. - -*/ + * Special Interrupt handler + * + * The following abstract should show how this module is included + * in the driver path: + * + * In the ISR of the driver the bits for frame transmission complete and + * for receive complete are checked and handled by the driver itself. + * The bits of the slow path mask are checked after this and then the + * entry into the so-called "slow path" is prepared. It is an implemetors + * decision whether this is executed directly or just scheduled by + * disabling the mask. In the interrupt service routine events may be + * generated, so it would be a good idea to call the EventDispatcher + * right after this ISR. + * + * The Interrupt service register of the adapter is NOT read by this + * module. SO if the drivers implemetor needs a while loop around the + * slow data paths Interrupt bits, he needs to call the SkGeIsr() for + * each loop entered. + * + * However, the XMAC Interrupt status registers are read in a while loop. + * + */ + static const char SysKonnectFileId[] = - "$Id: skgesirq.c,v 1.49 1999/12/17 11:02:50 gklug Exp $" ; + "$Id: skgesirq.c,v 1.65 2001/02/23 13:41:51 gklug Exp $" ; #include "h/skdrv1st.h" /* Driver Specific Definitions */ #include "h/skgepnmi.h" /* PNMI Definitions */ #include "h/skrlmt.h" /* RLMT Definitions */ #include "h/skdrv2nd.h" /* Adapter Control- and Driver specific Def. */ - /* local function prototypes */ static int SkGePortCheckUpXmac(SK_AC*, SK_IOC, int); static int SkGePortCheckUpBcom(SK_AC*, SK_IOC, int); @@ -238,21 +286,31 @@ static void SkPhyIsrBcom(SK_AC*, SK_IOC, int, SK_U16); static void SkPhyIsrLone(SK_AC*, SK_IOC, int, SK_U16); +/* + * Define an array of RX counter which are checked + * in AutoSense mode to check whether a link is not able to autonegotiate. + */ +static const SK_U32 SkGeRxOids[]= { + OID_SKGE_STAT_RX_64, + OID_SKGE_STAT_RX_127, + OID_SKGE_STAT_RX_255, + OID_SKGE_STAT_RX_511, + OID_SKGE_STAT_RX_1023, + OID_SKGE_STAT_RX_MAX, +} ; #ifdef __C2MAN__ /* - Special IRQ function - - General Description: - + * Special IRQ function + * + * General Description: + * */ intro() {} #endif -/* - * Define return codes of SkGePortCheckUp and CheckShort - */ +/* Define return codes of SkGePortCheckUp and CheckShort. */ #define SK_HW_PS_NONE 0 /* No action needed */ #define SK_HW_PS_RESTART 1 /* Restart needed */ #define SK_HW_PS_LINK 2 /* Link Up actions needed */ @@ -268,13 +326,13 @@ * */ void SkHWInitDefSense( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* IO context */ int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - pPrt = &pAC->GIni.GP[Port] ; + pPrt = &pAC->GIni.GP[Port]; pPrt->PAutoNegTimeOut = 0; @@ -283,15 +341,16 @@ return; } - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, ("AutoSensing: First mode %d on Port %d\n", - (int) SK_LMODE_AUTOFULL, + (int)SK_LMODE_AUTOFULL, Port)); pPrt->PLinkMode = SK_LMODE_AUTOFULL; return; -} +} /* SkHWInitDefSense */ + /****************************************************************************** * @@ -304,29 +363,30 @@ * */ SK_U8 SkHWSenseGetNext( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* IO context */ int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - pPrt = &pAC->GIni.GP[Port] ; + pPrt = &pAC->GIni.GP[Port]; pPrt->PAutoNegTimeOut = 0; if (pPrt->PLinkModeConf != SK_LMODE_AUTOSENSE) { /* Leave all as configured */ - return(pPrt->PLinkModeConf); + return (pPrt->PLinkModeConf); } if (pPrt->PLinkMode == SK_LMODE_AUTOFULL) { /* Return next mode AUTOBOTH */ - return(SK_LMODE_AUTOBOTH); + return (SK_LMODE_AUTOBOTH); } /* Return default autofull */ - return(SK_LMODE_AUTOFULL); -} + return (SK_LMODE_AUTOFULL); +} /* SkHWSenseGetNext */ + /****************************************************************************** * @@ -341,12 +401,12 @@ void SkHWSenseSetNext( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U8 NewMode) /* New Mode to be written in sense mode */ { SK_GEPORT *pPrt; - pPrt = &pAC->GIni.GP[Port] ; + pPrt = &pAC->GIni.GP[Port]; pPrt->PAutoNegTimeOut = 0; @@ -354,13 +414,13 @@ return; } - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, - ("AutoSensing: next mode %d on Port %d\n", (int) NewMode, - Port)); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, + ("AutoSensing: next mode %d on Port %d\n", (int)NewMode, Port)); pPrt->PLinkMode = NewMode; return; -} +} /* SkHWSenseSetNext */ + /****************************************************************************** * @@ -375,38 +435,44 @@ void SkHWLinkDown( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; SK_U16 Word; - pPrt = &pAC->GIni.GP[Port] ; + pPrt = &pAC->GIni.GP[Port]; - /* Disable all XMAC interrupts */ + /* Disable all XMAC interrupts. */ XM_OUT16(IoC, Port, XM_IMSK, 0xffff); - /* Disable Receive and Transmitter */ + /* Disable Receiver and Transmitter. */ XM_IN16(IoC, Port, XM_MMU_CMD, &Word); - XM_OUT16(IoC, Port, XM_MMU_CMD, Word & ~(XM_MMU_ENA_RX|XM_MMU_ENA_TX)); + XM_OUT16(IoC, Port, XM_MMU_CMD, Word & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); - /* disable all PHY interrupts */ - switch (pAC->GIni.GP[Port].PhyType) { + /* Disable all PHY interrupts. */ + switch (pPrt->PhyType) { case SK_PHY_BCOM: - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, - 0xffff); + /* Make sure that PHY is initialized. */ + if (pAC->GIni.GP[Port].PState) { + /* NOT allowed if BCOM is in RESET state */ + /* Workaround BCOM Errata (#10523) all BCom. */ + /* Disable Power Management if link is down. */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, &Word); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, + Word | PHY_B_AC_DIS_PM); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, 0xffff); + } break; case SK_PHY_LONE: - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, - 0x0); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, 0x0); break; case SK_PHY_NAT: /* todo: National - PHY_WRITE(IoC, pPrt, Port, PHY_NAT_INT_MASK, - 0xffff); */ + PHY_WRITE(IoC, pPrt, Port, PHY_NAT_INT_MASK, 0xffff); */ break; } - /* Init default sense mode */ + /* Init default sense mode. */ SkHWInitDefSense(pAC, IoC, Port); if (!pPrt->PHWLinkUp) { @@ -416,27 +482,25 @@ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, ("Link down Port %d\n", Port)); - /* Set Link to DOWN */ + /* Set Link to DOWN. */ pPrt->PHWLinkUp = SK_FALSE; /* Reset Port stati */ pPrt->PLinkModeStatus = SK_LMODE_STAT_UNKNOWN; - pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE ; + pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE; /* - * Reinit Phy especially when the AutoSense default is set now + * Reinit Phy especially when the AutoSense default is set now. */ SkXmInitPhy(pAC, IoC, Port, SK_FALSE); - /* - * GP0: used for workaround of Rev. C - * Errata 2 - */ + /* GP0: used for workaround of Rev. C Errata 2. */ + + /* Do NOT signal to RLMT. */ - /* Do NOT signal to RLMT */ + /* Do NOT start the timer here. */ +} /* SkHWLinkDown */ - /* Do NOT start the timer here */ -} /****************************************************************************** * @@ -449,21 +513,21 @@ * */ void SkHWLinkUp( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* IO context */ int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - pPrt = &pAC->GIni.GP[Port] ; + pPrt = &pAC->GIni.GP[Port]; if (pPrt->PHWLinkUp) { /* We do NOT need to proceed on active link */ return; } - pPrt->PHWLinkUp = SK_TRUE ; - pPrt->PAutoNegFail = SK_FALSE ; + pPrt->PHWLinkUp = SK_TRUE; + pPrt->PAutoNegFail = SK_FALSE; pPrt->PLinkModeStatus = SK_LMODE_STAT_UNKNOWN; if (pPrt->PLinkMode != SK_LMODE_AUTOHALF && @@ -476,17 +540,19 @@ /* Set Link Mode */ if (pPrt->PLinkMode == SK_LMODE_FULL) { pPrt->PLinkModeStatus = SK_LMODE_STAT_FULL; - } else { + } + else { pPrt->PLinkModeStatus = SK_LMODE_STAT_HALF; } /* No flow control without autonegotiation */ - pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE ; + pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE; /* RX/TX enable */ SkXmRxTxEnable(pAC, IoC, Port); } -} +} /* SkHWLinkUp */ + /****************************************************************************** * @@ -494,27 +560,28 @@ * */ static void SkMacParity( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* IO context */ +SK_AC *pAC, /* adapter context */ +SK_IOC IoC, /* IO context */ int Port) /* Port Index of the port failed */ { SK_EVPARA Para; SK_GEPORT *pPrt; /* GIni Port struct pointer */ SK_U64 TxMax; /* TxMax Counter */ - unsigned int Len; + unsigned Len; pPrt = &pAC->GIni.GP[Port]; /* Clear IRQ */ - SK_OUT16(IoC, MR_ADDR(Port,TX_MFF_CTRL1), MFF_CLR_PERR) ; + SK_OUT16(IoC, MR_ADDR(Port,TX_MFF_CTRL1), MFF_CLR_PERR); if (pPrt->PCheckPar) { if (Port == MAC_1) { SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E016, - SKERR_SIRQ_E016MSG) ; - } else { + SKERR_SIRQ_E016MSG); + } + else { SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E017, - SKERR_SIRQ_E017MSG) ; + SKERR_SIRQ_E017MSG); } Para.Para64 = Port; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); @@ -524,17 +591,18 @@ return; } - /* Check whether frames with a size of 1k were sent */ Len = sizeof(SK_U64); - SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_TX_MAX, (char *) &TxMax, - &Len, (SK_U32) SK_PNMI_PORT_PHYS2INST(Port)); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_TX_MAX, (char *)&TxMax, + &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); if (TxMax > 0) { /* From now on check the parity */ pPrt->PCheckPar = SK_TRUE; } -} +} /* SkMacParity */ + /****************************************************************************** * @@ -550,17 +618,22 @@ SK_U32 HwStatus) /* Interrupt status word */ { SK_EVPARA Para; + SK_U16 Word; - if (HwStatus & IS_IRQ_STAT) { - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E013, - SKERR_SIRQ_E013MSG) ; - Para.Para64 = 0; - SkEventQueue(pAC, SKGE_DRV, SK_DRV_ADAP_FAIL, Para); - } + if ((HwStatus & IS_IRQ_MST_ERR) || (HwStatus & IS_IRQ_STAT)) { + if (HwStatus & IS_IRQ_STAT) { + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E013, SKERR_SIRQ_E013MSG); + } + else { + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E012, SKERR_SIRQ_E012MSG); + } + + /* Reset all bits in the PCI STATUS register */ + SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_ON); + SK_IN16(IoC, PCI_C(PCI_STATUS), &Word); + SK_OUT16(IoC, PCI_C(PCI_STATUS), Word | PCI_ERRBITS); + SK_OUT8(IoC, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - if (HwStatus & IS_IRQ_MST_ERR) { - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E012, - SKERR_SIRQ_E012MSG) ; Para.Para64 = 0; SkEventQueue(pAC, SKGE_DRV, SK_DRV_ADAP_FAIL, Para); } @@ -568,57 +641,54 @@ if (HwStatus & IS_NO_STAT_M1) { /* Ignore it */ /* This situation is also indicated in the descriptor */ - SK_OUT16(IoC, MR_ADDR(MAC_1,RX_MFF_CTRL1), MFF_CLR_INSTAT) ; + SK_OUT16(IoC, MR_ADDR(MAC_1,RX_MFF_CTRL1), MFF_CLR_INSTAT); } if (HwStatus & IS_NO_STAT_M2) { /* Ignore it */ /* This situation is also indicated in the descriptor */ - SK_OUT16(IoC, MR_ADDR(MAC_2,RX_MFF_CTRL1), MFF_CLR_INSTAT) ; + SK_OUT16(IoC, MR_ADDR(MAC_2,RX_MFF_CTRL1), MFF_CLR_INSTAT); } if (HwStatus & IS_NO_TIST_M1) { /* Ignore it */ /* This situation is also indicated in the descriptor */ - SK_OUT16(IoC, MR_ADDR(MAC_1,RX_MFF_CTRL1), MFF_CLR_INTIST) ; + SK_OUT16(IoC, MR_ADDR(MAC_1,RX_MFF_CTRL1), MFF_CLR_INTIST); } if (HwStatus & IS_NO_TIST_M2) { /* Ignore it */ /* This situation is also indicated in the descriptor */ - SK_OUT16(IoC, MR_ADDR(MAC_2,RX_MFF_CTRL1), MFF_CLR_INTIST) ; + SK_OUT16(IoC, MR_ADDR(MAC_2,RX_MFF_CTRL1), MFF_CLR_INTIST); } if (HwStatus & IS_RAM_RD_PAR) { - SK_OUT16(IoC, B3_RI_CTRL, RI_CLR_RD_PERR) ; - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E014, - SKERR_SIRQ_E014MSG) ; + SK_OUT16(IoC, B3_RI_CTRL, RI_CLR_RD_PERR); + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E014, SKERR_SIRQ_E014MSG); Para.Para64 = 0; SkEventQueue(pAC, SKGE_DRV, SK_DRV_ADAP_FAIL, Para); } if (HwStatus & IS_RAM_WR_PAR) { - SK_OUT16(IoC, B3_RI_CTRL, RI_CLR_WR_PERR) ; - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E015, - SKERR_SIRQ_E015MSG) ; + SK_OUT16(IoC, B3_RI_CTRL, RI_CLR_WR_PERR); + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E015, SKERR_SIRQ_E015MSG); Para.Para64 = 0; SkEventQueue(pAC, SKGE_DRV, SK_DRV_ADAP_FAIL, Para); } if (HwStatus & IS_M1_PAR_ERR) { - SkMacParity(pAC, IoC, MAC_1) ; + SkMacParity(pAC, IoC, MAC_1); } if (HwStatus & IS_M2_PAR_ERR) { - SkMacParity(pAC, IoC, MAC_2) ; + SkMacParity(pAC, IoC, MAC_2); } if (HwStatus & IS_R1_PAR_ERR) { /* Clear IRQ */ - SK_OUT32(IoC, B0_R1_CSR, CSR_IRQ_CL_P) ; + SK_OUT32(IoC, B0_R1_CSR, CSR_IRQ_CL_P); - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E018, - SKERR_SIRQ_E018MSG) ; + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E018, SKERR_SIRQ_E018MSG); Para.Para64 = MAC_1; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_1; @@ -627,17 +697,16 @@ if (HwStatus & IS_R2_PAR_ERR) { /* Clear IRQ */ - SK_OUT32(IoC, B0_R2_CSR, CSR_IRQ_CL_P) ; + SK_OUT32(IoC, B0_R2_CSR, CSR_IRQ_CL_P); - SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E019, - SKERR_SIRQ_E019MSG) ; + SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E019, SKERR_SIRQ_E019MSG); Para.Para64 = MAC_2; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_2; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_LINK_DOWN, Para); } +} /* SkGeHwErr */ -} /****************************************************************************** * @@ -652,13 +721,13 @@ SK_IOC IoC, /* IO context */ SK_U32 Istatus) /* Interrupt status word */ { - SK_U32 RegVal32; /* Read register Value */ SK_EVPARA Para; + SK_U32 RegVal32; /* Read register Value */ SK_U16 XmIsr; if (Istatus & IS_HW_ERR) { - SK_IN32(IoC, B0_HWE_ISRC, &RegVal32) ; - SkGeHwErr(pAC, IoC, RegVal32) ; + SK_IN32(IoC, B0_HWE_ISRC, &RegVal32); + SkGeHwErr(pAC, IoC, RegVal32); } /* @@ -666,41 +735,101 @@ */ /* Check whether XMACs are correctly initialized */ if ((Istatus & (IS_PA_TO_RX1 | IS_PA_TO_TX1)) && - !pAC->GIni.GP[MAC_1].PState) { - /* XMAC was not initialized but Packet timeout occured */ + !pAC->GIni.GP[MAC_1].PState) { + /* XMAC was not initialized but Packet timeout occurred */ SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E004, - SKERR_SIRQ_E004MSG) ; + SKERR_SIRQ_E004MSG); } if ((Istatus & (IS_PA_TO_RX2 | IS_PA_TO_TX2)) && !pAC->GIni.GP[MAC_2].PState) { - /* XMAC was not initialized but Packet timeout occured */ + /* XMAC was not initialized but Packet timeout occurred */ SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E005, - SKERR_SIRQ_E005MSG) ; + SKERR_SIRQ_E005MSG); } if (Istatus & IS_PA_TO_RX1) { /* Means network is filling us up */ SK_ERR_LOG(pAC, SK_ERRCL_HW | SK_ERRCL_INIT, SKERR_SIRQ_E002, - SKERR_SIRQ_E002MSG) ; - SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_RX1) ; + SKERR_SIRQ_E002MSG); + SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_RX1); } if (Istatus & IS_PA_TO_RX2) { /* Means network is filling us up */ SK_ERR_LOG(pAC, SK_ERRCL_HW | SK_ERRCL_INIT, SKERR_SIRQ_E003, - SKERR_SIRQ_E003MSG) ; - SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_RX2) ; + SKERR_SIRQ_E003MSG); + SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_RX2); } if (Istatus & IS_PA_TO_TX1) { + unsigned int Len; + SK_U64 Octets; + SK_GEPORT *pPrt = &pAC->GIni.GP[0]; + /* May be a normal situation in a server with a slow network */ - SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_TX1) ; + SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_TX1); + + /* + * workaround: if in half duplex mode, check for tx hangup. + * Read number of TX'ed bytes, wait for 10 ms, then compare + * the number with current value. If nothing changed, we + * assume that tx is hanging and do a FIFO flush (see event + * routine). + */ + if ((pPrt->PLinkModeStatus == SK_LMODE_STAT_HALF || + pPrt->PLinkModeStatus == SK_LMODE_STAT_AUTOHALF) && + !pPrt->HalfDupTimerActive) { + /* + * many more pack. arb. timeouts may come in between, + * we ignore those + */ + pPrt->HalfDupTimerActive = SK_TRUE; + + Len = sizeof(SK_U64); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_TX_OCTETS, (char *) &Octets, + &Len, (SK_U32) SK_PNMI_PORT_PHYS2INST(pAC, 0), + pAC->Rlmt.Port[0].Net->NetNumber); + pPrt->LastOctets = Octets; + Para.Para32[0] = 0; + SkTimerStart(pAC, IoC, + &pPrt->HalfDupChkTimer, + SK_HALFDUP_CHK_TIME, + SKGE_HWAC, + SK_HWEV_HALFDUP_CHK, + Para); + } } if (Istatus & IS_PA_TO_TX2) { + unsigned int Len; + SK_U64 Octets; + SK_GEPORT *pPrt = &pAC->GIni.GP[1]; + /* May be a normal situation in a server with a slow network */ - SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_TX2) ; + SK_OUT16(IoC, B3_PA_CTRL, PA_CLR_TO_TX2); + + /* + * workaround: see above + */ + if ((pPrt->PLinkModeStatus == SK_LMODE_STAT_HALF || + pPrt->PLinkModeStatus == SK_LMODE_STAT_AUTOHALF) && + !pPrt->HalfDupTimerActive) { + pPrt->HalfDupTimerActive = SK_TRUE; + + Len = sizeof(SK_U64); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_TX_OCTETS, (char *) &Octets, + &Len, (SK_U32) SK_PNMI_PORT_PHYS2INST(pAC, 1), + pAC->Rlmt.Port[1].Net->NetNumber); + pPrt->LastOctets = Octets; + Para.Para32[0] = 1; + SkTimerStart(pAC, IoC, + &pPrt->HalfDupChkTimer, + SK_HALFDUP_CHK_TIME, + SKGE_HWAC, + SK_HWEV_HALFDUP_CHK, + Para); + } } /* @@ -708,9 +837,9 @@ */ if (Istatus & IS_R1_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_R1_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_R1_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E006, - SKERR_SIRQ_E006MSG) ; + SKERR_SIRQ_E006MSG); Para.Para64 = MAC_1; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_1; @@ -719,9 +848,9 @@ if (Istatus & IS_R2_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_R2_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_R2_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E007, - SKERR_SIRQ_E007MSG) ; + SKERR_SIRQ_E007MSG); Para.Para64 = MAC_2; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_2; @@ -730,9 +859,9 @@ if (Istatus & IS_XS1_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_XS1_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_XS1_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E008, - SKERR_SIRQ_E008MSG) ; + SKERR_SIRQ_E008MSG); Para.Para64 = MAC_1; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_1; @@ -741,9 +870,9 @@ if (Istatus & IS_XA1_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_XA1_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_XA1_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E009, - SKERR_SIRQ_E009MSG) ; + SKERR_SIRQ_E009MSG); Para.Para64 = MAC_1; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_1; @@ -752,9 +881,9 @@ if (Istatus & IS_XS2_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_XS2_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_XS2_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E010, - SKERR_SIRQ_E010MSG) ; + SKERR_SIRQ_E010MSG); Para.Para64 = MAC_2; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_2; @@ -763,9 +892,9 @@ if (Istatus & IS_XA2_C) { /* Clear IRQ */ - SK_OUT32(IoC, B0_XA2_CSR, CSR_IRQ_CL_C) ; + SK_OUT32(IoC, B0_XA2_CSR, CSR_IRQ_CL_C); SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E011, - SKERR_SIRQ_E011MSG) ; + SKERR_SIRQ_E011MSG); Para.Para64 = MAC_2; SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_FAIL, Para); Para.Para32[0] = MAC_2; @@ -773,55 +902,59 @@ } /* - * I2C Ready interrupt + * External reg interrupt. */ - if (Istatus & IS_I2C_READY) { + if (Istatus & IS_EXT_REG) { SK_U16 PhyInt; SK_U16 PhyIMsk; - SK_BOOL IsPhyInt = SK_FALSE; - int i; - /* test IRQs from PHY */ - for (i=0; iGIni.GIMacsFound; i++) { - switch (pAC->GIni.GP[i].PhyType) { + int i; + SK_GEPORT *pPrt; /* GIni Port struct pointer */ + + /* Test IRQs from PHY. */ + for (i = 0; i < pAC->GIni.GIMacsFound; i++) { + pPrt = &pAC->GIni.GP[i]; + switch (pPrt->PhyType) { case SK_PHY_XMAC: break; case SK_PHY_BCOM: - if(pAC->GIni.GP[i].PState) { - PHY_READ(IoC, &pAC->GIni.GP[i], i, - PHY_BCOM_INT_STAT, &PhyInt); - PHY_READ(IoC, &pAC->GIni.GP[i], i, - PHY_BCOM_INT_MASK, &PhyIMsk); + if (pPrt->PState) { + PHY_READ(IoC, pPrt, i, PHY_BCOM_INT_STAT, &PhyInt); + PHY_READ(IoC, pPrt, i, PHY_BCOM_INT_MASK, &PhyIMsk); + +#ifdef xDEBUG + if (PhyInt & PhyIMsk) { + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "SirqIsr - Stat: %x", + (void *)PhyInt, + (void *)NULL); + } +#endif /* DEBUG */ - if (PhyInt & (~PhyIMsk)) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM, + if (PhyInt & ~PhyIMsk) { + SK_DBG_MSG( + pAC, + SK_DBGMOD_HWM, SK_DBGCAT_IRQ, - ("Port %d Bcom Int: %x " - " Mask: %x\n", - i, PhyInt, PhyIMsk)); - SkPhyIsrBcom(pAC, IoC, i, - (SK_U16) - (PhyInt & (~PhyIMsk))); - IsPhyInt = SK_TRUE; + ("Port %d Bcom Int: %x Mask: %x\n", + i, PhyInt, PhyIMsk)); + SkPhyIsrBcom(pAC, IoC, i, PhyInt); } } - else { - } break; case SK_PHY_LONE: - PHY_READ(IoC, &pAC->GIni.GP[i], i, - PHY_LONE_INT_STAT, &PhyInt); - PHY_READ(IoC, &pAC->GIni.GP[i], i, - PHY_LONE_INT_ENAB, &PhyIMsk); + PHY_READ(IoC, pPrt, i, PHY_LONE_INT_STAT, &PhyInt); + PHY_READ(IoC, pPrt, i, PHY_LONE_INT_ENAB, &PhyIMsk); if (PhyInt & PhyIMsk) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM, + SK_DBG_MSG( + pAC, + SK_DBGMOD_HWM, SK_DBGCAT_IRQ, - ("Port %d Lone Int: %x " - " Mask: %x\n", + ("Port %d Lone Int: %x Mask: %x\n", i, PhyInt, PhyIMsk)); - SkPhyIsrLone(pAC, IoC, i, - (SK_U16) (PhyInt & PhyIMsk)); - IsPhyInt = SK_TRUE; + SkPhyIsrLone(pAC, IoC, i, PhyInt); } break; case SK_PHY_NAT: @@ -829,9 +962,13 @@ break; } } - if (!IsPhyInt) { - SkI2cIsr(pAC, IoC); - } + } + + /* + * I2C Ready interrupt + */ + if (Istatus & IS_I2C_READY) { + SkI2cIsr(pAC, IoC); } if (Istatus & IS_LNK_SYNC_M1) { @@ -840,12 +977,12 @@ * us only a link going down. */ /* clear interrupt */ - SK_OUT8(IoC, MR_ADDR(MAC_1,LNK_SYNC_CTRL), LED_CLR_IRQ); + SK_OUT8(IoC, MR_ADDR(MAC_1, LNK_SYNC_CTRL), LED_CLR_IRQ); } /* Check MAC after link sync counter */ if (Istatus & IS_MAC1) { - XM_IN16(IoC, MAC_1, XM_ISRC, &XmIsr) ; + XM_IN16(IoC, MAC_1, XM_ISRC, &XmIsr); SkXmIrq(pAC, IoC, MAC_1, XmIsr); } @@ -860,7 +997,7 @@ /* Check MAC after link sync counter */ if (Istatus & IS_MAC2) { - XM_IN16(IoC, MAC_2, XM_ISRC, &XmIsr) ; + XM_IN16(IoC, MAC_2, XM_ISRC, &XmIsr); SkXmIrq(pAC, IoC, MAC_2, XmIsr); } @@ -871,20 +1008,9 @@ if (Istatus & IS_TIMINT) { SkHwtIsr(pAC, IoC); } -} +} /* SkGeSirqIsr */ + -/* - * Define an array of RX counter which are checked - * in AutoSense mode to check whether a link is not able to autonegotiate. - */ -static const SK_U32 SkGeRxOids[]= { - OID_SKGE_STAT_RX_64, - OID_SKGE_STAT_RX_127, - OID_SKGE_STAT_RX_255, - OID_SKGE_STAT_RX_511, - OID_SKGE_STAT_RX_1023, - OID_SKGE_STAT_RX_MAX, -} ; /****************************************************************************** * * SkGePortCheckShorts - Implementing of the Workaround Errata # 2 @@ -894,19 +1020,19 @@ * 1 Restart needed on this port */ int SkGePortCheckShorts( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +int Port) /* Which port should be checked */ { - SK_U64 Shorts; /* Short Event Counter */ + SK_U64 Shorts; /* Short Event Counter */ SK_U64 CheckShorts; /* Check value for Short Event Counter */ - SK_U64 RxCts; /* RX Counter (packets on network) */ - SK_U64 RxTmp; /* RX temp. Counter */ - SK_U64 FcsErrCts; /* FCS Error Counter */ - SK_GEPORT *pPrt; /* GIni Port struct pointer */ - unsigned int Len; - int Rtv; /* Return value */ - int i; + SK_U64 RxCts; /* RX Counter (packets on network) */ + SK_U64 RxTmp; /* RX temp. Counter */ + SK_U64 FcsErrCts; /* FCS Error Counter */ + SK_GEPORT *pPrt; /* GIni Port struct pointer */ + unsigned Len; + int Rtv; /* Return value */ + int i; pPrt = &pAC->GIni.GP[Port]; @@ -917,8 +1043,9 @@ * Extra precaution: check for short Event counter */ Len = sizeof(SK_U64); - SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_RX_SHORTS, (char *) &Shorts, - &Len, (SK_U32) SK_PNMI_PORT_PHYS2INST(Port)); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_RX_SHORTS, (char *)&Shorts, + &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); /* * Read RX counter (packets seen on the network and not neccesarily @@ -927,9 +1054,10 @@ Len = sizeof(SK_U64); RxCts = 0; - for (i = 0; i < sizeof(SkGeRxOids)/sizeof(SK_U32) ; i++) { - SkPnmiGetVar(pAC, IoC, SkGeRxOids[i], (char *) &RxTmp, - &Len, (SK_U32) SK_PNMI_PORT_PHYS2INST(Port)); + for (i = 0; i < sizeof(SkGeRxOids)/sizeof(SK_U32); i++) { + SkPnmiGetVar(pAC, IoC, SkGeRxOids[i], (char *)&RxTmp, + &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); RxCts += RxTmp; } @@ -944,19 +1072,20 @@ * Reset Link Restart counter */ pPrt->PLinkResCt = 0; + pPrt->PAutoNegTOCt = 0; /* If link is up check for 2 */ CheckShorts = 2; Len = sizeof(SK_U64); SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_RX_FCS, - (char *) &FcsErrCts, &Len, - (SK_U32) SK_PNMI_PORT_PHYS2INST(Port)); + (char *)&FcsErrCts, &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && pPrt->PLipaAutoNeg == SK_LIPA_UNKNOWN && (pPrt->PLinkMode == SK_LMODE_HALF || - pPrt->PLinkMode == SK_LMODE_FULL)) { + pPrt->PLinkMode == SK_LMODE_FULL)) { /* * This is autosensing and we are in the fallback * manual full/half duplex mode. @@ -968,8 +1097,9 @@ */ pPrt->PPrevFcs = FcsErrCts; pPrt->PPrevShorts = Shorts; - return(SK_HW_PS_RESTART); - } else { + return (SK_HW_PS_RESTART); + } + else { pPrt->PLipaAutoNeg = SK_LIPA_MANUAL; } } @@ -977,20 +1107,18 @@ if (((RxCts - pPrt->PPrevRx) > pPrt->PRxLim) || (!(FcsErrCts - pPrt->PPrevFcs))) { /* - * Note: The compare with zero above has to be done - * the way shown, otherwise the Linux driver will - * have a problem. + * Note: The compare with zero above has to be done the way shown, + * otherwise the Linux driver will have a problem. */ /* - * we received a bunch of frames or no - * CRC error occured on the network -> - * ok. + * We received a bunch of frames or no CRC error occurred on the + * network -> ok. */ pPrt->PPrevRx = RxCts; pPrt->PPrevFcs = FcsErrCts; pPrt->PPrevShorts = Shorts; - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } pPrt->PPrevFcs = FcsErrCts; @@ -998,7 +1126,7 @@ if ((Shorts - pPrt->PPrevShorts) > CheckShorts) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, ("Short Event Count Restart Port %d \n", Port)); Rtv = SK_HW_PS_RESTART; } @@ -1006,13 +1134,13 @@ pPrt->PPrevShorts = Shorts; pPrt->PPrevRx = RxCts; - return(Rtv); -} + return (Rtv); +} /* SkGePortCheckShorts*/ /****************************************************************************** * - * SkGePortCheckUp - Implementing of the Workaround Errata # 2 + * SkGePortCheckUp - Implementation of the Workaround for Errata #2 * * return: * 0 o.k. nothing needed @@ -1020,15 +1148,11 @@ * 2 Link came up */ int SkGePortCheckUp( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +int Port) /* Which port should be checked */ { - SK_GEPORT *pPrt; /* GIni Port struct pointer */ - - pPrt = &pAC->GIni.GP[Port]; - - switch (pPrt->PhyType) { + switch (pAC->GIni.GP[Port].PhyType) { case SK_PHY_XMAC: return (SkGePortCheckUpXmac(pAC, IoC, Port)); case SK_PHY_BCOM: @@ -1038,9 +1162,8 @@ case SK_PHY_NAT: return (SkGePortCheckUpNat(pAC, IoC, Port)); } - - return(SK_HW_PS_NONE) ; -} + return (SK_HW_PS_NONE); +} /* SkGePortCheckUp */ /****************************************************************************** @@ -1053,75 +1176,69 @@ * 2 Link came up */ static int SkGePortCheckUpXmac( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +int Port) /* Which port should be checked */ { + SK_U64 Shorts; /* Short Event Counter */ SK_GEPORT *pPrt; /* GIni Port struct pointer */ - SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ - SK_U16 Isrc; /* Interrupt source register */ + unsigned Len; + int Done; SK_U32 GpReg; /* General Purpose register value */ + SK_U16 Isrc; /* Interrupt source register */ SK_U16 IsrcSum; /* Interrupt source register sum */ SK_U16 LpAb; /* Link Partner Ability */ SK_U16 ResAb; /* Resolved Ability */ - SK_U64 Shorts; /* Short Event Counter */ - unsigned int Len; - SK_U8 NextMode; /* Next AutoSensing Mode */ SK_U16 ExtStat; /* Extended Status Register */ - int Done; + SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ + SK_U8 NextMode; /* Next AutoSensing Mode */ pPrt = &pAC->GIni.GP[Port]; if (pPrt->PHWLinkUp) { if (pPrt->PhyType != SK_PHY_XMAC) { - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } else { - return(SkGePortCheckShorts(pAC, IoC, Port)) ; + return (SkGePortCheckShorts(pAC, IoC, Port)); } } IsrcSum = pPrt->PIsave; pPrt->PIsave = 0; - /* Now wait for each ports link */ + /* Now wait for each port's link. */ if (pPrt->PLinkMode == SK_LMODE_HALF || pPrt->PLinkMode == SK_LMODE_FULL) { AutoNeg = SK_FALSE; - } else { + } + else { AutoNeg = SK_TRUE; } if (pPrt->PLinkBroken) { /* Link was broken */ - XM_IN32(IoC,Port,XM_GP_PORT, &GpReg) ; + XM_IN32(IoC,Port,XM_GP_PORT, &GpReg); if ((GpReg & XM_GP_INP_ASS) == 0) { /* The Link is in sync */ - XM_IN16(IoC,Port,XM_ISRC, &Isrc) ; + XM_IN16(IoC,Port,XM_ISRC, &Isrc); IsrcSum |= Isrc; SkXmAutoNegLipaXmac(pAC, IoC, Port, IsrcSum); if ((Isrc & XM_IS_INP_ASS) == 0) { /* It has been in sync since last Time */ /* Restart the PORT */ - - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, - ("Link in sync Restart Port %d\n", - Port)); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, + ("Link in sync Restart Port %d\n", Port)); - /* - * We now need to reinitialize the PrevSHorts - * counter. - */ + /* We now need to reinitialize the PrevShorts counter. */ Len = sizeof(SK_U64); - SkPnmiGetVar(pAC, IoC, - OID_SKGE_STAT_RX_SHORTS, - (char *) &Shorts, - &Len, - (SK_U32) SK_PNMI_PORT_PHYS2INST(Port)); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_RX_SHORTS, (char *)&Shorts, + &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); pPrt->PPrevShorts = Shorts; - pAC->GIni.GP[Port].PLinkBroken = SK_FALSE ; + pAC->GIni.GP[Port].PLinkBroken = SK_FALSE; /* * Link Restart Workaround: @@ -1136,61 +1253,60 @@ pAC->GIni.GP[Port].PLinkResCt ++; pPrt->PAutoNegTimeOut = 0; - if (pAC->GIni.GP[Port].PLinkResCt < - SK_MAX_LRESTART) { - return(SK_HW_PS_RESTART) ; + if (pAC->GIni.GP[Port].PLinkResCt < SK_MAX_LRESTART) { + return (SK_HW_PS_RESTART); } SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("Do NOT restart on Port %d %x %x\n", - Port, Isrc, IsrcSum)); + ("Do NOT restart on Port %d %x %x\n", Port, Isrc, IsrcSum)); pAC->GIni.GP[Port].PLinkResCt = 0; - } else { - pPrt->PIsave = (SK_U16) (IsrcSum & (XM_IS_AND)); + } + else { + pPrt->PIsave = (SK_U16)(IsrcSum & (XM_IS_AND)); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("Save Sync/nosync Port %d %x %x\n", - Port, Isrc, IsrcSum)); + ("Save Sync/nosync Port %d %x %x\n", Port, Isrc, IsrcSum)); + /* Do nothing more if link is broken */ - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } - } else { + } + else { /* Do nothing more if link is broken */ - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } - } else { + } + else { /* Link was not broken, check if it is */ - XM_IN16(IoC,Port,XM_ISRC, &Isrc) ; + XM_IN16(IoC, Port, XM_ISRC, &Isrc); IsrcSum |= Isrc; if ((Isrc & XM_IS_INP_ASS) == XM_IS_INP_ASS) { - XM_IN16(IoC,Port,XM_ISRC, &Isrc) ; + XM_IN16(IoC, Port, XM_ISRC, &Isrc); IsrcSum |= Isrc; if ((Isrc & XM_IS_INP_ASS) == XM_IS_INP_ASS) { - XM_IN16(IoC,Port,XM_ISRC, &Isrc) ; + XM_IN16(IoC, Port, XM_ISRC, &Isrc); IsrcSum |= Isrc; if ((Isrc & XM_IS_INP_ASS) == XM_IS_INP_ASS) { - pPrt->PLinkBroken = SK_TRUE ; + pPrt->PLinkBroken = SK_TRUE; /* * Re-Init Link partner Autoneg flag */ pPrt->PLipaAutoNeg = SK_LIPA_UNKNOWN; - SK_DBG_MSG(pAC,SK_DBGMOD_HWM, - SK_DBGCAT_IRQ, - ("Link broken Port %d\n", - Port)); + SK_DBG_MSG(pAC,SK_DBGMOD_HWM, SK_DBGCAT_IRQ, + ("Link broken Port %d\n", Port)); - /* cable removed-> reinit Sensemode */ - /* Init default sense mode */ + /* Cable removed-> reinit sense mode. */ + /* Init default sense mode. */ SkHWInitDefSense(pAC, IoC, Port); - return(SK_HW_PS_RESTART) ; + return (SK_HW_PS_RESTART); } } - } else { + } + else { SkXmAutoNegLipaXmac(pAC, IoC, Port, Isrc); - if (SkGePortCheckShorts(pAC, IoC, Port) == - SK_HW_PS_RESTART) { - return(SK_HW_PS_RESTART) ; + if (SkGePortCheckShorts(pAC, IoC, Port) == SK_HW_PS_RESTART) { + return (SK_HW_PS_RESTART); } } } @@ -1199,18 +1315,15 @@ * here we usually can check whether the link is in sync and * autonegotiation is done. */ - XM_IN32(IoC,Port,XM_GP_PORT, &GpReg) ; - XM_IN16(IoC,Port,XM_ISRC, &Isrc) ; + XM_IN32(IoC, Port, XM_GP_PORT, &GpReg); + XM_IN16(IoC, Port, XM_ISRC, &Isrc); IsrcSum |= Isrc; SkXmAutoNegLipaXmac(pAC, IoC, Port, IsrcSum); if ((GpReg & XM_GP_INP_ASS) != 0 || (IsrcSum & XM_IS_INP_ASS) != 0) { if ((GpReg & XM_GP_INP_ASS) == 0) { - /* - * Save Autonegotiation Done interrupt only if link - * is in sync - */ - pPrt->PIsave = (SK_U16) (IsrcSum & (XM_IS_AND)); + /* Save Autonegotiation Done interrupt only if link is in sync. */ + pPrt->PIsave = (SK_U16)(IsrcSum & (XM_IS_AND)); } #ifdef DEBUG if (pPrt->PIsave & (XM_IS_AND)) { @@ -1218,44 +1331,40 @@ ("AutoNeg done rescheduled Port %d\n", Port)); } #endif - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } if (AutoNeg) { if (IsrcSum & XM_IS_AND) { - SkHWLinkUp(pAC, IoC, Port) ; + SkHWLinkUp(pAC, IoC, Port); Done = SkXmAutoNegDone(pAC,IoC,Port); if (Done != SK_AND_OK) { /* Get PHY parameters, for debuging only */ - PHY_READ(IoC, pPrt, Port, PHY_XMAC_AUNE_LP, - &LpAb); - PHY_READ(IoC, pPrt, Port, PHY_XMAC_RES_ABI, - &ResAb); + PHY_READ(IoC, pPrt, Port, PHY_XMAC_AUNE_LP, &LpAb); + PHY_READ(IoC, pPrt, Port, PHY_XMAC_RES_ABI, &ResAb); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNeg FAIL Port %d (LpAb %x, ResAb %x)\n", Port, LpAb, ResAb)); /* Try next possible mode */ NextMode = SkHWSenseGetNext(pAC, IoC, Port); - SkHWLinkDown(pAC, IoC, Port) ; + SkHWLinkDown(pAC, IoC, Port); if (Done == SK_AND_DUP_CAP) { /* GoTo next mode */ - SkHWSenseSetNext(pAC, IoC, Port, - NextMode); + SkHWSenseSetNext(pAC, IoC, Port, NextMode); } - return(SK_HW_PS_RESTART) ; - - } else { + return (SK_HW_PS_RESTART); + } + else { /* - * Dummy Read extended status to prevent - * extra link down/ups + * Dummy Read extended status to prevent extra link down/ups * (clear Page Received bit if set) */ PHY_READ(IoC, pPrt, Port, PHY_XMAC_AUNE_EXP, &ExtStat); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNeg done Port %d\n", Port)); - return(SK_HW_PS_LINK) ; + return (SK_HW_PS_LINK); } } @@ -1265,7 +1374,12 @@ pPrt->PAutoNegTimeOut ++; if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) { /* - * Timeout occured. + * Increase the Timeout counter. + */ + pPrt->PAutoNegTOCt ++; + + /* + * Timeout occurred. * What do we need now? */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM, @@ -1275,42 +1389,57 @@ if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && pPrt->PLipaAutoNeg != SK_LIPA_AUTO) { /* - * Timeout occured + * Timeout occurred * Set Link manually up. */ - SkHWSenseSetNext(pAC, IoC, Port, - SK_LMODE_FULL); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM, - SK_DBGCAT_IRQ, - ("Set manual full duplex Port %d\n", - Port)); + SkHWSenseSetNext(pAC, IoC, Port, SK_LMODE_FULL); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, + ("Set manual full duplex Port %d\n", Port)); + } + + if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && + pPrt->PLipaAutoNeg == SK_LIPA_AUTO && + pPrt->PAutoNegTOCt >= SK_MAX_ANEG_TO) { + /* + * This is rather complicated. + * we need to check here whether the LIPA_AUTO + * we saw before is false alert. We saw at one + * switch ( SR8800) that on boot time it sends + * just one autoneg packet and does no further + * autonegotiation. + * Solution: we restart the autosensing after + * a few timeouts. + */ + pPrt->PAutoNegTOCt = 0; + pPrt->PLipaAutoNeg = SK_LIPA_UNKNOWN; + SkHWInitDefSense(pAC, IoC, Port); } /* * Do the restart */ - return(SK_HW_PS_RESTART) ; + return (SK_HW_PS_RESTART); } - } else { + } + else { /* * Link is up and we don't need more. */ #ifdef DEBUG if (pPrt->PLipaAutoNeg == SK_LIPA_AUTO) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("ERROR: Lipa auto detected on port %d\n", - Port)); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, + ("ERROR: Lipa auto detected on port %d\n", Port)); } #endif SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, ("Link sync(GP), Port %d\n", Port)); - SkHWLinkUp(pAC, IoC, Port) ; - return(SK_HW_PS_LINK) ; + SkHWLinkUp(pAC, IoC, Port); + return (SK_HW_PS_LINK); } - return(SK_HW_PS_NONE) ; -} + return (SK_HW_PS_NONE); +} /* SkGePortCheckUpXmac */ /****************************************************************************** @@ -1323,44 +1452,216 @@ * 2 Link came up */ static int SkGePortCheckUpBcom( -SK_AC *pAC, /* Adapters context */ -SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* IO Context */ +int Port) /* Which port should be checked */ { SK_GEPORT *pPrt; /* GIni Port struct pointer */ - SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ + int Done; SK_U16 Isrc; /* Interrupt source register */ - SK_U16 LpAb; /* Link Partner Ability */ - SK_U16 ExtStat; /* Extended Status Register */ SK_U16 PhyStat; /* Phy Status Register */ - int Done; - SK_U16 ResAb; + SK_U16 ResAb; /* Master/Slave resolution */ + SK_U16 Ctrl; /* Broadcom control flags */ +#ifdef DEBUG + SK_U16 LpAb; + SK_U16 ExtStat; +#endif /* DEBUG */ + SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ pPrt = &pAC->GIni.GP[Port]; + + /* Check for No HCD Link events (#10523) */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_INT_STAT, &Isrc); + +#ifdef xDEBUG + if ((Isrc & ~0x1800) == 0x70) { + SK_U32 Stat1, Stat2, Stat3; + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_INT_MASK, &Stat1); + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "CheckUp1 - Stat: %x, Mask: %x", + (void *)Isrc, + (void *)Stat1); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_CTRL, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_STAT, &Stat2); + Stat1 = Stat1 << 16 | Stat2; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_ADV, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_LP, &Stat3); + Stat2 = Stat2 << 16 | Stat3; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "Ctrl/Stat: %x, AN Adv/LP: %x", + (void *)Stat1, + (void *)Stat2); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_EXP, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_EXT_STAT, &Stat2); + Stat1 = Stat1 << 16 | Stat2; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_1000T_CTRL, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_1000T_STAT, &Stat3); + Stat2 = Stat2 << 16 | Stat3; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "AN Exp/IEEE Ext: %x, 1000T Ctrl/Stat: %x", + (void *)Stat1, + (void *)Stat2); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_P_EXT_CTRL, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_P_EXT_STAT, &Stat2); + Stat1 = Stat1 << 16 | Stat2; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUX_CTRL, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUX_STAT, &Stat3); + Stat2 = Stat2 << 16 | Stat3; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "PHY Ext Ctrl/Stat: %x, Aux Ctrl/Stat: %x", + (void *)Stat1, + (void *)Stat2); + } +#endif /* DEBUG */ + + if ((Isrc & (PHY_B_IS_NO_HDCL /* | PHY_B_IS_NO_HDC */)) != 0) { + /* + * Workaround BCOM Errata: + * enable and disable loopback mode if "NO HCD" occurs. + */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_CTRL, &Ctrl); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_CTRL, Ctrl | PHY_CT_LOOP); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_CTRL, Ctrl & ~PHY_CT_LOOP); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, + ("No HCD Link event, Port %d\n", Port)); +#ifdef xDEBUG + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "No HCD link event, port %d.", + (void *)Port, + (void *)NULL); +#endif /* DEBUG */ + } + + /* Not obsolete: link status bit is latched to 0 and autoclearing! */ PHY_READ(IoC, pPrt, Port, PHY_BCOM_STAT, &PhyStat); if (pPrt->PHWLinkUp) { - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } - pPrt->PIsave = 0; +#ifdef xDEBUG + { + SK_U32 Stat1, Stat2, Stat3; + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_INT_MASK, &Stat1); + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "CheckUp1a - Stat: %x, Mask: %x", + (void *)Isrc, + (void *)Stat1); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_CTRL, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_STAT, &PhyStat); + Stat1 = Stat1 << 16 | PhyStat; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_ADV, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_LP, &Stat3); + Stat2 = Stat2 << 16 | Stat3; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "Ctrl/Stat: %x, AN Adv/LP: %x", + (void *)Stat1, + (void *)Stat2); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUNE_EXP, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_EXT_STAT, &Stat2); + Stat1 = Stat1 << 16 | Stat2; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_1000T_CTRL, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_1000T_STAT, &ResAb); + Stat2 = Stat2 << 16 | ResAb; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "AN Exp/IEEE Ext: %x, 1000T Ctrl/Stat: %x", + (void *)Stat1, + (void *)Stat2); + + Stat1 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_P_EXT_CTRL, &Stat1); + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_P_EXT_STAT, &Stat2); + Stat1 = Stat1 << 16 | Stat2; + Stat2 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUX_CTRL, &Stat2); + Stat3 = 0; + PHY_READ(pAC, pPrt, Port, PHY_BCOM_AUX_STAT, &Stat3); + Stat2 = Stat2 << 16 | Stat3; + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "PHY Ext Ctrl/Stat: %x, Aux Ctrl/Stat: %x", + (void *)Stat1, + (void *)Stat2); + } +#endif /* DEBUG */ - /* Now wait for each port's link */ - if (pPrt->PLinkMode == SK_LMODE_HALF || - pPrt->PLinkMode == SK_LMODE_FULL) { + /* Now wait for each port's link. */ + if (pPrt->PLinkMode == SK_LMODE_HALF || pPrt->PLinkMode == SK_LMODE_FULL) { AutoNeg = SK_FALSE; - } else { + } + else { AutoNeg = SK_TRUE; } /* - * here we usually can check whether the link is in sync and + * Here we usually can check whether the link is in sync and * autonegotiation is done. */ - XM_IN16(IoC, Port, XM_ISRC, &Isrc) ; +#if 0 +/* RA;:;: obsolete */ + XM_IN16(IoC, Port, XM_ISRC, &Isrc); +#endif /* 0 */ PHY_READ(IoC, pPrt, Port, PHY_BCOM_STAT, &PhyStat); +#ifdef xDEBUG + if ((PhyStat & PHY_ST_LSYNC) >> 2 != (ExtStat & PHY_B_PES_LS) >> 8) { + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "PhyStat != ExtStat: %x %x", + (void *)PhyStat, + (void *)ExtStat); + } +#endif /* DEBUG */ + SkXmAutoNegLipaBcom(pAC, IoC, Port, PhyStat); SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, @@ -1368,28 +1669,22 @@ PHY_READ(IoC, pPrt, Port, PHY_BCOM_1000T_STAT, &ResAb); - if ((PhyStat & PHY_ST_LSYNC) == 0) { - if (ResAb & (PHY_B_1000S_MSF)) { - /* Error */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("Master/Slave Fault port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE; - pPrt->PMSStatus = SK_MS_STAT_FAULT; - return (SK_AND_OTHER); - } - return (SK_HW_PS_NONE); - } - - if (ResAb & (PHY_B_1000S_MSF)) { + if (ResAb & PHY_B_1000S_MSF) { /* Error */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("Master/Slave Fault port %d\n", Port)); pPrt->PAutoNegFail = SK_TRUE; pPrt->PMSStatus = SK_MS_STAT_FAULT; - return (SK_AND_OTHER); - } else if (ResAb & PHY_B_1000S_MSR) { + return (SK_HW_PS_RESTART); + } + + if ((PhyStat & PHY_ST_LSYNC) == 0) { + return (SK_HW_PS_NONE); + } + else if (ResAb & PHY_B_1000S_MSR) { pPrt->PMSStatus = SK_MS_STAT_MASTER; - } else { + } + else { pPrt->PMSStatus = SK_MS_STAT_SLAVE; } @@ -1399,76 +1694,73 @@ if (AutoNeg) { if (PhyStat & PHY_ST_AN_OVER) { SkHWLinkUp(pAC, IoC, Port); - Done = SkXmAutoNegDone(pAC,IoC,Port); + Done = SkXmAutoNegDone(pAC, IoC, Port); if (Done != SK_AND_OK) { - /* Get PHY parameters, for debuging only */ - PHY_READ(IoC, pPrt, Port, - PHY_BCOM_AUNE_LP, - &LpAb); - PHY_READ(IoC, pPrt, Port, - PHY_BCOM_1000T_STAT, - &ExtStat); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("AutoNeg FAIL Port %d (LpAb %x, " - "1000TStat %x)\n", - Port, LpAb, ExtStat)); - return(SK_HW_PS_RESTART) ; - - } else { - /* - * Dummy Read interrupt status to prevent - * extra link down/ups - */ - PHY_READ(IoC, pPrt, Port, PHY_BCOM_INT_STAT, - &ExtStat); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, +#ifdef DEBUG + /* Get PHY parameters, for debugging only. */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUNE_LP, &LpAb); + PHY_READ(IoC, pPrt, Port, PHY_BCOM_1000T_STAT, &ExtStat); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, + ("AutoNeg FAIL Port %d (LpAb %x, 1000TStat %x)\n", + Port, LpAb, ExtStat)); +#endif /* DEBUG */ + return (SK_HW_PS_RESTART); + } + else { +#ifdef xDEBUG + /* Dummy read ISR to prevent extra link downs/ups. */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_INT_STAT, &ExtStat); + + if ((ExtStat & ~0x1800) != 0) { + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "CheckUp2 - Stat: %x", + (void *)ExtStat, + (void *)NULL); + } +#endif /* DEBUG */ + + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("AutoNeg done Port %d\n", Port)); - return(SK_HW_PS_LINK) ; + return (SK_HW_PS_LINK); } } - } else { + } + else { /* !AutoNeg */ /* * Link is up and we don't need more. */ #ifdef DEBUG if (pPrt->PLipaAutoNeg == SK_LIPA_AUTO) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("ERROR: Lipa auto detected on port %d\n", - Port)); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, + ("ERROR: Lipa auto detected on port %d\n", Port)); } #endif -#if 0 - PHY_READ(IoC, pPrt, Port, PHY_BCOM_1000T_STAT, &ResAb); - if (ResAb & (PHY_B_1000S_MSF)) { - /* Error */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("Master/Slave Fault port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE; - pPrt->PMSStatus = SK_MS_STAT_FAULT; - return (SK_AND_OTHER); - } else if (ResAb & PHY_B_1000S_MSR) { - pPrt->PMSStatus = SK_MS_STAT_MASTER ; - } else { - pPrt->PMSStatus = SK_MS_STAT_SLAVE ; - } -#endif /* 0 */ - - - /* - * Dummy Read interrupt status to prevent - * extra link down/ups - */ +#ifdef xDEBUG + /* Dummy read ISR to prevent extra link downs/ups. */ PHY_READ(IoC, pPrt, Port, PHY_BCOM_INT_STAT, &ExtStat); + + if ((ExtStat & ~0x1800) != 0) { + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "CheckUp3 - Stat: %x", + (void *)ExtStat, + (void *)NULL); + } +#endif /* DEBUG */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, ("Link sync(GP), Port %d\n", Port)); - SkHWLinkUp(pAC, IoC, Port) ; - return(SK_HW_PS_LINK) ; + SkHWLinkUp(pAC, IoC, Port); + return (SK_HW_PS_LINK); } - return(SK_HW_PS_NONE) ; -} + return (SK_HW_PS_NONE); +} /* SkGePortCheckUpBcom */ + /****************************************************************************** * @@ -1480,24 +1772,24 @@ * 2 Link came up */ static int SkGePortCheckUpLone( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +int Port) /* Which port should be checked */ { SK_GEPORT *pPrt; /* GIni Port struct pointer */ - SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ + int Done; SK_U16 Isrc; /* Interrupt source register */ SK_U16 LpAb; /* Link Partner Ability */ - SK_U8 NextMode; /* Next AutoSensing Mode */ SK_U16 ExtStat; /* Extended Status Register */ SK_U16 PhyStat; /* Phy Status Register */ SK_U16 StatSum; - int Done; + SK_BOOL AutoNeg; /* Is Autonegotiation used ? */ + SK_U8 NextMode; /* Next AutoSensing Mode */ pPrt = &pAC->GIni.GP[Port]; if (pPrt->PHWLinkUp) { - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } StatSum = pPrt->PIsave; @@ -1507,7 +1799,8 @@ if (pPrt->PLinkMode == SK_LMODE_HALF || pPrt->PLinkMode == SK_LMODE_FULL) { AutoNeg = SK_FALSE; - } else { + } + else { AutoNeg = SK_TRUE; } @@ -1515,7 +1808,7 @@ * here we usually can check whether the link is in sync and * autonegotiation is done. */ - XM_IN16(IoC, Port, XM_ISRC, &Isrc) ; + XM_IN16(IoC, Port, XM_ISRC, &Isrc); PHY_READ(IoC, pPrt, Port, PHY_LONE_STAT, &PhyStat); StatSum |= PhyStat; @@ -1524,19 +1817,19 @@ /* * Save Autonegotiation Done bit */ - pPrt->PIsave = (SK_U16) (StatSum & PHY_ST_AN_OVER); + pPrt->PIsave = (SK_U16)(StatSum & PHY_ST_AN_OVER); #ifdef DEBUG if (pPrt->PIsave & PHY_ST_AN_OVER) { SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNeg done rescheduled Port %d\n", Port)); } #endif - return(SK_HW_PS_NONE) ; + return (SK_HW_PS_NONE); } if (AutoNeg) { if (StatSum & PHY_ST_AN_OVER) { - SkHWLinkUp(pAC, IoC, Port) ; + SkHWLinkUp(pAC, IoC, Port); Done = SkXmAutoNegDone(pAC,IoC,Port); if (Done != SK_AND_OK) { /* Get PHY parameters, for debuging only */ @@ -1546,31 +1839,30 @@ PHY_READ(IoC, pPrt, Port, PHY_LONE_1000T_STAT, &ExtStat); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("AutoNeg FAIL Port %d (LpAb %x, 1000TStat %x)\n", Port, LpAb, ExtStat)); /* Try next possible mode */ NextMode = SkHWSenseGetNext(pAC, IoC, Port); - SkHWLinkDown(pAC, IoC, Port) ; + SkHWLinkDown(pAC, IoC, Port); if (Done == SK_AND_DUP_CAP) { /* GoTo next mode */ - SkHWSenseSetNext(pAC, IoC, Port, - NextMode); + SkHWSenseSetNext(pAC, IoC, Port, NextMode); } - return(SK_HW_PS_RESTART) ; + return (SK_HW_PS_RESTART); - } else { + } + else { /* * Dummy Read interrupt status to prevent * extra link down/ups */ - PHY_READ(IoC, pPrt, Port, PHY_LONE_INT_STAT, - &ExtStat); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, + PHY_READ(IoC, pPrt, Port, PHY_LONE_INT_STAT, &ExtStat); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("AutoNeg done Port %d\n", Port)); - return(SK_HW_PS_LINK) ; + return (SK_HW_PS_LINK); } } @@ -1580,7 +1872,7 @@ pPrt->PAutoNegTimeOut ++; if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) { /* - * Timeout occured. + * Timeout occurred. * What do we need now? */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM, @@ -1590,7 +1882,7 @@ if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && pPrt->PLipaAutoNeg != SK_LIPA_AUTO) { /* - * Timeout occured + * Timeout occurred * Set Link manually up. */ SkHWSenseSetNext(pAC, IoC, Port, @@ -1604,17 +1896,17 @@ /* * Do the restart */ - return(SK_HW_PS_RESTART) ; + return (SK_HW_PS_RESTART); } - } else { + } + else { /* * Link is up and we don't need more. */ #ifdef DEBUG if (pPrt->PLipaAutoNeg == SK_LIPA_AUTO) { - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("ERROR: Lipa auto detected on port %d\n", - Port)); + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, + ("ERROR: Lipa auto detected on port %d\n", Port)); } #endif @@ -1624,14 +1916,14 @@ */ PHY_READ(IoC, pPrt, Port, PHY_LONE_INT_STAT, &ExtStat); - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_IRQ, + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, ("Link sync(GP), Port %d\n", Port)); - SkHWLinkUp(pAC, IoC, Port) ; - return(SK_HW_PS_LINK) ; + SkHWLinkUp(pAC, IoC, Port); + return (SK_HW_PS_LINK); } - return(SK_HW_PS_NONE) ; -} + return (SK_HW_PS_NONE); +} /* SkGePortCheckUpLone*/ /****************************************************************************** @@ -1644,13 +1936,13 @@ * 2 Link came up */ static int SkGePortCheckUpNat( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* IO Context */ -int Port) /* Which port should be checked */ +int Port) /* Which port should be checked */ { /* todo: National */ - return(SK_HW_PS_NONE) ; -} + return (SK_HW_PS_NONE); +} /* SkGePortCheckUpNat */ /****************************************************************************** @@ -1662,17 +1954,21 @@ * Notes: */ int SkGeSirqEvent( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* Io Context */ SK_U32 Event, /* Module specific Event */ SK_EVPARA Para) /* Event specific Parameter */ { - SK_U32 Port; - SK_U32 Time; - SK_U8 Val8 ; - int PortStat; + SK_U64 Octets; + SK_GEPORT *pPrt; /* GIni Port struct pointer */ + SK_U32 Port; + SK_U32 Time; + unsigned Len; + int PortStat; + SK_U8 Val8; Port = Para.Para32[0]; + pPrt = & pAC->GIni.GP[Port]; switch (Event) { case SK_HWEV_WATIM: @@ -1681,7 +1977,7 @@ switch (PortStat) { case SK_HW_PS_RESTART: - if (pAC->GIni.GP[Port].PHWLinkUp) { + if (pPrt->PHWLinkUp) { /* * Set Link to down. */ @@ -1691,16 +1987,7 @@ * Signal directly to RLMT to ensure correct * sequence of SWITCH and RESET event. */ - Para.Para32[0] = (SK_U32) Port; SkRlmtEvent(pAC, IoC, SK_RLMT_LINK_DOWN, Para); - - /* Start workaround Errata #2 timer */ - SkTimerStart(pAC, IoC, - &pAC->GIni.GP[Port].PWaTimer, - SK_WA_INA_TIME, - SKGE_HWAC, - SK_HWEV_WATIM, - Para); } /* Restart needed */ @@ -1713,39 +2000,38 @@ break; } - + /* Start again the check Timer */ - if (pAC->GIni.GP[Port].PHWLinkUp) { + if (pPrt->PHWLinkUp) { Time = SK_WA_ACT_TIME; - } else { + } + else { Time = SK_WA_INA_TIME; } - /* todo: still needed for non-Xmac-PHYs ??? */ - /* Start workaround Errata #2 timer */ - SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, Time, - SKGE_HWAC, SK_HWEV_WATIM, Para); - + /* Todo: still needed for non-XMAC PHYs??? */ + /* Start workaround Errata #2 timer. */ + SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, + Time, SKGE_HWAC, SK_HWEV_WATIM, Para); break; case SK_HWEV_PORT_START: - if (pAC->GIni.GP[Port].PHWLinkUp) { + if (pPrt->PHWLinkUp) { /* * Signal directly to RLMT to ensure correct * sequence of SWITCH and RESET event. */ - Para.Para32[0] = (SK_U32) Port; SkRlmtEvent(pAC, IoC, SK_RLMT_LINK_DOWN, Para); } - SkHWLinkDown(pAC, IoC, Port) ; + SkHWLinkDown(pAC, IoC, Port); /* Schedule Port RESET */ SkEventQueue(pAC, SKGE_DRV, SK_DRV_PORT_RESET, Para); /* Start workaround Errata #2 timer */ - SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, - SK_WA_INA_TIME,SKGE_HWAC,SK_HWEV_WATIM,Para); + SkTimerStart(pAC, IoC, &pPrt->PWaTimer, SK_WA_INA_TIME, + SKGE_HWAC, SK_HWEV_WATIM, Para); break; case SK_HWEV_PORT_STOP: @@ -1754,13 +2040,13 @@ * Signal directly to RLMT to ensure correct * sequence of SWITCH and RESET event. */ - Para.Para32[0] = (SK_U32) Port; SkRlmtEvent(pAC, IoC, SK_RLMT_LINK_DOWN, Para); } + /* Stop Workaround Timer */ - SkTimerStop(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer) ; + SkTimerStop(pAC, IoC, &pPrt->PWaTimer); - SkHWLinkDown(pAC, IoC, Port) ; + SkHWLinkDown(pAC, IoC, Port); break; case SK_HWEV_UPDATE_STAT: @@ -1769,18 +2055,18 @@ case SK_HWEV_CLEAR_STAT: /* We do NOT need to clear any statistics */ - for (Port = 0; Port < (SK_U32) pAC->GIni.GIMacsFound; Port++) { - pAC->GIni.GP[Port].PPrevRx = 0; - pAC->GIni.GP[Port].PPrevFcs = 0; - pAC->GIni.GP[Port].PPrevShorts = 0; + for (Port = 0; Port < (SK_U32)pAC->GIni.GIMacsFound; Port++) { + pPrt->PPrevRx = 0; + pPrt->PPrevFcs = 0; + pPrt->PPrevShorts = 0; } break; case SK_HWEV_SET_LMODE: - Val8 = (SK_U8) Para.Para32[1]; - if (pAC->GIni.GP[Port].PLinkModeConf != Val8) { + Val8 = (SK_U8)Para.Para32[1]; + if (pPrt->PLinkModeConf != Val8) { /* Set New link mode */ - pAC->GIni.GP[Port].PLinkModeConf = Val8; + pPrt->PLinkModeConf = Val8; /* Restart Port */ SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_PORT_STOP, Para); @@ -1789,10 +2075,10 @@ break; case SK_HWEV_SET_FLOWMODE: - Val8 = (SK_U8) Para.Para32[1]; - if (pAC->GIni.GP[Port].PFlowCtrlMode != Val8) { + Val8 = (SK_U8)Para.Para32[1]; + if (pPrt->PFlowCtrlMode != Val8) { /* Set New Flow Control mode */ - pAC->GIni.GP[Port].PFlowCtrlMode = Val8; + pPrt->PFlowCtrlMode = Val8; /* Restart Port */ SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_PORT_STOP, Para); @@ -1801,10 +2087,10 @@ break; case SK_HWEV_SET_ROLE: - Val8 = (SK_U8) Para.Para32[1]; - if (pAC->GIni.GP[Port].PMSMode != Val8) { + Val8 = (SK_U8)Para.Para32[1]; + if (pPrt->PMSMode != Val8) { /* Set New link mode */ - pAC->GIni.GP[Port].PMSMode = Val8; + pPrt->PMSMode = Val8; /* Restart Port */ SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_PORT_STOP, Para); @@ -1812,14 +2098,31 @@ } break; + case SK_HWEV_HALFDUP_CHK: + /* + * half duplex hangup workaround. See packet arbiter timeout + * interrupt for description + */ + pPrt->HalfDupTimerActive = SK_FALSE; + if (pPrt->PLinkModeStatus == SK_LMODE_STAT_HALF || + pPrt->PLinkModeStatus == SK_LMODE_STAT_AUTOHALF) { + Len = sizeof(SK_U64); + SkPnmiGetVar(pAC, IoC, OID_SKGE_STAT_TX_OCTETS, (char *)&Octets, + &Len, (SK_U32)SK_PNMI_PORT_PHYS2INST(pAC, Port), + pAC->Rlmt.Port[Port].Net->NetNumber); + if (pPrt->LastOctets == Octets) { + /* TX hanging, do a FIFO flush restarts it. */ + SkXmFlushTxFifo(pAC, IoC, Port); + } + } + break; default: - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_SIRQ_E001, - SKERR_SIRQ_E001MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_SIRQ_E001, SKERR_SIRQ_E001MSG); break; } - return(0) ; -} + return (0); +} /* SkGeSirqEvent */ /****************************************************************************** @@ -1831,17 +2134,20 @@ * Returns: N/A */ static void SkPhyIsrBcom( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_IOC IoC, /* Io Context */ -int Port, /* Port Num = PHY Num */ -SK_U16 IStatus) /* Interrupts masked with PHY-Mask */ +int Port, /* Port Num = PHY Num */ +SK_U16 IStatus) /* Interrupt Status */ { + SK_GEPORT *pPrt; /* GIni Port struct pointer */ SK_EVPARA Para; + pPrt = &pAC->GIni.GP[Port]; + if (IStatus & PHY_B_IS_PSE) { - /* incorrectable pair swap error */ + /* Incorrectable pair swap error. */ SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E022, - SKERR_SIRQ_E022MSG) ; + SKERR_SIRQ_E022MSG); } if (IStatus & PHY_B_IS_MDXI_SC) { @@ -1857,19 +2163,19 @@ } if (IStatus & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { + Para.Para32[0] = (SK_U32)Port; + SkHWLinkDown(pAC, IoC, Port); /* Signal to RLMT */ - Para.Para32[0] = (SK_U32) Port; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_LINK_DOWN, Para); /* Start workaround Errata #2 timer */ - SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, - SK_WA_INA_TIME,SKGE_HWAC,SK_HWEV_WATIM,Para); + SkTimerStart(pAC, IoC, &pPrt->PWaTimer, + SK_WA_INA_TIME, SKGE_HWAC, SK_HWEV_WATIM, Para); } if (IStatus & PHY_B_IS_NO_HDCL) { - /* not used */ } if (IStatus & PHY_B_IS_NO_HDC) { @@ -1903,8 +2209,7 @@ if (IStatus & PHY_B_IS_CRC_ER) { /* not used */ } - -} +} /* SkPhyIsrBcom */ /****************************************************************************** @@ -1916,10 +2221,10 @@ * Returns: N/A */ static void SkPhyIsrLone( -SK_AC *pAC, /* Adapters context */ -SK_IOC IoC, /* Io Context */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* Io Context */ int Port, /* Port Num = PHY Num */ -SK_U16 IStatus) /* Interrupts masked with PHY-Mask */ +SK_U16 IStatus) /* Interrupt Status */ { SK_EVPARA Para; @@ -1955,19 +2260,17 @@ SkHWLinkDown(pAC, IoC, Port); /* Signal to RLMT */ - Para.Para32[0] = (SK_U32) Port; + Para.Para32[0] = (SK_U32)Port; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_LINK_DOWN, Para); /* Start workaround Errata #2 timer */ SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, - SK_WA_INA_TIME,SKGE_HWAC,SK_HWEV_WATIM,Para); + SK_WA_INA_TIME, SKGE_HWAC, SK_HWEV_WATIM, Para); } if (IStatus & PHY_L_IS_MDINT) { /* not used */ } - -} - +} /* SkPhyIsrLone */ /* End of File */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/ski2c.c linux.20p9/drivers/net/sk98lin/ski2c.c --- linux.vanilla/drivers/net/sk98lin/ski2c.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/ski2c.c Wed Jul 4 16:03:56 2001 @@ -2,17 +2,16 @@ * * Name: ski2c.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.42 $ - * Date: $Date: 1999/11/22 13:35:12 $ - * Purpose: Funktions to access Voltage and Temperature Sensor - * (taken from Monalisa (taken from Concentrator)) + * Version: $Revision: 1.47 $ + * Date: $Date: 2001/04/05 11:38:09 $ + * Purpose: Functions to access Voltage and Temperature Sensor + * (taken from Monalisa (taken from Concentrator)) * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -28,6 +27,23 @@ * History: * * $Log: ski2c.c,v $ + * Revision 1.47 2001/04/05 11:38:09 rassmann + * Set SenState to idle in SkI2cWaitIrq(). + * Changed error message in SkI2cWaitIrq(). + * + * Revision 1.46 2001/04/02 14:03:35 rassmann + * Changed pAC to IoC in SK_IN32(). + * + * Revision 1.45 2001/03/21 12:12:49 rassmann + * Resetting I2C_READY interrupt in SkI2cInit1(). + * + * Revision 1.44 2000/08/07 15:49:03 gklug + * Fix: SK_INFAST only in NetWare driver. + * + * Revision 1.43 2000/08/03 14:28:17 rassmann + * Added function to wait for I2C being ready before resetting the board. + * Replaced one duplicate "out of range" message with correct one. + * * Revision 1.42 1999/11/22 13:35:12 cgoos * Changed license header to GPL. * @@ -173,10 +189,10 @@ /* - i2C Protocol -*/ + * I2C Protocol + */ static const char SysKonnectFileId[] = - "$Id: ski2c.c,v 1.42 1999/11/22 13:35:12 cgoos Exp $" ; + "$Id: ski2c.c,v 1.47 2001/04/05 11:38:09 rassmann Exp $"; #include "h/skdrv1st.h" /* Driver Specific Definitions */ #include "h/lm80.h" @@ -184,7 +200,7 @@ #ifdef __C2MAN__ /* - I2C protocol implemetation. + I2C protocol implementation. General Description: @@ -194,9 +210,9 @@ This file covers functions that allow to read write and do some bulk requests a specified I2C address. - The Genesis has 2 I2C busses. One for the EEPROM which holds + The Genesis has 2 I2C buses. One for the EEPROM which holds the VPD Data and one for temperature and voltage sensor. - The following picture shows the I2C busses, I2C devices and + The following picture shows the I2C buses, I2C devices and there control registers. Note: The VPD functions are in skvpd.c @@ -293,13 +309,13 @@ * serial data line simultaneously (ASIC: last bit of a byte = '1', I2C client * send an 'ACK'). See also Concentrator Bugreport No. 10192. */ -#define I2C_DATA_HIGH(IoC) SK_I2C_SET_BIT(IoC,I2C_DATA) -#define I2C_DATA_LOW(IoC) SK_I2C_CLR_BIT(IoC,I2C_DATA) -#define I2C_DATA_OUT(IoC) SK_I2C_SET_BIT(IoC,I2C_DATA_DIR) -#define I2C_DATA_IN(IoC) SK_I2C_CLR_BIT(IoC,I2C_DATA_DIR|I2C_DATA) -#define I2C_CLK_HIGH(IoC) SK_I2C_SET_BIT(IoC,I2C_CLK) -#define I2C_CLK_LOW(IoC) SK_I2C_CLR_BIT(IoC,I2C_CLK|I2C_DATA_DIR) -#define I2C_START_COND(IoC) SK_I2C_CLR_BIT(IoC,I2C_CLK) +#define I2C_DATA_HIGH(IoC) SK_I2C_SET_BIT(IoC, I2C_DATA) +#define I2C_DATA_LOW(IoC) SK_I2C_CLR_BIT(IoC, I2C_DATA) +#define I2C_DATA_OUT(IoC) SK_I2C_SET_BIT(IoC, I2C_DATA_DIR) +#define I2C_DATA_IN(IoC) SK_I2C_CLR_BIT(IoC, I2C_DATA_DIR|I2C_DATA) +#define I2C_CLK_HIGH(IoC) SK_I2C_SET_BIT(IoC, I2C_CLK) +#define I2C_CLK_LOW(IoC) SK_I2C_CLR_BIT(IoC, I2C_CLK|I2C_DATA_DIR) +#define I2C_START_COND(IoC) SK_I2C_CLR_BIT(IoC, I2C_CLK) #define NS2CLKT(x) ((x*125L)/10000) @@ -309,25 +325,24 @@ * sending one bit */ void SkI2cSndBit( -SK_IOC IoC, /* IoContext */ +SK_IOC IoC, /* I/O Context */ SK_U8 Bit) /* Bit to send */ { - I2C_DATA_OUT(IoC) ; + I2C_DATA_OUT(IoC); if (Bit) { I2C_DATA_HIGH(IoC); } else { I2C_DATA_LOW(IoC); } - SkDgWaitTime(IoC,NS2BCLK(T_DATA_IN_SETUP)); + SkDgWaitTime(IoC, NS2BCLK(T_DATA_IN_SETUP)); I2C_CLK_HIGH(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_HIGH)); + SkDgWaitTime(IoC, NS2BCLK(T_CLK_HIGH)); I2C_CLK_LOW(IoC); -} - +} /* SkI2cSndBit*/ /* - * Signal a start to the i2C Bus. + * Signal a start to the I2C Bus. * * A start is signaled when data goes to low in a high clock cycle. * @@ -335,66 +350,70 @@ * * Status: not tested */ -void SkI2cStart(SK_IOC IoC) /* I/O Context */ +void SkI2cStart( +SK_IOC IoC) /* I/O Context */ { /* Init data and Clock to output lines */ /* Set Data high */ - I2C_DATA_OUT(IoC) ; - I2C_DATA_HIGH(IoC) ; + I2C_DATA_OUT(IoC); + I2C_DATA_HIGH(IoC); /* Set Clock high */ - I2C_CLK_HIGH(IoC) ; + I2C_CLK_HIGH(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_START_SETUP)) ; + SkDgWaitTime(IoC, NS2BCLK(T_START_SETUP)); /* Set Data Low */ - I2C_DATA_LOW(IoC) ; + I2C_DATA_LOW(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_START_HOLD)) ; + SkDgWaitTime(IoC, NS2BCLK(T_START_HOLD)); /* Clock low without Data to Input */ - I2C_START_COND(IoC) ; + I2C_START_COND(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_LOW)) ; -} + SkDgWaitTime(IoC, NS2BCLK(T_CLK_LOW)); +} /* SkI2cStart */ -void SkI2cStop(SK_IOC IoC) /* I/O Context */ +void SkI2cStop( +SK_IOC IoC) /* I/O Context */ { /* Init data and Clock to output lines */ /* Set Data low */ - I2C_DATA_OUT(IoC) ; - I2C_DATA_LOW(IoC) ; + I2C_DATA_OUT(IoC); + I2C_DATA_LOW(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_2_DATA_OUT)) ; + SkDgWaitTime(IoC, NS2BCLK(T_CLK_2_DATA_OUT)); /* Set Clock high */ - I2C_CLK_HIGH(IoC) ; + I2C_CLK_HIGH(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_STOP_SETUP)) ; + SkDgWaitTime(IoC, NS2BCLK(T_STOP_SETUP)); /* * Set Data High: Do it by setting the Data Line to Input. * Because of a pull up resistor the Data Line * floods to high. */ - I2C_DATA_IN(IoC) ; + I2C_DATA_IN(IoC); /* * When I2C activity is stopped * o DATA should be set to input and * o CLOCK should be set to high! */ - SkDgWaitTime(IoC,NS2BCLK(T_BUS_IDLE)) ; -} + SkDgWaitTime(IoC, NS2BCLK(T_BUS_IDLE)); +} /* SkI2cStop */ + /* - * Receive just one bit via the i2C bus. + * Receive just one bit via the I2C bus. * * Note: Clock must be set to LOW before calling this function. * * Returns The received bit. */ -int SkI2cRcvBit(SK_IOC IoC) /* I/O Context */ +int SkI2cRcvBit( +SK_IOC IoC) /* I/O Context */ { int Bit; SK_U8 I2cSwCtrl; @@ -402,13 +421,13 @@ /* Init data as input line */ I2C_DATA_IN(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_2_DATA_OUT)) ; + SkDgWaitTime(IoC, NS2BCLK(T_CLK_2_DATA_OUT)); I2C_CLK_HIGH(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_HIGH)) ; + SkDgWaitTime(IoC, NS2BCLK(T_CLK_HIGH)); - SK_I2C_GET_SW(IoC,&I2cSwCtrl) ; + SK_I2C_GET_SW(IoC, &I2cSwCtrl); if (I2cSwCtrl & I2C_DATA) { Bit = 1; } else { @@ -416,10 +435,11 @@ } I2C_CLK_LOW(IoC); - SkDgWaitTime(IoC,NS2BCLK(T_CLK_LOW-T_CLK_2_DATA_OUT)) ; + SkDgWaitTime(IoC, NS2BCLK(T_CLK_LOW-T_CLK_2_DATA_OUT)); return(Bit); -} +} /* SkI2cRcvBit */ + /* * Receive an ACK. @@ -427,58 +447,64 @@ * returns 0 If acknoledged * 1 in case of an error */ -int SkI2cRcvAck(SK_IOC IoC) /* I/O Context */ +int SkI2cRcvAck( +SK_IOC IoC) /* I/O Context */ { /* * Received bit must be zero. */ - return (SkI2cRcvBit(IoC) != 0) ; -} + return (SkI2cRcvBit(IoC) != 0); +} /* SkI2cRcvAck */ + /* * Send an NACK. */ -void SkI2cSndNAck(SK_IOC IoC) /* I/O Context */ +void SkI2cSndNAck( +SK_IOC IoC) /* I/O Context */ { /* * Received bit must be zero. */ - SkI2cSndBit(IoC,1) ; -} + SkI2cSndBit(IoC, 1); +} /* SkI2cSndNAck */ + /* * Send an ACK. */ -void SkI2cSndAck(SK_IOC IoC) /* I/O Context */ +void SkI2cSndAck( +SK_IOC IoC) /* I/O Context */ { /* * Received bit must be zero. * */ - SkI2cSndBit(IoC,0) ; -} + SkI2cSndBit(IoC, 0); +} /* SkI2cSndAck */ + /* - * Send one byte to the i2C device and wait for ACK. + * Send one byte to the I2C device and wait for ACK. * * Return acknoleged status. */ int SkI2cSndByte( SK_IOC IoC, /* I/O Context */ -int Byte) /* byte to send */ +int Byte) /* byte to send */ { int i; - for (i=0; i<8; i++) { + for (i = 0; i < 8; i++) { if (Byte & (1<<(7-i))) { - SkI2cSndBit(IoC,1) ; + SkI2cSndBit(IoC, 1); } else { - SkI2cSndBit(IoC,0) ; + SkI2cSndBit(IoC, 0); } } - return(SkI2cRcvAck(IoC)) ; -} + return(SkI2cRcvAck(IoC)); +} /* SkI2cSndByte */ /* @@ -488,24 +514,24 @@ */ int SkI2cRcvByte( SK_IOC IoC, /* I/O Context */ -int Last) /* Last Byte Flag */ +int Last) /* Last Byte Flag */ { int i; int Byte = 0; - for (i=0; i<8; i++) { - Byte <<= 1 ; - Byte |= SkI2cRcvBit(IoC) ; + for (i = 0; i < 8; i++) { + Byte <<= 1; + Byte |= SkI2cRcvBit(IoC); } if (Last) { - SkI2cSndNAck(IoC) ; + SkI2cSndNAck(IoC); } else { - SkI2cSndAck(IoC) ; + SkI2cSndAck(IoC); } - return(Byte) ; -} + return(Byte); +} /* SkI2cRcvByte */ /* @@ -515,68 +541,107 @@ */ int SkI2cSndDev( SK_IOC IoC, /* I/O Context */ -int Addr, /* Device Address */ -int Rw) /* Read / Write Flag */ +int Addr, /* Device Address */ +int Rw) /* Read / Write Flag */ { - SkI2cStart(IoC) ; - Rw = ~Rw ; - Rw &= I2C_WRITE ; - return(SkI2cSndByte(IoC, (Addr<<1) | Rw)) ; -} + SkI2cStart(IoC); + Rw = ~Rw; + Rw &= I2C_WRITE; + return(SkI2cSndByte(IoC, (Addr<<1) | Rw)); +} /* SkI2cSndDev */ #endif /* SK_DIAG */ /*----------------- I2C CTRL Register Functions ----------*/ /* - * waits for a completetion of a I2C transfer + * waits for a completion of an I2C transfer * * returns 0: success, transfer completes - * 1: error, transfer does not complete, I2C transfer - * killed, wait loop terminated. + * 1: error, transfer does not complete, I2C transfer + * killed, wait loop terminated. */ int SkI2cWait( SK_AC *pAC, /* Adapter Context */ -SK_IOC IoC, /* IoContext */ -int Event) /* complete event to wait for (I2C_READ or I2C_WRITE) */ +SK_IOC IoC, /* I/O Context */ +int Event) /* complete event to wait for (I2C_READ or I2C_WRITE) */ { - SK_U64 StartTime ; - SK_U32 I2cCtrl ; + SK_U64 StartTime; + SK_U32 I2cCtrl; - StartTime = SkOsGetTime(pAC) ; + StartTime = SkOsGetTime(pAC); do { - if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC/16) { - SK_I2C_STOP(IoC) ; + if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC / 8) { + SK_I2C_STOP(IoC); #ifndef SK_DIAG - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E002, - SKERR_I2C_E002MSG) ; + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E002, SKERR_I2C_E002MSG); #endif /* !SK_DIAG */ - return(1) ; + return(1); } - SK_I2C_GET_CTL(IoC,&I2cCtrl) ; - } while((I2cCtrl & I2C_FLAG) == (SK_U32)Event << 31) ; + SK_I2C_GET_CTL(IoC, &I2cCtrl); + } while ((I2cCtrl & I2C_FLAG) == (SK_U32)Event << 31); + + return(0); +} /* SkI2cWait */ + - return(0) ; -} +/* + * waits for a completion of an I2C transfer + * + * Returns + * Nothing + */ +void SkI2cWaitIrq( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC) /* I/O Context */ +{ + SK_SENSOR *pSen; + SK_U64 StartTime; + SK_U32 IrqSrc; + + pSen = &pAC->I2c.SenTable[pAC->I2c.CurrSens]; + + if (pSen->SenState == SK_SEN_IDLE) { + return; + } + + StartTime = SkOsGetTime(pAC); + do { + if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC / 8) { + SK_I2C_STOP(IoC); +#ifndef SK_DIAG + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E016, SKERR_I2C_E016MSG); +#endif /* !SK_DIAG */ + return; + } + SK_IN32(IoC, B0_ISRC, &IrqSrc); + } while ((IrqSrc & IS_I2C_READY) == 0); + + pSen->SenState = SK_SEN_IDLE; + return; +} /* SkI2cWaitIrq */ #ifdef SK_DIAG + /* * writes a single byte or 4 bytes into the I2C device * * returns 0: success - * 1: error + * 1: error */ int SkI2cWrite( -SK_AC *pAC, /* Adapter Context */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ SK_U32 I2cData, /* I2C Data to write */ -int I2cDev, /* I2C Device Address */ -int I2cReg, /* I2C Device Register Address */ -int I2cBurst) /* I2C Burst Flag ( 0 || I2C_BURST ) */ -{ - SK_OUT32(pAC,B2_I2C_DATA,I2cData) ; - SK_I2C_CTL(pAC,I2C_WRITE,I2cDev,I2cReg,I2cBurst); - return(SkI2cWait(pAC,pAC,I2C_WRITE)) ; -} +int I2cDev, /* I2C Device Address */ +int I2cReg, /* I2C Device Register Address */ +int I2cBurst) /* I2C Burst Flag ( 0 || I2C_BURST ) */ +{ + SK_OUT32(IoC, B2_I2C_DATA, I2cData); + SK_I2C_CTL(IoC, I2C_WRITE, I2cDev, I2cReg, I2cBurst); + return(SkI2cWait(pAC, IoC, I2C_WRITE)); +} /* SkI2cWrite*/ + /* * reads a single byte or 4 bytes from the I2C device @@ -584,39 +649,43 @@ * returns the word read */ SK_U32 SkI2cRead( -SK_AC *pAC, /* Adapter Context */ -int I2cDev, /* I2C Device Address */ -int I2cReg, /* I2C Device Register Address */ -int I2cBurst) /* I2C Burst Flag ( 0 || I2C_BURST ) */ -{ - SK_U32 Data ; - - SK_OUT32(pAC,B2_I2C_DATA,0) ; - SK_I2C_CTL(pAC,I2C_READ,I2cDev,I2cReg,I2cBurst); - if (SkI2cWait(pAC,pAC,I2C_READ)) { - w_print("I2c Transfer Timeout!\n"); - } - SK_IN32(pAC,B2_I2C_DATA,&Data) ; - return(Data) ; -} +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +int I2cDev, /* I2C Device Address */ +int I2cReg, /* I2C Device Register Address */ +int I2cBurst) /* I2C Burst Flag ( 0 || I2C_BURST ) */ +{ + SK_U32 Data; + + SK_OUT32(IoC, B2_I2C_DATA, 0); + SK_I2C_CTL(IoC, I2C_READ, I2cDev, I2cReg, I2cBurst); + if (SkI2cWait(pAC, IoC, I2C_READ)) { + w_print("I2C Transfer Timeout!\n"); + } + SK_IN32(IoC, B2_I2C_DATA, &Data); + return(Data); +} /* SkI2cRead */ + #endif /* SK_DIAG */ + /* - * read a sensors value + * read a sensor's value * - * This function read a sensors value from the I2c sensor chip. The sensor + * This function reads a sensor's value from the I2C sensor chip. The sensor * is defined by its index into the sensors database in the struct pAC points * to. - * Returns 1 if the read is completed - * 0 if the read must be continued (I2c Bus still allocated) + * Returns + * 1 if the read is completed + * 0 if the read must be continued (I2C Bus still allocated) */ int SkI2cReadSensor( SK_AC *pAC, /* Adapter Context */ -SK_IOC IoC, /* IoContext */ +SK_IOC IoC, /* I/O Context */ SK_SENSOR *pSen) /* Sensor to be read */ { - return((*pSen->SenRead)(pAC,IoC,pSen)) ; -} + return((*pSen->SenRead)(pAC, IoC, pSen)); +} /* SkI2cReadSensor*/ /* * Do the Init state 0 initialization @@ -637,10 +706,10 @@ pAC->I2c.DummyReads = SK_MAX_SENSORS; #endif - for (i=0; i < SK_MAX_SENSORS; i ++) { + for (i = 0; i < SK_MAX_SENSORS; i ++) { switch (i) { case 0: - pAC->I2c.SenTable[i].SenDesc = "Temperature" ; + pAC->I2c.SenTable[i].SenDesc = "Temperature"; pAC->I2c.SenTable[i].SenType = SK_SEN_TEMP; pAC->I2c.SenTable[i].SenThreErrHigh = SK_SEN_ERRHIGH0; pAC->I2c.SenTable[i].SenThreErrLow = SK_SEN_ERRLOW0; @@ -734,10 +803,11 @@ pAC->I2c.SenTable[i].SenDev = LM80_ADDR; } - /* Now we are INIT dataed */ + /* Now we are "INIT data"ed */ pAC->I2c.InitLevel = SK_INIT_DATA; return(0); -} +} /* SkI2cInit0*/ + /* * Do the init state 1 initialization @@ -761,7 +831,7 @@ */ static int SkI2cInit1( SK_AC *pAC, /* Adapter Context */ -SK_IOC IoC) /* IoContext needed in level 1 */ +SK_IOC IoC) /* I/O Context */ { if (pAC->I2c.InitLevel != SK_INIT_DATA) { /* ReInit not needed in I2C module */ @@ -770,27 +840,27 @@ SK_OUT32(IoC, B2_I2C_DATA, 0); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_CFG, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); SK_OUT32(IoC, B2_I2C_DATA, 0xff); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_IMSK_1, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); SK_OUT32(IoC, B2_I2C_DATA, 0xff); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_IMSK_2, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); SK_OUT32(IoC, B2_I2C_DATA, 0x0); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_FAN_CTRL, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); SK_OUT32(IoC, B2_I2C_DATA, 0); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_TEMP_CTRL, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); SK_OUT32(IoC, B2_I2C_DATA, LM80_CFG_START); SK_I2C_CTL(IoC, I2C_WRITE, LM80_ADDR, LM80_CFG, 0); - (void)SkI2cWait(pAC, IoC, I2C_WRITE) ; + (void)SkI2cWait(pAC, IoC, I2C_WRITE); /* * MaxSens has to be initialized here, because PhyType is not @@ -816,19 +886,23 @@ #ifndef SK_DIAG pAC->I2c.DummyReads = pAC->I2c.MaxSens; + + /* Clear the interrupt source */ + SK_OUT32(IoC, B2_I2C_IRQ, I2C_CLR_IRQ); #endif /* !SK_DIAG */ - /* Now we are IO initialized */ + /* Now we are I/O initialized */ pAC->I2c.InitLevel = SK_INIT_IO; return(0); -} +} /* SkI2cInit1 */ + /* - * Init level 2: Start first sensors read + * Init level 2: Start first sensor read. */ static int SkI2cInit2( SK_AC *pAC, /* Adapter Context */ -SK_IOC IoC) /* IoContext needed in level 1 */ +SK_IOC IoC) /* I/O Context */ { int ReadComplete; SK_SENSOR *pSen; @@ -840,18 +914,18 @@ } pSen = &pAC->I2c.SenTable[pAC->I2c.CurrSens]; - ReadComplete = SkI2cReadSensor(pAC,IoC,pSen); + ReadComplete = SkI2cReadSensor(pAC, IoC, pSen); if (ReadComplete) { - SK_ERR_LOG(pAC, SK_ERRCL_INIT, SKERR_I2C_E008, - SKERR_I2C_E008MSG); + SK_ERR_LOG(pAC, SK_ERRCL_INIT, SKERR_I2C_E008, SKERR_I2C_E008MSG); } /* Now we are correctly initialized */ pAC->I2c.InitLevel = SK_INIT_RUN; return(0); -} +} /* SkI2cInit2*/ + /* * Initialize I2C devices @@ -863,36 +937,39 @@ * Level 0: * Initialize only the data structures. Do NOT access hardware. * Level 1: - * Initialize hardware through SK_IN?OUT commands. Do NOT use interrupts. + * Initialize hardware through SK_IN / SK_OUT commands. Do NOT use interrupts. * Level 2: * Everything is possible. Interrupts may be used from now on. * - * return: 0 = success - * other = error. + * return: + * 0 = success + * other = error. */ int SkI2cInit( SK_AC *pAC, /* Adapter Context */ -SK_IOC IoC, /* IoContext needed in level 1 */ -int Level) /* Init Level */ +SK_IOC IoC, /* I/O Context needed in levels 1 and 2 */ +int Level) /* Init Level */ { switch (Level) { case SK_INIT_DATA: - return(SkI2cInit0(pAC)) ; + return(SkI2cInit0(pAC)); case SK_INIT_IO: - return(SkI2cInit1(pAC, IoC)) ; + return(SkI2cInit1(pAC, IoC)); case SK_INIT_RUN: - return(SkI2cInit2(pAC, IoC)) ; + return(SkI2cInit2(pAC, IoC)); default: break; } - return(0) ; -} + return(0); +} /* SkI2cInit */ + #ifndef SK_DIAG + /* - * Interrupt service function for the I2c Interface + * Interrupt service function for the I2C Interface * * Clears the Interrupt source * @@ -901,60 +978,58 @@ * Starts the timer if necessary. */ void SkI2cIsr( -SK_AC *pAC, /* Adapters context */ -SK_IOC IoC) /* Io Context */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC) /* I/O Context */ { SK_EVPARA Para; /* Clear the interrupt source */ - SK_OUT32(IoC, B2_I2C_IRQ, I2C_CLR_IRQ) ; + SK_OUT32(IoC, B2_I2C_IRQ, I2C_CLR_IRQ); Para.Para64 = 0; SkEventQueue(pAC, SKGE_I2C, SK_I2CEV_IRQ, Para); -} +} /* SkI2cIsr */ + /* * Check this sensors Value against the threshold and send events. */ static void SkI2cCheckSensor( -SK_AC *pAC, /* Adapters context */ +SK_AC *pAC, /* Adapter Context */ SK_SENSOR *pSen) { SK_EVPARA ParaLocal; SK_BOOL TooHigh; /* Is sensor too high? */ SK_BOOL TooLow; /* Is sensor too low? */ - SK_U64 CurrTime; /* current Time */ + SK_U64 CurrTime; /* Current Time */ SK_BOOL DoTrapSend; /* We need to send a trap */ SK_BOOL DoErrLog; /* We need to log the error */ SK_BOOL IsError; /* We need to log the error */ /* Check Dummy Reads first */ if (pAC->I2c.DummyReads > 0) { - pAC->I2c.DummyReads -- ; + pAC->I2c.DummyReads --; return; } /* Get the current time */ - CurrTime = SkOsGetTime(pAC) ; + CurrTime = SkOsGetTime(pAC); - /* Set para to the most usefull setting: - * The current sensor. - */ + /* Set para to the most useful setting: The current sensor. */ ParaLocal.Para64 = (SK_U64) pAC->I2c.CurrSens; - /* Check the Value against the thresholds */ - /* First: Error Thresholds */ - TooHigh = (pSen->SenValue > pSen->SenThreErrHigh) ; - TooLow = (pSen->SenValue < pSen->SenThreErrLow) ; + /* Check the Value against the thresholds. First: Error Thresholds */ + TooHigh = (pSen->SenValue > pSen->SenThreErrHigh); + TooLow = (pSen->SenValue < pSen->SenThreErrLow); - IsError = SK_FALSE ; + IsError = SK_FALSE; if (TooHigh || TooLow) { - /* Error condition is satiesfied */ + /* Error condition is satisfied */ DoTrapSend = SK_TRUE; DoErrLog = SK_TRUE; /* Now error condition is satisfied */ - IsError = SK_TRUE ; + IsError = SK_TRUE; if (pSen->SenErrFlag == SK_SEN_ERR_ERR) { /* This state is the former one */ @@ -982,7 +1057,7 @@ /* We came from a different state */ /* -> Set Begin Time Stamp */ pSen->SenBegErrTS = CurrTime; - pSen->SenErrFlag = SK_SEN_ERR_ERR ; + pSen->SenErrFlag = SK_SEN_ERR_ERR; } if (DoTrapSend) { @@ -994,7 +1069,7 @@ SkEventQueue(pAC, SKGE_PNMI, (TooHigh ? SK_PNMI_EVT_SEN_ERR_UPP : SK_PNMI_EVT_SEN_ERR_LOW), - ParaLocal) ; + ParaLocal); } if (DoErrLog) { @@ -1017,12 +1092,12 @@ /* Check the Value against the thresholds */ /* 2nd: Warning thresholds */ - TooHigh = (pSen->SenValue > pSen->SenThreWarnHigh) ; - TooLow = (pSen->SenValue < pSen->SenThreWarnLow) ; + TooHigh = (pSen->SenValue > pSen->SenThreWarnHigh); + TooLow = (pSen->SenValue < pSen->SenThreWarnLow); if (!IsError && (TooHigh || TooLow)) { - /* Error condition is satiesfied */ + /* Error condition is satisfied */ DoTrapSend = SK_TRUE; DoErrLog = SK_TRUE; @@ -1052,7 +1127,7 @@ /* We came from a different state */ /* -> Set Begin Time Stamp */ pSen->SenBegWarnTS = CurrTime; - pSen->SenErrFlag = SK_SEN_ERR_WARN ; + pSen->SenErrFlag = SK_SEN_ERR_WARN; } if (DoTrapSend) { @@ -1064,7 +1139,7 @@ SkEventQueue(pAC, SKGE_PNMI, (TooHigh ? SK_PNMI_EVT_SEN_WAR_UPP : SK_PNMI_EVT_SEN_WAR_LOW), - ParaLocal) ; + ParaLocal); } if (DoErrLog) { @@ -1075,8 +1150,8 @@ SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E009, SKERR_I2C_E009MSG); } else if (pSen->SenType == SK_SEN_VOLT) { - SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E009, - SKERR_I2C_E009MSG); + SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E010, + SKERR_I2C_E010MSG); } else { SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E014, @@ -1088,7 +1163,7 @@ /* Check for NO error at all */ if (!IsError && !TooHigh && !TooLow) { /* Set o.k. Status if no error and no warning condition */ - pSen->SenErrFlag = SK_SEN_ERR_OK ; + pSen->SenErrFlag = SK_SEN_ERR_OK; } /* End of check against the thresholds */ @@ -1116,23 +1191,24 @@ if (!pSen->SenInit) { SK_ERR_LOG(pAC, SK_ERRCL_HW, SKERR_I2C_E013, SKERR_I2C_E013MSG); } -} +} /* SkI2cCheckSensor*/ + /* * The only Event to be served is the timeout event * */ int SkI2cEvent( -SK_AC *pAC, /* Adapters context */ -SK_IOC IoC, /* Io Context */ -SK_U32 Event, /* Module specific Event */ -SK_EVPARA Para) /* Event specific Parameter */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Event, /* Module specific Event */ +SK_EVPARA Para) /* Event specific Parameter */ { - int ReadComplete; + int ReadComplete; SK_SENSOR *pSen; SK_U32 Time; SK_EVPARA ParaLocal; - int i; + int i; switch (Event) { case SK_I2CEV_IRQ: @@ -1142,7 +1218,7 @@ if (ReadComplete) { /* Check sensor against defined thresholds */ - SkI2cCheckSensor (pAC, pSen) ; + SkI2cCheckSensor (pAC, pSen); /* Increment Current and set appropriate Timeout */ Time = SK_I2C_TIM_SHORT; @@ -1156,20 +1232,20 @@ /* Start Timer */ ParaLocal.Para64 = (SK_U64) 0; SkTimerStart(pAC, IoC, &pAC->I2c.SenTimer, Time, - SKGE_I2C, SK_I2CEV_TIM, ParaLocal) ; + SKGE_I2C, SK_I2CEV_TIM, ParaLocal); } break; case SK_I2CEV_CLEAR: - for (i=0; i < SK_MAX_SENSORS; i ++) { + for (i = 0; i < SK_MAX_SENSORS; i ++) { pAC->I2c.SenTable[i].SenErrFlag = SK_SEN_ERR_OK; pAC->I2c.SenTable[i].SenErrCts = 0; pAC->I2c.SenTable[i].SenWarnCts = 0; pAC->I2c.SenTable[i].SenBegErrTS = 0; pAC->I2c.SenTable[i].SenBegWarnTS = 0; - pAC->I2c.SenTable[i].SenLastErrTrapTS = (SK_U64) 0; - pAC->I2c.SenTable[i].SenLastErrLogTS = (SK_U64) 0; - pAC->I2c.SenTable[i].SenLastWarnTrapTS = (SK_U64) 0; - pAC->I2c.SenTable[i].SenLastWarnLogTS = (SK_U64) 0; + pAC->I2c.SenTable[i].SenLastErrTrapTS = (SK_U64)0; + pAC->I2c.SenTable[i].SenLastErrLogTS = (SK_U64)0; + pAC->I2c.SenTable[i].SenLastWarnTrapTS = (SK_U64)0; + pAC->I2c.SenTable[i].SenLastWarnLogTS = (SK_U64)0; } break; default: @@ -1177,6 +1253,6 @@ } return(0); -} -#endif /* !SK_DIAG */ -/* End of File */ +} /* SkI2cEvent*/ + +#endif /* !SK_DIAG */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skproc.c linux.20p9/drivers/net/sk98lin/skproc.c --- linux.vanilla/drivers/net/sk98lin/skproc.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/sk98lin/skproc.c Wed Jul 4 16:03:56 2001 @@ -0,0 +1,441 @@ +/****************************************************************************** + * + * Name: skproc.c + * Project: GEnesis, PCI Gigabit Ethernet Adapter + * Version: $Revision: 1.2 $ + * Date: $Date: 2001/02/19 13:14:16 $ + * Purpose: Funktions to display statictic data + * + ******************************************************************************/ + +/****************************************************************************** + * + * (C)Copyright 1998-2001 SysKonnect GmbH. + * + * 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. + * + * Created 22-Nov-2000 + * Author: Mirko Lindner (mlindner@syskonnect.de) + * + * The information in this file is provided "AS IS" without warranty. + * + ******************************************************************************/ +/****************************************************************************** + * + * History: + * + * $Log: skproc.c,v $ + * Revision 1.2 2001/02/19 13:14:16 mlindner + * Changed PNMI parameter values + * Corrected ProcFs functionality + * + * Revision 1.1 2001/01/22 14:15:31 mlindner + * added ProcFs functionality + * Dual Net functionality integrated + * Rlmt networks added + * + * + ******************************************************************************/ + +#include + +#include "h/skdrv1st.h" +#include "h/skdrv2nd.h" +#define ZEROPAD 1 /* pad with zero */ +#define SIGN 2 /* unsigned/signed long */ +#define PLUS 4 /* show plus */ +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 + +extern void proc_fill_inode(struct inode *inode, int fill); +extern char * SkNumber(char * str, long long num, int base, int size, + int precision ,int type); +int proc_read(char *buffer, + char **buffer_location, + off_t offset, + int buffer_length, + int *eof, + void *data); + +static const char SK_Root_Dir_entry[] = "sk98lin"; +extern struct device *root_dev; + + +struct proc_dir_entry Our_Proc_Dir = { + 0, + sizeof(SK_Root_Dir_entry)-1, + SK_Root_Dir_entry, + S_IFDIR | S_IRUGO, + 2, 0, 0, 0, NULL, + NULL, proc_fill_inode +}; + + +/***************************************************************************** + * + * proc_read - print "summaries" entry + * + * Description: + * This function fills the proc entry with statistic data about + * the ethernet device. + * + * + * Returns: buffer with statistic data + * + */ +int proc_read(char *buffer, +char **buffer_location, +off_t offset, +int buffer_length, +int *eof, +void *data) +{ + int len = 0; + int t; + int i; + DEV_NET *pNet; + SK_AC *pAC; + char test_buf[100]; + unsigned int Flags; + unsigned int Size; + struct device *next; + struct device *SkgeProcDev = root_dev; + + SK_PNMI_STRUCT_DATA *pPnmiStruct; + SK_PNMI_STAT *pPnmiStat; + struct proc_dir_entry *file = (struct proc_dir_entry*) data; + + while (SkgeProcDev) { + pNet = (DEV_NET*) SkgeProcDev->priv; + pAC = pNet->pAC; + next = pAC->Next; + + pPnmiStruct = &pAC->PnmiStruct; + + for (t=pAC->GIni.GIMacsFound; t > 0; t--) { + if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1) + t--; + + spin_lock_irqsave(&pAC->SlowPathLock, Flags); + Size = SK_PNMI_STRUCT_SIZE; + SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, t-1); + spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + + + + + if (strcmp(pAC->dev[t-1]->name, file->name) == 0) { + pPnmiStat = &pPnmiStruct->Stat[t-1]; + len = sprintf(buffer, + "\nDetailed statistic for device %s\n", + pAC->dev[t-1]->name); + len += sprintf(buffer + len, + "==================================\n"); + + /* Board statistics */ + + len += sprintf(buffer + len, + "\nBoard statistics\n\n"); + len += sprintf(buffer + len, + "Active Port %c\n", + 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. + Net[t-1].PrefPort]->PortNumber); + len += sprintf(buffer + len, + "Preferred Port %c\n", + 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. + Net[t-1].PrefPort]->PortNumber); + + len += sprintf(buffer + len, + "Bus speed (MHz) %d\n", + pPnmiStruct->BusSpeed); + + len += sprintf(buffer + len, + "Bus width (Bit) %d\n", + pPnmiStruct->BusWidth); + + + for (i=0; i < SK_MAX_SENSORS; i ++) { + if (strcmp(pAC->I2c.SenTable[i].SenDesc, + "Temperature") == 0 ) { + len += sprintf(buffer + len, + "Temperature (C) %d.%d\n", + pAC->I2c.SenTable[i].SenValue / 10, + pAC->I2c.SenTable[i].SenValue % 10); + len += sprintf(buffer + len, + "Temperature (F) %d.%d\n", + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200)/100, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200) % 10); + } else if (strcmp(pAC->I2c.SenTable[i].SenDesc, + "Speed Fan") == 0 ) { + len += sprintf(buffer + len, + "Speed Fan %d\n", + pAC->I2c.SenTable[i].SenValue); + } else { + len += sprintf(buffer + len, + "%-20s %d.%d\n", + pAC->I2c.SenTable[i].SenDesc, + pAC->I2c.SenTable[i].SenValue / 1000, + pAC->I2c.SenTable[i].SenValue % 1000); + } + } + + /*Receive statistics */ + + len += sprintf(buffer + len, + "\nReceive statistics\n\n"); + + len += sprintf(buffer + len, + "Received bytes %s\n", + SkNumber(test_buf, pPnmiStat->StatRxOctetsOkCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Received packets %s\n", + SkNumber(test_buf, pPnmiStat->StatRxOkCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Received errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxFcsCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Received dropped %s\n", + SkNumber(test_buf, pPnmiStruct->RxNoBufCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Received multicast %s\n", + SkNumber(test_buf, pPnmiStat->StatRxMulticastOkCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Received errors types\n"); + len += sprintf(buffer + len, + " length errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxRuntCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " over errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxFifoOverflowCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " crc errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxFcsCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " frame errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxFramingCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " fifo errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxFifoOverflowCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " missed errors %s\n", + SkNumber(test_buf, pPnmiStat->StatRxMissedCts, + 10, 0, -1, 0)); + + + /*Transmit statistics */ + + len += sprintf(buffer + len, + "\nTransmit statistics\n\n"); + + len += sprintf(buffer + len, + "Transmit bytes %s\n", + SkNumber(test_buf, pPnmiStat->StatTxOctetsOkCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Transmit packets %s\n", + SkNumber(test_buf, pPnmiStat->StatTxOkCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Transmit errors %s\n", + SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Transmit dropped %s\n", + SkNumber(test_buf, pPnmiStruct->TxNoBufCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Transmit collisions %s\n", + SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, + 10,0,-1,0)); + len += sprintf(buffer + len, + "Transmited errors types\n"); + len += sprintf(buffer + len, + " aborted errors %ld\n", + pAC->stats.tx_aborted_errors); + len += sprintf(buffer + len, + " carrier errors %s\n", + SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " fifo errors %s\n", + SkNumber(test_buf, pPnmiStat->StatTxFifoUnderrunCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " heartbeat errors %s\n", + SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, + 10, 0, -1, 0)); + len += sprintf(buffer + len, + " window errors %ld\n", + pAC->stats.tx_window_errors); + } + } + SkgeProcDev = next; + } + + if (offset >= len) { + *eof = 1; + return 0; + } + + *buffer_location = buffer + offset; + if (buffer_length >= len - offset) { + *eof = 1; + } + + return (min(buffer_length, len - offset)); +} + + + + + +/***************************************************************************** + * + * SkDoDiv - convert 64bit number + * + * Description: + * This function "converts" a long long number. + * + * Returns: + * remainder of division + */ +static long SkDoDiv (long long Dividend, int Divisor, long long *pErg) +{ + long Rest; + long long Ergebnis; + long Akku; + + + Akku = Dividend >> 32; + + Ergebnis = ((long long) (Akku / Divisor)) << 32; + Rest = Akku % Divisor ; + + Akku = Rest << 16; + Akku |= ((Dividend & 0xFFFF0000) >> 16); + + + Ergebnis += ((long long) (Akku / Divisor)) << 16; + Rest = Akku % Divisor ; + + Akku = Rest << 16; + Akku |= (Dividend & 0xFFFF); + + Ergebnis += (Akku / Divisor); + Rest = Akku % Divisor ; + + *pErg = Ergebnis; + return (Rest); +} + + +#if 0 +#define do_div(n,base) ({ \ +long long __res; \ +__res = ((unsigned long long) n) % (unsigned) base; \ +n = ((unsigned long long) n) / (unsigned) base; \ +__res; }) + +#endif + + +/***************************************************************************** + * + * SkNumber - Print results + * + * Description: + * This function converts a long long number into a string. + * + * Returns: + * number as string + */ +char * SkNumber(char * str, long long num, int base, int size, int precision + ,int type) +{ + char c,sign,tmp[66], *strorg = str; + const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; + int i; + + if (type & LARGE) + digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return 0; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + else if (base == 8) + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + tmp[i++] = digits[SkDoDiv(num,base, &num)]; + + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) + while(size-->0) + *str++ = ' '; + if (sign) + *str++ = sign; + if (type & SPECIAL) { + if (base==8) + *str++ = '0'; + else if (base==16) { + *str++ = '0'; + *str++ = digits[33]; + } + } + if (!(type & LEFT)) + while (size-- > 0) + *str++ = c; + while (i < precision--) + *str++ = '0'; + while (i-- > 0) + *str++ = tmp[i]; + while (size-- > 0) + *str++ = ' '; + + str[0] = '\0'; + + return strorg; +} + + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skqueue.c linux.20p9/drivers/net/sk98lin/skqueue.c --- linux.vanilla/drivers/net/sk98lin/skqueue.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skqueue.c Wed Jul 4 16:03:56 2001 @@ -147,7 +147,7 @@ * send command to state machine * end * return error reported by individual Event function - * 0 if no error occured. + * 0 if no error occurred. */ int SkEventDispatcher( SK_AC *pAC, /* Adapters Context */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skrlmt.c linux.20p9/drivers/net/sk98lin/skrlmt.c --- linux.vanilla/drivers/net/sk98lin/skrlmt.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skrlmt.c Wed Jul 4 16:03:56 2001 @@ -2,16 +2,15 @@ * * Name: skrlmt.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.49 $ - * Date: $Date: 1999/11/22 13:38:02 $ + * Version: $Revision: 1.61 $ + * Date: $Date: 2001/03/14 12:52:08 $ * Purpose: Manage links on SK-NET Adapters, esp. redundant ones. * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,15 +26,53 @@ * History: * * $Log: skrlmt.c,v $ + * Revision 1.61 2001/03/14 12:52:08 rassmann + * Fixed reporting of active port up/down to PNMI. + * + * Revision 1.60 2001/02/21 16:02:25 gklug + * fix: when RLMT starts set Active Port for PNMI + * + * Revision 1.59 2001/02/16 14:38:19 rassmann + * Initializing some pointers earlier in the init phase. + * Rx Mbufs are freed if the net which they belong to is stopped. + * + * Revision 1.58 2001/02/14 14:06:31 rassmann + * Editorial changes. + * + * Revision 1.57 2001/02/05 14:25:26 rassmann + * Prepared RLMT for transparent operation. + * + * Revision 1.56 2001/01/30 10:29:09 rassmann + * Not checking switching befor RlmtStart. + * Editorial changes. + * + * Revision 1.55 2001/01/22 13:41:38 rassmann + * Supporting two nets on dual-port adapters. + * + * Revision 1.54 2000/11/30 13:25:07 rassmann + * Setting SK_TICK_INCR to 1 by default. + * + * Revision 1.53 2000/11/30 10:48:07 cgoos + * Changed definition of SK_RLMT_BC_DELTA. + * + * Revision 1.52 2000/11/27 12:50:03 rassmann + * Checking ports after receiving broadcasts. + * + * Revision 1.51 2000/11/17 08:58:00 rassmann + * Moved CheckSwitch from SK_RLMT_PACKET_RECEIVED to SK_RLMT_TIM event. + * + * Revision 1.50 2000/11/09 12:24:34 rassmann + * Indicating that segmentation check is not running anymore after + * SkRlmtCheckSeg(). + * Restarting segmentation timer after segmentation log. + * Editorial changes. + * * Revision 1.49 1999/11/22 13:38:02 cgoos * Changed license header to GPL. * Added initialization to some variables to avoid compiler warnings. * * Revision 1.48 1999/10/04 14:01:17 rassmann - * Corrected reaction to reception of BPDU frames. - * Added parameter descriptions to "For Readme" section skrlmt.txt. - * Clarified usage of lookahead result *pForRlmt. - * Requested driver to present RLMT packets as soon as poosible. + * Corrected reaction to reception of BPDU frames (#10441). * * Revision 1.47 1999/07/20 12:53:36 rassmann * Fixed documentation errors for lookahead macros. @@ -66,7 +103,7 @@ * * Revision 1.40 1999/01/22 13:17:30 rassmann * Informing PNMI of NET_UP. - * Clearing RLMT multicast addresses before first setting them. + * Clearing RLMT multicast addresses before setting them for the first time. * Reporting segmentation earlier, setting a "quiet time" * after a report. * @@ -218,13 +255,13 @@ #ifndef lint static const char SysKonnectFileId[] = - "@(#) $Id: skrlmt.c,v 1.49 1999/11/22 13:38:02 cgoos Exp $ (C) SysKonnect."; + "@(#) $Id: skrlmt.c,v 1.61 2001/03/14 12:52:08 rassmann Exp $ (C) SysKonnect."; #endif /* !defined(lint) */ #define __SKRLMT_C #ifdef __cplusplus -xxxx /* not supported yet - force error */ +#error C++ is not yet supported. extern "C" { #endif /* cplusplus */ @@ -245,11 +282,13 @@ #ifndef SK_LITTLE_ENDIAN /* First 32 bits */ #define OFFS_LO32 1 + /* Second 32 bits */ #define OFFS_HI32 0 #else /* SK_LITTLE_ENDIAN */ /* First 32 bits */ #define OFFS_LO32 0 + /* Second 32 bits */ #define OFFS_HI32 1 #endif /* SK_LITTLE_ENDIAN */ @@ -258,58 +297,60 @@ /* ----- Private timeout values ----- */ -#define SK_RLMT_MIN_TO_VAL 125000 /* 1/8 sec. */ -#define SK_RLMT_DEF_TO_VAL 1000000 /* 1 sec. */ +#define SK_RLMT_MIN_TO_VAL 125000 /* 1/8 sec. */ +#define SK_RLMT_DEF_TO_VAL 1000000 /* 1 sec. */ #define SK_RLMT_PORTDOWN_TIM_VAL 900000 /* another 0.9 sec. */ #define SK_RLMT_PORTSTART_TIM_VAL 100000 /* 0.1 sec. */ #define SK_RLMT_PORTUP_TIM_VAL 2500000 /* 2.5 sec. */ -#define SK_RLMT_SEG_TO_VAL 900000000 /* 15 min. */ +#define SK_RLMT_SEG_TO_VAL 900000000 /* 15 min. */ + +/* Assume tick counter increment is 1 - may be set OS-dependent. */ +#ifndef SK_TICK_INCR +#define SK_TICK_INCR SK_CONSTU64(1) +#endif /* !defined(SK_TICK_INCR) */ /* * Amount that a time stamp must be later to be recognized as "substantially - * later". This is about 1/128 sec. + * later". This is about 1/128 sec, but above 1 tick counter increment. */ - -#define SK_RLMT_BC_DELTA ((SK_TICKS_PER_SEC >> 7) + 1) +#define SK_RLMT_BC_DELTA (1 + ((SK_TICKS_PER_SEC >> 7) > SK_TICK_INCR ? \ + (SK_TICKS_PER_SEC >> 7) : SK_TICK_INCR)) /* ----- Private RLMT defaults ----- */ -#define SK_RLMT_DEF_PREF_PORT 0 /* "Lower" port. */ -#define SK_RLMT_DEF_MODE SK_RLMT_CHECK_LINK /* Default RLMT Mode. */ +#define SK_RLMT_DEF_PREF_PORT 0 /* "Lower" port. */ +#define SK_RLMT_DEF_MODE SK_RLMT_CHECK_LINK /* Default RLMT Mode. */ /* ----- Private RLMT checking states ----- */ -#define SK_RLMT_RCS_SEG 1 /* RLMT Check State: check seg. */ -#define SK_RLMT_RCS_START_SEG 2 /* RLMT Check State: start check seg. */ -#define SK_RLMT_RCS_SEND_SEG 4 /* RLMT Check State: send BPDU packet */ -#define SK_RLMT_RCS_REPORT_SEG 8 /* RLMT Check State: report seg. */ +#define SK_RLMT_RCS_SEG 1 /* RLMT Check State: check seg. */ +#define SK_RLMT_RCS_START_SEG 2 /* RLMT Check State: start check seg. */ +#define SK_RLMT_RCS_SEND_SEG 4 /* RLMT Check State: send BPDU packet */ +#define SK_RLMT_RCS_REPORT_SEG 8 /* RLMT Check State: report seg. */ /* ----- Private PORT checking states ----- */ -#define SK_RLMT_PCS_TX 1 /* Port Check State: check tx. */ -#define SK_RLMT_PCS_RX 2 /* Port Check State: check rx. */ +#define SK_RLMT_PCS_TX 1 /* Port Check State: check tx. */ +#define SK_RLMT_PCS_RX 2 /* Port Check State: check rx. */ /* ----- Private PORT events ----- */ /* Note: Update simulation when changing these. */ - #define SK_RLMT_PORTSTART_TIM 1100 /* Port start timeout. */ -#define SK_RLMT_PORTUP_TIM 1101 /* Port can now go up. */ +#define SK_RLMT_PORTUP_TIM 1101 /* Port can now go up. */ #define SK_RLMT_PORTDOWN_RX_TIM 1102 /* Port did not receive once ... */ -#define SK_RLMT_PORTDOWN 1103 /* Port went down. */ +#define SK_RLMT_PORTDOWN 1103 /* Port went down. */ #define SK_RLMT_PORTDOWN_TX_TIM 1104 /* Partner did not receive ... */ /* ----- Private RLMT events ----- */ /* Note: Update simulation when changing these. */ - -#define SK_RLMT_TIM 2100 /* RLMT timeout. */ -#define SK_RLMT_SEG_TIM 2101 /* RLMT segmentation check timeout. */ +#define SK_RLMT_TIM 2100 /* RLMT timeout. */ +#define SK_RLMT_SEG_TIM 2101 /* RLMT segmentation check timeout. */ #define TO_SHORTEN(tim) ((tim) / 2) /* Error numbers and messages. */ - #define SKERR_RLMT_E001 (SK_ERRBASE_RLMT + 0) #define SKERR_RLMT_E001_MSG "No Packet." #define SKERR_RLMT_E002 (SKERR_RLMT_E001 + 1) @@ -333,78 +374,70 @@ #define SKERR_RLMT_E010_MSG "Ignored illegal Preferred Port." /* LLC field values. */ - -#define LLC_COMMAND_RESPONSE_BIT 1 -#define LLC_TEST_COMMAND 0xE3 -#define LLC_UI 0x03 +#define LLC_COMMAND_RESPONSE_BIT 1 +#define LLC_TEST_COMMAND 0xE3 +#define LLC_UI 0x03 /* RLMT Packet fields. */ - -#define SK_RLMT_DSAP 0 -#define SK_RLMT_SSAP 0 -#define SK_RLMT_CTRL (LLC_TEST_COMMAND) -#define SK_RLMT_INDICATOR0 0x53 /* S */ -#define SK_RLMT_INDICATOR1 0x4B /* K */ -#define SK_RLMT_INDICATOR2 0x2D /* - */ -#define SK_RLMT_INDICATOR3 0x52 /* R */ -#define SK_RLMT_INDICATOR4 0x4C /* L */ -#define SK_RLMT_INDICATOR5 0x4D /* M */ -#define SK_RLMT_INDICATOR6 0x54 /* T */ -#define SK_RLMT_PACKET_VERSION 0 +#define SK_RLMT_DSAP 0 +#define SK_RLMT_SSAP 0 +#define SK_RLMT_CTRL (LLC_TEST_COMMAND) +#define SK_RLMT_INDICATOR0 0x53 /* S */ +#define SK_RLMT_INDICATOR1 0x4B /* K */ +#define SK_RLMT_INDICATOR2 0x2D /* - */ +#define SK_RLMT_INDICATOR3 0x52 /* R */ +#define SK_RLMT_INDICATOR4 0x4C /* L */ +#define SK_RLMT_INDICATOR5 0x4D /* M */ +#define SK_RLMT_INDICATOR6 0x54 /* T */ +#define SK_RLMT_PACKET_VERSION 0 /* RLMT SPT Flag values. */ - -#define SK_RLMT_SPT_FLAG_CHANGE 0x01 -#define SK_RLMT_SPT_FLAG_CHANGE_ACK 0x80 +#define SK_RLMT_SPT_FLAG_CHANGE 0x01 +#define SK_RLMT_SPT_FLAG_CHANGE_ACK 0x80 /* RLMT SPT Packet fields. */ - -#define SK_RLMT_SPT_DSAP 0x42 -#define SK_RLMT_SPT_SSAP 0x42 -#define SK_RLMT_SPT_CTRL (LLC_UI) -#define SK_RLMT_SPT_PROTOCOL_ID0 0x00 -#define SK_RLMT_SPT_PROTOCOL_ID1 0x00 +#define SK_RLMT_SPT_DSAP 0x42 +#define SK_RLMT_SPT_SSAP 0x42 +#define SK_RLMT_SPT_CTRL (LLC_UI) +#define SK_RLMT_SPT_PROTOCOL_ID0 0x00 +#define SK_RLMT_SPT_PROTOCOL_ID1 0x00 #define SK_RLMT_SPT_PROTOCOL_VERSION_ID 0x00 -#define SK_RLMT_SPT_BPDU_TYPE 0x00 -#define SK_RLMT_SPT_FLAGS 0x00 /* ?? */ -#define SK_RLMT_SPT_ROOT_ID0 0xFF /* Lowest possible priority. */ -#define SK_RLMT_SPT_ROOT_ID1 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_BPDU_TYPE 0x00 +#define SK_RLMT_SPT_FLAGS 0x00 /* ?? */ +#define SK_RLMT_SPT_ROOT_ID0 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_ROOT_ID1 0xFF /* Lowest possible priority. */ /* Remaining 6 bytes will be the current port address. */ - -#define SK_RLMT_SPT_ROOT_PATH_COST0 0x00 -#define SK_RLMT_SPT_ROOT_PATH_COST1 0x00 -#define SK_RLMT_SPT_ROOT_PATH_COST2 0x00 -#define SK_RLMT_SPT_ROOT_PATH_COST3 0x00 -#define SK_RLMT_SPT_BRIDGE_ID0 0xFF /* Lowest possible priority. */ -#define SK_RLMT_SPT_BRIDGE_ID1 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_ROOT_PATH_COST0 0x00 +#define SK_RLMT_SPT_ROOT_PATH_COST1 0x00 +#define SK_RLMT_SPT_ROOT_PATH_COST2 0x00 +#define SK_RLMT_SPT_ROOT_PATH_COST3 0x00 +#define SK_RLMT_SPT_BRIDGE_ID0 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_BRIDGE_ID1 0xFF /* Lowest possible priority. */ /* Remaining 6 bytes will be the current port address. */ - -#define SK_RLMT_SPT_PORT_ID0 0xFF /* Lowest possible priority. */ -#define SK_RLMT_SPT_PORT_ID1 0xFF /* Lowest possible priority. */ -#define SK_RLMT_SPT_MSG_AGE0 0x00 -#define SK_RLMT_SPT_MSG_AGE1 0x00 -#define SK_RLMT_SPT_MAX_AGE0 0x00 -#define SK_RLMT_SPT_MAX_AGE1 0xFF -#define SK_RLMT_SPT_HELLO_TIME0 0x00 -#define SK_RLMT_SPT_HELLO_TIME1 0xFF -#define SK_RLMT_SPT_FWD_DELAY0 0x00 -#define SK_RLMT_SPT_FWD_DELAY1 0x40 +#define SK_RLMT_SPT_PORT_ID0 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_PORT_ID1 0xFF /* Lowest possible priority. */ +#define SK_RLMT_SPT_MSG_AGE0 0x00 +#define SK_RLMT_SPT_MSG_AGE1 0x00 +#define SK_RLMT_SPT_MAX_AGE0 0x00 +#define SK_RLMT_SPT_MAX_AGE1 0xFF +#define SK_RLMT_SPT_HELLO_TIME0 0x00 +#define SK_RLMT_SPT_HELLO_TIME1 0xFF +#define SK_RLMT_SPT_FWD_DELAY0 0x00 +#define SK_RLMT_SPT_FWD_DELAY1 0x40 /* Size defines. */ - -#define SK_RLMT_MIN_PACKET_SIZE 34 -#define SK_RLMT_MAX_PACKET_SIZE (SK_RLMT_MAX_TX_BUF_SIZE) -#define SK_PACKET_DATA_LEN (SK_RLMT_MAX_PACKET_SIZE - \ - SK_RLMT_MIN_PACKET_SIZE) +#define SK_RLMT_MIN_PACKET_SIZE 34 +#define SK_RLMT_MAX_PACKET_SIZE (SK_RLMT_MAX_TX_BUF_SIZE) +#define SK_PACKET_DATA_LEN (SK_RLMT_MAX_PACKET_SIZE - \ + SK_RLMT_MIN_PACKET_SIZE) /* ----- RLMT packet types ----- */ - -#define SK_PACKET_ANNOUNCE 1 /* Port announcement. */ -#define SK_PACKET_ALIVE 2 /* Alive packet to port. */ -#define SK_PACKET_ADDR_CHANGED 3 /* Port address changed. */ -#define SK_PACKET_CHECK_TX 4 /* Check your tx line. */ +#define SK_PACKET_ANNOUNCE 1 /* Port announcement. */ +#define SK_PACKET_ALIVE 2 /* Alive packet to port. */ +#define SK_PACKET_ADDR_CHANGED 3 /* Port address changed. */ +#define SK_PACKET_CHECK_TX 4 /* Check your tx line. */ #ifdef SK_LITTLE_ENDIAN #define SK_U16_TO_NETWORK_ORDER(Val,Addr) { \ @@ -426,7 +459,6 @@ /* typedefs *******************************************************************/ /* RLMT packet. Length: SK_RLMT_MAX_PACKET_SIZE (60) bytes. */ - typedef struct s_RlmtPacket { SK_U8 DstAddr[SK_MAC_ADDR_LEN]; SK_U8 SrcAddr[SK_MAC_ADDR_LEN]; @@ -437,8 +469,8 @@ SK_U8 Indicator[7]; SK_U8 RlmtPacketType[2]; SK_U8 Align1[2]; - SK_U8 Random[4]; /* Random value of requesting(!) station. */ - SK_U8 RlmtPacketVersion[2]; /* RLMT Packet version */ + SK_U8 Random[4]; /* Random value of requesting(!) station. */ + SK_U8 RlmtPacketVersion[2]; /* RLMT Packet version. */ SK_U8 Data[SK_PACKET_DATA_LEN]; } SK_RLMT_PACKET; @@ -465,9 +497,9 @@ /* global variables ***********************************************************/ -SK_MAC_ADDR SkRlmtMcAddr = {{0x01, 0x00, 0x5A, 0x52, 0x4C, 0x4D}}; -SK_MAC_ADDR BridgeMcAddr = {{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}; -SK_MAC_ADDR BcAddr = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}; +SK_MAC_ADDR SkRlmtMcAddr = {{0x01, 0x00, 0x5A, 0x52, 0x4C, 0x4D}}; +SK_MAC_ADDR BridgeMcAddr = {{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}; +SK_MAC_ADDR BcAddr = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}; /* local variables ************************************************************/ @@ -477,10 +509,16 @@ RLMT_STATIC void SkRlmtCheckSwitch( SK_AC *pAC, - SK_IOC IoC); + SK_IOC IoC, + SK_U32 NetIdx); RLMT_STATIC void SkRlmtCheckSeg( SK_AC *pAC, - SK_IOC IoC); + SK_IOC IoC, + SK_U32 NetIdx); +RLMT_STATIC void SkRlmtEvtSetNets( + SK_AC *pAC, + SK_IOC IoC, + SK_EVPARA Para); /****************************************************************************** * @@ -506,7 +544,7 @@ * =========== * * Determine the adapter's random value. - * Set the hw registers, the "logical adapter address", the + * Set the hw registers, the "logical MAC address", the * RLMT multicast address, and eventually the BPDU multicast address. * * Context: @@ -516,18 +554,15 @@ * Nothing. */ void SkRlmtInit( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -int Level) /* initialization level */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +int Level) /* Initialization Level */ { SK_U32 i, j; SK_U64 Random; SK_EVPARA Para; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_INIT, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_INIT, ("RLMT Init level %d.\n", Level)) switch (Level) { @@ -541,68 +576,70 @@ pAC->Rlmt.Port[i].PortStarted = SK_FALSE; pAC->Rlmt.Port[i].PortNoRx = SK_FALSE; pAC->Rlmt.Port[i].RootIdSet = SK_FALSE; - } - - pAC->Rlmt.RlmtState = SK_RLMT_RS_INIT; - pAC->Rlmt.RootIdSet = SK_FALSE; - pAC->Rlmt.MacPreferred = 0xFFFFFFFF; /* Automatic. */ - pAC->Rlmt.PrefPort = SK_RLMT_DEF_PREF_PORT; - pAC->Rlmt.MacActive = pAC->Rlmt.PrefPort; /* Just assuming. */ - pAC->Rlmt.RlmtMode = SK_RLMT_DEF_MODE; - pAC->Rlmt.TimeoutValue = SK_RLMT_DEF_TO_VAL; + pAC->Rlmt.Port[i].PortNumber = i; + pAC->Rlmt.Port[i].Net = &pAC->Rlmt.Net[0]; + pAC->Rlmt.Port[i].AddrPort = &pAC->Addr.Port[i]; + } + + pAC->Rlmt.NumNets = 1; + for (i = 0; i < SK_MAX_NETS; i++) { + pAC->Rlmt.Net[i].RlmtState = SK_RLMT_RS_INIT; + pAC->Rlmt.Net[i].RootIdSet = SK_FALSE; + pAC->Rlmt.Net[i].Preference = 0xFFFFFFFF; /* Automatic. */ + pAC->Rlmt.Net[i].PrefPort = SK_RLMT_DEF_PREF_PORT; + /* Just assuming. */ + pAC->Rlmt.Net[i].ActivePort = pAC->Rlmt.Net[i].PrefPort; + pAC->Rlmt.Net[i].RlmtMode = SK_RLMT_DEF_MODE; + pAC->Rlmt.Net[i].TimeoutValue = SK_RLMT_DEF_TO_VAL; + pAC->Rlmt.Net[i].NetNumber = i; + } + + pAC->Rlmt.Net[0].Port[0] = &pAC->Rlmt.Port[0]; + pAC->Rlmt.Net[0].Port[1] = &pAC->Rlmt.Port[1]; +#if SK_MAX_NETS > 1 + pAC->Rlmt.Net[1].Port[0] = &pAC->Rlmt.Port[1]; +#endif /* SK_MAX_NETS > 1 */ break; case SK_INIT_IO: /* GIMacsFound first available here. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_INIT, - ("RLMT: %d MACs were detected.\n", - pAC->GIni.GIMacsFound)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_INIT, + ("RLMT: %d MACs were detected.\n", pAC->GIni.GIMacsFound)) - /* Initialize HW registers? */ + pAC->Rlmt.Net[0].NumPorts = pAC->GIni.GIMacsFound; + /* Initialize HW registers? */ if (pAC->GIni.GIMacsFound < 2) { - Para.Para32[0] = SK_RLMT_CHECK_LINK; + Para.Para32[0] = SK_RLMT_MODE_CLS; + Para.Para32[1] = 0; (void)SkRlmtEvent(pAC, IoC, SK_RLMT_MODE_CHANGE, Para); } break; case SK_INIT_RUN: + /* Ensure RLMT is set to one net. */ + if (pAC->Rlmt.NumNets > 1) { + Para.Para32[0] = 1; + Para.Para32[1] = -1; + SkRlmtEvtSetNets(pAC, IoC, Para); + } + for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { Random = SkOsGetTime(pAC); *(SK_U32*)&pAC->Rlmt.Port[i].Random = *(SK_U32*)&Random; for (j = 0; j < 4; j++) { - pAC->Rlmt.Port[i].Random[j] ^= pAC->Addr.Port[i - ].CurrentMacAddress.a[SK_MAC_ADDR_LEN - - 1 - j]; + pAC->Rlmt.Port[i].Random[j] ^= pAC->Rlmt.Port[i].AddrPort-> + CurrentMacAddress.a[SK_MAC_ADDR_LEN - 1 - j]; } - (void)SkAddrMcClear( - pAC, - IoC, - i, - SK_ADDR_PERMANENT | SK_MC_SW_ONLY); + (void)SkAddrMcClear(pAC, IoC, i, SK_ADDR_PERMANENT | SK_MC_SW_ONLY); /* Add RLMT MC address. */ + (void)SkAddrMcAdd(pAC, IoC, i, &SkRlmtMcAddr, SK_ADDR_PERMANENT); - (void)SkAddrMcAdd( - pAC, - IoC, - i, - &SkRlmtMcAddr, - SK_ADDR_PERMANENT); - - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { + if (pAC->Rlmt.Net[0].RlmtMode & SK_RLMT_CHECK_SEG) { /* Add BPDU MC address. */ - - (void)SkAddrMcAdd( - pAC, - IoC, - i, - &BridgeMcAddr, - SK_ADDR_PERMANENT); + (void)SkAddrMcAdd(pAC, IoC, i, &BridgeMcAddr, SK_ADDR_PERMANENT); } (void)SkAddrMcUpdate(pAC, IoC, i); @@ -612,9 +649,7 @@ default: /* error */ break; } - return; - } /* SkRlmtInit */ @@ -639,32 +674,33 @@ * Nothing */ RLMT_STATIC void SkRlmtBuildCheckChain( -SK_AC *pAC) /* adapter context */ +SK_AC *pAC, /* Adapter Context */ +SK_U32 NetIdx) /* Net Number */ { - SK_U32 i; - SK_U32 NumMacsUp; - SK_U32 FirstMacUp=0; - SK_U32 PrevMacUp=0; + SK_U32 i; + SK_U32 NumMacsUp; + SK_RLMT_PORT * FirstMacUp; + SK_RLMT_PORT * PrevMacUp; - if (!(pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK)) { - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pAC->Rlmt.Port[i].PortsChecked = 0; + FirstMacUp = NULL; + PrevMacUp = NULL; + + if (!(pAC->Rlmt.Net[NetIdx].RlmtMode & SK_RLMT_CHECK_LOC_LINK)) { + for (i = 0; i < pAC->Rlmt.Net[i].NumPorts; i++) { + pAC->Rlmt.Net[NetIdx].Port[i]->PortsChecked = 0; } - return; /* Nothing to build. */ + return; /* Done. */ } - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("SkRlmtBuildCheckChain.\n")) NumMacsUp = 0; - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pAC->Rlmt.Port[i].PortsChecked = 0; - pAC->Rlmt.Port[i].PortsSuspect = 0; - pAC->Rlmt.Port[i].CheckingState &= + for (i = 0; i < pAC->Rlmt.Net[NetIdx].NumPorts; i++) { + pAC->Rlmt.Net[NetIdx].Port[i]->PortsChecked = 0; + pAC->Rlmt.Net[NetIdx].Port[i]->PortsSuspect = 0; + pAC->Rlmt.Net[NetIdx].Port[i]->CheckingState &= ~(SK_RLMT_PCS_RX | SK_RLMT_PCS_TX); /* @@ -673,156 +709,43 @@ * 1. the next port that is not LinkDown and * 2. the next port that is not PortDown. */ - - if (!pAC->Rlmt.Port[i].LinkDown) { + if (!pAC->Rlmt.Net[NetIdx].Port[i]->LinkDown) { if (NumMacsUp == 0) { - FirstMacUp = i; + FirstMacUp = pAC->Rlmt.Net[NetIdx].Port[i]; } else { - pAC->Rlmt.Port[PrevMacUp].PortCheck[ - pAC->Rlmt.Port[ - PrevMacUp].PortsChecked].CheckAddr = - pAC->Addr.Port[i].CurrentMacAddress; - pAC->Rlmt.Port[PrevMacUp].PortCheck[ - pAC->Rlmt.Port[ - PrevMacUp].PortsChecked].SuspectTx = - SK_FALSE; - pAC->Rlmt.Port[PrevMacUp].PortsChecked++; + pAC->Rlmt.Net[NetIdx].Port[i]->PortCheck[ + pAC->Rlmt.Net[NetIdx].Port[i]->PortsChecked].CheckAddr = + pAC->Rlmt.Net[NetIdx].Port[i]->AddrPort->CurrentMacAddress; + PrevMacUp->PortCheck[ + PrevMacUp->PortsChecked].SuspectTx = SK_FALSE; + PrevMacUp->PortsChecked++; } - PrevMacUp = i; + PrevMacUp = pAC->Rlmt.Net[NetIdx].Port[i]; NumMacsUp++; } } if (NumMacsUp > 1) { - pAC->Rlmt.Port[PrevMacUp].PortCheck[pAC->Rlmt.Port[ - PrevMacUp].PortsChecked].CheckAddr = - pAC->Addr.Port[FirstMacUp].CurrentMacAddress; - pAC->Rlmt.Port[PrevMacUp].PortCheck[pAC->Rlmt.Port[ - PrevMacUp].PortsChecked].SuspectTx = SK_FALSE; - pAC->Rlmt.Port[PrevMacUp].PortsChecked++; + PrevMacUp->PortCheck[PrevMacUp->PortsChecked].CheckAddr = + FirstMacUp->AddrPort->CurrentMacAddress; + PrevMacUp->PortCheck[PrevMacUp->PortsChecked].SuspectTx = + SK_FALSE; + PrevMacUp->PortsChecked++; } #ifdef DEBUG - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("Port %d checks %d other ports: %2X.\n", - i, - pAC->Rlmt.Port[i].PortsChecked, - pAC->Rlmt.Port[i].PortCheck[0].CheckAddr.a[5])) + for (i = 0; i < pAC->Rlmt.Net[NetIdx].NumPorts; i++) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Port %d checks %d other ports: %2X.\n", NetIdx, + pAC->Rlmt.Net[NetIdx].Port[i]->PortsChecked, + pAC->Rlmt.Net[NetIdx].Port[i]->PortCheck[0].CheckAddr.a[5])) } #endif /* DEBUG */ return; } /* SkRlmtBuildCheckChain */ -#ifdef SK_RLMT_SLOW_LOOKAHEAD - -/****************************************************************************** - * - * SkRlmtLookaheadPacket - examine received packet shortly, count s-th - * - * Description: - * This routine examines each received packet fast and short and - * increments some counters. - * The received packet has to be stored virtually contiguous. - * This function does the following: - * - Increment some counters. - * - Ensure length is sufficient. - * - Ensure that destination address is physical port address, - * RLMT multicast, or BPDU multicast address. - * - * Notes: - * This function is fully reentrant while the fast path is not blocked. - * - * Context: - * isr/dpr, not pageable - * - * Returns: - * SK_FALSE packet for upper layers - * SK_TRUE packet for RLMT - */ -SK_BOOL SkRlmtLookaheadPacket( -SK_AC *pAC, /* adapter context */ -SK_U32 PortIdx, /* receiving port */ -SK_U8 *pLaPacket, /* received packet's data */ -unsigned PacketLength, /* received packet's length */ /* Necessary? */ -unsigned LaLength) /* lookahead length */ -{ - int i; - SK_BOOL IsBc; /* Broadcast address? */ - int RxDest; /* Receive destination? */ - int Offset; /* Offset of data to present to LOOKAHEAD. */ - int NumBytes; /* #Bytes to present to LOOKAHEAD. */ - SK_RLMT_PACKET *pRPacket; - SK_ADDR_PORT *pAPort; - -#ifdef DEBUG - PacketLength = PacketLength; -#endif /* DEBUG */ - - pRPacket = (SK_RLMT_PACKET*)pLaPacket; - pAPort = &pAC->Addr.Port[PortIdx]; - -#ifdef DEBUG - if (pLaPacket == NULL) { - - /* Create error log entry. */ - - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E001, - SKERR_RLMT_E001_MSG); - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, - ("SkRlmtLookaheadPacket: NULL pointer.\n")) - - return (SK_FALSE); - } -#endif /* DEBUG */ - - /* Drivers should get IsBc from the descriptor. */ - - IsBc = SK_TRUE; - for (i = 0; IsBc && i < SK_MAC_ADDR_LEN; i++) { - IsBc = IsBc && (pLaPacket[i] == 0xFF); - } - - SK_RLMT_PRE_LOOKAHEAD( - pAC, - PortIdx, - PacketLength, - IsBc, - &Offset, - &NumBytes) - - if (NumBytes == 0) { - return (SK_FALSE); - } - - SK_RLMT_LOOKAHEAD( - pAC, - PortIdx, - &pLaPacket[Offset], - IsBc, - pLaPacket[0] & 1, /* Drivers: Get info from descriptor. */ - &RxDest) - - if (RxDest & SK_RLMT_RX_RLMT) { - return (SK_TRUE); - } - - return (SK_FALSE); -} /* SkRlmtLookaheadPacket */ - -#endif /* SK_RLMT_SLOW_LOOKAHEAD */ /****************************************************************************** * @@ -838,20 +761,19 @@ * NULL or pointer to RLMT mbuf */ RLMT_STATIC SK_MBUF *SkRlmtBuildPacket( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx, /* sending port */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber, /* Sending port */ SK_U16 PacketType, /* RLMT packet type */ -SK_MAC_ADDR *SrcAddr, /* source address */ -SK_MAC_ADDR *DestAddr) /* destination address */ +SK_MAC_ADDR *SrcAddr, /* Source address */ +SK_MAC_ADDR *DestAddr) /* Destination address */ { int i; SK_U16 Length; SK_MBUF *pMb; SK_RLMT_PACKET *pPacket; - if ((pMb = SkDrvAllocRlmtMbuf(pAC, IoC, SK_RLMT_MAX_PACKET_SIZE)) != - NULL) { + if ((pMb = SkDrvAllocRlmtMbuf(pAC, IoC, SK_RLMT_MAX_PACKET_SIZE)) != NULL) { pPacket = (SK_RLMT_PACKET*)pMb->pData; for (i = 0; i < SK_MAC_ADDR_LEN; i++) { pPacket->DstAddr[i] = DestAddr->a[i]; @@ -868,17 +790,14 @@ pPacket->Indicator[5] = SK_RLMT_INDICATOR5; pPacket->Indicator[6] = SK_RLMT_INDICATOR6; - SK_U16_TO_NETWORK_ORDER( - PacketType, - &pPacket->RlmtPacketType[0]); + SK_U16_TO_NETWORK_ORDER(PacketType, &pPacket->RlmtPacketType[0]); for (i = 0; i < 4; i++) { - pPacket->Random[i] = pAC->Rlmt.Port[PortIdx].Random[i]; + pPacket->Random[i] = pAC->Rlmt.Port[PortNumber].Random[i]; } SK_U16_TO_NETWORK_ORDER( - SK_RLMT_PACKET_VERSION, - &pPacket->RlmtPacketVersion[0]); + SK_RLMT_PACKET_VERSION, &pPacket->RlmtPacketVersion[0]); for (i = 0; i < SK_PACKET_DATA_LEN; i++) { pPacket->Data[i] = 0x00; @@ -886,12 +805,12 @@ Length = SK_RLMT_MAX_PACKET_SIZE; /* Or smaller. */ pMb->Length = Length; - pMb->PortIdx = PortIdx; + pMb->PortIdx = PortNumber; Length -= 14; SK_U16_TO_NETWORK_ORDER(Length, &pPacket->TypeLen[0]); if (PacketType == SK_PACKET_ALIVE) { - pAC->Rlmt.Port[PortIdx].TxHelloCts++; + pAC->Rlmt.Port[PortNumber].TxHelloCts++; } } @@ -913,13 +832,13 @@ * NULL or pointer to RLMT mbuf */ RLMT_STATIC SK_MBUF *SkRlmtBuildSpanningTreePacket( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) /* sending port */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber) /* Sending port */ { - unsigned i; - SK_U16 Length; - SK_MBUF *pMb; + unsigned i; + SK_U16 Length; + SK_MBUF *pMb; SK_SPTREE_PACKET *pSPacket; if ((pMb = SkDrvAllocRlmtMbuf(pAC, IoC, SK_RLMT_MAX_PACKET_SIZE)) != @@ -928,7 +847,7 @@ for (i = 0; i < SK_MAC_ADDR_LEN; i++) { pSPacket->DstAddr[i] = BridgeMcAddr.a[i]; pSPacket->SrcAddr[i] = - pAC->Addr.Port[PortIdx].CurrentMacAddress.a[i]; + pAC->Addr.Port[PortNumber].CurrentMacAddress.a[i]; } pSPacket->DSap = SK_RLMT_SPT_DSAP; pSPacket->SSap = SK_RLMT_SPT_SSAP; @@ -949,13 +868,13 @@ pSPacket->BridgeId[1] = SK_RLMT_SPT_BRIDGE_ID1; /* - * Use virtual address as bridge ID and filter these packets + * Use logical MAC address as bridge ID and filter these packets * on receive. */ - for (i = 0; i < SK_MAC_ADDR_LEN; i++) { pSPacket->BridgeId[i + 2] = pSPacket->RootId[i + 2] = - pAC->Addr.CurrentMacAddress.a[i]; + pAC->Addr.Net[pAC->Rlmt.Port[PortNumber].Net->NetNumber]. + CurrentMacAddress.a[i]; } pSPacket->PortId[0] = SK_RLMT_SPT_PORT_ID0; pSPacket->PortId[1] = SK_RLMT_SPT_PORT_ID1; @@ -970,11 +889,11 @@ Length = SK_RLMT_MAX_PACKET_SIZE; /* Or smaller. */ pMb->Length = Length; - pMb->PortIdx = PortIdx; + pMb->PortIdx = PortNumber; Length -= 14; SK_U16_TO_NETWORK_ORDER(Length, &pSPacket->TypeLen[0]); - pAC->Rlmt.Port[PortIdx].TxSpHelloReqCts++; + pAC->Rlmt.Port[PortNumber].TxSpHelloReqCts++; } return (pMb); @@ -996,36 +915,22 @@ * Nothing. */ RLMT_STATIC void SkRlmtSend( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber) /* Sending port */ { unsigned j; SK_EVPARA Para; SK_RLMT_PORT *pRPort; - pRPort = &pAC->Rlmt.Port[PortIdx]; - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK) { - if (pRPort->CheckingState & - (SK_RLMT_PCS_TX | SK_RLMT_PCS_RX)) { - - /* - * Port is suspicious. Send the RLMT packet to the - * RLMT multicast address. - */ - - if ((Para.pParaPtr = SkRlmtBuildPacket( - pAC, - IoC, - PortIdx, - SK_PACKET_ALIVE, - &pAC->Addr.Port[PortIdx].CurrentMacAddress, + pRPort = &pAC->Rlmt.Port[PortNumber]; + if (pAC->Rlmt.Port[PortNumber].Net->RlmtMode & SK_RLMT_CHECK_LOC_LINK) { + if (pRPort->CheckingState & (SK_RLMT_PCS_TX | SK_RLMT_PCS_RX)) { + /* Port is suspicious. Send the RLMT packet to the RLMT mc addr. */ + if ((Para.pParaPtr = SkRlmtBuildPacket(pAC, IoC, PortNumber, + SK_PACKET_ALIVE, &pAC->Addr.Port[PortNumber].CurrentMacAddress, &SkRlmtMcAddr)) != NULL) { - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } } else { @@ -1033,61 +938,33 @@ * Send a directed RLMT packet to all ports that are * checked by the indicated port. */ - for (j = 0; j < pRPort->PortsChecked; j++) { - if ((Para.pParaPtr = - SkRlmtBuildPacket( - pAC, - IoC, - PortIdx, - SK_PACKET_ALIVE, - &pAC->Addr.Port[PortIdx].CurrentMacAddress, - &pRPort->PortCheck[j].CheckAddr) - ) != NULL) { - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + if ((Para.pParaPtr = SkRlmtBuildPacket(pAC, IoC, PortNumber, + SK_PACKET_ALIVE, &pAC->Addr.Port[PortNumber].CurrentMacAddress, + &pRPort->PortCheck[j].CheckAddr)) != NULL) { + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } } } } - if ((pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) && - (pAC->Rlmt.CheckingState & SK_RLMT_RCS_SEND_SEG)) { - + if ((pAC->Rlmt.Port[PortNumber].Net->RlmtMode & SK_RLMT_CHECK_SEG) && + (pAC->Rlmt.Port[PortNumber].Net->CheckingState & SK_RLMT_RCS_SEND_SEG)) { /* * Send a BPDU packet to make a connected switch tell us * the correct root bridge. */ - if ((Para.pParaPtr = - SkRlmtBuildSpanningTreePacket( - pAC, - IoC, - PortIdx) - ) != NULL) { - - pAC->Rlmt.CheckingState &= ~SK_RLMT_RCS_SEND_SEG; + SkRlmtBuildSpanningTreePacket(pAC, IoC, PortNumber)) != NULL) { + pAC->Rlmt.Port[PortNumber].Net->CheckingState &= ~SK_RLMT_RCS_SEND_SEG; pRPort->RootIdSet = SK_FALSE; - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_TX, - ("SkRlmtSend: BPDU Packet on Port %u.\n", - PortIdx)) + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_TX, + ("SkRlmtSend: BPDU Packet on Port %u.\n", PortNumber)) } - } - - return; - + } + return; } /* SkRlmtSend */ @@ -1099,61 +976,51 @@ * This routine checks if a port who received a non-BPDU packet * needs to go up or needs to be stopped going down. * -* Context: + * Context: * runtime, pageable? * * Returns: * Nothing. */ RLMT_STATIC void SkRlmtPortReceives( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) /* port to check */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber) /* Port to check */ { SK_RLMT_PORT *pRPort; - SK_EVPARA Para; + SK_EVPARA Para; - pRPort = &pAC->Rlmt.Port[PortIdx]; + pRPort = &pAC->Rlmt.Port[PortNumber]; pRPort->PortNoRx = SK_FALSE; if ((pRPort->PortState == SK_RLMT_PS_DOWN) && !(pRPort->CheckingState & SK_RLMT_PCS_TX)) { - /* * Port is marked down (rx), but received a non-BPDU packet. * Bring it up. */ - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Received on PortDown.\n")) pRPort->PortState = SK_RLMT_PS_GOING_UP; pRPort->GuTimeStamp = SkOsGetTime(pAC); - Para.Para32[0] = PortIdx; - SkTimerStart( - pAC, - IoC, - &pRPort->UpTimer, - SK_RLMT_PORTUP_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTUP_TIM, - Para); - SkRlmtCheckSwitch(pAC, IoC); - } + Para.Para32[0] = PortNumber; + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->UpTimer, SK_RLMT_PORTUP_TIM_VAL, + SKGE_RLMT, SK_RLMT_PORTUP_TIM, Para); + pRPort->CheckingState &= ~SK_RLMT_PCS_RX; + /* pAC->Rlmt.CheckSwitch = SK_TRUE; */ + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); + } /* PortDown && !SuspectTx */ else if (pRPort->CheckingState & SK_RLMT_PCS_RX) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Stop bringing port down.\n")) SkTimerStop(pAC, IoC, &pRPort->DownRxTimer); - SkRlmtCheckSwitch(pAC, IoC); - } + pRPort->CheckingState &= ~SK_RLMT_PCS_RX; + /* pAC->Rlmt.CheckSwitch = SK_TRUE; */ + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); + } /* PortGoingDown */ - pRPort->CheckingState &= ~SK_RLMT_PCS_RX; return; } /* SkRlmtPortReceives */ @@ -1163,7 +1030,7 @@ * SkRlmtPacketReceive - receive a packet for closer examination * * Description: - * This routine examines a packet more closely than SkRlmtLookahead*(). + * This routine examines a packet more closely than SK_RLMT_LOOKAHEAD. * * Context: * runtime, pageable? @@ -1172,32 +1039,29 @@ * Nothing. */ RLMT_STATIC void SkRlmtPacketReceive( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_MBUF *pMb) /* received packet */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_MBUF *pMb) /* Received packet */ { #ifdef xDEBUG extern void DumpData(char *p, int size); #endif /* DEBUG */ - int i; - unsigned j; - SK_U16 PacketType; - SK_U32 PortIdx; + int i; + unsigned j; + SK_U16 PacketType; + SK_U32 PortNumber; SK_ADDR_PORT *pAPort; SK_RLMT_PORT *pRPort; SK_RLMT_PACKET *pRPacket; SK_SPTREE_PACKET *pSPacket; - SK_EVPARA Para; + SK_EVPARA Para; + + PortNumber = pMb->PortIdx; + pAPort = &pAC->Addr.Port[PortNumber]; + pRPort = &pAC->Rlmt.Port[PortNumber]; - PortIdx = pMb->PortIdx; - pAPort = &pAC->Addr.Port[PortIdx]; - pRPort = &pAC->Rlmt.Port[PortIdx]; - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, - ("SkRlmtPacketReceive: PortIdx == %d.\n", PortIdx)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, + ("SkRlmtPacketReceive: PortNumber == %d.\n", PortNumber)) pRPacket = (SK_RLMT_PACKET*)pMb->pData; pSPacket = (SK_SPTREE_PACKET*)pRPacket; @@ -1207,7 +1071,7 @@ #endif /* DEBUG */ if ((pRPort->PacketsPerTimeSlot - pRPort->BpduPacketsPerTimeSlot) != 0) { - SkRlmtPortReceives(pAC, IoC, PortIdx); + SkRlmtPortReceives(pAC, IoC, PortNumber); } /* Check destination address. */ @@ -1216,15 +1080,8 @@ !SK_ADDR_EQUAL(SkRlmtMcAddr.a, pRPacket->DstAddr) && !SK_ADDR_EQUAL(BridgeMcAddr.a, pRPacket->DstAddr)) { - /* - * Not sent to current MAC or registered MC address - * => Trash it. - */ - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + /* Not sent to current MAC or registered MC address => Trash it. */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Not for me.\n")) SkDrvFreeRlmtMbuf(pAC, IoC, pMb); @@ -1241,19 +1098,17 @@ * Check for duplicate address here: * If Packet.Random != My.Random => DupAddr. */ - for (i = 3; i >= 0; i--) { - if (pRPort->Random[i] != - pRPacket->Random[i]) { + if (pRPort->Random[i] != pRPacket->Random[i]) { break; } } /* - * CAUTION: Do not check for duplicate MAC - * address in RLMT Alive Reply packets. + * CAUTION: Do not check for duplicate MAC address in RLMT Alive Reply + * packets (they have the LLC_COMMAND_RESPONSE_BIT set in + * pRPacket->SSap). */ - if (i >= 0 && pRPacket->DSap == SK_RLMT_DSAP && pRPacket->Ctrl == SK_RLMT_CTRL && pRPacket->SSap == SK_RLMT_SSAP && @@ -1264,43 +1119,28 @@ pRPacket->Indicator[4] == SK_RLMT_INDICATOR4 && pRPacket->Indicator[5] == SK_RLMT_INDICATOR5 && pRPacket->Indicator[6] == SK_RLMT_INDICATOR6) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Duplicate MAC Address.\n")) /* Error Log entry. */ - - SK_ERR_LOG( - pAC, - SK_ERRCL_COMM, - SKERR_RLMT_E006, - SKERR_RLMT_E006_MSG); + SK_ERR_LOG(pAC, SK_ERRCL_COMM, SKERR_RLMT_E006, SKERR_RLMT_E006_MSG); } else { /* Simply trash it. */ - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Sent by me.\n")) } SkDrvFreeRlmtMbuf(pAC, IoC, pMb); - return; } /* Check SuspectTx entries. */ - if (pRPort->PortsSuspect > 0) { for (j = 0; j < pRPort->PortsChecked; j++) { if (pRPort->PortCheck[j].SuspectTx && SK_ADDR_EQUAL( - pRPacket->SrcAddr, - pRPort->PortCheck[j].CheckAddr.a)) { + pRPacket->SrcAddr, pRPort->PortCheck[j].CheckAddr.a)) { pRPort->PortCheck[j].SuspectTx = SK_FALSE; pRPort->PortsSuspect--; break; @@ -1309,7 +1149,6 @@ } /* Determine type of packet. */ - if (pRPacket->DSap == SK_RLMT_DSAP && pRPacket->Ctrl == SK_RLMT_CTRL && (pRPacket->SSap & ~LLC_COMMAND_RESPONSE_BIT) == SK_RLMT_SSAP && @@ -1322,7 +1161,6 @@ pRPacket->Indicator[6] == SK_RLMT_INDICATOR6) { /* It's an RLMT packet. */ - PacketType = (SK_U16)((pRPacket->RlmtPacketType[0] << 8) | pRPacket->RlmtPacketType[1]); @@ -1330,14 +1168,10 @@ case SK_PACKET_ANNOUNCE: /* Not yet used. */ #if 0 /* Build the check chain. */ - SkRlmtBuildCheckChain(pAC); #endif /* 0 */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Announce.\n")) SkDrvFreeRlmtMbuf(pAC, IoC, pMb); @@ -1345,221 +1179,145 @@ case SK_PACKET_ALIVE: if (pRPacket->SSap & LLC_COMMAND_RESPONSE_BIT) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Alive Reply.\n")) - /* Alive Reply Packet. */ - -#if 0 - pRPort->RlmtAcksPerTimeSlot++; -#endif /* 0 */ - - if (!(pAC->Addr.Port[PortIdx].PromMode & - SK_PROM_MODE_LLC) || + if (!(pAC->Addr.Port[PortNumber].PromMode & SK_PROM_MODE_LLC) || SK_ADDR_EQUAL( - pRPacket->DstAddr, - pAPort->CurrentMacAddress.a)) { - + pRPacket->DstAddr, pAPort->CurrentMacAddress.a)) { /* Obviously we could send something. */ - - if (pRPort->CheckingState & - SK_RLMT_PCS_TX) { - pRPort->CheckingState &= - ~SK_RLMT_PCS_TX; - SkTimerStop( - pAC, - IoC, - &pRPort->DownTxTimer); + if (pRPort->CheckingState & SK_RLMT_PCS_TX) { + pRPort->CheckingState &= ~SK_RLMT_PCS_TX; + SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); } - if ((pRPort->PortState == - SK_RLMT_PS_DOWN) && - !(pRPort->CheckingState & - SK_RLMT_PCS_RX)) { - pRPort->PortState = - SK_RLMT_PS_GOING_UP; - pRPort->GuTimeStamp = - SkOsGetTime(pAC); - - SkTimerStop( - pAC, - IoC, - &pRPort->DownTxTimer); - - Para.Para32[0] = PortIdx; - SkTimerStart( - pAC, - IoC, - &pRPort->UpTimer, - SK_RLMT_PORTUP_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTUP_TIM, - Para); + if ((pRPort->PortState == SK_RLMT_PS_DOWN) && + !(pRPort->CheckingState & SK_RLMT_PCS_RX)) { + pRPort->PortState = SK_RLMT_PS_GOING_UP; + pRPort->GuTimeStamp = SkOsGetTime(pAC); + + SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); + + Para.Para32[0] = PortNumber; + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->UpTimer, + SK_RLMT_PORTUP_TIM_VAL, SKGE_RLMT, + SK_RLMT_PORTUP_TIM, Para); } } /* Mark sending port as alive? */ - SkDrvFreeRlmtMbuf(pAC, IoC, pMb); } else { /* Alive Request Packet. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Alive Request.\n")) pRPort->RxHelloCts++; -#if 0 - pRPort->RlmtChksPerTimeSlot++; -#endif /* 0 */ /* Answer. */ - for (i = 0; i < SK_MAC_ADDR_LEN; i++) { - pRPacket->DstAddr[i] = - pRPacket->SrcAddr[i]; - pRPacket->SrcAddr[i] = pAC->Addr.Port[ - PortIdx].CurrentMacAddress.a[i]; + pRPacket->DstAddr[i] = pRPacket->SrcAddr[i]; + pRPacket->SrcAddr[i] = + pAC->Addr.Port[PortNumber].CurrentMacAddress.a[i]; } pRPacket->SSap |= LLC_COMMAND_RESPONSE_BIT; Para.pParaPtr = pMb; - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } break; case SK_PACKET_CHECK_TX: - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Check your tx line.\n")) - /* - * A port checking us requests us to check our tx line. - */ - + /* A port checking us requests us to check our tx line. */ pRPort->CheckingState |= SK_RLMT_PCS_TX; /* Start PortDownTx timer. */ - - Para.Para32[0] = PortIdx; - SkTimerStart( - pAC, - IoC, - &pRPort->DownTxTimer, - SK_RLMT_PORTDOWN_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTDOWN_TX_TIM, - Para); + Para.Para32[0] = PortNumber; + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->DownTxTimer, + SK_RLMT_PORTDOWN_TIM_VAL, SKGE_RLMT, + SK_RLMT_PORTDOWN_TX_TIM, Para); SkDrvFreeRlmtMbuf(pAC, IoC, pMb); - if ((Para.pParaPtr = SkRlmtBuildPacket( - pAC, - IoC, - PortIdx, - SK_PACKET_ALIVE, - &pAC->Addr.Port[PortIdx].CurrentMacAddress, + if ((Para.pParaPtr = SkRlmtBuildPacket(pAC, IoC, PortNumber, + SK_PACKET_ALIVE, &pAC->Addr.Port[PortNumber].CurrentMacAddress, &SkRlmtMcAddr)) != NULL) { - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } break; case SK_PACKET_ADDR_CHANGED: - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Address Change.\n")) /* Build the check chain. */ - - SkRlmtBuildCheckChain(pAC); + SkRlmtBuildCheckChain(pAC, pRPort->Net->NetNumber); SkDrvFreeRlmtMbuf(pAC, IoC, pMb); break; default: - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Unknown RLMT packet.\n")) /* RA;:;: ??? */ - SkDrvFreeRlmtMbuf(pAC, IoC, pMb); } } else if (pSPacket->DSap == SK_RLMT_SPT_DSAP && pSPacket->Ctrl == SK_RLMT_SPT_CTRL && - (pSPacket->SSap & ~LLC_COMMAND_RESPONSE_BIT) == - SK_RLMT_SPT_SSAP) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + (pSPacket->SSap & ~LLC_COMMAND_RESPONSE_BIT) == SK_RLMT_SPT_SSAP) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: BPDU Packet.\n")) /* Spanning Tree packet. */ - pRPort->RxSpHelloCts++; - if (!SK_ADDR_EQUAL( - &pSPacket->RootId[2], - &pAC->Addr.CurrentMacAddress.a[0])) { - + if (!SK_ADDR_EQUAL(&pSPacket->RootId[2], &pAC->Addr.Net[pAC->Rlmt. + Port[PortNumber].Net->NetNumber].CurrentMacAddress.a[0])) { /* * Check segmentation if a new root bridge is set and * the segmentation check is not currently running. */ - - if (!SK_ADDR_EQUAL( - &pSPacket->RootId[2], - &pRPort->Root.Id[2]) && - (pAC->Rlmt.LinksUp > 1) && - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) && - !(pAC->Rlmt.CheckingState & SK_RLMT_RCS_SEG)) { - pAC->Rlmt.CheckingState |= - SK_RLMT_RCS_START_SEG | - SK_RLMT_RCS_SEND_SEG; + if (!SK_ADDR_EQUAL(&pSPacket->RootId[2], &pRPort->Root.Id[2]) && + (pAC->Rlmt.Port[PortNumber].Net->LinksUp > 1) && + (pAC->Rlmt.Port[PortNumber].Net->RlmtMode & SK_RLMT_CHECK_SEG) + != 0 && (pAC->Rlmt.Port[PortNumber].Net->CheckingState & + SK_RLMT_RCS_SEG) == 0) { + pAC->Rlmt.Port[PortNumber].Net->CheckingState |= + SK_RLMT_RCS_START_SEG | SK_RLMT_RCS_SEND_SEG; } /* Store tree view of this port. */ - for (i = 0; i < 8; i++) { pRPort->Root.Id[i] = pSPacket->RootId[i]; } pRPort->RootIdSet = SK_TRUE; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_DUMP, + ("Root ID %d: %02x %02x %02x %02x %02x %02x %02x %02x.\n", + PortNumber, + pRPort->Root.Id[0], pRPort->Root.Id[1], + pRPort->Root.Id[2], pRPort->Root.Id[3], + pRPort->Root.Id[4], pRPort->Root.Id[5], + pRPort->Root.Id[6], pRPort->Root.Id[7])) } SkDrvFreeRlmtMbuf(pAC, IoC, pMb); - - if (pAC->Rlmt.CheckingState & SK_RLMT_RCS_REPORT_SEG) { - SkRlmtCheckSeg(pAC, IoC); + if ((pAC->Rlmt.Port[PortNumber].Net->CheckingState & + SK_RLMT_RCS_REPORT_SEG) != 0) { + SkRlmtCheckSeg(pAC, IoC, pAC->Rlmt.Port[PortNumber].Net->NetNumber); } } else { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_RX, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_RX, ("SkRlmtPacketReceive: Unknown Packet Type.\n")) /* Unknown packet. */ - SkDrvFreeRlmtMbuf(pAC, IoC, pMb); } return; @@ -1625,25 +1383,21 @@ * New timeout value. */ RLMT_STATIC SK_U32 SkRlmtCheckPort( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) /* port to check */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber) /* Port to check */ { - unsigned i; - SK_U32 NewTimeout; + unsigned i; + SK_U32 NewTimeout; SK_RLMT_PORT *pRPort; - SK_EVPARA Para; + SK_EVPARA Para; - pRPort = &pAC->Rlmt.Port[PortIdx]; + pRPort = &pAC->Rlmt.Port[PortNumber]; if ((pRPort->PacketsPerTimeSlot - pRPort->BpduPacketsPerTimeSlot) == 0) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("SkRlmtCheckPort %d: No (%d) receives in last time slot.\n", - PortIdx, - pRPort->PacketsPerTimeSlot)) + PortNumber, pRPort->PacketsPerTimeSlot)) /* * Check segmentation if there was no receive at least twice @@ -1651,46 +1405,35 @@ * check is not currently running. */ - if (pRPort->PortNoRx && (pAC->Rlmt.LinksUp > 1) && - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) && - !(pAC->Rlmt.CheckingState & SK_RLMT_RCS_SEG)) { - pAC->Rlmt.CheckingState |= + if (pRPort->PortNoRx && (pAC->Rlmt.Port[PortNumber].Net->LinksUp > 1) && + (pAC->Rlmt.Port[PortNumber].Net->RlmtMode & SK_RLMT_CHECK_SEG) && + !(pAC->Rlmt.Port[PortNumber].Net->CheckingState & SK_RLMT_RCS_SEG)) { + pAC->Rlmt.Port[PortNumber].Net->CheckingState |= SK_RLMT_RCS_START_SEG | SK_RLMT_RCS_SEND_SEG; } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("SkRlmtCheckPort: PortsSuspect %d, PcsRx %d.\n", - pRPort->PortsSuspect, - pRPort->CheckingState & SK_RLMT_PCS_RX)) + pRPort->PortsSuspect, pRPort->CheckingState & SK_RLMT_PCS_RX)) if (pRPort->PortState != SK_RLMT_PS_DOWN) { - NewTimeout = TO_SHORTEN(pAC->Rlmt.TimeoutValue); + NewTimeout = TO_SHORTEN(pAC->Rlmt.Port[PortNumber].Net->TimeoutValue); if (NewTimeout < SK_RLMT_MIN_TO_VAL) { NewTimeout = SK_RLMT_MIN_TO_VAL; } if (!(pRPort->CheckingState & SK_RLMT_PCS_RX)) { - Para.Para32[0] = PortIdx; + Para.Para32[0] = PortNumber; pRPort->CheckingState |= SK_RLMT_PCS_RX; /* - * What shall we do if the port checked - * by this one receives our request - * frames? What's bad - our rx line - * or his tx line? + * What shall we do if the port checked by this one receives + * our request frames? What's bad - our rx line or his tx line? */ - - SkTimerStart( - pAC, - IoC, - &pRPort->DownRxTimer, - SK_RLMT_PORTDOWN_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTDOWN_RX_TIM, - Para); + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->DownRxTimer, + SK_RLMT_PORTDOWN_TIM_VAL, SKGE_RLMT, + SK_RLMT_PORTDOWN_RX_TIM, Para); for (i = 0; i < pRPort->PortsChecked; i++) { if (pRPort->PortCheck[i].SuspectTx) { @@ -1699,19 +1442,10 @@ pRPort->PortCheck[i].SuspectTx = SK_TRUE; pRPort->PortsSuspect++; if ((Para.pParaPtr = - SkRlmtBuildPacket( - pAC, - IoC, - PortIdx, - SK_PACKET_CHECK_TX, - &pAC->Addr.Port[PortIdx].CurrentMacAddress, - &pRPort->PortCheck[i].CheckAddr) - ) != NULL) { - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + SkRlmtBuildPacket(pAC, IoC, PortNumber, SK_PACKET_CHECK_TX, + &pAC->Addr.Port[PortNumber].CurrentMacAddress, + &pRPort->PortCheck[i].CheckAddr)) != NULL) { + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } } } @@ -1722,17 +1456,17 @@ pRPort->PortNoRx = SK_TRUE; } else { /* A non-BPDU packet was received. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("SkRlmtCheckPort %d: %d (%d) receives in last time slot.\n", - PortIdx, - pRPort->PacketsPerTimeSlot - - pRPort->BpduPacketsPerTimeSlot, + PortNumber, + pRPort->PacketsPerTimeSlot - pRPort->BpduPacketsPerTimeSlot, pRPort->PacketsPerTimeSlot)) - SkRlmtPortReceives(pAC, IoC, PortIdx); + SkRlmtPortReceives(pAC, IoC, PortNumber); + if (pAC->Rlmt.CheckSwitch) { + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); + } + NewTimeout = SK_RLMT_DEF_TO_VAL; } @@ -1755,82 +1489,69 @@ * SK_BOOL */ RLMT_STATIC SK_BOOL SkRlmtSelectBcRx( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 A, /* active port */ -SK_U32 P, /* preferred port */ -SK_U32 *N) /* new active port */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Active, /* Active port */ +SK_U32 PrefPort, /* Preferred port */ +SK_U32 *pSelect) /* New active port */ { SK_U64 BcTimeStamp; SK_U32 i; SK_BOOL PortFound; - BcTimeStamp = 0; /* Not totally necessary, but feeling better. */ + BcTimeStamp = 0; /* Not totally necessary, but feeling better. */ PortFound = SK_FALSE; /* Select port with the latest TimeStamp. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("TimeStamp Port %d: %.08x%.08x.\n", - i, - *((SK_U32*)(&pAC->Rlmt.Port[i].BcTimeStamp) + OFFS_HI32), - *((SK_U32*)(&pAC->Rlmt.Port[i].BcTimeStamp) + OFFS_LO32))) - if (!pAC->Rlmt.Port[i].PortDown && - !pAC->Rlmt.Port[i].PortNoRx) { - if (!PortFound || - pAC->Rlmt.Port[i].BcTimeStamp > BcTimeStamp) { +#ifdef xDEBUG + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("TimeStamp Port %d: %08x %08x.\n", + i, + *((SK_U32*)(&pAC->Rlmt.Port[i].BcTimeStamp) + OFFS_HI32), + *((SK_U32*)(&pAC->Rlmt.Port[i].BcTimeStamp) + OFFS_LO32))) +#endif /* DEBUG */ + if (!pAC->Rlmt.Port[i].PortDown && !pAC->Rlmt.Port[i].PortNoRx) { + if (!PortFound || pAC->Rlmt.Port[i].BcTimeStamp > BcTimeStamp) { BcTimeStamp = pAC->Rlmt.Port[i].BcTimeStamp; - *N = i; + *pSelect = i; PortFound = SK_TRUE; } } } if (PortFound) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("Port %d received the last broadcast.\n", *N)) +#if 0 + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Port %d received the last broadcast.\n", *pSelect)) +#endif /* 0 */ /* Look if another port's time stamp is similar. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (i == *N) { + if (i == *pSelect) { continue; } - if (!pAC->Rlmt.Port[i].PortDown && - !pAC->Rlmt.Port[i].PortNoRx && + if (!pAC->Rlmt.Port[i].PortDown && !pAC->Rlmt.Port[i].PortNoRx && (pAC->Rlmt.Port[i].BcTimeStamp > - BcTimeStamp - SK_RLMT_BC_DELTA || - pAC->Rlmt.Port[i].BcTimeStamp - + SK_RLMT_BC_DELTA > BcTimeStamp)) { + BcTimeStamp - SK_RLMT_BC_DELTA || + pAC->Rlmt.Port[i].BcTimeStamp + + SK_RLMT_BC_DELTA > BcTimeStamp)) { PortFound = SK_FALSE; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("Port %d received a broadcast %s.\n", - i, - "at a similar time")) +#ifdef xDEBUG + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Port %d received a broadcast at a similar time.\n", i)) +#endif /* DEBUG */ break; } } } -#ifdef DEBUG +#ifdef xDEBUG if (PortFound) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_CHECK_SWITCH found Port %d receiving %s.\n", - *N, - "the substantially latest broadcast")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_CHECK_SWITCH found Port %d receiving the substantially latest broadcast (%d).\n", + *pSelect, + BcTimeStamp - pAC->Rlmt.Port[1 - *pSelect].BcTimeStamp)) } #endif /* DEBUG */ @@ -1852,11 +1573,11 @@ * SK_BOOL */ RLMT_STATIC SK_BOOL SkRlmtSelectNotSuspect( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 A, /* active port */ -SK_U32 P, /* preferred port */ -SK_U32 *N) /* new active port */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Active, /* Active port */ +SK_U32 PrefPort, /* Preferred port */ +SK_U32 *pSelect) /* New active port */ { SK_U32 i; SK_BOOL PortFound; @@ -1864,32 +1585,25 @@ PortFound = SK_FALSE; /* Select first port that is PortUp && !SuspectRx. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { if (!pAC->Rlmt.Port[i].PortDown && !(pAC->Rlmt.Port[i].CheckingState & SK_RLMT_PCS_RX)) { - *N = i; - if (!pAC->Rlmt.Port[A].PortDown && - !(pAC->Rlmt.Port[A].CheckingState & - SK_RLMT_PCS_RX)) { - *N = A; - } - if (!pAC->Rlmt.Port[P].PortDown && - !(pAC->Rlmt.Port[P].CheckingState & - SK_RLMT_PCS_RX)) { - *N = P; + *pSelect = i; + if (!pAC->Rlmt.Port[Active].PortDown && + !(pAC->Rlmt.Port[Active].CheckingState & SK_RLMT_PCS_RX)) { + *pSelect = Active; + } + if (!pAC->Rlmt.Port[PrefPort].PortDown && + !(pAC->Rlmt.Port[PrefPort].CheckingState & SK_RLMT_PCS_RX)) { + *pSelect = PrefPort; } PortFound = SK_TRUE; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("SK_RLMT_CHECK_SWITCH found Port %d up and not check RX.\n", - *N)) + *pSelect)) break; } } - return (PortFound); } /* SkRlmtSelectNotSuspect */ @@ -1908,12 +1622,12 @@ * SK_BOOL */ RLMT_STATIC SK_BOOL SkRlmtSelectUp( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 A, /* active port */ -SK_U32 P, /* preferred port */ -SK_U32 *N, /* new active port */ -SK_BOOL AutoNegDone) /* successfully auto-negotiated? */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Active, /* Active port */ +SK_U32 PrefPort, /* Preferred port */ +SK_U32 *pSelect, /* New active port */ +SK_BOOL AutoNegDone) /* Successfully auto-negotiated? */ { SK_U32 i; SK_BOOL PortFound; @@ -1921,30 +1635,24 @@ PortFound = SK_FALSE; /* Select first port that is PortUp. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { if (pAC->Rlmt.Port[i].PortState == SK_RLMT_PS_UP && pAC->GIni.GP[i].PAutoNegFail != AutoNegDone) { - *N = i; - if (pAC->Rlmt.Port[A].PortState == SK_RLMT_PS_UP && - pAC->GIni.GP[A].PAutoNegFail != AutoNegDone) { - *N = A; - } - if (pAC->Rlmt.Port[P].PortState == SK_RLMT_PS_UP && - pAC->GIni.GP[P].PAutoNegFail != AutoNegDone) { - *N = P; + *pSelect = i; + if (pAC->Rlmt.Port[Active].PortState == SK_RLMT_PS_UP && + pAC->GIni.GP[Active].PAutoNegFail != AutoNegDone) { + *pSelect = Active; + } + if (pAC->Rlmt.Port[PrefPort].PortState == SK_RLMT_PS_UP && + pAC->GIni.GP[PrefPort].PAutoNegFail != AutoNegDone) { + *pSelect = PrefPort; } PortFound = SK_TRUE; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_CHECK_SWITCH found Port %d up.\n", - *N)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_CHECK_SWITCH found Port %d up.\n", *pSelect)) break; } } - return (PortFound); } /* SkRlmtSelectUp */ @@ -1963,26 +1671,26 @@ * SK_BOOL */ RLMT_STATIC SK_BOOL SkRlmtSelectGoingUp( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 A, /* active port */ -SK_U32 P, /* preferred port */ -SK_U32 *N, /* new active port */ -SK_BOOL AutoNegDone) /* successfully auto-negotiated? */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Active, /* Active port */ +SK_U32 PrefPort, /* Preferred port */ +SK_U32 *pSelect, /* New active port */ +SK_BOOL AutoNegDone) /* Successfully auto-negotiated? */ { - SK_U64 GuTimeStamp=0; + SK_U64 GuTimeStamp; SK_U32 i; SK_BOOL PortFound; + GuTimeStamp = 0; PortFound = SK_FALSE; /* Select port that is PortGoingUp for the longest time. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { if (pAC->Rlmt.Port[i].PortState == SK_RLMT_PS_GOING_UP && pAC->GIni.GP[i].PAutoNegFail != AutoNegDone) { - GuTimeStamp = pAC->Rlmt.Port[i].GuTimeStamp; - *N = i; + GuTimeStamp = pAC->Rlmt.Port[i].GuTimeStamp; + *pSelect = i; PortFound = SK_TRUE; break; } @@ -1992,22 +1700,17 @@ return (SK_FALSE); } - for (i = *N + 1; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { + for (i = *pSelect + 1; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { if (pAC->Rlmt.Port[i].PortState == SK_RLMT_PS_GOING_UP && - pAC->Rlmt.Port[i].GuTimeStamp < GuTimeStamp && + pAC->Rlmt.Port[i].GuTimeStamp < GuTimeStamp && pAC->GIni.GP[i].PAutoNegFail != AutoNegDone) { - - GuTimeStamp = pAC->Rlmt.Port[i].GuTimeStamp; - *N = i; + GuTimeStamp = pAC->Rlmt.Port[i].GuTimeStamp; + *pSelect = i; } } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_CHECK_SWITCH found Port %d going up.\n", *N)) - + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_CHECK_SWITCH found Port %d going up.\n", *pSelect)) return (SK_TRUE); } /* SkRlmtSelectGoingUp */ @@ -2026,12 +1729,12 @@ * SK_BOOL */ RLMT_STATIC SK_BOOL SkRlmtSelectDown( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 A, /* active port */ -SK_U32 P, /* preferred port */ -SK_U32 *N, /* new active port */ -SK_BOOL AutoNegDone) /* successfully auto-negotiated? */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Active, /* Active port */ +SK_U32 PrefPort, /* Preferred port */ +SK_U32 *pSelect, /* New active port */ +SK_BOOL AutoNegDone) /* Successfully auto-negotiated? */ { SK_U32 i; SK_BOOL PortFound; @@ -2039,30 +1742,24 @@ PortFound = SK_FALSE; /* Select first port that is PortDown. */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { if (pAC->Rlmt.Port[i].PortState == SK_RLMT_PS_DOWN && pAC->GIni.GP[i].PAutoNegFail != AutoNegDone) { - *N = i; - if (pAC->Rlmt.Port[A].PortState == SK_RLMT_PS_DOWN && - pAC->GIni.GP[A].PAutoNegFail != AutoNegDone) { - *N = A; - } - if (pAC->Rlmt.Port[P].PortState == SK_RLMT_PS_DOWN && - pAC->GIni.GP[P].PAutoNegFail != AutoNegDone) { - *N = P; + *pSelect = i; + if (pAC->Rlmt.Port[Active].PortState == SK_RLMT_PS_DOWN && + pAC->GIni.GP[Active].PAutoNegFail != AutoNegDone) { + *pSelect = Active; + } + if (pAC->Rlmt.Port[PrefPort].PortState == SK_RLMT_PS_DOWN && + pAC->GIni.GP[PrefPort].PAutoNegFail != AutoNegDone) { + *pSelect = PrefPort; } PortFound = SK_TRUE; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_CHECK_SWITCH found Port %d down.\n", - *N)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_CHECK_SWITCH found Port %d down.\n", *pSelect)) break; } } - return (PortFound); } /* SkRlmtSelectDown */ @@ -2082,58 +1779,50 @@ * Nothing. */ RLMT_STATIC void SkRlmtCheckSwitch( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC) /* I/O context */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 NetIdx) /* Net index */ { SK_EVPARA Para; - SK_U32 A; - SK_U32 P; + SK_U32 Active; + SK_U32 PrefPort; SK_U32 i; SK_BOOL PortFound; - if (pAC->Rlmt.RlmtState == SK_RLMT_RS_INIT) { - return; - } - - A = pAC->Rlmt.MacActive; /* Index of active port. */ - P = pAC->Rlmt.PrefPort; /* Index of preferred port. */ + Active = pAC->Rlmt.Net[NetIdx].ActivePort; /* Index of active port. */ + PrefPort = pAC->Rlmt.Net[NetIdx].PrefPort; /* Index of preferred port. */ PortFound = SK_FALSE; + pAC->Rlmt.CheckSwitch = SK_FALSE; - if (pAC->Rlmt.LinksUp == 0) { - - /* - * Last link went down - shut down the net. - */ - - pAC->Rlmt.RlmtState = SK_RLMT_RS_NET_DOWN; + if (pAC->Rlmt.Net[NetIdx].LinksUp == 0) { + /* Last link went down - shut down the net. */ + pAC->Rlmt.Net[NetIdx].RlmtState = SK_RLMT_RS_NET_DOWN; Para.Para32[0] = SK_RLMT_NET_DOWN_TEMP; - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_NET_DOWN, - Para); + Para.Para32[1] = NetIdx; + SkEventQueue(pAC, SKGE_DRV, SK_DRV_NET_DOWN, Para); + Para.Para32[0] = pAC->Rlmt.Net[NetIdx]. + Port[pAC->Rlmt.Net[NetIdx].ActivePort]->PortNumber; + Para.Para32[1] = NetIdx; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_ACTIVE_DOWN, Para); return; - } - else if (pAC->Rlmt.LinksUp == 1 && - pAC->Rlmt.RlmtState == SK_RLMT_RS_NET_DOWN) { - + } /* pAC->Rlmt.LinksUp == 0 */ + else if (pAC->Rlmt.Net[NetIdx].LinksUp == 1 && + pAC->Rlmt.Net[NetIdx].RlmtState == SK_RLMT_RS_NET_DOWN) { /* First link came up - get the net up. */ - - pAC->Rlmt.RlmtState = SK_RLMT_RS_NET_UP; + pAC->Rlmt.Net[NetIdx].RlmtState = SK_RLMT_RS_NET_UP; /* - * If pAC->Rlmt.MacActive != Para.Para32[0], + * If pAC->Rlmt.ActivePort != Para.Para32[0], * the DRV switches to the port that came up. */ - - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (!pAC->Rlmt.Port[i].LinkDown) { - if (!pAC->Rlmt.Port[A].LinkDown) { - i = A; + for (i = 0; i < pAC->Rlmt.Net[NetIdx].NumPorts; i++) { + if (!pAC->Rlmt.Net[NetIdx].Port[i]->LinkDown) { + if (!pAC->Rlmt.Net[NetIdx].Port[Active]->LinkDown) { + i = Active; } - if (!pAC->Rlmt.Port[P].LinkDown) { - i = P; + if (!pAC->Rlmt.Net[NetIdx].Port[PrefPort]->LinkDown) { + i = PrefPort; } PortFound = SK_TRUE; break; @@ -2141,184 +1830,143 @@ } if (PortFound) { - Para.Para32[0] = pAC->Rlmt.MacActive; - Para.Para32[1] = i; - SkEventQueue( - pAC, - SKGE_PNMI, - SK_PNMI_EVT_RLMT_PORT_SWITCH, - Para); - - pAC->Rlmt.MacActive = i; - Para.Para32[0] = i; + Para.Para32[0] = pAC->Rlmt.Net[NetIdx].Port[i]->PortNumber; + Para.Para32[1] = NetIdx; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_ACTIVE_UP, Para); + + pAC->Rlmt.Net[NetIdx].ActivePort = i; + Para.Para32[0] = pAC->Rlmt.Net[NetIdx].Port[i]->PortNumber; + Para.Para32[1] = NetIdx; SkEventQueue(pAC, SKGE_DRV, SK_DRV_NET_UP, Para); - if ((Para.pParaPtr = SkRlmtBuildPacket( - pAC, - IoC, - i, - SK_PACKET_ANNOUNCE, - &pAC->Addr.CurrentMacAddress, - &SkRlmtMcAddr) - ) != NULL) { - + if ((pAC->Rlmt.Net[NetIdx].RlmtMode & SK_RLMT_TRANSPARENT) == 0 && + (Para.pParaPtr = SkRlmtBuildPacket(pAC, IoC, + pAC->Rlmt.Net[NetIdx].Port[i]->PortNumber, + SK_PACKET_ANNOUNCE, &pAC->Addr.Net[NetIdx]. + CurrentMacAddress, &SkRlmtMcAddr)) != NULL) { /* - * Send packet to RLMT multicast address - * to force switches to learn the new - * location of the address. + * Send announce packet to RLMT multicast address to force + * switches to learn the new location of the logical MAC address. */ - - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); } } else { - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E007, - SKERR_RLMT_E007_MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E007, SKERR_RLMT_E007_MSG); } return; - } - else { - Para.Para32[0] = A; + } /* LinksUp == 1 && RlmtState == SK_RLMT_RS_NET_DOWN */ + else { /* Cannot be reached in dual-net mode. */ + Para.Para32[0] = Active; /* * Preselection: - * If RLMT Mode != CheckLinkState - * select port that received a broadcast frame - * substantially later than all other ports - * else select first port that is not SuspectRx - * else select first port that is PortUp - * else select port that is PortGoingUp for the longest time - * else select first port that is PortDown - * else stop. + * If RLMT Mode != CheckLinkState + * select port that received a broadcast frame substantially later + * than all other ports + * else select first port that is not SuspectRx + * else select first port that is PortUp + * else select port that is PortGoingUp for the longest time + * else select first port that is PortDown + * else stop. * * For the preselected port: - * If ActivePort is equal in quality, select ActivePort. + * If ActivePort is equal in quality, select ActivePort. * - * If PrefPort is equal in quality, select PrefPort. + * If PrefPort is equal in quality, select PrefPort. * - * If MacActive != SelectedPort, - * If old ActivePort is LinkDown, - * SwitchHard - * else - * SwitchSoft + * If ActivePort != SelectedPort, + * If old ActivePort is LinkDown, + * SwitchHard + * else + * SwitchSoft */ - - if (pAC->Rlmt.RlmtMode != SK_RLMT_CHECK_LINK) { + if (pAC->Rlmt.Net[0].RlmtMode != SK_RLMT_MODE_CLS) { if (!PortFound) { - PortFound = SkRlmtSelectBcRx(pAC, IoC, - A, P, &Para.Para32[1]); + PortFound = SkRlmtSelectBcRx( + pAC, IoC, Active, PrefPort, &Para.Para32[1]); } if (!PortFound) { - PortFound = SkRlmtSelectNotSuspect(pAC, IoC, - A, P, &Para.Para32[1]); + PortFound = SkRlmtSelectNotSuspect( + pAC, IoC, Active, PrefPort, &Para.Para32[1]); } - } + } /* pAC->Rlmt.RlmtMode != SK_RLMT_MODE_CLS */ if (!PortFound) { - PortFound = SkRlmtSelectUp(pAC, IoC, - A, P, &Para.Para32[1], AUTONEG_SUCCESS); + PortFound = SkRlmtSelectUp( + pAC, IoC, Active, PrefPort, &Para.Para32[1], AUTONEG_SUCCESS); } if (!PortFound) { - PortFound = SkRlmtSelectUp(pAC, IoC, - A, P, &Para.Para32[1], AUTONEG_FAILED); + PortFound = SkRlmtSelectUp( + pAC, IoC, Active, PrefPort, &Para.Para32[1], AUTONEG_FAILED); } if (!PortFound) { - PortFound = SkRlmtSelectGoingUp(pAC, IoC, - A, P, &Para.Para32[1], AUTONEG_SUCCESS); + PortFound = SkRlmtSelectGoingUp( + pAC, IoC, Active, PrefPort, &Para.Para32[1], AUTONEG_SUCCESS); } if (!PortFound) { - PortFound = SkRlmtSelectGoingUp(pAC, IoC, - A, P,&Para.Para32[1], AUTONEG_FAILED); + PortFound = SkRlmtSelectGoingUp( + pAC, IoC, Active, PrefPort, &Para.Para32[1], AUTONEG_FAILED); } - if (pAC->Rlmt.RlmtMode != SK_RLMT_CHECK_LINK) { + if (pAC->Rlmt.Net[0].RlmtMode != SK_RLMT_MODE_CLS) { if (!PortFound) { PortFound = SkRlmtSelectDown(pAC, IoC, - A, P,&Para.Para32[1], AUTONEG_SUCCESS); + Active, PrefPort, &Para.Para32[1], AUTONEG_SUCCESS); } if (!PortFound) { PortFound = SkRlmtSelectDown(pAC, IoC, - A, P,&Para.Para32[1], AUTONEG_FAILED); + Active, PrefPort, &Para.Para32[1], AUTONEG_FAILED); } - } + } /* pAC->Rlmt.RlmtMode != SK_RLMT_MODE_CLS */ if (PortFound) { - if (Para.Para32[1] != A) { - pAC->Rlmt.MacActive = Para.Para32[1]; - SK_HWAC_LINK_LED( - pAC, - IoC, - Para.Para32[1], - SK_LED_ACTIVE); - if (pAC->Rlmt.Port[A].LinkDown) { - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_SWITCH_HARD, - Para); + if (Para.Para32[1] != Active) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Active: %d, Para1: %d.\n", Active, Para.Para32[1])) + pAC->Rlmt.Net[NetIdx].ActivePort = Para.Para32[1]; + Para.Para32[0] = pAC->Rlmt.Net[NetIdx]. + Port[Para.Para32[0]]->PortNumber; + Para.Para32[1] = pAC->Rlmt.Net[NetIdx]. + Port[Para.Para32[1]]->PortNumber; + SK_HWAC_LINK_LED(pAC, IoC, Para.Para32[1], SK_LED_ACTIVE); + if (pAC->Rlmt.Port[Active].LinkDown) { + SkEventQueue(pAC, SKGE_DRV, SK_DRV_SWITCH_HARD, Para); } else { - SK_HWAC_LINK_LED( - pAC, - IoC, - Para.Para32[0], - SK_LED_STANDBY); - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_SWITCH_SOFT, - Para); + SK_HWAC_LINK_LED(pAC, IoC, Para.Para32[0], SK_LED_STANDBY); + SkEventQueue(pAC, SKGE_DRV, SK_DRV_SWITCH_SOFT, Para); } - SkEventQueue( - pAC, - SKGE_PNMI, - SK_PNMI_EVT_RLMT_PORT_SWITCH, - Para); - if ((Para.pParaPtr = SkRlmtBuildPacket( - pAC, - IoC, - Para.Para32[1], - SK_PACKET_ANNOUNCE, - &pAC->Addr.CurrentMacAddress, - &SkRlmtMcAddr) - ) != NULL) { - + Para.Para32[1] = NetIdx; + Para.Para32[0] = + pAC->Rlmt.Net[NetIdx].Port[Para.Para32[0]]->PortNumber; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_ACTIVE_DOWN, Para); + Para.Para32[0] = pAC->Rlmt.Net[NetIdx]. + Port[pAC->Rlmt.Net[NetIdx].ActivePort]->PortNumber; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_ACTIVE_UP, Para); + if ((pAC->Rlmt.Net[NetIdx].RlmtMode & SK_RLMT_TRANSPARENT) == 0 && + (Para.pParaPtr = SkRlmtBuildPacket(pAC, IoC, Para.Para32[0], + SK_PACKET_ANNOUNCE, &pAC->Addr.Net[NetIdx].CurrentMacAddress, + &SkRlmtMcAddr)) != NULL) { /* - * Send "new" packet to RLMT multicast - * address to force switches to learn - * the new location of the MAC address. + * Send announce packet to RLMT multicast address to force + * switches to learn the new location of the logical + * MAC address. */ - - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para); - } - } - } + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para); + } /* (Para.pParaPtr = SkRlmtBuildPacket(...)) != NULL */ + } /* Para.Para32[1] != Active */ + } /* PortFound */ else { - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E004, - SKERR_RLMT_E004_MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E004, SKERR_RLMT_E004_MSG); } - } - + } /* LinksUp > 1 || LinksUp == 1 && RlmtState != SK_RLMT_RS_NET_DOWN */ return; } /* SkRlmtCheckSwitch */ @@ -2338,66 +1986,65 @@ * Nothing. */ RLMT_STATIC void SkRlmtCheckSeg( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC) /* I/O context */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 NetIdx) /* Net number */ { - SK_BOOL Equal; - SK_U32 i, j; + SK_EVPARA Para; + SK_RLMT_NET *pNet; + SK_U32 i, j; + SK_BOOL Equal; - pAC->Rlmt.RootIdSet = SK_FALSE; + pNet = &pAC->Rlmt.Net[NetIdx]; + pNet->RootIdSet = SK_FALSE; Equal = SK_TRUE; - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (pAC->Rlmt.Port[i].LinkDown || - !pAC->Rlmt.Port[i].RootIdSet) { + + for (i = 0; i < pNet->NumPorts; i++) { + if (pNet->Port[i]->LinkDown || !pNet->Port[i]->RootIdSet) { continue; } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("Root ID %d: %02x %02x %02x %02x %02x %02x %02x %02x.\n", - i, - pAC->Rlmt.Port[i].Root.Id[0], - pAC->Rlmt.Port[i].Root.Id[1], - pAC->Rlmt.Port[i].Root.Id[2], - pAC->Rlmt.Port[i].Root.Id[3], - pAC->Rlmt.Port[i].Root.Id[4], - pAC->Rlmt.Port[i].Root.Id[5], - pAC->Rlmt.Port[i].Root.Id[6], - pAC->Rlmt.Port[i].Root.Id[7])) - - if (!pAC->Rlmt.RootIdSet) { - pAC->Rlmt.Root = pAC->Rlmt.Port[i].Root; - pAC->Rlmt.RootIdSet = SK_TRUE; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_DUMP, + ("Root ID %d: %02x %02x %02x %02x %02x %02x %02x %02x.\n", i, + pNet->Port[i]->Root.Id[0], pNet->Port[i]->Root.Id[1], + pNet->Port[i]->Root.Id[2], pNet->Port[i]->Root.Id[3], + pNet->Port[i]->Root.Id[4], pNet->Port[i]->Root.Id[5], + pNet->Port[i]->Root.Id[6], pNet->Port[i]->Root.Id[7])) + + if (!pNet->RootIdSet) { + pNet->Root = pNet->Port[i]->Root; + pNet->RootIdSet = SK_TRUE; continue; } for (j = 0; j < 8; j ++) { - Equal &= pAC->Rlmt.Port[i].Root.Id[j] == - pAC->Rlmt.Root.Id[j]; + Equal &= pNet->Port[i]->Root.Id[j] == pNet->Root.Id[j]; if (!Equal) { break; } } if (!Equal) { - SK_ERR_LOG( - pAC, - SK_ERRCL_COMM, - SKERR_RLMT_E005, - SKERR_RLMT_E005_MSG); -#ifdef SK_PNMI_EVT_SEGMENTATION - SkEventQueue( - pAC, - SKGE_PNMI, - SK_PNMI_EVT_SEGMENTATION, - Para); -#endif /* SK_PNMI_EVT_SEGMENTATION */ - pAC->Rlmt.CheckingState &= ~SK_RLMT_RCS_REPORT_SEG; + SK_ERR_LOG(pAC, SK_ERRCL_COMM, SKERR_RLMT_E005, SKERR_RLMT_E005_MSG); + Para.Para32[0] = NetIdx; + Para.Para32[1] = (SK_U32)-1; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_SEGMENTATION, Para); + + pNet->CheckingState &= ~SK_RLMT_RCS_REPORT_SEG; + + /* 2000-03-06 RA: New. */ + Para.Para32[0] = NetIdx; + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pNet->SegTimer, SK_RLMT_SEG_TO_VAL, + SKGE_RLMT, SK_RLMT_SEG_TIM, Para); break; } - } + } /* for (i = 0; i < pNet->NumPorts; i++) */ + + /* 2000-03-06 RA: Moved here. */ + /* Segmentation check not running anymore. */ + pNet->CheckingState &= ~SK_RLMT_RCS_SEG; + } /* SkRlmtCheckSeg */ @@ -2417,1005 +2064,1340 @@ * Nothing */ RLMT_STATIC void SkRlmtPortStart( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 PortIdx) /* event code */ +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 PortNumber) /* Port number */ { SK_EVPARA Para; - pAC->Rlmt.Port[PortIdx].PortState = SK_RLMT_PS_LINK_DOWN; - pAC->Rlmt.Port[PortIdx].PortStarted = SK_TRUE; - pAC->Rlmt.Port[PortIdx].LinkDown = SK_TRUE; - pAC->Rlmt.Port[PortIdx].PortDown = SK_TRUE; - pAC->Rlmt.Port[PortIdx].CheckingState = 0; - pAC->Rlmt.Port[PortIdx].RootIdSet = SK_FALSE; - Para.Para32[0] = PortIdx; + pAC->Rlmt.Port[PortNumber].PortState = SK_RLMT_PS_LINK_DOWN; + pAC->Rlmt.Port[PortNumber].PortStarted = SK_TRUE; + pAC->Rlmt.Port[PortNumber].LinkDown = SK_TRUE; + pAC->Rlmt.Port[PortNumber].PortDown = SK_TRUE; + pAC->Rlmt.Port[PortNumber].CheckingState = 0; + pAC->Rlmt.Port[PortNumber].RootIdSet = SK_FALSE; + Para.Para32[0] = PortNumber; + Para.Para32[1] = (SK_U32)-1; SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_PORT_START, Para); } /* SkRlmtPortStart */ /****************************************************************************** * - * SkRlmtEvent - a PORT- or an RLMT-specific event happened + * SkRlmtEvtPortStartTim - PORT_START_TIM * * Description: - * This routine handles PORT- and RLMT-specific events. + * This routine handles PORT_START_TIM events. * * Context: * runtime, pageable? * may be called after SK_INIT_IO * * Returns: - * 0 + * Nothing */ -int SkRlmtEvent( -SK_AC *pAC, /* adapter context */ -SK_IOC IoC, /* I/O context */ -SK_U32 Event, /* event code */ -SK_EVPARA Para) /* event-specific parameter */ +RLMT_STATIC void SkRlmtEvtPortStartTim( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 -1 */ { - SK_U32 i, j; - SK_RLMT_PORT *pRPort; - SK_EVPARA Para2; - SK_MBUF *pMb; - SK_MBUF *pNextMb; - SK_MAC_ADDR *pOldMacAddr; - SK_MAC_ADDR *pNewMacAddr; - SK_U32 Timeout; - SK_U32 NewTimeout; - SK_U32 PrevRlmtMode; - - switch (Event) { - case SK_RLMT_PORTSTART_TIM: /* From RLMT via TIME. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTSTART_TIMEOUT Port %d Event (%d) BEGIN.\n", Para.Para32[0], Event)) - - /* - * Used to start non-preferred ports if the preferred one - * does not come up. - * This timeout needs only be set when starting the first - * (preferred) port. - */ + SK_U32 i; - if (pAC->Rlmt.Port[Para.Para32[0]].LinkDown) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTSTART_TIMEOUT Port %d Event BEGIN.\n", Para.Para32[0])) - /* PORT_START failed. */ + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTSTART_TIMEOUT Event EMPTY.\n")) + return; + } - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (!pAC->Rlmt.Port[i].PortStarted) { - SkRlmtPortStart(pAC, IoC, i); - } + /* + * Used to start non-preferred ports if the preferred one + * does not come up. + * This timeout needs only be set when starting the first + * (preferred) port. + */ + if (pAC->Rlmt.Port[Para.Para32[0]].LinkDown) { + /* PORT_START failed. */ + for (i = 0; i < pAC->Rlmt.Port[Para.Para32[0]].Net->NumPorts; i++) { + if (!pAC->Rlmt.Port[Para.Para32[0]].Net->Port[i]->PortStarted) { + SkRlmtPortStart(pAC, IoC, + pAC->Rlmt.Port[Para.Para32[0]].Net->Port[i]->PortNumber); } } + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTSTART_TIMEOUT Event (%d) END.\n", Event)) - break; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTSTART_TIMEOUT Event END.\n")) +} /* SkRlmtEvtPortStartTim */ - case SK_RLMT_LINK_UP: /* From SIRQ. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_UP Port %d Event (%d) BEGIN.\n", - Para.Para32[0], Event)) - - pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; - - if (!pRPort->PortStarted) { - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E008, - SKERR_RLMT_E008_MSG); - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_UP Event (%d) EMPTY.\n", Event)) - break; - } - if (!pRPort->LinkDown) { - /* RA;:;: Any better solution? */ +/****************************************************************************** + * + * SkRlmtEvtLinkUp - LINK_UP + * + * Description: + * This routine handles LLINK_UP events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtLinkUp( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 Undefined */ +{ + SK_U32 i; + SK_RLMT_PORT *pRPort; + SK_EVPARA Para2; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_UP Event (%d) EMPTY.\n", Event)) - break; - } + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_UP Port %d Event BEGIN.\n", Para.Para32[0])) - SkTimerStop(pAC, IoC, &pRPort->UpTimer); - SkTimerStop(pAC, IoC, &pRPort->DownRxTimer); - SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); + pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; + if (!pRPort->PortStarted) { + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E008, SKERR_RLMT_E008_MSG); - /* Do something if timer already fired? */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_UP Event EMPTY.\n")) + return; + } - pRPort->LinkDown = SK_FALSE; - pRPort->PortState = SK_RLMT_PS_GOING_UP; - pRPort->GuTimeStamp = SkOsGetTime(pAC); - pRPort->BcTimeStamp = 0; - if (pAC->Rlmt.LinksUp == 0) { - SK_HWAC_LINK_LED( - pAC, - IoC, - Para.Para32[0], - SK_LED_ACTIVE); - } - else { - SK_HWAC_LINK_LED( - pAC, - IoC, - Para.Para32[0], - SK_LED_STANDBY); + if (!pRPort->LinkDown) { + /* RA;:;: Any better solution? */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_UP Event EMPTY.\n")) + return; + } + + SkTimerStop(pAC, IoC, &pRPort->UpTimer); + SkTimerStop(pAC, IoC, &pRPort->DownRxTimer); + SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); + + /* Do something if timer already fired? */ + + pRPort->LinkDown = SK_FALSE; + pRPort->PortState = SK_RLMT_PS_GOING_UP; + pRPort->GuTimeStamp = SkOsGetTime(pAC); + pRPort->BcTimeStamp = 0; + pRPort->Net->LinksUp++; + if (pRPort->Net->LinksUp == 1) { + SK_HWAC_LINK_LED(pAC, IoC, Para.Para32[0], SK_LED_ACTIVE); + } + else { + SK_HWAC_LINK_LED(pAC, IoC, Para.Para32[0], SK_LED_STANDBY); + } + + for (i = 0; i < pRPort->Net->NumPorts; i++) { + if (!pRPort->Net->Port[i]->PortStarted) { + SkRlmtPortStart(pAC, IoC, pRPort->Net->Port[i]->PortNumber); } - pAC->Rlmt.LinksUp++; + } - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (!pAC->Rlmt.Port[i].PortStarted) { - SkRlmtPortStart(pAC, IoC, i); - } + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); + + if (pRPort->Net->LinksUp >= 2) { + if (pRPort->Net->RlmtMode & SK_RLMT_CHECK_LOC_LINK) { + /* Build the check chain. */ + SkRlmtBuildCheckChain(pAC, pRPort->Net->NetNumber); } + } - SkRlmtCheckSwitch(pAC, IoC); + /* If the first link comes up, start the periodical RLMT timeout. */ + if (pRPort->Net->NumPorts > 1 && pRPort->Net->LinksUp == 1 && + (pRPort->Net->RlmtMode & SK_RLMT_CHECK_OTHERS) != 0) { + Para2.Para32[0] = pRPort->Net->NetNumber; + Para2.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->Net->LocTimer, + pRPort->Net->TimeoutValue, SKGE_RLMT, SK_RLMT_TIM, Para2); + } - if (pAC->Rlmt.LinksUp >= 2) { - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK) { + Para2 = Para; + Para2.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->UpTimer, SK_RLMT_PORTUP_TIM_VAL, + SKGE_RLMT, SK_RLMT_PORTUP_TIM, Para2); + + /* Later: if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK) && */ + if ((pRPort->Net->RlmtMode & SK_RLMT_TRANSPARENT) == 0 && + (pRPort->Net->RlmtMode & SK_RLMT_CHECK_LINK) != 0 && + (Para2.pParaPtr = + SkRlmtBuildPacket(pAC, IoC, Para.Para32[0], SK_PACKET_ANNOUNCE, + &pAC->Addr.Port[Para.Para32[0]].CurrentMacAddress, &SkRlmtMcAddr) + ) != NULL) { + /* Send "new" packet to RLMT multicast address. */ + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para2); + } + + if (pRPort->Net->RlmtMode & SK_RLMT_CHECK_SEG) { + if ((Para2.pParaPtr = + SkRlmtBuildSpanningTreePacket(pAC, IoC, Para.Para32[0])) != NULL) { + pAC->Rlmt.Port[Para.Para32[0]].RootIdSet = SK_FALSE; + pRPort->Net->CheckingState |= + SK_RLMT_RCS_SEG | SK_RLMT_RCS_REPORT_SEG; - /* Build the check chain. */ + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para2); - SkRlmtBuildCheckChain(pAC); - } + Para.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pRPort->Net->SegTimer, + SK_RLMT_SEG_TO_VAL, SKGE_RLMT, SK_RLMT_SEG_TIM, Para); } + } - /* - * If the first link comes up, start the periodical - * RLMT timeout. - */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_UP Event END.\n")) +} /* SkRlmtEvtLinkUp */ - if (pAC->GIni.GIMacsFound > 1 && pAC->Rlmt.LinksUp == 1 && - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_OTHERS)) { - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.LocTimer, - pAC->Rlmt.TimeoutValue, - SKGE_RLMT, - SK_RLMT_TIM, - Para); - } - - SkTimerStart( - pAC, - IoC, - &pRPort->UpTimer, - SK_RLMT_PORTUP_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTUP_TIM, - Para); - /* - * Later: - * if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK) && - */ +/****************************************************************************** + * + * SkRlmtEvtPortUpTim - PORT_UP_TIM + * + * Description: + * This routine handles PORT_UP_TIM events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtPortUpTim( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 -1 */ +{ + SK_RLMT_PORT *pRPort; - if ((pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LINK) && - (Para2.pParaPtr = SkRlmtBuildPacket( - pAC, - IoC, - Para.Para32[0], - SK_PACKET_ANNOUNCE, - &pAC->Addr.Port[Para.Para32[0]].CurrentMacAddress, - &SkRlmtMcAddr) - ) != NULL) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTUP_TIM Port %d Event BEGIN.\n", Para.Para32[0])) - /* Send "new" packet to RLMT multicast address. */ + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTUP_TIM Event EMPTY.\n")) + return; + } - SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para2); - } + pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; + if (pRPort->LinkDown || (pRPort->PortState == SK_RLMT_PS_UP)) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTUP_TIM Port %d Event EMPTY.\n", Para.Para32[0])) + return; + } - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { - if ((Para2.pParaPtr = - SkRlmtBuildSpanningTreePacket( - pAC, - IoC, - Para.Para32[0]) - ) != NULL) { - - pAC->Rlmt.Port[Para.Para32[0]].RootIdSet = - SK_FALSE; - pAC->Rlmt.CheckingState |= - SK_RLMT_RCS_SEG | - SK_RLMT_RCS_REPORT_SEG; - - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para2); - - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.SegTimer, - SK_RLMT_SEG_TO_VAL, - SKGE_RLMT, - SK_RLMT_SEG_TIM, - Para); - } + pRPort->PortDown = SK_FALSE; + pRPort->PortState = SK_RLMT_PS_UP; + pRPort->Net->PortsUp++; + if (pRPort->Net->RlmtState != SK_RLMT_RS_INIT) { + if (pAC->Rlmt.NumNets <= 1) { + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); } + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_PORT_UP, Para); + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_UP Event (%d) END.\n", Event)) - break; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTUP_TIM Event END.\n")) +} /* SkRlmtEvtPortUpTim */ - case SK_RLMT_PORTUP_TIM: /* From RLMT via TIME. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTUP_TIM Port %d Event (%d) BEGIN.\n", Para.Para32[0], Event)) - - pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; - - if (pRPort->LinkDown || (pRPort->PortState == SK_RLMT_PS_UP)) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTUP_TIM Port %d Event (%d) EMPTY.\n", - Para.Para32[0], - Event)) - break; - } - pRPort->PortDown = SK_FALSE; - pRPort->PortState = SK_RLMT_PS_UP; - pAC->Rlmt.PortsUp++; +/****************************************************************************** + * + * SkRlmtEvtPortDownTim - PORT_DOWN_* + * + * Description: + * This routine handles PORT_DOWN_* events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtPortDownX( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Event, /* Event code */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 -1 */ +{ + SK_RLMT_PORT *pRPort; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTDOWN* Port %d Event (%d) BEGIN.\n", + Para.Para32[0], Event)) + + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTDOWN* Event EMPTY.\n")) + return; + } - if (pAC->Rlmt.RlmtState != SK_RLMT_RS_INIT) { - SkRlmtCheckSwitch(pAC, IoC); + pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; + if (!pRPort->PortStarted || (Event == SK_RLMT_PORTDOWN_TX_TIM && + !(pRPort->CheckingState & SK_RLMT_PCS_TX))) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTDOWN* Event (%d) EMPTY.\n", Event)) + return; + } + + /* Stop port's timers. */ + SkTimerStop(pAC, IoC, &pRPort->UpTimer); + SkTimerStop(pAC, IoC, &pRPort->DownRxTimer); + SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); - SkEventQueue( - pAC, - SKGE_PNMI, - SK_PNMI_EVT_RLMT_PORT_UP, - Para); - } + if (pRPort->PortState != SK_RLMT_PS_LINK_DOWN) { + pRPort->PortState = SK_RLMT_PS_DOWN; + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTUP_TIM Event (%d) END.\n", Event)) - break; + if (!pRPort->PortDown) { + pRPort->Net->PortsUp--; + pRPort->PortDown = SK_TRUE; + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_PORT_DOWN, Para); + } - case SK_RLMT_PORTDOWN: /* From RLMT. */ - case SK_RLMT_PORTDOWN_RX_TIM: /* From RLMT via TIME. */ - case SK_RLMT_PORTDOWN_TX_TIM: /* From RLMT via TIME. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTDOWN* Port %d Event (%d) BEGIN.\n", Para.Para32[0], Event)) - - pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; - - if (!pRPort->PortStarted || - (Event == SK_RLMT_PORTDOWN_TX_TIM && - !(pRPort->CheckingState & SK_RLMT_PCS_TX))) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTDOWN* Event (%d) EMPTY.\n", Event)) - break; + pRPort->PacketsPerTimeSlot = 0; + /* pRPort->DataPacketsPerTimeSlot = 0; */ + pRPort->BpduPacketsPerTimeSlot = 0; + + /* + * RA;:;: To be checked: + * - actions at RLMT_STOP: We should not switch anymore. + */ + if (pRPort->Net->RlmtState != SK_RLMT_RS_INIT) { + if (Para.Para32[0] == + pRPort->Net->Port[pRPort->Net->ActivePort]->PortNumber) { + /* Active Port went down. */ + SkRlmtCheckSwitch(pAC, IoC, pRPort->Net->NetNumber); } - /* Stop port's timers. */ + } - SkTimerStop(pAC, IoC, &pRPort->UpTimer); - SkTimerStop(pAC, IoC, &pRPort->DownRxTimer); - SkTimerStop(pAC, IoC, &pRPort->DownTxTimer); + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORTDOWN* Event (%d) END.\n", Event)) +} /* SkRlmtEvtPortDownX */ - if (pRPort->PortState != SK_RLMT_PS_LINK_DOWN) { - pRPort->PortState = SK_RLMT_PS_DOWN; - } - if (!pRPort->PortDown) { - pAC->Rlmt.PortsUp--; - pRPort->PortDown = SK_TRUE; +/****************************************************************************** + * + * SkRlmtEvtLinkDown - LINK_DOWN + * + * Description: + * This routine handles LINK_DOWN events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtLinkDown( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 Undefined */ +{ + SK_RLMT_PORT *pRPort; - SkEventQueue( - pAC, - SKGE_PNMI, - SK_PNMI_EVT_RLMT_PORT_DOWN, - Para); + pRPort = &pAC->Rlmt.Port[Para.Para32[0]]; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_DOWN Port %d Event BEGIN.\n", Para.Para32[0])) + + if (!pAC->Rlmt.Port[Para.Para32[0]].LinkDown) { + pRPort->Net->LinksUp--; + pRPort->LinkDown = SK_TRUE; + pRPort->PortState = SK_RLMT_PS_LINK_DOWN; + SK_HWAC_LINK_LED(pAC, IoC, Para.Para32[0], SK_LED_OFF); + + if ((pRPort->Net->RlmtMode & SK_RLMT_CHECK_LOC_LINK) != 0) { + /* Build the check chain. */ + SkRlmtBuildCheckChain(pAC, pRPort->Net->NetNumber); } - pRPort->PacketsPerTimeSlot = 0; - pRPort->DataPacketsPerTimeSlot = 0; - pRPort->BpduPacketsPerTimeSlot = 0; -#if 0 - pRPort->RlmtChksPerTimeSlot = 0; - pRPort->RlmtAcksPerTimeSlot = 0; -#endif /* 0 */ + /* Ensure that port is marked down. */ + Para.Para32[1] = -1; + (void)SkRlmtEvent(pAC, IoC, SK_RLMT_PORTDOWN, Para); + } - /* - * RA;:;: To be checked: - * - actions at RLMT_STOP: We should not switch anymore. - */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_LINK_DOWN Event END.\n")) +} /* SkRlmtEvtLinkDown */ + + +/****************************************************************************** + * + * SkRlmtEvtPortAddr - PORT_ADDR + * + * Description: + * This routine handles PORT_ADDR events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtPortAddr( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortNumber; SK_U32 -1 */ +{ + SK_U32 i, j; + SK_RLMT_PORT *pRPort; + SK_MAC_ADDR *pOldMacAddr; + SK_MAC_ADDR *pNewMacAddr; - if (pAC->Rlmt.RlmtState != SK_RLMT_RS_INIT) { - if (Para.Para32[0] == pAC->Rlmt.MacActive) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORT_ADDR Port %d Event BEGIN.\n", Para.Para32[0])) - /* Active Port went down. */ + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORT_ADDR Event EMPTY.\n")) + return; + } - SkRlmtCheckSwitch(pAC, IoC); + /* Port's physical MAC address changed. */ + pOldMacAddr = &pAC->Addr.Port[Para.Para32[0]].PreviousMacAddress; + pNewMacAddr = &pAC->Addr.Port[Para.Para32[0]].CurrentMacAddress; + + /* + * NOTE: This is not scalable for solutions where ports are + * checked remotely. There, we need to send an RLMT + * address change packet - and how do we ensure delivery? + */ + for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { + pRPort = &pAC->Rlmt.Port[i]; + for (j = 0; j < pRPort->PortsChecked; j++) { + if (SK_ADDR_EQUAL( + pRPort->PortCheck[j].CheckAddr.a, pOldMacAddr->a)) { + pRPort->PortCheck[j].CheckAddr = *pNewMacAddr; } } + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORTDOWN* Event (%d) END.\n", Event)) - break; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PORT_ADDR Event END.\n")) +} /* SkRlmtEvtPortAddr */ - case SK_RLMT_LINK_DOWN: /* From SIRQ. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_DOWN Port %d Event (%d) BEGIN.\n", - Para.Para32[0], Event)) - - if (!pAC->Rlmt.Port[Para.Para32[0]].LinkDown) { - pAC->Rlmt.LinksUp--; - pAC->Rlmt.Port[Para.Para32[0]].LinkDown = SK_TRUE; - pAC->Rlmt.Port[Para.Para32[0]].PortState = - SK_RLMT_PS_LINK_DOWN; - SK_HWAC_LINK_LED( - pAC, - IoC, - Para.Para32[0], - SK_LED_OFF); - - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK) { - - /* Build the check chain. */ - - SkRlmtBuildCheckChain(pAC); - } - - /* Ensure that port is marked down. */ - - (void)SkRlmtEvent( - pAC, - IoC, - SK_RLMT_PORTDOWN, - Para); - } - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_LINK_DOWN Event (%d) END.\n", Event)) - break; - case SK_RLMT_PORT_ADDR: /* From ADDR. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORT_ADDR Port %d Event (%d) BEGIN.\n", Para.Para32[0], Event)) - - /* Port's physical MAC address changed. */ - - pOldMacAddr = - &pAC->Addr.Port[Para.Para32[0]].PreviousMacAddress; - pNewMacAddr = - &pAC->Addr.Port[Para.Para32[0]].CurrentMacAddress; +/****************************************************************************** + * + * SkRlmtEvtStart - START + * + * Description: + * This routine handles START events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtStart( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ + SK_EVPARA Para2; + SK_U32 PortIdx; + SK_U32 PortNumber; - /* - * NOTE: This is not scalable for solutions where ports are - * checked remotely. There, we need to send an RLMT - * address change packet - and how do we ensure delivery? - */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Net %d Event BEGIN.\n", Para.Para32[0])) - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pRPort = &pAC->Rlmt.Port[i]; - for (j = 0; j < pRPort->PortsChecked; j++) { - if (SK_ADDR_EQUAL( - pRPort->PortCheck[j].CheckAddr.a, - pOldMacAddr->a)) { - pRPort->PortCheck[j].CheckAddr = - *pNewMacAddr; - } - } - } + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Event EMPTY.\n")) + return; + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PORT_ADDR Event (%d) END.\n", Event)) - break; + if (Para.Para32[0] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[0])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Event EMPTY.\n")) + return; + } - /* ----- RLMT events ----- */ + if (pAC->Rlmt.Net[Para.Para32[0]].RlmtState != SK_RLMT_RS_INIT) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Event EMPTY.\n")) + return; + } - case SK_RLMT_START: /* From DRV. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_START Event (%d) BEGIN.\n", Event)) - - if (pAC->Rlmt.RlmtState != SK_RLMT_RS_INIT) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_START Event (%d) EMPTY.\n", Event)) - break; - } + if (pAC->Rlmt.NetsStarted >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("All nets should have been started.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Event EMPTY.\n")) + return; + } - if (pAC->Rlmt.PrefPort >= (SK_U32)pAC->GIni.GIMacsFound) { - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E009, - SKERR_RLMT_E009_MSG); - - /* Change PrefPort to internal default. */ - - Para.Para32[0] = 0xFFFFFFFF; - (void)SkRlmtEvent( - pAC, - IoC, - SK_RLMT_PREFPORT_CHANGE, - Para); - } -#if 0 - if (pAC->GIni.GIMacsFound == 1 && - pAC->Rlmt.RlmtMode != SK_RLMT_CHECK_LINK) { - Para.Para32[0] = SK_RLMT_CHECK_LINK; - (void)SkRlmtEvent( - pAC, - IoC, - SK_RLMT_MODE_CHANGE, - Para); - } -#endif /* 0 */ - pAC->Rlmt.LinksUp = 0; - pAC->Rlmt.PortsUp = 0; - pAC->Rlmt.CheckingState = 0; - pAC->Rlmt.RlmtState = SK_RLMT_RS_NET_DOWN; - - SkRlmtPortStart(pAC, IoC, pAC->Rlmt.PrefPort); - - /* Start Timer (for first port only). */ - - Para2.Para32[0] = pAC->Rlmt.PrefPort; - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.Port[pAC->Rlmt.PrefPort].UpTimer, - SK_RLMT_PORTSTART_TIM_VAL, - SKGE_RLMT, - SK_RLMT_PORTSTART_TIM, - Para2); - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_START Event (%d) END.\n", Event)) - break; + if (pAC->Rlmt.Net[Para.Para32[0]].PrefPort >= + pAC->Rlmt.Net[Para.Para32[0]].NumPorts) { + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E009, SKERR_RLMT_E009_MSG); - case SK_RLMT_STOP: /* From DRV. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STOP Event (%d) BEGIN.\n", Event)) - - if (pAC->Rlmt.RlmtState == SK_RLMT_RS_INIT) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STOP Event (%d) EMPTY.\n", Event)) - break; - } + /* Change PrefPort to internal default. */ + Para2.Para32[0] = 0xFFFFFFFF; + Para2.Para32[1] = Para.Para32[0]; + (void)SkRlmtEvent(pAC, IoC, SK_RLMT_PREFPORT_CHANGE, Para2); + } - /* Stop RLMT timers. */ + PortIdx = pAC->Rlmt.Net[Para.Para32[0]].PrefPort; + PortNumber = pAC->Rlmt.Net[Para.Para32[0]].Port[PortIdx]->PortNumber; - SkTimerStop(pAC, IoC, &pAC->Rlmt.LocTimer); - SkTimerStop(pAC, IoC, &pAC->Rlmt.SegTimer); + pAC->Rlmt.Net[Para.Para32[0]].LinksUp = 0; + pAC->Rlmt.Net[Para.Para32[0]].PortsUp = 0; + pAC->Rlmt.Net[Para.Para32[0]].CheckingState = 0; + pAC->Rlmt.Net[Para.Para32[0]].RlmtState = SK_RLMT_RS_NET_DOWN; - /* Stop Net. */ + /* Start preferred port. */ + SkRlmtPortStart(pAC, IoC, PortNumber); - pAC->Rlmt.RlmtState = SK_RLMT_RS_INIT; - pAC->Rlmt.RootIdSet = SK_FALSE; - Para2.Para32[0] = SK_RLMT_NET_DOWN_FINAL; - SkEventQueue(pAC, SKGE_DRV, SK_DRV_NET_DOWN, Para2); + /* Start Timer (for first port only). */ + Para2.Para32[0] = PortNumber; + Para2.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pAC->Rlmt.Port[PortNumber].UpTimer, + SK_RLMT_PORTSTART_TIM_VAL, SKGE_RLMT, SK_RLMT_PORTSTART_TIM, Para2); - /* Stop ports. */ + pAC->Rlmt.NetsStarted++; - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - if (pAC->Rlmt.Port[i].PortState != SK_RLMT_PS_INIT) { - SkTimerStop( - pAC, - IoC, - &pAC->Rlmt.Port[i].UpTimer); - SkTimerStop( - pAC, - IoC, - &pAC->Rlmt.Port[i].DownRxTimer); - SkTimerStop( - pAC, - IoC, - &pAC->Rlmt.Port[i].DownTxTimer); - - pAC->Rlmt.Port[i].PortState = SK_RLMT_PS_INIT; - pAC->Rlmt.Port[i].RootIdSet = SK_FALSE; - pAC->Rlmt.Port[i].PortStarted = SK_FALSE; - Para2.Para32[0] = i; - SkEventQueue( - pAC, - SKGE_HWAC, - SK_HWEV_PORT_STOP, - Para2); - } - } + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_START Event END.\n")) +} /* SkRlmtEvtStart */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STOP Event (%d) END.\n", Event)) - break; - case SK_RLMT_TIM: /* From RLMT via TIME. */ -#if 0 - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_TIM Event (%d) BEGIN.\n", Event)) -#endif /* 0 */ +/****************************************************************************** + * + * SkRlmtEvtStop - STOP + * + * Description: + * This routine handles STOP events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtStop( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ + SK_EVPARA Para2; + SK_U32 PortNumber; + SK_U32 i; - if (!(pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_OTHERS) || - pAC->Rlmt.LinksUp == 0) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Net %d Event BEGIN.\n", Para.Para32[0])) - /* - * Mode changed or all links down: - * No more link checking. - */ + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Event EMPTY.\n")) + return; + } - break; + if (Para.Para32[0] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[0])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Event EMPTY.\n")) + return; + } + + if (pAC->Rlmt.Net[Para.Para32[0]].RlmtState == SK_RLMT_RS_INIT) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Event EMPTY.\n")) + return; + } + + if (pAC->Rlmt.NetsStarted == 0) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("All nets are stopped.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Event EMPTY.\n")) + return; + } + + /* Stop RLMT timers. */ + SkTimerStop(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[0]].LocTimer); + SkTimerStop(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[0]].SegTimer); + + /* Stop net. */ + pAC->Rlmt.Net[Para.Para32[0]].RlmtState = SK_RLMT_RS_INIT; + pAC->Rlmt.Net[Para.Para32[0]].RootIdSet = SK_FALSE; + Para2.Para32[0] = SK_RLMT_NET_DOWN_FINAL; + Para2.Para32[1] = Para.Para32[0]; /* Net# */ + SkEventQueue(pAC, SKGE_DRV, SK_DRV_NET_DOWN, Para2); + + /* Stop ports. */ + for (i = 0; i < pAC->Rlmt.Net[Para.Para32[0]].NumPorts; i++) { + PortNumber = pAC->Rlmt.Net[Para.Para32[0]].Port[i]->PortNumber; + if (pAC->Rlmt.Port[PortNumber].PortState != SK_RLMT_PS_INIT) { + SkTimerStop(pAC, IoC, &pAC->Rlmt.Port[PortNumber].UpTimer); + SkTimerStop(pAC, IoC, &pAC->Rlmt.Port[PortNumber].DownRxTimer); + SkTimerStop(pAC, IoC, &pAC->Rlmt.Port[PortNumber].DownTxTimer); + + pAC->Rlmt.Port[PortNumber].PortState = SK_RLMT_PS_INIT; + pAC->Rlmt.Port[PortNumber].RootIdSet = SK_FALSE; + pAC->Rlmt.Port[PortNumber].PortStarted = SK_FALSE; + Para2.Para32[0] = PortNumber; + Para2.Para32[1] = (SK_U32)-1; + SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_PORT_STOP, Para2); } + } + + pAC->Rlmt.NetsStarted--; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STOP Event END.\n")) +} /* SkRlmtEvtStop */ + + +/****************************************************************************** + * + * SkRlmtEvtTim - TIM + * + * Description: + * This routine handles TIM events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtTim( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ + SK_RLMT_PORT *pRPort; + SK_U32 Timeout; + SK_U32 NewTimeout; + SK_U32 PortNumber; + SK_U32 i; #if 0 - pAC->Rlmt.SwitchCheckCounter--; - if (pAC->Rlmt.SwitchCheckCounter == 0) { - pAC->Rlmt.SwitchCheckCounter; - } + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_TIM Event BEGIN.\n")) #endif /* 0 */ - NewTimeout = SK_RLMT_DEF_TO_VAL; - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pRPort = &pAC->Rlmt.Port[i]; - if (!pRPort->LinkDown) { - Timeout = SkRlmtCheckPort(pAC, IoC, i); - if (Timeout < NewTimeout) { - NewTimeout = Timeout; - } + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_TIM Event EMPTY.\n")) + return; + } - /* - * This counter should be set to 0 for all - * ports before the first frame is sent in the - * next loop. - */ + if ((pAC->Rlmt.Net[Para.Para32[0]].RlmtMode & SK_RLMT_CHECK_OTHERS) == 0 || + pAC->Rlmt.Net[Para.Para32[0]].LinksUp == 0) { + /* Mode changed or all links down: No more link checking. */ + return; + } - pRPort->PacketsPerTimeSlot = 0; - pRPort->DataPacketsPerTimeSlot = 0; - pRPort->BpduPacketsPerTimeSlot = 0; #if 0 - pRPort->RlmtChksPerTimeSlot = 0; - pRPort->RlmtAcksPerTimeSlot = 0; + pAC->Rlmt.SwitchCheckCounter--; + if (pAC->Rlmt.SwitchCheckCounter == 0) { + pAC->Rlmt.SwitchCheckCounter; + } #endif /* 0 */ + + NewTimeout = SK_RLMT_DEF_TO_VAL; + for (i = 0; i < pAC->Rlmt.Net[Para.Para32[0]].NumPorts; i++) { + PortNumber = pAC->Rlmt.Net[Para.Para32[0]].Port[i]->PortNumber; + pRPort = &pAC->Rlmt.Port[PortNumber]; + if (!pRPort->LinkDown) { + Timeout = SkRlmtCheckPort(pAC, IoC, PortNumber); + if (Timeout < NewTimeout) { + NewTimeout = Timeout; } - } - pAC->Rlmt.TimeoutValue = NewTimeout; - if (pAC->Rlmt.LinksUp > 1) { /* - * If checking remote ports, also send packets if - * (LinksUp == 1) && - * this port checks at least one (remote) port. + * These counters should be set to 0 for all ports before the + * first frame is sent in the next loop. */ + pRPort->PacketsPerTimeSlot = 0; + /* pRPort->DataPacketsPerTimeSlot = 0; */ + pRPort->BpduPacketsPerTimeSlot = 0; + } + } + pAC->Rlmt.Net[Para.Para32[0]].TimeoutValue = NewTimeout; - /* - * Must be new loop, as SkRlmtCheckPort can request to - * check segmentation when e.g. checking the last port. - */ + if (pAC->Rlmt.Net[Para.Para32[0]].LinksUp > 1) { + /* + * If checking remote ports, also send packets if + * (LinksUp == 1) && + * this port checks at least one (remote) port. + */ - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pRPort = &pAC->Rlmt.Port[i]; - if (!pRPort->LinkDown) { /* !PortDown? */ - SkRlmtSend(pAC, IoC, i); - } + /* + * Must be new loop, as SkRlmtCheckPort can request to + * check segmentation when e.g. checking the last port. + */ + for (i = 0; i < pAC->Rlmt.Net[Para.Para32[0]].NumPorts; i++) { + if (!pAC->Rlmt.Net[Para.Para32[0]].Port[i]->LinkDown) { + SkRlmtSend(pAC, IoC, + pAC->Rlmt.Net[Para.Para32[0]].Port[i]->PortNumber); } } + } - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.LocTimer, - pAC->Rlmt.TimeoutValue, - SKGE_RLMT, - SK_RLMT_TIM, - Para); - - if (pAC->Rlmt.LinksUp > 1 && - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) && - (pAC->Rlmt.CheckingState & SK_RLMT_RCS_START_SEG)) { - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.SegTimer, - SK_RLMT_SEG_TO_VAL, - SKGE_RLMT, - SK_RLMT_SEG_TIM, - Para); - pAC->Rlmt.CheckingState &= - ~SK_RLMT_RCS_START_SEG; - pAC->Rlmt.CheckingState |= - SK_RLMT_RCS_SEG | SK_RLMT_RCS_REPORT_SEG; - } + SkTimerStart(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[0]].LocTimer, + pAC->Rlmt.Net[Para.Para32[0]].TimeoutValue, SKGE_RLMT, SK_RLMT_TIM, + Para); + + if (pAC->Rlmt.Net[Para.Para32[0]].LinksUp > 1 && + (pAC->Rlmt.Net[Para.Para32[0]].RlmtMode & SK_RLMT_CHECK_SEG) && + (pAC->Rlmt.Net[Para.Para32[0]].CheckingState & SK_RLMT_RCS_START_SEG)) { + SkTimerStart(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[0]].SegTimer, + SK_RLMT_SEG_TO_VAL, SKGE_RLMT, SK_RLMT_SEG_TIM, Para); + pAC->Rlmt.Net[Para.Para32[0]].CheckingState &= ~SK_RLMT_RCS_START_SEG; + pAC->Rlmt.Net[Para.Para32[0]].CheckingState |= + SK_RLMT_RCS_SEG | SK_RLMT_RCS_REPORT_SEG; + } #if 0 - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_TIM Event (%d) END.\n", Event)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_TIM Event END.\n")) #endif /* 0 */ - break; +} /* SkRlmtEvtTim */ - case SK_RLMT_SEG_TIM: - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_SEG_TIM Event (%d) BEGIN.\n", Event)) -#ifdef DEBUG - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - SK_U8 InAddr8[6]; - SK_U16 *InAddr; - SK_ADDR_PORT *pAPort; - - InAddr = (SK_U16 *)&InAddr8[0]; - pAPort = &pAC->Addr.Port[i]; - for (j = 0; - j < pAPort->NextExactMatchRlmt; - j++) { - - /* Get exact match address j from port i. */ - - XM_INADDR(IoC, i, XM_EXM(j), InAddr); - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("MC address %d on Port %u: %02x %02x %02x %02x %02x %02x -- %02x %02x %02x %02x %02x %02x.\n", - j, - i, - InAddr8[0], - InAddr8[1], - InAddr8[2], - InAddr8[3], - InAddr8[4], - InAddr8[5], - pAPort->Exact[j].a[0], - pAPort->Exact[j].a[1], - pAPort->Exact[j].a[2], - pAPort->Exact[j].a[3], - pAPort->Exact[j].a[4], - pAPort->Exact[j].a[5])) - } +/****************************************************************************** + * + * SkRlmtEvtSegTim - SEG_TIM + * + * Description: + * This routine handles SEG_TIM events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtSegTim( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ +#ifdef XDEBUG + int j; +#endif /* DEBUG */ + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SEG_TIM Event BEGIN.\n")) + + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SEG_TIM Event EMPTY.\n")) + return; + } + +#ifdef xDEBUG + for (j = 0; i < pAC->Rlmt.Net[Para.Para32[0]].NumPorts; j++) { + SK_ADDR_PORT *pAPort; + SK_U32 k; + SK_U16 *InAddr; + SK_U8 InAddr8[6]; + + InAddr = (SK_U16 *)&InAddr8[0]; + pAPort = pAC->Rlmt.Net[Para.Para32[0]].Port[j]->AddrPort; + for (k = 0; k < pAPort->NextExactMatchRlmt; k++) { + /* Get exact match address k from port j. */ + XM_INADDR(IoC, pAC->Rlmt.Net[Para.Para32[0]].Port[j]->PortNumber, + XM_EXM(k), InAddr); + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("MC address %d on Port %u: %02x %02x %02x %02x %02x %02x -- %02x %02x %02x %02x %02x %02x.\n", + k, pAC->Rlmt.Net[Para.Para32[0]].Port[j]->PortNumber, + InAddr8[0], InAddr8[1], InAddr8[2], + InAddr8[3], InAddr8[4], InAddr8[5], + pAPort->Exact[k].a[0], pAPort->Exact[k].a[1], + pAPort->Exact[k].a[2], pAPort->Exact[k].a[3], + pAPort->Exact[k].a[4], pAPort->Exact[k].a[5])) } + } #endif /* DEBUG */ - pAC->Rlmt.CheckingState &= ~SK_RLMT_RCS_SEG; + SkRlmtCheckSeg(pAC, IoC, Para.Para32[0]); - SkRlmtCheckSeg(pAC, IoC); + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SEG_TIM Event END.\n")) +} /* SkRlmtEvtSegTim */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_SEG_TIM Event (%d) END.\n", Event)) - break; - case SK_RLMT_PACKET_RECEIVED: /* From DRV. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PACKET_RECEIVED Event (%d) BEGIN.\n", Event)) +/****************************************************************************** + * + * SkRlmtEvtPacketRx - PACKET_RECEIVED + * + * Description: + * This routine handles PACKET_RECEIVED events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtPacketRx( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_MBUF *pMb */ +{ + SK_MBUF *pMb; + SK_MBUF *pNextMb; + SK_U32 NetNumber; + +#if 0 + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PACKET_RECEIVED Event BEGIN.\n")) +#endif /* 0 */ - /* Should we ignore frames during port switching? */ + /* Should we ignore frames during port switching? */ #ifdef DEBUG - pMb = Para.pParaPtr; - if (pMb == NULL) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("No mbuf.\n")) - } - else if (pMb->pNext != NULL) { - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("More than one mbuf or pMb->pNext not set.\n")) - } + pMb = Para.pParaPtr; + if (pMb == NULL) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("No mbuf.\n")) + } + else if (pMb->pNext != NULL) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("More than one mbuf or pMb->pNext not set.\n")) + } #endif /* DEBUG */ - for (pMb = Para.pParaPtr; pMb != NULL; pMb = pNextMb) { - pNextMb = pMb->pNext; - pMb->pNext = NULL; + for (pMb = Para.pParaPtr; pMb != NULL; pMb = pNextMb) { + pNextMb = pMb->pNext; + pMb->pNext = NULL; + + NetNumber = pAC->Rlmt.Port[pMb->PortIdx].Net->NetNumber; + if (pAC->Rlmt.Net[NetNumber].RlmtState == SK_RLMT_RS_INIT) { + SkDrvFreeRlmtMbuf(pAC, IoC, pMb); + } + else { SkRlmtPacketReceive(pAC, IoC, pMb); } + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PACKET_RECEIVED Event (%d) END.\n", Event)) - break; +#if 0 + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PACKET_RECEIVED Event END.\n")) +#endif /* 0 */ +} /* SkRlmtEvtPacketRx */ - case SK_RLMT_STATS_CLEAR: /* From PNMI. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STATS_CLEAR Event (%d) BEGIN.\n", Event)) - /* Clear statistics for virtual and physical ports. */ +/****************************************************************************** + * + * SkRlmtEvtStatsClear - STATS_CLEAR + * + * Description: + * This routine handles STATS_CLEAR events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtStatsClear( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ + SK_U32 i; + SK_RLMT_PORT *pRPort; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_CLEAR Event BEGIN.\n")) - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - pAC->Rlmt.Port[i].TxHelloCts = 0; - pAC->Rlmt.Port[i].RxHelloCts = 0; - pAC->Rlmt.Port[i].TxSpHelloReqCts = 0; - pAC->Rlmt.Port[i].RxSpHelloCts = 0; - } + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_CLEAR Event EMPTY.\n")) + return; + } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STATS_CLEAR Event (%d) END.\n", Event)) - break; + if (Para.Para32[0] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[0])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_CLEAR Event EMPTY.\n")) + return; + } + + /* Clear statistics for logical and physical ports. */ + for (i = 0; i < pAC->Rlmt.Net[Para.Para32[0]].NumPorts; i++) { + pRPort = + &pAC->Rlmt.Port[pAC->Rlmt.Net[Para.Para32[0]].Port[i]->PortNumber]; + pRPort->TxHelloCts = 0; + pRPort->RxHelloCts = 0; + pRPort->TxSpHelloReqCts = 0; + pRPort->RxSpHelloCts = 0; + } + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_CLEAR Event END.\n")) +} /* SkRlmtEvtStatsClear */ + + +/****************************************************************************** + * + * SkRlmtEvtStatsUpdate - STATS_UPDATE + * + * Description: + * This routine handles STATS_UPDATE events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtStatsUpdate( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NetNumber; SK_U32 -1 */ +{ + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_UPDATE Event EMPTY.\n")) + return; + } + + if (Para.Para32[0] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[0])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_UPDATE Event EMPTY.\n")) + return; + } - case SK_RLMT_STATS_UPDATE: /* From PNMI. */ #if 0 - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STATS_UPDATE Event (%d) BEGIN.\n", Event)) - - /* Update statistics. */ - - /* Currently always up-to-date. */ - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_STATS_UPDATE Event (%d) END.\n", Event)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_UPDATE Event BEGIN.\n")) + + /* Update statistics - currently always up-to-date. */ + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_STATS_UPDATE Event END.\n")) #endif /* 0 */ - break; +} /* SkRlmtEvtStatsUpdate */ - case SK_RLMT_PREFPORT_CHANGE: /* From PNMI. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PREFPORT_CHANGE to Port %d Event (%d) BEGIN.\n", Para.Para32[0], Event)) - /* 0xFFFFFFFF == auto-mode. */ +/****************************************************************************** + * + * SkRlmtEvtPrefportChange - PREFPORT_CHANGE + * + * Description: + * This routine handles PREFPORT_CHANGE events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtPrefportChange( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 PortIndex; SK_U32 NetNumber */ +{ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PREFPORT_CHANGE to Port %d Event BEGIN.\n", Para.Para32[0])) + + if (Para.Para32[1] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[1])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PREFPORT_CHANGE Event EMPTY.\n")) + return; + } - if (Para.Para32[0] == 0xFFFFFFFF) { - pAC->Rlmt.PrefPort = SK_RLMT_DEF_PREF_PORT; - } - else { - if (Para.Para32[0] >= (SK_U32)pAC->GIni.GIMacsFound) { - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E010, - SKERR_RLMT_E010_MSG); - - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PREFPORT_CHANGE Event (%d) EMPTY.\n", Event)) - break; - } + /* 0xFFFFFFFF == auto-mode. */ + if (Para.Para32[0] == 0xFFFFFFFF) { + pAC->Rlmt.Net[Para.Para32[1]].PrefPort = SK_RLMT_DEF_PREF_PORT; + } + else { + if (Para.Para32[0] >= pAC->Rlmt.Net[Para.Para32[1]].NumPorts) { + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E010, SKERR_RLMT_E010_MSG); - pAC->Rlmt.PrefPort = Para.Para32[0]; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PREFPORT_CHANGE Event EMPTY.\n")) + return; } - pAC->Rlmt.MacPreferred = Para.Para32[0]; + pAC->Rlmt.Net[Para.Para32[1]].PrefPort = Para.Para32[0]; + } - SkRlmtCheckSwitch(pAC, IoC); + pAC->Rlmt.Net[Para.Para32[1]].Preference = Para.Para32[0]; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_PREFPORT_CHANGE Event (%d) END.\n", Event)) - break; + if (pAC->Rlmt.Net[Para.Para32[1]].RlmtState != SK_RLMT_RS_INIT) { + SkRlmtCheckSwitch(pAC, IoC, Para.Para32[1]); + } - case SK_RLMT_MODE_CHANGE: /* From PNMI. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_MODE_CHANGE Event (%d) BEGIN.\n", Event)) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_PREFPORT_CHANGE Event END.\n")) +} /* SkRlmtEvtPrefportChange */ - if (pAC->GIni.GIMacsFound < 2) { - pAC->Rlmt.RlmtMode = SK_RLMT_CHECK_LINK; - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("Forced RLMT mode to CLS on single link adapter.\n")) - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_MODE_CHANGE Event (%d) EMPTY.\n", - Event)) - break; + +/****************************************************************************** + * + * SkRlmtEvtSetNets - SET_NETS + * + * Description: + * This routine handles SET_NETS events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtSetNets( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NumNets; SK_U32 -1 */ +{ + int i; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event BEGIN.\n")) + + if (Para.Para32[1] != (SK_U32)-1) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad Parameter.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event EMPTY.\n")) + return; + } + + if (Para.Para32[0] == 0 || Para.Para32[0] > SK_MAX_NETS || + Para.Para32[0] > (SK_U32)pAC->GIni.GIMacsFound) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad number of nets: %d.\n", Para.Para32[0])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event EMPTY.\n")) + return; + } + + if (Para.Para32[0] == pAC->Rlmt.NumNets) { /* No change. */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event EMPTY.\n")) + return; + } + + /* Entering and leaving dual mode only allowed while nets are stopped. */ + if (pAC->Rlmt.NetsStarted > 0) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Changing dual mode only allowed while all nets are stopped.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event EMPTY.\n")) + return; + } + + if (Para.Para32[0] == 1) { + if (pAC->Rlmt.NumNets > 1) { + /* Clear logical MAC addr from second net's active port. */ + (void)SkAddrOverride(pAC, IoC, pAC->Rlmt.Net[1].Port[pAC->Addr. + Net[1].ActivePort]->PortNumber, NULL, SK_ADDR_CLEAR_LOGICAL); + pAC->Rlmt.Net[1].NumPorts = 0; + } + + pAC->Rlmt.NumNets = Para.Para32[0]; + for (i = 0; (SK_U32)i < pAC->Rlmt.NumNets; i++) { + pAC->Rlmt.Net[i].RlmtState = SK_RLMT_RS_INIT; + pAC->Rlmt.Net[i].RootIdSet = SK_FALSE; + pAC->Rlmt.Net[i].Preference = 0xFFFFFFFF; /* "Automatic" */ + pAC->Rlmt.Net[i].PrefPort = SK_RLMT_DEF_PREF_PORT; + /* Just assuming. */ + pAC->Rlmt.Net[i].ActivePort = pAC->Rlmt.Net[i].PrefPort; + pAC->Rlmt.Net[i].RlmtMode = SK_RLMT_DEF_MODE; + pAC->Rlmt.Net[i].TimeoutValue = SK_RLMT_DEF_TO_VAL; + pAC->Rlmt.Net[i].NetNumber = i; + } + + pAC->Rlmt.Port[1].Net= &pAC->Rlmt.Net[0]; + pAC->Rlmt.Net[0].NumPorts = pAC->GIni.GIMacsFound; + + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_SET_NETS, Para); + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("RLMT: Changed to one net with two ports.\n")) + } + else if (Para.Para32[0] == 2) { + pAC->Rlmt.Port[1].Net= &pAC->Rlmt.Net[1]; + pAC->Rlmt.Net[1].NumPorts = pAC->GIni.GIMacsFound - 1; + pAC->Rlmt.Net[0].NumPorts = + pAC->GIni.GIMacsFound - pAC->Rlmt.Net[1].NumPorts; + + pAC->Rlmt.NumNets = Para.Para32[0]; + for (i = 0; (SK_U32)i < pAC->Rlmt.NumNets; i++) { + pAC->Rlmt.Net[i].RlmtState = SK_RLMT_RS_INIT; + pAC->Rlmt.Net[i].RootIdSet = SK_FALSE; + pAC->Rlmt.Net[i].Preference = 0xFFFFFFFF; /* "Automatic" */ + pAC->Rlmt.Net[i].PrefPort = SK_RLMT_DEF_PREF_PORT; + /* Just assuming. */ + pAC->Rlmt.Net[i].ActivePort = pAC->Rlmt.Net[i].PrefPort; + pAC->Rlmt.Net[i].RlmtMode = SK_RLMT_DEF_MODE; + pAC->Rlmt.Net[i].TimeoutValue = SK_RLMT_DEF_TO_VAL; + + pAC->Rlmt.Net[i].NetNumber = i; + } + + /* Set logical MAC addr on second net's active port. */ + (void)SkAddrOverride(pAC, IoC, pAC->Rlmt.Net[1].Port[pAC->Addr. + Net[1].ActivePort]->PortNumber, NULL, SK_ADDR_SET_LOGICAL); + + SkEventQueue(pAC, SKGE_PNMI, SK_PNMI_EVT_RLMT_SET_NETS, Para); + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("RLMT: Changed to two nets with one port each.\n")) + } + else { + /* Not implemented for more than two nets. */ + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SetNets not implemented for more than two nets.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event EMPTY.\n")) + return; + } + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_SET_NETS Event END.\n")) +} /* SkRlmtSetNets */ + + +/****************************************************************************** + * + * SkRlmtEvtModeChange - MODE_CHANGE + * + * Description: + * This routine handles MODE_CHANGE events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * Nothing + */ +RLMT_STATIC void SkRlmtEvtModeChange( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_EVPARA Para) /* SK_U32 NewMode; SK_U32 NetNumber */ +{ + SK_EVPARA Para2; + SK_U32 i; + SK_U32 PrevRlmtMode; + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_MODE_CHANGE Event BEGIN.\n")) + + if (Para.Para32[1] >= pAC->Rlmt.NumNets) { + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Bad NetNumber %d.\n", Para.Para32[1])) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_MODE_CHANGE Event EMPTY.\n")) + return; + } + + Para.Para32[0] |= SK_RLMT_CHECK_LINK; + + if (pAC->Rlmt.Net[Para.Para32[1]].NumPorts < 2 && + Para.Para32[0] != SK_RLMT_MODE_CLS) { + pAC->Rlmt.Net[Para.Para32[1]].RlmtMode = SK_RLMT_MODE_CLS; + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("Forced RLMT mode to CLS on single port net.\n")) + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_MODE_CHANGE Event EMPTY.\n")) + return; + } + + /* Update RLMT mode. */ + PrevRlmtMode = pAC->Rlmt.Net[Para.Para32[1]].RlmtMode; + pAC->Rlmt.Net[Para.Para32[1]].RlmtMode = Para.Para32[0]; + + if ((PrevRlmtMode & SK_RLMT_CHECK_LOC_LINK) != + (pAC->Rlmt.Net[Para.Para32[1]].RlmtMode & SK_RLMT_CHECK_LOC_LINK)) { + /* SK_RLMT_CHECK_LOC_LINK bit changed. */ + if ((PrevRlmtMode & SK_RLMT_CHECK_OTHERS) == 0 && + pAC->Rlmt.Net[Para.Para32[1]].NumPorts > 1 && + pAC->Rlmt.Net[Para.Para32[1]].PortsUp >= 1) { + /* 20001207 RA: Was "PortsUp == 1". */ + Para2.Para32[0] = Para.Para32[1]; + Para2.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[1]].LocTimer, + pAC->Rlmt.Net[Para.Para32[1]].TimeoutValue, + SKGE_RLMT, SK_RLMT_TIM, Para2); } + } - /* Update RLMT mode. */ + if ((PrevRlmtMode & SK_RLMT_CHECK_SEG) != + (pAC->Rlmt.Net[Para.Para32[1]].RlmtMode & SK_RLMT_CHECK_SEG)) { + /* SK_RLMT_CHECK_SEG bit changed. */ + for (i = 0; i < pAC->Rlmt.Net[Para.Para32[1]].NumPorts; i++) { + (void)SkAddrMcClear(pAC, IoC, + pAC->Rlmt.Net[Para.Para32[1]].Port[i]->PortNumber, + SK_ADDR_PERMANENT | SK_MC_SW_ONLY); - PrevRlmtMode = pAC->Rlmt.RlmtMode; - pAC->Rlmt.RlmtMode = Para.Para32[0] | SK_RLMT_CHECK_LINK; + /* Add RLMT MC address. */ + (void)SkAddrMcAdd(pAC, IoC, + pAC->Rlmt.Net[Para.Para32[1]].Port[i]->PortNumber, + &SkRlmtMcAddr, SK_ADDR_PERMANENT); - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("RLMT: Changed Mode to %X.\n", pAC->Rlmt.RlmtMode)) - - if ((PrevRlmtMode & SK_RLMT_CHECK_LOC_LINK) != - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_LOC_LINK)) { - if (!(PrevRlmtMode & SK_RLMT_CHECK_OTHERS) && - pAC->GIni.GIMacsFound > 1 && - pAC->Rlmt.PortsUp == 1) { - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.LocTimer, - pAC->Rlmt.TimeoutValue, - SKGE_RLMT, - SK_RLMT_TIM, - Para); - } - } - - if ((PrevRlmtMode & SK_RLMT_CHECK_SEG) != - (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG)) { - - for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) { - (void)SkAddrMcClear( - pAC, - IoC, - i, - SK_ADDR_PERMANENT | SK_MC_SW_ONLY); - - /* Add RLMT MC address. */ - - (void)SkAddrMcAdd( - pAC, - IoC, - i, - &SkRlmtMcAddr, - SK_ADDR_PERMANENT); - - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { - /* Add BPDU MC address. */ - - (void)SkAddrMcAdd( - pAC, - IoC, - i, - &BridgeMcAddr, - SK_ADDR_PERMANENT); - - if (pAC->Rlmt.RlmtState != - SK_RLMT_RS_INIT) { - if (!pAC->Rlmt.Port[i].LinkDown && - (Para2.pParaPtr = - SkRlmtBuildSpanningTreePacket( - pAC, - IoC, - i) - ) != NULL) { - - pAC->Rlmt.Port[i - ].RootIdSet = - SK_FALSE; - - SkEventQueue( - pAC, - SKGE_DRV, - SK_DRV_RLMT_SEND, - Para2); - } + if ((pAC->Rlmt.Net[Para.Para32[1]].RlmtMode & + SK_RLMT_CHECK_SEG) != 0) { + /* Add BPDU MC address. */ + (void)SkAddrMcAdd(pAC, IoC, + pAC->Rlmt.Net[Para.Para32[1]].Port[i]->PortNumber, + &BridgeMcAddr, SK_ADDR_PERMANENT); + + if (pAC->Rlmt.Net[Para.Para32[1]].RlmtState != SK_RLMT_RS_INIT) { + if (!pAC->Rlmt.Net[Para.Para32[1]].Port[i]->LinkDown && + (Para2.pParaPtr = SkRlmtBuildSpanningTreePacket( + pAC, IoC, i)) != NULL) { + pAC->Rlmt.Net[Para.Para32[1]].Port[i]->RootIdSet = + SK_FALSE; + SkEventQueue(pAC, SKGE_DRV, SK_DRV_RLMT_SEND, Para2); } } - - (void)SkAddrMcUpdate(pAC, IoC, i); } + (void)SkAddrMcUpdate(pAC, IoC, + pAC->Rlmt.Net[Para.Para32[1]].Port[i]->PortNumber); + } /* for ... */ + + if ((pAC->Rlmt.Net[Para.Para32[1]].RlmtMode & SK_RLMT_CHECK_SEG) != 0) { + Para2.Para32[0] = Para.Para32[1]; + Para2.Para32[1] = (SK_U32)-1; + SkTimerStart(pAC, IoC, &pAC->Rlmt.Net[Para.Para32[1]].SegTimer, + SK_RLMT_SEG_TO_VAL, SKGE_RLMT, SK_RLMT_SEG_TIM, Para2); + } + } /* SK_RLMT_CHECK_SEG bit changed. */ + + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, + ("SK_RLMT_MODE_CHANGE Event END.\n")) +} /* SkRlmtEvtModeChange */ - if (pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { - SkTimerStart( - pAC, - IoC, - &pAC->Rlmt.SegTimer, - SK_RLMT_SEG_TO_VAL, - SKGE_RLMT, - SK_RLMT_SEG_TIM, - Para); - } - } - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, - ("SK_RLMT_MODE_CHANGE Event (%d) END.\n", Event)) +/****************************************************************************** + * + * SkRlmtEvent - a PORT- or an RLMT-specific event happened + * + * Description: + * This routine calls subroutines to handle PORT- and RLMT-specific events. + * + * Context: + * runtime, pageable? + * may be called after SK_INIT_IO + * + * Returns: + * 0 + */ +int SkRlmtEvent( +SK_AC *pAC, /* Adapter Context */ +SK_IOC IoC, /* I/O Context */ +SK_U32 Event, /* Event code */ +SK_EVPARA Para) /* Event-specific parameter */ +{ + switch (Event) { + + /* ----- PORT events ----- */ + + case SK_RLMT_PORTSTART_TIM: /* From RLMT via TIME. */ + SkRlmtEvtPortStartTim(pAC, IoC, Para); + break; + case SK_RLMT_LINK_UP: /* From SIRQ. */ + SkRlmtEvtLinkUp(pAC, IoC, Para); + break; + case SK_RLMT_PORTUP_TIM: /* From RLMT via TIME. */ + SkRlmtEvtPortUpTim(pAC, IoC, Para); break; + case SK_RLMT_PORTDOWN: /* From RLMT. */ + case SK_RLMT_PORTDOWN_RX_TIM: /* From RLMT via TIME. */ + case SK_RLMT_PORTDOWN_TX_TIM: /* From RLMT via TIME. */ + SkRlmtEvtPortDownX(pAC, IoC, Event, Para); + break; + case SK_RLMT_LINK_DOWN: /* From SIRQ. */ + SkRlmtEvtLinkDown(pAC, IoC, Para); + break; + case SK_RLMT_PORT_ADDR: /* From ADDR. */ + SkRlmtEvtPortAddr(pAC, IoC, Para); + break; + + /* ----- RLMT events ----- */ + + case SK_RLMT_START: /* From DRV. */ + SkRlmtEvtStart(pAC, IoC, Para); + break; + case SK_RLMT_STOP: /* From DRV. */ + SkRlmtEvtStop(pAC, IoC, Para); + break; + case SK_RLMT_TIM: /* From RLMT via TIME. */ + SkRlmtEvtTim(pAC, IoC, Para); + break; + case SK_RLMT_SEG_TIM: + SkRlmtEvtSegTim(pAC, IoC, Para); + break; + case SK_RLMT_PACKET_RECEIVED: /* From DRV. */ + SkRlmtEvtPacketRx(pAC, IoC, Para); + break; + case SK_RLMT_STATS_CLEAR: /* From PNMI. */ + SkRlmtEvtStatsClear(pAC, IoC, Para); + break; + case SK_RLMT_STATS_UPDATE: /* From PNMI. */ + SkRlmtEvtStatsUpdate(pAC, IoC, Para); + break; + case SK_RLMT_PREFPORT_CHANGE: /* From PNMI. */ + SkRlmtEvtPrefportChange(pAC, IoC, Para); + break; + case SK_RLMT_MODE_CHANGE: /* From PNMI. */ + SkRlmtEvtModeChange(pAC, IoC, Para); + break; + case SK_RLMT_SET_NETS: /* From DRV. */ + SkRlmtEvtSetNets(pAC, IoC, Para); + break; + + /* ----- Unknown events ----- */ default: /* Create error log entry. */ - SK_DBG_MSG( - pAC, - SK_DBGMOD_RLMT, - SK_DBGCAT_CTRL, + SK_DBG_MSG(pAC, SK_DBGMOD_RLMT, SK_DBGCAT_CTRL, ("Unknown RLMT Event %d.\n", Event)) - - SK_ERR_LOG( - pAC, - SK_ERRCL_SW, - SKERR_RLMT_E003, - SKERR_RLMT_E003_MSG); + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_RLMT_E003, SKERR_RLMT_E003_MSG); break; - } + } /* switch() */ return (0); } /* SkRlmtEvent */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skvpd.c linux.20p9/drivers/net/sk98lin/skvpd.c --- linux.vanilla/drivers/net/sk98lin/skvpd.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skvpd.c Wed Jul 4 16:03:56 2001 @@ -2,8 +2,8 @@ * * Name: skvpd.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.25 $ - * Date: $Date: 1999/11/22 13:39:32 $ + * Version: $Revision: 1.26 $ + * Date: $Date: 2000/06/13 08:00:01 $ * Purpose: Shared software to read and write VPD data * ******************************************************************************/ @@ -27,6 +27,9 @@ * History: * * $Log: skvpd.c,v $ + * Revision 1.26 2000/06/13 08:00:01 mkarl + * additional cast to avoid compile problems in 64 bit environment + * * Revision 1.25 1999/11/22 13:39:32 cgoos * Changed license header to GPL. * @@ -121,7 +124,7 @@ Please refer skvpd.txt for infomation how to include this module */ static const char SysKonnectFileId[] = - "@(#)$Id: skvpd.c,v 1.25 1999/11/22 13:39:32 cgoos Exp $ (C) SK" ; + "@(#)$Id: skvpd.c,v 1.26 2000/06/13 08:00:01 mkarl Exp $ (C) SK" ; #include "h/skdrv1st.h" #include "h/sktypes.h" @@ -644,7 +647,7 @@ if (n == 0) return ; - i = end - start + 1 ; + i = (int) (end - start + 1) ; if (n < 0) { p = start + n ; while (i != 0) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sk98lin/skxmac2.c linux.20p9/drivers/net/sk98lin/skxmac2.c --- linux.vanilla/drivers/net/sk98lin/skxmac2.c Sun Mar 25 17:31:22 2001 +++ linux.20p9/drivers/net/sk98lin/skxmac2.c Wed Jul 4 16:03:56 2001 @@ -2,16 +2,15 @@ * * Name: skxmac2.c * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.50 $ - * Date: $Date: 1999/11/22 13:40:14 $ + * Version: $Revision: 1.61 $ + * Date: $Date: 2001/02/09 15:40:59 $ * Purpose: Contains functions to initialize the XMAC II * ******************************************************************************/ /****************************************************************************** * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. + * (C)Copyright 1998-2001 SysKonnect GmbH. * * 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 @@ -27,14 +26,47 @@ * History: * * $Log: skxmac2.c,v $ + * Revision 1.61 2001/02/09 15:40:59 rassmann + * Editorial changes. + * + * Revision 1.60 2001/02/07 15:02:01 cgoos + * Added workaround for Fujitsu switch link down. + * + * Revision 1.59 2001/01/10 09:38:06 cgoos + * Fixed Broadcom C0/A1 Id check for workaround. + * + * Revision 1.58 2000/11/29 11:30:38 cgoos + * Changed DEBUG sections with NW output to xDEBUG + * + * Revision 1.57 2000/11/27 12:40:40 rassmann + * Suppressing preamble after first access to BCom, not before (#10556). + * + * Revision 1.56 2000/11/09 12:32:48 rassmann + * Renamed variables. + * + * Revision 1.55 2000/11/09 11:30:10 rassmann + * WA: Waiting after releasing reset until BCom chip is accessible. + * + * Revision 1.54 2000/10/02 14:10:27 rassmann + * Reading BCOM PHY after releasing reset until it returns a valid value. + * + * Revision 1.53 2000/07/27 12:22:11 gklug + * fix: possible endless loop in XmHardRst. + * + * Revision 1.52 2000/05/22 08:48:31 malthoff + * Fix: #10523 errata valid for all BCOM PHYs. + * + * Revision 1.51 2000/05/17 12:52:18 malthoff + * Fixes BCom link errata (#10523). + * * Revision 1.50 1999/11/22 13:40:14 cgoos * Changed license header to GPL. * * Revision 1.49 1999/11/22 08:12:13 malthoff - * Add workaround for power consumption feature of Bcom C0 chip. + * Add workaround for power consumption feature of BCom C0 chip. * * Revision 1.48 1999/11/16 08:39:01 malthoff - * Fix: MDIO preamble suppression is port dependend. + * Fix: MDIO preamble suppression is port dependent. * * Revision 1.47 1999/08/27 08:55:35 malthoff * 1000BT: Optimizing MDIO transfer by oppressing MDIO preamble. @@ -70,8 +102,7 @@ * Changes for 1000Base-T. * * Revision 1.38 1999/04/08 14:35:10 malthoff - * Add code for enabling signal detect. Enabling signal - * detect is disabled. + * Add code for enabling signal detect. Enabling signal detect is disabled. * * Revision 1.37 1999/03/12 13:42:54 malthoff * Add: Jumbo Frame Support. @@ -225,11 +256,11 @@ /* local variables ************************************************************/ static const char SysKonnectFileId[] = - "@(#)$Id: skxmac2.c,v 1.50 1999/11/22 13:40:14 cgoos Exp $ (C) SK "; + "@(#)$Id: skxmac2.c,v 1.61 2001/02/09 15:40:59 rassmann Exp $ (C) SK "; /* BCOM PHY magic pattern list */ typedef struct s_PhyHack { - int PhyReg; /* Phy register */ + int PhyReg; /* Phy register */ SK_U16 PhyVal; /* Value to write */ } BCOM_HACK; @@ -284,12 +315,12 @@ void SkXmSetRxCmd( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* The XMAC to handle with belongs to this Port */ -int Mode) /* Mode is SK_STRIP_FCS_ON/OFF, SK_STRIP_PAD_ON/OFF, - SK_LENERR_OK_ON/OFF, or SK_BIG_PK_OK_ON/OFF */ +int Port, /* The XMAC to handle with belongs to this Port */ +int Mode) /* Mode is SK_STRIP_FCS_ON/OFF, SK_STRIP_PAD_ON/OFF, + SK_LENERR_OK_ON/OFF, or SK_BIG_PK_OK_ON/OFF */ { - SK_GEPORT *pPrt; - SK_U16 OldRxMode; + SK_GEPORT *pPrt; + SK_U16 OldRxMode; pPrt = &pAC->GIni.GP[Port]; OldRxMode = pPrt->PRxCmd; @@ -334,7 +365,8 @@ if (OldRxMode != pPrt->PRxCmd) { XM_OUT16(IoC, Port, XM_RX_CMD, pPrt->PRxCmd); } -} +} /* SkXmSetRxCmd*/ + /****************************************************************************** * @@ -351,12 +383,12 @@ void SkXmClrExactAddr( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* The XMAC to handle with belongs to this Port */ -int StartNum, /* Begin with this Address Register Index (0..15) */ -int StopNum) /* Stop after finished with this Register Idx (0..15) */ +int Port, /* The XMAC to handle with belongs to this Port */ +int StartNum, /* Begin with this Address Register Index (0..15) */ +int StopNum) /* Stop after finished with this Register Idx (0..15) */ { - int i; - SK_U16 ZeroAddr[3] = { 0x0000, 0x0000, 0x0000 }; + int i; + SK_U16 ZeroAddr[3] = {0x0000, 0x0000, 0x0000}; if ((unsigned)StartNum > 15 || (unsigned)StopNum > 15 || StartNum > StopNum) { @@ -368,7 +400,8 @@ for (i = StartNum; i <= StopNum; i++) { XM_OUTADDR(IoC, Port, XM_EXM(i), &ZeroAddr[0]); } -} +} /* SkXmClrExactAddr */ + /****************************************************************************** * @@ -384,12 +417,13 @@ static void SkXmClrSrcCheck( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ +int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ { - SK_U16 ZeroAddr[3] = { 0x0000, 0x0000, 0x0000 }; + SK_U16 ZeroAddr[3] = {0x0000, 0x0000, 0x0000}; XM_OUTHASH(IoC, Port, XM_SRC_CHK, &ZeroAddr); -} +} /* SkXmClrSrcCheck */ + /****************************************************************************** * @@ -404,12 +438,13 @@ static void SkXmClrHashAddr( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ +int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ { - SK_U16 ZeroAddr[4] = { 0x0000, 0x0000, 0x0000, 0x0000 }; + SK_U16 ZeroAddr[4] = {0x0000, 0x0000, 0x0000, 0x0000}; XM_OUTHASH(IoC, Port, XM_HSM, &ZeroAddr); -} +} /* SkXmClrHashAddr*/ + /****************************************************************************** * @@ -424,14 +459,15 @@ void SkXmFlushTxFifo( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ +int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ { SK_U32 MdReg; XM_IN32(IoC, Port, XM_MODE, &MdReg); MdReg |= XM_MD_FTF; XM_OUT32(IoC, Port, XM_MODE, MdReg); -} +} /* SkXmFlushTxFifo */ + /****************************************************************************** * @@ -446,14 +482,15 @@ void SkXmFlushRxFifo( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ +int Port) /* The XMAC to handle with belongs to this Port (MAC_1 + n) */ { SK_U32 MdReg; XM_IN32(IoC, Port, XM_MODE, &MdReg); MdReg |= XM_MD_FRF; XM_OUT32(IoC, Port, XM_MODE, MdReg); -} +} /* SkXmFlushRxFifo*/ + /****************************************************************************** * @@ -493,10 +530,10 @@ void SkXmSoftRst( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* port to stop (MAC_1 + n) */ +int Port) /* port to stop (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 Word; + SK_U16 Word; pPrt = &pAC->GIni.GP[Port]; @@ -518,13 +555,11 @@ /* disable all PHY IRQs */ switch (pAC->GIni.GP[Port].PhyType) { - case SK_PHY_BCOM: - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, - 0xffff); + case SK_PHY_BCOM: + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, 0xffff); break; case SK_PHY_LONE: - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, - 0x0); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, 0x0); break; case SK_PHY_NAT: /* todo: National @@ -545,7 +580,8 @@ SkXmFlushRxFifo(pAC, IoC, Port); pAC->GIni.GP[Port].PState = SK_PRT_STOP; -} +} /* SkXmSoftRst*/ + /****************************************************************************** * @@ -559,31 +595,47 @@ * register (Timing requirements: Broadcom: 400ns, Level One: * none, National: 80ns). * + * ATTENTION: + * It is absolutely neccessary to reset the SW_RST Bit first + * before calling this function. + * * Returns: * nothing */ void SkXmHardRst( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* port to stop (MAC_1 + n) */ +int Port) /* port to stop (MAC_1 + n) */ { - SK_U16 Word; - int i; SK_U32 Reg; + int i; + int TOut; + SK_U16 Word; - for (i=0; i<4; i++) { + for (i = 0; i < 4; i++) { /* TX_MFF_CTRL1 is a 32 bit register but only the lowest 16 */ /* bit contains buttoms to press */ - SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), - (SK_U16) MFF_CLR_MAC_RST); - SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), - (SK_U16) MFF_SET_MAC_RST); + SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), (SK_U16)MFF_CLR_MAC_RST); + + TOut = 0; do { + TOut ++; + if (TOut > 10000) { + /* + * Adapter seems to be in RESET state. + * Registers cannot be written. + */ + return; + } + + SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), + (SK_U16) MFF_SET_MAC_RST); SK_IN16(IoC,MR_ADDR(Port,TX_MFF_CTRL1), &Word); } while ((Word & MFF_SET_MAC_RST) == 0); } - if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) { + /* For external PHYs there must be special handling */ + if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) { /* reset external PHY */ SK_IN32(IoC, B2_GP_IO, &Reg); if (Port == 0) { @@ -601,7 +653,8 @@ } pAC->GIni.GP[Port].PState = SK_PRT_RESET; -} +} /* SkXmHardRst */ + /****************************************************************************** * @@ -612,8 +665,7 @@ * The XMAC must be reset or stopped before calling this function. * * Note: - * The XMACs Rx and Tx state machine is still disabled when - * returning. + * The XMAC's Rx and Tx state machine is still disabled when returning. * * Returns: * nothing @@ -621,12 +673,13 @@ void SkXmInitMac( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { - SK_GEPORT *pPrt; - SK_U16 SWord; - int i; - SK_U32 Reg; + SK_GEPORT *pPrt; + SK_U32 Reg; + int i; + SK_U16 SWord; + SK_U16 PhyId; pPrt = &pAC->GIni.GP[Port]; @@ -634,74 +687,118 @@ /* Port State: SK_PRT_STOP */ /* Verify that the reset bit is cleared */ SK_IN16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), &SWord); - if (SWord & (SK_U16) MFF_SET_MAC_RST) { + if (SWord & (SK_U16)MFF_SET_MAC_RST) { /* PState does not match HW state */ - SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E006, - SKERR_HWI_E006MSG); - /* correct it */ + SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E006, SKERR_HWI_E006MSG); + /* Correct it. */ pPrt->PState = SK_PRT_RESET; } } + if (pPrt->PState == SK_PRT_RESET) { /* * clear HW reset * Note: The SW reset is self clearing, therefore there is * nothing to do here. */ - SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), - (SK_U16) MFF_CLR_MAC_RST); - - /* - * clear PHY reset - */ - if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) { + SK_OUT16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), (SK_U16)MFF_CLR_MAC_RST); + + /* Ensure that XMAC reset release is done (errata from LReinbold?). */ + SK_IN16(IoC, MR_ADDR(Port, TX_MFF_CTRL1), &SWord); + /* Clear PHY reset. */ + if (pAC->GIni.GP[Port].PhyType != SK_PHY_XMAC) { SK_IN32(IoC, B2_GP_IO, &Reg); if (Port == 0) { - Reg |= GP_DIR_0; /* set to output */ + Reg |= GP_DIR_0; /* Set to output. */ Reg |= GP_IO_0; } else { - Reg |= GP_DIR_2; /* set to output */ + Reg |= GP_DIR_2; /* Set to output. */ Reg |= GP_IO_2; } SK_OUT32(IoC, B2_GP_IO, Reg); - /* enable GMII interface */ + /* Enable GMII interface. */ XM_OUT16(IoC, Port, XM_HW_CFG, XM_HW_GMII_MD); - /* optimize MDIO transfer by oppressing preamble */ + PHY_READ(IoC, pPrt, Port, PHY_XMAC_ID1, &PhyId); +#ifdef xDEBUG + if (SWord == 0xFFFF) { + i = 1; + do { + PHY_READ(IoC, pPrt, Port, PHY_XMAC_ID1, &SWord); + i++; + /* Limit retries; else machine may hang. */ + } while (SWord == 0xFFFF && i < 500000); + + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "ID1 is %x after %d reads.", + (void *)SWord, + (void *)i); + + /* Trigger PCI analyzer */ + /* SK_IN32(IoC, 0x012c, &Reg); */ + } +#endif /* DEBUG */ + + /* + * Optimize MDIO transfer by suppressing preamble. + * Must be done AFTER first access to BCOM chip. + */ XM_IN16(IoC, Port, XM_MMU_CMD, &SWord); XM_OUT16(IoC, Port, XM_MMU_CMD, SWord | XM_MMU_NO_PRE); - /* Workaround BCOM Errata for the A1 type */ - /* Write magic patterns to reserved registers */ - PHY_READ(IoC, pPrt, Port, PHY_XMAC_ID1, &SWord); - if (SWord == 0x6041) { + if (PhyId == 0x6044) { + /* Workaround BCOM Errata for the C0 type. */ + /* Write magic patterns to reserved registers. */ i = 0; - while (BcomRegA1Hack[i].PhyReg != 0) { - PHY_WRITE(IoC, pPrt, Port, - BcomRegA1Hack[i].PhyReg, - BcomRegA1Hack[i].PhyVal); + while (BcomRegC0Hack[i].PhyReg != 0) { + PHY_WRITE(IoC, pPrt, Port, BcomRegC0Hack[i].PhyReg, + BcomRegC0Hack[i].PhyVal); i++; } } - /* Workaround BCOM Errata for the C0 type */ - /* Write magic patterns to reserved registers */ - if (SWord == 0x6044) { + else if (PhyId == 0x6041) { + /* Workaround BCOM Errata for the A1 type. */ + /* Write magic patterns to reserved registers. */ i = 0; - while (BcomRegC0Hack[i].PhyReg != 0) { - PHY_WRITE(IoC, pPrt, Port, - BcomRegC0Hack[i].PhyReg, - BcomRegC0Hack[i].PhyVal); + while (BcomRegA1Hack[i].PhyReg != 0) { + PHY_WRITE(IoC, pPrt, Port, BcomRegA1Hack[i].PhyReg, + BcomRegA1Hack[i].PhyVal); i++; } } - /* - * PHY LED initialization is performed in - * SkGeXmitLED() (but not here). - */ + /* Workaround BCOM Errata (#10523) for all BCom PHYs. */ + /* Disable Power Management after reset. */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, &SWord); +#ifdef xDEBUG + if (SWord == 0xFFFF) { + i = 1; + do { + PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, &SWord); + i++; + /* Limit retries; else machine may hang. */ + } while (SWord == 0xFFFF && i < 500000); + + CMSMPrintString( + pAC->pConfigTable, + MSG_TYPE_RUNTIME_INFO, + "AUX_CTRL is %x after %d reads.", + (void *)SWord, + (void *)i); + + /* Trigger PCI analyzer */ + /* SK_IN32(IoC, 0x012c, &Reg); */ + } +#endif /* DEBUG */ + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, + SWord | PHY_B_AC_DIS_PM); + + /* PHY LED initialization is done in SkGeXmitLED(), not here. */ } /* Dummy read the Interrupt source register */ @@ -709,7 +806,7 @@ /* * The autonegotiation process starts immediately after - * clearing the reset. Autonegotiation process should be + * clearing the reset. The autonegotiation process should be * started by the SIRQ, therefore stop it here immediately. */ SkXmInitPhy(pAC, IoC, Port, SK_FALSE); @@ -817,7 +914,8 @@ * This should be done after the autonegotiation process * has been completed successfully. */ -} +} /* SkXmInitMac*/ + /****************************************************************************** * @@ -834,7 +932,7 @@ void SkXmInitDupMd( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { switch (pAC->GIni.GP[Port].PLinkModeStatus) { case SK_LMODE_STAT_AUTOHALF: @@ -863,7 +961,8 @@ SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_HWI_E007, SKERR_HWI_E007MSG); break; } -} +} /* SkXmInitDupMd */ + /****************************************************************************** * @@ -881,11 +980,11 @@ void SkXmInitPauseMd( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 Word; SK_U32 DWord; + SK_U16 Word; pPrt = &pAC->GIni.GP[Port]; @@ -944,8 +1043,7 @@ /* Disable Pause Mode in MAC Rx FIFO */ SK_OUT16(IoC, MR_ADDR(Port,RX_MFF_CTRL1), MFF_DIS_PAUSE); } - -} +} /* SkXmInitPauseMd*/ /****************************************************************************** @@ -963,7 +1061,7 @@ void SkXmInitPhy( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL DoLoop) /* Should a Phy LOOback be set-up? */ { SK_GEPORT *pPrt; @@ -983,7 +1081,8 @@ SkXmInitPhyNat(pAC, IoC, Port, DoLoop); break; } -} +} /* SkXmInitPhy*/ + /****************************************************************************** * @@ -1000,11 +1099,11 @@ static void SkXmInitPhyXmac( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL DoLoop) /* Should a Phy LOOback be set-up? */ { SK_GEPORT *pPrt; - SK_U16 Crtl; + SK_U16 Ctrl; pPrt = &pAC->GIni.GP[Port]; @@ -1015,67 +1114,69 @@ ("InitPhyXmac: no autonegotiation Port %d\n", Port)); /* No Autonegiotiation */ /* Set DuplexMode in Config register */ - Crtl = (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); + Ctrl = (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); /* * Do NOT enable Autonegotiation here. This would hold * the link down because no IDLES are transmitted */ - } else { + } + else { SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("InitPhyXmac: with autonegotiation Port %d\n", Port)); /* Set Autonegotiation advertisement */ - Crtl = 0; + Ctrl = 0; /* Set Full/half duplex capabilities */ switch (pPrt->PLinkMode) { case SK_LMODE_AUTOHALF: - Crtl |= PHY_X_AN_HD; + Ctrl |= PHY_X_AN_HD; break; case SK_LMODE_AUTOFULL: - Crtl |= PHY_X_AN_FD; + Ctrl |= PHY_X_AN_FD; break; case SK_LMODE_AUTOBOTH: - Crtl |= PHY_X_AN_FD | PHY_X_AN_HD; + Ctrl |= PHY_X_AN_FD | PHY_X_AN_HD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, - SKERR_HWI_E015, SKERR_HWI_E015MSG) ; + SKERR_HWI_E015, SKERR_HWI_E015MSG); } switch (pPrt->PFlowCtrlMode) { case SK_FLOW_MODE_NONE: - Crtl |= PHY_X_P_NO_PAUSE; + Ctrl |= PHY_X_P_NO_PAUSE; break; case SK_FLOW_MODE_LOC_SEND: - Crtl |= PHY_X_P_ASYM_MD; + Ctrl |= PHY_X_P_ASYM_MD; break; case SK_FLOW_MODE_SYMMETRIC: - Crtl |= PHY_X_P_SYM_MD; + Ctrl |= PHY_X_P_SYM_MD; break; case SK_FLOW_MODE_SYM_OR_REM: - Crtl |= PHY_X_P_BOTH_MD; + Ctrl |= PHY_X_P_BOTH_MD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, - SKERR_HWI_E016, SKERR_HWI_E016MSG) ; + SKERR_HWI_E016, SKERR_HWI_E016MSG); } /* Write AutoNeg Advertisement Register */ - PHY_WRITE(IoC, pPrt, Port, PHY_XMAC_AUNE_ADV, Crtl) ; + PHY_WRITE(IoC, pPrt, Port, PHY_XMAC_AUNE_ADV, Ctrl); /* Restart Autonegotiation */ - Crtl = PHY_CT_ANE | PHY_CT_RE_CFG; + Ctrl = PHY_CT_ANE | PHY_CT_RE_CFG; } if (DoLoop) { /* Set the Phy Loopback bit, too */ - Crtl |= PHY_CT_LOOP; + Ctrl |= PHY_CT_LOOP; } /* Write to the Phy control register */ - PHY_WRITE(IoC, pPrt, Port, PHY_XMAC_CTRL, Crtl) ; -} + PHY_WRITE(IoC, pPrt, Port, PHY_XMAC_CTRL, Ctrl); +} /* SkXmInitPhyXmac*/ + /****************************************************************************** * @@ -1092,23 +1193,29 @@ static void SkXmInitPhyBcom( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL DoLoop) /* Should a Phy LOOback be set-up? */ { SK_GEPORT *pPrt; - SK_U16 Crtl1 = PHY_B_CT_SP1000; - SK_U16 Crtl2 = 0; - SK_U16 Crtl3 = PHY_SEL_TYPE; - SK_U16 Crtl4 = PHY_B_PEC_EN_LTR; - SK_U16 Crtl5 = PHY_B_AC_TX_TST; + SK_U16 Ctrl1; + SK_U16 Ctrl2; + SK_U16 Ctrl3; + SK_U16 Ctrl4; + SK_U16 Ctrl5; + + Ctrl1 = PHY_B_CT_SP1000; + Ctrl2 = 0; + Ctrl3 = PHY_SEL_TYPE; + Ctrl4 = PHY_B_PEC_EN_LTR; + Ctrl5 = PHY_B_AC_TX_TST; pPrt = &pAC->GIni.GP[Port]; - /* manuell Master/Slave ? */ + /* manually Master/Slave ? */ if (pPrt->PMSMode != SK_MS_MODE_AUTO) { - Crtl2 |= PHY_B_1000C_MSE; + Ctrl2 |= PHY_B_1000C_MSE; if (pPrt->PMSMode == SK_MS_MODE_MASTER) { - Crtl2 |= PHY_B_1000C_MSC; + Ctrl2 |= PHY_B_1000C_MSC; } } /* Autonegotiation ? */ @@ -1118,18 +1225,19 @@ ("InitPhyBcom: no autonegotiation Port %d\n", Port)); /* No Autonegiotiation */ /* Set DuplexMode in Config register */ - Crtl1 |= (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); + Ctrl1 |= (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); - /* Determine Master/Slave manuell if not already done */ + /* Determine Master/Slave manually if not already done. */ if (pPrt->PMSMode == SK_MS_MODE_AUTO) { - Crtl2 |= PHY_B_1000C_MSE; /* set it to Slave */ + Ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ } /* * Do NOT enable Autonegotiation here. This would hold * the link down because no IDLES are transmitted */ - } else { + } + else { SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("InitPhyBcom: with autonegotiation Port %d\n", Port)); /* Set Autonegotiation advertisement */ @@ -1137,31 +1245,31 @@ /* Set Full/half duplex capabilities */ switch (pPrt->PLinkMode) { case SK_LMODE_AUTOHALF: - Crtl2 |= PHY_B_1000C_AHD; + Ctrl2 |= PHY_B_1000C_AHD; break; case SK_LMODE_AUTOFULL: - Crtl2 |= PHY_B_1000C_AFD; + Ctrl2 |= PHY_B_1000C_AFD; break; case SK_LMODE_AUTOBOTH: - Crtl2 |= PHY_B_1000C_AFD | PHY_B_1000C_AHD; + Ctrl2 |= PHY_B_1000C_AFD | PHY_B_1000C_AHD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, - SKERR_HWI_E015, SKERR_HWI_E015MSG) ; + SKERR_HWI_E015, SKERR_HWI_E015MSG); } switch (pPrt->PFlowCtrlMode) { case SK_FLOW_MODE_NONE: - Crtl3 |= PHY_B_P_NO_PAUSE; + Ctrl3 |= PHY_B_P_NO_PAUSE; break; case SK_FLOW_MODE_LOC_SEND: - Crtl3 |= PHY_B_P_ASYM_MD; + Ctrl3 |= PHY_B_P_ASYM_MD; break; case SK_FLOW_MODE_SYMMETRIC: - Crtl3 |= PHY_B_P_SYM_MD; + Ctrl3 |= PHY_B_P_SYM_MD; break; case SK_FLOW_MODE_SYM_OR_REM: - Crtl3 |= PHY_B_P_BOTH_MD; + Ctrl3 |= PHY_B_P_BOTH_MD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, @@ -1169,7 +1277,7 @@ } /* Restart Autonegotiation */ - Crtl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; + Ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; } @@ -1178,39 +1286,40 @@ init order of LEDs and XMAC. (MAl) */ /* Write 1000Base-T Control Register */ - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_1000T_CTRL, Crtl2); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_1000T_CTRL, Ctrl2); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("1000Base-T Control Reg = %x\n", Crtl2)); + ("1000Base-T Control Reg = %x\n", Ctrl2)); /* Write AutoNeg Advertisement Register */ - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUNE_ADV, Crtl3); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUNE_ADV, Ctrl3); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("AutoNeg Advertisment Reg = %x\n", Crtl3)); + ("AutoNeg Advertisment Reg = %x\n", Ctrl3)); if (DoLoop) { /* Set the Phy Loopback bit, too */ - Crtl1 |= PHY_CT_LOOP; + Ctrl1 |= PHY_CT_LOOP; } if (pAC->GIni.GIPortUsage == SK_JUMBO_LINK) { /* configure fifo to high latency for xmission of ext. packets*/ - Crtl4 |= PHY_B_PEC_HIGH_LA; + Ctrl4 |= PHY_B_PEC_HIGH_LA; /* configure reception of extended packets */ - Crtl5 |= PHY_B_AC_LONG_PACK; + Ctrl5 |= PHY_B_AC_LONG_PACK; - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, Crtl5); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, Ctrl5); } /* Configure LED Traffic Mode and Jumbo Frame usage if specified */ - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_P_EXT_CTRL, Crtl4); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_P_EXT_CTRL, Ctrl4); /* Write to the Phy control register */ - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_CTRL, Crtl1); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_CTRL, Ctrl1); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("PHY Control Reg = %x\n", Crtl1)); -} + ("PHY Control Reg = %x\n", Ctrl1)); +} /* SkXmInitPhyBcom */ + /****************************************************************************** * @@ -1227,21 +1336,25 @@ static void SkXmInitPhyLone( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL DoLoop) /* Should a Phy LOOback be set-up? */ { SK_GEPORT *pPrt; - SK_U16 Crtl1 = PHY_L_CT_SP1000; - SK_U16 Crtl2 = 0; - SK_U16 Crtl3 = PHY_SEL_TYPE; + SK_U16 Ctrl1; + SK_U16 Ctrl2; + SK_U16 Ctrl3; + + Ctrl1 = PHY_L_CT_SP1000; + Ctrl2 = 0; + Ctrl3 = PHY_SEL_TYPE; pPrt = &pAC->GIni.GP[Port]; - /* manuell Master/Slave ? */ + /* manually Master/Slave ? */ if (pPrt->PMSMode != SK_MS_MODE_AUTO) { - Crtl2 |= PHY_L_1000C_MSE; + Ctrl2 |= PHY_L_1000C_MSE; if (pPrt->PMSMode == SK_MS_MODE_MASTER) { - Crtl2 |= PHY_L_1000C_MSC; + Ctrl2 |= PHY_L_1000C_MSC; } } /* Autonegotiation ? */ @@ -1257,18 +1370,19 @@ ("InitPhyLone: no autonegotiation Port %d\n", Port)); /* No Autonegiotiation */ /* Set DuplexMode in Config register */ - Crtl1 = (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); + Ctrl1 = (pPrt->PLinkMode == SK_LMODE_FULL ? PHY_CT_DUP_MD : 0); - /* Determine Master/Slave manuell if not already done */ + /* Determine Master/Slave manually if not already done. */ if (pPrt->PMSMode == SK_MS_MODE_AUTO) { - Crtl2 |= PHY_L_1000C_MSE; /* set it to Slave */ + Ctrl2 |= PHY_L_1000C_MSE; /* set it to Slave */ } /* * Do NOT enable Autonegotiation here. This would hold * the link down because no IDLES are transmitted */ - } else { + } + else { SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("InitPhyLone: with autonegotiation Port %d\n", Port)); /* Set Autonegotiation advertisement */ @@ -1276,31 +1390,31 @@ /* Set Full/half duplex capabilities */ switch (pPrt->PLinkMode) { case SK_LMODE_AUTOHALF: - Crtl2 |= PHY_L_1000C_AHD; + Ctrl2 |= PHY_L_1000C_AHD; break; case SK_LMODE_AUTOFULL: - Crtl2 |= PHY_L_1000C_AFD; + Ctrl2 |= PHY_L_1000C_AFD; break; case SK_LMODE_AUTOBOTH: - Crtl2 |= PHY_L_1000C_AFD | PHY_L_1000C_AHD; + Ctrl2 |= PHY_L_1000C_AFD | PHY_L_1000C_AHD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, - SKERR_HWI_E015, SKERR_HWI_E015MSG) ; + SKERR_HWI_E015, SKERR_HWI_E015MSG); } switch (pPrt->PFlowCtrlMode) { case SK_FLOW_MODE_NONE: - Crtl3 |= PHY_L_P_NO_PAUSE; + Ctrl3 |= PHY_L_P_NO_PAUSE; break; case SK_FLOW_MODE_LOC_SEND: - Crtl3 |= PHY_L_P_ASYM_MD; + Ctrl3 |= PHY_L_P_ASYM_MD; break; case SK_FLOW_MODE_SYMMETRIC: - Crtl3 |= PHY_L_P_SYM_MD; + Ctrl3 |= PHY_L_P_SYM_MD; break; case SK_FLOW_MODE_SYM_OR_REM: - Crtl3 |= PHY_L_P_BOTH_MD; + Ctrl3 |= PHY_L_P_BOTH_MD; break; default: SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, @@ -1308,7 +1422,7 @@ } /* Restart Autonegotiation */ - Crtl1 = PHY_CT_ANE | PHY_CT_RE_CFG; + Ctrl1 = PHY_CT_ANE | PHY_CT_RE_CFG; } @@ -1317,19 +1431,19 @@ init order of LEDs and XMAC. (MAl) */ /* Write 1000Base-T Control Register */ - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_1000T_CTRL, Crtl2); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_1000T_CTRL, Ctrl2); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("1000Base-T Control Reg = %x\n", Crtl2)); + ("1000Base-T Control Reg = %x\n", Ctrl2)); /* Write AutoNeg Advertisement Register */ - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_AUNE_ADV, Crtl3); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_AUNE_ADV, Ctrl3); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("AutoNeg Advertisment Reg = %x\n", Crtl3)); + ("AutoNeg Advertisment Reg = %x\n", Ctrl3)); if (DoLoop) { /* Set the Phy Loopback bit, too */ - Crtl1 |= PHY_CT_LOOP; + Ctrl1 |= PHY_CT_LOOP; } if (pAC->GIni.GIPortUsage == SK_JUMBO_LINK) { @@ -1340,10 +1454,11 @@ } /* Write to the Phy control register */ - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_CTRL, Crtl1); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_CTRL, Ctrl1); SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, - ("PHY Control Reg = %x\n", Crtl1)); -} + ("PHY Control Reg = %x\n", Ctrl1)); +} /* SkXmInitPhyLone*/ + /****************************************************************************** * @@ -1360,11 +1475,12 @@ static void SkXmInitPhyNat( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_BOOL DoLoop) /* Should a Phy LOOback be set-up? */ { /* todo: National */ -} +} /* SkXmInitPhyNat*/ + /****************************************************************************** * @@ -1377,7 +1493,7 @@ void SkXmAutoNegLipaXmac( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U16 IStatus) /* Interrupt Status word to analyse */ { SK_GEPORT *pPrt; @@ -1391,7 +1507,8 @@ ("AutoNegLipa: AutoNeg detected on port %d %x\n", Port, IStatus)); pPrt->PLipaAutoNeg = SK_LIPA_AUTO; } -} +} /* SkXmAutoNegLipaXmac*/ + /****************************************************************************** * @@ -1404,21 +1521,20 @@ void SkXmAutoNegLipaBcom( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U16 PhyStat) /* PHY Status word to analyse */ { SK_GEPORT *pPrt; pPrt = &pAC->GIni.GP[Port]; - if (pPrt->PLipaAutoNeg != SK_LIPA_AUTO && - (PhyStat & (PHY_ST_AN_OVER))) { - + if (pPrt->PLipaAutoNeg != SK_LIPA_AUTO && (PhyStat & PHY_ST_AN_OVER)) { SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegLipa: AutoNeg detected on port %d %x\n", Port, PhyStat)); pPrt->PLipaAutoNeg = SK_LIPA_AUTO; } -} +} /* SkXmAutoNegLipaBcom*/ + /****************************************************************************** * @@ -1445,7 +1561,8 @@ ("AutoNegLipa: AutoNeg detected on port %d %x\n", Port, PhyStat)); pPrt->PLipaAutoNeg = SK_LIPA_AUTO; } -} +} /* SkXmAutoNegLipaLone*/ + /****************************************************************************** * @@ -1458,7 +1575,7 @@ void SkXmAutoNegLipaNat( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U16 PhyStat) /* PHY Status word to analyse */ { SK_GEPORT *pPrt; @@ -1472,7 +1589,9 @@ ("AutoNegLipa: AutoNeg detected on port %d %x\n", Port, PhyStat)); pPrt->PLipaAutoNeg = SK_LIPA_AUTO; } -} +} /* SkXmAutoNegLipaNat*/ + + /****************************************************************************** * * SkXmAutoNegDone() - Auto negotiation handling @@ -1493,13 +1612,9 @@ int SkXmAutoNegDone( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { - SK_GEPORT *pPrt; - - pPrt = &pAC->GIni.GP[Port]; - - switch (pPrt->PhyType) { + switch (pAC->GIni.GP[Port].PhyType) { case SK_PHY_XMAC: return (SkXmAutoNegDoneXmac(pAC, IoC, Port)); case SK_PHY_BCOM: @@ -1509,8 +1624,9 @@ case SK_PHY_NAT: return (SkXmAutoNegDoneNat(pAC, IoC, Port)); } - return(SK_AND_OTHER); -} + return (SK_AND_OTHER); +} /* SkXmAutoNegDone*/ + /****************************************************************************** * @@ -1530,11 +1646,11 @@ static int SkXmAutoNegDoneXmac( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 ResAb ; /* Resolved Ability */ - SK_U16 LPAb ; /* Link Partner Ability */ + SK_U16 ResAb; /* Resolved Ability */ + SK_U16 LPAb; /* Link Partner Ability */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegDoneXmac" "Port %d\n",Port)); @@ -1550,21 +1666,23 @@ /* Error */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegFail: Remote fault bit set Port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE ; - return (SK_AND_OTHER) ; + pPrt->PAutoNegFail = SK_TRUE; + return (SK_AND_OTHER); } /* Check Duplex mismatch */ if ((ResAb & (PHY_X_RS_HD | PHY_X_RS_FD)) == PHY_X_RS_FD) { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL ; - } else if ((ResAb & (PHY_X_RS_HD | PHY_X_RS_FD)) == PHY_X_RS_HD) { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF ; - } else { + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL; + } + else if ((ResAb & (PHY_X_RS_HD | PHY_X_RS_FD)) == PHY_X_RS_HD) { + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF; + } + else { /* Error */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegFail: Duplex mode mismatch port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE ; - return (SK_AND_DUP_CAP) ; + pPrt->PAutoNegFail = SK_TRUE; + return (SK_AND_DUP_CAP); } /* Check PAUSE mismatch */ @@ -1575,25 +1693,29 @@ (LPAb & PHY_X_P_SYM_MD)) { /* Symmetric PAUSE */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_SYMMETRIC; - } else if (pPrt->PFlowCtrlMode == SK_FLOW_MODE_SYM_OR_REM && + } + else if (pPrt->PFlowCtrlMode == SK_FLOW_MODE_SYM_OR_REM && (LPAb & PHY_X_RS_PAUSE) == PHY_X_P_ASYM_MD) { /* Enable PAUSE receive, disable PAUSE transmit */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_REM_SEND; - } else if (pPrt->PFlowCtrlMode == SK_FLOW_MODE_LOC_SEND && + } + else if (pPrt->PFlowCtrlMode == SK_FLOW_MODE_LOC_SEND && (LPAb & PHY_X_RS_PAUSE) == PHY_X_P_BOTH_MD) { /* Disable PAUSE receive, enable PAUSE transmit */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_LOC_SEND; - } else { + } + else { /* PAUSE mismatch -> no PAUSE */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE; } /* We checked everything and may now enable the link */ - pPrt->PAutoNegFail = SK_FALSE ; + pPrt->PAutoNegFail = SK_FALSE; SkXmRxTxEnable(pAC, IoC, Port); - return(SK_AND_OK) ; -} + return (SK_AND_OK); +} /* SkXmAutoNegDoneXmac*/ + /****************************************************************************** * @@ -1613,82 +1735,99 @@ static int SkXmAutoNegDoneBcom( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 ResAb ; /* Resolved Ability */ - SK_U16 LPAb ; /* Link Partner Ability */ + SK_U16 LPAb; /* Link Partner Ability */ SK_U16 AuxStat; /* Auxiliary Status */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegDoneBcom," - " Port %d\n",Port)); +#if 0 +01-Sep-2000 RA;:;: + SK_U16 ResAb; /* Resolved Ability */ +#endif /* 0 */ + + SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, + ("AutoNegDoneBcom, Port %d\n", Port)); pPrt = &pAC->GIni.GP[Port]; - /* Get PHY parameters */ + /* Get PHY parameters. */ PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUNE_LP, &LPAb); +#if 0 +01-Sep-2000 RA;:;: PHY_READ(IoC, pPrt, Port, PHY_BCOM_1000T_STAT, &ResAb); +#endif /* 0 */ PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUX_STAT, &AuxStat); if (LPAb & PHY_B_AN_RF) { - /* Remote fault bit is set */ - /* Error */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, + /* Remote fault bit is set: Error. */ + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("AutoNegFail: Remote fault bit set Port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE ; - return (SK_AND_OTHER) ; + pPrt->PAutoNegFail = SK_TRUE; + return (SK_AND_OTHER); } - /* Check Duplex mismatch */ + /* Check Duplex mismatch. */ if ((AuxStat & PHY_B_AS_AN_RES) == PHY_B_RES_1000FD) { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL ; - } else if ((AuxStat & PHY_B_AS_AN_RES) == PHY_B_RES_1000HD) { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF ; - } else { - /* Error */ + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL; + } + else if ((AuxStat & PHY_B_AS_AN_RES) == PHY_B_RES_1000HD) { + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF; + } + else { + /* Error. */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegFail: Duplex mode mismatch port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE ; - return (SK_AND_DUP_CAP) ; + pPrt->PAutoNegFail = SK_TRUE; + return (SK_AND_DUP_CAP); } - /* Check Master/Slave resolution */ - if (ResAb & (PHY_B_1000S_MSF)) { - /* Error */ - SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, +#if 0 +01-Sep-2000 RA;:;: + /* Check Master/Slave resolution. */ + if (ResAb & PHY_B_1000S_MSF) { + /* Error. */ + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_CTRL, ("Master/Slave Fault port %d\n", Port)); pPrt->PAutoNegFail = SK_TRUE; pPrt->PMSStatus = SK_MS_STAT_FAULT; return (SK_AND_OTHER); - } else if (ResAb & PHY_B_1000S_MSR) { - pPrt->PMSStatus = SK_MS_STAT_MASTER ; - } else { - pPrt->PMSStatus = SK_MS_STAT_SLAVE ; } + else if (ResAb & PHY_B_1000S_MSR) { + pPrt->PMSStatus = SK_MS_STAT_MASTER; + } + else { + pPrt->PMSStatus = SK_MS_STAT_SLAVE; + } +#endif /* 0 */ - /* Check PAUSE mismatch */ - /* We are NOT using chapter 4.23 of the Xaqti manual */ - /* We are using IEEE 802.3z/D5.0 Table 37-4 */ + /* Check PAUSE mismatch. */ + /* We are NOT using chapter 4.23 of the Xaqti manual. */ + /* We are using IEEE 802.3z/D5.0 Table 37-4. */ if ((AuxStat & (PHY_B_AS_PRR | PHY_B_AS_PRT)) == (PHY_B_AS_PRR | PHY_B_AS_PRT)) { - /* Symmetric PAUSE */ + /* Symmetric PAUSE. */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_SYMMETRIC; - } else if ((AuxStat & (PHY_B_AS_PRR | PHY_B_AS_PRT)) == PHY_B_AS_PRR) { - /* Enable PAUSE receive, disable PAUSE transmit */ + } + else if ((AuxStat & (PHY_B_AS_PRR | PHY_B_AS_PRT)) == PHY_B_AS_PRR) { + /* Enable PAUSE receive, disable PAUSE transmit. */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_REM_SEND; - } else if ((AuxStat & (PHY_B_AS_PRR | PHY_B_AS_PRT)) == PHY_B_AS_PRT) { - /* Disable PAUSE receive, enable PAUSE transmit */ + } + else if ((AuxStat & (PHY_B_AS_PRR | PHY_B_AS_PRT)) == PHY_B_AS_PRT) { + /* Disable PAUSE receive, enable PAUSE transmit. */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_LOC_SEND; - } else { - /* PAUSE mismatch -> no PAUSE */ + } + else { + /* PAUSE mismatch -> no PAUSE. */ pPrt->PFlowCtrlStatus = SK_FLOW_STAT_NONE; } - /* We checked everything and may now enable the link */ - pPrt->PAutoNegFail = SK_FALSE ; + /* We checked everything and may now enable the link. */ + pPrt->PAutoNegFail = SK_FALSE; SkXmRxTxEnable(pAC, IoC, Port); - return(SK_AND_OK) ; -} + return (SK_AND_OK); +} /* SkXmAutoNegDoneBcom*/ + /****************************************************************************** * @@ -1708,11 +1847,11 @@ static int SkXmAutoNegDoneLone( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 ResAb ; /* Resolved Ability */ - SK_U16 LPAb ; /* Link Partner Ability */ + SK_U16 ResAb; /* Resolved Ability */ + SK_U16 LPAb; /* Link Partner Ability */ SK_U16 QuickStat; /* Auxiliary Status */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegDoneLone" @@ -1729,15 +1868,16 @@ /* Error */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("AutoNegFail: Remote fault bit set Port %d\n", Port)); - pPrt->PAutoNegFail = SK_TRUE ; - return (SK_AND_OTHER) ; + pPrt->PAutoNegFail = SK_TRUE; + return (SK_AND_OTHER); } /* Check Duplex mismatch */ if (QuickStat & PHY_L_QS_DUP_MOD) { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL ; - } else { - pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF ; + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOFULL; + } + else { + pPrt->PLinkModeStatus = SK_LMODE_STAT_AUTOHALF; } /* Check Master/Slave resolution */ @@ -1746,12 +1886,14 @@ SK_DBG_MSG(pAC,SK_DBGMOD_HWM,SK_DBGCAT_CTRL, ("Master/Slave Fault port %d\n", Port)); pPrt->PAutoNegFail = SK_TRUE; - pPrt->PMSStatus = SK_MS_STAT_FAULT ; + pPrt->PMSStatus = SK_MS_STAT_FAULT; return (SK_AND_OTHER); - } else if (ResAb & PHY_L_1000S_MSR) { - pPrt->PMSStatus = SK_MS_STAT_MASTER ; - } else { - pPrt->PMSStatus = SK_MS_STAT_SLAVE ; + } + else if (ResAb & PHY_L_1000S_MSR) { + pPrt->PMSStatus = SK_MS_STAT_MASTER; + } + else { + pPrt->PMSStatus = SK_MS_STAT_SLAVE; } /* Check PAUSE mismatch */ @@ -1793,11 +1935,12 @@ } /* We checked everything and may now enable the link */ - pPrt->PAutoNegFail = SK_FALSE ; + pPrt->PAutoNegFail = SK_FALSE; SkXmRxTxEnable(pAC, IoC, Port); - return(SK_AND_OK); -} + return (SK_AND_OK); +} /* SkXmAutoNegDoneLone */ + /****************************************************************************** * @@ -1819,11 +1962,12 @@ static int SkXmAutoNegDoneNat( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { /* todo: National */ - return(SK_AND_OK); -} + return (SK_AND_OK); +} /* SkXmAutoNegDoneNat*/ + /****************************************************************************** * @@ -1841,17 +1985,18 @@ int SkXmRxTxEnable( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port) /* Port Index (MAC_1 + n) */ +int Port) /* Port Index (MAC_1 + n) */ { SK_GEPORT *pPrt; - SK_U16 Reg ; /* 16bit register value */ + SK_U16 Reg; /* 16bit register value */ SK_U16 IntMask; /* XMac interrupt mask */ + SK_U16 SWord; pPrt = &pAC->GIni.GP[Port]; if (!pPrt->PHWLinkUp) { /* The Hardware link is NOT up */ - return(0) ; + return (0); } if ((pPrt->PLinkMode == SK_LMODE_AUTOHALF || @@ -1859,7 +2004,7 @@ pPrt->PLinkMode == SK_LMODE_AUTOBOTH) && pPrt->PAutoNegFail) { /* Autonegotiation is not done or failed */ - return(0) ; + return (0); } /* Set Dup Mode and Pause Mode */ @@ -1893,12 +2038,14 @@ } switch (pPrt->PhyType) { case SK_PHY_BCOM: - PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, - PHY_B_DEF_MSK); + /* Workaround BCOM Errata (#10523) for all BCom Phys */ + /* Enable Power Management after link up */ + PHY_READ(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, &SWord); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_AUX_CTRL, SWord & ~PHY_B_AC_DIS_PM); + PHY_WRITE(IoC, pPrt, Port, PHY_BCOM_INT_MASK, PHY_B_DEF_MSK); break; case SK_PHY_LONE: - PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, - PHY_L_DEF_MSK); + PHY_WRITE(IoC, pPrt, Port, PHY_LONE_INT_ENAB, PHY_L_DEF_MSK); break; case SK_PHY_NAT: /* todo National: @@ -1910,9 +2057,10 @@ XM_OUT16(IoC, Port, XM_MMU_CMD, Reg | XM_MMU_ENA_RX | XM_MMU_ENA_TX); return (0); -} +} /* SkXmRxTxEnable*/ #ifndef SK_DIAG + /****************************************************************************** * * SkXmIrq() - Interrupt service routine @@ -1938,11 +2086,12 @@ void SkXmIrq( SK_AC *pAC, /* adapter context */ SK_IOC IoC, /* IO context */ -int Port, /* Port Index (MAC_1 + n) */ +int Port, /* Port Index (MAC_1 + n) */ SK_U16 IStatus) /* Interrupt status read from the XMAC */ { SK_GEPORT *pPrt; SK_EVPARA Para; + SK_U16 IStatus2; pPrt = &pAC->GIni.GP[Port]; @@ -1954,7 +2103,7 @@ } /* - * LinkPartner Autonegable ? + * LinkPartner Autonegable? */ if (pPrt->PhyType == SK_PHY_XMAC) { SkXmAutoNegLipaXmac(pAC, IoC, Port, IStatus); @@ -1966,11 +2115,22 @@ if (!pPrt->PHWLinkUp) { /* Spurious XMAC interrupt */ SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, - ("SkXmIrq: spurious interrupt on port %d\n", - Port)); + ("SkXmIrq: spurious interrupt on port %d\n", Port)); return; } + if (IStatus & XM_IS_INP_ASS) { + /* Reread ISR Register if link is not in sync */ + XM_IN16(IoC, Port, XM_ISRC, &IStatus2); + + SK_DBG_MSG(pAC, SK_DBGMOD_HWM, SK_DBGCAT_IRQ, + ("SkXmIrq: Link async. Double check port %d %x %x\n", + Port, IStatus, IStatus2)); + IStatus &= ~XM_IS_INP_ASS; + IStatus |= IStatus2; + + } + if (IStatus & XM_IS_LNK_AE) { /* not used GP0 is used instead */ } @@ -1992,7 +2152,7 @@ /* Start workaround Errata #2 timer */ SkTimerStart(pAC, IoC, &pAC->GIni.GP[Port].PWaTimer, - SK_WA_INA_TIME,SKGE_HWAC,SK_HWEV_WATIM,Para); + SK_WA_INA_TIME, SKGE_HWAC, SK_HWEV_WATIM, Para); } if (IStatus & XM_IS_RX_PAGE) { @@ -2031,7 +2191,7 @@ if (IStatus & XM_IS_TXF_UR) { /* may NOT happen -> error log */ SK_ERR_LOG(pAC, SK_ERRCL_HW , SKERR_SIRQ_E020, - SKERR_SIRQ_E020MSG) ; + SKERR_SIRQ_E020MSG); } if (IStatus & XM_IS_TX_COMP) { @@ -2042,7 +2202,8 @@ /* not served here */ } -} +} /* SkXmIrq*/ + #endif /* !SK_DIAG */ /* End of file */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/skfp/drvfbi.c linux.20p9/drivers/net/skfp/drvfbi.c --- linux.vanilla/drivers/net/skfp/drvfbi.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/skfp/drvfbi.c Wed Jul 4 16:03:56 2001 @@ -849,7 +849,7 @@ #ifdef EISA -/*arrays with io adresses of dma controller length and adress registers*/ +/*arrays with io addresses of dma controller length and address registers*/ static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ; static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ; static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/skfp/h/smc.h linux.20p9/drivers/net/skfp/h/smc.h --- linux.vanilla/drivers/net/skfp/h/smc.h Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/skfp/h/smc.h Wed Jul 4 16:03:56 2001 @@ -297,7 +297,7 @@ #define RS_NORINGOP (1<< 5) /* no ring op */ #define RS_VERSION (1<< 4) /* SMT version mismatch */ #define RS_STUCKBYPASSS (1<< 3) /* stuck bypass */ -#define RS_EVENT (1<< 2) /* FDDI event occured */ +#define RS_EVENT (1<< 2) /* FDDI event occurred */ #define RS_RINGOPCHANGE (1<< 1) /* ring op changed */ #define RS_RES0 (1<< 0) /* reserved */ @@ -320,7 +320,7 @@ u_char evc_rep_required ; /* report required */ u_short evc_para ; /* SMT Para Number */ u_char *evc_cond_state ; /* condition state */ - u_char *evc_multiple ; /* multiple occurence */ + u_char *evc_multiple ; /* multiple occurrence */ } ; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/skfp/pcmplc.c linux.20p9/drivers/net/skfp/pcmplc.c --- linux.vanilla/drivers/net/skfp/pcmplc.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/skfp/pcmplc.c Wed Jul 4 16:03:56 2001 @@ -1722,7 +1722,7 @@ } if (cmd & PL_EBUF_ERR) { /* elastic buff. det. over-|underflow*/ /* - * Check whether the SRF Condition occured. + * Check whether the SRF Condition occurred. */ if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){ /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/skfp/srf.c linux.20p9/drivers/net/skfp/srf.c --- linux.vanilla/drivers/net/skfp/srf.c Sun Mar 25 17:31:23 2001 +++ linux.20p9/drivers/net/skfp/srf.c Wed Jul 4 16:03:56 2001 @@ -197,7 +197,7 @@ struct s_srf_evc *evc ; int cond_asserted = 0 ; int cond_deasserted = 0 ; - int event_occured = 0 ; + int event_occurred = 0 ; int tsr ; int T_Limit = 2*TICKS_PER_SECOND ; @@ -246,7 +246,7 @@ *evc->evc_multiple = FALSE ; } smc->srf.any_report = TRUE ; - event_occured = TRUE ; + event_occurred = TRUE ; } #ifdef FDDI_MIB snmp_srf_event(smc,evc) ; @@ -268,7 +268,7 @@ break ; } /* SR01c */ - if (event_occured && tsr < T_Limit) { + if (event_occurred && tsr < T_Limit) { smc->srf.sr_state = SR1_HOLDOFF ; break ; } @@ -286,7 +286,7 @@ break ; } /* SR00d */ - if (event_occured && tsr >= T_Limit) { + if (event_occurred && tsr >= T_Limit) { smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/slip.h linux.20p9/drivers/net/slip.h --- linux.vanilla/drivers/net/slip.h Sun Mar 25 17:31:15 2001 +++ linux.20p9/drivers/net/slip.h Thu Jul 26 18:07:32 2001 @@ -89,7 +89,7 @@ int xdata, xbits; /* 6 bit slip controls */ #endif - unsigned int flags; /* Flag values/ mode etc */ + unsigned long flags; /* Flag values/ mode etc */ #define SLF_INUSE 0 /* Channel in use */ #define SLF_ESCAPE 1 /* ESC received */ #define SLF_ERROR 2 /* Parity, etc. error */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/starfire-kcomp22.h linux.20p9/drivers/net/starfire-kcomp22.h --- linux.vanilla/drivers/net/starfire-kcomp22.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/net/starfire-kcomp22.h Wed Aug 8 22:36:42 2001 @@ -0,0 +1,343 @@ +#ifndef __STARFIRE_KCOMP22_H +#define __STARFIRE_KCOMP22_H + +#include +#include + +/* MII constants */ +#define MII_BMCR 0x00 /* Basic mode control register */ +#define MII_BMSR 0x01 /* Basic mode status register */ +#define MII_ADVERTISE 0x04 /* Advertisement control reg */ +#define MII_LPA 0x05 /* Link partner ability reg */ + +#define BMCR_FULLDPLX 0x0100 /* Full duplex */ +#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ +#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ +#define BMCR_SPEED100 0x2000 /* Select 100Mbps */ +#define BMCR_RESET 0x8000 /* Reset the DP83840 */ + +#define BMSR_LSTATUS 0x0004 /* Link status */ + +#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ +#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ +#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ +#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ +#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ + +#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ +#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ +#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ +#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ + +/* MII ioctls */ +#define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */ +#define SIOCGMIIREG 0x8948 /* Read MII PHY register. */ +#define SIOCSMIIREG 0x8949 /* Write MII PHY register. */ + +/* This structure is used in all SIOCxMIIxxx ioctl calls */ +struct mii_ioctl_data { + u16 phy_id; + u16 reg_num; + u16 val_in; + u16 val_out; +}; + +/* ethtool stuff */ +#define SIOCETHTOOL 0x8946 /* Ethtool interface */ + +/* This should work for both 32 and 64 bit userland. */ +struct ethtool_cmd { + u32 cmd; + u32 supported; /* Features this interface supports */ + u32 advertising; /* Features this interface advertises */ + u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + u8 duplex; /* Duplex, half or full */ + u8 port; /* Which connector port */ + u8 phy_address; + u8 transceiver; /* Which tranceiver to use */ + u8 autoneg; /* Enable or disable autonegotiation */ + u32 maxtxpkt; /* Tx pkts before generating tx int */ + u32 maxrxpkt; /* Rx pkts before generating rx int */ + u32 reserved[4]; +}; + +/* these strings are set to whatever the driver author decides... */ +struct ethtool_drvinfo { + u32 cmd; + char driver[32]; /* driver short name, "tulip", "eepro100" */ + char version[32]; /* driver version string */ + char fw_version[32]; /* firmware version string, if applicable */ + char bus_info[32]; /* Bus info for this interface. For PCI + * devices, use pci_dev->slot_name. */ + char reserved1[32]; + char reserved2[32]; +}; + +/* CMDs currently supported */ +#define ETHTOOL_GSET 0x00000001 /* Get settings. */ +#define ETHTOOL_SSET 0x00000002 /* Set settings, privileged. */ +#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */ + +/* Indicates what features are supported by the interface. */ +#define SUPPORTED_10baseT_Half (1 << 0) +#define SUPPORTED_10baseT_Full (1 << 1) +#define SUPPORTED_100baseT_Half (1 << 2) +#define SUPPORTED_100baseT_Full (1 << 3) +#define SUPPORTED_1000baseT_Half (1 << 4) +#define SUPPORTED_1000baseT_Full (1 << 5) +#define SUPPORTED_Autoneg (1 << 6) +#define SUPPORTED_TP (1 << 7) +#define SUPPORTED_AUI (1 << 8) +#define SUPPORTED_MII (1 << 9) +#define SUPPORTED_FIBRE (1 << 10) + +/* Indicates what features are advertised by the interface. */ +#define ADVERTISED_10baseT_Half (1 << 0) +#define ADVERTISED_10baseT_Full (1 << 1) +#define ADVERTISED_100baseT_Half (1 << 2) +#define ADVERTISED_100baseT_Full (1 << 3) +#define ADVERTISED_1000baseT_Half (1 << 4) +#define ADVERTISED_1000baseT_Full (1 << 5) +#define ADVERTISED_Autoneg (1 << 6) +#define ADVERTISED_TP (1 << 7) +#define ADVERTISED_AUI (1 << 8) +#define ADVERTISED_MII (1 << 9) +#define ADVERTISED_FIBRE (1 << 10) + +/* The forced speed, 10Mb, 100Mb, gigabit. */ +#define SPEED_10 10 +#define SPEED_100 100 +#define SPEED_1000 1000 + +/* Duplex, half or full. */ +#define DUPLEX_HALF 0x00 +#define DUPLEX_FULL 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 + +/* Which tranceiver to use. */ +#define XCVR_INTERNAL 0x00 +#define XCVR_EXTERNAL 0x01 + +/* Enable or disable autonegotiation. If this is set to enable, + * the forced link modes above are completely ignored. + */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + + +static LIST_HEAD(pci_drivers); + +struct pci_driver_mapping { + struct pci_dev *dev; + struct pci_driver *drv; + void *driver_data; +}; + +struct pci_device_id { + unsigned int vendor, device; + unsigned int subvendor, subdevice; + unsigned int class, class_mask; + unsigned long driver_data; +}; + +struct pci_driver { + struct list_head node; + struct pci_dev *dev; + char *name; + const struct pci_device_id *id_table; /* NULL if wants all devices */ + int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ + void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ + void (*suspend)(struct pci_dev *dev); /* Device suspended */ + void (*resume)(struct pci_dev *dev); /* Device woken up */ +}; + +#define PCI_MAX_MAPPINGS 16 +static struct pci_driver_mapping drvmap [PCI_MAX_MAPPINGS] = { { NULL, } , }; + +#define __devinit __init +#define __devinitdata __initdata +#define __devexit +#define MODULE_DEVICE_TABLE(foo,bar) +#define SET_MODULE_OWNER(dev) +#define COMPAT_MOD_INC_USE_COUNT MOD_INC_USE_COUNT +#define COMPAT_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT +#define PCI_ANY_ID (~0) +#define IORESOURCE_MEM 2 +#define PCI_DMA_FROMDEVICE 0 +#define PCI_DMA_TODEVICE 0 +#define PCI_SLOT_NAME(pci_dev) "" + +#define pci_request_regions(pdev, name) 0 +#define pci_release_regions(pdev) do {} while(0) +#define del_timer_sync(timer) del_timer(timer) +#define alloc_etherdev(size) init_etherdev(NULL, size) +#define register_netdev(dev) 0 + +static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, + dma_addr_t *dma_handle) +{ + void *virt_ptr; + + virt_ptr = kmalloc(size, GFP_KERNEL); + *dma_handle = virt_to_bus(virt_ptr); + return virt_ptr; +} +#define pci_free_consistent(cookie, size, ptr, dma_ptr) kfree(ptr) +#define pci_map_single(cookie, address, size, dir) virt_to_bus(address) +#define pci_unmap_single(cookie, address, size, dir) +#define pci_dma_sync_single(cookie, address, size, dir) +#undef pci_resource_flags +#define pci_resource_flags(dev, i) \ + ((dev->base_address[i] & IORESOURCE_IO) ? IORESOURCE_IO : IORESOURCE_MEM) + +static void * pci_get_drvdata (struct pci_dev *dev) +{ + int i; + + for (i = 0; i < PCI_MAX_MAPPINGS; i++) + if (drvmap[i].dev == dev) + return drvmap[i].driver_data; + + return NULL; +} + +static void pci_set_drvdata (struct pci_dev *dev, void *driver_data) +{ + int i; + + for (i = 0; i < PCI_MAX_MAPPINGS; i++) + if (drvmap[i].dev == dev) { + drvmap[i].driver_data = driver_data; + return; + } +} + +static const struct pci_device_id * __init +pci_compat_match_device(const struct pci_device_id *ids, struct pci_dev *dev) +{ + u16 subsystem_vendor, subsystem_device; + + pci_read_config_word(dev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor); + pci_read_config_word(dev, PCI_SUBSYSTEM_ID, &subsystem_device); + + while (ids->vendor || ids->subvendor || ids->class_mask) { + if ((ids->vendor == PCI_ANY_ID || ids->vendor == dev->vendor) && + (ids->device == PCI_ANY_ID || ids->device == dev->device) && + (ids->subvendor == PCI_ANY_ID || ids->subvendor == subsystem_vendor) && + (ids->subdevice == PCI_ANY_ID || ids->subdevice == subsystem_device) && + !((ids->class ^ dev->class) & ids->class_mask)) + return ids; + ids++; + } + return NULL; +} + +static int __init +pci_announce_device(struct pci_driver *drv, struct pci_dev *dev) +{ + const struct pci_device_id *id; + int found, i; + + if (drv->id_table) { + id = pci_compat_match_device(drv->id_table, dev); + if (!id) + return 0; + } else + id = NULL; + + found = 0; + for (i = 0; i < PCI_MAX_MAPPINGS; i++) + if (!drvmap[i].dev) { + drvmap[i].dev = dev; + drvmap[i].drv = drv; + found = 1; + break; + } + + if (!found) + return 0; + + if (drv->probe(dev, id) >= 0) + return 1; + + /* clean up */ + drvmap[i].dev = NULL; + return 0; +} + +static int __init +pci_register_driver(struct pci_driver *drv) +{ + struct pci_dev *dev; + int count = 0, found, i; + list_add_tail(&drv->node, &pci_drivers); + for (dev = pci_devices; dev; dev = dev->next) { + found = 0; + for (i = 0; i < PCI_MAX_MAPPINGS && !found; i++) + if (drvmap[i].dev == dev) + found = 1; + if (!found) + count += pci_announce_device(drv, dev); + } + return count; +} + +static void +pci_unregister_driver(struct pci_driver *drv) +{ + struct pci_dev *dev; + int i, found; + list_del(&drv->node); + for (dev = pci_devices; dev; dev = dev->next) { + found = 0; + for (i = 0; i < PCI_MAX_MAPPINGS; i++) + if (drvmap[i].dev == dev) { + found = 1; + break; + } + if (found) { + if (drv->remove) + drv->remove(dev); + drvmap[i].dev = NULL; + } + } +} + +static inline int pci_module_init(struct pci_driver *drv) +{ + if (pci_register_driver(drv)) + return 0; + return -ENODEV; +} + +static struct pci_driver starfire_driver; + +int __init starfire_probe(struct net_device *dev) +{ + static int __initdata probed = 0; + + if (probed) + return -ENODEV; + probed++; + + return pci_module_init(&starfire_driver); +} + +#define init_tx_timer(dev, func, timeout) +#define kick_tx_timer(dev, func, timeout) \ + if (netif_queue_stopped(dev)) { \ + /* If this happens network layer tells us we're broken. */ \ + if (jiffies - dev->trans_start > timeout) \ + func(dev); \ + } + +#define netif_start_if(dev) dev->start = 1 +#define netif_stop_if(dev) dev->start = 0 + +#endif /* __STARFIRE_KCOMP22_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/starfire.c linux.20p9/drivers/net/starfire.c --- linux.vanilla/drivers/net/starfire.c Sun Mar 25 18:45:41 2001 +++ linux.20p9/drivers/net/starfire.c Thu Jul 26 15:49:47 2001 @@ -2,6 +2,10 @@ /* Written 1998-2000 by Donald Becker. + Current maintainer is Ion Badulescu . Please + send all bug reports to me, and not to Donald Becker, as this code + has been modified quite a bit from Donald's original version. + This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference. Drivers based on or derived from this code fall under the GPL and must @@ -63,31 +67,44 @@ - Quell bogus error messages, inform about the Tx threshold - Removed #ifdef CONFIG_PCI, this driver is PCI only + LK1.2.9 (Ion Badulescu) + - Merged Jeff Garzik's changes from 2.4.4-pre5 + - Added 2.2.x compatibility stuff required by the above changes + + LK1.2.9a (Ion Badulescu) + - More updates from Jeff Garzik + + LK1.3.0 (Ion Badulescu) + - Merged zerocopy support + + LK1.3.1 (Ion Badulescu) + - Added ethtool support + - Added GPIO (media change) interrupt support + + LK1.3.2 (Ion Badulescu) + - Fixed 2.2.x compatibility issues introduced in 1.3.1 + - Fixed ethtool ioctl returning uninitialized memory + + LK1.3.3 (Ion Badulescu) + - Initialize the TxMode register properly + - Don't dereference dev->priv after freeing it + TODO: - implement tx_timeout() properly - - support ethtool */ -/* These identify the driver base version and may not be removed. */ -static const char version1[] = -"starfire.c:v1.03 7/26/2000 Written by Donald Becker \n"; -static const char version2[] = -" Updates and info at http://www.scyld.com/network/starfire.html\n"; - -static const char version3[] = -" (unofficial 2.2.x kernel port, version 1.2.8, March 7, 2001)\n"; - -/* The user-configurable values. - These may be modified when a driver module is loaded.*/ +#define DRV_NAME "starfire" +#define DRV_VERSION "1.03+LK1.3.3" +#define DRV_RELDATE "July 05, 2001" /* * Adaptec's license for their Novell drivers (which is where I got the - * firmware files) does not allow to redistribute them. Thus, we can't - * include them with this driver. + * firmware files) does not allow one to redistribute them. Thus, we can't + * include the firmware with this driver. * - * However, an end-user is allowed to download and use them, after - * converting them to C header files using starfire_firmware.pl. - * Once that's done, the #undef must be changed into a #define + * However, an end-user is allowed to download and use it, after + * converting it to C header files using starfire_firmware.pl. + * Once that's done, the #undef below must be changed into a #define * for this driver to really use the firmware. Note that Rx/Tx * hardware TCP checksumming is not possible without the firmware. * @@ -100,16 +117,25 @@ * of length 1. If and when this is fixed, the #define below can be removed. */ #define HAS_BROKEN_FIRMWARE +/* + * Define this if using the driver with the zero-copy patch + */ +#if defined(HAS_FIRMWARE) && defined(MAX_SKB_FRAGS) +#define ZEROCOPY +#endif + +/* The user-configurable values. + These may be modified when a driver module is loaded.*/ /* Used for tuning interrupt latency vs. overhead. */ -static int interrupt_mitigation = 0x0; +static int interrupt_mitigation; static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */ static int max_interrupt_work = 20; -static int mtu = 0; +static int mtu; /* Maximum number of multicast addresses to filter (vs. rx-all-multicast). The Starfire has a 512 element hash table based on the Ethernet CRC. */ -static int multicast_filter_limit = 32; +static int multicast_filter_limit = 512; #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ /* @@ -122,12 +148,12 @@ * packets as the starfire doesn't allow for misaligned DMAs ;-( * 23/10/2000 - Jes * - * Neither does the Alpha. -Ion + * The Alpha and the Sparc don't allow unaligned loads, either. -Ion */ -#if defined(__ia64__) || defined(__alpha__) +#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__) static int rx_copybreak = PKT_BUF_SZ; #else -static int rx_copybreak = 0; +static int rx_copybreak /* = 0 */; #endif /* Used to pass the media type, etc. @@ -135,8 +161,8 @@ The media type is usually passed in 'options[]'. */ #define MAX_UNITS 8 /* More are supported, limit only on options */ -static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int options[MAX_UNITS] = {0, }; +static int full_duplex[MAX_UNITS] = {0, }; /* Operational parameters that are set at compile time. */ @@ -152,39 +178,72 @@ /* Operational parameters that usually are not changed. */ /* Time in jiffies before concluding the transmitter is hung. */ -#define TX_TIMEOUT (2*HZ) +#define TX_TIMEOUT (2 * HZ) +#ifdef ZEROCOPY +#if MAX_SKB_FRAGS <= 6 +#define MAX_STARFIRE_FRAGS 6 +#else /* MAX_STARFIRE_FRAGS > 6 */ +#warning This driver will not work with more than 6 skb fragments. +#warning Turning off zerocopy support. +#undef ZEROCOPY +#endif /* MAX_STARFIRE_FRAGS > 6 */ +#endif /* ZEROCOPY */ + +#ifdef ZEROCOPY +#define skb_first_frag_len(skb) skb_headlen(skb) +#else /* not ZEROCOPY */ #define skb_first_frag_len(skb) (skb->len) - -#if !defined(__OPTIMIZE__) -#warning You must compile this file with the correct options! -#warning See the last lines of the source file. -#error You must compile this driver with "-O". -#endif +#endif /* not ZEROCOPY */ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include #include #include #include /* Processor type for cache alignment. */ -#include -#include +#include #ifdef HAS_FIRMWARE #include "starfire_firmware.h" #endif /* HAS_FIRMWARE */ +/* 2.2.x compatibility code */ +#if LINUX_VERSION_CODE < 0x20300 + +#include "starfire-kcomp22.h" + +#else /* LINUX_VERSION_CODE > 0x20300 */ + +#include +#include + +#define COMPAT_MOD_INC_USE_COUNT +#define COMPAT_MOD_DEC_USE_COUNT + +#define init_tx_timer(dev, func, timeout) \ + dev->tx_timeout = func; \ + dev->watchdog_timeo = timeout; +#define kick_tx_timer(dev, func, timeout) + +#define netif_start_if(dev) +#define netif_stop_if(dev) + +#define PCI_SLOT_NAME(pci_dev) (pci_dev)->slot_name + +#endif /* LINUX_VERSION_CODE > 0x20300 */ +/* end of compatibility code */ + + +/* These identify the driver base version and may not be removed. */ +static char version[] __devinitdata = +KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker \n" +KERN_INFO " Updates and info at http://www.scyld.com/network/starfire.html\n" +KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; + MODULE_AUTHOR("Donald Becker "); MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); MODULE_PARM(max_interrupt_work, "i"); @@ -194,6 +253,12 @@ MODULE_PARM(interrupt_mitigation, "i"); MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM_DESC(max_interrupt_work, "Starfire maximum events handled per interrupt"); +MODULE_PARM_DESC(mtu, "Starfire MTU (all boards)"); +MODULE_PARM_DESC(debug, "Starfire debug level (0-6)"); +MODULE_PARM_DESC(rx_copybreak, "Starfire copy breakpoint for copy-only-tiny-frames"); +MODULE_PARM_DESC(options, "Starfire: Bits 0-3: media type, bit 17: full duplex"); +MODULE_PARM_DESC(full_duplex, "Starfire full duplex setting(s) (1)"); /* Theory of Operation @@ -225,7 +290,7 @@ each structure. There are far too many to document here. For transmit this driver uses type 0/1 transmit descriptors (depending -on the presence of the zerocopy patches), and relies on automatic +on the presence of the zerocopy infrastructure), and relies on automatic minimum-length padding. It does not use the completion queue consumer index, but instead checks for non-zero status entries. @@ -241,7 +306,7 @@ phase of receive. A notable aspect of operation is that unaligned buffers are not permitted by -the Starfire hardware. The IP header at offset 14 in an ethernet frame thus +the Starfire hardware. Thus the IP header at offset 14 in an ethernet frame isn't longword aligned, which may cause problems on some machine e.g. Alphas and IA64. For these architectures, the driver is forced to copy the frame into a new skbuff unconditionally. Copied frames are put into the @@ -278,236 +343,8 @@ -/* 2.2.x compatibility code */ -#if LINUX_VERSION_CODE < 0x20300 -#include - -static LIST_HEAD(pci_drivers); - -struct pci_driver_mapping { - struct pci_dev *dev; - struct pci_driver *drv; - void *driver_data; -}; - -struct pci_device_id { - unsigned int vendor, device; - unsigned int subvendor, subdevice; - unsigned int class, class_mask; - unsigned long driver_data; -}; - -struct pci_driver { - struct list_head node; - struct pci_dev *dev; - char *name; - const struct pci_device_id *id_table; /* NULL if wants all devices */ - int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ - void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ - void (*suspend)(struct pci_dev *dev); /* Device suspended */ - void (*resume)(struct pci_dev *dev); /* Device woken up */ -}; - -#define PCI_MAX_MAPPINGS 16 -static struct pci_driver_mapping drvmap [PCI_MAX_MAPPINGS] = { { NULL, } , }; - -#define __devinit __init -#define __devinitdata __initdata -#define __devexit -#define MODULE_DEVICE_TABLE(foo,bar) -#define SET_MODULE_OWNER(dev) -#define COMPAT_MOD_INC_USE_COUNT MOD_INC_USE_COUNT -#define COMPAT_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT -#define PCI_ANY_ID (~0) -#define IORESOURCE_MEM 2 -#define PCI_DMA_FROMDEVICE 0 -#define PCI_DMA_TODEVICE 0 - -#define request_mem_region(addr, size, name) ((void *)1) -#define release_mem_region(addr, size) -#define del_timer_sync(timer) del_timer(timer) - -static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - void *virt_ptr; - - virt_ptr = kmalloc(size, GFP_KERNEL); - *dma_handle = virt_to_bus(virt_ptr); - return virt_ptr; -} -#define pci_free_consistent(cookie, size, ptr, dma_ptr) kfree(ptr) -#define pci_map_single(cookie, address, size, dir) virt_to_bus(address) -#define pci_unmap_single(cookie, address, size, dir) -#define pci_dma_sync_single(cookie, address, size, dir) -#undef pci_resource_flags -#define pci_resource_flags(dev, i) \ - ((dev->base_address[i] & IORESOURCE_IO) ? IORESOURCE_IO : IORESOURCE_MEM) - -static void * pci_get_drvdata (struct pci_dev *dev) -{ - int i; - - for (i = 0; i < PCI_MAX_MAPPINGS; i++) - if (drvmap[i].dev == dev) - return drvmap[i].driver_data; - - return NULL; -} - -static void pci_set_drvdata (struct pci_dev *dev, void *driver_data) -{ - int i; - - for (i = 0; i < PCI_MAX_MAPPINGS; i++) - if (drvmap[i].dev == dev) { - drvmap[i].driver_data = driver_data; - return; - } -} - -static const struct pci_device_id * __init -pci_compat_match_device(const struct pci_device_id *ids, struct pci_dev *dev) -{ - u16 subsystem_vendor, subsystem_device; - - pci_read_config_word(dev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor); - pci_read_config_word(dev, PCI_SUBSYSTEM_ID, &subsystem_device); - - while (ids->vendor || ids->subvendor || ids->class_mask) { - if ((ids->vendor == PCI_ANY_ID || ids->vendor == dev->vendor) && - (ids->device == PCI_ANY_ID || ids->device == dev->device) && - (ids->subvendor == PCI_ANY_ID || ids->subvendor == subsystem_vendor) && - (ids->subdevice == PCI_ANY_ID || ids->subdevice == subsystem_device) && - !((ids->class ^ dev->class) & ids->class_mask)) - return ids; - ids++; - } - return NULL; -} - -static int __init -pci_announce_device(struct pci_driver *drv, struct pci_dev *dev) -{ - const struct pci_device_id *id; - int found, i; - - if (drv->id_table) { - id = pci_compat_match_device(drv->id_table, dev); - if (!id) - return 0; - } else - id = NULL; - - found = 0; - for (i = 0; i < PCI_MAX_MAPPINGS; i++) - if (!drvmap[i].dev) { - drvmap[i].dev = dev; - drvmap[i].drv = drv; - found = 1; - break; - } - - if (!found) - return 0; - - if (drv->probe(dev, id) >= 0) - return 1; - - /* clean up */ - drvmap[i].dev = NULL; - return 0; -} - -static int __init -pci_register_driver(struct pci_driver *drv) -{ - struct pci_dev *dev; - int count = 0, found, i; - list_add_tail(&drv->node, &pci_drivers); - for (dev = pci_devices; dev; dev = dev->next) { - found = 0; - for (i = 0; i < PCI_MAX_MAPPINGS && !found; i++) - if (drvmap[i].dev == dev) - found = 1; - if (!found) - count += pci_announce_device(drv, dev); - } - return count; -} - -static void -pci_unregister_driver(struct pci_driver *drv) -{ - struct pci_dev *dev; - int i, found; - list_del(&drv->node); - for (dev = pci_devices; dev; dev = dev->next) { - found = 0; - for (i = 0; i < PCI_MAX_MAPPINGS; i++) - if (drvmap[i].dev == dev) { - found = 1; - break; - } - if (found) { - if (drv->remove) - drv->remove(dev); - drvmap[i].dev = NULL; - } - } -} - -static inline int pci_module_init(struct pci_driver *drv) -{ - if (pci_register_driver(drv)) - return 0; - return -ENODEV; -} - -static struct pci_driver starfire_driver; - -int __init starfire_probe(struct net_device *dev) -{ - static int __initdata probed = 0; - - if (probed) - return -ENODEV; - probed++; - - return pci_module_init(&starfire_driver); -} - -#define init_tx_timer(dev, func, timeout) -#define kick_tx_timer(dev, func, timeout) \ - if (netif_queue_stopped(dev)) { \ - /* If this happens network layer tells us we're broken. */ \ - if (jiffies - dev->trans_start > timeout) \ - func(dev); \ - } - -#define netif_start_if(dev) dev->start = 1 -#define netif_stop_if(dev) dev->start = 0 - -#else /* LINUX_VERSION_CODE > 0x20300 */ - -#define COMPAT_MOD_INC_USE_COUNT -#define COMPAT_MOD_DEC_USE_COUNT - -#define init_tx_timer(dev, func, timeout) \ - dev->tx_timeout = func; \ - dev->watchdog_timeo = timeout; -#define kick_tx_timer(dev, func, timeout) - -#define netif_start_if(dev) -#define netif_stop_if(dev) - -#endif /* LINUX_VERSION_CODE > 0x20300 */ -/* end of compatibility code */ - - enum chip_capability_flags {CanHaveMII=1, }; #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR0) -#define MEM_ADDR_SZ 0x80000 /* And maps in 0.5MB(!). */ #if 0 #define ADDR_64BITS 1 /* This chip uses 64 bit addresses. */ @@ -528,10 +365,9 @@ /* A chip capabilities table, matching the CH_xxx entries in xxx_pci_tbl[] above. */ static struct chip_info { const char *name; - int io_size; int drv_flags; } netdrv_tbl[] __devinitdata = { - { "Adaptec Starfire 6915", MEM_ADDR_SZ, CanHaveMII }, + { "Adaptec Starfire 6915", CanHaveMII }, }; @@ -547,7 +383,7 @@ PCIDeviceConfig=0x50040, GenCtrl=0x50070, IntrTimerCtrl=0x50074, IntrClear=0x50080, IntrStatus=0x50084, IntrEnable=0x50088, MIICtrl=0x52000, StationAddr=0x50120, EEPROMCtrl=0x51000, - TxDescCtrl=0x50090, + GPIOCtrl=0x5008C, TxDescCtrl=0x50090, TxRingPtr=0x50098, HiPriTxRingPtr=0x50094, /* Low and High priority. */ TxRingHiAddr=0x5009C, /* 64 bit address extension. */ TxProducerIdx=0x500A0, TxConsumerIdx=0x500A4, @@ -557,7 +393,8 @@ CompletionQConsumerIdx=0x500C4, RxDMACtrl=0x500D0, RxDescQCtrl=0x500D4, RxDescQHiAddr=0x500DC, RxDescQAddr=0x500E0, RxDescQIdx=0x500E8, RxDMAStatus=0x500F0, RxFilterMode=0x500F4, - TxMode=0x55000, TxGfpMem=0x58000, RxGfpMem=0x5a000, + TxMode=0x55000, PerfFilterTable=0x56000, HashTable=0x56100, + TxGfpMem=0x58000, RxGfpMem=0x5a000, }; /* Bits in the interrupt status/mask registers. */ @@ -649,11 +486,28 @@ RxOK=0x20000000, RxFIFOErr=0x10000000, RxBufQ2=0x08000000, }; +#ifdef ZEROCOPY +/* Type 0 Tx descriptor. */ +/* If more fragments are needed, don't forget to change the + descriptor spacing as well! */ +struct starfire_tx_desc { + u32 status; + u32 nbufs; + u32 first_addr; + u16 first_len; + u16 total_len; + struct { + u32 addr; + u32 len; + } frag[MAX_STARFIRE_FRAGS]; +}; +#else /* not ZEROCOPY */ /* Type 1 Tx descriptor. */ struct starfire_tx_desc { u32 status; /* Upper bits are status, lower 16 length. */ u32 first_addr; }; +#endif /* not ZEROCOPY */ enum tx_desc_bits { TxDescID=0xB0000000, TxCRCEn=0x01000000, TxDescIntr=0x08000000, @@ -673,9 +527,12 @@ struct tx_ring_info { struct sk_buff *skb; dma_addr_t first_mapping; +#ifdef ZEROCOPY + dma_addr_t frag_mapping[MAX_STARFIRE_FRAGS]; +#endif /* ZEROCOPY */ }; -#define MII_CNT 2 +#define PHY_CNT 2 struct netdev_private { /* Descriptor rings first for alignment. */ struct starfire_rx_desc *rx_ring; @@ -685,41 +542,38 @@ /* The addresses of rx/tx-in-place skbuffs. */ struct rx_ring_info rx_info[RX_RING_SIZE]; struct tx_ring_info tx_info[TX_RING_SIZE]; - /* Pointers to completion queues (full pages). I should cache line pad..*/ - u8 pad0[100]; + /* Pointers to completion queues (full pages). */ struct rx_done_desc *rx_done_q; dma_addr_t rx_done_q_dma; unsigned int rx_done; struct tx_done_report *tx_done_q; - unsigned int tx_done; dma_addr_t tx_done_q_dma; + unsigned int tx_done; struct net_device_stats stats; - struct timer_list timer; /* Media monitoring timer. */ struct pci_dev *pci_dev; /* Frequently used values: keep some adjacent for cache effect. */ unsigned int cur_rx, dirty_rx; /* Producer/consumer ring indices */ unsigned int cur_tx, dirty_tx; unsigned int rx_buf_sz; /* Based on MTU+slack. */ - unsigned int tx_full:1; /* The Tx queue is full. */ - /* These values are keep track of the transceiver/media in use. */ - unsigned int full_duplex:1, /* Full-duplex operation requested. */ - medialock:1, /* Xcvr set to fixed speed/duplex. */ - rx_flowctrl:1, - tx_flowctrl:1; /* Use 802.3x flow control. */ - unsigned int default_port:4; /* Last dev->if_port value. */ + unsigned int tx_full:1, /* The Tx queue is full. */ + /* These values keep track of the transceiver/media in use. */ + autoneg:1, /* Autonegotiation allowed. */ + full_duplex:1, /* Full-duplex operation. */ + speed100:1; /* Set if speed == 100MBit. */ + unsigned int intr_mitigation; u32 tx_mode; u8 tx_threshold; /* MII transceiver section. */ - int mii_cnt; /* MII device addresses. */ u16 advertising; /* NWay media advertisement */ - unsigned char phys[MII_CNT]; /* MII device addresses. */ + int phy_cnt; /* MII device addresses. */ + unsigned char phys[PHY_CNT]; /* MII device addresses. */ }; + static int mdio_read(struct net_device *dev, int phy_id, int location); static void mdio_write(struct net_device *dev, int phy_id, int location, int value); static int netdev_open(struct net_device *dev); -static void check_duplex(struct net_device *dev, int startup); -static void netdev_timer(unsigned long data); +static void check_duplex(struct net_device *dev); static void tx_timeout(struct net_device *dev); static void init_ring(struct net_device *dev); static int start_tx(struct sk_buff *skb, struct net_device *dev); @@ -729,10 +583,11 @@ static void netdev_error(struct net_device *dev, int intr_status); static void set_rx_mode(struct net_device *dev); static struct net_device_stats *get_stats(struct net_device *dev); -static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int netdev_close(struct net_device *dev); +static void netdev_media_change(struct net_device *dev); + - static int __devinit starfire_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) @@ -741,61 +596,74 @@ int i, irq, option, chip_idx = ent->driver_data; struct net_device *dev; static int card_idx = -1; - static int printed_version = 0; long ioaddr; int drv_flags, io_size; int boguscnt; + u8 cache; - card_idx++; - option = card_idx < MAX_UNITS ? options[card_idx] : 0; - +/* when built into the kernel, we only print version if device is found */ +#ifndef MODULE + static int printed_version; if (!printed_version++) - printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s", - version1, version2, version3); + printk(version); +#endif + + card_idx++; if (pci_enable_device (pdev)) return -EIO; - ioaddr = pci_resource_start (pdev, 0); - io_size = pci_resource_len (pdev, 0); - if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) { - printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx); + ioaddr = pci_resource_start(pdev, 0); + io_size = pci_resource_len(pdev, 0); + if (!ioaddr || ((pci_resource_flags(pdev, 0) & IORESOURCE_MEM) == 0)) { + printk (KERN_ERR DRV_NAME " %d: no PCI MEM resources, aborting\n", card_idx); return -ENODEV; } - dev = init_etherdev(NULL, sizeof(*np)); + dev = alloc_etherdev(sizeof(*np)); if (!dev) { - printk (KERN_ERR "starfire %d: cannot alloc etherdev, aborting\n", card_idx); + printk (KERN_ERR DRV_NAME " %d: cannot alloc etherdev, aborting\n", card_idx); return -ENOMEM; } SET_MODULE_OWNER(dev); irq = pdev->irq; - if (request_mem_region (ioaddr, io_size, dev->name) == NULL) { - printk (KERN_ERR "starfire %d: resource 0x%x @ 0x%lx busy, aborting\n", - card_idx, io_size, ioaddr); + if (pci_request_regions (pdev, dev->name)) { + printk (KERN_ERR DRV_NAME " %d: cannot reserve PCI resources, aborting\n", card_idx); goto err_out_free_netdev; } ioaddr = (long) ioremap (ioaddr, io_size); if (!ioaddr) { - printk (KERN_ERR "starfire %d: cannot remap 0x%x @ 0x%lx, aborting\n", + printk (KERN_ERR DRV_NAME " %d: cannot remap 0x%x @ 0x%lx, aborting\n", card_idx, io_size, ioaddr); goto err_out_free_res; } pci_set_master (pdev); - printk(KERN_INFO "%s: %s at 0x%lx, ", - dev->name, netdrv_tbl[chip_idx].name, ioaddr); + /* set PCI cache size */ + pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache); + if ((cache << 2) != SMP_CACHE_BYTES) { + printk(KERN_INFO " PCI cache line size set incorrectly " + "(%i bytes) by BIOS/FW, correcting to %i\n", + (cache << 2), SMP_CACHE_BYTES); + pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, + SMP_CACHE_BYTES >> 2); + } + +#ifdef ZEROCOPY + /* Starfire can do SG and TCP/UDP checksumming */ + dev->features |= NETIF_F_SG; +#ifdef HAS_FIRMWARE + dev->features |= NETIF_F_IP_CSUM; +#endif /* HAS_FIRMWARE */ +#endif /* ZEROCOPY */ /* Serial EEPROM reads are hidden by the hardware. */ for (i = 0; i < 6; i++) dev->dev_addr[i] = readb(ioaddr + EEPROMCtrl + 20-i); - for (i = 0; i < 5; i++) - printk("%2.2x:", dev->dev_addr[i]); - printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); #if ! defined(final_version) /* Dump the EEPROM contents during development. */ if (debug > 4) @@ -832,22 +700,22 @@ np->pci_dev = pdev; drv_flags = netdrv_tbl[chip_idx].drv_flags; + option = card_idx < MAX_UNITS ? options[card_idx] : 0; if (dev->mem_start) option = dev->mem_start; /* The lower four bits are the media type. */ - if (option > 0) { - if (option & 0x200) - np->full_duplex = 1; - np->default_port = option & 15; - if (np->default_port) - np->medialock = 1; - } + if (option & 0x200) + np->full_duplex = 1; + if (card_idx < MAX_UNITS && full_duplex[card_idx] > 0) np->full_duplex = 1; if (np->full_duplex) - np->medialock = 1; + np->autoneg = 0; + else + np->autoneg = 1; + np->speed100 = 1; /* The chip-specific entries in the device structure. */ dev->open = &netdev_open; @@ -856,29 +724,39 @@ dev->stop = &netdev_close; dev->get_stats = &get_stats; dev->set_multicast_list = &set_rx_mode; - dev->do_ioctl = &mii_ioctl; + dev->do_ioctl = &netdev_ioctl; if (mtu) dev->mtu = mtu; + i = register_netdev(dev); + if (i) + goto err_out_cleardev; + + printk(KERN_INFO "%s: %s at 0x%lx, ", + dev->name, netdrv_tbl[chip_idx].name, ioaddr); + for (i = 0; i < 5; i++) + printk("%2.2x:", dev->dev_addr[i]); + printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); + if (drv_flags & CanHaveMII) { int phy, phy_idx = 0; int mii_status; - for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) { - mdio_write(dev, phy, 0, 0x8000); + for (phy = 0; phy < 32 && phy_idx < PHY_CNT; phy++) { + mdio_write(dev, phy, MII_BMCR, BMCR_RESET); udelay(500); boguscnt = 1000; while (--boguscnt > 0) - if ((mdio_read(dev, phy, 0) & 0x8000) == 0) + if ((mdio_read(dev, phy, MII_BMCR) & BMCR_RESET) == 0) break; if (boguscnt == 0) { printk("%s: PHY reset never completed!\n", dev->name); continue; } - mii_status = mdio_read(dev, phy, 1); - if (mii_status != 0x0000) { + mii_status = mdio_read(dev, phy, MII_BMSR); + if (mii_status != 0) { np->phys[phy_idx++] = phy; - np->advertising = mdio_read(dev, phy, 4); + np->advertising = mdio_read(dev, phy, MII_ADVERTISE); printk(KERN_INFO "%s: MII PHY found at address %d, status " "0x%4.4x advertising %4.4x.\n", dev->name, phy, mii_status, np->advertising); @@ -886,22 +764,24 @@ break; } } - np->mii_cnt = phy_idx; + np->phy_cnt = phy_idx; } return 0; +err_out_cleardev: + pci_set_drvdata(pdev, NULL); + iounmap((void *)ioaddr); err_out_free_res: - release_mem_region (ioaddr, io_size); + pci_release_regions (pdev); err_out_free_netdev: - unregister_netdev (dev); - kfree (dev); + unregister_netdev(dev); + kfree(dev); return -ENODEV; } - -/* Read the MII Management Data I/O (MDIO) interfaces. */ +/* Read the MII Management Data I/O (MDIO) interfaces. */ static int mdio_read(struct net_device *dev, int phy_id, int location) { long mdio_addr = dev->base_addr + MIICtrl + (phy_id<<7) + (location<<2); @@ -917,6 +797,7 @@ return result & 0xffff; } + static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { long mdio_addr = dev->base_addr + MIICtrl + (phy_id<<7) + (location<<2); @@ -925,7 +806,7 @@ return; } - + static int netdev_open(struct net_device *dev) { struct netdev_private *np = dev->priv; @@ -983,12 +864,21 @@ RxDescSpace4, ioaddr + RxDescQCtrl); +#ifdef ZEROCOPY + /* Set Tx descriptor to type 0 and spacing to 64 bytes. */ + writel((2 << TxHiPriFIFOThreshShift) | + (0 << TxPadLenShift) | + (4 << TxDMABurstSizeShift) | + TxDescSpace64 | TxDescType0, + ioaddr + TxDescCtrl); +#else /* not ZEROCOPY */ /* Set Tx descriptor to type 1 and padding to 0 bytes. */ writel((2 << TxHiPriFIFOThreshShift) | (0 << TxPadLenShift) | (4 << TxDMABurstSizeShift) | TxDescSpaceUnlim | TxDescType1, ioaddr + TxDescCtrl); +#endif /* not ZEROCOPY */ #if defined(ADDR_64BITS) && defined(__alpha__) /* XXX We really need a 64-bit PCI dma interfaces too... -DaveM */ @@ -1030,7 +920,7 @@ writeb(dev->dev_addr[i], ioaddr + StationAddr + 5-i); for (i = 0; i < 16; i++) { u16 *eaddrs = (u16 *)dev->dev_addr; - long setup_frm = ioaddr + 0x56000 + i*16; + long setup_frm = ioaddr + PerfFilterTable + i * 16; writew(cpu_to_be16(eaddrs[2]), setup_frm); setup_frm += 4; writew(cpu_to_be16(eaddrs[1]), setup_frm); setup_frm += 4; writew(cpu_to_be16(eaddrs[0]), setup_frm); setup_frm += 8; @@ -1038,13 +928,15 @@ /* Initialize other registers. */ /* Configure the PCI bus bursts and FIFO thresholds. */ - np->tx_mode = 0; /* Initialized when TxMode set. */ + np->tx_mode = 0x0C04; /* modified when link is up. */ + writel(0x8000 | np->tx_mode, ioaddr + TxMode); + writel(np->tx_mode, ioaddr + TxMode); np->tx_threshold = 4; writel(np->tx_threshold, ioaddr + TxThreshold); - writel(interrupt_mitigation, ioaddr + IntrTimerCtrl); - if (dev->if_port == 0) - dev->if_port = np->default_port; + interrupt_mitigation &= 0x1f; + np->intr_mitigation = interrupt_mitigation; + writel(np->intr_mitigation, ioaddr + IntrTimerCtrl); netif_start_if(dev); netif_start_queue(dev); @@ -1053,8 +945,11 @@ printk(KERN_DEBUG "%s: Setting the Rx and Tx modes.\n", dev->name); set_rx_mode(dev); - np->advertising = mdio_read(dev, np->phys[0], 4); - check_duplex(dev, 1); + np->advertising = mdio_read(dev, np->phys[0], MII_ADVERTISE); + check_duplex(dev); + + /* Enable GPIO interrupts on link change */ + writel(0x0f00ff00, ioaddr + GPIOCtrl); /* Set the interrupt mask and enable PCI interrupts. */ writel(IntrRxDone | IntrRxEmpty | IntrDMAErr | @@ -1082,77 +977,39 @@ printk(KERN_DEBUG "%s: Done netdev_open().\n", dev->name); - /* Set the timer to check for link beat. */ - init_timer(&np->timer); - np->timer.expires = jiffies + 3*HZ; - np->timer.data = (unsigned long)dev; - np->timer.function = &netdev_timer; /* timer handler */ - add_timer(&np->timer); - return 0; } -static void check_duplex(struct net_device *dev, int startup) + +static void check_duplex(struct net_device *dev) { struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; - int new_tx_mode ; + u16 reg0; - new_tx_mode = 0x0C04 | (np->tx_flowctrl ? 0x0800:0) - | (np->rx_flowctrl ? 0x0400:0); - if (np->medialock) { - if (np->full_duplex) - new_tx_mode |= 2; - } else { - int mii_reg5 = mdio_read(dev, np->phys[0], 5); - int negotiated = mii_reg5 & np->advertising; - int duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040; - if (duplex) - new_tx_mode |= 2; - if (np->full_duplex != duplex) { - np->full_duplex = duplex; - if (debug > 1) - printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d" - " negotiated capability %4.4x.\n", dev->name, - duplex ? "full" : "half", np->phys[0], negotiated); - } - } - if (new_tx_mode != np->tx_mode) { - np->tx_mode = new_tx_mode; - writel(np->tx_mode | 0x8000, ioaddr + TxMode); - writel(np->tx_mode, ioaddr + TxMode); - } -} + mdio_write(dev, np->phys[0], MII_ADVERTISE, np->advertising); + mdio_write(dev, np->phys[0], MII_BMCR, BMCR_RESET); + udelay(500); + while (mdio_read(dev, np->phys[0], MII_BMCR) & BMCR_RESET); -static void netdev_timer(unsigned long data) -{ - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; - int next_tick = 60*HZ; /* Check before driver release. */ + reg0 = mdio_read(dev, np->phys[0], MII_BMCR); - if (debug > 3) { - printk(KERN_DEBUG "%s: Media selection timer tick, status %8.8x.\n", - dev->name, (int)readl(ioaddr + IntrStatus)); - } - check_duplex(dev, 0); -#if ! defined(final_version) - /* This is often falsely triggered. */ - if (readl(ioaddr + IntrStatus) & 1) { - int new_status = readl(ioaddr + IntrStatus); - /* Bogus hardware IRQ: Fake an interrupt handler call. */ - if (new_status & 1) { - printk(KERN_ERR "%s: Interrupt blocked, status %8.8x/%8.8x.\n", - dev->name, new_status, (int)readl(ioaddr + IntrStatus)); - intr_handler(dev->irq, dev, 0); - } + if (np->autoneg) { + reg0 |= BMCR_ANENABLE | BMCR_ANRESTART; + } else { + reg0 &= ~(BMCR_ANENABLE | BMCR_ANRESTART); + if (np->speed100) + reg0 |= BMCR_SPEED100; + if (np->full_duplex) + reg0 |= BMCR_FULLDPLX; + printk(KERN_DEBUG "%s: Link forced to %sMbit %s-duplex\n", + dev->name, + np->speed100 ? "100" : "10", + np->full_duplex ? "full" : "half"); } -#endif - - np->timer.expires = jiffies + next_tick; - add_timer(&np->timer); + mdio_write(dev, np->phys[0], MII_BMCR, reg0); } + static void tx_timeout(struct net_device *dev) { struct netdev_private *np = dev->priv; @@ -1175,7 +1032,6 @@ #endif /* Perhaps we should reinitialize the hardware here. */ - dev->if_port = 0; /* Stop and restart the chip's Tx processes . */ /* Trigger an immediate transmit demand. */ @@ -1230,15 +1086,26 @@ for (i = 0; i < TX_RING_SIZE; i++) { np->tx_info[i].skb = NULL; np->tx_info[i].first_mapping = 0; +#ifdef ZEROCOPY + { + int j; + for (j = 0; j < MAX_STARFIRE_FRAGS; j++) + np->tx_info[i].frag_mapping[j] = 0; + } +#endif /* ZEROCOPY */ np->tx_ring[i].status = 0; } return; } + static int start_tx(struct sk_buff *skb, struct net_device *dev) { struct netdev_private *np = dev->priv; unsigned int entry; +#ifdef ZEROCOPY + int i; +#endif kick_tx_timer(dev, tx_timeout, TX_TIMEOUT); @@ -1248,23 +1115,82 @@ /* Calculate the next Tx descriptor entry. */ entry = np->cur_tx % TX_RING_SIZE; +#if defined(ZEROCOPY) && defined(HAS_FIRMWARE) && defined(HAS_BROKEN_FIRMWARE) + { + int has_bad_length = 0; + + if (skb_first_frag_len(skb) == 1) + has_bad_length = 1; + else { + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) + if (skb_shinfo(skb)->frags[i].size == 1) { + has_bad_length = 1; + break; + } + } + + if (has_bad_length) + skb_checksum_help(skb); + } +#endif /* ZEROCOPY && HAS_FIRMWARE && HAS_BROKEN_FIRMWARE */ + np->tx_info[entry].skb = skb; np->tx_info[entry].first_mapping = pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE); np->tx_ring[entry].first_addr = cpu_to_le32(np->tx_info[entry].first_mapping); +#ifdef ZEROCOPY + np->tx_ring[entry].first_len = cpu_to_le32(skb_first_frag_len(skb)); + np->tx_ring[entry].total_len = cpu_to_le32(skb->len); + /* Add "| TxDescIntr" to generate Tx-done interrupts. */ + np->tx_ring[entry].status = cpu_to_le32(TxDescID | TxCRCEn); + np->tx_ring[entry].nbufs = cpu_to_le32(skb_shinfo(skb)->nr_frags + 1); +#else /* not ZEROCOPY */ /* Add "| TxDescIntr" to generate Tx-done interrupts. */ np->tx_ring[entry].status = cpu_to_le32(skb->len | TxDescID | TxCRCEn | 1 << 16); +#endif /* not ZEROCOPY */ if (entry >= TX_RING_SIZE-1) /* Wrap ring */ np->tx_ring[entry].status |= cpu_to_le32(TxRingWrap | TxDescIntr); +#ifdef ZEROCOPY + if (skb->ip_summed == CHECKSUM_HW) + np->tx_ring[entry].status |= cpu_to_le32(TxCalTCP); +#endif /* ZEROCOPY */ + if (debug > 5) { +#ifdef ZEROCOPY + printk(KERN_DEBUG "%s: Tx #%d slot %d status %8.8x nbufs %d len %4.4x/%4.4x.\n", + dev->name, np->cur_tx, entry, + le32_to_cpu(np->tx_ring[entry].status), + le32_to_cpu(np->tx_ring[entry].nbufs), + le32_to_cpu(np->tx_ring[entry].first_len), + le32_to_cpu(np->tx_ring[entry].total_len)); +#else /* not ZEROCOPY */ printk(KERN_DEBUG "%s: Tx #%d slot %d status %8.8x.\n", dev->name, np->cur_tx, entry, le32_to_cpu(np->tx_ring[entry].status)); +#endif /* not ZEROCOPY */ } +#ifdef ZEROCOPY + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i]; + + /* we already have the proper value in entry */ + np->tx_info[entry].frag_mapping[i] = + pci_map_single(np->pci_dev, page_address(this_frag->page) + this_frag->page_offset, this_frag->size, PCI_DMA_TODEVICE); + + np->tx_ring[entry].frag[i].addr = cpu_to_le32(np->tx_info[entry].frag_mapping[i]); + np->tx_ring[entry].frag[i].len = cpu_to_le32(this_frag->size); + if (debug > 5) { + printk(KERN_DEBUG "%s: Tx #%d frag %d len %4.4x.\n", + dev->name, np->cur_tx, i, + le32_to_cpu(np->tx_ring[entry].frag[i].len)); + } + } +#endif /* ZEROCOPY */ + np->cur_tx++; if (entry >= TX_RING_SIZE-1) /* Wrap ring */ @@ -1289,6 +1215,7 @@ return 0; } + /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) @@ -1347,6 +1274,9 @@ np->stats.tx_packets++; } else if ((tx_status & 0xe0000000) == 0x80000000) { struct sk_buff *skb; +#ifdef ZEROCOPY + int i; +#endif /* ZEROCOPY */ u16 entry = tx_status; /* Implicit truncate */ entry /= sizeof(struct starfire_tx_desc); @@ -1358,6 +1288,16 @@ PCI_DMA_TODEVICE); np->tx_info[entry].first_mapping = 0; +#ifdef ZEROCOPY + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + pci_unmap_single(np->pci_dev, + np->tx_info[entry].frag_mapping[i], + skb_shinfo(skb)->frags[i].size, + PCI_DMA_TODEVICE); + np->tx_info[entry].frag_mapping[i] = 0; + } +#endif /* ZEROCOPY */ + /* Scavenge the descriptor. */ dev_kfree_skb_irq(skb); @@ -1374,6 +1314,15 @@ netif_wake_queue(dev); } + /* Stats overflow */ + if (intr_status & IntrStatsMax) { + get_stats(dev); + } + + /* Media change interrupt. */ + if (intr_status & IntrLinkChange) + netdev_media_change(dev); + /* Abnormal error summary/uncommon events handlers. */ if (intr_status & IntrAbnormalSummary) netdev_error(dev, intr_status); @@ -1403,6 +1352,7 @@ #endif } + /* This routine is logically part of the interrupt handler, but separated for clarity and better register allocation. */ static int netdev_rx(struct net_device *dev) @@ -1460,11 +1410,9 @@ memcpy(skb_put(skb, pkt_len), np->rx_info[entry].skb->tail, pkt_len); #endif } else { - char *temp; - pci_unmap_single(np->pci_dev, np->rx_info[entry].mapping, np->rx_buf_sz, PCI_DMA_FROMDEVICE); skb = np->rx_info[entry].skb; - temp = skb_put(skb, pkt_len); + skb_put(skb, pkt_len); np->rx_info[entry].skb = NULL; np->rx_info[entry].mapping = 0; } @@ -1533,30 +1481,82 @@ writew(entry, dev->base_addr + RxDescQIdx); } - if (debug > 5 - || memcmp(np->pad0, np->pad0 + 1, sizeof(np->pad0) -1)) - printk(KERN_DEBUG " exiting netdev_rx() status of %d was %8.8x %d.\n", - np->rx_done, desc_status, - memcmp(np->pad0, np->pad0 + 1, sizeof(np->pad0) -1)); + if (debug > 5) + printk(KERN_DEBUG " exiting netdev_rx() status of %d was %8.8x.\n", + np->rx_done, desc_status); /* Restart Rx engine if stopped. */ return 0; } -static void netdev_error(struct net_device *dev, int intr_status) + +static void netdev_media_change(struct net_device *dev) { struct netdev_private *np = dev->priv; + long ioaddr = dev->base_addr; + u16 reg0, reg1, reg4, reg5; + u32 new_tx_mode; - if (intr_status & IntrLinkChange) { - printk(KERN_NOTICE "%s: Link changed: Autonegotiation advertising" - " %4.4x, partner %4.4x.\n", dev->name, - mdio_read(dev, np->phys[0], 4), - mdio_read(dev, np->phys[0], 5)); - check_duplex(dev, 0); - } - if (intr_status & IntrStatsMax) { - get_stats(dev); + /* reset status first */ + mdio_read(dev, np->phys[0], MII_BMCR); + mdio_read(dev, np->phys[0], MII_BMSR); + + reg0 = mdio_read(dev, np->phys[0], MII_BMCR); + reg1 = mdio_read(dev, np->phys[0], MII_BMSR); + + if (reg1 & BMSR_LSTATUS) { + /* link is up */ + if (reg0 & BMCR_ANENABLE) { + /* autonegotiation is enabled */ + reg4 = mdio_read(dev, np->phys[0], MII_ADVERTISE); + reg5 = mdio_read(dev, np->phys[0], MII_LPA); + if (reg4 & ADVERTISE_100FULL && reg5 & LPA_100FULL) { + np->speed100 = 1; + np->full_duplex = 1; + } else if (reg4 & ADVERTISE_100HALF && reg5 & LPA_100HALF) { + np->speed100 = 1; + np->full_duplex = 0; + } else if (reg4 & ADVERTISE_10FULL && reg5 & LPA_10FULL) { + np->speed100 = 0; + np->full_duplex = 1; + } else { + np->speed100 = 0; + np->full_duplex = 0; + } + } else { + /* autonegotiation is disabled */ + if (reg0 & BMCR_SPEED100) + np->speed100 = 1; + else + np->speed100 = 0; + if (reg0 & BMCR_FULLDPLX) + np->full_duplex = 1; + else + np->full_duplex = 0; + } + printk(KERN_DEBUG "%s: Link is up, running at %sMbit %s-duplex\n", + dev->name, + np->speed100 ? "100" : "10", + np->full_duplex ? "full" : "half"); + + new_tx_mode = np->tx_mode & ~0x2; /* duplex setting */ + if (np->full_duplex) + new_tx_mode |= 2; + if (np->tx_mode != new_tx_mode) { + np->tx_mode = new_tx_mode; + writel(np->tx_mode | 0x8000, ioaddr + TxMode); + writel(np->tx_mode, ioaddr + TxMode); + } + } else { + printk(KERN_DEBUG "%s: Link is down\n", dev->name); } +} + + +static void netdev_error(struct net_device *dev, int intr_status) +{ + struct netdev_private *np = dev->priv; + /* Came close to underrunning the Tx FIFO, increase threshold. */ if (intr_status & IntrTxDataLow) { writel(++np->tx_threshold, dev->base_addr + TxThreshold); @@ -1571,6 +1571,7 @@ np->stats.tx_fifo_errors++; } + static struct net_device_stats *get_stats(struct net_device *dev) { long ioaddr = dev->base_addr; @@ -1597,6 +1598,7 @@ return &np->stats; } + /* The little-endian AUTODIN II ethernet CRC calculations. A big-endian version is also available. This is slow but compact code. Do not use this routine for bulk data, @@ -1623,6 +1625,7 @@ return crc; } + static void set_rx_mode(struct net_device *dev) { long ioaddr = dev->base_addr; @@ -1631,16 +1634,14 @@ int i; if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ - /* Unconditionally log net taps. */ - printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name); rx_mode = AcceptBroadcast|AcceptAllMulticast|AcceptAll|AcceptMyPhys; } else if ((dev->mc_count > multicast_filter_limit) || (dev->flags & IFF_ALLMULTI)) { /* Too many to match, or accept all multicasts. */ rx_mode = AcceptBroadcast|AcceptAllMulticast|AcceptMyPhys; } else if (dev->mc_count <= 15) { - /* Use the 16 element perfect filter. */ - long filter_addr = ioaddr + 0x56000 + 1*16; + /* Use the 16 element perfect filter, skip first entry. */ + long filter_addr = ioaddr + PerfFilterTable + 1 * 16; for (i = 1, mclist = dev->mc_list; mclist && i <= dev->mc_count; i++, mclist = mclist->next) { u16 *eaddrs = (u16 *)mclist->dmi_addr; @@ -1662,53 +1663,168 @@ memset(mc_filter, 0, sizeof(mc_filter)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) { - set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 23, mc_filter); + int bit_nr = ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 23; + __u32 *fptr = (__u32 *) &mc_filter[(bit_nr >> 4) & ~1]; + + *fptr |= cpu_to_le32(1 << (bit_nr & 31)); } - /* Clear the perfect filter list. */ - filter_addr = ioaddr + 0x56000 + 1*16; + /* Clear the perfect filter list, skip first entry. */ + filter_addr = ioaddr + PerfFilterTable + 1 * 16; for (i = 1; i < 16; i++) { writew(0xffff, filter_addr); filter_addr += 4; writew(0xffff, filter_addr); filter_addr += 4; writew(0xffff, filter_addr); filter_addr += 8; } - for (filter_addr=ioaddr + 0x56100, i=0; i < 32; filter_addr+= 16, i++) + for (filter_addr = ioaddr + HashTable, i=0; i < 32; filter_addr+= 16, i++) writew(mc_filter[i], filter_addr); rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; } writel(rx_mode, ioaddr + RxFilterMode); } -static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) + +static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) { + struct ethtool_cmd ecmd; struct netdev_private *np = dev->priv; - u16 *data = (u16 *)&rq->ifr_data; + + if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) + return -EFAULT; + + switch (ecmd.cmd) { + case ETHTOOL_GSET: + ecmd.supported = + SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_Autoneg | + SUPPORTED_MII; + + ecmd.advertising = ADVERTISED_MII; + if (np->advertising & ADVERTISE_10HALF) + ecmd.advertising |= ADVERTISED_10baseT_Half; + if (np->advertising & ADVERTISE_10FULL) + ecmd.advertising |= ADVERTISED_10baseT_Full; + if (np->advertising & ADVERTISE_100HALF) + ecmd.advertising |= ADVERTISED_100baseT_Half; + if (np->advertising & ADVERTISE_100FULL) + ecmd.advertising |= ADVERTISED_100baseT_Full; + if (np->autoneg) { + ecmd.advertising |= ADVERTISED_Autoneg; + ecmd.autoneg = AUTONEG_ENABLE; + } else + ecmd.autoneg = AUTONEG_DISABLE; + + ecmd.port = PORT_MII; + ecmd.transceiver = XCVR_INTERNAL; + ecmd.phy_address = np->phys[0]; + ecmd.speed = np->speed100 ? SPEED_100 : SPEED_10; + ecmd.duplex = np->full_duplex ? DUPLEX_FULL : DUPLEX_HALF; + ecmd.maxtxpkt = TX_RING_SIZE; + ecmd.maxrxpkt = np->intr_mitigation; /* not 100% accurate */ + + + if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) + return -EFAULT; + return 0; + + case ETHTOOL_SSET: { + u16 autoneg, speed100, full_duplex; + + autoneg = (ecmd.autoneg == AUTONEG_ENABLE); + speed100 = (ecmd.speed == SPEED_100); + full_duplex = (ecmd.duplex == DUPLEX_FULL); + + np->autoneg = autoneg; + if (speed100 != np->speed100 || + full_duplex != np->full_duplex) { + np->speed100 = speed100; + np->full_duplex = full_duplex; + /* change advertising bits */ + np->advertising &= ~(ADVERTISE_10HALF | + ADVERTISE_10FULL | + ADVERTISE_100HALF | + ADVERTISE_100FULL | + ADVERTISE_100BASE4); + if (speed100) { + if (full_duplex) + np->advertising |= ADVERTISE_100FULL; + else + np->advertising |= ADVERTISE_100HALF; + } else { + if (full_duplex) + np->advertising |= ADVERTISE_10FULL; + else + np->advertising |= ADVERTISE_10HALF; + } + } + check_duplex(dev); + return 0; + } + + case ETHTOOL_GDRVINFO: { + struct ethtool_drvinfo info; + memset(&info, 0, sizeof(info)); + info.cmd = ecmd.cmd; + strcpy(info.driver, DRV_NAME); + strcpy(info.version, DRV_VERSION); + *info.fw_version = 0; + strcpy(info.bus_info, PCI_SLOT_NAME(np->pci_dev)); + if (copy_to_user(useraddr, &info, sizeof(info))) + return -EFAULT; + return 0; + } + + default: + return -EOPNOTSUPP; + } +} + + +static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + struct netdev_private *np = dev->priv; + struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; switch(cmd) { - case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ - data[0] = np->phys[0] & 0x1f; + case SIOCETHTOOL: + return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); + + /* Legacy mii-diag interface */ + case SIOCGMIIPHY: /* Get address of MII PHY in use. */ + case SIOCDEVPRIVATE: /* for binary compat, remove in 2.5 */ + data->phy_id = np->phys[0] & 0x1f; /* Fall Through */ - case SIOCDEVPRIVATE+1: /* Read the specified MII register. */ - data[3] = mdio_read(dev, data[0] & 0x1f, data[1] & 0x1f); + + case SIOCGMIIREG: /* Read MII PHY register. */ + case SIOCDEVPRIVATE+1: /* for binary compat, remove in 2.5 */ + data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f); return 0; - case SIOCDEVPRIVATE+2: /* Write the specified MII register */ + + case SIOCSMIIREG: /* Write MII PHY register. */ + case SIOCDEVPRIVATE+2: /* for binary compat, remove in 2.5 */ if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (data[0] == np->phys[0]) { - u16 value = data[2]; - switch (data[1]) { + if (data->phy_id == np->phys[0]) { + u16 value = data->val_in; + switch (data->reg_num) { case 0: - if (value & 0x9000) /* Autonegotiation. */ - np->medialock = 0; + if (value & (BMCR_RESET | BMCR_ANENABLE)) + /* Autonegotiation. */ + np->autoneg = 1; else { - np->full_duplex = (value & 0x0100) ? 1 : 0; - np->medialock = 1; + np->full_duplex = (value & BMCR_FULLDPLX) ? 1 : 0; + np->autoneg = 0; } break; - case 4: np->advertising = value; break; + case 4: + np->advertising = value; + break; } - check_duplex(dev, 0); + check_duplex(dev); } - mdio_write(dev, data[0] & 0x1f, data[1] & 0x1f, data[2]); + mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); return 0; default: return -EOPNOTSUPP; @@ -1724,8 +1840,6 @@ netif_stop_queue(dev); netif_stop_if(dev); - del_timer_sync(&np->timer); - if (debug > 1) { printk(KERN_DEBUG "%s: Shutting down ethercard, Intr status %4.4x.\n", dev->name, (int)readl(ioaddr + IntrStatus)); @@ -1771,6 +1885,9 @@ } for (i = 0; i < TX_RING_SIZE; i++) { struct sk_buff *skb = np->tx_info[i].skb; +#ifdef ZEROCOPY + int j; +#endif /* ZEROCOPY */ if (skb == NULL) continue; pci_unmap_single(np->pci_dev, @@ -1779,6 +1896,17 @@ np->tx_info[i].first_mapping = 0; dev_kfree_skb(skb); np->tx_info[i].skb = NULL; +#ifdef ZEROCOPY + for (j = 0; j < MAX_STARFIRE_FRAGS; j++) + if (np->tx_info[i].frag_mapping[j]) { + pci_unmap_single(np->pci_dev, + np->tx_info[i].frag_mapping[j], + skb_shinfo(skb)->frags[j].size, + PCI_DMA_TODEVICE); + np->tx_info[i].frag_mapping[j] = 0; + } else + break; +#endif /* ZEROCOPY */ } COMPAT_MOD_DEC_USE_COUNT; @@ -1796,32 +1924,31 @@ BUG(); np = dev->priv; - - unregister_netdev(dev); - iounmap((char *)dev->base_addr); - - release_mem_region(pci_resource_start (pdev, 0), - pci_resource_len (pdev, 0)); - if (np->tx_done_q) - pci_free_consistent(np->pci_dev, PAGE_SIZE, + pci_free_consistent(pdev, PAGE_SIZE, np->tx_done_q, np->tx_done_q_dma); if (np->rx_done_q) - pci_free_consistent(np->pci_dev, PAGE_SIZE, + pci_free_consistent(pdev, + sizeof(struct rx_done_desc) * DONE_Q_SIZE, np->rx_done_q, np->rx_done_q_dma); if (np->tx_ring) - pci_free_consistent(np->pci_dev, PAGE_SIZE, + pci_free_consistent(pdev, PAGE_SIZE, np->tx_ring, np->tx_ring_dma); if (np->rx_ring) - pci_free_consistent(np->pci_dev, PAGE_SIZE, + pci_free_consistent(pdev, PAGE_SIZE, np->rx_ring, np->rx_ring_dma); - kfree(dev); + unregister_netdev(dev); + iounmap((char *)dev->base_addr); + pci_release_regions(pdev); + + pci_set_drvdata(pdev, NULL); + kfree(dev); /* Will also free np!! */ } static struct pci_driver starfire_driver = { - name: "starfire", + name: DRV_NAME, probe: starfire_init_one, remove: starfire_remove_one, id_table: starfire_pci_tbl, @@ -1830,6 +1957,10 @@ static int __init starfire_init (void) { +/* when a module, this is printed whether or not devices are found in probe */ +#ifdef MODULE + printk(version); +#endif return pci_module_init (&starfire_driver); } @@ -1846,8 +1977,8 @@ /* * Local variables: - * compile-command: "gcc -DMODULE -Wall -Wstrict-prototypes -O6 -c starfire.c" - * simple-compile-command: "gcc -DMODULE -O6 -c starfire.c" + * compile-command: "gcc -DMODULE -Wall -Wstrict-prototypes -O2 -c starfire.c" + * simple-compile-command: "gcc -DMODULE -O2 -c starfire.c" * c-basic-offset: 8 * tab-width: 8 * End: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/sunhme.c linux.20p9/drivers/net/sunhme.c --- linux.vanilla/drivers/net/sunhme.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/net/sunhme.c Wed Jul 4 16:03:56 2001 @@ -3019,27 +3019,23 @@ struct linux_sbus *sbus; struct linux_sbus_device *sdev; struct quattro *qp; + int i; if(qfe_sbus_list == NULL) goto found; for(qp = qfe_sbus_list; qp != NULL; qp = qp->next) { - for(sdev = qp->quattro_sbus_dev; - sdev != NULL; - sdev = sdev->next) { + for(i = 0, sdev = qp->quattro_sbus_dev; + (sdev != NULL) && (i < 4); + sdev = sdev->next, i++) { if(sdev == goal_sdev) return qp; } } for_each_sbus(sbus) { for_each_sbusdev(sdev, sbus) { - if(sdev->child != NULL) { - struct linux_sbus_device *p; - - for(p = sdev->child; p != NULL; p = p->next) - if(p == goal_sdev) - goto found; - } + if (sdev == goal_sdev) + goto found; } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/syncppp.c linux.20p9/drivers/net/syncppp.c --- linux.vanilla/drivers/net/syncppp.c Sun Mar 25 17:31:20 2001 +++ linux.20p9/drivers/net/syncppp.c Wed Jul 4 16:03:56 2001 @@ -505,8 +505,10 @@ } /* Send Configure-Ack packet. */ sp->pp_loopcnt = 0; - sppp_cp_send (sp, PPP_LCP, LCP_CONF_ACK, - h->ident, len-4, h+1); + if (sp->lcp.state != LCP_STATE_OPENED) { + sppp_cp_send (sp, PPP_LCP, LCP_CONF_ACK, + h->ident, len-4, h+1); + } /* Change the state. */ switch (sp->lcp.state) { case LCP_STATE_CLOSED: @@ -522,7 +524,9 @@ sp->ipcp.state = IPCP_STATE_CLOSED; /* Initiate renegotiation. */ sppp_lcp_open (sp); - /* An ACK has already been sent. */ + /* Send ACK after our REQ in attempt to break loop */ + sppp_cp_send (sp, PPP_LCP, LCP_CONF_ACK, + h->ident, len-4, h+1); sp->lcp.state = LCP_STATE_ACK_SENT; break; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/tulip.c linux.20p9/drivers/net/tulip.c --- linux.vanilla/drivers/net/tulip.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/net/tulip.c Wed Jul 4 16:03:56 2001 @@ -2742,7 +2742,8 @@ (tp->link_change)(dev, csr5); } if (csr5 & SytemError) { - printk(KERN_ERR "%s: (%lu) System Error occured\n", dev->name, tp->nir); + printk(KERN_ERR "%s: (%lu) System Error occurred\n", + dev->name, tp->nir); } /* Clear all error sources, included undocumented ones! */ outl(0x0800f7ba, ioaddr + CSR5); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/net/via-rhine.c linux.20p9/drivers/net/via-rhine.c --- linux.vanilla/drivers/net/via-rhine.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/net/via-rhine.c Wed Jul 4 16:03:56 2001 @@ -133,6 +133,8 @@ MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +#define NETSTATS_VER2 + /* Theory of Operation diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/pci/oldproc.c linux.20p9/drivers/pci/oldproc.c --- linux.vanilla/drivers/pci/oldproc.c Sun Mar 25 17:31:36 2001 +++ linux.20p9/drivers/pci/oldproc.c Thu Jul 26 15:46:22 2001 @@ -1034,15 +1034,8 @@ { int nprinted, len, size; struct pci_dev *dev; - static int complained = 0; # define MSG "\nwarning: page-size limit reached!\n" - if (!complained) { - complained++; - printk(KERN_INFO "%s uses obsolete /proc/pci interface\n", - current->comm); - } - /* reserve same for truncation warning message: */ size = PAGE_SIZE - (strlen(MSG) + 1); len = sprintf(buf, "PCI devices found:\n"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/pci/proc.c linux.20p9/drivers/pci/proc.c --- linux.vanilla/drivers/pci/proc.c Sun Mar 25 17:31:36 2001 +++ linux.20p9/drivers/pci/proc.c Wed Jul 4 16:03:56 2001 @@ -195,18 +195,117 @@ return nbytes; } +struct pci_filp_private { + enum pci_mmap_state mmap_state; + int write_combine; +}; + +static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + const struct proc_dir_entry *dp = inode->u.generic_ip; + struct pci_dev *dev = dp->data; +#ifdef HAVE_PCI_MMAP + struct pci_filp_private *fpriv = file->private_data; +#endif /* HAVE_PCI_MMAP */ + int ret = 0; + + switch (cmd) { + case PCIIOC_CONTROLLER: + ret = pci_controller_num(dev); + break; + +#ifdef HAVE_PCI_MMAP + case PCIIOC_MMAP_IS_IO: + fpriv->mmap_state = pci_mmap_io; + break; + + case PCIIOC_MMAP_IS_MEM: + fpriv->mmap_state = pci_mmap_mem; + break; + + case PCIIOC_WRITE_COMBINE: + if (arg) + fpriv->write_combine = 1; + else + fpriv->write_combine = 0; + break; + +#endif /* HAVE_PCI_MMAP */ + + default: + ret = -EINVAL; + break; + }; + + return ret; +} + +#ifdef HAVE_PCI_MMAP +static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) +{ + struct inode *inode = file->f_dentry->d_inode; + const struct proc_dir_entry *dp = inode->u.generic_ip; + struct pci_dev *dev = dp->data; + struct pci_filp_private *fpriv = file->private_data; + int ret; + + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; + + ret = pci_mmap_page_range(dev, vma, + fpriv->mmap_state, + fpriv->write_combine); + if (ret < 0) + return ret; + + return 0; +} + +static int proc_bus_pci_open(struct inode *inode, struct file *file) +{ + struct pci_filp_private *fpriv = kmalloc(sizeof(*fpriv), GFP_KERNEL); + + if (!fpriv) + return -ENOMEM; + + fpriv->mmap_state = pci_mmap_io; + fpriv->write_combine = 0; + + file->private_data = fpriv; + + return 0; +} + +static int proc_bus_pci_release(struct inode *inode, struct file *file) +{ + kfree(file->private_data); + file->private_data = NULL; + + return 0; +} +#endif /* HAVE_PCI_MMAP */ + static struct file_operations proc_bus_pci_operations = { proc_bus_pci_lseek, proc_bus_pci_read, proc_bus_pci_write, - NULL, /* readdir */ - NULL, /* poll */ - NULL, /* ioctl */ - NULL, /* mmap */ - NULL, /* no special open code */ - NULL, /* flush */ - NULL, /* no special release code */ - NULL /* can't fsync */ + NULL, /* readdir */ + NULL, /* poll */ + proc_bus_pci_ioctl, /* ioctl */ +#ifdef HAVE_PCI_MMAP + proc_bus_pci_mmap, /* mmap */ + proc_bus_pci_open, /* open code */ +#else + NULL, /* mmap */ + NULL, /* no special open code */ +#endif + NULL, /* flush */ +#ifdef HAVE_PCI_MMAP + proc_bus_pci_release, /* release code */ +#else + NULL, /* no special release code */ +#endif + NULL /* can't fsync */ }; static struct inode_operations proc_bus_pci_inode_operations = { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/pnp/parport_probe.c linux.20p9/drivers/pnp/parport_probe.c --- linux.vanilla/drivers/pnp/parport_probe.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/pnp/parport_probe.c Wed Jul 4 16:08:13 2001 @@ -55,7 +55,7 @@ unsigned int count = 0; unsigned char z=0; unsigned char Byte=0; - unsigned long igiveupat=jiffies+5*HZ; + unsigned long igiveupat=jiffies+9*HZ; for (i=0; time_before(jiffies, igiveupat); i++) { /* if(current->need_resched) schedule(); */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/Config.in linux.20p9/drivers/s390/Config.in --- linux.vanilla/drivers/s390/Config.in Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/Config.in Wed Aug 8 22:14:09 2001 @@ -75,3 +75,16 @@ fi endmenu +mainmenu_option next_comment +comment 'S/390 character device drivers' + +tristate 'S/390 tape device support' CONFIG_S390_TAPE +if [ "$CONFIG_S390_TAPE" != "n" ]; then + comment 'S/390 tape interface support' + bool ' Support for tape character devices' CONFIG_S390_TAPE_CHAR + bool ' Support for tape block devices' CONFIG_S390_TAPE_BLOCK + comment 'S/390 tape hardware support' + bool ' Support for 3490 tape hardware' CONFIG_S390_TAPE_3490 + bool ' Support for 3480 tape hardware' CONFIG_S390_TAPE_3480 +fi +endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/block/dasd_3990_erp.c linux.20p9/drivers/s390/block/dasd_3990_erp.c --- linux.vanilla/drivers/s390/block/dasd_3990_erp.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/block/dasd_3990_erp.c Wed Jul 4 16:03:56 2001 @@ -986,7 +986,7 @@ * * RETURN VALUES * erp erp-pointer to the already defined error recovery procedure OR - * NULL if a 'new' error occured. + * NULL if a 'new' error occurred. */ ccw_req_t * dasd_3990_erp_in_erp (ccw_req_t * cqr) @@ -1068,7 +1068,7 @@ * DASD_3990_ERP_HANDLE_MATCH_ERP * * DESCRIPTION - * An error occured again and an ERP has been detected which is already + * An error occurred again and an ERP has been detected which is already * used to handle this error (e.g. retries). * All prior ERP's are set to status DONE and the retry counter is * decremented. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/Makefile linux.20p9/drivers/s390/char/Makefile --- linux.vanilla/drivers/s390/char/Makefile Sun Mar 25 17:31:44 2001 +++ linux.20p9/drivers/s390/char/Makefile Wed Aug 8 22:14:09 2001 @@ -13,4 +13,31 @@ O_OBJS += hwc_con.o hwc_rw.o hwc_tty.o endif +# stuff for building tape390.o +T390_OBJS = tape.o +ifeq ($(CONFIG_S390_TAPE_CHAR),y) + T390_OBJS += tapechar.o +endif +ifeq ($(CONFIG_S390_TAPE_BLOCK),y) + T390_OBJS += tapeblock.o +endif +ifeq ($(CONFIG_S390_TAPE_3480),y) + T390_OBJS += tape3480.o + CONFIG_S390_TAPE_NEED_34xx = y +endif +ifeq ($(CONFIG_S390_TAPE_3490),y) + T390_OBJS += tape3490.o + CONFIG_S390_TAPE_NEED_34xx = y +endif +ifeq ($(CONFIG_S390_TAPE_NEED_34xx),y) + T390_OBJS += tape34xx.o +endif +ifeq ($(CONFIG_S390_TAPE),y) + O_OBJS += tape390.o +endif +ifeq ($(CONFIG_S390_TAPE),m) + M_OBJS += tape390.o +endif +tape390.o: $(T390_OBJS) + $(LD) -r -o $@ $(T390_OBJS) include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/con3215.c linux.20p9/drivers/s390/char/con3215.c --- linux.vanilla/drivers/s390/char/con3215.c Sun Mar 25 17:31:44 2001 +++ linux.20p9/drivers/s390/char/con3215.c Wed Aug 8 22:14:20 2001 @@ -834,7 +834,7 @@ kdev_t con3215_device(struct console *c) { - return MKDEV(TTY_MAJOR, c->index); + return MKDEV(TTY_MAJOR, c->index + 64); } /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc.h linux.20p9/drivers/s390/char/hwc.h --- linux.vanilla/drivers/s390/char/hwc.h Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/char/hwc.h Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke * * * @@ -13,6 +13,9 @@ #ifndef __HWC_H__ #define __HWC_H__ +#define HWC_EXT_INT_PARAM_ADDR 0xFFFFFFF8 +#define HWC_EXT_INT_PARAM_PEND 0x00000001 + #define ET_OpCmd 0x01 #define ET_Msg 0x02 #define ET_StateChange 0x08 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc_con.c linux.20p9/drivers/s390/char/hwc_con.c --- linux.vanilla/drivers/s390/char/hwc_con.c Sun Mar 25 17:31:44 2001 +++ linux.20p9/drivers/s390/char/hwc_con.c Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke */ #include diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc_rw.c linux.20p9/drivers/s390/char/hwc_rw.c --- linux.vanilla/drivers/s390/char/hwc_rw.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/char/hwc_rw.c Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke * * * @@ -27,6 +27,7 @@ #include #include #include +#include #ifndef MIN #define MIN(a,b) (((awake_up != NULL) - (hwc_data.calls->wake_up) (); + } + + if (evbuf_pending) { + + unconditional_read_1 (); + } else { + + write_event_data_1 (); + } + + if (!hwc_data.calls || !hwc_data.calls->wake_up) + return; + (hwc_data.calls->wake_up) (); +} + +void +hwc_interrupt_handler (struct pt_regs *regs, __u16 code) +{ + u32 ext_int_param = hwc_ext_int_param (); + int cpu = smp_processor_id (); + + irq_enter (cpu, 0x2401); + + if (hwc_data.flags & HWC_INIT) { + + hwc_data.flags |= HWC_INTERRUPT; + } else if (hwc_data.flags & HWC_BROKEN) { + + if (!do_hwc_init ()) { + hwc_data.flags &= ~HWC_BROKEN; + internal_print (DELAYED_WRITE, + HWC_RW_PRINT_HEADER + "delayed HWC setup after" + " temporary breakdown" + " (ext. int. parameter=0x%x)\n", + ext_int_param); + } + } else { + spin_lock (&hwc_data.lock); + hwc_do_interrupt (ext_int_param); spin_unlock (&hwc_data.lock); } + irq_exit (cpu, 0x2401); } void diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc_rw.h linux.20p9/drivers/s390/char/hwc_rw.h --- linux.vanilla/drivers/s390/char/hwc_rw.h Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/char/hwc_rw.h Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke */ #ifndef __HWC_RW_H__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc_tty.c linux.20p9/drivers/s390/char/hwc_tty.c --- linux.vanilla/drivers/s390/char/hwc_tty.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/char/hwc_tty.c Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke * * Thanks to Martin Schwidefsky. */ @@ -171,9 +171,7 @@ switch (cmd) { case TIOCHWCTTYSINTRC: - count = strnlen_user((const char *)arg, HWC_TTY_MAX_CNTL_SIZE); - if (!count) - return -EFAULT; + count = strlen_user ((const char *) arg); if (count > HWC_TTY_MAX_CNTL_SIZE) return -EINVAL; strncpy_from_user (hwc_tty_data.ioctl.intr_char, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/hwc_tty.h linux.20p9/drivers/s390/char/hwc_tty.h --- linux.vanilla/drivers/s390/char/hwc_tty.h Sun Mar 25 17:31:44 2001 +++ linux.20p9/drivers/s390/char/hwc_tty.h Wed Aug 8 22:14:20 2001 @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Martin Peschke + * Author(s): Martin Peschke */ #ifndef __HWC_TTY_H__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape.c linux.20p9/drivers/s390/char/tape.c --- linux.vanilla/drivers/s390/char/tape.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,1120 @@ + +/*********************************************************************** + * drivers/s390/char/tape.c + * tape device driver for S/390 and zSeries tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + *********************************************************************** + */ + +#include "tapedefs.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef MODULE +#include +#endif +#include +#ifdef CONFIG_S390_TAPE_DYNAMIC +#include +#endif +#include "tape.h" +#ifdef CONFIG_S390_TAPE_3490 +#include "tape3490.h" +#endif +#ifdef CONFIG_S390_TAPE_3480 +#include "tape3480.h" +#endif +#ifdef CONFIG_S390_TAPE_BLOCK +#include "tapeblock.h" +#endif +#ifdef CONFIG_S390_TAPE_CHAR +#include "tapechar.h" +#endif +#ifdef CONFIG_PROC_FS +#include +#endif +#define PRINTK_HEADER "T390:" + + +/* state handling routines */ +inline void tapestate_set (tape_info_t * ti, int newstate); +inline int tapestate_get (tape_info_t * ti); +void tapestate_event (tape_info_t * ti, int event); + +/* our globals */ +tape_info_t *first_tape_info = NULL; +tape_discipline_t *first_discipline = NULL; +tape_frontend_t *first_frontend = NULL; +devreg_t* tape_devreg[128]; +int devregct=0; + +#ifdef TAPE_DEBUG +debug_info_t *tape_debug_area = NULL; +#endif + +char* state_verbose[TS_SIZE]={ + "TS_UNUSED", "TS_IDLE", "TS_DONE", "TS_FAILED", + "TS_BLOCK_INIT", + "TS_BSB_INIT", + "TS_BSF_INIT", + "TS_DSE_INIT", + "TS_EGA_INIT", + "TS_FSB_INIT", + "TS_FSF_INIT", + "TS_LDI_INIT", + "TS_LBL_INIT", + "TS_MSE_INIT", + "TS_NOP_INIT", + "TS_RBA_INIT", + "TS_RBI_INIT", + "TS_RBU_INIT", + "TS_RBL_INIT", + "TS_RDC_INIT", + "TS_RFO_INIT", + "TS_RSD_INIT", + "TS_REW_INIT", + "TS_REW_RELEASE_INIT", + "TS_RUN_INIT", + "TS_SEN_INIT", + "TS_SID_INIT", + "TS_SNP_INIT", + "TS_SPG_INIT", + "TS_SWI_INIT", + "TS_SMR_INIT", + "TS_SYN_INIT", + "TS_TIO_INIT", + "TS_UNA_INIT", + "TS_WRI_INIT", + "TS_WTM_INIT", + "TS_NOT_OPER"}; + +char* event_verbose[TE_SIZE]= { + "TE_START", "TE_DONE", "TE_FAILED", "TE_ERROR", "TE_OTHER"}; + +/* our root devfs handle */ +#ifdef CONFIG_DEVFS_FS +devfs_handle_t tape_devfs_root_entry; + +inline void +tape_mkdevfsroots (tape_info_t* ti) +{ + char devno [5]; + sprintf (devno,"%04X",ti->devinfo.devno); + ti->devfs_dir=devfs_mk_dir (tape_devfs_root_entry, devno, ti); +} + +inline void +tape_rmdevfsroots (tape_info_t* ti) +{ + devfs_unregister (ti->devfs_dir); +} +#endif + +#ifdef CONFIG_PROC_FS +/* our proc tapedevices entry */ +static struct proc_dir_entry *tape_devices_entry; + +typedef struct { + char *data; + int len; +} tempinfo_t; + + +static int +tape_devices_open (struct inode *inode, struct file *file) +{ + int size=80; + tape_info_t* ti; + tempinfo_t* tempinfo; + char* data; + int pos=0; + tempinfo = kmalloc (sizeof(tempinfo_t),GFP_KERNEL); + if (!tempinfo) + return -ENOMEM; + for (ti=first_tape_info;ti!=NULL;ti=ti->next) + size+=80; // FIXME: Guess better! + data=vmalloc(size); + if (!data) { + kfree (tempinfo); + return -ENOMEM; + } + pos+=sprintf(data+pos,"TapeNo\tDevNo\tCuType\tCuModel\tDevType\tDevModel\tState\n"); + for (ti=first_tape_info;ti!=NULL;ti=ti->next) { + pos+=sprintf(data+pos,"%d\t%04X\t%04X\t%02X\t%04X\t%02X\t\t%s\n",ti->rew_minor/2, + ti->devinfo.devno,ti->devinfo.sid_data.cu_type, + ti->devinfo.sid_data.cu_model,ti->devinfo.sid_data.dev_type, + ti->devinfo.sid_data.dev_model,((tapestate_get(ti) >= 0) && + (tapestate_get(ti) < TS_SIZE)) ? + state_verbose[tapestate_get (ti)] : "TS UNKNOWN"); + } + tempinfo->len=pos; + tempinfo->data=data; + file->private_data= (void*) tempinfo; +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif + return 0; +} + +static ssize_t +tape_devices_read (struct file *file, char *user_buf, size_t user_len, loff_t * offset) +{ + loff_t len; + tempinfo_t *p_info = (tempinfo_t *) file->private_data; + + if (*offset >= p_info->len) { + return 0; /* EOF */ + } else { + len = user_len<(p_info->len - *offset)?user_len:(p_info->len - *offset); + if (copy_to_user (user_buf, &(p_info->data[*offset]), len)) + return -EFAULT; + (*offset) += len; + return len; /* number of bytes "read" */ + } +} + +static int +tape_devices_release (struct inode *inode, struct file *file) +{ + int rc = 0; + tempinfo_t *p_info = (tempinfo_t *) file->private_data; + if (p_info) { + if (p_info->data) + vfree (p_info->data); + kfree (p_info); + } +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif + return rc; +} + +static struct file_operations tape_devices_file_ops = +{ + read:tape_devices_read, /* read */ + open:tape_devices_open, /* open */ + release:tape_devices_release, /* close */ +}; + +static struct inode_operations tape_devices_inode_ops = +{ +#if !(LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) + default_file_ops:&tape_devices_file_ops /* file ops */ +#endif /* LINUX_IS_24 */ +}; +#endif /* CONFIG_PROC_FS */ + +/* SECTION: Parameters for tape */ +char *tape[256] = { NULL, }; + +#ifndef MODULE +static char tape_parm_string[1024] __initdata = { 0, }; +static void +tape_split_parm_string (char *str) +{ + char *tmp = str; + int count = 0; + while (tmp != NULL && *tmp != '\0') { + char *end; + int len; + end = strchr (tmp, ','); + if (end == NULL) { + len = strlen (tmp) + 1; + } else { + len = (long) end - (long) tmp + 1; + *end = '\0'; + end++; + } + tape[count] = kmalloc (len * sizeof (char), GFP_ATOMIC); + if (tape[count] == NULL) { + printk (KERN_WARNING PRINTK_HEADER + "can't store tape= parameter no %d\n", + count + 1); + break; + } + memset (tape[count], 0, len * sizeof (char)); + memcpy (tape[count], tmp, len * sizeof (char)); + count++; + tmp = end; + }; +} + +void __init +tape_parm_setup (char *str, int *ints) +{ + int len = strlen (tape_parm_string); + if (len != 0) { + strcat (tape_parm_string, ","); + } + strcat (tape_parm_string, str); +} + +int __init +tape_parm_call_setup (char *str) +{ + int dummy; + tape_parm_setup (str, &dummy); + return 1; +} + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,2,16)) +__setup("tape=", tape_parm_call_setup); +#endif /* kernel <2.2.19 */ +#endif /* not defined MODULE */ + +static inline int +tape_parm_strtoul (char *str, char **stra) +{ + char *temp = str; + int val; + if (*temp == '0') { + temp++; /* strip leading zero */ + if (*temp == 'x') + temp++; /* strip leading x */ + } + val = simple_strtoul (temp, &temp, 16); /* interpret anything as hex */ + *stra = temp; + return val; +} + +static inline devreg_t * +tape_create_devreg (int devno) +{ + devreg_t *devreg = kmalloc (sizeof (devreg_t), GFP_KERNEL); + if (devreg != NULL) { + memset (devreg, 0, sizeof (devreg_t)); + devreg->ci.devno = devno; + devreg->flag = DEVREG_TYPE_DEVNO; + devreg->oper_func = tape_oper_handler; + } + return devreg; +} + +static inline void +tape_parm_parse (char **str) +{ + char *temp; + int from, to,i,irq=0,rc,retries=0,tape_num=0; + s390_dev_info_t dinfo; + tape_info_t* ti,*tempti; + tape_discipline_t* disc; + long lockflags; + if (*str==NULL) { + /* no params present -> leave */ + return; + } + while (*str) { + temp = *str; + from = 0; + to = 0; + + /* turn off autodetect mode, if any range is present */ + from = tape_parm_strtoul (temp, &temp); + to = from; + if (*temp == '-') { + temp++; + to = tape_parm_strtoul (temp, &temp); + } + for (i=from;i<=to;i++) { + retries=0; + // register for attch/detach of a devno + tape_devreg[devregct]=tape_create_devreg(i); + if (tape_devreg[devregct]==NULL) { + PRINT_WARN ("Could not create devreg for devno %04x, dyn. attach for this devno deactivated.\n",i); + } else { + s390_device_register (tape_devreg[devregct++]); + } + // we are activating a device if it is present + for (irq = get_irq_first(); irq!=-ENODEV; irq=get_irq_next(irq)) { + rc = get_dev_info_by_irq (irq, &dinfo); + + disc = first_discipline; + while ((dinfo.devno == i) && (disc != NULL) && (disc->cu_type != dinfo.sid_data.cu_type)) + disc = (tape_discipline_t *) (disc->next); + if ((disc == NULL) || (rc == -ENODEV) || (i!=dinfo.devno)) { + continue; + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"det irq: "); + debug_int_event (tape_debug_area,3,irq); + debug_text_event (tape_debug_area,3,"cu: "); + debug_int_event (tape_debug_area,3,disc->cu_type); +#endif /* TAPE_DEBUG */ + PRINT_INFO ("using devno %04x with discipline %04x on irq %d as tape device %d\n",dinfo.devno,dinfo.sid_data.cu_type,irq,tape_num/2); + /* Allocate tape structure */ + ti = kmalloc (sizeof (tape_info_t), GFP_ATOMIC); + if (ti == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"ti:no mem "); +#endif /* TAPE_DEBUG */ + PRINT_INFO ("tape: can't allocate memory for " + "tape info structure\n"); + continue; + } + memset(ti,0,sizeof(tape_info_t)); + ti->discipline = disc; + disc->tape = ti; + rc = tape_setup (ti, irq, tape_num); + if (rc) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"tsetup err"); + debug_int_exception (tape_debug_area,3,rc); +#endif /* TAPE_DEBUG */ + kfree (ti); + } else { + s390irq_spin_lock_irqsave (irq, lockflags); + if (first_tape_info == NULL) { + first_tape_info = ti; + } else { + tempti = first_tape_info; + while (tempti->next != NULL) + tempti = tempti->next; + tempti->next = ti; + } + s390irq_spin_unlock_irqrestore (irq, lockflags); + } + } + tape_num+=2; + } + str++; + } +} + + +/* SECTION: Managing wrappers for ccwcache */ + +#define TAPE_EMERGENCY_REQUESTS 16 + +static ccw_req_t *tape_emergency_req[TAPE_EMERGENCY_REQUESTS] = +{NULL,}; +static spinlock_t tape_emergency_req_lock = SPIN_LOCK_UNLOCKED; + +static void +tape_init_emergency_req (void) +{ + int i; + for (i = 0; i < TAPE_EMERGENCY_REQUESTS; i++) { + tape_emergency_req[i] = (ccw_req_t *) get_free_page (GFP_KERNEL); + } +} + +#ifdef MODULE // We only cleanup the emergency requests on module unload. +static void +tape_cleanup_emergency_req (void) +{ + int i; + for (i = 0; i < TAPE_EMERGENCY_REQUESTS; i++) { + if (tape_emergency_req[i]) + free_page ((long) (tape_emergency_req[i])); + else + printk (KERN_WARNING PRINTK_HEADER "losing one page for 'in-use' emergency request\n"); + } +} +#endif + +ccw_req_t * +tape_alloc_request (char *magic, int cplength, int datasize) +{ + ccw_req_t *rv = NULL; + int i; + if ((rv = ccw_alloc_request (magic, cplength, datasize)) != NULL) { + return rv; + } + if (cplength * sizeof (ccw1_t) + datasize + sizeof (ccw_req_t) > PAGE_SIZE) { + return NULL; + } + spin_lock (&tape_emergency_req_lock); + for (i = 0; i < TAPE_EMERGENCY_REQUESTS; i++) { + if (tape_emergency_req[i] != NULL) { + rv = tape_emergency_req[i]; + tape_emergency_req[i] = NULL; + } + } + spin_unlock (&tape_emergency_req_lock); + if (rv) { + memset (rv, 0, PAGE_SIZE); + rv->cache = (kmem_cache_t *) (tape_emergency_req + i); + strncpy ((char *) (&rv->magic), magic, 4); + ASCEBC ((char *) (&rv->magic), 4); + rv->cplength = cplength; + rv->datasize = datasize; + rv->data = (void *) ((long) rv + PAGE_SIZE - datasize); + rv->cpaddr = (ccw1_t *) ((long) rv + sizeof (ccw_req_t)); + } + return rv; +} + +void +tape_free_request (ccw_req_t * request) +{ + if (request->cache >= (kmem_cache_t *) tape_emergency_req && + request->cache <= (kmem_cache_t *) (tape_emergency_req + TAPE_EMERGENCY_REQUESTS)) { + *((ccw_req_t **) (request->cache)) = request; + } else { + clear_normalized_cda ((ccw1_t *) (request->cpaddr)); // avoid memory leak caused by modeset_byte + ccw_free_request (request); + } +} + +/* + * Allocate a ccw request and reserve it for tape driver + */ +inline + ccw_req_t * +tape_alloc_ccw_req (tape_info_t * ti, int cplength, int datasize) +{ + char tape_magic_id[] = "tape"; + ccw_req_t *cqr = NULL; + + if (!ti) + return NULL; + cqr = tape_alloc_request (tape_magic_id, cplength, datasize); + + if (!cqr) { +#ifdef TAPE_DEBUG + PRINT_WARN ("empty CQR generated\n"); +#endif + } + cqr->magic = TAPE_MAGIC; /* sets an identifier for tape driver */ + cqr->device = ti; /* save pointer to tape info */ + return cqr; +} + +/* + * Find the tape_info_t structure associated with irq + */ +static inline tape_info_t * +tapedev_find_info (int irq) +{ + tape_info_t *ti; + + ti = first_tape_info; + if (ti != NULL) + do { + if (ti->devinfo.irq == irq) + break; + } while ((ti = (tape_info_t *) ti->next) != NULL); + return ti; +} + +#define QUEUE_THRESHOLD 5 + +/* + * Tape interrupt routine, called from Ingo's I/O layer + */ +void +tape_irq (int irq, void *int_parm, struct pt_regs *regs) +{ + tape_info_t *ti = tapedev_find_info (irq); + + /* analyse devstat and fire event */ + if (ti->devstat.dstat & DEV_STAT_UNIT_CHECK) { + tapestate_event (ti, TE_ERROR); + } else if (ti->devstat.dstat & (DEV_STAT_DEV_END)) { + tapestate_event (ti, TE_DONE); + } else + tapestate_event (ti, TE_OTHER); +} + +int +tape_oper_handler ( int irq, struct _devreg *dreg) { + tape_info_t* ti=first_tape_info; + tape_info_t* newtape; + int rc,tape_num,retries=0,i; + s390_dev_info_t dinfo; + tape_discipline_t* disc; +#ifdef CONFIG_DEVFS_FS + tape_frontend_t* frontend; +#endif + long lockflags; + while ((ti!=NULL) && (ti->devinfo.irq!=irq)) + ti=ti->next; + if (ti!=NULL) { + // irq is (still) used by tape. tell ingo to try again later + PRINT_WARN ("Oper handler for irq %d called while irq still (internaly?) used.\n",irq); + return -EAGAIN; + } + // irq is not used by tape + rc = get_dev_info_by_irq (irq, &dinfo); + if (rc == -ENODEV) { + retries++; + rc = get_dev_info_by_irq (irq, &dinfo); + if (retries > 5) { + PRINT_WARN ("No device information for new dev. could be retrieved.\n"); + return -ENODEV; + } + } + disc = first_discipline; + while ((disc != NULL) && (disc->cu_type != dinfo.sid_data.cu_type)) + disc = (tape_discipline_t *) (disc->next); + if (disc == NULL) + PRINT_WARN ("No matching discipline for cu_type %x found, ignoring device %04x.\n",dinfo.sid_data.cu_type,dinfo.devno); + if (rc == -ENODEV) + PRINT_WARN ("No device information for new dev. could be retrieved.\n"); + if ((disc == NULL) || (rc == -ENODEV)) + return -ENODEV; + + /* Allocate tape structure */ + ti = kmalloc (sizeof (tape_info_t), GFP_ATOMIC); + if (ti == NULL) { + PRINT_INFO ( "tape: can't allocate memory for " + "tape info structure\n"); + return -ENOBUFS; + } + memset(ti,0,sizeof(tape_info_t)); + ti->discipline = disc; + disc->tape = ti; + tape_num=0; + if (*tape) { + // we have static device ranges, so fingure out the tape_num of the attached tape + for (i=0;ici.devno==dinfo.devno) { + tape_num=2*i; + break; + } + } else { + // we are running in autoprobe mode, find a free tape_num + newtape=first_tape_info; + while (newtape!=NULL) { + if (newtape->rew_minor==tape_num) { + // tape num in use. try next one + tape_num+=2; + newtape=first_tape_info; + } else { + // tape num not used by newtape. look at next tape info + newtape=newtape->next; + } + } + } + rc = tape_setup (ti, irq, tape_num); + if (rc) { + kfree (ti); + return -ENOBUFS; + } +#ifdef CONFIG_DEVFS_FS + for (frontend=first_frontend;frontend!=NULL;frontend=frontend->next) + frontend->mkdevfstree(ti); +#endif + s390irq_spin_lock_irqsave (irq,lockflags); + if (first_tape_info == NULL) { + first_tape_info = ti; + } else { + newtape = first_tape_info; + while (newtape->next != NULL) + newtape = newtape->next; + newtape->next = ti; + } + s390irq_spin_unlock_irqrestore (irq, lockflags); + return 0; +} + + +static void +tape_noper_handler ( int irq, int status ) { + tape_info_t *ti=first_tape_info; + tape_info_t *lastti; +#ifdef CONFIG_DEVFS_FS + tape_frontend_t *frontend; +#endif + long lockflags; + s390irq_spin_lock_irqsave(irq,lockflags); + while (ti!=NULL && ti->devinfo.irq!=irq) ti=ti->next; + if (ti==NULL) return; + if (tapestate_get(ti)!=TS_UNUSED) { + // device is in use! + PRINT_WARN ("Tape #%d was detached while it was busy. Expect errors!",ti->blk_minor/2); + tapestate_set(ti,TS_NOT_OPER); + ti->rc=-ENODEV; + ti->wanna_wakeup=1; + switch (tapestate_get(ti)) { + case TS_REW_RELEASE_INIT: + tapestate_set(ti,TS_NOT_OPER); + wake_up (&ti->wq); + break; +#ifdef CONFIG_S390_TAPE_BLOCK + case TS_BLOCK_INIT: + tapestate_set(ti,TS_NOT_OPER); + schedule_tapeblock_exec_IO(ti); + break; +#endif + default: + tapestate_set(ti,TS_NOT_OPER); + wake_up_interruptible (&ti->wq); + } + } else { + // device is unused! + PRINT_WARN ("Tape #%d was detached.\n",ti->blk_minor/2); + if (ti==first_tape_info) { + first_tape_info=ti->next; + } else { + lastti=first_tape_info; + while (lastti->next!=ti) lastti=lastti->next; + lastti->next=ti->next; + } +#ifdef CONFIG_DEVFS_FS + for (frontend=first_frontend;frontend!=NULL;frontend=frontend->next) + frontend->rmdevfstree(ti); + tape_rmdevfsroots(ti); +#endif + kfree(ti); + } + s390irq_spin_unlock_irqrestore(irq,lockflags); + return; +} + + +void +tape_dump_sense (devstat_t * stat) +{ +#ifdef TAPE_DEBUG + int sl; +#endif +#if 0 + + PRINT_WARN ("------------I/O resulted in unit check:-----------\n"); + for (sl = 0; sl < 4; sl++) { + PRINT_WARN ("Sense:"); + for (sct = 0; sct < 8; sct++) { + PRINT_WARN (" %2d:0x%02X", 8 * sl + sct, + stat->ii.sense.data[8 * sl + sct]); + } + PRINT_WARN ("\n"); + } + PRINT_INFO ("Sense data: %02X%02X%02X%02X %02X%02X%02X%02X " + " %02X%02X%02X%02X %02X%02X%02X%02X \n", + stat->ii.sense.data[0], stat->ii.sense.data[1], + stat->ii.sense.data[2], stat->ii.sense.data[3], + stat->ii.sense.data[4], stat->ii.sense.data[5], + stat->ii.sense.data[6], stat->ii.sense.data[7], + stat->ii.sense.data[8], stat->ii.sense.data[9], + stat->ii.sense.data[10], stat->ii.sense.data[11], + stat->ii.sense.data[12], stat->ii.sense.data[13], + stat->ii.sense.data[14], stat->ii.sense.data[15]); + PRINT_INFO ("Sense data: %02X%02X%02X%02X %02X%02X%02X%02X " + " %02X%02X%02X%02X %02X%02X%02X%02X \n", + stat->ii.sense.data[16], stat->ii.sense.data[17], + stat->ii.sense.data[18], stat->ii.sense.data[19], + stat->ii.sense.data[20], stat->ii.sense.data[21], + stat->ii.sense.data[22], stat->ii.sense.data[23], + stat->ii.sense.data[24], stat->ii.sense.data[25], + stat->ii.sense.data[26], stat->ii.sense.data[27], + stat->ii.sense.data[28], stat->ii.sense.data[29], + stat->ii.sense.data[30], stat->ii.sense.data[31]); +#endif +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"SENSE:"); + for (sl=0;sl<31;sl++) { + debug_int_event (tape_debug_area,3,stat->ii.sense.data[sl]); + } + debug_int_exception (tape_debug_area,3,stat->ii.sense.data[31]); +#endif +} + +/* + * Setup tape_info_t structure of a tape device + */ +int +tape_setup (tape_info_t * ti, int irq, int minor) +{ + long lockflags; + int rc = 0; + + if (minor>254) { + PRINT_WARN ("Device id %d on irq %d will not be accessible since this driver is restricted to 128 devices.\n",minor/2,irq); + return -EINVAL; + } + rc = get_dev_info_by_irq (irq, &(ti->devinfo)); + if (rc == -ENODEV) { /* end of device list */ + return rc; + } + ti->rew_minor = minor; + ti->nor_minor = minor + 1; + ti->blk_minor = minor; +#ifdef CONFIG_DEVFS_FS + tape_mkdevfsroots(ti); +#endif + /* Register IRQ */ +#ifdef CONFIG_S390_TAPE_DYNAMIC + rc = s390_request_irq_special (irq, tape_irq, tape_noper_handler,0, "tape", &(ti->devstat)); +#else + rc = s390_request_irq (irq, tape_irq, 0, "tape", &(ti->devstat)); +#endif + s390irq_spin_lock_irqsave (irq, lockflags); + ti->next = NULL; + if (rc) + PRINT_WARN ("Cannot register irq %d, rc=%d\n", irq, rc); + init_waitqueue_head (&ti->wq); + ti->kernbuf = ti->userbuf = ti->discdata = NULL; + tapestate_set (ti, TS_UNUSED); + ti->discdata=NULL; + ti->discipline->setup_assist (ti); + ti->wanna_wakeup=0; + s390irq_spin_unlock_irqrestore (irq, lockflags); + return rc; +} + +/* + * tape_init will register the driver for each tape. + */ +int +tape_init (void) +{ + long lockflags; + s390_dev_info_t dinfo; + tape_discipline_t *disc; + tape_info_t *ti = NULL, *tempti = NULL; + char *opt_char,*opt_block,*opt_3490,*opt_3480; + int irq = 0, rc, retries = 0, tape_num = 0; + static int initialized=0; + + if (initialized) // Only init the devices once + return 0; + initialized=1; + +#ifdef TAPE_DEBUG + tape_debug_area = debug_register ( "tape", 3, 2, 10); + debug_register_view(tape_debug_area,&debug_hex_ascii_view); + debug_text_event (tape_debug_area,3,"begin init"); +#endif /* TAPE_DEBUG */ + + /* print banner */ + PRINT_WARN ("IBM S/390 Tape Device Driver (v1.01).\n"); + PRINT_WARN ("(C) IBM Deutschland Entwicklung GmbH, 2000\n"); + opt_char=opt_block=opt_3480=opt_3490="not present"; +#ifdef CONFIG_S390_TAPE_CHAR + opt_char="built in"; +#endif +#ifdef CONFIG_S390_TAPE_BLOCK + opt_block="built in"; +#endif +#ifdef CONFIG_S390_TAPE_3480 + opt_3480="built in"; +#endif +#ifdef CONFIG_S390_TAPE_3490 + opt_3490="built in"; +#endif + /* print feature info */ + PRINT_WARN ("character device frontend : %s\n",opt_char); + PRINT_WARN ("block device frontend : %s\n",opt_block); + PRINT_WARN ("support for 3480 compatible : %s\n",opt_3480); + PRINT_WARN ("support for 3490 compatible : %s\n",opt_3490); + +#ifndef MODULE + tape_split_parm_string(tape_parm_string); +#endif + if (*tape) + PRINT_INFO ("Using ranges supplied in parameters, disabling autoprobe mode.\n"); + else + PRINT_INFO ("No parameters supplied, enabling autoprobe mode for all supported devices.\n"); +#ifdef CONFIG_S390_TAPE_3490 + if (*tape) + first_discipline = tape3490_init (0); // no autoprobe for devices + else + first_discipline = tape3490_init (1); // do autoprobe since no parm specified + first_discipline->next = NULL; +#endif + +#ifdef CONFIG_S390_TAPE_3480 + if (first_discipline == NULL) { + if (*tape) + first_discipline = tape3480_init (0); // no autoprobe for devices + else + first_discipline = tape3480_init (1); // do autoprobe since no parm specified + first_discipline->next = NULL; + } else { + if (*tape) + first_discipline->next = tape3480_init (0); // no autoprobe for devices + else + first_discipline->next = tape3480_init (1); // do autoprobe since no parm specified + ((tape_discipline_t*) (first_discipline->next))->next=NULL; + } +#endif +#ifdef CONFIG_DEVFS_FS + tape_devfs_root_entry=devfs_mk_dir (NULL, "tape", NULL); +#endif CONFIG_DEVFS_FS + +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"dev detect"); +#endif /* TAPE_DEBUG */ + /* Allocate the tape structures */ + if (*tape!=NULL) { + // we have parameters, continue with parsing the parameters and set the devices online + tape_parm_parse (tape); + } else { + // we are running in autodetect mode, search all devices for compatibles + for (irq = get_irq_first(); irq!=-ENODEV; irq=get_irq_next(irq)) { + rc = get_dev_info_by_irq (irq, &dinfo); + disc = first_discipline; + while ((disc != NULL) && (disc->cu_type != dinfo.sid_data.cu_type)) + disc = (tape_discipline_t *) (disc->next); + if ((disc == NULL) || (rc == -ENODEV)) + continue; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"det irq: "); + debug_int_event (tape_debug_area,3,irq); + debug_text_event (tape_debug_area,3,"cu: "); + debug_int_event (tape_debug_area,3,disc->cu_type); +#endif /* TAPE_DEBUG */ + PRINT_INFO ("using devno %04x with discipline %04x on irq %d as tape device %d\n",dinfo.devno,dinfo.sid_data.cu_type,irq,tape_num/2); + /* Allocate tape structure */ + ti = kmalloc (sizeof (tape_info_t), GFP_ATOMIC); + if (ti == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"ti:no mem "); +#endif /* TAPE_DEBUG */ + PRINT_INFO ("tape: can't allocate memory for " + "tape info structure\n"); + continue; + } + memset(ti,0,sizeof(tape_info_t)); + ti->discipline = disc; + disc->tape = ti; + rc = tape_setup (ti, irq, tape_num); + if (rc) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"tsetup err"); + debug_int_exception (tape_debug_area,3,rc); +#endif /* TAPE_DEBUG */ + kfree (ti); + } else { + s390irq_spin_lock_irqsave (irq, lockflags); + if (first_tape_info == NULL) { + first_tape_info = ti; + } else { + tempti = first_tape_info; + while (tempti->next != NULL) + tempti = tempti->next; + tempti->next = ti; + } + tape_num += 2; + s390irq_spin_unlock_irqrestore (irq, lockflags); + } + } + } + + /* Allocate local buffer for the ccwcache */ + tape_init_emergency_req (); +#ifdef CONFIG_PROC_FS +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) + tape_devices_entry = create_proc_entry ("tapedevices", + S_IFREG | S_IRUGO | S_IWUSR, + &proc_root); + tape_devices_entry->proc_fops = &tape_devices_file_ops; + tape_devices_entry->proc_iops = &tape_devices_inode_ops; +#else + tape_devices_entry = (struct proc_dir_entry *) kmalloc + (sizeof (struct proc_dir_entry), GFP_ATOMIC); + if (tape_devices_entry) { + memset (tape_devices_entry, 0, sizeof (struct proc_dir_entry)); + tape_devices_entry->name = "tapedevices"; + tape_devices_entry->namelen = strlen ("tapedevices"); + tape_devices_entry->low_ino = 0; + tape_devices_entry->mode = (S_IFREG | S_IRUGO | S_IWUSR); + tape_devices_entry->nlink = 1; + tape_devices_entry->uid = 0; + tape_devices_entry->gid = 0; + tape_devices_entry->size = 0; + tape_devices_entry->get_info = NULL; + tape_devices_entry->ops = &tape_devices_inode_ops; + proc_register (&proc_root, tape_devices_entry); + } +#endif +#endif /* CONFIG_PROC_FS */ + + return 0; +} + +#ifdef MODULE +MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte (cotte@de.ibm.com)"); +MODULE_DESCRIPTION("Linux for S/390 channel attached tape device driver"); +MODULE_PARM (tape, "1-" __MODULE_STRING (256) "s"); + +int +init_module (void) +{ +#ifdef CONFIG_S390_TAPE_CHAR + tapechar_init (); +#endif +#ifdef CONFIG_S390_TAPE_BLOCK + tapeblock_init (); +#endif + return 0; +} + +void +cleanup_module (void) +{ + tape_info_t *ti ,*temp; + tape_frontend_t* frontend, *tempfe; + tape_discipline_t* disc ,*tempdi; + int i; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"cleaup mod"); +#endif /* TAPE_DEBUG */ + + if (*tape) { + // we are running with parameters. we'll now deregister from our devno's + for (i=0;inext; + //cleanup a device +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"free irq:"); + debug_int_event (tape_debug_area,6,temp->devinfo.irq); +#endif /* TAPE_DEBUG */ + free_irq (temp->devinfo.irq, &(temp->devstat)); + if (temp->discdata) kfree (temp->discdata); + if (temp->kernbuf) kfree (temp->kernbuf); + if (temp->cqr) tape_free_request(temp->cqr); +#ifdef CONFIG_DEVFS_FS + for (frontend=first_frontend;frontend!=NULL;frontend=frontend->next) + frontend->rmdevfstree(temp); + tape_rmdevfsroots(temp); +#endif + kfree (temp); + } +#ifdef CONFIG_DEVFS_FS + devfs_unregister (tape_devfs_root_entry); +#endif CONFIG_DEVFS_FS +#ifdef CONFIG_PROC_FS +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) + remove_proc_entry ("tapedevices", &proc_root); +#else + proc_unregister (&proc_root, tape_devices_entry->low_ino); + kfree (tape_devices_entry); +#endif /* LINUX_IS_24 */ +#endif +#ifdef CONFIG_S390_TAPE_CHAR + tapechar_uninit(); +#endif +#ifdef CONFIG_S390_TAPE_BLOCK + tapeblock_uninit(); +#endif + frontend=first_frontend; + while (frontend != NULL) { + tempfe = frontend; + frontend = frontend->next; + kfree (tempfe); + } + disc=first_discipline; + while (disc != NULL) { + if (*tape) + disc->shutdown(0); + else + disc->shutdown(1); + tempdi = disc; + disc = disc->next; + kfree (tempdi); + } + /* Deallocate the local buffer for the ccwcache */ + tape_cleanup_emergency_req (); +#ifdef TAPE_DEBUG + debug_unregister (tape_debug_area); +#endif /* TAPE_DEBUG */ +} +#endif /* MODULE */ + +inline void +tapestate_set (tape_info_t * ti, int newstate) +{ + if (ti->tape_state == TS_NOT_OPER) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"ts_set err"); + debug_text_exception (tape_debug_area,3,"dev n.oper"); +#endif /* TAPE_DEBUG */ + } else { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,4,"ts. dev: "); + debug_int_event (tape_debug_area,4,ti->blk_minor); + debug_text_event (tape_debug_area,4,"old ts: "); + debug_text_event (tape_debug_area,4,(((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >=0 )) ? + state_verbose[tapestate_get (ti)] : + "UNKNOWN TS")); + debug_text_event (tape_debug_area,4,"new ts: "); + debug_text_event (tape_debug_area,4,(((newstate < TS_SIZE) && + (newstate >= 0)) ? + state_verbose[newstate] : + "UNKNOWN TS")); +#endif /* TAPE_DEBUG */ + ti->tape_state = newstate; + } +} + +inline int +tapestate_get (tape_info_t * ti) +{ + return (ti->tape_state); +} + +void +tapestate_event (tape_info_t * ti, int event) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"te! dev: "); + debug_int_event (tape_debug_area,6,ti->blk_minor); + debug_text_event (tape_debug_area,6,"event:"); + debug_text_event (tape_debug_area,6,((event >=0) && + (event < TE_SIZE)) ? + event_verbose[event] : "TE UNKNOWN"); + debug_text_event (tape_debug_area,6,"state:"); + debug_text_event (tape_debug_area,6,((tapestate_get(ti) >= 0) && + (tapestate_get(ti) < TS_SIZE)) ? + state_verbose[tapestate_get (ti)] : + "TS UNKNOWN"); +#endif /* TAPE_DEBUG */ + if (event == TE_ERROR) { + ti->discipline->error_recovery(ti); + } else { + if ((event >= 0) && + (event < TE_SIZE) && + (tapestate_get (ti) >= 0) && + (tapestate_get (ti) < TS_SIZE) && + ((*(ti->discipline->event_table))[tapestate_get (ti)][event] != NULL)) + ((*(ti->discipline->event_table))[tapestate_get (ti)][event]) (ti); + else { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"TE UNEXPEC"); +#endif /* TAPE_DEBUG */ + ti->discipline->default_handler (ti); + } + } +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 4 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -4 + * c-argdecl-indent: 4 + * c-label-offset: -4 + * c-continued-statement-offset: 4 + * c-continued-brace-offset: 0 + * indent-tabs-mode: nil + * tab-width: 8 + * End: + */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape.h linux.20p9/drivers/s390/char/tape.h --- linux.vanilla/drivers/s390/char/tape.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,203 @@ +/*************************************************************************** + * + * drivers/s390/char/tape.h + * tape device driver for 3480/3490E tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#ifndef _TAPE_H + +#define _TAPE_H +#include +#include + +#define MAX_TAPES 7 /* Max tapes supported is 7*/ +#define TAPE_MAGIC 0xE3C1D7C5 /* is ebcdic-"TAPE" */ + +typedef enum { + TS_UNUSED=0, TS_IDLE, TS_DONE, TS_FAILED, + TS_BLOCK_INIT, + TS_BSB_INIT, + TS_BSF_INIT, + TS_DSE_INIT, + TS_EGA_INIT, + TS_FSB_INIT, + TS_FSF_INIT, + TS_LDI_INIT, + TS_LBL_INIT, + TS_MSE_INIT, + TS_NOP_INIT, + TS_RBA_INIT, + TS_RBI_INIT, + TS_RBU_INIT, + TS_RBL_INIT, + TS_RDC_INIT, + TS_RFO_INIT, + TS_RSD_INIT, + TS_REW_INIT, + TS_REW_RELEASE_INIT, + TS_RUN_INIT, + TS_SEN_INIT, + TS_SID_INIT, + TS_SNP_INIT, + TS_SPG_INIT, + TS_SWI_INIT, + TS_SMR_INIT, + TS_SYN_INIT, + TS_TIO_INIT, + TS_UNA_INIT, + TS_WRI_INIT, + TS_WTM_INIT, + TS_NOT_OPER, + TS_SIZE } tape_stat; + +struct _tape_info_t; //Forward declaration + +typedef enum { + TE_START=0, TE_DONE, TE_FAILED, TE_ERROR, TE_OTHER, + TE_SIZE } tape_events; + +typedef void (*tape_disc_shutdown_t) (int); +typedef void (*tape_event_handler_t) (struct _tape_info_t*); +typedef ccw_req_t* (*tape_ccwgen_t)(struct _tape_info_t* ti,int count); +typedef ccw_req_t* (*tape_reqgen_t)(struct request* req,struct _tape_info_t* ti,int tapeblock_major); +typedef ccw_req_t* (*tape_rwblock_t)(const char* data,size_t count,struct _tape_info_t* ti); +typedef void (*tape_freeblock_t)(ccw_req_t* cqr,struct _tape_info_t* ti); +typedef void (*tape_setup_assist_t) (struct _tape_info_t*); +#ifdef CONFIG_DEVFS_FS +typedef void (*tape_devfs_handler_t) (struct _tape_info_t*); +#endif +typedef tape_event_handler_t tape_event_table_t[TS_SIZE][TE_SIZE]; +typedef struct _tape_discipline_t { + unsigned int cu_type; + tape_setup_assist_t setup_assist; + tape_event_handler_t error_recovery; + tape_reqgen_t bread; + tape_freeblock_t free_bread; + tape_rwblock_t write_block; + tape_freeblock_t free_write_block; + tape_rwblock_t read_block; + tape_freeblock_t free_read_block; + tape_ccwgen_t mtfsf; + tape_ccwgen_t mtbsf; + tape_ccwgen_t mtfsr; + tape_ccwgen_t mtbsr; + tape_ccwgen_t mtweof; + tape_ccwgen_t mtrew; + tape_ccwgen_t mtoffl; + tape_ccwgen_t mtnop; + tape_ccwgen_t mtbsfm; + tape_ccwgen_t mtfsfm; + tape_ccwgen_t mteom; + tape_ccwgen_t mterase; + tape_ccwgen_t mtsetdensity; + tape_ccwgen_t mtseek; + tape_ccwgen_t mttell; + tape_ccwgen_t mtsetdrvbuffer; + tape_ccwgen_t mtlock; + tape_ccwgen_t mtunlock; + tape_ccwgen_t mtload; + tape_ccwgen_t mtunload; + tape_ccwgen_t mtcompression; + tape_ccwgen_t mtsetpart; + tape_ccwgen_t mtmkpart; + tape_ccwgen_t mtiocget; + tape_ccwgen_t mtiocpos; + tape_disc_shutdown_t shutdown; + int (*discipline_ioctl_overload)(struct inode *,struct file*, unsigned int,unsigned long); + tape_event_table_t* event_table; + tape_event_handler_t default_handler; + struct _tape_info_t* tape; /* pointer for backreference */ + void* next; +} tape_discipline_t __attribute__ ((aligned(8))); + +typedef struct _tape_frontend_t { + tape_setup_assist_t device_setup; +#ifdef CONFIG_DEVFS_FS + tape_devfs_handler_t mkdevfstree; + tape_devfs_handler_t rmdevfstree; +#endif + void* next; +} tape_frontend_t __attribute__ ((aligned(8))); + + +typedef struct _tape_info_t { + wait_queue_head_t wq; + s390_dev_info_t devinfo; /* device info from Common I/O */ + int wanna_wakeup; + int rew_minor; /* minor number for the rewinding tape */ + int nor_minor; /* minor number for the nonrewinding tape */ + int blk_minor; /* minor number for the block device */ + devstat_t devstat; /* contains irq, devno, status */ + size_t block_size; /* block size of tape */ + int drive_type; /* Code indicating type of drive */ + struct file *rew_filp; /* backpointer to file structure */ + struct file *nor_filp; + struct file *blk_filp; + int tape_state; /* State of the device. See tape_stat */ + int rc; /* Return code. */ + tape_discipline_t* discipline; + request_queue_t request_queue; + struct request* current_request; + int blk_retries; + long position; + int medium_is_unloaded; // Becomes true when a unload-type operation was issued, false again when medium-insert was detected + ccw_req_t* cqr; + atomic_t bh_scheduled; + struct tq_struct bh_tq; +#ifdef CONFIG_DEVFS_FS + devfs_handle_t devfs_dir; /* devfs handle for tape/DEVNO directory */ + devfs_handle_t devfs_char_dir; /* devfs handle for tape/DEVNO/char directory */ + devfs_handle_t devfs_block_dir; /* devfs handle for tape/DEVNO/block directory */ + devfs_handle_t devfs_nonrewinding; /* devfs handle for tape/DEVNO/char/nonrewinding device */ + devfs_handle_t devfs_rewinding; /* devfs handle for tape/DEVNO/char/rewinding device */ + devfs_handle_t devfs_disc; /* devfs handle for tape/DEVNO/block/disc device */ +#endif + void* discdata; + void* kernbuf; + void* userbuf; + void* next; +} tape_info_t __attribute__ ((aligned(8))); + +/* tape initialisation functions */ +int tape_init(void); +int tape_setup (tape_info_t * ti, int irq, int minor); + +/* functoins for alloc'ing ccw stuff */ +inline ccw_req_t * tape_alloc_ccw_req (tape_info_t* ti, int cplength, int datasize); +void tape_free_request (ccw_req_t * request); + +/* a function for dumping device sense info */ +void tape_dump_sense (devstat_t * stat); + +#ifdef CONFIG_S390_TAPE_DYNAMIC +/* functions for dyn. dev. attach/detach */ +int tape_oper_handler ( int irq, struct _devreg *dreg); +#endif + +/* functions for handling the status of a device */ +inline void tapestate_set (tape_info_t * ti, int newstate); +inline int tapestate_get (tape_info_t * ti); +void tapestate_event (tape_info_t * ti, int event); +extern char* state_verbose[TS_SIZE]; +extern char* event_verbose[TE_SIZE]; + +/****************************************************************************/ + +/* Some linked lists for storing plugins and devices */ +extern tape_info_t *first_tape_info; +extern tape_discipline_t *first_discipline; +extern tape_frontend_t *first_frontend; + +/* The debug area */ +#ifdef TAPE_DEBUG +extern debug_info_t *tape_debug_area; +#endif + +#endif /* for ifdef tape.h */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape3480.c linux.20p9/drivers/s390/char/tape3480.c --- linux.vanilla/drivers/s390/char/tape3480.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape3480.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,156 @@ +/*************************************************************************** + * + * drivers/s390/char/tape3480.c + * tape device discipline for 3480 tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#include "tapedefs.h" +#include +#include /* CCW allocations */ +#include +#include +#include +#include "tape.h" +#include "tape34xx.h" +#include "tape3480.h" + +tape_event_handler_t tape3480_event_handler_table[TS_SIZE][TE_SIZE] = +{ + /* {START , DONE, FAILED, ERROR, OTHER } */ + {NULL, tape34xx_unused_done, NULL, NULL, NULL}, /* TS_UNUSED */ + {NULL, tape34xx_idle_done, NULL, NULL, NULL}, /* TS_IDLE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_DONE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_FAILED */ + {NULL, tape34xx_block_done, NULL, NULL, NULL}, /* TS_BLOCK_INIT */ + {NULL, tape34xx_bsb_init_done, NULL, NULL, NULL}, /* TS_BSB_INIT */ + {NULL, tape34xx_bsf_init_done, NULL, NULL, NULL}, /* TS_BSF_INIT */ + {NULL, tape34xx_dse_init_done, NULL, NULL, NULL}, /* TS_DSE_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_EGA_INIT */ + {NULL, tape34xx_fsb_init_done, NULL, NULL, NULL}, /* TS_FSB_INIT */ + {NULL, tape34xx_fsf_init_done, NULL, NULL, NULL}, /* TS_FSF_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_LDI_INIT */ + {NULL, tape34xx_lbl_init_done, NULL, NULL, NULL}, /* TS_LBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_MSE_INIT */ + {NULL, tape34xx_nop_init_done, NULL, NULL, NULL}, /* TS_NOP_INIT */ + {NULL, tape34xx_rfo_init_done, NULL, NULL, NULL}, /* TS_RBA_INIT */ + {NULL, tape34xx_rbi_init_done, NULL, NULL, NULL}, /* TS_RBI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBU_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RDC_INIT */ + {NULL, tape34xx_rfo_init_done, NULL, NULL, NULL}, /* TS_RFO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RSD_INIT */ + {NULL, tape34xx_rew_init_done, NULL, NULL, NULL}, /* TS_REW_INIT */ + {NULL, tape34xx_rew_release_init_done, NULL, NULL, NULL}, /* TS_REW_RELEASE_IMIT */ + {NULL, tape34xx_run_init_done, NULL, NULL, NULL}, /* TS_RUN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SEN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SID_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SNP_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SPG_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SWI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SMR_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SYN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_TIO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_UNA_INIT */ + {NULL, tape34xx_wri_init_done, NULL, NULL, NULL}, /* TS_WRI_INIT */ + {NULL, tape34xx_wtm_init_done, NULL, NULL, NULL}, /* TS_WTM_INIT */ + {NULL, NULL, NULL, NULL, NULL}}; /* TS_NOT_OPER */ + +devreg_t tape3480_devreg = { + ci: + {hc: + {ctype:0x3480}}, + flag:DEVREG_MATCH_CU_TYPE | DEVREG_TYPE_DEVCHARS, + oper_func:tape_oper_handler +}; + + +void +tape3480_setup_assist (tape_info_t * ti) +{ + tape3480_disc_data_t *data = NULL; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"3480 dsetu"); + debug_text_event (tape_debug_area,6,"dev:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif /* TAPE_DEBUG */ + while (data == NULL) + data = kmalloc (sizeof (tape3480_disc_data_t), GFP_KERNEL); + data->modeset_byte = 0x00; + ti->discdata = (void *) data; +} + + +void +tape3480_shutdown (int autoprobe) { + if (autoprobe) + s390_device_unregister(&tape3480_devreg); +} + +tape_discipline_t * +tape3480_init (int autoprobe) +{ + tape_discipline_t *disc; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"3480 init"); +#endif /* TAPE_DEBUG */ + disc = kmalloc (sizeof (tape_discipline_t), GFP_KERNEL); + if (disc == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"disc:nomem"); +#endif /* TAPE_DEBUG */ + return disc; + } + disc->cu_type = 0x3480; + disc->setup_assist = tape3480_setup_assist; + disc->error_recovery = tape34xx_error_recovery; + disc->write_block = tape34xx_write_block; + disc->free_write_block = tape34xx_free_write_block; + disc->read_block = tape34xx_read_block; + disc->free_read_block = tape34xx_free_read_block; + disc->mtfsf = tape34xx_mtfsf; + disc->mtbsf = tape34xx_mtbsf; + disc->mtfsr = tape34xx_mtfsr; + disc->mtbsr = tape34xx_mtbsr; + disc->mtweof = tape34xx_mtweof; + disc->mtrew = tape34xx_mtrew; + disc->mtoffl = tape34xx_mtoffl; + disc->mtnop = tape34xx_mtnop; + disc->mtbsfm = tape34xx_mtbsfm; + disc->mtfsfm = tape34xx_mtfsfm; + disc->mteom = tape34xx_mteom; + disc->mterase = tape34xx_mterase; + disc->mtsetdensity = tape34xx_mtsetdensity; + disc->mtseek = tape34xx_mtseek; + disc->mttell = tape34xx_mttell; + disc->mtsetdrvbuffer = tape34xx_mtsetdrvbuffer; + disc->mtlock = tape34xx_mtlock; + disc->mtunlock = tape34xx_mtunlock; + disc->mtload = tape34xx_mtload; + disc->mtunload = tape34xx_mtunload; + disc->mtcompression = tape34xx_mtcompression; + disc->mtsetpart = tape34xx_mtsetpart; + disc->mtmkpart = tape34xx_mtmkpart; + disc->mtiocget = tape34xx_mtiocget; + disc->mtiocpos = tape34xx_mtiocpos; + disc->shutdown = tape3480_shutdown; + disc->discipline_ioctl_overload = tape34xx_ioctl_overload; + disc->event_table = &tape3480_event_handler_table; + disc->default_handler = tape34xx_default_handler; + disc->bread = tape34xx_bread; + disc->free_bread = tape34xx_free_bread; + disc->tape = NULL; /* pointer for backreference */ + disc->next = NULL; + if (autoprobe) + s390_device_register(&tape3480_devreg); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"3480 regis"); +#endif /* TAPE_DEBUG */ + return disc; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape3480.h linux.20p9/drivers/s390/char/tape3480.h --- linux.vanilla/drivers/s390/char/tape3480.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape3480.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,23 @@ +/*************************************************************************** + * + * drivers/s390/char/tape3480.h + * tape device discipline for 3480 tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#ifndef _TAPE3480_H + +#define _TAPE3480_H + + +typedef struct _tape3480_disc_data_t { + __u8 modeset_byte; +} tape3480_disc_data_t __attribute__ ((packed, aligned(8))); +tape_discipline_t * tape3480_init (int); +#endif // _TAPE3480_H diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape3490.c linux.20p9/drivers/s390/char/tape3490.c --- linux.vanilla/drivers/s390/char/tape3490.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape3490.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,156 @@ +/*************************************************************************** + * + * drivers/s390/char/tape3490.c + * tape device discipline for 3490E tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#include "tapedefs.h" +#include +#include /* CCW allocations */ +#include +#include +#include +#include "tape.h" +#include "tape34xx.h" +#include "tape3490.h" + +tape_event_handler_t tape3490_event_handler_table[TS_SIZE][TE_SIZE] = +{ + /* {START , DONE, FAILED, ERROR, OTHER } */ + {NULL, tape34xx_unused_done, NULL, NULL, NULL}, /* TS_UNUSED */ + {NULL, tape34xx_idle_done, NULL, NULL, NULL}, /* TS_IDLE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_DONE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_FAILED */ + {NULL, tape34xx_block_done, NULL, NULL, NULL}, /* TS_BLOCK_INIT */ + {NULL, tape34xx_bsb_init_done, NULL, NULL, NULL}, /* TS_BSB_INIT */ + {NULL, tape34xx_bsf_init_done, NULL, NULL, NULL}, /* TS_BSF_INIT */ + {NULL, tape34xx_dse_init_done, NULL, NULL, NULL}, /* TS_DSE_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_EGA_INIT */ + {NULL, tape34xx_fsb_init_done, NULL, NULL, NULL}, /* TS_FSB_INIT */ + {NULL, tape34xx_fsf_init_done, NULL, NULL, NULL}, /* TS_FSF_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_LDI_INIT */ + {NULL, tape34xx_lbl_init_done, NULL, NULL, NULL}, /* TS_LBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_MSE_INIT */ + {NULL, tape34xx_nop_init_done, NULL, NULL, NULL}, /* TS_NOP_INIT */ + {NULL, tape34xx_rfo_init_done, NULL, NULL, NULL}, /* TS_RBA_INIT */ + {NULL, tape34xx_rbi_init_done, NULL, NULL, NULL}, /* TS_RBI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBU_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RDC_INIT */ + {NULL, tape34xx_rfo_init_done, NULL, NULL, NULL}, /* TS_RFO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RSD_INIT */ + {NULL, tape34xx_rew_init_done, NULL, NULL, NULL}, /* TS_REW_INIT */ + {NULL, tape34xx_rew_release_init_done, NULL, NULL, NULL}, /* TS_REW_RELEASE_IMIT */ + {NULL, tape34xx_run_init_done, NULL, NULL, NULL}, /* TS_RUN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SEN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SID_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SNP_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SPG_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SWI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SMR_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SYN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_TIO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_UNA_INIT */ + {NULL, tape34xx_wri_init_done, NULL, NULL, NULL}, /* TS_WRI_INIT */ + {NULL, tape34xx_wtm_init_done, NULL, NULL, NULL}, /* TS_WTM_INIT */ + {NULL, NULL, NULL, NULL, NULL}}; /* TS_NOT_OPER */ + +devreg_t tape3490_devreg = { + ci: + {hc: + {ctype:0x3490}}, + flag:DEVREG_MATCH_CU_TYPE | DEVREG_TYPE_DEVCHARS, + oper_func:tape_oper_handler +}; + +void +tape3490_setup_assist (tape_info_t * ti) +{ + tape3490_disc_data_t *data = NULL; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"3490 dsetu"); + debug_text_event (tape_debug_area,6,"dev:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif /* TAPE_DEBUG */ + while (data == NULL) + data = kmalloc (sizeof (tape3490_disc_data_t), GFP_KERNEL); + data->modeset_byte = 0x00; + ti->discdata = (void *) data; +} + + +void +tape3490_shutdown (int autoprobe) { + if (autoprobe) + s390_device_unregister(&tape3490_devreg); +} + + +tape_discipline_t * +tape3490_init (int autoprobe) +{ + tape_discipline_t *disc; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"3490 init"); +#endif /* TAPE_DEBUG */ + disc = kmalloc (sizeof (tape_discipline_t), GFP_KERNEL); + if (disc == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"disc:nomem"); +#endif /* TAPE_DEBUG */ + return disc; + } + disc->cu_type = 0x3490; + disc->setup_assist = tape3490_setup_assist; + disc->error_recovery = tape34xx_error_recovery; + disc->write_block = tape34xx_write_block; + disc->free_write_block = tape34xx_free_write_block; + disc->read_block = tape34xx_read_block; + disc->free_read_block = tape34xx_free_read_block; + disc->mtfsf = tape34xx_mtfsf; + disc->mtbsf = tape34xx_mtbsf; + disc->mtfsr = tape34xx_mtfsr; + disc->mtbsr = tape34xx_mtbsr; + disc->mtweof = tape34xx_mtweof; + disc->mtrew = tape34xx_mtrew; + disc->mtoffl = tape34xx_mtoffl; + disc->mtnop = tape34xx_mtnop; + disc->mtbsfm = tape34xx_mtbsfm; + disc->mtfsfm = tape34xx_mtfsfm; + disc->mteom = tape34xx_mteom; + disc->mterase = tape34xx_mterase; + disc->mtsetdensity = tape34xx_mtsetdensity; + disc->mtseek = tape34xx_mtseek; + disc->mttell = tape34xx_mttell; + disc->mtsetdrvbuffer = tape34xx_mtsetdrvbuffer; + disc->mtlock = tape34xx_mtlock; + disc->mtunlock = tape34xx_mtunlock; + disc->mtload = tape34xx_mtload; + disc->mtunload = tape34xx_mtunload; + disc->mtcompression = tape34xx_mtcompression; + disc->mtsetpart = tape34xx_mtsetpart; + disc->mtmkpart = tape34xx_mtmkpart; + disc->mtiocget = tape34xx_mtiocget; + disc->mtiocpos = tape34xx_mtiocpos; + disc->shutdown = tape3490_shutdown; + disc->discipline_ioctl_overload = tape34xx_ioctl_overload; + disc->event_table = &tape3490_event_handler_table; + disc->default_handler = tape34xx_default_handler; + disc->bread = tape34xx_bread; + disc->free_bread = tape34xx_free_bread; + disc->tape = NULL; /* pointer for backreference */ + disc->next = NULL; + if (autoprobe) + s390_device_register(&tape3490_devreg); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"3490 regis"); +#endif /* TAPE_DEBUG */ + return disc; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape3490.h linux.20p9/drivers/s390/char/tape3490.h --- linux.vanilla/drivers/s390/char/tape3490.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape3490.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,24 @@ + +/*************************************************************************** + * + * drivers/s390/char/tape3490.h + * tape device discipline for 3490E tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#ifndef _TAPE3490_H + +#define _TAPE3490_H + + +typedef struct _tape3490_disc_data_t { + __u8 modeset_byte; +} tape3490_disc_data_t __attribute__ ((packed, aligned(8))); +tape_discipline_t * tape3490_init (int); +#endif // _TAPE3490_H diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape34xx.c linux.20p9/drivers/s390/char/tape34xx.c --- linux.vanilla/drivers/s390/char/tape34xx.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape34xx.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,2382 @@ +/*************************************************************************** + * + * drivers/s390/char/tape34xx.c + * common tape device discipline for 34xx tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#include "tapedefs.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_S390_TAPE_DYNAMIC +#include +#endif +#include +#include +#include "tape.h" +#include "tape34xx.h" + +#define PRINTK_HEADER "T34xx:" + +tape_event_handler_t tape34xx_event_handler_table[TS_SIZE][TE_SIZE] = +{ + /* {START , DONE, FAILED, ERROR, OTHER } */ + {NULL, tape34xx_unused_done, NULL, NULL, NULL}, /* TS_UNUSED */ + {NULL, tape34xx_idle_done, NULL, NULL, NULL}, /* TS_IDLE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_DONE */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_FAILED */ + {NULL, tape34xx_block_done, NULL, NULL, NULL}, /* TS_BLOCK_INIT */ + {NULL, tape34xx_bsb_init_done, NULL, NULL, NULL}, /* TS_BSB_INIT */ + {NULL, tape34xx_bsf_init_done, NULL, NULL, NULL}, /* TS_BSF_INIT */ + {NULL, tape34xx_dse_init_done, NULL, NULL, NULL}, /* TS_DSE_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_EGA_INIT */ + {NULL, tape34xx_fsb_init_done, NULL, NULL, NULL}, /* TS_FSB_INIT */ + {NULL, tape34xx_fsf_init_done, NULL, NULL, NULL}, /* TS_FSF_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_LDI_INIT */ + {NULL, tape34xx_lbl_init_done, NULL, NULL, NULL}, /* TS_LBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_MSE_INIT */ + {NULL, tape34xx_nop_init_done, NULL, NULL, NULL}, /* TS_NOP_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBA_INIT */ + {NULL, tape34xx_rbi_init_done, NULL, NULL, NULL}, /* TS_RBI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBU_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RBL_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RDC_INIT */ + {NULL, tape34xx_rfo_init_done, NULL, NULL, NULL}, /* TS_RFO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_RSD_INIT */ + {NULL, tape34xx_rew_init_done, NULL, NULL, NULL}, /* TS_REW_INIT */ + {NULL, tape34xx_rew_release_init_done, NULL, NULL, NULL}, /* TS_REW_RELEASE_IMIT */ + {NULL, tape34xx_run_init_done, NULL, NULL, NULL}, /* TS_RUN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SEN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SID_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SNP_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SPG_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SWI_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SMR_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_SYN_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_TIO_INIT */ + {NULL, NULL, NULL, NULL, NULL}, /* TS_UNA_INIT */ + {NULL, tape34xx_wri_init_done, NULL, NULL, NULL}, /* TS_WRI_INIT */ + {NULL, tape34xx_wtm_init_done, NULL, NULL, NULL}, /* TS_WTM_INIT */ + {NULL, NULL, NULL, NULL, NULL}}; /* TS_NOT_OPER */ + + +int +tape34xx_ioctl_overload (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) +{ + return -EINVAL; // no additional ioctls + +} + +ccw_req_t * +tape34xx_write_block (const char *data, size_t count, tape_info_t * ti) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + void *mem; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xwbl nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + mem = kmalloc (count, GFP_KERNEL); + if (!mem) { + tape_free_request (cqr); +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xwbl nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + if (copy_from_user (mem, data, count)) { + kfree (mem); + tape_free_request (cqr); +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xwbl segf."); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + + ccw->cmd_code = WRITE_CMD; + ccw->flags = 0; + ccw->count = count; + set_normalized_cda (ccw, (unsigned long) mem); + if ((ccw->cda) == 0) { + kfree (mem); + tape_free_request (cqr); + return NULL; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = mem; + ti->userbuf = (void *) data; + tapestate_set (ti, TS_WRI_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xwbl ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +void +tape34xx_free_write_block (ccw_req_t * cqr, tape_info_t * ti) +{ + unsigned long lockflags; + ccw1_t *ccw; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ccw = cqr->cpaddr; + ccw++; + clear_normalized_cda (ccw); + kfree (ti->kernbuf); + tape_free_request (cqr); + ti->kernbuf = ti->userbuf = NULL; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xfwb free"); +#endif /* TAPE_DEBUG */ +} + +ccw_req_t * +tape34xx_read_block (const char *data, size_t count, tape_info_t * ti) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + void *mem; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xrbl nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + mem = kmalloc (count, GFP_KERNEL); + if (!mem) { + tape_free_request (cqr); +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xrbl nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + + ccw->cmd_code = READ_FORWARD; + ccw->flags = 0; + ccw->count = count; + set_normalized_cda (ccw, (unsigned long) mem); + if ((ccw->cda) == 0) { + kfree (mem); + tape_free_request (cqr); + return NULL; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = mem; + ti->userbuf = (void *) data; + tapestate_set (ti, TS_RFO_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xrbl ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +ccw_req_t * +tape34xx_read_opposite (tape_info_t * ti,int novalue) +{ + ccw_req_t *cqr; + ccw1_t *ccw; + size_t count; + // first, retrieve the count from the old cqr. + cqr = ti->cqr; + ccw = cqr->cpaddr; + ccw++; + count=ccw->count; + // free old cqr. + clear_normalized_cda (ccw); + tape_free_request (cqr); + // build new cqr + cqr = tape_alloc_ccw_req (ti, 3, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xrop nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + + ccw->cmd_code = READ_BACKWARD; + ccw->flags = CCW_FLAG_CC; + ccw->count = count; + set_normalized_cda (ccw, (unsigned long) ti->kernbuf); + if ((ccw->cda) == 0) { + tape_free_request (cqr); + return NULL; + } + ccw++; + ccw->cmd_code = FORSPACEBLOCK; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + ccw->cda = (unsigned long)ccw; + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 1; + ccw->cda = (unsigned long)ccw; + tapestate_set (ti, TS_RBA_INIT); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xrop ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +void +tape34xx_free_read_block (ccw_req_t * cqr, tape_info_t * ti) +{ + unsigned long lockflags; + size_t cpysize; + ccw1_t *ccw; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ccw = cqr->cpaddr; + ccw++; + cpysize = ccw->count - ti->devstat.rescnt; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if (copy_to_user (ti->userbuf, ti->kernbuf, cpysize)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfrb segf."); +#endif /* TAPE_DEBUG */ + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + clear_normalized_cda (ccw); + kfree (ti->kernbuf); + tape_free_request (cqr); + ti->kernbuf = ti->userbuf = NULL; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xfrb free"); +#endif /* TAPE_DEBUG */ +} + +/* + * The IOCTL interface is implemented in the following section, + * excepted the MTRESET, MTSETBLK which are handled by tapechar.c + */ +/* + * MTFSF: Forward space over 'count' file marks. The tape is positioned + * at the EOT (End of Tape) side of the file mark. + */ +ccw_req_t * +tape34xx_mtfsf (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsf parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsf nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = FORSPACEFILE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_FSF_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xfsf ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTBSF: Backward space over 'count' file marks. The tape is positioned at + * the EOT (End of Tape) side of the last skipped file mark. + */ +ccw_req_t * +tape34xx_mtbsf (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsf parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsf nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = BACKSPACEFILE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_BSF_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xbsf ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTFSR: Forward space over 'count' tape blocks (blocksize is set + * via MTSETBLK. + */ +ccw_req_t * +tape34xx_mtfsr (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsr parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsr nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = FORSPACEBLOCK; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_FSB_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xfsr ccwgen"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTBSR: Backward space over 'count' tape blocks. + * (blocksize is set via MTSETBLK. + */ +ccw_req_t * +tape34xx_mtbsr (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsr parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsr nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = BACKSPACEBLOCK; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_BSB_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xbsr ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTWEOF: Write 'count' file marks at the current position. + */ +ccw_req_t * +tape34xx_mtweof (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xweo parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xweo nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = WRITETAPEMARK; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_WTM_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xweo ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTREW: Rewind the tape. + */ +ccw_req_t * +tape34xx_mtrew (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 3, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xrew nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = REWIND; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_REW_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xrew ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTOFFL: Rewind the tape and put the drive off-line. + * Implement 'rewind unload' + */ +ccw_req_t * +tape34xx_mtoffl (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 3, 32); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xoff nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = REWIND_UNLOAD; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = SENSE; + ccw->flags = 0; + ccw->count = 32; + ccw->cda = (unsigned long) cqr->cpaddr; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_RUN_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xoff ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTNOP: 'No operation'. + */ +ccw_req_t * +tape34xx_mtnop (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 1, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xnop nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) ccw->cmd_code; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xnop ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTBSFM: Backward space over 'count' file marks. + * The tape is positioned at the BOT (Begin Of Tape) side of the + * last skipped file mark. + */ +ccw_req_t * +tape34xx_mtbsfm (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsm parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbsm nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = BACKSPACEFILE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_BSF_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xbsm ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTFSFM: Forward space over 'count' file marks. + * The tape is positioned at the BOT (Begin Of Tape) side + * of the last skipped file mark. + */ +ccw_req_t * +tape34xx_mtfsfm (tape_info_t * ti, int count) +{ + long lockflags; + int i; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count == 0) || (count > 510)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsm parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + cqr = tape_alloc_ccw_req (ti, 2 + count, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xfsm nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + for (i = 0; i < count; i++) { + ccw->cmd_code = FORSPACEFILE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + } + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_FSF_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xfsm ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTEOM: positions at the end of the portion of the tape already used + * for recordind data. MTEOM positions after the last file mark, ready for + * appending another file. + * MTRETEN: Retension the tape, i.e. forward space to end of tape and rewind. + */ +ccw_req_t * +tape34xx_mteom (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 4, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xeom nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = FORSPACEFILE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = CCW_CMD_TIC; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (cqr->cpaddr); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_FSF_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xeom ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTERASE: erases the tape. + */ +ccw_req_t * +tape34xx_mterase (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 5, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xera nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = REWIND; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = ERASE_GAP; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = DATA_SEC_ERASE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_DSE_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xera ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTSETDENSITY: set tape density. + */ +ccw_req_t * +tape34xx_mtsetdensity (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xden nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xden ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTSEEK: seek to the specified block. + */ +ccw_req_t * +tape34xx_mtseek (tape_info_t * ti, int count) +{ + long lockflags; + __u8 *data; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((data = kmalloc (4 * sizeof (__u8), GFP_KERNEL)) == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xsee nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + data[0] = 0x01; + data[1] = data[2] = data[3] = 0x00; + if (count >= 4194304) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xsee parm"); +#endif /* TAPE_DEBUG */ + kfree(data); + return NULL; + } + if (((tape34xx_disc_data_t *) ti->discdata)->modeset_byte & 0x08) // IDRC on + + data[1] = data[1] | 0x80; + data[3] += count % 256; + data[2] += (count / 256) % 256; + data[1] += (count / 65536); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xsee id:"); + debug_int_event (tape_debug_area,6,count); +#endif /* TAPE_DEBUG */ + cqr = tape_alloc_ccw_req (ti, 3, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xsee nomem"); +#endif /* TAPE_DEBUG */ + kfree (data); + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = LOCATE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 4; + set_normalized_cda (ccw, (unsigned long) data); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = data; + ti->userbuf = NULL; + tapestate_set (ti, TS_LBL_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xsee ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTTELL: Tell block. Return the number of block relative to current file. + */ +ccw_req_t * +tape34xx_mttell (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + void *mem; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xtel nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + mem = kmalloc (8, GFP_KERNEL); + if (!mem) { + tape_free_request (cqr); +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xtel nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + + ccw->cmd_code = READ_BLOCK_ID; + ccw->flags = 0; + ccw->count = 8; + set_normalized_cda (ccw, (unsigned long) mem); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = mem; + ti->userbuf = NULL; + tapestate_set (ti, TS_RBI_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xtel ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTSETDRVBUFFER: Set the tape drive buffer code to number. + * Implement NOP. + */ +ccw_req_t * +tape34xx_mtsetdrvbuffer (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xbuf nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xbuf ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTLOCK: Locks the tape drive door. + * Implement NOP CCW command. + */ +ccw_req_t * +tape34xx_mtlock (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xloc nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xloc ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTUNLOCK: Unlocks the tape drive door. + * Implement the NOP CCW command. + */ +ccw_req_t * +tape34xx_mtunlock (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xulk nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xulk ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTLOAD: Loads the tape. + * This function is not implemented and returns NULL, which causes the Frontend to wait for a medium being loaded. + * The 3480/3490 type Tapes do not support a load command + */ +ccw_req_t * +tape34xx_mtload (tape_info_t * ti, int count) +{ + return NULL; +} + +/* + * MTUNLOAD: Rewind the tape and unload it. + */ +ccw_req_t * +tape34xx_mtunload (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 3, 32); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xunl nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = REWIND_UNLOAD; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ccw++; + ccw->cmd_code = SENSE; + ccw->flags = 0; + ccw->count = 32; + ccw->cda = (unsigned long) cqr->cpaddr; + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_RUN_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xunl ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTCOMPRESSION: used to enable compression. + * Sets the IDRC on/off. + */ +ccw_req_t * +tape34xx_mtcompression (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + if ((count < 0) || (count > 1)) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xcom parm"); +#endif /* TAPE_DEBUG */ + return NULL; + } + if (count == 0) + ((tape34xx_disc_data_t *) ti->discdata)->modeset_byte = 0x00; // IDRC off + + else + ((tape34xx_disc_data_t *) ti->discdata)->modeset_byte = 0x08; // IDRC on + + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xcom nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xcom ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTSTPART: Move the tape head at the partition with the number 'count'. + * Implement the NOP CCW command. + */ +ccw_req_t * +tape34xx_mtsetpart (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xspa nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xspa ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTMKPART: .... dummy . + * Implement the NOP CCW command. + */ +ccw_req_t * +tape34xx_mtmkpart (tape_info_t * ti, int count) +{ + long lockflags; + ccw_req_t *cqr; + ccw1_t *ccw; + cqr = tape_alloc_ccw_req (ti, 2, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xnpa nomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = NULL; + ti->userbuf = NULL; + tapestate_set (ti, TS_NOP_INIT); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xnpa ccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} + +/* + * MTIOCGET: query the tape drive status. + */ +ccw_req_t * +tape34xx_mtiocget (tape_info_t * ti, int count) +{ + return NULL; +} + +/* + * MTIOCPOS: query the tape position. + */ +ccw_req_t * +tape34xx_mtiocpos (tape_info_t * ti, int count) +{ + return NULL; +} + +ccw_req_t * tape34xx_bread (struct request *req,tape_info_t* ti,int tapeblock_major) { + ccw_req_t *cqr; + ccw1_t *ccw; + __u8 *data; + int s2b = blksize_size[tapeblock_major][ti->blk_minor]/hardsect_size[tapeblock_major][ti->blk_minor]; + int realcount; + int size,bhct = 0; + struct buffer_head* bh; + for (bh = req->bh; bh; bh = bh->b_reqnext) { + if (bh->b_size > blksize_size[tapeblock_major][ti->blk_minor]) + for (size = 0; size < bh->b_size; size += blksize_size[tapeblock_major][ti->blk_minor]) + bhct++; + else + bhct++; + } + if ((data = kmalloc (4 * sizeof (__u8), GFP_ATOMIC)) == NULL) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,3,"xBREDnomem"); +#endif /* TAPE_DEBUG */ + return NULL; + } + data[0] = 0x01; + data[1] = data[2] = data[3] = 0x00; + realcount=req->sector/s2b; + if (((tape34xx_disc_data_t *) ti->discdata)->modeset_byte & 0x08) // IDRC on + + data[1] = data[1] | 0x80; + data[3] += realcount % 256; + data[2] += (realcount / 256) % 256; + data[1] += (realcount / 65536); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xBREDid:"); + debug_int_event (tape_debug_area,6,realcount); +#endif /* TAPE_DEBUG */ + cqr = tape_alloc_ccw_req (ti, 2+bhct+1, 0); + if (!cqr) { +#ifdef TAPE_DEBUG + debug_text_exception (tape_debug_area,6,"xBREDnomem"); +#endif /* TAPE_DEBUG */ + kfree(data); + return NULL; + } + ccw = cqr->cpaddr; + ccw->cmd_code = MODE_SET_DB; + ccw->flags = CCW_FLAG_CC; + ccw->count = 1; + set_normalized_cda (ccw, (unsigned long) (&(((tape34xx_disc_data_t *) ti->discdata)->modeset_byte))); + if (realcount!=ti->position) { + ccw++; + ccw->cmd_code = LOCATE; + ccw->flags = CCW_FLAG_CC; + ccw->count = 4; + set_normalized_cda (ccw, (unsigned long) data); + } + ti->position=realcount+req->nr_sectors/s2b; + for (bh=req->bh;bh!=NULL;) { + ccw->flags = CCW_FLAG_CC; + if (bh->b_size >= blksize_size[tapeblock_major][ti->blk_minor]) { + for (size = 0; size < bh->b_size; size += blksize_size[tapeblock_major][ti->blk_minor]) { + ccw++; + ccw->flags = CCW_FLAG_CC; + ccw->cmd_code = READ_FORWARD; + ccw->count = blksize_size[tapeblock_major][ti->blk_minor]; + set_normalized_cda (ccw, __pa (bh->b_data + size)); + } + bh = bh->b_reqnext; + } else { /* group N bhs to fit into byt_per_blk */ + for (size = 0; bh != NULL && size < blksize_size[tapeblock_major][ti->blk_minor];) { + ccw++; + ccw->flags = CCW_FLAG_DC; + ccw->cmd_code = READ_FORWARD; + ccw->count = bh->b_size; + set_normalized_cda (ccw, __pa (bh->b_data)); + size += bh->b_size; + bh = bh->b_reqnext; + } + if (size != blksize_size[tapeblock_major][ti->blk_minor]) { + PRINT_WARN ("Cannot fulfill small request %d vs. %d (%ld sects)\n", + size, + blksize_size[tapeblock_major][ti->blk_minor], + req->nr_sectors); + kfree(data); + tape_free_request (cqr); + return NULL; + } + } + } + ccw -> flags &= ~(CCW_FLAG_DC); + ccw -> flags |= (CCW_FLAG_CC); + ccw++; + ccw->cmd_code = NOP; + ccw->flags = 0; + ccw->count = 0; + ccw->cda = (unsigned long) (&(ccw->cmd_code)); + ti->kernbuf = data; + ti->userbuf = NULL; + tapestate_set (ti, TS_BLOCK_INIT); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xBREDccwg"); +#endif /* TAPE_DEBUG */ + return cqr; +} +void tape34xx_free_bread (ccw_req_t* cqr,struct _tape_info_t* ti) { + ccw1_t* ccw; + for (ccw=(ccw1_t*)cqr->cpaddr;(ccw->flags & CCW_FLAG_CC)||(ccw->flags & CCW_FLAG_DC);ccw++) + if ((ccw->cmd_code == MODE_SET_DB) || + (ccw->cmd_code == LOCATE) || + (ccw->cmd_code == READ_FORWARD)) + clear_normalized_cda(ccw); + tape_free_request(cqr); + kfree(ti->kernbuf); + ti->kernbuf=NULL; +} + +/* event handlers */ +void +tape34xx_default_handler (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xdefhandle"); +#endif /* TAPE_DEBUG */ + PRINT_ERR ("TAPE34XX: An unexpected Unit Check occurred.\n"); + PRINT_ERR ("TAPE34XX: Please read Documentation/s390/TAPE and report it!\n"); + PRINT_ERR ("TAPE34XX: Current state is: %s", + (((tapestate_get (ti) < TS_SIZE) && (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "->UNKNOWN STATE<-")); + tape_dump_sense (&ti->devstat); + ti->rc = -EIO; + ti->wanna_wakeup=1; + switch (tapestate_get(ti)) { + case TS_REW_RELEASE_INIT: + tapestate_set(ti,TS_FAILED); + wake_up (&ti->wq); + break; + case TS_BLOCK_INIT: + tapestate_set(ti,TS_FAILED); + schedule_tapeblock_exec_IO(ti); + break; + default: + tapestate_set(ti,TS_FAILED); + wake_up_interruptible (&ti->wq); + } +} + +void +tape34xx_unexpect_uchk_handler (tape_info_t * ti) +{ + if ((ti->devstat.ii.sense.data[0] == 0x40) && + (ti->devstat.ii.sense.data[1] == 0x40) && + (ti->devstat.ii.sense.data[3] == 0x43)) { + // no tape in the drive + PRINT_INFO ("Drive %d not ready. No volume loaded.\n", ti->rew_minor / 2); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xuuh nomed"); +#endif /* TAPE_DEBUG */ + tapestate_set (ti, TS_FAILED); + ti->rc = -ENOMEDIUM; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); + } else if ((ti->devstat.ii.sense.data[0] == 0x42) && + (ti->devstat.ii.sense.data[1] == 0x44) && + (ti->devstat.ii.sense.data[3] == 0x3b)) { + PRINT_INFO ("Media in drive %d was changed!\n", + ti->rew_minor / 2); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xuuh medchg"); +#endif + /* nothing to do. chan end & dev end will be reported when io is finished */ + } else { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xuuh unexp"); + debug_text_event (tape_debug_area,3,"state:"); + debug_text_event (tape_debug_area,3,((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : + "TS UNKNOWN"); +#endif /* TAPE_DEBUG */ + tape34xx_default_handler (ti); + } +} + +void +tape34xx_unused_done (tape_info_t * ti) +{ + if (ti->medium_is_unloaded) { + // A medium was inserted in the drive! +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xuui med"); +#endif /* TAPE_DEBUG */ + PRINT_WARN ("A medium was inserted into the tape.\n"); + ti->medium_is_unloaded=0; + } else { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"unsol.irq!"); + debug_text_event (tape_debug_area,3,"dev end"); + debug_int_exception (tape_debug_area,3,ti->devinfo.irq); +#endif /* TAPE_DEBUG */ + PRINT_WARN ("Unsolicited IRQ (Device End) caught in unused state.\n"); + tape_dump_sense (&ti->devstat); + } +} + + +void +tape34xx_idle_done (tape_info_t * ti) +{ + if (ti->medium_is_unloaded) { + // A medium was inserted in the drive! +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"xuud med"); +#endif /* TAPE_DEBUG */ + PRINT_WARN ("A medium was inserted into the tape.\n"); + ti->medium_is_unloaded=0; + wake_up_interruptible (&ti->wq); + } else { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"unsol.irq!"); + debug_text_event (tape_debug_area,3,"dev end"); + debug_int_exception (tape_debug_area,3,ti->devinfo.irq); +#endif /* TAPE_DEBUG */ + PRINT_WARN ("Unsolicited IRQ (Device End) caught in idle state.\n"); + tape_dump_sense (&ti->devstat); + } +} + +void +tape34xx_block_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"x:bREQdone"); +#endif /* TAPE_DEBUG */ + tapestate_set(ti,TS_DONE); + schedule_tapeblock_exec_IO(ti); +} + +void +tape34xx_bsf_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"bsf done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_dse_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"dse done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_fsf_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"fsf done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_fsb_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"fsb done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_bsb_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"bsb done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_lbl_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"lbl done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + //s390irq_spin_unlock(tape->devinfo.irq); + ti->wanna_wakeup=1; + wake_up (&ti->wq); +} + +void +tape34xx_nop_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"nop done.."); + debug_text_exception (tape_debug_area,6,"or rew/rel"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + //s390irq_spin_unlock(tape->devinfo.irq); + ti->wanna_wakeup=1; + wake_up (&ti->wq); +} + +void +tape34xx_rfo_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"rfo done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_rbi_init_done (tape_info_t * ti) +{ + __u8 *data; +#ifdef TAPE_DEBUG + int i; +#endif + tapestate_set (ti, TS_FAILED); + data = ti->kernbuf; + ti->rc = data[3]; + ti->rc += 256 * data[2]; + ti->rc += 65536 * (data[1] & 0x3F); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"rbi done"); + debug_text_event (tape_debug_area,6,"data:"); + for (i=0;i<8;i++) + debug_int_event (tape_debug_area,6,data[i]); +#endif + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_rew_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"rew done"); +#endif + //BH: use irqsave + //s390irq_spin_lock(tape->devinfo.irq); + tapestate_set (ti, TS_DONE); + ti->rc = 0; + //s390irq_spin_unlock(tape->devinfo.irq); + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_rew_release_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"rewR done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + //s390irq_spin_unlock(tape->devinfo.irq); + ti->wanna_wakeup=1; + wake_up (&ti->wq); +} + +void +tape34xx_run_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"rew done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_wri_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"wri done"); +#endif + //BH: use irqsave + //s390irq_spin_lock(ti->devinfo.irq); + tapestate_set (ti, TS_DONE); + ti->rc = 0; + //s390irq_spin_unlock(ti->devinfo.irq); + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +void +tape34xx_wtm_init_done (tape_info_t * ti) +{ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"wtm done"); +#endif + tapestate_set (ti, TS_DONE); + ti->rc = 0; + ti->wanna_wakeup=1; + wake_up_interruptible (&ti->wq); +} + +/* This function analyses the tape's sense-data in case of a unit-check. If possible, + it tries to recover from the error. Else the user is informed about the problem. */ +void +tape34xx_error_recovery (tape_info_t* ti) +{ + __u8* sense=ti->devstat.ii.sense.data; + int inhibit_cu_recovery=0; + int cu_type=ti->discipline->cu_type; + if ((((tape34xx_disc_data_t *) ti->discdata)->modeset_byte)&0x80) inhibit_cu_recovery=1; + if (tapestate_get(ti)==TS_BLOCK_INIT) { + // no recovery for block device, bottom half will retry... + tape34xx_error_recovery_has_failed(ti,EIO); + return; + } + if (sense[0]&SENSE_COMMAND_REJECT) + switch (tapestate_get(ti)) { + case TS_BLOCK_INIT: + case TS_DSE_INIT: + case TS_EGA_INIT: + case TS_WRI_INIT: + case TS_WTM_INIT: + if (sense[1]&SENSE_WRITE_PROTECT) { + // trying to write, but medium is write protected + tape34xx_error_recovery_has_failed(ti,EACCES); + return; + } + default: + tape34xx_error_recovery_HWBUG(ti,1); + return; + } + // special cases for various tape-states when reaching end of recorded area + if (((sense[0]==0x08) || (sense[0]==0x10) || (sense[0]==0x12)) && + ((sense[1]==0x40) || (sense[1]==0x0c))) + switch (tapestate_get(ti)) { + case TS_FSF_INIT: + // Trying to seek beyond end of recorded area + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case TS_LBL_INIT: + // Block could not be located. + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case TS_RFO_INIT: + // Try to read beyond end of recorded area -> 0 bytes read + tape34xx_error_recovery_has_failed(ti,0); + return; + } + // Sensing special bits + if (sense[0]&SENSE_BUS_OUT_CHECK) { + tape34xx_error_recovery_do_retry(ti); + return; + } + if (sense[0]&SENSE_DATA_CHECK) { + // hardware failure, damaged tape or improper operating conditions + switch (sense[3]) { + case 0x23: + // a read data check occurred + if ((sense[2]&SENSE_TAPE_SYNC_MODE) || + (inhibit_cu_recovery)) { + // data check is not permanent, may be recovered. + // We always use async-mode with cu-recovery, so this should *never* happen. + tape34xx_error_recovery_HWBUG(ti,2); + return; + } else { + // data check is permanent, CU recovery has failed + PRINT_WARN("Permanent read error, recovery failed!\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + } + case 0x25: + // a write data check occurred + if ((sense[2]&SENSE_TAPE_SYNC_MODE) || + (inhibit_cu_recovery)) { + // data check is not permanent, may be recovered. + // We always use async-mode with cu-recovery, so this should *never* happen. + tape34xx_error_recovery_HWBUG(ti,3); + return; + } else { + // data check is permanent, cu-recovery has failed + PRINT_WARN("Permanent write error, recovery failed!\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + } + case 0x26: + // Data Check (read opposite) occurred. We'll recover this. + tape34xx_error_recovery_read_opposite(ti); + return; + case 0x28: + // The ID-Mark at the beginning of the tape could not be written. This is fatal, we'll report and exit. + PRINT_WARN("ID-Mark could not be written. Check your hardware!\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x31: + // Tape void. Tried to read beyond end of device. We'll report and exit. + PRINT_WARN("Try to read beyond end of recorded area!\n"); + tape34xx_error_recovery_has_failed(ti,ENOSPC); + return; + case 0x41: + // Record sequence error. cu detected incorrect block-id sequence on tape. We'll report and exit. + PRINT_WARN("Illegal block-id sequence found!\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + default: + // well, all data checks for 3480 should result in one of the above erpa-codes. if not -> bug + // On 3490, other data-check conditions do exist. + if (cu_type==0x3480) { + tape34xx_error_recovery_HWBUG(ti,4); + return; + } + } + } + if (sense[0]&SENSE_OVERRUN) { + // A data overrun between cu and drive occurred. The channel speed is to slow! We'll report this and exit! + switch (sense[3]) { + case 0x40: // overrun error + PRINT_WARN ("Data overrun error between control-unit and drive. Use a faster channel connection, if possible! \n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + default: + // Overrun bit is set, but erpa does not show overrun error. This is a bug. + tape34xx_error_recovery_HWBUG(ti,5); + return; + } + } + if (sense[1]&SENSE_RECORD_SEQUENCE_ERR) { + switch (sense[3]) { + case 0x41: + // Record sequence error. cu detected incorrect block-id sequence on tape. We'll report and exit. + PRINT_WARN("Illegal block-id sequence found!\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + default: + // Record sequence error bit is set, but erpa does not show record sequence error. This is a bug. + tape34xx_error_recovery_HWBUG(ti,6); + return; + } + } + // Sensing erpa codes + switch (sense[3]) { + case 0x00: + // Everything is fine, but we got a unit check. Report and ignore! + PRINT_WARN ("Non-error sense was found. Unit-check will be ignored, expect errors...\n"); + return; + case 0x21: + // Data streaming not operational. Cu switches to interlock mode, we reissue the command. + PRINT_WARN ("Data streaming not operational. Switching to interlock-mode! \n"); + tape34xx_error_recovery_do_retry(ti); + return; + case 0x22: + // Path equipment check. Might be drive adapter error, buffer error on the lower interface, internal path not useable, or error during cartridge load. + // All of the above are not recoverable + PRINT_WARN ("A path equipment check occurred. One of the following conditions occurred:\n"); + PRINT_WARN ("drive adapter error,buffer error on the lower interface, internal path not useable, error during cartridge load.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x23: + // Read data check. Should have been be covered earlier -> Bug! + tape34xx_error_recovery_HWBUG(ti,7); + return; + case 0x24: + // Load display check. Load display was command was issued, but the drive is displaying a drive check message. Can be threated as "device end". + tape34xx_error_recovery_succeded(ti); + return; + case 0x25: + // Write data check. Should have been covered earlier -> Bug! + tape34xx_error_recovery_HWBUG(ti,8); + return; + case 0x26: + // Data check (read opposite). Should have been covered earlier -> Bug! + tape34xx_error_recovery_HWBUG(ti,9); + return; + case 0x27: + // Command reject. May indicate illegal channel program or buffer over/underrun. + // Since all channel programms are issued by this driver and ought be correct, + // we assume a over/underrun situaltion and retry the channel program. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x28: + // Write id mark check. Should have beed covered earlier -> bug! + tape34xx_error_recovery_HWBUG(ti,10); + return; + case 0x29: + // Function incompatible. Either idrc is on but hardware not capable doing idrc + // or a perform subsystem func is issued and the cu is not online. Anyway, this + // cannot be recovered and is an I/O error. + PRINT_WARN ("Function incompatible. Try to switch off idrc! \n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x2a: + // Unsolicited environmental data. An internal counter overflows, we can ignore + // this and reissue the cmd. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x2b: + // Environmental data present. Indicates either unload completed ok or read buffered + // log command completed ok. + if (tapestate_get(ti)==TS_RUN_INIT) { + // Rewind unload completed ok. + tape34xx_error_recovery_succeded(ti); + return; + } + // Since we do not issue read buffered log commands, this should never occur -> bug. + tape34xx_error_recovery_HWBUG(ti,11); + return; + case 0x2c: + // Permanent equipment check. cu has tried recovery, but did not succeed. This is an + // I/O error. + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x2d: + // Data security erase failure. + if (tapestate_get(ti)==TS_DSE_INIT) { + // report an I/O error + tape34xx_error_recovery_has_failed(ti,EIO); + return; + } + // Data security erase failure, but no such command issued. This is a bug. + tape34xx_error_recovery_HWBUG(ti,12); + return; + case 0x2e: + // Not capable. This indicates either that the drive fails reading the format id mark + // or that that format specified is not supported by the drive. We write a message and + // return an I/O error. + PRINT_WARN("Drive not capable processing the tape format!"); + tape34xx_error_recovery_has_failed(ti,EMEDIUMTYPE); + return; + case 0x2f: + // This erpa is reserved. This is a bug. + tape34xx_error_recovery_HWBUG(ti,13); + return; + case 0x30: + // The medium is write protected, while trying to write on it. We'll report this. + PRINT_WARN("Medium is write protected!\n"); + tape34xx_error_recovery_has_failed(ti,EACCES); + return; + case 0x31: + // Tape void. Should have beed covered ealier -> bug + tape34xx_error_recovery_HWBUG(ti,14); + return; + case 0x32: + // Tension loss. We cannot recover this, it's an I/O error. + PRINT_WARN("The drive lost tape tension.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x33: + // Load Failure. The catridge was not inserted correctly or the tape is not threaded + // correctly. We cannot recover this, the user has to reload the catridge. + PRINT_WARN("Cartridge load failure. Reload the cartridge and try again.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x34: + // Unload failure. The drive cannot maintain tape tension and control tape movement + // during an unload operation. + PRINT_WARN("Failure during cartridge unload. Please try manually.\n"); + if (tapestate_get(ti)!=TS_RUN_INIT) { + tape34xx_error_recovery_HWBUG(ti,15); + return; + } + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x35: + // Drive equipment check. One of the following: + // - cu cannot recover from a drive detected error + // - a check code message is displayed on drive message/load displays + // - the cartridge loader does not respond correctly + // - a failure occurs during an index, load, or unload cycle + PRINT_WARN("Equipment check! Please check the drive and the cartridge loader.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x36: + switch (cu_type) { + case 0x3480: + // This erpa is reserved for 3480 -> BUG + tape34xx_error_recovery_HWBUG(ti,16); + return; + case 0x3490: + // End of data. This is a permanent I/O error, which cannot be recovered. + // A read-type command has reached the end-of-data mark. + tape34xx_error_recovery_has_failed(ti,EIO); + return; + } + case 0x37: + // Tape length error. The tape is shorter than reported in the beginning-of-tape data. + PRINT_WARN("Tape length error.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x38: + // Physical end of tape. A read/write operation reached the physical end of tape. + if (tapestate_get(ti)==TS_WRI_INIT) { + tape34xx_error_recovery_has_failed(ti,ENOSPC); + } + return; + case 0x39: + // Backward at BOT. The drive is at BOT and is requestet to move backward. + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x3a: + // Drive switched not ready, but the command needs the drive to be ready. + PRINT_WARN("Drive not ready. Turn the ready/not ready switch to ready position and try again.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x3b: + // Manual rewind or unload. This causes an I/O error. + PRINT_WARN("Medium was rewound or unloaded manually. Expect errors! Please do only use the mtoffl and mtrew ioctl to unload tapes or rewind tapes.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + // These erpas are reserved -> BUG + tape34xx_error_recovery_HWBUG(ti,17); + return; + case 0x40: + // Overrun error. This should have been covered earlier -> bug. + tape34xx_error_recovery_HWBUG(ti,18); + return; + case 0x41: + // Record sequence error. This should have been covered earlier -> bug. + tape34xx_error_recovery_HWBUG(ti,19); + return; + case 0x42: + // Degraded mode. A condition that can cause degraded performace is detected. + PRINT_WARN("Subsystem is running in degraded mode. This may compromise your performace.\n"); + tape34xx_error_recovery_do_retry(ti); + return; + case 0x43: + // Drive not ready. Probably swith the ready/not ready switch to ready? + PRINT_WARN("The drive is not ready. Maybe no medium in?\n"); + tape34xx_error_recovery_has_failed(ti,ENOMEDIUM); + return; + case 0x44: + // Locate Block unsuccessfull. We'll report this. + if ((tapestate_get(ti)!=TS_BLOCK_INIT) && + (tapestate_get(ti)!=TS_LBL_INIT)) { + tape34xx_error_recovery_HWBUG(ti,20); // No locate block was issued... + return; + } + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x45: + // The drive is assigned elsewhere [to a different channel path/computer]. + PRINT_WARN("The drive is assigned elsewhere.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x46: + // Drive not online. Drive may be switched offline, the power supply may be switched off + // or the drive address may not be set correctly. + PRINT_WARN("The drive is not online."); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x47: + // Volume fenced. cu reports volume integrity is lost! + PRINT_WARN("Volume fenced. The volume integrity is lost! \n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x48: + // Log sense data and retry request. We'll do so... + tape34xx_error_recovery_do_retry(ti); + return; + case 0x49: + // Bus out check. A parity check error on the bus was found. PRINT_WARN("Bus out check. A data transfer over the bus was corrupted.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x4a: + // Control unit erp failed. We'll report this. + PRINT_WARN("The control unit failed recovering an I/O error.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x4b: + // Cu and drive incompatible. The drive requests micro-program patches, which are not available on the cu. + PRINT_WARN("The drive needs microprogram patches from the control unit, which are not available.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x4c: + // Recovered Check-One failure. Cu develops a hardware error, but is able to recover. We'll reissue the command. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x4d: + switch (cu_type) { + case 0x3480: + // This erpa is reserved for 3480 -> bug + tape34xx_error_recovery_HWBUG(ti,21); + return; + case 0x3490: + // Resetting event recieved. Since the driver does not support resetting event recovery + // (which has to be handled by the I/O Layer), we'll report and retry our command. + tape34xx_error_recovery_do_retry(ti); + return; + } + case 0x4e: + switch (cu_type) { + case 0x3480: + // This erpa is reserved for 3480 -> bug. + tape34xx_error_recovery_HWBUG(ti,22); + return; + case 0x3490: + // Maximum block size exeeded. This indicates, that the block to be written is larger + // than allowed for buffered mode. We'll report this... + PRINT_WARN("Maximum block size for buffered mode exceeded.\n"); + tape34xx_error_recovery_has_failed(ti,ENOBUFS); + return; + } + case 0x4f: + // These erpas are reserved -> bug + tape34xx_error_recovery_HWBUG(ti,23); + return; + case 0x50: + // Read buffered log (Overflow). Cu is running in extended beffered log mode, and a counter overflows. + // This should never happen, since we're never running in extended buffered log mode -> bug. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x51: + // Read buffered log (EOV). EOF processing occurs while the cu is in extended buffered log mode. + // This should never happen, since we're never running in extended buffered log mode -> bug. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x52: + // End of Volume complete. Rewind unload completed ok. We'll report to the user... + if (tapestate_get(ti)!=TS_RUN_INIT) { + tape34xx_error_recovery_HWBUG(ti,24); + return; + } + tape34xx_error_recovery_succeded(ti); + return; + case 0x53: + // Global command intercept. We'll have to reissue our command. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x54: + // Channel interface recovery (temporary). This can be recovered by reissuing the command. + tape34xx_error_recovery_do_retry(ti); + return; + case 0x55: + // Channel interface recovery (permanent). This cannot be recovered, we'll inform the user. + PRINT_WARN("A permanent channel interface error occurred.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x56: + // Channel protocol error. This cannot be recovered. + PRINT_WARN("A channel protocol error occurred.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x57: + switch (cu_type) { + case 0x3480: + // Attention intercept. We have to reissue the command. + PRINT_WARN("An attention intercept occurred, which will be recovered.\n"); + tape34xx_error_recovery_do_retry(ti); + return; + case 0x3490: + // Global status intercept. We have to reissue the command. + PRINT_WARN("An global status intercept was recieved, which will be recovered.\n"); + tape34xx_error_recovery_do_retry(ti); + return; + } + case 0x58: + case 0x59: + // These erpas are reserved -> bug. + tape34xx_error_recovery_HWBUG(ti,25); + return; + case 0x5a: + // Tape length incompatible. The tape inserted is too long, + // which could cause damage to the tape or the drive. + PRINT_WARN("Tape length incompatible [should be IBM Cartridge System Tape]. May cause damage to drive or tape.n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x5b: + // Format 3480 XF incompatible + if (sense[1]&SENSE_BEGINNING_OF_TAPE) { + // Everything is fine. The tape will be overwritten in a different format. + tape34xx_error_recovery_do_retry(ti); + return; + } + PRINT_WARN("Tape format is incompatible to the drive, which writes 3480-2 XF.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x5c: + // Format 3480-2 XF incompatible + PRINT_WARN("Tape format is incompatible to the drive. The drive cannot access 3480-2 XF volumes.\n"); + tape34xx_error_recovery_has_failed(ti,EIO); + return; + case 0x5d: + // Tape length violation. + PRINT_WARN("Tape length violation [should be IBM Enhanced Capacity Cartridge System Tape]. May cause damage to drive or tape.\n"); + tape34xx_error_recovery_has_failed(ti,EMEDIUMTYPE); + return; + case 0x5e: + // Compaction algorithm incompatible. + PRINT_WARN("The volume is recorded using an incompatible compaction algorith, which is not supported by the control unit.\n"); + tape34xx_error_recovery_has_failed(ti,EMEDIUMTYPE); + return; + default: + // Reserved erpas -> bug + tape34xx_error_recovery_HWBUG(ti,26); + return; + } +} + +void tape34xx_error_recovery_has_failed (tape_info_t* ti,int error_id) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xerp fail"); + debug_text_event (tape_debug_area,3,(((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "UNKNOWN")); +#endif + if ((tapestate_get(ti)!=TS_UNUSED) && (tapestate_get(ti)!=TS_IDLE)) { + tape_dump_sense(&ti->devstat); + ti->rc = -error_id; + ti->wanna_wakeup=1; + switch (tapestate_get(ti)) { + case TS_REW_RELEASE_INIT: + tapestate_set(ti,TS_FAILED); + wake_up (&ti->wq); + break; + case TS_BLOCK_INIT: + tapestate_set(ti,TS_FAILED); + schedule_tapeblock_exec_IO(ti); + break; + default: + tapestate_set(ti,TS_FAILED); + wake_up_interruptible (&ti->wq); + } + } else { + PRINT_WARN("Recieved an unsolicited IRQ.\n"); + tape_dump_sense(&ti->devstat); + } +} + +void tape34xx_error_recovery_succeded(tape_info_t* ti) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xerp done"); + debug_text_event (tape_debug_area,3,(((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "UNKNOWN")); +#endif + if ((tapestate_get(ti)!=TS_UNUSED) && (tapestate_get(ti)!=TS_DONE)) { + tapestate_event (ti, TE_DONE); + } else { + PRINT_WARN("Recieved an unsolicited IRQ.\n"); + tape_dump_sense(&ti->devstat); + } +} + +void tape34xx_error_recovery_do_retry(tape_info_t* ti) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"xerp retr"); + debug_text_event (tape_debug_area,3,(((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "UNKNOWN")); +#endif + if ((tapestate_get(ti)!=TS_UNUSED) && (tapestate_get(ti)!=TS_IDLE)) { + tape_dump_sense(&ti->devstat); + while (do_IO (ti->devinfo.irq, ti->cqr->cpaddr, (unsigned long) ti->cqr, 0x00, ti->cqr->options)); + } else { + PRINT_WARN("Recieved an unsolicited IRQ.\n"); + tape_dump_sense(&ti->devstat); + } +} + +void +tape34xx_error_recovery_read_opposite (tape_info_t* ti) { + switch (tapestate_get(ti)) { + case TS_RFO_INIT: + // We did read forward, but the data could not be read *correctly*. + // We will read backward and then skip forward again. + ti->cqr=tape34xx_read_opposite(ti,0); + if (ti->cqr==NULL) + tape34xx_error_recovery_has_failed(ti,EIO); + else + tape34xx_error_recovery_do_retry(ti); + break; + case TS_RBA_INIT: + // We tried to read forward and backward, but hat no success -> failed. + tape34xx_error_recovery_has_failed(ti,EIO); + break; + case TS_BLOCK_INIT: + tape34xx_error_recovery_do_retry(ti); + break; + default: + PRINT_WARN("read_opposite_recovery_called_with_state:%s\n", + (((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "UNKNOWN")); + } +} + +void +tape34xx_error_recovery_HWBUG (tape_info_t* ti,int condno) { + devstat_t* stat=&ti->devstat; + PRINT_WARN("An unexpected condition #%d was caught in tape error recovery.\n",condno); + PRINT_WARN("Please report this incident.\n"); + PRINT_WARN("State of the tape:%s\n", + (((tapestate_get (ti) < TS_SIZE) && + (tapestate_get (ti) >= 0)) ? + state_verbose[tapestate_get (ti)] : "UNKNOWN")); + PRINT_INFO ("Sense data: %02X%02X%02X%02X %02X%02X%02X%02X " + " %02X%02X%02X%02X %02X%02X%02X%02X \n", + stat->ii.sense.data[0], stat->ii.sense.data[1], + stat->ii.sense.data[2], stat->ii.sense.data[3], + stat->ii.sense.data[4], stat->ii.sense.data[5], + stat->ii.sense.data[6], stat->ii.sense.data[7], + stat->ii.sense.data[8], stat->ii.sense.data[9], + stat->ii.sense.data[10], stat->ii.sense.data[11], + stat->ii.sense.data[12], stat->ii.sense.data[13], + stat->ii.sense.data[14], stat->ii.sense.data[15]); + PRINT_INFO ("Sense data: %02X%02X%02X%02X %02X%02X%02X%02X " + " %02X%02X%02X%02X %02X%02X%02X%02X \n", + stat->ii.sense.data[16], stat->ii.sense.data[17], + stat->ii.sense.data[18], stat->ii.sense.data[19], + stat->ii.sense.data[20], stat->ii.sense.data[21], + stat->ii.sense.data[22], stat->ii.sense.data[23], + stat->ii.sense.data[24], stat->ii.sense.data[25], + stat->ii.sense.data[26], stat->ii.sense.data[27], + stat->ii.sense.data[28], stat->ii.sense.data[29], + stat->ii.sense.data[30], stat->ii.sense.data[31]); + tape34xx_error_recovery_has_failed(ti,EIO); +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tape34xx.h linux.20p9/drivers/s390/char/tape34xx.h --- linux.vanilla/drivers/s390/char/tape34xx.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tape34xx.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,183 @@ + +/*************************************************************************** + * + * drivers/s390/char/tape34xx.h + * common tape device discipline for 34xx tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + **************************************************************************** + */ + +#ifndef _TAPE34XX_H + +#define _TAPE34XX_H + +/* + * The CCW commands for the Tape type of command. + */ + +#define INVALID_00 0x00 /* Invalid cmd */ +#define BACKSPACEBLOCK 0x27 /* Back Space block */ +#define BACKSPACEFILE 0x2f /* Back Space file */ +#define DATA_SEC_ERASE 0x97 /* Data security erase */ +#define ERASE_GAP 0x17 /* Erase Gap */ +#define FORSPACEBLOCK 0x37 /* Forward space block */ +#define FORSPACEFILE 0x3F /* Forward Space file */ +#define FORCE_STREAM_CNT 0xEB /* Forced streaming count # */ +#define NOP 0x03 /* No operation */ +#define READ_FORWARD 0x02 /* Read forward */ +#define REWIND 0x07 /* Rewind */ +#define REWIND_UNLOAD 0x0F /* Rewind and Unload */ +#define SENSE 0x04 /* Sense */ +#define NEW_MODE_SET 0xEB /* Guess it is Mode set */ +#define WRITE_CMD 0x01 /* Write */ +#define WRITETAPEMARK 0x1F /* Write Tape Mark */ + +#define ASSIGN 0xB7 /* 3420 REJECT,3480 OK */ +#define CONTROL_ACCESS 0xE3 /* Set high speed */ +#define DIAG_MODE_SET 0x0B /* 3420 NOP, 3480 REJECT*/ +#define LOAD_DISPLAY 0x9F /* 3420 REJECT,3480 OK */ +#define LOCATE 0x4F /* 3420 REJ, 3480 NOP */ +#define LOOP_WRITE_TO_READ 0x8B /* 3480 REJECT */ +#define MODE_SET_DB 0xDB /* 3420 REJECT,3480 OK */ +#define MODE_SET_C3 0xC3 /* for 3420 */ +#define MODE_SET_CB 0xCB /* for 3420 */ +#define MODE_SET_D3 0xD3 /* for 3420 */ +#define READ_BACKWARD 0x0C /* */ +#define READ_BLOCK_ID 0x22 /* 3420 REJECT,3480 OK */ +#define READ_BUFFER 0x12 /* 3420 REJECT,3480 OK */ +#define READ_BUFF_LOG 0x24 /* 3420 REJECT,3480 OK */ +#define RELEASE 0xD4 /* 3420 NOP, 3480 REJECT*/ +#define REQ_TRK_IN_ERROR 0x1B /* 3420 NOP, 3480 REJECT*/ +#define RESERVE 0xF4 /* 3420 NOP, 3480 REJECT*/ +#define SENSE_GROUP_ID 0x34 /* 3420 REJECT,3480 OK */ +#define SENSE_ID 0xE4 /* 3420 REJECT,3480 OK */ +#define READ_DEV_CHAR 0x64 /* Read device characteristics */ +#define SET_DIAGNOSE 0x4B /* 3420 NOP, 3480 REJECT*/ +#define SET_GROUP_ID 0xAF /* 3420 REJECT,3480 OK */ +#define SET_TAPE_WRITE_IMMED 0xC3 /* for 3480 */ +#define SUSPEND 0x5B /* 3420 REJ, 3480 NOP */ +#define SYNC 0x43 /* Synchronize (flush buffer) */ +#define UNASSIGN 0xC7 /* 3420 REJECT,3480 OK */ +#define PERF_SUBSYS_FUNC 0x77 /* 3490 CMD */ +#define READ_CONFIG_DATA 0xFA /* 3490 CMD */ +#define READ_MESSAGE_ID 0x4E /* 3490 CMD */ +#define READ_SUBSYS_DATA 0x3E /* 3490 CMD */ +#define SET_INTERFACE_ID 0x73 /* 3490 CMD */ + +#ifndef MIN +#define MIN(a,b) ( (a) < (b) ? (a) : (b) ) +#endif + + +#define BLOCKSIZE 4096 /* size of the tape rcds */ + +#define COMMAND_CHAIN CCW_FLAG_CC /* redefine from irq.h */ +#define CHANNEL_END DEV_STAT_CHN_END /* redefine from irq.h */ +#define DEVICE_END DEV_STAT_DEV_END /* redefine from irq.h */ +#define UNIT_CHECK DEV_STAT_UNIT_CHECK /* redefine from irq.h */ +#define UNIT_EXCEPTION DEV_STAT_UNIT_EXCEP /* redefine from irq.h */ +#define CONTROL_UNIT_END DEV_STAT_CU_END /* redefine from irq.h */ +#define INCORR_LEN SCHN_STAT_INCORR_LEN /* redefine from irq.h */ + +#define SENSE_COMMAND_REJECT 0x80 +#define SENSE_INTERVENTION_REQUIRED 0x40 +#define SENSE_BUS_OUT_CHECK 0x20 +#define SENSE_EQUIPMENT_CHECK 0x10 +#define SENSE_DATA_CHECK 0x08 +#define SENSE_OVERRUN 0x04 +#define SENSE_DEFERRED_UNIT_CHECK 0x02 +#define SENSE_ASSIGNED_ELSEWHERE 0x01 + +#define SENSE_LOCATE_FAILURE 0x80 +#define SENSE_DRIVE_ONLINE 0x40 +#define SENSE_RESERVED 0x20 +#define SENSE_RECORD_SEQUENCE_ERR 0x10 +#define SENSE_BEGINNING_OF_TAPE 0x08 +#define SENSE_WRITE_MODE 0x04 +#define SENSE_WRITE_PROTECT 0x02 +#define SENSE_NOT_CAPABLE 0x01 + +#define SENSE_CHANNEL_ADAPTER_CODE 0xE0 +#define SENSE_CHANNEL_ADAPTER_LOC 0x10 +#define SENSE_REPORTING_CU 0x08 +#define SENSE_AUTOMATIC_LOADER 0x04 +#define SENSE_TAPE_SYNC_MODE 0x02 +#define SENSE_TAPE_POSITIONING 0x01 + +typedef struct _tape34xx_disc_data_t { + __u8 modeset_byte; +} tape34xx_disc_data_t __attribute__ ((packed, aligned(8))); + +/* discipline functions */ +int tape34xx_ioctl_overload (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); +ccw_req_t * tape34xx_write_block (const char *data, size_t count, tape_info_t * ti); +void tape34xx_free_write_block (ccw_req_t * cqr, tape_info_t * ti); +ccw_req_t * tape34xx_read_block (const char *data, size_t count, tape_info_t * ti); +void tape34xx_free_read_block (ccw_req_t * cqr, tape_info_t * ti); +void tape34xx_clear_read_block (ccw_req_t * cqr, tape_info_t * ti); +ccw_req_t * tape34xx_mtfsf (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtbsf (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtfsr (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtbsr (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtweof (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtrew (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtoffl (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtnop (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtbsfm (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtfsfm (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mteom (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mterase (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtsetdensity (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtseek (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mttell (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtsetdrvbuffer (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtlock (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtunlock (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtload (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtunload (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtcompression (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtsetpart (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtmkpart (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtiocget (tape_info_t * ti, int count); +ccw_req_t * tape34xx_mtiocpos (tape_info_t * ti, int count); +ccw_req_t * tape34xx_bread (struct request *req, tape_info_t* ti,int tapeblock_major); +ccw_req_t * tape34xx_bwrite (struct request *req, tape_info_t* ti,int tapeblock_major); +void tape34xx_free_bread (ccw_req_t*,struct _tape_info_t*); +void tape34xx_free_bwrite (ccw_req_t*,struct _tape_info_t*); + +/* Event handlers */ +void tape34xx_default_handler (tape_info_t * ti); +void tape34xx_unexpect_uchk_handler (tape_info_t * ti); +void tape34xx_unused_done(tape_info_t* ti); +void tape34xx_idle_done(tape_info_t* ti); +void tape34xx_block_done(tape_info_t* ti); +void tape34xx_bsf_init_done(tape_info_t* ti); +void tape34xx_dse_init_done(tape_info_t* ti); +void tape34xx_fsf_init_done(tape_info_t* ti); +void tape34xx_bsb_init_done(tape_info_t* ti); +void tape34xx_fsb_init_done(tape_info_t* ti); +void tape34xx_lbl_init_done(tape_info_t* ti); +void tape34xx_nop_init_done(tape_info_t* ti); +void tape34xx_rfo_init_done(tape_info_t* ti); +void tape34xx_rbi_init_done(tape_info_t* ti); +void tape34xx_rew_init_done(tape_info_t* ti); +void tape34xx_rew_release_init_done(tape_info_t* ti); +void tape34xx_run_init_done(tape_info_t* ti); +void tape34xx_wri_init_done(tape_info_t* ti); +void tape34xx_wtm_init_done(tape_info_t* ti); + +extern void schedule_tapeblock_exec_IO (tape_info_t *ti); + +// the error recovery stuff: +void tape34xx_error_recovery (tape_info_t* ti); +void tape34xx_error_recovery_has_failed (tape_info_t* ti,int error_id); +void tape34xx_error_recovery_succeded(tape_info_t* ti); +void tape34xx_error_recovery_do_retry(tape_info_t* ti); +void tape34xx_error_recovery_read_opposite (tape_info_t* ti); +void tape34xx_error_recovery_HWBUG (tape_info_t* ti,int condno); +#endif // _TAPE34XX_H diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tapeblock.c linux.20p9/drivers/s390/char/tapeblock.c --- linux.vanilla/drivers/s390/char/tapeblock.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tapeblock.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,598 @@ + +/*************************************************************************** + * + * drivers/s390/char/tapeblock.c + * block device frontend for tape device driver + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + * + **************************************************************************** + */ + +#include "tapedefs.h" +#include +#include +#include +#include +#include +#include /* CCW allocations */ +#include +#include +#include +#ifdef MODULE +#define __NO_VERSION__ +#include +#endif +#include "tape.h" +#include "tapeblock.h" + +#define PRINTK_HEADER "TBLOCK:" + +/* + * file operation structure for tape devices + */ +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) +static struct block_device_operations tapeblock_fops = { +#else +static struct file_operations tapeblock_fops = { +#endif + open : tapeblock_open, /* open */ + release : tapeblock_release, /* release */ + }; + +int tapeblock_major = 0; + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) +static void tape_request_fn (request_queue_t * queue); +#else +static void tape_request_fn (void); +#endif + +static request_queue_t* tapeblock_getqueue (kdev_t kdev); + +#ifdef CONFIG_DEVFS_FS +void +tapeblock_mkdevfstree (tape_info_t* ti) { + ti->devfs_block_dir=devfs_mk_dir (ti->devfs_dir, "block", ti); + ti->devfs_disc=devfs_register(ti->devfs_block_dir, "disc",DEVFS_FL_DEFAULT, + tapeblock_major, ti->blk_minor, + TAPEBLOCK_DEFAULTMODE, &tapeblock_fops, ti); +} + +void +tapeblock_rmdevfstree (tape_info_t* ti) { + devfs_unregister(ti->devfs_disc); + devfs_unregister(ti->devfs_block_dir); +} +#endif + +void +tapeblock_setup(tape_info_t* ti) { + blk_size[tapeblock_major][ti->blk_minor]=0; // this will be detected + blksize_size[tapeblock_major][ti->blk_minor]=2048; // blocks are 2k by default. + hardsect_size[tapeblock_major][ti->blk_minor]=512; + blk_init_queue (&ti->request_queue, tape_request_fn); + blk_queue_headactive (&ti->request_queue, 0); +#ifdef CONFIG_DEVFS_FS + tapeblock_mkdevfstree(ti); +#endif +} + +int +tapeblock_init(void) { + int result; + tape_frontend_t* blkfront,*temp; + tape_info_t* ti; + + tape_init(); + /* Register the tape major number to the kernel */ +#ifdef CONFIG_DEVFS_FS + result = devfs_register_blkdev(tapeblock_major, "tBLK", &tapeblock_fops); +#else + result = register_blkdev(tapeblock_major, "tBLK", &tapeblock_fops); +#endif + if (result < 0) { + PRINT_WARN(KERN_ERR "tape: can't get major %d for block device\n", tapeblock_major); + panic ("cannot get major number for tape block device"); + } + if (tapeblock_major == 0) tapeblock_major = result; /* accept dynamic major number*/ + INIT_BLK_DEV(tapeblock_major,tape_request_fn,tapeblock_getqueue,NULL); + read_ahead[tapeblock_major]=TAPEBLOCK_READAHEAD; + PRINT_WARN(KERN_ERR " tape gets major %d for block device\n", result); + blk_size[tapeblock_major] = (int*) kmalloc (256*sizeof(int),GFP_ATOMIC); + memset(blk_size[tapeblock_major],0,256*sizeof(int)); + blksize_size[tapeblock_major] = (int*) kmalloc (256*sizeof(int),GFP_ATOMIC); + memset(blksize_size[tapeblock_major],0,256*sizeof(int)); + hardsect_size[tapeblock_major] = (int*) kmalloc (256*sizeof(int),GFP_ATOMIC); + memset(hardsect_size[tapeblock_major],0,256*sizeof(int)); + max_sectors[tapeblock_major] = (int*) kmalloc (256*sizeof(int),GFP_ATOMIC); + memset(max_sectors[tapeblock_major],0,256*sizeof(int)); + blkfront = kmalloc(sizeof(tape_frontend_t),GFP_KERNEL); + if (blkfront==NULL) panic ("no mem for tape block device structure"); + blkfront->device_setup=tapeblock_setup; +#ifdef CONFIG_DEVFS_FS + blkfront->mkdevfstree = tapeblock_mkdevfstree; + blkfront->rmdevfstree = tapeblock_rmdevfstree; +#endif + blkfront->next=NULL; + if (first_frontend==NULL) { + first_frontend=blkfront; + } else { + temp=first_frontend; + while (temp->next!=NULL) + temp=temp->next; + temp->next=blkfront; + } + ti=first_tape_info; + while (ti!=NULL) { + tapeblock_setup(ti); + ti=ti->next; + } + return 0; +} + + +void +tapeblock_uninit(void) { + unregister_blkdev(tapeblock_major, "tBLK"); +} + +int +tapeblock_open(struct inode *inode, struct file *filp) { + tape_info_t *ti; + kdev_t dev; + int rc; + long lockflags; + + inode = filp->f_dentry->d_inode; + ti = first_tape_info; + while ((ti != NULL) && (ti->blk_minor != MINOR (inode->i_rdev))) + ti = (tape_info_t *) ti->next; + if (ti == NULL) + return -ENODEV; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:open:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) != TS_UNUSED) { + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:dbusy"); +#endif + return -EBUSY; + } + tapestate_set (ti, TS_IDLE); + ti->position=-1; + + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + rc=tapeblock_mediumdetect(ti); + if (rc) { + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_UNUSED); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return rc; // in case of errors, we don't have a size of the medium + } + dev = MKDEV (tapeblock_major, MINOR (inode->i_rdev)); /* Get the device */ + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->blk_filp = filp; + filp->private_data = ti; /* save the dev.info for later reference */ + ti->cqr=NULL; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif /* MODULE */ + return 0; +} + +int +tapeblock_release(struct inode *inode, struct file *filp) { + long lockflags; + tape_info_t *ti,*lastti; + ti = first_tape_info; + while ((ti != NULL) && (ti->blk_minor != MINOR (inode->i_rdev))) + ti = (tape_info_t *) ti->next; + if ((ti != NULL) && (tapestate_get (ti) == TS_NOT_OPER)) { + if (ti==first_tape_info) { + first_tape_info=ti->next; + } else { + lastti=first_tape_info; + while (lastti->next!=ti) lastti=lastti->next; + lastti->next=ti->next; + } + kfree(ti); + return 0; + } + if ((ti == NULL) || (tapestate_get (ti) != TS_IDLE)) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:notidle!"); +#endif + return -ENXIO; /* error in tape_release */ + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:release:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_UNUSED); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif /* MODULE */ + invalidate_buffers(inode->i_rdev); + return 0; +} + +static void +tapeblock_end_request(tape_info_t* ti) { + struct buffer_head *bh; + int uptodate; + if ((tapestate_get(ti)!=TS_FAILED) && + (tapestate_get(ti)!=TS_DONE)) + BUG(); // A request has to be completed to end it + uptodate=(tapestate_get(ti)==TS_DONE); // is the buffer up to date? +#ifdef TAPE_DEBUG + if (uptodate) { + debug_text_event (tape_debug_area,6,"b:done:"); + debug_int_event (tape_debug_area,6,(long)ti->cqr); + } else { + debug_text_event (tape_debug_area,3,"b:failed:"); + debug_int_event (tape_debug_area,3,(long)ti->cqr); + } +#endif + // now inform ll_rw_block about a request status + while ((bh = ti->current_request->bh) != NULL) { + ti->current_request->bh = bh->b_reqnext; + bh->b_reqnext = NULL; + bh->b_end_io (bh, uptodate); + } + if (!end_that_request_first (ti->current_request, uptodate, "tBLK")) { +#ifndef DEVICE_NO_RANDOM + add_blkdev_randomness (MAJOR (ti->current_request->rq_dev)); +#endif + end_that_request_last (ti->current_request); + } + ti->discipline->free_bread(ti->cqr,ti); + ti->cqr=NULL; + ti->current_request=NULL; + if (tapestate_get(ti)!=TS_NOT_OPER) tapestate_set(ti,TS_IDLE); + return; +} + +static void +tapeblock_exec_IO (tape_info_t* ti) { + int rc; + struct request* req; + if (ti->cqr) { // process done/failed request + while ((tapestate_get(ti)==TS_FAILED) && + ti->blk_retries>0) { + ti->blk_retries--; + ti->position=-1; + tapestate_set(ti,TS_BLOCK_INIT); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:retryreq:"); + debug_int_event (tape_debug_area,3,(long)ti->cqr); +#endif + rc = do_IO (ti->devinfo.irq, ti->cqr->cpaddr, (unsigned long) ti->cqr, + 0x00, ti->cqr->options); + if (rc) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:doIOfail:"); + debug_int_event (tape_debug_area,3,(long)ti->cqr); +#endif + continue; // one retry lost 'cause doIO failed + } + return; + } + tapeblock_end_request (ti); // check state, inform user, free mem, dev=idl + } + if (ti->cqr!=NULL) BUG(); // tape should be idle now, request should be freed! + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + return; + } +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) + if (list_empty (&ti->request_queue.queue_head)) { +#else + if (ti->request_queue==NULL) { +#endif + // nothing more to do or device has dissapeared;) +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:Qempty"); +#endif + tapestate_set(ti,TS_IDLE); + return; + } + // queue is not empty, fetch a request and start IO! + req=ti->current_request=tape_next_request(&ti->request_queue); + if (req==NULL) { + BUG(); // Yo. The queue was not reported empy, but no request found. This is _bad_. + } + if (req->cmd!=READ) { // we only support reading + tapestate_set(ti,TS_FAILED); + tapeblock_end_request (ti); // check state, inform user, free mem, dev=idl + tapestate_set(ti,TS_BLOCK_INIT); + schedule_tapeblock_exec_IO(ti); + return; + } + ti->cqr=ti->discipline->bread(req,ti,tapeblock_major); //build channel program from request + if (!ti->cqr) { + // ccw generation failed. we try again later. +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:cqrNULL"); +#endif + schedule_tapeblock_exec_IO(ti); + ti->current_request=NULL; + return; + } + ti->blk_retries = TAPEBLOCK_RETRIES; + rc= do_IO (ti->devinfo.irq, ti->cqr->cpaddr, + (unsigned long) ti->cqr, 0x00, ti->cqr->options); + if (rc) { + // okay. ssch failed. we try later. +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:doIOfail"); +#endif + ti->discipline->free_bread(ti->cqr,ti); + ti->cqr=NULL; + ti->current_request=NULL; + schedule_tapeblock_exec_IO(ti); + return; + } + // our request is in IO. we remove it from the queue and exit + tape_dequeue_request (&ti->request_queue,req); +} + +static void +do_tape_request (request_queue_t * queue) { + tape_info_t* ti; + long lockflags; + for (ti=first_tape_info; + ((ti!=NULL) && ((&ti->request_queue)!=queue)); + ti=ti->next); + if (ti==NULL) BUG(); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get(ti)!=TS_IDLE) { + s390irq_spin_unlock_irqrestore(ti->devinfo.irq,lockflags); + return; + } + if (tapestate_get(ti)!=TS_IDLE) BUG(); + tapestate_set(ti,TS_BLOCK_INIT); + tapeblock_exec_IO(ti); + s390irq_spin_unlock_irqrestore(ti->devinfo.irq,lockflags); +} + +static void +run_tapeblock_exec_IO (tape_info_t* ti) { + long flags_390irq,flags_ior; + spin_lock_irqsave (&io_request_lock, flags_ior); + s390irq_spin_lock_irqsave(ti->devinfo.irq,flags_390irq); + atomic_set(&ti->bh_scheduled,0); + tapeblock_exec_IO(ti); + s390irq_spin_unlock_irqrestore(ti->devinfo.irq,flags_390irq); + spin_unlock_irqrestore (&io_request_lock, flags_ior); +} + +void +schedule_tapeblock_exec_IO (tape_info_t *ti) +{ + /* Protect against rescheduling, when already running */ + if (atomic_compare_and_swap(0,1,&ti->bh_scheduled)) { + return; + } +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) + INIT_LIST_HEAD(&ti->bh_tq.list); +#endif + ti->bh_tq.sync = 0; + ti->bh_tq.routine = (void *) (void *) run_tapeblock_exec_IO; + ti->bh_tq.data = ti; + + queue_task (&ti->bh_tq, &tq_immediate); + mark_bh (IMMEDIATE_BH); + return; +} + +/* wrappers around do_tape_request for different kernel versions */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,98)) +static void tape_request_fn (void) { + tape_info_t* ti=first_tape_info; + while (ti!=NULL) { + do_tape_request(&ti->request_queue); + ti=ti->next; + } +} +#else +static void tape_request_fn (request_queue_t* queue) { + do_tape_request(queue); +} +#endif + +static request_queue_t* tapeblock_getqueue (kdev_t kdev) { + tape_info_t* ti=first_tape_info; + while ((ti!=NULL) && (MINOR(kdev)!=ti->blk_minor)) + ti=ti->next; + if (ti!=NULL) return &ti->request_queue; + return NULL; +} + +int tapeblock_mediumdetect(tape_info_t* ti) { + ccw_req_t* cqr; + int losize=1,hisize=1,rc; + long lockflags; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"b:medDet"); +#endif + PRINT_WARN("Detecting media size. This will take _long_, so get yourself a coffee...\n"); + while (1) { //is interruped by break + hisize=hisize << 1; // try twice the size tested before + cqr=ti->discipline->mtseek (ti, hisize); + if (cqr == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:ccwg fail"); +#endif + return -ENOSPC; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if (rc) return -EIO; + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + tape_free_request (cqr); + if (ti->kernbuf) { + kfree (ti->kernbuf); + ti->kernbuf=NULL; + } + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + break; + } + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + losize=hisize; + } + cqr = ti->discipline->mtrew (ti, 1); + if (cqr == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:ccwg fail"); +#endif + return -ENOSPC; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + tape_free_request (cqr); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + while (losize!=hisize) { + cqr=ti->discipline->mtseek (ti, (hisize+losize)/2+1); + if (cqr == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:ccwg fail"); +#endif + return -ENOSPC; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if (rc) return -EIO; + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + tape_free_request (cqr); + if (ti->kernbuf) { + kfree (ti->kernbuf); + ti->kernbuf=NULL; + } + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + hisize=(hisize+losize)/2; + cqr = ti->discipline->mtrew (ti, 1); + if (cqr == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"b:ccwg fail"); +#endif + return -ENOSPC; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + tape_free_request (cqr); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + continue; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + losize=(hisize+losize)/2+1; + } + blk_size[tapeblock_major][ti->blk_minor]=(losize)*(blksize_size[tapeblock_major][ti->blk_minor]/1024); + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tapeblock.h linux.20p9/drivers/s390/char/tapeblock.h --- linux.vanilla/drivers/s390/char/tapeblock.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tapeblock.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,36 @@ + +/*************************************************************************** + * + * drivers/s390/char/tapechar.h + * character device frontend for tape device driver + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + * + **************************************************************************** + */ + +#ifndef TAPEBLOCK_H +#define TAPEBLOCK_H +#include +#define PARTN_BITS 0 + +#define TAPEBLOCK_READAHEAD 30 +#define TAPEBLOCK_MAJOR 0 + +#define TAPEBLOCK_DEFAULTMODE 0060644 + +int tapeblock_open(struct inode *, struct file *); +int tapeblock_release(struct inode *, struct file *); +void tapeblock_setup(tape_info_t* ti); +void schedule_tapeblock_exec_IO (tape_info_t *ti); +int tapeblock_mediumdetect(tape_info_t* ti); +#ifdef CONFIG_DEVFS_FS +void tapeblock_mkdevfstree (tape_info_t* ti); +#endif +int tapeblock_init (void); +void tapeblock_uninit (void); +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tapechar.c linux.20p9/drivers/s390/char/tapechar.c --- linux.vanilla/drivers/s390/char/tapechar.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tapechar.c Wed Aug 8 22:14:09 2001 @@ -0,0 +1,761 @@ + +/*************************************************************************** + * + * drivers/s390/char/tapechar.c + * character device frontend for tape device driver + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + * + **************************************************************************** + */ + +#include "tapedefs.h" +#include +#include +#include +#include +#include /* CCW allocations */ +#include +#include +#include +#include +#include +#ifdef MODULE +#define __NO_VERSION__ +#include +#endif +#include "tape.h" +#include "tapechar.h" + +#define PRINTK_HEADER "TCHAR:" + +/* + * file operation structure for tape devices + */ +static struct file_operations tape_fops = +{ + // owner : THIS_MODULE, + llseek:NULL, /* lseek - default */ + read:tape_read, /* read */ + write:tape_write, /* write */ + readdir:NULL, /* readdir - bad */ + poll:NULL, /* poll */ + ioctl:tape_ioctl, /* ioctl */ + mmap:NULL, /* mmap */ + open:tape_open, /* open */ + flush:NULL, /* flush */ + release:tape_release, /* release */ + fsync:NULL, /* fsync */ + fasync:NULL, /* fasync */ + lock:NULL, +}; + +int tape_major = TAPE_MAJOR; + +#ifdef CONFIG_DEVFS_FS +void +tapechar_mkdevfstree (tape_info_t* ti) { + ti->devfs_char_dir=devfs_mk_dir (ti->devfs_dir, "char", ti); + ti->devfs_nonrewinding=devfs_register(ti->devfs_char_dir, "nonrewinding", + DEVFS_FL_DEFAULT,tape_major, + ti->nor_minor, TAPECHAR_DEFAULTMODE, + &tape_fops, ti); + ti->devfs_rewinding=devfs_register(ti->devfs_char_dir, "rewinding", + DEVFS_FL_DEFAULT, tape_major, ti->rew_minor, + TAPECHAR_DEFAULTMODE, &tape_fops, ti); +} + +void +tapechar_rmdevfstree (tape_info_t* ti) { + devfs_unregister(ti->devfs_nonrewinding); + devfs_unregister(ti->devfs_rewinding); + devfs_unregister(ti->devfs_char_dir); +} +#endif + +void +tapechar_setup (tape_info_t * ti) +{ +#ifdef CONFIG_DEVFS_FS + tapechar_mkdevfstree(ti); +#endif +} + +void +tapechar_init (void) +{ + int result; + tape_frontend_t *charfront,*temp; + tape_info_t* ti; + + tape_init(); + + /* Register the tape major number to the kernel */ +#ifdef CONFIG_DEVFS_FS + result = devfs_register_chrdev (tape_major, "tape", &tape_fops); +#else + result = register_chrdev (tape_major, "tape", &tape_fops); +#endif + + if (result < 0) { + PRINT_WARN (KERN_ERR "tape: can't get major %d\n", tape_major); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"c:initfail"); + debug_text_event (tape_debug_area,3,"regchrfail"); +#endif /* TAPE_DEBUG */ + panic ("no major number available for tape char device"); + } + if (tape_major == 0) + tape_major = result; /* accept dynamic major number */ + PRINT_WARN (KERN_ERR " tape gets major %d for character device\n", result); + charfront = kmalloc (sizeof (tape_frontend_t), GFP_KERNEL); + if (charfront == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"c:initfail"); + debug_text_event (tape_debug_area,3,"no mem"); +#endif /* TAPE_DEBUG */ + panic ("no major number available for tape char device"); + } + charfront->device_setup = tapechar_setup; +#ifdef CONFIG_DEVFS_FS + charfront->mkdevfstree = tapechar_mkdevfstree; + charfront->rmdevfstree = tapechar_rmdevfstree; +#endif +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"c:init ok"); +#endif /* TAPE_DEBUG */ + charfront->next=NULL; + if (first_frontend==NULL) { + first_frontend=charfront; + } else { + temp=first_frontend; + while (temp->next!=NULL) + temp=temp->next; + temp->next=charfront; + } + ti=first_tape_info; + while (ti!=NULL) { + tapechar_setup(ti); + ti=ti->next; + } +} + +void +tapechar_uninit (void) +{ + unregister_chrdev (tape_major, "tape"); +} + +/* + * Tape device read function + */ +ssize_t +tape_read (struct file *filp, char *data, size_t count, loff_t * ppos) +{ + long lockflags; + tape_info_t *ti; + size_t block_size; + ccw_req_t *cqr; + int rc; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:read"); +#endif /* TAPE_DEBUG */ + ti = first_tape_info; + while ((ti != NULL) && (ti->rew_filp != filp) && (ti->nor_filp != filp)) + ti = (tape_info_t *) ti->next; + if (ti == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:nodev"); +#endif /* TAPE_DEBUG */ + return -ENODEV; + } + if (ppos != &filp->f_pos) { + /* "A request was outside the capabilities of the device." */ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:ppos wrong"); +#endif /* TAPE_DEBUG */ + return -EOVERFLOW; /* errno=75 Value too large for def. data type */ + } + if (ti->block_size == 0) { + block_size = count; + } else { + block_size = ti->block_size; + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:nbytes:"); + debug_int_event (tape_debug_area,6,block_size); +#endif + cqr = ti->discipline->read_block (data, block_size, ti); + if (!cqr) { + return -ENOBUFS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + if (rc) { + tapestate_set(ti,TS_IDLE); + kfree (cqr); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return rc; + } + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + ti->discipline->free_read_block (cqr, ti); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return ti->rc; + } + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:rbytes:"); + debug_int_event (tape_debug_area,6,block_size - ti->devstat.rescnt); +#endif /* TAPE_DEBUG */ + filp->f_pos += block_size - ti->devstat.rescnt; + return block_size - ti->devstat.rescnt; +} + +/* + * Tape device write function + */ +ssize_t +tape_write (struct file *filp, const char *data, size_t count, loff_t * ppos) +{ + long lockflags; + tape_info_t *ti; + size_t block_size; + ccw_req_t *cqr; + int nblocks, i, rc; + size_t written = 0; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:write"); +#endif + ti = first_tape_info; + while ((ti != NULL) && (ti->nor_filp != filp) && (ti->rew_filp != filp)) + ti = (tape_info_t *) ti->next; + if (ti == NULL) + return -ENODEV; + if (ppos != &filp->f_pos) { + /* "A request was outside the capabilities of the device." */ +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:ppos wrong"); +#endif + return -EOVERFLOW; /* errno=75 Value too large for def. data type */ + } + if ((ti->block_size != 0) && (count % ti->block_size != 0)) + return -EIO; + if (ti->block_size == 0) { + block_size = count; + nblocks = 1; + } else { + block_size = ti->block_size; + nblocks = count / (ti->block_size); + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:nbytes:"); + debug_int_event (tape_debug_area,6,block_size); + debug_text_event (tape_debug_area,6,"c:nblocks:"); + debug_int_event (tape_debug_area,6,nblocks); +#endif + for (i = 0; i < nblocks; i++) { + cqr = ti->discipline->write_block (data + i * block_size, block_size, ti); + if (!cqr) { + return -ENOBUFS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + ti->discipline->free_write_block (cqr, ti); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if ((ti->rc==-ENOSPC) && (i!=0)) + return i*block_size; + return ti->rc; + } + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:wbytes:"); + debug_int_event (tape_debug_area,6,block_size - ti->devstat.rescnt); +#endif + filp->f_pos += block_size - ti->devstat.rescnt; + written += block_size - ti->devstat.rescnt; + if (ti->devstat.rescnt > 0) + return written; + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:wtotal:"); + debug_int_event (tape_debug_area,6,written); +#endif + return written; +} + +static int +tape_mtioctop (struct file *filp, short mt_op, int mt_count) +{ + tape_info_t *ti; + ccw_req_t *cqr = NULL; + int rc; + long lockflags; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:mtio"); + debug_text_event (tape_debug_area,6,"c:ioop:"); + debug_int_event (tape_debug_area,6,mt_op); + debug_text_event (tape_debug_area,6,"c:arg:"); + debug_int_event (tape_debug_area,6,mt_count); +#endif + ti = first_tape_info; + while ((ti != NULL) && (ti->rew_filp != filp) && (ti->nor_filp != filp)) + ti = (tape_info_t *) ti->next; + if (ti == NULL) + return -ENODEV; + switch (mt_op) { + case MTREW: // rewind + + cqr = ti->discipline->mtrew (ti, mt_count); + break; + case MTOFFL: // put drive offline + + cqr = ti->discipline->mtoffl (ti, mt_count); + break; + case MTUNLOAD: // unload the tape + + cqr = ti->discipline->mtunload (ti, mt_count); + break; + case MTWEOF: // write tapemark + + cqr = ti->discipline->mtweof (ti, mt_count); + break; + case MTFSF: // forward space file + + cqr = ti->discipline->mtfsf (ti, mt_count); + break; + case MTBSF: // backward space file + + cqr = ti->discipline->mtbsf (ti, mt_count); + break; + case MTFSFM: // forward space file, stop at BOT side + + cqr = ti->discipline->mtfsfm (ti, mt_count); + break; + case MTBSFM: // backward space file, stop at BOT side + + cqr = ti->discipline->mtbsfm (ti, mt_count); + break; + case MTFSR: // forward space file + + cqr = ti->discipline->mtfsr (ti, mt_count); + break; + case MTBSR: // backward space file + + cqr = ti->discipline->mtbsr (ti, mt_count); + break; + case MTNOP: + cqr = ti->discipline->mtnop (ti, mt_count); + break; + case MTEOM: // postion at the end of portion + + case MTRETEN: // retension the tape + + cqr = ti->discipline->mteom (ti, mt_count); + break; + case MTERASE: + cqr = ti->discipline->mterase (ti, mt_count); + break; + case MTSETDENSITY: + cqr = ti->discipline->mtsetdensity (ti, mt_count); + break; + case MTSEEK: + cqr = ti->discipline->mtseek (ti, mt_count); + break; + case MTSETDRVBUFFER: + cqr = ti->discipline->mtsetdrvbuffer (ti, mt_count); + break; + case MTLOCK: + cqr = ti->discipline->mtsetdrvbuffer (ti, mt_count); + break; + case MTUNLOCK: + cqr = ti->discipline->mtsetdrvbuffer (ti, mt_count); + break; + case MTLOAD: + cqr = ti->discipline->mtload (ti, mt_count); + if (cqr!=NULL) break; // if backend driver has an load function ->use it + // if no medium is in, wait until it gets inserted + if (ti->medium_is_unloaded) { + wait_event_interruptible (ti->wq,ti->medium_is_unloaded==0); + } + return 0; + case MTCOMPRESSION: + cqr = ti->discipline->mtcompression (ti, mt_count); + break; + case MTSETPART: + cqr = ti->discipline->mtsetpart (ti, mt_count); + break; + case MTMKPART: + cqr = ti->discipline->mtmkpart (ti, mt_count); + break; + case MTTELL: // return number of block relative to current file + + cqr = ti->discipline->mttell (ti, mt_count); + break; + case MTSETBLK: + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->block_size = mt_count; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:setblk:"); + debug_int_event (tape_debug_area,6,mt_count); +#endif + return 0; + case MTRESET: + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->kernbuf = ti->userbuf = NULL; + tapestate_set (ti, TS_IDLE); + ti->block_size = 0; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:devreset:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif + return 0; + default: +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:inv.mtio"); +#endif + return -EINVAL; + } + if (cqr == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:ccwg fail"); +#endif + return -ENOSPC; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + if (ti->kernbuf != NULL) { + kfree (ti->kernbuf); + ti->kernbuf = NULL; + } + tape_free_request (cqr); + // if medium was unloaded, update the corresponding variable. + switch (mt_op) { + case MTOFFL: + case MTUNLOAD: + ti->medium_is_unloaded=1; + } + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (((mt_op == MTEOM) || (mt_op == MTRETEN)) && (tapestate_get (ti) == TS_FAILED)) + tapestate_set (ti, TS_DONE); + if (tapestate_get (ti) == TS_FAILED) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return ti->rc; + } + if (tapestate_get (ti) == TS_NOT_OPER) { + ti->blk_minor=ti->rew_minor=ti->nor_minor=-1; + ti->devinfo.irq=-1; + s390irq_spin_unlock_irqrestore (ti->devinfo.irq,lockflags); + return -ENODEV; + } + if (tapestate_get (ti) != TS_DONE) { + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + return -EIO; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + switch (mt_op) { + case MTRETEN: //need to rewind the tape after moving to eom + + return tape_mtioctop (filp, MTREW, 1); + case MTFSFM: //need to skip back over the filemark + + return tape_mtioctop (filp, MTBSFM, 1); + case MTBSF: //need to skip forward over the filemark + + return tape_mtioctop (filp, MTFSF, 1); + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:mtio done"); +#endif + return 0; +} + +/* + * Tape device io controls. + */ +int +tape_ioctl (struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg) +{ + long lockflags; + tape_info_t *ti; + ccw_req_t *cqr; + struct mtop op; /* structure for MTIOCTOP */ + struct mtpos pos; /* structure for MTIOCPOS */ + struct mtget get; + + int rc; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:ioct"); +#endif + ti = first_tape_info; + while ((ti != NULL) && + (ti->rew_minor != MINOR (inode->i_rdev)) && + (ti->nor_minor != MINOR (inode->i_rdev))) + ti = (tape_info_t *) ti->next; + if (ti == NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:nodev"); +#endif + return -ENODEV; + } + // check for discipline ioctl overloading + if ((rc = ti->discipline->discipline_ioctl_overload (inode, filp, cmd, arg)) + != -EINVAL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:ioverloa"); +#endif + return rc; + } + + switch (cmd) { + case MTIOCTOP: /* tape op command */ + if (copy_from_user (&op, (char *) arg, sizeof (struct mtop))) { + return -EFAULT; + } + return (tape_mtioctop (filp, op.mt_op, op.mt_count)); + case MTIOCPOS: /* query tape position */ + cqr = ti->discipline->mttell (ti, 0); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + pos.mt_blkno = ti->rc; + ti->cqr = NULL; + if (ti->kernbuf != NULL) { + kfree (ti->kernbuf); + ti->kernbuf = NULL; + } + tape_free_request (cqr); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if (copy_to_user ((char *) arg, &pos, sizeof (struct mtpos))) + return -EFAULT; + return 0; + case MTIOCGET: + get.mt_erreg = ti->rc; + cqr = ti->discipline->mttell (ti, 0); + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + ti->cqr = cqr; + ti->wanna_wakeup=0; + do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event_interruptible (ti->wq,ti->wanna_wakeup); + get.mt_blkno = ti->rc; + get.mt_fileno = 0; + get.mt_type = MT_ISUNKNOWN; + get.mt_resid = ti->devstat.rescnt; + get.mt_dsreg = ti->devstat.ii.sense.data[3]; + get.mt_gstat = 0; + if (ti->devstat.ii.sense.data[1] & 0x08) + get.mt_gstat &= GMT_BOT (1); // BOT + + if (ti->devstat.ii.sense.data[1] & 0x02) + get.mt_gstat &= GMT_WR_PROT (1); // write protected + + if (ti->devstat.ii.sense.data[1] & 0x40) + get.mt_gstat &= GMT_ONLINE (1); //drive online + + ti->cqr = NULL; + if (ti->kernbuf != NULL) { + kfree (ti->kernbuf); + ti->kernbuf = NULL; + } + tape_free_request (cqr); + if (signal_pending (current)) { + tapestate_set (ti, TS_IDLE); + return -ERESTARTSYS; + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + if (copy_to_user ((char *) arg, &get, sizeof (struct mtget))) + return -EFAULT; + return 0; + default: +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,3,"c:ioct inv"); +#endif + return -EINVAL; + } +} + +/* + * Tape device open function. + */ +int +tape_open (struct inode *inode, struct file *filp) +{ + tape_info_t *ti; + kdev_t dev; + long lockflags; + + inode = filp->f_dentry->d_inode; + ti = first_tape_info; + while ((ti != NULL) && + (ti->rew_minor != MINOR (inode->i_rdev)) && + (ti->nor_minor != MINOR (inode->i_rdev))) + ti = (tape_info_t *) ti->next; + if (ti == NULL) + return -ENODEV; +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:open:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (tapestate_get (ti) != TS_UNUSED) { + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:dbusy"); +#endif + return -EBUSY; + } + tapestate_set (ti, TS_IDLE); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + + dev = MKDEV (tape_major, MINOR (inode->i_rdev)); /* Get the device */ + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + if (ti->rew_minor == MINOR (inode->i_rdev)) + ti->rew_filp = filp; /* save for later reference */ + else + ti->nor_filp = filp; + filp->private_data = ti; /* save the dev.info for later reference */ + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif /* MODULE */ + return 0; +} + +/* + * Tape device release function. + */ +int +tape_release (struct inode *inode, struct file *filp) +{ + long lockflags; + tape_info_t *ti,*lastti; + ccw_req_t *cqr = NULL; + int rc; + + ti = first_tape_info; + while ((ti != NULL) && (ti->rew_minor != MINOR (inode->i_rdev)) && (ti->nor_minor != MINOR (inode->i_rdev))) + ti = (tape_info_t *) ti->next; + if ((ti != NULL) && (tapestate_get (ti) == TS_NOT_OPER)) { + if (ti==first_tape_info) { + first_tape_info=ti->next; + } else { + lastti=first_tape_info; + while (lastti->next!=ti) lastti=lastti->next; + lastti->next=ti->next; + } + kfree(ti); + return 0; + } + if ((ti == NULL) || (tapestate_get (ti) != TS_IDLE)) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:notidle!"); +#endif + return -ENXIO; /* error in tape_release */ + } +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:release:"); + debug_int_event (tape_debug_area,6,ti->blk_minor); +#endif + if (ti->rew_minor == MINOR (inode->i_rdev)) { + cqr = ti->discipline->mtrew (ti, 1); + if (cqr != NULL) { +#ifdef TAPE_DEBUG + debug_text_event (tape_debug_area,6,"c:rewrelea"); +#endif + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_REW_RELEASE_INIT); + ti->cqr = cqr; + ti->wanna_wakeup=0; + rc = do_IO (ti->devinfo.irq, cqr->cpaddr, (unsigned long) cqr, 0x00, cqr->options); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); + wait_event (ti->wq,ti->wanna_wakeup); + ti->cqr = NULL; + tape_free_request (cqr); + } + } + s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags); + tapestate_set (ti, TS_UNUSED); + s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags); +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif /* MODULE */ + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tapechar.h linux.20p9/drivers/s390/char/tapechar.h --- linux.vanilla/drivers/s390/char/tapechar.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tapechar.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,34 @@ + +/*************************************************************************** + * + * drivers/s390/char/tapechar.h + * character device frontend for tape device driver + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + * + **************************************************************************** + */ + +#ifndef TAPECHAR_H +#define TAPECHAR_H +#include +#define TAPECHAR_DEFAULTMODE 0020644 +#define TAPE_MAJOR 0 /* get dynamic major since no major officialy defined for tape */ +/* + * Prototypes for tape_fops + */ +ssize_t tape_read(struct file *, char *, size_t, loff_t *); +ssize_t tape_write(struct file *, const char *, size_t, loff_t *); +int tape_ioctl(struct inode *,struct file *,unsigned int,unsigned long); +int tape_open (struct inode *,struct file *); +int tape_release (struct inode *,struct file *); +#ifdef CONFIG_DEVFS_FS +void tapechar_mkdevfstree (tape_info_t* ti); +#endif +void tapechar_init (void); +void tapechar_uninit (void); +#endif /* TAPECHAR_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/char/tapedefs.h linux.20p9/drivers/s390/char/tapedefs.h --- linux.vanilla/drivers/s390/char/tapedefs.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/s390/char/tapedefs.h Wed Aug 8 22:14:09 2001 @@ -0,0 +1,76 @@ +/*********************************************************************** + * drivers/s390/char/tapedefs.h + * tape device driver for S/390 and zSeries tapes. + * + * S390 and zSeries version + * Copyright (C) 2001 IBM Corporation + * Author(s): Carsten Otte + * Tuan Ngo-Anh + * + * + *********************************************************************** + */ + +/* Kernel Version Compatibility section */ +#include +#include +#include +#include + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,2,17)) +#define TAPE_DEBUG // use s390 debug feature +#else +#undef TAPE_DEBUG // debug feature not supported by our 2.2.16 code +static inline void set_normalized_cda ( ccw1_t * cp, unsigned long address ) { + cp -> cda = address; +} +static inline void clear_normalized_cda ( ccw1_t * ccw ) { + ccw -> cda = 0; +} +#define BUG() PRINT_FATAL("tape390: CRITICAL INTERNAL ERROR OCCURED. REPORT THIS BACK TO LINUX390@DE.IBM.COM\n") +#endif +#define CONFIG_S390_TAPE_DYNAMIC // allow devices to be attached or detached on the fly +#define TAPEBLOCK_RETRIES 20 // number of retries, when a block-dev request fails. + + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) +#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ +do { \ + blk_dev[d_major].queue = d_queue_fn; \ +} while(0) +static inline struct request * +tape_next_request( request_queue_t *queue ) +{ + return blkdev_entry_next_request(&queue->queue_head); +} +static inline void +tape_dequeue_request( request_queue_t * q, struct request *req ) +{ + blkdev_dequeue_request (req); +} +#else +#define s390_dev_info_t dev_info_t +typedef struct request *request_queue_t; +#ifndef init_waitqueue_head +#define init_waitqueue_head(x) do { *x = NULL; } while(0) +#endif +#define blk_init_queue(x,y) do {} while(0) +#define blk_queue_headactive(x,y) do {} while(0) +#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ +do { \ + blk_dev[d_major].request_fn = d_request_fn; \ + blk_dev[d_major].queue = d_queue_fn; \ + blk_dev[d_major].current_request = d_current; \ +} while(0) +static inline struct request * +tape_next_request( request_queue_t *queue ) +{ + return *queue; +} +static inline void +tape_dequeue_request( request_queue_t * q, struct request *req ) +{ + *q = req->next; + req->next = NULL; +} +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/net/ctc.c linux.20p9/drivers/s390/net/ctc.c --- linux.vanilla/drivers/s390/net/ctc.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/net/ctc.c Wed Jul 4 16:03:56 2001 @@ -1109,7 +1109,7 @@ if (sense & 0x01) printk(KERN_DEBUG "%s: %s: Interface disconnect or Selective reset occurred (remote side)\n", dev->name, caller); else - printk(KERN_DEBUG "%s: %s: System reset occured (remote side)\n", dev->name, caller); + printk(KERN_DEBUG "%s: %s: System reset occurred (remote side)\n", dev->name, caller); #endif } else if (sense & 0x20) { if (sense & 0x04) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/s390/net/iucv.c linux.20p9/drivers/s390/net/iucv.c --- linux.vanilla/drivers/s390/net/iucv.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/s390/net/iucv.c Wed Aug 8 22:14:20 2001 @@ -20,6 +20,7 @@ #include #include "iucv.h" #include +#include #include #include #include @@ -1531,11 +1532,16 @@ inline void top_half_interrupt (struct pt_regs *regs, __u16 code) { + int cpu = smp_processor_id(); iucv_packet *pkt; + + irq_enter(cpu, 0x4000); + pkt = (iucv_packet *) kmalloc (sizeof (iucv_packet), GFP_ATOMIC); if (pkt == NULL) { printk (KERN_DEBUG "out of memory\n"); + irq_exit(cpu, 0x4000); return; } memcpy (pkt->data, iucv_external_int_buffer, 40); @@ -1560,6 +1566,7 @@ queue_task (&short_task, &tq_immediate); mark_bh (IMMEDIATE_BH); } + irq_exit(cpu, 0x4000); return; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/aurora.c linux.20p9/drivers/sbus/char/aurora.c --- linux.vanilla/drivers/sbus/char/aurora.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/aurora.c Wed Aug 8 22:15:23 2001 @@ -1,7 +1,7 @@ /* * linux/drivers/sbus/char/aurora.c -- Aurora multiport driver * - * Copyright (c) 1999 by Oliver Aldulea (oli@bv.ro) + * Copyright (c) 1999 by Oliver Aldulea (oli at bv.ro) * * This code is based on the RISCom/8 multiport serial driver written * by Dmitry Gorodchanin (pgmdsg@ibi.com), based on the Linux serial @@ -1556,33 +1556,58 @@ if (!tty || !port->xmit_buf || !tmp_buf) return 0; - if (from_user) + save_flags(flags); + if (from_user) { down(&tmp_buf_sem); + while (1) { + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) + break; - save_flags(flags); - while (1) { - cli(); - c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, - SERIAL_XMIT_SIZE - port->xmit_head)); - if (c <= 0) - break; + c -= copy_from_user(tmp_buf, buf, c); + if (!c) { + if (!total) + total = -EFAULT; + break; + } - if (from_user) { - copy_from_user(tmp_buf, buf, c); + cli(); c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, SERIAL_XMIT_SIZE - port->xmit_head)); memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c); - } else + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } + up(&tmp_buf_sem); + } else { + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, + SERIAL_XMIT_SIZE - port->xmit_head)); + if (c <= 0) { + restore_flags(flags); + break; + } + memcpy(port->xmit_buf + port->xmit_head, buf, c); - port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - port->xmit_cnt += c; - restore_flags(flags); - buf += c; - count -= c; - total += c; + port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + port->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } } - if (from_user) - up(&tmp_buf_sem); + + + cli(); if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped && !(port->SRER & SRER_TXRDY)) { port->SRER |= SRER_TXRDY; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/aurora.h linux.20p9/drivers/sbus/char/aurora.h --- linux.vanilla/drivers/sbus/char/aurora.h Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/aurora.h Wed Jul 4 16:03:56 2001 @@ -243,7 +243,7 @@ struct tty_struct * tty; int count; int blocked_open; - int event; + long event; int timeout; int close_delay; long session; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/envctrl.c linux.20p9/drivers/sbus/char/envctrl.c --- linux.vanilla/drivers/sbus/char/envctrl.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/envctrl.c Thu Jul 26 15:40:16 2001 @@ -1,4 +1,4 @@ -/* $Id: envctrl.c,v 1.9.2.2 2000/11/08 09:43:04 davem Exp $ +/* $Id: envctrl.c,v 1.9.2.3 2001/06/19 16:49:44 davem Exp $ * envctrl.c: Temperature and Fan monitoring on Machines providing it. * * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) @@ -239,7 +239,7 @@ printk(KERN_INFO "envctrl: Busy bit will not clear.\n"); } -/* Function Description: Send the adress for a read access. +/* Function Description: Send the address for a read access. * Return : 0 if not acknowledged, otherwise acknowledged. */ static int envctrl_i2c_read_addr(unsigned char addr) @@ -265,7 +265,7 @@ } } -/* Function Description: Send the adress for write mode. +/* Function Description: Send the address for write mode. * Return : None. */ static void envctrl_i2c_write_addr(unsigned char addr) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/pcikbd.c linux.20p9/drivers/sbus/char/pcikbd.c --- linux.vanilla/drivers/sbus/char/pcikbd.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/pcikbd.c Wed Jul 4 16:03:56 2001 @@ -1,4 +1,4 @@ -/* $Id: pcikbd.c,v 1.27.2.2 2000/01/21 01:05:45 davem Exp $ +/* $Id: pcikbd.c,v 1.27.2.4 2001/06/03 13:41:48 ecd Exp $ * pcikbd.c: Ultra/AX PC keyboard support. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -48,6 +48,7 @@ static int pcikbd_mrcoffee = 0; #else #define pcikbd_mrcoffee 0 +extern void (*prom_keyboard)(void); #endif static unsigned long pcikbd_iobase = 0; @@ -58,6 +59,9 @@ static volatile unsigned char acknowledge = 0; static volatile unsigned char resend = 0; +static void pcikbd_write(int address, int data); +static int pcikbd_wait_for_input(void); + unsigned char pckbd_read_mask = KBD_STAT_OBF; extern int pcikbd_init(void); @@ -250,7 +254,7 @@ e0_keys[scancode - 128]; } -int do_acknowledge(unsigned char scancode) +static int do_acknowledge(unsigned char scancode) { if(reply_expected) { if(scancode == KBD_REPLY_ACK) { @@ -266,10 +270,87 @@ return 1; } +#ifdef __sparc_v9__ +static void pcikbd_enter_prom(void) +{ + pcikbd_write(KBD_DATA_REG, KBD_CMD_DISABLE); + if(pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Enter: Disable keyboard: no ACK\n"); + + /* Disable PC scancode translation */ + pcikbd_write(KBD_CNTL_REG, KBD_CCMD_WRITE_MODE); + pcikbd_write(KBD_DATA_REG, KBD_MODE_SYS); + pcikbd_write(KBD_DATA_REG, KBD_CMD_ENABLE); + if (pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Enter: Enable Keyboard: no ACK\n"); +} +#endif + +static void ctrl_break(void) +{ + extern int stop_a_enabled; + unsigned long timeout; + int status, data; + int mode; + + if (!stop_a_enabled) + return; + + pcikbd_write(KBD_DATA_REG, KBD_CMD_DISABLE); + if(pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Enter: Disable keyboard: no ACK\n"); + + /* Save current mode register settings */ + pcikbd_write(KBD_CNTL_REG, KBD_CCMD_READ_MODE); + if ((mode = pcikbd_wait_for_input()) == -1) + printk("Prom Enter: Read Mode: no ACK\n"); + + /* Disable PC scancode translation */ + pcikbd_write(KBD_CNTL_REG, KBD_CCMD_WRITE_MODE); + pcikbd_write(KBD_DATA_REG, mode & ~(KBD_MODE_KCC)); + pcikbd_write(KBD_DATA_REG, KBD_CMD_ENABLE); + if (pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Enter: Enable Keyboard: no ACK\n"); + + /* Drop into OBP. + * Note that we must flush the user windows + * first before giving up control. + */ + flush_user_windows(); + prom_cmdline(); + + /* Read prom's key up event (use short timeout) */ + do { + timeout = 10; + do { + mdelay(1); + status = pcikbd_inb(pcikbd_iobase + KBD_STATUS_REG); + if (!(status & KBD_STAT_OBF)) + continue; + data = pcikbd_inb(pcikbd_iobase + KBD_DATA_REG); + if (status & (KBD_STAT_GTO | KBD_STAT_PERR)) + continue; + break; + } while (--timeout > 0); + } while (timeout > 0); + + /* Reenable PC scancode translation */ + pcikbd_write(KBD_DATA_REG, KBD_CMD_DISABLE); + if(pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Leave: Disable keyboard: no ACK\n"); + + pcikbd_write(KBD_CNTL_REG, KBD_CCMD_WRITE_MODE); + pcikbd_write(KBD_DATA_REG, mode); + pcikbd_write(KBD_DATA_REG, KBD_CMD_ENABLE); + if (pcikbd_wait_for_input() != KBD_REPLY_ACK) + printk("Prom Enter: Enable Keyboard: no ACK\n"); +} + int pcikbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode) { static int prev_scancode = 0; + int down = scancode & 0x80 ? 0 : 1; if (scancode == 0xe0 || scancode == 0xe1) { prev_scancode = scancode; @@ -308,6 +389,18 @@ } else *keycode = scancode; + + if (*keycode == E0_BREAK) { + if (down) + return 0; + + /* Handle ctrl-break event */ + ctrl_break(); + + /* Send ctrl up event to the keyboard driver */ + *keycode = 0x1d; + } + return 1; } @@ -367,7 +460,7 @@ } -__initfunc(static int pcikbd_wait_for_input(void)) +static int pcikbd_wait_for_input(void) { int status, data; unsigned long start = jiffies; @@ -384,7 +477,7 @@ return -1; } -__initfunc(static void pcikbd_write(int address, int data)) +static void pcikbd_write(int address, int data) { int status; @@ -570,6 +663,8 @@ printk("8042(speaker): iobase[%016lx]%s\n", pcibeep_iobase, edev ? "" : " (forced)"); } + + prom_keyboard = pcikbd_enter_prom; #endif disable_irq(pcikbd_irq); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/sab82532.c linux.20p9/drivers/sbus/char/sab82532.c --- linux.vanilla/drivers/sbus/char/sab82532.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/sab82532.c Wed Jul 4 16:03:56 2001 @@ -1,4 +1,4 @@ -/* $Id: sab82532.c,v 1.30.2.4 2000/05/27 04:46:34 davem Exp $ +/* $Id: sab82532.c,v 1.30.2.7 2001/05/29 06:17:24 ecd Exp $ * sab82532.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -54,9 +54,12 @@ /* Set of debugging defines */ #undef SERIAL_DEBUG_OPEN #undef SERIAL_DEBUG_FLOW +#undef SERIAL_DEBUG_MODEM #undef SERIAL_DEBUG_WAIT_UNTIL_SENT #undef SERIAL_DEBUG_SEND_BREAK #undef SERIAL_DEBUG_INTR +#undef SERIAL_DEBUG_FIFO +#define SERIAL_DEBUG_OVERFLOW 1 /* Trace things on serial device, useful for console debugging: */ #undef SERIAL_LOG_DEVICE @@ -194,10 +197,14 @@ if (info->xmit_cnt <= 0) goto out; - if (!(info->regs->r.star & SAB82532_STAR_XFW)) + if (!test_bit(SAB82532_XPR, &info->irqflags)) goto out; - info->all_sent = 0; + info->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS); + info->regs->w.imr1 = info->interrupt_mask1; + clear_bit(SAB82532_ALLS, &info->irqflags); + + clear_bit(SAB82532_XPR, &info->irqflags); for (i = 0; i < info->xmit_fifo_size; i++) { info->regs->w.xfifo[i] = info->xmit_buf[info->xmit_tail++]; info->xmit_tail &= (SERIAL_XMIT_SIZE - 1); @@ -318,15 +325,15 @@ * This routine is used by the interrupt handler to schedule * processing in the software interrupt portion of the driver. */ -static inline void sab82532_sched_event(struct sab82532 *info, int event) +static void sab82532_sched_event(struct sab82532 *info, int event) { info->event |= 1 << event; queue_task(&info->tqueue, &tq_serial); mark_bh(SERIAL_BH); } -static inline void receive_chars(struct sab82532 *info, - union sab82532_irq_status *stat) +static void receive_chars(struct sab82532 *info, + union sab82532_irq_status *stat) { struct tty_struct *tty = info->tty; unsigned char buf[32]; @@ -353,7 +360,7 @@ } if (stat->sreg.isr0 & SAB82532_ISR0_RFO) { -#if 1 +#ifdef SERIAL_DEBUG_OVERFLOW printk("sab82532: receive_chars: RFO"); #endif free_fifo++; @@ -377,7 +384,7 @@ for (i = 0; i < count; ) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { -#if 1 +#ifdef SERIAL_DEBUG_OVERFLOW printk("sab82532: receive_chars: tty overrun\n"); #endif info->icount.buf_overrun++; @@ -411,16 +418,29 @@ queue_task(&tty->flip.tqueue, &tq_timer); } -static inline void transmit_chars(struct sab82532 *info, - union sab82532_irq_status *stat) +static void transmit_chars(struct sab82532 *info, + union sab82532_irq_status *stat) { int i; - if (stat->sreg.isr1 & SAB82532_ISR1_ALLS) - info->all_sent = 1; - if (!(info->regs->r.star & SAB82532_STAR_XFW)) + if (stat->sreg.isr1 & SAB82532_ISR1_ALLS) { + info->interrupt_mask1 |= SAB82532_IMR1_ALLS; + info->regs->w.imr1 = info->interrupt_mask1; + set_bit(SAB82532_ALLS, &info->irqflags); + } + + if (!(stat->sreg.isr1 & SAB82532_ISR1_XPR)) return; + if (!(info->regs->r.star & SAB82532_STAR_XFW)) { +#ifdef SERIAL_DEBUG_FIFO + printk("%s: XPR, but no XFW (???)\n", __FUNCTION__); +#endif + return; + } + + set_bit(SAB82532_XPR, &info->irqflags); + if (!info->tty) { info->interrupt_mask1 |= SAB82532_IMR1_XPR; info->regs->w.imr1 = info->interrupt_mask1; @@ -434,8 +454,12 @@ return; } + info->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS); + info->regs->w.imr1 = info->interrupt_mask1; + clear_bit(SAB82532_ALLS, &info->irqflags); + /* Stuff 32 bytes into Transmit FIFO. */ - info->all_sent = 0; + clear_bit(SAB82532_XPR, &info->irqflags); for (i = 0; i < info->xmit_fifo_size; i++) { info->regs->w.xfifo[i] = info->xmit_buf[info->xmit_tail++]; info->xmit_tail &= (SERIAL_XMIT_SIZE - 1); @@ -455,14 +479,10 @@ #ifdef SERIAL_DEBUG_INTR printk("THRE..."); #endif - if (info->xmit_cnt <= 0) { - info->interrupt_mask1 |= SAB82532_IMR1_XPR; - info->regs->w.imr1 = info->interrupt_mask1; - } } -static inline void check_status(struct sab82532 *info, - union sab82532_irq_status *stat) +static void check_status(struct sab82532 *info, + union sab82532_irq_status *stat) { struct tty_struct *tty = info->tty; int modem_change = 0; @@ -501,7 +521,7 @@ info->dcd = (info->regs->r.vstr & SAB82532_VSTR_CD) ? 0 : 1; info->icount.dcd++; modem_change++; -#if 0 +#ifdef SERIAL_DEBUG_MODEM printk("DCD change: %d\n", info->icount.dcd); #endif } @@ -509,7 +529,7 @@ info->cts = info->regs->r.star & SAB82532_STAR_CTS; info->icount.cts++; modem_change++; -#if 0 +#ifdef SERIAL_DEBUG_MODEM printk("CTS change: %d, CTS %s\n", info->icount.cts, info->cts ? "on" : "off"); #endif } @@ -517,7 +537,7 @@ info->dsr = (info->regs->r.pvr & info->pvr_dsr_bit) ? 0 : 1; info->icount.dsr++; modem_change++; -#if 0 +#ifdef SERIAL_DEBUG_MODEM printk("DSR change: %d\n", info->icount.dsr); #endif } @@ -808,15 +828,19 @@ info->interrupt_mask0 = SAB82532_IMR0_PERR | SAB82532_IMR0_FERR | SAB82532_IMR0_PLLA; info->regs->w.imr0 = info->interrupt_mask0; - info->interrupt_mask1 = SAB82532_IMR1_BRKT | SAB82532_IMR1_XOFF | - SAB82532_IMR1_TIN | SAB82532_IMR1_XON | + info->interrupt_mask1 = SAB82532_IMR1_BRKT | SAB82532_IMR1_ALLS | + SAB82532_IMR1_XOFF | SAB82532_IMR1_TIN | + SAB82532_IMR1_CSC | SAB82532_IMR1_XON | SAB82532_IMR1_XPR; info->regs->w.imr1 = info->interrupt_mask1; + set_bit(SAB82532_ALLS, &info->irqflags); if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + set_bit(SAB82532_XPR, &info->irqflags); + /* * and set the speed of the serial port */ @@ -1019,10 +1043,14 @@ info->regs->rw.mode &= ~(SAB82532_MODE_RTS); info->regs->rw.mode |= SAB82532_MODE_FRTS; info->regs->rw.mode &= ~(SAB82532_MODE_FCTS); + info->interrupt_mask1 &= ~(SAB82532_IMR1_CSC); + info->regs->w.imr1 = info->interrupt_mask1; } else { info->regs->rw.mode |= SAB82532_MODE_RTS; info->regs->rw.mode &= ~(SAB82532_MODE_FRTS); info->regs->rw.mode |= SAB82532_MODE_FCTS; + info->interrupt_mask1 |= SAB82532_IMR1_CSC; + info->regs->w.imr1 = info->interrupt_mask1; } info->regs->rw.mode |= SAB82532_MODE_RAC; restore_flags(flags); @@ -1204,10 +1232,11 @@ if (I_IXOFF(tty)) sab82532_send_xchar(tty, STOP_CHAR(tty)); -#if 0 - if (tty->termios->c_cflag & CRTSCTS) - info->regs->rw.mode |= SAB82532_MODE_RTS; -#endif + + if (tty->termios->c_cflag & CRTSCTS) { + info->regs->rw.mode &= ~(SAB82532_MODE_FRTS | + SAB82532_MODE_RTS); + } } static void sab82532_unthrottle(struct tty_struct * tty) @@ -1230,10 +1259,12 @@ sab82532_send_xchar(tty, START_CHAR(tty)); } -#if 0 - if (tty->termios->c_cflag & CRTSCTS) - info->regs->rw.mode &= ~(SAB82532_MODE_RTS); -#endif + if (tty->termios->c_cflag & CRTSCTS) { + u8 mode = info->regs->r.mode; + mode &= ~(SAB82532_MODE_RTS); + mode |= SAB82532_MODE_FRTS; + info->regs->w.mode = mode; + } } /* @@ -1287,7 +1318,8 @@ { unsigned int result; - result = (!info->xmit_buf && info->all_sent) ? TIOCSER_TEMT : 0; + result = (!info->xmit_buf && test_bit(SAB82532_ALLS, &info->irqflags)) + ? TIOCSER_TEMT : 0; return put_user(result, value); } @@ -1515,10 +1547,19 @@ if (!(old_termios->c_cflag & CBAUD) && (tty->termios->c_cflag & CBAUD)) { info->regs->w.pvr &= ~(info->pvr_dtr_bit); - if (!tty->hw_stopped || - !(tty->termios->c_cflag & CRTSCTS)) { - info->regs->w.mode &= ~(SAB82532_MODE_FRTS); - info->regs->w.mode |= SAB82532_MODE_RTS; + if (!tty->hw_stopped) { + u8 mode = info->regs->r.mode; + if (tty->termios->c_cflag & CRTSCTS) { + mode &= ~(SAB82532_MODE_RTS); + mode |= SAB82532_MODE_FRTS; + } else if (test_bit(TTY_THROTTLED, &tty->flags)) { + mode &= ~(SAB82532_MODE_FRTS | + SAB82532_MODE_RTS); + } else { + mode &= ~(SAB82532_MODE_FRTS); + mode |= SAB82532_MODE_RTS; + } + info->regs->w.mode = mode; } } @@ -1528,18 +1569,6 @@ tty->hw_stopped = 0; sab82532_start(tty); } - -#if 0 - /* - * No need to wake up processes in open wait, since they - * sample the CLOCAL flag once, and don't recheck it. - * XXX It's not clear whether the current behavior is correct - * or not. Hence, this may change..... - */ - if (!(old_termios->c_cflag & CLOCAL) && - (tty->termios->c_cflag & CLOCAL)) - wake_up_interruptible(&info->open_wait); -#endif } /* @@ -1617,9 +1646,6 @@ */ info->interrupt_mask0 |= SAB82532_IMR0_TCD; info->regs->w.imr0 = info->interrupt_mask0; -#if 0 - info->regs->rw.mode &= ~(SAB82532_MODE_RAC); -#endif if (info->flags & ASYNC_INITIALIZED) { /* * Before we drop DTR, make sure the UART transmitter @@ -1661,7 +1687,6 @@ if (serial_paranoia_check(info,tty->device,"sab82532_wait_until_sent")) return; - orig_jiffies = jiffies; /* * Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check @@ -1677,10 +1702,14 @@ if (timeout) char_time = MIN(char_time, timeout); #ifdef SERIAL_DEBUG_WAIT_UNTIL_SENT - printk("In sab82532_wait_until_sent(%d) check=%lu...", timeout, char_time); - printk("jiff=%lu...", jiffies); + printk("In sab82532_wait_until_sent(%d) check=%lu " + "xmit_cnt = %ld, alls = %d (jiff=%lu)...\n", + timeout, char_time, info->xmit_cnt, + test_bit(SAB82532_ALLS, &info->irqflags), jiffies); #endif - while (info->xmit_cnt || !info->all_sent) { + orig_jiffies = jiffies; + while (info->xmit_cnt || + !test_bit(SAB82532_ALLS, &info->irqflags)) { current->state = TASK_INTERRUPTIBLE; current->counter = 0; schedule_timeout(char_time); @@ -1691,7 +1720,9 @@ } current->state = TASK_RUNNING; #ifdef SERIAL_DEBUG_WAIT_UNTIL_SENT - printk("xmit_cnt = %d, alls = %d (jiff=%lu)...done\n", info->xmit_cnt, info->all_sent, jiffies); + printk("xmit_cnt = %d, alls = %d (jiff=%lu)...done\n", + info->xmit_cnt, test_bit(SAB82532_ALLS, &info->irqflags), + jiffies); #endif } @@ -2146,7 +2177,7 @@ __initfunc(static inline void show_serial_version(void)) { - char *revision = "$Revision: 1.30.2.4 $"; + char *revision = "$Revision: 1.30.2.7 $"; char *version, *p; version = strchr(revision, ' '); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/su.c linux.20p9/drivers/sbus/char/su.c --- linux.vanilla/drivers/sbus/char/su.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/sbus/char/su.c Wed Jul 4 16:03:56 2001 @@ -1,4 +1,4 @@ -/* $Id: su.c,v 1.18.2.7 2000/05/27 04:46:34 davem Exp $ +/* $Id: su.c,v 1.18.2.8 2001/05/16 08:37:26 davem Exp $ * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -1411,6 +1411,41 @@ */ /* + * get_serial_info - handle TIOCGSERIAL ioctl() + * + * Purpose: Return standard serial struct information about + * a serial port handled by this driver. + * + * Added: 11-May-2001 Lars Kellogg-Stedman + */ +static int get_serial_info(struct su_struct * info, + struct serial_struct * retinfo) +{ + struct serial_struct tmp; + + if (!retinfo) + return -EFAULT; + memset(&tmp, 0, sizeof(tmp)); + + tmp.type = info->type; + tmp.line = info->line; + tmp.port = info->port; + tmp.irq = info->irq; + tmp.flags = info->flags; + tmp.xmit_fifo_size = info->xmit_fifo_size; + tmp.baud_base = info->baud_base; + tmp.close_delay = info->close_delay; + tmp.closing_wait = info->closing_wait; + tmp.custom_divisor = info->custom_divisor; + tmp.hub6 = 0; + + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) + return -EFAULT; + + return 0; +} + +/* * get_lsr_info - get line status register info * * Purpose: Let user call ioctl() to get info when the UART physically @@ -1568,6 +1603,9 @@ case TIOCMSET: return set_modem_info(info, cmd, (unsigned int *) arg); + case TIOCGSERIAL: + return get_serial_info(info, (struct serial_struct *)arg); + case TIOCSERGETLSR: /* Get line status register */ return get_lsr_info(info, (unsigned int *) arg); @@ -2226,7 +2264,7 @@ */ __initfunc(static __inline__ void show_su_version(void)) { - char *revision = "$Revision: 1.18.2.7 $"; + char *revision = "$Revision: 1.18.2.8 $"; char *version, *p; version = strchr(revision, ' '); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/sbus/char/zs.c linux.20p9/drivers/sbus/char/zs.c --- linux.vanilla/drivers/sbus/char/zs.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/sbus/char/zs.c Wed Jul 4 16:03:56 2001 @@ -1,4 +1,4 @@ -/* $Id: zs.c,v 1.41.2.7 2001/01/03 08:07:04 ecd Exp $ +/* $Id: zs.c,v 1.41.2.9 2001/05/09 07:47:10 davem Exp $ * zs.c: Zilog serial port driver for the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -173,7 +173,7 @@ * buffer across all the serial ports, since it significantly saves * memory if large numbers of serial ports are open. */ -static unsigned char tmp_buf[4096]; /* This is cheating */ +static unsigned char tmp_buf[SERIAL_XMIT_SIZE]; /* This is cheating */ static struct semaphore tmp_buf_sem = MUTEX; static inline int serial_paranoia_check(struct sun_serial *info, @@ -1109,28 +1109,53 @@ return 0; save_flags(flags); - while (1) { - cli(); - c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, - SERIAL_XMIT_SIZE - info->xmit_head)); - if (c <= 0) - break; + if (from_user) { + down(&tmp_buf_sem); + while (1) { + c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, + SERIAL_XMIT_SIZE - info->xmit_head)); + if (c <= 0) + break; + + c -= copy_from_user(tmp_buf, buf, c); + if (!c) { + if (!total) + total = -EFAULT; + break; + } - if (from_user) { - down(&tmp_buf_sem); - copy_from_user(tmp_buf, buf, c); + cli(); c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, SERIAL_XMIT_SIZE - info->xmit_head)); memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c); - up(&tmp_buf_sem); - } else + info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + info->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } + up(&tmp_buf_sem); + } else { + while (1) { + cli(); + c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, + SERIAL_XMIT_SIZE - info->xmit_head)); + if (c <= 0) { + restore_flags(flags); + break; + } + memcpy(info->xmit_buf + info->xmit_head, buf, c); - info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - info->xmit_cnt += c; - restore_flags(flags); - buf += c; - count -= c; - total += c; + info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + info->xmit_cnt += c; + restore_flags(flags); + + buf += c; + count -= c; + total += c; + } } cli(); @@ -1856,7 +1881,7 @@ static void show_serial_version(void) { - char *revision = "$Revision: 1.41.2.7 $"; + char *revision = "$Revision: 1.41.2.9 $"; char *version, *p; version = strchr(revision, ' '); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/3w-xxxx.c linux.20p9/drivers/scsi/3w-xxxx.c --- linux.vanilla/drivers/scsi/3w-xxxx.c Sun Mar 25 17:37:35 2001 +++ linux.20p9/drivers/scsi/3w-xxxx.c Wed Jul 4 16:03:56 2001 @@ -5,7 +5,6 @@ Modifications By: Joel Jacobson Arnaldo Carvalho de Melo - Copyright (C) 1999-2001 3ware Inc. Kernel compatablity By: Andre Hedrick @@ -77,6 +76,20 @@ Make tw_setfeature() call with interrupts disabled. Register interrupt handler before enabling interrupts. Clear attention interrupt before draining aen queue. + 1.02.00.005 - Allocate bounce buffers and custom queue depth for raid5 for + 6000 and 5000 series controllers. + Reduce polling mdelays causing problems on some systems. + Fix use_sg = 1 calculation bug. + Check for scsi_register returning NULL. + Add aen count to /proc/scsi/3w-xxxx. + Remove aen code unit masking in tw_aen_complete(). + 1.02.00.006 - Remove unit from printk in tw_scsi_eh_abort(), causing + possible oops. + Fix possible null pointer dereference in tw_scsi_queue() + if done function pointer was invalid. + 1.02.00.007 - Fix possible null pointer dereferences in tw_ioctl(). + Remove check for invalid done function pointer from + tw_scsi_queue(). */ #include @@ -128,7 +141,7 @@ }; /* Globals */ -char *tw_driver_version="1.02.00.004"; +char *tw_driver_version="1.02.00.007"; TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT]; int tw_device_extension_count = 0; @@ -138,7 +151,7 @@ int tw_aen_complete(TW_Device_Extension *tw_dev, int request_id) { TW_Param *param; - unsigned short aen, aen_code; + unsigned short aen; if (tw_dev->alignment_virtual_address[request_id] == NULL) { printk(KERN_WARNING "3w-xxxx: tw_aen_complete(): Bad alignment virtual address.\n"); @@ -146,10 +159,11 @@ } param = (TW_Param *)tw_dev->alignment_virtual_address[request_id]; aen = *(unsigned short *)(param->data); - aen_code = (aen & 0x0ff); - dprintk(KERN_NOTICE "3w-xxxx: tw_aen_complete(): Queue'd code 0x%x\n", aen_code); + dprintk(KERN_NOTICE "3w-xxxx: tw_aen_complete(): Queue'd code 0x%x\n", aen); + tw_dev->aen_count++; + /* Now queue the code */ - tw_dev->aen_queue[tw_dev->aen_tail] = aen_code; + tw_dev->aen_queue[tw_dev->aen_tail] = aen; if (tw_dev->aen_tail == TW_Q_LENGTH - 1) { tw_dev->aen_tail = TW_Q_START; } else { @@ -248,7 +262,7 @@ /* Now poll for completion */ for (i=0;icommand_packet_virtual_address[request_id] = virt_addr; - tw_dev->command_packet_physical_address[request_id] = - virt_to_bus(virt_addr); - } else { - tw_dev->alignment_virtual_address[request_id] = virt_addr; - tw_dev->alignment_physical_address[request_id] = - virt_to_bus(virt_addr); + switch(which) { + case 0: + tw_dev->command_packet_virtual_address[request_id] = virt_addr; + tw_dev->command_packet_physical_address[request_id] = + virt_to_bus(virt_addr); + break; + case 1: + tw_dev->alignment_virtual_address[request_id] = virt_addr; + tw_dev->alignment_physical_address[request_id] = + virt_to_bus(virt_addr); + break; + case 2: + tw_dev->bounce_buffer[request_id] = virt_addr; + break; + default: + printk(KERN_WARNING "3w-xxxx: tw_allocate_memory(): case slip in tw_allocate_memory()\n"); + return 1; } return 0; } /* End tw_allocate_memory() */ @@ -708,7 +730,7 @@ kfree(tw_dev); continue; } - + /* Calculate max cmds per lun */ if (tw_dev->num_units > 0) tw_host->cmd_per_lun = (TW_Q_LENGTH-2)/tw_dev->num_units; @@ -716,7 +738,13 @@ /* Register the card with the kernel SCSI layer */ host = scsi_register(tw_host, sizeof(TW_Device_Extension)); - /* FIXME - check for NULL */ + if (host == NULL) { + printk(KERN_WARNING "3w-xxxx: tw_findcards(): scsi_register() failed for card %d.\n", numcards-1); + release_region((tw_dev->tw_pci_dev->base_address[0]), TW_IO_ADDRESS_RANGE); + tw_free_device_extension(tw_dev); + kfree(tw_dev); + continue; + } status_reg_value = inl(tw_dev->registers.status_reg_addr); @@ -787,6 +815,9 @@ if (tw_dev->alignment_virtual_address[i]) kfree(tw_dev->alignment_virtual_address[i]); + + if (tw_dev->bounce_buffer[i]) + kfree(tw_dev->bounce_buffer[i]); } } /* End tw_free_device_extension() */ @@ -852,7 +883,7 @@ /* Poll for completion */ imax = TW_POLL_MAX_RETRIES; for (i=0;iaen_queue[i] = 0; } - for (i=0;iis_unit_present[i] = 0; + tw_dev->is_raid_five[i] = 0; + } tw_dev->num_units = 0; tw_dev->num_aborts = 0; @@ -927,6 +960,8 @@ tw_dev->aen_tail = 0; tw_dev->sector_count = 0; tw_dev->max_sector_count = 0; + tw_dev->aen_count = 0; + tw_dev->num_raid_five = 0; spin_lock_init(&tw_dev->tw_lock); return 0; } /* End tw_initialize_device_extension() */ @@ -938,13 +973,14 @@ unsigned char request_id = 0; TW_Command *command_packet; TW_Param *param; - int i, imax, num_units = 0; + int i, j, imax, num_units = 0, num_raid_five = 0; u32 status_reg_addr, status_reg_value; u32 command_que_addr, command_que_value; u32 response_que_addr; TW_Response_Queue response_queue; u32 param_value; unsigned char *is_unit_present; + unsigned char *raid_level; dprintk(KERN_NOTICE "3w-xxxx: tw_initialize_units()\n"); @@ -999,7 +1035,7 @@ /* Poll for completion */ imax = TW_POLL_MAX_RETRIES; for(i=0; iis_unit_present[j] == 0) + continue; + command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id]; + if (command_packet == NULL) { + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad command packet virtual address.\n"); + return 1; + } + memset(command_packet, 0, sizeof(TW_Sector)); + command_packet->byte0.opcode = TW_OP_GET_PARAM; + command_packet->byte0.sgl_offset = 2; + command_packet->size = 4; + command_packet->request_id = request_id; + command_packet->byte3.unit = 0; + command_packet->byte3.host_id = 0; + command_packet->status = 0; + command_packet->flags = 0; + command_packet->byte6.block_count = 1; + + /* Now setup the param */ + if (tw_dev->alignment_virtual_address[request_id] == NULL) { + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad alignment virtual address.\n"); + return 1; + } + param = (TW_Param *)tw_dev->alignment_virtual_address[request_id]; + memset(param, 0, sizeof(TW_Sector)); + param->table_id = 0x300+j; /* unit summary table */ + param->parameter_id = 0x6; /* unit descriptor */ + param->parameter_size_bytes = 0xc; + param_value = tw_dev->alignment_physical_address[request_id]; + if (param_value == 0) { + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad alignment physical address.\n"); + return 1; + } + + command_packet->byte8.param.sgl[0].address = param_value; + command_packet->byte8.param.sgl[0].length = sizeof(TW_Sector); + + /* Post the command packet to the board */ + command_que_value = tw_dev->command_packet_physical_address[request_id]; + if (command_que_value == 0) { + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad command packet physical address.\n"); + return 1; + } + outl(command_que_value, command_que_addr); + + /* Poll for completion */ + imax = TW_POLL_MAX_RETRIES; + for(i=0; istatus != 0) { + /* bad response */ + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags); + return 1; + } + found = 1; + break; + } + } + if (found == 0) { + /* response never received */ + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): No response.\n"); + return 1; + } + + param = (TW_Param *)tw_dev->alignment_virtual_address[request_id]; + raid_level = (unsigned char *)&(param->data[1]); + if (*raid_level == 5) { + dprintk(KERN_WARNING "3w-xxxx: Found unit %d to be a raid5 unit.\n", j); + tw_dev->is_raid_five[j] = 1; + num_raid_five++; + } + } + tw_dev->num_raid_five = num_raid_five; + + /* Now allocate raid5 bounce buffers */ + if ((num_raid_five != 0) && (tw_dev->tw_pci_dev->device == TW_DEVICE_ID)) { + for (i=0;ibounce_buffer[i] == NULL) { + printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bounce buffer allocation failed.\n"); + return 1; + } + memset(tw_dev->bounce_buffer[i], 0, sizeof(TW_Sector)*128); + } + } return 0; } /* End tw_initialize_units() */ @@ -1283,12 +1420,17 @@ case TW_OP_SET_PARAM: dprintk(KERN_NOTICE "3w-xxxx: tw_ioctl(): caught TW_OP_SET_PARAM: table_id = %d, parameter_id = %d, parameter_size_bytes = %d.\n", ioctl->table_id, ioctl->parameter_id, ioctl->parameter_size_bytes); - command_packet->byte0.opcode = TW_OP_SET_PARAM; - param->table_id = ioctl->table_id; - param->parameter_id = ioctl->parameter_id; - param->parameter_size_bytes = ioctl->parameter_size_bytes; - memcpy(param->data, ioctl->data, ioctl->parameter_size_bytes); - break; + if (ioctl->data != NULL) { + command_packet->byte0.opcode = TW_OP_SET_PARAM; + param->table_id = ioctl->table_id; + param->parameter_id = ioctl->parameter_id; + param->parameter_size_bytes = ioctl->parameter_size_bytes; + memcpy(param->data, ioctl->data, ioctl->parameter_size_bytes); + break; + } else { + printk(KERN_WARNING "3w-xxxx: tw_ioctl(): ioctl->data NULL.\n"); + return 1; + } case TW_OP_AEN_LISTEN: dprintk(KERN_NOTICE "3w-xxxx: tw_ioctl(): caught TW_OP_AEN_LISTEN.\n"); if (tw_dev->aen_head == tw_dev->aen_tail) { @@ -1313,11 +1455,15 @@ tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); return 0; case TW_CMD_PACKET: - memcpy(command_packet, ioctl->data, sizeof(TW_Command)); - command_packet->request_id = request_id; - tw_post_command_packet(tw_dev, request_id); - - return 0; + if (ioctl->data != NULL) { + memcpy(command_packet, ioctl->data, sizeof(TW_Command)); + command_packet->request_id = request_id; + tw_post_command_packet(tw_dev, request_id); + return 0; + } else { + printk(KERN_WARNING "3w-xxxx: tw_ioctl(): ioctl->data NULL.\n"); + return 1; + } default: printk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode); tw_dev->state[request_id] = TW_S_COMPLETED; @@ -1752,6 +1898,7 @@ tw_copy_info(&info, "Max sector count: %3d\n", tw_dev->max_sector_count); tw_copy_info(&info, "Resets: %3d\n", tw_dev->num_resets); tw_copy_info(&info, "Aborts: %3d\n", tw_dev->num_aborts); + tw_copy_info(&info, "AEN's: %3d\n", tw_dev->aen_count); } if (info.position > info.offset) { return (info.position - info.offset); @@ -1769,6 +1916,13 @@ int flags = 0; TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->host->hostdata; + if (tw_dev == NULL) { + printk(KERN_WARNING "3w-xxxx: tw_scsi_queue(): Invalid device extension.\n"); + SCpnt->result = (DID_ERROR << 16); + done(SCpnt); + return 0; + } + spin_lock_irqsave(&tw_dev->tw_lock, flags); dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_queue()\n"); @@ -1779,20 +1933,6 @@ spin_unlock_irqrestore(&tw_dev->tw_lock, flags); return 0; } - if (done == NULL) { - printk(KERN_WARNING "3w-xxxx: tw_scsi_queue(): Invalid done function.\n"); - SCpnt->result = (DID_ERROR << 16); - done(SCpnt); - spin_unlock_irqrestore(&tw_dev->tw_lock, flags); - return 0; - } - if (tw_dev == NULL) { - printk(KERN_WARNING "3w-xxxx: tw_scsi_queue(): Invalid device extension.\n"); - SCpnt->result = (DID_ERROR << 16); - done(SCpnt); - spin_unlock_irqrestore(&tw_dev->tw_lock, flags); - return 0; - } /* Save done function into Scsi_Cmnd struct */ SCpnt->scsi_done = done; @@ -2093,7 +2233,7 @@ TW_Command *command_packet; u32 command_que_addr, command_que_value = 0; u32 lba = 0x0, num_sectors = 0x0; - int i; + int i, count = 0; Scsi_Cmnd *srb; struct scatterlist *sglist; @@ -2151,29 +2291,52 @@ command_packet->byte8.io.lba = lba; command_packet->byte6.block_count = num_sectors; - /* Do this if there are no sg list entries */ - if (tw_dev->srb[request_id]->use_sg == 0) { - dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_read_write(): SG = 0\n"); - command_packet->byte8.io.sgl[0].address = virt_to_bus(tw_dev->srb[request_id]->request_buffer); - command_packet->byte8.io.sgl[0].length = tw_dev->srb[request_id]->request_bufflen; - } - - /* Do this if we have multiple sg list entries */ - if (tw_dev->srb[request_id]->use_sg > 0) { - for (i=0;isrb[request_id]->use_sg; i++) { - command_packet->byte8.io.sgl[i].address = virt_to_bus(sglist[i].address); - command_packet->byte8.io.sgl[i].length = sglist[i].length; - command_packet->size+=2; + if ((tw_dev->is_raid_five[tw_dev->srb[request_id]->target] == 0) || (srb->cmnd[0] == READ_6) || (srb->cmnd[0] == READ_10) || (tw_dev->tw_pci_dev->device == TW_DEVICE_ID2)) { + /* Do this if there are no sg list entries */ + if (tw_dev->srb[request_id]->use_sg == 0) { + dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_read_write(): SG = 0\n"); + command_packet->byte8.io.sgl[0].address = virt_to_bus(tw_dev->srb[request_id]->request_buffer); + command_packet->byte8.io.sgl[0].length = tw_dev->srb[request_id]->request_bufflen; + } + + /* Do this if we have multiple sg list entries */ + if (tw_dev->srb[request_id]->use_sg > 0) { + for (i=0;isrb[request_id]->use_sg; i++) { + command_packet->byte8.io.sgl[i].address = virt_to_bus(sglist[i].address); + command_packet->byte8.io.sgl[i].length = sglist[i].length; + command_packet->size+=2; + } + if (tw_dev->srb[request_id]->use_sg >= 1) + command_packet->size-=2; + } + } else { + /* Do this if there are no sg list entries for raid 5 */ + if (tw_dev->srb[request_id]->use_sg == 0) { + dprintk(KERN_WARNING "doing raid 5 write use_sg = 0, bounce_buffer[%d] = 0x%p\n", request_id, tw_dev->bounce_buffer[request_id]); + memcpy(tw_dev->bounce_buffer[request_id], tw_dev->srb[request_id]->request_buffer, tw_dev->srb[request_id]->request_bufflen); + command_packet->byte8.io.sgl[0].address = virt_to_bus(tw_dev->bounce_buffer[request_id]); + command_packet->byte8.io.sgl[0].length = tw_dev->srb[request_id]->request_bufflen; + } + + /* Do this if we have multiple sg list entries for raid 5 */ + if (tw_dev->srb[request_id]->use_sg > 0) { + dprintk(KERN_WARNING "doing raid 5 write use_sg = %d, sglist[0].length = %d\n", + tw_dev->srb[request_id]->use_sg, sglist[0].length); + for (i=0;isrb[request_id]->use_sg; i++) { + memcpy((char *)(tw_dev->bounce_buffer[request_id])+count, sglist[i].address, sglist[i].length); + count+=sglist[i].length; + } + command_packet->byte8.io.sgl[0].address = virt_to_bus(tw_dev->bounce_buffer[request_id]); + command_packet->byte8.io.sgl[0].length = count; + command_packet->size = 5; /* single sgl */ } - if (tw_dev->srb[request_id]->use_sg > 1) - command_packet->size-=2; } - + /* Update SG statistics */ tw_dev->sgl_entries = tw_dev->srb[request_id]->use_sg; if (tw_dev->sgl_entries > tw_dev->max_sgl_entries) tw_dev->max_sgl_entries = tw_dev->sgl_entries; - + command_que_value = tw_dev->command_packet_physical_address[request_id]; if (command_que_value == 0) { dprintk(KERN_WARNING "3w-xxxx: tw_scsiop_read_write(): Bad command packet physical address.\n"); @@ -2277,7 +2440,7 @@ /* Poll for completion */ imax = TW_POLL_MAX_RETRIES; for (i=0;i 11/2000 +(w) Kurt Garloff 04/2001 This file describes the osst driver as of version 0.8.x/0.9.x, the released version of the osst driver. @@ -45,7 +45,7 @@ So you could only have either of them being present in the kernel. This has been fixed by registering an own device, now. st and osst can coexist, each only accessing the devices it can support by -their own device. +themselves. Installation @@ -87,10 +87,11 @@ supported and you may try the mt (or mt_st) program to jump between filemarks, eject the tape, ... -There's one limitation: You need to use a block size of 32kB. - -(This limitation is worked on and will be fixed in version 0.8.7 of - this driver.) +There's one limitation: You need to use a block size of 512 bytes, 1kB, 2kB, +4kB, 8kB, 16kB or 32kB. The default block size is 512 bytes. However, your +backup software can transfer any multiple of the current block size. The +blocksize can be changed with: +mt -f /dev/nosst0 defblksize 1024 If you just want to get started with standard software, here is an example for creating and restoring a full backup: @@ -112,13 +113,42 @@ tar). +Interpreting log output +----------------------- +Log output of different severity is created by osst. Every message starts +with "osstX:S:" where X is the tape device (minor number modulo 32), or a +blank if not applicable, and S is the severity: + +:A: Assert, an error that "should not happen". If you get one of these and + have not changed anything in osst_options.h, report it to the mail list. + +:E: Error, your backup is toast (sorry). + +:W: Warning, something happened that endangers your data. Look for other + information to see if osst was able to recover. + +:I: Information which osst wants you to know. This could be follow-on info + on a previously issued warning or error. + +:D: Debug output, created when you compile with "#define DEBUG 1". + +This output is sent to klogd with corresponding priority. If you don't see +it in your system log (typically /var/log/messages), check your syslog.conf. + + USB and IDE ----------- Via the SCSI emulation layers usb-storage and ide-scsi, you can also use the osst driver to drive the USB-30 and the DI-30 drives. (Unfortunately, there is no such layer for the parallel port, otherwise the DP-30 would work as -well.) For the USB support, you need the latest 2.4.0-test kernels and the -latest usb-storage driver from +well.) + +For the DI-30, compile the SCSI layer and ide-scsi into the kernel and pass +hdX=scsi as boot parameter to your kernel, with hdX corresponding to your +OnStream device. + +For the USB support, you need the usb-sotrage driver of 2.4.0 kernel or +newer and you have to enable the Freecom support. For news, check http://www.linux-usb.org/ http://sourceforge.net/cvs/?group_id=3581 @@ -158,6 +188,11 @@ have been sent, but mostly reported success or only minor trouble. All the issues have been addressed. Check the web pages for more info about the current developments. +0.9.x is the tree for the 2.3/2.4 kernel. + +0.8.6.x and 0.9.4.x have been integrated into the mainstream kernels 2.2.19 +and 2.4.0 repsectively. Newer versions with variable block size support will +be submitted soon. Acknowledgments @@ -188,7 +223,7 @@ #!/bin/sh # Script to create OnStream SC-x0 device nodes (major 206) # Usage: Makedevs.sh [nos [path to dev]] -# $Id: README.osst.kernel,v 1.1.2.2 2000/12/20 14:08:38 garloff Exp $ +# $Id: README.osst.kernel,v 1.3.2.3 2001/06/02 23:49:03 riede Exp $ major=206 nrs=4 dir=/dev diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/advansys.c linux.20p9/drivers/scsi/advansys.c --- linux.vanilla/drivers/scsi/advansys.c Sun Mar 25 17:31:29 2001 +++ linux.20p9/drivers/scsi/advansys.c Wed Jul 4 16:03:57 2001 @@ -1,10 +1,10 @@ -#define ASC_VERSION "3.3D" /* AdvanSys Driver Version */ +#define ASC_VERSION "3.3G" /* AdvanSys Driver Version */ /* * advansys.c - Linux Host Driver for AdvanSys SCSI Adapters - * + * * Copyright (c) 1995-2000 Advanced System Products, Inc. - * Copyright (c) 2000 ConnectCom Solutions, Inc. + * Copyright (c) 2000-2001 ConnectCom Solutions, Inc. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,7 +13,7 @@ * modification. * * As of March 8, 2000 Advanced System Products, Inc. (AdvanSys) - * changed its name to name to ConnectCom Solutions, Inc. + * changed its name to ConnectCom Solutions, Inc. * * There is an AdvanSys Linux WWW page at: * http://www.connectcom.net/downloads/software/os/linux.html @@ -24,43 +24,39 @@ * ftp://ftp.connectcom.net/pub/linux/linux.tgz * * Please send questions, comments, bug reports to: - * linux@connectcom.net or bfrey@turbolinux.com.cn + * support@connectcom.net */ /* Documentation for the AdvanSys Driver - A. Linux Kernel Testing + A. Linux Kernels Supported by this Driver B. Adapters Supported by this Driver - C. Linux v1.2.X - Directions for Adding the AdvanSys Driver - D. Linux v1.3.1 - v1.3.57 - Directions for Adding the AdvanSys Driver - E. Linux v1.3.58 and Newer - Upgrading the AdvanSys Driver - F. Source Comments - G. Driver Compile Time Options and Debugging - H. Driver LILO Option - I. Release History - J. Known Problems/Fix List - K. Credits - L. ConnectCom (AdvanSys) Contact Information - - A. Linux Kernel Testing - - This driver has been tested in the following Linux kernels: v2.2.17 - v2.4.0-test9. The driver should also work in earlier versions of the - Linux kernel. Beginning with v1.3.58 the AdvanSys driver was included - with all Linux kernels. Please refer to sections C, D, and E for - instructions on adding or upgrading the AdvanSys driver. The driver is - supported for x86 and alpha systems. + C. Linux source files modified by AdvanSys Driver + D. Source Comments + E. Driver Compile Time Options and Debugging + F. Driver LILO Option + G. Tests to run before releasing new driver + H. Release History + I. Known Problems/Fix List + J. Credits (Chronological Order) + K. ConnectCom (AdvanSys) Contact Information + + A. Linux Kernels Supported by this Driver + + This driver has been tested in the following Linux kernels: v2.2.18 + v2.4.0. The driver is supported on v2.2 and v2.4 kernels and on x86, + alpha, and PowerPC platforms. B. Adapters Supported by this Driver - + AdvanSys (Advanced System Products, Inc.) manufactures the following RISC-based, Bus-Mastering, Fast (10 Mhz) and Ultra (20 Mhz) Narrow (8-bit transfer) SCSI Host Adapters for the ISA, EISA, VL, and PCI buses and RISC-based, Bus-Mastering, Ultra (20 Mhz) Wide (16-bit transfer) SCSI Host Adapters for the PCI bus. - + The CDB counts below indicate the number of SCSI CDB (Command Descriptor Block) requests that can be stored in the RISC chip cache and board LRAM. A CDB is a single SCSI command. The driver @@ -86,7 +82,7 @@ ABP930UA - Bus-Master PCI Ultra (16 CDB) ABP960 - Bus-Master PCI MAC/PC (16 CDB) ABP960U - Bus-Master PCI MAC/PC Ultra (16 CDB) - + Single Channel Products: ABP542 - Bus-Master ISA with floppy (240 CDB) ABP742 - Bus-Master EISA (240 CDB) @@ -100,7 +96,7 @@ ABP940UW/3940UW - Bus-Master PCI Ultra-Wide (253 CDB) ABP970UW - Bus-Master PCI MAC/PC Ultra-Wide (253 CDB) ABP3940U2W - Bus-Master PCI LVD/Ultra2-Wide (253 CDB) - + Multi-Channel Products: ABP752 - Dual Channel Bus-Master EISA (240 CDB Per Channel) ABP852 - Dual Channel Bus-Master VL (240 CDB Per Channel) @@ -111,37 +107,32 @@ ABP980UA/3980UA - Four Channel Bus-Master PCI Ultra (16 CDB Per Chan.) ABP3950U2W - Bus-Master PCI LVD/Ultra2-Wide and Ultra-Wide (253 CDB) ABP3950U3W - Bus-Master PCI Dual LVD2/Ultra3-Wide (253 CDB) - - C. Linux v1.2.X - Directions for Adding the AdvanSys Driver - These directions apply to v1.2.13. For versions that follow v1.2.13. - but precede v1.3.57 some of the changes for Linux v1.3.X listed - below may need to be modified or included. A patch is available - for v1.2.13 from the AdvanSys WWW and FTP sites. - - There are two source files: advansys.h and advansys.c. Copy - both of these files to the directory /usr/src/linux/drivers/scsi. - - 1. Add the following line to /usr/src/linux/arch/i386/config.in - after "comment 'SCSI low-level drivers'": - + C. Linux source files modified by AdvanSys Driver + + This section for historical purposes documents the changes + originally made to the Linux kernel source to add the advansys + driver. As Linux has changed some of these files have also + been modified. + + 1. linux/arch/i386/config.in: + bool 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS y - - 2. Add the following lines to /usr/src/linux/drivers/scsi/hosts.c - after "#include "hosts.h"": - + + 2. linux/drivers/scsi/hosts.c: + #ifdef CONFIG_SCSI_ADVANSYS #include "advansys.h" #endif - + and after "static Scsi_Host_Template builtin_scsi_hosts[] =": - + #ifdef CONFIG_SCSI_ADVANSYS ADVANSYS, #endif - - 3. Add the following lines to /usr/src/linux/drivers/scsi/Makefile: - + + 3. linux/drivers/scsi/Makefile: + ifdef CONFIG_SCSI_ADVANSYS SCSI_SRCS := $(SCSI_SRCS) advansys.c SCSI_OBJS := $(SCSI_OBJS) advansys.o @@ -149,12 +140,7 @@ SCSI_MODULE_OBJS := $(SCSI_MODULE_OBJS) advansys.o endif - 4. (Optional) If you would like to enable the LILO command line - and /etc/lilo.conf 'advansys' option, make the following changes. - This option can be used to disable I/O port scanning or to limit - I/O port scanning to specific addresses. Refer to the 'Driver - LILO Option' section below. Add the following lines to - /usr/src/linux/init/main.c in the prototype section: + 4. linux/init/main.c: extern void advansys_setup(char *str, int *ints); @@ -164,118 +150,19 @@ { "advansys=", advansys_setup }, #endif - 5. If you have the HP 4020i CD-R driver and Linux v1.2.X you should - add a fix to the CD-ROM target driver. This fix will allow - you to mount CDs with the iso9660 file system. Linux v1.3.X - already has this fix. In the file /usr/src/linux/drivers/scsi/sr.c - and function get_sectorsize() after the line: - - if(scsi_CDs[i].sector_size == 0) scsi_CDs[i].sector_size = 2048; - - add the following line: - - if(scsi_CDs[i].sector_size == 2340) scsi_CDs[i].sector_size = 2048; - - 6. In the directory /usr/src/linux run 'make config' to configure - the AdvanSys driver, then run 'make vmlinux' or 'make zlilo' to - make the kernel. If the AdvanSys driver is not configured, then - a loadable module can be built by running 'make modules' and - 'make modules_install'. Use 'insmod' and 'rmmod' to install - and remove advansys.o. - - D. Linux v1.3.1 - v1.3.57 - Directions for Adding the AdvanSys Driver - - These directions apply to v1.3.57. For versions that precede v1.3.57 - some of these changes may need to be modified or eliminated. A patch - is available for v1.3.57 from the AdvanSys WWW and FTP sites. - Beginning with v1.3.58 this driver is included with the Linux - distribution eliminating the need for making any changes. - - There are two source files: advansys.h and advansys.c. Copy - both of these files to the directory /usr/src/linux/drivers/scsi. - - 1. Add the following line to /usr/src/linux/drivers/scsi/Config.in - after "comment 'SCSI low-level drivers'": - - dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI - - 2. Add the following lines to /usr/src/linux/drivers/scsi/hosts.c - after "#include "hosts.h"": - - #ifdef CONFIG_SCSI_ADVANSYS - #include "advansys.h" - #endif - - and after "static Scsi_Host_Template builtin_scsi_hosts[] =": - - #ifdef CONFIG_SCSI_ADVANSYS - ADVANSYS, - #endif - - 3. Add the following lines to /usr/src/linux/drivers/scsi/Makefile: - - ifeq ($(CONFIG_SCSI_ADVANSYS),y) - L_OBJS += advansys.o - else - ifeq ($(CONFIG_SCSI_ADVANSYS),m) - M_OBJS += advansys.o - endif - endif - - 4. Add the following line to /usr/src/linux/include/linux/proc_fs.h - in the enum scsi_directory_inos array: - - PROC_SCSI_ADVANSYS, - - 5. (Optional) If you would like to enable the LILO command line - and /etc/lilo.conf 'advansys' option, make the following changes. - This option can be used to disable I/O port scanning or to limit - I/O port scanning to specific addresses. Refer to the 'Driver - LILO Option' section below. Add the following lines to - /usr/src/linux/init/main.c in the prototype section: - - extern void advansys_setup(char *str, int *ints); - - and add the following lines to the bootsetups[] array. - - #ifdef CONFIG_SCSI_ADVANSYS - { "advansys=", advansys_setup }, - #endif - - 6. In the directory /usr/src/linux run 'make config' to configure - the AdvanSys driver, then run 'make vmlinux' or 'make zlilo' to - make the kernel. If the AdvanSys driver is not configured, then - a loadable module can be built by running 'make modules' and - 'make modules_install'. Use 'insmod' and 'rmmod' to install - and remove advansys.o. - - E. Linux v1.3.58 and Newer - Upgrading the AdvanSys Driver - - To upgrade the AdvanSys driver in a Linux v1.3.58 and newer - kernel, first check the version of the current driver. The - version is defined by the manifest constant ASC_VERSION at - the beginning of advansys.c. The new driver should have a - ASC_VERSION value greater than the current version. To install - the new driver rename advansys.c and advansys.h in the Linux - kernel source tree drivers/scsi directory to different names - or save them to a different directory in case you want to revert - to the old version of the driver. After the old driver is saved - copy the new advansys.c and advansys.h to drivers/scsi, rebuild - the kernel, and install the new kernel. No other changes are needed. + D. Source Comments - F. Source Comments - 1. Use tab stops set to 4 for the source files. For vi use 'se tabstops=4'. - + 2. This driver should be maintained in multiple files. But to make it easier to include with Linux and to follow Linux conventions, the whole driver is maintained in the source files advansys.h and advansys.c. In this file logical sections of the driver begin with a comment that contains '---'. The following are the logical sections of the driver below. - + --- Linux Version - --- Linux Include Files + --- Linux Include File --- Driver Options --- Debugging Header --- Asc Library Constants and Macros @@ -292,27 +179,27 @@ --- Tracing and Debugging Functions --- Asc Library Functions --- Adv Library Functions - + 3. The string 'XXX' is used to flag code that needs to be re-written or that contains a problem that needs to be addressed. - + 4. I have stripped comments from and reformatted the source for the Asc Library and Adv Library to reduce the size of this file. This source can be found under the following headings. The Asc Library is used to support Narrow Boards. The Adv Library is used to support Wide Boards. - + --- Asc Library Constants and Macros --- Adv Library Constants and Macros --- Asc Library Functions --- Adv Library Functions - - G. Driver Compile Time Options and Debugging - + + E. Driver Compile Time Options and Debugging + In this source file the following constants can be defined. They are defined in the source below. Both of these options are enabled by default. - + 1. ADVANSYS_ASSERT - Enable driver assertions (Def: Enabled) Enabling this option adds assertion logic statements to the @@ -332,11 +219,11 @@ the kernel name space. This option is very useful for debugging the driver, but it will add to the size of the driver execution image and add overhead to the execution of the driver. - + The amount of debugging output can be controlled with the global variable 'asc_dbglvl'. The higher the number the more output. By default the debug level is 0. - + If the driver is loaded at boot time and the LILO Driver Option is included in the system, the debug level can be changed by specifying a 5th (ASC_NUM_IOPORT_PROBE + 1) I/O Port. The @@ -350,28 +237,44 @@ If the driver is built as a loadable module this variable can be defined when the driver is loaded. The following insmod command will set the debug level to one. - + insmod advansys.o asc_dbglvl=1 - + Debugging Message Levels: 0: Errors Only 1: High-Level Tracing 2-N: Verbose Tracing - - I don't know the approved way for turning on printk()s to the - console. Here's a program I use to do this. Debug output is - logged in /var/adm/messages. - + + To enable debug output to console, please make sure that: + + a. System and kernel logging is enabled (syslogd, klogd running). + b. Kernel messages are routed to console output. Check + /etc/syslog.conf for an entry similar to this: + + kern.* /dev/console + + c. klogd is started with the appropriate -c parameter + (e.g. klogd -c 8) + + This will cause printk() messages to be be displayed on the + current console. Refer to the klogd(8) and syslogd(8) man pages + for details. + + Alternatively you can enable printk() to console with this + program. However, this is not the 'official' way to do this. + Debug output is logged in /var/log/messages. + main() { syscall(103, 7, 0, 0); } - - I found that increasing LOG_BUF_LEN to 40960 in kernel/printk.c - prevents most level 1 debug messages from being lost. + + Increasing LOG_BUF_LEN in kernel/printk.c to something like + 40960 allows more debug messages to be buffered in the kernel + and written to the console or log file. 3. ADVANSYS_STATS - Enable statistics (Def: Enabled >= v1.3.0) - + Enabling this option adds statistics collection and display through /proc to the driver. The information is useful for monitoring driver and device performance. It will add to the @@ -394,8 +297,8 @@ When ADVANSYS_STATS is not defined the AdvanSys /proc files only contain adapter and device configuration information. - H. Driver LILO Option - + F. Driver LILO Option + If init/main.c is modified as described in the 'Directions for Adding the AdvanSys Driver to Linux' section (B.4.) above, the driver will recognize the 'advansys' LILO command line and /etc/lilo.conf option. @@ -425,9 +328,24 @@ the 'Driver Compile Time Options and Debugging' section above for more information. - I. Release History + G. Tests to run before releasing new driver + + 1. In the supported kernels verify there are no warning or compile + errors when the kernel is built as both a driver and as a module + and with the following options: + + ADVANSYS_DEBUG - enabled and disabled + CONFIG_SMP - enabled and disabled + CONFIG_PROC_FS - enabled and disabled - BETA-1.0 (12/23/95): + 2. Run tests on an x86, alpha, and PowerPC with at least one narrow + card and one wide card attached to a hard disk and CD-ROM drive: + fdisk, mkfs, fsck, bonnie, copy/compare test from the + CD-ROM to the hard drive. + + H. Release History + + BETA-1.0 (12/23/95): First Release BETA-1.1 (12/28/95): @@ -461,7 +379,7 @@ 4. Remove reset request loop problem from the "Known Problems or Issues" section. This problem was isolated and fixed in the mid-level SCSI driver. - + 1.5 (8/8/96): 1. Add support for ABP-940U (PCI Ultra) adapter. 2. Add support for IRQ sharing by setting the SA_SHIRQ flag for @@ -690,7 +608,7 @@ 3. For >= v2.3.28 use new SCSI error handling with new function advansys_eh_bus_reset(). Don't include an abort function because of base library limitations. - 4. For >= v2.3.28 use per board asc_lock instead of io_request_lock. + 4. For >= v2.3.28 use per board lock instead of io_request_lock. 5. For >= v2.3.28 eliminate advansys_command() and advansys_command_done(). 6. Add some changes for PowerPC (Big Endian) support, but it isn't @@ -708,8 +626,8 @@ 3.3B (5/1/00): 1. Support for PowerPC (Big Endian) wide cards. Narrow cards still need work. - 2. Change bitfields to shift and mask access for endian - portability. + 2. Change bitfields to shift and mask access for endian + portability. 3.3C (10/13/00): 1. Update for latest 2.4 kernel. @@ -721,7 +639,38 @@ 1. Update for latest 2.4 kernel. 2. Create patches for 2.2 and 2.4 kernels. - J. Known Problems/Fix List (XXX) + 3.3E (1/9/01): + 1. Now that 2.4 is released remove ifdef code for kernel versions + less than 2.2. The driver is now only supported in kernels 2.2, + 2.4, and greater. + 2. Add code to release and acquire the io_request_lock in + the driver entrypoint functions: advansys_detect and + advansys_queuecommand. In kernel 2.4 the SCSI mid-level driver + still holds the io_request_lock on entry to SCSI low-level drivers. + This was supposed to be removed before 2.4 was released but never + happened. When the mid-level SCSI driver is changed all references + to the io_request_lock should be removed from the driver. + 3. Simplify error handling by removing advansys_abort(), + AscAbortSRB(), AscResetDevice(). SCSI bus reset requests are + now handled by resetting the SCSI bus and fully re-initializing + the chip. This simple method of error recovery has proven to work + most reliably after attempts at different methods. Also now only + support the "new" error handling method and remove the obsolete + error handling interface. + 4. Fix debug build errors. + + 3.3F (1/24/01): + 1. Merge with ConnectCom version from Andy Kellner which + updates Adv Library to 5.14. + 2. Make PowerPC (Big Endian) work for narrow cards and + fix problems writing EEPROM for wide cards. + 3. Remove interrupts_enabled assertion function. + + 3.3G (2/16/01): + 1. Return an error from narrow boards if passed a 16 byte + CDB. The wide board can already handle 16 byte CDBs. + + I. Known Problems/Fix List (XXX) 1. Need to add memory mapping workaround. Test the memory mapping. If it doesn't work revert to I/O port access. Can a test be done @@ -731,13 +680,12 @@ has not occurred then print a message and run in polled mode. 3. Allow bus type scanning order to be changed. 4. Need to add support for target mode commands, cf. CAM XPT. - 5. Add PowerPC (Big Endian) support for narrow cards. - K. Credits + J. Credits (Chronological Order) - Bob Frey wrote the AdvanSys SCSI driver. - I no longer work for AdvanSys, but continue to maintain and support - the driver. + Bob Frey wrote the AdvanSys SCSI driver + and maintained it up to 3.3F. He continues to answer questions + and help maintain the driver. Nathan Hartwell provided the directions and basis for the Linux v1.3.X changes which were included in the @@ -763,7 +711,7 @@ in 3.2K. Tom Rini provided the CONFIG_ISA - patch and helped with PowerPC support. + patch and helped with PowerPC wide and narrow board support. Philip Blundell provided an advansys_interrupts_enabled patch. @@ -775,15 +723,27 @@ Jerry Quinn fixed PowerPC support (endian problems) for wide cards. - L. ConnectCom (AdvanSys) Contact Information - + Bryan Henderson helped debug narrow + card error handling. + + Manuel Veloso worked hard on PowerPC narrow + board support and fixed a bug in AscGetEEPConfig(). + + Arnaldo Carvalho de Melo made + save_flags/restore_flags changes. + + Andy Kellner continues the Advansys SCSI + driver development for ConnectCom (Version > 3.3F). + + K. ConnectCom (AdvanSys) Contact Information + Mail: ConnectCom Solutions, Inc. 1150 Ringwood Court San Jose, CA 95131 Operator/Sales: 1-408-383-9400 FAX: 1-408-383-9612 Tech Support: 1-408-467-2930 - Tech Support E-Mail: support@connectcom.net + Tech Support E-Mail: linux@connectcom.net FTP Site: ftp.connectcom.net (login: anonymous) Web Site: http://www.connectcom.net @@ -794,87 +754,62 @@ * --- Linux Version */ -/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ -#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) - #ifndef LINUX_VERSION_CODE #include #endif /* LINUX_VERSION_CODE */ +/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#define ASC_LINUX_KERNEL22 (LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0)) +#define ASC_LINUX_KERNEL24 (LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,4,0)) + +/* Driver supported only in version 2.2 and version >= 2.4. */ +#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,2,0) || \ + (LINUX_VERSION_CODE > ASC_LINUX_VERSION(2,3,0) && \ + LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0)) +#error "AdvanSys driver supported only in 2.2 and 2.4 or greater kernels." +#endif /* - * --- Linux Include Files + * --- Linux Include Files */ #include -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) #ifdef MODULE #include #endif /* MODULE */ -#endif /* version >= v1.3.0 */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,2,0) #if defined(CONFIG_X86) && !defined(CONFIG_ISA) #define CONFIG_ISA #endif /* CONFIG_X86 && !CONFIG_ISA */ -#else /* version < 2.2.0 */ -#define CONFIG_ISA -#endif /* version < 2.2.0 */ #include #include #include -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0) -#include -#endif /* verions < v2.1.0 */ #include #include #include #include #include -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) #include -#endif /* version >= v1.3.0 */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,23) #include -#endif /* version >= v2.1.23 */ #include #include #include -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -#include "../block/blk.h" -#else /* version >= v1.3.0 */ #include #include -#endif /* version >= v1.3.0 */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,18) +#if ASC_LINUX_KERNEL24 #include -#elif LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,95) +#elif ASC_LINUX_KERNEL22 #include -#endif /* version >= 2.1.95 */ +#endif #include "scsi.h" #include "hosts.h" #include "sd.h" #include "advansys.h" -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,93) #ifdef CONFIG_PCI #include #endif /* CONFIG_PCI */ -#else /* version < v2.1.93 */ -/* - * For earlier than v2.1.93 the driver has its own PCI configuration. - * If PCI is not needed in a kernel before v2.1.93 this define can be - * turned-off to make the driver object smaller. - */ -#define ASC_CONFIG_PCI -#endif /* version < v2.1.93 */ - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0) -#define cpu_to_le16(word) (word) -#define le16_to_cpu(word) (word) -#define cpu_to_le32(dword) (dword) -#define le32_to_cpu(dword) (dword) -#endif /* version < v2.1.0 */ /* @@ -884,19 +819,12 @@ /* Enable driver assertions. */ #define ADVANSYS_ASSERT +/* Enable driver /proc statistics. */ +#define ADVANSYS_STATS + /* Enable driver tracing. */ /* #define ADVANSYS_DEBUG */ -/* - * Because of no /proc to display them, statistics are disabled - * for versions prior to v1.3.0. - */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -#undef ADVANSYS_STATS /* Disable statistics */ -#else /* version >= v1.3.0 */ -#define ADVANSYS_STATS /* Enable statistics. */ -#endif /* version >= v1.3.0 */ - /* * --- Debugging Header @@ -925,7 +853,7 @@ * types must be used. In Linux the char, short, and int types * are all consistent at 8, 16, and 32 bits respectively. Pointers * and long types are 64 bits on Alpha and UltraSPARC. - */ + */ #define ASC_PADDR __u32 /* Physical/Bus address data type. */ #define ASC_VADDR __u32 /* Virtual address data type. */ #define ASC_DCNT __u32 /* Unsigned Data count type. */ @@ -974,7 +902,7 @@ #define ASC_PCI_VENDORID 0x10CD #define ASC_PCI_DEVICEID_1200A 0x1100 #define ASC_PCI_DEVICEID_1200B 0x1200 -#define ASC_PCI_DEVICEID_ULTRA 0x1300 +#define ASC_PCI_DEVICEID_ULTRA 0x1300 #define ASC_PCI_REVISION_3150 0x02 #define ASC_PCI_REVISION_3050 0x03 @@ -991,13 +919,13 @@ #define CC_VERY_LONG_SG_LIST 0 #define ASC_SRB2SCSIQ(srb_ptr) (srb_ptr) -#define PortAddr unsigned short /* port address size */ -#define inp(port) inb(port) -#define inpw(port) inw(port) -#define inpl(port) inl(port) -#define outp(port, byte) outb((byte), (port)) -#define outpw(port, word) outw((word), (port)) -#define outpl(port, dword) outl((dword), (port)) +#define PortAddr unsigned short /* port address size */ +#define inp(port) inb(port) +#define outp(port, byte) outb((byte), (port)) + +#define inpw(port) inw(port) +#define outpw(port, word) outw((word), (port)) + #define ASC_MAX_SG_QUEUE 7 #define ASC_MAX_SG_LIST 255 @@ -1044,12 +972,7 @@ #define ASC_MAX_ISA_DMA_COUNT (0x00FFFFFFL) #define ASC_MAX_EISA_DMA_ADDR (0x07FFFFFFL) #define ASC_MAX_EISA_DMA_COUNT (0x07FFFFFFL) -#ifndef inpw_noswap -#define inpw_noswap(port) inpw(port) -#endif -#ifndef outpw_noswap -#define outpw_noswap(port, data) outpw(port, data) -#endif + #define ASC_SCSI_ID_BITS 3 #define ASC_SCSI_TIX_TYPE uchar #define ASC_ALL_DEVICE_BIT_SET 0xFF @@ -1091,6 +1014,8 @@ #define SCSICMD_ReadHeader 0x44 #define SCSICMD_ModeSelect10 0x55 #define SCSICMD_ModeSense10 0x5A + +/* Inquiry Data Peripheral Device Types */ #define SCSI_TYPE_DASD 0x00 #define SCSI_TYPE_SASD 0x01 #define SCSI_TYPE_PRN 0x02 @@ -1102,10 +1027,20 @@ #define SCSI_TYPE_MED_CHG 0x08 #define SCSI_TYPE_COMM 0x09 #define SCSI_TYPE_UNKNOWN 0x1F -#define SCSI_TYPE_NO_DVC 0xFF -#define INQ_CLOCKING_ST_ONLY 0x0 -#define INQ_CLOCKING_DT_ONLY 0x1 -#define INQ_CLOCKING_ST_AND_DT 0x3 + +#define ADV_INQ_CLOCKING_ST_ONLY 0x0 +#define ADV_INQ_CLOCKING_DT_ONLY 0x1 +#define ADV_INQ_CLOCKING_ST_AND_DT 0x3 + +/* + * Inquiry SPC-2 SPI Byte 1 EVPD (Enable Vital Product Data) + * and CmdDt (Command Support Data) field bit definitions. + */ +#define ADV_INQ_RTN_VPD_AND_CMDDT 0x3 +#define ADV_INQ_RTN_CMDDT_FOR_OP_CODE 0x2 +#define ADV_INQ_RTN_VPD_FOR_PG_CODE 0x1 +#define ADV_INQ_RTN_STD_INQUIRY_DATA 0x0 + #define ASC_SCSIDIR_NOCHK 0x00 #define ASC_SCSIDIR_T2H 0x08 #define ASC_SCSIDIR_H2T 0x10 @@ -1169,77 +1104,49 @@ #define M2_QTAG_MSG_ORDERED 0x22 #define M2_IGNORE_WIDE_RESIDUE 0x23 -typedef struct { - uchar peri_dvc_type:5; - uchar peri_qualifier:3; -} ASC_SCSI_INQ0; - -typedef struct { - uchar dvc_type_modifier:7; - uchar rmb:1; -} ASC_SCSI_INQ1; - -typedef struct { - uchar ansi_apr_ver:3; - uchar ecma_ver:3; - uchar iso_ver:2; -} ASC_SCSI_INQ2; - -typedef struct { - uchar rsp_data_fmt:4; - uchar res:2; - uchar TemIOP:1; - uchar aenc:1; -} ASC_SCSI_INQ3; - -typedef struct { - uchar StfRe:1; - uchar CmdQue:1; - uchar Reserved:1; - uchar Linked:1; - uchar Sync:1; - uchar WBus16:1; - uchar WBus32:1; - uchar RelAdr:1; -} ASC_SCSI_INQ7; +/* + * Inquiry data structure and bitfield macros + * + * Only quantities of more than 1 bit are shifted, since the others are + * just tested for true or false. C bitfields aren't portable between big + * and little-endian platforms so they are not used. + */ + +#define ASC_INQ_DVC_TYPE(inq) ((inq)->periph & 0x1f) +#define ASC_INQ_QUALIFIER(inq) (((inq)->periph & 0xe0) >> 5) +#define ASC_INQ_DVC_TYPE_MOD(inq) ((inq)->devtype & 0x7f) +#define ASC_INQ_REMOVABLE(inq) ((inq)->devtype & 0x80) +#define ASC_INQ_ANSI_VER(inq) ((inq)->ver & 0x07) +#define ASC_INQ_ECMA_VER(inq) (((inq)->ver & 0x38) >> 3) +#define ASC_INQ_ISO_VER(inq) (((inq)->ver & 0xc0) >> 6) +#define ASC_INQ_RESPONSE_FMT(inq) ((inq)->byte3 & 0x0f) +#define ASC_INQ_TERM_IO(inq) ((inq)->byte3 & 0x40) +#define ASC_INQ_ASYNC_NOTIF(inq) ((inq)->byte3 & 0x80) +#define ASC_INQ_SOFT_RESET(inq) ((inq)->flags & 0x01) +#define ASC_INQ_CMD_QUEUE(inq) ((inq)->flags & 0x02) +#define ASC_INQ_LINK_CMD(inq) ((inq)->flags & 0x08) +#define ASC_INQ_SYNC(inq) ((inq)->flags & 0x10) +#define ASC_INQ_WIDE16(inq) ((inq)->flags & 0x20) +#define ASC_INQ_WIDE32(inq) ((inq)->flags & 0x40) +#define ASC_INQ_REL_ADDR(inq) ((inq)->flags & 0x80) +#define ASC_INQ_INFO_UNIT(inq) ((inq)->info & 0x01) +#define ASC_INQ_QUICK_ARB(inq) ((inq)->info & 0x02) +#define ASC_INQ_CLOCKING(inq) (((inq)->info & 0x0c) >> 2) typedef struct { - ASC_SCSI_INQ0 byte0; - ASC_SCSI_INQ1 byte1; - ASC_SCSI_INQ2 byte2; - ASC_SCSI_INQ3 byte3; + uchar periph; + uchar devtype; + uchar ver; + uchar byte3; uchar add_len; uchar res1; uchar res2; - ASC_SCSI_INQ7 byte7; + uchar flags; uchar vendor_id[8]; uchar product_id[16]; uchar product_rev_level[4]; } ASC_SCSI_INQUIRY; -typedef struct asc_req_sense { - uchar err_code:7; - uchar info_valid:1; - uchar segment_no; - uchar sense_key:4; - uchar reserved_bit:1; - uchar sense_ILI:1; - uchar sense_EOM:1; - uchar file_mark:1; - uchar info1[4]; - uchar add_sense_len; - uchar cmd_sp_info[4]; - uchar asc; - uchar ascq; - uchar fruc; - uchar sks_byte0:7; - uchar sks_valid:1; - uchar sks_bytes[2]; - uchar notused[2]; - uchar ex_sense_code; - uchar info2[4]; -} ASC_REQ_SENSE; - #define ASC_SG_LIST_PER_Q 7 #define QS_FREE 0x00 #define QS_READY 0x01 @@ -1353,7 +1260,7 @@ #define ASC_TIX_TO_LUN(tix) (((tix) >> ASC_SCSI_ID_BITS) & ASC_MAX_LUN) #define ASC_QNO_TO_QADDR(q_no) ((ASC_QADR_BEG)+((int)(q_no) << 6)) -typedef struct asc_scisq_1 { +typedef struct asc_scsiq_1 { uchar status; uchar q_no; uchar cntl; @@ -1367,7 +1274,7 @@ uchar extra_bytes; } ASC_SCSIQ_1; -typedef struct asc_scisq_2 { +typedef struct asc_scsiq_2 { ASC_VADDR srb_ptr; uchar target_ix; uchar flag; @@ -1445,8 +1352,8 @@ typedef struct asc_scsi_req_q { ASC_SCSIQ_1 r1; ASC_SCSIQ_2 r2; - uchar *cdbptr; - ASC_SG_HEAD *sg_head; + uchar *cdbptr; + ASC_SG_HEAD *sg_head; uchar *sense_ptr; ASC_SCSIQ_3 r3; uchar cdb[ASC_MAX_CDB_LEN]; @@ -1528,6 +1435,10 @@ #define ASCQ_ERR_SEND_SCSI_Q 0x22 #define ASCQ_ERR_HOST_REQ_RISC_HALT 0x23 #define ASCQ_ERR_RESET_SDTR 0x24 + +/* + * Warning code values are set in ASC_DVC_VAR 'warn_code'. + */ #define ASC_WARN_NO_ERROR 0x0000 #define ASC_WARN_IO_PORT_ROTATE 0x0001 #define ASC_WARN_EEPROM_CHKSUM 0x0002 @@ -1537,6 +1448,10 @@ #define ASC_WARN_EEPROM_RECOVER 0x0020 #define ASC_WARN_CFG_MSW_RECOVER 0x0040 #define ASC_WARN_SET_PCI_CONFIG_SPACE 0x0080 + +/* + * Error code values are set in ASC_DVC_VAR 'err_code'. + */ #define ASC_IERR_WRITE_EEPROM 0x0001 #define ASC_IERR_MCODE_CHKSUM 0x0002 #define ASC_IERR_SET_PC_ADDR 0x0004 @@ -1551,6 +1466,7 @@ #define ASC_IERR_SCAM 0x0800 #define ASC_IERR_SET_SDTR 0x1000 #define ASC_IERR_RW_LRAM 0x8000 + #define ASC_DEF_IRQ_NO 10 #define ASC_MAX_IRQ_NO 15 #define ASC_MIN_IRQ_NO 10 @@ -1771,19 +1687,10 @@ #define ASC_EEP_ISA_PNP_WSIZE 16 /* - * This struct is filled in by reading ushorts from the board in - * order. Therefore, order of fields matters. - * ASCEEP_Config_Field_IsChar indicates when a ushort actually - * contains two chars. On big_endian machines, the byte-swap needs to - * be undone to put the chars in order. When an entry in - * ASCEEP_Config_Field_IsChar is 1, it indicates that the swap is - * needed. - */ - -/* - * These macros allow us to keep the chip scsi id and isa dma speed - * bitfields in board order. C bitfields aren't portable across - * endianness. + * These macros keep the chip SCSI id and ISA DMA speed + * bitfields in board order. C bitfields aren't portable + * between big and little-endian platforms so they are + * not used. */ #define ASC_EEP_GET_CHIP_ID(cfg) ((cfg)->id_speed & 0x0f) @@ -1806,32 +1713,13 @@ uchar power_up_wait; uchar no_scam; uchar id_speed; /* low order 4 bits is chip scsi id */ - /* high order 4 bits is isa dma speed */ + /* high order 4 bits is isa dma speed */ uchar dos_int13_table[ASC_MAX_TID + 1]; uchar adapter_info[6]; ushort cntl; ushort chksum; } ASCEEP_CONFIG; -STATIC ASCEEP_CONFIG ASCEEP_Config_Field_IsChar = { - 0, /* cfg_lsw */ - 0, /* cfg_msw */ - 1, /* init_sdtr */ - 1, /* disc_enable */ - 1, /* use_cmd_qng */ - 1, /* start_motor */ - 1, /* max_total_qng */ - 1, /* max_tag_qng */ - 1, /* bios_scan */ - 1, /* power_up_wait */ - 1, /* no_scam */ - 1, /* id_speed */ - { 1,1,1,1,1,1,1,1 }, /* dos_int13_table[ASC_MAX_TID + 1] */ - { 1,1,1,1,1,1 }, /* adapter_info[6] */ - 0, /* cntl */ - 0, /* chksum */ -}; - #define ASC_PCI_CFG_LSW_SCSI_PARITY 0x0800 #define ASC_PCI_CFG_LSW_BURST_MODE 0x0080 #define ASC_PCI_CFG_LSW_INTR_ABLE 0x0020 @@ -2071,8 +1959,6 @@ #define AscSetChipLramAddr(port, addr) outpw((PortAddr)((port)+IOP_RAM_ADDR), addr) #define AscGetChipLramData(port) (ushort)inpw((port)+IOP_RAM_DATA) #define AscSetChipLramData(port, data) outpw((port)+IOP_RAM_DATA, data) -#define AscGetChipLramDataNoSwap(port) (ushort)inpw_noswap((port)+IOP_RAM_DATA) -#define AscSetChipLramDataNoSwap(port, data) outpw_noswap((port)+IOP_RAM_DATA, data) #define AscGetChipIFC(port) (uchar)inp((port)+IOP_REG_IFC) #define AscSetChipIFC(port, data) outp((port)+IOP_REG_IFC, data) #define AscGetChipStatus(port) (ASC_CS_TYPE)inpw((port)+IOP_STATUS) @@ -2138,15 +2024,16 @@ #endif /* CONFIG_ISA */ STATIC uchar AscReadLramByte(PortAddr, ushort); STATIC ushort AscReadLramWord(PortAddr, ushort); +#if CC_VERY_LONG_SG_LIST STATIC ASC_DCNT AscReadLramDWord(PortAddr, ushort); +#endif /* CC_VERY_LONG_SG_LIST */ STATIC void AscWriteLramWord(PortAddr, ushort, ushort); -STATIC void AscWriteLramDWord(PortAddr, ushort, ASC_DCNT); STATIC void AscWriteLramByte(PortAddr, ushort, uchar); STATIC ASC_DCNT AscMemSumLramWord(PortAddr, ushort, int); STATIC void AscMemWordSetLram(PortAddr, ushort, ushort, int); -STATIC void AscMemWordCopyToLram(PortAddr, ushort, ushort *, int); -STATIC void AscMemDWordCopyToLram(PortAddr, ushort, ASC_DCNT *, int); -STATIC void AscMemWordCopyFromLram(PortAddr, ushort, ushort *, int); +STATIC void AscMemWordCopyPtrToLram(PortAddr, ushort, uchar *, int); +STATIC void AscMemDWordCopyPtrToLram(PortAddr, ushort, uchar *, int); +STATIC void AscMemWordCopyPtrFromLram(PortAddr, ushort, uchar *, int); STATIC ushort AscInitAscDvcVar(ASC_DVC_VAR *); STATIC ushort AscInitFromEEP(ASC_DVC_VAR *); STATIC ushort AscInitFromAscDvcVar(ASC_DVC_VAR *); @@ -2158,25 +2045,8 @@ STATIC uchar AscGetSynPeriodIndex(ASC_DVC_VAR *, uchar); STATIC uchar AscAllocFreeQueue(PortAddr, uchar); STATIC uchar AscAllocMultipleFreeQueue(PortAddr, uchar, uchar); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int AscRiscHaltedAbortSRB(ASC_DVC_VAR *, ASC_DCNT); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) -STATIC int AscRiscHaltedAbortTIX(ASC_DVC_VAR *, uchar); -#endif /* version >= v1.3.89 */ -#endif /* version < v2.3.28 */ STATIC int AscHostReqRiscHalt(PortAddr); STATIC int AscStopQueueExe(PortAddr); -STATIC int AscStartQueueExe(PortAddr); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) -STATIC int AscCleanUpDiscQueue(PortAddr); -#endif /* version >= v1.3.89 */ -STATIC int AscCleanUpBusyQueue(PortAddr); -#endif /* version < v2.3.28 */ -STATIC int AscWaitTixISRDone(ASC_DVC_VAR *, uchar); -STATIC int AscWaitISRDone(ASC_DVC_VAR *); -STATIC ASC_PADDR AscGetOnePhyAddr(ASC_DVC_VAR *, uchar *, - ASC_DCNT); STATIC int AscSendScsiQueue(ASC_DVC_VAR *, ASC_SCSI_Q * scsiq, uchar n_q_required); @@ -2187,13 +2057,8 @@ STATIC int AscSetChipSynRegAtID(PortAddr, uchar, uchar); STATIC int AscSetRunChipSynRegAtID(PortAddr, uchar, uchar); STATIC ushort AscInitLram(ASC_DVC_VAR *); -STATIC int AscReInitLram(ASC_DVC_VAR *); STATIC ushort AscInitQLinkVar(ASC_DVC_VAR *); STATIC int AscSetLibErrorCode(ASC_DVC_VAR *, ushort); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) && \ - LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int _AscWaitQDone(PortAddr, ASC_SCSI_Q *); -#endif /* version >= v1.3.89 && version < v2.3.28 */ STATIC int AscIsrChipHalted(ASC_DVC_VAR *); STATIC uchar _AscCopyLramScsiDoneQ(PortAddr, ushort, ASC_QDONE_INFO *, ASC_DCNT); @@ -2211,27 +2076,24 @@ STATIC uchar AscSetChipScsiID(PortAddr, uchar); STATIC uchar AscGetChipVersion(PortAddr, ushort); STATIC ushort AscGetChipBusType(PortAddr); -STATIC ASC_DCNT AscLoadMicroCode(PortAddr, ushort, ushort *, ushort); +STATIC ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort); STATIC int AscFindSignature(PortAddr); STATIC void AscToggleIRQAct(PortAddr); STATIC uchar AscGetChipIRQ(PortAddr, ushort); STATIC uchar AscSetChipIRQ(PortAddr, uchar, ushort); STATIC ushort AscGetChipBiosAddress(PortAddr, ushort); -STATIC int DvcEnterCritical(void); -STATIC void DvcLeaveCritical(int); -STATIC void DvcInPortWords(PortAddr, ushort *, int); -STATIC void DvcOutPortWords(PortAddr, ushort *, int); -STATIC void DvcOutPortDWords(PortAddr, ASC_DCNT *, int); +STATIC inline ulong DvcEnterCritical(void); +STATIC inline void DvcLeaveCritical(ulong); +#ifdef CONFIG_PCI STATIC uchar DvcReadPCIConfigByte(ASC_DVC_VAR *, ushort); STATIC void DvcWritePCIConfigByte(ASC_DVC_VAR *, ushort, uchar); +#endif /* CONFIG_PCI */ STATIC ushort AscGetChipBiosAddress(PortAddr, ushort); STATIC void DvcSleepMilliSecond(ASC_DCNT); STATIC void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT); -STATIC ASC_DCNT DvcGetSGList(ASC_DVC_VAR *, uchar *, - ASC_DCNT, ASC_SG_HEAD *); -STATIC void DvcPutScsiQ(PortAddr, ushort, ushort *, int); -STATIC void DvcGetQinfo(PortAddr, ushort, ushort *, int); +STATIC void DvcPutScsiQ(PortAddr, ushort, uchar *, int); +STATIC void DvcGetQinfo(PortAddr, ushort, uchar *, int); STATIC ushort AscInitGetConfig(ASC_DVC_VAR *); STATIC ushort AscInitSetConfig(ASC_DVC_VAR *); STATIC ushort AscInitAsc1000Driver(ASC_DVC_VAR *); @@ -2245,13 +2107,6 @@ STATIC uint AscGetNumOfFreeQueue(ASC_DVC_VAR *, uchar, uchar); STATIC int AscSgListToQueue(int); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int AscAbortSRB(ASC_DVC_VAR *, ASC_VADDR); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) -STATIC int AscResetDevice(ASC_DVC_VAR *, uchar); -#endif /* version >= v1.3.89 */ -#endif /* version < v2.3.28 */ -STATIC int AscResetSB(ASC_DVC_VAR *); #ifdef CONFIG_ISA STATIC void AscEnableIsaDma(uchar); #endif /* CONFIG_ISA */ @@ -2263,7 +2118,7 @@ */ #define ADV_LIB_VERSION_MAJOR 5 -#define ADV_LIB_VERSION_MINOR 12 +#define ADV_LIB_VERSION_MINOR 14 /* d_os_dep.h */ #define ADV_OS_LINUX @@ -2280,7 +2135,7 @@ * types must be used. In Linux the char, short, and int types * are all consistent at 8, 16, and 32 bits respectively. Pointers * and long types are 64 bits on Alpha and UltraSPARC. - */ + */ #define ADV_PADDR __u32 /* Physical address data type. */ #define ADV_VADDR __u32 /* Virtual address data type. */ #define ADV_DCNT __u32 /* Unsigned Data count type. */ @@ -2297,11 +2152,7 @@ #define ADV_VADDR_TO_U32 virt_to_bus #define ADV_U32_TO_VADDR bus_to_virt -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -#define AdvPortAddr unsigned short /* I/O Port address size */ -#else /* version >= v1,3,0 */ #define AdvPortAddr ulong /* Virtual memory address size */ -#endif /* version >= v1,3,0 */ /* * Define Adv Library required memory access macros. @@ -2312,14 +2163,6 @@ #define ADV_MEM_WRITEW(addr, word) writew(word, addr) #define ADV_MEM_WRITEDW(addr, dword) writel(dword, addr) -/* - * The I/O memory mapping function names changed in 2.1.X. - */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0) -#define ioremap vremap -#define iounmap vfree -#endif /* version < v2.1.0 */ - #define ADV_CARRIER_COUNT (ASC_DEF_MAX_HOST_QNG + 15) /* @@ -2336,7 +2179,7 @@ * elements. Allow each command to have at least one ADV_SG_BLOCK structure. * This allows about 15 commands to have the maximum 17 ADV_SG_BLOCK * structures or 255 scatter-gather elements. - * + * */ #define ADV_TOT_SG_BLOCK ASC_DEF_MAX_HOST_QNG @@ -2354,10 +2197,10 @@ #define ADV_SG_TOTAL_MEM_SIZE \ (sizeof(ADV_SG_BLOCK) * ADV_NUM_SG_BLOCK) -#define ASC_PAGE_SIZE PAGE_SIZE +#define ADV_PAGE_SIZE PAGE_SIZE #define ADV_NUM_PAGE_CROSSING \ - ((ADV_SG_TOTAL_MEM_SIZE + (ASC_PAGE_SIZE - 1))/ASC_PAGE_SIZE) + ((ADV_SG_TOTAL_MEM_SIZE + (ADV_PAGE_SIZE - 1))/ADV_PAGE_SIZE) /* a_condor.h */ #define ADV_PCI_VENDOR_ID 0x10CD @@ -2365,12 +2208,12 @@ #define ADV_PCI_DEVID_38C0800_REV1 0x2500 #define ADV_PCI_DEVID_38C1600_REV1 0x2700 -#define ASC_EEP_DVC_CFG_BEGIN (0x00) -#define ASC_EEP_DVC_CFG_END (0x15) -#define ASC_EEP_DVC_CTL_BEGIN (0x16) /* location of OEM name */ -#define ASC_EEP_MAX_WORD_ADDR (0x1E) +#define ADV_EEP_DVC_CFG_BEGIN (0x00) +#define ADV_EEP_DVC_CFG_END (0x15) +#define ADV_EEP_DVC_CTL_BEGIN (0x16) /* location of OEM name */ +#define ADV_EEP_MAX_WORD_ADDR (0x1E) -#define ASC_EEP_DELAY_MS 100 +#define ADV_EEP_DELAY_MS 100 #define ADV_EEPROM_BIG_ENDIAN 0x8000 /* EEPROM Bit 15 */ #define ADV_EEPROM_BIOS_ENABLE 0x4000 /* EEPROM Bit 14 */ @@ -2403,20 +2246,20 @@ /* bit 14 set - BIOS Enable */ /* bit 15 set - Big Endian Mode */ ushort cfg_msw; /* 01 unused */ - ushort disc_enable; /* 02 disconnect enable */ + ushort disc_enable; /* 02 disconnect enable */ ushort wdtr_able; /* 03 Wide DTR able */ ushort sdtr_able; /* 04 Synchronous DTR able */ - ushort start_motor; /* 05 send start up motor */ + ushort start_motor; /* 05 send start up motor */ ushort tagqng_able; /* 06 tag queuing able */ - ushort bios_scan; /* 07 BIOS device control */ - ushort scam_tolerant; /* 08 no scam */ - + ushort bios_scan; /* 07 BIOS device control */ + ushort scam_tolerant; /* 08 no scam */ + uchar adapter_scsi_id; /* 09 Host Adapter ID */ uchar bios_boot_delay; /* power up wait */ - + uchar scsi_reset_delay; /* 10 reset delay */ uchar bios_id_lun; /* first boot device scsi id & lun */ - /* high nibble is lun */ + /* high nibble is lun */ /* low nibble is scsi id */ uchar termination; /* 11 0 - automatic */ @@ -2425,7 +2268,7 @@ /* 3 - low on / high on */ /* There is no low on / high off */ - uchar reserved1; /* reserved byte (not used) */ + uchar reserved1; /* reserved byte (not used) */ ushort bios_ctrl; /* 12 BIOS control bits */ /* bit 0 BIOS don't act as initiator. */ @@ -2444,14 +2287,14 @@ /* bit 13 */ /* bit 14 */ /* bit 15 */ - ushort ultra_able; /* 13 ULTRA speed able */ + ushort ultra_able; /* 13 ULTRA speed able */ ushort reserved2; /* 14 reserved */ uchar max_host_qng; /* 15 maximum host queuing */ uchar max_dvc_qng; /* maximum per device queuing */ ushort dvc_cntl; /* 16 control bit for driver */ ushort bug_fix; /* 17 control bit for bug fix */ - ushort serial_number_word1; /* 18 Board serial number word 1 */ - ushort serial_number_word2; /* 19 Board serial number word 2 */ + ushort serial_number_word1; /* 18 Board serial number word 1 */ + ushort serial_number_word2; /* 19 Board serial number word 2 */ ushort serial_number_word3; /* 20 Board serial number word 3 */ ushort check_sum; /* 21 EEP check sum */ uchar oem_name[16]; /* 22 OEM name */ @@ -2460,9 +2303,9 @@ ushort adv_err_addr; /* 32 last uc error address */ ushort saved_dvc_err_code; /* 33 saved last dev. driver error code */ ushort saved_adv_err_code; /* 34 saved last uc and Adv Lib error code */ - ushort saved_adv_err_addr; /* 35 saved last uc error address */ + ushort saved_adv_err_addr; /* 35 saved last uc error address */ ushort num_of_err; /* 36 number of error */ -} ADVEEP_3550_CONFIG; +} ADVEEP_3550_CONFIG; typedef struct adveep_38C0800_config { @@ -2698,11 +2541,9 @@ #define ADV_38C0800_IOLEN 0x100 /* I/O Port Range in bytes */ /* - * - * XXX - Since ASC38C1600 Rev.3 has a Local RAM failure issue, we come out - * a special 16K Adv Library and Microcode version. After the issue resolved, - * we should turn back to the 32K support. Both a_init.c and mcode.sas files - * also need to be updated. + * XXX - Since ASC38C1600 Rev.3 has a local RAM failure issue, there is + * a special 16K Adv Library and Microcode version. After the issue is + * resolved, should restore 32K support. * * #define ADV_38C1600_MEMSIZE 0x8000L * 32 KB Internal Memory * */ @@ -2907,8 +2748,8 @@ #define SLEW_RATE 0x1000 /* SCSI output buffer slew rate */ #define FILTER_SEL 0x0C00 /* Filter Period Selection */ #define FLTR_DISABLE 0x0000 /* Input Filtering Disabled */ -#define FLTR_11_TO_20NS 0x0800 /* Input Filtering 11ns to 20ns */ -#define FLTR_21_TO_39NS 0x0C00 /* Input Filtering 21ns to 39ns */ +#define FLTR_11_TO_20NS 0x0800 /* Input Filtering 11ns to 20ns */ +#define FLTR_21_TO_39NS 0x0C00 /* Input Filtering 21ns to 39ns */ #define ACTIVE_DBL 0x0200 /* Disable Active Negation */ #define DIFF_MODE 0x0100 /* SCSI differential Mode (Read-Only) */ #define DIFF_SENSE 0x0080 /* 1: No SE cables, 0: SE cable (Read-Only) */ @@ -3048,7 +2889,7 @@ /* - * ASC_DVC_VAR 'warn_code' values + * ADV_DVC_VAR 'warn_code' values */ #define ASC_WARN_BUSRESET_ERROR 0x0001 /* SCSI Bus Reset error */ #define ASC_WARN_EEPROM_CHKSUM 0x0002 /* EEP check sum error */ @@ -3059,11 +2900,8 @@ #define ADV_MAX_TID 15 /* max. target identifier */ #define ADV_MAX_LUN 7 /* max. logical unit number */ - /* - * AscInitGetConfig() and AscInitAsc1000Driver() Definitions - * - * Error code values are set in ASC_DVC_VAR 'err_code'. + * Error code values are set in ADV_DVC_VAR 'err_code'. */ #define ASC_IERR_WRITE_EEPROM 0x0001 /* write EEPROM error */ #define ASC_IERR_MCODE_CHKSUM 0x0002 /* micro code check sum error */ @@ -3196,8 +3034,6 @@ #define ASC_GET_CARRP(carrp) ((carrp) & ASC_NEXT_VPA_MASK) -#define ADV_PAGE_SIZE 4096 /* Assume 4KB page size. */ - #define ADV_CARRIER_NUM_PAGE_CROSSING \ (((ADV_CARRIER_COUNT * sizeof(ADV_CARR_T)) + \ (ADV_PAGE_SIZE - 1))/ADV_PAGE_SIZE) @@ -3225,7 +3061,7 @@ * This structure can be discarded after initialization. Don't add * fields here needed after initialization. * - * Field naming convention: + * Field naming convention: * * *_enable indicates the field enables or disables a feature. The * value of the field is never reset. @@ -3245,7 +3081,7 @@ ushort serial1; /* EEPROM serial number word 1 */ ushort serial2; /* EEPROM serial number word 2 */ ushort serial3; /* EEPROM serial number word 3 */ -} ADV_DVC_CFG; +} ADV_DVC_CFG; struct adv_dvc_var; struct adv_scsi_req_q; @@ -3261,7 +3097,7 @@ * * One structure is required per host adapter. * - * Field naming convention: + * Field naming convention: * * *_able indicates both whether a feature should be enabled or disabled * and whether a device isi capable of the feature. At initialization @@ -3304,13 +3140,13 @@ * driver may discard the buffer after initialization is done. */ ADV_DVC_CFG *cfg; /* temporary configuration structure */ -} ADV_DVC_VAR; +} ADV_DVC_VAR; #define NO_OF_SG_PER_BLOCK 15 typedef struct asc_sg_block { - uchar reserved1; - uchar reserved2; + uchar reserved1; + uchar reserved2; uchar reserved3; uchar sg_cnt; /* Valid entries in block. */ ADV_PADDR sg_ptr; /* Pointer to next sg block. */ @@ -3362,7 +3198,7 @@ ADV_SG_BLOCK *sg_list_ptr; /* SG list virtual address. */ char *vdata_addr; /* Data buffer virtual address. */ uchar a_flag; - uchar pad[2]; /* Pad out to a word boundary. */ + uchar pad[2]; /* Pad out to a word boundary. */ } ADV_SCSI_REQ_Q; /* @@ -3406,8 +3242,8 @@ /* * Device drivers must define the following functions. */ -STATIC int DvcEnterCritical(void); -STATIC void DvcLeaveCritical(int); +STATIC inline ulong DvcEnterCritical(void); +STATIC inline void DvcLeaveCritical(ulong); STATIC void DvcSleepMilliSecond(ADV_DCNT); STATIC uchar DvcAdvReadPCIConfigByte(ADV_DVC_VAR *, ushort); STATIC void DvcAdvWritePCIConfigByte(ADV_DVC_VAR *, ushort, uchar); @@ -3450,68 +3286,6 @@ #define AscPCICmdRegBits_BusMastering 0x0007 #define AscPCICmdRegBits_ParErrRespCtrl 0x0040 -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) - -/* Read byte from a register. */ -#define AdvReadByteRegister(iop_base, reg_off) \ - (inp((iop_base) + (reg_off))) - -/* Write byte to a register. */ -#define AdvWriteByteRegister(iop_base, reg_off, byte) \ - (outp((iop_base) + (reg_off), (byte))) - -/* Read word (2 bytes) from a register. */ -#define AdvReadWordRegister(iop_base, reg_off) \ - (le16_to_cpu(inpw((iop_base) + (reg_off)))) - -/* Write word (2 bytes) to a register. */ -#define AdvWriteWordRegister(iop_base, reg_off, word) \ - (outpw((iop_base) + (reg_off), cpu_to_le16(word))) - -/* Read byte from LRAM. */ -#define AdvReadByteLram(iop_base, addr, byte) \ -do { \ - outpw((iop_base) + IOPW_RAM_ADDR, (addr)); \ - (byte) = inp((iop_base) + IOPB_RAM_DATA); \ -} while (0) - -/* Write byte to LRAM. */ -#define AdvWriteByteLram(iop_base, addr, byte) \ - (outpw((iop_base) + IOPW_RAM_ADDR, (addr)), \ - outp((iop_base) + IOPB_RAM_DATA, (byte))) - -/* Read word (2 bytes) from LRAM. */ -#define AdvReadWordLram(iop_base, addr, word) \ -do { \ - outpw((iop_base) + IOPW_RAM_ADDR, (addr)); \ - (word) = le16_to_cpu(inpw((iop_base) + IOPW_RAM_DATA)); \ -} while (0) - -/* Write word (2 bytes) to LRAM. */ -#define AdvWriteWordLram(iop_base, addr, word) \ - (outpw((iop_base) + IOPW_RAM_ADDR, (addr)), \ - outpw((iop_base) + IOPW_RAM_DATA, cpu_to_le16(word))) - -/* Write double word (4 bytes) to LRAM */ -/* Because of unspecified C language ordering don't use auto-increment. */ -#define AdvWriteDWordLram(iop_base, addr, dword) \ - ((outpw((iop_base) + IOPW_RAM_ADDR, (addr)), \ - outpw((iop_base) + IOPW_RAM_DATA, \ - cpu_to_le16((ushort) ((dword) & 0xFFFF)))), \ - (outpw((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \ - outpw((iop_base) + IOPW_RAM_DATA, \ - cpu_to_le16((ushort) ((dword >> 16) & 0xFFFF))))) - -/* Read word (2 bytes) from LRAM assuming that the address is already set. */ -#define AdvReadWordAutoIncLram(iop_base) \ - (le16_to_cpu(inpw((iop_base) + IOPW_RAM_DATA))) - -/* Write word (2 bytes) to LRAM assuming that the address is already set. */ -#define AdvWriteWordAutoIncLram(iop_base, word) \ - (outpw((iop_base) + IOPW_RAM_DATA, cpu_to_le16(word))) - -#else /* version >= v1,3,0 */ - /* Read byte from a register. */ #define AdvReadByteRegister(iop_base, reg_off) \ (ADV_MEM_READB((iop_base) + (reg_off))) @@ -3556,15 +3330,15 @@ (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \ ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word))) -/* Write double word (4 bytes) to LRAM */ +/* Write little-endian double word (4 bytes) to LRAM */ /* Because of unspecified C language ordering don't use auto-increment. */ -#define AdvWriteDWordLram(iop_base, addr, dword) \ +#define AdvWriteDWordLramNoSwap(iop_base, addr, dword) \ ((ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \ ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \ - ((ushort) ((dword) & 0xFFFF)))), \ + cpu_to_le16((ushort) ((dword) & 0xFFFF)))), \ (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \ ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \ - ((ushort) ((dword >> 16) & 0xFFFF))))) + cpu_to_le16((ushort) ((dword >> 16) & 0xFFFF))))) /* Read word (2 bytes) from LRAM assuming that the address is already set. */ #define AdvReadWordAutoIncLram(iop_base) \ @@ -3574,7 +3348,6 @@ #define AdvWriteWordAutoIncLram(iop_base, word) \ (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word))) -#endif /* version >= v1,3,0 */ /* * Define macro to check for Condor signature. @@ -3599,7 +3372,7 @@ /* * Abort an SRB in the chip's RISC Memory. The 'srb_ptr' argument must * match the ASC_SCSI_REQ_Q 'srb_ptr' field. - * + * * If the request has not yet been sent to the device it will simply be * aborted from RISC memory. If the request is disconnected it will be * aborted on reselection by sending an Abort Message to the target ID. @@ -3702,6 +3475,7 @@ /* Return the address that is aligned at the next doubleword >= to 'addr'. */ #define ADV_8BALIGN(addr) (((ulong) (addr) + 0x7) & ~0x7) #define ADV_16BALIGN(addr) (((ulong) (addr) + 0xF) & ~0xF) +#define ADV_32BALIGN(addr) (((ulong) (addr) + 0x1F) & ~0x1F) /* * Total contiguous memory needed for driver SG blocks. @@ -3711,80 +3485,76 @@ * single request. */ -#ifndef ADV_MAX_SG_LIST -Forced Error: Driver must define ADV_MAX_SG_LIST. -#endif /* ADV_MAX_SG_LIST */ - #define ADV_SG_LIST_MAX_BYTE_SIZE \ (sizeof(ADV_SG_BLOCK) * \ ((ADV_MAX_SG_LIST + (NO_OF_SG_PER_BLOCK - 1))/NO_OF_SG_PER_BLOCK)) -/* - * Inquiry data structure and bitfield accessor macros +/* + * Inquiry data structure and bitfield macros * * Using bitfields to access the subchar data isn't portable across - * endianness, so instead mask and shift. Only quantities of more + * endianness, so instead mask and shift. Only quantities of more * than 1 bit are shifted, since the others are just tested for true * or false. */ -#define INQ_DVC_TYPE(inq) ((inq).periph & 0x1f) -#define INQ_QUALIFIER(inq) (((inq).periph & 0xe0) >> 5) -#define INQ_DVC_TYPE_MOD(inq) ((inq).devtype & 0x7f) -#define INQ_REMOVABLE(inq) ((inq).devtype & 0x80) -#define INQ_ANSI_VER(inq) ((inq).ver & 0x07) -#define INQ_ECMA_VER(inq) (((inq).ver & 0x38) >> 3) -#define INQ_ISO_VER(inq) (((inq).ver & 0xc0) >> 6) -#define INQ_RESPONSE_FMT(inq) ((inq).byte3 & 0x0f) -#define INQ_TERM_IO(inq) ((inq).byte3 & 0x40) -#define INQ_ASYNC_NOTIF(inq) ((inq).byte3 & 0x80) -#define INQ_SOFT_RESET(inq) ((inq).flags & 0x01) -#define INQ_CMD_QUEUE(inq) ((inq).flags & 0x02) -#define INQ_LINK_CMD(inq) ((inq).flags & 0x08) -#define INQ_SYNC(inq) ((inq).flags & 0x10) -#define INQ_WIDE16(inq) ((inq).flags & 0x20) -#define INQ_WIDE32(inq) ((inq).flags & 0x40) -#define INQ_REL_ADDR(inq) ((inq).flags & 0x80) -#define INQ_INFO_UNIT(inq) ((inq).info & 0x01) -#define INQ_QUICK_ARB(inq) ((inq).info & 0x02) -#define INQ_CLOCKING(inq) (((inq).info & 0x0c) >> 2) +#define ADV_INQ_DVC_TYPE(inq) ((inq)->periph & 0x1f) +#define ADV_INQ_QUALIFIER(inq) (((inq)->periph & 0xe0) >> 5) +#define ADV_INQ_DVC_TYPE_MOD(inq) ((inq)->devtype & 0x7f) +#define ADV_INQ_REMOVABLE(inq) ((inq)->devtype & 0x80) +#define ADV_INQ_ANSI_VER(inq) ((inq)->ver & 0x07) +#define ADV_INQ_ECMA_VER(inq) (((inq)->ver & 0x38) >> 3) +#define ADV_INQ_ISO_VER(inq) (((inq)->ver & 0xc0) >> 6) +#define ADV_INQ_RESPONSE_FMT(inq) ((inq)->byte3 & 0x0f) +#define ADV_INQ_TERM_IO(inq) ((inq)->byte3 & 0x40) +#define ADV_INQ_ASYNC_NOTIF(inq) ((inq)->byte3 & 0x80) +#define ADV_INQ_SOFT_RESET(inq) ((inq)->flags & 0x01) +#define ADV_INQ_CMD_QUEUE(inq) ((inq)->flags & 0x02) +#define ADV_INQ_LINK_CMD(inq) ((inq)->flags & 0x08) +#define ADV_INQ_SYNC(inq) ((inq)->flags & 0x10) +#define ADV_INQ_WIDE16(inq) ((inq)->flags & 0x20) +#define ADV_INQ_WIDE32(inq) ((inq)->flags & 0x40) +#define ADV_INQ_REL_ADDR(inq) ((inq)->flags & 0x80) +#define ADV_INQ_INFO_UNIT(inq) ((inq)->info & 0x01) +#define ADV_INQ_QUICK_ARB(inq) ((inq)->info & 0x02) +#define ADV_INQ_CLOCKING(inq) (((inq)->info & 0x0c) >> 2) typedef struct { - uchar periph; /* peripheral device type [0:4] */ - /* peripheral qualifier [5:7] */ - uchar devtype; /* device type modifier (for SCSI I) [0:6] */ - /* RMB - removable medium bit [7] */ - uchar ver; /* ANSI approved version [0:2] */ - /* ECMA version [3:5] */ - /* ISO version [6:7] */ - uchar byte3; /* response data format [0:3] */ + uchar periph; /* peripheral device type [0:4] */ + /* peripheral qualifier [5:7] */ + uchar devtype; /* device type modifier (for SCSI I) [0:6] */ + /* RMB - removable medium bit [7] */ + uchar ver; /* ANSI approved version [0:2] */ + /* ECMA version [3:5] */ + /* ISO version [6:7] */ + uchar byte3; /* response data format [0:3] */ /* 0 SCSI 1 */ /* 1 CCS */ /* 2 SCSI-2 */ /* 3-F reserved */ - /* reserved [4:5] */ - /* terminate I/O process bit (see 5.6.22) [6] */ - /* asynch. event notification (processor) [7] */ + /* reserved [4:5] */ + /* terminate I/O process bit (see 5.6.22) [6] */ + /* asynch. event notification (processor) [7] */ uchar add_len; /* additional length */ + uchar res1; /* reserved */ uchar res2; /* reserved */ - uchar res3; /* reserved */ - uchar flags; /* soft reset implemented [0] */ - /* command queuing [1] */ - /* reserved [2] */ - /* linked command for this logical unit [3] */ - /* synchronous data transfer [4] */ - /* wide bus 16 bit data transfer [5] */ - /* wide bus 32 bit data transfer [6] */ - /* relative addressing mode [7] */ + uchar flags; /* soft reset implemented [0] */ + /* command queuing [1] */ + /* reserved [2] */ + /* linked command for this logical unit [3] */ + /* synchronous data transfer [4] */ + /* wide bus 16 bit data transfer [5] */ + /* wide bus 32 bit data transfer [6] */ + /* relative addressing mode [7] */ uchar vendor_id[8]; /* vendor identification */ uchar product_id[16]; /* product identification */ uchar product_rev_level[4]; /* product revision level */ uchar vendor_specific[20]; /* vendor specific */ - uchar info; /* information unit supported [0] */ - /* quick arbitrate supported [1] */ - /* clocking field [2:3] */ - /* reserved [4:7] */ - uchar res6; /* reserved */ + uchar info; /* information unit supported [0] */ + /* quick arbitrate supported [1] */ + /* clocking field [2:3] */ + /* reserved [4:7] */ + uchar res3; /* reserved */ } ADV_SCSI_INQUIRY; /* 58 bytes */ @@ -3801,7 +3571,6 @@ /* asc_board_t flags */ #define ASC_HOST_IN_RESET 0x01 -#define ASC_HOST_IN_ABORT 0x02 #define ASC_IS_WIDE_BOARD 0x04 /* AdvanSys Wide Board */ #define ASC_SELECT_QUEUE_DEPTHS 0x08 @@ -3815,22 +3584,17 @@ * and data after loading, define macros for this purpose. These macros * are not used when the driver is built as a module, cf. linux/init.h. */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,23) -#define ASC_INITFUNC(type, func) type func -#define ASC_INITDATA -#define ASC_INIT -#else /* version >= v2.1.23 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,16) -#define ASC_INITFUNC(type, func) __initfunc(type func) -#else /* version >= v2.3.16 */ +#if ASC_LINUX_KERNEL24 #define ASC_INITFUNC(type, func) type __init func -#endif /* version >= v2.3.16 */ +#elif ASC_LINUX_KERNEL22 +#define ASC_INITFUNC(type, func) __initfunc(type func) +#endif #define ASC_INITDATA __initdata #define ASC_INIT __init -#endif /* version >= v2.1.23 */ #define ASC_INFO_SIZE 128 /* advansys_info() line size */ +#ifdef CONFIG_PROC_FS /* /proc/scsi/advansys/[0...] related definitions */ #define ASC_PRTBUF_SIZE 2048 #define ASC_PRTLINE_SIZE 160 @@ -3846,6 +3610,37 @@ } #define ASC_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif /* CONFIG_PROC_FS */ + +/* + * XXX - Release and acquire the io_request_lock. These macros are needed + * because the 2.4 kernel SCSI mid-level driver holds the 'io_request_lock' + * on entry to SCSI low-level drivers. + * + * These definitions and all code that uses code should be removed when the + * SCSI mid-level driver no longer holds the 'io_request_lock' on entry to + * SCSI low-level driver detect, queuecommand, and reset entrypoints. + * + * The interrupt flags values doesn't matter in the macros because the + * SCSI mid-level will save and restore the flags values before and after + * calling advansys_detect, advansys_queuecommand, and advansys_reset where + * these macros are used. We do want interrupts enabled after the lock is + * released so an explicit sti() is done. The driver only needs interrupts + * disabled when it acquires the per board lock. + */ +#define ASC_UNLOCK_IO_REQUEST_LOCK \ + { \ + ulong flags; /* flags value not needed, cf. comment above. */ \ + save_flags(flags); \ + spin_unlock_irqrestore(&io_request_lock, flags); \ + sti(); /* enable interrupts */ \ + } + +#define ASC_LOCK_IO_REQUEST_LOCK \ + { \ + ulong flags; /* flags value not needed, cf. comment above. */ \ + spin_lock_irqsave(&io_request_lock, flags); \ + } /* Asc Library return codes */ #define ASC_TRUE 1 @@ -4186,16 +3981,8 @@ /* Per board statistics structure */ struct asc_stats { /* Driver Entrypoint Statistics */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - ADV_DCNT command; /* # calls to advansys_command() */ -#endif /* version < v2.3.28 */ ADV_DCNT queuecommand; /* # calls to advansys_queuecommand() */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - ADV_DCNT abort; /* # calls to advansys_abort() */ - ADV_DCNT reset; /* # calls to advansys_reset() */ -#else /* version >= v2.3.28 */ - ADV_DCNT eh_bus_reset; /* # calls to advansys_eh_bus_reset() */ -#endif /* version >= v2.3.28 */ + ADV_DCNT reset; /* # calls to advansys_eh_bus_reset() */ ADV_DCNT biosparam; /* # calls to advansys_biosparam() */ ADV_DCNT interrupt; /* # advansys_interrupt() calls */ ADV_DCNT callback; /* # calls to asc/adv_isr_callback() */ @@ -4249,17 +4036,17 @@ * up to 255 scatter-gather elements may be used per request or * ADV_SCSI_REQ_Q. * - * Both structures must be 8 byte aligned. + * Both structures must be 32 byte aligned. */ typedef struct adv_sgblk { ADV_SG_BLOCK sg_block; /* Sgblock structure. */ - uchar align[8]; /* Sgblock structure padding. */ + uchar align[32]; /* Sgblock structure padding. */ struct adv_sgblk *next_sgblkp; /* Next scatter-gather structure. */ } adv_sgblk_t; typedef struct adv_req { ADV_SCSI_REQ_Q scsi_req_q; /* Adv Library request structure. */ - uchar align[8]; /* Request structure padding. */ + uchar align[32]; /* Request structure padding. */ Scsi_Cmnd *cmndp; /* Mid-Level SCSI command pointer. */ adv_sgblk_t *sgblkp; /* Adv Library scatter-gather pointer. */ struct adv_req *next_reqp; /* Next Request Structure. */ @@ -4299,13 +4086,11 @@ ADVEEP_38C1600_CONFIG adv_38C1600_eep; /* 38C1600 EEPROM config. */ } eep_config; ulong last_reset; /* Saved last reset time */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,28) spinlock_t lock; /* Board spinlock */ -#endif /* version >= v2.3.28 */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS /* /proc/scsi/advansys/[0...] */ - char *prtbuf; /* Statistics Print Buffer */ -#endif /* version >= v1.3.0 */ + char *prtbuf; /* /proc print buffer */ +#endif /* CONFIG_PROC_FS */ #ifdef ADVANSYS_STATS struct asc_stats asc_stats; /* Board statistics */ #endif /* ADVANSYS_STATS */ @@ -4388,8 +4173,8 @@ /* Note: All driver global data should be initialized. */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) && \ - LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#if ASC_LINUX_KERNEL22 +#ifdef CONFIG_PROC_FS struct proc_dir_entry proc_scsi_advansys = { PROC_SCSI_ADVANSYS, /* unsigned short low_ino */ @@ -4398,13 +4183,14 @@ S_IFDIR | S_IRUGO | S_IXUGO, /* mode_t mode */ 2 /* nlink_t nlink */ }; -#endif /* v2.3.28 > version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ +#endif /* ASC_LINUX_KERNEL22 */ /* Number of boards detected in system. */ STATIC int asc_board_count = 0; STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 }; -/* Overrun buffer shared between all boards. */ +/* Overrun buffer used by all narrow boards. */ STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 }; /* @@ -4421,12 +4207,6 @@ ASC_IS_PCI, }; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI -STATIC int pci_scan_method ASC_INITDATA = -1; -#endif /* ASC_CONFIG_PCI */ -#endif /* version < v2.1.93 */ - /* * Used with the LILO 'advansys' option to eliminate or * limit I/O port probing at boot time, cf. advansys_setup(). @@ -4434,19 +4214,6 @@ STATIC int asc_iopflag = ASC_FALSE; STATIC int asc_ioport[ASC_NUM_IOPORT_PROBE] = { 0, 0, 0, 0 }; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -/* - * In kernels earlier than v1.3.0, kmalloc() does not work - * during driver initialization. Therefore statically declare - * 16 elements of each structure. v1.3.0 kernels will probably - * not need any more than this number. - */ -uchar adv_carr_buf[20 * sizeof(ADV_CARR_T)] = { 0 }; -uchar adv_req_buf[16 * sizeof(adv_req_t)] = { 0 }; -#define ADV_SGBLK_BUF_CNT 32 -uchar adv_sgblk_buf[ADV_SGBLK_BUF_CNT * sizeof(adv_sgblk_t)] = { 0 }; -#endif /* version >= v1,3,0 */ - #ifdef ADVANSYS_DEBUG STATIC char * asc_bus_name[ASC_NUM_BUS] = { @@ -4469,23 +4236,9 @@ * advansys.h contains function prototypes for functions global to Linux. */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) -#ifdef CONFIG_PROC_FS -STATIC int asc_proc_copy(off_t, off_t, char *, int , char *, int); -#endif /* CONFIG_PROC_FS */ -#endif /* version >= v1.3.0 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70) -STATIC void advansys_interrupt(int, struct pt_regs *); -#else /* version >= v1.3.70 */ -STATIC void advansys_interrupt(int, void *, struct pt_regs *); -#endif /* version >= v1.3.70 */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) -STATIC void advansys_select_queue_depths(struct Scsi_Host *, - Scsi_Device *); -#endif /* version >= v1.3.89 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC void advansys_command_done(Scsi_Cmnd *); -#endif /* version < v2.3.28 */ +STATIC void advansys_interrupt(int, void *, struct pt_regs *); +STATIC void advansys_select_queue_depths(struct Scsi_Host *, + Scsi_Device *); STATIC void asc_scsi_done_list(Scsi_Cmnd *); STATIC int asc_execute_scsi_cmnd(Scsi_Cmnd *); STATIC int asc_build_req(asc_board_t *, Scsi_Cmnd *); @@ -4494,27 +4247,13 @@ STATIC void asc_isr_callback(ASC_DVC_VAR *, ASC_QDONE_INFO *); STATIC void adv_isr_callback(ADV_DVC_VAR *, ADV_SCSI_REQ_Q *); STATIC void adv_async_callback(ADV_DVC_VAR *, uchar); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI -STATIC int asc_srch_pci_dev(PCI_DEVICE *); -STATIC uchar asc_scan_method(void); -STATIC int asc_pci_find_dev(PCI_DEVICE *); -STATIC void asc_get_pci_cfg(PCI_DEVICE *, PCI_CONFIG_SPACE *); -STATIC ushort asc_get_cfg_word(PCI_DATA *); -STATIC uchar asc_get_cfg_byte(PCI_DATA *); -STATIC void asc_put_cfg_byte(PCI_DATA *, uchar); -#endif /* ASC_CONFIG_PCI */ -#endif /* version < v2.1.93 */ STATIC void asc_enqueue(asc_queue_t *, REQP, int); STATIC REQP asc_dequeue(asc_queue_t *, int); STATIC REQP asc_dequeue_list(asc_queue_t *, REQP *, int); STATIC int asc_rmqueue(asc_queue_t *, REQP); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int asc_isqueued(asc_queue_t *, REQP); -#endif /* version < v2.3.28 */ STATIC void asc_execute_queue(asc_queue_t *); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) #ifdef CONFIG_PROC_FS +STATIC int asc_proc_copy(off_t, off_t, char *, int , char *, int); STATIC int asc_prt_board_devices(struct Scsi_Host *, char *, int); STATIC int asc_prt_adv_bios(struct Scsi_Host *, char *, int); STATIC int asc_get_eeprom_string(ushort *serialnum, uchar *cp); @@ -4525,12 +4264,12 @@ STATIC int asc_prt_adv_board_info(struct Scsi_Host *, char *, int); STATIC int asc_prt_line(char *, int, char *fmt, ...); #endif /* CONFIG_PROC_FS */ -#endif /* version >= v1.3.0 */ /* Declaration for Asc Library internal functions referenced by driver. */ STATIC int AscFindSignature(PortAddr); STATIC ushort AscGetEEPConfig(PortAddr, ASCEEP_CONFIG *, ushort); +/* Statistics function prototypes. */ #ifdef ADVANSYS_STATS #ifdef CONFIG_PROC_FS STATIC int asc_prt_board_stats(struct Scsi_Host *, char *, int); @@ -4538,6 +4277,7 @@ #endif /* CONFIG_PROC_FS */ #endif /* ADVANSYS_STATS */ +/* Debug function prototypes. */ #ifdef ADVANSYS_DEBUG STATIC void asc_prt_scsi_host(struct Scsi_Host *); STATIC void asc_prt_scsi_cmnd(Scsi_Cmnd *); @@ -4552,16 +4292,12 @@ STATIC void asc_prt_hex(char *f, uchar *, int); #endif /* ADVANSYS_DEBUG */ -#ifdef ADVANSYS_ASSERT -STATIC int advansys_interrupts_enabled(void); -#endif /* ADVANSYS_ASSERT */ - /* * --- Linux 'Scsi_Host_Template' and advansys_setup() Functions */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS /* * advansys_proc_info() - /proc/scsi/advansys/[0-(ASC_NUM_BOARD_SUPPORTED-1)] * @@ -4583,10 +4319,9 @@ * user just won't get all the available statistics. */ int -advansys_proc_info(char *buffer, char **start, off_t offset, int length, +advansys_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout) { -#ifdef CONFIG_PROC_FS struct Scsi_Host *shp; asc_board_t *boardp; int i; @@ -4598,7 +4333,9 @@ char *curbuf; off_t advoffset; Scsi_Device *scd; +#ifdef ADVANSYS_STATS int tgt_id; +#endif /* ADVANSYS_STATS */ ASC_DBG(1, "advansys_proc_info: begin\n"); @@ -4690,11 +4427,7 @@ * Display target driver information for each device attached * to the board. */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,75) - for (scd = scsi_devices; scd; scd = scd->next) -#else /* version >= v2.1.75 */ for (scd = shp->host_queue; scd; scd = scd->next) -#endif /* version >= v2.1.75 */ { if (scd->host == shp) { cp = boardp->prtbuf; @@ -4715,7 +4448,7 @@ curbuf += cnt; } } - + /* * Display EEPROM configuration for the board. */ @@ -4812,11 +4545,8 @@ ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt); return totcnt; -#else /* CONFIG_PROC_FS */ - return 0; -#endif /* CONFIG_PROC_FS */ } -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ /* * advansys_detect() @@ -4847,19 +4577,6 @@ int ioport = 0; int share_irq = FALSE; int iolen = 0; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - int pci_init_search = 0; - PCI_DEVICE pci_device[ASC_NUM_BOARD_SUPPORTED]; - int pci_card_cnt_max = 0; - int pci_card_cnt = 0; - PCI_DEVICE pciDevice; - PCI_CONFIG_SPACE pciConfig; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) - ADV_PADDR pci_memory_address; -#endif /* version >= v1,3,0 */ -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI int pci_init_search = 0; struct pci_dev *pci_devicep[ASC_NUM_BOARD_SUPPORTED]; @@ -4877,7 +4594,6 @@ }; ADV_PADDR pci_memory_address; #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ int warn_code, err_code; int ret; @@ -4890,11 +4606,18 @@ ASC_DBG(1, "advansys_detect: begin\n"); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,28) + /* + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level detect entrypoint. + */ + ASC_UNLOCK_IO_REQUEST_LOCK + +#if ASC_LINUX_KERNEL24 tpnt->proc_name = "advansys"; -#elif LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#elif ASC_LINUX_KERNEL22 tpnt->proc_dir = &proc_scsi_advansys; -#endif /* version >= v1.3.0 */ +#endif asc_board_count = 0; @@ -4904,7 +4627,7 @@ */ if (asc_iopflag == ASC_TRUE) { for (ioport = 0; ioport < ASC_NUM_IOPORT_PROBE; ioport++) { - ASC_DBG2(1, "advansys_detect: asc_ioport[%d] %x\n", + ASC_DBG2(1, "advansys_detect: asc_ioport[%d] 0x%x\n", ioport, asc_ioport[ioport]); if (asc_ioport[ioport] != 0) { for (iop = 0; iop < ASC_IOADR_TABLE_MAX_IX; iop++) { @@ -4923,15 +4646,6 @@ ioport = 0; } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - memset(&pciDevice, 0, sizeof(PCI_DEVICE)); - memset(&pciConfig, 0, sizeof(PCI_CONFIG_SPACE)); - pciDevice.maxBusNumber = PCI_MAX_BUS; - pciDevice.endSlot = PCI_MAX_SLOT; -#endif /* ASC_CONFIG_PCI */ -#endif /* version < v2.1.93 */ - for (bus = 0; bus < ASC_NUM_BUS; bus++) { ASC_DBG2(1, "advansys_detect: bus search type %d (%s)\n", @@ -4965,7 +4679,8 @@ } } if (iop) { - ASC_DBG1(1, "advansys_detect: probing I/O port %x...\n", + ASC_DBG1(1, + "advansys_detect: probing I/O port 0x%x...\n", iop); if (check_region(iop, ASC_IOADR_GAP) != 0) { printk( @@ -5016,67 +4731,6 @@ break; case ASC_IS_PCI: -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - if (pci_init_search == 0) { - int i, j; - - pci_init_search = 1; - - /* Find all PCI cards. */ - while (asc_srch_pci_dev(&pciDevice) == PCI_DEVICE_FOUND) { - pci_device[pci_card_cnt_max++] = pciDevice; - } - - /* - * Sort PCI cards in ascending order by PCI Bus, Slot, - * and Device Number. - */ - for (i = 0; i < pci_card_cnt_max - 1; i++) - { - for (j = i + 1; j < pci_card_cnt_max; j++) { - if ((pci_device[j].busNumber < - pci_device[i].busNumber) || - ((pci_device[j].busNumber == - pci_device[i].busNumber) && - (pci_device[j].slotNumber < - pci_device[i].slotNumber)) || - ((pci_device[j].busNumber == - pci_device[i].busNumber) && - (pci_device[j].slotNumber == - pci_device[i].slotNumber) && - (pci_device[j].devFunc < - pci_device[i].devFunc))) { - pciDevice = pci_device[i]; - pci_device[i] = pci_device[j]; - pci_device[j] = pciDevice; - } - } - } - - pci_card_cnt = 0; - } else { - pci_card_cnt++; - } - - if (pci_card_cnt == pci_card_cnt_max) { - iop = 0; - } else { - pciDevice = pci_device[pci_card_cnt]; - ASC_DBG2(2, - "advansys_detect: slotFound %d, busNumber %d\n", - pciDevice.slotFound, pciDevice.busNumber); - asc_get_pci_cfg(&pciDevice, &pciConfig); - iop = pciConfig.baseAddress[0] & PCI_IOADDRESS_MASK; - ASC_DBG2(1, - "advansys_detect: vendorID %X, deviceID %X\n", - pciConfig.vendorID, pciConfig.deviceID); - ASC_DBG2(2, "advansys_detect: iop %X, irqLine %d\n", - iop, pciConfig.irqLine); - } - break; -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI if (pci_init_search == 0) { int i, j; @@ -5090,13 +4744,13 @@ NULL) { pci_device_id_cnt++; } else { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0) - pci_devicep[pci_card_cnt_max++] = pci_devp; -#else /* version >= v2.4.0 */ +#if ASC_LINUX_KERNEL24 if (pci_enable_device(pci_devp) == 0) { pci_devicep[pci_card_cnt_max++] = pci_devp; } -#endif /* version >= v2.4.0 */ +#elif ASC_LINUX_KERNEL22 + pci_devicep[pci_card_cnt_max++] = pci_devp; +#endif } } @@ -5133,21 +4787,18 @@ ASC_DBG2(2, "advansys_detect: devfn %d, bus number %d\n", pci_devp->devfn, pci_devp->bus->number); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,13) - iop = pci_devp->base_address[0] & PCI_IOADDRESS_MASK; -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0) - iop = pci_devp->resource[0].start & PCI_IOADDRESS_MASK; -#else /* version >= v2.4.0 */ +#if ASC_LINUX_KERNEL24 iop = pci_resource_start(pci_devp, 0); -#endif /* version >= v2.4.0 */ - ASC_DBG2(1, +#elif ASC_LINUX_KERNEL22 + iop = pci_devp->base_address[0] & PCI_IOADDRESS_MASK; +#endif + ASC_DBG2(1, "advansys_detect: vendorID %X, deviceID %X\n", pci_devp->vendor, pci_devp->device); ASC_DBG2(2, "advansys_detect: iop %X, irqLine %d\n", iop, pci_devp->irq); } #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ break; default: @@ -5155,7 +4806,7 @@ asc_bus[bus]); break; } - ASC_DBG1(1, "advansys_detect: iop %x\n", iop); + ASC_DBG1(1, "advansys_detect: iop 0x%x\n", iop); /* * Adapter not found, try next bus type. @@ -5172,9 +4823,9 @@ */ ASC_DBG(2, "advansys_detect: scsi_register()\n"); shp = scsi_register(tpnt, sizeof(asc_board_t)); - - if(shp == NULL) { - continue; + + if (shp == NULL) { + continue; } /* Save a pointer to the Scsi_host of each board found. */ @@ -5185,10 +4836,8 @@ memset(boardp, 0, sizeof(asc_board_t)); boardp->id = asc_board_count - 1; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,28) /* Initialize spinlock. */ - boardp->lock = SPIN_LOCK_UNLOCKED; -#endif /* version >= v2.3.28 */ + boardp->lock = SPIN_LOCK_UNLOCKED; /* * Handle both narrow and wide boards. @@ -5197,17 +4846,6 @@ * wide board flag. Set-up the board structure based on * the board type. */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - if (asc_bus[bus] == ASC_IS_PCI && - (pciConfig.deviceID == ASC_PCI_DEVICE_ID_2300 || - pciConfig.deviceID == ASC_PCI_DEVICE_ID_2500 || - pciConfig.deviceID == ASC_PCI_DEVICE_ID_2700)) - { - boardp->flags |= ASC_IS_WIDE_BOARD; - } -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI if (asc_bus[bus] == ASC_IS_PCI && (pci_devp->device == ASC_PCI_DEVICE_ID_2300 || @@ -5217,7 +4855,6 @@ boardp->flags |= ASC_IS_WIDE_BOARD; } #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ if (ASC_NARROW_BOARD(boardp)) { ASC_DBG(1, "advansys_detect: narrow board\n"); @@ -5235,24 +4872,6 @@ adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg; adv_dvc_varp->isr_callback = adv_isr_callback; adv_dvc_varp->async_callback = adv_async_callback; - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - if (pciConfig.deviceID == ASC_PCI_DEVICE_ID_2300) - { - ASC_DBG(1, "advansys_detect: ASC-3550\n"); - adv_dvc_varp->chip_type = ADV_CHIP_ASC3550; - } else if (pciConfig.deviceID == ASC_PCI_DEVICE_ID_2500) - { - ASC_DBG(1, "advansys_detect: ASC-38C0800\n"); - adv_dvc_varp->chip_type = ADV_CHIP_ASC38C0800; - } else - { - ASC_DBG(1, "advansys_detect: ASC-38C1600\n"); - adv_dvc_varp->chip_type = ADV_CHIP_ASC38C1600; - } -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI if (pci_devp->device == ASC_PCI_DEVICE_ID_2300) { @@ -5268,11 +4887,7 @@ adv_dvc_varp->chip_type = ADV_CHIP_ASC38C1600; } #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) - adv_dvc_varp->iop_base = iop; -#else /* version >= v1,3,0 */ /* * Map the board's registers into virtual memory for * PCI slave access. Only memory accesses are used to @@ -5294,75 +4909,46 @@ { iolen = ADV_38C1600_IOLEN; } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - pci_memory_address = pciConfig.baseAddress[1]; - ASC_DBG1(1, "advansys_detect: pci_memory_address: %lu\n", - (ulong) pci_memory_address); - if ((boardp->ioremap_addr = - ioremap(pci_memory_address & PAGE_MASK, - PAGE_SIZE)) == 0) { - ASC_PRINT3( -"advansys_detect: board %d: ioremap(%lu, %x) returned NULL\n", - boardp->id, (ulong) pci_memory_address, iolen); - scsi_unregister(shp); - asc_board_count--; - continue; - } - ASC_DBG1(1, "advansys_detect: ioremap_addr: %lx\n", - (ulong) boardp->ioremap_addr); - adv_dvc_varp->iop_base = (AdvPortAddr) - (boardp->ioremap_addr + - (pci_memory_address - (pci_memory_address & PAGE_MASK))); - ASC_DBG1(1, "advansys_detect: iop_base: %lx\n", - adv_dvc_varp->iop_base); -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,13) - pci_memory_address = pci_devp->base_address[1]; -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0) - pci_memory_address = pci_devp->resource[1].start; -#else /* version >= v2.4.0 */ +#if ASC_LINUX_KERNEL24 pci_memory_address = pci_resource_start(pci_devp, 1); -#endif /* version >= v2.4.0 */ - ASC_DBG1(1, "advansys_detect: pci_memory_address: %x\n", - pci_memory_address); +#elif ASC_LINUX_KERNEL22 + pci_memory_address = pci_devp->base_address[1]; +#endif + ASC_DBG1(1, "advansys_detect: pci_memory_address: 0x%lx\n", + (ulong) pci_memory_address); if ((boardp->ioremap_addr = ioremap(pci_memory_address & PAGE_MASK, PAGE_SIZE)) == 0) { ASC_PRINT3( "advansys_detect: board %d: ioremap(%x, %d) returned NULL\n", - boardp->id, pci_memory_address, iolen); + boardp->id, pci_memory_address, iolen); scsi_unregister(shp); asc_board_count--; continue; } - ASC_DBG1(1, "advansys_detect: ioremap_addr: %lx\n", + ASC_DBG1(1, "advansys_detect: ioremap_addr: 0x%lx\n", (ulong) boardp->ioremap_addr); adv_dvc_varp->iop_base = (AdvPortAddr) (boardp->ioremap_addr + (pci_memory_address - (pci_memory_address & PAGE_MASK))); - ASC_DBG1(1, "advansys_detect: iop_base: %lx\n", + ASC_DBG1(1, "advansys_detect: iop_base: 0x%lx\n", adv_dvc_varp->iop_base); #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ -#endif /* version >= v1,3,0 */ /* - * Even though it isn't used to access the board in - * kernels greater than or equal to v1.3.0, save - * the I/O Port address so that it can be reported and - * displayed. + * Even though it isn't used to access wide boards, other + * than for the debug line below, save I/O Port address so + * that it can be reported. */ boardp->ioport = iop; ASC_DBG2(1, - "advansys_detect: iopb_chip_id_1 %x, iopw_chip_id_0 %x\n", +"advansys_detect: iopb_chip_id_1 0x%x, iopw_chip_id_0 0x%x\n", (ushort) inp(iop + 1), (ushort) inpw(iop)); } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS /* * Allocate buffer for printing information from * /proc/scsi/advansys/[0...]. @@ -5376,7 +4962,7 @@ asc_board_count--; continue; } -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ if (ASC_NARROW_BOARD(boardp)) { /* @@ -5398,20 +4984,6 @@ share_irq = TRUE; break; #endif /* CONFIG_ISA */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - case ASC_IS_PCI: - shp->irq = asc_dvc_varp->irq_no = pciConfig.irqLine; - asc_dvc_varp->cfg->pci_device_id = pciConfig.deviceID; - asc_dvc_varp->cfg->pci_slot_info = - ASC_PCI_MKID(pciDevice.busNumber, - pciDevice.slotFound, - pciDevice.devFunc); - shp->unchecked_isa_dma = FALSE; - share_irq = TRUE; - break; -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI case ASC_IS_PCI: shp->irq = asc_dvc_varp->irq_no = pci_devp->irq; @@ -5424,7 +4996,6 @@ share_irq = TRUE; break; #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ default: ASC_PRINT2( "advansys_detect: board %d: unknown adapter type: %d\n", @@ -5438,18 +5009,6 @@ * For Wide boards set PCI information before calling * AdvInitGetConfig(). */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - shp->irq = adv_dvc_varp->irq_no = pciConfig.irqLine; - adv_dvc_varp->cfg->pci_device_id = pciConfig.deviceID; - adv_dvc_varp->cfg->pci_slot_info = - ASC_PCI_MKID(pciDevice.busNumber, - pciDevice.slotFound, - pciDevice.devFunc); - shp->unchecked_isa_dma = FALSE; - share_irq = TRUE; -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI shp->irq = adv_dvc_varp->irq_no = pci_devp->irq; adv_dvc_varp->cfg->pci_device_id = pci_devp->device; @@ -5460,7 +5019,6 @@ shp->unchecked_isa_dma = FALSE; share_irq = TRUE; #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ } /* @@ -5504,33 +5062,33 @@ break; default: ASC_PRINT2( -"AscInitGetConfig: board %d: unknown warning: %x\n", +"AscInitGetConfig: board %d: unknown warning: 0x%x\n", boardp->id, ret); break; } if ((err_code = asc_dvc_varp->err_code) != 0) { ASC_PRINT3( -"AscInitGetConfig: board %d error: init_state %x, err_code %x\n", +"AscInitGetConfig: board %d error: init_state 0x%x, err_code 0x%x\n", boardp->id, asc_dvc_varp->init_state, asc_dvc_varp->err_code); } } else { ASC_DBG(2, "advansys_detect: AdvInitGetConfig()\n"); if ((ret = AdvInitGetConfig(adv_dvc_varp)) != 0) { - ASC_PRINT2("AdvInitGetConfig: board %d: warning: %x\n", + ASC_PRINT2("AdvInitGetConfig: board %d: warning: 0x%x\n", boardp->id, ret); } if ((err_code = adv_dvc_varp->err_code) != 0) { ASC_PRINT2( -"AdvInitGetConfig: board %d error: err_code %x\n", +"AdvInitGetConfig: board %d error: err_code 0x%x\n", boardp->id, adv_dvc_varp->err_code); } } - + if (err_code != 0) { -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ scsi_unregister(shp); asc_board_count--; continue; @@ -5608,18 +5166,18 @@ break; default: ASC_PRINT2( -"AscInitSetConfig: board %d: unknown warning: %x\n", +"AscInitSetConfig: board %d: unknown warning: 0x%x\n", boardp->id, ret); break; } if (asc_dvc_varp->err_code != 0) { ASC_PRINT3( -"AscInitSetConfig: board %d error: init_state %x, err_code %x\n", +"AscInitSetConfig: board %d error: init_state 0x%x, err_code 0x%x\n", boardp->id, asc_dvc_varp->init_state, asc_dvc_varp->err_code); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ scsi_unregister(shp); asc_board_count--; continue; @@ -5730,14 +5288,12 @@ shp->irq = adv_dvc_varp->irq_no; } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) /* * Channels are numbered beginning with 0. For AdvanSys one host * structure supports one channel. Multi-channel boards have a - * separate host structure for each channel. + * separate host structure for each channel. */ shp->max_channel = 0; -#endif /* version >= v1.3.89 */ if (ASC_NARROW_BOARD(boardp)) { shp->max_id = ASC_MAX_TID + 1; shp->max_lun = ASC_MAX_LUN + 1; @@ -5753,10 +5309,10 @@ shp->max_lun = ADV_MAX_LUN + 1; /* - * Save the I/O Port address and length even though the - * in v1.3.0 and greater kernels the region is not used - * by a Wide board. Instead the board is accessed with - * Memory Mapped I/O. + * Save the I/O Port address and length even though + * I/O ports are not used to access Wide boards. + * Instead the Wide boards are accessed with + * PCI Memory Mapped I/O. */ shp->io_port = iop; boardp->asc_n_io_port = iolen; @@ -5767,22 +5323,15 @@ shp->can_queue = adv_dvc_varp->max_host_qng; } - /* 'n_io_port' currently is one byte. */ + /* + * 'n_io_port' currently is one byte. + * + * Set a value to 'n_io_port', but never referenced it because + * it may be truncated. + */ shp->n_io_port = boardp->asc_n_io_port <= 255 ? boardp->asc_n_io_port : 255; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89) - /* - * In old kernels without tag queuing support and with memory - * allocation problems set a conservative 'cmd_per_lun' value. - */ -#ifdef MODULE - shp->cmd_per_lun = 1; -#else /* MODULE */ - shp->cmd_per_lun = 4; -#endif /* MODULE */ - ASC_DBG1(1, "advansys_detect: cmd_per_lun: %d\n", shp->cmd_per_lun); -#else /* version >= v1.3.89 */ /* * Following v1.3.89, 'cmd_per_lun' is no longer needed * and should be set to zero. @@ -5802,7 +5351,6 @@ * the number of commands to queue per device. */ shp->select_queue_depths = advansys_select_queue_depths; -#endif /* version >= v1.3.89 */ /* * Set the maximum number of scatter-gather elements the @@ -5822,20 +5370,6 @@ shp->sg_tablesize = ADV_MAX_SG_LIST; } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) -#ifdef MODULE - /* - * If the driver is compiled as a module, set a limit on the - * 'sg_tablesize' value to prevent memory allocation failures. - * Memory allocation errors are more likely to occur at module - * load time, then at driver initialization time. - */ - if (shp->sg_tablesize > 64) { - shp->sg_tablesize = 64; - } -#endif /* MODULE */ -#endif /* version < v2.0.0 */ - /* * The value of 'sg_tablesize' can not exceed the SCSI * mid-level driver definition of SG_ALL. SG_ALL also @@ -5851,11 +5385,11 @@ /* BIOS start address. */ if (ASC_NARROW_BOARD(boardp)) { -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,29) +#if ASC_LINUX_KERNEL24 shp->base = -#else /* version >= v2.3.29 */ +#elif ASC_LINUX_KERNEL22 shp->base = (char *) -#endif /* version < v2.3.29 */ +#endif ((ulong) AscGetChipBiosAddress( asc_dvc_varp->iop_base, asc_dvc_varp->bus_type)); @@ -5874,11 +5408,11 @@ boardp->bios_codelen); ASC_DBG2(1, - "advansys_detect: bios_signature %x, bios_version %x\n", + "advansys_detect: bios_signature 0x%x, bios_version 0x%x\n", boardp->bios_signature, boardp->bios_version); ASC_DBG2(1, - "advansys_detect: bios_codeseg %x, bios_codelen %x\n", + "advansys_detect: bios_codeseg 0x%x, bios_codelen 0x%x\n", boardp->bios_codeseg, boardp->bios_codelen); /* @@ -5890,11 +5424,10 @@ * Convert x86 realmode code segment to a linear * address by shifting left 4. */ -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,29) shp->base = -#else /* version >= v2.3.29 */ - shp->base = (char *) -#endif /* version < v2.3.29 */ +#if ASC_LINUX_KERNEL22 + (char *) +#endif ((ulong) boardp->bios_codeseg << 4); } else { shp->base = 0; @@ -5905,9 +5438,33 @@ * Register Board Resources - I/O Port, DMA, IRQ */ - /* Register I/O port range. */ - ASC_DBG(2, "advansys_detect: request_region()\n"); + /* + * Register I/O port range. + * + * For Wide boards the I/O ports are not used to access + * the board, but request the region anyway. + * + * 'shp->n_io_port' is not referenced, because it may be truncated. + */ + ASC_DBG2(2, + "advansys_detect: request_region port 0x%lx, len 0x%x\n", + (ulong) shp->io_port, boardp->asc_n_io_port); +#if ASC_LINUX_KERNEL24 + if (request_region(shp->io_port, boardp->asc_n_io_port, + "advansys") == NULL) { + ASC_PRINT3( +"advansys_detect: board %d: request_region() failed, port 0x%lx, len 0x%x\n", + boardp->id, (ulong) shp->io_port, boardp->asc_n_io_port); +#ifdef CONFIG_PROC_FS + kfree(boardp->prtbuf); +#endif /* CONFIG_PROC_FS */ + scsi_unregister(shp); + asc_board_count--; + continue; + } +#elif ASC_LINUX_KERNEL22 request_region(shp->io_port, boardp->asc_n_io_port, "advansys"); +#endif /* Register DMA Channel for Narrow boards. */ shp->dma_channel = NO_ISA_DMA; /* Default to no ISA DMA. */ @@ -5922,9 +5479,9 @@ "advansys_detect: board %d: request_dma() %d failed %d\n", boardp->id, shp->dma_channel, ret); release_region(shp->io_port, boardp->asc_n_io_port); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ scsi_unregister(shp); asc_board_count--; continue; @@ -5936,10 +5493,6 @@ /* Register IRQ Number. */ ASC_DBG1(2, "advansys_detect: request_irq() %d\n", shp->irq); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70) - if ((ret = request_irq(shp->irq, advansys_interrupt, - SA_INTERRUPT, "advansys")) != 0) -#else /* version >= v1.3.70 */ /* * If request_irq() fails with the SA_INTERRUPT flag set, * then try again without the SA_INTERRUPT flag set. This @@ -5955,31 +5508,28 @@ ((ret = request_irq(shp->irq, advansys_interrupt, (share_irq == TRUE ? SA_SHIRQ : 0), "advansys", boardp)) != 0)) -#endif /* version >= v1.3.70 */ { if (ret == -EBUSY) { ASC_PRINT2( -"advansys_detect: board %d: request_irq(): IRQ %d already in use.\n", +"advansys_detect: board %d: request_irq(): IRQ 0x%x already in use.\n", boardp->id, shp->irq); } else if (ret == -EINVAL) { ASC_PRINT2( -"advansys_detect: board %d: request_irq(): IRQ %d not valid.\n", +"advansys_detect: board %d: request_irq(): IRQ 0x%x not valid.\n", boardp->id, shp->irq); } else { ASC_PRINT3( -"advansys_detect: board %d: request_irq(): IRQ %d failed with %d\n", +"advansys_detect: board %d: request_irq(): IRQ 0x%x failed with %d\n", boardp->id, shp->irq, ret); } release_region(shp->io_port, boardp->asc_n_io_port); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) iounmap(boardp->ioremap_addr); -#endif /* version >= v1,3,0 */ if (shp->dma_channel != NO_ISA_DMA) { free_dma(shp->dma_channel); } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ scsi_unregister(shp); asc_board_count--; continue; @@ -5995,7 +5545,7 @@ if (warn_code || err_code) { ASC_PRINT4( -"AscInitAsc1000Driver: board %d: error: init_state %x, warn %x error %x\n", +"advansys_detect: board %d error: init_state 0x%x, warn 0x%x, error 0x%x\n", boardp->id, asc_dvc_varp->init_state, warn_code, err_code); } @@ -6005,25 +5555,13 @@ adv_req_t *reqp = NULL; int sg_cnt = 0; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) - carrp = (ADV_CARR_T *) &adv_carr_buf[0]; - req_cnt = sizeof(adv_req_buf)/sizeof(adv_req_t); - sg_cnt = sizeof(adv_sgblk_buf)/sizeof(adv_sgblk_t); - reqp = (adv_req_t *) &adv_req_buf[0]; - boardp->adv_sgblkp = NULL; - for (sg_cnt = 0; sg_cnt < ADV_SGBLK_BUF_CNT; sg_cnt++) { - sgp = (adv_sgblk_t *) &adv_sgblk_buf[sg_cnt]; - sgp->next_sgblkp = boardp->adv_sgblkp; - boardp->adv_sgblkp = sgp; - } -#else /* version >= v1.3.0 */ /* * Allocate buffer carrier structures. The total size * is about 4 KB, so allocate all at once. */ carrp = (ADV_CARR_T *) kmalloc(ADV_CARRIER_BUFSIZE, GFP_ATOMIC); - ASC_DBG1(1, "advansys_detect: carrp %lx\n", (ulong) carrp); + ASC_DBG1(1, "advansys_detect: carrp 0x%lx\n", (ulong) carrp); if (carrp == NULL) { goto kmalloc_error; @@ -6042,7 +5580,7 @@ kmalloc(sizeof(adv_req_t) * req_cnt, GFP_ATOMIC); ASC_DBG3(1, - "advansys_detect: reqp %lx, req_cnt %d, bytes %lu\n", + "advansys_detect: reqp 0x%lx, req_cnt %d, bytes %lu\n", (ulong) reqp, req_cnt, (ulong) sizeof(adv_req_t) * req_cnt); @@ -6087,24 +5625,24 @@ if (carrp == NULL) { ASC_PRINT1( -"advansys_detect: board %d: error: failed to kmalloc() carrier buffer.\n", +"advansys_detect: board %d error: failed to kmalloc() carrier buffer.\n", boardp->id); err_code = ADV_ERROR; } else if (reqp == NULL) { kfree(carrp); ASC_PRINT1( -"advansys_detect: board %d: error: failed to kmalloc() adv_req_t buffer.\n", +"advansys_detect: board %d error: failed to kmalloc() adv_req_t buffer.\n", boardp->id); err_code = ADV_ERROR; } else if (boardp->adv_sgblkp == NULL) { kfree(carrp); kfree(reqp); ASC_PRINT1( -"advansys_detect: board %d: error: failed to kmalloc() adv_sgblk_t buffers.\n", +"advansys_detect: board %d error: failed to kmalloc() adv_sgblk_t buffers.\n", boardp->id); err_code = ADV_ERROR; } else { - + /* Save carrier buffer pointer. */ boardp->orig_carrp = carrp; @@ -6113,7 +5651,6 @@ * driver is built as a module and can be unloaded. */ boardp->orig_reqp = reqp; -#endif /* version >= v1.3.0 */ adv_dvc_varp->carrier_buf = carrp; @@ -6146,17 +5683,14 @@ if (warn_code || err_code) { ASC_PRINT3( -"AdvInitAsc3550/38C0800/38C1600Driver: board %d: error: warn %x, error %x\n", +"advansys_detect: board %d error: warn 0x%x, error 0x%x\n", boardp->id, warn_code, err_code); } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) } -#endif /* version >= v1,3,0 */ } if (err_code != 0) { release_region(shp->io_port, boardp->asc_n_io_port); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) if (ASC_WIDE_BOARD(boardp)) { iounmap(boardp->ioremap_addr); if (boardp->orig_carrp) { @@ -6173,18 +5707,13 @@ kfree(sgp); } } -#endif /* version >= v1,3,0 */ if (shp->dma_channel != NO_ISA_DMA) { free_dma(shp->dma_channel); } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) +#ifdef CONFIG_PROC_FS kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70) - free_irq(shp->irq); -#else /* version >= v1.3.70 */ +#endif /* CONFIG_PROC_FS */ free_irq(shp->irq, boardp); -#endif /* version >= v1.3.70 */ scsi_unregister(shp); asc_board_count--; continue; @@ -6192,6 +5721,14 @@ ASC_DBG_PRT_SCSI_HOST(2, shp); } } + + /* + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level detect entrypoint. + */ + ASC_LOCK_IO_REQUEST_LOCK + ASC_DBG1(1, "advansys_detect: done: asc_board_count %d\n", asc_board_count); return asc_board_count; } @@ -6208,17 +5745,12 @@ ASC_DBG(1, "advansys_release: begin\n"); boardp = ASC_BOARDP(shp); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70) - free_irq(shp->irq); -#else /* version >= v1.3.70 */ free_irq(shp->irq, boardp); -#endif /* version >= v1.3.70 */ if (shp->dma_channel != NO_ISA_DMA) { ASC_DBG(1, "advansys_release: free_dma()\n"); free_dma(shp->dma_channel); } release_region(shp->io_port, boardp->asc_n_io_port); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) if (ASC_WIDE_BOARD(boardp)) { adv_sgblk_t *sgp = NULL; @@ -6237,9 +5769,10 @@ kfree(sgp); } } +#ifdef CONFIG_PROC_FS ASC_ASSERT(boardp->prtbuf != NULL); kfree(boardp->prtbuf); -#endif /* version >= v1.3.0 */ +#endif /* CONFIG_PROC_FS */ scsi_unregister(shp); ASC_DBG(1, "advansys_release: end\n"); return 0; @@ -6275,51 +5808,37 @@ } else { busname = "ISA"; } + /* Don't reference 'shp->n_io_port'; It may be truncated. */ sprintf(info, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,92) -"AdvanSys SCSI %s: %s %u CDB: BIOS %lX, IO %lX/%X, IRQ %u, DMA %u", -#else /* version >= v2.1.92 */ -"AdvanSys SCSI %s: %s %u CDB: BIOS %lX, IO %lX/%X, IRQ %u, DMA %u", -#endif /* version >= v2.1.92 */ - ASC_VERSION, busname, asc_dvc_varp->max_total_qng, - (ulong) shp->base, - (ulong) shp->io_port, boardp->asc_n_io_port - 1, +"AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X, DMA 0x%X", + ASC_VERSION, busname, + (ulong) shp->io_port, + (ulong) shp->io_port + boardp->asc_n_io_port - 1, shp->irq, shp->dma_channel); - } else if (asc_dvc_varp->bus_type & ASC_IS_PCI) { - if ((asc_dvc_varp->bus_type & ASC_IS_PCI_ULTRA) - == ASC_IS_PCI_ULTRA) { - busname = "PCI Ultra"; - } else { - busname = "PCI"; - } - sprintf(info, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,92) - "AdvanSys SCSI %s: %s %u CDB: IO %X/%X, IRQ %u", -#else /* version >= v2.1.92 */ - "AdvanSys SCSI %s: %s %u CDB: IO %lX/%X, IRQ %u", -#endif /* version >= v2.1.92 */ - ASC_VERSION, busname, asc_dvc_varp->max_total_qng, - shp->io_port, boardp->asc_n_io_port - 1, shp->irq); } else { if (asc_dvc_varp->bus_type & ASC_IS_VL) { busname = "VL"; } else if (asc_dvc_varp->bus_type & ASC_IS_EISA) { busname = "EISA"; + } else if (asc_dvc_varp->bus_type & ASC_IS_PCI) { + if ((asc_dvc_varp->bus_type & ASC_IS_PCI_ULTRA) + == ASC_IS_PCI_ULTRA) { + busname = "PCI Ultra"; + } else { + busname = "PCI"; + } } else { busname = "?"; - ASC_PRINT2( - "advansys_info: board %d: unknown bus type %d\n", + ASC_PRINT2( "advansys_info: board %d: unknown bus type %d\n", boardp->id, asc_dvc_varp->bus_type); } + /* Don't reference 'shp->n_io_port'; It may be truncated. */ sprintf(info, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,92) - "AdvanSys SCSI %s: %s %u CDB: BIOS %lX, IO %X/%X, IRQ %u", -#else /* version >= v2.1.92 */ - "AdvanSys SCSI %s: %s %u CDB: BIOS %lX, IO %lX/%X, IRQ %u", -#endif /* version >= v2.1.92 */ - ASC_VERSION, busname, asc_dvc_varp->max_total_qng, - (ulong) shp->base, shp->io_port - 1, - boardp->asc_n_io_port, shp->irq); + "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", + ASC_VERSION, busname, + (ulong) shp->io_port, + (ulong) shp->io_port + boardp->asc_n_io_port - 1, + shp->irq); } } else { /* @@ -6343,57 +5862,18 @@ iolen = ADV_38C1600_IOLEN; widename = "Ultra3-Wide"; } - if (boardp->bios_signature == 0x55AA) { - sprintf(info, -"AdvanSys SCSI %s: PCI %s: BIOS %X/%X, IO %X/%X, IRQ %u", - ASC_VERSION, - widename, - boardp->bios_codeseg << 4, - boardp->bios_codelen > 0 ? - (boardp->bios_codelen << 9) - 1 : 0, - (unsigned) boardp->ioport, iolen - 1, - shp->irq); - } else { - sprintf(info, -"AdvanSys SCSI %s: PCI %s: IO %X/%X, IRQ %u", - ASC_VERSION, - widename, - (unsigned) boardp->ioport, - (iolen - 1), - shp->irq); - } + sprintf(info, "AdvanSys SCSI %s: PCI %s: PCIMEM 0x%lX-0x%lX, IRQ 0x%X", + ASC_VERSION, + widename, + (ulong) adv_dvc_varp->iop_base, + (ulong) adv_dvc_varp->iop_base + iolen - 1, + shp->irq); } ASC_ASSERT(strlen(info) < ASC_INFO_SIZE); ASC_DBG(1, "advansys_info: end\n"); return info; } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -/* - * advansys_command() - polled I/O entrypoint. - * - * Apparently host drivers shouldn't return until the command - * is finished. - * - * Note: This is an old interface that is no longer used by the SCSI - * mid-level driver. The new interface, advansys_queuecommand(), - * currently handles all requests. - */ -int -advansys_command(Scsi_Cmnd *scp) -{ - ASC_DBG1(1, "advansys_command: scp %lx\n", (ulong) scp); - ASC_STATS(scp->host, command); - scp->SCp.Status = 0; /* Set to a known state */ - advansys_queuecommand(scp, advansys_command_done); - while (scp->SCp.Status == 0) { - continue; - } - ASC_DBG1(1, "advansys_command: result %x\n", scp->result); - return scp->result; -} -#endif /* version < v2.3.28 */ - /* * advansys_queuecommand() - interrupt-driven I/O entrypoint. * @@ -6405,40 +5885,30 @@ { struct Scsi_Host *shp; asc_board_t *boardp; - int flags; + ulong flags; Scsi_Cmnd *done_scp; shp = scp->host; boardp = ASC_BOARDP(shp); ASC_STATS(shp, queuecommand); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) /* - * Disable interrupts to preserve request ordering and provide - * mutually exclusive access to global structures used to initiate - * a request. - */ - save_flags(flags); - cli(); -#else /* version >= v2.3.28 */ + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level queuecommand entrypoint. + */ + ASC_UNLOCK_IO_REQUEST_LOCK + spin_lock_irqsave(&boardp->lock, flags); -#endif /* version >= v2.3.28 */ /* * Block new commands while handling a reset or abort request. */ - if (boardp->flags & (ASC_HOST_IN_RESET | ASC_HOST_IN_ABORT)) { - if (boardp->flags & ASC_HOST_IN_RESET) { - ASC_DBG1(1, - "advansys_queuecommand: scp %lx blocked for reset request\n", - (ulong) scp); - scp->result = HOST_BYTE(DID_RESET); - } else { - ASC_DBG1(1, - "advansys_queuecommand: scp %lx blocked for abort request\n", - (ulong) scp); - scp->result = HOST_BYTE(DID_ABORT); - } + if (boardp->flags & ASC_HOST_IN_RESET) { + ASC_DBG1(1, + "advansys_queuecommand: scp 0x%lx blocked for reset request\n", + (ulong) scp); + scp->result = HOST_BYTE(DID_RESET); /* * Add blocked requests to the board's 'done' queue. The queued @@ -6446,11 +5916,7 @@ * handling. */ asc_enqueue(&boardp->done, scp, ASC_BACK); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - restore_flags(flags); -#else /* version >= v2.3.28 */ spin_unlock_irqrestore(&boardp->lock, flags); -#endif /* version >= v2.3.28 */ return 0; } @@ -6467,13 +5933,15 @@ * Save the function pointer to Linux mid-level 'done' function * and attempt to execute the command. * - * If ASC_ERROR is returned the request has been added to the + * If ASC_NOERROR is returned the request has been added to the * board's 'active' queue and will be completed by the interrupt * handler. * * If ASC_BUSY is returned add the request to the board's per - * target waiting list. - * + * target waiting list. This is the first time the request has + * been tried. Add it to the back of the waiting list. It will be + * retried later. + * * If an error occurred, the request will have been placed on the * board's 'done' queue and must be completed before returning. */ @@ -6492,656 +5960,21 @@ break; } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - restore_flags(flags); -#else /* version >= v2.3.28 */ spin_unlock_irqrestore(&boardp->lock, flags); -#endif /* version >= v2.3.28 */ - return 0; -} - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -/* - * advansys_abort() - * - * Abort the command specified by 'scp'. - */ -int -advansys_abort(Scsi_Cmnd *scp) -{ - struct Scsi_Host *shp; - asc_board_t *boardp; - ASC_DVC_VAR *asc_dvc_varp; - ADV_DVC_VAR *adv_dvc_varp; - int flags; - int do_scsi_done; - int scp_found; - Scsi_Cmnd *done_scp = NULL; - int ret; - - /* Save current flags and disable interrupts. */ - save_flags(flags); - cli(); - - ASC_DBG1(1, "advansys_abort: scp %lx\n", (ulong) scp); - -#ifdef ADVANSYS_STATS - if (scp->host != NULL) { - ASC_STATS(scp->host, abort); - } -#endif /* ADVANSYS_STATS */ - -#ifdef ADVANSYS_ASSERT - do_scsi_done = ASC_ERROR; - scp_found = ASC_ERROR; - ret = ASC_ERROR; -#endif /* ADVANSYS_ASSERT */ - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - if (scp->serial_number != scp->serial_number_at_timeout) { - ASC_PRINT1( -"advansys_abort: timeout serial number changed for request %lx\n", - (ulong) scp); - do_scsi_done = ASC_FALSE; - scp_found = ASC_FALSE; - ret = SCSI_ABORT_NOT_RUNNING; - } else -#endif /* version >= v1.3.89 */ - if ((shp = scp->host) == NULL) { - scp->result = HOST_BYTE(DID_ERROR); - do_scsi_done = ASC_TRUE; - scp_found = ASC_FALSE; - ret = SCSI_ABORT_ERROR; - } else if ((boardp = ASC_BOARDP(shp))->flags & - (ASC_HOST_IN_RESET | ASC_HOST_IN_ABORT)) { - ASC_PRINT2( -"advansys_abort: board %d: Nested host reset or abort, flags 0x%x\n", - boardp->id, boardp->flags); - do_scsi_done = ASC_TRUE; - if ((asc_rmqueue(&boardp->active, scp) == ASC_TRUE) || - (asc_rmqueue(&boardp->waiting, scp) == ASC_TRUE)) { - scp_found = ASC_TRUE; - } else { - scp_found = ASC_FALSE; - } - scp->result = HOST_BYTE(DID_ERROR); - ret = SCSI_ABORT_ERROR; - } else { - /* Set abort flag to avoid nested reset or abort requests. */ - boardp->flags |= ASC_HOST_IN_ABORT; - - do_scsi_done = ASC_TRUE; - if (asc_rmqueue(&boardp->waiting, scp) == ASC_TRUE) { - /* - * If asc_rmqueue() found the command on the waiting - * queue, it had not been sent to the device. After - * the queue is removed, no other handling is required. - */ - ASC_DBG1(1, "advansys_abort: scp %lx found on waiting queue\n", - (ulong) scp); - scp_found = ASC_TRUE; - scp->result = HOST_BYTE(DID_ABORT); - ret = SCSI_ABORT_SUCCESS; - } else if (asc_isqueued(&boardp->active, scp) == ASC_TRUE) { - /* - * If asc_isqueued() found the command on the active - * queue, it has been sent to the device. The command - * will be returned through the interrupt handler after - * it has been aborted. - */ - - if (ASC_NARROW_BOARD(boardp)) { - /* - * Narrow Board - */ - asc_dvc_varp = &boardp->dvc_var.asc_dvc_var; - scp->result = HOST_BYTE(DID_ABORT); - - /* sti(); XXX */ /* Enable interrupts for AscAbortSRB(). */ - ASC_DBG1(1, "advansys_abort: before AscAbortSRB(), scp %lx\n", - (ulong) scp); - /* XXX */ - switch (AscAbortSRB(asc_dvc_varp, ASC_VADDR_TO_U32(scp))) { - case ASC_TRUE: - /* asc_isr_callback() will be called */ - ASC_DBG(1, "advansys_abort: AscAbortSRB() TRUE\n"); - ret = SCSI_ABORT_PENDING; - break; - case ASC_FALSE: - /* Request has apparently already completed. */ - ASC_DBG(1, "advansys_abort: AscAbortSRB() FALSE\n"); - ret = SCSI_ABORT_NOT_RUNNING; - break; - case ASC_ERROR: - default: - ASC_DBG(1, "advansys_abort: AscAbortSRB() ERROR\n"); - ret = SCSI_ABORT_ERROR; - break; - } - cli(); - } else { - /* - * Wide Board - */ - adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; - scp->result = HOST_BYTE(DID_ABORT); - - ASC_DBG1(1, - "advansys_abort: before AdvAbortQueue(), scp %lx\n", - (ulong) scp); -#if 0 /* XXX */ - switch (AdvAbortQueue(adv_dvc_varp, (ADV_VADDR) XXX)) { - case ASC_TRUE: - /* asc_isr_callback() will be called */ - ASC_DBG(1, "advansys_abort: AdvAbortQueue() TRUE\n"); - ret = SCSI_ABORT_PENDING; - break; - case ASC_FALSE: - /* Request has apparently already completed. */ - ASC_DBG(1, "advansys_abort: AdvAbortQueue() FALSE\n"); - ret = SCSI_ABORT_NOT_RUNNING; - break; - case ASC_ERROR: - default: - ASC_DBG(1, "advansys_abort: AdvAbortQueue() ERROR\n"); - ret = SCSI_ABORT_ERROR; - break; - } - /* - * Ensure all requests completed by the microcode have - * been processed by calling AdvISR(). - */ - (void) AdvISR(adv_dvc_varp); -#else /* XXX */ - (void) AdvResetChipAndSB(adv_dvc_varp); - ret = SCSI_ABORT_SUCCESS; -#endif /* XXX */ - } - - /* - * The request will either still be on the active queue - * or have been added to the board's done queue. - */ - if (asc_rmqueue(&boardp->active, scp) == ASC_TRUE) { - scp->result = HOST_BYTE(DID_ABORT); - scp_found = ASC_TRUE; - } else { - scp_found = asc_rmqueue(&boardp->done, scp); - ASC_ASSERT(scp_found == ASC_TRUE); - } - } else { - /* - * The command was not found on the active or waiting queues. - */ - do_scsi_done = ASC_TRUE; - scp_found = ASC_FALSE; - ret = SCSI_ABORT_NOT_RUNNING; - } - - /* Clear abort flag. */ - boardp->flags &= ~ASC_HOST_IN_ABORT; - - /* - * Because the ASC_HOST_IN_ABORT flag causes both - * 'advansys_interrupt' and 'asc_isr_callback' to - * queue requests to the board's 'done' queue and - * prevents waiting commands from being executed, - * these queued requests must be handled here. - */ - done_scp = asc_dequeue_list(&boardp->done, NULL, ASC_TID_ALL); - - /* - * Start any waiting commands for the board. - */ - if (!ASC_QUEUE_EMPTY(&boardp->waiting)) { - ASC_DBG(1, "advansys_interrupt: before asc_execute_queue()\n"); - asc_execute_queue(&boardp->waiting); - } - } - - /* Interrupts could be enabled here. */ /* - * Complete the request to be aborted, unless it has been - * restarted as detected above, even if it was not found on - * the device active or waiting queues. + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level queuecommand entrypoint. */ - ASC_ASSERT(do_scsi_done != ASC_ERROR); - ASC_ASSERT(scp_found != ASC_ERROR); - if (do_scsi_done == ASC_TRUE) { - if (scp->scsi_done == NULL) { - ASC_PRINT1( -"advansys_abort: aborted request scsi_done() is NULL, %lx\n", - (ulong) scp); - } else { - if (scp_found == ASC_FALSE) { - ASC_PRINT1( -"advansys_abort: abort request not active or waiting, completing anyway %lx\n", - (ulong) scp); - } - ASC_STATS(scp->host, done); - scp->scsi_done(scp); - } - } - - /* - * It is possible for the request done function to re-enable - * interrupts without confusing the driver. But here interrupts - * aren't enabled until all requests have been completed. - */ - if (done_scp != NULL) { - asc_scsi_done_list(done_scp); - } + ASC_LOCK_IO_REQUEST_LOCK - ASC_DBG1(1, "advansys_abort: ret %d\n", ret); - - /* Re-enable interrupts, if they were enabled on entry. */ - restore_flags(flags); - - ASC_ASSERT(ret != ASC_ERROR); - return ret; + return 0; } /* * advansys_reset() * - * Reset the device associated with the command 'scp'. - */ -int -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89) -advansys_reset(Scsi_Cmnd *scp) -#else /* version >= v1.3.89 */ -advansys_reset(Scsi_Cmnd *scp, unsigned int reset_flags) -#endif /* version >= v1.3.89 */ -{ - struct Scsi_Host *shp; - asc_board_t *boardp; - ASC_DVC_VAR *asc_dvc_varp; - ADV_DVC_VAR *adv_dvc_varp; - int flags; - Scsi_Cmnd *done_scp = NULL, *last_scp = NULL; - Scsi_Cmnd *tscp, *new_last_scp; - int do_scsi_done; - int scp_found; - int status; - int target; - int ret; - int device_reset = ASC_FALSE; - - /* Save current flags and disable interrupts. */ - save_flags(flags); - cli(); - - ASC_DBG1(1, "advansys_reset: %lx\n", (ulong) scp); - -#ifdef ADVANSYS_STATS - if (scp->host != NULL) { - ASC_STATS(scp->host, reset); - } -#endif /* ADVANSYS_STATS */ - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - if ((reset_flags & SCSI_RESET_ASYNCHRONOUS) && - (scp->serial_number != scp->serial_number_at_timeout)) { - ASC_PRINT1( -"advansys_reset: timeout serial number changed for request %lx\n", - (ulong) scp); - do_scsi_done = ASC_FALSE; - scp_found = ASC_FALSE; - ret = SCSI_RESET_NOT_RUNNING; - } else -#endif /* version >= v1.3.89 */ - if ((shp = scp->host) == NULL) { - scp->result = HOST_BYTE(DID_ERROR); - do_scsi_done = ASC_TRUE; - scp_found = ASC_FALSE; - ret = SCSI_RESET_ERROR; - } else if ((boardp = ASC_BOARDP(shp))->flags & - (ASC_HOST_IN_RESET | ASC_HOST_IN_ABORT)) { - ASC_PRINT2( -"advansys_reset: board %d: Nested host reset or abort, flags 0x%x\n", - boardp->id, boardp->flags); - do_scsi_done = ASC_TRUE; - if ((asc_rmqueue(&boardp->active, scp) == ASC_TRUE) || - (asc_rmqueue(&boardp->waiting, scp) == ASC_TRUE)) { - scp_found = ASC_TRUE; - } else { - scp_found = ASC_FALSE; - } - scp->result = HOST_BYTE(DID_ERROR); - ret = SCSI_RESET_ERROR; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0) - } else if (time_after_eq(jiffies, boardp->last_reset) && - time_before(jiffies, boardp->last_reset + (10 * HZ))) { -#else /* version < v2.1.0 */ - } else if (jiffies >= boardp->last_reset && - jiffies < (boardp->last_reset + (10 * HZ))) { -#endif /* version < v2.1.0 */ - /* - * Don't allow a reset to be attempted within 10 seconds - * of the last reset. - * - * If 'jiffies' wrapping occurs, the reset request will go - * through, because a wrapped 'jiffies' would not pass the - * test above. - */ - ASC_DBG(1, - "advansys_reset: reset within 10 sec of last reset ignored\n"); - do_scsi_done = ASC_TRUE; - if ((asc_rmqueue(&boardp->active, scp) == ASC_TRUE) || - (asc_rmqueue(&boardp->waiting, scp) == ASC_TRUE)) { - scp_found = ASC_TRUE; - } else { - scp_found = ASC_FALSE; - } - scp->result = HOST_BYTE(DID_ERROR); - ret = SCSI_RESET_ERROR; - } else { - do_scsi_done = ASC_TRUE; - - /* Set reset flag to avoid nested reset or abort requests. */ - boardp->flags |= ASC_HOST_IN_RESET; - - /* - * If the request is on the target waiting or active queue - * or the board done queue, then remove it and note that it - * was found. - */ - if (asc_rmqueue(&boardp->active, scp) == ASC_TRUE) { - ASC_DBG(1, "advansys_reset: active scp_found = TRUE\n"); - scp_found = ASC_TRUE; - } else if (asc_rmqueue(&boardp->waiting, scp) == ASC_TRUE) { - ASC_DBG(1, "advansys_reset: waiting scp_found = TRUE\n"); - scp_found = ASC_TRUE; - } else if (asc_rmqueue(&boardp->done, scp) == ASC_TRUE) { - scp_found = ASC_TRUE; - } else { - scp_found = ASC_FALSE; - } - - - if (ASC_NARROW_BOARD(boardp)) { - /* - * Narrow Board - * - * If the suggest reset bus flags are set, then reset the bus. - * Otherwise only reset the device. - */ - asc_dvc_varp = &boardp->dvc_var.asc_dvc_var; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - if (reset_flags & - (SCSI_RESET_SUGGEST_BUS_RESET | - SCSI_RESET_SUGGEST_HOST_RESET)) { -#endif /* version >= v1.3.89 */ - - /* - * Reset the target's SCSI bus. - */ - ASC_DBG(1, "advansys_reset: before AscResetSB()\n"); - /* sti(); XXX */ /* Enable interrupts for AscResetSB(). */ - status = AscResetSB(asc_dvc_varp); - /* cli(); XXX */ - switch (status) { - case ASC_TRUE: - ASC_DBG(1, "advansys_reset: AscResetSB() success\n"); - ret = SCSI_RESET_SUCCESS; - break; - case ASC_ERROR: - default: - ASC_DBG(1, "advansys_reset: AscResetSB() failed\n"); - ret = SCSI_RESET_ERROR; - break; - } - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - } else { - /* - * Reset the specified device. If the device reset fails, - * then reset the SCSI bus. - */ - - ASC_DBG1(1, - "advansys_reset: before AscResetDevice(), target %d\n", - scp->target); - /* sti(); XXX */ /* Enable interrupts for AscResetDevice(). */ - status = AscResetDevice(asc_dvc_varp, scp->target); - /* cli(); XXX */ - - switch (status) { - case ASC_TRUE: - ASC_DBG(1, "advansys_reset: AscResetDevice() success\n"); - device_reset = ASC_TRUE; - ret = SCSI_RESET_SUCCESS; - break; - case ASC_ERROR: - default: - ASC_DBG(1, -"advansys_reset: AscResetDevice() failed; Calling AscResetSB()\n"); - /* sti(); XXX */ /* Enable interrupts for AscResetSB(). */ - status = AscResetSB(asc_dvc_varp); - /* cli(); XXX */ - switch (status) { - case ASC_TRUE: - ASC_DBG(1, "advansys_reset: AscResetSB() TRUE\n"); - ret = SCSI_RESET_SUCCESS; - break; - case ASC_ERROR: - default: - ASC_DBG(1, "advansys_reset: AscResetSB() ERROR\n"); - ret = SCSI_RESET_ERROR; - break; - } - break; - } - } -#endif /* version >= v1.3.89 */ - } else { - /* - * Wide Board - * - * If the suggest reset bus flags are set, then reset the bus. - * Otherwise only reset the device. - */ - adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - if (reset_flags & - (SCSI_RESET_SUGGEST_BUS_RESET | - SCSI_RESET_SUGGEST_HOST_RESET)) { -#endif /* version >= v1.3.89 */ - - /* - * Reset the target's SCSI bus. - */ - ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n"); - switch (AdvResetChipAndSB(adv_dvc_varp)) { - case ASC_TRUE: - ASC_DBG(1, - "advansys_reset: AdvResetChipAndSB() success\n"); - ret = SCSI_RESET_SUCCESS; - break; - case ASC_FALSE: - default: - ASC_DBG(1, "advansys_reset: AdvResetChipAndSB() failed\n"); - ret = SCSI_RESET_ERROR; - break; - } - /* - * Ensure all requests completed by the microcode have - * been processed by calling AdvISR(). - */ - (void) AdvISR(adv_dvc_varp); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) - } else { - /* - * Reset the specified device. If the device reset fails, - * then reset the SCSI bus. - */ - - ASC_DBG1(1, - "advansys_reset: before AdvResetDevice(), target %d\n", - scp->target); - - switch (AdvResetDevice(adv_dvc_varp, scp->target)) { - case ASC_TRUE: - ASC_DBG(1, "advansys_reset: AdvResetDevice() success\n"); - device_reset = ASC_TRUE; - ret = SCSI_RESET_SUCCESS; - break; - case ASC_FALSE: - default: - ASC_DBG(1, -"advansys_reset: AdvResetDevice() failed; Calling AdvResetChipAndSB()\n"); - - switch (AdvResetChipAndSB(adv_dvc_varp)) { - case ASC_TRUE: - ASC_DBG(1, - "advansys_reset: AdvResetChipAndSB() TRUE\n"); - ret = SCSI_RESET_SUCCESS; - break; - case ASC_FALSE: - default: - ASC_DBG(1, - "advansys_reset: AdvResetChipAndSB() ERROR\n"); - ret = SCSI_RESET_ERROR; - break; - } - break; - } - /* - * Ensure all requests completed by the microcode have - * been processed by calling AdvISR(). - */ - (void) AdvISR(adv_dvc_varp); - } -#endif /* version >= v1.3.89 */ - } - - /* - * Because the ASC_HOST_IN_RESET flag causes both - * 'advansys_interrupt' and 'asc_isr_callback' to - * queue requests to the board's 'done' queue and - * prevents waiting commands from being executed, - * these queued requests must be handled here. - */ - done_scp = asc_dequeue_list(&boardp->done, &last_scp, - ASC_TID_ALL); - - /* - * If a device reset was performed dequeue all waiting - * and active requests for the device and set the request - * status to DID_RESET. - * - * If a SCSI bus reset was performed dequeue all waiting - * and active requests for all devices and set the request - * status to DID_RESET. - */ - if (device_reset == ASC_TRUE) { - target = scp->target; - } else { - target = ASC_TID_ALL; - } - - /* - * Add active requests to 'done_scp' and set the request status - * to DID_RESET. - */ - if (done_scp == NULL) { - done_scp = asc_dequeue_list(&boardp->active, &last_scp, target); - for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { - tscp->result = HOST_BYTE(DID_RESET); - } - } else { - ASC_ASSERT(last_scp != NULL); - REQPNEXT(last_scp) = asc_dequeue_list(&boardp->active, - &new_last_scp, target); - if (new_last_scp != NULL) { - ASC_ASSERT(REQPNEXT(last_scp) != NULL); - for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) { - tscp->result = HOST_BYTE(DID_RESET); - } - last_scp = new_last_scp; - } - } - - /* - * Add waiting requests to 'done_scp' and set the request status - * to DID_RESET. - */ - if (done_scp == NULL) { - done_scp = asc_dequeue_list(&boardp->waiting, &last_scp, target); - for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { - tscp->result = HOST_BYTE(DID_RESET); - } - } else { - ASC_ASSERT(last_scp != NULL); - REQPNEXT(last_scp) = asc_dequeue_list(&boardp->waiting, - &new_last_scp, target); - if (new_last_scp != NULL) { - ASC_ASSERT(REQPNEXT(last_scp) != NULL); - for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) { - tscp->result = HOST_BYTE(DID_RESET); - } - last_scp = new_last_scp; - } - } - - /* Save the time of the most recently completed reset. */ - boardp->last_reset = jiffies; - - /* Clear reset flag. */ - boardp->flags &= ~ASC_HOST_IN_RESET; - - /* - * Start any waiting commands for the board. - */ - if (!ASC_QUEUE_EMPTY(&boardp->waiting)) { - ASC_DBG(1, "advansys_interrupt: before asc_execute_queue()\n"); - asc_execute_queue(&boardp->waiting); - } - ret = SCSI_RESET_SUCCESS; - } - - /* Interrupts could be enabled here. */ - - ASC_ASSERT(do_scsi_done != ASC_ERROR); - ASC_ASSERT(scp_found != ASC_ERROR); - if (do_scsi_done == ASC_TRUE) { - if (scp->scsi_done == NULL) { - ASC_PRINT1( -"advansys_reset: reset request scsi_done() is NULL, %lx\n", - (ulong) scp); - } else { - if (scp_found == ASC_FALSE) { - ASC_PRINT1( -"advansys_reset: reset request not active or waiting, completing anyway %lx\n", - (ulong) scp); - } - ASC_STATS(scp->host, done); - scp->scsi_done(scp); - } - } - - /* - * It is possible for the request done function to re-enable - * interrupts without confusing the driver. But here interrupts - * aren't enabled until requests have been completed. - */ - if (done_scp != NULL) { - asc_scsi_done_list(done_scp); - } - - ASC_DBG1(1, "advansys_reset: ret %d\n", ret); - - /* Re-enable interrupts, if they were enabled on entry. */ - restore_flags(flags); - - ASC_ASSERT(ret != ASC_ERROR); - return ret; -} -#else /* version >= v2.3.28 */ -/* - * advansys_eh_bus_reset() - * * Reset the bus associated with the command 'scp'. * * This function runs its own thread. Interrupts must be blocked but @@ -7149,24 +5982,24 @@ * required. Returns SUCCESS or FAILED. */ int -advansys_eh_bus_reset(Scsi_Cmnd *scp) +advansys_reset(Scsi_Cmnd *scp) { struct Scsi_Host *shp; asc_board_t *boardp; ASC_DVC_VAR *asc_dvc_varp; ADV_DVC_VAR *adv_dvc_varp; - int flags; + ulong flags; Scsi_Cmnd *done_scp = NULL, *last_scp = NULL; Scsi_Cmnd *tscp, *new_last_scp; int status; - int ret; + int ret = SUCCESS; - ASC_DBG1(1, "advansys_eh_bus_reset: %lx\n", (ulong) scp); + ASC_DBG1(1, "advansys_reset: 0x%lx\n", (ulong) scp); #ifdef ADVANSYS_STATS if (scp->host != NULL) { - ASC_STATS(scp->host, eh_bus_reset); - } + ASC_STATS(scp->host, reset); + } #endif /* ADVANSYS_STATS */ if ((shp = scp->host) == NULL) { @@ -7176,6 +6009,8 @@ boardp = ASC_BOARDP(shp); + ASC_PRINT1("advansys_reset: board %d: SCSI bus reset started...\n", + boardp->id); /* * Check for re-entrancy. */ @@ -7187,32 +6022,43 @@ boardp->flags |= ASC_HOST_IN_RESET; spin_unlock_irqrestore(&boardp->lock, flags); + /* + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level reset entrypoint. + */ + ASC_UNLOCK_IO_REQUEST_LOCK + if (ASC_NARROW_BOARD(boardp)) { /* * Narrow Board - * - * If the suggest reset bus flags are set, then reset the bus. - * Otherwise only reset the device. */ asc_dvc_varp = &boardp->dvc_var.asc_dvc_var; /* - * Reset the target's SCSI bus. + * Reset the chip and SCSI bus. */ - ASC_DBG(1, "advansys_eh_bus_reset: before AscResetSB()\n"); - status = AscResetSB(asc_dvc_varp); - switch (status) { - case ASC_TRUE: - ASC_DBG(1, "advansys_eh_bus_reset: AscResetSB() success\n"); - ret = SUCCESS; - break; - case ASC_ERROR: - default: - ASC_DBG(1, "advansys_eh_bus_reset: AscResetSB() failed\n"); + ASC_DBG(1, "advansys_reset: before AscInitAsc1000Driver()\n"); + status = AscInitAsc1000Driver(asc_dvc_varp); + + /* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */ + if (asc_dvc_varp->err_code) { + ASC_PRINT2( + "advansys_reset: board %d: SCSI bus reset error: 0x%x\n", + boardp->id, asc_dvc_varp->err_code); ret = FAILED; - break; + } else if (status) { + ASC_PRINT2( + "advansys_reset: board %d: SCSI bus reset warning: 0x%x\n", + boardp->id, status); + } else { + ASC_PRINT1( + "advansys_reset: board %d: SCSI bus reset successful.\n", + boardp->id); } + ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n"); + /* * Acquire the board lock. */ @@ -7230,16 +6076,16 @@ /* * Reset the target's SCSI bus. */ - ASC_DBG(1, "advansys_eh_bus_reset: before AdvResetChipAndSB()\n"); + ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n"); switch (AdvResetChipAndSB(adv_dvc_varp)) { case ASC_TRUE: - ASC_DBG(1, - "advansys_eh_bus_reset: AdvResetChipAndSB() success\n"); - ret = SUCCESS; + ASC_PRINT1("advansys_reset: board %d: SCSI bus reset successful.\n", + boardp->id); break; case ASC_FALSE: default: - ASC_DBG(1, "advansys_eh_bus_reset: AdvResetChipAndSB() failed\n"); + ASC_PRINT1("advansys_reset: board %d: SCSI bus reset error.\n", + boardp->id); ret = FAILED; break; } @@ -7322,11 +6168,17 @@ asc_scsi_done_list(done_scp); } - ASC_DBG1(1, "advansys_eh_bus_reset: ret %d\n", ret); + /* + * XXX - Remove this comment and the next line when SCSI mid-level + * no longer acquires 'io_request_lock' before calling the SCSI + * low-level reset entrypoint. + */ + ASC_LOCK_IO_REQUEST_LOCK + + ASC_DBG1(1, "advansys_reset: ret %d\n", ret); return ret; } -#endif /* version >= v2.3.28 */ /* * advansys_biosparam() @@ -7340,11 +6192,7 @@ * ip[2]: cylinders */ int -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -advansys_biosparam(Disk *dp, int dep, int ip[]) -#else /* version >= v1.3.0 */ advansys_biosparam(Disk *dp, kdev_t dep, int ip[]) -#endif /* version >= v1.3.0 */ { asc_board_t *boardp; @@ -7440,14 +6288,14 @@ #ifdef ADVANSYS_DEBUG ASC_DBG1(1, "advansys_setup: ints[0] %d\n", ints[0]); for (i = 1; i < ints[0]; i++) { - ASC_DBG2(1, " ints[%d] %x", i, ints[i]); + ASC_DBG2(1, " ints[%d] 0x%x", i, ints[i]); } ASC_DBG(1, "\n"); #endif /* ADVANSYS_DEBUG */ for (i = 1; i <= ints[0] && i <= ASC_NUM_IOPORT_PROBE; i++) { asc_ioport[i-1] = ints[i]; - ASC_DBG2(1, "advansys_setup: asc_ioport[%d] %x\n", + ASC_DBG2(1, "advansys_setup: asc_ioport[%d] 0x%x\n", i - 1, asc_ioport[i-1]); } } @@ -7457,15 +6305,15 @@ * --- Loadable Driver Support */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0) +#if ASC_LINUX_KERNEL24 +static Scsi_Host_Template driver_template = ADVANSYS; +# include "scsi_module.c" +#elif ASC_LINUX_KERNEL22 #ifdef MODULE Scsi_Host_Template driver_template = ADVANSYS; # include "scsi_module.c" #endif /* MODULE */ -#else /* version >= v2.4.0 */ -static Scsi_Host_Template driver_template = ADVANSYS; -# include "scsi_module.c" -#endif /* version >= v2.4.0 */ +#endif /* @@ -7475,41 +6323,21 @@ /* * First-level interrupt handler. * - * For versions > v1.3.70, 'dev_id' is a pointer to the interrupting - * adapter's asc_board_t. Because all boards are currently checked - * for interrupts on each interrupt, 'dev_id' is not referenced. 'dev_id' - * could be used to identify an interrupt passed to the AdvanSys driver, - * which is for a device sharing an interrupt with an AdvanSys adapter. + * 'dev_id' is a pointer to the interrupting adapter's asc_board_t. Because + * all boards are currently checked for interrupts on each interrupt, 'dev_id' + * is not referenced. 'dev_id' could be used to identify an interrupt passed + * to the AdvanSys driver which is for a device sharing an interrupt with + * an AdvanSys adapter. */ STATIC void -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70) -advansys_interrupt(int irq, struct pt_regs *regs) -#else /* version >= v1.3.70 */ advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs) -#endif /* version >= v1.3.70 */ { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,95) - int flags; -#else /* version >= v2.1.95 */ - unsigned long flags; -#endif /* version >= v2.1.95 */ + ulong flags; int i; asc_board_t *boardp; Scsi_Cmnd *done_scp = NULL, *last_scp = NULL; Scsi_Cmnd *new_last_scp; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,95) - /* Disable interrupts, if they aren't already disabled. */ - save_flags(flags); - cli(); -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - /* - * Disable interrupts, if they aren't already disabled and acquire - * the I/O spinlock. - */ - spin_lock_irqsave(&io_request_lock, flags); -#endif /* version < v2.3.28 */ - ASC_DBG(1, "advansys_interrupt: begin\n"); /* @@ -7518,11 +6346,9 @@ */ for (i = 0; i < asc_board_count; i++) { boardp = ASC_BOARDP(asc_host[i]); - ASC_DBG2(2, "advansys_interrupt: i %d, boardp %lx\n", - i, (ulong) boardp) -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,28) + ASC_DBG2(2, "advansys_interrupt: i %d, boardp 0x%lx\n", + i, (ulong) boardp); spin_lock_irqsave(&boardp->lock, flags); -#endif /* version >= v2.3.28 */ if (ASC_NARROW_BOARD(boardp)) { /* * Narrow Board @@ -7544,13 +6370,12 @@ /* * Start waiting requests and create a list of completed requests. - * - * If a reset or abort request is being performed for the board, - * the reset or abort handler will complete pending requests after - * it has completed. + * + * If a reset request is being performed for the board, the reset + * handler will complete pending requests after it has completed. */ - if ((boardp->flags & (ASC_HOST_IN_RESET | ASC_HOST_IN_ABORT)) == 0) { - ASC_DBG2(1, "advansys_interrupt: done_scp %lx, last_scp %lx\n", + if ((boardp->flags & ASC_HOST_IN_RESET) == 0) { + ASC_DBG2(1, "advansys_interrupt: done_scp 0x%lx, last_scp 0x%lx\n", (ulong) done_scp, (ulong) last_scp); /* Start any waiting commands for the board. */ @@ -7579,41 +6404,21 @@ } } } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,28) spin_unlock_irqrestore(&boardp->lock, flags); -#endif /* version >= v2.3.28 */ } - /* Interrupts could be enabled here. */ - /* - * It is possible for the request done function to re-enable - * interrupts without confusing the driver. But here the - * original flags aren't restored until all requests have been - * completed. + * If interrupts were enabled on entry, then they + * are now enabled here. + * + * Complete all requests on the done list. */ asc_scsi_done_list(done_scp); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,95) - /* - * Restore the original flags which will enable interrupts - * if and only if they were enabled on entry. - */ - restore_flags(flags); -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - /* - * Release the I/O spinlock and restore the original flags - * which will enable interrupts if and only if they were - * enabled on entry. - */ - spin_unlock_irqrestore(&io_request_lock, flags); -#endif /* version < v2.3.28 */ - ASC_DBG(1, "advansys_interrupt: end\n"); return; } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) /* * Set the number of commands to queue per device for the * specified host adapter. @@ -7642,24 +6447,11 @@ device->queue_depth = boardp->dvc_var.adv_dvc_var.max_dvc_qng; } - ASC_DBG3(1, "advansys_select_queue_depths: shp %lx, id %d, depth %d\n", + ASC_DBG3(1, + "advansys_select_queue_depths: shp 0x%lx, id %d, depth %d\n", (ulong) shp, device->id, device->queue_depth); } } -#endif /* version >= v1.3.89 */ - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -/* - * Function used only with polled I/O requests that are initiated by - * advansys_command(). - */ -STATIC void -advansys_command_done(Scsi_Cmnd *scp) -{ - ASC_DBG1(1, "advansys_command_done: scp %lx\n", (ulong) scp); - scp->SCp.Status = 1; -} -#endif /* version < v2.3.28 */ /* * Complete all requests on the singly linked list pointed @@ -7674,7 +6466,7 @@ ASC_DBG(2, "asc_scsi_done_list: begin\n"); while (scp != NULL) { - ASC_DBG1(3, "asc_scsi_done_list: scp %lx\n", (ulong) scp); + ASC_DBG1(3, "asc_scsi_done_list: scp 0x%lx\n", (ulong) scp); tscp = REQPNEXT(scp); REQPNEXT(scp) = NULL; ASC_STATS(scp->host, done); @@ -7722,12 +6514,15 @@ * scsi_done - used to save caller's done function * host_scribble - used for pointer to another Scsi_Cmnd * - * If this function returns ASC_NOERROR or ASC_ERROR the request - * has been enqueued on the board's 'done' queue and must be - * completed by the caller. + * If this function returns ASC_NOERROR the request has been enqueued + * on the board's 'active' queue and will be completed from the + * interrupt handler. * - * If ASC_BUSY is returned the request must be enqueued by the - * caller and re-tried later. + * If this function returns ASC_NOERROR the request has been enqueued + * on the board's 'done' queue and must be completed by the caller. + * + * If ASC_BUSY is returned the request will be enqueued by the + * caller on the target's waiting queue and re-tried later. */ STATIC int asc_execute_scsi_cmnd(Scsi_Cmnd *scp) @@ -7739,8 +6534,7 @@ Scsi_Device *device; int ret; - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); - ASC_DBG2(1, "asc_execute_scsi_cmnd: scp %lx, done %lx\n", + ASC_DBG2(1, "asc_execute_scsi_cmnd: scp 0x%lx, done 0x%lx\n", (ulong) scp, (ulong) scp->scsi_done); boardp = ASC_BOARDP(scp->host); @@ -7757,6 +6551,10 @@ * Build Asc Library request structure using the * global structures 'asc_scsi_req' and 'asc_sg_head'. * + * If an error is returned, then the request has been + * queued on the board done queue. It will be completed + * by the caller. + * * asc_build_req() can not return ASC_BUSY. */ if (asc_build_req(boardp, scp) == ASC_ERROR) { @@ -7776,18 +6574,20 @@ * request counter. Wrapping doesn't matter. */ boardp->reqcnt[scp->target]++; - asc_enqueue(&boardp->active, scp, ASC_BACK); ASC_DBG(1, "asc_execute_scsi_cmnd: AscExeScsiQueue(), ASC_NOERROR\n"); break; case ASC_BUSY: - /* Caller must enqueue request and retry later. */ + /* + * Caller will enqueue request on the target's waiting queue + * and retry later. + */ ASC_STATS(scp->host, exe_busy); break; case ASC_ERROR: ASC_PRINT2( -"asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() ASC_ERROR, err_code %x\n", +"asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n", boardp->id, asc_dvc_varp->err_code); ASC_STATS(scp->host, exe_error); scp->result = HOST_BYTE(DID_ERROR); @@ -7795,7 +6595,7 @@ break; default: ASC_PRINT2( -"asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() unknown, err_code %x\n", +"asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() unknown, err_code 0x%x\n", boardp->id, asc_dvc_varp->err_code); ASC_STATS(scp->host, exe_unknown); scp->result = HOST_BYTE(DID_ERROR); @@ -7811,7 +6611,7 @@ /* * Build and get a pointer to an Adv Library request structure. * - * If the request is successfully built then send it below, + * If the request is successfully built then send it below, * otherwise return with an error. */ switch (adv_build_req(boardp, scp, &adv_scsiqp)) { @@ -7820,14 +6620,28 @@ break; case ASC_BUSY: ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req ASC_BUSY\n"); + /* + * If busy is returned the request has not been enqueued. + * It will be enqueued by the caller on the target's waiting + * queue and retried later. + * + * The asc_stats fields 'adv_build_noreq' and 'adv_build_nosg' + * count wide board busy conditions. They are updated in + * adv_build_req and adv_get_sglist, respectively. + */ return ASC_BUSY; case ASC_ERROR: + /* + * If an error is returned, then the request has been + * queued on the board done queue. It will be completed + * by the caller. + */ default: ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req ASC_ERROR\n"); ASC_STATS(scp->host, build_error); return ASC_ERROR; } - + /* * Execute the command. If there is no error, add the command * to the active queue. @@ -7845,12 +6659,15 @@ "asc_execute_scsi_cmnd: AdvExeScsiQueue(), ASC_NOERROR\n"); break; case ASC_BUSY: - /* Caller must enqueue request and retry later. */ + /* + * Caller will enqueue request on the target's waiting queue + * and retry later. + */ ASC_STATS(scp->host, exe_busy); break; case ASC_ERROR: ASC_PRINT2( -"asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() ASC_ERROR, err_code %x\n", +"asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n", boardp->id, adv_dvc_varp->err_code); ASC_STATS(scp->host, exe_error); scp->result = HOST_BYTE(DID_ERROR); @@ -7858,7 +6675,7 @@ break; default: ASC_PRINT2( -"asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() unknown, err_code %x\n", +"asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() unknown, err_code 0x%x\n", boardp->id, adv_dvc_varp->err_code); ASC_STATS(scp->host, exe_unknown); scp->result = HOST_BYTE(DID_ERROR); @@ -7868,7 +6685,6 @@ } ASC_DBG(1, "asc_execute_scsi_cmnd: end\n"); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); return ret; } @@ -7878,7 +6694,8 @@ * The global structures 'asc_scsi_q' and 'asc_sg_head' are * used to build the request. * - * If an error occurs, then return ASC_ERROR. + * If an error occurs, then queue the request on the board done + * queue and return ASC_ERROR. */ STATIC int asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp) @@ -7900,20 +6717,20 @@ * For narrow boards a CDB length maximum of 12 bytes * is supported. */ - ASC_ASSERT(scp->cmd_len <= ASC_MAX_CDB_LEN); if (scp->cmd_len > ASC_MAX_CDB_LEN) { - scp->cmd_len = ASC_MAX_CDB_LEN; + ASC_PRINT3( +"asc_build_req: board %d: cmd_len %d > ASC_MAX_CDB_LEN %d\n", + boardp->id, scp->cmd_len, ASC_MAX_CDB_LEN); + scp->result = HOST_BYTE(DID_ERROR); + asc_enqueue(&boardp->done, scp, ASC_BACK); + return ASC_ERROR; } asc_scsi_q.cdbptr = &scp->cmnd[0]; asc_scsi_q.q2.cdb_len = scp->cmd_len; asc_scsi_q.q1.target_id = ASC_TID_TO_TARGET_ID(scp->target); asc_scsi_q.q1.target_lun = scp->lun; asc_scsi_q.q2.target_ix = ASC_TIDLUN_TO_IX(scp->target, scp->lun); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - asc_scsi_q.q1.sense_addr = (ADV_PADDR) &scp->sense_buffer[0]; -#else /* version >= v2.0.0 */ asc_scsi_q.q1.sense_addr = cpu_to_le32(virt_to_bus(&scp->sense_buffer[0])); -#endif /* version >= v2.0.0 */ asc_scsi_q.q1.sense_len = sizeof(scp->sense_buffer); /* @@ -7925,7 +6742,7 @@ * * The request count is incremented below for every successfully * started request. - * + * */ if ((boardp->dvc_var.asc_dvc_var.cur_dvc_qng[scp->target] > 0) && (boardp->reqcnt[scp->target] % 255) == 0) { @@ -7943,13 +6760,9 @@ * CDB request of single contiguous buffer. */ ASC_STATS(scp->host, cont_cnt); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - asc_scsi_q.q1.data_addr = (ADV_PADDR) scp->request_buffer; -#else /* version >= v2.0.0 */ asc_scsi_q.q1.data_addr = cpu_to_le32(virt_to_bus(scp->request_buffer)); -#endif /* version >= v2.0.0 */ - asc_scsi_q.q1.data_cnt = scp->request_bufflen; + asc_scsi_q.q1.data_cnt = cpu_to_le32(scp->request_bufflen); ASC_STATS_ADD(scp->host, cont_xfer, ASC_CEILING(scp->request_bufflen, 512)); asc_scsi_q.q1.sg_queue_cnt = 0; @@ -7982,6 +6795,7 @@ asc_scsi_q.sg_head = &asc_sg_head; asc_scsi_q.q1.data_cnt = 0; asc_scsi_q.q1.data_addr = 0; + /* This is a byte value, otherwise it would need to be swapped. */ asc_sg_head.entry_cnt = asc_scsi_q.q1.sg_queue_cnt = scp->use_sg; ASC_STATS_ADD(scp->host, sg_elem, asc_sg_head.entry_cnt); @@ -7990,12 +6804,8 @@ */ slp = (struct scatterlist *) scp->request_buffer; for (sgcnt = 0; sgcnt < scp->use_sg; sgcnt++, slp++) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - asc_sg_head.sg_list[sgcnt].addr = (ADV_PADDR) slp->address; -#else /* version >= v2.0.0 */ asc_sg_head.sg_list[sgcnt].addr = cpu_to_le32(virt_to_bus(slp->address)); -#endif /* version >= v2.0.0 */ asc_sg_head.sg_list[sgcnt].bytes = cpu_to_le32(slp->length); ASC_STATS_ADD(scp->host, sg_xfer, ASC_CEILING(slp->length, 512)); } @@ -8041,9 +6851,9 @@ } /* - * Get 4-byte aligned ADV_SCSI_REQ_Q and ADV_SG_BLOCK pointers. + * Get 32-byte aligned ADV_SCSI_REQ_Q and ADV_SG_BLOCK pointers. */ - scsiqp = (ADV_SCSI_REQ_Q *) ADV_8BALIGN(&reqp->scsi_req_q); + scsiqp = (ADV_SCSI_REQ_Q *) ADV_32BALIGN(&reqp->scsi_req_q); /* * Initialize the structure. @@ -8069,9 +6879,13 @@ * For wide boards a CDB length maximum of 16 bytes * is supported. */ - ASC_ASSERT(scp->cmd_len <= ADV_MAX_CDB_LEN); if (scp->cmd_len > ADV_MAX_CDB_LEN) { - scp->cmd_len = ADV_MAX_CDB_LEN; + ASC_PRINT3( +"adv_build_req: board %d: cmd_len %d > ADV_MAX_CDB_LEN %d\n", + boardp->id, scp->cmd_len, ADV_MAX_CDB_LEN); + scp->result = HOST_BYTE(DID_ERROR); + asc_enqueue(&boardp->done, scp, ASC_BACK); + return ASC_ERROR; } scsiqp->cdb_len = scp->cmd_len; /* Copy first 12 CDB bytes to cdb[]. */ @@ -8086,11 +6900,7 @@ scsiqp->target_id = scp->target; scsiqp->target_lun = scp->lun; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - scsiqp->sense_addr = (ADV_PADDR) &scp->sense_buffer[0]; -#else /* version >= v2.0.0 */ scsiqp->sense_addr = cpu_to_le32(virt_to_bus(&scp->sense_buffer[0])); -#endif /* version >= v2.0.0 */ scsiqp->sense_len = sizeof(scp->sense_buffer); /* @@ -8099,11 +6909,7 @@ */ scsiqp->data_cnt = cpu_to_le32(scp->request_bufflen); scsiqp->vdata_addr = scp->request_buffer; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - scsiqp->data_addr = (ADV_PADDR) scp->request_buffer; -#else /* version >= v2.0.0 */ scsiqp->data_addr = cpu_to_le32(virt_to_bus(scp->request_buffer)); -#endif /* version >= v2.0.0 */ if (scp->use_sg == 0) { /* @@ -8182,7 +6988,7 @@ ADV_PADDR sg_block_paddr; int i; - scsiqp = (ADV_SCSI_REQ_Q *) ADV_8BALIGN(&reqp->scsi_req_q); + scsiqp = (ADV_SCSI_REQ_Q *) ADV_32BALIGN(&reqp->scsi_req_q); slp = (struct scatterlist *) scp->request_buffer; sg_elem_cnt = scp->use_sg; prev_sg_block = NULL; @@ -8223,12 +7029,7 @@ * the allocated ADV_SG_BLOCK structure. */ sg_block = (ADV_SG_BLOCK *) ADV_8BALIGN(&sgblkp->sg_block); - sg_block_paddr = -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - (ADV_PADDR) sg_block; -#else /* version >= v2.0.0 */ - virt_to_bus(sg_block); -#endif /* version >= v2.0.0 */ + sg_block_paddr = virt_to_bus(sg_block); /* * Check if this is the first 'adv_sgblk_t' for the request. @@ -8262,11 +7063,7 @@ for (i = 0; i < NO_OF_SG_PER_BLOCK; i++) { sg_block->sg_list[i].sg_addr = -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - (ADV_PADDR) slp->address; -#else /* version >= v2.0.0 */ cpu_to_le32(virt_to_bus(slp->address)); -#endif /* version >= v2.0.0 */ sg_block->sg_list[i].sg_count = cpu_to_le32(slp->length); ASC_STATS_ADD(scp->host, sg_xfer, ASC_CEILING(slp->length, 512)); @@ -8298,8 +7095,7 @@ struct Scsi_Host *shp; int i; - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); - ASC_DBG2(1, "asc_isr_callback: asc_dvc_varp %lx, qdonep %lx\n", + ASC_DBG2(1, "asc_isr_callback: asc_dvc_varp 0x%lx, qdonep 0x%lx\n", (ulong) asc_dvc_varp, (ulong) qdonep); ASC_DBG_PRT_ASC_QDONE_INFO(2, qdonep); @@ -8308,7 +7104,7 @@ * command that has been completed. */ scp = (Scsi_Cmnd *) ASC_U32_TO_VADDR(qdonep->d2.srb_ptr); - ASC_DBG1(1, "asc_isr_callback: scp %lx\n", (ulong) scp); + ASC_DBG1(1, "asc_isr_callback: scp 0x%lx\n", (ulong) scp); if (scp == NULL) { ASC_PRINT("asc_isr_callback: scp is NULL\n"); @@ -8328,24 +7124,24 @@ } if (i == asc_board_count) { ASC_PRINT2( - "asc_isr_callback: scp %lx has bad host pointer, host %lx\n", + "asc_isr_callback: scp 0x%lx has bad host pointer, host 0x%lx\n", (ulong) scp, (ulong) shp); return; } ASC_STATS(shp, callback); - ASC_DBG1(1, "asc_isr_callback: shp %lx\n", (ulong) shp); + ASC_DBG1(1, "asc_isr_callback: shp 0x%lx\n", (ulong) shp); /* * If the request isn't found on the active queue, it may - * have been removed to handle a reset or abort request. + * have been removed to handle a reset request. * Display a message and return. */ boardp = ASC_BOARDP(shp); ASC_ASSERT(asc_dvc_varp == &boardp->dvc_var.asc_dvc_var); if (asc_rmqueue(&boardp->active, scp) == ASC_FALSE) { ASC_PRINT2( - "asc_isr_callback: board %d: scp %lx not on active queue\n", + "asc_isr_callback: board %d: scp 0x%lx not on active queue\n", boardp->id, (ulong) scp); return; } @@ -8369,20 +7165,20 @@ (ASC_SCSI_INQUIRY *) scp->request_buffer); } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,19) +#if ASC_LINUX_KERNEL24 /* * Check for an underrun condition. * * If there was no error and an underrun condition, then * then return the number of underrun bytes. */ - if (scp->request_bufflen != 0 && qdonep->remain_bytes != 0 && + if (scp->request_bufflen != 0 && qdonep->remain_bytes != 0 && qdonep->remain_bytes <= scp->request_bufflen != 0) { ASC_DBG1(1, "asc_isr_callback: underrun condition %u bytes\n", (unsigned) qdonep->remain_bytes); scp->resid = qdonep->remain_bytes; } -#endif /* version >= v2.3.19 */ +#endif break; case QD_WITH_ERROR: @@ -8404,15 +7200,15 @@ * byte as it is defined by SCSI. */ scp->result = DRIVER_BYTE(DRIVER_SENSE) | - STATUS_BYTE(qdonep->d3.scsi_stat); + STATUS_BYTE(qdonep->d3.scsi_stat); } else { - scp->result = STATUS_BYTE(qdonep->d3.scsi_stat); + scp->result = STATUS_BYTE(qdonep->d3.scsi_stat); } break; default: /* QHSTA error occurred */ - ASC_DBG1(1, "asc_isr_callback: host_stat %x\n", + ASC_DBG1(1, "asc_isr_callback: host_stat 0x%x\n", qdonep->d3.host_stat); scp->result = HOST_BYTE(DID_BAD_TARGET); break; @@ -8426,7 +7222,7 @@ break; default: - ASC_DBG1(1, "asc_isr_callback: done_stat %x\n", qdonep->d3.done_stat); + ASC_DBG1(1, "asc_isr_callback: done_stat 0x%x\n", qdonep->d3.done_stat); scp->result = HOST_BYTE(DID_ERROR) | MSG_BYTE(qdonep->d3.scsi_msg) | STATUS_BYTE(qdonep->d3.scsi_stat); break; @@ -8443,7 +7239,7 @@ boardp->init_tidmask |= ADV_TID_TO_TIDMASK(scp->target); } - /* + /* * Because interrupts may be enabled by the 'Scsi_Cmnd' done * function, add the command to the end of the board's done queue. * The done function for the command will be called from @@ -8468,9 +7264,12 @@ Scsi_Cmnd *scp; struct Scsi_Host *shp; int i; +#if ASC_LINUX_KERNEL24 + ADV_DCNT resid_cnt; +#endif - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); - ASC_DBG2(1, "adv_isr_callback: adv_dvc_varp %lx, scsiqp %lx\n", + + ASC_DBG2(1, "adv_isr_callback: adv_dvc_varp 0x%lx, scsiqp 0x%lx\n", (ulong) adv_dvc_varp, (ulong) scsiqp); ASC_DBG_PRT_ADV_SCSI_REQ_Q(2, scsiqp); @@ -8480,7 +7279,7 @@ * completed ADV_SCSI_REQ_Q structure. */ reqp = (adv_req_t *) ADV_U32_TO_VADDR(scsiqp->srb_ptr); - ASC_DBG1(1, "adv_isr_callback: reqp %lx\n", (ulong) reqp); + ASC_DBG1(1, "adv_isr_callback: reqp 0x%lx\n", (ulong) reqp); if (reqp == NULL) { ASC_PRINT("adv_isr_callback: reqp is NULL\n"); return; @@ -8495,7 +7294,7 @@ * determined. */ scp = reqp->cmndp; - ASC_DBG1(1, "adv_isr_callback: scp %lx\n", (ulong) scp); + ASC_DBG1(1, "adv_isr_callback: scp 0x%lx\n", (ulong) scp); if (scp == NULL) { ASC_PRINT("adv_isr_callback: scp is NULL; adv_req_t dropped.\n"); return; @@ -8518,18 +7317,17 @@ */ if (i == asc_board_count) { ASC_PRINT2( - "adv_isr_callback: scp %lx has bad host pointer, host %lx\n", + "adv_isr_callback: scp 0x%lx has bad host pointer, host 0x%lx\n", (ulong) scp, (ulong) shp); return; } ASC_STATS(shp, callback); - ASC_DBG1(1, "adv_isr_callback: shp %lx\n", (ulong) shp); + ASC_DBG1(1, "adv_isr_callback: shp 0x%lx\n", (ulong) shp); /* * If the request isn't found on the active queue, it may have been - * removed to handle a reset or abort request. Display a message and - * return. + * removed to handle a reset request. Display a message and return. * * Note: Because the structure may still be in use don't attempt * to free the adv_req_t and adv_sgblk_t, if any, structures. @@ -8538,7 +7336,7 @@ ASC_ASSERT(adv_dvc_varp == &boardp->dvc_var.adv_dvc_var); if (asc_rmqueue(&boardp->active, scp) == ASC_FALSE) { ASC_PRINT2( - "adv_isr_callback: board %d: scp %lx not on active queue\n", + "adv_isr_callback: board %d: scp 0x%lx not on active queue\n", boardp->id, (ulong) scp); return; } @@ -8551,20 +7349,21 @@ ASC_DBG(2, "adv_isr_callback: QD_NO_ERROR\n"); scp->result = 0; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,3,19) +#if ASC_LINUX_KERNEL24 /* * Check for an underrun condition. * * If there was no error and an underrun condition, then * then return the number of underrun bytes. */ - if (scp->request_bufflen != 0 && scsiqp->data_cnt != 0 && - le32_to_cpu(scsiqp->data_cnt) <= scp->request_bufflen) { + resid_cnt = le32_to_cpu(scsiqp->data_cnt); + if (scp->request_bufflen != 0 && resid_cnt != 0 && + resid_cnt <= scp->request_bufflen) { ASC_DBG1(1, "adv_isr_callback: underrun condition %lu bytes\n", - (ulong) le32_to_cpu(scsiqp->data_cnt)); - scp->resid = le32_to_cpu(scsiqp->data_cnt); + (ulong) resid_cnt); + scp->resid = resid_cnt; } -#endif /* version >= v2.3.19 */ +#endif break; case QD_WITH_ERROR: @@ -8594,7 +7393,7 @@ default: /* Some other QHSTA error occurred. */ - ASC_DBG1(1, "adv_isr_callback: host_status %x\n", + ASC_DBG1(1, "adv_isr_callback: host_status 0x%x\n", scsiqp->host_status); scp->result = HOST_BYTE(DID_BAD_TARGET); break; @@ -8607,7 +7406,7 @@ break; default: - ASC_DBG1(1, "adv_isr_callback: done_status %x\n", scsiqp->done_status); + ASC_DBG1(1, "adv_isr_callback: done_status 0x%x\n", scsiqp->done_status); scp->result = HOST_BYTE(DID_ERROR) | STATUS_BYTE(scsiqp->scsi_status); break; } @@ -8623,7 +7422,7 @@ boardp->init_tidmask |= ADV_TID_TO_TIDMASK(scp->target); } - /* + /* * Because interrupts may be enabled by the 'Scsi_Cmnd' done * function, add the command to the end of the board's done queue. * The done function for the command will be called from @@ -8663,445 +7462,36 @@ adv_async_callback(ADV_DVC_VAR *adv_dvc_varp, uchar code) { switch (code) - { - case ADV_ASYNC_SCSI_BUS_RESET_DET: - /* - * The firmware detected a SCSI Bus reset. - */ - ASC_DBG(0, "adv_async_callback: ADV_ASYNC_SCSI_BUS_RESET_DET\n"); - break; - - case ADV_ASYNC_RDMA_FAILURE: - /* - * Handle RDMA failure by resetting the SCSI Bus and - * possibly the chip if it is unresponsive. Log the error - * with a unique code. - */ - ASC_DBG(0, "adv_async_callback: ADV_ASYNC_RDMA_FAILURE\n"); - AdvResetChipAndSB(adv_dvc_varp); - break; - - case ADV_HOST_SCSI_BUS_RESET: - /* - * Host generated SCSI bus reset occurred. - */ - ASC_DBG(0, "adv_async_callback: ADV_HOST_SCSI_BUS_RESET\n"); - break; - - default: - ASC_DBG1(0, "DvcAsyncCallBack: unknown code 0x%x\n", code); - break; - } -} - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI -/* - * Search for an AdvanSys PCI device in the PCI configuration space. - */ -ASC_INITFUNC( -STATIC int, -asc_srch_pci_dev(PCI_DEVICE *pciDevice) -) -{ - int ret = PCI_DEVICE_NOT_FOUND; - - ASC_DBG(2, "asc_srch_pci_dev: begin\n"); - - if (pci_scan_method == -1) { - pci_scan_method = asc_scan_method(); - } - pciDevice->type = pci_scan_method; - ASC_DBG1(2, "asc_srch_pci_dev: type %d\n", pciDevice->type); - - ret = asc_pci_find_dev(pciDevice); - ASC_DBG1(2, "asc_srch_pci_dev: asc_pci_find_dev() return %d\n", ret); - if (ret == PCI_DEVICE_FOUND) { - pciDevice->slotNumber = pciDevice->slotFound + 1; - pciDevice->startSlot = pciDevice->slotFound + 1; - } else { - if (pciDevice->bridge > pciDevice->busNumber) { - ASC_DBG2(2, "asc_srch_pci_dev: bridge %x, busNumber %x\n", - pciDevice->bridge, pciDevice->busNumber); - pciDevice->busNumber++; - pciDevice->slotNumber = 0; - pciDevice->startSlot = 0; - pciDevice->endSlot = 0x0f; - ret = asc_srch_pci_dev(pciDevice); - ASC_DBG1(2, "asc_srch_pci_dev: recursive call return %d\n", ret); - } - } - - ASC_DBG1(2, "asc_srch_pci_dev: return %d\n", ret); - return ret; -} - -/* - * Determine the access method to be used for 'pciDevice'. - */ -ASC_INITFUNC( -STATIC uchar, -asc_scan_method(void) -) -{ - ushort data; - PCI_DATA pciData; - uchar type; - uchar slot; - - ASC_DBG(2, "asc_scan_method: begin\n"); - memset(&pciData, 0, sizeof(pciData)); - for (type = 1; type < 3; type++) { - pciData.type = type; - for (slot = 0; slot < PCI_MAX_SLOT; slot++) { - pciData.slot = slot; - data = asc_get_cfg_word(&pciData); - if ((data != 0xFFFF) && (data != 0x0000)) { - ASC_DBG2(4, "asc_scan_method: data %x, type %d\n", data, type); - return (type); - } - } - } - ASC_DBG1(4, "asc_scan_method: type %d\n", type); - return (type); -} - -/* - * Check for an AdvanSys PCI device in 'pciDevice'. - * - * Return PCI_DEVICE_FOUND if found, otherwise return PCI_DEVICE_NOT_FOUND. - */ -ASC_INITFUNC( -STATIC int, -asc_pci_find_dev(PCI_DEVICE *pciDevice) -) -{ - PCI_DATA pciData; - ushort vendorid, deviceid; - uchar classcode, subclass; - uchar lslot; - - ASC_DBG(3, "asc_pci_find_dev: begin\n"); - pciData.type = pciDevice->type; - pciData.bus = pciDevice->busNumber; - pciData.func = pciDevice->devFunc; - lslot = pciDevice->startSlot; - for (; lslot < pciDevice->endSlot; lslot++) { - pciData.slot = lslot; - pciData.offset = VENDORID_OFFSET; - vendorid = asc_get_cfg_word(&pciData); - ASC_DBG1(3, "asc_pci_find_dev: vendorid %x\n", vendorid); - if (vendorid != 0xffff) { - pciData.offset = DEVICEID_OFFSET; - deviceid = asc_get_cfg_word(&pciData); - ASC_DBG1(3, "asc_pci_find_dev: deviceid %x\n", deviceid); - if ((vendorid == ASC_PCI_VENDORID) && - ((deviceid == ASC_PCI_DEVICE_ID_1100) || - (deviceid == ASC_PCI_DEVICE_ID_1200) || - (deviceid == ASC_PCI_DEVICE_ID_1300) || - (deviceid == ASC_PCI_DEVICE_ID_2300) || - (deviceid == ASC_PCI_DEVICE_ID_2500))) { - pciDevice->slotFound = lslot; - ASC_DBG(3, "asc_pci_find_dev: PCI_DEVICE_FOUND\n"); - return PCI_DEVICE_FOUND; - } else { - pciData.offset = SUBCLASS_OFFSET; - subclass = asc_get_cfg_byte(&pciData); - pciData.offset = CLASSCODE_OFFSET; - classcode = asc_get_cfg_byte(&pciData); - if ((classcode & PCI_BASE_CLASS_BRIDGE_DEVICE) && - (subclass & PCI_SUB_CLASS_PCI_TO_PCI_BRIDGE_CONTROLLER)) { - pciDevice->bridge++; - } - ASC_DBG2(3, "asc_pci_find_dev: subclass %x, classcode %x\n", - subclass, classcode); - } - } - } - return PCI_DEVICE_NOT_FOUND; -} - -/* - * Read PCI configuration data into 'pciConfig'. - */ -ASC_INITFUNC( -STATIC void, -asc_get_pci_cfg(PCI_DEVICE *pciDevice, PCI_CONFIG_SPACE *pciConfig) -) -{ - PCI_DATA pciData; - uchar counter; - uchar *localConfig; - - ASC_DBG1(4, "asc_get_pci_cfg: slotFound %d\n ", - pciDevice->slotFound); - - pciData.type = pciDevice->type; - pciData.bus = pciDevice->busNumber; - pciData.slot = pciDevice->slotFound; - pciData.func = pciDevice->devFunc; - localConfig = (uchar *) pciConfig; - - for (counter = 0; counter < sizeof(PCI_CONFIG_SPACE); counter++) { - pciData.offset = counter; - *localConfig = asc_get_cfg_byte(&pciData); - ASC_DBG1(4, "asc_get_pci_cfg: byte %x\n", *localConfig); - localConfig++; - } - ASC_DBG1(4, "asc_get_pci_cfg: counter %d\n", counter); -} - -/* - * Read a word (16 bits) from the PCI configuration space. - * - * The configuration mechanism is checked for the correct access method. - */ -ASC_INITFUNC( -STATIC ushort, -asc_get_cfg_word(PCI_DATA *pciData) -) -{ - ushort tmp; - ADV_DCNT address; - ADV_DCNT lbus = pciData->bus; - ADV_DCNT lslot = pciData->slot; - ADV_DCNT lfunc = pciData->func; - uchar t2CFA, t2CF8; - ADV_DCNT t1CF8, t1CFC; - - ASC_DBG4(4, "asc_get_cfg_word: type %d, bus %u, slot %u, func %u\n", - pciData->type, (unsigned) lbus, (unsigned) lslot, (unsigned) lfunc); - - /* - * Check type of configuration mechanism. - */ - if (pciData->type == 2) { - /* - * Save registers to be restored later. - */ - t2CFA = inp(0xCFA); /* save PCI bus register */ - t2CF8 = inp(0xCF8); /* save config space enable register */ - - /* - * Write the bus and enable registers. - */ - /* set for type 1 cycle, if needed */ - outp(0xCFA, pciData->bus); - /* set the function number */ - outp(0xCF8, 0x10 | (pciData->func << 1)); - - /* - * Read the configuration space type 2 locations. - */ - tmp = (ushort) inpw(0xC000 | ((pciData->slot << 8) + pciData->offset)); - - outp(0xCFA, t2CFA); /* save PCI bus register */ - outp(0xCF8, t2CF8); /* save config space enable register */ - } else { - /* - * Type 1 or 3 configuration mechanism. - * - * Save the CONFIG_ADDRESS and CONFIG_DATA register values. - */ - t1CF8 = inpl(0xCF8); - t1CFC = inpl(0xCFC); - - /* - * enable <31>, bus = <23:16>, slot = <15:11>, - * func = <10:8>, reg = <7:2> - */ - address = (ADV_DCNT) ((lbus << 16) | (lslot << 11) | - (lfunc << 8) | (pciData->offset & 0xFC) | 0x80000000L); - - /* - * Write out the address to CONFIG_ADDRESS. - */ - outpl(0xCF8, address); - - /* - * Read in word from CONFIG_DATA. - */ - tmp = (ushort) ((inpl(0xCFC) >> - ((pciData->offset & 2) * 8)) & 0xFFFF); - - /* - * Restore registers. - */ - outpl(0xCF8, t1CF8); - outpl(0xCFC, t1CFC); - } - ASC_DBG1(4, "asc_get_cfg_word: config data: %x\n", tmp); - return tmp; -} - -/* - * Reads a byte from the PCI configuration space. - * - * The configuration mechanism is checked for the correct access method. - */ -ASC_INITFUNC( -STATIC uchar, -asc_get_cfg_byte(PCI_DATA *pciData) -) -{ - uchar tmp; - ADV_DCNT address; - ADV_DCNT lbus = pciData->bus, lslot = pciData->slot, lfunc = pciData->func; - ADV_DCNT t2CFA, t2CF8; - ADV_DCNT t1CF8, t1CFC; - - ASC_DBG1(4, "asc_get_cfg_byte: type: %d\n", pciData->type); - - /* - * Check type of configuration mechanism. - */ - if (pciData->type == 2) { - /* - * Save registers to be restored later. - */ - t2CFA = inp(0xCFA); /* save PCI bus register */ - t2CF8 = inp(0xCF8); /* save config space enable register */ - - /* - * Write the bus and enable registers. - */ - /* set for type 1 cycle, if needed */ - outp(0xCFA, pciData->bus); - /* set the function number */ - outp(0xCF8, 0x10 | (pciData->func << 1)); - - /* - * Read configuration space type 2 locations. - */ - tmp = inp(0xC000 | ((pciData->slot << 8) + pciData->offset)); - - /* - * Restore registers. - */ - outp(0xCF8, t2CF8); /* restore the enable register */ - outp(0xCFA, t2CFA); /* restore PCI bus register */ - } else { - /* - * Type 1 or 3 configuration mechanism. - * - * Save CONFIG_ADDRESS and CONFIG_DATA register values. - */ - t1CF8 = inpl(0xCF8); - t1CFC = inpl(0xCFC); - - /* - * enable <31>, bus = <23:16>, slot = <15:11>, func = <10:8>, - * reg = <7:2> - */ - address = (ADV_DCNT) ((lbus << 16) | (lslot << 11) | - (lfunc << 8) | (pciData->offset & 0xFC) | 0x80000000L); - - /* - * Write out address to CONFIG_ADDRESS. - */ - outpl(0xCF8, address); - - /* - * Read in word from CONFIG_DATA. - */ - tmp = (uchar) ((inpl(0xCFC) >> ((pciData->offset & 3) * 8)) & 0xFF); - - /* - * Restore registers. - */ - outpl(0xCF8, t1CF8); - outpl(0xCFC, t1CFC); - } - ASC_DBG1(4, "asc_get_cfg_byte: config data: %x\n", tmp); - return tmp; -} - -/* - * Write a byte to the PCI configuration space. - */ -ASC_INITFUNC( -STATIC void, -asc_put_cfg_byte(PCI_DATA *pciData, uchar byte_data) -) -{ - ADV_DCNT tmpl; - ADV_DCNT address; - ADV_DCNT lbus = pciData->bus, lslot = pciData->slot, lfunc = pciData->func; - uchar t2CFA, t2CF8; - ADV_DCNT t1CF8, t1CFC; - - ASC_DBG2(4, "asc_put_cfg_byte: type: %d, byte_data %x\n", - pciData->type, byte_data); - - /* - * Check type of configuration mechanism. - */ - if (pciData->type == 2) { - - /* - * Save registers to be restored later. - */ - t2CFA = inp(0xCFA); /* save PCI bus register */ - t2CF8 = inp(0xCF8); /* save config space enable register */ - - /* - * Write bus and enable registers. - */ - outp(0xCFA, pciData->bus); - - /* - * Set the function number. - */ - outp(0xCF8, 0x10 | (pciData->func << 1)); - - /* - * Write the configuration space type 2 locations. - */ - outp(0xC000 | ((pciData->slot << 8) + pciData->offset), byte_data); - - /* - * Restore registers. - */ - outp(0xCF8, t2CF8); /* restore the enable register */ - outp(0xCFA, t2CFA); /* restore PCI bus register */ - } else { - - /* - * Type 1 or 3 configuration mechanism. - * - * Save the CONFIG_ADDRESS and CONFIG_DATA register values. - */ - t1CF8 = inpl(0xCF8); - t1CFC = inpl(0xCFC); - - /* - * enable <31>, bus = <23:16>, slot = <15:11>, func = <10:8>, - * reg = <7:2> - */ - address = (ADV_DCNT) ((lbus << 16) | (lslot << 11) | (lfunc << 8) | - (pciData->offset & 0xFC) | 0x80000000L); + { + case ADV_ASYNC_SCSI_BUS_RESET_DET: /* - * Write out address to CONFIG_ADDRESS. + * The firmware detected a SCSI Bus reset. */ - outpl(0xCF8, address); + ASC_DBG(0, "adv_async_callback: ADV_ASYNC_SCSI_BUS_RESET_DET\n"); + break; + case ADV_ASYNC_RDMA_FAILURE: /* - * Write double word to CONFIG_DATA preserving the bytes - * in the double not written. + * Handle RDMA failure by resetting the SCSI Bus and + * possibly the chip if it is unresponsive. Log the error + * with a unique code. */ - tmpl = inpl(0xCFC) & ~(0xFF << ((pciData->offset & 3) * 8)); - outpl(0xCFC, tmpl | (byte_data << ((pciData->offset & 3) * 8))); + ASC_DBG(0, "adv_async_callback: ADV_ASYNC_RDMA_FAILURE\n"); + AdvResetChipAndSB(adv_dvc_varp); + break; + case ADV_HOST_SCSI_BUS_RESET: /* - * Restore registers. + * Host generated SCSI bus reset occurred. */ - outpl(0xCF8, t1CF8); - outpl(0xCFC, t1CFC); + ASC_DBG(0, "adv_async_callback: ADV_HOST_SCSI_BUS_RESET\n"); + break; + + default: + ASC_DBG1(0, "DvcAsyncCallBack: unknown code 0x%x\n", code); + break; } - ASC_DBG(4, "asc_put_cfg_byte: end\n"); } -#endif /* ASC_CONFIG_PCI */ -#endif /* version < v2.1.93 */ /* * Add a 'REQP' to the end of specified queue. Set 'tidmask' @@ -9116,9 +7506,8 @@ { int tid; - ASC_DBG3(3, "asc_enqueue: ascq %lx, reqp %lx, flag %d\n", + ASC_DBG3(3, "asc_enqueue: ascq 0x%lx, reqp 0x%lx, flag %d\n", (ulong) ascq, (ulong) reqp, flag); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); ASC_ASSERT(reqp != NULL); ASC_ASSERT(flag == ASC_FRONT || flag == ASC_BACK); tid = REQPTID(reqp); @@ -9154,7 +7543,7 @@ } REQPTIME(reqp) = REQTIMESTAMP(); #endif /* ADVANSYS_STATS */ - ASC_DBG1(3, "asc_enqueue: reqp %lx\n", (ulong) reqp); + ASC_DBG1(3, "asc_enqueue: reqp 0x%lx\n", (ulong) reqp); return; } @@ -9170,8 +7559,7 @@ { REQP reqp; - ASC_DBG2(3, "asc_dequeue: ascq %lx, tid %d\n", (ulong) ascq, tid); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); + ASC_DBG2(3, "asc_dequeue: ascq 0x%lx, tid %d\n", (ulong) ascq, tid); ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID); if ((reqp = ascq->q_first[tid]) != NULL) { ASC_ASSERT(ascq->q_tidmask & ADV_TID_TO_TIDMASK(tid)); @@ -9189,7 +7577,7 @@ REQTIMESTAT("asc_dequeue", ascq, reqp, tid); #endif /* ADVANSYS_STATS */ } - ASC_DBG1(3, "asc_dequeue: reqp %lx\n", (ulong) reqp); + ASC_DBG1(3, "asc_dequeue: reqp 0x%lx\n", (ulong) reqp); return reqp; } @@ -9197,7 +7585,7 @@ * Return a pointer to a singly linked list of all the requests queued * for 'tid' on the 'asc_queue_t' pointed to by 'ascq'. * - * If 'lastpp' is not NULL, '*lastpp' will be set to point to the + * If 'lastpp' is not NULL, '*lastpp' will be set to point to the * the last request returned in the singly linked list. * * 'tid' should either be a valid target id or if it is ASC_TID_ALL, @@ -9219,8 +7607,7 @@ REQP firstp, lastp; int i; - ASC_DBG2(3, "asc_dequeue_list: ascq %lx, tid %d\n", (ulong) ascq, tid); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); + ASC_DBG2(3, "asc_dequeue_list: ascq 0x%lx, tid %d\n", (ulong) ascq, tid); ASC_ASSERT((tid == ASC_TID_ALL) || (tid >= 0 && tid <= ADV_MAX_TID)); /* @@ -9280,7 +7667,7 @@ if (lastpp) { *lastpp = lastp; } - ASC_DBG1(3, "asc_dequeue_list: firstp %lx\n", (ulong) firstp); + ASC_DBG1(3, "asc_dequeue_list: firstp 0x%lx\n", (ulong) firstp); return firstp; } @@ -9301,9 +7688,8 @@ int tid; int ret = ASC_FALSE; - ASC_DBG2(3, "asc_rmqueue: ascq %lx, reqp %lx\n", + ASC_DBG2(3, "asc_rmqueue: ascq 0x%lx, reqp 0x%lx\n", (ulong) ascq, (ulong) reqp); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); ASC_ASSERT(reqp != NULL); tid = REQPTID(reqp); @@ -9354,41 +7740,9 @@ } ASC_ASSERT(ascq->q_cur_cnt[tid] >= 0); #endif /* ADVANSYS_STATS */ - ASC_DBG2(3, "asc_rmqueue: reqp %lx, ret %d\n", (ulong) reqp, ret); - return ret; -} - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -/* - * If the specified 'REQP' is queued on the specified queue for - * the specified target device, return ASC_TRUE. - */ -STATIC int -asc_isqueued(asc_queue_t *ascq, REQP reqp) -{ - REQP treqp; - int tid; - int ret = ASC_FALSE; - - ASC_DBG2(3, "asc_isqueued: ascq %lx, reqp %lx\n", - (ulong) ascq, (ulong) reqp); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); - ASC_ASSERT(reqp != NULL); - - tid = REQPTID(reqp); - ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID); - - for (treqp = ascq->q_first[tid]; treqp; treqp = REQPNEXT(treqp)) { - ASC_ASSERT(ascq->q_tidmask & ADV_TID_TO_TIDMASK(tid)); - if (treqp == reqp) { - ret = ASC_TRUE; - break; - } - } - ASC_DBG1(3, "asc_isqueued: ret %x\n", ret); + ASC_DBG2(3, "asc_rmqueue: reqp 0x%lx, ret %d\n", (ulong) reqp, ret); return ret; } -#endif /* version < v2.3.28 */ /* * Execute as many queued requests as possible for the specified queue. @@ -9402,8 +7756,7 @@ REQP reqp; int i; - ASC_DBG1(1, "asc_execute_queue: ascq %lx\n", (ulong) ascq); - ASC_ASSERT(advansys_interrupts_enabled() == ASC_FALSE); + ASC_DBG1(1, "asc_execute_queue: ascq 0x%lx\n", (ulong) ascq); /* * Execute queued commands for devices attached to * the current board in round-robin fashion. @@ -9417,7 +7770,10 @@ } else if (asc_execute_scsi_cmnd((Scsi_Cmnd *) reqp) == ASC_BUSY) { scan_tidmask &= ~ADV_TID_TO_TIDMASK(i); - /* Put the request back at front of the list. */ + /* + * The request returned ASC_BUSY. Enqueue at the front of + * target's waiting list to maintain correct ordering. + */ asc_enqueue(ascq, reqp, ASC_FRONT); } } @@ -9426,7 +7782,6 @@ return; } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0) #ifdef CONFIG_PROC_FS /* * asc_prt_board_devices() @@ -9507,7 +7862,7 @@ "BIOS either disabled or Pre-3.1. If it is pre-3.1, then a newer version\n"); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -"can be found at the AdvanSys FTP site: ftp://ftp.advansys.com/pub\n"); +"can be found at the ConnectCom FTP site: ftp://ftp.connectcom.net/pub\n"); ASC_PRT_NEXT(); } else { major = (boardp->bios_version >> 12) & 0xF; @@ -9526,10 +7881,10 @@ if (major < 3 || (major <= 3 && minor < 1) || (major <= 3 && minor <= 1 && letter < ('I'- 'A'))) { len = asc_prt_line(cp, leftlen, -"Newer version of ROM BIOS is available at the AdvanSys FTP site:\n"); +"Newer version of ROM BIOS is available at the ConnectCom FTP site:\n"); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -"ftp://ftp.advansys.com/pub\n"); +"ftp://ftp.connectcom.net/pub\n"); ASC_PRT_NEXT(); } } @@ -9695,7 +8050,7 @@ ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" cntl %x, no_scam %x\n", +" cntl 0x%x, no_scam 0x%x\n", ep->cntl, ep->no_scam); ASC_PRT_NEXT(); @@ -9885,19 +8240,19 @@ if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) { len = asc_prt_line(cp, leftlen, -" termination: %u (%s), bios_ctrl: %x\n", +" termination: %u (%s), bios_ctrl: 0x%x\n", ep_3550->termination, termstr, ep_3550->bios_ctrl); ASC_PRT_NEXT(); } else if (adv_dvc_varp->chip_type == ADV_CHIP_ASC38C0800) { len = asc_prt_line(cp, leftlen, -" termination: %u (%s), bios_ctrl: %x\n", +" termination: %u (%s), bios_ctrl: 0x%x\n", ep_38C0800->termination_lvd, termstr, ep_38C0800->bios_ctrl); ASC_PRT_NEXT(); } else { len = asc_prt_line(cp, leftlen, -" termination: %u (%s), bios_ctrl: %x\n", +" termination: %u (%s), bios_ctrl: 0x%x\n", ep_38C1600->termination_lvd, termstr, ep_38C1600->bios_ctrl); ASC_PRT_NEXT(); } @@ -10089,9 +8444,7 @@ int totlen; int len; int chip_scsi_id; -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) int i; -#endif /* version >= v1.3.89 */ boardp = ASC_BOARDP(shp); @@ -10104,39 +8457,31 @@ ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89) -" host_busy %u, last_reset %u, max_id %u, max_lun %u\n", - shp->host_busy, shp->last_reset, shp->max_id, shp->max_lun); -#else /* version >= v1.3.89 */ " host_busy %u, last_reset %u, max_id %u, max_lun %u, max_channel %u\n", shp->host_busy, shp->last_reset, shp->max_id, shp->max_lun, shp->max_channel); -#endif /* version >= v1.3.89 */ ASC_PRT_NEXT(); - + len = asc_prt_line(cp, leftlen, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,57) -" can_queue %d, this_id %d, sg_tablesize %u, cmd_per_lun %u\n", - shp->can_queue, shp->this_id, shp->sg_tablesize, shp->cmd_per_lun); -#else /* version >= v1.3.57 */ " unique_id %d, can_queue %d, this_id %d, sg_tablesize %u, cmd_per_lun %u\n", shp->unique_id, shp->can_queue, shp->this_id, shp->sg_tablesize, shp->cmd_per_lun); -#endif /* version >= v1.3.57 */ ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,57) -" unchecked_isa_dma %d, loaded_as_module %d\n", - shp->unchecked_isa_dma, shp->loaded_as_module); -#else /* version >= v1.3.57 */ " unchecked_isa_dma %d, use_clustering %d, loaded_as_module %d\n", shp->unchecked_isa_dma, shp->use_clustering, shp->loaded_as_module); -#endif /* version >= v1.3.57 */ ASC_PRT_NEXT(); - len = asc_prt_line(cp, leftlen, " flags %x, last_reset %x, jiffies %x\n", - boardp->flags, boardp->last_reset, jiffies); + len = asc_prt_line(cp, leftlen, +" flags 0x%x, last_reset 0x%x, jiffies 0x%x, asc_n_io_port 0x%x\n", + boardp->flags, boardp->last_reset, jiffies, boardp->asc_n_io_port); + ASC_PRT_NEXT(); + + /* 'shp->n_io_port' may be truncated because it is only one byte. */ + len = asc_prt_line(cp, leftlen, +" io_port 0x%x, n_io_port 0x%x\n", + shp->io_port, shp->n_io_port); ASC_PRT_NEXT(); if (ASC_NARROW_BOARD(boardp)) { @@ -10145,7 +8490,6 @@ chip_scsi_id = boardp->dvc_var.adv_dvc_var.chip_scsi_id; } -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) if (boardp->flags & ASC_SELECT_QUEUE_DEPTHS) { len = asc_prt_line(cp, leftlen, " queue_depth:"); ASC_PRT_NEXT(); @@ -10164,7 +8508,6 @@ len = asc_prt_line(cp, leftlen, "\n"); ASC_PRT_NEXT(); } -#endif /* version >= v1.3.89 */ return totlen; } @@ -10207,12 +8550,12 @@ ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" chip_version %u, lib_version %x, lib_serial_no %u, mcode_date %x\n", +" chip_version %u, lib_version 0x%x, lib_serial_no %u, mcode_date 0x%x\n", c->chip_version, c->lib_version, c->lib_serial_no, c->mcode_date); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" mcode_version %x, err_code %u\n", +" mcode_version 0x%x, err_code %u\n", c->mcode_version, v->err_code); ASC_PRT_NEXT(); @@ -10400,14 +8743,14 @@ ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" iop_base %lx, cable_detect: %X, err_code %u\n", +" iop_base 0x%lx, cable_detect: %X, err_code %u\n", v->iop_base, AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1) & CABLE_DETECT, v->err_code); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" chip_version %u, lib_version %x, mcode_date %x, mcode_version %x\n", +" chip_version %u, lib_version 0x%x, mcode_date 0x%x, mcode_version 0x%x\n", c->chip_version, c->lib_version, c->mcode_date, c->mcode_version); ASC_PRT_NEXT(); @@ -10599,7 +8942,7 @@ } /* - * asc_proc_copy() + * asc_proc_copy() * * Copy proc information to a read buffer taking into account the current * read offset in the file and the remaining space in the read buffer. @@ -10609,13 +8952,13 @@ char *cp, int cplen) { int cnt = 0; - + ASC_DBG3(2, "asc_proc_copy: offset %d, advoffset %d, cplen %d\n", (unsigned) offset, (unsigned) advoffset, cplen); if (offset <= advoffset) { /* Read offset below current offset, copy everything. */ cnt = ASC_MIN(cplen, leftlen); - ASC_DBG3(2, "asc_proc_copy: curbuf %lx, cp %lx, cnt %d\n", + ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n", (ulong) curbuf, (ulong) cp, cnt); memcpy(curbuf, cp, cnt); } else if (offset < advoffset + cplen) { @@ -10623,7 +8966,7 @@ cnt = (advoffset + cplen) - offset; cp = (cp + cplen) - cnt; cnt = ASC_MIN(cnt, leftlen); - ASC_DBG3(2, "asc_proc_copy: curbuf %lx, cp %lx, cnt %d\n", + ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n", (ulong) curbuf, (ulong) cp, cnt); memcpy(curbuf, cp, cnt); } @@ -10662,7 +9005,6 @@ return ret; } #endif /* CONFIG_PROC_FS */ -#endif /* version >= v1.3.0 */ /* @@ -10678,56 +9020,33 @@ STATIC void DvcSleepMilliSecond(ADV_DCNT n) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0) - ADV_DCNT i; -#endif /* version < v2.1.0 */ - ASC_DBG1(4, "DvcSleepMilliSecond: %lu\n", (ulong) n); -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0) mdelay(n); -#else /* version < v2.1.0 */ - for (i = 0; i < n; i++) { - udelay(1000); - } -#endif /* version < v2.1.0 */ } -STATIC int +/* + * Currently and inline noop but leave as a placeholder. + * Leave DvcEnterCritical() as a noop placeholder. + */ +STATIC inline ulong DvcEnterCritical(void) { - int flags; - - save_flags(flags); - cli(); - return flags; + return 0; } -STATIC void -DvcLeaveCritical(int flags) +/* + * Critical sections are all protected by the board spinlock. + * Leave DvcLeaveCritical() as a noop placeholder. + */ +STATIC inline void +DvcLeaveCritical(ulong flags) { - restore_flags(flags); -} - -STATIC ADV_DCNT -DvcGetSGList(ASC_DVC_VAR *asc_dvc_sg, uchar *buf_addr, ADV_DCNT buf_len, - ASC_SG_HEAD *asc_sg_head_ptr) -{ - ADV_DCNT buf_size; - - buf_size = buf_len; - asc_sg_head_ptr->entry_cnt = 1; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - asc_sg_head_ptr->sg_list[0].addr = (ADV_PADDR) buf_addr; -#else /* version >= v2.0.0 */ - asc_sg_head_ptr->sg_list[0].addr = virt_to_bus(buf_addr); -#endif /* version >= v2.0.0 */ - asc_sg_head_ptr->sg_list[0].bytes = buf_size; - return buf_size; + return; } /* * void - * DvcPutScsiQ(PortAddr iop_base, ushort s_addr, ushort *outbuf, int words) + * DvcPutScsiQ(PortAddr iop_base, ushort s_addr, uchar *outbuf, int words) * * Calling/Exit State: * none @@ -10736,23 +9055,24 @@ * Output an ASC_SCSI_Q structure to the chip */ STATIC void -DvcPutScsiQ(PortAddr iop_base, ushort s_addr, ushort *outbuf, int words) +DvcPutScsiQ(PortAddr iop_base, ushort s_addr, uchar *outbuf, int words) { int i; - ASC_DBG_PRT_HEX(2, "DvcPutScsiQ", (uchar *) outbuf, 2 * words); + ASC_DBG_PRT_HEX(2, "DvcPutScsiQ", outbuf, 2 * words); AscSetChipLramAddr(iop_base, s_addr); - for (i = 0; i < words; i++, outbuf++) { - if (i == 2 || i == 10) { + for (i = 0; i < 2 * words; i += 2) { + if (i == 4 || i == 20) { continue; } - AscSetChipLramDataNoSwap(iop_base, *outbuf); + outpw(iop_base + IOP_RAM_DATA, + ((ushort) outbuf[i + 1] << 8) | outbuf[i]); } } /* * void - * DvcGetQinfo(PortAddr iop_base, ushort s_addr, ushort *inbuf, int words) + * DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) * * Calling/Exit State: * none @@ -10761,79 +9081,21 @@ * Input an ASC_QDONE_INFO structure from the chip */ STATIC void -DvcGetQinfo(PortAddr iop_base, ushort s_addr, ushort *inbuf, int words) +DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) { int i; + ushort word; AscSetChipLramAddr(iop_base, s_addr); - for (i = 0; i < words; i++, inbuf++) { - if (i == 5) { + for (i = 0; i < 2 * words; i += 2) { + if (i == 10) { continue; } - *inbuf = AscGetChipLramDataNoSwap(iop_base); - } - ASC_DBG_PRT_HEX(2, "DvcGetQinfo", (uchar *) inbuf, 2 * words); -} - -/* - * void DvcOutPortWords(ushort iop_base, ushort &outbuf, int words) - * - * Calling/Exit State: - * none - * - * Description: - * output a buffer to an i/o port address - */ -STATIC void -DvcOutPortWords(ushort iop_base, ushort *outbuf, int words) -{ - int i; - - for (i = 0; i < words; i++, outbuf++) - outpw(iop_base, *outbuf); -} - -/* - * void DvcInPortWords(ushort iop_base, ushort &outbuf, int words) - * - * Calling/Exit State: - * none - * - * Description: - * input a buffer from an i/o port address - */ -STATIC void -DvcInPortWords(ushort iop_base, ushort *inbuf, int words) -{ - int i; - - for (i = 0; i < words; i++, inbuf++) - *inbuf = inpw(iop_base); -} - -/* - * void DvcOutPortDWords(PortAddr port, ADV_DCNT *pdw, int dwords) - * - * Calling/Exit State: - * none - * - * Description: - * output a buffer of 32-bit integers to an i/o port address in - * 16 bit integer units - */ -STATIC void -DvcOutPortDWords(PortAddr port, ADV_DCNT *pdw, int dwords) -{ - int i; - int words; - ushort *pw; - - pw = (ushort *) pdw; - words = dwords << 1; - for(i = 0; i < words; i++, pw++) { - outpw(port, *pw); + word = inpw(iop_base + IOP_RAM_DATA); + inbuf[i] = word & 0xff; + inbuf[i + 1] = (word >> 8) & 0xff; } - return; + ASC_DBG_PRT_HEX(2, "DvcGetQinfo", inbuf, 2 * words); } /* @@ -10842,24 +9104,10 @@ ASC_INITFUNC( STATIC uchar, DvcReadPCIConfigByte( - ASC_DVC_VAR *asc_dvc, + ASC_DVC_VAR *asc_dvc, ushort offset) ) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - PCI_DATA pciData; - - pciData.bus = ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info); - pciData.slot = ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info); - pciData.func = ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info); - pciData.offset = offset; - pciData.type = pci_scan_method; - return asc_get_cfg_byte(&pciData); -#else /* ASC_CONFIG_PCI */ - return 0; -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI uchar byte_data; pcibios_read_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), @@ -10867,10 +9115,9 @@ ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), offset, &byte_data); return byte_data; -#else /* CONFIG_PCI */ +#else /* !defined(CONFIG_PCI) */ return 0; -#endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ +#endif /* !defined(CONFIG_PCI) */ } /* @@ -10879,30 +9126,17 @@ ASC_INITFUNC( STATIC void, DvcWritePCIConfigByte( - ASC_DVC_VAR *asc_dvc, - ushort offset, + ASC_DVC_VAR *asc_dvc, + ushort offset, uchar byte_data) ) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - PCI_DATA pciData; - - pciData.bus = ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info); - pciData.slot = ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info); - pciData.func = ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info); - pciData.offset = offset; - pciData.type = pci_scan_method; - asc_put_cfg_byte(&pciData, byte_data); -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI pcibios_write_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), offset, byte_data); #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ } /* @@ -10978,14 +9212,10 @@ { ADV_PADDR paddr; -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,0,0) - paddr = (ADV_PADDR) vaddr; -#else /* version >= v2.0.0 */ paddr = virt_to_bus(vaddr); -#endif /* version >= v2.0.0 */ ASC_DBG4(4, - "DvcGetPhyAddr: vaddr 0x%lx, lenp 0x%lx *lenp %lu, paddr 0x%lx\n", + "DvcGetPhyAddr: vaddr 0x%lx, lenp 0x%lx *lenp %lu, paddr 0x%lx\n", (ulong) vaddr, (ulong) lenp, (ulong) *((ulong *) lenp), (ulong) paddr); return paddr; @@ -10997,24 +9227,10 @@ ASC_INITFUNC( STATIC uchar, DvcAdvReadPCIConfigByte( - ADV_DVC_VAR *asc_dvc, + ADV_DVC_VAR *asc_dvc, ushort offset) ) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - PCI_DATA pciData; - - pciData.bus = ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info); - pciData.slot = ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info); - pciData.func = ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info); - pciData.offset = offset; - pciData.type = pci_scan_method; - return asc_get_cfg_byte(&pciData); -#else /* ASC_CONFIG_PCI */ - return 0; -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI uchar byte_data; pcibios_read_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), @@ -11025,7 +9241,6 @@ #else /* CONFIG_PCI */ return 0; #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ } /* @@ -11034,30 +9249,19 @@ ASC_INITFUNC( STATIC void, DvcAdvWritePCIConfigByte( - ADV_DVC_VAR *asc_dvc, - ushort offset, + ADV_DVC_VAR *asc_dvc, + ushort offset, uchar byte_data) ) { -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93) -#ifdef ASC_CONFIG_PCI - PCI_DATA pciData; - - pciData.bus = ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info); - pciData.slot = ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info); - pciData.func = ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info); - pciData.offset = offset; - pciData.type = pci_scan_method; - asc_put_cfg_byte(&pciData, byte_data); -#endif /* ASC_CONFIG_PCI */ -#else /* version >= v2.1.93 */ #ifdef CONFIG_PCI pcibios_write_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), offset, byte_data); +#else /* CONFIG_PCI */ + return 0; #endif /* CONFIG_PCI */ -#endif /* version >= v2.1.93 */ } /* @@ -11093,21 +9297,16 @@ len = asc_prt_line(cp, leftlen, "\nLinux Driver Statistics for AdvanSys SCSI Host %d:\n", shp->host_no); ASC_PRT_NEXT(); - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) - len = asc_prt_line(cp, leftlen, -" command %lu, queuecommand %lu, abort %lu, reset %lu, biosparam %lu\n", - s->command, s->queuecommand, s->abort, s->reset, s->biosparam); -#else /* version >= v2.3.28 */ + len = asc_prt_line(cp, leftlen, -" queuecommand %lu, eh_bus_reset %lu, biosparam %lu\n", - s->queuecommand, s->eh_bus_reset, s->biosparam); -#endif /* version >= v2.3.28 */ +" queuecommand %lu, reset %lu, biosparam %lu, interrupt %lu\n", + s->queuecommand, s->reset, s->biosparam, s->interrupt); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, -" interrupt %lu, callback %lu, done %lu\n", - s->interrupt, s->callback, s->done); +" callback %lu, done %lu, build_error %lu, build_noreq %lu, build_nosg %lu\n", + s->callback, s->done, s->build_error, s->adv_build_noreq, + s->adv_build_nosg); ASC_PRT_NEXT(); len = asc_prt_line(cp, leftlen, @@ -11115,17 +9314,6 @@ s->exe_noerror, s->exe_busy, s->exe_error, s->exe_unknown); ASC_PRT_NEXT(); - if (ASC_NARROW_BOARD(boardp)) { - len = asc_prt_line(cp, leftlen, -" build_error %lu\n", - s->build_error); - } else { - len = asc_prt_line(cp, leftlen, -" build_error %lu, build_noreq %lu, build_nosg %lu\n", - s->build_error, s->adv_build_noreq, s->adv_build_nosg); - } - ASC_PRT_NEXT(); - /* * Display data transfer statistics. */ @@ -11184,7 +9372,6 @@ return totlen; } - /* * asc_prt_target_stats() * @@ -11230,31 +9417,33 @@ } do { - if (active->q_tot_cnt[tgt_id] > 0 || waiting->q_tot_cnt[tgt_id] > 0) { - len = asc_prt_line(cp, leftlen, " target %d\n", tgt_id); - ASC_PRT_NEXT(); + if (active->q_tot_cnt[tgt_id] > 0 || waiting->q_tot_cnt[tgt_id] > 0) { + len = asc_prt_line(cp, leftlen, " target %d\n", tgt_id); + ASC_PRT_NEXT(); - len = asc_prt_line(cp, leftlen, + len = asc_prt_line(cp, leftlen, " active: cnt [cur %d, max %d, tot %u], time [min %d, max %d, avg %lu.%01lu]\n", - active->q_cur_cnt[tgt_id], active->q_max_cnt[tgt_id], - active->q_tot_cnt[tgt_id], - active->q_min_tim[tgt_id], active->q_max_tim[tgt_id], - (active->q_tot_cnt[tgt_id] == 0) ? 0 : - (active->q_tot_tim[tgt_id]/active->q_tot_cnt[tgt_id]), - (active->q_tot_cnt[tgt_id] == 0) ? 0 : - ASC_TENTHS(active->q_tot_tim[tgt_id], active->q_tot_cnt[tgt_id])); - ASC_PRT_NEXT(); + active->q_cur_cnt[tgt_id], active->q_max_cnt[tgt_id], + active->q_tot_cnt[tgt_id], + active->q_min_tim[tgt_id], active->q_max_tim[tgt_id], + (active->q_tot_cnt[tgt_id] == 0) ? 0 : + (active->q_tot_tim[tgt_id]/active->q_tot_cnt[tgt_id]), + (active->q_tot_cnt[tgt_id] == 0) ? 0 : + ASC_TENTHS(active->q_tot_tim[tgt_id], + active->q_tot_cnt[tgt_id])); + ASC_PRT_NEXT(); - len = asc_prt_line(cp, leftlen, + len = asc_prt_line(cp, leftlen, " waiting: cnt [cur %d, max %d, tot %u], time [min %u, max %u, avg %lu.%01lu]\n", - waiting->q_cur_cnt[tgt_id], waiting->q_max_cnt[tgt_id], - waiting->q_tot_cnt[tgt_id], - waiting->q_min_tim[tgt_id], waiting->q_max_tim[tgt_id], - (waiting->q_tot_cnt[tgt_id] == 0) ? 0 : - (waiting->q_tot_tim[tgt_id]/waiting->q_tot_cnt[tgt_id]), - (waiting->q_tot_cnt[tgt_id] == 0) ? 0 : - ASC_TENTHS(waiting->q_tot_tim[tgt_id], waiting->q_tot_cnt[tgt_id])); - ASC_PRT_NEXT(); + waiting->q_cur_cnt[tgt_id], waiting->q_max_cnt[tgt_id], + waiting->q_tot_cnt[tgt_id], + waiting->q_min_tim[tgt_id], waiting->q_max_tim[tgt_id], + (waiting->q_tot_cnt[tgt_id] == 0) ? 0 : + (waiting->q_tot_tim[tgt_id]/waiting->q_tot_cnt[tgt_id]), + (waiting->q_tot_cnt[tgt_id] == 0) ? 0 : + ASC_TENTHS(waiting->q_tot_tim[tgt_id], + waiting->q_tot_cnt[tgt_id])); + ASC_PRT_NEXT(); } } while (0); @@ -11267,25 +9456,31 @@ /* * asc_prt_scsi_host() */ -STATIC void +STATIC void asc_prt_scsi_host(struct Scsi_Host *s) { asc_board_t *boardp; boardp = ASC_BOARDP(s); - printk("Scsi_Host at addr %lx\n", (ulong) s); + printk("Scsi_Host at addr 0x%lx\n", (ulong) s); printk( -" next %lx, extra_bytes %u, host_busy %u, host_no %d, last_reset %d,\n", +" next 0x%lx, extra_bytes %u, host_busy %u, host_no %d, last_reset %d,\n", (ulong) s->next, s->extra_bytes, s->host_busy, s->host_no, (unsigned) s->last_reset); +#if ASC_LINUX_KERNEL24 printk( -" host_queue %lx, hostt %lx, block %lx,\n", +" host_queue 0x%lx, hostt 0x%lx\n", + (ulong) s->host_queue, (ulong) s->hostt); +#elif ASC_LINUX_KERNEL22 + printk( +" host_queue 0x%lx, hostt 0x%lx, block 0x%lx,\n", (ulong) s->host_queue, (ulong) s->hostt, (ulong) s->block); +#endif printk( -" base %lu, io_port %lu, n_io_port %u, irq %d,\n", +" base 0x%lx, io_port 0x%lx, n_io_port %u, irq 0x%x,\n", (ulong) s->base, (ulong) s->io_port, s->n_io_port, s->irq); printk( @@ -11309,49 +9504,49 @@ /* * asc_prt_scsi_cmnd() */ -STATIC void +STATIC void asc_prt_scsi_cmnd(Scsi_Cmnd *s) { - printk("Scsi_Cmnd at addr %lx\n", (ulong) s); + printk("Scsi_Cmnd at addr 0x%lx\n", (ulong) s); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) - printk( -" host %x, device %x, target %u, lun %u\n", - (unsigned) s->host, (unsigned) s->device, s->target, s->lun); -#else /* version >= v1.3.0 */ printk( -" host %lx, device %lx, target %u, lun %u, channel %u,\n", +" host 0x%lx, device 0x%lx, target %u, lun %u, channel %u,\n", (ulong) s->host, (ulong) s->device, s->target, s->lun, s->channel); -#endif /* version >= v1.3.0 */ asc_prt_hex(" CDB", s->cmnd, s->cmd_len); +#if ASC_LINUX_KERNEL24 + printk ( +"sc_data_direction %u, resid %d\n", + s->sc_data_direction, s->resid); +#endif + printk( -" use_sg %u, sglist_len %u, abort_reason %x\n", +" use_sg %u, sglist_len %u, abort_reason 0x%x\n", s->use_sg, s->sglist_len, s->abort_reason); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89) printk( -" retries %d, allowed %d\n", - s->retries, s->allowed); -#else /* version >= v1.3.89 */ - printk( -" serial_number %x, serial_number_at_timeout %x, retries %d, allowed %d\n", +" serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n", (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout, s->retries, s->allowed); -#endif /* version >= v1.3.89 */ printk( " timeout_per_command %d, timeout_total %d, timeout %d\n", s->timeout_per_command, s->timeout_total, s->timeout); +#if ASC_LINUX_KERNEL24 + printk( +" internal_timeout %u, flags %u\n", + s->internal_timeout, s->flags); +#elif ASC_LINUX_KERNEL22 printk( " internal_timeout %u, flags %u, this_count %d\n", - s->internal_timeout, s->flags, s->this_count); + s->internal_timeout, s->flags,s->this_count); +#endif printk( -" scsi_done %lx, done %lx, host_scribble %lx, result %x\n", +" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", (ulong) s->scsi_done, (ulong) s->done, (ulong) s->host_scribble, s->result); @@ -11363,57 +9558,59 @@ /* * asc_prt_asc_dvc_var() */ -STATIC void +STATIC void asc_prt_asc_dvc_var(ASC_DVC_VAR *h) { - printk("ASC_DVC_VAR at addr %lx\n", (ulong) h); + printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong) h); printk( -" iop_base %x, err_code %x, dvc_cntl %x, bug_fix_cntl %d,\n", +" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl %d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); printk( -" bus_type %d, isr_callback %lx, exe_callback %lx, init_sdtr %x,\n", +" bus_type %d, isr_callback 0x%lx, exe_callback 0x%lx, init_sdtr 0x%x,\n", h->bus_type, (ulong) h->isr_callback, (ulong) h->exe_callback, (unsigned) h->init_sdtr); printk( -" sdtr_done %x, use_tagged_qng %x, unit_not_ready %x, chip_no %x,\n", +" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, chip_no 0x%x,\n", (unsigned) h->sdtr_done, (unsigned) h->use_tagged_qng, (unsigned) h->unit_not_ready, (unsigned) h->chip_no); - + printk( -" queue_full_or_busy %x, start_motor %x, scsi_reset_wait %x, irq_no %x,\n", +" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait %u,\n", (unsigned) h->queue_full_or_busy, (unsigned) h->start_motor, - (unsigned) h->scsi_reset_wait, (unsigned) h->irq_no); + (unsigned) h->scsi_reset_wait); printk( -" is_in_int %x, max_total_qng %x, cur_total_qng %x, in_critical_cnt %x,\n", +" is_in_int %u, max_total_qng %u, cur_total_qng %u, in_critical_cnt %u,\n", (unsigned) h->is_in_int, (unsigned) h->max_total_qng, (unsigned) h->cur_total_qng, (unsigned) h->in_critical_cnt); printk( -" last_q_shortage %x, init_state %x, no_scam %x, pci_fix_asyn_xfer %x,\n", +" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, pci_fix_asyn_xfer 0x%x,\n", (unsigned) h->last_q_shortage, (unsigned) h->init_state, (unsigned) h->no_scam, (unsigned) h->pci_fix_asyn_xfer); printk( -" cfg %lx\n", - (ulong) h->cfg); +" cfg 0x%lx, irq_no 0x%x\n", + (ulong) h->cfg, (unsigned) h->irq_no); } /* * asc_prt_asc_dvc_cfg() */ -STATIC void +STATIC void asc_prt_asc_dvc_cfg(ASC_DVC_CFG *h) { - printk("ASC_DVC_CFG at addr %lx\n", (ulong) h); + printk("ASC_DVC_CFG at addr 0x%lx\n", (ulong) h); printk( -" can_tagged_qng %x, cmd_qng_enabled %x, disc_enable %x, sdtr_enable %x,\n", - h->can_tagged_qng, h->cmd_qng_enabled, h->disc_enable, - h->sdtr_enable); +" can_tagged_qng 0x%x, cmd_qng_enabled 0x%x,\n", + h->can_tagged_qng, h->cmd_qng_enabled); + printk( +" disc_enable 0x%x, sdtr_enable 0x%x,\n", + h->disc_enable, h->sdtr_enable); printk( " chip_scsi_id %d, isa_dma_speed %d, isa_dma_channel %d, chip_version %d,\n", @@ -11421,48 +9618,49 @@ h->chip_version); printk( -" pci_device_id %d, lib_serial_no %x, lib_version %x, mcode_date %x,\n", +" pci_device_id %d, lib_serial_no %u, lib_version %u, mcode_date 0x%x,\n", h->pci_device_id, h->lib_serial_no, h->lib_version, h->mcode_date); printk( -" mcode_version %d, overrun_buf %lx\n", +" mcode_version %d, overrun_buf 0x%lx\n", h->mcode_version, (ulong) h->overrun_buf); } /* * asc_prt_asc_scsi_q() */ -STATIC void +STATIC void asc_prt_asc_scsi_q(ASC_SCSI_Q *q) { ASC_SG_HEAD *sgp; int i; - printk("ASC_SCSI_Q at addr %lx\n", (ulong) q); + printk("ASC_SCSI_Q at addr 0x%lx\n", (ulong) q); printk( -" target_ix %u, target_lun %u, srb_ptr %x, tag_code %u,\n", +" target_ix 0x%x, target_lun %u, srb_ptr 0x%lx, tag_code 0x%x,\n", q->q2.target_ix, q->q1.target_lun, - (unsigned) q->q2.srb_ptr, q->q2.tag_code); + (ulong) q->q2.srb_ptr, q->q2.tag_code); printk( -" data_addr %lx, data_cnt %lu, sense_addr %lx, sense_len %u,\n", - (ulong) q->q1.data_addr, (ulong) q->q1.data_cnt, - (ulong) q->q1.sense_addr, q->q1.sense_len); +" data_addr 0x%lx, data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n", + (ulong) le32_to_cpu(q->q1.data_addr), + (ulong) le32_to_cpu(q->q1.data_cnt), + (ulong) le32_to_cpu(q->q1.sense_addr), q->q1.sense_len); printk( -" cdbptr %lx, cdb_len %u, sg_head %lx, sg_queue_cnt %u\n", +" cdbptr 0x%lx, cdb_len %u, sg_head 0x%lx, sg_queue_cnt %u\n", (ulong) q->cdbptr, q->q2.cdb_len, (ulong) q->sg_head, q->q1.sg_queue_cnt); if (q->sg_head) { sgp = q->sg_head; - printk("ASC_SG_HEAD at addr %lx\n", (ulong) sgp); + printk("ASC_SG_HEAD at addr 0x%lx\n", (ulong) sgp); printk(" entry_cnt %u, queue_cnt %u\n", sgp->entry_cnt, sgp->queue_cnt); for (i = 0; i < sgp->entry_cnt; i++) { - printk(" [%u]: addr %lx, bytes %lu\n", - i, (ulong) sgp->sg_list[i].addr, - (ulong) sgp->sg_list[i].bytes); + printk(" [%u]: addr 0x%lx, bytes %lu\n", + i, (ulong) le32_to_cpu(sgp->sg_list[i].addr), + (ulong) le32_to_cpu(sgp->sg_list[i].bytes)); } } @@ -11471,17 +9669,17 @@ /* * asc_prt_asc_qdone_info() */ -STATIC void +STATIC void asc_prt_asc_qdone_info(ASC_QDONE_INFO *q) { - printk("ASC_QDONE_INFO at addr %lx\n", (ulong) q); + printk("ASC_QDONE_INFO at addr 0x%lx\n", (ulong) q); printk( -" srb_ptr %x, target_ix %u, cdb_len %u, tag_code %u, done_stat %x\n", - (unsigned) q->d2.srb_ptr, q->d2.target_ix, q->d2.cdb_len, - q->d2.tag_code, q->d3.done_stat); +" srb_ptr 0x%lx, target_ix %u, cdb_len %u, tag_code %u,\n", + (ulong) q->d2.srb_ptr, q->d2.target_ix, q->d2.cdb_len, + q->d2.tag_code); printk( -" host_stat %x, scsi_stat %x, scsi_msg %x\n", - q->d3.host_stat, q->d3.scsi_stat, q->d3.scsi_msg); +" done_stat 0x%x, host_stat 0x%x, scsi_stat 0x%x, scsi_msg 0x%x\n", + q->d3.done_stat, q->d3.host_stat, q->d3.scsi_stat, q->d3.scsi_msg); } /* @@ -11489,7 +9687,7 @@ * * Display an ADV_DVC_VAR structure. */ -STATIC void +STATIC void asc_prt_adv_dvc_var(ADV_DVC_VAR *h) { printk(" ADV_DVC_VAR at addr 0x%lx\n", (ulong) h); @@ -11509,12 +9707,12 @@ (unsigned) h->scsi_reset_wait, (unsigned) h->irq_no); printk( -" max_host_qng %x, max_dvc_qng %x, carr_freelist %lxn\n", +" max_host_qng %u, max_dvc_qng %u, carr_freelist 0x%lxn\n", (unsigned) h->max_host_qng, (unsigned) h->max_dvc_qng, (ulong) h->carr_freelist); printk( -" icq_sp %lx, irq_sp %lx\n", +" icq_sp 0x%lx, irq_sp 0x%lx\n", (ulong) h->icq_sp, (ulong) h->irq_sp); printk( @@ -11522,7 +9720,7 @@ (unsigned) h->no_scam, (unsigned) h->tagqng_able); printk( -" chip_scsi_id 0x%x, cfg %lx\n", +" chip_scsi_id 0x%x, cfg 0x%lx\n", (unsigned) h->chip_scsi_id, (ulong) h->cfg); } @@ -11531,7 +9729,7 @@ * * Display an ADV_DVC_CFG structure. */ -STATIC void +STATIC void asc_prt_adv_dvc_cfg(ADV_DVC_CFG *h) { printk(" ADV_DVC_CFG at addr 0x%lx\n", (ulong) h); @@ -11545,7 +9743,7 @@ h->chip_version, h->mcode_date); printk( -" mcode_version 0x%x, pci_device_id 0x%x, lib_version 0x%x\n", +" mcode_version 0x%x, pci_device_id 0x%x, lib_version %u\n", h->mcode_version, h->pci_device_id, h->lib_version); printk( @@ -11558,38 +9756,38 @@ * * Display an ADV_SCSI_REQ_Q structure. */ -STATIC void +STATIC void asc_prt_adv_scsi_req_q(ADV_SCSI_REQ_Q *q) { int sg_blk_cnt; struct asc_sg_block *sg_ptr; - printk("ADV_SCSI_REQ_Q at addr %lx\n", (ulong) q); + printk("ADV_SCSI_REQ_Q at addr 0x%lx\n", (ulong) q); printk( " target_id %u, target_lun %u, srb_ptr 0x%lx, a_flag 0x%x\n", q->target_id, q->target_lun, (ulong) q->srb_ptr, q->a_flag); printk(" cntl 0x%x, data_addr 0x%lx, vdata_addr 0x%lx\n", - q->cntl, (ulong)le32_to_cpu(q->data_addr), (ulong) q->vdata_addr); + q->cntl, (ulong) le32_to_cpu(q->data_addr), (ulong) q->vdata_addr); printk( " data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n", - (ulong) le32_to_cpu(q->data_cnt), (ulong) le32_to_cpu(q->sense_addr), - q->sense_len); + (ulong) le32_to_cpu(q->data_cnt), + (ulong) le32_to_cpu(q->sense_addr), q->sense_len); printk( " cdb_len %u, done_status 0x%x, host_status 0x%x, scsi_status 0x%x\n", q->cdb_len, q->done_status, q->host_status, q->scsi_status); printk( -" sg_working_ix %x, target_cmd %u\n", +" sg_working_ix 0x%x, target_cmd %u\n", q->sg_working_ix, q->target_cmd); printk( -" scsiq_rptr %lx, sg_real_addr %lx, sg_list_ptr %lx\n", - (ulong) le32_to_cpu(q->scsiq_rptr), (ulong) le32_to_cpu(q->sg_real_addr), - (ulong) q->sg_list_ptr); +" scsiq_rptr 0x%lx, sg_real_addr 0x%lx, sg_list_ptr 0x%lx\n", + (ulong) le32_to_cpu(q->scsiq_rptr), + (ulong) le32_to_cpu(q->sg_real_addr), (ulong) q->sg_list_ptr); /* Display the request's ADV_SG_BLOCK structures. */ if (q->sg_list_ptr != NULL) @@ -11624,9 +9822,9 @@ { int i; - printk(" ASC_SG_BLOCK at addr %lx (sgblockno %d)\n", + printk(" ASC_SG_BLOCK at addr 0x%lx (sgblockno %d)\n", (ulong) b, sgblockno); - printk(" sg_cnt %u, sg_ptr %lx\n", + printk(" sg_cnt %u, sg_ptr 0x%lx\n", b->sg_cnt, (ulong) le32_to_cpu(b->sg_ptr)); ASC_ASSERT(b->sg_cnt <= NO_OF_SG_PER_BLOCK); if (b->sg_ptr != 0) @@ -11634,7 +9832,7 @@ ASC_ASSERT(b->sg_cnt == NO_OF_SG_PER_BLOCK); } for (i = 0; i < b->sg_cnt; i++) { - printk(" [%u]: sg_addr %lx, sg_count %lx\n", + printk(" [%u]: sg_addr 0x%lx, sg_count 0x%lx\n", i, (ulong) b->sg_list[i].sg_addr, (ulong) b->sg_list[i].sg_count); } } @@ -11642,10 +9840,10 @@ /* * asc_prt_hex() * - * Print hexadecimal output in 4 byte groupings 32 bytes + * Print hexadecimal output in 4 byte groupings 32 bytes * or 8 double-words per line. */ -STATIC void +STATIC void asc_prt_hex(char *f, uchar *s, int l) { int i; @@ -11656,7 +9854,7 @@ printk("%s: (%d bytes)\n", f, l); for (i = 0; i < l; i += 32) { - + /* Display a maximum of 8 double-words per line. */ if ((k = (l - i) / 4) >= 8) { k = 8; @@ -11697,27 +9895,6 @@ } #endif /* ADVANSYS_DEBUG */ -#ifdef ADVANSYS_ASSERT -/* - * advansys_interrupts_enabled() - * - * Return 1 if interrupts are enabled, otherwise return 0. - */ -STATIC int -advansys_interrupts_enabled(void) -{ - int flags; - - save_flags(flags); - if (flags & 0x0200) { - return ASC_TRUE; - } else { - return ASC_FALSE; - } -} -#endif /* ADVANSYS_ASSERT */ - - /* * --- Asc Library Functions */ @@ -11825,42 +10002,47 @@ return (0); } -ASC_INITFUNC( -STATIC ASC_DCNT, +STATIC ASC_DCNT AscLoadMicroCode( PortAddr iop_base, ushort s_addr, - ushort *mcode_buf, + uchar *mcode_buf, ushort mcode_size ) -) { ASC_DCNT chksum; ushort mcode_word_size; ushort mcode_chksum; + /* Write the microcode buffer starting at LRAM address 0. */ mcode_word_size = (ushort) (mcode_size >> 1); AscMemWordSetLram(iop_base, s_addr, 0, mcode_word_size); - AscMemWordCopyToLram(iop_base, s_addr, mcode_buf, mcode_word_size); + AscMemWordCopyPtrToLram(iop_base, s_addr, mcode_buf, mcode_word_size); + chksum = AscMemSumLramWord(iop_base, s_addr, mcode_word_size); + ASC_DBG1(1, "AscLoadMicroCode: chksum 0x%lx\n", (ulong) chksum); mcode_chksum = (ushort) AscMemSumLramWord(iop_base, - (ushort) ASC_CODE_SEC_BEG, + (ushort) ASC_CODE_SEC_BEG, (ushort) ((mcode_size - s_addr - (ushort) ASC_CODE_SEC_BEG) / 2)); + ASC_DBG1(1, "AscLoadMicroCode: mcode_chksum 0x%lx\n", + (ulong) mcode_chksum); AscWriteLramWord(iop_base, ASCV_MCODE_CHKSUM_W, mcode_chksum); AscWriteLramWord(iop_base, ASCV_MCODE_SIZE_W, mcode_size); return (chksum); } -ASC_INITFUNC( -STATIC int, +STATIC int AscFindSignature( PortAddr iop_base ) -) { ushort sig_word; + ASC_DBG2(1, "AscFindSignature: AscGetChipSignatureByte(0x%x) 0x%x\n", + iop_base, AscGetChipSignatureByte(iop_base)); if (AscGetChipSignatureByte(iop_base) == (uchar) ASC_1000_ID1B) { + ASC_DBG2(1, "AscFindSignature: AscGetChipSignatureWord(0x%x) 0x%x\n", + iop_base, AscGetChipSignatureWord(iop_base)); sig_word = AscGetChipSignatureWord(iop_base); if ((sig_word == (ushort) ASC_1000_ID0W) || (sig_word == (ushort) ASC_1000_ID0W_FIX)) { @@ -11935,11 +10117,11 @@ iop_base = _asc_def_iop_base[i]; if (check_region(iop_base, ASC_IOADR_GAP) != 0) { ASC_DBG1(1, - "AscSearchIOPortAddr11: check_region() failed I/O port %x\n", + "AscSearchIOPortAddr11: check_region() failed I/O port 0x%x\n", iop_base); continue; } - ASC_DBG1(1, "AscSearchIOPortAddr11: probing I/O port %x\n", iop_base); + ASC_DBG1(1, "AscSearchIOPortAddr11: probing I/O port 0x%x\n", iop_base); if (AscFindSignature(iop_base)) { return (iop_base); } @@ -12067,7 +10249,7 @@ } #endif /* CONFIG_ISA */ -STATIC int +STATIC int AscIsrChipHalted( ASC_DVC_VAR *asc_dvc ) @@ -12126,10 +10308,10 @@ return (0); } else if (int_halt_code == ASC_HALT_EXTMSG_IN) { - AscMemWordCopyFromLram(iop_base, + AscMemWordCopyPtrFromLram(iop_base, ASCV_MSGIN_BEG, - (ushort *) & ext_msg, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &ext_msg, + sizeof(EXT_MSG) >> 1); if (ext_msg.msg_type == MS_EXTEND && ext_msg.msg_req == MS_SDTR_CODE && @@ -12203,10 +10385,10 @@ ext_msg.msg_len == MS_WDTR_LEN) { ext_msg.wdtr_width = 0; - AscMemWordCopyToLram(iop_base, + AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, - (ushort *) & ext_msg, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &ext_msg, + sizeof(EXT_MSG) >> 1); q_cntl |= QC_MSG_OUT; AscWriteLramByte(iop_base, (ushort) (halt_q_addr + (ushort) ASC_SCSIQ_B_CNTL), @@ -12216,10 +10398,10 @@ } else { ext_msg.msg_type = M1_MSG_REJECT; - AscMemWordCopyToLram(iop_base, + AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, - (ushort *) & ext_msg, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &ext_msg, + sizeof(EXT_MSG) >> 1); q_cntl |= QC_MSG_OUT; AscWriteLramByte(iop_base, (ushort) (halt_q_addr + (ushort) ASC_SCSIQ_B_CNTL), @@ -12279,10 +10461,10 @@ return (0); } else if (int_halt_code == ASC_HALT_SDTR_REJECTED) { - AscMemWordCopyFromLram(iop_base, + AscMemWordCopyPtrFromLram(iop_base, ASCV_MSGOUT_BEG, - (ushort *) & out_msg, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &out_msg, + sizeof(EXT_MSG) >> 1); if ((out_msg.msg_type == MS_EXTEND) && (out_msg.msg_len == MS_SDTR_LEN) && @@ -12337,7 +10519,9 @@ } AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); return (0); - } else if (int_halt_code == ASC_HALT_HOST_COPY_SG_LIST_TO_RISC) + } +#if CC_VERY_LONG_SG_LIST + else if (int_halt_code == ASC_HALT_HOST_COPY_SG_LIST_TO_RISC) { uchar q_no; ushort q_addr; @@ -12461,16 +10645,15 @@ } scsi_sg_q.q_no = next_qp; - AscMemWordCopyToLram(iop_base, - (ushort) (q_addr+ASC_SCSIQ_SGHD_CPY_BEG), - (ushort *) &scsi_sg_q, - (ushort) (sizeof(ASC_SG_LIST_Q) >> 1)); - - AscMemDWordCopyToLram( iop_base, - (ushort) (q_addr+ASC_SGQ_LIST_BEG ), - (ADV_PADDR *) - &sg_head->sg_list[scsiq->next_sg_index], - (ushort) sg_list_dwords); + AscMemWordCopyPtrToLram(iop_base, + q_addr + ASC_SCSIQ_SGHD_CPY_BEG, + (uchar *) &scsi_sg_q, + sizeof(ASC_SG_LIST_Q) >> 1); + + AscMemDWordCopyPtrToLram(iop_base, + q_addr + ASC_SGQ_LIST_BEG, + (uchar *) &sg_head->sg_list[scsiq->next_sg_index], + sg_list_dwords); scsiq->next_sg_index += ASC_SG_LIST_PER_Q; @@ -12496,6 +10679,7 @@ AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); return(0); } +#endif /* CC_VERY_LONG_SG_LIST */ return (0); } @@ -12511,9 +10695,10 @@ uchar sg_queue_cnt; DvcGetQinfo(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_DONE_INFO_BEG), - (ushort *) scsiq, - (ushort) ((sizeof (ASC_SCSIQ_2) + sizeof (ASC_SCSIQ_3)) / 2)); + q_addr + ASC_SCSIQ_DONE_INFO_BEG, + (uchar *) scsiq, + (sizeof (ASC_SCSIQ_2) + sizeof (ASC_SCSIQ_3)) / 2); + _val = AscReadLramWord(iop_base, (ushort) (q_addr + (ushort) ASC_SCSIQ_B_STATUS)); scsiq->q_status = (uchar) _val; @@ -12777,7 +10962,8 @@ return (int_pending); } -STATIC uchar _asc_mcode_buf[] ASC_INITDATA = +/* Microcode buffer is kept after initialization for error recovery. */ +STATIC uchar _asc_mcode_buf[] = { 0x01, 0x03, 0x01, 0x19, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -12925,8 +11111,8 @@ 0xF1, 0xC7, 0x41, 0x23, 0xF8, 0x88, 0x11, 0x23, 0xA1, 0x01, 0x04, 0x23, 0xA0, 0x01, 0xE6, 0x84, }; -STATIC ushort _asc_mcode_size ASC_INITDATA = sizeof(_asc_mcode_buf); -STATIC ADV_DCNT _asc_mcode_chksum ASC_INITDATA = 0x012C453FUL; +STATIC ushort _asc_mcode_size = sizeof(_asc_mcode_buf); +STATIC ADV_DCNT _asc_mcode_chksum = 0x012C453FUL; #define ASC_SYN_OFFSET_ONE_DISABLE_LIST 16 STATIC uchar _syn_offset_one_disable_cmd[ASC_SYN_OFFSET_ONE_DISABLE_LIST] = @@ -12956,7 +11142,7 @@ ) { PortAddr iop_base; - int last_int_level; + ulong last_int_level; int sta; int n_q_required; int disable_syn_offset_one_fix; @@ -13019,6 +11205,7 @@ if (sg_entry_cnt > ASC_MAX_SG_LIST) { asc_dvc->in_critical_cnt--; + DvcLeaveCritical(last_int_level); return(ERR); } #endif /* !CC_VERY_LONG_SG_LIST */ @@ -13036,10 +11223,10 @@ if (scsiq->q1.cntl & QC_SG_HEAD) { data_cnt = 0; for (i = 0; i < sg_entry_cnt; i++) { - data_cnt += (ADV_DCNT) sg_head->sg_list[i].bytes; + data_cnt += (ADV_DCNT) le32_to_cpu(sg_head->sg_list[i].bytes); } } else { - data_cnt = scsiq->q1.data_cnt; + data_cnt = le32_to_cpu(scsiq->q1.data_cnt); } if (data_cnt != 0UL) { if (data_cnt < 512UL) { @@ -13071,23 +11258,27 @@ if ((scsi_cmd == SCSICMD_Read6) || (scsi_cmd == SCSICMD_Read10)) { addr = - (ADV_PADDR) - sg_head->sg_list[sg_entry_cnt_minus_one].addr + - (ADV_DCNT) - sg_head->sg_list[sg_entry_cnt_minus_one].bytes; + (ADV_PADDR) le32_to_cpu( + sg_head->sg_list[sg_entry_cnt_minus_one].addr) + + (ADV_DCNT) le32_to_cpu( + sg_head->sg_list[sg_entry_cnt_minus_one].bytes); extra_bytes = (uchar) ((ushort) addr & 0x0003); if ((extra_bytes != 0) && ((scsiq->q2.tag_code & ASC_TAG_FLAG_EXTRA_BYTES) == 0)) { scsiq->q2.tag_code |= ASC_TAG_FLAG_EXTRA_BYTES; scsiq->q1.extra_bytes = extra_bytes; - sg_head->sg_list[sg_entry_cnt_minus_one].bytes -= - (ASC_DCNT) extra_bytes; + data_cnt = le32_to_cpu( + sg_head->sg_list[sg_entry_cnt_minus_one].bytes); + data_cnt -= (ASC_DCNT) extra_bytes; + sg_head->sg_list[sg_entry_cnt_minus_one].bytes = + cpu_to_le32(data_cnt); } } } } sg_head->entry_to_copy = sg_head->entry_cnt; +#if CC_VERY_LONG_SG_LIST /* * Set the sg_entry_cnt to the maximum possible. The rest of * the SG elements will be copied when the RISC completes the @@ -13097,6 +11288,7 @@ { sg_entry_cnt = ASC_MAX_SG_LIST; } +#endif /* CC_VERY_LONG_SG_LIST */ n_q_required = AscSgListToQueue(sg_entry_cnt); if ((AscGetNumOfFreeQueue(asc_dvc, target_ix, n_q_required) >= (uint) n_q_required) || ((scsiq->q1.cntl & QC_URGENT) != 0)) { @@ -13115,14 +11307,17 @@ if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) { if ((scsi_cmd == SCSICMD_Read6) || (scsi_cmd == SCSICMD_Read10)) { - addr = scsiq->q1.data_addr + scsiq->q1.data_cnt; + addr = le32_to_cpu(scsiq->q1.data_addr) + + le32_to_cpu(scsiq->q1.data_cnt); extra_bytes = (uchar) ((ushort) addr & 0x0003); if ((extra_bytes != 0) && ((scsiq->q2.tag_code & ASC_TAG_FLAG_EXTRA_BYTES) == 0)) { - if (((ushort) scsiq->q1.data_cnt & 0x01FF) == 0) { + data_cnt = le32_to_cpu(scsiq->q1.data_cnt); + if (((ushort) data_cnt & 0x01FF) == 0) { scsiq->q2.tag_code |= ASC_TAG_FLAG_EXTRA_BYTES; - scsiq->q1.data_cnt -= (ASC_DCNT) extra_bytes; + data_cnt -= (ASC_DCNT) extra_bytes; + scsiq->q1.data_cnt = cpu_to_le32(data_cnt); scsiq->q1.extra_bytes = extra_bytes; } } @@ -13285,14 +11480,15 @@ scsiq->q2.tag_code &= ~M2_QTAG_MSG_SIMPLE; } scsiq->q1.status = QS_FREE; - AscMemWordCopyToLram(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_CDB_BEG), - (ushort *) scsiq->cdbptr, - (ushort) ((ushort) scsiq->q2.cdb_len >> 1)); + AscMemWordCopyPtrToLram(iop_base, + q_addr + ASC_SCSIQ_CDB_BEG, + (uchar *) scsiq->cdbptr, + scsiq->q2.cdb_len >> 1); + DvcPutScsiQ(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_CPY_BEG), - (ushort *) & scsiq->q1.cntl, - (ushort) ((((sizeof (ASC_SCSIQ_1) + sizeof (ASC_SCSIQ_2)) / 2) - 1))); + q_addr + ASC_SCSIQ_CPY_BEG, + (uchar *) &scsiq->q1.cntl, + ((sizeof(ASC_SCSIQ_1) + sizeof(ASC_SCSIQ_2)) / 2) - 1); AscWriteLramWord(iop_base, (ushort) (q_addr + (ushort) ASC_SCSIQ_B_STATUS), (ushort) (((ushort) scsiq->q1.q_no << 8) | (ushort) QS_READY)); @@ -13325,6 +11521,7 @@ saved_data_cnt = scsiq->q1.data_cnt; scsiq->q1.data_addr = (ASC_PADDR) sg_head->sg_list[0].addr; scsiq->q1.data_cnt = (ASC_DCNT) sg_head->sg_list[0].bytes; +#if CC_VERY_LONG_SG_LIST /* * If sg_head->entry_cnt is greater than ASC_MAX_SG_LIST * then not all SG elements will fit in the allocated queues. @@ -13335,10 +11532,10 @@ { /* * Set sg_entry_cnt to be the number of SG elements that - * will fit in the allocated SG queues. It is minus 1 because - * first SG element handled above. ASC_MAX_SG_LIST is already - * inflated by 1 to account for this. For example it may - * be 50 which is 1 + 7 queues * 7 SG elements. + * will fit in the allocated SG queues. It is minus 1, because + * the first SG element is handled above. ASC_MAX_SG_LIST is + * already inflated by 1 to account for this. For example it + * may be 50 which is 1 + 7 queues * 7 SG elements. */ sg_entry_cnt = ASC_MAX_SG_LIST - 1; @@ -13349,13 +11546,16 @@ scsiq->remain_sg_entry_cnt = sg_head->entry_cnt - ASC_MAX_SG_LIST; } else { +#endif /* CC_VERY_LONG_SG_LIST */ /* * Set sg_entry_cnt to be the number of SG elements that - * will fit in the allocated SG queues. Refer to comment - * above regarding why it is - 1. + * will fit in the allocated SG queues. It is minus 1, because + * the first SG element is handled above. */ sg_entry_cnt = sg_head->entry_cnt - 1; +#if CC_VERY_LONG_SG_LIST } +#endif /* CC_VERY_LONG_SG_LIST */ if (sg_entry_cnt != 0) { scsiq->q1.cntl |= QC_SG_HEAD; q_addr = ASC_QNO_TO_QADDR(q_no); @@ -13376,6 +11576,7 @@ scsi_sg_q.sg_cur_list_cnt = ASC_SG_LIST_PER_Q - 1; } } else { +#if CC_VERY_LONG_SG_LIST /* * This is the last SG queue in the list of * allocated SG queues. If there are more @@ -13387,8 +11588,11 @@ scsi_sg_q.cntl |= QCSG_SG_XFER_MORE; } else { +#endif /* CC_VERY_LONG_SG_LIST */ scsi_sg_q.cntl |= QCSG_SG_XFER_END; +#if CC_VERY_LONG_SG_LIST } +#endif /* CC_VERY_LONG_SG_LIST */ sg_list_dwords = sg_entry_cnt << 1; if (i == 0) { scsi_sg_q.sg_list_cnt = sg_entry_cnt; @@ -13403,14 +11607,14 @@ (ushort) (q_addr + ASC_SCSIQ_B_FWD)); scsi_sg_q.q_no = next_qp; q_addr = ASC_QNO_TO_QADDR(next_qp); - AscMemWordCopyToLram(iop_base, - (ushort) (q_addr + ASC_SCSIQ_SGHD_CPY_BEG), - (ushort *) & scsi_sg_q, - (ushort) (sizeof (ASC_SG_LIST_Q) >> 1)); - AscMemDWordCopyToLram(iop_base, - (ushort) (q_addr + ASC_SGQ_LIST_BEG), - (ADV_PADDR *) &sg_head->sg_list[sg_index], - (ushort) sg_list_dwords); + AscMemWordCopyPtrToLram(iop_base, + q_addr + ASC_SCSIQ_SGHD_CPY_BEG, + (uchar *) &scsi_sg_q, + sizeof(ASC_SG_LIST_Q) >> 1); + AscMemDWordCopyPtrToLram(iop_base, + q_addr + ASC_SGQ_LIST_BEG, + (uchar *) &sg_head->sg_list[sg_index], + sg_list_dwords); sg_index += ASC_SG_LIST_PER_Q; scsiq->next_sg_index = sg_index; } @@ -13423,150 +11627,6 @@ return (sta); } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -AscAbortSRB( - ASC_DVC_VAR *asc_dvc, - ADV_VADDR srb_ptr -) -{ - int sta; - ASC_SCSI_BIT_ID_TYPE saved_unit_not_ready; - PortAddr iop_base; - - iop_base = asc_dvc->iop_base; - sta = ERR; - saved_unit_not_ready = asc_dvc->unit_not_ready; - asc_dvc->unit_not_ready = 0xFF; - AscWaitISRDone(asc_dvc); - if (AscStopQueueExe(iop_base) == 1) { - if (AscRiscHaltedAbortSRB(asc_dvc, srb_ptr) == 1) { - sta = 1; - AscCleanUpBusyQueue(iop_base); - AscStartQueueExe(iop_base); - } else { - sta = 0; - AscStartQueueExe(iop_base); - } - } - asc_dvc->unit_not_ready = saved_unit_not_ready; - return (sta); -} -#endif /* version < v2.3.28 */ - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) && \ - LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -AscResetDevice( - ASC_DVC_VAR *asc_dvc, - uchar target_ix -) -{ - PortAddr iop_base; - int sta; - uchar tid_no; - - ASC_SCSI_BIT_ID_TYPE target_id; - int i; - ASC_SCSI_REQ_Q scsiq_buf; - ASC_SCSI_REQ_Q *scsiq; - uchar *buf; - ASC_SCSI_BIT_ID_TYPE saved_unit_not_ready; - iop_base = asc_dvc->iop_base; - tid_no = ASC_TIX_TO_TID(target_ix); - target_id = ASC_TID_TO_TARGET_ID(tid_no); - saved_unit_not_ready = asc_dvc->unit_not_ready; - asc_dvc->unit_not_ready = target_id; - sta = ERR; - AscWaitTixISRDone(asc_dvc, target_ix); - if (AscStopQueueExe(iop_base) == 1) { - if (AscRiscHaltedAbortTIX(asc_dvc, target_ix) == 1) { - AscCleanUpBusyQueue(iop_base); - AscStartQueueExe(iop_base); - AscWaitTixISRDone(asc_dvc, target_ix); - sta = TRUE; - scsiq = (ASC_SCSI_REQ_Q *) & scsiq_buf; - buf = (uchar *) & scsiq_buf; - for (i = 0; i < sizeof (ASC_SCSI_REQ_Q); i++) { - *buf++ = 0x00; - } - scsiq->r1.status = (uchar) QS_READY; - scsiq->r2.cdb_len = 6; - scsiq->r2.tag_code = M2_QTAG_MSG_SIMPLE; - scsiq->r1.target_id = target_id; - scsiq->r2.target_ix = ASC_TIDLUN_TO_IX(tid_no, 0); - scsiq->cdbptr = (uchar *) scsiq->cdb; - scsiq->r1.cntl = QC_NO_CALLBACK | QC_MSG_OUT | QC_URGENT; - AscWriteLramByte(asc_dvc->iop_base, ASCV_MSGOUT_BEG, - M1_BUS_DVC_RESET); - asc_dvc->unit_not_ready &= ~target_id; - asc_dvc->sdtr_done |= target_id; - if (AscExeScsiQueue(asc_dvc, (ASC_SCSI_Q *) scsiq) - == 1) { - asc_dvc->unit_not_ready = target_id; - DvcSleepMilliSecond(1000); - _AscWaitQDone(iop_base, (ASC_SCSI_Q *) scsiq); - if (AscStopQueueExe(iop_base) == 1) { - AscCleanUpDiscQueue(iop_base); - AscStartQueueExe(iop_base); - if (asc_dvc->pci_fix_asyn_xfer & target_id) { - AscSetRunChipSynRegAtID(iop_base, tid_no, - ASYN_SDTR_DATA_FIX_PCI_REV_AB); - } - AscWaitTixISRDone(asc_dvc, target_ix); - } - } else { - sta = 0; - } - asc_dvc->sdtr_done &= ~target_id; - } else { - sta = ERR; - AscStartQueueExe(iop_base); - } - } - asc_dvc->unit_not_ready = saved_unit_not_ready; - return (sta); -} -#endif /* version >= v1.3.89 && version <= v2.3.28 */ - -STATIC int -AscResetSB( - ASC_DVC_VAR *asc_dvc -) -{ - int sta; - int i; - PortAddr iop_base; - - iop_base = asc_dvc->iop_base; - asc_dvc->unit_not_ready = 0xFF; - sta = TRUE; - AscWaitISRDone(asc_dvc); - AscStopQueueExe(iop_base); - asc_dvc->sdtr_done = 0; - AscResetChipAndScsiBus(asc_dvc); - DvcSleepMilliSecond((ASC_DCNT) ((ushort) asc_dvc->scsi_reset_wait * 1000)); - AscReInitLram(asc_dvc); - for (i = 0; i <= ASC_MAX_TID; i++) { - asc_dvc->cur_dvc_qng[i] = 0; - if (asc_dvc->pci_fix_asyn_xfer & (ASC_SCSI_BIT_ID_TYPE) (0x01 << i)) { - AscSetChipSynRegAtID(iop_base, i, ASYN_SDTR_DATA_FIX_PCI_REV_AB); - } - } - asc_dvc->err_code = 0; - AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); - if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { - sta = ERR; - } - if (AscStartChip(iop_base) == 0) { - sta = ERR; - } - AscStartQueueExe(iop_base); - asc_dvc->unit_not_ready = 0; - asc_dvc->queue_full_or_busy = 0; - return (sta); -} - STATIC int AscSetRunChipSynRegAtID( PortAddr iop_base, @@ -13618,16 +11678,6 @@ return (sta); } -STATIC int -AscReInitLram( - ASC_DVC_VAR *asc_dvc -) -{ - AscInitLram(asc_dvc); - AscInitQLinkVar(asc_dvc); - return (0); -} - STATIC ushort AscInitLram( ASC_DVC_VAR *asc_dvc @@ -13722,39 +11772,14 @@ { if (asc_dvc->err_code == 0) { asc_dvc->err_code = err_code; - AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, - err_code); - } - return (err_code); -} - - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) && \ - LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -_AscWaitQDone( - PortAddr iop_base, - ASC_SCSI_Q * scsiq -) -{ - ushort q_addr; - uchar q_status; - int count = 0; - - while (scsiq->q1.q_no == 0); - q_addr = ASC_QNO_TO_QADDR(scsiq->q1.q_no); - do { - q_status = AscReadLramByte(iop_base, q_addr + ASC_SCSIQ_B_STATUS); - DvcSleepMilliSecond(100L); - if (count++ > 30) { - return (0); - } - } while ((q_status & QS_READY) != 0); - return (1); + AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, + err_code); + } + return (err_code); } -#endif /* version >= v1.3.89 && version < v2.3.28 */ -STATIC uchar + +STATIC uchar AscMsgOutSDTR( ASC_DVC_VAR *asc_dvc, uchar sdtr_period, @@ -13775,18 +11800,18 @@ if ((sdtr_period_index = AscGetSynPeriodIndex(asc_dvc, sdtr_period)) <= asc_dvc->max_sdtr_index) { - AscMemWordCopyToLram(iop_base, + AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, - (ushort *) & sdtr_buf, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &sdtr_buf, + sizeof (EXT_MSG) >> 1); return ((sdtr_period_index << 4) | sdtr_offset); } else { sdtr_buf.req_ack_offset = 0; - AscMemWordCopyToLram(iop_base, + AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, - (ushort *) & sdtr_buf, - (ushort) (sizeof (EXT_MSG) >> 1)); + (uchar *) &sdtr_buf, + sizeof (EXT_MSG) >> 1); return (0); } } @@ -13888,98 +11913,6 @@ return (free_q_head); } -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -AscRiscHaltedAbortSRB( - ASC_DVC_VAR *asc_dvc, - ASC_VADDR srb_ptr -) -{ - PortAddr iop_base; - ushort q_addr; - uchar q_no; - ASC_QDONE_INFO scsiq_buf; - ASC_QDONE_INFO *scsiq; - ASC_ISR_CALLBACK asc_isr_callback; - int last_int_level; - - iop_base = asc_dvc->iop_base; - asc_isr_callback = asc_dvc->isr_callback; - last_int_level = DvcEnterCritical(); - scsiq = (ASC_QDONE_INFO *) & scsiq_buf; - for (q_no = ASC_MIN_ACTIVE_QNO; q_no <= asc_dvc->max_total_qng; - q_no++) { - q_addr = ASC_QNO_TO_QADDR(q_no); - scsiq->d2.srb_ptr = AscReadLramDWord(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_D_SRBPTR)); - if (scsiq->d2.srb_ptr == srb_ptr) { - _AscCopyLramScsiDoneQ(iop_base, q_addr, scsiq, asc_dvc->max_dma_count); - if (((scsiq->q_status & QS_READY) != 0) - && ((scsiq->q_status & QS_ABORTED) == 0) - && ((scsiq->cntl & QCSG_SG_XFER_LIST) == 0)) { - scsiq->q_status |= QS_ABORTED; - scsiq->d3.done_stat = QD_ABORTED_BY_HOST; - AscWriteLramDWord(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_D_SRBPTR), - 0L); - AscWriteLramByte(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_B_STATUS), - scsiq->q_status); - (*asc_isr_callback) (asc_dvc, scsiq); - return (1); - } - } - } - DvcLeaveCritical(last_int_level); - return (0); -} -#endif /* version < v2.3.28 */ - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) && \ - LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -AscRiscHaltedAbortTIX( - ASC_DVC_VAR *asc_dvc, - uchar target_ix -) -{ - PortAddr iop_base; - ushort q_addr; - uchar q_no; - ASC_QDONE_INFO scsiq_buf; - ASC_QDONE_INFO *scsiq; - ASC_ISR_CALLBACK asc_isr_callback; - int last_int_level; - - iop_base = asc_dvc->iop_base; - asc_isr_callback = asc_dvc->isr_callback; - last_int_level = DvcEnterCritical(); - scsiq = (ASC_QDONE_INFO *) & scsiq_buf; - for (q_no = ASC_MIN_ACTIVE_QNO; q_no <= asc_dvc->max_total_qng; - q_no++) { - q_addr = ASC_QNO_TO_QADDR(q_no); - _AscCopyLramScsiDoneQ(iop_base, q_addr, scsiq, asc_dvc->max_dma_count); - if (((scsiq->q_status & QS_READY) != 0) && - ((scsiq->q_status & QS_ABORTED) == 0) && - ((scsiq->cntl & QCSG_SG_XFER_LIST) == 0)) { - if (scsiq->d2.target_ix == target_ix) { - scsiq->q_status |= QS_ABORTED; - scsiq->d3.done_stat = QD_ABORTED_BY_HOST; - AscWriteLramDWord(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_D_SRBPTR), - 0L); - AscWriteLramByte(iop_base, - (ushort) (q_addr + (ushort) ASC_SCSIQ_B_STATUS), - scsiq->q_status); - (*asc_isr_callback) (asc_dvc, scsiq); - } - } - } - DvcLeaveCritical(last_int_level); - return (1); -} -#endif /* version >= v1.3.89 && version < v2.3.28 */ - STATIC int AscHostReqRiscHalt( PortAddr iop_base @@ -14028,121 +11961,6 @@ return (0); } -STATIC int -AscStartQueueExe( - PortAddr iop_base -) -{ - if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) != 0) { - AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, 0); - } - return (1); -} - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -STATIC int -AscCleanUpBusyQueue( - PortAddr iop_base -) -{ - int count; - uchar stop_code; - - count = 0; - if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) != 0) { - AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, - ASC_STOP_CLEAN_UP_BUSY_Q); - do { - stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); - if ((stop_code & ASC_STOP_CLEAN_UP_BUSY_Q) == 0) - break; - DvcSleepMilliSecond(100); - } while (count++ < 20); - } - return (1); -} - -#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89) -STATIC int -AscCleanUpDiscQueue( - PortAddr iop_base -) -{ - int count; - uchar stop_code; - - count = 0; - if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) != 0) { - AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, - ASC_STOP_CLEAN_UP_DISC_Q); - do { - stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); - if ((stop_code & ASC_STOP_CLEAN_UP_DISC_Q) == 0) - break; - DvcSleepMilliSecond(100); - } while (count++ < 20); - } - return (1); -} -#endif /* version >= v1.3.89 */ -#endif /* version < v2.3.28 */ - -STATIC int -AscWaitTixISRDone( - ASC_DVC_VAR *asc_dvc, - uchar target_ix -) -{ - uchar cur_req; - uchar tid_no; - int i = 0; - - tid_no = ASC_TIX_TO_TID(target_ix); - while (i++ < 10) { - if ((cur_req = asc_dvc->cur_dvc_qng[tid_no]) == 0) { - break; - } - DvcSleepMilliSecond(1000L); - if (asc_dvc->cur_dvc_qng[tid_no] == cur_req) { - break; - } - } - return (1); -} - -STATIC int -AscWaitISRDone( - ASC_DVC_VAR *asc_dvc -) -{ - int tid; - - for (tid = 0; tid <= ASC_MAX_TID; tid++) { - AscWaitTixISRDone(asc_dvc, ASC_TID_TO_TIX(tid)); - } - return (1); -} - -STATIC ASC_PADDR -AscGetOnePhyAddr( - ASC_DVC_VAR *asc_dvc, - uchar * buf_addr, - ASC_DCNT buf_size -) -{ - ASC_MIN_SG_HEAD sg_head; - - sg_head.entry_cnt = ASC_MIN_SG_LIST; - if (DvcGetSGList(asc_dvc, (uchar *) buf_addr, - buf_size, (ASC_SG_HEAD *) &sg_head) != buf_size) { - return (0L); - } - if (sg_head.entry_cnt > 1) { - return (0L); - } - return ((ASC_PADDR) sg_head.sg_list[0].addr); -} - STATIC void DvcDelayMicroSecond(ADV_DVC_VAR *asc_dvc, ushort micro_sec) { @@ -14647,12 +12465,10 @@ return (warn_code); } -ASC_INITFUNC( -STATIC ushort, +STATIC ushort AscInitAsc1000Driver( ASC_DVC_VAR *asc_dvc ) -) { ushort warn_code; PortAddr iop_base; @@ -14676,7 +12492,9 @@ warn_code |= AscInitLram(asc_dvc); if (asc_dvc->err_code != 0) return (UW_ERR); - if (AscLoadMicroCode(iop_base, 0, (ushort *) _asc_mcode_buf, + ASC_DBG1(1, "AscInitAsc1000Driver: _asc_mcode_chksum 0x%lx\n", + (ulong) _asc_mcode_chksum); + if (AscLoadMicroCode(iop_base, 0, _asc_mcode_buf, _asc_mcode_size) != _asc_mcode_chksum) { asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; return (warn_code); @@ -14838,7 +12656,7 @@ asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR; return (warn_code); } - eep_config = (ASCEEP_CONFIG *) & eep_config_buf; + eep_config = (ASCEEP_CONFIG *) &eep_config_buf; cfg_msw = AscGetChipCfgMsw(iop_base); cfg_lsw = AscGetChipCfgLsw(iop_base); if ((cfg_msw & ASC_CFG_MSW_CLR_MASK) != 0) { @@ -14847,6 +12665,7 @@ AscSetChipCfgMsw(iop_base, cfg_msw); } chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); + ASC_DBG1(1, "AscInitFromEEP: chksum 0x%x\n", chksum); if (chksum == 0) { chksum = 0xaa55; } @@ -14865,10 +12684,14 @@ } eep_config->cfg_msw &= ~ASC_CFG_MSW_CLR_MASK; eep_config->cfg_lsw |= ASC_CFG0_HOST_INT_ON; + ASC_DBG1(1, "AscInitFromEEP: eep_config->chksum 0x%x\n", + eep_config->chksum); if (chksum != eep_config->chksum) { if (AscGetChipVersion(iop_base, asc_dvc->bus_type) == ASC_CHIP_VER_PCI_ULTRA_3050 ) { + ASC_DBG(1, +"AscInitFromEEP: chksum error ignored; EEPROM-less board\n"); eep_config->init_sdtr = 0xFF; eep_config->disc_enable = 0xFF; eep_config->start_motor = 0xFF; @@ -14886,6 +12709,8 @@ /* Indicate EEPROM-less board. */ eep_config->adapter_info[5] = 0xBB; } else { + ASC_PRINT( +"AscInitFromEEP: EEPROM checksum error; Will try to re-write EEPROM.\n"); write_eep = 1; warn_code |= ASC_WARN_EEPROM_CHKSUM; } @@ -14953,22 +12778,27 @@ } eep_config->cfg_msw = AscGetChipCfgMsw(iop_base); if (write_eep) { - (void) AscSetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); + if ((i = AscSetEEPConfig(iop_base, eep_config, asc_dvc->bus_type)) != + 0) { + ASC_PRINT1( +"AscInitFromEEP: Failed to re-write EEPROM with %d errors.\n", i); + } else { + ASC_PRINT("AscInitFromEEP: Succesfully re-wrote EEPROM."); + } } return (warn_code); } -ASC_INITFUNC( -STATIC ushort, +STATIC ushort AscInitMicroCodeVar( ASC_DVC_VAR *asc_dvc ) -) { int i; ushort warn_code; PortAddr iop_base; ASC_PADDR phy_addr; + ASC_DCNT phy_size; iop_base = asc_dvc->iop_base; warn_code = 0; @@ -14977,26 +12807,27 @@ asc_dvc->cfg->sdtr_period_offset[i] ); } + AscInitQLinkVar(asc_dvc); AscWriteLramByte(iop_base, ASCV_DISC_ENABLE_B, asc_dvc->cfg->disc_enable); AscWriteLramByte(iop_base, ASCV_HOSTSCSI_ID_B, ASC_TID_TO_TARGET_ID(asc_dvc->cfg->chip_scsi_id)); - if ((phy_addr = AscGetOnePhyAddr(asc_dvc, - (uchar *) asc_dvc->cfg->overrun_buf, - ASC_OVERRUN_BSIZE)) == 0L) { - asc_dvc->err_code |= ASC_IERR_GET_PHY_ADDR; - } else { - /* Align on an 8 byte boundary. */ - phy_addr = /*cpu_to_le32*/((phy_addr + 7) & ~0x7); - AscWriteLramDWord(iop_base, ASCV_OVERRUN_PADDR_D, phy_addr); - AscWriteLramDWord(iop_base, ASCV_OVERRUN_BSIZE_D, - ASC_OVERRUN_BSIZE - 8); - } - asc_dvc->cfg->mcode_date = AscReadLramWord(iop_base, - (ushort) ASCV_MC_DATE_W); - asc_dvc->cfg->mcode_version = AscReadLramWord(iop_base, - (ushort) ASCV_MC_VER_W); + + /* Align overrun buffer on an 8 byte boundary. */ + phy_addr = virt_to_bus(asc_dvc->cfg->overrun_buf); + phy_addr = cpu_to_le32((phy_addr + 7) & ~0x7); + AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_PADDR_D, + (uchar *) &phy_addr, 1); + phy_size = cpu_to_le32(ASC_OVERRUN_BSIZE - 8); + AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_BSIZE_D, + (uchar *) &phy_size, 1); + + asc_dvc->cfg->mcode_date = + AscReadLramWord(iop_base, (ushort) ASCV_MC_DATE_W); + asc_dvc->cfg->mcode_version = + AscReadLramWord(iop_base, (ushort) ASCV_MC_VER_W); + AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR; @@ -15006,6 +12837,7 @@ asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP; return (warn_code); } + return (warn_code); } @@ -15167,24 +12999,17 @@ ushort wval; ushort sum; ushort *wbuf; - ushort *charfields; int cfg_beg; int cfg_end; + int uchar_end_in_config = ASC_EEP_MAX_DVC_ADDR - 2; int s_addr; - int isa_pnp_wsize; wbuf = (ushort *) cfg_buf; - charfields = (ushort *) &ASCEEP_Config_Field_IsChar; sum = 0; - isa_pnp_wsize = 0; - for (s_addr = 0; s_addr < (2 + isa_pnp_wsize); s_addr++, wbuf++) { - wval = AscReadEEPWord(iop_base, (uchar) s_addr); - sum += wval; - /* Swap to native as needed */ - if (*charfields++) - *wbuf = cpu_to_le16(wval); - else - *wbuf = wval; + /* Read two config words; Byte-swapping done by AscReadEEPWord(). */ + for (s_addr = 0; s_addr < 2; s_addr++, wbuf++) { + *wbuf = AscReadEEPWord(iop_base, (uchar) s_addr); + sum += *wbuf; } if (bus_type & ASC_IS_VL) { cfg_beg = ASC_EEP_DVC_CFG_BEG_VL; @@ -15193,20 +13018,25 @@ cfg_beg = ASC_EEP_DVC_CFG_BEG; cfg_end = ASC_EEP_MAX_DVC_ADDR; } - for (s_addr = cfg_beg; s_addr <= (cfg_end - 1); - s_addr++, wbuf++) { - wval = AscReadEEPWord(iop_base, (uchar) s_addr); - sum += wval; - *wbuf = wval; - /* Swap to native as needed */ - if (*charfields++) - *wbuf = cpu_to_le16(wval); - else - *wbuf = wval; + for (s_addr = cfg_beg; s_addr <= (cfg_end - 1); s_addr++, wbuf++) { + wval = AscReadEEPWord( iop_base, ( uchar )s_addr ) ; + if (s_addr <= uchar_end_in_config) { + /* + * Swap all char fields - must unswap bytes already swapped + * by AscReadEEPWord(). + */ + *wbuf = le16_to_cpu(wval); + } else { + /* Don't swap word field at the end - cntl field. */ + *wbuf = wval; + } + sum += wval; /* Checksum treats all EEPROM data as words. */ } + /* + * Read the checksum word which will be compared against 'sum' + * by the caller. Word field already swapped. + */ *wbuf = AscReadEEPWord(iop_base, (uchar) s_addr); - if (charfields) - *wbuf = cpu_to_le16(*wbuf); return (sum); } @@ -15219,15 +13049,19 @@ ) { int n_error; - ushort *wbuf; + ushort *wbuf; + ushort word; ushort sum; int s_addr; int cfg_beg; int cfg_end; + int uchar_end_in_config = ASC_EEP_MAX_DVC_ADDR - 2; + wbuf = (ushort *) cfg_buf; n_error = 0; sum = 0; + /* Write two config words; AscWriteEEPWord() will swap bytes. */ for (s_addr = 0; s_addr < 2; s_addr++, wbuf++) { sum += *wbuf; if (*wbuf != AscWriteEEPWord(iop_base, (uchar) s_addr, *wbuf)) { @@ -15241,29 +13075,66 @@ cfg_beg = ASC_EEP_DVC_CFG_BEG; cfg_end = ASC_EEP_MAX_DVC_ADDR; } - for (s_addr = cfg_beg; s_addr <= (cfg_end - 1); - s_addr++, wbuf++) { - sum += *wbuf; - if (*wbuf != AscWriteEEPWord(iop_base, (uchar) s_addr, *wbuf)) { - n_error++; + for (s_addr = cfg_beg; s_addr <= (cfg_end - 1); s_addr++, wbuf++) { + if (s_addr <= uchar_end_in_config) { + /* + * This is a char field. Swap char fields before they are + * swapped again by AscWriteEEPWord(). + */ + word = cpu_to_le16(*wbuf); + if (word != AscWriteEEPWord( iop_base, (uchar) s_addr, word)) { + n_error++; + } + } else { + /* Don't swap word field at the end - cntl field. */ + if (*wbuf != AscWriteEEPWord(iop_base, (uchar) s_addr, *wbuf)) { + n_error++; + } } + sum += *wbuf; /* Checksum calculated from word values. */ } + /* Write checksum word. It will be swapped by AscWriteEEPWord(). */ *wbuf = sum; if (sum != AscWriteEEPWord(iop_base, (uchar) s_addr, sum)) { n_error++; } + + /* Read EEPROM back again. */ wbuf = (ushort *) cfg_buf; + /* + * Read two config words; Byte-swapping done by AscReadEEPWord(). + */ for (s_addr = 0; s_addr < 2; s_addr++, wbuf++) { if (*wbuf != AscReadEEPWord(iop_base, (uchar) s_addr)) { n_error++; } } - for (s_addr = cfg_beg; s_addr <= cfg_end; - s_addr++, wbuf++) { - if (*wbuf != AscReadEEPWord(iop_base, (uchar) s_addr)) { + if (bus_type & ASC_IS_VL) { + cfg_beg = ASC_EEP_DVC_CFG_BEG_VL; + cfg_end = ASC_EEP_MAX_DVC_ADDR_VL; + } else { + cfg_beg = ASC_EEP_DVC_CFG_BEG; + cfg_end = ASC_EEP_MAX_DVC_ADDR; + } + for (s_addr = cfg_beg; s_addr <= (cfg_end - 1); s_addr++, wbuf++) { + if (s_addr <= uchar_end_in_config) { + /* + * Swap all char fields. Must unswap bytes already swapped + * by AscReadEEPWord(). + */ + word = le16_to_cpu(AscReadEEPWord(iop_base, (uchar) s_addr)); + } else { + /* Don't swap word field at the end - cntl field. */ + word = AscReadEEPWord(iop_base, (uchar) s_addr); + } + if (*wbuf != word) { n_error++; } } + /* Read checksum; Byte swapping not needed. */ + if (AscReadEEPWord(iop_base, (uchar) s_addr) != sum) { + n_error++; + } return (n_error); } @@ -15300,7 +13171,7 @@ uchar dvc_type; ASC_SCSI_BIT_ID_TYPE tid_bits; - dvc_type = inq->byte0.peri_dvc_type; + dvc_type = ASC_INQ_DVC_TYPE(inq); tid_bits = ASC_TIX_TO_TARGET_ID(tid_no); if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_ASYN_USE_SYN) @@ -15360,11 +13231,12 @@ asc_dvc->cfg->can_tagged_qng &= ~tid_bit; asc_dvc->use_tagged_qng &= ~tid_bit; - if (inq->byte3.rsp_data_fmt >= 2 || inq->byte2.ansi_apr_ver >= 2) { - if ((asc_dvc->cfg->sdtr_enable & tid_bit) && inq->byte7.Sync) { + if (ASC_INQ_RESPONSE_FMT(inq) >= 2 || ASC_INQ_ANSI_VER(inq) >= 2) { + if ((asc_dvc->cfg->sdtr_enable & tid_bit) && ASC_INQ_SYNC(inq)) { asc_dvc->init_sdtr |= tid_bit; } - if ((asc_dvc->cfg->cmd_qng_enabled & tid_bit) && inq->byte7.CmdQue) { + if ((asc_dvc->cfg->cmd_qng_enabled & tid_bit) && + ASC_INQ_CMD_QUEUE(inq)) { if (AscTagQueuingSafe(inq)) { asc_dvc->use_tagged_qng |= tid_bit; asc_dvc->cfg->can_tagged_qng |= tid_bit; @@ -15429,7 +13301,6 @@ } return (byte_data); } - STATIC ushort AscReadLramWord( PortAddr iop_base, @@ -15443,6 +13314,7 @@ return (word_data); } +#if CC_VERY_LONG_SG_LIST STATIC ASC_DCNT AscReadLramDWord( PortAddr iop_base, @@ -15458,6 +13330,7 @@ dword_data = ((ASC_DCNT) val_high << 16) | (ASC_DCNT) val_low; return (dword_data); } +#endif /* CC_VERY_LONG_SG_LIST */ STATIC void AscWriteLramWord( @@ -15472,23 +13345,6 @@ } STATIC void -AscWriteLramDWord( - PortAddr iop_base, - ushort addr, - ASC_DCNT dword_val -) -{ - ushort word_val; - - AscSetChipLramAddr(iop_base, addr); - word_val = (ushort) dword_val; - AscSetChipLramData(iop_base, word_val); - word_val = (ushort) (dword_val >> 16); - AscSetChipLramData(iop_base, word_val); - return; -} - -STATIC void AscWriteLramByte( PortAddr iop_base, ushort addr, @@ -15511,42 +13367,87 @@ return; } +/* + * Copy 2 bytes to LRAM. + * + * The source data is assumed to be in little-endian order in memory + * and is maintained in little-endian order when written to LRAM. + */ STATIC void -AscMemWordCopyToLram( +AscMemWordCopyPtrToLram( PortAddr iop_base, ushort s_addr, - ushort * s_buffer, + uchar *s_buffer, int words ) { + int i; + AscSetChipLramAddr(iop_base, s_addr); - DvcOutPortWords(iop_base + IOP_RAM_DATA, s_buffer, words); + for (i = 0; i < 2 * words; i += 2) { + /* + * On a little-endian system the second argument below + * produces a little-endian ushort which is written to + * LRAM in little-endian order. On a big-endian system + * the second argument produces a big-endian ushort which + * is "transparently" byte-swapped by outpw() and written + * in little-endian order to LRAM. + */ + outpw(iop_base + IOP_RAM_DATA, + ((ushort) s_buffer[i + 1] << 8) | s_buffer[i]); + } return; } +/* + * Copy 4 bytes to LRAM. + * + * The source data is assumed to be in little-endian order in memory + * and is maintained in little-endian order when writen to LRAM. + */ STATIC void -AscMemDWordCopyToLram( +AscMemDWordCopyPtrToLram( PortAddr iop_base, ushort s_addr, - ASC_DCNT *s_buffer, + uchar *s_buffer, int dwords ) { + int i; + AscSetChipLramAddr(iop_base, s_addr); - DvcOutPortDWords(iop_base + IOP_RAM_DATA, s_buffer, dwords); + for (i = 0; i < 4 * dwords; i += 4) { + outpw(iop_base + IOP_RAM_DATA, + ((ushort) s_buffer[i + 1] << 8) | s_buffer[i]); /* LSW */ + outpw(iop_base + IOP_RAM_DATA, + ((ushort) s_buffer[i + 3] << 8) | s_buffer[i + 2]); /* MSW */ + } return; } +/* + * Copy 2 bytes from LRAM. + * + * The source data is assumed to be in little-endian order in LRAM + * and is maintained in little-endian order when written to memory. + */ STATIC void -AscMemWordCopyFromLram( +AscMemWordCopyPtrFromLram( PortAddr iop_base, ushort s_addr, - ushort * d_buffer, + uchar *d_buffer, int words ) { + int i; + ushort word; + AscSetChipLramAddr(iop_base, s_addr); - DvcInPortWords(iop_base + IOP_RAM_DATA, d_buffer, words); + for (i = 0; i < 2 * words; i += 2) { + word = inpw(iop_base + IOP_RAM_DATA); + d_buffer[i] = word & 0xff; + d_buffer[i + 1] = (word >> 8) & 0xff; + } return; } @@ -15591,1034 +13492,1077 @@ /* a_mcode.h */ +/* Microcode buffer is kept after initialization for error recovery. */ STATIC unsigned char _adv_asc3550_buf[] = { - 0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0x00, 0x16, 0x00, 0xfc, 0x01, 0x00, 0x48, 0xe4, 0x98, 0x18, - 0x03, 0xf6, 0x18, 0xe4, 0x02, 0x00, 0x18, 0x80, 0x00, 0xfa, 0xff, 0xff, 0x0c, 0x0e, 0x9e, 0xe7, - 0xff, 0x00, 0x82, 0xe7, 0x00, 0xea, 0x00, 0xf6, 0x01, 0xe6, 0x09, 0xe7, 0x01, 0xf6, 0x08, 0x00, - 0x55, 0xf0, 0x01, 0xfa, 0x03, 0x00, 0x04, 0x00, 0x18, 0xf4, 0x00, 0xec, 0x85, 0xf0, 0xbc, 0x00, - 0xd5, 0xf0, 0x7c, 0x0c, 0x38, 0x54, 0x00, 0xe6, 0x1e, 0xf0, 0x86, 0xf0, 0xb4, 0x00, 0x98, 0x57, - 0xd0, 0x01, 0x0c, 0x1c, 0x3e, 0x1c, 0x0c, 0x00, 0x10, 0x00, 0xbb, 0x00, 0x00, 0x10, 0x84, 0x18, - 0x02, 0x80, 0x32, 0xf0, 0x01, 0xfc, 0x76, 0x0c, 0x0a, 0x10, 0x0c, 0x10, 0xa4, 0x12, 0x02, 0x13, - 0x18, 0x40, 0x00, 0x57, 0x01, 0xea, 0x3c, 0x00, 0xc0, 0x00, 0x6c, 0x01, 0x6e, 0x01, 0x04, 0x12, - 0x00, 0x80, 0x03, 0xe6, 0xb6, 0x00, 0x01, 0x01, 0x3e, 0x01, 0xb8, 0x0f, 0x06, 0x13, 0xb9, 0x54, - 0x3e, 0x57, 0x03, 0x58, 0x1b, 0x80, 0x30, 0xe4, 0x4b, 0xe4, 0x20, 0x00, 0x32, 0x00, 0x3e, 0x00, - 0x80, 0x00, 0x24, 0x01, 0x3c, 0x01, 0x68, 0x01, 0x6a, 0x01, 0x70, 0x01, 0x72, 0x01, 0x74, 0x01, - 0x76, 0x01, 0x78, 0x01, 0x62, 0x0a, 0x80, 0x0c, 0x08, 0x12, 0x1e, 0x13, 0x4c, 0x1c, 0x02, 0x4a, - 0xbb, 0x55, 0x3c, 0x56, 0x4a, 0xe4, 0x02, 0xee, 0x5b, 0xf0, 0xb1, 0xf0, 0x03, 0xf7, 0x06, 0xf7, - 0x03, 0xfc, 0x0f, 0x00, 0x40, 0x00, 0xbe, 0x00, 0x00, 0x01, 0xa0, 0x08, 0x42, 0x15, 0x32, 0x1c, - 0x38, 0x1c, 0x4e, 0x1c, 0x10, 0x44, 0x02, 0x48, 0x00, 0x4c, 0x04, 0x80, 0x04, 0xea, 0x5d, 0xf0, + 0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0x00, 0x16, 0x18, 0xe4, 0x00, 0xfc, 0x01, 0x00, 0x48, 0xe4, + 0xbe, 0x18, 0x18, 0x80, 0x03, 0xf6, 0x02, 0x00, 0x00, 0xfa, 0xff, 0xff, 0x28, 0x0e, 0x9e, 0xe7, + 0xff, 0x00, 0x82, 0xe7, 0x00, 0xea, 0x00, 0xf6, 0x01, 0xe6, 0x09, 0xe7, 0x55, 0xf0, 0x01, 0xf6, + 0x01, 0xfa, 0x08, 0x00, 0x03, 0x00, 0x04, 0x00, 0x18, 0xf4, 0x10, 0x00, 0x00, 0xec, 0x85, 0xf0, + 0xbc, 0x00, 0xd5, 0xf0, 0x8e, 0x0c, 0x38, 0x54, 0x00, 0xe6, 0x1e, 0xf0, 0x86, 0xf0, 0xb4, 0x00, + 0x98, 0x57, 0xd0, 0x01, 0x0c, 0x1c, 0x3e, 0x1c, 0x0c, 0x00, 0xbb, 0x00, 0xaa, 0x18, 0x02, 0x80, + 0x32, 0xf0, 0x01, 0xfc, 0x88, 0x0c, 0xc6, 0x12, 0x02, 0x13, 0x18, 0x40, 0x00, 0x57, 0x01, 0xea, + 0x3c, 0x00, 0x6c, 0x01, 0x6e, 0x01, 0x04, 0x12, 0x3e, 0x57, 0x00, 0x80, 0x03, 0xe6, 0xb6, 0x00, + 0xc0, 0x00, 0x01, 0x01, 0x3e, 0x01, 0xda, 0x0f, 0x22, 0x10, 0x08, 0x12, 0x02, 0x4a, 0xb9, 0x54, + 0x03, 0x58, 0x1b, 0x80, 0x30, 0xe4, 0x4b, 0xe4, 0x20, 0x00, 0x32, 0x00, 0x3e, 0x00, 0x80, 0x00, + 0x24, 0x01, 0x3c, 0x01, 0x68, 0x01, 0x6a, 0x01, 0x70, 0x01, 0x72, 0x01, 0x74, 0x01, 0x76, 0x01, + 0x78, 0x01, 0x62, 0x0a, 0x92, 0x0c, 0x2c, 0x10, 0x2e, 0x10, 0x06, 0x13, 0x4c, 0x1c, 0xbb, 0x55, + 0x3c, 0x56, 0x04, 0x80, 0x4a, 0xe4, 0x02, 0xee, 0x5b, 0xf0, 0xb1, 0xf0, 0x03, 0xf7, 0x06, 0xf7, + 0x03, 0xfc, 0x0f, 0x00, 0x40, 0x00, 0xbe, 0x00, 0x00, 0x01, 0xb0, 0x08, 0x30, 0x13, 0x64, 0x15, + 0x32, 0x1c, 0x38, 0x1c, 0x4e, 0x1c, 0x10, 0x44, 0x02, 0x48, 0x00, 0x4c, 0x04, 0xea, 0x5d, 0xf0, 0x04, 0xf6, 0x02, 0xfc, 0x05, 0x00, 0x34, 0x00, 0x36, 0x00, 0x98, 0x00, 0xcc, 0x00, 0x20, 0x01, - 0x4e, 0x01, 0x3e, 0x0b, 0x02, 0x0e, 0x0a, 0x12, 0x04, 0x13, 0x0e, 0x13, 0x30, 0x13, 0x60, 0x13, - 0xee, 0x14, 0x30, 0x1c, 0x00, 0x4e, 0xbd, 0x56, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, 0x59, 0xf0, - 0xa7, 0xf0, 0xb8, 0xf0, 0x0e, 0xf7, 0x06, 0x00, 0x19, 0x00, 0x33, 0x00, 0x9b, 0x00, 0xa4, 0x00, - 0xb5, 0x00, 0xba, 0x00, 0xd0, 0x00, 0xe1, 0x00, 0xe7, 0x00, 0xde, 0x03, 0x46, 0x0a, 0xf8, 0x0d, - 0x02, 0x10, 0x04, 0x10, 0x0a, 0x13, 0x12, 0x13, 0xf2, 0x14, 0x8a, 0x16, 0x20, 0x1c, 0x34, 0x1c, - 0x36, 0x1c, 0x08, 0x44, 0x38, 0x44, 0x91, 0x44, 0x0a, 0x45, 0x48, 0x46, 0x01, 0x48, 0x68, 0x54, - 0x83, 0x55, 0xb0, 0x57, 0x01, 0x58, 0x83, 0x59, 0x06, 0x83, 0x05, 0xe6, 0x0b, 0xf0, 0x0c, 0xf0, - 0x5c, 0xf0, 0x4b, 0xf4, 0x04, 0xf8, 0x05, 0xf8, 0x02, 0xfa, 0x03, 0xfa, 0x04, 0xfc, 0x05, 0xfc, - 0x07, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0x1c, 0x00, 0x9e, 0x00, 0xa8, 0x00, 0xaa, 0x00, 0xb9, 0x00, - 0xe0, 0x00, 0x22, 0x01, 0x26, 0x01, 0x79, 0x01, 0x7a, 0x01, 0xc0, 0x01, 0xc2, 0x01, 0x7c, 0x02, - 0x62, 0x03, 0xda, 0x04, 0xd8, 0x07, 0x68, 0x08, 0x69, 0x08, 0xaa, 0x08, 0xe9, 0x09, 0xf6, 0x0a, - 0x1e, 0x0e, 0x0e, 0x10, 0x14, 0x10, 0x1a, 0x10, 0xed, 0x10, 0xf1, 0x10, 0x06, 0x12, 0x16, 0x13, - 0x20, 0x14, 0xb4, 0x14, 0xb6, 0x14, 0x68, 0x15, 0xa0, 0x17, 0xac, 0x17, 0x6b, 0x18, 0x12, 0x1c, - 0x46, 0x1c, 0x9c, 0x32, 0x00, 0x40, 0x0e, 0x47, 0x48, 0x47, 0x41, 0x48, 0x89, 0x48, 0x80, 0x4c, - 0x00, 0x54, 0x44, 0x55, 0xe5, 0x55, 0x14, 0x56, 0x77, 0x57, 0xbf, 0x57, 0x40, 0x5c, 0x06, 0x80, - 0x08, 0x90, 0x03, 0xa1, 0x00, 0xcc, 0x19, 0xe4, 0x4e, 0xe4, 0xfe, 0x9c, 0xf0, 0x28, 0x02, 0xfe, - 0xa6, 0x0c, 0xff, 0x10, 0x00, 0x00, 0xce, 0xfe, 0xa6, 0x18, 0x00, 0xcd, 0xfe, 0x80, 0x01, 0xff, - 0x03, 0x00, 0x00, 0xfe, 0x02, 0x15, 0xfe, 0x0c, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, - 0x00, 0xfe, 0x48, 0x00, 0x50, 0xff, 0x04, 0x00, 0x00, 0x10, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, + 0x4e, 0x01, 0x4e, 0x0b, 0x1e, 0x0e, 0x0c, 0x10, 0x0a, 0x12, 0x04, 0x13, 0x40, 0x13, 0x30, 0x1c, + 0x00, 0x4e, 0xbd, 0x56, 0x06, 0x83, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, 0x59, 0xf0, 0xa7, 0xf0, + 0xb8, 0xf0, 0x0e, 0xf7, 0x06, 0x00, 0x19, 0x00, 0x33, 0x00, 0x9b, 0x00, 0xa4, 0x00, 0xb5, 0x00, + 0xba, 0x00, 0xd0, 0x00, 0xe1, 0x00, 0xe7, 0x00, 0xde, 0x03, 0x56, 0x0a, 0x14, 0x0e, 0x02, 0x10, + 0x04, 0x10, 0x0a, 0x10, 0x36, 0x10, 0x0a, 0x13, 0x12, 0x13, 0x52, 0x13, 0x10, 0x15, 0x14, 0x15, + 0xac, 0x16, 0x20, 0x1c, 0x34, 0x1c, 0x36, 0x1c, 0x08, 0x44, 0x38, 0x44, 0x91, 0x44, 0x0a, 0x45, + 0x48, 0x46, 0x01, 0x48, 0x68, 0x54, 0x83, 0x55, 0xb0, 0x57, 0x01, 0x58, 0x83, 0x59, 0x05, 0xe6, + 0x0b, 0xf0, 0x0c, 0xf0, 0x5c, 0xf0, 0x4b, 0xf4, 0x04, 0xf8, 0x05, 0xf8, 0x02, 0xfa, 0x03, 0xfa, + 0x04, 0xfc, 0x05, 0xfc, 0x07, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0x1c, 0x00, 0x9e, 0x00, 0xa8, 0x00, + 0xaa, 0x00, 0xb9, 0x00, 0xe0, 0x00, 0x22, 0x01, 0x26, 0x01, 0x79, 0x01, 0x7a, 0x01, 0xc0, 0x01, + 0xc2, 0x01, 0x7c, 0x02, 0x5a, 0x03, 0xea, 0x04, 0xe8, 0x07, 0x68, 0x08, 0x69, 0x08, 0xba, 0x08, + 0xe9, 0x09, 0x06, 0x0b, 0x3a, 0x0e, 0x00, 0x10, 0x1a, 0x10, 0xed, 0x10, 0xf1, 0x10, 0x06, 0x12, + 0x0c, 0x13, 0x16, 0x13, 0x1e, 0x13, 0x82, 0x13, 0x42, 0x14, 0xd6, 0x14, 0x8a, 0x15, 0xc6, 0x17, + 0xd2, 0x17, 0x6b, 0x18, 0x12, 0x1c, 0x46, 0x1c, 0x9c, 0x32, 0x00, 0x40, 0x0e, 0x47, 0x48, 0x47, + 0x41, 0x48, 0x89, 0x48, 0x80, 0x4c, 0x00, 0x54, 0x44, 0x55, 0xe5, 0x55, 0x14, 0x56, 0x77, 0x57, + 0xbf, 0x57, 0x40, 0x5c, 0x06, 0x80, 0x08, 0x90, 0x03, 0xa1, 0xfe, 0x9c, 0xf0, 0x29, 0x02, 0xfe, + 0xb8, 0x0c, 0xff, 0x10, 0x00, 0x00, 0xd0, 0xfe, 0xcc, 0x18, 0x00, 0xcf, 0xfe, 0x80, 0x01, 0xff, + 0x03, 0x00, 0x00, 0xfe, 0x93, 0x15, 0xfe, 0x0f, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, + 0x00, 0xfe, 0x48, 0x00, 0x4f, 0xff, 0x04, 0x00, 0x00, 0x10, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, 0x01, 0x01, 0xff, 0x08, 0xff, 0xff, 0xff, 0x27, 0x00, 0x00, 0xff, 0x10, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0xfe, 0x78, 0x56, 0xfe, 0x34, 0x12, 0xff, 0x21, 0x00, 0x00, 0xfe, 0x04, 0xf7, 0xcd, - 0x29, 0x67, 0x0a, 0x01, 0xfe, 0xac, 0x0e, 0xfe, 0x04, 0xf7, 0xcd, 0x67, 0x0a, 0x48, 0x29, 0xfe, - 0x3d, 0xf0, 0xfe, 0x02, 0x02, 0xfe, 0x20, 0xf0, 0x9d, 0xfe, 0x91, 0xf0, 0xfe, 0xf0, 0x01, 0xfe, - 0x90, 0xf0, 0xfe, 0xf0, 0x01, 0xfe, 0x8f, 0xf0, 0x9d, 0x04, 0x52, 0x3f, 0x02, 0xfe, 0xc2, 0x0c, - 0x01, 0xfe, 0x28, 0x0d, 0xfe, 0xdd, 0x12, 0xfe, 0xfc, 0x10, 0xfe, 0x28, 0x1c, 0x04, 0xfe, 0xa6, - 0x00, 0xfe, 0xd3, 0x12, 0x47, 0x19, 0xfe, 0xa6, 0x00, 0xb2, 0xfe, 0x48, 0xf0, 0xfe, 0x86, 0x02, + 0x00, 0x00, 0xfe, 0x78, 0x56, 0xfe, 0x34, 0x12, 0xff, 0x21, 0x00, 0x00, 0xfe, 0x04, 0xf7, 0xcf, + 0x2a, 0x67, 0x0b, 0x01, 0xfe, 0xce, 0x0e, 0xfe, 0x04, 0xf7, 0xcf, 0x67, 0x0b, 0x3c, 0x2a, 0xfe, + 0x3d, 0xf0, 0xfe, 0x02, 0x02, 0xfe, 0x20, 0xf0, 0x9c, 0xfe, 0x91, 0xf0, 0xfe, 0xf0, 0x01, 0xfe, + 0x90, 0xf0, 0xfe, 0xf0, 0x01, 0xfe, 0x8f, 0xf0, 0x9c, 0x05, 0x51, 0x3b, 0x02, 0xfe, 0xd4, 0x0c, + 0x01, 0xfe, 0x44, 0x0d, 0xfe, 0xdd, 0x12, 0xfe, 0xfc, 0x10, 0xfe, 0x28, 0x1c, 0x05, 0xfe, 0xa6, + 0x00, 0xfe, 0xd3, 0x12, 0x47, 0x18, 0xfe, 0xa6, 0x00, 0xb5, 0xfe, 0x48, 0xf0, 0xfe, 0x86, 0x02, 0xfe, 0x49, 0xf0, 0xfe, 0xa0, 0x02, 0xfe, 0x4a, 0xf0, 0xfe, 0xbe, 0x02, 0xfe, 0x46, 0xf0, 0xfe, 0x50, 0x02, 0xfe, 0x47, 0xf0, 0xfe, 0x56, 0x02, 0xfe, 0x43, 0xf0, 0xfe, 0x44, 0x02, 0xfe, 0x44, - 0xf0, 0xfe, 0x48, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x4c, 0x02, 0x16, 0x0a, 0xa1, 0x16, 0x05, 0x19, - 0x97, 0x02, 0x28, 0xfe, 0x00, 0x1c, 0xdd, 0xfe, 0x02, 0x1c, 0xdc, 0xfe, 0x1e, 0x1c, 0xfe, 0xe9, - 0x10, 0x01, 0xfe, 0xfe, 0x16, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xc5, 0x08, 0x6b, 0x01, 0x9f, - 0x02, 0x28, 0x14, 0x4e, 0x3a, 0x98, 0x01, 0xfe, 0x42, 0x0f, 0x08, 0x6b, 0x01, 0x82, 0xfe, 0xbd, - 0x10, 0x08, 0x6b, 0x01, 0x82, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x16, 0x05, - 0x19, 0x97, 0x29, 0x24, 0x28, 0xfe, 0x3d, 0xf0, 0xfe, 0x02, 0x02, 0x20, 0xfe, 0x94, 0x02, 0xfe, - 0x5a, 0x1c, 0xe7, 0xfe, 0x14, 0x1c, 0x14, 0xfe, 0x30, 0x00, 0x3a, 0x98, 0x01, 0xfe, 0x32, 0x0f, - 0x16, 0x05, 0x19, 0x97, 0x02, 0xce, 0x1d, 0x1f, 0x06, 0x10, 0x37, 0xfe, 0x69, 0x10, 0x16, 0x05, - 0x19, 0x97, 0xfe, 0x04, 0xec, 0x1f, 0x5f, 0x40, 0x12, 0x1f, 0xfe, 0x05, 0xf6, 0xc5, 0x01, 0xfe, - 0x30, 0x16, 0x0b, 0x4b, 0x4d, 0x38, 0x11, 0x2d, 0x48, 0xb4, 0x01, 0xe3, 0x02, 0x28, 0x08, 0x3c, - 0x01, 0x0e, 0x06, 0x00, 0x46, 0x01, 0x6e, 0xfe, 0x20, 0x10, 0x08, 0x9a, 0x01, 0x0e, 0xfe, 0x41, - 0x58, 0x08, 0x3c, 0x01, 0x0e, 0xfe, 0x49, 0x54, 0x64, 0xfe, 0x0c, 0x03, 0x01, 0xe3, 0x02, 0x28, - 0x29, 0x5f, 0xfe, 0x02, 0xe8, 0x26, 0xf5, 0xfe, 0x9e, 0x43, 0xf4, 0xfe, 0x27, 0xf0, 0xfe, 0xdc, - 0x01, 0xfe, 0x07, 0x4b, 0xfe, 0x20, 0xf0, 0x9d, 0xfe, 0x40, 0x1c, 0x24, 0xd0, 0xfe, 0x26, 0xf0, - 0xfe, 0x5e, 0x03, 0xfe, 0xa0, 0xf0, 0xfe, 0x4c, 0x03, 0xfe, 0x11, 0xf0, 0x9d, 0xd9, 0xfe, 0x9f, - 0xf0, 0xfe, 0x6c, 0x03, 0xe8, 0x0f, 0xfe, 0x11, 0x00, 0x02, 0x5b, 0x29, 0xfe, 0x48, 0x1c, 0xe8, - 0x22, 0x1d, 0x99, 0xa9, 0x12, 0x99, 0x08, 0x3c, 0x01, 0x0e, 0xa9, 0x74, 0x01, 0xfe, 0x9a, 0x15, - 0x11, 0xc8, 0x24, 0xd0, 0xfe, 0x01, 0xf0, 0xd0, 0xfe, 0x82, 0xf0, 0xfe, 0x92, 0x03, 0xe9, 0x11, - 0xfe, 0xe4, 0x00, 0x65, 0xfe, 0xa4, 0x03, 0x24, 0x33, 0x1e, 0xfe, 0xb4, 0x03, 0x01, 0x45, 0xfe, - 0x06, 0xf0, 0xfe, 0xc4, 0x03, 0x8e, 0x81, 0xfe, 0x0a, 0xf0, 0xfe, 0x6a, 0x06, 0x02, 0x21, 0x04, - 0x6b, 0x27, 0x18, 0xfe, 0xe6, 0x04, 0x14, 0x2b, 0x01, 0x36, 0x90, 0xfe, 0x66, 0x02, 0x02, 0xcf, - 0xe8, 0x29, 0x67, 0x1a, 0xfe, 0x67, 0x1b, 0xf5, 0xf4, 0xfe, 0x48, 0x1c, 0x6f, 0x01, 0x85, 0x89, - 0x08, 0x3c, 0x01, 0x0e, 0x06, 0x00, 0x18, 0xd1, 0x08, 0xc8, 0x01, 0x0e, 0x73, 0x61, 0x5a, 0x76, - 0x26, 0x04, 0x6b, 0x27, 0xfe, 0x10, 0x12, 0x14, 0x2b, 0x01, 0x36, 0x90, 0xfe, 0x66, 0x02, 0x02, - 0xcf, 0xba, 0x7d, 0xbb, 0x7f, 0x24, 0x21, 0x65, 0xfe, 0x3c, 0x04, 0x1e, 0xfe, 0x38, 0x04, 0x68, - 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x46, 0x12, 0x2a, 0xff, 0x02, 0x00, 0x10, 0x01, 0x07, - 0x1e, 0xfe, 0xd0, 0x04, 0x2a, 0x01, 0x07, 0x1e, 0x21, 0x31, 0x2f, 0xd3, 0xfe, 0x4c, 0x44, 0xfe, - 0x3c, 0x12, 0x61, 0xfe, 0x44, 0x48, 0x13, 0x2b, 0xfe, 0x4c, 0x54, 0x64, 0xd1, 0x5f, 0x76, 0x26, - 0xf7, 0xec, 0xfe, 0x52, 0x13, 0x30, 0x06, 0x7e, 0xfe, 0x4a, 0x13, 0xfe, 0x18, 0x10, 0x13, 0x2b, - 0xfe, 0x4c, 0x54, 0x64, 0xd1, 0xf7, 0xec, 0xfe, 0x38, 0x13, 0x30, 0x06, 0x7e, 0x86, 0x0b, 0x09, - 0x2c, 0xfe, 0x1c, 0x12, 0x14, 0x93, 0x0b, 0x09, 0x05, 0x3f, 0x14, 0xc2, 0x01, 0x36, 0x90, 0xfe, - 0x5e, 0x0c, 0x02, 0x21, 0x2a, 0x11, 0xfe, 0xe6, 0x00, 0xfe, 0x1c, 0x90, 0xf6, 0x03, 0x14, 0x93, - 0x01, 0x36, 0x02, 0x28, 0xfe, 0x42, 0x5b, 0x67, 0x1a, 0xfe, 0x46, 0x59, 0xf5, 0xf4, 0xfe, 0x87, - 0x80, 0xfe, 0x31, 0xe4, 0x50, 0x0b, 0x09, 0x0a, 0xfe, 0x78, 0x13, 0xfe, 0x20, 0x80, 0x06, 0x1a, - 0xfe, 0x70, 0x12, 0x4a, 0x09, 0x05, 0x87, 0x04, 0xfe, 0xa2, 0x00, 0x27, 0x18, 0xfe, 0x70, 0x05, - 0xfe, 0x31, 0xe4, 0x6a, 0x4a, 0x09, 0x0a, 0xfe, 0x4a, 0x13, 0x04, 0xfe, 0xa0, 0x00, 0x27, 0xfe, - 0x42, 0x12, 0x5e, 0x01, 0x07, 0x24, 0x33, 0xee, 0x01, 0x07, 0x25, 0xfe, 0x88, 0x05, 0x11, 0xfe, - 0xe3, 0x00, 0x22, 0x4a, 0xfe, 0x4a, 0xf0, 0xfe, 0x5a, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0x54, 0x05, - 0x35, 0x23, 0xfe, 0x21, 0x00, 0x34, 0x23, 0xfe, 0x22, 0x00, 0xa1, 0x23, 0x4d, 0xfe, 0x09, 0x48, - 0x01, 0x07, 0x25, 0xfe, 0x88, 0x05, 0xfe, 0xe2, 0x08, 0x4a, 0x09, 0xc3, 0x3f, 0x01, 0x5d, 0x23, - 0x05, 0x12, 0xca, 0x3a, 0xfe, 0x27, 0x01, 0x0b, 0x09, 0x2c, 0xfe, 0x22, 0x12, 0x47, 0x01, 0xa4, - 0x14, 0x93, 0x0b, 0x09, 0x05, 0x3f, 0x14, 0xc2, 0x01, 0x36, 0x90, 0xfe, 0x5e, 0x0c, 0x02, 0x21, - 0x04, 0xfe, 0x9c, 0x00, 0x27, 0xfe, 0x3e, 0x12, 0x04, 0x51, 0x27, 0xfe, 0x36, 0x13, 0x47, 0x01, - 0xa4, 0x25, 0xfe, 0xf8, 0x05, 0x08, 0x05, 0x4a, 0x09, 0x17, 0xfe, 0x02, 0x12, 0x60, 0x01, 0xfe, - 0x88, 0x14, 0x1e, 0xfe, 0xee, 0x05, 0x11, 0x9b, 0x01, 0x45, 0x11, 0xfe, 0xe5, 0x00, 0x04, 0x51, - 0xb1, 0x0c, 0x51, 0x04, 0xc4, 0x27, 0xfe, 0x62, 0x12, 0x04, 0x42, 0x27, 0xfe, 0x5a, 0x13, 0x01, - 0xfe, 0xee, 0x17, 0x01, 0xfe, 0x40, 0x18, 0xfe, 0x43, 0x48, 0xb5, 0x17, 0x13, 0x6c, 0xff, 0x02, - 0x00, 0x57, 0x49, 0x8c, 0x1c, 0x40, 0x84, 0xb5, 0x69, 0x47, 0x01, 0xa4, 0x25, 0xfe, 0x62, 0x06, - 0x4a, 0x09, 0x1b, 0xde, 0x8b, 0x08, 0x4e, 0x01, 0xe2, 0x1e, 0xfe, 0x58, 0x06, 0x11, 0x9b, 0x01, - 0x45, 0x11, 0xfe, 0xe5, 0x00, 0x04, 0x42, 0xb1, 0x0c, 0x42, 0x16, 0x05, 0x01, 0xa4, 0xe9, 0x71, - 0x6f, 0x01, 0x85, 0x89, 0x11, 0xfe, 0xe2, 0x00, 0x01, 0x07, 0x24, 0x33, 0xfe, 0x0a, 0xf0, 0xfe, - 0x96, 0x06, 0x8d, 0xfe, 0x4c, 0x07, 0xfe, 0x06, 0xf0, 0xfe, 0x54, 0x07, 0x8e, 0x81, 0x02, 0x21, - 0x0b, 0x09, 0x0a, 0xfe, 0x2e, 0x12, 0x15, 0x1a, 0x01, 0x07, 0x15, 0x00, 0x01, 0x07, 0x15, 0x00, - 0x01, 0x07, 0x15, 0x00, 0x01, 0x07, 0xfe, 0x99, 0xa4, 0x01, 0x07, 0x15, 0x00, 0x02, 0xfe, 0x22, - 0x08, 0x75, 0x09, 0x1b, 0xfe, 0x38, 0x12, 0x0b, 0x09, 0x1b, 0x86, 0x15, 0xfe, 0x1b, 0x00, 0x01, - 0x07, 0x15, 0x00, 0x01, 0x07, 0x15, 0x00, 0x01, 0x07, 0x15, 0x00, 0x01, 0x07, 0x15, 0x05, 0x01, - 0x07, 0x15, 0x00, 0x02, 0xd7, 0x66, 0x4d, 0xfe, 0x3a, 0x55, 0x60, 0xfe, 0x9a, 0x81, 0x4c, 0x2c, - 0xb8, 0xfe, 0x22, 0x07, 0x08, 0x2c, 0xfe, 0x09, 0x6f, 0xac, 0xfe, 0xca, 0x45, 0xfe, 0x32, 0x12, - 0x62, 0x2b, 0x84, 0x66, 0x7b, 0x01, 0x07, 0x24, 0x33, 0xfe, 0x0a, 0xf0, 0xfe, 0x22, 0x07, 0x8e, - 0x81, 0x8d, 0xfe, 0x4c, 0x07, 0x02, 0x21, 0x01, 0x45, 0x02, 0xfe, 0x7a, 0x06, 0x15, 0x17, 0x02, - 0xfe, 0x7a, 0x06, 0xfe, 0x9c, 0xf7, 0xd2, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x77, 0xfe, 0xba, - 0x07, 0x0c, 0x55, 0x19, 0x56, 0x0b, 0x4b, 0x6a, 0x38, 0x1d, 0x1f, 0x06, 0x10, 0xfe, 0x0e, 0x12, - 0x73, 0xfe, 0x80, 0x80, 0x3a, 0x1f, 0x63, 0x26, 0xfe, 0x06, 0x10, 0xfe, 0x83, 0xe7, 0xc2, 0x34, - 0xfe, 0x03, 0x40, 0x0b, 0x4b, 0x50, 0x38, 0x01, 0xa5, 0xaa, 0xfe, 0x1f, 0x40, 0x12, 0x59, 0x01, - 0x86, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, 0xfe, 0xc6, 0x51, 0x35, 0xf8, 0xfe, - 0x8a, 0x90, 0x0c, 0x53, 0x19, 0x54, 0xfe, 0x0c, 0x90, 0xfe, 0x8e, 0x90, 0xfe, 0x40, 0x50, 0xfe, - 0xc2, 0x50, 0x0c, 0x3d, 0x19, 0x3e, 0xfe, 0x4a, 0x10, 0x0b, 0x09, 0x6a, 0xfe, 0x2a, 0x12, 0xfe, - 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x0c, 0x55, 0x19, 0x56, 0x0b, 0x09, 0x50, 0x84, 0x01, 0xa5, 0xfe, - 0x1f, 0x80, 0x12, 0x59, 0xfe, 0x44, 0x90, 0xfe, 0xc6, 0x90, 0x0c, 0x57, 0x19, 0x58, 0xf8, 0xfe, - 0x8a, 0x90, 0x0c, 0x53, 0x19, 0x54, 0xfe, 0x40, 0x90, 0xfe, 0xc2, 0x90, 0x0c, 0x3d, 0x19, 0x3e, - 0x0c, 0x3b, 0x19, 0x4f, 0x0b, 0x4b, 0x17, 0x38, 0x29, 0x13, 0xfe, 0x4e, 0x11, 0x65, 0xfe, 0x38, - 0x08, 0xfe, 0x9e, 0xf0, 0xfe, 0x4c, 0x08, 0xae, 0x18, 0x33, 0x29, 0x72, 0xdc, 0xb6, 0xfe, 0x70, - 0x08, 0xb7, 0xfe, 0x8e, 0x08, 0x8d, 0xfe, 0x64, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x6a, 0x08, 0x8e, - 0x81, 0x02, 0x21, 0x01, 0x45, 0xfe, 0xc9, 0x10, 0x15, 0x17, 0xfe, 0xc9, 0x10, 0x75, 0x09, 0x05, - 0xfe, 0x10, 0x12, 0x75, 0x09, 0x0a, 0x5c, 0x0b, 0x09, 0x0a, 0xfe, 0x68, 0x12, 0xfe, 0x2e, 0x1c, - 0x02, 0xfe, 0x14, 0x0a, 0x75, 0x09, 0x05, 0x5c, 0x75, 0x09, 0x0a, 0xfe, 0x52, 0x12, 0xfe, 0x2c, - 0x1c, 0xfe, 0xaa, 0xf0, 0xfe, 0x0e, 0x09, 0xfe, 0xac, 0xf0, 0xfe, 0xae, 0x08, 0xfe, 0x8a, 0x10, - 0xa7, 0xfe, 0xf3, 0x10, 0xfe, 0xad, 0xf0, 0xfe, 0xba, 0x08, 0x02, 0xfe, 0x14, 0x0a, 0xa8, 0xfe, - 0xe7, 0x10, 0xfe, 0x2b, 0xf0, 0x9e, 0xe6, 0x1c, 0xfe, 0x00, 0xfe, 0xfe, 0x1c, 0x12, 0xb2, 0xfe, - 0xd2, 0xf0, 0x9e, 0xfe, 0x76, 0x18, 0x1c, 0x1a, 0x18, 0x9e, 0x04, 0xc9, 0x1c, 0x05, 0x18, 0x9e, - 0xb6, 0x6d, 0xb7, 0x6d, 0xa7, 0xa8, 0xfe, 0xb1, 0x10, 0x6f, 0x5e, 0x2a, 0x14, 0x93, 0x01, 0x36, - 0x0f, 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, 0x5b, 0x0f, 0x7c, 0x02, 0x5b, 0xfe, 0x74, 0x18, 0x1c, - 0xfe, 0x00, 0xf8, 0x18, 0x6d, 0x67, 0x1b, 0x01, 0xfe, 0x28, 0x0d, 0x3f, 0x01, 0xe3, 0x1d, 0x26, - 0x73, 0x67, 0x1a, 0x02, 0x6d, 0xfe, 0x98, 0x80, 0xfb, 0x0a, 0x20, 0xfe, 0xf6, 0x09, 0x0b, 0x09, - 0x6a, 0xfe, 0x82, 0x12, 0x0b, 0x09, 0x17, 0xfe, 0x66, 0x13, 0x1d, 0x59, 0xa9, 0xf9, 0xfe, 0x83, - 0x80, 0xfe, 0xc8, 0x44, 0xfe, 0x2e, 0x13, 0xfe, 0x04, 0x91, 0xfe, 0x86, 0x91, 0x63, 0x26, 0xfe, - 0x40, 0x59, 0xfe, 0xc1, 0x59, 0x77, 0xd5, 0x04, 0x55, 0x32, 0x56, 0x0c, 0x7b, 0x19, 0x7c, 0xbc, - 0x55, 0xbd, 0x56, 0x01, 0xa5, 0xaa, 0x63, 0x26, 0x12, 0x59, 0xbe, 0x3b, 0xbf, 0x4f, 0x79, 0x57, - 0x68, 0x58, 0xf1, 0xf2, 0xfe, 0x04, 0xfa, 0x3b, 0xfe, 0x05, 0xfa, 0x4f, 0x01, 0x86, 0xfe, 0x36, - 0x10, 0x22, 0x0c, 0x7b, 0x0c, 0x7c, 0x79, 0x57, 0x68, 0x58, 0xfe, 0x12, 0x10, 0x0b, 0x09, 0x17, - 0x18, 0xd5, 0x79, 0x3d, 0x68, 0x3e, 0x0b, 0x09, 0xfe, 0xf7, 0x00, 0x38, 0x04, 0x53, 0x32, 0x54, - 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, 0xfe, 0x14, 0x59, 0xfe, 0x95, 0x59, 0x02, 0x6d, 0x0b, 0x09, - 0x17, 0x18, 0xd5, 0x0b, 0x09, 0xfe, 0xf7, 0x00, 0x38, 0xfe, 0x3a, 0x55, 0xfe, 0x19, 0x81, 0x60, - 0xfe, 0x10, 0x90, 0xfe, 0x92, 0x90, 0xfe, 0xd7, 0x10, 0x30, 0x06, 0x9c, 0x18, 0xfe, 0xb6, 0x08, - 0x11, 0x9c, 0xfe, 0x98, 0x80, 0xfb, 0x0a, 0xfe, 0x14, 0x13, 0x04, 0x3d, 0x32, 0x3e, 0x77, 0xfe, - 0xb6, 0x08, 0xfe, 0x0c, 0x58, 0xfe, 0x8d, 0x58, 0x02, 0x6d, 0x22, 0x47, 0xfe, 0x19, 0x80, 0xdd, - 0x0b, 0x09, 0x0a, 0xfe, 0x1a, 0x12, 0xfe, 0x6c, 0x19, 0xfe, 0x19, 0x41, 0xe6, 0xb2, 0xfe, 0xd1, - 0xf0, 0xd7, 0x14, 0x7a, 0x01, 0x36, 0x0f, 0xfe, 0x44, 0x00, 0xfe, 0x8e, 0x10, 0xfe, 0x6c, 0x19, - 0xbc, 0x3d, 0xfe, 0xed, 0x19, 0xbd, 0x3e, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0xe6, 0x1c, 0xfe, - 0x00, 0xff, 0x37, 0xfe, 0x74, 0x10, 0xb2, 0xfe, 0xd2, 0xf0, 0xfe, 0xa2, 0x0a, 0xfe, 0x76, 0x18, - 0x1c, 0x1a, 0x83, 0x04, 0xc9, 0x1c, 0x05, 0xfe, 0x08, 0x13, 0x0f, 0xfe, 0x16, 0x00, 0x02, 0x5b, - 0xfe, 0xd1, 0xf0, 0xfe, 0xb4, 0x0a, 0x14, 0x7a, 0x01, 0x36, 0x0f, 0xfe, 0x17, 0x00, 0xfe, 0x42, - 0x10, 0xfe, 0xce, 0xf0, 0xfe, 0xba, 0x0a, 0xfe, 0x3c, 0x10, 0xfe, 0xcd, 0xf0, 0xfe, 0xc6, 0x0a, - 0x0f, 0xfe, 0x22, 0x00, 0x02, 0x5b, 0xfe, 0xcb, 0xf0, 0xfe, 0xd2, 0x0a, 0x0f, 0xfe, 0x24, 0x00, - 0x02, 0x5b, 0xfe, 0xd0, 0xf0, 0xfe, 0xdc, 0x0a, 0x0f, 0x94, 0xdb, 0xfe, 0xcf, 0xf0, 0xfe, 0xe6, - 0x0a, 0x0f, 0x4d, 0xfe, 0x10, 0x10, 0xfe, 0xcc, 0xf0, 0xd7, 0xfe, 0x84, 0x80, 0xfb, 0x17, 0x3f, - 0x0f, 0xfe, 0x12, 0x00, 0x29, 0x13, 0xfe, 0x4e, 0x11, 0x65, 0xfe, 0xfc, 0x0a, 0xfe, 0x9e, 0xf0, - 0xfe, 0x10, 0x0b, 0xae, 0x18, 0x33, 0x29, 0x72, 0xdc, 0xb6, 0x21, 0xb7, 0x21, 0x29, 0xe9, 0x65, - 0xfe, 0x1c, 0x0b, 0x24, 0x33, 0x8d, 0xfe, 0x38, 0x0b, 0x8e, 0x81, 0xb6, 0xd2, 0xb7, 0xd2, 0x02, - 0x21, 0x01, 0x45, 0xfe, 0xdb, 0x10, 0x11, 0xfe, 0xe8, 0x00, 0xa7, 0xa8, 0x6f, 0xba, 0x7d, 0xbb, - 0x7f, 0xfe, 0x89, 0xf0, 0x21, 0x31, 0x2f, 0xd6, 0xba, 0x7d, 0xbb, 0x7f, 0x01, 0x07, 0x1e, 0x21, - 0x31, 0x2f, 0xd4, 0xae, 0x5c, 0x0f, 0xfe, 0x42, 0x00, 0x02, 0x5b, 0x78, 0x05, 0xfe, 0x81, 0x49, - 0xfe, 0xa2, 0x12, 0x0b, 0x09, 0x0a, 0xfe, 0x44, 0x13, 0x0f, 0x00, 0x4c, 0x0a, 0xfe, 0x54, 0x12, - 0x4c, 0xfe, 0x28, 0x00, 0x20, 0xfe, 0x94, 0x0c, 0x08, 0x3c, 0x01, 0x0e, 0x06, 0x00, 0x46, 0x41, - 0xfe, 0x28, 0x00, 0xfe, 0xe2, 0x10, 0x01, 0xe4, 0x01, 0xe5, 0x08, 0x9a, 0x01, 0xfe, 0x16, 0x0e, - 0x5a, 0x11, 0x2d, 0x01, 0x6e, 0x02, 0x28, 0x0f, 0xfe, 0x44, 0x00, 0x4c, 0x0a, 0xde, 0x41, 0x0a, - 0xfe, 0xb4, 0x10, 0x01, 0x5d, 0x41, 0x0a, 0xfe, 0xaa, 0x10, 0x01, 0x5d, 0xfe, 0x19, 0x82, 0xfe, - 0x34, 0x46, 0xa2, 0x41, 0x0a, 0x0f, 0xfe, 0x43, 0x00, 0xfe, 0x96, 0x10, 0x0b, 0x4b, 0x0a, 0x38, - 0x01, 0xe4, 0x01, 0xe5, 0x5a, 0x11, 0x2d, 0x01, 0x6e, 0x67, 0x0a, 0x5a, 0x48, 0xb4, 0x02, 0xfe, - 0x32, 0x03, 0x0b, 0x09, 0x0a, 0x83, 0x41, 0x0a, 0x0f, 0x00, 0xfe, 0x5c, 0x10, 0x75, 0x09, 0x1b, - 0xfe, 0x58, 0x12, 0x0b, 0x09, 0x1b, 0xfe, 0x50, 0x13, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, - 0x4a, 0x0c, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x50, 0x0c, 0x0b, 0x4b, 0x1b, 0x38, 0xfe, - 0xa9, 0x10, 0x0f, 0xfe, 0x15, 0x00, 0xfe, 0x04, 0xe6, 0x0a, 0x60, 0xfe, 0x2e, 0x10, 0x0f, 0xfe, - 0x13, 0x00, 0xfe, 0x10, 0x10, 0x0f, 0xfe, 0x47, 0x00, 0x34, 0x0f, 0xfe, 0x41, 0x00, 0xa1, 0x0f, - 0xfe, 0x24, 0x00, 0x89, 0xa7, 0xa8, 0x6f, 0x04, 0x6b, 0x27, 0x20, 0xcf, 0x60, 0xfe, 0x04, 0xe6, - 0x1b, 0xfe, 0x9d, 0x41, 0xfe, 0x1c, 0x42, 0x5a, 0x01, 0xd8, 0x02, 0x28, 0xe7, 0x14, 0x0a, 0x3a, - 0x96, 0xa6, 0x14, 0xfe, 0x31, 0x00, 0x3a, 0x98, 0x01, 0xfe, 0x32, 0x0f, 0x02, 0xce, 0x48, 0xfe, - 0x06, 0xec, 0xc7, 0xeb, 0x41, 0x2c, 0xfe, 0xce, 0x45, 0x37, 0x48, 0xfe, 0x06, 0xea, 0xc7, 0xfe, - 0x47, 0x4b, 0x8b, 0xfe, 0x75, 0x57, 0x04, 0x52, 0xfe, 0x98, 0x56, 0xfe, 0x2e, 0x12, 0x08, 0x3c, - 0x01, 0x0e, 0x47, 0xfe, 0x41, 0x58, 0x08, 0x9a, 0x01, 0x0e, 0xfe, 0x49, 0x54, 0x8f, 0xfe, 0x0e, - 0x0d, 0x08, 0x44, 0x01, 0x0e, 0xfe, 0x44, 0x48, 0x02, 0xfe, 0x32, 0x03, 0x08, 0x52, 0x88, 0xeb, - 0x41, 0x2c, 0xfe, 0xce, 0x45, 0x37, 0x48, 0xfe, 0xce, 0x47, 0xfe, 0xb7, 0x13, 0x02, 0x28, 0x1d, - 0x1f, 0x06, 0x10, 0xfe, 0x9e, 0x12, 0x22, 0x12, 0x4e, 0x12, 0x95, 0x12, 0xcc, 0x1d, 0x2d, 0x47, - 0x3a, 0x2d, 0xae, 0xfe, 0x0c, 0x13, 0xfe, 0xbc, 0xf0, 0xfe, 0xd0, 0x0d, 0x13, 0x05, 0x12, 0x4e, - 0x01, 0xfe, 0xc0, 0x15, 0x04, 0xfe, 0x38, 0x01, 0x32, 0xfe, 0x3a, 0x01, 0x77, 0xfe, 0xd4, 0x0d, - 0xfe, 0x02, 0xec, 0xcc, 0x62, 0x00, 0x46, 0xfe, 0x04, 0xec, 0x1f, 0x5f, 0xfe, 0x05, 0xf6, 0xfe, - 0x34, 0x01, 0x01, 0xfe, 0x30, 0x16, 0xf8, 0xfe, 0x48, 0xf4, 0x0d, 0xfe, 0x18, 0x13, 0xac, 0xfe, - 0x02, 0xea, 0xcc, 0x62, 0x7a, 0xfe, 0xc5, 0x13, 0x14, 0x1b, 0x3a, 0x96, 0xa6, 0xfe, 0x2e, 0x10, - 0x04, 0xfe, 0x38, 0x01, 0x1c, 0xfe, 0xf0, 0xff, 0x0c, 0xfe, 0x60, 0x01, 0x04, 0xfe, 0x3a, 0x01, - 0x0c, 0xfe, 0x62, 0x01, 0x40, 0x12, 0x1f, 0x23, 0x05, 0x12, 0x2d, 0x11, 0x2d, 0xb4, 0x13, 0x05, - 0x03, 0x22, 0x03, 0x1d, 0x4e, 0xfe, 0xf7, 0x12, 0x1d, 0x95, 0xa9, 0x12, 0x95, 0x06, 0x7a, 0xfe, - 0x71, 0x13, 0xfe, 0x24, 0x1c, 0x14, 0x1a, 0x3a, 0x96, 0xa6, 0xfe, 0xd9, 0x10, 0xb3, 0xfe, 0x03, - 0xdc, 0xfe, 0x73, 0x57, 0xfe, 0x80, 0x5d, 0x03, 0xb3, 0xfe, 0x03, 0xdc, 0xfe, 0x5b, 0x57, 0xfe, - 0x80, 0x5d, 0x03, 0xfe, 0x03, 0x57, 0xb3, 0x22, 0xfa, 0x03, 0xfe, 0x03, 0x57, 0xb3, 0x74, 0x03, - 0x0b, 0x09, 0x4d, 0xfe, 0x22, 0x13, 0xfe, 0x1c, 0x80, 0x06, 0x05, 0xfe, 0x1a, 0x13, 0xfe, 0x1e, - 0x80, 0xdf, 0xfe, 0x1d, 0x80, 0xa3, 0xfe, 0x0c, 0x90, 0x85, 0xfe, 0x0e, 0x90, 0xa2, 0xfe, 0x3c, - 0x90, 0xfe, 0x30, 0xf4, 0x0a, 0xfe, 0x3c, 0x50, 0xa1, 0x01, 0xfe, 0x60, 0x16, 0x30, 0x06, 0x2d, - 0x46, 0x01, 0xfe, 0x9a, 0x15, 0xfe, 0x08, 0x10, 0x01, 0xe4, 0x01, 0xe5, 0x11, 0xfe, 0xe9, 0x00, - 0x0b, 0x09, 0x4d, 0xfe, 0x2c, 0x13, 0x01, 0xfe, 0xf2, 0x15, 0xfe, 0x1e, 0x1c, 0xfe, 0x14, 0x90, - 0x0c, 0xfe, 0x64, 0x01, 0xfe, 0x16, 0x90, 0x0c, 0xfe, 0x66, 0x01, 0x0b, 0x09, 0x50, 0xfe, 0x12, - 0x12, 0xfe, 0x03, 0x80, 0x73, 0xfe, 0x01, 0xec, 0x1f, 0xfe, 0x80, 0x40, 0x12, 0x1f, 0x63, 0x26, - 0x11, 0xc6, 0x5a, 0x1d, 0x1f, 0xea, 0x76, 0x1f, 0x03, 0xfe, 0x08, 0x1c, 0x04, 0xfe, 0xac, 0x00, - 0xfe, 0x06, 0x58, 0x04, 0xfe, 0xae, 0x00, 0xfe, 0x07, 0x58, 0x04, 0xfe, 0xb0, 0x00, 0xfe, 0x08, - 0x58, 0x04, 0xfe, 0xb2, 0x00, 0xfe, 0x09, 0x58, 0xfe, 0x0a, 0x1c, 0x23, 0x69, 0x12, 0xc7, 0x22, - 0x0c, 0x51, 0x0c, 0x42, 0x13, 0x3c, 0x49, 0x60, 0x16, 0x2c, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, - 0x20, 0xfe, 0xe6, 0x0e, 0x41, 0x10, 0x13, 0x44, 0x49, 0x16, 0x4d, 0xfe, 0x90, 0x4d, 0xfe, 0x91, - 0x54, 0x20, 0xfe, 0xfc, 0x0e, 0x23, 0x10, 0x12, 0x1f, 0x78, 0x2b, 0x5f, 0x1d, 0x1f, 0xea, 0x76, - 0x1f, 0x11, 0xc6, 0xf3, 0xfe, 0xd6, 0xf0, 0xfe, 0x10, 0x0f, 0xe7, 0x6f, 0xfe, 0x14, 0x1c, 0xfe, - 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x03, 0x48, 0xfe, 0x0c, 0x14, 0xeb, 0xfe, 0x07, 0xe6, 0x2c, 0xfe, - 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x03, 0x01, 0x5d, 0x78, 0x2b, 0x5f, 0xf7, 0xec, 0xfe, 0x42, 0x13, - 0x30, 0x06, 0x2d, 0xfe, 0x34, 0x13, 0x08, 0x44, 0x01, 0x0e, 0xad, 0xfe, 0x36, 0x12, 0xed, 0xfe, - 0x45, 0x48, 0x01, 0x87, 0xfa, 0xad, 0xfe, 0xf3, 0x13, 0x40, 0x74, 0x06, 0x10, 0xa2, 0x08, 0x80, - 0x01, 0x0e, 0xfe, 0x80, 0x5c, 0x01, 0x6e, 0xd9, 0x06, 0x7e, 0x5c, 0xf3, 0xfe, 0xd6, 0xf0, 0xfe, - 0x4a, 0x0f, 0x03, 0xfe, 0x44, 0x58, 0x73, 0xfe, 0x01, 0xec, 0x98, 0xfe, 0x9e, 0x40, 0xfe, 0x9d, - 0xe7, 0x00, 0xfe, 0x9c, 0xe7, 0x1b, 0x76, 0x26, 0x01, 0xd8, 0xfe, 0xdd, 0x10, 0x29, 0xba, 0x7d, - 0xbb, 0x7f, 0x31, 0x2f, 0xd3, 0x06, 0x1b, 0xfe, 0x48, 0x12, 0x06, 0x0a, 0xfe, 0x56, 0x12, 0x06, - 0x1a, 0xfe, 0x30, 0x12, 0x06, 0xc0, 0x18, 0xfe, 0x1c, 0x11, 0x06, 0xfe, 0x23, 0x00, 0x18, 0xfe, - 0x28, 0x11, 0x06, 0x05, 0x18, 0xfe, 0x86, 0x11, 0x06, 0x17, 0xfe, 0x12, 0x12, 0x06, 0x00, 0x18, - 0x21, 0x14, 0xc0, 0x01, 0x36, 0xa0, 0x2a, 0x01, 0x07, 0x8d, 0x45, 0x03, 0x2a, 0xfe, 0x62, 0x08, - 0x08, 0xc8, 0x01, 0xfe, 0x16, 0x0e, 0x11, 0x7e, 0x02, 0x28, 0x2a, 0x30, 0x06, 0x9c, 0xfe, 0xd9, - 0x13, 0x79, 0x3d, 0x68, 0x3e, 0x77, 0xfe, 0xda, 0x10, 0x0b, 0x09, 0x6a, 0xfe, 0x72, 0x12, 0xbe, - 0x3b, 0xbf, 0x4f, 0xf1, 0xf2, 0x8f, 0xfe, 0xa4, 0x10, 0x1d, 0x59, 0xfe, 0x26, 0x13, 0x04, 0x7b, - 0x32, 0x7c, 0x77, 0xfe, 0x70, 0x0c, 0x0c, 0x55, 0x19, 0x56, 0x22, 0x0c, 0x7b, 0x0c, 0x7c, 0x01, - 0xa5, 0x23, 0x69, 0x72, 0x12, 0x59, 0x01, 0x86, 0xbe, 0x3b, 0xbf, 0x4f, 0xfe, 0x04, 0x55, 0xfe, - 0xa5, 0x55, 0xfe, 0x04, 0xfa, 0x3b, 0xfe, 0x05, 0xfa, 0x4f, 0xfe, 0x91, 0x10, 0x04, 0x57, 0x32, - 0x58, 0xfe, 0x40, 0x56, 0xfe, 0xe1, 0x56, 0x0c, 0x57, 0x19, 0x58, 0x35, 0xbe, 0x3b, 0xbf, 0x4f, - 0xf1, 0xf2, 0x04, 0x53, 0x32, 0x54, 0xfe, 0x00, 0x56, 0xfe, 0xa1, 0x56, 0x0c, 0x53, 0x19, 0x54, - 0x0b, 0x09, 0x6a, 0xfe, 0x1e, 0x12, 0x1d, 0x59, 0xfe, 0x1f, 0x40, 0x04, 0x55, 0x32, 0x56, 0xfe, - 0x2c, 0x50, 0xfe, 0xae, 0x50, 0x04, 0x57, 0x32, 0x58, 0xfe, 0x44, 0x50, 0xfe, 0xc6, 0x50, 0x04, - 0x53, 0x32, 0x54, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0x04, 0x3d, 0x32, 0x3e, 0xfe, 0x40, 0x50, - 0xfe, 0xc2, 0x50, 0x02, 0x35, 0x23, 0x05, 0x12, 0xcb, 0x02, 0x34, 0x2a, 0x01, 0x07, 0x1e, 0x2e, - 0x31, 0x2f, 0xd3, 0x06, 0x05, 0x20, 0x2e, 0x30, 0x06, 0x9c, 0x20, 0x34, 0x01, 0x85, 0x1c, 0x40, - 0x18, 0x2e, 0x0b, 0x09, 0x0a, 0x5d, 0x79, 0x3d, 0x68, 0x3e, 0xfe, 0x0a, 0x55, 0x37, 0xfe, 0x8b, - 0x55, 0xbc, 0x3d, 0xbd, 0x3e, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0x02, 0x34, 0xfe, 0x19, 0x81, - 0xac, 0xfe, 0x19, 0x41, 0x02, 0x34, 0x2a, 0x01, 0x07, 0x24, 0x33, 0x1e, 0xda, 0x31, 0x2f, 0xd6, - 0x4c, 0x1a, 0xfe, 0xa6, 0x12, 0x4c, 0x0a, 0x3f, 0x02, 0x2e, 0x01, 0x07, 0x24, 0x33, 0x1e, 0xda, - 0x31, 0x2f, 0xd4, 0x06, 0x1a, 0x20, 0x2e, 0x01, 0x07, 0x1e, 0xda, 0x31, 0x2f, 0xfe, 0xe8, 0x09, - 0xfe, 0xc2, 0x49, 0x61, 0x04, 0xfe, 0x9c, 0x00, 0x27, 0x83, 0x4a, 0x09, 0x17, 0x37, 0xa0, 0xfe, - 0xbb, 0x45, 0x4c, 0x00, 0x5c, 0x41, 0x05, 0x78, 0x40, 0xfe, 0xda, 0x14, 0x01, 0x85, 0x89, 0xfe, - 0x4b, 0x45, 0x5d, 0x30, 0x06, 0x9b, 0xdf, 0x04, 0xc4, 0x27, 0x83, 0x04, 0x42, 0x27, 0x37, 0x5e, - 0x02, 0x34, 0xfe, 0xc0, 0x5d, 0xfe, 0xf8, 0x14, 0xfe, 0x03, 0x17, 0x04, 0x51, 0xb1, 0x0c, 0x51, - 0x5e, 0x2a, 0x01, 0x07, 0x25, 0x35, 0x01, 0xfe, 0x88, 0x14, 0x02, 0x35, 0x01, 0x07, 0x24, 0x33, - 0x1e, 0x2e, 0x31, 0x2f, 0xd4, 0x06, 0x05, 0x20, 0x2e, 0x01, 0xfe, 0x6c, 0x13, 0xfe, 0x42, 0x58, - 0xfe, 0x82, 0x14, 0xfe, 0xa4, 0x14, 0x89, 0xfe, 0x4a, 0xf4, 0x0a, 0x18, 0x2e, 0xfe, 0x4a, 0xf4, - 0x05, 0xfe, 0x0c, 0x12, 0x30, 0x06, 0x9b, 0x84, 0x02, 0x34, 0x04, 0x42, 0xb1, 0x0c, 0x42, 0x5e, - 0x2a, 0x01, 0x07, 0x25, 0x35, 0x01, 0xe2, 0x02, 0x35, 0x13, 0x05, 0x65, 0xfe, 0xa8, 0x12, 0x25, - 0xfe, 0xbe, 0x12, 0x71, 0xee, 0x01, 0x07, 0x22, 0x71, 0x03, 0x90, 0xfe, 0xba, 0x12, 0x24, 0xfe, - 0xba, 0x12, 0x1e, 0xfe, 0xa8, 0x12, 0x5e, 0x2a, 0x01, 0x07, 0xfe, 0xd5, 0x10, 0x13, 0x6c, 0xff, - 0x02, 0x00, 0x57, 0x49, 0x8c, 0x1c, 0xfe, 0xff, 0x7f, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x03, - 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x49, 0x8c, 0x1c, 0x40, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, - 0x03, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x49, 0x8c, 0x03, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, - 0x49, 0x8c, 0xfe, 0x0b, 0x58, 0x03, 0x08, 0x51, 0x01, 0x82, 0x08, 0x42, 0x01, 0x82, 0x03, 0xf9, - 0x1c, 0x10, 0xff, 0x03, 0x00, 0x54, 0xfe, 0x00, 0xf4, 0x17, 0x49, 0xfe, 0x00, 0x7d, 0xfe, 0x01, - 0x7d, 0xfe, 0x02, 0x7d, 0xfe, 0x03, 0x7c, 0x63, 0x26, 0x0c, 0x53, 0x19, 0x54, 0xbc, 0x57, 0xbd, - 0x58, 0x03, 0xfe, 0x62, 0x08, 0xfe, 0x82, 0x4a, 0xfe, 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x73, 0x03, - 0x01, 0xfe, 0xee, 0x17, 0xfe, 0x42, 0x48, 0x60, 0x61, 0x8b, 0x01, 0x07, 0x1e, 0xfe, 0x80, 0x14, - 0x31, 0x2f, 0xd6, 0x01, 0x07, 0x1e, 0xfe, 0x80, 0x14, 0x31, 0x2f, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, - 0x59, 0x04, 0xc4, 0x27, 0xfe, 0xcc, 0x12, 0x4a, 0x09, 0x1b, 0xfe, 0xc4, 0x13, 0x22, 0x62, 0x1b, - 0x5d, 0x4c, 0xc1, 0x64, 0xfe, 0xc6, 0x13, 0x3f, 0x13, 0x05, 0x16, 0xc1, 0x78, 0x2e, 0xfe, 0x78, - 0x10, 0xff, 0x02, 0x83, 0x55, 0x34, 0xff, 0x02, 0x83, 0x55, 0x62, 0x1a, 0xa3, 0xb9, 0xfe, 0x30, - 0x00, 0x8f, 0xe0, 0x16, 0x2b, 0x13, 0x05, 0xfe, 0x56, 0x10, 0x62, 0x0a, 0xdf, 0xb9, 0xfe, 0x64, - 0x00, 0x8f, 0xe0, 0x08, 0xfe, 0x64, 0x00, 0x16, 0x94, 0x13, 0x05, 0xfe, 0x28, 0x10, 0x62, 0x05, - 0x87, 0xb9, 0xfe, 0xc8, 0x00, 0x8f, 0xe0, 0x08, 0xfe, 0xc8, 0x00, 0x16, 0x4e, 0x13, 0x05, 0x35, - 0xb9, 0xfe, 0x90, 0x01, 0xb8, 0xfe, 0x2c, 0x14, 0x8b, 0xfe, 0x12, 0x10, 0xfe, 0x43, 0xf4, 0x95, - 0xfe, 0x56, 0xf0, 0xfe, 0x3e, 0x14, 0xfe, 0x04, 0xf4, 0x6c, 0xfe, 0x43, 0xf4, 0x94, 0xfe, 0xf3, - 0x10, 0xf6, 0x01, 0xfe, 0x00, 0x13, 0x1c, 0x40, 0xfe, 0x10, 0x13, 0xfe, 0x00, 0x17, 0xfe, 0x4d, - 0xe4, 0x69, 0xb8, 0xfe, 0x7a, 0x14, 0xb5, 0x69, 0xfe, 0x1c, 0x10, 0xfe, 0x00, 0x17, 0xfe, 0x4d, - 0xe4, 0x17, 0xb8, 0xfe, 0x7a, 0x14, 0xb5, 0x17, 0x35, 0x61, 0x22, 0xfe, 0x4d, 0xf4, 0x00, 0xde, - 0x8b, 0x13, 0x05, 0xfe, 0xb4, 0x56, 0xfe, 0xc3, 0x58, 0x03, 0x61, 0x13, 0x0a, 0x03, 0x15, 0x05, - 0x01, 0x07, 0x25, 0xe1, 0x15, 0x0a, 0x01, 0x07, 0x25, 0xe1, 0x15, 0x1a, 0x01, 0x07, 0x25, 0xe1, - 0x71, 0xfe, 0x89, 0x49, 0x01, 0x07, 0x03, 0x15, 0x05, 0x01, 0x07, 0x25, 0x88, 0x15, 0x1a, 0x01, - 0x07, 0x25, 0x88, 0x15, 0x05, 0x01, 0x07, 0x25, 0x88, 0xfe, 0x89, 0x49, 0x01, 0x07, 0x25, 0x88, - 0x71, 0xfe, 0x89, 0x4a, 0x01, 0x07, 0x03, 0x61, 0x03, 0x1d, 0xca, 0x06, 0x05, 0xfe, 0x44, 0x13, - 0xaa, 0x12, 0xca, 0xfe, 0x49, 0xf4, 0x00, 0x3f, 0x71, 0xa0, 0x5e, 0xfe, 0x01, 0xec, 0xfe, 0x27, - 0x01, 0xee, 0x01, 0x07, 0x30, 0x06, 0xfe, 0xe3, 0x00, 0xfe, 0x20, 0x13, 0x1e, 0xfe, 0x38, 0x15, - 0x22, 0x12, 0xcb, 0x01, 0x45, 0x1d, 0xcb, 0x06, 0x05, 0x5c, 0x0b, 0x4b, 0x05, 0x38, 0x03, 0x08, - 0x44, 0x01, 0x0e, 0xea, 0x8a, 0x06, 0x10, 0xa3, 0x08, 0x80, 0x01, 0x0e, 0x8a, 0x08, 0x52, 0x01, - 0x9f, 0x03, 0x08, 0x80, 0x01, 0x0e, 0x8a, 0xfe, 0x80, 0xe7, 0x10, 0x06, 0x10, 0x83, 0xfe, 0x45, - 0x58, 0x01, 0x87, 0x8a, 0x03, 0x08, 0x44, 0x01, 0x0e, 0x8a, 0x08, 0x52, 0x01, 0x9f, 0x03, 0x08, - 0x44, 0x01, 0x0e, 0xfe, 0x80, 0x80, 0xef, 0xfe, 0x49, 0xe4, 0x10, 0xa3, 0x08, 0x80, 0x01, 0x0e, - 0xef, 0x08, 0x52, 0x01, 0x82, 0x03, 0x16, 0x10, 0x70, 0x66, 0xfe, 0x60, 0x01, 0xfe, 0x18, 0xdf, - 0xfe, 0x19, 0xde, 0xfe, 0x24, 0x1c, 0xfe, 0x1d, 0xf7, 0x2c, 0x91, 0xfe, 0xd4, 0x15, 0x01, 0xfe, - 0xda, 0x16, 0xfe, 0x0c, 0x13, 0x92, 0x2c, 0x66, 0xfe, 0x2c, 0x01, 0xfe, 0x2f, 0x19, 0x03, 0xab, - 0x20, 0xfe, 0xc4, 0x15, 0xfe, 0xda, 0x10, 0x16, 0x10, 0x70, 0x04, 0xfe, 0x64, 0x01, 0xfe, 0x00, - 0xf4, 0x17, 0xfe, 0x18, 0x58, 0x04, 0xfe, 0x66, 0x01, 0xfe, 0x19, 0x58, 0x92, 0x17, 0xfe, 0x3c, - 0x90, 0xfe, 0x30, 0xf4, 0x05, 0xfe, 0x3c, 0x50, 0x66, 0xfe, 0x38, 0x00, 0xfe, 0x0f, 0x79, 0xfe, - 0x1c, 0xf7, 0x17, 0x91, 0xfe, 0x1e, 0x16, 0xe2, 0x37, 0x03, 0xab, 0x20, 0xfe, 0xf6, 0x15, 0xfe, - 0x9c, 0x10, 0x16, 0x10, 0x70, 0xfe, 0x83, 0x5a, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, - 0xf7, 0x3b, 0x91, 0xfe, 0x40, 0x16, 0xfe, 0x94, 0x14, 0xfe, 0x10, 0x13, 0x92, 0x3b, 0x66, 0x1b, - 0xfe, 0xaf, 0x19, 0xfe, 0x98, 0xe7, 0x00, 0x03, 0xab, 0x20, 0xfe, 0x34, 0x16, 0xfe, 0x6c, 0x10, - 0x16, 0x10, 0x70, 0xfe, 0x30, 0xbc, 0xfe, 0xb2, 0xbc, 0x92, 0xc3, 0x66, 0x1b, 0xfe, 0x0f, 0x79, - 0xfe, 0x1c, 0xf7, 0xc3, 0x91, 0xfe, 0x78, 0x16, 0xfe, 0x5c, 0x14, 0x37, 0x03, 0xab, 0x20, 0xfe, - 0x64, 0x16, 0xfe, 0x42, 0x10, 0xfe, 0x02, 0xf6, 0x10, 0x70, 0xfe, 0x18, 0xfe, 0x55, 0xfe, 0x19, - 0xfe, 0x56, 0xf9, 0xfe, 0x1d, 0xf7, 0x50, 0x91, 0xfe, 0x9e, 0x16, 0xfe, 0x36, 0x14, 0xfe, 0x1c, - 0x13, 0x92, 0x50, 0x47, 0xfe, 0x83, 0x58, 0xfe, 0xaf, 0x19, 0xfe, 0x80, 0xe7, 0x10, 0xfe, 0x81, - 0xe7, 0x10, 0x11, 0xfe, 0xdd, 0x00, 0x63, 0x26, 0x03, 0x63, 0x26, 0xfe, 0x12, 0x45, 0x20, 0xfe, - 0x8e, 0x16, 0x14, 0x05, 0x3a, 0x96, 0xa6, 0x02, 0x28, 0xfe, 0x39, 0xf0, 0xfe, 0xe2, 0x16, 0x22, - 0x03, 0xfe, 0x7e, 0x18, 0x1c, 0x1a, 0x46, 0x13, 0x0d, 0x03, 0x70, 0x04, 0xc9, 0x1c, 0x05, 0xfe, - 0xef, 0x12, 0xfe, 0xe1, 0x10, 0x78, 0x2b, 0x5f, 0x30, 0x06, 0x2d, 0xfe, 0x3c, 0x13, 0xfe, 0x7e, - 0x14, 0xfe, 0x42, 0x13, 0x48, 0xb4, 0x08, 0x44, 0x01, 0x0e, 0xad, 0xfe, 0x3e, 0x12, 0xed, 0xfe, - 0x45, 0x48, 0x01, 0x87, 0xfa, 0xad, 0xfe, 0xf3, 0x13, 0x40, 0x74, 0x06, 0x10, 0xa2, 0x08, 0x80, - 0x01, 0x0e, 0xef, 0x01, 0x6e, 0xfe, 0x16, 0x10, 0x06, 0x7e, 0x84, 0xfe, 0x3c, 0x14, 0xfe, 0x24, - 0x12, 0xf3, 0xfe, 0xd6, 0xf0, 0xfe, 0x02, 0x17, 0x16, 0x0a, 0x03, 0xfe, 0x9c, 0xe7, 0x0a, 0x0f, - 0xfe, 0x15, 0x00, 0x5a, 0x76, 0x26, 0x01, 0xd8, 0x16, 0x05, 0x03, 0x0b, 0x4b, 0x2c, 0x38, 0x11, - 0x2d, 0x01, 0x6e, 0x16, 0x05, 0x03, 0xfe, 0x38, 0x90, 0xfe, 0xba, 0x90, 0x79, 0xc5, 0x68, 0xc6, - 0xfe, 0x48, 0x55, 0x37, 0xfe, 0xc9, 0x55, 0x03, 0x1d, 0x99, 0x72, 0x12, 0x99, 0x03, 0x08, 0x9a, - 0x01, 0x0e, 0xed, 0x08, 0x3c, 0x01, 0x0e, 0xfe, 0x49, 0x44, 0x18, 0xfe, 0xca, 0x17, 0x72, 0x74, - 0x03, 0x08, 0x44, 0x01, 0x0e, 0x06, 0x10, 0x5c, 0x08, 0x52, 0x01, 0x9f, 0x08, 0x3c, 0x01, 0x0e, - 0x72, 0x74, 0x03, 0xfc, 0x1a, 0x64, 0xfe, 0xfe, 0x17, 0x04, 0xfe, 0x90, 0x00, 0xfe, 0x3a, 0x45, - 0xfe, 0x2c, 0x10, 0xfc, 0xc0, 0x64, 0xfe, 0x10, 0x18, 0x04, 0xfe, 0x92, 0x00, 0xfe, 0x02, 0xe6, - 0x1b, 0xdb, 0xfc, 0xfe, 0x0b, 0x00, 0x64, 0xfe, 0x22, 0x18, 0x04, 0xfe, 0x94, 0x00, 0xfe, 0x02, - 0xe6, 0x17, 0xfe, 0x08, 0x10, 0x04, 0xfe, 0x96, 0x00, 0xfe, 0x02, 0xe6, 0x2b, 0xfe, 0x4e, 0x45, - 0xfe, 0x0c, 0x12, 0xac, 0xff, 0x04, 0x68, 0x54, 0xdd, 0x1c, 0x69, 0x03, 0x06, 0x7a, 0xfe, 0x5a, - 0xf0, 0xfe, 0x4e, 0x18, 0x23, 0xfe, 0x09, 0x00, 0xfe, 0x34, 0x10, 0x06, 0x1b, 0xfe, 0x5a, 0xf0, - 0xfe, 0x5c, 0x18, 0x23, 0xc1, 0xfe, 0x26, 0x10, 0x06, 0x1a, 0x46, 0x23, 0x2b, 0xdb, 0x06, 0x0a, - 0x46, 0x23, 0x94, 0xd9, 0x06, 0x05, 0x46, 0x23, 0x4e, 0xa0, 0xaa, 0x03, 0x14, 0xfe, 0x09, 0x00, - 0x01, 0x36, 0xfe, 0x04, 0xfe, 0x7d, 0x04, 0x7f, 0xf6, 0x03, 0x24, 0xfe, 0xa4, 0x18, 0xfe, 0x14, - 0xf0, 0x07, 0x65, 0xfe, 0xa0, 0x18, 0x03, 0xff, 0x2d, 0x00, 0x00, + 0xf0, 0xfe, 0x48, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x4c, 0x02, 0x17, 0x0b, 0xa0, 0x17, 0x06, 0x18, + 0x96, 0x02, 0x29, 0xfe, 0x00, 0x1c, 0xde, 0xfe, 0x02, 0x1c, 0xdd, 0xfe, 0x1e, 0x1c, 0xfe, 0xe9, + 0x10, 0x01, 0xfe, 0x20, 0x17, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xc7, 0x0a, 0x6b, 0x01, 0x9e, + 0x02, 0x29, 0x14, 0x4d, 0x37, 0x97, 0x01, 0xfe, 0x64, 0x0f, 0x0a, 0x6b, 0x01, 0x82, 0xfe, 0xbd, + 0x10, 0x0a, 0x6b, 0x01, 0x82, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x17, 0x06, + 0x18, 0x96, 0x2a, 0x25, 0x29, 0xfe, 0x3d, 0xf0, 0xfe, 0x02, 0x02, 0x21, 0xfe, 0x94, 0x02, 0xfe, + 0x5a, 0x1c, 0xea, 0xfe, 0x14, 0x1c, 0x14, 0xfe, 0x30, 0x00, 0x37, 0x97, 0x01, 0xfe, 0x54, 0x0f, + 0x17, 0x06, 0x18, 0x96, 0x02, 0xd0, 0x1e, 0x20, 0x07, 0x10, 0x34, 0xfe, 0x69, 0x10, 0x17, 0x06, + 0x18, 0x96, 0xfe, 0x04, 0xec, 0x20, 0x46, 0x3d, 0x12, 0x20, 0xfe, 0x05, 0xf6, 0xc7, 0x01, 0xfe, + 0x52, 0x16, 0x09, 0x4a, 0x4c, 0x35, 0x11, 0x2d, 0x3c, 0x8a, 0x01, 0xe6, 0x02, 0x29, 0x0a, 0x40, + 0x01, 0x0e, 0x07, 0x00, 0x5d, 0x01, 0x6f, 0xfe, 0x18, 0x10, 0xfe, 0x41, 0x58, 0x0a, 0x99, 0x01, + 0x0e, 0xfe, 0xc8, 0x54, 0x64, 0xfe, 0x0c, 0x03, 0x01, 0xe6, 0x02, 0x29, 0x2a, 0x46, 0xfe, 0x02, + 0xe8, 0x27, 0xf8, 0xfe, 0x9e, 0x43, 0xf7, 0xfe, 0x27, 0xf0, 0xfe, 0xdc, 0x01, 0xfe, 0x07, 0x4b, + 0xfe, 0x20, 0xf0, 0x9c, 0xfe, 0x40, 0x1c, 0x25, 0xd2, 0xfe, 0x26, 0xf0, 0xfe, 0x56, 0x03, 0xfe, + 0xa0, 0xf0, 0xfe, 0x44, 0x03, 0xfe, 0x11, 0xf0, 0x9c, 0xfe, 0xef, 0x10, 0xfe, 0x9f, 0xf0, 0xfe, + 0x64, 0x03, 0xeb, 0x0f, 0xfe, 0x11, 0x00, 0x02, 0x5a, 0x2a, 0xfe, 0x48, 0x1c, 0xeb, 0x09, 0x04, + 0x1d, 0xfe, 0x18, 0x13, 0x23, 0x1e, 0x98, 0xac, 0x12, 0x98, 0x0a, 0x40, 0x01, 0x0e, 0xac, 0x75, + 0x01, 0xfe, 0xbc, 0x15, 0x11, 0xca, 0x25, 0xd2, 0xfe, 0x01, 0xf0, 0xd2, 0xfe, 0x82, 0xf0, 0xfe, + 0x92, 0x03, 0xec, 0x11, 0xfe, 0xe4, 0x00, 0x65, 0xfe, 0xa4, 0x03, 0x25, 0x32, 0x1f, 0xfe, 0xb4, + 0x03, 0x01, 0x43, 0xfe, 0x06, 0xf0, 0xfe, 0xc4, 0x03, 0x8d, 0x81, 0xfe, 0x0a, 0xf0, 0xfe, 0x7a, + 0x06, 0x02, 0x22, 0x05, 0x6b, 0x28, 0x16, 0xfe, 0xf6, 0x04, 0x14, 0x2c, 0x01, 0x33, 0x8f, 0xfe, + 0x66, 0x02, 0x02, 0xd1, 0xeb, 0x2a, 0x67, 0x1a, 0xfe, 0x67, 0x1b, 0xf8, 0xf7, 0xfe, 0x48, 0x1c, + 0x70, 0x01, 0x6e, 0x87, 0x0a, 0x40, 0x01, 0x0e, 0x07, 0x00, 0x16, 0xd3, 0x0a, 0xca, 0x01, 0x0e, + 0x74, 0x60, 0x59, 0x76, 0x27, 0x05, 0x6b, 0x28, 0xfe, 0x10, 0x12, 0x14, 0x2c, 0x01, 0x33, 0x8f, + 0xfe, 0x66, 0x02, 0x02, 0xd1, 0xbc, 0x7d, 0xbd, 0x7f, 0x25, 0x22, 0x65, 0xfe, 0x3c, 0x04, 0x1f, + 0xfe, 0x38, 0x04, 0x68, 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x4e, 0x12, 0x2b, 0xff, 0x02, + 0x00, 0x10, 0x01, 0x08, 0x1f, 0xfe, 0xe0, 0x04, 0x2b, 0x01, 0x08, 0x1f, 0x22, 0x30, 0x2e, 0xd5, + 0xfe, 0x4c, 0x44, 0xfe, 0x4c, 0x12, 0x60, 0xfe, 0x44, 0x48, 0x13, 0x2c, 0xfe, 0x4c, 0x54, 0x64, + 0xd3, 0x46, 0x76, 0x27, 0xfa, 0xef, 0xfe, 0x62, 0x13, 0x09, 0x04, 0x1d, 0xfe, 0x2a, 0x13, 0x2f, + 0x07, 0x7e, 0xa5, 0xfe, 0x20, 0x10, 0x13, 0x2c, 0xfe, 0x4c, 0x54, 0x64, 0xd3, 0xfa, 0xef, 0x86, + 0x09, 0x04, 0x1d, 0xfe, 0x08, 0x13, 0x2f, 0x07, 0x7e, 0x6e, 0x09, 0x04, 0x1d, 0xfe, 0x1c, 0x12, + 0x14, 0x92, 0x09, 0x04, 0x06, 0x3b, 0x14, 0xc4, 0x01, 0x33, 0x8f, 0xfe, 0x70, 0x0c, 0x02, 0x22, + 0x2b, 0x11, 0xfe, 0xe6, 0x00, 0xfe, 0x1c, 0x90, 0xf9, 0x03, 0x14, 0x92, 0x01, 0x33, 0x02, 0x29, + 0xfe, 0x42, 0x5b, 0x67, 0x1a, 0xfe, 0x46, 0x59, 0xf8, 0xf7, 0xfe, 0x87, 0x80, 0xfe, 0x31, 0xe4, + 0x4f, 0x09, 0x04, 0x0b, 0xfe, 0x78, 0x13, 0xfe, 0x20, 0x80, 0x07, 0x1a, 0xfe, 0x70, 0x12, 0x49, + 0x04, 0x06, 0xfe, 0x60, 0x13, 0x05, 0xfe, 0xa2, 0x00, 0x28, 0x16, 0xfe, 0x80, 0x05, 0xfe, 0x31, + 0xe4, 0x6a, 0x49, 0x04, 0x0b, 0xfe, 0x4a, 0x13, 0x05, 0xfe, 0xa0, 0x00, 0x28, 0xfe, 0x42, 0x12, + 0x5e, 0x01, 0x08, 0x25, 0x32, 0xf1, 0x01, 0x08, 0x26, 0xfe, 0x98, 0x05, 0x11, 0xfe, 0xe3, 0x00, + 0x23, 0x49, 0xfe, 0x4a, 0xf0, 0xfe, 0x6a, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0x64, 0x05, 0x83, 0x24, + 0xfe, 0x21, 0x00, 0xa1, 0x24, 0xfe, 0x22, 0x00, 0xa0, 0x24, 0x4c, 0xfe, 0x09, 0x48, 0x01, 0x08, + 0x26, 0xfe, 0x98, 0x05, 0xfe, 0xe2, 0x08, 0x49, 0x04, 0xc5, 0x3b, 0x01, 0x86, 0x24, 0x06, 0x12, + 0xcc, 0x37, 0xfe, 0x27, 0x01, 0x09, 0x04, 0x1d, 0xfe, 0x22, 0x12, 0x47, 0x01, 0xa7, 0x14, 0x92, + 0x09, 0x04, 0x06, 0x3b, 0x14, 0xc4, 0x01, 0x33, 0x8f, 0xfe, 0x70, 0x0c, 0x02, 0x22, 0x05, 0xfe, + 0x9c, 0x00, 0x28, 0xfe, 0x3e, 0x12, 0x05, 0x50, 0x28, 0xfe, 0x36, 0x13, 0x47, 0x01, 0xa7, 0x26, + 0xfe, 0x08, 0x06, 0x0a, 0x06, 0x49, 0x04, 0x19, 0xfe, 0x02, 0x12, 0x5f, 0x01, 0xfe, 0xaa, 0x14, + 0x1f, 0xfe, 0xfe, 0x05, 0x11, 0x9a, 0x01, 0x43, 0x11, 0xfe, 0xe5, 0x00, 0x05, 0x50, 0xb4, 0x0c, + 0x50, 0x05, 0xc6, 0x28, 0xfe, 0x62, 0x12, 0x05, 0x3f, 0x28, 0xfe, 0x5a, 0x13, 0x01, 0xfe, 0x14, + 0x18, 0x01, 0xfe, 0x66, 0x18, 0xfe, 0x43, 0x48, 0xb7, 0x19, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, + 0x48, 0x8b, 0x1c, 0x3d, 0x85, 0xb7, 0x69, 0x47, 0x01, 0xa7, 0x26, 0xfe, 0x72, 0x06, 0x49, 0x04, + 0x1b, 0xdf, 0x89, 0x0a, 0x4d, 0x01, 0xfe, 0xd8, 0x14, 0x1f, 0xfe, 0x68, 0x06, 0x11, 0x9a, 0x01, + 0x43, 0x11, 0xfe, 0xe5, 0x00, 0x05, 0x3f, 0xb4, 0x0c, 0x3f, 0x17, 0x06, 0x01, 0xa7, 0xec, 0x72, + 0x70, 0x01, 0x6e, 0x87, 0x11, 0xfe, 0xe2, 0x00, 0x01, 0x08, 0x25, 0x32, 0xfe, 0x0a, 0xf0, 0xfe, + 0xa6, 0x06, 0x8c, 0xfe, 0x5c, 0x07, 0xfe, 0x06, 0xf0, 0xfe, 0x64, 0x07, 0x8d, 0x81, 0x02, 0x22, + 0x09, 0x04, 0x0b, 0xfe, 0x2e, 0x12, 0x15, 0x1a, 0x01, 0x08, 0x15, 0x00, 0x01, 0x08, 0x15, 0x00, + 0x01, 0x08, 0x15, 0x00, 0x01, 0x08, 0xfe, 0x99, 0xa4, 0x01, 0x08, 0x15, 0x00, 0x02, 0xfe, 0x32, + 0x08, 0x61, 0x04, 0x1b, 0xfe, 0x38, 0x12, 0x09, 0x04, 0x1b, 0x6e, 0x15, 0xfe, 0x1b, 0x00, 0x01, + 0x08, 0x15, 0x00, 0x01, 0x08, 0x15, 0x00, 0x01, 0x08, 0x15, 0x00, 0x01, 0x08, 0x15, 0x06, 0x01, + 0x08, 0x15, 0x00, 0x02, 0xd9, 0x66, 0x4c, 0xfe, 0x3a, 0x55, 0x5f, 0xfe, 0x9a, 0x81, 0x4b, 0x1d, + 0xba, 0xfe, 0x32, 0x07, 0x0a, 0x1d, 0xfe, 0x09, 0x6f, 0xaf, 0xfe, 0xca, 0x45, 0xfe, 0x32, 0x12, + 0x62, 0x2c, 0x85, 0x66, 0x7b, 0x01, 0x08, 0x25, 0x32, 0xfe, 0x0a, 0xf0, 0xfe, 0x32, 0x07, 0x8d, + 0x81, 0x8c, 0xfe, 0x5c, 0x07, 0x02, 0x22, 0x01, 0x43, 0x02, 0xfe, 0x8a, 0x06, 0x15, 0x19, 0x02, + 0xfe, 0x8a, 0x06, 0xfe, 0x9c, 0xf7, 0xd4, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x77, 0xfe, 0xca, + 0x07, 0x0c, 0x54, 0x18, 0x55, 0x09, 0x4a, 0x6a, 0x35, 0x1e, 0x20, 0x07, 0x10, 0xfe, 0x0e, 0x12, + 0x74, 0xfe, 0x80, 0x80, 0x37, 0x20, 0x63, 0x27, 0xfe, 0x06, 0x10, 0xfe, 0x83, 0xe7, 0xc4, 0xa1, + 0xfe, 0x03, 0x40, 0x09, 0x4a, 0x4f, 0x35, 0x01, 0xa8, 0xad, 0xfe, 0x1f, 0x40, 0x12, 0x58, 0x01, + 0xa5, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, 0xfe, 0xc6, 0x51, 0x83, 0xfb, 0xfe, + 0x8a, 0x90, 0x0c, 0x52, 0x18, 0x53, 0xfe, 0x0c, 0x90, 0xfe, 0x8e, 0x90, 0xfe, 0x40, 0x50, 0xfe, + 0xc2, 0x50, 0x0c, 0x39, 0x18, 0x3a, 0xfe, 0x4a, 0x10, 0x09, 0x04, 0x6a, 0xfe, 0x2a, 0x12, 0xfe, + 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x0c, 0x54, 0x18, 0x55, 0x09, 0x04, 0x4f, 0x85, 0x01, 0xa8, 0xfe, + 0x1f, 0x80, 0x12, 0x58, 0xfe, 0x44, 0x90, 0xfe, 0xc6, 0x90, 0x0c, 0x56, 0x18, 0x57, 0xfb, 0xfe, + 0x8a, 0x90, 0x0c, 0x52, 0x18, 0x53, 0xfe, 0x40, 0x90, 0xfe, 0xc2, 0x90, 0x0c, 0x39, 0x18, 0x3a, + 0x0c, 0x38, 0x18, 0x4e, 0x09, 0x4a, 0x19, 0x35, 0x2a, 0x13, 0xfe, 0x4e, 0x11, 0x65, 0xfe, 0x48, + 0x08, 0xfe, 0x9e, 0xf0, 0xfe, 0x5c, 0x08, 0xb1, 0x16, 0x32, 0x2a, 0x73, 0xdd, 0xb8, 0xfe, 0x80, + 0x08, 0xb9, 0xfe, 0x9e, 0x08, 0x8c, 0xfe, 0x74, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x7a, 0x08, 0x8d, + 0x81, 0x02, 0x22, 0x01, 0x43, 0xfe, 0xc9, 0x10, 0x15, 0x19, 0xfe, 0xc9, 0x10, 0x61, 0x04, 0x06, + 0xfe, 0x10, 0x12, 0x61, 0x04, 0x0b, 0x45, 0x09, 0x04, 0x0b, 0xfe, 0x68, 0x12, 0xfe, 0x2e, 0x1c, + 0x02, 0xfe, 0x24, 0x0a, 0x61, 0x04, 0x06, 0x45, 0x61, 0x04, 0x0b, 0xfe, 0x52, 0x12, 0xfe, 0x2c, + 0x1c, 0xfe, 0xaa, 0xf0, 0xfe, 0x1e, 0x09, 0xfe, 0xac, 0xf0, 0xfe, 0xbe, 0x08, 0xfe, 0x8a, 0x10, + 0xaa, 0xfe, 0xf3, 0x10, 0xfe, 0xad, 0xf0, 0xfe, 0xca, 0x08, 0x02, 0xfe, 0x24, 0x0a, 0xab, 0xfe, + 0xe7, 0x10, 0xfe, 0x2b, 0xf0, 0x9d, 0xe9, 0x1c, 0xfe, 0x00, 0xfe, 0xfe, 0x1c, 0x12, 0xb5, 0xfe, + 0xd2, 0xf0, 0x9d, 0xfe, 0x76, 0x18, 0x1c, 0x1a, 0x16, 0x9d, 0x05, 0xcb, 0x1c, 0x06, 0x16, 0x9d, + 0xb8, 0x6d, 0xb9, 0x6d, 0xaa, 0xab, 0xfe, 0xb1, 0x10, 0x70, 0x5e, 0x2b, 0x14, 0x92, 0x01, 0x33, + 0x0f, 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, 0x5a, 0x0f, 0x7c, 0x02, 0x5a, 0xfe, 0x74, 0x18, 0x1c, + 0xfe, 0x00, 0xf8, 0x16, 0x6d, 0x67, 0x1b, 0x01, 0xfe, 0x44, 0x0d, 0x3b, 0x01, 0xe6, 0x1e, 0x27, + 0x74, 0x67, 0x1a, 0x02, 0x6d, 0x09, 0x04, 0x0b, 0x21, 0xfe, 0x06, 0x0a, 0x09, 0x04, 0x6a, 0xfe, + 0x82, 0x12, 0x09, 0x04, 0x19, 0xfe, 0x66, 0x13, 0x1e, 0x58, 0xac, 0xfc, 0xfe, 0x83, 0x80, 0xfe, + 0xc8, 0x44, 0xfe, 0x2e, 0x13, 0xfe, 0x04, 0x91, 0xfe, 0x86, 0x91, 0x63, 0x27, 0xfe, 0x40, 0x59, + 0xfe, 0xc1, 0x59, 0x77, 0xd7, 0x05, 0x54, 0x31, 0x55, 0x0c, 0x7b, 0x18, 0x7c, 0xbe, 0x54, 0xbf, + 0x55, 0x01, 0xa8, 0xad, 0x63, 0x27, 0x12, 0x58, 0xc0, 0x38, 0xc1, 0x4e, 0x79, 0x56, 0x68, 0x57, + 0xf4, 0xf5, 0xfe, 0x04, 0xfa, 0x38, 0xfe, 0x05, 0xfa, 0x4e, 0x01, 0xa5, 0xa2, 0x23, 0x0c, 0x7b, + 0x0c, 0x7c, 0x79, 0x56, 0x68, 0x57, 0xfe, 0x12, 0x10, 0x09, 0x04, 0x19, 0x16, 0xd7, 0x79, 0x39, + 0x68, 0x3a, 0x09, 0x04, 0xfe, 0xf7, 0x00, 0x35, 0x05, 0x52, 0x31, 0x53, 0xfe, 0x10, 0x58, 0xfe, + 0x91, 0x58, 0xfe, 0x14, 0x59, 0xfe, 0x95, 0x59, 0x02, 0x6d, 0x09, 0x04, 0x19, 0x16, 0xd7, 0x09, + 0x04, 0xfe, 0xf7, 0x00, 0x35, 0xfe, 0x3a, 0x55, 0xfe, 0x19, 0x81, 0x5f, 0xfe, 0x10, 0x90, 0xfe, + 0x92, 0x90, 0xfe, 0xd7, 0x10, 0x2f, 0x07, 0x9b, 0x16, 0xfe, 0xc6, 0x08, 0x11, 0x9b, 0x09, 0x04, + 0x0b, 0xfe, 0x14, 0x13, 0x05, 0x39, 0x31, 0x3a, 0x77, 0xfe, 0xc6, 0x08, 0xfe, 0x0c, 0x58, 0xfe, + 0x8d, 0x58, 0x02, 0x6d, 0x23, 0x47, 0xfe, 0x19, 0x80, 0xde, 0x09, 0x04, 0x0b, 0xfe, 0x1a, 0x12, + 0xfe, 0x6c, 0x19, 0xfe, 0x19, 0x41, 0xe9, 0xb5, 0xfe, 0xd1, 0xf0, 0xd9, 0x14, 0x7a, 0x01, 0x33, + 0x0f, 0xfe, 0x44, 0x00, 0xfe, 0x8e, 0x10, 0xfe, 0x6c, 0x19, 0xbe, 0x39, 0xfe, 0xed, 0x19, 0xbf, + 0x3a, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0xe9, 0x1c, 0xfe, 0x00, 0xff, 0x34, 0xfe, 0x74, 0x10, + 0xb5, 0xfe, 0xd2, 0xf0, 0xfe, 0xb2, 0x0a, 0xfe, 0x76, 0x18, 0x1c, 0x1a, 0x84, 0x05, 0xcb, 0x1c, + 0x06, 0xfe, 0x08, 0x13, 0x0f, 0xfe, 0x16, 0x00, 0x02, 0x5a, 0xfe, 0xd1, 0xf0, 0xfe, 0xc4, 0x0a, + 0x14, 0x7a, 0x01, 0x33, 0x0f, 0xfe, 0x17, 0x00, 0xfe, 0x42, 0x10, 0xfe, 0xce, 0xf0, 0xfe, 0xca, + 0x0a, 0xfe, 0x3c, 0x10, 0xfe, 0xcd, 0xf0, 0xfe, 0xd6, 0x0a, 0x0f, 0xfe, 0x22, 0x00, 0x02, 0x5a, + 0xfe, 0xcb, 0xf0, 0xfe, 0xe2, 0x0a, 0x0f, 0xfe, 0x24, 0x00, 0x02, 0x5a, 0xfe, 0xd0, 0xf0, 0xfe, + 0xec, 0x0a, 0x0f, 0x93, 0xdc, 0xfe, 0xcf, 0xf0, 0xfe, 0xf6, 0x0a, 0x0f, 0x4c, 0xfe, 0x10, 0x10, + 0xfe, 0xcc, 0xf0, 0xd9, 0x61, 0x04, 0x19, 0x3b, 0x0f, 0xfe, 0x12, 0x00, 0x2a, 0x13, 0xfe, 0x4e, + 0x11, 0x65, 0xfe, 0x0c, 0x0b, 0xfe, 0x9e, 0xf0, 0xfe, 0x20, 0x0b, 0xb1, 0x16, 0x32, 0x2a, 0x73, + 0xdd, 0xb8, 0x22, 0xb9, 0x22, 0x2a, 0xec, 0x65, 0xfe, 0x2c, 0x0b, 0x25, 0x32, 0x8c, 0xfe, 0x48, + 0x0b, 0x8d, 0x81, 0xb8, 0xd4, 0xb9, 0xd4, 0x02, 0x22, 0x01, 0x43, 0xfe, 0xdb, 0x10, 0x11, 0xfe, + 0xe8, 0x00, 0xaa, 0xab, 0x70, 0xbc, 0x7d, 0xbd, 0x7f, 0xfe, 0x89, 0xf0, 0x22, 0x30, 0x2e, 0xd8, + 0xbc, 0x7d, 0xbd, 0x7f, 0x01, 0x08, 0x1f, 0x22, 0x30, 0x2e, 0xd6, 0xb1, 0x45, 0x0f, 0xfe, 0x42, + 0x00, 0x02, 0x5a, 0x78, 0x06, 0xfe, 0x81, 0x49, 0x16, 0xfe, 0x38, 0x0c, 0x09, 0x04, 0x0b, 0xfe, + 0x44, 0x13, 0x0f, 0x00, 0x4b, 0x0b, 0xfe, 0x54, 0x12, 0x4b, 0xfe, 0x28, 0x00, 0x21, 0xfe, 0xa6, + 0x0c, 0x0a, 0x40, 0x01, 0x0e, 0x07, 0x00, 0x5d, 0x3e, 0xfe, 0x28, 0x00, 0xfe, 0xe2, 0x10, 0x01, + 0xe7, 0x01, 0xe8, 0x0a, 0x99, 0x01, 0xfe, 0x32, 0x0e, 0x59, 0x11, 0x2d, 0x01, 0x6f, 0x02, 0x29, + 0x0f, 0xfe, 0x44, 0x00, 0x4b, 0x0b, 0xdf, 0x3e, 0x0b, 0xfe, 0xb4, 0x10, 0x01, 0x86, 0x3e, 0x0b, + 0xfe, 0xaa, 0x10, 0x01, 0x86, 0xfe, 0x19, 0x82, 0xfe, 0x34, 0x46, 0xa3, 0x3e, 0x0b, 0x0f, 0xfe, + 0x43, 0x00, 0xfe, 0x96, 0x10, 0x09, 0x4a, 0x0b, 0x35, 0x01, 0xe7, 0x01, 0xe8, 0x59, 0x11, 0x2d, + 0x01, 0x6f, 0x67, 0x0b, 0x59, 0x3c, 0x8a, 0x02, 0xfe, 0x2a, 0x03, 0x09, 0x04, 0x0b, 0x84, 0x3e, + 0x0b, 0x0f, 0x00, 0xfe, 0x5c, 0x10, 0x61, 0x04, 0x1b, 0xfe, 0x58, 0x12, 0x09, 0x04, 0x1b, 0xfe, + 0x50, 0x13, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x5c, 0x0c, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, + 0xf0, 0xfe, 0x62, 0x0c, 0x09, 0x4a, 0x1b, 0x35, 0xfe, 0xa9, 0x10, 0x0f, 0xfe, 0x15, 0x00, 0xfe, + 0x04, 0xe6, 0x0b, 0x5f, 0x5c, 0x0f, 0xfe, 0x13, 0x00, 0xfe, 0x10, 0x10, 0x0f, 0xfe, 0x47, 0x00, + 0xa1, 0x0f, 0xfe, 0x41, 0x00, 0xa0, 0x0f, 0xfe, 0x24, 0x00, 0x87, 0xaa, 0xab, 0x70, 0x05, 0x6b, + 0x28, 0x21, 0xd1, 0x5f, 0xfe, 0x04, 0xe6, 0x1b, 0xfe, 0x9d, 0x41, 0xfe, 0x1c, 0x42, 0x59, 0x01, + 0xda, 0x02, 0x29, 0xea, 0x14, 0x0b, 0x37, 0x95, 0xa9, 0x14, 0xfe, 0x31, 0x00, 0x37, 0x97, 0x01, + 0xfe, 0x54, 0x0f, 0x02, 0xd0, 0x3c, 0xfe, 0x06, 0xec, 0xc9, 0xee, 0x3e, 0x1d, 0xfe, 0xce, 0x45, + 0x34, 0x3c, 0xfe, 0x06, 0xea, 0xc9, 0xfe, 0x47, 0x4b, 0x89, 0xfe, 0x75, 0x57, 0x05, 0x51, 0xfe, + 0x98, 0x56, 0xfe, 0x38, 0x12, 0x0a, 0x42, 0x01, 0x0e, 0xfe, 0x44, 0x48, 0x46, 0x09, 0x04, 0x1d, + 0xfe, 0x1a, 0x13, 0x0a, 0x40, 0x01, 0x0e, 0x47, 0xfe, 0x41, 0x58, 0x0a, 0x99, 0x01, 0x0e, 0xfe, + 0x49, 0x54, 0x8e, 0xfe, 0x2a, 0x0d, 0x02, 0xfe, 0x2a, 0x03, 0x0a, 0x51, 0xfe, 0xee, 0x14, 0xee, + 0x3e, 0x1d, 0xfe, 0xce, 0x45, 0x34, 0x3c, 0xfe, 0xce, 0x47, 0xfe, 0xad, 0x13, 0x02, 0x29, 0x1e, + 0x20, 0x07, 0x10, 0xfe, 0x9e, 0x12, 0x23, 0x12, 0x4d, 0x12, 0x94, 0x12, 0xce, 0x1e, 0x2d, 0x47, + 0x37, 0x2d, 0xb1, 0xe0, 0xfe, 0xbc, 0xf0, 0xfe, 0xec, 0x0d, 0x13, 0x06, 0x12, 0x4d, 0x01, 0xfe, + 0xe2, 0x15, 0x05, 0xfe, 0x38, 0x01, 0x31, 0xfe, 0x3a, 0x01, 0x77, 0xfe, 0xf0, 0x0d, 0xfe, 0x02, + 0xec, 0xce, 0x62, 0x00, 0x5d, 0xfe, 0x04, 0xec, 0x20, 0x46, 0xfe, 0x05, 0xf6, 0xfe, 0x34, 0x01, + 0x01, 0xfe, 0x52, 0x16, 0xfb, 0xfe, 0x48, 0xf4, 0x0d, 0xfe, 0x18, 0x13, 0xaf, 0xfe, 0x02, 0xea, + 0xce, 0x62, 0x7a, 0xfe, 0xc5, 0x13, 0x14, 0x1b, 0x37, 0x95, 0xa9, 0x5c, 0x05, 0xfe, 0x38, 0x01, + 0x1c, 0xfe, 0xf0, 0xff, 0x0c, 0xfe, 0x60, 0x01, 0x05, 0xfe, 0x3a, 0x01, 0x0c, 0xfe, 0x62, 0x01, + 0x3d, 0x12, 0x20, 0x24, 0x06, 0x12, 0x2d, 0x11, 0x2d, 0x8a, 0x13, 0x06, 0x03, 0x23, 0x03, 0x1e, + 0x4d, 0xfe, 0xf7, 0x12, 0x1e, 0x94, 0xac, 0x12, 0x94, 0x07, 0x7a, 0xfe, 0x71, 0x13, 0xfe, 0x24, + 0x1c, 0x14, 0x1a, 0x37, 0x95, 0xa9, 0xfe, 0xd9, 0x10, 0xb6, 0xfe, 0x03, 0xdc, 0xfe, 0x73, 0x57, + 0xfe, 0x80, 0x5d, 0x03, 0xb6, 0xfe, 0x03, 0xdc, 0xfe, 0x5b, 0x57, 0xfe, 0x80, 0x5d, 0x03, 0xfe, + 0x03, 0x57, 0xb6, 0x23, 0xfe, 0x00, 0xcc, 0x03, 0xfe, 0x03, 0x57, 0xb6, 0x75, 0x03, 0x09, 0x04, + 0x4c, 0xfe, 0x22, 0x13, 0xfe, 0x1c, 0x80, 0x07, 0x06, 0xfe, 0x1a, 0x13, 0xfe, 0x1e, 0x80, 0xe1, + 0xfe, 0x1d, 0x80, 0xa4, 0xfe, 0x0c, 0x90, 0xfe, 0x0e, 0x13, 0xfe, 0x0e, 0x90, 0xa3, 0xfe, 0x3c, + 0x90, 0xfe, 0x30, 0xf4, 0x0b, 0xfe, 0x3c, 0x50, 0xa0, 0x01, 0xfe, 0x82, 0x16, 0x2f, 0x07, 0x2d, + 0xe0, 0x01, 0xfe, 0xbc, 0x15, 0x09, 0x04, 0x1d, 0x45, 0x01, 0xe7, 0x01, 0xe8, 0x11, 0xfe, 0xe9, + 0x00, 0x09, 0x04, 0x4c, 0xfe, 0x2c, 0x13, 0x01, 0xfe, 0x14, 0x16, 0xfe, 0x1e, 0x1c, 0xfe, 0x14, + 0x90, 0xfe, 0x96, 0x90, 0x0c, 0xfe, 0x64, 0x01, 0x18, 0xfe, 0x66, 0x01, 0x09, 0x04, 0x4f, 0xfe, + 0x12, 0x12, 0xfe, 0x03, 0x80, 0x74, 0xfe, 0x01, 0xec, 0x20, 0xfe, 0x80, 0x40, 0x12, 0x20, 0x63, + 0x27, 0x11, 0xc8, 0x59, 0x1e, 0x20, 0xed, 0x76, 0x20, 0x03, 0xfe, 0x08, 0x1c, 0x05, 0xfe, 0xac, + 0x00, 0xfe, 0x06, 0x58, 0x05, 0xfe, 0xae, 0x00, 0xfe, 0x07, 0x58, 0x05, 0xfe, 0xb0, 0x00, 0xfe, + 0x08, 0x58, 0x05, 0xfe, 0xb2, 0x00, 0xfe, 0x09, 0x58, 0xfe, 0x0a, 0x1c, 0x24, 0x69, 0x12, 0xc9, + 0x23, 0x0c, 0x50, 0x0c, 0x3f, 0x13, 0x40, 0x48, 0x5f, 0x17, 0x1d, 0xfe, 0x90, 0x4d, 0xfe, 0x91, + 0x54, 0x21, 0xfe, 0x08, 0x0f, 0x3e, 0x10, 0x13, 0x42, 0x48, 0x17, 0x4c, 0xfe, 0x90, 0x4d, 0xfe, + 0x91, 0x54, 0x21, 0xfe, 0x1e, 0x0f, 0x24, 0x10, 0x12, 0x20, 0x78, 0x2c, 0x46, 0x1e, 0x20, 0xed, + 0x76, 0x20, 0x11, 0xc8, 0xf6, 0xfe, 0xd6, 0xf0, 0xfe, 0x32, 0x0f, 0xea, 0x70, 0xfe, 0x14, 0x1c, + 0xfe, 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x03, 0x3c, 0xfe, 0x0c, 0x14, 0xee, 0xfe, 0x07, 0xe6, 0x1d, + 0xfe, 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x03, 0x01, 0x86, 0x78, 0x2c, 0x46, 0xfa, 0xef, 0xfe, 0x42, + 0x13, 0x2f, 0x07, 0x2d, 0xfe, 0x34, 0x13, 0x0a, 0x42, 0x01, 0x0e, 0xb0, 0xfe, 0x36, 0x12, 0xf0, + 0xfe, 0x45, 0x48, 0x01, 0xe3, 0xfe, 0x00, 0xcc, 0xb0, 0xfe, 0xf3, 0x13, 0x3d, 0x75, 0x07, 0x10, + 0xa3, 0x0a, 0x80, 0x01, 0x0e, 0xfe, 0x80, 0x5c, 0x01, 0x6f, 0xfe, 0x0e, 0x10, 0x07, 0x7e, 0x45, + 0xf6, 0xfe, 0xd6, 0xf0, 0xfe, 0x6c, 0x0f, 0x03, 0xfe, 0x44, 0x58, 0x74, 0xfe, 0x01, 0xec, 0x97, + 0xfe, 0x9e, 0x40, 0xfe, 0x9d, 0xe7, 0x00, 0xfe, 0x9c, 0xe7, 0x1b, 0x76, 0x27, 0x01, 0xda, 0xfe, + 0xdd, 0x10, 0x2a, 0xbc, 0x7d, 0xbd, 0x7f, 0x30, 0x2e, 0xd5, 0x07, 0x1b, 0xfe, 0x48, 0x12, 0x07, + 0x0b, 0xfe, 0x56, 0x12, 0x07, 0x1a, 0xfe, 0x30, 0x12, 0x07, 0xc2, 0x16, 0xfe, 0x3e, 0x11, 0x07, + 0xfe, 0x23, 0x00, 0x16, 0xfe, 0x4a, 0x11, 0x07, 0x06, 0x16, 0xfe, 0xa8, 0x11, 0x07, 0x19, 0xfe, + 0x12, 0x12, 0x07, 0x00, 0x16, 0x22, 0x14, 0xc2, 0x01, 0x33, 0x9f, 0x2b, 0x01, 0x08, 0x8c, 0x43, + 0x03, 0x2b, 0xfe, 0x62, 0x08, 0x0a, 0xca, 0x01, 0xfe, 0x32, 0x0e, 0x11, 0x7e, 0x02, 0x29, 0x2b, + 0x2f, 0x07, 0x9b, 0xfe, 0xd9, 0x13, 0x79, 0x39, 0x68, 0x3a, 0x77, 0xfe, 0xfc, 0x10, 0x09, 0x04, + 0x6a, 0xfe, 0x72, 0x12, 0xc0, 0x38, 0xc1, 0x4e, 0xf4, 0xf5, 0x8e, 0xfe, 0xc6, 0x10, 0x1e, 0x58, + 0xfe, 0x26, 0x13, 0x05, 0x7b, 0x31, 0x7c, 0x77, 0xfe, 0x82, 0x0c, 0x0c, 0x54, 0x18, 0x55, 0x23, + 0x0c, 0x7b, 0x0c, 0x7c, 0x01, 0xa8, 0x24, 0x69, 0x73, 0x12, 0x58, 0x01, 0xa5, 0xc0, 0x38, 0xc1, + 0x4e, 0xfe, 0x04, 0x55, 0xfe, 0xa5, 0x55, 0xfe, 0x04, 0xfa, 0x38, 0xfe, 0x05, 0xfa, 0x4e, 0xfe, + 0x91, 0x10, 0x05, 0x56, 0x31, 0x57, 0xfe, 0x40, 0x56, 0xfe, 0xe1, 0x56, 0x0c, 0x56, 0x18, 0x57, + 0x83, 0xc0, 0x38, 0xc1, 0x4e, 0xf4, 0xf5, 0x05, 0x52, 0x31, 0x53, 0xfe, 0x00, 0x56, 0xfe, 0xa1, + 0x56, 0x0c, 0x52, 0x18, 0x53, 0x09, 0x04, 0x6a, 0xfe, 0x1e, 0x12, 0x1e, 0x58, 0xfe, 0x1f, 0x40, + 0x05, 0x54, 0x31, 0x55, 0xfe, 0x2c, 0x50, 0xfe, 0xae, 0x50, 0x05, 0x56, 0x31, 0x57, 0xfe, 0x44, + 0x50, 0xfe, 0xc6, 0x50, 0x05, 0x52, 0x31, 0x53, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0x05, 0x39, + 0x31, 0x3a, 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x02, 0x5c, 0x24, 0x06, 0x12, 0xcd, 0x02, 0x5b, + 0x2b, 0x01, 0x08, 0x1f, 0x44, 0x30, 0x2e, 0xd5, 0x07, 0x06, 0x21, 0x44, 0x2f, 0x07, 0x9b, 0x21, + 0x5b, 0x01, 0x6e, 0x1c, 0x3d, 0x16, 0x44, 0x09, 0x04, 0x0b, 0xe2, 0x79, 0x39, 0x68, 0x3a, 0xfe, + 0x0a, 0x55, 0x34, 0xfe, 0x8b, 0x55, 0xbe, 0x39, 0xbf, 0x3a, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, + 0x02, 0x5b, 0xfe, 0x19, 0x81, 0xaf, 0xfe, 0x19, 0x41, 0x02, 0x5b, 0x2b, 0x01, 0x08, 0x25, 0x32, + 0x1f, 0xa2, 0x30, 0x2e, 0xd8, 0x4b, 0x1a, 0xfe, 0xa6, 0x12, 0x4b, 0x0b, 0x3b, 0x02, 0x44, 0x01, + 0x08, 0x25, 0x32, 0x1f, 0xa2, 0x30, 0x2e, 0xd6, 0x07, 0x1a, 0x21, 0x44, 0x01, 0x08, 0x1f, 0xa2, + 0x30, 0x2e, 0xfe, 0xe8, 0x09, 0xfe, 0xc2, 0x49, 0x60, 0x05, 0xfe, 0x9c, 0x00, 0x28, 0x84, 0x49, + 0x04, 0x19, 0x34, 0x9f, 0xfe, 0xbb, 0x45, 0x4b, 0x00, 0x45, 0x3e, 0x06, 0x78, 0x3d, 0xfe, 0xda, + 0x14, 0x01, 0x6e, 0x87, 0xfe, 0x4b, 0x45, 0xe2, 0x2f, 0x07, 0x9a, 0xe1, 0x05, 0xc6, 0x28, 0x84, + 0x05, 0x3f, 0x28, 0x34, 0x5e, 0x02, 0x5b, 0xfe, 0xc0, 0x5d, 0xfe, 0xf8, 0x14, 0xfe, 0x03, 0x17, + 0x05, 0x50, 0xb4, 0x0c, 0x50, 0x5e, 0x2b, 0x01, 0x08, 0x26, 0x5c, 0x01, 0xfe, 0xaa, 0x14, 0x02, + 0x5c, 0x01, 0x08, 0x25, 0x32, 0x1f, 0x44, 0x30, 0x2e, 0xd6, 0x07, 0x06, 0x21, 0x44, 0x01, 0xfe, + 0x8e, 0x13, 0xfe, 0x42, 0x58, 0xfe, 0x82, 0x14, 0xfe, 0xa4, 0x14, 0x87, 0xfe, 0x4a, 0xf4, 0x0b, + 0x16, 0x44, 0xfe, 0x4a, 0xf4, 0x06, 0xfe, 0x0c, 0x12, 0x2f, 0x07, 0x9a, 0x85, 0x02, 0x5b, 0x05, + 0x3f, 0xb4, 0x0c, 0x3f, 0x5e, 0x2b, 0x01, 0x08, 0x26, 0x5c, 0x01, 0xfe, 0xd8, 0x14, 0x02, 0x5c, + 0x13, 0x06, 0x65, 0xfe, 0xca, 0x12, 0x26, 0xfe, 0xe0, 0x12, 0x72, 0xf1, 0x01, 0x08, 0x23, 0x72, + 0x03, 0x8f, 0xfe, 0xdc, 0x12, 0x25, 0xfe, 0xdc, 0x12, 0x1f, 0xfe, 0xca, 0x12, 0x5e, 0x2b, 0x01, + 0x08, 0xfe, 0xd5, 0x10, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x48, 0x8b, 0x1c, 0xfe, 0xff, 0x7f, + 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x03, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x48, 0x8b, 0x1c, + 0x3d, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x03, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x48, 0x8b, + 0x03, 0x13, 0x6c, 0xff, 0x02, 0x00, 0x57, 0x48, 0x8b, 0xfe, 0x0b, 0x58, 0x03, 0x0a, 0x50, 0x01, + 0x82, 0x0a, 0x3f, 0x01, 0x82, 0x03, 0xfc, 0x1c, 0x10, 0xff, 0x03, 0x00, 0x54, 0xfe, 0x00, 0xf4, + 0x19, 0x48, 0xfe, 0x00, 0x7d, 0xfe, 0x01, 0x7d, 0xfe, 0x02, 0x7d, 0xfe, 0x03, 0x7c, 0x63, 0x27, + 0x0c, 0x52, 0x18, 0x53, 0xbe, 0x56, 0xbf, 0x57, 0x03, 0xfe, 0x62, 0x08, 0xfe, 0x82, 0x4a, 0xfe, + 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x74, 0x03, 0x01, 0xfe, 0x14, 0x18, 0xfe, 0x42, 0x48, 0x5f, 0x60, + 0x89, 0x01, 0x08, 0x1f, 0xfe, 0xa2, 0x14, 0x30, 0x2e, 0xd8, 0x01, 0x08, 0x1f, 0xfe, 0xa2, 0x14, + 0x30, 0x2e, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, 0x59, 0x05, 0xc6, 0x28, 0xfe, 0xcc, 0x12, 0x49, 0x04, + 0x1b, 0xfe, 0xc4, 0x13, 0x23, 0x62, 0x1b, 0xe2, 0x4b, 0xc3, 0x64, 0xfe, 0xe8, 0x13, 0x3b, 0x13, + 0x06, 0x17, 0xc3, 0x78, 0xdb, 0xfe, 0x78, 0x10, 0xff, 0x02, 0x83, 0x55, 0xa1, 0xff, 0x02, 0x83, + 0x55, 0x62, 0x1a, 0xa4, 0xbb, 0xfe, 0x30, 0x00, 0x8e, 0xe4, 0x17, 0x2c, 0x13, 0x06, 0xfe, 0x56, + 0x10, 0x62, 0x0b, 0xe1, 0xbb, 0xfe, 0x64, 0x00, 0x8e, 0xe4, 0x0a, 0xfe, 0x64, 0x00, 0x17, 0x93, + 0x13, 0x06, 0xfe, 0x28, 0x10, 0x62, 0x06, 0xfe, 0x60, 0x13, 0xbb, 0xfe, 0xc8, 0x00, 0x8e, 0xe4, + 0x0a, 0xfe, 0xc8, 0x00, 0x17, 0x4d, 0x13, 0x06, 0x83, 0xbb, 0xfe, 0x90, 0x01, 0xba, 0xfe, 0x4e, + 0x14, 0x89, 0xfe, 0x12, 0x10, 0xfe, 0x43, 0xf4, 0x94, 0xfe, 0x56, 0xf0, 0xfe, 0x60, 0x14, 0xfe, + 0x04, 0xf4, 0x6c, 0xfe, 0x43, 0xf4, 0x93, 0xfe, 0xf3, 0x10, 0xf9, 0x01, 0xfe, 0x22, 0x13, 0x1c, + 0x3d, 0xfe, 0x10, 0x13, 0xfe, 0x00, 0x17, 0xfe, 0x4d, 0xe4, 0x69, 0xba, 0xfe, 0x9c, 0x14, 0xb7, + 0x69, 0xfe, 0x1c, 0x10, 0xfe, 0x00, 0x17, 0xfe, 0x4d, 0xe4, 0x19, 0xba, 0xfe, 0x9c, 0x14, 0xb7, + 0x19, 0x83, 0x60, 0x23, 0xfe, 0x4d, 0xf4, 0x00, 0xdf, 0x89, 0x13, 0x06, 0xfe, 0xb4, 0x56, 0xfe, + 0xc3, 0x58, 0x03, 0x60, 0x13, 0x0b, 0x03, 0x15, 0x06, 0x01, 0x08, 0x26, 0xe5, 0x15, 0x0b, 0x01, + 0x08, 0x26, 0xe5, 0x15, 0x1a, 0x01, 0x08, 0x26, 0xe5, 0x72, 0xfe, 0x89, 0x49, 0x01, 0x08, 0x03, + 0x15, 0x06, 0x01, 0x08, 0x26, 0xa6, 0x15, 0x1a, 0x01, 0x08, 0x26, 0xa6, 0x15, 0x06, 0x01, 0x08, + 0x26, 0xa6, 0xfe, 0x89, 0x49, 0x01, 0x08, 0x26, 0xa6, 0x72, 0xfe, 0x89, 0x4a, 0x01, 0x08, 0x03, + 0x60, 0x03, 0x1e, 0xcc, 0x07, 0x06, 0xfe, 0x44, 0x13, 0xad, 0x12, 0xcc, 0xfe, 0x49, 0xf4, 0x00, + 0x3b, 0x72, 0x9f, 0x5e, 0xfe, 0x01, 0xec, 0xfe, 0x27, 0x01, 0xf1, 0x01, 0x08, 0x2f, 0x07, 0xfe, + 0xe3, 0x00, 0xfe, 0x20, 0x13, 0x1f, 0xfe, 0x5a, 0x15, 0x23, 0x12, 0xcd, 0x01, 0x43, 0x1e, 0xcd, + 0x07, 0x06, 0x45, 0x09, 0x4a, 0x06, 0x35, 0x03, 0x0a, 0x42, 0x01, 0x0e, 0xed, 0x88, 0x07, 0x10, + 0xa4, 0x0a, 0x80, 0x01, 0x0e, 0x88, 0x0a, 0x51, 0x01, 0x9e, 0x03, 0x0a, 0x80, 0x01, 0x0e, 0x88, + 0xfe, 0x80, 0xe7, 0x10, 0x07, 0x10, 0x84, 0xfe, 0x45, 0x58, 0x01, 0xe3, 0x88, 0x03, 0x0a, 0x42, + 0x01, 0x0e, 0x88, 0x0a, 0x51, 0x01, 0x9e, 0x03, 0x0a, 0x42, 0x01, 0x0e, 0xfe, 0x80, 0x80, 0xf2, + 0xfe, 0x49, 0xe4, 0x10, 0xa4, 0x0a, 0x80, 0x01, 0x0e, 0xf2, 0x0a, 0x51, 0x01, 0x82, 0x03, 0x17, + 0x10, 0x71, 0x66, 0xfe, 0x60, 0x01, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x24, 0x1c, 0xfe, + 0x1d, 0xf7, 0x1d, 0x90, 0xfe, 0xf6, 0x15, 0x01, 0xfe, 0xfc, 0x16, 0xe0, 0x91, 0x1d, 0x66, 0xfe, + 0x2c, 0x01, 0xfe, 0x2f, 0x19, 0x03, 0xae, 0x21, 0xfe, 0xe6, 0x15, 0xfe, 0xda, 0x10, 0x17, 0x10, + 0x71, 0x05, 0xfe, 0x64, 0x01, 0xfe, 0x00, 0xf4, 0x19, 0xfe, 0x18, 0x58, 0x05, 0xfe, 0x66, 0x01, + 0xfe, 0x19, 0x58, 0x91, 0x19, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, 0x06, 0xfe, 0x3c, 0x50, 0x66, + 0xfe, 0x38, 0x00, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x19, 0x90, 0xfe, 0x40, 0x16, 0xfe, 0xb6, + 0x14, 0x34, 0x03, 0xae, 0x21, 0xfe, 0x18, 0x16, 0xfe, 0x9c, 0x10, 0x17, 0x10, 0x71, 0xfe, 0x83, + 0x5a, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, 0xf7, 0x38, 0x90, 0xfe, 0x62, 0x16, 0xfe, + 0x94, 0x14, 0xfe, 0x10, 0x13, 0x91, 0x38, 0x66, 0x1b, 0xfe, 0xaf, 0x19, 0xfe, 0x98, 0xe7, 0x00, + 0x03, 0xae, 0x21, 0xfe, 0x56, 0x16, 0xfe, 0x6c, 0x10, 0x17, 0x10, 0x71, 0xfe, 0x30, 0xbc, 0xfe, + 0xb2, 0xbc, 0x91, 0xc5, 0x66, 0x1b, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0xc5, 0x90, 0xfe, 0x9a, + 0x16, 0xfe, 0x5c, 0x14, 0x34, 0x03, 0xae, 0x21, 0xfe, 0x86, 0x16, 0xfe, 0x42, 0x10, 0xfe, 0x02, + 0xf6, 0x10, 0x71, 0xfe, 0x18, 0xfe, 0x54, 0xfe, 0x19, 0xfe, 0x55, 0xfc, 0xfe, 0x1d, 0xf7, 0x4f, + 0x90, 0xfe, 0xc0, 0x16, 0xfe, 0x36, 0x14, 0xfe, 0x1c, 0x13, 0x91, 0x4f, 0x47, 0xfe, 0x83, 0x58, + 0xfe, 0xaf, 0x19, 0xfe, 0x80, 0xe7, 0x10, 0xfe, 0x81, 0xe7, 0x10, 0x11, 0xfe, 0xdd, 0x00, 0x63, + 0x27, 0x03, 0x63, 0x27, 0xfe, 0x12, 0x45, 0x21, 0xfe, 0xb0, 0x16, 0x14, 0x06, 0x37, 0x95, 0xa9, + 0x02, 0x29, 0xfe, 0x39, 0xf0, 0xfe, 0x04, 0x17, 0x23, 0x03, 0xfe, 0x7e, 0x18, 0x1c, 0x1a, 0x5d, + 0x13, 0x0d, 0x03, 0x71, 0x05, 0xcb, 0x1c, 0x06, 0xfe, 0xef, 0x12, 0xfe, 0xe1, 0x10, 0x78, 0x2c, + 0x46, 0x2f, 0x07, 0x2d, 0xfe, 0x3c, 0x13, 0xfe, 0x82, 0x14, 0xfe, 0x42, 0x13, 0x3c, 0x8a, 0x0a, + 0x42, 0x01, 0x0e, 0xb0, 0xfe, 0x3e, 0x12, 0xf0, 0xfe, 0x45, 0x48, 0x01, 0xe3, 0xfe, 0x00, 0xcc, + 0xb0, 0xfe, 0xf3, 0x13, 0x3d, 0x75, 0x07, 0x10, 0xa3, 0x0a, 0x80, 0x01, 0x0e, 0xf2, 0x01, 0x6f, + 0xfe, 0x16, 0x10, 0x07, 0x7e, 0x85, 0xfe, 0x40, 0x14, 0xfe, 0x24, 0x12, 0xf6, 0xfe, 0xd6, 0xf0, + 0xfe, 0x24, 0x17, 0x17, 0x0b, 0x03, 0xfe, 0x9c, 0xe7, 0x0b, 0x0f, 0xfe, 0x15, 0x00, 0x59, 0x76, + 0x27, 0x01, 0xda, 0x17, 0x06, 0x03, 0x3c, 0x8a, 0x09, 0x4a, 0x1d, 0x35, 0x11, 0x2d, 0x01, 0x6f, + 0x17, 0x06, 0x03, 0xfe, 0x38, 0x90, 0xfe, 0xba, 0x90, 0x79, 0xc7, 0x68, 0xc8, 0xfe, 0x48, 0x55, + 0x34, 0xfe, 0xc9, 0x55, 0x03, 0x1e, 0x98, 0x73, 0x12, 0x98, 0x03, 0x0a, 0x99, 0x01, 0x0e, 0xf0, + 0x0a, 0x40, 0x01, 0x0e, 0xfe, 0x49, 0x44, 0x16, 0xfe, 0xf0, 0x17, 0x73, 0x75, 0x03, 0x0a, 0x42, + 0x01, 0x0e, 0x07, 0x10, 0x45, 0x0a, 0x51, 0x01, 0x9e, 0x0a, 0x40, 0x01, 0x0e, 0x73, 0x75, 0x03, + 0xfe, 0x4e, 0xe4, 0x1a, 0x64, 0xfe, 0x24, 0x18, 0x05, 0xfe, 0x90, 0x00, 0xfe, 0x3a, 0x45, 0x5b, + 0xfe, 0x4e, 0xe4, 0xc2, 0x64, 0xfe, 0x36, 0x18, 0x05, 0xfe, 0x92, 0x00, 0xfe, 0x02, 0xe6, 0x1b, + 0xdc, 0xfe, 0x4e, 0xe4, 0xfe, 0x0b, 0x00, 0x64, 0xfe, 0x48, 0x18, 0x05, 0xfe, 0x94, 0x00, 0xfe, + 0x02, 0xe6, 0x19, 0xfe, 0x08, 0x10, 0x05, 0xfe, 0x96, 0x00, 0xfe, 0x02, 0xe6, 0x2c, 0xfe, 0x4e, + 0x45, 0xfe, 0x0c, 0x12, 0xaf, 0xff, 0x04, 0x68, 0x54, 0xde, 0x1c, 0x69, 0x03, 0x07, 0x7a, 0xfe, + 0x5a, 0xf0, 0xfe, 0x74, 0x18, 0x24, 0xfe, 0x09, 0x00, 0xfe, 0x34, 0x10, 0x07, 0x1b, 0xfe, 0x5a, + 0xf0, 0xfe, 0x82, 0x18, 0x24, 0xc3, 0xfe, 0x26, 0x10, 0x07, 0x1a, 0x5d, 0x24, 0x2c, 0xdc, 0x07, + 0x0b, 0x5d, 0x24, 0x93, 0xfe, 0x0e, 0x10, 0x07, 0x06, 0x5d, 0x24, 0x4d, 0x9f, 0xad, 0x03, 0x14, + 0xfe, 0x09, 0x00, 0x01, 0x33, 0xfe, 0x04, 0xfe, 0x7d, 0x05, 0x7f, 0xf9, 0x03, 0x25, 0xfe, 0xca, + 0x18, 0xfe, 0x14, 0xf0, 0x08, 0x65, 0xfe, 0xc6, 0x18, 0x03, 0xff, 0x1a, 0x00, 0x00, }; STATIC unsigned short _adv_asc3550_size = - sizeof(_adv_asc3550_buf); /* 0x137B */ + sizeof(_adv_asc3550_buf); /* 0x13AD */ STATIC ADV_DCNT _adv_asc3550_chksum = - 0x04CDA9B9UL; /* Expanded little-endian checksum. */ + 0x04D52DDDUL; /* Expanded little-endian checksum. */ +/* Microcode buffer is kept after initialization for error recovery. */ STATIC unsigned char _adv_asc38C0800_buf[] = { - 0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0x16, 0x01, 0x00, 0x48, 0xe4, 0x03, 0xf6, - 0x18, 0xe4, 0x02, 0x00, 0x18, 0x80, 0xa8, 0x19, 0x00, 0xfa, 0xff, 0xff, 0x00, 0x0f, 0x00, 0xf6, - 0x9e, 0xe7, 0xff, 0x00, 0x82, 0xe7, 0x00, 0xea, 0x01, 0xe6, 0x09, 0xe7, 0x01, 0xf6, 0x01, 0xfa, - 0x03, 0x00, 0x55, 0xf0, 0x04, 0x00, 0x1e, 0xf0, 0x85, 0xf0, 0x18, 0xf4, 0x08, 0x00, 0xbc, 0x00, - 0x38, 0x54, 0x00, 0xec, 0xd5, 0xf0, 0x70, 0x0d, 0x00, 0xe6, 0x86, 0xf0, 0xb1, 0xf0, 0x98, 0x57, - 0x01, 0xfc, 0xb4, 0x00, 0xd4, 0x01, 0x0c, 0x1c, 0x3e, 0x1c, 0x10, 0x00, 0x3c, 0x00, 0xbb, 0x00, - 0x00, 0x10, 0x94, 0x19, 0x02, 0x80, 0x32, 0xf0, 0x6a, 0x0d, 0x02, 0x13, 0x98, 0x13, 0x18, 0x40, - 0x00, 0x57, 0x01, 0xea, 0x02, 0xfc, 0x03, 0xfc, 0x3e, 0x00, 0xc0, 0x00, 0x6c, 0x01, 0x6e, 0x01, - 0x74, 0x01, 0x76, 0x01, 0xb9, 0x54, 0x00, 0x80, 0x03, 0xe6, 0xb6, 0x00, 0x01, 0x01, 0x3e, 0x01, - 0x7a, 0x01, 0xba, 0x08, 0xac, 0x10, 0xf4, 0x10, 0x04, 0x12, 0x06, 0x13, 0xbb, 0x55, 0x3c, 0x56, - 0x3e, 0x57, 0x03, 0x58, 0x1b, 0x80, 0x30, 0xe4, 0x4b, 0xe4, 0x5d, 0xf0, 0x02, 0xfa, 0x20, 0x00, - 0x32, 0x00, 0x40, 0x00, 0x80, 0x00, 0x24, 0x01, 0x3c, 0x01, 0x68, 0x01, 0x6a, 0x01, 0x70, 0x01, - 0x72, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x62, 0x0a, 0x74, 0x0d, 0x08, 0x12, 0x4c, 0x1c, 0x02, 0x4a, - 0x4a, 0xe4, 0x02, 0xee, 0x5b, 0xf0, 0x03, 0xf7, 0x0c, 0x00, 0x0f, 0x00, 0x47, 0x00, 0xbe, 0x00, - 0x00, 0x01, 0xfe, 0x10, 0x3a, 0x16, 0x32, 0x1c, 0x38, 0x1c, 0x4e, 0x1c, 0x10, 0x44, 0x00, 0x4c, - 0x04, 0x80, 0x04, 0xea, 0x5c, 0xf0, 0xa7, 0xf0, 0x04, 0xf6, 0x03, 0xfa, 0x05, 0x00, 0x34, 0x00, - 0x36, 0x00, 0x98, 0x00, 0xcc, 0x00, 0x20, 0x01, 0x4e, 0x01, 0x3a, 0x0b, 0x32, 0x0c, 0xf6, 0x0e, - 0x04, 0x10, 0x0c, 0x10, 0x00, 0x11, 0x0a, 0x12, 0x04, 0x13, 0x30, 0x1c, 0x02, 0x48, 0x00, 0x4e, - 0x42, 0x54, 0x44, 0x55, 0xbd, 0x56, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, 0x59, 0xf0, 0xb8, 0xf0, + 0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0x16, 0x18, 0xe4, 0x01, 0x00, 0x48, 0xe4, + 0x18, 0x80, 0x03, 0xf6, 0x02, 0x00, 0xce, 0x19, 0x00, 0xfa, 0xff, 0xff, 0x1c, 0x0f, 0x00, 0xf6, + 0x9e, 0xe7, 0xff, 0x00, 0x82, 0xe7, 0x00, 0xea, 0x01, 0xfa, 0x01, 0xe6, 0x09, 0xe7, 0x55, 0xf0, + 0x01, 0xf6, 0x03, 0x00, 0x04, 0x00, 0x10, 0x00, 0x1e, 0xf0, 0x85, 0xf0, 0x18, 0xf4, 0x08, 0x00, + 0xbc, 0x00, 0x38, 0x54, 0x00, 0xec, 0xd5, 0xf0, 0x82, 0x0d, 0x00, 0xe6, 0x86, 0xf0, 0xb1, 0xf0, + 0x98, 0x57, 0x01, 0xfc, 0xb4, 0x00, 0xd4, 0x01, 0x0c, 0x1c, 0x3e, 0x1c, 0x3c, 0x00, 0xbb, 0x00, + 0x00, 0x10, 0xba, 0x19, 0x02, 0x80, 0x32, 0xf0, 0x7c, 0x0d, 0x02, 0x13, 0xba, 0x13, 0x18, 0x40, + 0x00, 0x57, 0x01, 0xea, 0x02, 0xfc, 0x03, 0xfc, 0x3e, 0x00, 0x6c, 0x01, 0x6e, 0x01, 0x74, 0x01, + 0x76, 0x01, 0xb9, 0x54, 0x3e, 0x57, 0x00, 0x80, 0x03, 0xe6, 0xb6, 0x00, 0xc0, 0x00, 0x01, 0x01, + 0x3e, 0x01, 0x7a, 0x01, 0xca, 0x08, 0xce, 0x10, 0x16, 0x11, 0x04, 0x12, 0x08, 0x12, 0x02, 0x4a, + 0xbb, 0x55, 0x3c, 0x56, 0x03, 0x58, 0x1b, 0x80, 0x30, 0xe4, 0x4b, 0xe4, 0x5d, 0xf0, 0x02, 0xfa, + 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x80, 0x00, 0x24, 0x01, 0x3c, 0x01, 0x68, 0x01, 0x6a, 0x01, + 0x70, 0x01, 0x72, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x62, 0x0a, 0x86, 0x0d, 0x06, 0x13, 0x4c, 0x1c, + 0x04, 0x80, 0x4a, 0xe4, 0x02, 0xee, 0x5b, 0xf0, 0x03, 0xf7, 0x0c, 0x00, 0x0f, 0x00, 0x47, 0x00, + 0xbe, 0x00, 0x00, 0x01, 0x20, 0x11, 0x5c, 0x16, 0x32, 0x1c, 0x38, 0x1c, 0x4e, 0x1c, 0x10, 0x44, + 0x00, 0x4c, 0x04, 0xea, 0x5c, 0xf0, 0xa7, 0xf0, 0x04, 0xf6, 0x03, 0xfa, 0x05, 0x00, 0x34, 0x00, + 0x36, 0x00, 0x98, 0x00, 0xcc, 0x00, 0x20, 0x01, 0x4e, 0x01, 0x4a, 0x0b, 0x42, 0x0c, 0x12, 0x0f, + 0x0c, 0x10, 0x22, 0x11, 0x0a, 0x12, 0x04, 0x13, 0x30, 0x1c, 0x02, 0x48, 0x00, 0x4e, 0x42, 0x54, + 0x44, 0x55, 0xbd, 0x56, 0x06, 0x83, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, 0x59, 0xf0, 0xb8, 0xf0, 0x4b, 0xf4, 0x06, 0xf7, 0x0e, 0xf7, 0x04, 0xfc, 0x05, 0xfc, 0x06, 0x00, 0x19, 0x00, 0x33, 0x00, 0x9b, 0x00, 0xa4, 0x00, 0xb5, 0x00, 0xba, 0x00, 0xd0, 0x00, 0xe1, 0x00, 0xe7, 0x00, 0xe2, 0x03, - 0xec, 0x0e, 0x02, 0x10, 0x0a, 0x10, 0x0a, 0x13, 0x12, 0x13, 0x02, 0x14, 0x12, 0x14, 0xe2, 0x15, - 0xe6, 0x15, 0x82, 0x17, 0x20, 0x1c, 0x34, 0x1c, 0x36, 0x1c, 0x08, 0x44, 0x38, 0x44, 0x91, 0x44, - 0x0a, 0x45, 0x48, 0x46, 0x01, 0x48, 0x68, 0x54, 0x3a, 0x55, 0x83, 0x55, 0xe5, 0x55, 0xb0, 0x57, - 0x01, 0x58, 0x83, 0x59, 0x06, 0x83, 0x19, 0xe4, 0x05, 0xe6, 0x0b, 0xf0, 0x0c, 0xf0, 0x04, 0xf8, + 0x08, 0x0f, 0x02, 0x10, 0x04, 0x10, 0x0a, 0x10, 0x0a, 0x13, 0x0c, 0x13, 0x12, 0x13, 0x24, 0x14, + 0x34, 0x14, 0x04, 0x16, 0x08, 0x16, 0xa4, 0x17, 0x20, 0x1c, 0x34, 0x1c, 0x36, 0x1c, 0x08, 0x44, + 0x38, 0x44, 0x91, 0x44, 0x0a, 0x45, 0x48, 0x46, 0x01, 0x48, 0x68, 0x54, 0x3a, 0x55, 0x83, 0x55, + 0xe5, 0x55, 0xb0, 0x57, 0x01, 0x58, 0x83, 0x59, 0x05, 0xe6, 0x0b, 0xf0, 0x0c, 0xf0, 0x04, 0xf8, 0x05, 0xf8, 0x07, 0x00, 0x0a, 0x00, 0x1c, 0x00, 0x1e, 0x00, 0x9e, 0x00, 0xa8, 0x00, 0xaa, 0x00, 0xb9, 0x00, 0xe0, 0x00, 0x22, 0x01, 0x26, 0x01, 0x79, 0x01, 0x7e, 0x01, 0xc4, 0x01, 0xc6, 0x01, - 0x80, 0x02, 0x66, 0x03, 0xde, 0x04, 0x8a, 0x06, 0xe8, 0x07, 0x68, 0x08, 0x69, 0x08, 0xc6, 0x08, - 0xe9, 0x09, 0xea, 0x0b, 0x12, 0x0f, 0x0e, 0x10, 0x1a, 0x10, 0x26, 0x10, 0xed, 0x10, 0xf1, 0x10, - 0x08, 0x11, 0x06, 0x12, 0x0c, 0x12, 0x10, 0x12, 0x1c, 0x12, 0x0c, 0x13, 0x10, 0x13, 0x16, 0x13, - 0x1e, 0x13, 0x24, 0x14, 0x54, 0x14, 0x14, 0x15, 0xa8, 0x15, 0x6b, 0x18, 0x98, 0x18, 0xa4, 0x18, - 0x6c, 0x19, 0xc0, 0x19, 0x12, 0x1c, 0x46, 0x1c, 0x9c, 0x32, 0xfe, 0x9c, 0xf0, 0x2a, 0x02, 0xfe, - 0x9a, 0x0d, 0xff, 0x10, 0x00, 0x00, 0xd7, 0xfe, 0xc2, 0x19, 0x00, 0xd6, 0xfe, 0x84, 0x01, 0xff, - 0x03, 0x00, 0x00, 0xfe, 0x02, 0x15, 0xfe, 0x0c, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, - 0x00, 0xfe, 0x4c, 0x00, 0x5a, 0xff, 0x04, 0x00, 0x00, 0x11, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, + 0x80, 0x02, 0x5e, 0x03, 0xee, 0x04, 0x9a, 0x06, 0xf8, 0x07, 0x62, 0x08, 0x68, 0x08, 0x69, 0x08, + 0xd6, 0x08, 0xe9, 0x09, 0xfa, 0x0b, 0x2e, 0x0f, 0x12, 0x10, 0x1a, 0x10, 0xed, 0x10, 0xf1, 0x10, + 0x2a, 0x11, 0x06, 0x12, 0x0c, 0x12, 0x3e, 0x12, 0x10, 0x13, 0x16, 0x13, 0x1e, 0x13, 0x46, 0x14, + 0x76, 0x14, 0x82, 0x14, 0x36, 0x15, 0xca, 0x15, 0x6b, 0x18, 0xbe, 0x18, 0xca, 0x18, 0xe6, 0x19, + 0x12, 0x1c, 0x46, 0x1c, 0x9c, 0x32, 0x00, 0x40, 0x0e, 0x47, 0xfe, 0x9c, 0xf0, 0x2b, 0x02, 0xfe, + 0xac, 0x0d, 0xff, 0x10, 0x00, 0x00, 0xd7, 0xfe, 0xe8, 0x19, 0x00, 0xd6, 0xfe, 0x84, 0x01, 0xff, + 0x03, 0x00, 0x00, 0xfe, 0x93, 0x15, 0xfe, 0x0f, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, + 0x00, 0xfe, 0x4c, 0x00, 0x5b, 0xff, 0x04, 0x00, 0x00, 0x11, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, 0x01, 0x01, 0xff, 0x08, 0xff, 0xff, 0xff, 0x27, 0x00, 0x00, 0xff, 0x10, 0xff, 0xff, 0xff, 0x11, 0x00, 0x00, 0xfe, 0x78, 0x56, 0xfe, 0x34, 0x12, 0xff, 0x21, 0x00, 0x00, 0xfe, 0x04, 0xf7, 0xd6, - 0x2b, 0x99, 0x09, 0x01, 0xfe, 0xa0, 0x0f, 0xfe, 0x04, 0xf7, 0xd6, 0x99, 0x09, 0x50, 0x2b, 0xfe, + 0x2c, 0x99, 0x0a, 0x01, 0xfe, 0xc2, 0x0f, 0xfe, 0x04, 0xf7, 0xd6, 0x99, 0x0a, 0x42, 0x2c, 0xfe, 0x3d, 0xf0, 0xfe, 0x06, 0x02, 0xfe, 0x20, 0xf0, 0xa7, 0xfe, 0x91, 0xf0, 0xfe, 0xf4, 0x01, 0xfe, - 0x90, 0xf0, 0xfe, 0xf4, 0x01, 0xfe, 0x8f, 0xf0, 0xa7, 0x03, 0x5c, 0x4c, 0x02, 0xfe, 0xb6, 0x0d, - 0x01, 0xfe, 0x1c, 0x0e, 0xfe, 0xdd, 0x12, 0xfe, 0xfc, 0x10, 0xfe, 0x28, 0x1c, 0x03, 0xfe, 0xa6, - 0x00, 0xfe, 0xd3, 0x12, 0x42, 0x17, 0xfe, 0xa6, 0x00, 0xc0, 0xfe, 0x48, 0xf0, 0xfe, 0x8a, 0x02, + 0x90, 0xf0, 0xfe, 0xf4, 0x01, 0xfe, 0x8f, 0xf0, 0xa7, 0x03, 0x5d, 0x4d, 0x02, 0xfe, 0xc8, 0x0d, + 0x01, 0xfe, 0x38, 0x0e, 0xfe, 0xdd, 0x12, 0xfe, 0xfc, 0x10, 0xfe, 0x28, 0x1c, 0x03, 0xfe, 0xa6, + 0x00, 0xfe, 0xd3, 0x12, 0x41, 0x14, 0xfe, 0xa6, 0x00, 0xc2, 0xfe, 0x48, 0xf0, 0xfe, 0x8a, 0x02, 0xfe, 0x49, 0xf0, 0xfe, 0xa4, 0x02, 0xfe, 0x4a, 0xf0, 0xfe, 0xc2, 0x02, 0xfe, 0x46, 0xf0, 0xfe, 0x54, 0x02, 0xfe, 0x47, 0xf0, 0xfe, 0x5a, 0x02, 0xfe, 0x43, 0xf0, 0xfe, 0x48, 0x02, 0xfe, 0x44, - 0xf0, 0xfe, 0x4c, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x50, 0x02, 0x16, 0x09, 0x88, 0x16, 0x05, 0x17, - 0xa1, 0x02, 0x2a, 0xfe, 0x00, 0x1c, 0xe7, 0xfe, 0x02, 0x1c, 0xe6, 0xfe, 0x1e, 0x1c, 0xfe, 0xe9, - 0x10, 0x01, 0xfe, 0xf6, 0x17, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xce, 0x07, 0x6f, 0x01, 0xa8, - 0x02, 0x2a, 0x14, 0x58, 0x39, 0xa2, 0x01, 0xfe, 0x36, 0x10, 0x07, 0x6f, 0x01, 0x87, 0xfe, 0xbd, - 0x10, 0x07, 0x6f, 0x01, 0x87, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x16, 0x05, - 0x17, 0xa1, 0x2b, 0x1b, 0x2a, 0xfe, 0x3d, 0xf0, 0xfe, 0x06, 0x02, 0x22, 0xfe, 0x98, 0x02, 0xfe, - 0x5a, 0x1c, 0xfa, 0xfe, 0x14, 0x1c, 0x14, 0xfe, 0x30, 0x00, 0x39, 0xa2, 0x01, 0xe5, 0x16, 0x05, - 0x17, 0xa1, 0x02, 0xd7, 0x21, 0x1f, 0x06, 0x11, 0x35, 0xfe, 0x69, 0x10, 0x16, 0x05, 0x17, 0xa1, - 0xfe, 0x04, 0xec, 0x1f, 0x67, 0x43, 0x13, 0x1f, 0xfe, 0x05, 0xf6, 0xce, 0x01, 0xfe, 0x28, 0x17, - 0x0a, 0x53, 0x57, 0x37, 0x12, 0x2f, 0x50, 0xc2, 0x01, 0xfe, 0x60, 0x16, 0x02, 0x2a, 0x07, 0x3d, - 0x01, 0x0e, 0x06, 0x00, 0x4d, 0x01, 0x72, 0xfe, 0x20, 0x10, 0x07, 0xa4, 0x01, 0x0e, 0xfe, 0x41, - 0x58, 0x07, 0x3d, 0x01, 0x0e, 0xfe, 0x49, 0x54, 0x6a, 0xfe, 0x10, 0x03, 0x01, 0xfe, 0x60, 0x16, - 0x02, 0x2a, 0x2b, 0x67, 0xfe, 0x02, 0xe8, 0x29, 0xfe, 0xbf, 0x57, 0xfe, 0x9e, 0x43, 0xfe, 0x77, - 0x57, 0xfe, 0x27, 0xf0, 0xfe, 0xe0, 0x01, 0xfe, 0x07, 0x4b, 0xfe, 0x20, 0xf0, 0xa7, 0xfe, 0x40, - 0x1c, 0x1b, 0xd9, 0xfe, 0x26, 0xf0, 0xfe, 0x62, 0x03, 0xfe, 0xa0, 0xf0, 0xfe, 0x50, 0x03, 0xfe, - 0x11, 0xf0, 0xa7, 0xe3, 0xfe, 0x9f, 0xf0, 0xfe, 0x70, 0x03, 0xfb, 0x10, 0xfe, 0x11, 0x00, 0x02, - 0x64, 0x2b, 0xfe, 0x48, 0x1c, 0xfb, 0x20, 0x21, 0xa3, 0xb5, 0x13, 0xa3, 0x07, 0x3d, 0x01, 0x0e, - 0xb5, 0x77, 0x01, 0xfe, 0x92, 0x16, 0x12, 0xd1, 0x1b, 0xd9, 0xfe, 0x01, 0xf0, 0xd9, 0xfe, 0x82, - 0xf0, 0xfe, 0x96, 0x03, 0xfc, 0x12, 0xfe, 0xe4, 0x00, 0x26, 0xfe, 0xa8, 0x03, 0x1b, 0x34, 0x1c, - 0xfe, 0xb8, 0x03, 0x01, 0x4a, 0xfe, 0x06, 0xf0, 0xfe, 0xc8, 0x03, 0x95, 0x86, 0xfe, 0x0a, 0xf0, - 0xfe, 0x7a, 0x06, 0x02, 0x23, 0x03, 0x6f, 0x27, 0x19, 0xfe, 0xea, 0x04, 0x14, 0x6c, 0x01, 0x36, - 0x7b, 0xfe, 0x6a, 0x02, 0x02, 0xd8, 0xfb, 0x2b, 0x99, 0x18, 0xfe, 0x67, 0x1b, 0xfe, 0xbf, 0x57, - 0xfe, 0x77, 0x57, 0xfe, 0x48, 0x1c, 0x73, 0x01, 0xad, 0x8d, 0x07, 0x3d, 0x01, 0x0e, 0x06, 0x00, - 0x19, 0xda, 0x07, 0xd1, 0x01, 0x0e, 0x8e, 0x4f, 0x63, 0x79, 0x29, 0x03, 0x6f, 0x27, 0xeb, 0x14, - 0x6c, 0x01, 0x36, 0x7b, 0xfe, 0x6a, 0x02, 0x02, 0xd8, 0xc7, 0x81, 0xc8, 0x83, 0x1b, 0x23, 0x26, - 0xfe, 0x40, 0x04, 0x1c, 0xfe, 0x3c, 0x04, 0x3b, 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x46, - 0x12, 0x2c, 0xff, 0x02, 0x00, 0x10, 0x01, 0x0b, 0x1c, 0xfe, 0xd4, 0x04, 0x2c, 0x01, 0x0b, 0x1c, - 0x23, 0x33, 0x31, 0xdd, 0xfe, 0x4c, 0x44, 0xfe, 0x3c, 0x12, 0x4f, 0xfe, 0x44, 0x48, 0x0f, 0x6e, - 0xfe, 0x4c, 0x54, 0x6a, 0xda, 0x67, 0x79, 0x29, 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x52, - 0x13, 0x32, 0x06, 0x82, 0xfe, 0x4a, 0x13, 0xfe, 0x18, 0x10, 0x0f, 0x6e, 0xfe, 0x4c, 0x54, 0x6a, - 0xda, 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x38, 0x13, 0x32, 0x06, 0x82, 0xfe, 0x30, 0x13, - 0x0a, 0x08, 0x2d, 0xec, 0x14, 0x9d, 0x0a, 0x08, 0x05, 0x4c, 0x14, 0xfe, 0x0d, 0x00, 0x01, 0x36, - 0x7b, 0xfe, 0x52, 0x0d, 0x02, 0x23, 0x2c, 0x12, 0xfe, 0xe6, 0x00, 0xfe, 0x1c, 0x90, 0xfe, 0x40, - 0x5c, 0x04, 0x14, 0x9d, 0x01, 0x36, 0x02, 0x2a, 0xfe, 0x42, 0x5b, 0x99, 0x18, 0xfe, 0x46, 0x59, - 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0xfe, 0x87, 0x80, 0xfe, 0x31, 0xe4, 0x5a, 0x0a, 0x08, 0x09, - 0xfe, 0x84, 0x13, 0xfe, 0x20, 0x80, 0x06, 0x18, 0xfe, 0x7c, 0x12, 0x52, 0x08, 0x05, 0xfe, 0x6c, - 0x13, 0x03, 0xfe, 0xa2, 0x00, 0x27, 0x19, 0xfe, 0x80, 0x05, 0xfe, 0x31, 0xe4, 0x59, 0x52, 0x08, - 0x09, 0xfe, 0x56, 0x13, 0x03, 0xfe, 0xa0, 0x00, 0x27, 0xfe, 0x4e, 0x12, 0x66, 0xff, 0x02, 0x00, - 0x10, 0x26, 0xfe, 0x38, 0x05, 0x1b, 0x34, 0xfe, 0x89, 0x48, 0xff, 0x02, 0x00, 0x10, 0x26, 0xfe, - 0x46, 0x05, 0x25, 0xfe, 0x98, 0x05, 0x12, 0xfe, 0xe3, 0x00, 0x20, 0x52, 0xfe, 0x4a, 0xf0, 0xfe, - 0x66, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0x60, 0x05, 0x89, 0x24, 0xfe, 0x21, 0x00, 0xaa, 0x24, 0xfe, - 0x22, 0x00, 0x88, 0x24, 0x57, 0xfe, 0x09, 0x48, 0xff, 0x02, 0x00, 0x10, 0x26, 0xfe, 0x76, 0x05, - 0x25, 0xfe, 0x98, 0x05, 0xfe, 0xe2, 0x08, 0x52, 0x08, 0xcb, 0x4c, 0x01, 0xae, 0x24, 0x05, 0x13, - 0xd3, 0x39, 0xfe, 0x27, 0x01, 0x0a, 0x08, 0x2d, 0xfe, 0x22, 0x12, 0x42, 0x01, 0xb0, 0x14, 0x9d, - 0x0a, 0x08, 0x05, 0x4c, 0x14, 0xfe, 0x0d, 0x00, 0x01, 0x36, 0x7b, 0xfe, 0x52, 0x0d, 0x02, 0x23, - 0x03, 0xfe, 0x9c, 0x00, 0x27, 0xfe, 0x3e, 0x12, 0x03, 0x5b, 0x27, 0xfe, 0x36, 0x13, 0x42, 0x01, - 0xb0, 0x25, 0xfe, 0x08, 0x06, 0x07, 0x05, 0x52, 0x08, 0x1e, 0xfe, 0x02, 0x12, 0x4e, 0x01, 0xfe, - 0x7c, 0x15, 0x1c, 0xfe, 0xfe, 0x05, 0x12, 0xa5, 0x01, 0x4a, 0x12, 0xfe, 0xe5, 0x00, 0x03, 0x5b, - 0xbf, 0x0c, 0x5b, 0x03, 0xcd, 0x27, 0xfe, 0x62, 0x12, 0x03, 0x45, 0x27, 0xfe, 0x5a, 0x13, 0x01, - 0xfe, 0xe6, 0x18, 0x01, 0xfe, 0x50, 0x19, 0xfe, 0x43, 0x48, 0xc4, 0xcc, 0x0f, 0x70, 0xff, 0x02, - 0x00, 0x57, 0x51, 0x93, 0x1d, 0x43, 0x8c, 0xc4, 0x6d, 0x42, 0x01, 0xb0, 0x25, 0xfe, 0x72, 0x06, - 0x52, 0x08, 0x1a, 0xe9, 0x92, 0x07, 0x58, 0x01, 0xfe, 0xaa, 0x15, 0x1c, 0xfe, 0x68, 0x06, 0x12, - 0xa5, 0x01, 0x4a, 0x12, 0xfe, 0xe5, 0x00, 0x03, 0x45, 0xbf, 0x0c, 0x45, 0x16, 0x05, 0x01, 0xb0, - 0xfc, 0x75, 0x73, 0x01, 0xad, 0x8d, 0x12, 0xfe, 0xe2, 0x00, 0x26, 0xdb, 0x1b, 0x34, 0xfe, 0x0a, - 0xf0, 0xfe, 0xa6, 0x06, 0x94, 0xfe, 0x5c, 0x07, 0xfe, 0x06, 0xf0, 0xfe, 0x64, 0x07, 0x95, 0x86, - 0x02, 0x23, 0x0a, 0x08, 0x09, 0xfe, 0x2e, 0x12, 0x15, 0x18, 0x01, 0x0b, 0x15, 0x00, 0x01, 0x0b, - 0x15, 0x00, 0x01, 0x0b, 0x15, 0x00, 0x01, 0x0b, 0xfe, 0x99, 0xa4, 0x01, 0x0b, 0x15, 0x00, 0x02, - 0xfe, 0x32, 0x08, 0x78, 0x08, 0x1a, 0xfe, 0x38, 0x12, 0x0a, 0x08, 0x1a, 0xfe, 0x30, 0x13, 0x15, - 0xfe, 0x1b, 0x00, 0x01, 0x0b, 0x15, 0x00, 0x01, 0x0b, 0x15, 0x00, 0x01, 0x0b, 0x15, 0x00, 0x01, - 0x0b, 0x15, 0x05, 0x01, 0x0b, 0x15, 0x00, 0x02, 0xe1, 0x6b, 0x57, 0xbc, 0x4e, 0xfe, 0x9a, 0x81, - 0x54, 0x2d, 0x7a, 0xfe, 0x32, 0x07, 0x07, 0x2d, 0xfe, 0x09, 0x6f, 0xb8, 0xfe, 0xca, 0x45, 0xfe, - 0x32, 0x12, 0x68, 0x6c, 0x8c, 0x6b, 0x7f, 0x26, 0xfe, 0x44, 0x07, 0x1b, 0x34, 0xfe, 0x0a, 0xf0, - 0xfe, 0x32, 0x07, 0x95, 0x86, 0x94, 0xfe, 0x5c, 0x07, 0x02, 0x23, 0x01, 0x4a, 0x02, 0xdb, 0x15, - 0x1e, 0x02, 0xdb, 0xfe, 0x9c, 0xf7, 0xdc, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x55, 0xfe, 0xca, - 0x07, 0x0c, 0x5f, 0x17, 0x60, 0x0a, 0x53, 0x59, 0x37, 0x21, 0x1f, 0x06, 0x11, 0xfe, 0x0e, 0x12, - 0x8e, 0xfe, 0x80, 0x80, 0x39, 0x1f, 0x69, 0x29, 0xfe, 0x06, 0x10, 0xfe, 0x83, 0xe7, 0xfe, 0x48, - 0x00, 0xaa, 0xfe, 0x03, 0x40, 0x0a, 0x53, 0x5a, 0x37, 0x01, 0xb1, 0xb6, 0xfe, 0x1f, 0x40, 0x13, - 0x61, 0x01, 0xf1, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, 0xfe, 0xc6, 0x51, 0x89, - 0xfe, 0x08, 0x90, 0xfe, 0x8a, 0x90, 0x0c, 0x5d, 0x17, 0x5e, 0xfe, 0x0c, 0x90, 0xfe, 0x8e, 0x90, - 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x0c, 0x3e, 0x17, 0x3f, 0xfe, 0x4a, 0x10, 0x0a, 0x08, 0x59, - 0xfe, 0x2a, 0x12, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x0c, 0x5f, 0x17, 0x60, 0x0a, 0x08, 0x5a, - 0x8c, 0x01, 0xb1, 0xfe, 0x1f, 0x80, 0x13, 0x61, 0xfe, 0x44, 0x90, 0xfe, 0xc6, 0x90, 0x0c, 0x40, - 0x17, 0x41, 0xfe, 0x08, 0x90, 0xfe, 0x8a, 0x90, 0x0c, 0x5d, 0x17, 0x5e, 0xfe, 0x40, 0x90, 0xfe, - 0xc2, 0x90, 0x0c, 0x3e, 0x17, 0x3f, 0x0c, 0x2e, 0x17, 0x3c, 0x20, 0x0c, 0x48, 0x0c, 0x62, 0x0a, - 0x53, 0x1e, 0x37, 0x2b, 0x0f, 0xfe, 0x4e, 0x11, 0x26, 0xfe, 0x52, 0x08, 0xfe, 0x9e, 0xf0, 0xfe, - 0x66, 0x08, 0xba, 0x19, 0x34, 0x2b, 0x76, 0xe6, 0xc5, 0xfe, 0x8a, 0x08, 0xc6, 0xfe, 0xa8, 0x08, - 0x94, 0xfe, 0x7e, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x84, 0x08, 0x95, 0x86, 0x02, 0x23, 0x01, 0x4a, - 0xfe, 0xc9, 0x10, 0x15, 0x1e, 0xfe, 0xc9, 0x10, 0x78, 0x08, 0x05, 0xeb, 0x78, 0x08, 0x09, 0x65, - 0x0a, 0x08, 0x09, 0xfe, 0x90, 0x12, 0xfe, 0x2e, 0x1c, 0x02, 0xfe, 0x08, 0x0b, 0x78, 0x08, 0x05, - 0x65, 0x78, 0x08, 0x09, 0xfe, 0x7a, 0x12, 0xfe, 0x2c, 0x1c, 0xfe, 0xaa, 0xf0, 0xfe, 0xc2, 0x09, - 0xfe, 0xac, 0xf0, 0xfe, 0xf0, 0x08, 0x02, 0xfe, 0xce, 0x09, 0xfe, 0xb7, 0xf0, 0xfe, 0xec, 0x08, - 0xfe, 0x02, 0xf6, 0x1a, 0x4e, 0xfe, 0x70, 0x18, 0xfe, 0xf1, 0x18, 0xfe, 0x40, 0x55, 0xfe, 0xe1, - 0x55, 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, 0xfe, 0x14, 0x59, 0xfe, 0x95, 0x59, 0x1b, 0x85, 0xfe, - 0x8c, 0xf0, 0xfe, 0xec, 0x08, 0xfe, 0xac, 0xf0, 0xfe, 0xe0, 0x08, 0xb3, 0xfe, 0xcb, 0x10, 0xfe, - 0xad, 0xf0, 0xfe, 0xfc, 0x08, 0x02, 0xfe, 0x08, 0x0b, 0xb4, 0xfe, 0xbf, 0x10, 0xfe, 0x2b, 0xf0, - 0x85, 0xf5, 0x1d, 0xfe, 0x00, 0xfe, 0xec, 0xc0, 0xfe, 0xd2, 0xf0, 0x85, 0xfe, 0x76, 0x18, 0x1d, - 0x18, 0x19, 0x85, 0x03, 0xd2, 0x1d, 0x05, 0x19, 0x85, 0xc5, 0x49, 0xc6, 0x49, 0xb3, 0xb4, 0xfe, - 0x89, 0x10, 0x73, 0x66, 0x2c, 0x14, 0x9d, 0x01, 0x36, 0x10, 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, - 0x64, 0x10, 0x80, 0x02, 0x64, 0xfe, 0x98, 0x80, 0xc3, 0x09, 0xfe, 0x1a, 0x12, 0x4f, 0xfe, 0x19, - 0x82, 0xfe, 0x6c, 0x18, 0xfe, 0x44, 0x54, 0xbc, 0xfe, 0x19, 0x81, 0xfe, 0x74, 0x18, 0x90, 0x91, - 0x19, 0xfe, 0xbe, 0x08, 0x02, 0x49, 0x0a, 0x08, 0x59, 0xee, 0x03, 0x2e, 0x28, 0x3c, 0x0c, 0x40, - 0x17, 0x41, 0x9b, 0x2e, 0x9c, 0x3c, 0xfe, 0x6c, 0x18, 0xfe, 0xed, 0x18, 0xfe, 0x44, 0x54, 0xfe, - 0xe5, 0x54, 0x3a, 0x40, 0x3b, 0x41, 0x03, 0x48, 0x28, 0x62, 0x90, 0xfe, 0xe3, 0x54, 0xfe, 0x74, - 0x18, 0xfe, 0xf5, 0x18, 0x90, 0xfe, 0xe3, 0x54, 0x91, 0xbe, 0x55, 0xfe, 0xbe, 0x08, 0x02, 0x49, - 0xfe, 0x37, 0xf0, 0xfe, 0xca, 0x09, 0xfe, 0x8b, 0xf0, 0xfe, 0x50, 0x09, 0x02, 0x49, 0xfe, 0x98, - 0x80, 0xc3, 0x09, 0x22, 0xfe, 0xea, 0x0a, 0x3a, 0x48, 0x3b, 0x62, 0x55, 0xfe, 0x2e, 0x0a, 0x0f, - 0xfe, 0xc0, 0x07, 0x42, 0x98, 0x00, 0xed, 0xfe, 0x01, 0x59, 0xfe, 0x52, 0xf0, 0xfe, 0xfc, 0x09, - 0x90, 0x7a, 0xfe, 0x14, 0x0a, 0x3a, 0x48, 0x90, 0xfe, 0xe3, 0x54, 0x56, 0x48, 0x7d, 0x62, 0xfe, - 0x14, 0x58, 0xfe, 0x95, 0x58, 0x02, 0x49, 0x3a, 0x48, 0x3b, 0x62, 0xfe, 0x14, 0x59, 0xfe, 0x95, - 0x59, 0xbc, 0x56, 0x48, 0x56, 0x62, 0x02, 0x49, 0x0a, 0x08, 0x59, 0xfe, 0x82, 0x12, 0x0a, 0x08, - 0x1e, 0xfe, 0x66, 0x13, 0x21, 0x61, 0xb5, 0xfe, 0x03, 0xa1, 0xfe, 0x83, 0x80, 0xfe, 0xc8, 0x44, - 0xfe, 0x2e, 0x13, 0xfe, 0x04, 0x91, 0xfe, 0x86, 0x91, 0x69, 0x29, 0xfe, 0x40, 0x59, 0xfe, 0xc1, - 0x59, 0x55, 0xdf, 0x03, 0x5f, 0x28, 0x60, 0x0c, 0x7f, 0x17, 0x80, 0x56, 0x5f, 0x7d, 0x60, 0x01, - 0xb1, 0xb6, 0x69, 0x29, 0x13, 0x61, 0x9b, 0x2e, 0x9c, 0x3c, 0x3a, 0x40, 0x3b, 0x41, 0x91, 0xbe, - 0xfe, 0x04, 0xfa, 0x2e, 0xfe, 0x05, 0xfa, 0x3c, 0x01, 0xf1, 0xfe, 0x36, 0x10, 0x20, 0x0c, 0x7f, - 0x0c, 0x80, 0x3a, 0x40, 0x3b, 0x41, 0xfe, 0x12, 0x10, 0x0a, 0x08, 0x1e, 0x19, 0xdf, 0x3a, 0x3e, - 0x3b, 0x3f, 0x0a, 0x08, 0xfe, 0xf7, 0x00, 0x37, 0x03, 0x5d, 0x28, 0x5e, 0xfe, 0x10, 0x58, 0xfe, - 0x91, 0x58, 0x56, 0x48, 0x7d, 0x62, 0x02, 0xfe, 0xe4, 0x09, 0x0a, 0x08, 0x1e, 0x19, 0xdf, 0x0a, - 0x08, 0xfe, 0xf7, 0x00, 0x37, 0xbc, 0xfe, 0x19, 0x81, 0x4e, 0xfe, 0x10, 0x90, 0xfe, 0x92, 0x90, - 0xfe, 0xd3, 0x10, 0x32, 0x06, 0xa6, 0x19, 0xfe, 0xf8, 0x08, 0x12, 0xa6, 0xfe, 0x98, 0x80, 0xc3, - 0x09, 0xfe, 0x14, 0x13, 0x03, 0x3e, 0x28, 0x3f, 0x55, 0xfe, 0xf8, 0x08, 0xfe, 0x0c, 0x58, 0xfe, - 0x8d, 0x58, 0x02, 0x49, 0x20, 0x42, 0xfe, 0x19, 0x80, 0xe7, 0x0a, 0x08, 0x09, 0xfe, 0x1a, 0x12, - 0xf8, 0xfe, 0x19, 0x41, 0xf5, 0xc0, 0xfe, 0xd1, 0xf0, 0xe1, 0x14, 0x7e, 0x01, 0x36, 0x10, 0xfe, - 0x44, 0x00, 0xfe, 0x8e, 0x10, 0xf8, 0x56, 0x3e, 0xfe, 0xed, 0x19, 0x7d, 0x3f, 0xfe, 0x0c, 0x51, - 0xfe, 0x8e, 0x51, 0xf5, 0x1d, 0xfe, 0x00, 0xff, 0x35, 0xfe, 0x74, 0x10, 0xc0, 0xfe, 0xd2, 0xf0, - 0xfe, 0x96, 0x0b, 0xfe, 0x76, 0x18, 0x1d, 0x18, 0x8b, 0x03, 0xd2, 0x1d, 0x05, 0xfe, 0x08, 0x13, - 0x10, 0xfe, 0x16, 0x00, 0x02, 0x64, 0xfe, 0xd1, 0xf0, 0xfe, 0xa8, 0x0b, 0x14, 0x7e, 0x01, 0x36, - 0x10, 0xfe, 0x17, 0x00, 0xfe, 0x42, 0x10, 0xfe, 0xce, 0xf0, 0xfe, 0xae, 0x0b, 0xfe, 0x3c, 0x10, - 0xfe, 0xcd, 0xf0, 0xfe, 0xba, 0x0b, 0x10, 0xfe, 0x22, 0x00, 0x02, 0x64, 0xfe, 0xcb, 0xf0, 0xfe, - 0xc6, 0x0b, 0x10, 0xfe, 0x24, 0x00, 0x02, 0x64, 0xfe, 0xd0, 0xf0, 0xfe, 0xd0, 0x0b, 0x10, 0x9e, - 0xe4, 0xfe, 0xcf, 0xf0, 0xfe, 0xda, 0x0b, 0x10, 0x57, 0xfe, 0x10, 0x10, 0xfe, 0xcc, 0xf0, 0xe1, - 0xfe, 0x84, 0x80, 0xc3, 0x1e, 0x4c, 0x10, 0xfe, 0x12, 0x00, 0x2b, 0x0f, 0xfe, 0x4e, 0x11, 0x26, - 0xfe, 0xf0, 0x0b, 0xfe, 0x9e, 0xf0, 0xfe, 0x04, 0x0c, 0xba, 0x19, 0x34, 0x2b, 0x76, 0xe6, 0xc5, - 0x23, 0xc6, 0x23, 0x2b, 0xfc, 0x26, 0xfe, 0x10, 0x0c, 0x1b, 0x34, 0x94, 0xfe, 0x2c, 0x0c, 0x95, - 0x86, 0xc5, 0xdc, 0xc6, 0xdc, 0x02, 0x23, 0x01, 0x4a, 0xfe, 0xdb, 0x10, 0x12, 0xfe, 0xe8, 0x00, - 0xb3, 0xb4, 0x73, 0xc7, 0x81, 0xc8, 0x83, 0xfe, 0x89, 0xf0, 0x23, 0x33, 0x31, 0xe0, 0xc7, 0x81, - 0xc8, 0x83, 0x26, 0xfe, 0x56, 0x0c, 0x1c, 0x23, 0x33, 0x31, 0xde, 0xba, 0x65, 0x10, 0xfe, 0x42, - 0x00, 0x02, 0x64, 0x7c, 0x05, 0xfe, 0x81, 0x49, 0xfe, 0xa2, 0x12, 0x0a, 0x08, 0x09, 0xfe, 0x44, - 0x13, 0x10, 0x00, 0x54, 0x09, 0xfe, 0x54, 0x12, 0x54, 0xfe, 0x28, 0x00, 0x22, 0xfe, 0x88, 0x0d, - 0x07, 0x3d, 0x01, 0x0e, 0x06, 0x00, 0x4d, 0x44, 0xfe, 0x28, 0x00, 0xfe, 0xe2, 0x10, 0x01, 0xf6, - 0x01, 0xf7, 0x07, 0xa4, 0x01, 0xfe, 0x0a, 0x0f, 0x63, 0x12, 0x2f, 0x01, 0x72, 0x02, 0x2a, 0x10, - 0xfe, 0x44, 0x00, 0x54, 0x09, 0xe9, 0x44, 0x09, 0xfe, 0xb4, 0x10, 0x01, 0xae, 0x44, 0x09, 0xfe, - 0xaa, 0x10, 0x01, 0xae, 0xfe, 0x19, 0x82, 0xfe, 0x34, 0x46, 0xab, 0x44, 0x09, 0x10, 0xfe, 0x43, - 0x00, 0xfe, 0x96, 0x10, 0x0a, 0x53, 0x09, 0x37, 0x01, 0xf6, 0x01, 0xf7, 0x63, 0x12, 0x2f, 0x01, - 0x72, 0x99, 0x09, 0x63, 0x50, 0xc2, 0x02, 0xfe, 0x36, 0x03, 0x0a, 0x08, 0x09, 0x8b, 0x44, 0x09, - 0x10, 0x00, 0xfe, 0x5c, 0x10, 0x78, 0x08, 0x1a, 0xfe, 0x58, 0x12, 0x0a, 0x08, 0x1a, 0xfe, 0x50, - 0x13, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x3e, 0x0d, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, - 0xfe, 0x44, 0x0d, 0x0a, 0x53, 0x1a, 0x37, 0xfe, 0xa9, 0x10, 0x10, 0xfe, 0x15, 0x00, 0xfe, 0x04, - 0xe6, 0x09, 0x4e, 0xfe, 0x2e, 0x10, 0x10, 0xfe, 0x13, 0x00, 0xfe, 0x10, 0x10, 0x10, 0x6e, 0xaa, - 0x10, 0xfe, 0x41, 0x00, 0x88, 0x10, 0xfe, 0x24, 0x00, 0x8d, 0xb3, 0xb4, 0x73, 0x03, 0x6f, 0x27, - 0x22, 0xd8, 0x4e, 0xfe, 0x04, 0xe6, 0x1a, 0xfe, 0x9d, 0x41, 0xfe, 0x1c, 0x42, 0x63, 0x01, 0xe2, - 0x02, 0x2a, 0xfa, 0x14, 0x09, 0x39, 0xa0, 0xb2, 0x14, 0xfe, 0x31, 0x00, 0x39, 0xa2, 0x01, 0xe5, - 0x02, 0xd7, 0x50, 0xfe, 0x06, 0xec, 0xd0, 0xfe, 0x0e, 0x47, 0x44, 0x2d, 0xfe, 0xce, 0x45, 0x35, - 0x50, 0xfe, 0x06, 0xea, 0xd0, 0xfe, 0x47, 0x4b, 0x92, 0xfe, 0x75, 0x57, 0x03, 0x5c, 0xfe, 0x98, - 0x56, 0xfe, 0x2e, 0x12, 0x07, 0x3d, 0x01, 0x0e, 0x42, 0xfe, 0x41, 0x58, 0x07, 0xa4, 0x01, 0x0e, - 0xfe, 0x49, 0x54, 0x96, 0xfe, 0x02, 0x0e, 0x07, 0x47, 0x01, 0x0e, 0xfe, 0x44, 0x48, 0x02, 0xfe, - 0x36, 0x03, 0x07, 0x5c, 0xfe, 0xee, 0x14, 0xfe, 0x0e, 0x47, 0x44, 0x2d, 0xfe, 0xce, 0x45, 0x35, - 0x50, 0xfe, 0xce, 0x47, 0xfe, 0xb7, 0x13, 0x02, 0x2a, 0x21, 0x1f, 0x06, 0x11, 0xfe, 0x9e, 0x12, - 0x20, 0x13, 0x58, 0x13, 0x9f, 0x13, 0xd5, 0x21, 0x2f, 0x42, 0x39, 0x2f, 0xba, 0xed, 0xfe, 0xbc, - 0xf0, 0xfe, 0xc4, 0x0e, 0x0f, 0x05, 0x13, 0x58, 0x01, 0xfe, 0xb8, 0x16, 0x03, 0xfe, 0x38, 0x01, - 0x28, 0xfe, 0x3a, 0x01, 0x55, 0xfe, 0xc8, 0x0e, 0xfe, 0x02, 0xec, 0xd5, 0x68, 0x00, 0x4d, 0xfe, - 0x04, 0xec, 0x1f, 0x67, 0xfe, 0x05, 0xf6, 0xfe, 0x34, 0x01, 0x01, 0xfe, 0x28, 0x17, 0xfe, 0x08, - 0x90, 0xfe, 0x48, 0xf4, 0x0d, 0xfe, 0x18, 0x13, 0xb8, 0xfe, 0x02, 0xea, 0xd5, 0x68, 0x7e, 0xfe, - 0xc5, 0x13, 0x14, 0x1a, 0x39, 0xa0, 0xb2, 0xfe, 0x2e, 0x10, 0x03, 0xfe, 0x38, 0x01, 0x1d, 0xfe, - 0xf0, 0xff, 0x0c, 0xfe, 0x60, 0x01, 0x03, 0xfe, 0x3a, 0x01, 0x0c, 0xfe, 0x62, 0x01, 0x43, 0x13, - 0x1f, 0x24, 0x05, 0x13, 0x2f, 0x12, 0x2f, 0xc2, 0x0f, 0x05, 0x04, 0x20, 0x04, 0x21, 0x58, 0xfe, - 0xf7, 0x12, 0x21, 0x9f, 0xb5, 0x13, 0x9f, 0x06, 0x7e, 0xfe, 0x71, 0x13, 0xfe, 0x24, 0x1c, 0x14, - 0x18, 0x39, 0xa0, 0xb2, 0xfe, 0xd9, 0x10, 0xc1, 0xfe, 0x03, 0xdc, 0xfe, 0x73, 0x57, 0xfe, 0x80, - 0x5d, 0x04, 0xc1, 0xfe, 0x03, 0xdc, 0xfe, 0x5b, 0x57, 0xfe, 0x80, 0x5d, 0x04, 0xfe, 0x03, 0x57, - 0xc1, 0x20, 0xfe, 0x00, 0xcc, 0x04, 0xfe, 0x03, 0x57, 0xc1, 0x77, 0x04, 0x0a, 0x08, 0x57, 0xfe, - 0x22, 0x13, 0xfe, 0x1c, 0x80, 0x06, 0x05, 0xfe, 0x1a, 0x13, 0xfe, 0x1e, 0x80, 0xef, 0xfe, 0x1d, - 0x80, 0xac, 0xfe, 0x0c, 0x90, 0xfe, 0x0e, 0x13, 0xfe, 0x0e, 0x90, 0xab, 0xfe, 0x3c, 0x90, 0xfe, - 0x30, 0xf4, 0x09, 0xfe, 0x3c, 0x50, 0x88, 0x01, 0xfe, 0x58, 0x17, 0x32, 0x06, 0x2f, 0x4d, 0x01, - 0xfe, 0x92, 0x16, 0xfe, 0x08, 0x10, 0x01, 0xf6, 0x01, 0xf7, 0x12, 0xfe, 0xe9, 0x00, 0x0a, 0x08, - 0x57, 0xfe, 0x2c, 0x13, 0x01, 0xfe, 0xea, 0x16, 0xfe, 0x1e, 0x1c, 0xfe, 0x14, 0x90, 0x0c, 0xfe, - 0x64, 0x01, 0xfe, 0x16, 0x90, 0x0c, 0xfe, 0x66, 0x01, 0x0a, 0x08, 0x5a, 0xfe, 0x12, 0x12, 0xfe, - 0x03, 0x80, 0x8e, 0xfe, 0x01, 0xec, 0x1f, 0xfe, 0x80, 0x40, 0x13, 0x1f, 0x69, 0x29, 0x12, 0xcf, - 0x63, 0x21, 0x1f, 0xfe, 0x00, 0x40, 0x79, 0x1f, 0x04, 0xfe, 0x08, 0x1c, 0x03, 0xfe, 0xac, 0x00, - 0xfe, 0x06, 0x58, 0x03, 0xfe, 0xae, 0x00, 0xfe, 0x07, 0x58, 0x03, 0xfe, 0xb0, 0x00, 0xfe, 0x08, - 0x58, 0x03, 0xfe, 0xb2, 0x00, 0xfe, 0x09, 0x58, 0xfe, 0x0a, 0x1c, 0x24, 0x6d, 0x13, 0xd0, 0x20, - 0x0c, 0x5b, 0x0c, 0x45, 0x0f, 0x3d, 0x51, 0x4e, 0x16, 0x2d, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, - 0x22, 0xfe, 0xda, 0x0f, 0x44, 0x11, 0x0f, 0x47, 0x51, 0x16, 0x57, 0xfe, 0x90, 0x4d, 0xfe, 0x91, - 0x54, 0x22, 0xfe, 0xf0, 0x0f, 0x24, 0x11, 0x13, 0x1f, 0x7c, 0x6e, 0x67, 0x21, 0x1f, 0xfe, 0x00, - 0x40, 0x79, 0x1f, 0x12, 0xcf, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, 0x88, 0xfa, 0x73, 0xfe, 0x14, - 0x1c, 0xfe, 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x04, 0x50, 0xfe, 0x0c, 0x14, 0xfe, 0x0e, 0x47, 0xfe, - 0x07, 0xe6, 0x2d, 0xfe, 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x04, 0x01, 0xae, 0x7c, 0x6e, 0x67, 0xfe, - 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x42, 0x13, 0x32, 0x06, 0x2f, 0xfe, 0x34, 0x13, 0x07, 0x47, - 0x01, 0x0e, 0xb9, 0xfe, 0x36, 0x12, 0xfe, 0x41, 0x48, 0xfe, 0x45, 0x48, 0x01, 0xf2, 0xfe, 0x00, - 0xcc, 0xb9, 0xfe, 0xf3, 0x13, 0x43, 0x77, 0x06, 0x11, 0xab, 0x07, 0x84, 0x01, 0x0e, 0xfe, 0x80, - 0x5c, 0x01, 0x72, 0xe3, 0x06, 0x82, 0x65, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0x3e, 0x10, - 0x04, 0xfe, 0x44, 0x58, 0x8e, 0xfe, 0x01, 0xec, 0xa2, 0xfe, 0x9e, 0x40, 0xfe, 0x9d, 0xe7, 0x00, - 0xfe, 0x9c, 0xe7, 0x1a, 0x79, 0x29, 0x01, 0xe2, 0xfe, 0xdd, 0x10, 0x2b, 0xc7, 0x81, 0xc8, 0x83, - 0x33, 0x31, 0xdd, 0x06, 0x1a, 0xfe, 0x48, 0x12, 0x06, 0x09, 0xfe, 0x56, 0x12, 0x06, 0x18, 0xfe, - 0x30, 0x12, 0x06, 0xc9, 0x19, 0xeb, 0x06, 0xfe, 0x23, 0x00, 0x19, 0xec, 0x06, 0x05, 0x19, 0xfe, - 0x7a, 0x12, 0x06, 0x1e, 0xfe, 0x12, 0x12, 0x06, 0x00, 0x19, 0x23, 0x14, 0xc9, 0x01, 0x36, 0xa9, - 0x2c, 0x01, 0x0b, 0x94, 0x4a, 0x04, 0x2c, 0xfe, 0x62, 0x08, 0x07, 0xd1, 0x01, 0xfe, 0x0a, 0x0f, - 0x12, 0x82, 0x02, 0x2a, 0x2c, 0x32, 0x06, 0xa6, 0xfe, 0xd9, 0x13, 0x3a, 0x3e, 0x3b, 0x3f, 0x55, - 0xfe, 0xce, 0x11, 0x0a, 0x08, 0x59, 0xfe, 0x72, 0x12, 0x9b, 0x2e, 0x9c, 0x3c, 0x91, 0xbe, 0x96, - 0xfe, 0x98, 0x11, 0x21, 0x61, 0xfe, 0x26, 0x13, 0x03, 0x7f, 0x28, 0x80, 0x55, 0xfe, 0x64, 0x0d, - 0x0c, 0x5f, 0x17, 0x60, 0x20, 0x0c, 0x7f, 0x0c, 0x80, 0x01, 0xb1, 0x24, 0x6d, 0x76, 0x13, 0x61, - 0x01, 0xf1, 0x9b, 0x2e, 0x9c, 0x3c, 0xfe, 0x04, 0x55, 0xfe, 0xa5, 0x55, 0xfe, 0x04, 0xfa, 0x2e, - 0xfe, 0x05, 0xfa, 0x3c, 0xfe, 0x91, 0x10, 0x03, 0x40, 0x28, 0x41, 0xfe, 0x40, 0x56, 0xfe, 0xe1, - 0x56, 0x0c, 0x40, 0x17, 0x41, 0x89, 0x9b, 0x2e, 0x9c, 0x3c, 0x91, 0xbe, 0x03, 0x5d, 0x28, 0x5e, - 0xfe, 0x00, 0x56, 0xfe, 0xa1, 0x56, 0x0c, 0x5d, 0x17, 0x5e, 0x0a, 0x08, 0x59, 0xfe, 0x1e, 0x12, - 0x21, 0x61, 0xfe, 0x1f, 0x40, 0x03, 0x5f, 0x28, 0x60, 0xfe, 0x2c, 0x50, 0xfe, 0xae, 0x50, 0x03, - 0x40, 0x28, 0x41, 0xfe, 0x44, 0x50, 0xfe, 0xc6, 0x50, 0x03, 0x5d, 0x28, 0x5e, 0xfe, 0x08, 0x50, - 0xfe, 0x8a, 0x50, 0x03, 0x3e, 0x28, 0x3f, 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x02, 0x8a, 0x24, - 0x05, 0x13, 0xd4, 0x02, 0x71, 0x2c, 0x01, 0x0b, 0x1c, 0x4b, 0x33, 0x31, 0xdd, 0x06, 0x05, 0x22, - 0x4b, 0x32, 0x06, 0xa6, 0x22, 0x71, 0x01, 0xad, 0x1d, 0x43, 0x19, 0x4b, 0x0a, 0x08, 0x09, 0xf0, - 0x3a, 0x3e, 0x3b, 0x3f, 0xfe, 0x0a, 0x55, 0x35, 0xfe, 0x8b, 0x55, 0x56, 0x3e, 0x7d, 0x3f, 0xfe, - 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0x02, 0x71, 0xfe, 0x19, 0x81, 0xb8, 0xfe, 0x19, 0x41, 0x02, 0x71, - 0x2c, 0x01, 0x0b, 0x1b, 0x34, 0x1c, 0xe8, 0x33, 0x31, 0xe0, 0x54, 0x18, 0xfe, 0xa6, 0x12, 0x54, - 0x09, 0x4c, 0x02, 0x4b, 0x01, 0x0b, 0x1b, 0x34, 0x1c, 0xe8, 0x33, 0x31, 0xde, 0x06, 0x18, 0x22, - 0x4b, 0x01, 0x0b, 0x1c, 0xe8, 0x33, 0x31, 0xfe, 0xe8, 0x09, 0xfe, 0xc2, 0x49, 0x4f, 0x03, 0xfe, - 0x9c, 0x00, 0x27, 0x8b, 0x52, 0x08, 0x1e, 0x35, 0xa9, 0xfe, 0xbb, 0x45, 0x54, 0x00, 0x65, 0x44, - 0x05, 0x7c, 0x43, 0xfe, 0xda, 0x14, 0x01, 0xad, 0x8d, 0xfe, 0x4b, 0x45, 0xf0, 0x32, 0x06, 0xa5, - 0xef, 0x03, 0xcd, 0x27, 0x8b, 0x03, 0x45, 0x27, 0x35, 0x66, 0x02, 0x71, 0xfe, 0xc0, 0x5d, 0xfe, - 0xf8, 0x14, 0xfe, 0x03, 0x17, 0x03, 0x5b, 0xbf, 0x0c, 0x5b, 0x66, 0x2c, 0x01, 0x0b, 0x25, 0x8a, - 0x01, 0xfe, 0x7c, 0x15, 0x02, 0x8a, 0x01, 0x0b, 0x1b, 0x34, 0x1c, 0x4b, 0x33, 0x31, 0xde, 0x06, - 0x05, 0x22, 0x4b, 0x01, 0xfe, 0x60, 0x14, 0xfe, 0x42, 0x58, 0xfe, 0x82, 0x14, 0xfe, 0xa4, 0x14, - 0x8d, 0xfe, 0x4a, 0xf4, 0x09, 0x19, 0x4b, 0xfe, 0x4a, 0xf4, 0x05, 0xea, 0x32, 0x06, 0xa5, 0x8c, - 0x02, 0x71, 0x03, 0x45, 0xbf, 0x0c, 0x45, 0x66, 0x2c, 0x01, 0x0b, 0x25, 0x8a, 0x01, 0xfe, 0xaa, - 0x15, 0x02, 0x8a, 0x0f, 0x05, 0x26, 0xfe, 0x9c, 0x13, 0x25, 0xfe, 0xb2, 0x13, 0x75, 0xfe, 0x89, - 0x48, 0x01, 0x0b, 0x20, 0x75, 0x04, 0x7b, 0xfe, 0xae, 0x13, 0x1b, 0xfe, 0xae, 0x13, 0x1c, 0xfe, - 0x9c, 0x13, 0x66, 0x2c, 0x01, 0x0b, 0xfe, 0xd5, 0x10, 0x0f, 0x70, 0xff, 0x02, 0x00, 0x57, 0x51, - 0x93, 0x1d, 0xfe, 0xff, 0x7f, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x04, 0x0f, 0x70, 0xff, 0x02, - 0x00, 0x57, 0x51, 0x93, 0x1d, 0x43, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x04, 0x0f, 0x70, 0xff, - 0x02, 0x00, 0x57, 0x51, 0x93, 0x04, 0x0f, 0x70, 0xff, 0x02, 0x00, 0x57, 0x51, 0x93, 0xfe, 0x0b, - 0x58, 0x04, 0x07, 0x5b, 0x01, 0x87, 0x07, 0x45, 0x01, 0x87, 0x04, 0xfe, 0x03, 0xa1, 0x1d, 0x11, - 0xff, 0x03, 0x00, 0x54, 0xfe, 0x00, 0xf4, 0x1e, 0x51, 0xfe, 0x00, 0x7d, 0xfe, 0x01, 0x7d, 0xfe, - 0x02, 0x7d, 0xfe, 0x03, 0x7c, 0x69, 0x29, 0x0c, 0x5d, 0x17, 0x5e, 0x56, 0x40, 0x7d, 0x41, 0x04, - 0xfe, 0x62, 0x08, 0xfe, 0x82, 0x4a, 0xfe, 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x8e, 0x04, 0x01, 0xfe, - 0xe6, 0x18, 0xfe, 0x42, 0x48, 0x4e, 0x4f, 0x92, 0x01, 0x0b, 0x1c, 0xfe, 0x74, 0x15, 0x33, 0x31, - 0xe0, 0x01, 0x0b, 0x1c, 0xfe, 0x74, 0x15, 0x33, 0x31, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, 0x59, 0x03, - 0xcd, 0x27, 0xfe, 0xcc, 0x12, 0x52, 0x08, 0x1a, 0xfe, 0xc4, 0x13, 0x20, 0x68, 0x1a, 0xf0, 0x54, - 0xca, 0x6a, 0xfe, 0xba, 0x14, 0x4c, 0x0f, 0x05, 0x16, 0xca, 0x7c, 0x30, 0xfe, 0x78, 0x10, 0xff, - 0x02, 0x83, 0x55, 0xaa, 0xff, 0x02, 0x83, 0x55, 0x68, 0x18, 0xac, 0x98, 0xfe, 0x30, 0x00, 0x96, - 0xf3, 0x16, 0x6c, 0x0f, 0x05, 0xfe, 0x56, 0x10, 0x68, 0x09, 0xef, 0x98, 0xfe, 0x64, 0x00, 0x96, - 0xf3, 0x07, 0xfe, 0x64, 0x00, 0x16, 0x9e, 0x0f, 0x05, 0xfe, 0x28, 0x10, 0x68, 0x05, 0xfe, 0x60, - 0x13, 0x98, 0xfe, 0xc8, 0x00, 0x96, 0xf3, 0x07, 0xfe, 0xc8, 0x00, 0x16, 0x58, 0x0f, 0x05, 0x89, - 0x98, 0xfe, 0x90, 0x01, 0x7a, 0xfe, 0x20, 0x15, 0x92, 0xfe, 0x12, 0x10, 0xfe, 0x43, 0xf4, 0x9f, - 0xfe, 0x56, 0xf0, 0xfe, 0x32, 0x15, 0xfe, 0x04, 0xf4, 0x70, 0xfe, 0x43, 0xf4, 0x9e, 0xfe, 0xf3, - 0x10, 0xfe, 0x40, 0x5c, 0x01, 0xfe, 0xf4, 0x13, 0x1d, 0x43, 0xee, 0xfe, 0x00, 0x17, 0xfe, 0x4d, - 0xe4, 0x6d, 0x7a, 0xfe, 0x6e, 0x15, 0xc4, 0x6d, 0xfe, 0x1c, 0x10, 0xfe, 0x00, 0x17, 0xfe, 0x4d, - 0xe4, 0xcc, 0x7a, 0xfe, 0x6e, 0x15, 0xc4, 0xcc, 0x89, 0x4f, 0x20, 0xfe, 0x4d, 0xf4, 0x00, 0xe9, - 0x92, 0x0f, 0x05, 0xfe, 0xb4, 0x56, 0xfe, 0xc3, 0x58, 0x04, 0x4f, 0x0f, 0x09, 0x04, 0x15, 0x05, - 0x01, 0x0b, 0x25, 0xf4, 0x15, 0x09, 0x01, 0x0b, 0x25, 0xf4, 0x15, 0x18, 0x01, 0x0b, 0x25, 0xf4, - 0x75, 0xfe, 0x89, 0x49, 0x01, 0x0b, 0x04, 0x15, 0x05, 0x01, 0x0b, 0x25, 0xaf, 0x15, 0x18, 0x01, - 0x0b, 0x25, 0xaf, 0x15, 0x05, 0x01, 0x0b, 0x25, 0xaf, 0xfe, 0x89, 0x49, 0x01, 0x0b, 0x25, 0xaf, - 0x75, 0xfe, 0x89, 0x4a, 0x01, 0x0b, 0x04, 0x4f, 0x04, 0x21, 0xd3, 0x06, 0x05, 0xfe, 0x48, 0x13, - 0xb6, 0x13, 0xd3, 0xfe, 0x49, 0xf4, 0x00, 0x4c, 0x75, 0xa9, 0x66, 0xfe, 0x01, 0xec, 0xfe, 0x27, - 0x01, 0xfe, 0x89, 0x48, 0xff, 0x02, 0x00, 0x10, 0x26, 0xfe, 0x0c, 0x16, 0x32, 0x06, 0xfe, 0xe3, - 0x00, 0xfe, 0x20, 0x13, 0x1c, 0xfe, 0x30, 0x16, 0x20, 0x13, 0xd4, 0x01, 0x4a, 0x21, 0xd4, 0x06, - 0x05, 0x65, 0x0a, 0x53, 0x05, 0x37, 0x04, 0x07, 0x47, 0x01, 0x0e, 0xfe, 0x00, 0x40, 0x8f, 0x06, - 0x11, 0xac, 0x07, 0x84, 0x01, 0x0e, 0x8f, 0x07, 0x5c, 0x01, 0xa8, 0x04, 0x07, 0x84, 0x01, 0x0e, - 0x8f, 0xfe, 0x80, 0xe7, 0x11, 0x06, 0x11, 0x8b, 0xfe, 0x45, 0x58, 0x01, 0xf2, 0x8f, 0x04, 0x07, - 0x47, 0x01, 0x0e, 0x8f, 0x07, 0x5c, 0x01, 0xa8, 0x04, 0x07, 0x47, 0x01, 0x0e, 0xfe, 0x80, 0x80, - 0xfe, 0x80, 0x4c, 0xfe, 0x49, 0xe4, 0x11, 0xac, 0x07, 0x84, 0x01, 0x0e, 0xfe, 0x80, 0x4c, 0x07, - 0x5c, 0x01, 0x87, 0x04, 0x16, 0x11, 0x74, 0x6b, 0xfe, 0x60, 0x01, 0xfe, 0x18, 0xdf, 0xfe, 0x19, - 0xde, 0xfe, 0x24, 0x1c, 0xfe, 0x1d, 0xf7, 0x2d, 0x97, 0xfe, 0xcc, 0x16, 0x01, 0xfe, 0xd2, 0x17, - 0xed, 0x9a, 0x2d, 0x6b, 0xfe, 0x2c, 0x01, 0xfe, 0x2f, 0x19, 0x04, 0xb7, 0x22, 0xfe, 0xbc, 0x16, - 0xfe, 0xda, 0x10, 0x16, 0x11, 0x74, 0x03, 0xfe, 0x64, 0x01, 0xfe, 0x00, 0xf4, 0x1e, 0xfe, 0x18, - 0x58, 0x03, 0xfe, 0x66, 0x01, 0xfe, 0x19, 0x58, 0x9a, 0x1e, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, - 0x05, 0xfe, 0x3c, 0x50, 0x6b, 0xfe, 0x38, 0x00, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x1e, 0x97, - 0xfe, 0x16, 0x17, 0xfe, 0xb6, 0x14, 0x35, 0x04, 0xb7, 0x22, 0xfe, 0xee, 0x16, 0xfe, 0x9c, 0x10, - 0x16, 0x11, 0x74, 0xfe, 0x83, 0x5a, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, 0xf7, 0x2e, - 0x97, 0xfe, 0x38, 0x17, 0xfe, 0x94, 0x14, 0xee, 0x9a, 0x2e, 0x6b, 0x1a, 0xfe, 0xaf, 0x19, 0xfe, - 0x98, 0xe7, 0x00, 0x04, 0xb7, 0x22, 0xfe, 0x2c, 0x17, 0xfe, 0x6c, 0x10, 0x16, 0x11, 0x74, 0xfe, - 0x30, 0xbc, 0xfe, 0xb2, 0xbc, 0x9a, 0xcb, 0x6b, 0x1a, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0xcb, - 0x97, 0xfe, 0x70, 0x17, 0xfe, 0x5c, 0x14, 0x35, 0x04, 0xb7, 0x22, 0xfe, 0x5c, 0x17, 0xfe, 0x42, - 0x10, 0xfe, 0x02, 0xf6, 0x11, 0x74, 0xfe, 0x18, 0xfe, 0x5f, 0xfe, 0x19, 0xfe, 0x60, 0xfe, 0x03, - 0xa1, 0xfe, 0x1d, 0xf7, 0x5a, 0x97, 0xfe, 0x96, 0x17, 0xfe, 0x36, 0x14, 0xfe, 0x1c, 0x13, 0x9a, - 0x5a, 0x42, 0xfe, 0x83, 0x58, 0xfe, 0xaf, 0x19, 0xfe, 0x80, 0xe7, 0x11, 0xfe, 0x81, 0xe7, 0x11, - 0x12, 0xfe, 0xdd, 0x00, 0x69, 0x29, 0x04, 0x69, 0x29, 0xfe, 0x12, 0x45, 0x22, 0xfe, 0x86, 0x17, - 0x14, 0x05, 0x39, 0xa0, 0xb2, 0x02, 0x2a, 0xfe, 0x39, 0xf0, 0xfe, 0xda, 0x17, 0x20, 0x04, 0xfe, - 0x7e, 0x18, 0x1d, 0x18, 0x4d, 0x0f, 0x0d, 0x04, 0x74, 0x03, 0xd2, 0x1d, 0x05, 0xfe, 0xef, 0x12, - 0xfe, 0xe1, 0x10, 0x7c, 0x6e, 0x67, 0x32, 0x06, 0x2f, 0xfe, 0x3c, 0x13, 0xfe, 0x7e, 0x14, 0xfe, - 0x42, 0x13, 0x50, 0xc2, 0x07, 0x47, 0x01, 0x0e, 0xb9, 0xfe, 0x3e, 0x12, 0xfe, 0x41, 0x48, 0xfe, - 0x45, 0x48, 0x01, 0xf2, 0xfe, 0x00, 0xcc, 0xb9, 0xfe, 0xf3, 0x13, 0x43, 0x77, 0x06, 0x11, 0xab, - 0x07, 0x84, 0x01, 0x0e, 0xfe, 0x80, 0x4c, 0x01, 0x72, 0xfe, 0x16, 0x10, 0x06, 0x82, 0x8c, 0xfe, - 0x3c, 0x14, 0xfe, 0x24, 0x12, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0xfa, 0x17, 0x16, 0x09, - 0x04, 0xfe, 0x9c, 0xe7, 0x09, 0x10, 0xfe, 0x15, 0x00, 0x63, 0x79, 0x29, 0x01, 0xe2, 0x16, 0x05, - 0x04, 0x0a, 0x53, 0x2d, 0x37, 0x12, 0x2f, 0x01, 0x72, 0x16, 0x05, 0x04, 0xfe, 0x38, 0x90, 0xfe, - 0xba, 0x90, 0x3a, 0xce, 0x3b, 0xcf, 0xfe, 0x48, 0x55, 0x35, 0xfe, 0xc9, 0x55, 0x04, 0x21, 0xa3, - 0x76, 0x13, 0xa3, 0x04, 0x07, 0xa4, 0x01, 0x0e, 0xfe, 0x41, 0x48, 0x07, 0x3d, 0x01, 0x0e, 0xfe, - 0x49, 0x44, 0x19, 0xfe, 0xc2, 0x18, 0x76, 0x77, 0x04, 0x07, 0x47, 0x01, 0x0e, 0x06, 0x11, 0x65, - 0x07, 0x5c, 0x01, 0xa8, 0x07, 0x3d, 0x01, 0x0e, 0x76, 0x77, 0x04, 0xfe, 0x4e, 0xe4, 0x18, 0x6a, - 0xfe, 0xf6, 0x18, 0x03, 0xfe, 0x90, 0x00, 0xfe, 0x3a, 0x45, 0xfe, 0x2c, 0x10, 0xfe, 0x4e, 0xe4, - 0xc9, 0x6a, 0xfe, 0x08, 0x19, 0x03, 0xfe, 0x92, 0x00, 0xfe, 0x02, 0xe6, 0x1a, 0xe4, 0xfe, 0x4e, - 0xe4, 0xfe, 0x0b, 0x00, 0x6a, 0xfe, 0x1a, 0x19, 0x03, 0xfe, 0x94, 0x00, 0xfe, 0x02, 0xe6, 0x1e, - 0xfe, 0x08, 0x10, 0x03, 0xfe, 0x96, 0x00, 0xfe, 0x02, 0xe6, 0x6c, 0xfe, 0x4e, 0x45, 0xea, 0xb8, - 0xff, 0x04, 0x68, 0x54, 0xe7, 0x1d, 0x6d, 0xfe, 0x08, 0x1c, 0xfe, 0x67, 0x19, 0xfe, 0x0a, 0x1c, - 0xfe, 0x1a, 0xf4, 0xfe, 0x00, 0x04, 0xea, 0xfe, 0x48, 0xf4, 0x18, 0x7a, 0xfe, 0x4e, 0x19, 0x0f, - 0x18, 0x04, 0x06, 0x7e, 0xfe, 0x5a, 0xf0, 0xfe, 0x5e, 0x19, 0x24, 0xfe, 0x09, 0x00, 0xfe, 0x34, - 0x10, 0x06, 0x1a, 0xfe, 0x5a, 0xf0, 0xf8, 0x24, 0xca, 0xe5, 0x06, 0x18, 0x4d, 0x24, 0x6c, 0xe4, - 0x06, 0x09, 0x4d, 0x24, 0x9e, 0xe3, 0x06, 0x05, 0x4d, 0x24, 0x58, 0xa9, 0xb6, 0x04, 0x14, 0xfe, - 0x09, 0x00, 0x01, 0x36, 0xfe, 0x04, 0xfe, 0x81, 0x03, 0x83, 0xfe, 0x40, 0x5c, 0x04, 0x1b, 0xf9, - 0xfe, 0x14, 0xf0, 0x0b, 0x26, 0xfe, 0xb0, 0x19, 0x1b, 0xf9, 0x7b, 0xf9, 0xfe, 0x82, 0xf0, 0xfe, - 0xb4, 0x19, 0x04, 0xff, 0xdf, 0x00, 0x00, + 0xf0, 0xfe, 0x4c, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x50, 0x02, 0x18, 0x0a, 0xaa, 0x18, 0x06, 0x14, + 0xa1, 0x02, 0x2b, 0xfe, 0x00, 0x1c, 0xe7, 0xfe, 0x02, 0x1c, 0xe6, 0xfe, 0x1e, 0x1c, 0xfe, 0xe9, + 0x10, 0x01, 0xfe, 0x18, 0x18, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xce, 0x09, 0x70, 0x01, 0xa8, + 0x02, 0x2b, 0x15, 0x59, 0x39, 0xa2, 0x01, 0xfe, 0x58, 0x10, 0x09, 0x70, 0x01, 0x87, 0xfe, 0xbd, + 0x10, 0x09, 0x70, 0x01, 0x87, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x18, 0x06, + 0x14, 0xa1, 0x2c, 0x1c, 0x2b, 0xfe, 0x3d, 0xf0, 0xfe, 0x06, 0x02, 0x23, 0xfe, 0x98, 0x02, 0xfe, + 0x5a, 0x1c, 0xf8, 0xfe, 0x14, 0x1c, 0x15, 0xfe, 0x30, 0x00, 0x39, 0xa2, 0x01, 0xfe, 0x48, 0x10, + 0x18, 0x06, 0x14, 0xa1, 0x02, 0xd7, 0x22, 0x20, 0x07, 0x11, 0x35, 0xfe, 0x69, 0x10, 0x18, 0x06, + 0x14, 0xa1, 0xfe, 0x04, 0xec, 0x20, 0x4f, 0x43, 0x13, 0x20, 0xfe, 0x05, 0xf6, 0xce, 0x01, 0xfe, + 0x4a, 0x17, 0x08, 0x54, 0x58, 0x37, 0x12, 0x2f, 0x42, 0x92, 0x01, 0xfe, 0x82, 0x16, 0x02, 0x2b, + 0x09, 0x46, 0x01, 0x0e, 0x07, 0x00, 0x66, 0x01, 0x73, 0xfe, 0x18, 0x10, 0xfe, 0x41, 0x58, 0x09, + 0xa4, 0x01, 0x0e, 0xfe, 0xc8, 0x54, 0x6b, 0xfe, 0x10, 0x03, 0x01, 0xfe, 0x82, 0x16, 0x02, 0x2b, + 0x2c, 0x4f, 0xfe, 0x02, 0xe8, 0x2a, 0xfe, 0xbf, 0x57, 0xfe, 0x9e, 0x43, 0xfe, 0x77, 0x57, 0xfe, + 0x27, 0xf0, 0xfe, 0xe0, 0x01, 0xfe, 0x07, 0x4b, 0xfe, 0x20, 0xf0, 0xa7, 0xfe, 0x40, 0x1c, 0x1c, + 0xd9, 0xfe, 0x26, 0xf0, 0xfe, 0x5a, 0x03, 0xfe, 0xa0, 0xf0, 0xfe, 0x48, 0x03, 0xfe, 0x11, 0xf0, + 0xa7, 0xfe, 0xef, 0x10, 0xfe, 0x9f, 0xf0, 0xfe, 0x68, 0x03, 0xf9, 0x10, 0xfe, 0x11, 0x00, 0x02, + 0x65, 0x2c, 0xfe, 0x48, 0x1c, 0xf9, 0x08, 0x05, 0x1b, 0xfe, 0x18, 0x13, 0x21, 0x22, 0xa3, 0xb7, + 0x13, 0xa3, 0x09, 0x46, 0x01, 0x0e, 0xb7, 0x78, 0x01, 0xfe, 0xb4, 0x16, 0x12, 0xd1, 0x1c, 0xd9, + 0xfe, 0x01, 0xf0, 0xd9, 0xfe, 0x82, 0xf0, 0xfe, 0x96, 0x03, 0xfa, 0x12, 0xfe, 0xe4, 0x00, 0x27, + 0xfe, 0xa8, 0x03, 0x1c, 0x34, 0x1d, 0xfe, 0xb8, 0x03, 0x01, 0x4b, 0xfe, 0x06, 0xf0, 0xfe, 0xc8, + 0x03, 0x95, 0x86, 0xfe, 0x0a, 0xf0, 0xfe, 0x8a, 0x06, 0x02, 0x24, 0x03, 0x70, 0x28, 0x17, 0xfe, + 0xfa, 0x04, 0x15, 0x6d, 0x01, 0x36, 0x7b, 0xfe, 0x6a, 0x02, 0x02, 0xd8, 0xf9, 0x2c, 0x99, 0x19, + 0xfe, 0x67, 0x1b, 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0xfe, 0x48, 0x1c, 0x74, 0x01, 0xaf, 0x8c, + 0x09, 0x46, 0x01, 0x0e, 0x07, 0x00, 0x17, 0xda, 0x09, 0xd1, 0x01, 0x0e, 0x8d, 0x51, 0x64, 0x79, + 0x2a, 0x03, 0x70, 0x28, 0xfe, 0x10, 0x12, 0x15, 0x6d, 0x01, 0x36, 0x7b, 0xfe, 0x6a, 0x02, 0x02, + 0xd8, 0xc7, 0x81, 0xc8, 0x83, 0x1c, 0x24, 0x27, 0xfe, 0x40, 0x04, 0x1d, 0xfe, 0x3c, 0x04, 0x3b, + 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x4e, 0x12, 0x2d, 0xff, 0x02, 0x00, 0x10, 0x01, 0x0b, + 0x1d, 0xfe, 0xe4, 0x04, 0x2d, 0x01, 0x0b, 0x1d, 0x24, 0x33, 0x31, 0xde, 0xfe, 0x4c, 0x44, 0xfe, + 0x4c, 0x12, 0x51, 0xfe, 0x44, 0x48, 0x0f, 0x6f, 0xfe, 0x4c, 0x54, 0x6b, 0xda, 0x4f, 0x79, 0x2a, + 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x62, 0x13, 0x08, 0x05, 0x1b, 0xfe, 0x2a, 0x13, 0x32, + 0x07, 0x82, 0xfe, 0x52, 0x13, 0xfe, 0x20, 0x10, 0x0f, 0x6f, 0xfe, 0x4c, 0x54, 0x6b, 0xda, 0xfe, + 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x40, 0x13, 0x08, 0x05, 0x1b, 0xfe, 0x08, 0x13, 0x32, 0x07, + 0x82, 0xfe, 0x30, 0x13, 0x08, 0x05, 0x1b, 0xfe, 0x1c, 0x12, 0x15, 0x9d, 0x08, 0x05, 0x06, 0x4d, + 0x15, 0xfe, 0x0d, 0x00, 0x01, 0x36, 0x7b, 0xfe, 0x64, 0x0d, 0x02, 0x24, 0x2d, 0x12, 0xfe, 0xe6, + 0x00, 0xfe, 0x1c, 0x90, 0xfe, 0x40, 0x5c, 0x04, 0x15, 0x9d, 0x01, 0x36, 0x02, 0x2b, 0xfe, 0x42, + 0x5b, 0x99, 0x19, 0xfe, 0x46, 0x59, 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0xfe, 0x87, 0x80, 0xfe, + 0x31, 0xe4, 0x5b, 0x08, 0x05, 0x0a, 0xfe, 0x84, 0x13, 0xfe, 0x20, 0x80, 0x07, 0x19, 0xfe, 0x7c, + 0x12, 0x53, 0x05, 0x06, 0xfe, 0x6c, 0x13, 0x03, 0xfe, 0xa2, 0x00, 0x28, 0x17, 0xfe, 0x90, 0x05, + 0xfe, 0x31, 0xe4, 0x5a, 0x53, 0x05, 0x0a, 0xfe, 0x56, 0x13, 0x03, 0xfe, 0xa0, 0x00, 0x28, 0xfe, + 0x4e, 0x12, 0x67, 0xff, 0x02, 0x00, 0x10, 0x27, 0xfe, 0x48, 0x05, 0x1c, 0x34, 0xfe, 0x89, 0x48, + 0xff, 0x02, 0x00, 0x10, 0x27, 0xfe, 0x56, 0x05, 0x26, 0xfe, 0xa8, 0x05, 0x12, 0xfe, 0xe3, 0x00, + 0x21, 0x53, 0xfe, 0x4a, 0xf0, 0xfe, 0x76, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0x70, 0x05, 0x88, 0x25, + 0xfe, 0x21, 0x00, 0xab, 0x25, 0xfe, 0x22, 0x00, 0xaa, 0x25, 0x58, 0xfe, 0x09, 0x48, 0xff, 0x02, + 0x00, 0x10, 0x27, 0xfe, 0x86, 0x05, 0x26, 0xfe, 0xa8, 0x05, 0xfe, 0xe2, 0x08, 0x53, 0x05, 0xcb, + 0x4d, 0x01, 0xb0, 0x25, 0x06, 0x13, 0xd3, 0x39, 0xfe, 0x27, 0x01, 0x08, 0x05, 0x1b, 0xfe, 0x22, + 0x12, 0x41, 0x01, 0xb2, 0x15, 0x9d, 0x08, 0x05, 0x06, 0x4d, 0x15, 0xfe, 0x0d, 0x00, 0x01, 0x36, + 0x7b, 0xfe, 0x64, 0x0d, 0x02, 0x24, 0x03, 0xfe, 0x9c, 0x00, 0x28, 0xeb, 0x03, 0x5c, 0x28, 0xfe, + 0x36, 0x13, 0x41, 0x01, 0xb2, 0x26, 0xfe, 0x18, 0x06, 0x09, 0x06, 0x53, 0x05, 0x1f, 0xfe, 0x02, + 0x12, 0x50, 0x01, 0xfe, 0x9e, 0x15, 0x1d, 0xfe, 0x0e, 0x06, 0x12, 0xa5, 0x01, 0x4b, 0x12, 0xfe, + 0xe5, 0x00, 0x03, 0x5c, 0xc1, 0x0c, 0x5c, 0x03, 0xcd, 0x28, 0xfe, 0x62, 0x12, 0x03, 0x45, 0x28, + 0xfe, 0x5a, 0x13, 0x01, 0xfe, 0x0c, 0x19, 0x01, 0xfe, 0x76, 0x19, 0xfe, 0x43, 0x48, 0xc4, 0xcc, + 0x0f, 0x71, 0xff, 0x02, 0x00, 0x57, 0x52, 0x93, 0x1e, 0x43, 0x8b, 0xc4, 0x6e, 0x41, 0x01, 0xb2, + 0x26, 0xfe, 0x82, 0x06, 0x53, 0x05, 0x1a, 0xe9, 0x91, 0x09, 0x59, 0x01, 0xfe, 0xcc, 0x15, 0x1d, + 0xfe, 0x78, 0x06, 0x12, 0xa5, 0x01, 0x4b, 0x12, 0xfe, 0xe5, 0x00, 0x03, 0x45, 0xc1, 0x0c, 0x45, + 0x18, 0x06, 0x01, 0xb2, 0xfa, 0x76, 0x74, 0x01, 0xaf, 0x8c, 0x12, 0xfe, 0xe2, 0x00, 0x27, 0xdb, + 0x1c, 0x34, 0xfe, 0x0a, 0xf0, 0xfe, 0xb6, 0x06, 0x94, 0xfe, 0x6c, 0x07, 0xfe, 0x06, 0xf0, 0xfe, + 0x74, 0x07, 0x95, 0x86, 0x02, 0x24, 0x08, 0x05, 0x0a, 0xfe, 0x2e, 0x12, 0x16, 0x19, 0x01, 0x0b, + 0x16, 0x00, 0x01, 0x0b, 0x16, 0x00, 0x01, 0x0b, 0x16, 0x00, 0x01, 0x0b, 0xfe, 0x99, 0xa4, 0x01, + 0x0b, 0x16, 0x00, 0x02, 0xfe, 0x42, 0x08, 0x68, 0x05, 0x1a, 0xfe, 0x38, 0x12, 0x08, 0x05, 0x1a, + 0xfe, 0x30, 0x13, 0x16, 0xfe, 0x1b, 0x00, 0x01, 0x0b, 0x16, 0x00, 0x01, 0x0b, 0x16, 0x00, 0x01, + 0x0b, 0x16, 0x00, 0x01, 0x0b, 0x16, 0x06, 0x01, 0x0b, 0x16, 0x00, 0x02, 0xe2, 0x6c, 0x58, 0xbe, + 0x50, 0xfe, 0x9a, 0x81, 0x55, 0x1b, 0x7a, 0xfe, 0x42, 0x07, 0x09, 0x1b, 0xfe, 0x09, 0x6f, 0xba, + 0xfe, 0xca, 0x45, 0xfe, 0x32, 0x12, 0x69, 0x6d, 0x8b, 0x6c, 0x7f, 0x27, 0xfe, 0x54, 0x07, 0x1c, + 0x34, 0xfe, 0x0a, 0xf0, 0xfe, 0x42, 0x07, 0x95, 0x86, 0x94, 0xfe, 0x6c, 0x07, 0x02, 0x24, 0x01, + 0x4b, 0x02, 0xdb, 0x16, 0x1f, 0x02, 0xdb, 0xfe, 0x9c, 0xf7, 0xdc, 0xfe, 0x2c, 0x90, 0xfe, 0xae, + 0x90, 0x56, 0xfe, 0xda, 0x07, 0x0c, 0x60, 0x14, 0x61, 0x08, 0x54, 0x5a, 0x37, 0x22, 0x20, 0x07, + 0x11, 0xfe, 0x0e, 0x12, 0x8d, 0xfe, 0x80, 0x80, 0x39, 0x20, 0x6a, 0x2a, 0xfe, 0x06, 0x10, 0xfe, + 0x83, 0xe7, 0xfe, 0x48, 0x00, 0xab, 0xfe, 0x03, 0x40, 0x08, 0x54, 0x5b, 0x37, 0x01, 0xb3, 0xb8, + 0xfe, 0x1f, 0x40, 0x13, 0x62, 0x01, 0xef, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, + 0xfe, 0xc6, 0x51, 0x88, 0xfe, 0x08, 0x90, 0xfe, 0x8a, 0x90, 0x0c, 0x5e, 0x14, 0x5f, 0xfe, 0x0c, + 0x90, 0xfe, 0x8e, 0x90, 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x0c, 0x3d, 0x14, 0x3e, 0xfe, 0x4a, + 0x10, 0x08, 0x05, 0x5a, 0xfe, 0x2a, 0x12, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x0c, 0x60, 0x14, + 0x61, 0x08, 0x05, 0x5b, 0x8b, 0x01, 0xb3, 0xfe, 0x1f, 0x80, 0x13, 0x62, 0xfe, 0x44, 0x90, 0xfe, + 0xc6, 0x90, 0x0c, 0x3f, 0x14, 0x40, 0xfe, 0x08, 0x90, 0xfe, 0x8a, 0x90, 0x0c, 0x5e, 0x14, 0x5f, + 0xfe, 0x40, 0x90, 0xfe, 0xc2, 0x90, 0x0c, 0x3d, 0x14, 0x3e, 0x0c, 0x2e, 0x14, 0x3c, 0x21, 0x0c, + 0x49, 0x0c, 0x63, 0x08, 0x54, 0x1f, 0x37, 0x2c, 0x0f, 0xfe, 0x4e, 0x11, 0x27, 0xdd, 0xfe, 0x9e, + 0xf0, 0xfe, 0x76, 0x08, 0xbc, 0x17, 0x34, 0x2c, 0x77, 0xe6, 0xc5, 0xfe, 0x9a, 0x08, 0xc6, 0xfe, + 0xb8, 0x08, 0x94, 0xfe, 0x8e, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x94, 0x08, 0x95, 0x86, 0x02, 0x24, + 0x01, 0x4b, 0xfe, 0xc9, 0x10, 0x16, 0x1f, 0xfe, 0xc9, 0x10, 0x68, 0x05, 0x06, 0xfe, 0x10, 0x12, + 0x68, 0x05, 0x0a, 0x4e, 0x08, 0x05, 0x0a, 0xfe, 0x90, 0x12, 0xfe, 0x2e, 0x1c, 0x02, 0xfe, 0x18, + 0x0b, 0x68, 0x05, 0x06, 0x4e, 0x68, 0x05, 0x0a, 0xfe, 0x7a, 0x12, 0xfe, 0x2c, 0x1c, 0xfe, 0xaa, + 0xf0, 0xfe, 0xd2, 0x09, 0xfe, 0xac, 0xf0, 0xfe, 0x00, 0x09, 0x02, 0xfe, 0xde, 0x09, 0xfe, 0xb7, + 0xf0, 0xfe, 0xfc, 0x08, 0xfe, 0x02, 0xf6, 0x1a, 0x50, 0xfe, 0x70, 0x18, 0xfe, 0xf1, 0x18, 0xfe, + 0x40, 0x55, 0xfe, 0xe1, 0x55, 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, 0xfe, 0x14, 0x59, 0xfe, 0x95, + 0x59, 0x1c, 0x85, 0xfe, 0x8c, 0xf0, 0xfe, 0xfc, 0x08, 0xfe, 0xac, 0xf0, 0xfe, 0xf0, 0x08, 0xb5, + 0xfe, 0xcb, 0x10, 0xfe, 0xad, 0xf0, 0xfe, 0x0c, 0x09, 0x02, 0xfe, 0x18, 0x0b, 0xb6, 0xfe, 0xbf, + 0x10, 0xfe, 0x2b, 0xf0, 0x85, 0xf4, 0x1e, 0xfe, 0x00, 0xfe, 0xfe, 0x1c, 0x12, 0xc2, 0xfe, 0xd2, + 0xf0, 0x85, 0xfe, 0x76, 0x18, 0x1e, 0x19, 0x17, 0x85, 0x03, 0xd2, 0x1e, 0x06, 0x17, 0x85, 0xc5, + 0x4a, 0xc6, 0x4a, 0xb5, 0xb6, 0xfe, 0x89, 0x10, 0x74, 0x67, 0x2d, 0x15, 0x9d, 0x01, 0x36, 0x10, + 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, 0x65, 0x10, 0x80, 0x02, 0x65, 0xfe, 0x98, 0x80, 0xfe, 0x19, + 0xe4, 0x0a, 0xfe, 0x1a, 0x12, 0x51, 0xfe, 0x19, 0x82, 0xfe, 0x6c, 0x18, 0xfe, 0x44, 0x54, 0xbe, + 0xfe, 0x19, 0x81, 0xfe, 0x74, 0x18, 0x8f, 0x90, 0x17, 0xfe, 0xce, 0x08, 0x02, 0x4a, 0x08, 0x05, + 0x5a, 0xec, 0x03, 0x2e, 0x29, 0x3c, 0x0c, 0x3f, 0x14, 0x40, 0x9b, 0x2e, 0x9c, 0x3c, 0xfe, 0x6c, + 0x18, 0xfe, 0xed, 0x18, 0xfe, 0x44, 0x54, 0xfe, 0xe5, 0x54, 0x3a, 0x3f, 0x3b, 0x40, 0x03, 0x49, + 0x29, 0x63, 0x8f, 0xfe, 0xe3, 0x54, 0xfe, 0x74, 0x18, 0xfe, 0xf5, 0x18, 0x8f, 0xfe, 0xe3, 0x54, + 0x90, 0xc0, 0x56, 0xfe, 0xce, 0x08, 0x02, 0x4a, 0xfe, 0x37, 0xf0, 0xfe, 0xda, 0x09, 0xfe, 0x8b, + 0xf0, 0xfe, 0x60, 0x09, 0x02, 0x4a, 0x08, 0x05, 0x0a, 0x23, 0xfe, 0xfa, 0x0a, 0x3a, 0x49, 0x3b, + 0x63, 0x56, 0xfe, 0x3e, 0x0a, 0x0f, 0xfe, 0xc0, 0x07, 0x41, 0x98, 0x00, 0xad, 0xfe, 0x01, 0x59, + 0xfe, 0x52, 0xf0, 0xfe, 0x0c, 0x0a, 0x8f, 0x7a, 0xfe, 0x24, 0x0a, 0x3a, 0x49, 0x8f, 0xfe, 0xe3, + 0x54, 0x57, 0x49, 0x7d, 0x63, 0xfe, 0x14, 0x58, 0xfe, 0x95, 0x58, 0x02, 0x4a, 0x3a, 0x49, 0x3b, + 0x63, 0xfe, 0x14, 0x59, 0xfe, 0x95, 0x59, 0xbe, 0x57, 0x49, 0x57, 0x63, 0x02, 0x4a, 0x08, 0x05, + 0x5a, 0xfe, 0x82, 0x12, 0x08, 0x05, 0x1f, 0xfe, 0x66, 0x13, 0x22, 0x62, 0xb7, 0xfe, 0x03, 0xa1, + 0xfe, 0x83, 0x80, 0xfe, 0xc8, 0x44, 0xfe, 0x2e, 0x13, 0xfe, 0x04, 0x91, 0xfe, 0x86, 0x91, 0x6a, + 0x2a, 0xfe, 0x40, 0x59, 0xfe, 0xc1, 0x59, 0x56, 0xe0, 0x03, 0x60, 0x29, 0x61, 0x0c, 0x7f, 0x14, + 0x80, 0x57, 0x60, 0x7d, 0x61, 0x01, 0xb3, 0xb8, 0x6a, 0x2a, 0x13, 0x62, 0x9b, 0x2e, 0x9c, 0x3c, + 0x3a, 0x3f, 0x3b, 0x40, 0x90, 0xc0, 0xfe, 0x04, 0xfa, 0x2e, 0xfe, 0x05, 0xfa, 0x3c, 0x01, 0xef, + 0xfe, 0x36, 0x10, 0x21, 0x0c, 0x7f, 0x0c, 0x80, 0x3a, 0x3f, 0x3b, 0x40, 0xe4, 0x08, 0x05, 0x1f, + 0x17, 0xe0, 0x3a, 0x3d, 0x3b, 0x3e, 0x08, 0x05, 0xfe, 0xf7, 0x00, 0x37, 0x03, 0x5e, 0x29, 0x5f, + 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, 0x57, 0x49, 0x7d, 0x63, 0x02, 0xfe, 0xf4, 0x09, 0x08, 0x05, + 0x1f, 0x17, 0xe0, 0x08, 0x05, 0xfe, 0xf7, 0x00, 0x37, 0xbe, 0xfe, 0x19, 0x81, 0x50, 0xfe, 0x10, + 0x90, 0xfe, 0x92, 0x90, 0xfe, 0xd3, 0x10, 0x32, 0x07, 0xa6, 0x17, 0xfe, 0x08, 0x09, 0x12, 0xa6, + 0x08, 0x05, 0x0a, 0xfe, 0x14, 0x13, 0x03, 0x3d, 0x29, 0x3e, 0x56, 0xfe, 0x08, 0x09, 0xfe, 0x0c, + 0x58, 0xfe, 0x8d, 0x58, 0x02, 0x4a, 0x21, 0x41, 0xfe, 0x19, 0x80, 0xe7, 0x08, 0x05, 0x0a, 0xfe, + 0x1a, 0x12, 0xfe, 0x6c, 0x19, 0xfe, 0x19, 0x41, 0xf4, 0xc2, 0xfe, 0xd1, 0xf0, 0xe2, 0x15, 0x7e, + 0x01, 0x36, 0x10, 0xfe, 0x44, 0x00, 0xfe, 0x8e, 0x10, 0xfe, 0x6c, 0x19, 0x57, 0x3d, 0xfe, 0xed, + 0x19, 0x7d, 0x3e, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0xf4, 0x1e, 0xfe, 0x00, 0xff, 0x35, 0xfe, + 0x74, 0x10, 0xc2, 0xfe, 0xd2, 0xf0, 0xfe, 0xa6, 0x0b, 0xfe, 0x76, 0x18, 0x1e, 0x19, 0x8a, 0x03, + 0xd2, 0x1e, 0x06, 0xfe, 0x08, 0x13, 0x10, 0xfe, 0x16, 0x00, 0x02, 0x65, 0xfe, 0xd1, 0xf0, 0xfe, + 0xb8, 0x0b, 0x15, 0x7e, 0x01, 0x36, 0x10, 0xfe, 0x17, 0x00, 0xfe, 0x42, 0x10, 0xfe, 0xce, 0xf0, + 0xfe, 0xbe, 0x0b, 0xfe, 0x3c, 0x10, 0xfe, 0xcd, 0xf0, 0xfe, 0xca, 0x0b, 0x10, 0xfe, 0x22, 0x00, + 0x02, 0x65, 0xfe, 0xcb, 0xf0, 0xfe, 0xd6, 0x0b, 0x10, 0xfe, 0x24, 0x00, 0x02, 0x65, 0xfe, 0xd0, + 0xf0, 0xfe, 0xe0, 0x0b, 0x10, 0x9e, 0xe5, 0xfe, 0xcf, 0xf0, 0xfe, 0xea, 0x0b, 0x10, 0x58, 0xfe, + 0x10, 0x10, 0xfe, 0xcc, 0xf0, 0xe2, 0x68, 0x05, 0x1f, 0x4d, 0x10, 0xfe, 0x12, 0x00, 0x2c, 0x0f, + 0xfe, 0x4e, 0x11, 0x27, 0xfe, 0x00, 0x0c, 0xfe, 0x9e, 0xf0, 0xfe, 0x14, 0x0c, 0xbc, 0x17, 0x34, + 0x2c, 0x77, 0xe6, 0xc5, 0x24, 0xc6, 0x24, 0x2c, 0xfa, 0x27, 0xfe, 0x20, 0x0c, 0x1c, 0x34, 0x94, + 0xfe, 0x3c, 0x0c, 0x95, 0x86, 0xc5, 0xdc, 0xc6, 0xdc, 0x02, 0x24, 0x01, 0x4b, 0xfe, 0xdb, 0x10, + 0x12, 0xfe, 0xe8, 0x00, 0xb5, 0xb6, 0x74, 0xc7, 0x81, 0xc8, 0x83, 0xfe, 0x89, 0xf0, 0x24, 0x33, + 0x31, 0xe1, 0xc7, 0x81, 0xc8, 0x83, 0x27, 0xfe, 0x66, 0x0c, 0x1d, 0x24, 0x33, 0x31, 0xdf, 0xbc, + 0x4e, 0x10, 0xfe, 0x42, 0x00, 0x02, 0x65, 0x7c, 0x06, 0xfe, 0x81, 0x49, 0x17, 0xfe, 0x2c, 0x0d, + 0x08, 0x05, 0x0a, 0xfe, 0x44, 0x13, 0x10, 0x00, 0x55, 0x0a, 0xfe, 0x54, 0x12, 0x55, 0xfe, 0x28, + 0x00, 0x23, 0xfe, 0x9a, 0x0d, 0x09, 0x46, 0x01, 0x0e, 0x07, 0x00, 0x66, 0x44, 0xfe, 0x28, 0x00, + 0xfe, 0xe2, 0x10, 0x01, 0xf5, 0x01, 0xf6, 0x09, 0xa4, 0x01, 0xfe, 0x26, 0x0f, 0x64, 0x12, 0x2f, + 0x01, 0x73, 0x02, 0x2b, 0x10, 0xfe, 0x44, 0x00, 0x55, 0x0a, 0xe9, 0x44, 0x0a, 0xfe, 0xb4, 0x10, + 0x01, 0xb0, 0x44, 0x0a, 0xfe, 0xaa, 0x10, 0x01, 0xb0, 0xfe, 0x19, 0x82, 0xfe, 0x34, 0x46, 0xac, + 0x44, 0x0a, 0x10, 0xfe, 0x43, 0x00, 0xfe, 0x96, 0x10, 0x08, 0x54, 0x0a, 0x37, 0x01, 0xf5, 0x01, + 0xf6, 0x64, 0x12, 0x2f, 0x01, 0x73, 0x99, 0x0a, 0x64, 0x42, 0x92, 0x02, 0xfe, 0x2e, 0x03, 0x08, + 0x05, 0x0a, 0x8a, 0x44, 0x0a, 0x10, 0x00, 0xfe, 0x5c, 0x10, 0x68, 0x05, 0x1a, 0xfe, 0x58, 0x12, + 0x08, 0x05, 0x1a, 0xfe, 0x50, 0x13, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x50, 0x0d, 0xfe, + 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x56, 0x0d, 0x08, 0x54, 0x1a, 0x37, 0xfe, 0xa9, 0x10, 0x10, + 0xfe, 0x15, 0x00, 0xfe, 0x04, 0xe6, 0x0a, 0x50, 0xfe, 0x2e, 0x10, 0x10, 0xfe, 0x13, 0x00, 0xfe, + 0x10, 0x10, 0x10, 0x6f, 0xab, 0x10, 0xfe, 0x41, 0x00, 0xaa, 0x10, 0xfe, 0x24, 0x00, 0x8c, 0xb5, + 0xb6, 0x74, 0x03, 0x70, 0x28, 0x23, 0xd8, 0x50, 0xfe, 0x04, 0xe6, 0x1a, 0xfe, 0x9d, 0x41, 0xfe, + 0x1c, 0x42, 0x64, 0x01, 0xe3, 0x02, 0x2b, 0xf8, 0x15, 0x0a, 0x39, 0xa0, 0xb4, 0x15, 0xfe, 0x31, + 0x00, 0x39, 0xa2, 0x01, 0xfe, 0x48, 0x10, 0x02, 0xd7, 0x42, 0xfe, 0x06, 0xec, 0xd0, 0xfc, 0x44, + 0x1b, 0xfe, 0xce, 0x45, 0x35, 0x42, 0xfe, 0x06, 0xea, 0xd0, 0xfe, 0x47, 0x4b, 0x91, 0xfe, 0x75, + 0x57, 0x03, 0x5d, 0xfe, 0x98, 0x56, 0xfe, 0x38, 0x12, 0x09, 0x48, 0x01, 0x0e, 0xfe, 0x44, 0x48, + 0x4f, 0x08, 0x05, 0x1b, 0xfe, 0x1a, 0x13, 0x09, 0x46, 0x01, 0x0e, 0x41, 0xfe, 0x41, 0x58, 0x09, + 0xa4, 0x01, 0x0e, 0xfe, 0x49, 0x54, 0x96, 0xfe, 0x1e, 0x0e, 0x02, 0xfe, 0x2e, 0x03, 0x09, 0x5d, + 0xfe, 0xee, 0x14, 0xfc, 0x44, 0x1b, 0xfe, 0xce, 0x45, 0x35, 0x42, 0xfe, 0xce, 0x47, 0xfe, 0xad, + 0x13, 0x02, 0x2b, 0x22, 0x20, 0x07, 0x11, 0xfe, 0x9e, 0x12, 0x21, 0x13, 0x59, 0x13, 0x9f, 0x13, + 0xd5, 0x22, 0x2f, 0x41, 0x39, 0x2f, 0xbc, 0xad, 0xfe, 0xbc, 0xf0, 0xfe, 0xe0, 0x0e, 0x0f, 0x06, + 0x13, 0x59, 0x01, 0xfe, 0xda, 0x16, 0x03, 0xfe, 0x38, 0x01, 0x29, 0xfe, 0x3a, 0x01, 0x56, 0xfe, + 0xe4, 0x0e, 0xfe, 0x02, 0xec, 0xd5, 0x69, 0x00, 0x66, 0xfe, 0x04, 0xec, 0x20, 0x4f, 0xfe, 0x05, + 0xf6, 0xfe, 0x34, 0x01, 0x01, 0xfe, 0x4a, 0x17, 0xfe, 0x08, 0x90, 0xfe, 0x48, 0xf4, 0x0d, 0xfe, + 0x18, 0x13, 0xba, 0xfe, 0x02, 0xea, 0xd5, 0x69, 0x7e, 0xfe, 0xc5, 0x13, 0x15, 0x1a, 0x39, 0xa0, + 0xb4, 0xfe, 0x2e, 0x10, 0x03, 0xfe, 0x38, 0x01, 0x1e, 0xfe, 0xf0, 0xff, 0x0c, 0xfe, 0x60, 0x01, + 0x03, 0xfe, 0x3a, 0x01, 0x0c, 0xfe, 0x62, 0x01, 0x43, 0x13, 0x20, 0x25, 0x06, 0x13, 0x2f, 0x12, + 0x2f, 0x92, 0x0f, 0x06, 0x04, 0x21, 0x04, 0x22, 0x59, 0xfe, 0xf7, 0x12, 0x22, 0x9f, 0xb7, 0x13, + 0x9f, 0x07, 0x7e, 0xfe, 0x71, 0x13, 0xfe, 0x24, 0x1c, 0x15, 0x19, 0x39, 0xa0, 0xb4, 0xfe, 0xd9, + 0x10, 0xc3, 0xfe, 0x03, 0xdc, 0xfe, 0x73, 0x57, 0xfe, 0x80, 0x5d, 0x04, 0xc3, 0xfe, 0x03, 0xdc, + 0xfe, 0x5b, 0x57, 0xfe, 0x80, 0x5d, 0x04, 0xfe, 0x03, 0x57, 0xc3, 0x21, 0xfe, 0x00, 0xcc, 0x04, + 0xfe, 0x03, 0x57, 0xc3, 0x78, 0x04, 0x08, 0x05, 0x58, 0xfe, 0x22, 0x13, 0xfe, 0x1c, 0x80, 0x07, + 0x06, 0xfe, 0x1a, 0x13, 0xfe, 0x1e, 0x80, 0xed, 0xfe, 0x1d, 0x80, 0xae, 0xfe, 0x0c, 0x90, 0xfe, + 0x0e, 0x13, 0xfe, 0x0e, 0x90, 0xac, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, 0x0a, 0xfe, 0x3c, 0x50, + 0xaa, 0x01, 0xfe, 0x7a, 0x17, 0x32, 0x07, 0x2f, 0xad, 0x01, 0xfe, 0xb4, 0x16, 0x08, 0x05, 0x1b, + 0x4e, 0x01, 0xf5, 0x01, 0xf6, 0x12, 0xfe, 0xe9, 0x00, 0x08, 0x05, 0x58, 0xfe, 0x2c, 0x13, 0x01, + 0xfe, 0x0c, 0x17, 0xfe, 0x1e, 0x1c, 0xfe, 0x14, 0x90, 0xfe, 0x96, 0x90, 0x0c, 0xfe, 0x64, 0x01, + 0x14, 0xfe, 0x66, 0x01, 0x08, 0x05, 0x5b, 0xfe, 0x12, 0x12, 0xfe, 0x03, 0x80, 0x8d, 0xfe, 0x01, + 0xec, 0x20, 0xfe, 0x80, 0x40, 0x13, 0x20, 0x6a, 0x2a, 0x12, 0xcf, 0x64, 0x22, 0x20, 0xfb, 0x79, + 0x20, 0x04, 0xfe, 0x08, 0x1c, 0x03, 0xfe, 0xac, 0x00, 0xfe, 0x06, 0x58, 0x03, 0xfe, 0xae, 0x00, + + 0xfe, 0x07, 0x58, 0x03, 0xfe, 0xb0, 0x00, 0xfe, 0x08, 0x58, 0x03, 0xfe, 0xb2, 0x00, 0xfe, 0x09, + 0x58, 0xfe, 0x0a, 0x1c, 0x25, 0x6e, 0x13, 0xd0, 0x21, 0x0c, 0x5c, 0x0c, 0x45, 0x0f, 0x46, 0x52, + 0x50, 0x18, 0x1b, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, 0x23, 0xfe, 0xfc, 0x0f, 0x44, 0x11, 0x0f, + 0x48, 0x52, 0x18, 0x58, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, 0x23, 0xe4, 0x25, 0x11, 0x13, 0x20, + 0x7c, 0x6f, 0x4f, 0x22, 0x20, 0xfb, 0x79, 0x20, 0x12, 0xcf, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, + 0xfe, 0x26, 0x10, 0xf8, 0x74, 0xfe, 0x14, 0x1c, 0xfe, 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x04, 0x42, + 0xfe, 0x0c, 0x14, 0xfc, 0xfe, 0x07, 0xe6, 0x1b, 0xfe, 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x04, 0x01, + 0xb0, 0x7c, 0x6f, 0x4f, 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x42, 0x13, 0x32, 0x07, 0x2f, + 0xfe, 0x34, 0x13, 0x09, 0x48, 0x01, 0x0e, 0xbb, 0xfe, 0x36, 0x12, 0xfe, 0x41, 0x48, 0xfe, 0x45, + 0x48, 0x01, 0xf0, 0xfe, 0x00, 0xcc, 0xbb, 0xfe, 0xf3, 0x13, 0x43, 0x78, 0x07, 0x11, 0xac, 0x09, + 0x84, 0x01, 0x0e, 0xfe, 0x80, 0x5c, 0x01, 0x73, 0xfe, 0x0e, 0x10, 0x07, 0x82, 0x4e, 0xfe, 0x14, + 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0x60, 0x10, 0x04, 0xfe, 0x44, 0x58, 0x8d, 0xfe, 0x01, 0xec, 0xa2, + 0xfe, 0x9e, 0x40, 0xfe, 0x9d, 0xe7, 0x00, 0xfe, 0x9c, 0xe7, 0x1a, 0x79, 0x2a, 0x01, 0xe3, 0xfe, + 0xdd, 0x10, 0x2c, 0xc7, 0x81, 0xc8, 0x83, 0x33, 0x31, 0xde, 0x07, 0x1a, 0xfe, 0x48, 0x12, 0x07, + 0x0a, 0xfe, 0x56, 0x12, 0x07, 0x19, 0xfe, 0x30, 0x12, 0x07, 0xc9, 0x17, 0xfe, 0x32, 0x12, 0x07, + 0xfe, 0x23, 0x00, 0x17, 0xeb, 0x07, 0x06, 0x17, 0xfe, 0x9c, 0x12, 0x07, 0x1f, 0xfe, 0x12, 0x12, + 0x07, 0x00, 0x17, 0x24, 0x15, 0xc9, 0x01, 0x36, 0xa9, 0x2d, 0x01, 0x0b, 0x94, 0x4b, 0x04, 0x2d, + 0xdd, 0x09, 0xd1, 0x01, 0xfe, 0x26, 0x0f, 0x12, 0x82, 0x02, 0x2b, 0x2d, 0x32, 0x07, 0xa6, 0xfe, + 0xd9, 0x13, 0x3a, 0x3d, 0x3b, 0x3e, 0x56, 0xfe, 0xf0, 0x11, 0x08, 0x05, 0x5a, 0xfe, 0x72, 0x12, + 0x9b, 0x2e, 0x9c, 0x3c, 0x90, 0xc0, 0x96, 0xfe, 0xba, 0x11, 0x22, 0x62, 0xfe, 0x26, 0x13, 0x03, + 0x7f, 0x29, 0x80, 0x56, 0xfe, 0x76, 0x0d, 0x0c, 0x60, 0x14, 0x61, 0x21, 0x0c, 0x7f, 0x0c, 0x80, + 0x01, 0xb3, 0x25, 0x6e, 0x77, 0x13, 0x62, 0x01, 0xef, 0x9b, 0x2e, 0x9c, 0x3c, 0xfe, 0x04, 0x55, + 0xfe, 0xa5, 0x55, 0xfe, 0x04, 0xfa, 0x2e, 0xfe, 0x05, 0xfa, 0x3c, 0xfe, 0x91, 0x10, 0x03, 0x3f, + 0x29, 0x40, 0xfe, 0x40, 0x56, 0xfe, 0xe1, 0x56, 0x0c, 0x3f, 0x14, 0x40, 0x88, 0x9b, 0x2e, 0x9c, + 0x3c, 0x90, 0xc0, 0x03, 0x5e, 0x29, 0x5f, 0xfe, 0x00, 0x56, 0xfe, 0xa1, 0x56, 0x0c, 0x5e, 0x14, + 0x5f, 0x08, 0x05, 0x5a, 0xfe, 0x1e, 0x12, 0x22, 0x62, 0xfe, 0x1f, 0x40, 0x03, 0x60, 0x29, 0x61, + 0xfe, 0x2c, 0x50, 0xfe, 0xae, 0x50, 0x03, 0x3f, 0x29, 0x40, 0xfe, 0x44, 0x50, 0xfe, 0xc6, 0x50, + 0x03, 0x5e, 0x29, 0x5f, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0x03, 0x3d, 0x29, 0x3e, 0xfe, 0x40, + 0x50, 0xfe, 0xc2, 0x50, 0x02, 0x89, 0x25, 0x06, 0x13, 0xd4, 0x02, 0x72, 0x2d, 0x01, 0x0b, 0x1d, + 0x4c, 0x33, 0x31, 0xde, 0x07, 0x06, 0x23, 0x4c, 0x32, 0x07, 0xa6, 0x23, 0x72, 0x01, 0xaf, 0x1e, + 0x43, 0x17, 0x4c, 0x08, 0x05, 0x0a, 0xee, 0x3a, 0x3d, 0x3b, 0x3e, 0xfe, 0x0a, 0x55, 0x35, 0xfe, + 0x8b, 0x55, 0x57, 0x3d, 0x7d, 0x3e, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0x02, 0x72, 0xfe, 0x19, + 0x81, 0xba, 0xfe, 0x19, 0x41, 0x02, 0x72, 0x2d, 0x01, 0x0b, 0x1c, 0x34, 0x1d, 0xe8, 0x33, 0x31, + 0xe1, 0x55, 0x19, 0xfe, 0xa6, 0x12, 0x55, 0x0a, 0x4d, 0x02, 0x4c, 0x01, 0x0b, 0x1c, 0x34, 0x1d, + 0xe8, 0x33, 0x31, 0xdf, 0x07, 0x19, 0x23, 0x4c, 0x01, 0x0b, 0x1d, 0xe8, 0x33, 0x31, 0xfe, 0xe8, + 0x09, 0xfe, 0xc2, 0x49, 0x51, 0x03, 0xfe, 0x9c, 0x00, 0x28, 0x8a, 0x53, 0x05, 0x1f, 0x35, 0xa9, + 0xfe, 0xbb, 0x45, 0x55, 0x00, 0x4e, 0x44, 0x06, 0x7c, 0x43, 0xfe, 0xda, 0x14, 0x01, 0xaf, 0x8c, + 0xfe, 0x4b, 0x45, 0xee, 0x32, 0x07, 0xa5, 0xed, 0x03, 0xcd, 0x28, 0x8a, 0x03, 0x45, 0x28, 0x35, + 0x67, 0x02, 0x72, 0xfe, 0xc0, 0x5d, 0xfe, 0xf8, 0x14, 0xfe, 0x03, 0x17, 0x03, 0x5c, 0xc1, 0x0c, + 0x5c, 0x67, 0x2d, 0x01, 0x0b, 0x26, 0x89, 0x01, 0xfe, 0x9e, 0x15, 0x02, 0x89, 0x01, 0x0b, 0x1c, + 0x34, 0x1d, 0x4c, 0x33, 0x31, 0xdf, 0x07, 0x06, 0x23, 0x4c, 0x01, 0xf1, 0xfe, 0x42, 0x58, 0xf1, + 0xfe, 0xa4, 0x14, 0x8c, 0xfe, 0x4a, 0xf4, 0x0a, 0x17, 0x4c, 0xfe, 0x4a, 0xf4, 0x06, 0xea, 0x32, + 0x07, 0xa5, 0x8b, 0x02, 0x72, 0x03, 0x45, 0xc1, 0x0c, 0x45, 0x67, 0x2d, 0x01, 0x0b, 0x26, 0x89, + 0x01, 0xfe, 0xcc, 0x15, 0x02, 0x89, 0x0f, 0x06, 0x27, 0xfe, 0xbe, 0x13, 0x26, 0xfe, 0xd4, 0x13, + 0x76, 0xfe, 0x89, 0x48, 0x01, 0x0b, 0x21, 0x76, 0x04, 0x7b, 0xfe, 0xd0, 0x13, 0x1c, 0xfe, 0xd0, + 0x13, 0x1d, 0xfe, 0xbe, 0x13, 0x67, 0x2d, 0x01, 0x0b, 0xfe, 0xd5, 0x10, 0x0f, 0x71, 0xff, 0x02, + 0x00, 0x57, 0x52, 0x93, 0x1e, 0xfe, 0xff, 0x7f, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x04, 0x0f, + 0x71, 0xff, 0x02, 0x00, 0x57, 0x52, 0x93, 0x1e, 0x43, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x04, + 0x0f, 0x71, 0xff, 0x02, 0x00, 0x57, 0x52, 0x93, 0x04, 0x0f, 0x71, 0xff, 0x02, 0x00, 0x57, 0x52, + 0x93, 0xfe, 0x0b, 0x58, 0x04, 0x09, 0x5c, 0x01, 0x87, 0x09, 0x45, 0x01, 0x87, 0x04, 0xfe, 0x03, + 0xa1, 0x1e, 0x11, 0xff, 0x03, 0x00, 0x54, 0xfe, 0x00, 0xf4, 0x1f, 0x52, 0xfe, 0x00, 0x7d, 0xfe, + 0x01, 0x7d, 0xfe, 0x02, 0x7d, 0xfe, 0x03, 0x7c, 0x6a, 0x2a, 0x0c, 0x5e, 0x14, 0x5f, 0x57, 0x3f, + 0x7d, 0x40, 0x04, 0xdd, 0xfe, 0x82, 0x4a, 0xfe, 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x8d, 0x04, 0x01, + 0xfe, 0x0c, 0x19, 0xfe, 0x42, 0x48, 0x50, 0x51, 0x91, 0x01, 0x0b, 0x1d, 0xfe, 0x96, 0x15, 0x33, + 0x31, 0xe1, 0x01, 0x0b, 0x1d, 0xfe, 0x96, 0x15, 0x33, 0x31, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, 0x59, + 0x03, 0xcd, 0x28, 0xfe, 0xcc, 0x12, 0x53, 0x05, 0x1a, 0xfe, 0xc4, 0x13, 0x21, 0x69, 0x1a, 0xee, + 0x55, 0xca, 0x6b, 0xfe, 0xdc, 0x14, 0x4d, 0x0f, 0x06, 0x18, 0xca, 0x7c, 0x30, 0xfe, 0x78, 0x10, + 0xff, 0x02, 0x83, 0x55, 0xab, 0xff, 0x02, 0x83, 0x55, 0x69, 0x19, 0xae, 0x98, 0xfe, 0x30, 0x00, + 0x96, 0xf2, 0x18, 0x6d, 0x0f, 0x06, 0xfe, 0x56, 0x10, 0x69, 0x0a, 0xed, 0x98, 0xfe, 0x64, 0x00, + 0x96, 0xf2, 0x09, 0xfe, 0x64, 0x00, 0x18, 0x9e, 0x0f, 0x06, 0xfe, 0x28, 0x10, 0x69, 0x06, 0xfe, + 0x60, 0x13, 0x98, 0xfe, 0xc8, 0x00, 0x96, 0xf2, 0x09, 0xfe, 0xc8, 0x00, 0x18, 0x59, 0x0f, 0x06, + 0x88, 0x98, 0xfe, 0x90, 0x01, 0x7a, 0xfe, 0x42, 0x15, 0x91, 0xe4, 0xfe, 0x43, 0xf4, 0x9f, 0xfe, + 0x56, 0xf0, 0xfe, 0x54, 0x15, 0xfe, 0x04, 0xf4, 0x71, 0xfe, 0x43, 0xf4, 0x9e, 0xfe, 0xf3, 0x10, + 0xfe, 0x40, 0x5c, 0x01, 0xfe, 0x16, 0x14, 0x1e, 0x43, 0xec, 0xfe, 0x00, 0x17, 0xfe, 0x4d, 0xe4, + 0x6e, 0x7a, 0xfe, 0x90, 0x15, 0xc4, 0x6e, 0xfe, 0x1c, 0x10, 0xfe, 0x00, 0x17, 0xfe, 0x4d, 0xe4, + 0xcc, 0x7a, 0xfe, 0x90, 0x15, 0xc4, 0xcc, 0x88, 0x51, 0x21, 0xfe, 0x4d, 0xf4, 0x00, 0xe9, 0x91, + 0x0f, 0x06, 0xfe, 0xb4, 0x56, 0xfe, 0xc3, 0x58, 0x04, 0x51, 0x0f, 0x0a, 0x04, 0x16, 0x06, 0x01, + 0x0b, 0x26, 0xf3, 0x16, 0x0a, 0x01, 0x0b, 0x26, 0xf3, 0x16, 0x19, 0x01, 0x0b, 0x26, 0xf3, 0x76, + 0xfe, 0x89, 0x49, 0x01, 0x0b, 0x04, 0x16, 0x06, 0x01, 0x0b, 0x26, 0xb1, 0x16, 0x19, 0x01, 0x0b, + 0x26, 0xb1, 0x16, 0x06, 0x01, 0x0b, 0x26, 0xb1, 0xfe, 0x89, 0x49, 0x01, 0x0b, 0x26, 0xb1, 0x76, + 0xfe, 0x89, 0x4a, 0x01, 0x0b, 0x04, 0x51, 0x04, 0x22, 0xd3, 0x07, 0x06, 0xfe, 0x48, 0x13, 0xb8, + 0x13, 0xd3, 0xfe, 0x49, 0xf4, 0x00, 0x4d, 0x76, 0xa9, 0x67, 0xfe, 0x01, 0xec, 0xfe, 0x27, 0x01, + 0xfe, 0x89, 0x48, 0xff, 0x02, 0x00, 0x10, 0x27, 0xfe, 0x2e, 0x16, 0x32, 0x07, 0xfe, 0xe3, 0x00, + 0xfe, 0x20, 0x13, 0x1d, 0xfe, 0x52, 0x16, 0x21, 0x13, 0xd4, 0x01, 0x4b, 0x22, 0xd4, 0x07, 0x06, + 0x4e, 0x08, 0x54, 0x06, 0x37, 0x04, 0x09, 0x48, 0x01, 0x0e, 0xfb, 0x8e, 0x07, 0x11, 0xae, 0x09, + 0x84, 0x01, 0x0e, 0x8e, 0x09, 0x5d, 0x01, 0xa8, 0x04, 0x09, 0x84, 0x01, 0x0e, 0x8e, 0xfe, 0x80, + 0xe7, 0x11, 0x07, 0x11, 0x8a, 0xfe, 0x45, 0x58, 0x01, 0xf0, 0x8e, 0x04, 0x09, 0x48, 0x01, 0x0e, + 0x8e, 0x09, 0x5d, 0x01, 0xa8, 0x04, 0x09, 0x48, 0x01, 0x0e, 0xfe, 0x80, 0x80, 0xfe, 0x80, 0x4c, + 0xfe, 0x49, 0xe4, 0x11, 0xae, 0x09, 0x84, 0x01, 0x0e, 0xfe, 0x80, 0x4c, 0x09, 0x5d, 0x01, 0x87, + 0x04, 0x18, 0x11, 0x75, 0x6c, 0xfe, 0x60, 0x01, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x24, + 0x1c, 0xfe, 0x1d, 0xf7, 0x1b, 0x97, 0xfe, 0xee, 0x16, 0x01, 0xfe, 0xf4, 0x17, 0xad, 0x9a, 0x1b, + 0x6c, 0xfe, 0x2c, 0x01, 0xfe, 0x2f, 0x19, 0x04, 0xb9, 0x23, 0xfe, 0xde, 0x16, 0xfe, 0xda, 0x10, + 0x18, 0x11, 0x75, 0x03, 0xfe, 0x64, 0x01, 0xfe, 0x00, 0xf4, 0x1f, 0xfe, 0x18, 0x58, 0x03, 0xfe, + 0x66, 0x01, 0xfe, 0x19, 0x58, 0x9a, 0x1f, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, 0x06, 0xfe, 0x3c, + 0x50, 0x6c, 0xfe, 0x38, 0x00, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x1f, 0x97, 0xfe, 0x38, 0x17, + 0xfe, 0xb6, 0x14, 0x35, 0x04, 0xb9, 0x23, 0xfe, 0x10, 0x17, 0xfe, 0x9c, 0x10, 0x18, 0x11, 0x75, + 0xfe, 0x83, 0x5a, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, 0xf7, 0x2e, 0x97, 0xfe, 0x5a, + 0x17, 0xfe, 0x94, 0x14, 0xec, 0x9a, 0x2e, 0x6c, 0x1a, 0xfe, 0xaf, 0x19, 0xfe, 0x98, 0xe7, 0x00, + 0x04, 0xb9, 0x23, 0xfe, 0x4e, 0x17, 0xfe, 0x6c, 0x10, 0x18, 0x11, 0x75, 0xfe, 0x30, 0xbc, 0xfe, + 0xb2, 0xbc, 0x9a, 0xcb, 0x6c, 0x1a, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0xcb, 0x97, 0xfe, 0x92, + 0x17, 0xfe, 0x5c, 0x14, 0x35, 0x04, 0xb9, 0x23, 0xfe, 0x7e, 0x17, 0xfe, 0x42, 0x10, 0xfe, 0x02, + 0xf6, 0x11, 0x75, 0xfe, 0x18, 0xfe, 0x60, 0xfe, 0x19, 0xfe, 0x61, 0xfe, 0x03, 0xa1, 0xfe, 0x1d, + 0xf7, 0x5b, 0x97, 0xfe, 0xb8, 0x17, 0xfe, 0x36, 0x14, 0xfe, 0x1c, 0x13, 0x9a, 0x5b, 0x41, 0xfe, + 0x83, 0x58, 0xfe, 0xaf, 0x19, 0xfe, 0x80, 0xe7, 0x11, 0xfe, 0x81, 0xe7, 0x11, 0x12, 0xfe, 0xdd, + 0x00, 0x6a, 0x2a, 0x04, 0x6a, 0x2a, 0xfe, 0x12, 0x45, 0x23, 0xfe, 0xa8, 0x17, 0x15, 0x06, 0x39, + 0xa0, 0xb4, 0x02, 0x2b, 0xfe, 0x39, 0xf0, 0xfe, 0xfc, 0x17, 0x21, 0x04, 0xfe, 0x7e, 0x18, 0x1e, + 0x19, 0x66, 0x0f, 0x0d, 0x04, 0x75, 0x03, 0xd2, 0x1e, 0x06, 0xfe, 0xef, 0x12, 0xfe, 0xe1, 0x10, + 0x7c, 0x6f, 0x4f, 0x32, 0x07, 0x2f, 0xfe, 0x3c, 0x13, 0xf1, 0xfe, 0x42, 0x13, 0x42, 0x92, 0x09, + 0x48, 0x01, 0x0e, 0xbb, 0xeb, 0xfe, 0x41, 0x48, 0xfe, 0x45, 0x48, 0x01, 0xf0, 0xfe, 0x00, 0xcc, + 0xbb, 0xfe, 0xf3, 0x13, 0x43, 0x78, 0x07, 0x11, 0xac, 0x09, 0x84, 0x01, 0x0e, 0xfe, 0x80, 0x4c, + 0x01, 0x73, 0xfe, 0x16, 0x10, 0x07, 0x82, 0x8b, 0xfe, 0x40, 0x14, 0xfe, 0x24, 0x12, 0xfe, 0x14, + 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0x1c, 0x18, 0x18, 0x0a, 0x04, 0xfe, 0x9c, 0xe7, 0x0a, 0x10, 0xfe, + 0x15, 0x00, 0x64, 0x79, 0x2a, 0x01, 0xe3, 0x18, 0x06, 0x04, 0x42, 0x92, 0x08, 0x54, 0x1b, 0x37, + 0x12, 0x2f, 0x01, 0x73, 0x18, 0x06, 0x04, 0xfe, 0x38, 0x90, 0xfe, 0xba, 0x90, 0x3a, 0xce, 0x3b, + 0xcf, 0xfe, 0x48, 0x55, 0x35, 0xfe, 0xc9, 0x55, 0x04, 0x22, 0xa3, 0x77, 0x13, 0xa3, 0x04, 0x09, + 0xa4, 0x01, 0x0e, 0xfe, 0x41, 0x48, 0x09, 0x46, 0x01, 0x0e, 0xfe, 0x49, 0x44, 0x17, 0xfe, 0xe8, + 0x18, 0x77, 0x78, 0x04, 0x09, 0x48, 0x01, 0x0e, 0x07, 0x11, 0x4e, 0x09, 0x5d, 0x01, 0xa8, 0x09, + 0x46, 0x01, 0x0e, 0x77, 0x78, 0x04, 0xfe, 0x4e, 0xe4, 0x19, 0x6b, 0xfe, 0x1c, 0x19, 0x03, 0xfe, + 0x90, 0x00, 0xfe, 0x3a, 0x45, 0xfe, 0x2c, 0x10, 0xfe, 0x4e, 0xe4, 0xc9, 0x6b, 0xfe, 0x2e, 0x19, + 0x03, 0xfe, 0x92, 0x00, 0xfe, 0x02, 0xe6, 0x1a, 0xe5, 0xfe, 0x4e, 0xe4, 0xfe, 0x0b, 0x00, 0x6b, + 0xfe, 0x40, 0x19, 0x03, 0xfe, 0x94, 0x00, 0xfe, 0x02, 0xe6, 0x1f, 0xfe, 0x08, 0x10, 0x03, 0xfe, + 0x96, 0x00, 0xfe, 0x02, 0xe6, 0x6d, 0xfe, 0x4e, 0x45, 0xea, 0xba, 0xff, 0x04, 0x68, 0x54, 0xe7, + 0x1e, 0x6e, 0xfe, 0x08, 0x1c, 0xfe, 0x67, 0x19, 0xfe, 0x0a, 0x1c, 0xfe, 0x1a, 0xf4, 0xfe, 0x00, + 0x04, 0xea, 0xfe, 0x48, 0xf4, 0x19, 0x7a, 0xfe, 0x74, 0x19, 0x0f, 0x19, 0x04, 0x07, 0x7e, 0xfe, + 0x5a, 0xf0, 0xfe, 0x84, 0x19, 0x25, 0xfe, 0x09, 0x00, 0xfe, 0x34, 0x10, 0x07, 0x1a, 0xfe, 0x5a, + 0xf0, 0xfe, 0x92, 0x19, 0x25, 0xca, 0xfe, 0x26, 0x10, 0x07, 0x19, 0x66, 0x25, 0x6d, 0xe5, 0x07, + 0x0a, 0x66, 0x25, 0x9e, 0xfe, 0x0e, 0x10, 0x07, 0x06, 0x66, 0x25, 0x59, 0xa9, 0xb8, 0x04, 0x15, + 0xfe, 0x09, 0x00, 0x01, 0x36, 0xfe, 0x04, 0xfe, 0x81, 0x03, 0x83, 0xfe, 0x40, 0x5c, 0x04, 0x1c, + 0xf7, 0xfe, 0x14, 0xf0, 0x0b, 0x27, 0xfe, 0xd6, 0x19, 0x1c, 0xf7, 0x7b, 0xf7, 0xfe, 0x82, 0xf0, + 0xfe, 0xda, 0x19, 0x04, 0xff, 0xcc, 0x00, 0x00, }; STATIC unsigned short _adv_asc38C0800_size = - sizeof(_adv_asc38C0800_buf); /* 0x14C7 */ + sizeof(_adv_asc38C0800_buf); /* 0x14E1 */ STATIC ADV_DCNT _adv_asc38C0800_chksum = - 0x0505BAF2UL; /* Expanded little-endian checksum. */ - + 0x050D3FD8UL; /* Expanded little-endian checksum. */ +/* Microcode buffer is kept after initialization for error recovery. */ STATIC unsigned char _adv_asc38C1600_buf[] = { - 0x00, 0x00, 0x00, 0xf2, 0x00, 0xfc, 0x00, 0x16, 0x00, 0xf0, 0x01, 0x00, 0xe6, 0x1b, 0x48, 0xe4, - 0x18, 0xe4, 0x03, 0xf6, 0x02, 0x00, 0x18, 0x80, 0x00, 0xfa, 0xff, 0xff, 0x04, 0x00, 0x00, 0xf6, - 0x09, 0xe7, 0x82, 0xe7, 0x85, 0xf0, 0x86, 0xf0, 0xe8, 0x0e, 0x9e, 0xe7, 0xff, 0x00, 0x55, 0xf0, - 0x01, 0xf6, 0x03, 0x00, 0x98, 0x57, 0x01, 0xe6, 0x00, 0xea, 0x00, 0xec, 0x18, 0xf4, 0x01, 0xfa, - 0x08, 0x00, 0xd2, 0x1b, 0x38, 0x54, 0x32, 0xf0, 0x70, 0x0d, 0x1e, 0xf0, 0xd5, 0xf0, 0xbc, 0x00, - 0x4b, 0xe4, 0x00, 0xe6, 0xb1, 0xf0, 0xb4, 0x00, 0x02, 0x13, 0x06, 0x13, 0x3e, 0x1c, 0x3e, 0x00, - 0xd8, 0x01, 0x00, 0x10, 0x0c, 0x1c, 0x00, 0x57, 0x00, 0x80, 0x02, 0x80, 0x1b, 0x80, 0x01, 0xfc, - 0x10, 0x00, 0x6a, 0x0d, 0xe0, 0x10, 0xb9, 0x54, 0xf2, 0x13, 0x18, 0x40, 0xbd, 0x56, 0x03, 0xe6, - 0x01, 0xea, 0x5c, 0xf0, 0x0f, 0x00, 0x20, 0x00, 0xc0, 0x00, 0x6c, 0x01, 0x6e, 0x01, 0x98, 0x10, - 0x04, 0x12, 0x04, 0x13, 0xbb, 0x55, 0x3c, 0x56, 0x03, 0x58, 0x4a, 0xe4, 0x40, 0x00, 0xb6, 0x00, - 0xbb, 0x00, 0x00, 0x01, 0x01, 0x01, 0x3e, 0x01, 0x7c, 0x09, 0x08, 0x12, 0x0a, 0x12, 0x4c, 0x1c, - 0x3e, 0x57, 0x30, 0xe4, 0x05, 0xe6, 0x0c, 0x00, 0x3c, 0x00, 0x80, 0x00, 0x24, 0x01, 0x3c, 0x01, + 0x00, 0x00, 0x00, 0xf2, 0x00, 0x16, 0x00, 0xfc, 0x00, 0x10, 0x00, 0xf0, 0x18, 0xe4, 0x01, 0x00, + 0x04, 0x1e, 0x48, 0xe4, 0x03, 0xf6, 0xf7, 0x13, 0x2e, 0x1e, 0x02, 0x00, 0x07, 0x17, 0xc0, 0x5f, + 0x00, 0xfa, 0xff, 0xff, 0x04, 0x00, 0x00, 0xf6, 0x09, 0xe7, 0x82, 0xe7, 0x85, 0xf0, 0x86, 0xf0, + 0x4e, 0x10, 0x9e, 0xe7, 0xff, 0x00, 0x55, 0xf0, 0x01, 0xf6, 0x03, 0x00, 0x98, 0x57, 0x01, 0xe6, + 0x00, 0xea, 0x00, 0xec, 0x01, 0xfa, 0x18, 0xf4, 0x08, 0x00, 0xf0, 0x1d, 0x38, 0x54, 0x32, 0xf0, + 0x10, 0x00, 0xc2, 0x0e, 0x1e, 0xf0, 0xd5, 0xf0, 0xbc, 0x00, 0x4b, 0xe4, 0x00, 0xe6, 0xb1, 0xf0, + 0xb4, 0x00, 0x02, 0x13, 0x3e, 0x1c, 0xc8, 0x47, 0x3e, 0x00, 0xd8, 0x01, 0x06, 0x13, 0x0c, 0x1c, + 0x5e, 0x1e, 0x00, 0x57, 0xc8, 0x57, 0x01, 0xfc, 0xbc, 0x0e, 0xa2, 0x12, 0xb9, 0x54, 0x00, 0x80, + 0x62, 0x0a, 0x5a, 0x12, 0xc8, 0x15, 0x3e, 0x1e, 0x18, 0x40, 0xbd, 0x56, 0x03, 0xe6, 0x01, 0xea, + 0x5c, 0xf0, 0x0f, 0x00, 0x20, 0x00, 0x6c, 0x01, 0x6e, 0x01, 0x04, 0x12, 0x04, 0x13, 0xbb, 0x55, + 0x3c, 0x56, 0x3e, 0x57, 0x03, 0x58, 0x4a, 0xe4, 0x40, 0x00, 0xb6, 0x00, 0xbb, 0x00, 0xc0, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x3e, 0x01, 0x58, 0x0a, 0x44, 0x10, 0x0a, 0x12, 0x4c, 0x1c, 0x4e, 0x1c, + 0x02, 0x4a, 0x30, 0xe4, 0x05, 0xe6, 0x0c, 0x00, 0x3c, 0x00, 0x80, 0x00, 0x24, 0x01, 0x3c, 0x01, 0x68, 0x01, 0x6a, 0x01, 0x70, 0x01, 0x72, 0x01, 0x74, 0x01, 0x76, 0x01, 0x78, 0x01, 0x7c, 0x01, - 0x62, 0x0a, 0x74, 0x0d, 0x0c, 0x10, 0xea, 0x10, 0xec, 0x10, 0x22, 0x18, 0x4e, 0x1c, 0x02, 0x4a, - 0x3a, 0x55, 0x02, 0xee, 0x5b, 0xf0, 0x03, 0xf7, 0x06, 0xf7, 0x03, 0xfc, 0x06, 0x00, 0x1e, 0x00, - 0xbe, 0x00, 0xe1, 0x00, 0xde, 0x0e, 0x24, 0x18, 0x78, 0x18, 0x30, 0x1c, 0x32, 0x1c, 0x38, 0x1c, - 0x10, 0x44, 0x02, 0x48, 0x00, 0x4c, 0xb0, 0x57, 0x04, 0x80, 0x4d, 0xe4, 0x04, 0xea, 0x5d, 0xf0, - 0xa7, 0xf0, 0x04, 0xf6, 0x02, 0xfc, 0x05, 0x00, 0x09, 0x00, 0x19, 0x00, 0x32, 0x00, 0x33, 0x00, - 0x34, 0x00, 0x36, 0x00, 0x98, 0x00, 0x9e, 0x00, 0xcc, 0x00, 0x20, 0x01, 0x4e, 0x01, 0x79, 0x01, - 0xac, 0x08, 0x32, 0x0c, 0x02, 0x10, 0x04, 0x10, 0x12, 0x10, 0x0c, 0x12, 0x0a, 0x13, 0x6a, 0x14, - 0x7a, 0x14, 0x56, 0x17, 0x00, 0x4e, 0x00, 0x54, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, 0x59, 0xf0, - 0xb8, 0xf0, 0x48, 0xf4, 0x0e, 0xf7, 0x0a, 0x00, 0x9b, 0x00, 0x9c, 0x00, 0xa4, 0x00, 0xb5, 0x00, - 0xba, 0x00, 0xd0, 0x00, 0xe7, 0x00, 0xe6, 0x03, 0x69, 0x08, 0xe9, 0x09, 0x2a, 0x0b, 0xd4, 0x0e, - 0x0a, 0x10, 0x0e, 0x10, 0x12, 0x13, 0x94, 0x14, 0xc8, 0x17, 0xc0, 0x19, 0x24, 0x1b, 0x20, 0x1c, - 0x34, 0x1c, 0x36, 0x1c, 0x08, 0x44, 0x38, 0x44, 0x91, 0x44, 0x0a, 0x45, 0x48, 0x46, 0x89, 0x48, - 0x68, 0x54, 0x83, 0x55, 0x01, 0x58, 0x83, 0x59, 0x40, 0x5c, 0x06, 0x83, 0x31, 0xe4, 0x02, 0xe6, - 0x07, 0xf0, 0x08, 0xf0, 0x0b, 0xf0, 0x0c, 0xf0, 0x4b, 0xf4, 0x04, 0xf8, 0x05, 0xf8, 0x02, 0xfa, - 0x03, 0xfa, 0x04, 0xfc, 0x05, 0xfc, 0x07, 0x00, 0xa8, 0x00, 0xaa, 0x00, 0xb9, 0x00, 0xe0, 0x00, - 0xe5, 0x00, 0x22, 0x01, 0x26, 0x01, 0x60, 0x01, 0x7a, 0x01, 0x82, 0x01, 0xc8, 0x01, 0xca, 0x01, - 0x84, 0x02, 0x6a, 0x03, 0xe2, 0x04, 0x4e, 0x07, 0x68, 0x08, 0x86, 0x09, 0xda, 0x0b, 0xfa, 0x0e, - 0x06, 0x10, 0x1a, 0x10, 0xed, 0x10, 0xf1, 0x10, 0xf3, 0x10, 0xf4, 0x10, 0x06, 0x12, 0x0e, 0x13, - 0x10, 0x13, 0x16, 0x13, 0x1e, 0x13, 0xc4, 0x14, 0x90, 0x15, 0xfe, 0x9c, 0xf0, 0x30, 0x04, 0xfe, - 0x9a, 0x0d, 0xff, 0x10, 0x00, 0x00, 0xe7, 0xfe, 0x00, 0x1c, 0x00, 0xe6, 0xfe, 0x88, 0x01, 0xff, - 0x03, 0x00, 0x00, 0xfe, 0x02, 0x15, 0xfe, 0x0c, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, - 0x00, 0xfe, 0x4c, 0x00, 0x5d, 0xff, 0x04, 0x00, 0x00, 0x16, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, + 0xc6, 0x0e, 0x0c, 0x10, 0xac, 0x12, 0xae, 0x12, 0x16, 0x1a, 0x32, 0x1c, 0x6e, 0x1e, 0x02, 0x48, + 0x3a, 0x55, 0xc9, 0x57, 0x02, 0xee, 0x5b, 0xf0, 0x03, 0xf7, 0x06, 0xf7, 0x03, 0xfc, 0x06, 0x00, + 0x1e, 0x00, 0xbe, 0x00, 0xe1, 0x00, 0x0c, 0x12, 0x18, 0x1a, 0x70, 0x1a, 0x30, 0x1c, 0x38, 0x1c, + 0x10, 0x44, 0x00, 0x4c, 0xb0, 0x57, 0x40, 0x5c, 0x4d, 0xe4, 0x04, 0xea, 0x5d, 0xf0, 0xa7, 0xf0, + 0x04, 0xf6, 0x02, 0xfc, 0x05, 0x00, 0x09, 0x00, 0x19, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, + 0x36, 0x00, 0x98, 0x00, 0x9e, 0x00, 0xcc, 0x00, 0x20, 0x01, 0x4e, 0x01, 0x79, 0x01, 0x3c, 0x09, + 0x68, 0x0d, 0x02, 0x10, 0x04, 0x10, 0x3a, 0x10, 0x08, 0x12, 0x0a, 0x13, 0x40, 0x16, 0x50, 0x16, + 0x00, 0x17, 0x4a, 0x19, 0x00, 0x4e, 0x00, 0x54, 0x01, 0x58, 0x00, 0xdc, 0x05, 0xf0, 0x09, 0xf0, + 0x59, 0xf0, 0xb8, 0xf0, 0x48, 0xf4, 0x0e, 0xf7, 0x0a, 0x00, 0x9b, 0x00, 0x9c, 0x00, 0xa4, 0x00, + 0xb5, 0x00, 0xba, 0x00, 0xd0, 0x00, 0xe7, 0x00, 0xf0, 0x03, 0x69, 0x08, 0xe9, 0x09, 0x5c, 0x0c, + 0xb6, 0x12, 0xbc, 0x19, 0xd8, 0x1b, 0x20, 0x1c, 0x34, 0x1c, 0x36, 0x1c, 0x42, 0x1d, 0x08, 0x44, + 0x38, 0x44, 0x91, 0x44, 0x0a, 0x45, 0x48, 0x46, 0x89, 0x48, 0x68, 0x54, 0x83, 0x55, 0x83, 0x59, + 0x31, 0xe4, 0x02, 0xe6, 0x07, 0xf0, 0x08, 0xf0, 0x0b, 0xf0, 0x0c, 0xf0, 0x4b, 0xf4, 0x04, 0xf8, + 0x05, 0xf8, 0x02, 0xfa, 0x03, 0xfa, 0x04, 0xfc, 0x05, 0xfc, 0x07, 0x00, 0xa8, 0x00, 0xaa, 0x00, + 0xb9, 0x00, 0xe0, 0x00, 0xe5, 0x00, 0x22, 0x01, 0x26, 0x01, 0x60, 0x01, 0x7a, 0x01, 0x82, 0x01, + 0xc8, 0x01, 0xca, 0x01, 0x86, 0x02, 0x6a, 0x03, 0x18, 0x05, 0xb2, 0x07, 0x68, 0x08, 0x10, 0x0d, + 0x06, 0x10, 0x0a, 0x10, 0x0e, 0x10, 0x12, 0x10, 0x60, 0x10, 0xed, 0x10, 0xf3, 0x10, 0x06, 0x12, + 0x10, 0x12, 0x1e, 0x12, 0x0c, 0x13, 0x0e, 0x13, 0x10, 0x13, 0xfe, 0x9c, 0xf0, 0x35, 0x05, 0xfe, + 0xec, 0x0e, 0xff, 0x10, 0x00, 0x00, 0xe9, 0xfe, 0x34, 0x1f, 0x00, 0xe8, 0xfe, 0x88, 0x01, 0xff, + 0x03, 0x00, 0x00, 0xfe, 0x93, 0x15, 0xfe, 0x0f, 0x05, 0xff, 0x38, 0x00, 0x00, 0xfe, 0x57, 0x24, + 0x00, 0xfe, 0x4c, 0x00, 0x65, 0xff, 0x04, 0x00, 0x00, 0x1a, 0xff, 0x09, 0x00, 0x00, 0xff, 0x08, 0x01, 0x01, 0xff, 0x08, 0xff, 0xff, 0xff, 0x27, 0x00, 0x00, 0xff, 0x10, 0xff, 0xff, 0xff, 0x13, - 0x00, 0x00, 0xfe, 0x78, 0x56, 0xfe, 0x34, 0x12, 0xff, 0x21, 0x00, 0x00, 0xfe, 0x04, 0xf7, 0xe6, - 0x32, 0x74, 0x0a, 0x01, 0xfe, 0x88, 0x0f, 0xfe, 0x04, 0xf7, 0xe6, 0x74, 0x0a, 0x58, 0x32, 0xfe, - 0x3d, 0xf0, 0xfe, 0x0a, 0x02, 0xfe, 0x20, 0xf0, 0xb3, 0xfe, 0x91, 0xf0, 0xfe, 0xf8, 0x01, 0xfe, - 0x90, 0xf0, 0xfe, 0xf8, 0x01, 0xfe, 0x8f, 0xf0, 0xb3, 0x02, 0x5f, 0x48, 0x04, 0xfe, 0xb6, 0x0d, - 0x01, 0xfe, 0x18, 0x0e, 0xfe, 0xdd, 0x12, 0xfe, 0xfc, 0x10, 0xfe, 0x28, 0x1c, 0x02, 0xfe, 0xa6, - 0x00, 0xfe, 0xd3, 0x12, 0x3b, 0x1f, 0xfe, 0xa6, 0x00, 0xca, 0xfe, 0x48, 0xf0, 0xfe, 0x8e, 0x02, - 0xfe, 0x49, 0xf0, 0xfe, 0xa8, 0x02, 0xfe, 0x4a, 0xf0, 0xfe, 0xc6, 0x02, 0xfe, 0x46, 0xf0, 0xfe, - 0x58, 0x02, 0xfe, 0x47, 0xf0, 0xfe, 0x5e, 0x02, 0xfe, 0x43, 0xf0, 0xfe, 0x4c, 0x02, 0xfe, 0x44, - 0xf0, 0xfe, 0x50, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x54, 0x02, 0x18, 0x0a, 0x9b, 0x18, 0x05, 0x1f, - 0xae, 0x04, 0x30, 0xfe, 0x00, 0x1c, 0xf3, 0xfe, 0x02, 0x1c, 0xf2, 0xfe, 0x1e, 0x1c, 0xfe, 0xe9, - 0x10, 0x01, 0xfe, 0x34, 0x1a, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xdc, 0x09, 0x78, 0x01, 0xb7, - 0x04, 0x30, 0x1b, 0x8e, 0x40, 0xaf, 0x01, 0xfe, 0x22, 0x10, 0x09, 0x78, 0x01, 0x7a, 0xfe, 0xbd, - 0x10, 0x09, 0x78, 0x01, 0x7a, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x18, 0x05, - 0x1f, 0xae, 0x32, 0x25, 0x30, 0xfe, 0x3d, 0xf0, 0xfe, 0x0a, 0x02, 0x26, 0xfe, 0x9c, 0x02, 0xfe, - 0x5a, 0x1c, 0xfe, 0x12, 0x1c, 0xfe, 0x14, 0x1c, 0x1b, 0xfe, 0x30, 0x00, 0x40, 0xaf, 0x01, 0x9c, - 0x18, 0x05, 0x1f, 0xae, 0x04, 0xe7, 0x1d, 0x27, 0x07, 0x16, 0x2c, 0xfe, 0x69, 0x10, 0x18, 0x05, - 0x1f, 0xae, 0xfe, 0x04, 0xec, 0x27, 0x6f, 0x34, 0x1c, 0x27, 0xfe, 0x05, 0xf6, 0xdc, 0x01, 0xfe, - 0x66, 0x19, 0x0b, 0x59, 0x43, 0x3d, 0x11, 0x50, 0x58, 0xcd, 0x01, 0xfe, 0x9e, 0x18, 0x04, 0x30, - 0x09, 0x44, 0x01, 0x14, 0x07, 0x00, 0x2d, 0x01, 0x7c, 0xfe, 0x20, 0x10, 0x09, 0xb1, 0x01, 0x14, - 0xfe, 0x41, 0x58, 0x09, 0x44, 0x01, 0x14, 0xfe, 0x49, 0x54, 0x72, 0xfe, 0x14, 0x03, 0x01, 0xfe, - 0x9e, 0x18, 0x04, 0x30, 0x32, 0x6f, 0xfe, 0x02, 0xe8, 0x2b, 0xfe, 0xbf, 0x57, 0xfe, 0x9e, 0x43, - 0xfe, 0x77, 0x57, 0xfe, 0x27, 0xf0, 0xfe, 0xe4, 0x01, 0xfe, 0x07, 0x4b, 0xfe, 0x20, 0xf0, 0xb3, - 0xfe, 0x40, 0x1c, 0x25, 0xe9, 0xfe, 0x26, 0xf0, 0xfe, 0x66, 0x03, 0xfe, 0xa0, 0xf0, 0xfe, 0x54, - 0x03, 0xfe, 0x11, 0xf0, 0xb3, 0xb9, 0xfe, 0x9f, 0xf0, 0xfe, 0x74, 0x03, 0xfe, 0x46, 0x1c, 0x15, - 0xfe, 0x11, 0x00, 0x04, 0x69, 0x32, 0xfe, 0x48, 0x1c, 0xfe, 0x46, 0x1c, 0x22, 0x1d, 0xb0, 0xc2, - 0x1c, 0xb0, 0x09, 0x44, 0x01, 0x14, 0xc2, 0x82, 0x01, 0xfe, 0xd0, 0x18, 0x11, 0xdf, 0x25, 0xe9, - 0xfe, 0x01, 0xf0, 0xe9, 0xfe, 0x82, 0xf0, 0xfe, 0x9a, 0x03, 0xfe, 0x9c, 0x32, 0x11, 0xfe, 0xe4, - 0x00, 0x2a, 0xfe, 0xac, 0x03, 0x25, 0x39, 0x12, 0xfe, 0xbc, 0x03, 0x01, 0x47, 0xfe, 0x06, 0xf0, - 0xfe, 0xcc, 0x03, 0xa6, 0x99, 0xfe, 0x0a, 0xf0, 0xfe, 0x3e, 0x07, 0x04, 0x24, 0x02, 0x78, 0x1a, - 0x17, 0xfe, 0xee, 0x04, 0x1b, 0x5b, 0x01, 0x3c, 0x88, 0xfe, 0x6e, 0x02, 0x04, 0xe8, 0xfe, 0x46, - 0x1c, 0x32, 0x74, 0x19, 0xfe, 0x67, 0x1b, 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0xfe, 0x48, 0x1c, - 0x7e, 0x01, 0x9f, 0x7d, 0x09, 0x44, 0x01, 0x14, 0x07, 0x00, 0x17, 0xea, 0x09, 0xdf, 0x01, 0x14, - 0x81, 0x4b, 0x68, 0x86, 0x2b, 0x02, 0x78, 0x1a, 0xfe, 0x10, 0x12, 0x1b, 0x5b, 0x01, 0x3c, 0x88, - 0xfe, 0x6e, 0x02, 0x04, 0xe8, 0xd5, 0x92, 0xd6, 0x95, 0x25, 0x24, 0x2a, 0xfe, 0x44, 0x04, 0x12, - 0xfe, 0x40, 0x04, 0x75, 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x46, 0x12, 0x2e, 0xff, 0x02, - 0x00, 0x10, 0x01, 0x06, 0x12, 0xfe, 0xd8, 0x04, 0x2e, 0x01, 0x06, 0x12, 0x24, 0x23, 0x21, 0xec, - 0xfe, 0x4c, 0x44, 0xfe, 0x3c, 0x12, 0x4b, 0xfe, 0x44, 0x48, 0x0f, 0x2f, 0xfe, 0x4c, 0x54, 0x72, - 0xea, 0x6f, 0x86, 0x2b, 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x52, 0x13, 0x35, 0x07, 0x94, - 0xfe, 0x4a, 0x13, 0xfe, 0x18, 0x10, 0x0f, 0x2f, 0xfe, 0x4c, 0x54, 0x72, 0xea, 0xfe, 0x06, 0x80, - 0xfe, 0x48, 0x47, 0xfe, 0x38, 0x13, 0x35, 0x07, 0x94, 0xfe, 0x30, 0x13, 0x0b, 0x08, 0x38, 0xfe, - 0x1c, 0x12, 0x1b, 0x76, 0x0b, 0x08, 0x05, 0x48, 0x1b, 0xfe, 0x0d, 0x00, 0x01, 0x3c, 0x88, 0xfe, - 0x52, 0x0d, 0x04, 0x24, 0x2e, 0x11, 0xfe, 0xe6, 0x00, 0xfe, 0x1c, 0x90, 0xcc, 0x03, 0x1b, 0x76, - 0x01, 0x3c, 0x04, 0x30, 0xfe, 0x42, 0x5b, 0x74, 0x19, 0xfe, 0x46, 0x59, 0xfe, 0xbf, 0x57, 0xfe, - 0x77, 0x57, 0xfe, 0x87, 0x80, 0xce, 0x5d, 0x0b, 0x08, 0x0a, 0xfe, 0x84, 0x13, 0xfe, 0x20, 0x80, - 0x07, 0x19, 0xfe, 0x7c, 0x12, 0x36, 0x08, 0x05, 0xfe, 0x6c, 0x13, 0x02, 0xfe, 0xa2, 0x00, 0x1a, - 0x17, 0xfe, 0x84, 0x05, 0xce, 0x4e, 0x36, 0x08, 0x0a, 0xfe, 0x56, 0x13, 0x02, 0xfe, 0xa0, 0x00, - 0x1a, 0xfe, 0x4e, 0x12, 0x57, 0xff, 0x02, 0x00, 0x10, 0x2a, 0xfe, 0x3c, 0x05, 0x25, 0x39, 0xc7, - 0xff, 0x02, 0x00, 0x10, 0x2a, 0xfe, 0x4a, 0x05, 0x13, 0xfe, 0x9c, 0x05, 0x11, 0xfe, 0xe3, 0x00, - 0x22, 0x36, 0xfe, 0x4a, 0xf0, 0xfe, 0x6a, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0x64, 0x05, 0x6a, 0x29, - 0xfe, 0x21, 0x00, 0xb8, 0x29, 0xfe, 0x22, 0x00, 0x9b, 0x29, 0x43, 0xfe, 0x09, 0x48, 0xff, 0x02, - 0x00, 0x10, 0x2a, 0xfe, 0x7a, 0x05, 0x13, 0xfe, 0x9c, 0x05, 0xfe, 0xe2, 0x08, 0x36, 0x08, 0xfe, - 0x1c, 0x00, 0x48, 0x01, 0xa0, 0x29, 0x05, 0x1c, 0xe2, 0x40, 0xfe, 0x27, 0x01, 0x0b, 0x08, 0x38, - 0xfe, 0x22, 0x12, 0x3b, 0x01, 0x7b, 0x1b, 0x76, 0x0b, 0x08, 0x05, 0x48, 0x1b, 0xfe, 0x0d, 0x00, - 0x01, 0x3c, 0x88, 0xfe, 0x52, 0x0d, 0x04, 0x24, 0x02, 0xe4, 0x1a, 0xfe, 0xc6, 0x13, 0x02, 0xad, - 0x1a, 0xfe, 0x3e, 0x12, 0x02, 0x5e, 0x1a, 0xfe, 0x36, 0x13, 0x3b, 0x01, 0x7b, 0x13, 0xfe, 0x14, - 0x06, 0x09, 0x05, 0x36, 0x08, 0x20, 0xfe, 0x02, 0x12, 0x4a, 0x01, 0xfe, 0x62, 0x17, 0x12, 0xfe, - 0x0a, 0x06, 0x11, 0x79, 0x01, 0x47, 0x11, 0xe0, 0x02, 0x5e, 0x83, 0x0c, 0x5e, 0x02, 0x93, 0x1a, - 0xfe, 0x6e, 0x12, 0x02, 0x4f, 0x1a, 0xfe, 0x66, 0x13, 0x01, 0xbe, 0x07, 0x0e, 0x41, 0xfe, 0x34, - 0x06, 0x29, 0x0e, 0x01, 0xfe, 0x8e, 0x1b, 0xfe, 0x43, 0x48, 0x5a, 0x77, 0x0f, 0x51, 0xff, 0x02, - 0x00, 0x57, 0x4c, 0xa4, 0x1e, 0x34, 0x49, 0x5a, 0x42, 0x3b, 0x01, 0x7b, 0x13, 0xfe, 0x8a, 0x06, - 0x36, 0x08, 0x0e, 0xf6, 0x3e, 0x09, 0x8e, 0x01, 0xfe, 0x90, 0x17, 0x12, 0xfe, 0x80, 0x06, 0x11, - 0x79, 0x01, 0x47, 0x11, 0xe0, 0x02, 0x4f, 0x83, 0x0c, 0x4f, 0x18, 0x05, 0x01, 0x7b, 0xfe, 0xaa, - 0x10, 0x02, 0x67, 0x1a, 0xfe, 0x9a, 0x13, 0x3b, 0x01, 0x7b, 0x02, 0x93, 0x1a, 0xfe, 0x18, 0x12, - 0x36, 0x08, 0x0e, 0xf8, 0x01, 0xbe, 0x01, 0xfe, 0x8e, 0x1b, 0xfe, 0x43, 0x48, 0x5a, 0x77, 0xf0, - 0x3e, 0x09, 0x8e, 0x02, 0xad, 0x1a, 0xfe, 0x0e, 0x12, 0x36, 0x08, 0x20, 0x2d, 0xfe, 0x02, 0xf6, - 0x05, 0x6a, 0x70, 0x85, 0x00, 0x48, 0x5a, 0x42, 0x3b, 0x28, 0x8c, 0x49, 0xce, 0x0a, 0x13, 0xfe, - 0x36, 0x07, 0x01, 0xfe, 0xcc, 0x17, 0x12, 0xfe, 0x2c, 0x07, 0x22, 0x1c, 0x97, 0x11, 0x79, 0x01, - 0x47, 0x11, 0xe0, 0x1d, 0x97, 0x07, 0x05, 0xf7, 0x02, 0xe4, 0xfe, 0x58, 0x57, 0x0c, 0xe4, 0x04, - 0xfe, 0xce, 0x05, 0x02, 0x67, 0x83, 0x0c, 0x67, 0x18, 0x05, 0x01, 0x7b, 0xfe, 0x9c, 0x32, 0x6e, - 0x7e, 0x01, 0x9f, 0x7d, 0x11, 0xfe, 0xe2, 0x00, 0x2a, 0xeb, 0x25, 0x39, 0xfe, 0x0a, 0xf0, 0xfe, - 0x6a, 0x07, 0xa5, 0xfe, 0x20, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x28, 0x08, 0xa6, 0x99, 0x04, 0x24, - 0x0b, 0x08, 0x0a, 0xfe, 0x2e, 0x12, 0x10, 0x19, 0x01, 0x06, 0x10, 0x00, 0x01, 0x06, 0x10, 0x00, - 0x01, 0x06, 0x10, 0x00, 0x01, 0x06, 0xfe, 0x99, 0xa4, 0x01, 0x06, 0x10, 0x00, 0x04, 0xfe, 0xf6, - 0x08, 0x84, 0x08, 0x0e, 0xfe, 0x38, 0x12, 0x0b, 0x08, 0x0e, 0xfe, 0x30, 0x13, 0x10, 0xfe, 0x1b, - 0x00, 0x01, 0x06, 0x10, 0x00, 0x01, 0x06, 0x10, 0x00, 0x01, 0x06, 0x10, 0x00, 0x01, 0x06, 0x10, - 0x05, 0x01, 0x06, 0x10, 0x00, 0x04, 0xee, 0x73, 0x43, 0x70, 0x4a, 0xfe, 0x9a, 0x81, 0x28, 0x38, - 0x41, 0xfe, 0xf6, 0x07, 0x09, 0x38, 0xfe, 0x09, 0x6f, 0xc5, 0xfe, 0xca, 0x45, 0xfe, 0x32, 0x12, - 0x4d, 0x5b, 0x49, 0x73, 0x90, 0x2a, 0xfe, 0x08, 0x08, 0x25, 0x39, 0xfe, 0x0a, 0xf0, 0xfe, 0xf6, - 0x07, 0xa6, 0x99, 0xa5, 0xfe, 0x20, 0x08, 0x04, 0x24, 0x01, 0x47, 0x04, 0xeb, 0x10, 0x20, 0x04, - 0xeb, 0xfe, 0x9c, 0xf7, 0x98, 0xfe, 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x87, 0xfe, 0x8e, 0x08, 0x0c, - 0x62, 0x1f, 0x63, 0x0b, 0x59, 0x4e, 0x3d, 0x1d, 0x27, 0x07, 0x16, 0xfe, 0x0e, 0x12, 0x81, 0xfe, - 0x80, 0x80, 0x40, 0x27, 0x71, 0x2b, 0xf0, 0xfe, 0x83, 0xe7, 0xfe, 0x3f, 0x00, 0xb8, 0xfe, 0x03, - 0x40, 0x0b, 0x59, 0x5d, 0x3d, 0x01, 0xbd, 0xc3, 0xfe, 0x1f, 0x40, 0x1c, 0x66, 0x01, 0xbb, 0xfe, - 0x08, 0x50, 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, 0xfe, 0xc6, 0x51, 0x6a, 0xfe, 0x08, 0x90, 0xfe, - 0x8a, 0x90, 0x0c, 0x60, 0x1f, 0x61, 0xfe, 0x0c, 0x90, 0xfe, 0x8e, 0x90, 0xfe, 0x40, 0x50, 0xfe, - 0xc2, 0x50, 0x0c, 0x45, 0x1f, 0x46, 0xfe, 0x4a, 0x10, 0x0b, 0x08, 0x4e, 0xfe, 0x2a, 0x12, 0xfe, - 0x2c, 0x90, 0xfe, 0xae, 0x90, 0x0c, 0x62, 0x1f, 0x63, 0x0b, 0x08, 0x5d, 0x49, 0x01, 0xbd, 0xfe, - 0x1f, 0x80, 0x1c, 0x66, 0xfe, 0x44, 0x90, 0xfe, 0xc6, 0x90, 0x0c, 0x64, 0x1f, 0x65, 0xfe, 0x08, - 0x90, 0xfe, 0x8a, 0x90, 0x0c, 0x60, 0x1f, 0x61, 0xfe, 0x40, 0x90, 0xfe, 0xc2, 0x90, 0x0c, 0x45, - 0x1f, 0x46, 0x0c, 0x5c, 0x1f, 0x2f, 0x0b, 0x59, 0x20, 0x3d, 0x32, 0x0f, 0xfe, 0x4e, 0x11, 0x2a, - 0xfe, 0x0c, 0x09, 0xfe, 0x9e, 0xf0, 0xfe, 0x20, 0x09, 0xfe, 0x01, 0x48, 0x17, 0x39, 0x32, 0x80, - 0xf2, 0xd2, 0xfe, 0x4c, 0x09, 0xd3, 0xfe, 0x6a, 0x09, 0xd0, 0xfe, 0x4c, 0x09, 0xd1, 0xfe, 0x6a, - 0x09, 0xa5, 0xfe, 0x40, 0x09, 0xfe, 0x06, 0xf0, 0xfe, 0x46, 0x09, 0xa6, 0x99, 0x04, 0x24, 0x01, - 0x47, 0xfe, 0xc1, 0x10, 0x10, 0x20, 0xfe, 0xc1, 0x10, 0x84, 0x08, 0x05, 0xfe, 0x10, 0x12, 0x84, - 0x08, 0x0a, 0x55, 0x0b, 0x08, 0x0a, 0xfe, 0x70, 0x12, 0xfe, 0x2e, 0x1c, 0x04, 0xfe, 0xf8, 0x0a, - 0x84, 0x08, 0x05, 0x55, 0x84, 0x08, 0x0a, 0xfe, 0x5a, 0x12, 0xfe, 0x2c, 0x1c, 0xfe, 0xaa, 0xf0, - 0xfe, 0xf2, 0x09, 0xfe, 0xac, 0xf0, 0xfe, 0x8a, 0x09, 0xfe, 0x92, 0x10, 0xc0, 0xf4, 0xfe, 0xad, - 0xf0, 0xfe, 0x96, 0x09, 0x04, 0xfe, 0xf8, 0x0a, 0xc1, 0xfe, 0xe7, 0x10, 0xfe, 0x2b, 0xf0, 0xb6, - 0xfe, 0x6b, 0x18, 0x1e, 0xfe, 0x00, 0xfe, 0xfe, 0x1c, 0x12, 0xca, 0xfe, 0xd2, 0xf0, 0xb6, 0xfe, - 0x76, 0x18, 0x1e, 0x19, 0x17, 0xb6, 0x02, 0xe1, 0x1e, 0x05, 0x17, 0xb6, 0xd2, 0x54, 0xd3, 0x54, - 0xd0, 0x54, 0xd1, 0x54, 0xc0, 0xc1, 0xfe, 0xa9, 0x10, 0x7e, 0x57, 0x2e, 0x1b, 0x76, 0x01, 0x3c, - 0x15, 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, 0x69, 0x15, 0x91, 0x04, 0x69, 0xfe, 0x74, 0x18, 0x1e, - 0xfe, 0x00, 0xf8, 0x17, 0x54, 0x74, 0x0e, 0x01, 0xfe, 0x18, 0x0e, 0x48, 0x01, 0xfe, 0x9e, 0x18, - 0x1d, 0x2b, 0x81, 0x74, 0x19, 0x04, 0x54, 0xfe, 0x98, 0x80, 0xfe, 0x19, 0xe4, 0x0a, 0x26, 0xfe, - 0xda, 0x0a, 0x0b, 0x08, 0x4e, 0xfe, 0x82, 0x12, 0x0b, 0x08, 0x20, 0xfe, 0x66, 0x13, 0x1d, 0x66, - 0xc2, 0xfe, 0x03, 0xa1, 0xfe, 0x83, 0x80, 0xfe, 0xc8, 0x44, 0xfe, 0x2e, 0x13, 0xfe, 0x04, 0x91, - 0xfe, 0x86, 0x91, 0x71, 0x2b, 0xfe, 0x40, 0x59, 0xfe, 0xc1, 0x59, 0x87, 0xed, 0x02, 0x62, 0x37, - 0x63, 0x0c, 0x90, 0x1f, 0x91, 0xd7, 0x62, 0xd8, 0x63, 0x01, 0xbd, 0xc3, 0x71, 0x2b, 0x1c, 0x66, - 0xd9, 0x5c, 0xda, 0x2f, 0x8a, 0x64, 0x75, 0x65, 0xfe, 0x44, 0x55, 0xfe, 0xe5, 0x55, 0xfe, 0x04, - 0xfa, 0x5c, 0xfe, 0x05, 0xfa, 0x2f, 0x01, 0xbb, 0xfe, 0x36, 0x10, 0x22, 0x0c, 0x90, 0x0c, 0x91, - 0x8a, 0x64, 0x75, 0x65, 0x9c, 0x0b, 0x08, 0x20, 0x17, 0xed, 0x8a, 0x45, 0x75, 0x46, 0x0b, 0x08, - 0xfe, 0xf7, 0x00, 0x3d, 0x02, 0x60, 0x37, 0x61, 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, 0xfe, 0x14, - 0x59, 0xfe, 0x95, 0x59, 0x04, 0x54, 0x0b, 0x08, 0x20, 0x17, 0xed, 0x0b, 0x08, 0xfe, 0xf7, 0x00, - 0x3d, 0x70, 0xfe, 0x19, 0x81, 0x4a, 0xfe, 0x10, 0x90, 0xfe, 0x92, 0x90, 0xfe, 0xd7, 0x10, 0x35, - 0x07, 0xb2, 0x17, 0xfe, 0x92, 0x09, 0x11, 0xb2, 0xfe, 0x98, 0x80, 0xfe, 0x19, 0xe4, 0x0a, 0xfe, - 0x14, 0x13, 0x02, 0x45, 0x37, 0x46, 0x87, 0xfe, 0x92, 0x09, 0xfe, 0x0c, 0x58, 0xfe, 0x8d, 0x58, - 0x04, 0x54, 0x22, 0x3b, 0xfe, 0x19, 0x80, 0xf3, 0x0b, 0x08, 0x0a, 0xfe, 0x1a, 0x12, 0xfe, 0x6c, - 0x19, 0xfe, 0x19, 0x41, 0xfe, 0x6b, 0x18, 0xca, 0xfe, 0xd1, 0xf0, 0xee, 0x1b, 0x8b, 0x01, 0x3c, - 0x15, 0xfe, 0x44, 0x00, 0xfe, 0x8e, 0x10, 0xfe, 0x6c, 0x19, 0xd7, 0x45, 0xfe, 0xed, 0x19, 0xd8, - 0x46, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0xfe, 0x6b, 0x18, 0x1e, 0xfe, 0x00, 0xff, 0x2c, 0xfe, - 0x74, 0x10, 0xca, 0xfe, 0xd2, 0xf0, 0xfe, 0x86, 0x0b, 0xfe, 0x76, 0x18, 0x1e, 0x19, 0x56, 0x02, - 0xe1, 0x1e, 0x05, 0xfe, 0x08, 0x13, 0x15, 0xfe, 0x16, 0x00, 0x04, 0x69, 0xfe, 0xd1, 0xf0, 0xfe, - 0x98, 0x0b, 0x1b, 0x8b, 0x01, 0x3c, 0x15, 0xfe, 0x17, 0x00, 0xfe, 0x42, 0x10, 0xfe, 0xce, 0xf0, - 0xfe, 0x9e, 0x0b, 0xfe, 0x3c, 0x10, 0xfe, 0xcd, 0xf0, 0xfe, 0xaa, 0x0b, 0x15, 0xfe, 0x22, 0x00, - 0x04, 0x69, 0xfe, 0xcb, 0xf0, 0xfe, 0xb6, 0x0b, 0x15, 0xfe, 0x24, 0x00, 0x04, 0x69, 0xfe, 0xd0, - 0xf0, 0xfe, 0xc0, 0x0b, 0x15, 0x8d, 0xf1, 0xfe, 0xcf, 0xf0, 0xfe, 0xca, 0x0b, 0x15, 0x43, 0xfe, - 0x10, 0x10, 0xfe, 0xcc, 0xf0, 0xee, 0xfe, 0x84, 0x80, 0xfe, 0x19, 0xe4, 0x20, 0x48, 0x15, 0xfe, - 0x12, 0x00, 0x32, 0x0f, 0xfe, 0x4e, 0x11, 0x2a, 0xfe, 0xe0, 0x0b, 0xfe, 0x9e, 0xf0, 0xfe, 0xf4, - 0x0b, 0xfe, 0x01, 0x48, 0x17, 0x39, 0x32, 0x80, 0xf2, 0xd2, 0x24, 0xd3, 0x24, 0xd0, 0x24, 0xd1, - 0x24, 0x32, 0xfe, 0x9c, 0x32, 0x2a, 0xfe, 0x08, 0x0c, 0x25, 0x39, 0xa5, 0xfe, 0x2c, 0x0c, 0xa6, - 0x99, 0xd2, 0x98, 0xd3, 0x98, 0xd0, 0x98, 0xd1, 0x98, 0x04, 0x24, 0x01, 0x47, 0xfe, 0xd3, 0x10, - 0x11, 0xfe, 0xe8, 0x00, 0xc0, 0xc1, 0x7e, 0xd5, 0x92, 0xd6, 0x95, 0xfe, 0x89, 0xf0, 0x24, 0x23, - 0x21, 0xb5, 0xd5, 0x92, 0xd6, 0x95, 0x2a, 0xfe, 0x56, 0x0c, 0x12, 0x24, 0x23, 0x21, 0xb4, 0xfe, - 0x01, 0x48, 0x55, 0x15, 0xfe, 0x42, 0x00, 0x04, 0x69, 0x89, 0x05, 0xfe, 0x81, 0x49, 0xfe, 0xa2, - 0x12, 0x0b, 0x08, 0x0a, 0xfe, 0x44, 0x13, 0x15, 0x00, 0x28, 0x0a, 0xfe, 0x54, 0x12, 0x28, 0xfe, - 0x28, 0x00, 0x26, 0xfe, 0x88, 0x0d, 0x09, 0x44, 0x01, 0x14, 0x07, 0x00, 0x2d, 0x3f, 0xfe, 0x28, - 0x00, 0xfe, 0xe2, 0x10, 0x01, 0xfe, 0xd6, 0x1a, 0x01, 0xfe, 0xe2, 0x1a, 0x09, 0xb1, 0x01, 0xfe, - 0xf2, 0x0e, 0x68, 0x11, 0x50, 0x01, 0x7c, 0x04, 0x30, 0x15, 0xfe, 0x44, 0x00, 0x28, 0x0a, 0xf6, - 0x3f, 0x0a, 0xfe, 0xb4, 0x10, 0x01, 0xa0, 0x3f, 0x0a, 0xfe, 0xaa, 0x10, 0x01, 0xa0, 0xfe, 0x19, - 0x82, 0xfe, 0x34, 0x46, 0x9e, 0x3f, 0x0a, 0x15, 0xfe, 0x43, 0x00, 0xfe, 0x96, 0x10, 0x0b, 0x59, - 0x0a, 0x3d, 0x01, 0xfe, 0xd6, 0x1a, 0x01, 0xfe, 0xe2, 0x1a, 0x68, 0x11, 0x50, 0x01, 0x7c, 0x74, - 0x0a, 0x68, 0x58, 0xcd, 0x04, 0xfe, 0x3a, 0x03, 0x0b, 0x08, 0x0a, 0x56, 0x3f, 0x0a, 0x15, 0x00, - 0xfe, 0x5c, 0x10, 0x84, 0x08, 0x0e, 0xfe, 0x58, 0x12, 0x0b, 0x08, 0x0e, 0xfe, 0x50, 0x13, 0xfe, - 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x3e, 0x0d, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x44, - 0x0d, 0x0b, 0x59, 0x0e, 0x3d, 0xfe, 0xa9, 0x10, 0x15, 0xfe, 0x15, 0x00, 0xfe, 0x04, 0xe6, 0x0a, - 0x4a, 0xfe, 0x2e, 0x10, 0x15, 0xfe, 0x13, 0x00, 0xfe, 0x10, 0x10, 0x15, 0xfe, 0x47, 0x00, 0xb8, - 0x15, 0xfe, 0x41, 0x00, 0x9b, 0x15, 0xfe, 0x24, 0x00, 0x7d, 0xc0, 0xc1, 0x7e, 0x02, 0x78, 0x1a, - 0x26, 0xe8, 0x4a, 0xfe, 0x04, 0xe6, 0x0e, 0xfe, 0x9d, 0x41, 0xfe, 0x1c, 0x42, 0x68, 0x01, 0xef, - 0x04, 0x30, 0xfe, 0x12, 0x1c, 0x1b, 0x0a, 0x40, 0xac, 0xbf, 0x1b, 0xfe, 0x31, 0x00, 0x40, 0xaf, - 0x01, 0x9c, 0x04, 0xe7, 0x58, 0xfe, 0x06, 0xec, 0xde, 0xfe, 0x0e, 0x47, 0x3f, 0x38, 0xfe, 0xce, - 0x45, 0x2c, 0x58, 0xfe, 0x06, 0xea, 0xde, 0xfe, 0x47, 0x4b, 0x3e, 0xfe, 0x75, 0x57, 0x02, 0x5f, - 0xfe, 0x98, 0x56, 0xfe, 0x2a, 0x12, 0x09, 0x44, 0x01, 0x14, 0x3b, 0xfe, 0x41, 0x58, 0x09, 0xb1, - 0xfe, 0xfc, 0x14, 0xfe, 0x49, 0x54, 0xa7, 0xfe, 0xfe, 0x0d, 0x09, 0x53, 0xfe, 0xf0, 0x14, 0xfe, - 0x44, 0x48, 0x04, 0xfe, 0x3a, 0x03, 0x09, 0x5f, 0xfe, 0xda, 0x14, 0xfe, 0x0e, 0x47, 0x3f, 0x38, - 0xfe, 0xce, 0x45, 0x2c, 0x58, 0xfe, 0xce, 0x47, 0xfe, 0xbb, 0x13, 0x04, 0x30, 0x1d, 0x27, 0x07, - 0x16, 0xfe, 0x92, 0x12, 0x22, 0x1c, 0x8f, 0x1c, 0xe5, 0xfe, 0x08, 0x1c, 0xfe, 0x7c, 0x19, 0xfe, - 0xfd, 0x19, 0xfe, 0x0a, 0x1c, 0x02, 0xe3, 0xfe, 0x48, 0x55, 0x9e, 0x37, 0xfe, 0x62, 0x01, 0xfe, - 0xc9, 0x55, 0x2c, 0xfe, 0x6e, 0x10, 0x01, 0xfe, 0xf6, 0x18, 0x02, 0xfe, 0x38, 0x01, 0x37, 0xfe, - 0x3a, 0x01, 0x87, 0xfe, 0xb8, 0x0e, 0xfe, 0x02, 0xec, 0xe5, 0x4d, 0x00, 0x2d, 0xfe, 0x04, 0xec, - 0x27, 0x6f, 0xfe, 0x05, 0xf6, 0xfe, 0x34, 0x01, 0x01, 0xfe, 0x66, 0x19, 0xfe, 0x08, 0x90, 0xa9, - 0x0d, 0xfe, 0x18, 0x13, 0xc5, 0xfe, 0x02, 0xea, 0xe5, 0x4d, 0x8b, 0xfe, 0xc5, 0x13, 0x1b, 0x0e, - 0x40, 0xac, 0xbf, 0xfe, 0x26, 0x10, 0x02, 0xfe, 0x38, 0x01, 0x1e, 0xfe, 0xf0, 0xff, 0x0c, 0xe3, - 0x02, 0xfe, 0x3a, 0x01, 0x0c, 0xfe, 0x62, 0x01, 0x34, 0x1c, 0x27, 0x11, 0x50, 0xcd, 0x0f, 0x05, - 0x03, 0x22, 0x03, 0x1d, 0x8f, 0xc2, 0x1c, 0x8f, 0x07, 0x8b, 0xfe, 0x7f, 0x13, 0x1b, 0x19, 0x40, - 0xac, 0xbf, 0xfe, 0xe1, 0x10, 0xcb, 0xfe, 0x03, 0xdc, 0xfe, 0x73, 0x57, 0xfe, 0x80, 0x5d, 0x03, - 0xcb, 0xfe, 0x03, 0xdc, 0xfe, 0x5b, 0x57, 0xfe, 0x80, 0x5d, 0x03, 0xfe, 0x03, 0x57, 0xcb, 0x22, - 0xfe, 0x00, 0xcc, 0x03, 0xfe, 0x03, 0x57, 0xcb, 0x82, 0x03, 0x0b, 0x08, 0x43, 0xfe, 0x22, 0x13, - 0xfe, 0x1c, 0x80, 0x07, 0x05, 0xfe, 0x1a, 0x13, 0xfe, 0x1e, 0x80, 0xf9, 0xfe, 0x1d, 0x80, 0xba, - 0xfe, 0x0c, 0x90, 0xf7, 0xfe, 0x0e, 0x90, 0x9e, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, 0x0a, 0xfe, - 0x3c, 0x50, 0x9b, 0x01, 0xfe, 0x96, 0x19, 0x35, 0x07, 0x50, 0x2d, 0x01, 0xfe, 0xd0, 0x18, 0xfe, - 0x08, 0x10, 0x01, 0xfe, 0xd6, 0x1a, 0x01, 0xfe, 0xe2, 0x1a, 0x11, 0xfe, 0xe9, 0x00, 0x0b, 0x08, - 0x43, 0xfe, 0x2c, 0x13, 0x01, 0xfe, 0x28, 0x19, 0xfe, 0x1e, 0x1c, 0xfe, 0x14, 0x90, 0x0c, 0xfe, - 0x64, 0x01, 0xfe, 0x16, 0x90, 0x0c, 0xfe, 0x66, 0x01, 0x0b, 0x08, 0x5d, 0xfe, 0x12, 0x12, 0xfe, - 0x03, 0x80, 0x81, 0xfe, 0x01, 0xec, 0x27, 0xfe, 0x80, 0x40, 0x1c, 0x27, 0x71, 0x2b, 0x11, 0xdd, - 0x68, 0x1d, 0x27, 0xfe, 0x00, 0x40, 0x86, 0x27, 0x03, 0xfe, 0x08, 0x1c, 0x02, 0xfe, 0xac, 0x00, - 0xfe, 0x06, 0x58, 0x02, 0xfe, 0xae, 0x00, 0xfe, 0x07, 0x58, 0x02, 0xfe, 0xb0, 0x00, 0xfe, 0x08, - 0x58, 0x02, 0xfe, 0xb2, 0x00, 0xfe, 0x09, 0x58, 0xfe, 0x0a, 0x1c, 0x29, 0x42, 0x1c, 0xde, 0x22, - 0x0c, 0x5e, 0x0c, 0x4f, 0x0c, 0x67, 0x0f, 0x44, 0x4c, 0x4a, 0x18, 0x38, 0xfe, 0x90, 0x4d, 0xfe, - 0x91, 0x54, 0x26, 0xfe, 0xc6, 0x0f, 0x3f, 0x16, 0x0f, 0x53, 0x4c, 0x18, 0x43, 0xfe, 0x90, 0x4d, - 0xfe, 0x91, 0x54, 0x26, 0xfe, 0xdc, 0x0f, 0x29, 0x16, 0x1c, 0x27, 0x89, 0x2f, 0x6f, 0x1d, 0x27, - 0xfe, 0x00, 0x40, 0x86, 0x27, 0x11, 0xdd, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0xf0, 0x0f, - 0xfe, 0x12, 0x1c, 0x7e, 0xfe, 0x14, 0x1c, 0xfe, 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x03, 0x58, 0xfe, - 0x0c, 0x14, 0xfe, 0x0e, 0x47, 0xfe, 0x07, 0xe6, 0x38, 0xfe, 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x03, - 0x01, 0xa0, 0x89, 0x2f, 0x6f, 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x42, 0x13, 0x35, 0x07, - 0x50, 0xfe, 0x34, 0x13, 0x09, 0x53, 0x01, 0x14, 0xc6, 0xfe, 0x36, 0x12, 0xfe, 0x41, 0x48, 0xfe, - 0x45, 0x48, 0x01, 0xfb, 0xfe, 0x00, 0xcc, 0xc6, 0xfe, 0xf3, 0x13, 0x34, 0x82, 0x07, 0x16, 0x9e, - 0x09, 0x96, 0x01, 0x14, 0xfe, 0x80, 0x5c, 0x01, 0x7c, 0xb9, 0x07, 0x94, 0x55, 0xfe, 0x14, 0x56, - 0xfe, 0xd6, 0xf0, 0xfe, 0x2a, 0x10, 0x03, 0xfe, 0x44, 0x58, 0x81, 0xfe, 0x01, 0xec, 0xaf, 0xfe, - 0x9e, 0x40, 0xfe, 0x9d, 0xe7, 0x00, 0xfe, 0x9c, 0xe7, 0x0e, 0x86, 0x2b, 0x01, 0xef, 0xfe, 0xdd, - 0x10, 0x32, 0xd5, 0x92, 0xd6, 0x95, 0x23, 0x21, 0xec, 0x07, 0x0e, 0xfe, 0x48, 0x12, 0x07, 0x0a, - 0xfe, 0x56, 0x12, 0x07, 0x19, 0xfe, 0x30, 0x12, 0x07, 0xdb, 0x17, 0xfe, 0xfc, 0x11, 0x07, 0xfe, - 0x23, 0x00, 0x17, 0x55, 0x07, 0x05, 0x17, 0xfe, 0x66, 0x12, 0x07, 0x20, 0xfe, 0x12, 0x12, 0x07, - 0x00, 0x17, 0x24, 0x1b, 0xdb, 0x01, 0x3c, 0x9a, 0x2e, 0x01, 0x06, 0xa5, 0x47, 0x03, 0x2e, 0xfe, - 0x62, 0x08, 0x09, 0xdf, 0x01, 0xfe, 0xf2, 0x0e, 0x11, 0x94, 0x04, 0x30, 0x2e, 0x35, 0x07, 0xb2, - 0xfe, 0xd9, 0x13, 0x8a, 0x45, 0x75, 0x46, 0x87, 0xfe, 0xba, 0x11, 0x0b, 0x08, 0x4e, 0xfe, 0x72, - 0x12, 0xd9, 0x5c, 0xda, 0x2f, 0xfe, 0x44, 0x55, 0xfe, 0xe5, 0x55, 0xa7, 0xfe, 0x84, 0x11, 0x1d, - 0x66, 0xfe, 0x26, 0x13, 0x02, 0x90, 0x37, 0x91, 0x87, 0xfe, 0x64, 0x0d, 0x0c, 0x62, 0x1f, 0x63, - 0x22, 0x0c, 0x90, 0x0c, 0x91, 0x01, 0xbd, 0x29, 0x42, 0x80, 0x1c, 0x66, 0x01, 0xbb, 0xd9, 0x5c, - 0xda, 0x2f, 0xfe, 0x04, 0x55, 0xfe, 0xa5, 0x55, 0xfe, 0x04, 0xfa, 0x5c, 0xfe, 0x05, 0xfa, 0x2f, - 0xfe, 0x91, 0x10, 0x02, 0x64, 0x37, 0x65, 0xfe, 0x40, 0x56, 0xfe, 0xe1, 0x56, 0x0c, 0x64, 0x1f, - 0x65, 0x6a, 0xd9, 0x5c, 0xda, 0x2f, 0xfe, 0x44, 0x55, 0xfe, 0xe5, 0x55, 0x02, 0x60, 0x37, 0x61, - 0xfe, 0x00, 0x56, 0xfe, 0xa1, 0x56, 0x0c, 0x60, 0x1f, 0x61, 0x0b, 0x08, 0x4e, 0xfe, 0x1e, 0x12, - 0x1d, 0x66, 0xfe, 0x1f, 0x40, 0x02, 0x62, 0x37, 0x63, 0xfe, 0x2c, 0x50, 0xfe, 0xae, 0x50, 0x02, - 0x64, 0x37, 0x65, 0xfe, 0x44, 0x50, 0xfe, 0xc6, 0x50, 0x02, 0x60, 0x37, 0x61, 0xfe, 0x08, 0x50, - 0xfe, 0x8a, 0x50, 0x02, 0x45, 0x37, 0x46, 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x04, 0x6c, 0x29, - 0x05, 0x1c, 0x97, 0x04, 0x6b, 0x2e, 0x01, 0x06, 0x12, 0x3a, 0x23, 0x21, 0xec, 0x07, 0x05, 0x26, - 0x3a, 0x35, 0x07, 0xb2, 0x26, 0x6b, 0x01, 0x9f, 0x1e, 0x34, 0x17, 0x3a, 0x0b, 0x08, 0x0a, 0xfa, - 0x8a, 0x45, 0x75, 0x46, 0xfe, 0x0a, 0x55, 0x2c, 0xfe, 0x8b, 0x55, 0xd7, 0x45, 0xd8, 0x46, 0xfe, - 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0x04, 0x6b, 0xfe, 0x19, 0x81, 0xc5, 0xfe, 0x19, 0x41, 0x04, 0x6b, - 0x2e, 0x01, 0x06, 0x25, 0x39, 0x12, 0xf5, 0x23, 0x21, 0xb5, 0x28, 0x19, 0xfe, 0xb2, 0x12, 0x28, - 0x0a, 0x9d, 0x28, 0x76, 0x17, 0xfe, 0x92, 0x13, 0x04, 0x3a, 0x01, 0x06, 0x25, 0x39, 0x12, 0xf5, - 0x23, 0x21, 0xb4, 0x07, 0x19, 0x26, 0x3a, 0x01, 0x06, 0x12, 0xf5, 0x23, 0x21, 0xfe, 0xe8, 0x09, - 0xfe, 0xc2, 0x49, 0x4b, 0x02, 0xad, 0x1a, 0x56, 0x36, 0x08, 0x20, 0x2c, 0x9a, 0xfe, 0xbb, 0x45, - 0x28, 0x00, 0x55, 0x3f, 0x05, 0x89, 0x34, 0x01, 0xfe, 0x22, 0x14, 0x01, 0x9f, 0x7d, 0xfe, 0x4b, - 0x45, 0xfa, 0x35, 0x07, 0x79, 0xf9, 0x02, 0x93, 0x1a, 0x56, 0x02, 0x4f, 0x1a, 0x2c, 0x57, 0x04, - 0x6b, 0xfe, 0xc0, 0x5d, 0x01, 0xa0, 0xfe, 0x03, 0x17, 0x02, 0x5e, 0x83, 0x0c, 0x5e, 0x57, 0x2e, - 0x01, 0x06, 0x13, 0x6c, 0x01, 0xfe, 0x62, 0x17, 0x04, 0x6c, 0x01, 0x06, 0x25, 0x39, 0x12, 0x3a, - 0x23, 0x21, 0xb4, 0x07, 0x05, 0x26, 0x3a, 0x01, 0xfe, 0xd0, 0x14, 0xfe, 0x42, 0x58, 0xfe, 0xe4, - 0x14, 0x01, 0x9f, 0x7d, 0xfe, 0x4a, 0xf4, 0x0a, 0x17, 0x3a, 0xfe, 0x4a, 0xf4, 0x05, 0x9d, 0x35, - 0x07, 0x79, 0x49, 0x04, 0x6b, 0x02, 0x4f, 0x83, 0x0c, 0x4f, 0x57, 0x2e, 0x01, 0x06, 0x13, 0x6c, - 0x01, 0xfe, 0x90, 0x17, 0x04, 0x6c, 0x01, 0x06, 0x25, 0x39, 0x12, 0x3a, 0x23, 0x21, 0xb4, 0x07, - 0x0e, 0x26, 0x3a, 0x01, 0xfe, 0xf8, 0x15, 0xcc, 0xfe, 0xa8, 0x14, 0xfe, 0xb4, 0x14, 0x7d, 0xfe, - 0x00, 0x17, 0xa9, 0x0a, 0x17, 0x3a, 0xa9, 0x05, 0x9d, 0x35, 0x07, 0x79, 0x49, 0x04, 0x6b, 0x02, - 0x67, 0x83, 0x0c, 0x67, 0x57, 0x2e, 0x01, 0x06, 0x13, 0x6c, 0x01, 0xfe, 0xcc, 0x17, 0x04, 0x6c, - 0x0f, 0x05, 0x2a, 0xfe, 0xf6, 0x13, 0x13, 0xfe, 0x0c, 0x14, 0x6e, 0xc7, 0x01, 0x06, 0x22, 0x6e, - 0x03, 0x88, 0xfe, 0x08, 0x14, 0x25, 0xfe, 0x08, 0x14, 0x12, 0xfe, 0xf6, 0x13, 0x57, 0x2e, 0x01, - 0x06, 0xfe, 0xd5, 0x10, 0x0f, 0x51, 0xff, 0x02, 0x00, 0x57, 0x4c, 0xa4, 0x1e, 0xfe, 0xff, 0x7f, - 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x03, 0x0f, 0x51, 0xff, 0x02, 0x00, 0x57, 0x4c, 0xa4, 0x1e, - 0x34, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x03, 0x0f, 0x51, 0xff, 0x02, 0x00, 0x57, 0x4c, 0xa4, - 0x03, 0x0f, 0x51, 0xff, 0x02, 0x00, 0x57, 0x4c, 0xfe, 0x00, 0x5e, 0x03, 0x0f, 0x51, 0xff, 0x02, - 0x00, 0x57, 0x4c, 0xa4, 0xfe, 0x0b, 0x58, 0x03, 0x09, 0x5e, 0x01, 0x7a, 0x09, 0x4f, 0x01, 0x7a, - 0x09, 0x67, 0x01, 0x7a, 0x03, 0xfe, 0x03, 0xa1, 0x1e, 0x16, 0xff, 0x03, 0x00, 0x54, 0xfe, 0x00, - 0xf4, 0x20, 0x4c, 0xfe, 0x00, 0x7d, 0xfe, 0x01, 0x7d, 0xfe, 0x02, 0x7d, 0xfe, 0x03, 0x7c, 0x71, - 0x2b, 0x0c, 0x60, 0x1f, 0x61, 0xd7, 0x64, 0xd8, 0x65, 0x03, 0xfe, 0x62, 0x08, 0xfe, 0x82, 0x4a, - 0xfe, 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x81, 0x03, 0x01, 0xbe, 0xfe, 0x42, 0x48, 0x4a, 0x4b, 0x3e, - 0x01, 0x06, 0x12, 0xfe, 0xf0, 0x15, 0x23, 0x21, 0xb5, 0x01, 0x06, 0x12, 0xfe, 0xf0, 0x15, 0x23, - 0x21, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, 0x59, 0x02, 0x93, 0x1a, 0xfe, 0xd8, 0x12, 0x36, 0x08, 0x0e, - 0xfe, 0xd0, 0x13, 0x22, 0x4d, 0x0e, 0x41, 0xfe, 0x18, 0x15, 0xcf, 0x0e, 0x4d, 0x0e, 0xfa, 0x28, - 0xab, 0x72, 0xfe, 0x36, 0x15, 0x48, 0x0f, 0x05, 0x18, 0xab, 0x89, 0x31, 0xfe, 0x78, 0x10, 0xff, - 0x02, 0x83, 0x55, 0xb8, 0xff, 0x02, 0x83, 0x55, 0x4d, 0x19, 0xba, 0xd4, 0xfe, 0x30, 0x00, 0xa7, - 0xfc, 0x18, 0x5b, 0x0f, 0x05, 0xfe, 0x56, 0x10, 0x4d, 0x0a, 0xf9, 0xd4, 0xfe, 0x64, 0x00, 0xa7, - 0xfc, 0x09, 0xfe, 0x64, 0x00, 0x18, 0x8d, 0x0f, 0x05, 0xfe, 0x28, 0x10, 0x4d, 0x05, 0xfe, 0x60, - 0x13, 0xd4, 0xfe, 0xc8, 0x00, 0xa7, 0xfc, 0x09, 0xfe, 0xc8, 0x00, 0x18, 0x8e, 0x0f, 0x05, 0x6a, - 0xd4, 0xfe, 0x90, 0x01, 0x41, 0xfe, 0x9c, 0x15, 0x3e, 0x9c, 0xfe, 0x43, 0xf4, 0x8f, 0xfe, 0x56, - 0xf0, 0xfe, 0xae, 0x15, 0xfe, 0x04, 0xf4, 0x51, 0xfe, 0x43, 0xf4, 0x8d, 0xf4, 0xcc, 0x01, 0xfe, - 0x4e, 0x14, 0x1e, 0x34, 0xf8, 0xfe, 0x00, 0x17, 0x85, 0x42, 0x41, 0xfe, 0xea, 0x15, 0x5a, 0x42, - 0xfe, 0x1c, 0x10, 0xfe, 0x00, 0x17, 0x85, 0x77, 0x41, 0xfe, 0xea, 0x15, 0x5a, 0x77, 0x6a, 0x4b, - 0x22, 0xfe, 0x4d, 0xf4, 0x00, 0xf6, 0x3e, 0x0f, 0x05, 0xfe, 0xb4, 0x56, 0xfe, 0xc3, 0x58, 0x03, - 0x4b, 0x0f, 0x0a, 0x03, 0x4b, 0x3b, 0x70, 0x4a, 0x3e, 0x01, 0x06, 0x12, 0xa1, 0x23, 0x21, 0xb5, - 0xfe, 0x03, 0xea, 0xfe, 0x7e, 0x01, 0x01, 0x06, 0x12, 0xa1, 0x23, 0x21, 0xfe, 0xe9, 0x0a, 0x01, - 0x06, 0x12, 0xa1, 0x23, 0x21, 0xfe, 0xe9, 0x0a, 0xfe, 0x05, 0xea, 0xfe, 0x7f, 0x01, 0x01, 0x06, - 0x12, 0xa1, 0x23, 0x21, 0xfe, 0x69, 0x09, 0xfe, 0x02, 0xea, 0xfe, 0x80, 0x01, 0x01, 0x06, 0x12, - 0xa1, 0x23, 0x21, 0xfe, 0xe8, 0x08, 0x40, 0xfe, 0x81, 0x01, 0x02, 0xad, 0x1a, 0x56, 0x36, 0x08, - 0x20, 0x2c, 0x9b, 0x70, 0xb9, 0x4d, 0x05, 0x2d, 0xfe, 0x34, 0xf4, 0x34, 0x9a, 0x70, 0x02, 0x93, - 0x1a, 0x56, 0x36, 0x08, 0x0e, 0x2c, 0xf0, 0x4a, 0x3e, 0xfe, 0x90, 0x10, 0xfe, 0x40, 0x5a, 0x1e, - 0x34, 0xf7, 0x85, 0x42, 0x41, 0xfe, 0xb6, 0x16, 0x5a, 0x42, 0x6a, 0x85, 0x77, 0x41, 0xfe, 0xb6, - 0x16, 0x5a, 0x77, 0xfe, 0xb4, 0x56, 0xfe, 0x40, 0x5d, 0x01, 0xbe, 0x01, 0xfe, 0x8e, 0x1b, 0xfe, - 0x02, 0x17, 0xfe, 0xc8, 0x45, 0xfe, 0x5a, 0xf0, 0xfe, 0xcc, 0x16, 0xfe, 0x43, 0x48, 0x28, 0x8c, - 0x2d, 0xfe, 0x34, 0xf4, 0xfe, 0x00, 0x11, 0xfe, 0x40, 0x10, 0x28, 0xab, 0x2d, 0xfe, 0x34, 0xf4, - 0x31, 0xfe, 0x34, 0x10, 0x28, 0xfe, 0x0b, 0x00, 0x2d, 0x3f, 0x5b, 0xfe, 0x28, 0x10, 0xfe, 0xc0, - 0x49, 0xff, 0x02, 0x00, 0x54, 0xa9, 0xfe, 0x90, 0x01, 0x41, 0xfe, 0x06, 0x17, 0x3e, 0xfe, 0x1c, - 0xf4, 0x34, 0x9c, 0xfe, 0x40, 0xf4, 0x8f, 0xfe, 0x56, 0xf0, 0xfe, 0x18, 0x17, 0xfe, 0x04, 0xf4, - 0x51, 0xfe, 0x40, 0xf4, 0x8d, 0xf4, 0x3b, 0x28, 0x8c, 0x49, 0xce, 0x0a, 0x1d, 0xfe, 0x7f, 0x01, - 0xfe, 0xc8, 0x46, 0xfe, 0x24, 0x13, 0x85, 0x00, 0x56, 0x22, 0x1d, 0xfe, 0x7e, 0x01, 0xfe, 0xc8, - 0x45, 0xfe, 0x14, 0x13, 0x1d, 0xfe, 0x80, 0x01, 0xfe, 0x48, 0x45, 0xfe, 0x0c, 0x13, 0x1d, 0xfe, - 0x81, 0x01, 0xfe, 0xc8, 0x44, 0x49, 0x22, 0x03, 0x0f, 0x05, 0x03, 0x70, 0x3e, 0x4b, 0x0f, 0x0a, - 0x03, 0x10, 0x05, 0x01, 0x06, 0x13, 0xfe, 0x8e, 0x17, 0x10, 0x0a, 0x01, 0x06, 0x13, 0xfe, 0x8e, - 0x17, 0x10, 0x19, 0x01, 0x06, 0x13, 0xfe, 0x8e, 0x17, 0x6e, 0xfe, 0x89, 0x49, 0x01, 0x06, 0x03, - 0x10, 0x05, 0x01, 0x06, 0x13, 0xbc, 0x10, 0x19, 0x01, 0x06, 0x13, 0xbc, 0x10, 0x05, 0x01, 0x06, - 0x13, 0xbc, 0xfe, 0x89, 0x49, 0x01, 0x06, 0x13, 0xbc, 0x6e, 0xfe, 0x89, 0x4a, 0x01, 0x06, 0x03, - 0x4b, 0x03, 0x10, 0x05, 0x01, 0x06, 0x13, 0x6d, 0x10, 0x76, 0x01, 0x06, 0x13, 0x6d, 0x10, 0x0e, - 0x01, 0x06, 0x13, 0x6d, 0xfe, 0x89, 0x49, 0x01, 0x06, 0x13, 0x6d, 0x10, 0x00, 0x01, 0x06, 0x13, - 0x6d, 0xfe, 0x89, 0x4a, 0x01, 0x06, 0x13, 0x6d, 0xfe, 0x09, 0x49, 0x01, 0x06, 0x13, 0x6d, 0x6e, - 0xc7, 0x01, 0x06, 0x03, 0x1d, 0xe2, 0x07, 0x05, 0xfe, 0x48, 0x13, 0xc3, 0x1c, 0xe2, 0xfe, 0x49, - 0xf4, 0x00, 0x48, 0x6e, 0x9a, 0x57, 0xfe, 0x01, 0xec, 0xfe, 0x27, 0x01, 0xc7, 0xff, 0x02, 0x00, - 0x10, 0x2a, 0xfe, 0x4a, 0x18, 0x35, 0x07, 0xfe, 0xe3, 0x00, 0xfe, 0x20, 0x13, 0x12, 0xfe, 0x6e, - 0x18, 0x22, 0x1c, 0x97, 0x01, 0x47, 0x1d, 0x97, 0x07, 0x05, 0x55, 0x0b, 0x59, 0x05, 0x3d, 0x03, - 0x09, 0x53, 0x01, 0x14, 0xfe, 0x00, 0x40, 0xa2, 0x07, 0x16, 0xba, 0x09, 0x96, 0x01, 0x14, 0xa2, - 0x09, 0x5f, 0x01, 0xb7, 0x03, 0x09, 0x96, 0x01, 0x14, 0xa2, 0xfe, 0x80, 0xe7, 0x16, 0x07, 0x16, - 0x56, 0xfe, 0x45, 0x58, 0x01, 0xfb, 0xa2, 0x03, 0x09, 0x53, 0x01, 0x14, 0xa2, 0x09, 0x5f, 0x01, - 0xb7, 0x03, 0x09, 0x53, 0x01, 0x14, 0xfe, 0x80, 0x80, 0xfe, 0x80, 0x4c, 0xfe, 0x49, 0xe4, 0x16, - 0xba, 0x09, 0x96, 0x01, 0x14, 0xfe, 0x80, 0x4c, 0x09, 0x5f, 0x01, 0x7a, 0x03, 0x18, 0x16, 0x7f, - 0x73, 0xe3, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x24, 0x1c, 0xfe, 0x1d, 0xf7, 0x38, 0xa8, - 0xfe, 0x0a, 0x19, 0x01, 0xfe, 0x10, 0x1a, 0xfe, 0x0c, 0x13, 0xaa, 0x38, 0x73, 0xfe, 0x2c, 0x01, - 0xfe, 0x2f, 0x19, 0x03, 0xc4, 0x26, 0xfe, 0xfa, 0x18, 0xfe, 0xda, 0x10, 0x18, 0x16, 0x7f, 0x02, - 0xfe, 0x64, 0x01, 0xfe, 0x00, 0xf4, 0x20, 0xfe, 0x18, 0x58, 0x02, 0xfe, 0x66, 0x01, 0xfe, 0x19, - 0x58, 0xaa, 0x20, 0xfe, 0x3c, 0x90, 0xfe, 0x30, 0xf4, 0x05, 0xfe, 0x3c, 0x50, 0x73, 0xfe, 0x38, - 0x00, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x20, 0xa8, 0xfe, 0x54, 0x19, 0xfe, 0xb6, 0x14, 0x2c, - 0x03, 0xc4, 0x26, 0xfe, 0x2c, 0x19, 0xfe, 0x9c, 0x10, 0x18, 0x16, 0x7f, 0xfe, 0x83, 0x5a, 0xfe, - 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, 0xf7, 0x4e, 0xa8, 0xfe, 0x76, 0x19, 0xbb, 0xf8, 0xaa, - 0x4e, 0x73, 0x0e, 0xfe, 0xaf, 0x19, 0xfe, 0x98, 0xe7, 0x00, 0x03, 0xc4, 0x26, 0xfe, 0x6a, 0x19, - 0xfe, 0x6c, 0x10, 0x18, 0x16, 0x7f, 0xfe, 0x30, 0xbc, 0xfe, 0xb2, 0xbc, 0xaa, 0x43, 0x73, 0x0e, - 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x43, 0xa8, 0xfe, 0xae, 0x19, 0xfe, 0x5c, 0x14, 0x2c, 0x03, - 0xc4, 0x26, 0xfe, 0x9a, 0x19, 0xfe, 0x42, 0x10, 0xfe, 0x02, 0xf6, 0x16, 0x7f, 0xfe, 0x18, 0xfe, - 0x62, 0xfe, 0x19, 0xfe, 0x63, 0xfe, 0x03, 0xa1, 0xfe, 0x1d, 0xf7, 0x5d, 0xa8, 0xfe, 0xd4, 0x19, - 0xfe, 0x36, 0x14, 0xfe, 0x1c, 0x13, 0xaa, 0x5d, 0x3b, 0xfe, 0x83, 0x58, 0xfe, 0xaf, 0x19, 0xfe, - 0x80, 0xe7, 0x16, 0xfe, 0x81, 0xe7, 0x16, 0x11, 0xfe, 0xdd, 0x00, 0x71, 0x2b, 0x03, 0x71, 0x2b, - 0xfe, 0x12, 0x45, 0x26, 0xfe, 0xc4, 0x19, 0x1b, 0x05, 0x40, 0xac, 0xbf, 0x04, 0x30, 0xfe, 0x39, - 0xf0, 0xfe, 0x18, 0x1a, 0x22, 0x03, 0xfe, 0x7e, 0x18, 0x1e, 0x19, 0x2d, 0x0f, 0x0d, 0x03, 0x7f, - 0x02, 0xe1, 0x1e, 0x05, 0xfe, 0xef, 0x12, 0xfe, 0xe1, 0x10, 0x89, 0x2f, 0x6f, 0x35, 0x07, 0x50, - 0xfe, 0x3c, 0x13, 0xfe, 0x7e, 0x14, 0xfe, 0x42, 0x13, 0x58, 0xcd, 0x09, 0x53, 0x01, 0x14, 0xc6, - 0xfe, 0x3e, 0x12, 0xfe, 0x41, 0x48, 0xfe, 0x45, 0x48, 0x01, 0xfb, 0xfe, 0x00, 0xcc, 0xc6, 0xfe, - 0xf3, 0x13, 0x34, 0x82, 0x07, 0x16, 0x9e, 0x09, 0x96, 0x01, 0x14, 0xfe, 0x80, 0x4c, 0x01, 0x7c, - 0xfe, 0x16, 0x10, 0x07, 0x94, 0x49, 0xfe, 0x3c, 0x14, 0xfe, 0x24, 0x12, 0xfe, 0x14, 0x56, 0xfe, - 0xd6, 0xf0, 0xfe, 0x38, 0x1a, 0x18, 0x0a, 0x03, 0xfe, 0x9c, 0xe7, 0x0a, 0x15, 0xfe, 0x15, 0x00, - 0x68, 0x86, 0x2b, 0x01, 0xef, 0x18, 0x05, 0x03, 0x0b, 0x59, 0x38, 0x3d, 0x11, 0x50, 0x01, 0x7c, - 0x18, 0x05, 0x03, 0xfe, 0x38, 0x90, 0xfe, 0xba, 0x90, 0x8a, 0xdc, 0x75, 0xdd, 0xfe, 0x48, 0x55, - 0x2c, 0xfe, 0xc9, 0x55, 0x03, 0x1d, 0xb0, 0x80, 0x1c, 0xb0, 0x03, 0x09, 0xb1, 0x01, 0x14, 0xfe, - 0x41, 0x48, 0x09, 0x44, 0x01, 0x14, 0xfe, 0x49, 0x44, 0x17, 0xfe, 0x00, 0x1b, 0x80, 0x82, 0x03, - 0x09, 0x53, 0x01, 0x14, 0x07, 0x16, 0x55, 0x09, 0x5f, 0x01, 0xb7, 0x09, 0x44, 0x01, 0x14, 0x80, - 0x82, 0x03, 0xfe, 0x4e, 0xe4, 0x19, 0x72, 0xfe, 0x34, 0x1b, 0x02, 0xfe, 0x90, 0x00, 0xfe, 0x3a, - 0x45, 0xfe, 0x2c, 0x10, 0xfe, 0x4e, 0xe4, 0xdb, 0x72, 0xfe, 0x46, 0x1b, 0x02, 0xfe, 0x92, 0x00, - 0xcf, 0x0e, 0xf1, 0xfe, 0x4e, 0xe4, 0xfe, 0x0b, 0x00, 0x72, 0xfe, 0x58, 0x1b, 0x02, 0xfe, 0x94, - 0x00, 0xcf, 0x20, 0xfe, 0x08, 0x10, 0x02, 0xfe, 0x96, 0x00, 0xcf, 0x5b, 0xfe, 0x4e, 0x45, 0x9d, - 0xc5, 0xff, 0x04, 0x68, 0x54, 0xf3, 0x1e, 0x42, 0xfe, 0x08, 0x1c, 0xfe, 0x67, 0x19, 0xfe, 0x0a, - 0x1c, 0xfe, 0x1a, 0xf4, 0xfe, 0x00, 0x04, 0x9d, 0xa9, 0x19, 0x41, 0xfe, 0x8c, 0x1b, 0x0f, 0x19, - 0x03, 0x07, 0x8b, 0xfe, 0x5a, 0xf0, 0xfe, 0x9c, 0x1b, 0x29, 0x8c, 0xfe, 0x34, 0x10, 0x07, 0x0e, - 0xfe, 0x5a, 0xf0, 0xfe, 0xaa, 0x1b, 0x29, 0xab, 0xfe, 0x26, 0x10, 0x07, 0x19, 0x2d, 0x29, 0x5b, - 0xf1, 0x07, 0x0a, 0x2d, 0x29, 0x8d, 0xb9, 0x07, 0x05, 0x2d, 0x29, 0x8e, 0x9a, 0xc3, 0x03, 0x1b, - 0x8c, 0x01, 0x3c, 0xfe, 0x04, 0xfe, 0x92, 0x02, 0x95, 0xcc, 0x03, 0x25, 0xfe, 0xfe, 0x1b, 0xfe, - 0x14, 0xf0, 0x06, 0x2a, 0xfe, 0xee, 0x1b, 0x25, 0xfe, 0xfe, 0x1b, 0x88, 0xfe, 0xfe, 0x1b, 0xfe, - 0x82, 0xf0, 0xfe, 0xf2, 0x1b, 0x03, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x02, - 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x78, 0x56, 0xfe, 0x34, 0x12, 0xff, 0x21, 0x00, 0x00, 0xfe, 0x04, 0xf7, 0xe8, + 0x37, 0x7d, 0x0d, 0x01, 0xfe, 0x4a, 0x11, 0xfe, 0x04, 0xf7, 0xe8, 0x7d, 0x0d, 0x51, 0x37, 0xfe, + 0x3d, 0xf0, 0xfe, 0x0c, 0x02, 0xfe, 0x20, 0xf0, 0xbc, 0xfe, 0x91, 0xf0, 0xfe, 0xf8, 0x01, 0xfe, + 0x90, 0xf0, 0xfe, 0xf8, 0x01, 0xfe, 0x8f, 0xf0, 0xbc, 0x03, 0x67, 0x4d, 0x05, 0xfe, 0x08, 0x0f, + 0x01, 0xfe, 0x78, 0x0f, 0xfe, 0xdd, 0x12, 0x05, 0xfe, 0x0e, 0x03, 0xfe, 0x28, 0x1c, 0x03, 0xfe, + 0xa6, 0x00, 0xfe, 0xd1, 0x12, 0x3e, 0x22, 0xfe, 0xa6, 0x00, 0xac, 0xfe, 0x48, 0xf0, 0xfe, 0x90, + 0x02, 0xfe, 0x49, 0xf0, 0xfe, 0xaa, 0x02, 0xfe, 0x4a, 0xf0, 0xfe, 0xc8, 0x02, 0xfe, 0x46, 0xf0, + 0xfe, 0x5a, 0x02, 0xfe, 0x47, 0xf0, 0xfe, 0x60, 0x02, 0xfe, 0x43, 0xf0, 0xfe, 0x4e, 0x02, 0xfe, + 0x44, 0xf0, 0xfe, 0x52, 0x02, 0xfe, 0x45, 0xf0, 0xfe, 0x56, 0x02, 0x1c, 0x0d, 0xa2, 0x1c, 0x07, + 0x22, 0xb7, 0x05, 0x35, 0xfe, 0x00, 0x1c, 0xfe, 0xf1, 0x10, 0xfe, 0x02, 0x1c, 0xf5, 0xfe, 0x1e, + 0x1c, 0xfe, 0xe9, 0x10, 0x01, 0x5f, 0xfe, 0xe7, 0x10, 0xfe, 0x06, 0xfc, 0xde, 0x0a, 0x81, 0x01, + 0xa3, 0x05, 0x35, 0x1f, 0x95, 0x47, 0xb8, 0x01, 0xfe, 0xe4, 0x11, 0x0a, 0x81, 0x01, 0x5c, 0xfe, + 0xbd, 0x10, 0x0a, 0x81, 0x01, 0x5c, 0xfe, 0xad, 0x10, 0xfe, 0x16, 0x1c, 0xfe, 0x58, 0x1c, 0x1c, + 0x07, 0x22, 0xb7, 0x37, 0x2a, 0x35, 0xfe, 0x3d, 0xf0, 0xfe, 0x0c, 0x02, 0x2b, 0xfe, 0x9e, 0x02, + 0xfe, 0x5a, 0x1c, 0xfe, 0x12, 0x1c, 0xfe, 0x14, 0x1c, 0x1f, 0xfe, 0x30, 0x00, 0x47, 0xb8, 0x01, + 0xfe, 0xd4, 0x11, 0x1c, 0x07, 0x22, 0xb7, 0x05, 0xe9, 0x21, 0x2c, 0x09, 0x1a, 0x31, 0xfe, 0x69, + 0x10, 0x1c, 0x07, 0x22, 0xb7, 0xfe, 0x04, 0xec, 0x2c, 0x60, 0x01, 0xfe, 0x1e, 0x1e, 0x20, 0x2c, + 0xfe, 0x05, 0xf6, 0xde, 0x01, 0xfe, 0x62, 0x1b, 0x01, 0x0c, 0x61, 0x4a, 0x44, 0x15, 0x56, 0x51, + 0x01, 0xfe, 0x9e, 0x1e, 0x01, 0xfe, 0x96, 0x1a, 0x05, 0x35, 0x0a, 0x57, 0x01, 0x18, 0x09, 0x00, + 0x36, 0x01, 0x85, 0xfe, 0x18, 0x10, 0xfe, 0x41, 0x58, 0x0a, 0xba, 0x01, 0x18, 0xfe, 0xc8, 0x54, + 0x7b, 0xfe, 0x1c, 0x03, 0x01, 0xfe, 0x96, 0x1a, 0x05, 0x35, 0x37, 0x60, 0xfe, 0x02, 0xe8, 0x30, + 0xfe, 0xbf, 0x57, 0xfe, 0x9e, 0x43, 0xfe, 0x77, 0x57, 0xfe, 0x27, 0xf0, 0xfe, 0xe4, 0x01, 0xfe, + 0x07, 0x4b, 0xfe, 0x20, 0xf0, 0xbc, 0xfe, 0x40, 0x1c, 0x2a, 0xeb, 0xfe, 0x26, 0xf0, 0xfe, 0x66, + 0x03, 0xfe, 0xa0, 0xf0, 0xfe, 0x54, 0x03, 0xfe, 0x11, 0xf0, 0xbc, 0xfe, 0xef, 0x10, 0xfe, 0x9f, + 0xf0, 0xfe, 0x74, 0x03, 0xfe, 0x46, 0x1c, 0x19, 0xfe, 0x11, 0x00, 0x05, 0x70, 0x37, 0xfe, 0x48, + 0x1c, 0xfe, 0x46, 0x1c, 0x01, 0x0c, 0x06, 0x28, 0xfe, 0x18, 0x13, 0x26, 0x21, 0xb9, 0xc7, 0x20, + 0xb9, 0x0a, 0x57, 0x01, 0x18, 0xc7, 0x89, 0x01, 0xfe, 0xc8, 0x1a, 0x15, 0xe1, 0x2a, 0xeb, 0xfe, + 0x01, 0xf0, 0xeb, 0xfe, 0x82, 0xf0, 0xfe, 0xa4, 0x03, 0xfe, 0x9c, 0x32, 0x15, 0xfe, 0xe4, 0x00, + 0x2f, 0xfe, 0xb6, 0x03, 0x2a, 0x3c, 0x16, 0xfe, 0xc6, 0x03, 0x01, 0x41, 0xfe, 0x06, 0xf0, 0xfe, + 0xd6, 0x03, 0xaf, 0xa0, 0xfe, 0x0a, 0xf0, 0xfe, 0xa2, 0x07, 0x05, 0x29, 0x03, 0x81, 0x1e, 0x1b, + 0xfe, 0x24, 0x05, 0x1f, 0x63, 0x01, 0x42, 0x8f, 0xfe, 0x70, 0x02, 0x05, 0xea, 0xfe, 0x46, 0x1c, + 0x37, 0x7d, 0x1d, 0xfe, 0x67, 0x1b, 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0xfe, 0x48, 0x1c, 0x75, + 0x01, 0xa6, 0x86, 0x0a, 0x57, 0x01, 0x18, 0x09, 0x00, 0x1b, 0xec, 0x0a, 0xe1, 0x01, 0x18, 0x77, + 0x50, 0x40, 0x8d, 0x30, 0x03, 0x81, 0x1e, 0xf8, 0x1f, 0x63, 0x01, 0x42, 0x8f, 0xfe, 0x70, 0x02, + 0x05, 0xea, 0xd7, 0x99, 0xd8, 0x9c, 0x2a, 0x29, 0x2f, 0xfe, 0x4e, 0x04, 0x16, 0xfe, 0x4a, 0x04, + 0x7e, 0xfe, 0xa0, 0x00, 0xfe, 0x9b, 0x57, 0xfe, 0x54, 0x12, 0x32, 0xff, 0x02, 0x00, 0x10, 0x01, + 0x08, 0x16, 0xfe, 0x02, 0x05, 0x32, 0x01, 0x08, 0x16, 0x29, 0x27, 0x25, 0xee, 0xfe, 0x4c, 0x44, + 0xfe, 0x58, 0x12, 0x50, 0xfe, 0x44, 0x48, 0x13, 0x34, 0xfe, 0x4c, 0x54, 0x7b, 0xec, 0x60, 0x8d, + 0x30, 0x01, 0xfe, 0x4e, 0x1e, 0xfe, 0x48, 0x47, 0xfe, 0x7c, 0x13, 0x01, 0x0c, 0x06, 0x28, 0xfe, + 0x32, 0x13, 0x01, 0x43, 0x09, 0x9b, 0xfe, 0x68, 0x13, 0xfe, 0x26, 0x10, 0x13, 0x34, 0xfe, 0x4c, + 0x54, 0x7b, 0xec, 0x01, 0xfe, 0x4e, 0x1e, 0xfe, 0x48, 0x47, 0xfe, 0x54, 0x13, 0x01, 0x0c, 0x06, + 0x28, 0xa5, 0x01, 0x43, 0x09, 0x9b, 0xfe, 0x40, 0x13, 0x01, 0x0c, 0x06, 0x28, 0xf9, 0x1f, 0x7f, + 0x01, 0x0c, 0x06, 0x07, 0x4d, 0x1f, 0xfe, 0x0d, 0x00, 0x01, 0x42, 0x8f, 0xfe, 0xa4, 0x0e, 0x05, + 0x29, 0x32, 0x15, 0xfe, 0xe6, 0x00, 0x0f, 0xfe, 0x1c, 0x90, 0x04, 0xfe, 0x9c, 0x93, 0x3a, 0x0b, + 0x0e, 0x8b, 0x02, 0x1f, 0x7f, 0x01, 0x42, 0x05, 0x35, 0xfe, 0x42, 0x5b, 0x7d, 0x1d, 0xfe, 0x46, + 0x59, 0xfe, 0xbf, 0x57, 0xfe, 0x77, 0x57, 0x0f, 0xfe, 0x87, 0x80, 0x04, 0xfe, 0x87, 0x83, 0xfe, + 0xc9, 0x47, 0x0b, 0x0e, 0xd0, 0x65, 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x98, 0x13, 0x0f, 0xfe, 0x20, + 0x80, 0x04, 0xfe, 0xa0, 0x83, 0x33, 0x0b, 0x0e, 0x09, 0x1d, 0xfe, 0x84, 0x12, 0x01, 0x38, 0x06, + 0x07, 0xfe, 0x70, 0x13, 0x03, 0xfe, 0xa2, 0x00, 0x1e, 0x1b, 0xfe, 0xda, 0x05, 0xd0, 0x54, 0x01, + 0x38, 0x06, 0x0d, 0xfe, 0x58, 0x13, 0x03, 0xfe, 0xa0, 0x00, 0x1e, 0xfe, 0x50, 0x12, 0x5e, 0xff, + 0x02, 0x00, 0x10, 0x2f, 0xfe, 0x90, 0x05, 0x2a, 0x3c, 0xcc, 0xff, 0x02, 0x00, 0x10, 0x2f, 0xfe, + 0x9e, 0x05, 0x17, 0xfe, 0xf4, 0x05, 0x15, 0xfe, 0xe3, 0x00, 0x26, 0x01, 0x38, 0xfe, 0x4a, 0xf0, + 0xfe, 0xc0, 0x05, 0xfe, 0x49, 0xf0, 0xfe, 0xba, 0x05, 0x71, 0x2e, 0xfe, 0x21, 0x00, 0xf1, 0x2e, + 0xfe, 0x22, 0x00, 0xa2, 0x2e, 0x4a, 0xfe, 0x09, 0x48, 0xff, 0x02, 0x00, 0x10, 0x2f, 0xfe, 0xd0, + 0x05, 0x17, 0xfe, 0xf4, 0x05, 0xfe, 0xe2, 0x08, 0x01, 0x38, 0x06, 0xfe, 0x1c, 0x00, 0x4d, 0x01, + 0xa7, 0x2e, 0x07, 0x20, 0xe4, 0x47, 0xfe, 0x27, 0x01, 0x01, 0x0c, 0x06, 0x28, 0xfe, 0x24, 0x12, + 0x3e, 0x01, 0x84, 0x1f, 0x7f, 0x01, 0x0c, 0x06, 0x07, 0x4d, 0x1f, 0xfe, 0x0d, 0x00, 0x01, 0x42, + 0x8f, 0xfe, 0xa4, 0x0e, 0x05, 0x29, 0x03, 0xe6, 0x1e, 0xfe, 0xca, 0x13, 0x03, 0xb6, 0x1e, 0xfe, + 0x40, 0x12, 0x03, 0x66, 0x1e, 0xfe, 0x38, 0x13, 0x3e, 0x01, 0x84, 0x17, 0xfe, 0x72, 0x06, 0x0a, + 0x07, 0x01, 0x38, 0x06, 0x24, 0xfe, 0x02, 0x12, 0x4f, 0x01, 0xfe, 0x56, 0x19, 0x16, 0xfe, 0x68, + 0x06, 0x15, 0x82, 0x01, 0x41, 0x15, 0xe2, 0x03, 0x66, 0x8a, 0x10, 0x66, 0x03, 0x9a, 0x1e, 0xfe, + 0x70, 0x12, 0x03, 0x55, 0x1e, 0xfe, 0x68, 0x13, 0x01, 0xc6, 0x09, 0x12, 0x48, 0xfe, 0x92, 0x06, + 0x2e, 0x12, 0x01, 0xfe, 0xac, 0x1d, 0xfe, 0x43, 0x48, 0x62, 0x80, 0x13, 0x58, 0xff, 0x02, 0x00, + 0x57, 0x52, 0xad, 0x23, 0x3f, 0x4e, 0x62, 0x49, 0x3e, 0x01, 0x84, 0x17, 0xfe, 0xea, 0x06, 0x01, + 0x38, 0x06, 0x12, 0xf7, 0x45, 0x0a, 0x95, 0x01, 0xfe, 0x84, 0x19, 0x16, 0xfe, 0xe0, 0x06, 0x15, + 0x82, 0x01, 0x41, 0x15, 0xe2, 0x03, 0x55, 0x8a, 0x10, 0x55, 0x1c, 0x07, 0x01, 0x84, 0xfe, 0xae, + 0x10, 0x03, 0x6f, 0x1e, 0xfe, 0x9e, 0x13, 0x3e, 0x01, 0x84, 0x03, 0x9a, 0x1e, 0xfe, 0x1a, 0x12, + 0x01, 0x38, 0x06, 0x12, 0xfc, 0x01, 0xc6, 0x01, 0xfe, 0xac, 0x1d, 0xfe, 0x43, 0x48, 0x62, 0x80, + 0xf0, 0x45, 0x0a, 0x95, 0x03, 0xb6, 0x1e, 0xf8, 0x01, 0x38, 0x06, 0x24, 0x36, 0xfe, 0x02, 0xf6, + 0x07, 0x71, 0x78, 0x8c, 0x00, 0x4d, 0x62, 0x49, 0x3e, 0x2d, 0x93, 0x4e, 0xd0, 0x0d, 0x17, 0xfe, + 0x9a, 0x07, 0x01, 0xfe, 0xc0, 0x19, 0x16, 0xfe, 0x90, 0x07, 0x26, 0x20, 0x9e, 0x15, 0x82, 0x01, + 0x41, 0x15, 0xe2, 0x21, 0x9e, 0x09, 0x07, 0xfb, 0x03, 0xe6, 0xfe, 0x58, 0x57, 0x10, 0xe6, 0x05, + 0xfe, 0x2a, 0x06, 0x03, 0x6f, 0x8a, 0x10, 0x6f, 0x1c, 0x07, 0x01, 0x84, 0xfe, 0x9c, 0x32, 0x5f, + 0x75, 0x01, 0xa6, 0x86, 0x15, 0xfe, 0xe2, 0x00, 0x2f, 0xed, 0x2a, 0x3c, 0xfe, 0x0a, 0xf0, 0xfe, + 0xce, 0x07, 0xae, 0xfe, 0x96, 0x08, 0xfe, 0x06, 0xf0, 0xfe, 0x9e, 0x08, 0xaf, 0xa0, 0x05, 0x29, + 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x2e, 0x12, 0x14, 0x1d, 0x01, 0x08, 0x14, 0x00, 0x01, 0x08, 0x14, + 0x00, 0x01, 0x08, 0x14, 0x00, 0x01, 0x08, 0xfe, 0x99, 0xa4, 0x01, 0x08, 0x14, 0x00, 0x05, 0xfe, + 0xc6, 0x09, 0x01, 0x76, 0x06, 0x12, 0xfe, 0x3a, 0x12, 0x01, 0x0c, 0x06, 0x12, 0xfe, 0x30, 0x13, + 0x14, 0xfe, 0x1b, 0x00, 0x01, 0x08, 0x14, 0x00, 0x01, 0x08, 0x14, 0x00, 0x01, 0x08, 0x14, 0x00, + 0x01, 0x08, 0x14, 0x07, 0x01, 0x08, 0x14, 0x00, 0x05, 0xef, 0x7c, 0x4a, 0x78, 0x4f, 0x0f, 0xfe, + 0x9a, 0x81, 0x04, 0xfe, 0x9a, 0x83, 0xfe, 0xcb, 0x47, 0x0b, 0x0e, 0x2d, 0x28, 0x48, 0xfe, 0x6c, + 0x08, 0x0a, 0x28, 0xfe, 0x09, 0x6f, 0xca, 0xfe, 0xca, 0x45, 0xfe, 0x32, 0x12, 0x53, 0x63, 0x4e, + 0x7c, 0x97, 0x2f, 0xfe, 0x7e, 0x08, 0x2a, 0x3c, 0xfe, 0x0a, 0xf0, 0xfe, 0x6c, 0x08, 0xaf, 0xa0, + 0xae, 0xfe, 0x96, 0x08, 0x05, 0x29, 0x01, 0x41, 0x05, 0xed, 0x14, 0x24, 0x05, 0xed, 0xfe, 0x9c, + 0xf7, 0x9f, 0x01, 0xfe, 0xae, 0x1e, 0xfe, 0x18, 0x58, 0x01, 0xfe, 0xbe, 0x1e, 0xfe, 0x99, 0x58, + 0xfe, 0x78, 0x18, 0xfe, 0xf9, 0x18, 0x8e, 0xfe, 0x16, 0x09, 0x10, 0x6a, 0x22, 0x6b, 0x01, 0x0c, + 0x61, 0x54, 0x44, 0x21, 0x2c, 0x09, 0x1a, 0xf8, 0x77, 0x01, 0xfe, 0x7e, 0x1e, 0x47, 0x2c, 0x7a, + 0x30, 0xf0, 0xfe, 0x83, 0xe7, 0xfe, 0x3f, 0x00, 0x71, 0xfe, 0x03, 0x40, 0x01, 0x0c, 0x61, 0x65, + 0x44, 0x01, 0xc2, 0xc8, 0xfe, 0x1f, 0x40, 0x20, 0x6e, 0x01, 0xfe, 0x6a, 0x16, 0xfe, 0x08, 0x50, + 0xfe, 0x8a, 0x50, 0xfe, 0x44, 0x51, 0xfe, 0xc6, 0x51, 0xfe, 0x10, 0x10, 0x01, 0xfe, 0xce, 0x1e, + 0x01, 0xfe, 0xde, 0x1e, 0x10, 0x68, 0x22, 0x69, 0x01, 0xfe, 0xee, 0x1e, 0x01, 0xfe, 0xfe, 0x1e, + 0xfe, 0x40, 0x50, 0xfe, 0xc2, 0x50, 0x10, 0x4b, 0x22, 0x4c, 0xfe, 0x8a, 0x10, 0x01, 0x0c, 0x06, + 0x54, 0xfe, 0x50, 0x12, 0x01, 0xfe, 0xae, 0x1e, 0x01, 0xfe, 0xbe, 0x1e, 0x10, 0x6a, 0x22, 0x6b, + 0x01, 0x0c, 0x06, 0x65, 0x4e, 0x01, 0xc2, 0x0f, 0xfe, 0x1f, 0x80, 0x04, 0xfe, 0x9f, 0x83, 0x33, + 0x0b, 0x0e, 0x20, 0x6e, 0x0f, 0xfe, 0x44, 0x90, 0x04, 0xfe, 0xc4, 0x93, 0x3a, 0x0b, 0xfe, 0xc6, + 0x90, 0x04, 0xfe, 0xc6, 0x93, 0x79, 0x0b, 0x0e, 0x10, 0x6c, 0x22, 0x6d, 0x01, 0xfe, 0xce, 0x1e, + 0x01, 0xfe, 0xde, 0x1e, 0x10, 0x68, 0x22, 0x69, 0x0f, 0xfe, 0x40, 0x90, 0x04, 0xfe, 0xc0, 0x93, + 0x3a, 0x0b, 0xfe, 0xc2, 0x90, 0x04, 0xfe, 0xc2, 0x93, 0x79, 0x0b, 0x0e, 0x10, 0x4b, 0x22, 0x4c, + 0x10, 0x64, 0x22, 0x34, 0x01, 0x0c, 0x61, 0x24, 0x44, 0x37, 0x13, 0xfe, 0x4e, 0x11, 0x2f, 0xfe, + 0xde, 0x09, 0xfe, 0x9e, 0xf0, 0xfe, 0xf2, 0x09, 0xfe, 0x01, 0x48, 0x1b, 0x3c, 0x37, 0x88, 0xf5, + 0xd4, 0xfe, 0x1e, 0x0a, 0xd5, 0xfe, 0x42, 0x0a, 0xd2, 0xfe, 0x1e, 0x0a, 0xd3, 0xfe, 0x42, 0x0a, + 0xae, 0xfe, 0x12, 0x0a, 0xfe, 0x06, 0xf0, 0xfe, 0x18, 0x0a, 0xaf, 0xa0, 0x05, 0x29, 0x01, 0x41, + 0xfe, 0xc1, 0x10, 0x14, 0x24, 0xfe, 0xc1, 0x10, 0x01, 0x76, 0x06, 0x07, 0xfe, 0x14, 0x12, 0x01, + 0x76, 0x06, 0x0d, 0x5d, 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x74, 0x12, 0xfe, 0x2e, 0x1c, 0x05, 0xfe, + 0x1a, 0x0c, 0x01, 0x76, 0x06, 0x07, 0x5d, 0x01, 0x76, 0x06, 0x0d, 0x41, 0xfe, 0x2c, 0x1c, 0xfe, + 0xaa, 0xf0, 0xfe, 0xce, 0x0a, 0xfe, 0xac, 0xf0, 0xfe, 0x66, 0x0a, 0xfe, 0x92, 0x10, 0xc4, 0xf6, + 0xfe, 0xad, 0xf0, 0xfe, 0x72, 0x0a, 0x05, 0xfe, 0x1a, 0x0c, 0xc5, 0xfe, 0xe7, 0x10, 0xfe, 0x2b, + 0xf0, 0xbf, 0xfe, 0x6b, 0x18, 0x23, 0xfe, 0x00, 0xfe, 0xfe, 0x1c, 0x12, 0xac, 0xfe, 0xd2, 0xf0, + 0xbf, 0xfe, 0x76, 0x18, 0x23, 0x1d, 0x1b, 0xbf, 0x03, 0xe3, 0x23, 0x07, 0x1b, 0xbf, 0xd4, 0x5b, + 0xd5, 0x5b, 0xd2, 0x5b, 0xd3, 0x5b, 0xc4, 0xc5, 0xfe, 0xa9, 0x10, 0x75, 0x5e, 0x32, 0x1f, 0x7f, + 0x01, 0x42, 0x19, 0xfe, 0x35, 0x00, 0xfe, 0x01, 0xf0, 0x70, 0x19, 0x98, 0x05, 0x70, 0xfe, 0x74, + 0x18, 0x23, 0xfe, 0x00, 0xf8, 0x1b, 0x5b, 0x7d, 0x12, 0x01, 0xfe, 0x78, 0x0f, 0x4d, 0x01, 0xfe, + 0x96, 0x1a, 0x21, 0x30, 0x77, 0x7d, 0x1d, 0x05, 0x5b, 0x01, 0x0c, 0x06, 0x0d, 0x2b, 0xfe, 0xe2, + 0x0b, 0x01, 0x0c, 0x06, 0x54, 0xfe, 0xa6, 0x12, 0x01, 0x0c, 0x06, 0x24, 0xfe, 0x88, 0x13, 0x21, + 0x6e, 0xc7, 0x01, 0xfe, 0x1e, 0x1f, 0x0f, 0xfe, 0x83, 0x80, 0x04, 0xfe, 0x83, 0x83, 0xfe, 0xc9, + 0x47, 0x0b, 0x0e, 0xfe, 0xc8, 0x44, 0xfe, 0x42, 0x13, 0x0f, 0xfe, 0x04, 0x91, 0x04, 0xfe, 0x84, + 0x93, 0xfe, 0xca, 0x57, 0x0b, 0xfe, 0x86, 0x91, 0x04, 0xfe, 0x86, 0x93, 0xfe, 0xcb, 0x57, 0x0b, + 0x0e, 0x7a, 0x30, 0xfe, 0x40, 0x59, 0xfe, 0xc1, 0x59, 0x8e, 0x40, 0x03, 0x6a, 0x3b, 0x6b, 0x10, + 0x97, 0x22, 0x98, 0xd9, 0x6a, 0xda, 0x6b, 0x01, 0xc2, 0xc8, 0x7a, 0x30, 0x20, 0x6e, 0xdb, 0x64, + 0xdc, 0x34, 0x91, 0x6c, 0x7e, 0x6d, 0xfe, 0x44, 0x55, 0xfe, 0xe5, 0x55, 0xfe, 0x04, 0xfa, 0x64, + 0xfe, 0x05, 0xfa, 0x34, 0x01, 0xfe, 0x6a, 0x16, 0xa3, 0x26, 0x10, 0x97, 0x10, 0x98, 0x91, 0x6c, + 0x7e, 0x6d, 0xfe, 0x14, 0x10, 0x01, 0x0c, 0x06, 0x24, 0x1b, 0x40, 0x91, 0x4b, 0x7e, 0x4c, 0x01, + 0x0c, 0x06, 0xfe, 0xf7, 0x00, 0x44, 0x03, 0x68, 0x3b, 0x69, 0xfe, 0x10, 0x58, 0xfe, 0x91, 0x58, + 0xfe, 0x14, 0x59, 0xfe, 0x95, 0x59, 0x05, 0x5b, 0x01, 0x0c, 0x06, 0x24, 0x1b, 0x40, 0x01, 0x0c, + 0x06, 0xfe, 0xf7, 0x00, 0x44, 0x78, 0x01, 0xfe, 0x8e, 0x1e, 0x4f, 0x0f, 0xfe, 0x10, 0x90, 0x04, + 0xfe, 0x90, 0x93, 0x3a, 0x0b, 0xfe, 0x92, 0x90, 0x04, 0xfe, 0x92, 0x93, 0x79, 0x0b, 0x0e, 0xfe, + 0xbd, 0x10, 0x01, 0x43, 0x09, 0xbb, 0x1b, 0xfe, 0x6e, 0x0a, 0x15, 0xbb, 0x01, 0x0c, 0x06, 0x0d, + 0xfe, 0x14, 0x13, 0x03, 0x4b, 0x3b, 0x4c, 0x8e, 0xfe, 0x6e, 0x0a, 0xfe, 0x0c, 0x58, 0xfe, 0x8d, + 0x58, 0x05, 0x5b, 0x26, 0x3e, 0x0f, 0xfe, 0x19, 0x80, 0x04, 0xfe, 0x99, 0x83, 0x33, 0x0b, 0x0e, + 0xfe, 0xe5, 0x10, 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x1a, 0x12, 0xfe, 0x6c, 0x19, 0xfe, 0x19, 0x41, + 0xfe, 0x6b, 0x18, 0xac, 0xfe, 0xd1, 0xf0, 0xef, 0x1f, 0x92, 0x01, 0x42, 0x19, 0xfe, 0x44, 0x00, + 0xfe, 0x90, 0x10, 0xfe, 0x6c, 0x19, 0xd9, 0x4b, 0xfe, 0xed, 0x19, 0xda, 0x4c, 0xfe, 0x0c, 0x51, + 0xfe, 0x8e, 0x51, 0xfe, 0x6b, 0x18, 0x23, 0xfe, 0x00, 0xff, 0x31, 0xfe, 0x76, 0x10, 0xac, 0xfe, + 0xd2, 0xf0, 0xfe, 0xba, 0x0c, 0xfe, 0x76, 0x18, 0x23, 0x1d, 0x5d, 0x03, 0xe3, 0x23, 0x07, 0xfe, + 0x08, 0x13, 0x19, 0xfe, 0x16, 0x00, 0x05, 0x70, 0xfe, 0xd1, 0xf0, 0xfe, 0xcc, 0x0c, 0x1f, 0x92, + 0x01, 0x42, 0x19, 0xfe, 0x17, 0x00, 0x5c, 0xfe, 0xce, 0xf0, 0xfe, 0xd2, 0x0c, 0xfe, 0x3e, 0x10, + 0xfe, 0xcd, 0xf0, 0xfe, 0xde, 0x0c, 0x19, 0xfe, 0x22, 0x00, 0x05, 0x70, 0xfe, 0xcb, 0xf0, 0xfe, + 0xea, 0x0c, 0x19, 0xfe, 0x24, 0x00, 0x05, 0x70, 0xfe, 0xd0, 0xf0, 0xfe, 0xf4, 0x0c, 0x19, 0x94, + 0xfe, 0x1c, 0x10, 0xfe, 0xcf, 0xf0, 0xfe, 0xfe, 0x0c, 0x19, 0x4a, 0xf3, 0xfe, 0xcc, 0xf0, 0xef, + 0x01, 0x76, 0x06, 0x24, 0x4d, 0x19, 0xfe, 0x12, 0x00, 0x37, 0x13, 0xfe, 0x4e, 0x11, 0x2f, 0xfe, + 0x16, 0x0d, 0xfe, 0x9e, 0xf0, 0xfe, 0x2a, 0x0d, 0xfe, 0x01, 0x48, 0x1b, 0x3c, 0x37, 0x88, 0xf5, + 0xd4, 0x29, 0xd5, 0x29, 0xd2, 0x29, 0xd3, 0x29, 0x37, 0xfe, 0x9c, 0x32, 0x2f, 0xfe, 0x3e, 0x0d, + 0x2a, 0x3c, 0xae, 0xfe, 0x62, 0x0d, 0xaf, 0xa0, 0xd4, 0x9f, 0xd5, 0x9f, 0xd2, 0x9f, 0xd3, 0x9f, + 0x05, 0x29, 0x01, 0x41, 0xfe, 0xd3, 0x10, 0x15, 0xfe, 0xe8, 0x00, 0xc4, 0xc5, 0x75, 0xd7, 0x99, + 0xd8, 0x9c, 0xfe, 0x89, 0xf0, 0x29, 0x27, 0x25, 0xbe, 0xd7, 0x99, 0xd8, 0x9c, 0x2f, 0xfe, 0x8c, + 0x0d, 0x16, 0x29, 0x27, 0x25, 0xbd, 0xfe, 0x01, 0x48, 0xa4, 0x19, 0xfe, 0x42, 0x00, 0x05, 0x70, + 0x90, 0x07, 0xfe, 0x81, 0x49, 0x1b, 0xfe, 0x64, 0x0e, 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x44, 0x13, + 0x19, 0x00, 0x2d, 0x0d, 0xfe, 0x54, 0x12, 0x2d, 0xfe, 0x28, 0x00, 0x2b, 0xfe, 0xda, 0x0e, 0x0a, + 0x57, 0x01, 0x18, 0x09, 0x00, 0x36, 0x46, 0xfe, 0x28, 0x00, 0xfe, 0xfa, 0x10, 0x01, 0xfe, 0xf4, + 0x1c, 0x01, 0xfe, 0x00, 0x1d, 0x0a, 0xba, 0x01, 0xfe, 0x58, 0x10, 0x40, 0x15, 0x56, 0x01, 0x85, + 0x05, 0x35, 0x19, 0xfe, 0x44, 0x00, 0x2d, 0x0d, 0xf7, 0x46, 0x0d, 0xfe, 0xcc, 0x10, 0x01, 0xa7, + 0x46, 0x0d, 0xfe, 0xc2, 0x10, 0x01, 0xa7, 0x0f, 0xfe, 0x19, 0x82, 0x04, 0xfe, 0x99, 0x83, 0xfe, + 0xcc, 0x47, 0x0b, 0x0e, 0xfe, 0x34, 0x46, 0xa5, 0x46, 0x0d, 0x19, 0xfe, 0x43, 0x00, 0xfe, 0xa2, + 0x10, 0x01, 0x0c, 0x61, 0x0d, 0x44, 0x01, 0xfe, 0xf4, 0x1c, 0x01, 0xfe, 0x00, 0x1d, 0x40, 0x15, + 0x56, 0x01, 0x85, 0x7d, 0x0d, 0x40, 0x51, 0x01, 0xfe, 0x9e, 0x1e, 0x05, 0xfe, 0x3a, 0x03, 0x01, + 0x0c, 0x06, 0x0d, 0x5d, 0x46, 0x0d, 0x19, 0x00, 0xfe, 0x62, 0x10, 0x01, 0x76, 0x06, 0x12, 0xfe, + 0x5c, 0x12, 0x01, 0x0c, 0x06, 0x12, 0xfe, 0x52, 0x13, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, + 0x8e, 0x0e, 0xfe, 0x1c, 0x1c, 0xfe, 0x9d, 0xf0, 0xfe, 0x94, 0x0e, 0x01, 0x0c, 0x61, 0x12, 0x44, + 0xfe, 0x9f, 0x10, 0x19, 0xfe, 0x15, 0x00, 0xfe, 0x04, 0xe6, 0x0d, 0x4f, 0xfe, 0x2e, 0x10, 0x19, + 0xfe, 0x13, 0x00, 0xfe, 0x10, 0x10, 0x19, 0xfe, 0x47, 0x00, 0xf1, 0x19, 0xfe, 0x41, 0x00, 0xa2, + 0x19, 0xfe, 0x24, 0x00, 0x86, 0xc4, 0xc5, 0x75, 0x03, 0x81, 0x1e, 0x2b, 0xea, 0x4f, 0xfe, 0x04, + 0xe6, 0x12, 0xfe, 0x9d, 0x41, 0xfe, 0x1c, 0x42, 0x40, 0x01, 0xf4, 0x05, 0x35, 0xfe, 0x12, 0x1c, + 0x1f, 0x0d, 0x47, 0xb5, 0xc3, 0x1f, 0xfe, 0x31, 0x00, 0x47, 0xb8, 0x01, 0xfe, 0xd4, 0x11, 0x05, + 0xe9, 0x51, 0xfe, 0x06, 0xec, 0xe0, 0xfe, 0x0e, 0x47, 0x46, 0x28, 0xfe, 0xce, 0x45, 0x31, 0x51, + 0xfe, 0x06, 0xea, 0xe0, 0xfe, 0x47, 0x4b, 0x45, 0xfe, 0x75, 0x57, 0x03, 0x67, 0xfe, 0x98, 0x56, + 0xfe, 0x38, 0x12, 0x0a, 0x5a, 0x01, 0x18, 0xfe, 0x44, 0x48, 0x60, 0x01, 0x0c, 0x06, 0x28, 0xfe, + 0x18, 0x13, 0x0a, 0x57, 0x01, 0x18, 0x3e, 0xfe, 0x41, 0x58, 0x0a, 0xba, 0xfe, 0xfa, 0x14, 0xfe, + 0x49, 0x54, 0xb0, 0xfe, 0x5e, 0x0f, 0x05, 0xfe, 0x3a, 0x03, 0x0a, 0x67, 0xfe, 0xe0, 0x14, 0xfe, + 0x0e, 0x47, 0x46, 0x28, 0xfe, 0xce, 0x45, 0x31, 0x51, 0xfe, 0xce, 0x47, 0xfe, 0xad, 0x13, 0x05, + 0x35, 0x21, 0x2c, 0x09, 0x1a, 0xfe, 0x98, 0x12, 0x26, 0x20, 0x96, 0x20, 0xe7, 0xfe, 0x08, 0x1c, + 0xfe, 0x7c, 0x19, 0xfe, 0xfd, 0x19, 0xfe, 0x0a, 0x1c, 0x03, 0xe5, 0xfe, 0x48, 0x55, 0xa5, 0x3b, + 0xfe, 0x62, 0x01, 0xfe, 0xc9, 0x55, 0x31, 0xfe, 0x74, 0x10, 0x01, 0xfe, 0xf0, 0x1a, 0x03, 0xfe, + 0x38, 0x01, 0x3b, 0xfe, 0x3a, 0x01, 0x8e, 0xfe, 0x1e, 0x10, 0xfe, 0x02, 0xec, 0xe7, 0x53, 0x00, + 0x36, 0xfe, 0x04, 0xec, 0x2c, 0x60, 0xfe, 0x05, 0xf6, 0xfe, 0x34, 0x01, 0x01, 0xfe, 0x62, 0x1b, + 0x01, 0xfe, 0xce, 0x1e, 0xb2, 0x11, 0xfe, 0x18, 0x13, 0xca, 0xfe, 0x02, 0xea, 0xe7, 0x53, 0x92, + 0xfe, 0xc3, 0x13, 0x1f, 0x12, 0x47, 0xb5, 0xc3, 0xfe, 0x2a, 0x10, 0x03, 0xfe, 0x38, 0x01, 0x23, + 0xfe, 0xf0, 0xff, 0x10, 0xe5, 0x03, 0xfe, 0x3a, 0x01, 0x10, 0xfe, 0x62, 0x01, 0x01, 0xfe, 0x1e, + 0x1e, 0x20, 0x2c, 0x15, 0x56, 0x01, 0xfe, 0x9e, 0x1e, 0x13, 0x07, 0x02, 0x26, 0x02, 0x21, 0x96, + 0xc7, 0x20, 0x96, 0x09, 0x92, 0xfe, 0x79, 0x13, 0x1f, 0x1d, 0x47, 0xb5, 0xc3, 0xfe, 0xe1, 0x10, + 0xcf, 0xfe, 0x03, 0xdc, 0xfe, 0x73, 0x57, 0xfe, 0x80, 0x5d, 0x02, 0xcf, 0xfe, 0x03, 0xdc, 0xfe, + 0x5b, 0x57, 0xfe, 0x80, 0x5d, 0x02, 0xfe, 0x03, 0x57, 0xcf, 0x26, 0xfe, 0x00, 0xcc, 0x02, 0xfe, + 0x03, 0x57, 0xcf, 0x89, 0x02, 0x01, 0x0c, 0x06, 0x4a, 0xfe, 0x4e, 0x13, 0x0f, 0xfe, 0x1c, 0x80, + 0x04, 0xfe, 0x9c, 0x83, 0x33, 0x0b, 0x0e, 0x09, 0x07, 0xfe, 0x3a, 0x13, 0x0f, 0xfe, 0x1e, 0x80, + 0x04, 0xfe, 0x9e, 0x83, 0x33, 0x0b, 0x0e, 0xfe, 0x2a, 0x13, 0x0f, 0xfe, 0x1d, 0x80, 0x04, 0xfe, + 0x9d, 0x83, 0xfe, 0xf9, 0x13, 0x0e, 0xfe, 0x1c, 0x13, 0x01, 0xfe, 0xee, 0x1e, 0xac, 0xfe, 0x14, + 0x13, 0x01, 0xfe, 0xfe, 0x1e, 0xfe, 0x81, 0x58, 0xfa, 0x01, 0xfe, 0x0e, 0x1f, 0xfe, 0x30, 0xf4, + 0x0d, 0xfe, 0x3c, 0x50, 0xa2, 0x01, 0xfe, 0x92, 0x1b, 0x01, 0x43, 0x09, 0x56, 0xfb, 0x01, 0xfe, + 0xc8, 0x1a, 0x01, 0x0c, 0x06, 0x28, 0xa4, 0x01, 0xfe, 0xf4, 0x1c, 0x01, 0xfe, 0x00, 0x1d, 0x15, + 0xfe, 0xe9, 0x00, 0x01, 0x0c, 0x06, 0x4a, 0xfe, 0x4e, 0x13, 0x01, 0xfe, 0x22, 0x1b, 0xfe, 0x1e, + 0x1c, 0x0f, 0xfe, 0x14, 0x90, 0x04, 0xfe, 0x94, 0x93, 0x3a, 0x0b, 0xfe, 0x96, 0x90, 0x04, 0xfe, + 0x96, 0x93, 0x79, 0x0b, 0x0e, 0x10, 0xfe, 0x64, 0x01, 0x22, 0xfe, 0x66, 0x01, 0x01, 0x0c, 0x06, + 0x65, 0xf9, 0x0f, 0xfe, 0x03, 0x80, 0x04, 0xfe, 0x83, 0x83, 0x33, 0x0b, 0x0e, 0x77, 0xfe, 0x01, + 0xec, 0x2c, 0xfe, 0x80, 0x40, 0x20, 0x2c, 0x7a, 0x30, 0x15, 0xdf, 0x40, 0x21, 0x2c, 0xfe, 0x00, + 0x40, 0x8d, 0x2c, 0x02, 0xfe, 0x08, 0x1c, 0x03, 0xfe, 0xac, 0x00, 0xfe, 0x06, 0x58, 0x03, 0xfe, + 0xae, 0x00, 0xfe, 0x07, 0x58, 0x03, 0xfe, 0xb0, 0x00, 0xfe, 0x08, 0x58, 0x03, 0xfe, 0xb2, 0x00, + 0xfe, 0x09, 0x58, 0xfe, 0x0a, 0x1c, 0x2e, 0x49, 0x20, 0xe0, 0x26, 0x10, 0x66, 0x10, 0x55, 0x10, + 0x6f, 0x13, 0x57, 0x52, 0x4f, 0x1c, 0x28, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, 0x2b, 0xfe, 0x88, + 0x11, 0x46, 0x1a, 0x13, 0x5a, 0x52, 0x1c, 0x4a, 0xfe, 0x90, 0x4d, 0xfe, 0x91, 0x54, 0x2b, 0xfe, + 0x9e, 0x11, 0x2e, 0x1a, 0x20, 0x2c, 0x90, 0x34, 0x60, 0x21, 0x2c, 0xfe, 0x00, 0x40, 0x8d, 0x2c, + 0x15, 0xdf, 0xfe, 0x14, 0x56, 0xfe, 0xd6, 0xf0, 0xfe, 0xb2, 0x11, 0xfe, 0x12, 0x1c, 0x75, 0xfe, + 0x14, 0x1c, 0xfe, 0x10, 0x1c, 0xfe, 0x18, 0x1c, 0x02, 0x51, 0xfe, 0x0c, 0x14, 0xfe, 0x0e, 0x47, + 0xfe, 0x07, 0xe6, 0x28, 0xfe, 0xce, 0x47, 0xfe, 0xf5, 0x13, 0x02, 0x01, 0xa7, 0x90, 0x34, 0x60, + 0xfe, 0x06, 0x80, 0xfe, 0x48, 0x47, 0xfe, 0x42, 0x13, 0xfe, 0x02, 0x80, 0x09, 0x56, 0xfe, 0x34, + 0x13, 0x0a, 0x5a, 0x01, 0x18, 0xcb, 0xfe, 0x36, 0x12, 0xfe, 0x41, 0x48, 0xfe, 0x45, 0x48, 0x01, + 0xfe, 0xb2, 0x16, 0xfe, 0x00, 0xcc, 0xcb, 0xfe, 0xf3, 0x13, 0x3f, 0x89, 0x09, 0x1a, 0xa5, 0x0a, + 0x9d, 0x01, 0x18, 0xfe, 0x80, 0x5c, 0x01, 0x85, 0xf2, 0x09, 0x9b, 0xa4, 0xfe, 0x14, 0x56, 0xfe, + 0xd6, 0xf0, 0xfe, 0xec, 0x11, 0x02, 0xfe, 0x44, 0x58, 0x77, 0xfe, 0x01, 0xec, 0xb8, 0xfe, 0x9e, + 0x40, 0xfe, 0x9d, 0xe7, 0x00, 0xfe, 0x9c, 0xe7, 0x12, 0x8d, 0x30, 0x01, 0xf4, 0xfe, 0xdd, 0x10, + 0x37, 0xd7, 0x99, 0xd8, 0x9c, 0x27, 0x25, 0xee, 0x09, 0x12, 0xfe, 0x48, 0x12, 0x09, 0x0d, 0xfe, + 0x56, 0x12, 0x09, 0x1d, 0xfe, 0x30, 0x12, 0x09, 0xdd, 0x1b, 0xfe, 0xc4, 0x13, 0x09, 0xfe, 0x23, + 0x00, 0x1b, 0xfe, 0xd0, 0x13, 0x09, 0x07, 0x1b, 0xfe, 0x34, 0x14, 0x09, 0x24, 0xfe, 0x12, 0x12, + 0x09, 0x00, 0x1b, 0x29, 0x1f, 0xdd, 0x01, 0x42, 0xa1, 0x32, 0x01, 0x08, 0xae, 0x41, 0x02, 0x32, + 0xfe, 0x62, 0x08, 0x0a, 0xe1, 0x01, 0xfe, 0x58, 0x10, 0x15, 0x9b, 0x05, 0x35, 0x32, 0x01, 0x43, + 0x09, 0xbb, 0xfe, 0xd7, 0x13, 0x91, 0x4b, 0x7e, 0x4c, 0x8e, 0xfe, 0x80, 0x13, 0x01, 0x0c, 0x06, + 0x54, 0xfe, 0x72, 0x12, 0xdb, 0x64, 0xdc, 0x34, 0xfe, 0x44, 0x55, 0xfe, 0xe5, 0x55, 0xb0, 0xfe, + 0x4a, 0x13, 0x21, 0x6e, 0xfe, 0x26, 0x13, 0x03, 0x97, 0x3b, 0x98, 0x8e, 0xfe, 0xb6, 0x0e, 0x10, + 0x6a, 0x22, 0x6b, 0x26, 0x10, 0x97, 0x10, 0x98, 0x01, 0xc2, 0x2e, 0x49, 0x88, 0x20, 0x6e, 0x01, + 0xfe, 0x6a, 0x16, 0xdb, 0x64, 0xdc, 0x34, 0xfe, 0x04, 0x55, 0xfe, 0xa5, 0x55, 0xfe, 0x04, 0xfa, + 0x64, 0xfe, 0x05, 0xfa, 0x34, 0xfe, 0x8f, 0x10, 0x03, 0x6c, 0x3b, 0x6d, 0xfe, 0x40, 0x56, 0xfe, + 0xe1, 0x56, 0x10, 0x6c, 0x22, 0x6d, 0x71, 0xdb, 0x64, 0xdc, 0x34, 0xfe, 0x44, 0x55, 0xfe, 0xe5, + 0x55, 0x03, 0x68, 0x3b, 0x69, 0xfe, 0x00, 0x56, 0xfe, 0xa1, 0x56, 0x10, 0x68, 0x22, 0x69, 0x01, + 0x0c, 0x06, 0x54, 0xf9, 0x21, 0x6e, 0xfe, 0x1f, 0x40, 0x03, 0x6a, 0x3b, 0x6b, 0xfe, 0x2c, 0x50, + 0xfe, 0xae, 0x50, 0x03, 0x6c, 0x3b, 0x6d, 0xfe, 0x44, 0x50, 0xfe, 0xc6, 0x50, 0x03, 0x68, 0x3b, + 0x69, 0xfe, 0x08, 0x50, 0xfe, 0x8a, 0x50, 0x03, 0x4b, 0x3b, 0x4c, 0xfe, 0x40, 0x50, 0xfe, 0xc2, + 0x50, 0x05, 0x73, 0x2e, 0x07, 0x20, 0x9e, 0x05, 0x72, 0x32, 0x01, 0x08, 0x16, 0x3d, 0x27, 0x25, + 0xee, 0x09, 0x07, 0x2b, 0x3d, 0x01, 0x43, 0x09, 0xbb, 0x2b, 0x72, 0x01, 0xa6, 0x23, 0x3f, 0x1b, + 0x3d, 0x01, 0x0c, 0x06, 0x0d, 0xfe, 0x1e, 0x13, 0x91, 0x4b, 0x7e, 0x4c, 0xfe, 0x0a, 0x55, 0x31, + 0xfe, 0x8b, 0x55, 0xd9, 0x4b, 0xda, 0x4c, 0xfe, 0x0c, 0x51, 0xfe, 0x8e, 0x51, 0x05, 0x72, 0x01, + 0xfe, 0x8e, 0x1e, 0xca, 0xfe, 0x19, 0x41, 0x05, 0x72, 0x32, 0x01, 0x08, 0x2a, 0x3c, 0x16, 0xc0, + 0x27, 0x25, 0xbe, 0x2d, 0x1d, 0xc0, 0x2d, 0x0d, 0x83, 0x2d, 0x7f, 0x1b, 0xfe, 0x66, 0x15, 0x05, + 0x3d, 0x01, 0x08, 0x2a, 0x3c, 0x16, 0xc0, 0x27, 0x25, 0xbd, 0x09, 0x1d, 0x2b, 0x3d, 0x01, 0x08, + 0x16, 0xc0, 0x27, 0x25, 0xfe, 0xe8, 0x09, 0xfe, 0xc2, 0x49, 0x50, 0x03, 0xb6, 0x1e, 0x83, 0x01, + 0x38, 0x06, 0x24, 0x31, 0xa1, 0xfe, 0xbb, 0x45, 0x2d, 0x00, 0xa4, 0x46, 0x07, 0x90, 0x3f, 0x01, + 0xfe, 0xf8, 0x15, 0x01, 0xa6, 0x86, 0xfe, 0x4b, 0x45, 0xfe, 0x20, 0x13, 0x01, 0x43, 0x09, 0x82, + 0xfe, 0x16, 0x13, 0x03, 0x9a, 0x1e, 0x5d, 0x03, 0x55, 0x1e, 0x31, 0x5e, 0x05, 0x72, 0xfe, 0xc0, + 0x5d, 0x01, 0xa7, 0xfe, 0x03, 0x17, 0x03, 0x66, 0x8a, 0x10, 0x66, 0x5e, 0x32, 0x01, 0x08, 0x17, + 0x73, 0x01, 0xfe, 0x56, 0x19, 0x05, 0x73, 0x01, 0x08, 0x2a, 0x3c, 0x16, 0x3d, 0x27, 0x25, 0xbd, + 0x09, 0x07, 0x2b, 0x3d, 0x01, 0xfe, 0xbe, 0x16, 0xfe, 0x42, 0x58, 0xfe, 0xe8, 0x14, 0x01, 0xa6, + 0x86, 0xfe, 0x4a, 0xf4, 0x0d, 0x1b, 0x3d, 0xfe, 0x4a, 0xf4, 0x07, 0xfe, 0x0e, 0x12, 0x01, 0x43, + 0x09, 0x82, 0x4e, 0x05, 0x72, 0x03, 0x55, 0x8a, 0x10, 0x55, 0x5e, 0x32, 0x01, 0x08, 0x17, 0x73, + 0x01, 0xfe, 0x84, 0x19, 0x05, 0x73, 0x01, 0x08, 0x2a, 0x3c, 0x16, 0x3d, 0x27, 0x25, 0xbd, 0x09, + 0x12, 0x2b, 0x3d, 0x01, 0xfe, 0xe8, 0x17, 0x8b, 0xfe, 0xaa, 0x14, 0xfe, 0xb6, 0x14, 0x86, 0xa8, + 0xb2, 0x0d, 0x1b, 0x3d, 0xb2, 0x07, 0xfe, 0x0e, 0x12, 0x01, 0x43, 0x09, 0x82, 0x4e, 0x05, 0x72, + 0x03, 0x6f, 0x8a, 0x10, 0x6f, 0x5e, 0x32, 0x01, 0x08, 0x17, 0x73, 0x01, 0xfe, 0xc0, 0x19, 0x05, + 0x73, 0x13, 0x07, 0x2f, 0xfe, 0xcc, 0x15, 0x17, 0xfe, 0xe2, 0x15, 0x5f, 0xcc, 0x01, 0x08, 0x26, + 0x5f, 0x02, 0x8f, 0xfe, 0xde, 0x15, 0x2a, 0xfe, 0xde, 0x15, 0x16, 0xfe, 0xcc, 0x15, 0x5e, 0x32, + 0x01, 0x08, 0xfe, 0xd5, 0x10, 0x13, 0x58, 0xff, 0x02, 0x00, 0x57, 0x52, 0xad, 0x23, 0xfe, 0xff, + 0x7f, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x02, 0x13, 0x58, 0xff, 0x02, 0x00, 0x57, 0x52, 0xad, + 0x23, 0x3f, 0xfe, 0x30, 0x56, 0xfe, 0x00, 0x5c, 0x02, 0x13, 0x58, 0xff, 0x02, 0x00, 0x57, 0x52, + 0xad, 0x02, 0x13, 0x58, 0xff, 0x02, 0x00, 0x57, 0x52, 0xfe, 0x00, 0x5e, 0x02, 0x13, 0x58, 0xff, + 0x02, 0x00, 0x57, 0x52, 0xad, 0xfe, 0x0b, 0x58, 0x02, 0x0a, 0x66, 0x01, 0x5c, 0x0a, 0x55, 0x01, + 0x5c, 0x0a, 0x6f, 0x01, 0x5c, 0x02, 0x01, 0xfe, 0x1e, 0x1f, 0x23, 0x1a, 0xff, 0x03, 0x00, 0x54, + 0xfe, 0x00, 0xf4, 0x24, 0x52, 0x0f, 0xfe, 0x00, 0x7c, 0x04, 0xfe, 0x07, 0x7c, 0x3a, 0x0b, 0x0e, + 0xfe, 0x00, 0x71, 0xfe, 0xf9, 0x18, 0xfe, 0x7a, 0x19, 0xfe, 0xfb, 0x19, 0xfe, 0x1a, 0xf7, 0x00, + 0xfe, 0x1b, 0xf7, 0x00, 0x7a, 0x30, 0x10, 0x68, 0x22, 0x69, 0xd9, 0x6c, 0xda, 0x6d, 0x02, 0xfe, + 0x62, 0x08, 0xfe, 0x82, 0x4a, 0xfe, 0xe1, 0x1a, 0xfe, 0x83, 0x5a, 0x77, 0x02, 0x01, 0xc6, 0xfe, + 0x42, 0x48, 0x4f, 0x50, 0x45, 0x01, 0x08, 0x16, 0xfe, 0xe0, 0x17, 0x27, 0x25, 0xbe, 0x01, 0x08, + 0x16, 0xfe, 0xe0, 0x17, 0x27, 0x25, 0xfe, 0xe8, 0x0a, 0xfe, 0xc1, 0x59, 0x03, 0x9a, 0x1e, 0xfe, + 0xda, 0x12, 0x01, 0x38, 0x06, 0x12, 0xfe, 0xd0, 0x13, 0x26, 0x53, 0x12, 0x48, 0xfe, 0x08, 0x17, + 0xd1, 0x12, 0x53, 0x12, 0xfe, 0x1e, 0x13, 0x2d, 0xb4, 0x7b, 0xfe, 0x26, 0x17, 0x4d, 0x13, 0x07, + 0x1c, 0xb4, 0x90, 0x04, 0xfe, 0x78, 0x10, 0xff, 0x02, 0x83, 0x55, 0xf1, 0xff, 0x02, 0x83, 0x55, + 0x53, 0x1d, 0xfe, 0x12, 0x13, 0xd6, 0xfe, 0x30, 0x00, 0xb0, 0xfe, 0x80, 0x17, 0x1c, 0x63, 0x13, + 0x07, 0xfe, 0x56, 0x10, 0x53, 0x0d, 0xfe, 0x16, 0x13, 0xd6, 0xfe, 0x64, 0x00, 0xb0, 0xfe, 0x80, + 0x17, 0x0a, 0xfe, 0x64, 0x00, 0x1c, 0x94, 0x13, 0x07, 0xfe, 0x28, 0x10, 0x53, 0x07, 0xfe, 0x60, + 0x13, 0xd6, 0xfe, 0xc8, 0x00, 0xb0, 0xfe, 0x80, 0x17, 0x0a, 0xfe, 0xc8, 0x00, 0x1c, 0x95, 0x13, + 0x07, 0x71, 0xd6, 0xfe, 0x90, 0x01, 0x48, 0xfe, 0x8c, 0x17, 0x45, 0xf3, 0xfe, 0x43, 0xf4, 0x96, + 0xfe, 0x56, 0xf0, 0xfe, 0x9e, 0x17, 0xfe, 0x04, 0xf4, 0x58, 0xfe, 0x43, 0xf4, 0x94, 0xf6, 0x8b, + 0x01, 0xfe, 0x24, 0x16, 0x23, 0x3f, 0xfc, 0xa8, 0x8c, 0x49, 0x48, 0xfe, 0xda, 0x17, 0x62, 0x49, + 0xfe, 0x1c, 0x10, 0xa8, 0x8c, 0x80, 0x48, 0xfe, 0xda, 0x17, 0x62, 0x80, 0x71, 0x50, 0x26, 0xfe, + 0x4d, 0xf4, 0x00, 0xf7, 0x45, 0x13, 0x07, 0xfe, 0xb4, 0x56, 0xfe, 0xc3, 0x58, 0x02, 0x50, 0x13, + 0x0d, 0x02, 0x50, 0x3e, 0x78, 0x4f, 0x45, 0x01, 0x08, 0x16, 0xa9, 0x27, 0x25, 0xbe, 0xfe, 0x03, + 0xea, 0xfe, 0x7e, 0x01, 0x01, 0x08, 0x16, 0xa9, 0x27, 0x25, 0xfe, 0xe9, 0x0a, 0x01, 0x08, 0x16, + 0xa9, 0x27, 0x25, 0xfe, 0xe9, 0x0a, 0xfe, 0x05, 0xea, 0xfe, 0x7f, 0x01, 0x01, 0x08, 0x16, 0xa9, + 0x27, 0x25, 0xfe, 0x69, 0x09, 0xfe, 0x02, 0xea, 0xfe, 0x80, 0x01, 0x01, 0x08, 0x16, 0xa9, 0x27, + 0x25, 0xfe, 0xe8, 0x08, 0x47, 0xfe, 0x81, 0x01, 0x03, 0xb6, 0x1e, 0x83, 0x01, 0x38, 0x06, 0x24, + 0x31, 0xa2, 0x78, 0xf2, 0x53, 0x07, 0x36, 0xfe, 0x34, 0xf4, 0x3f, 0xa1, 0x78, 0x03, 0x9a, 0x1e, + 0x83, 0x01, 0x38, 0x06, 0x12, 0x31, 0xf0, 0x4f, 0x45, 0xfe, 0x90, 0x10, 0xfe, 0x40, 0x5a, 0x23, + 0x3f, 0xfb, 0x8c, 0x49, 0x48, 0xfe, 0xaa, 0x18, 0x62, 0x49, 0x71, 0x8c, 0x80, 0x48, 0xfe, 0xaa, + 0x18, 0x62, 0x80, 0xfe, 0xb4, 0x56, 0xfe, 0x40, 0x5d, 0x01, 0xc6, 0x01, 0xfe, 0xac, 0x1d, 0xfe, + 0x02, 0x17, 0xfe, 0xc8, 0x45, 0xfe, 0x5a, 0xf0, 0xfe, 0xc0, 0x18, 0xfe, 0x43, 0x48, 0x2d, 0x93, + 0x36, 0xfe, 0x34, 0xf4, 0xfe, 0x00, 0x11, 0xfe, 0x40, 0x10, 0x2d, 0xb4, 0x36, 0xfe, 0x34, 0xf4, + 0x04, 0xfe, 0x34, 0x10, 0x2d, 0xfe, 0x0b, 0x00, 0x36, 0x46, 0x63, 0xfe, 0x28, 0x10, 0xfe, 0xc0, + 0x49, 0xff, 0x02, 0x00, 0x54, 0xb2, 0xfe, 0x90, 0x01, 0x48, 0xfe, 0xfa, 0x18, 0x45, 0xfe, 0x1c, + 0xf4, 0x3f, 0xf3, 0xfe, 0x40, 0xf4, 0x96, 0xfe, 0x56, 0xf0, 0xfe, 0x0c, 0x19, 0xfe, 0x04, 0xf4, + 0x58, 0xfe, 0x40, 0xf4, 0x94, 0xf6, 0x3e, 0x2d, 0x93, 0x4e, 0xd0, 0x0d, 0x21, 0xfe, 0x7f, 0x01, + 0xfe, 0xc8, 0x46, 0xfe, 0x24, 0x13, 0x8c, 0x00, 0x5d, 0x26, 0x21, 0xfe, 0x7e, 0x01, 0xfe, 0xc8, + 0x45, 0xfe, 0x14, 0x13, 0x21, 0xfe, 0x80, 0x01, 0xfe, 0x48, 0x45, 0xfa, 0x21, 0xfe, 0x81, 0x01, + 0xfe, 0xc8, 0x44, 0x4e, 0x26, 0x02, 0x13, 0x07, 0x02, 0x78, 0x45, 0x50, 0x13, 0x0d, 0x02, 0x14, + 0x07, 0x01, 0x08, 0x17, 0xfe, 0x82, 0x19, 0x14, 0x0d, 0x01, 0x08, 0x17, 0xfe, 0x82, 0x19, 0x14, + 0x1d, 0x01, 0x08, 0x17, 0xfe, 0x82, 0x19, 0x5f, 0xfe, 0x89, 0x49, 0x01, 0x08, 0x02, 0x14, 0x07, + 0x01, 0x08, 0x17, 0xc1, 0x14, 0x1d, 0x01, 0x08, 0x17, 0xc1, 0x14, 0x07, 0x01, 0x08, 0x17, 0xc1, + 0xfe, 0x89, 0x49, 0x01, 0x08, 0x17, 0xc1, 0x5f, 0xfe, 0x89, 0x4a, 0x01, 0x08, 0x02, 0x50, 0x02, + 0x14, 0x07, 0x01, 0x08, 0x17, 0x74, 0x14, 0x7f, 0x01, 0x08, 0x17, 0x74, 0x14, 0x12, 0x01, 0x08, + 0x17, 0x74, 0xfe, 0x89, 0x49, 0x01, 0x08, 0x17, 0x74, 0x14, 0x00, 0x01, 0x08, 0x17, 0x74, 0xfe, + 0x89, 0x4a, 0x01, 0x08, 0x17, 0x74, 0xfe, 0x09, 0x49, 0x01, 0x08, 0x17, 0x74, 0x5f, 0xcc, 0x01, + 0x08, 0x02, 0x21, 0xe4, 0x09, 0x07, 0xfe, 0x4c, 0x13, 0xc8, 0x20, 0xe4, 0xfe, 0x49, 0xf4, 0x00, + 0x4d, 0x5f, 0xa1, 0x5e, 0xfe, 0x01, 0xec, 0xfe, 0x27, 0x01, 0xcc, 0xff, 0x02, 0x00, 0x10, 0x2f, + 0xfe, 0x3e, 0x1a, 0x01, 0x43, 0x09, 0xfe, 0xe3, 0x00, 0xfe, 0x22, 0x13, 0x16, 0xfe, 0x64, 0x1a, + 0x26, 0x20, 0x9e, 0x01, 0x41, 0x21, 0x9e, 0x09, 0x07, 0x5d, 0x01, 0x0c, 0x61, 0x07, 0x44, 0x02, + 0x0a, 0x5a, 0x01, 0x18, 0xfe, 0x00, 0x40, 0xaa, 0x09, 0x1a, 0xfe, 0x12, 0x13, 0x0a, 0x9d, 0x01, + 0x18, 0xaa, 0x0a, 0x67, 0x01, 0xa3, 0x02, 0x0a, 0x9d, 0x01, 0x18, 0xaa, 0xfe, 0x80, 0xe7, 0x1a, + 0x09, 0x1a, 0x5d, 0xfe, 0x45, 0x58, 0x01, 0xfe, 0xb2, 0x16, 0xaa, 0x02, 0x0a, 0x5a, 0x01, 0x18, + 0xaa, 0x0a, 0x67, 0x01, 0xa3, 0x02, 0x0a, 0x5a, 0x01, 0x18, 0x01, 0xfe, 0x7e, 0x1e, 0xfe, 0x80, + 0x4c, 0xfe, 0x49, 0xe4, 0x1a, 0xfe, 0x12, 0x13, 0x0a, 0x9d, 0x01, 0x18, 0xfe, 0x80, 0x4c, 0x0a, + 0x67, 0x01, 0x5c, 0x02, 0x1c, 0x1a, 0x87, 0x7c, 0xe5, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, + 0x24, 0x1c, 0xfe, 0x1d, 0xf7, 0x28, 0xb1, 0xfe, 0x04, 0x1b, 0x01, 0xfe, 0x2a, 0x1c, 0xfa, 0xb3, + 0x28, 0x7c, 0xfe, 0x2c, 0x01, 0xfe, 0x2f, 0x19, 0x02, 0xc9, 0x2b, 0xfe, 0xf4, 0x1a, 0xfe, 0xfa, + 0x10, 0x1c, 0x1a, 0x87, 0x03, 0xfe, 0x64, 0x01, 0xfe, 0x00, 0xf4, 0x24, 0xfe, 0x18, 0x58, 0x03, + 0xfe, 0x66, 0x01, 0xfe, 0x19, 0x58, 0xb3, 0x24, 0x01, 0xfe, 0x0e, 0x1f, 0xfe, 0x30, 0xf4, 0x07, + 0xfe, 0x3c, 0x50, 0x7c, 0xfe, 0x38, 0x00, 0xfe, 0x0f, 0x79, 0xfe, 0x1c, 0xf7, 0x24, 0xb1, 0xfe, + 0x50, 0x1b, 0xfe, 0xd4, 0x14, 0x31, 0x02, 0xc9, 0x2b, 0xfe, 0x26, 0x1b, 0xfe, 0xba, 0x10, 0x1c, + 0x1a, 0x87, 0xfe, 0x83, 0x5a, 0xfe, 0x18, 0xdf, 0xfe, 0x19, 0xde, 0xfe, 0x1d, 0xf7, 0x54, 0xb1, + 0xfe, 0x72, 0x1b, 0xfe, 0xb2, 0x14, 0xfc, 0xb3, 0x54, 0x7c, 0x12, 0xfe, 0xaf, 0x19, 0xfe, 0x98, + 0xe7, 0x00, 0x02, 0xc9, 0x2b, 0xfe, 0x66, 0x1b, 0xfe, 0x8a, 0x10, 0x1c, 0x1a, 0x87, 0x8b, 0x0f, + 0xfe, 0x30, 0x90, 0x04, 0xfe, 0xb0, 0x93, 0x3a, 0x0b, 0xfe, 0x18, 0x58, 0xfe, 0x32, 0x90, 0x04, + 0xfe, 0xb2, 0x93, 0x3a, 0x0b, 0xfe, 0x19, 0x58, 0x0e, 0xa8, 0xb3, 0x4a, 0x7c, 0x12, 0xfe, 0x0f, + 0x79, 0xfe, 0x1c, 0xf7, 0x4a, 0xb1, 0xfe, 0xc6, 0x1b, 0xfe, 0x5e, 0x14, 0x31, 0x02, 0xc9, 0x2b, + 0xfe, 0x96, 0x1b, 0x5c, 0xfe, 0x02, 0xf6, 0x1a, 0x87, 0xfe, 0x18, 0xfe, 0x6a, 0xfe, 0x19, 0xfe, + 0x6b, 0x01, 0xfe, 0x1e, 0x1f, 0xfe, 0x1d, 0xf7, 0x65, 0xb1, 0xfe, 0xee, 0x1b, 0xfe, 0x36, 0x14, + 0xfe, 0x1c, 0x13, 0xb3, 0x65, 0x3e, 0xfe, 0x83, 0x58, 0xfe, 0xaf, 0x19, 0xfe, 0x80, 0xe7, 0x1a, + 0xfe, 0x81, 0xe7, 0x1a, 0x15, 0xfe, 0xdd, 0x00, 0x7a, 0x30, 0x02, 0x7a, 0x30, 0xfe, 0x12, 0x45, + 0x2b, 0xfe, 0xdc, 0x1b, 0x1f, 0x07, 0x47, 0xb5, 0xc3, 0x05, 0x35, 0xfe, 0x39, 0xf0, 0x75, 0x26, + 0x02, 0xfe, 0x7e, 0x18, 0x23, 0x1d, 0x36, 0x13, 0x11, 0x02, 0x87, 0x03, 0xe3, 0x23, 0x07, 0xfe, + 0xef, 0x12, 0xfe, 0xe1, 0x10, 0x90, 0x34, 0x60, 0xfe, 0x02, 0x80, 0x09, 0x56, 0xfe, 0x3c, 0x13, + 0xfe, 0x82, 0x14, 0xfe, 0x42, 0x13, 0x51, 0xfe, 0x06, 0x83, 0x0a, 0x5a, 0x01, 0x18, 0xcb, 0xfe, + 0x3e, 0x12, 0xfe, 0x41, 0x48, 0xfe, 0x45, 0x48, 0x01, 0xfe, 0xb2, 0x16, 0xfe, 0x00, 0xcc, 0xcb, + 0xfe, 0xf3, 0x13, 0x3f, 0x89, 0x09, 0x1a, 0xa5, 0x0a, 0x9d, 0x01, 0x18, 0xfe, 0x80, 0x4c, 0x01, + 0x85, 0xfe, 0x16, 0x10, 0x09, 0x9b, 0x4e, 0xfe, 0x40, 0x14, 0xfe, 0x24, 0x12, 0xfe, 0x14, 0x56, + 0xfe, 0xd6, 0xf0, 0xfe, 0x52, 0x1c, 0x1c, 0x0d, 0x02, 0xfe, 0x9c, 0xe7, 0x0d, 0x19, 0xfe, 0x15, + 0x00, 0x40, 0x8d, 0x30, 0x01, 0xf4, 0x1c, 0x07, 0x02, 0x51, 0xfe, 0x06, 0x83, 0xfe, 0x18, 0x80, + 0x61, 0x28, 0x44, 0x15, 0x56, 0x01, 0x85, 0x1c, 0x07, 0x02, 0xfe, 0x38, 0x90, 0xfe, 0xba, 0x90, + 0x91, 0xde, 0x7e, 0xdf, 0xfe, 0x48, 0x55, 0x31, 0xfe, 0xc9, 0x55, 0x02, 0x21, 0xb9, 0x88, 0x20, + 0xb9, 0x02, 0x0a, 0xba, 0x01, 0x18, 0xfe, 0x41, 0x48, 0x0a, 0x57, 0x01, 0x18, 0xfe, 0x49, 0x44, + 0x1b, 0xfe, 0x1e, 0x1d, 0x88, 0x89, 0x02, 0x0a, 0x5a, 0x01, 0x18, 0x09, 0x1a, 0xa4, 0x0a, 0x67, + 0x01, 0xa3, 0x0a, 0x57, 0x01, 0x18, 0x88, 0x89, 0x02, 0xfe, 0x4e, 0xe4, 0x1d, 0x7b, 0xfe, 0x52, + 0x1d, 0x03, 0xfe, 0x90, 0x00, 0xfe, 0x3a, 0x45, 0xfe, 0x2c, 0x10, 0xfe, 0x4e, 0xe4, 0xdd, 0x7b, + 0xfe, 0x64, 0x1d, 0x03, 0xfe, 0x92, 0x00, 0xd1, 0x12, 0xfe, 0x1a, 0x10, 0xfe, 0x4e, 0xe4, 0xfe, + 0x0b, 0x00, 0x7b, 0xfe, 0x76, 0x1d, 0x03, 0xfe, 0x94, 0x00, 0xd1, 0x24, 0xfe, 0x08, 0x10, 0x03, + 0xfe, 0x96, 0x00, 0xd1, 0x63, 0xfe, 0x4e, 0x45, 0x83, 0xca, 0xff, 0x04, 0x68, 0x54, 0xfe, 0xf1, + 0x10, 0x23, 0x49, 0xfe, 0x08, 0x1c, 0xfe, 0x67, 0x19, 0xfe, 0x0a, 0x1c, 0xfe, 0x1a, 0xf4, 0xfe, + 0x00, 0x04, 0x83, 0xb2, 0x1d, 0x48, 0xfe, 0xaa, 0x1d, 0x13, 0x1d, 0x02, 0x09, 0x92, 0xfe, 0x5a, + 0xf0, 0xfe, 0xba, 0x1d, 0x2e, 0x93, 0xfe, 0x34, 0x10, 0x09, 0x12, 0xfe, 0x5a, 0xf0, 0xfe, 0xc8, + 0x1d, 0x2e, 0xb4, 0xfe, 0x26, 0x10, 0x09, 0x1d, 0x36, 0x2e, 0x63, 0xfe, 0x1a, 0x10, 0x09, 0x0d, + 0x36, 0x2e, 0x94, 0xf2, 0x09, 0x07, 0x36, 0x2e, 0x95, 0xa1, 0xc8, 0x02, 0x1f, 0x93, 0x01, 0x42, + 0xfe, 0x04, 0xfe, 0x99, 0x03, 0x9c, 0x8b, 0x02, 0x2a, 0xfe, 0x1c, 0x1e, 0xfe, 0x14, 0xf0, 0x08, + 0x2f, 0xfe, 0x0c, 0x1e, 0x2a, 0xfe, 0x1c, 0x1e, 0x8f, 0xfe, 0x1c, 0x1e, 0xfe, 0x82, 0xf0, 0xfe, + 0x10, 0x1e, 0x02, 0x0f, 0x3f, 0x04, 0xfe, 0x80, 0x83, 0x33, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x18, + 0x80, 0x04, 0xfe, 0x98, 0x83, 0x33, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x02, 0x80, 0x04, 0xfe, 0x82, + 0x83, 0x33, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x06, 0x80, 0x04, 0xfe, 0x86, 0x83, 0x33, 0x0b, 0x0e, + 0x02, 0x0f, 0xfe, 0x1b, 0x80, 0x04, 0xfe, 0x9b, 0x83, 0x33, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x04, + 0x80, 0x04, 0xfe, 0x84, 0x83, 0x33, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x80, 0x80, 0x04, 0xfe, 0x80, + 0x83, 0xfe, 0xc9, 0x47, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x19, 0x81, 0x04, 0xfe, 0x99, 0x83, 0xfe, + 0xca, 0x47, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x06, 0x83, 0x04, 0xfe, 0x86, 0x83, 0xfe, 0xce, 0x47, + 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x2c, 0x90, 0x04, 0xfe, 0xac, 0x93, 0x3a, 0x0b, 0x0e, 0x02, 0x0f, + 0xfe, 0xae, 0x90, 0x04, 0xfe, 0xae, 0x93, 0x79, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x08, 0x90, 0x04, + 0xfe, 0x88, 0x93, 0x3a, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x8a, 0x90, 0x04, 0xfe, 0x8a, 0x93, 0x79, + 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x0c, 0x90, 0x04, 0xfe, 0x8c, 0x93, 0x3a, 0x0b, 0x0e, 0x02, 0x0f, + 0xfe, 0x8e, 0x90, 0x04, 0xfe, 0x8e, 0x93, 0x79, 0x0b, 0x0e, 0x02, 0x0f, 0xfe, 0x3c, 0x90, 0x04, + 0xfe, 0xbc, 0x93, 0x3a, 0x0b, 0x0e, 0x02, 0x8b, 0x0f, 0xfe, 0x03, 0x80, 0x04, 0xfe, 0x83, 0x83, + 0x33, 0x0b, 0x77, 0x0e, 0xa8, 0x02, 0xff, 0x66, 0x00, 0x00, }; STATIC unsigned short _adv_asc38C1600_size = - sizeof(_adv_asc38C1600_buf); /* 0x1662 */ + sizeof(_adv_asc38C1600_buf); /* 0x1673 */ STATIC ADV_DCNT _adv_asc38C1600_chksum = - 0x057A378AUL; /* Expanded little_endian checksum. */ + 0x0604EF77UL; /* Expanded little-endian checksum. */ /* a_init.c */ /* @@ -16629,12 +14573,13 @@ * Additional structure information can be found in a_condor.h where * the structure is defined. * - * The XXX_Field_IsChar structs are needed to correct for endianness. + * The *_Field_IsChar structs are needed to correct for endianness. * These values are read from the board 16 bits at a time directly - * into the structs. Because some fields are char, the values will be - * in the wrong order. The XXX_Field_IsChar tells when to flip the - * bytes. Cleaner solutions are welcome. :-) - * + * into the structs. Because some fields are char, the values will be + * in the wrong order. The *_Field_IsChar tells when to flip the + * bytes. Data read and written to PCI memory is automatically swapped + * on big-endian platforms so char fields read as words are actually being + * unswapped on big-endian platforms. */ STATIC ADVEEP_3550_CONFIG Default_3550_EEPROM_Config ASC_INITDATA = { @@ -16676,14 +14621,14 @@ STATIC ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar ASC_INITDATA = { - 0, /* cfg_lsw */ - 0, /* cfg_msw */ - 0, /* -disc_enable */ - 0, /* wdtr_able */ - 0, /* sdtr_able */ - 0, /* start_motor */ - 0, /* tagqng_able */ - 0, /* bios_scan */ + 0, /* cfg_lsw */ + 0, /* cfg_msw */ + 0, /* -disc_enable */ + 0, /* wdtr_able */ + 0, /* sdtr_able */ + 0, /* start_motor */ + 0, /* tagqng_able */ + 0, /* bios_scan */ 0, /* scam_tolerant */ 1, /* adapter_scsi_id */ 1, /* bios_boot_delay */ @@ -16691,11 +14636,11 @@ 1, /* bios_id_lun */ 1, /* termination */ 1, /* reserved1 */ - 0, /* bios_ctrl */ - 0, /* ultra_able */ + 0, /* bios_ctrl */ + 0, /* ultra_able */ 0, /* reserved2 */ - 1, /* max_host_qng */ - 1, /* max_dvc_qng */ + 1, /* max_host_qng */ + 1, /* max_dvc_qng */ 0, /* dvc_cntl */ 0, /* bug_fix */ 0, /* serial_number_word1 */ @@ -16779,14 +14724,14 @@ STATIC ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar ASC_INITDATA = { - 0, /* 00 cfg_lsw */ - 0, /* 01 cfg_msw */ - 0, /* 02 disc_enable */ - 0, /* 03 wdtr_able */ - 0, /* 04 sdtr_speed1 */ - 0, /* 05 start_motor */ - 0, /* 06 tagqng_able */ - 0, /* 07 bios_scan */ + 0, /* 00 cfg_lsw */ + 0, /* 01 cfg_msw */ + 0, /* 02 disc_enable */ + 0, /* 03 wdtr_able */ + 0, /* 04 sdtr_speed1 */ + 0, /* 05 start_motor */ + 0, /* 06 tagqng_able */ + 0, /* 07 bios_scan */ 0, /* 08 scam_tolerant */ 1, /* 09 adapter_scsi_id */ 1, /* bios_boot_delay */ @@ -16794,13 +14739,13 @@ 1, /* bios_id_lun */ 1, /* 11 termination_se */ 1, /* termination_lvd */ - 0, /* 12 bios_ctrl */ - 0, /* 13 sdtr_speed2 */ - 0, /* 14 sdtr_speed3 */ - 1, /* 15 max_host_qng */ - 1, /* max_dvc_qng */ + 0, /* 12 bios_ctrl */ + 0, /* 13 sdtr_speed2 */ + 0, /* 14 sdtr_speed3 */ + 1, /* 15 max_host_qng */ + 1, /* max_dvc_qng */ 0, /* 16 dvc_cntl */ - 0, /* 17 sdtr_speed4 */ + 0, /* 17 sdtr_speed4 */ 0, /* 18 serial_number_word1 */ 0, /* 19 serial_number_word2 */ 0, /* 20 serial_number_word3 */ @@ -16834,8 +14779,8 @@ 0, /* 55 reserved */ 0, /* 56 cisptr_lsw */ 0, /* 57 cisprt_msw */ - 0, /* 58 subsysvid */ - 0, /* 59 subsysid */ + 0, /* 58 subsysvid */ + 0, /* 59 subsysid */ 0, /* 60 reserved */ 0, /* 61 reserved */ 0, /* 62 reserved */ @@ -16909,14 +14854,14 @@ STATIC ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar ASC_INITDATA = { - 0, /* 00 cfg_lsw */ - 0, /* 01 cfg_msw */ - 0, /* 02 disc_enable */ - 0, /* 03 wdtr_able */ - 0, /* 04 sdtr_speed1 */ - 0, /* 05 start_motor */ - 0, /* 06 tagqng_able */ - 0, /* 07 bios_scan */ + 0, /* 00 cfg_lsw */ + 0, /* 01 cfg_msw */ + 0, /* 02 disc_enable */ + 0, /* 03 wdtr_able */ + 0, /* 04 sdtr_speed1 */ + 0, /* 05 start_motor */ + 0, /* 06 tagqng_able */ + 0, /* 07 bios_scan */ 0, /* 08 scam_tolerant */ 1, /* 09 adapter_scsi_id */ 1, /* bios_boot_delay */ @@ -16924,13 +14869,13 @@ 1, /* bios_id_lun */ 1, /* 11 termination_se */ 1, /* termination_lvd */ - 0, /* 12 bios_ctrl */ - 0, /* 13 sdtr_speed2 */ - 0, /* 14 sdtr_speed3 */ - 1, /* 15 max_host_qng */ - 1, /* max_dvc_qng */ + 0, /* 12 bios_ctrl */ + 0, /* 13 sdtr_speed2 */ + 0, /* 14 sdtr_speed3 */ + 1, /* 15 max_host_qng */ + 1, /* max_dvc_qng */ 0, /* 16 dvc_cntl */ - 0, /* 17 sdtr_speed4 */ + 0, /* 17 sdtr_speed4 */ 0, /* 18 serial_number_word1 */ 0, /* 19 serial_number_word2 */ 0, /* 20 serial_number_word3 */ @@ -16964,8 +14909,8 @@ 0, /* 55 reserved */ 0, /* 56 cisptr_lsw */ 0, /* 57 cisprt_msw */ - 0, /* 58 subsysvid */ - 0, /* 59 subsysid */ + 0, /* 58 subsysvid */ + 0, /* 59 subsysid */ 0, /* 60 reserved */ 0, /* 61 reserved */ 0, /* 62 reserved */ @@ -17052,11 +14997,11 @@ asc_dvc->cfg->chip_version = AdvGetChipVersion(iop_base, asc_dvc->bus_type); - ASC_DBG2(1, "AdvInitGetConfig: iopb_chip_id_1: %x %x\n", + ASC_DBG2(1, "AdvInitGetConfig: iopb_chip_id_1: 0x%x 0x%x\n", (ushort) AdvReadByteRegister(iop_base, IOPB_CHIP_ID_1), (ushort) ADV_CHIP_ID_BYTE); - ASC_DBG2(1, "AdvInitGetConfig: iopw_chip_id_0: %x %x\n", + ASC_DBG2(1, "AdvInitGetConfig: iopw_chip_id_0: 0x%x 0x%x\n", (ushort) AdvReadWordRegister(iop_base, IOPW_CHIP_ID_0), (ushort) ADV_CHIP_ID_WORD); @@ -17121,6 +15066,8 @@ * * For a non-fatal error return a warning code. If there are no warnings * then 0 is returned. + * + * Needed after initialization for error recovery. */ STATIC int AdvInitAsc3550Driver(ADV_DVC_VAR *asc_dvc) @@ -17233,7 +15180,7 @@ { AdvWriteWordAutoIncLram(iop_base, (((ushort) _adv_asc3550_buf[i + 3] << 8) | - _adv_asc3550_buf[i + 2])); + _adv_asc3550_buf[i + 2])); word++; } i += 3; @@ -17241,14 +15188,14 @@ { AdvWriteWordAutoIncLram(iop_base, (((ushort) _adv_asc3550_buf[i + 2] << 8) | - _adv_asc3550_buf[i + 1])); + _adv_asc3550_buf[i + 1])); i += 2; word++; } else { AdvWriteWordAutoIncLram(iop_base, (((ushort) _adv_asc3550_buf[(_adv_asc3550_buf[i] * 2) + 1] << 8) | - _adv_asc3550_buf[_adv_asc3550_buf[i] * 2])); + _adv_asc3550_buf[_adv_asc3550_buf[i] * 2])); word++; } } @@ -17414,7 +15361,6 @@ */ AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, asc_dvc->cfg->disc_enable); - /* * Set SCSI_CFG0 Microcode Default Value. * @@ -17608,8 +15554,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); /* * The first command issued will be placed in the stopper carrier. @@ -17619,9 +15565,7 @@ /* * Set RISC ICQ physical address start value. */ - AdvWriteDWordLram(iop_base, ASC_MC_ICQ, - /* carr_pa is stored LE, must be native before write */ - le32_to_cpu(asc_dvc->icq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); /* * Set-up the RISC->Host Initiator Response Queue (IRQ). @@ -17631,8 +15575,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); /* * The first command completed by the RISC will be placed in @@ -17646,9 +15590,7 @@ /* * Set RISC IRQ physical address start value. */ - AdvWriteDWordLram(iop_base, ASC_MC_IRQ, - /* carr_pa is LE, must be native before write */ - le32_to_cpu(asc_dvc->irq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); asc_dvc->carr_pending_cnt = 0; AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, @@ -17704,6 +15646,8 @@ * * For a non-fatal error return a warning code. If there are no warnings * then 0 is returned. + * + * Needed after initialization for error recovery. */ STATIC int AdvInitAsc38C0800Driver(ADV_DVC_VAR *asc_dvc) @@ -18232,8 +16176,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); /* * The first command issued will be placed in the stopper carrier. @@ -18242,10 +16186,9 @@ /* * Set RISC ICQ physical address start value. + * carr_pa is LE, must be native before write */ - AdvWriteDWordLram(iop_base, ASC_MC_ICQ, - /* carr_pa is LE, must be native before write */ - le32_to_cpu(asc_dvc->icq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); /* * Set-up the RISC->Host Initiator Response Queue (IRQ). @@ -18255,8 +16198,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); /* * The first command completed by the RISC will be placed in @@ -18269,10 +16212,10 @@ /* * Set RISC IRQ physical address start value. + * + * carr_pa is LE, must be native before write * */ - AdvWriteDWordLram(iop_base, ASC_MC_IRQ, - /* carr_pa is LE, must be native before write */ - le32_to_cpu(asc_dvc->irq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); asc_dvc->carr_pending_cnt = 0; AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, @@ -18328,11 +16271,11 @@ * * For a non-fatal error return a warning code. If there are no warnings * then 0 is returned. + * + * Needed after initialization for error recovery. */ -ASC_INITFUNC( -STATIC int, +STATIC int AdvInitAsc38C1600Driver(ADV_DVC_VAR *asc_dvc) -) { AdvPortAddr iop_base; ushort warn_code; @@ -18763,6 +16706,8 @@ * Clear Big Endian and Terminator Polarity bits and set possibly * modified termination control bits in the Microcode SCSI_CFG1 * Register Value. + * + * Big Endian bit is not used even on big endian machines. */ scsi_cfg1 &= (~BIG_ENDIAN & ~DIS_TERM_DRV & ~TERM_POL); @@ -18867,8 +16812,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); /* * The first command issued will be placed in the stopper carrier. @@ -18880,11 +16825,9 @@ * COMMA register to the same value otherwise the RISC will * prematurely detect a command is available. */ - AdvWriteDWordLram(iop_base, ASC_MC_ICQ, - /* carr_pa is stored LE, must be native before write */ - le32_to_cpu(asc_dvc->icq_sp->carr_pa)); - AdvWriteDWordRegister(iop_base, IOPDW_COMMA, - le32_to_cpu(asc_dvc->icq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); + AdvWriteDWordRegister(iop_base, IOPDW_COMMA, + le32_to_cpu(asc_dvc->icq_sp->carr_pa)); /* * Set-up the RISC->Host Initiator Response Queue (IRQ). @@ -18894,8 +16837,8 @@ asc_dvc->err_code |= ASC_IERR_NO_CARRIER; return ADV_ERROR; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); /* * The first command completed by the RISC will be placed in @@ -18909,9 +16852,7 @@ /* * Set RISC IRQ physical address start value. */ - AdvWriteDWordLram(iop_base, ASC_MC_IRQ, - /* carr_pa is LE, must be native before write */ - le32_to_cpu(asc_dvc->irq_sp->carr_pa)); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); asc_dvc->carr_pending_cnt = 0; AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, @@ -18989,8 +16930,6 @@ * Read the board's EEPROM configuration. * * Set default values if a bad checksum is found. - * - * XXX - Don't handle big-endian access to EEPROM yet. */ if (AdvGet3550EEPConfig(iop_base, &eep_config) != eep_config.check_sum) { @@ -19011,13 +16950,13 @@ * failed. */ eep_config.serial_number_word3 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 1); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); eep_config.serial_number_word2 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 2); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); eep_config.serial_number_word1 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 3); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); AdvSet3550EEPConfig(iop_base, &eep_config); } @@ -19167,8 +17106,6 @@ * Read the board's EEPROM configuration. * * Set default values if a bad checksum is found. - * - * XXX - Don't handle big-endian access to EEPROM yet. */ if (AdvGet38C0800EEPConfig(iop_base, &eep_config) != eep_config.check_sum) { @@ -19189,13 +17126,13 @@ * failed. */ eep_config.serial_number_word3 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 1); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); eep_config.serial_number_word2 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 2); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); eep_config.serial_number_word1 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 3); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); AdvSet38C0800EEPConfig(iop_base, &eep_config); } @@ -19465,13 +17402,13 @@ * failed. */ eep_config.serial_number_word3 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 1); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); eep_config.serial_number_word2 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 2); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); eep_config.serial_number_word1 = - AdvReadEEPWord(iop_base, ASC_EEP_DVC_CFG_END - 3); + AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); AdvSet38C1600EEPConfig(iop_base, &eep_config); } @@ -19660,38 +17597,37 @@ ushort wval, chksum; ushort *wbuf; int eep_addr; - ushort *charfields; + ushort *charfields; - /* Charfields will tell us which words coming from the EEProm should not - be byteswapped, because they are not a single short but a pair of - chars. */ - charfields = (ushort*) &ADVEEP_3550_Config_Field_IsChar; + charfields = (ushort *) &ADVEEP_3550_Config_Field_IsChar; wbuf = (ushort *) cfg_buf; chksum = 0; - for (eep_addr = ASC_EEP_DVC_CFG_BEGIN; - eep_addr < ASC_EEP_DVC_CFG_END; + for (eep_addr = ADV_EEP_DVC_CFG_BEGIN; + eep_addr < ADV_EEP_DVC_CFG_END; eep_addr++, wbuf++) { wval = AdvReadEEPWord(iop_base, eep_addr); - chksum += wval; - /* swap back as needed */ - if (*charfields++) - *wbuf = cpu_to_le16(wval); - else - *wbuf = wval; + chksum += wval; /* Checksum is calculated from word values. */ + if (*charfields++) { + *wbuf = le16_to_cpu(wval); + } else { + *wbuf = wval; + } } + /* Read checksum word. */ *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); - wbuf++; - for (eep_addr = ASC_EEP_DVC_CTL_BEGIN; - eep_addr < ASC_EEP_MAX_WORD_ADDR; + wbuf++; charfields++; + + /* Read rest of EEPROM not covered by the checksum. */ + for (eep_addr = ADV_EEP_DVC_CTL_BEGIN; + eep_addr < ADV_EEP_MAX_WORD_ADDR; eep_addr++, wbuf++) { *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); + if (*charfields++) { + *wbuf = le16_to_cpu(*wbuf); + } } return chksum; } @@ -19712,36 +17648,35 @@ int eep_addr; ushort *charfields; - /* Charfields will tell us which words coming from the EEProm should not - be byteswapped, because they are not a single short but a pair of - chars. */ - charfields = (ushort*) &ADVEEP_38C0800_Config_Field_IsChar; + charfields = (ushort *) &ADVEEP_38C0800_Config_Field_IsChar; wbuf = (ushort *) cfg_buf; chksum = 0; - for (eep_addr = ASC_EEP_DVC_CFG_BEGIN; - eep_addr < ASC_EEP_DVC_CFG_END; + for (eep_addr = ADV_EEP_DVC_CFG_BEGIN; + eep_addr < ADV_EEP_DVC_CFG_END; eep_addr++, wbuf++) { wval = AdvReadEEPWord(iop_base, eep_addr); - chksum += wval; - /* swap back as needed */ - if (*charfields++) - *wbuf = cpu_to_le16(wval); - else - *wbuf = wval; + chksum += wval; /* Checksum is calculated from word values. */ + if (*charfields++) { + *wbuf = le16_to_cpu(wval); + } else { + *wbuf = wval; + } } + /* Read checksum word. */ *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); - wbuf++; - for (eep_addr = ASC_EEP_DVC_CTL_BEGIN; - eep_addr < ASC_EEP_MAX_WORD_ADDR; + wbuf++; charfields++; + + /* Read rest of EEPROM not covered by the checksum. */ + for (eep_addr = ADV_EEP_DVC_CTL_BEGIN; + eep_addr < ADV_EEP_MAX_WORD_ADDR; eep_addr++, wbuf++) { *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); + if (*charfields++) { + *wbuf = le16_to_cpu(*wbuf); + } } return chksum; } @@ -19760,38 +17695,37 @@ ushort wval, chksum; ushort *wbuf; int eep_addr; - ushort *charfields; + ushort *charfields; - /* Charfields will tell us which words coming from the EEProm should not - be byteswapped, because they are not a single short but a pair of - chars. */ charfields = (ushort*) &ADVEEP_38C1600_Config_Field_IsChar; wbuf = (ushort *) cfg_buf; chksum = 0; - for (eep_addr = ASC_EEP_DVC_CFG_BEGIN; - eep_addr < ASC_EEP_DVC_CFG_END; + for (eep_addr = ADV_EEP_DVC_CFG_BEGIN; + eep_addr < ADV_EEP_DVC_CFG_END; eep_addr++, wbuf++) { wval = AdvReadEEPWord(iop_base, eep_addr); - chksum += wval; - /* swap back as needed */ - if (*charfields++) - *wbuf = cpu_to_le16(wval); - else - *wbuf = wval; + chksum += wval; /* Checksum is calculated from word values. */ + if (*charfields++) { + *wbuf = le16_to_cpu(wval); + } else { + *wbuf = wval; + } } + /* Read checksum word. */ *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); - wbuf++; - for (eep_addr = ASC_EEP_DVC_CTL_BEGIN; - eep_addr < ASC_EEP_MAX_WORD_ADDR; + wbuf++; charfields++; + + /* Read rest of EEPROM not covered by the checksum. */ + for (eep_addr = ADV_EEP_DVC_CTL_BEGIN; + eep_addr < ADV_EEP_MAX_WORD_ADDR; eep_addr++, wbuf++) { *wbuf = AdvReadEEPWord(iop_base, eep_addr); - if (*charfields++) - *wbuf = cpu_to_le16(*wbuf); + if (*charfields++) { + *wbuf = le16_to_cpu(*wbuf); + } } return chksum; } @@ -19820,7 +17754,7 @@ { int eep_delay_ms; - for (eep_delay_ms = 0; eep_delay_ms < ASC_EEP_DELAY_MS; eep_delay_ms++) + for (eep_delay_ms = 0; eep_delay_ms < ADV_EEP_DELAY_MS; eep_delay_ms++) { if (AdvReadWordRegister(iop_base, IOPW_EE_CMD) & ASC_EEP_CMD_DONE) { @@ -19853,44 +17787,47 @@ AdvWaitEEPCmd(iop_base); /* - * Write EEPROM from word 0 to word 20 + * Write EEPROM from word 0 to word 20. */ - for (addr = ASC_EEP_DVC_CFG_BEGIN; - addr < ASC_EEP_DVC_CFG_END; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CFG_BEGIN; + addr < ADV_EEP_DVC_CFG_END; addr++, wbuf++) { - ushort tmp; - if (charfields++) { - uchar *cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - } - else - tmp = *wbuf; - chksum += tmp; - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + chksum += *wbuf; /* Checksum is calculated from word values. */ + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - DvcSleepMilliSecond(ASC_EEP_DELAY_MS); + DvcSleepMilliSecond(ADV_EEP_DELAY_MS); } /* - * Write EEPROM checksum at word 21 + * Write EEPROM checksum at word 21. */ AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - wbuf++; /* skip over check_sum */ + wbuf++; charfields++; /* - * Write EEPROM OEM name at words 22 to 29 + * Write EEPROM OEM name at words 22 to 29. */ - for (addr = ASC_EEP_DVC_CTL_BEGIN; - addr < ASC_EEP_MAX_WORD_ADDR; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CTL_BEGIN; + addr < ADV_EEP_MAX_WORD_ADDR; addr++, wbuf++) { - uchar *cbuf; - ushort tmp; - cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); } @@ -19918,44 +17855,47 @@ AdvWaitEEPCmd(iop_base); /* - * Write EEPROM from word 0 to word 20 + * Write EEPROM from word 0 to word 20. */ - for (addr = ASC_EEP_DVC_CFG_BEGIN; - addr < ASC_EEP_DVC_CFG_END; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CFG_BEGIN; + addr < ADV_EEP_DVC_CFG_END; addr++, wbuf++) { - ushort tmp; - if (*charfields++) { - uchar *cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - } - else - tmp = *wbuf; - chksum += tmp; - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + chksum += *wbuf; /* Checksum is calculated from word values. */ + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - DvcSleepMilliSecond(ASC_EEP_DELAY_MS); + DvcSleepMilliSecond(ADV_EEP_DELAY_MS); } /* - * Write EEPROM checksum at word 21 + * Write EEPROM checksum at word 21. */ AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - wbuf++; /* skip over check_sum */ + wbuf++; charfields++; /* - * Write EEPROM OEM name at words 22 to 29 + * Write EEPROM OEM name at words 22 to 29. */ - for (addr = ASC_EEP_DVC_CTL_BEGIN; - addr < ASC_EEP_MAX_WORD_ADDR; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CTL_BEGIN; + addr < ADV_EEP_MAX_WORD_ADDR; addr++, wbuf++) { - uchar *cbuf; - ushort tmp; - cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); } @@ -19972,7 +17912,7 @@ ADVEEP_38C1600_CONFIG *cfg_buf) { ushort *wbuf; - ushort *charfields; + ushort *charfields; ushort addr, chksum; wbuf = (ushort *) cfg_buf; @@ -19983,44 +17923,47 @@ AdvWaitEEPCmd(iop_base); /* - * Write EEPROM from word 0 to word 20 + * Write EEPROM from word 0 to word 20. */ - for (addr = ASC_EEP_DVC_CFG_BEGIN; - addr < ASC_EEP_DVC_CFG_END; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CFG_BEGIN; + addr < ADV_EEP_DVC_CFG_END; addr++, wbuf++) { - ushort tmp; - if (*charfields++) { - uchar *cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - } - else - tmp = *wbuf; - chksum += tmp; - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + chksum += *wbuf; /* Checksum is calculated from word values. */ + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - DvcSleepMilliSecond(ASC_EEP_DELAY_MS); + DvcSleepMilliSecond(ADV_EEP_DELAY_MS); } /* - * Write EEPROM checksum at word 21 + * Write EEPROM checksum at word 21. */ AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); - wbuf++; /* skip over check_sum */ + wbuf++; charfields++; /* - * Write EEPROM OEM name at words 22 to 29 + * Write EEPROM OEM name at words 22 to 29. */ - for (addr = ASC_EEP_DVC_CTL_BEGIN; - addr < ASC_EEP_MAX_WORD_ADDR; addr++, wbuf++) + for (addr = ADV_EEP_DVC_CTL_BEGIN; + addr < ADV_EEP_MAX_WORD_ADDR; addr++, wbuf++) { - uchar *cbuf; - ushort tmp; - cbuf = (uchar *) wbuf; - tmp = *cbuf + ((*(cbuf + 1)) << 8); - AdvWriteWordRegister(iop_base, IOPW_EE_DATA, tmp); + ushort word; + + if (*charfields++) { + word = cpu_to_le16(*wbuf); + } else { + word = *wbuf; + } + AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); AdvWaitEEPCmd(iop_base); } @@ -20055,7 +17998,7 @@ AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, ADV_SCSI_REQ_Q *scsiq) { - int last_int_level; + ulong last_int_level; AdvPortAddr iop_base; ADV_DCNT req_size; ADV_PADDR req_paddr; @@ -20083,10 +18026,11 @@ */ if ((new_carrp = asc_dvc->carr_freelist) == NULL) { + DvcLeaveCritical(last_int_level); return ADV_BUSY; } - asc_dvc->carr_freelist = - (ADV_CARR_T *) ADV_U32_TO_VADDR(le32_to_cpu(new_carrp->next_vpa)); + asc_dvc->carr_freelist = (ADV_CARR_T *) + ADV_U32_TO_VADDR(le32_to_cpu(new_carrp->next_vpa)); asc_dvc->carr_pending_cnt++; /* @@ -20105,7 +18049,7 @@ req_paddr = DvcGetPhyAddr(asc_dvc, scsiq, (uchar *) scsiq, (ADV_SDCNT *) &req_size, ADV_IS_SCSIQ_FLAG); - ASC_ASSERT(ADV_8BALIGN(req_paddr) == req_paddr); + ASC_ASSERT(ADV_32BALIGN(req_paddr) == req_paddr); ASC_ASSERT(req_size >= sizeof(ADV_SCSI_REQ_Q)); /* Wait for assertion before making little-endian */ @@ -20163,9 +18107,8 @@ * Notify the RISC a carrier is ready by writing the physical * address of the new carrier stopper to the COMMA register. */ - AdvWriteDWordRegister(iop_base, IOPDW_COMMA, - /* carr_pa is LE, must be native before write */ - le32_to_cpu(new_carrp->carr_pa)); + AdvWriteDWordRegister(iop_base, IOPDW_COMMA, + le32_to_cpu(new_carrp->carr_pa)); } DvcLeaveCritical(last_int_level); @@ -20362,6 +18305,7 @@ if ((int_stat & (ADV_INTR_STATUS_INTRA | ADV_INTR_STATUS_INTRB | ADV_INTR_STATUS_INTRC)) == 0) { + DvcLeaveCritical(flags); return ADV_FALSE; } @@ -20399,7 +18343,8 @@ /* * Check if the IRQ stopper carrier contains a completed request. */ - while (((irq_next_vpa = le32_to_cpu(asc_dvc->irq_sp->next_vpa)) & ASC_RQ_DONE) != 0) + while (((irq_next_vpa = + le32_to_cpu(asc_dvc->irq_sp->next_vpa)) & ASC_RQ_DONE) != 0) { /* * Get a pointer to the newly completed ADV_SCSI_REQ_Q structure. @@ -20410,7 +18355,8 @@ * below complements the conversion of ASC_SCSI_REQ_Q.scsiq_ptr' * in AdvExeScsiQueue(). */ - scsiq = (ADV_SCSI_REQ_Q *) ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->areq_vpa)); + scsiq = (ADV_SCSI_REQ_Q *) + ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->areq_vpa)); /* * Request finished with good status and the queue was not @@ -20433,7 +18379,8 @@ asc_dvc->irq_sp = (ADV_CARR_T *) ADV_U32_TO_VADDR(ASC_GET_CARRP(irq_next_vpa)); - free_carrp->next_vpa = cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); + free_carrp->next_vpa = + cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); asc_dvc->carr_freelist = free_carrp; asc_dvc->carr_pending_cnt--; @@ -20449,10 +18396,16 @@ * If the command that completed was a SCSI INQUIRY and * LUN 0 was sent the command, then process the INQUIRY * command information for the device. + * + * Note: If data returned were either VPD or CmdDt data, + * don't process the INQUIRY command information for + * the device, otherwise may erroneously set *_able bits. */ if (scsiq->done_status == QD_NO_ERROR && scsiq->cdb[0] == SCSICMD_Inquiry && - scsiq->target_lun == 0) + scsiq->target_lun == 0 && + (scsiq->cdb[1] & ADV_INQ_RTN_VPD_AND_CMDDT) + == ADV_INQ_RTN_STD_INQUIRY_DATA) { AdvInquiryHandling(asc_dvc, scsiq); } @@ -20504,7 +18457,7 @@ ushort idle_cmd, ADV_DCNT idle_cmd_parameter) { - int last_int_level; + ulong last_int_level; int result; ADV_DCNT i, j; AdvPortAddr iop_base; @@ -20527,8 +18480,8 @@ * followed, the microcode may process the idle command before the * parameters have been written to LRAM. */ - AdvWriteDWordLram(iop_base, ASC_MC_IDLE_CMD_PARAMETER, - idle_cmd_parameter); + AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IDLE_CMD_PARAMETER, + cpu_to_le32(idle_cmd_parameter)); AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD, idle_cmd); /* @@ -20594,7 +18547,8 @@ * microcode to the transfer residual count. */ - if (scsiq->cdb[4] < 8 || (scsiq->cdb[4] - le32_to_cpu(scsiq->data_cnt)) < 8) + if (scsiq->cdb[4] < 8 || + (scsiq->cdb[4] - le32_to_cpu(scsiq->data_cnt)) < 8) { return; } @@ -20607,7 +18561,7 @@ /* * WDTR, SDTR, and Tag Queuing cannot be enabled for old devices. */ - if (INQ_RESPONSE_FMT(*inq) < 2 && INQ_ANSI_VER(*inq) < 2) + if (ADV_INQ_RESPONSE_FMT(inq) < 2 && ADV_INQ_ANSI_VER(inq) < 2) { return; } else @@ -20631,7 +18585,7 @@ * device's 'wdtr_able' bit and write the new value to the * microcode. */ - if ((asc_dvc->wdtr_able & tidmask) && INQ_WIDE16(*inq)) + if ((asc_dvc->wdtr_able & tidmask) && ADV_INQ_WIDE16(inq)) { AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); if ((cfg_word & tidmask) == 0) @@ -20662,7 +18616,7 @@ * supports synchronous transfers, then turn on the device's * 'sdtr_able' bit. Write the new value to the microcode. */ - if ((asc_dvc->sdtr_able & tidmask) && INQ_SYNC(*inq)) + if ((asc_dvc->sdtr_able & tidmask) && ADV_INQ_SYNC(inq)) { AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); if ((cfg_word & tidmask) == 0) @@ -20685,8 +18639,8 @@ * Clocking field, then check if DT mode is supported. */ if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600 && - (scsiq->cdb[4] >= 57 - || (scsiq->cdb[4] - le32_to_cpu(scsiq->data_cnt)) >= 57)) + (scsiq->cdb[4] >= 57 || + (scsiq->cdb[4] - le32_to_cpu(scsiq->data_cnt)) >= 57)) { /* * PPR (Parallel Protocol Request) Capable @@ -20696,7 +18650,7 @@ * messages to negotiate synchronous speed and offset, transfer * width, and protocol options. */ - if (INQ_CLOCKING(*inq) & INQ_CLOCKING_DT_ONLY) + if (ADV_INQ_CLOCKING(inq) & ADV_INQ_CLOCKING_DT_ONLY) { AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, asc_dvc->ppr_able); asc_dvc->ppr_able |= tidmask; @@ -20716,7 +18670,7 @@ * disabling Tag Queuing in the BIOS devices with Tag Queuing * bugs will at least work with the BIOS. */ - if ((asc_dvc->tagqng_able & tidmask) && INQ_CMD_QUEUE(*inq)) + if ((asc_dvc->tagqng_able & tidmask) && ADV_INQ_CMD_QUEUE(inq)) { AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, cfg_word); cfg_word |= tidmask; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/advansys.h linux.20p9/drivers/scsi/advansys.h --- linux.vanilla/drivers/scsi/advansys.h Sun Mar 25 17:31:31 2001 +++ linux.20p9/drivers/scsi/advansys.h Wed Aug 8 22:41:06 2001 @@ -2,7 +2,7 @@ * advansys.h - Linux Host Driver for AdvanSys SCSI Adapters * * Copyright (c) 1995-2000 Advanced System Products, Inc. - * Copyright (c) 2000 ConnectCom Solutions, Inc. + * Copyright (c) 2000-2001 ConnectCom Solutions, Inc. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,7 +11,7 @@ * modification. * * As of March 8, 2000 Advanced System Products, Inc. (AdvanSys) - * changed its name to name to ConnectCom Solutions, Inc. + * changed its name to ConnectCom Solutions, Inc. * * There is an AdvanSys Linux WWW page at: * http://www.connectcom.net/downloads/software/os/linux.html @@ -28,42 +28,38 @@ #ifndef _ADVANSYS_H #define _ADVANSYS_H -/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ -#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) - #ifndef LINUX_VERSION_CODE #include #endif /* LINUX_VERSION_CODE */ +/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +/* Driver supported only in version 2.2 and version >= 2.4. */ +#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,2,0) || \ + (LINUX_VERSION_CODE > ASC_LINUX_VERSION(2,3,0) && \ + LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0)) +#error "AdvanSys driver supported only in 2.2 and 2.4 or greater kernels." +#endif +#define ASC_LINUX_KERNEL22 (LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0)) +#define ASC_LINUX_KERNEL24 (LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,4,0)) + /* * Scsi_Host_Template function prototypes. */ int advansys_detect(Scsi_Host_Template *); int advansys_release(struct Scsi_Host *); const char *advansys_info(struct Scsi_Host *); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -int advansys_command(Scsi_Cmnd *); -#endif /* version < v2.3.28 */ int advansys_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *)); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -int advansys_abort(Scsi_Cmnd *); -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89) int advansys_reset(Scsi_Cmnd *); -#else /* version >= v1.3.89 */ -int advansys_reset(Scsi_Cmnd *, unsigned int); -#endif /* version >= v1.3.89 */ -#else /* version >= v2.3.28 */ -int advansys_eh_bus_reset(Scsi_Cmnd *); -#endif /* version >= v2.3.28 */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) -int advansys_biosparam(Disk *, int, int[]); -#else /* version >= v1.3.0 */ int advansys_biosparam(Disk *, kdev_t, int[]); +#ifdef CONFIG_PROC_FS #if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) extern struct proc_dir_entry proc_scsi_advansys; #endif /* version < v2.3.28 */ int advansys_proc_info(char *, char **, off_t, int, int, int); -#endif /* version >= v1.3.0 */ +#else /* !defined(CONFIG_PROC_FS) */ +#define advansys_proc_info NULL +#endif /* !defined(CONFIG_PROC_FS) */ /* init/main.c setup function */ void advansys_setup(char *, int *); @@ -71,108 +67,24 @@ /* * AdvanSys Host Driver Scsi_Host_Template (struct SHT) from hosts.h. */ -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0) +#if ASC_LINUX_KERNEL24 #define ADVANSYS { \ - NULL, /* struct SHT *next */ \ - NULL, /* int *usage_count */ \ - "advansys", /* char *name */ \ - advansys_detect, /* int (*detect)(struct SHT *) */ \ - advansys_release, /* int (*release)(struct Scsi_Host *) */ \ - advansys_info, /* const char *(*info)(struct Scsi_Host *) */ \ - advansys_command, /* int (*command)(Scsi_Cmnd *) */ \ - advansys_queuecommand, \ - /* int (*queuecommand)(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)) */ \ - advansys_abort, /* int (*abort)(Scsi_Cmnd *) */ \ - advansys_reset, /* int (*reset)(Scsi_Cmnd *) */ \ - NULL, /* int (*slave_attach)(int, int) */ \ - advansys_biosparam, /* int (* bios_param)(Disk *, int, int []) */ \ - /* \ - * The following fields are set per adapter in advansys_detect(). \ - */ \ - 0, /* int can_queue */ \ - 0, /* int this_id */ \ - 0, /* short unsigned int sg_tablesize */ \ - 0, /* short cmd_per_lun */ \ - 0, /* unsigned char present */ \ - /* \ - * Because the driver may control an ISA adapter 'unchecked_isa_dma' \ - * must be set. The flag will be cleared in advansys_detect for non-ISA \ - * adapters. Refer to the comment in scsi_module.c for more information. \ - */ \ - 1, /* unsigned unchecked_isa_dma:1 */ \ - /* \ - * All adapters controlled by this driver are capable of large \ - * scatter-gather lists. According to the mid-level SCSI documentation \ - * this obviates any performance gain provided by setting \ - * 'use_clustering'. But empirically while CPU utilization is increased \ - * by enabling clustering, I/O throughput increases as well. \ - */ \ - ENABLE_CLUSTERING, /* unsigned use_clustering:1 */ \ -} -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,75) -#define ADVANSYS { \ - NULL, /* struct SHT *next */ \ - NULL, \ - /* version < v2.1.23 long *usage_count */ \ - /* version >= v2.1.23 struct module * */ \ - &proc_scsi_advansys, /* struct proc_dir_entry *proc_dir */ \ - advansys_proc_info, \ - /* int (*proc_info)(char *, char **, off_t, int, int, int) */ \ - "advansys", /* const char *name */ \ - advansys_detect, /* int (*detect)(struct SHT *) */ \ - advansys_release, /* int (*release)(struct Scsi_Host *) */ \ - advansys_info, /* const char *(*info)(struct Scsi_Host *) */ \ - advansys_command, /* int (*command)(Scsi_Cmnd *) */ \ - advansys_queuecommand, \ - /* int (*queuecommand)(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)) */ \ - advansys_abort, /* int (*abort)(Scsi_Cmnd *) */ \ - advansys_reset, \ - /* version < v1.3.89 int (*reset)(Scsi_Cmnd *) */ \ - /* version >= v1.3.89 int (*reset)(Scsi_Cmnd *, unsigned int) */ \ - NULL, /* int (*slave_attach)(int, int) */ \ - advansys_biosparam, /* int (* bios_param)(Disk *, kdev_t, int []) */ \ - /* \ - * The following fields are set per adapter in advansys_detect(). \ - */ \ - 0, /* int can_queue */ \ - 0, /* int this_id */ \ - 0, /* short unsigned int sg_tablesize */ \ - 0, /* short cmd_per_lun */ \ - 0, /* unsigned char present */ \ - /* \ - * Because the driver may control an ISA adapter 'unchecked_isa_dma' \ - * must be set. The flag will be cleared in advansys_detect for non-ISA \ - * adapters. Refer to the comment in scsi_module.c for more information. \ - */ \ - 1, /* unsigned unchecked_isa_dma:1 */ \ - /* \ - * All adapters controlled by this driver are capable of large \ - * scatter-gather lists. According to the mid-level SCSI documentation \ - * this obviates any performance gain provided by setting \ - * 'use_clustering'. But empirically while CPU utilization is increased \ - * by enabling clustering, I/O throughput increases as well. \ - */ \ - ENABLE_CLUSTERING, /* unsigned use_clustering:1 */ \ -} -#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28) -#define ADVANSYS { \ - proc_dir: &proc_scsi_advansys, \ - proc_info: advansys_proc_info, \ - name: "advansys", \ - detect: advansys_detect, \ - release: advansys_release, \ - info: advansys_info, \ - command: advansys_command, \ - queuecommand: advansys_queuecommand, \ - abort: advansys_abort, \ - reset: advansys_reset, \ - bios_param: advansys_biosparam, \ + proc_name: "advansys", \ + proc_info: advansys_proc_info, \ + name: "advansys", \ + detect: advansys_detect, \ + release: advansys_release, \ + info: advansys_info, \ + queuecommand: advansys_queuecommand, \ + use_new_eh_code: 1, \ + eh_bus_reset_handler: advansys_reset, \ + bios_param: advansys_biosparam, \ /* \ * Because the driver may control an ISA adapter 'unchecked_isa_dma' \ * must be set. The flag will be cleared in advansys_detect for non-ISA \ * adapters. Refer to the comment in scsi_module.c for more information. \ */ \ - unchecked_isa_dma: 1, \ + unchecked_isa_dma: 1, \ /* \ * All adapters controlled by this driver are capable of large \ * scatter-gather lists. According to the mid-level SCSI documentation \ @@ -180,11 +92,10 @@ * 'use_clustering'. But empirically while CPU utilization is increased \ * by enabling clustering, I/O throughput increases as well. \ */ \ - use_clustering: ENABLE_CLUSTERING, \ + use_clustering: ENABLE_CLUSTERING, \ } -#else /* version >= v2.3.28 */ +#elif ASC_LINUX_KERNEL22 #define ADVANSYS { \ - proc_name: "advansys", \ proc_info: advansys_proc_info, \ name: "advansys", \ detect: advansys_detect, \ @@ -192,7 +103,7 @@ info: advansys_info, \ queuecommand: advansys_queuecommand, \ use_new_eh_code: 1, \ - eh_bus_reset_handler: advansys_eh_bus_reset, \ + eh_bus_reset_handler: advansys_reset, \ bios_param: advansys_biosparam, \ /* \ * Because the driver may control an ISA adapter 'unchecked_isa_dma' \ @@ -209,5 +120,5 @@ */ \ use_clustering: ENABLE_CLUSTERING, \ } -#endif /* version >= v2.3.28 */ +#endif #endif /* _ADVANSYS_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/cpqfcTScontrol.c linux.20p9/drivers/scsi/cpqfcTScontrol.c --- linux.vanilla/drivers/scsi/cpqfcTScontrol.c Sun Mar 25 17:31:34 2001 +++ linux.20p9/drivers/scsi/cpqfcTScontrol.c Wed Jul 4 16:03:58 2001 @@ -553,7 +553,7 @@ -// This "look ahead" function examines the IMQ for occurence of +// This "look ahead" function examines the IMQ for occurrence of // "type". Returns 1 if found, 0 if not. static int PeekIMQEntry( PTACHYON fcChip, ULONG type) { @@ -1204,7 +1204,7 @@ // open Login exchanges, in case the LinkDown happened in the // middle of logins. It's possible that some ports already // ACCepted login commands which we have not processed before - // another LinkDown occured. Any accepted Login exhanges are + // another LinkDown occurred. Any accepted Login exhanges are // invalidated by LinkDown, even before they are acknowledged. // It's also possible for a port to have a Queued Reply or Request // for login which was interrupted by LinkDown; it may come later, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/cpqfcTSworker.c linux.20p9/drivers/scsi/cpqfcTSworker.c --- linux.vanilla/drivers/scsi/cpqfcTSworker.c Sun Mar 25 17:37:36 2001 +++ linux.20p9/drivers/scsi/cpqfcTSworker.c Wed Jul 4 16:03:58 2001 @@ -421,7 +421,7 @@ // printk(" *ELS %Xh* ", fcLQ->Qitem[QconsumerNdx].Type); // if PortDiscDone is not set, it means the SendLogins routine - // failed to complete -- assume that LDn occured, so login frames + // failed to complete -- assume that LDn occurred, so login frames // are invalid if( !cpqfcHBAdata->PortDiscDone) // cleared by LDn { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/eata_dma.c linux.20p9/drivers/scsi/eata_dma.c --- linux.vanilla/drivers/scsi/eata_dma.c Sun Mar 25 17:31:31 2001 +++ linux.20p9/drivers/scsi/eata_dma.c Thu Jul 26 15:18:15 2001 @@ -503,6 +503,7 @@ DBG(DBG_REQSENSE, printk(KERN_DEBUG "Tried to REQUEST SENSE\n")); cmd->result = DID_OK << 16; done(cmd); + restore_flags(flags); return(0); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/esp.c linux.20p9/drivers/scsi/esp.c --- linux.vanilla/drivers/scsi/esp.c Sun Mar 25 17:31:32 2001 +++ linux.20p9/drivers/scsi/esp.c Wed Jul 4 16:03:58 2001 @@ -3465,7 +3465,7 @@ /* Target negotiates for synchronous transfers before we do, this * is legal although very strange. What is even funnier is that * the SCSI2 standard specifically recommends against targets doing - * this because so many initiators cannot cope with this occuring. + * this because so many initiators cannot cope with this occurring. */ static int target_with_ants_in_pants(struct Sparc_ESP *esp, Scsi_Cmnd *SCptr, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/fdomain.c linux.20p9/drivers/scsi/fdomain.c --- linux.vanilla/drivers/scsi/fdomain.c Sun Mar 25 17:31:30 2001 +++ linux.20p9/drivers/scsi/fdomain.c Thu Jul 26 18:23:05 2001 @@ -3,6 +3,7 @@ * Revised: Mon Dec 28 21:59:02 1998 by faith@acm.org * Author: Rickard E. Faith, faith@cs.unc.edu * Copyright 1992-1996, 1998 Rickard E. Faith (faith@acm.org) + * Shared IRQ supported added 7/7/2001 Alan Cox * 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 @@ -983,7 +984,7 @@ /* Register the IRQ with the kernel */ retcode = request_irq( interrupt_level, - do_fdomain_16x0_intr, 0, "fdomain", NULL); + do_fdomain_16x0_intr, PCI_bus?SA_SHIRQ:0, "fdomain", NULL); if (retcode < 0) { if (retcode == -EINVAL) { @@ -1230,8 +1231,11 @@ interruptions while this routine is running. */ - /* sti(); Yes, we really want sti() here if we want to lock up our machine */ - + /* Check for other IRQ sources */ + if((inb(TMC_Status_port)&0x01)==0) + return; + + /* It is our IRQ */ outb( 0x00, Interrupt_Cntl_port ); /* We usually have one spurious interrupt after each command. Ignore it. */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/gdth.h linux.20p9/drivers/scsi/gdth.h --- linux.vanilla/drivers/scsi/gdth.h Sun Mar 25 17:37:36 2001 +++ linux.20p9/drivers/scsi/gdth.h Wed Aug 8 22:41:06 2001 @@ -891,7 +891,7 @@ unchar ldr_no; /* log. drive no. */ unchar rw_attribs; /* r/w attributes */ unchar cluster_type; /* cluster properties */ - unchar media_changed; /* Flag:MOUNT/UNMOUNT occured */ + unchar media_changed; /* Flag:MOUNT/UNMOUNT occurred */ ulong32 start_sec; /* start sector */ } hdr[MAX_LDRIVES]; /* host drives */ struct { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/ips.c linux.20p9/drivers/scsi/ips.c --- linux.vanilla/drivers/scsi/ips.c Sun Mar 25 17:31:34 2001 +++ linux.20p9/drivers/scsi/ips.c Wed Jul 4 16:03:58 2001 @@ -4835,7 +4835,7 @@ } if (j >= 45) - /* error occured */ + /* error occurred */ return (0); PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); @@ -4859,7 +4859,7 @@ } if (j >= 240) - /* error occured */ + /* error occurred */ return (0); ConfigByte[i] = inb(ha->io_addr + IPS_REG_ISPR); @@ -4924,7 +4924,7 @@ } if (j >= 45) - /* error occured */ + /* error occurred */ return (0); PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); @@ -4948,7 +4948,7 @@ } if (j >= 240) - /* error occured */ + /* error occurred */ return (0); ConfigByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); @@ -4965,7 +4965,7 @@ } if (i >= 240) - /* error occured */ + /* error occurred */ return (0); /* setup CCCR */ @@ -5015,7 +5015,7 @@ } if (i >= 45) { - /* error occured */ + /* error occurred */ printk(KERN_WARNING "(%s%d) timeout waiting for post.\n", ips_name, ha->host_num); @@ -5046,7 +5046,7 @@ } if (i >= 240) { - /* error occured */ + /* error occurred */ printk(KERN_WARNING "(%s%d) timeout waiting for config.\n", ips_name, ha->host_num); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/megaraid.c linux.20p9/drivers/scsi/megaraid.c --- linux.vanilla/drivers/scsi/megaraid.c Sun Mar 25 17:31:33 2001 +++ linux.20p9/drivers/scsi/megaraid.c Wed Jul 4 16:03:58 2001 @@ -1609,7 +1609,7 @@ } /*-------------------------------------------------------------------- - * Initializes the adress of the controller's mailbox register + * Initializes the address of the controller's mailbox register * The mailbox register is used to issue commands to the card. * Format of the mailbox area: * 00 01 command diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/osst.c linux.20p9/drivers/scsi/osst.c --- linux.vanilla/drivers/scsi/osst.c Sun Mar 25 17:37:36 2001 +++ linux.20p9/drivers/scsi/osst.c Wed Jul 4 16:03:58 2001 @@ -16,18 +16,18 @@ Copyright 1992 - 2000 Kai Makisara email Kai.Makisara@metla.fi - $Header: /home/cvsroot/Driver/osst.c,v 1.28.2.12.2.1 2000/12/15 20:36:12 garloff Exp $ + $Header: /home/cvsroot/Driver/osst.c,v 1.28.2.25 2001/06/03 21:56:26 riede Exp $ Last modified: Wed Feb 2 22:04:05 2000 by makisara@kai.makisara.local Some small formal changes - aeb, 950809 */ -static const char * cvsid = "$Id: osst.c,v 1.28.2.12.2.1 2000/12/15 20:36:12 garloff Exp $"; -const char * osst_version = "0.8.6.1"; +static const char * cvsid = "$Id: osst.c,v 1.28.2.25 2001/06/03 21:56:26 riede Exp $"; +const char * osst_version = "0.8.13"; /* The "failure to reconnect" firmware bug */ -#define OSST_FW_NEED_POLL_MIN 10602 /*(107A)*/ -#define OSST_FW_NEED_POLL_MAX 10708 /*(108D)*/ +#define OSST_FW_NEED_POLL_MIN 10601 /*(107A)*/ +#define OSST_FW_NEED_POLL_MAX 10704 /*(108D)*/ #define OSST_FW_NEED_POLL(x,d) ((x) >= OSST_FW_NEED_POLL_MIN && (x) <= OSST_FW_NEED_POLL_MAX && d->host->this_id != 7) #include @@ -95,6 +95,8 @@ #if DEBUG static int debugging = 1; +/* uncomment define below to test error recovery */ +// #define OSST_INJECT_ERRORS 1 #endif #define MAX_RETRIES 0 @@ -148,7 +150,7 @@ static int osst_get_frame_position(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt); -static int osst_flush_write_buffer(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt, int file_blk); +static int osst_flush_write_buffer(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt); static int osst_write_error_recovery(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int pending); @@ -179,7 +181,7 @@ #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: Error: %x, cmd: %x %x %x %x %x %x Len: %d\n", + printk(OSST_DEB_MSG "osst%d:D: Error: %x, cmd: %x %x %x %x %x %x Len: %d\n", dev, result, SCpnt->data_cmnd[0], SCpnt->data_cmnd[1], SCpnt->data_cmnd[2], SCpnt->data_cmnd[3], SCpnt->data_cmnd[4], SCpnt->data_cmnd[5], @@ -199,14 +201,21 @@ SCpnt->data_cmnd[0] != MODE_SENSE && SCpnt->data_cmnd[0] != TEST_UNIT_READY)) { /* Abnormal conditions for tape */ if (driver_byte(result) & DRIVER_SENSE) { - printk(KERN_WARNING "osst%d: Error with sense data: ", dev); + printk(KERN_WARNING "osst%d:W: Error with sense data: ", dev); print_sense("osst", SCpnt); } - else + else { +static int notyetprinted = 1; printk(KERN_WARNING - "osst%d: Error %x (sugg. bt 0x%x, driver bt 0x%x, host bt 0x%x).\n", - dev, result, suggestion(result), driver_byte(result), + "osst%d:W: Error %x (sugg. bt 0x%x, driver bt 0x%x, host bt 0x%x).\n", + dev, result, suggestion(result), driver_byte(result) & DRIVER_MASK, host_byte(result)); + if (notyetprinted) { + notyetprinted = 0; + printk(KERN_INFO "osst%d:I: This error may be caused by your scsi controller,\n", dev); + printk(KERN_INFO "osst%d:I: it has been reported with some Buslogic cards.\n", dev); + } + } } if ((sense[0] & 0x70) == 0x70 && @@ -222,7 +231,7 @@ stp = "write"; else stp = "ioctl"; - printk(OSST_DEB_MSG "osst%d: Recovered %s error (%d).\n", dev, stp, + printk(OSST_DEB_MSG "osst%d:D: Recovered %s error (%d).\n", dev, stp, os_scsi_tapes[dev]->recover_count); } #endif @@ -237,7 +246,6 @@ static void osst_sleep_done (Scsi_Cmnd * SCpnt) { unsigned int st_nbr; - int remainder; OS_Scsi_Tape * STp; if ((st_nbr = TAPE_NR(SCpnt->request.rq_dev)) < osst_template.nr_dev) { @@ -246,14 +254,7 @@ (SCpnt->sense_buffer[0] & 0x70) == 0x70 && (SCpnt->sense_buffer[2] & 0x40)) { /* EOM at write-behind, has all been written? */ - if ((SCpnt->sense_buffer[0] & 0x80) != 0) - remainder = (SCpnt->sense_buffer[3] << 24) | - (SCpnt->sense_buffer[4] << 16) | - (SCpnt->sense_buffer[5] << 8) | SCpnt->sense_buffer[6]; - else - remainder = 0; - if ((SCpnt->sense_buffer[2] & 0x0f) == VOLUME_OVERFLOW || - remainder > 0) + if ((SCpnt->sense_buffer[2] & 0x0f) == VOLUME_OVERFLOW) (STp->buffer)->last_result = SCpnt->result; /* Error */ else (STp->buffer)->last_result = INT_MAX; /* OK */ @@ -270,7 +271,7 @@ } #if DEBUG else if (debugging) - printk(KERN_ERR "osst?: Illegal interrupt device %x\n", st_nbr); + printk(KERN_ERR "osst?:D: Illegal interrupt device %x\n", st_nbr); #endif } @@ -283,12 +284,14 @@ { unsigned long flags; unsigned char *bp; -//static int inject = 0; /* FIXME - take out inject occasional read errors */ -//static int repeat = 0; +#ifdef OSST_INJECT_ERRORS + static int inject = 0; + static int repeat = 0; +#endif spin_lock_irqsave(&io_request_lock, flags); if (SCpnt == NULL) if ((SCpnt = scsi_allocate_device(NULL, STp->device, 1)) == NULL) { - printk(KERN_ERR "osst%d: Can't get SCSI request.\n", TAPE_NR(STp->devt)); + printk(KERN_ERR "osst%d:E: Can't get SCSI request.\n", TAPE_NR(STp->devt)); spin_unlock_irqrestore(&io_request_lock, flags); return NULL; } @@ -317,12 +320,14 @@ down(SCpnt->request.sem); (STp->buffer)->last_result_fatal = osst_chk_result(SCpnt); -//if ((STp->buffer)->last_result_fatal == 0 && -// cmd[0] == READ_6 && cmd[4] && ( /* (++ inject % 83) == 29 || */ -// (STp->first_frame_position == 240 /* or STp->read_error_frame to fail again on the block calculated above */ && ++repeat < 3))) { -// printk(OSST_DEB_MSG "osst%d: injecting read error\n", TAPE_NR(STp->devt)); -// STp->buffer->last_result_fatal = 1; /* FIXME - take out inject occasional read errors */ -//} +#ifdef OSST_INJECT_ERRORS + if (STp->buffer->last_result_fatal == 0 && + cmd[0] == READ_6 && cmd[4] && ( /* (++ inject % 83) == 29 || */ + (STp->first_frame_position == 240 /* or STp->read_error_frame to fail again on the block calculated above */ && ++repeat < 3))) { + printk(OSST_DEB_MSG "osst%d:D: Injecting read error\n", TAPE_NR(STp->devt)); + STp->buffer->last_result_fatal = 1; + } +#endif } return SCpnt; @@ -333,7 +338,6 @@ static void osst_write_behind_check(OS_Scsi_Tape *STp) { OSST_buffer * STbuffer; - ST_partstat * STps; STbuffer = STp->buffer; @@ -357,21 +361,9 @@ scsi_release_command((STp->buffer)->last_SCpnt); if (STbuffer->writing < STbuffer->buffer_bytes) -#if 0 - memcpy(STbuffer->b_data, - STbuffer->b_data + STbuffer->writing, - STbuffer->buffer_bytes - STbuffer->writing); -#else - printk(KERN_WARNING "osst: write_behind_check: something left in buffer!\n"); -#endif + printk(KERN_WARNING "osst:A: write_behind_check: something left in buffer!\n"); + STbuffer->buffer_bytes -= STbuffer->writing; - STps = &(STp->ps[STp->partition]); - if (STps->drv_block >= 0) { - if (STp->block_size == 0) - STps->drv_block++; - else - STps->drv_block += STbuffer->writing / STp->block_size; - } STbuffer->writing = 0; return; @@ -383,7 +375,8 @@ /* * Initialize the OnStream AUX */ -static void osst_init_aux(OS_Scsi_Tape * STp, int frame_type, int logical_blk_num) +static void osst_init_aux(OS_Scsi_Tape * STp, int frame_type, int frame_seq_number, + int logical_blk_num, int blk_sz, int blk_cnt) { os_aux_t *aux = STp->buffer->aux; os_partition_t *par = &aux->partition; @@ -417,9 +410,10 @@ dat->reserved1 = 0; dat->entry_cnt = 1; dat->reserved3 = 0; - dat->dat_list[0].blk_sz = htonl(frame_type==OS_FRAME_TYPE_DATA?STp->block_size:0); - dat->dat_list[0].blk_cnt = htons(1); - dat->dat_list[0].flags = frame_type==OS_FRAME_TYPE_MARKER?OS_DAT_FLAGS_MARK:OS_DAT_FLAGS_DATA; + dat->dat_list[0].blk_sz = htonl(blk_sz); + dat->dat_list[0].blk_cnt = htons(blk_cnt); + dat->dat_list[0].flags = frame_type==OS_FRAME_TYPE_MARKER? + OS_DAT_FLAGS_MARK:OS_DAT_FLAGS_DATA; dat->dat_list[0].reserved = 0; case OS_FRAME_TYPE_EOD: aux->update_frame_cntr = htonl(0); @@ -428,27 +422,28 @@ par->wrt_pass_cntr = htons(STp->wrt_pass_cntr); par->first_frame_ppos = htonl(STp->first_data_ppos); par->last_frame_ppos = htonl(STp->capacity); - aux->frame_seq_num = htonl(logical_blk_num); + aux->frame_seq_num = htonl(frame_seq_number); aux->logical_blk_num_high = htonl(0); aux->logical_blk_num = htonl(logical_blk_num); break; default: ; /* probably FILL */ } - aux->filemark_cnt = ntohl(STp->filemark_cnt); /* FIXME -- violates ADR spec */ + aux->filemark_cnt = ntohl(STp->filemark_cnt); aux->phys_fm = ntohl(0xffffffff); aux->last_mark_ppos = ntohl(STp->last_mark_ppos); + aux->last_mark_lbn = ntohl(STp->last_mark_lbn); } /* * Verify that we have the correct tape frame */ -static int osst_verify_frame(OS_Scsi_Tape * STp, int logical_blk_num, int quiet) +static int osst_verify_frame(OS_Scsi_Tape * STp, int frame_seq_number, int quiet) { os_aux_t * aux = STp->buffer->aux; os_partition_t * par = &(aux->partition); ST_partstat * STps = &(STp->ps[STp->partition]); - int i; int dev = TAPE_NR(STp->devt); + int blk_cnt, blk_sz, i; if (STp->raw) { if (STp->buffer->last_result_fatal) { @@ -459,55 +454,70 @@ return 1; } if (STp->buffer->last_result_fatal) { - printk(KERN_INFO "osst%d: Skipping frame, read error\n", dev); - return 0; +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, read error\n", dev); +#endif + return 0; } if (ntohl(aux->format_id) != 0) { - printk(KERN_INFO "osst%d: Skipping frame, format_id %u\n", dev, ntohl(aux->format_id)); - return 0; +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, format_id %u\n", dev, ntohl(aux->format_id)); +#endif + goto err_out; } if (memcmp(aux->application_sig, STp->application_sig, 4) != 0 && (memcmp(aux->application_sig, "LIN3", 4) != 0 || STp->linux_media_version != 4)) { - printk(KERN_INFO "osst%d: Skipping frame, incorrect application signature\n", dev); - return 0; +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, incorrect application signature\n", dev); +#endif + goto err_out; } if (par->partition_num != OS_DATA_PARTITION) { if (!STp->linux_media || STp->linux_media_version != 2) { - printk(KERN_INFO "osst%d: Skipping frame, partition num %d\n", dev, par->partition_num); return 0; +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, partition num %d\n", + dev, par->partition_num); +#endif + goto err_out; } } if (par->par_desc_ver != OS_PARTITION_VERSION) { - printk(KERN_INFO "osst%d: Skipping frame, partition version %d\n", dev, par->par_desc_ver); - return 0; +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, partition version %d\n", dev, par->par_desc_ver); +#endif + goto err_out; } if (ntohs(par->wrt_pass_cntr) != STp->wrt_pass_cntr) { - printk(KERN_INFO "osst%d: Skipping frame, wrt_pass_cntr %d (expected %d)\n", +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, wrt_pass_cntr %d (expected %d)\n", dev, ntohs(par->wrt_pass_cntr), STp->wrt_pass_cntr); - return 0; - } - if (aux->frame_seq_num != aux->logical_blk_num) { - printk(KERN_INFO "osst%d: Skipping frame, seq != logical\n", dev); - return 0; +#endif + goto err_out; } if (aux->frame_type != OS_FRAME_TYPE_DATA && aux->frame_type != OS_FRAME_TYPE_EOD && aux->frame_type != OS_FRAME_TYPE_MARKER) { - if (!quiet) - printk(KERN_INFO "osst%d: Skipping frame, frame type %x\n", dev, aux->frame_type); - return 0; +#if DEBUG + if (!quiet) + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, frame type %x\n", dev, aux->frame_type); +#endif + goto err_out; } if (aux->frame_type == OS_FRAME_TYPE_EOD && STp->first_frame_position < STp->eod_frame_ppos) { - printk(KERN_INFO "osst%d: skipping premature EOD frame %d\n", dev, STp->first_frame_position); - return 0; + printk(KERN_INFO "osst%d:I: skipping premature EOD frame %d\n", + dev, STp->first_frame_position); + goto err_out; } - STp->logical_blk_in_buffer = 1; + STp->frame_in_buffer = 1; - if (logical_blk_num != -1 && ntohl(aux->logical_blk_num) != logical_blk_num) { - if (!quiet) - printk(KERN_INFO "osst%d: Skipping frame, logical_blk_num %u (expected %d)\n", - dev, ntohl(aux->logical_blk_num), logical_blk_num); - return 0; + if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) { +#if DEBUG + if (!quiet) + printk(OSST_DEB_MSG "osst%d:D: Skipping frame, sequence number %u (expected %d)\n", + dev, ntohl(aux->frame_seq_num), frame_seq_number); +#endif + goto err_out; } if (aux->frame_type == OS_FRAME_TYPE_MARKER) { STps->eof = ST_FM_HIT; @@ -515,8 +525,8 @@ i = ntohl(aux->filemark_cnt); if (STp->header_cache != NULL && i < OS_FM_TAB_MAX && (i > STp->filemark_cnt || STp->first_frame_position - 1 != ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[i]))) { -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%i: %s filemark %d at frame %d\n", dev, +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: %s filemark %d at frame pos %d\n", dev, STp->header_cache->dat_fm_tab.fm_tab_ent[i] == 0?"Learned":"Corrected", i, STp->first_frame_position - 1); #endif @@ -529,9 +539,31 @@ STps->eof = ST_EOD_1; } if (aux->frame_type == OS_FRAME_TYPE_DATA) { - STps->eof = ST_NOEOF; + blk_cnt = ntohs(aux->dat.dat_list[0].blk_cnt); + blk_sz = ntohl(aux->dat.dat_list[0].blk_sz); + STp->buffer->buffer_bytes = blk_cnt * blk_sz; + STp->buffer->read_pointer = 0; + + /* See what block size was used to write file */ + if (STp->block_size != blk_sz && blk_sz > 0) { + printk(KERN_INFO + "osst%d:I: File was written with block size %d%c, currently %d%c, adjusted to match.\n", + dev, blk_sz<1024?blk_sz:blk_sz/1024,blk_sz<1024?'b':'k', + STp->block_size<1024?STp->block_size:STp->block_size/1024, + STp->block_size<1024?'b':'k'); + STp->block_size = blk_sz; + STp->buffer->buffer_blocks = OS_DATA_SIZE / blk_sz; + } + STps->eof = ST_NOEOF; } - return 1; + STp->frame_seq_number = ntohl(aux->frame_seq_num); + STp->logical_blk_num = ntohl(aux->logical_blk_num); + return 1; + +err_out: + if (STp->read_error_frame == 0) + STp->read_error_frame = STp->first_frame_position - 1; + return 0; } /* @@ -546,7 +578,7 @@ int dbg = debugging; int dev = TAPE_NR(STp->devt); - printk(OSST_DEB_MSG "osst%d: reached onstream wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Reached onstream wait ready\n", dev); #endif memset(cmd, 0, MAX_COMMAND_SIZE); @@ -561,8 +593,8 @@ time_before(jiffies, startwait + timeout*HZ) ) { #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: Sleeping in onstream wait ready\n", dev); - printk(OSST_DEB_MSG "osst%d: Turning off debugging for a while\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Sleeping in onstream wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Turning off debugging for a while\n", dev); debugging = 0; } #endif @@ -581,12 +613,12 @@ if ( SCpnt->sense_buffer[2] && osst_write_error_recovery(STp, aSCpnt, 0) ) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Abnormal exit from onstream wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Abnormal exit from onstream wait ready\n", dev); #endif return (-EIO); } #if DEBUG - printk(OSST_DEB_MSG "osst%d: Normal exit from onstream wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Normal exit from onstream wait ready\n", dev); #endif return 0; } @@ -614,7 +646,7 @@ #if DEBUG int dev = TAPE_NR(STp->devt); - printk(OSST_DEB_MSG "osst%d: Reached onstream flush drive buffer (write filemark)\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Reached onstream flush drive buffer (write filemark)\n", dev); #endif memset(cmd, 0, MAX_COMMAND_SIZE); @@ -667,7 +699,7 @@ char notyetprinted = 1; #endif if (minlast >= 0 && STp->ps[STp->partition].rw != ST_READING) - printk(KERN_ERR "osst%i: waiting for frame without having initialized read!\n", dev); + printk(KERN_ERR "osst%i:A: waiting for frame without having initialized read!\n", dev); while (time_before (jiffies, startwait + to*HZ)) { @@ -685,7 +717,8 @@ { #if DEBUG if (jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC) - printk ("osst%i: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n", + printk (OSST_DEB_MSG + "osst%i:D: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n", dev, curr, curr+minlast, STp->first_frame_position, STp->last_frame_position, STp->cur_frames, result, (jiffies-startwait)/HZ, @@ -696,7 +729,7 @@ #if DEBUG if (jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC && notyetprinted) { - printk ("osst%i: Wait for frame %i (>%i): %i-%i %i (%i)\n", + printk (KERN_INFO "osst%i:I: Wait for frame %i (>%i): %i-%i %i (%i)\n", dev, curr, curr+minlast, STp->first_frame_position, STp->last_frame_position, STp->cur_frames, result); notyetprinted--; @@ -706,7 +739,7 @@ schedule_timeout (HZ / OSST_POLL_PER_SEC); } #if DEBUG - printk ("osst%i: Fail wait f fr %i (>%i): %i-%i %i: %3li.%li s\n", + printk (OSST_DEB_MSG "osst%i:D: Fail wait f fr %i (>%i): %i-%i %i: %3li.%li s\n", dev, curr, curr+minlast, STp->first_frame_position, STp->last_frame_position, STp->cur_frames, (jiffies-startwait)/HZ, (((jiffies-startwait)%HZ)*10)/HZ); @@ -715,9 +748,9 @@ } /* - * Read the next OnStream tape block at the current location + * Read the next OnStream tape frame at the current location */ -static int osst_read_block(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int timeout) +static int osst_read_frame(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int timeout) { unsigned char cmd[MAX_COMMAND_SIZE]; Scsi_Cmnd * SCpnt; @@ -741,7 +774,7 @@ #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%i: Reading block from OnStream tape\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Reading frame from OnStream tape\n", dev); #endif SCpnt = osst_do_scsi(*aSCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, MAX_RETRIES, TRUE); *aSCpnt = SCpnt; @@ -752,11 +785,13 @@ retval = 1; if (STp->read_error_frame == 0) { STp->read_error_frame = STp->first_frame_position; - printk(OSST_DEB_MSG "osst: recording read error at %d\n", STp->read_error_frame);/*FIXME*/ +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Recording read error at %d\n", dev, STp->read_error_frame); +#endif } #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Sense: %2x %2x %2x %2x %2x %2x %2x %2x\n", + printk(OSST_DEB_MSG "osst%d:D: Sense: %2x %2x %2x %2x %2x %2x %2x %2x\n", dev, SCpnt->sense_buffer[0], SCpnt->sense_buffer[1], SCpnt->sense_buffer[2], SCpnt->sense_buffer[3], @@ -768,16 +803,19 @@ STp->first_frame_position++; #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%i: AUX: %c%c%c%c UpdFrCt#%d %s FrSeq#%d LogBlk#%d\n", dev, + printk(OSST_DEB_MSG + "osst%d:D: AUX: %c%c%c%c UpdFrCt#%d Wpass#%d %s FrSeq#%d LogBlk#%d Qty=%d Sz=%d\n", dev, aux->application_sig[0], aux->application_sig[1], - aux->application_sig[2], aux->application_sig[3], ntohl(aux->update_frame_cntr), + aux->application_sig[2], aux->application_sig[3], + ntohl(aux->update_frame_cntr), ntohs(aux->partition.wrt_pass_cntr), aux->frame_type==1?"EOD":aux->frame_type==2?"MARK": aux->frame_type==8?"HEADR":aux->frame_type==0x80?"DATA":"FILL", - ntohl(aux->frame_seq_num), ntohl(aux->logical_blk_num) ); + ntohl(aux->frame_seq_num), ntohl(aux->logical_blk_num), + ntohs(aux->dat.dat_list[0].blk_cnt), ntohl(aux->dat.dat_list[0].blk_sz) ); if (aux->frame_type==2) - printk(OSST_DEB_MSG "osst%i: mark_cnt=%d, last_mark=%d, next_mark=%d\n", dev, - ntohl(aux->filemark_cnt), ntohl(aux->last_mark_ppos), ntohl(aux->next_mark_ppos)); - printk(OSST_DEB_MSG "osst%i: Exit read block from OnStream tape with code %d\n", dev, retval); + printk(OSST_DEB_MSG "osst%d:D: mark_cnt=%d, last_mark_ppos=%d, last_mark_lbn=%d\n", dev, + ntohl(aux->filemark_cnt), ntohl(aux->last_mark_ppos), ntohl(aux->last_mark_lbn)); + printk(OSST_DEB_MSG "osst%d:D: Exit read frame from OnStream tape with code %d\n", dev, retval); } #endif return (retval); @@ -795,22 +833,22 @@ if (STps->rw != ST_READING) { /* Initialize read operation */ if (STps->rw == ST_WRITING) { - osst_flush_write_buffer(STp, aSCpnt, 1); + osst_flush_write_buffer(STp, aSCpnt); osst_flush_drive_buffer(STp, aSCpnt); } STps->rw = ST_READING; - STp->logical_blk_in_buffer = 0; + STp->frame_in_buffer = 0; /* * Issue a read 0 command to get the OnStream drive - * read blocks into its buffer. + * read frames into its buffer. */ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = READ_6; cmd[1] = 1; #if DEBUG - printk(OSST_DEB_MSG "osst%i: Start Read Ahead on OnStream tape\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Start Read Ahead on OnStream tape\n", dev); #endif SCpnt = osst_do_scsi(*aSCpnt, STp, cmd, 0, STp->timeout, MAX_RETRIES, TRUE); *aSCpnt = SCpnt; @@ -820,7 +858,7 @@ return retval; } -static int osst_get_logical_blk(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int logical_blk_num, int quiet) +static int osst_get_logical_frame(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int frame_seq_number, int quiet) { ST_partstat * STps = &(STp->ps[STp->partition]); int dev = TAPE_NR(STp->devt); @@ -831,16 +869,16 @@ position; /* - * Search and wait for the next logical tape block + * Search and wait for the next logical tape frame */ while (1) { if (cnt++ > 400) { - printk(KERN_WARNING "osst%d: Couldn't find logical block %d, aborting\n", - dev, logical_blk_num); + printk(KERN_ERR "osst%d:E: Couldn't find logical frame %d, aborting\n", + dev, frame_seq_number); if (STp->read_error_frame) { osst_set_frame_position(STp, aSCpnt, STp->read_error_frame, 0); -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%d: Repositioning tape to bad block %d\n", +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Repositioning tape to bad frame %d\n", dev, STp->read_error_frame); #endif STp->read_error_frame = 0; @@ -849,54 +887,55 @@ } #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Looking for block %d, attempt %d\n", - dev, logical_blk_num, cnt); + printk(OSST_DEB_MSG "osst%d:D: Looking for frame %d, attempt %d\n", + dev, frame_seq_number, cnt); #endif if ( osst_initiate_read(STp, aSCpnt) - || ( (!STp->logical_blk_in_buffer) && osst_read_block(STp, aSCpnt, 30) ) ) { + || ( (!STp->frame_in_buffer) && osst_read_frame(STp, aSCpnt, 30) ) ) { position = osst_get_frame_position(STp, aSCpnt); if (position >= 0xbae && position < 0xbb8) position = 0xbb8; else if (position > STp->eod_frame_ppos || ++bad == 10) { -printk(OSST_DEB_MSG "osst%d: start again from pos %d, eod %d, bad %d\n", dev, position, STp->eod_frame_ppos, bad); /*FIXME*/ position = STp->read_error_frame - 1; } else { position += 39; cnt += 20; } -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%d: Bad block detected, positioning tape to block %d\n", +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Bad frame detected, positioning tape to frame %d\n", dev, position); #endif osst_set_frame_position(STp, aSCpnt, position, 0); continue; } - if (osst_verify_frame(STp, logical_blk_num, quiet)) + if (osst_verify_frame(STp, frame_seq_number, quiet)) break; if (osst_verify_frame(STp, -1, quiet)) { - x = ntohl(STp->buffer->aux->logical_blk_num); + x = ntohl(STp->buffer->aux->frame_seq_num); if (STp->fast_open) { -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%d: Found logical block %d instead of %d after fast open\n", - dev, x, logical_blk_num); -#endif + printk(KERN_WARNING + "osst%d:W: Found logical frame %d instead of %d after fast open\n", + dev, x, frame_seq_number); STp->header_ok = 0; STp->read_error_frame = 0; return (-EIO); } - if (x > logical_blk_num) { + if (x > frame_seq_number) { if (++past > 3) { - /* positioning backwards did not bring us to the desired block */ + /* positioning backwards did not bring us to the desired frame */ position = STp->read_error_frame - 1; } - else + else { position = osst_get_frame_position(STp, aSCpnt) - + logical_blk_num - x - 1; -#if 1 //DEBUG + + frame_seq_number - x - 1; + if (STp->first_frame_position >= 3000 && position < 3000) + position -= 10; + } +#if DEBUG printk(OSST_DEB_MSG - "osst%d: Found logical block %d while looking for %d: back up %d\n", - dev, x, logical_blk_num, + "osst%d:D: Found logical frame %d while looking for %d: back up %d\n", + dev, x, frame_seq_number, STp->first_frame_position - position); #endif osst_set_frame_position(STp, aSCpnt, position, 0); @@ -907,22 +946,26 @@ } if (osst_get_frame_position(STp, aSCpnt) == 0xbaf) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Skipping config partition\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Skipping config partition\n", dev); #endif osst_set_frame_position(STp, aSCpnt, 0xbb8, 0); cnt--; } - STp->logical_blk_in_buffer = 0; + STp->frame_in_buffer = 0; } if (cnt > 1) { STp->recover_count++; STp->recover_erreg++; + printk(KERN_WARNING "osst%d:I: Read error at position %d recovered\n", + dev, STp->read_error_frame); } - STp->logical_blk_num = ntohl(STp->buffer->aux->logical_blk_num); + STp->read_count++; #if DEBUG if (debugging || STps->eof) - printk(OSST_DEB_MSG "osst%i: Exit get logical block (%d=>%d) from OnStream tape with code %d\n", dev, logical_blk_num, STp->logical_blk_num, STps->eof); + printk(OSST_DEB_MSG + "osst%i:D: Exit get logical frame (%d=>%d) from OnStream tape with code %d\n", + dev, frame_seq_number, STp->frame_seq_number, STps->eof); #endif STp->fast_open = FALSE; STp->read_error_frame = 0; @@ -931,60 +974,196 @@ static int osst_seek_logical_blk(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int logical_blk_num) { - int estimate; - int retries = 0; - int dev = TAPE_NR(STp->devt); - + ST_partstat * STps = &(STp->ps[STp->partition]); + int dev = TAPE_NR(STp->devt); + int retries = 0; + int frame_seq_estimate, ppos_estimate, move; + if (logical_blk_num < 0) logical_blk_num = 0; - /* FIXME -- this may not be valid for foreign formats */ - if (logical_blk_num < 2980) estimate = logical_blk_num + 10; - else estimate = logical_blk_num + 20; - #if DEBUG - printk(OSST_DEB_MSG "osst%d: Seeking logical block %d (now at %d)\n", - dev, logical_blk_num, STp->logical_blk_num); -#endif + printk(OSST_DEB_MSG "osst%d:D: Seeking logical block %d (now at %d, size %d%c)\n", + dev, logical_blk_num, STp->logical_blk_num, + STp->block_size<1024?STp->block_size:STp->block_size/1024, + STp->block_size<1024?'b':'k'); +#endif + /* Do we know where we are? */ + if (STps->drv_block >= 0) { + move = logical_blk_num - STp->logical_blk_num; + if (move < 0) move -= (OS_DATA_SIZE / STp->block_size) - 1; + move /= (OS_DATA_SIZE / STp->block_size); + frame_seq_estimate = STp->frame_seq_number + move; + } else + frame_seq_estimate = logical_blk_num * STp->block_size / OS_DATA_SIZE; + + if (frame_seq_estimate < 2980) ppos_estimate = frame_seq_estimate + 10; + else ppos_estimate = frame_seq_estimate + 20; + while (++retries < 10) { - osst_set_frame_position(STp, aSCpnt, estimate, 0); - if (osst_get_logical_blk(STp, aSCpnt, logical_blk_num, 1) >= 0) - return 0; - if (osst_get_logical_blk(STp, aSCpnt, -1, 1) < 0) + if (ppos_estimate > STp->eod_frame_ppos-2) { + frame_seq_estimate += STp->eod_frame_ppos - 2 - ppos_estimate; + ppos_estimate = STp->eod_frame_ppos - 2; + } + if (frame_seq_estimate < 0) { + frame_seq_estimate = 0; + ppos_estimate = 10; + } + osst_set_frame_position(STp, aSCpnt, ppos_estimate, 0); + if (osst_get_logical_frame(STp, aSCpnt, frame_seq_estimate, 1) >= 0) { + /* we've located the estimated frame, now does it have our block? */ + if (logical_blk_num < STp->logical_blk_num || + logical_blk_num >= STp->logical_blk_num + ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt)) { + if (STps->eof == ST_FM_HIT) + move = logical_blk_num < STp->logical_blk_num? -2 : 1; + else { + move = logical_blk_num - STp->logical_blk_num; + if (move < 0) move -= (OS_DATA_SIZE / STp->block_size) - 1; + move /= (OS_DATA_SIZE / STp->block_size); + } +#if DEBUG + printk(OSST_DEB_MSG + "osst%d:D: Seek retry %d at ppos %d fsq %d (est %d) lbn %d (need %d) move %d\n", + dev, retries, ppos_estimate, STp->frame_seq_number, frame_seq_estimate, + STp->logical_blk_num, logical_blk_num, move); +#endif + frame_seq_estimate += move; + ppos_estimate += move; + continue; + } else { + STp->buffer->read_pointer = (logical_blk_num - STp->logical_blk_num) * STp->block_size; + STp->buffer->buffer_bytes -= STp->buffer->read_pointer; + STp->logical_blk_num = logical_blk_num; +#if DEBUG + printk(OSST_DEB_MSG + "osst%d:D: Seek success at ppos %d fsq %d in_buf %d, bytes %d, ptr %d*%d\n", + dev, ppos_estimate, STp->frame_seq_number, STp->frame_in_buffer, + STp->buffer->buffer_bytes, STp->buffer->read_pointer / STp->block_size, + STp->block_size); +#endif + STps->drv_file = ntohl(STp->buffer->aux->filemark_cnt); + if (STps->eof == ST_FM_HIT) { + STps->drv_file++; + STps->drv_block = 0; + } else { + STps->drv_block = ntohl(STp->buffer->aux->last_mark_lbn)? + STp->logical_blk_num - + (STps->drv_file ? ntohl(STp->buffer->aux->last_mark_lbn) + 1 : 0): + -1; + } + STps->eof = (STp->first_frame_position >= STp->eod_frame_ppos)?ST_EOD:ST_NOEOF; + return 0; + } + } + if (osst_get_logical_frame(STp, aSCpnt, -1, 1) < 0) goto error; - if (STp->logical_blk_num != logical_blk_num) - estimate += logical_blk_num - STp->logical_blk_num; + /* we are not yet at the estimated frame, adjust our estimate of its physical position */ +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Seek retry %d at ppos %d fsq %d (est %d) lbn %d (need %d)\n", + dev, retries, ppos_estimate, STp->frame_seq_number, frame_seq_estimate, + STp->logical_blk_num, logical_blk_num); +#endif + if (frame_seq_estimate != STp->frame_seq_number) + ppos_estimate += frame_seq_estimate - STp->frame_seq_number; else break; } error: - printk(KERN_WARNING "osst%d: Couldn't seek to logical block %d (at %d), %d retries\n", + printk(KERN_ERR "osst%d:E: Couldn't seek to logical block %d (at %d), %d retries\n", dev, logical_blk_num, STp->logical_blk_num, retries); return (-EIO); } -static int osst_seek_frame(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int frame) +/* The values below are based on the OnStream frame payload size of 32K == 2**15, + * that is, OSST_FRAME_SHIFT + OSST_SECTOR_SHIFT must be 15. With a minimum block + * size of 512 bytes, we need to be able to resolve 32K/512 == 64 == 2**6 positions + * inside each frame. Finaly, OSST_SECTOR_MASK == 2**OSST_FRAME_SHIFT - 1. + */ +#define OSST_FRAME_SHIFT 6 +#define OSST_SECTOR_SHIFT 9 +#define OSST_SECTOR_MASK 0x03F + +static int osst_get_sector(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt) { - ST_partstat * STps = &(STp->ps[STp->partition]); - int r; + int sector; +#if DEBUG + int dev = TAPE_NR(STp->devt); + + printk(OSST_DEB_MSG + "osst%d:D: Positioned at ppos %d, frame %d, lbn %d, file %d, blk %d, %cptr %d, eof %d\n", + dev, STp->first_frame_position, STp->frame_seq_number, STp->logical_blk_num, + STp->ps[STp->partition].drv_file, STp->ps[STp->partition].drv_block, + STp->ps[STp->partition].rw == ST_WRITING?'w':'r', + STp->ps[STp->partition].rw == ST_WRITING?STp->buffer->buffer_bytes: + STp->buffer->read_pointer, STp->ps[STp->partition].eof); +#endif + /* do we know where we are inside a file? */ + if (STp->ps[STp->partition].drv_block >= 0) { + sector = (STp->frame_in_buffer ? STp->first_frame_position-1 : + STp->first_frame_position) << OSST_FRAME_SHIFT; + if (STp->ps[STp->partition].rw == ST_WRITING) + sector |= (STp->buffer->buffer_bytes >> OSST_SECTOR_SHIFT) & OSST_SECTOR_MASK; + else + sector |= (STp->buffer->read_pointer >> OSST_SECTOR_SHIFT) & OSST_SECTOR_MASK; + } else { + sector = osst_get_frame_position(STp, aSCpnt); + if (sector > 0) + sector <<= OSST_FRAME_SHIFT; + } + return sector; +} +static int osst_seek_sector(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int sector) +{ + ST_partstat * STps = &(STp->ps[STp->partition]); + int frame = sector >> OSST_FRAME_SHIFT, + offset = (sector & OSST_SECTOR_MASK) << OSST_SECTOR_SHIFT, + r; +#if DEBUG + int dev = TAPE_NR(STp->devt); + + printk(OSST_DEB_MSG "osst%d:D: Seeking sector %d in frame %d at offset %d\n", + dev, sector, frame, offset); +#endif if (frame < 0 || frame >= STp->capacity) return (-ENXIO); if (frame <= STp->first_data_ppos) { - STp->logical_blk_num = STps->drv_file = STps->drv_block = 0; + STp->frame_seq_number = STp->logical_blk_num = STps->drv_file = STps->drv_block = 0; return (osst_set_frame_position(STp, aSCpnt, frame, 0)); } - r = osst_set_frame_position(STp, aSCpnt, frame-1, 0); + r = osst_set_frame_position(STp, aSCpnt, offset?frame:frame-1, 0); if (r < 0) return r; - r = osst_get_logical_blk(STp, aSCpnt, -1, 1); + r = osst_get_logical_frame(STp, aSCpnt, -1, 1); if (r < 0) return r; - if (osst_get_frame_position(STp, aSCpnt) != frame) return (-EIO); + if (osst_get_frame_position(STp, aSCpnt) != (offset?frame+1:frame)) return (-EIO); - STp->logical_blk_num++; - STp->logical_blk_in_buffer = 0; - STps->drv_file = htonl(STp->buffer->aux->filemark_cnt); - STps->drv_block = -1; - STps->eof = ST_NOEOF; /* FIXME test for eod */ + if (offset) { + STp->logical_blk_num += offset / STp->block_size; + STp->buffer->read_pointer = offset; + STp->buffer->buffer_bytes -= offset; + } else { + STp->frame_seq_number++; + STp->frame_in_buffer = 0; + STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); + STp->buffer->buffer_bytes = STp->buffer->read_pointer = 0; + } + STps->drv_file = ntohl(STp->buffer->aux->filemark_cnt); + if (STps->eof == ST_FM_HIT) { + STps->drv_file++; + STps->drv_block = 0; + } else { + STps->drv_block = ntohl(STp->buffer->aux->last_mark_lbn)? + STp->logical_blk_num - + (STps->drv_file ? ntohl(STp->buffer->aux->last_mark_lbn) + 1 : 0): + -1; + } + STps->eof = (STp->first_frame_position >= STp->eod_frame_ppos)?ST_EOD:ST_NOEOF; +#if DEBUG + printk(OSST_DEB_MSG + "osst%d:D: Now positioned at ppos %d, frame %d, lbn %d, file %d, blk %d, rptr %d, eof %d\n", + dev, STp->first_frame_position, STp->frame_seq_number, STp->logical_blk_num, + STps->drv_file, STps->drv_block, STp->buffer->read_pointer, STps->eof); +#endif return 0; } @@ -992,38 +1171,43 @@ * Read back the drive's internal buffer contents, as a part * of the write error recovery mechanism for old OnStream * firmware revisions. + * Precondition for this function to work: all frames in the + * drive's buffer must be of one type (DATA, MARK or EOD)! */ static int osst_read_back_buffer_and_rewrite(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, - unsigned int block, unsigned int skip, int pending) + unsigned int frame, unsigned int skip, int pending) { Scsi_Cmnd * SCpnt = * aSCpnt; unsigned char * buffer, * p; unsigned char cmd[MAX_COMMAND_SIZE]; - int frames, flag, new_block, i, logical_blk_num; - int dev = TAPE_NR(STp->devt); - long startwait = jiffies; + int flag, new_frame, i; + int nframes = STp->cur_frames; + int blks_per_frame = ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); + int frame_seq_number = ntohl(STp->buffer->aux->frame_seq_num) + - (nframes + pending - 1); + int logical_blk_num = ntohl(STp->buffer->aux->logical_blk_num) + - (nframes + pending - 1) * blks_per_frame; + int dev = TAPE_NR(STp->devt); + long startwait = jiffies; #if DEBUG - int dbg = debugging; + int dbg = debugging; #endif - frames = STp->cur_frames; - if ((buffer = (unsigned char *)vmalloc((frames + pending) * OS_DATA_SIZE)) == NULL) + if ((buffer = (unsigned char *)vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL) return (-EIO); - logical_blk_num = STp->logical_blk_num - frames - pending; - printk(KERN_INFO "osst%d: Reading back %d frames from drive buffer%s\n", - dev, frames, pending?" and one that was pending":""); - - if (pending) { - osst_copy_from_buffer(STp->buffer, (p = &buffer[frames * OS_DATA_SIZE])); -// memcpy((p = &buffer[frames * OS_DATA_SIZE]), STp->buffer->b_data, OS_DATA_SIZE); + printk(KERN_INFO "osst%d:I: Reading back %d frames from drive buffer%s\n", + dev, nframes, pending?" and one that was pending":""); + + osst_copy_from_buffer(STp->buffer, (p = &buffer[nframes * OS_DATA_SIZE])); #if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: Pending logical block %d, data %x %x %x %x\n", - dev, logical_blk_num + frames, p[0], p[1], p[2], p[3]); + if (pending && debugging) + printk(OSST_DEB_MSG "osst%d:D: Pending frame %d (lblk %d), data %02x %02x %02x %02x\n", + dev, frame_seq_number + nframes, + logical_blk_num + nframes * blks_per_frame, + p[0], p[1], p[2], p[3]); #endif - } - for (i = 0, p = buffer; i < frames; i++, p += OS_DATA_SIZE) { + for (i = 0, p = buffer; i < nframes; i++, p += OS_DATA_SIZE) { memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = 0x3C; /* Buffer Read */ @@ -1034,62 +1218,62 @@ SCpnt = osst_do_scsi(SCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, MAX_RETRIES, TRUE); if ((STp->buffer)->last_result_fatal) { - printk(KERN_ERR "osst%d: Failed to read block back from OnStream buffer\n", dev); + printk(KERN_ERR "osst%d:E: Failed to read frame back from OnStream buffer\n", dev); vfree((void *)buffer); *aSCpnt = SCpnt; return (-EIO); } osst_copy_from_buffer(STp->buffer, p); -// memcpy(p, STp->buffer->b_data, OS_DATA_SIZE); #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Read back logical block %d, data %x %x %x %x\n", - dev, logical_blk_num + i, p[0], p[1], p[2], p[3]); + printk(OSST_DEB_MSG "osst%d:D: Read back logical frame %d, data %02x %02x %02x %02x\n", + dev, frame_seq_number + i, p[0], p[1], p[2], p[3]); #endif } *aSCpnt = SCpnt; osst_get_frame_position(STp, aSCpnt); #if DEBUG - printk(OSST_DEB_MSG "osst%d: Frames left in buffer: %d\n", dev, STp->cur_frames); + printk(OSST_DEB_MSG "osst%d:D: Frames left in buffer: %d\n", dev, STp->cur_frames); #endif /* Write synchronously so we can be sure we're OK again and don't have to recover recursively */ - /* In the header we don't actually re-write the blocks that fail, just the ones after them */ + /* In the header we don't actually re-write the frames that fail, just the ones after them */ - for (flag=1, new_block=block, p=buffer, i=0; i < frames + pending; ) { + for (flag=1, new_frame=frame, p=buffer, i=0; i < nframes + pending; ) { if (flag) { if (STp->write_type == OS_WRITE_HEADER) { i += skip; p += skip * OS_DATA_SIZE; } - else if (new_block < 2990 && new_block+skip+frames+pending >= 2990) - new_block = 3000-i; + else if (new_frame < 2990 && new_frame+skip+nframes+pending >= 2990) + new_frame = 3000-i; else - new_block += skip; + new_frame += skip; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Position to frame %d, write lblk %d\n", - dev, new_block+i, logical_blk_num+i); /* FIXME var blk sz */ + printk(OSST_DEB_MSG "osst%d:D: Position to frame %d, write fseq %d\n", + dev, new_frame+i, frame_seq_number+i); #endif - osst_set_frame_position(STp, aSCpnt, new_block + i, 0); + osst_set_frame_position(STp, aSCpnt, new_frame + i, 0); osst_wait_ready(STp, aSCpnt, 60); osst_get_frame_position(STp, aSCpnt); SCpnt = * aSCpnt; - if (new_block > block + 1000) { - printk(KERN_ERR "osst%d: Failed to find valid tape media\n", dev); + if (new_frame > frame + 1000) { + printk(KERN_ERR "osst%d:E: Failed to find writable tape media\n", dev); vfree((void *)buffer); return (-EIO); } flag = 0; - if ( i >= frames + pending ) break; + if ( i >= nframes + pending ) break; } osst_copy_to_buffer(STp->buffer, p); -// memcpy(STp->buffer->b_data, p, OS_DATA_SIZE); /* * IMPORTANT: for error recovery to work, _never_ queue frames with mixed frame type! */ - osst_init_aux(STp, STp->buffer->aux->frame_type, logical_blk_num+i ); + osst_init_aux(STp, STp->buffer->aux->frame_type, frame_seq_number+i, + logical_blk_num + i*blks_per_frame, + ntohl(STp->buffer->aux->dat.dat_list[0].blk_sz), blks_per_frame); memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = WRITE_6; cmd[1] = 1; @@ -1097,7 +1281,10 @@ #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: About to attempt to write to frame %d\n", dev, new_block+i); + printk(OSST_DEB_MSG + "osst%d:D: About to write frame %d, seq %d, lbn %d, data %02x %02x %02x %02x\n", + dev, new_frame+i, frame_seq_number+i, logical_blk_num + i*blks_per_frame, + p[0], p[1], p[2], p[3]); #endif SCpnt = osst_do_scsi(SCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, MAX_WRITE_RETRIES, TRUE); @@ -1107,9 +1294,9 @@ p += OS_DATA_SIZE; i++; /* if we just sent the last frame, wait till all successfully written */ - if ( i == frames + pending ) { + if ( i == nframes + pending ) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Check re-write successful\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Check re-write successful\n", dev); #endif memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = WRITE_FILEMARKS; @@ -1118,8 +1305,8 @@ #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: Sleeping in re-write wait ready\n", dev); - printk(OSST_DEB_MSG "osst%d: Turning off debugging for a while\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Sleeping in re-write wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Turning off debugging for a while\n", dev); debugging = 0; } #endif @@ -1144,44 +1331,47 @@ } #if DEBUG debugging = dbg; - printk(OSST_DEB_MSG "osst%d: Wait re-write finished\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Wait re-write finished\n", dev); #endif } } + *aSCpnt = SCpnt; if (flag) { if ((SCpnt->sense_buffer[ 2] & 0x0f) == 13 && SCpnt->sense_buffer[12] == 0 && SCpnt->sense_buffer[13] == 2) { - printk(KERN_ERR "osst%d: Volume overflow in write error recovery\n", dev); + printk(KERN_ERR "osst%d:E: Volume overflow in write error recovery\n", dev); vfree((void *)buffer); return (-EIO); /* hit end of tape = fail */ } i = ((SCpnt->sense_buffer[3] << 24) | (SCpnt->sense_buffer[4] << 16) | (SCpnt->sense_buffer[5] << 8) | - SCpnt->sense_buffer[6] ) - new_block; + SCpnt->sense_buffer[6] ) - new_frame; p = &buffer[i * OS_DATA_SIZE]; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Additional write error at %d\n", dev, new_block+i); + printk(OSST_DEB_MSG "osst%d:D: Additional write error at %d\n", dev, new_frame+i); #endif osst_get_frame_position(STp, aSCpnt); #if DEBUG - printk(OSST_DEB_MSG "osst%d: reported frame positions: host = %d, tape = %d\n", + printk(OSST_DEB_MSG "osst%d:D: reported frame positions: host = %d, tape = %d\n", dev, STp->first_frame_position, STp->last_frame_position); #endif } - *aSCpnt = SCpnt; } + if (!pending) + osst_copy_to_buffer(STp->buffer, p); /* so buffer content == at entry in all cases */ vfree((void *)buffer); return 0; } static int osst_reposition_and_retry(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, - unsigned int block, unsigned int skip, int pending) + unsigned int frame, unsigned int skip, int pending) { unsigned char cmd[MAX_COMMAND_SIZE]; - Scsi_Cmnd * SCpnt = * aSCpnt; + Scsi_Cmnd * SCpnt; int dev = TAPE_NR(STp->devt); + int expected __attribute__ ((__unused__)); int attempts = 1000 / skip; int flag = 1; long startwait = jiffies; @@ -1194,23 +1384,24 @@ #if DEBUG debugging = dbg; #endif - if (block < 2990 && block+skip+STp->cur_frames+pending >= 2990) - block = 3000-skip; + if (frame < 2990 && frame+skip+STp->cur_frames+pending >= 2990) + frame = 3000-skip; + expected = frame+skip+STp->cur_frames+pending; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Position to frame %d, re-write from lblk %d\n", - dev, block+skip, STp->logical_blk_num-STp->cur_frames-pending); + printk(OSST_DEB_MSG "osst%d:D: Position to fppos %d, re-write from fseq %d\n", + dev, frame+skip, STp->frame_seq_number-STp->cur_frames-pending); #endif - osst_set_frame_position(STp, aSCpnt, block + skip, 1); + osst_set_frame_position(STp, aSCpnt, frame + skip, 1); flag = 0; attempts--; } if (osst_get_frame_position(STp, aSCpnt) < 0) { /* additional write error */ #if DEBUG - printk(OSST_DEB_MSG "osst%d: Addl error, host %d, tape %d, buffer %d\n", + printk(OSST_DEB_MSG "osst%d:D: Addl error, host %d, tape %d, buffer %d\n", dev, STp->first_frame_position, STp->last_frame_position, STp->cur_frames); #endif - block = STp->last_frame_position; + frame = STp->last_frame_position; flag = 1; continue; } @@ -1221,10 +1412,10 @@ cmd[1] = 1; cmd[4] = 1; #if DEBUG - printk(OSST_DEB_MSG "osst%d: About to write pending lblk %d at frame %d\n", - dev, STp->logical_blk_num-1, STp->first_frame_position); + printk(OSST_DEB_MSG "osst%d:D: About to write pending fseq %d at fppos %d\n", + dev, STp->frame_seq_number-1, STp->first_frame_position); #endif - SCpnt = osst_do_scsi(SCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, + SCpnt = osst_do_scsi(*aSCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, MAX_WRITE_RETRIES, TRUE); *aSCpnt = SCpnt; @@ -1232,8 +1423,8 @@ if ((SCpnt->sense_buffer[ 2] & 0x0f) == 13 && SCpnt->sense_buffer[12] == 0 && SCpnt->sense_buffer[13] == 2) { - printk(OSST_DEB_MSG - "osst%d: Volume overflow in write error recovery\n", + printk(KERN_ERR + "osst%d:E: Volume overflow in write error recovery\n", dev); break; /* hit end of tape = fail */ } @@ -1247,20 +1438,25 @@ if (STp->cur_frames == 0) { #if DEBUG debugging = dbg; - printk(OSST_DEB_MSG "osst%d: Wait re-write finished\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Wait re-write finished\n", dev); #endif + if (STp->first_frame_position != expected) { + printk(KERN_ERR "osst%d:A: Actual position %d - expected %d\n", + dev, STp->first_frame_position, expected); + return (-EIO); + } return 0; } #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: Sleeping in re-write wait ready\n", dev); - printk(OSST_DEB_MSG "osst%d: Turning off debugging for a while\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Sleeping in re-write wait ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Turning off debugging for a while\n", dev); debugging = 0; } #endif schedule_timeout(HZ / 10); } - printk(KERN_ERR "osst%d: Failed to find valid tape media\n", dev); + printk(KERN_ERR "osst%d:E: Failed to find valid tape media\n", dev); #if DEBUG debugging = dbg; #endif @@ -1278,7 +1474,7 @@ int dev = TAPE_NR(STp->devt); int retval = 0; int rw_state; - unsigned int block, skip; + unsigned int frame, skip; rw_state = STps->rw; @@ -1286,54 +1482,57 @@ || SCpnt->sense_buffer[12] != 12 || SCpnt->sense_buffer[13] != 0) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Write error recovery cannot handle %02x:%02x:%02x\n", + printk(OSST_DEB_MSG "osst%d:D: Write error recovery cannot handle %02x:%02x:%02x\n", dev, SCpnt->sense_buffer[ 2], SCpnt->sense_buffer[12], SCpnt->sense_buffer[13]); #endif return (-EIO); } - block = (SCpnt->sense_buffer[3] << 24) | + frame = (SCpnt->sense_buffer[3] << 24) | (SCpnt->sense_buffer[4] << 16) | (SCpnt->sense_buffer[5] << 8) | SCpnt->sense_buffer[6]; skip = SCpnt->sense_buffer[9]; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Detected physical bad block at %u, advised to skip %d\n", dev, block, skip); + printk(OSST_DEB_MSG "osst%d:D: Detected physical bad frame at %u, advised to skip %d\n", + dev, frame, skip); #endif osst_get_frame_position(STp, aSCpnt); #if DEBUG - printk(OSST_DEB_MSG "osst%d: reported frame positions: host = %d, tape = %d\n", + printk(OSST_DEB_MSG "osst%d:D: reported frame positions: host = %d, tape = %d\n", dev, STp->first_frame_position, STp->last_frame_position); #endif switch (STp->write_type) { case OS_WRITE_DATA: case OS_WRITE_EOD: case OS_WRITE_NEW_MARK: - printk(KERN_WARNING "osst%d: Relocating %d buffered logical blocks to physical block %u\n", - dev, STp->cur_frames, block + skip); + printk(KERN_WARNING + "osst%d:I: Relocating %d buffered logical frames from position %u to %u\n", + dev, STp->cur_frames, frame, (frame + skip > 3000 && frame < 3000)?3000:frame + skip); if (STp->os_fw_rev >= 10600) - retval = osst_reposition_and_retry(STp, aSCpnt, block, skip, pending); + retval = osst_reposition_and_retry(STp, aSCpnt, frame, skip, pending); else - retval = osst_read_back_buffer_and_rewrite(STp, aSCpnt, block, skip, pending); + retval = osst_read_back_buffer_and_rewrite(STp, aSCpnt, frame, skip, pending); + printk(KERN_WARNING "osst%d:I: Write error%srecovered\n", dev, retval?" not ":" "); break; case OS_WRITE_LAST_MARK: - printk(KERN_ERR "osst%d: Bad block in update last marker, fatal\n", dev); - osst_set_frame_position(STp, aSCpnt, block + STp->cur_frames + pending, 0); + printk(KERN_ERR "osst%d:E: Bad frame in update last marker, fatal\n", dev); + osst_set_frame_position(STp, aSCpnt, frame + STp->cur_frames + pending, 0); retval = -EIO; break; case OS_WRITE_HEADER: - printk(KERN_WARNING "osst%d: Bad block in header partition, skipped\n", dev); - retval = osst_read_back_buffer_and_rewrite(STp, aSCpnt, block, 1, pending); + printk(KERN_WARNING "osst%d:I: Bad frame in header partition, skipped\n", dev); + retval = osst_read_back_buffer_and_rewrite(STp, aSCpnt, frame, 1, pending); break; default: - printk(KERN_WARNING "osst%d: Bad block in filler, ignored\n", dev); - osst_set_frame_position(STp, aSCpnt, block + STp->cur_frames + pending, 0); + printk(KERN_INFO "osst%d:I: Bad frame in filler, ignored\n", dev); + osst_set_frame_position(STp, aSCpnt, frame + STp->cur_frames + pending, 0); } osst_get_frame_position(STp, aSCpnt); #if DEBUG - printk(KERN_ERR "osst%d: Positioning complete, cur_frames %d, pos %d, tape pos %d\n", + printk(OSST_DEB_MSG "osst%d:D: Positioning complete, cur_frames %d, pos %d, tape pos %d\n", dev, STp->cur_frames, STp->first_frame_position, STp->last_frame_position); - printk(OSST_DEB_MSG "osst%d: next logical block to write: %d\n", dev, STp->logical_blk_num); + printk(OSST_DEB_MSG "osst%d:D: next logical frame to write: %d\n", dev, STp->logical_blk_num); #endif if (retval == 0) { STp->recover_count++; @@ -1350,10 +1549,12 @@ int last_mark_ppos = -1; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Reached space_over_filemarks_backwards %d %d\n", dev, mt_op, mt_count); + printk(OSST_DEB_MSG "osst%d:D: Reached space_over_filemarks_backwards %d %d\n", dev, mt_op, mt_count); +#endif + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks_bwd\n", dev); #endif - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks_bwd\n", dev); return -EIO; } if (STp->linux_media_version >= 4) { @@ -1369,12 +1570,13 @@ STp->header_cache->dat_fm_tab.fm_tab_ent[cnt-1] == STp->buffer->aux->last_mark_ppos) last_mark_ppos = ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[cnt - mt_count]); -#if 1 //DEBUG +#if DEBUG if (STp->header_cache == NULL || (cnt - mt_count) < 0 || (cnt - mt_count) >= OS_FM_TAB_MAX) - printk(OSST_DEB_MSG "osst%i: Filemark lookup fail due to %s\n", dev, + printk(OSST_DEB_MSG "osst%i:D: Filemark lookup fail due to %s\n", dev, STp->header_cache == NULL?"lack of header cache":"count out of range"); else - printk(OSST_DEB_MSG "osst%i: Filemark lookup: prev mark %d (%s), skip %d to %d\n", dev, cnt, + printk(OSST_DEB_MSG "osst%i:D: Filemark lookup: prev mark %d (%s), skip %d to %d\n", + dev, cnt, ((cnt == -1 && ntohl(STp->buffer->aux->last_mark_ppos) == -1) || (STp->header_cache->dat_fm_tab.fm_tab_ent[cnt-1] == STp->buffer->aux->last_mark_ppos))?"match":"error", @@ -1382,22 +1584,28 @@ #endif if (last_mark_ppos > 10 && last_mark_ppos < STp->eod_frame_ppos) { osst_set_frame_position(STp, aSCpnt, last_mark_ppos, 0); - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks\n", dev); + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG + "osst%d:D: Couldn't get logical blk num in space_filemarks\n", dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "osst%i: Expected to find marker at block %d, not found\n", + printk(KERN_WARNING "osst%i:W: Expected to find marker at ppos %d, not found\n", dev, last_mark_ppos); return (-EIO); } if (mt_op == MTBSFM) { - STp->logical_blk_num++; - STp->logical_blk_in_buffer = 0; + STp->frame_seq_number++; + STp->frame_in_buffer = 0; + STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); } return 0; } - printk(KERN_INFO "osst%i: Reverting to scan filemark backwards\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Reverting to scan filemark backwards\n", dev); +#endif } cnt = 0; while (cnt != mt_count) { @@ -1405,22 +1613,26 @@ if (last_mark_ppos == -1) return (-EIO); #if DEBUG - printk(OSST_DEB_MSG "osst%i: Positioning to last mark at %d\n", dev, last_mark_ppos); + printk(OSST_DEB_MSG "osst%d:D: Positioning to last mark at %d\n", dev, last_mark_ppos); #endif osst_set_frame_position(STp, aSCpnt, last_mark_ppos, 0); cnt++; - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks\n", dev); + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks\n", dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "osst%i: expected to find marker at block %d, not found\n", dev, last_mark_ppos); + printk(KERN_WARNING "osst%d:W: Expected to find marker at ppos %d, not found\n", + dev, last_mark_ppos); return (-EIO); } } if (mt_op == MTBSFM) { - STp->logical_blk_num++; - STp->logical_blk_in_buffer = 0; + STp->frame_seq_number++; + STp->frame_in_buffer = 0; + STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); } return 0; } @@ -1432,30 +1644,34 @@ */ static int osst_space_over_filemarks_forward_slow(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int mt_op, int mt_count) { - int dev = TAPE_NR(STp->devt); int cnt = 0; +#if DEBUG + int dev = TAPE_NR(STp->devt); + printk(OSST_DEB_MSG "osst%d:D: Reached space_over_filemarks_forward_slow %d %d\n", dev, mt_op, mt_count); +#endif + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Reached space_over_filemarks_forward_slow %d %d\n", dev, mt_op, mt_count); + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks_fwd\n", dev); #endif - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks_fwd\n", dev); return (-EIO); } while (1) { - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks\n", dev); + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks\n", dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type == OS_FRAME_TYPE_MARKER) cnt++; if (STp->buffer->aux->frame_type == OS_FRAME_TYPE_EOD) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: space_fwd: EOD reached\n", dev); + printk(OSST_DEB_MSG "osst%d:D: space_fwd: EOD reached\n", dev); #endif if (STp->first_frame_position > STp->eod_frame_ppos+1) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: EOD position corrected (%d=>%d)\n", + printk(OSST_DEB_MSG "osst%d:D: EOD position corrected (%d=>%d)\n", dev, STp->eod_frame_ppos, STp->first_frame_position-1); #endif STp->eod_frame_ppos = STp->first_frame_position-1; @@ -1464,11 +1680,12 @@ } if (cnt == mt_count) break; - STp->logical_blk_in_buffer = 0; + STp->frame_in_buffer = 0; } if (mt_op == MTFSF) { - STp->logical_blk_num++; - STp->logical_blk_in_buffer = 0; + STp->frame_seq_number++; + STp->frame_in_buffer = 0; + STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); } return 0; } @@ -1483,10 +1700,12 @@ next_mark_ppos = -1; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Reached space_over_filemarks_forward_fast %d %d\n", dev, mt_op, mt_count); + printk(OSST_DEB_MSG "osst%d:D: Reached space_over_filemarks_forward_fast %d %d\n", dev, mt_op, mt_count); +#endif + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks_fwd\n", dev); #endif - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks_fwd\n", dev); return (-EIO); } @@ -1503,33 +1722,39 @@ (STp->header_cache->dat_fm_tab.fm_tab_ent[cnt] == STp->buffer->aux->last_mark_ppos))) next_mark_ppos = ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[cnt + mt_count]); -#if 1 //DEBUG +#if DEBUG if (STp->header_cache == NULL || (cnt + mt_count) >= OS_FM_TAB_MAX) - printk(OSST_DEB_MSG "osst%i: Filemark lookup fail due to %s\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Filemark lookup fail due to %s\n", dev, STp->header_cache == NULL?"lack of header cache":"count out of range"); else - printk(OSST_DEB_MSG "osst%i: Filemark lookup: prev mark %d (%s), skip %d to %d\n", dev, cnt, + printk(OSST_DEB_MSG "osst%d:D: Filemark lookup: prev mark %d (%s), skip %d to %d\n", + dev, cnt, ((cnt == -1 && ntohl(STp->buffer->aux->last_mark_ppos) == -1) || (STp->header_cache->dat_fm_tab.fm_tab_ent[cnt] == STp->buffer->aux->last_mark_ppos))?"match":"error", mt_count, next_mark_ppos); #endif if (next_mark_ppos <= 10 || next_mark_ppos > STp->eod_frame_ppos) { - printk(KERN_INFO "osst%i: Reverting to slow filemark space\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Reverting to slow filemark space\n", dev); +#endif return osst_space_over_filemarks_forward_slow(STp, aSCpnt, mt_op, mt_count); } else { osst_set_frame_position(STp, aSCpnt, next_mark_ppos, 0); - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks\n", dev); + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks\n", + dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "osst%i: Expected to find marker at block %d, not found\n", + printk(KERN_WARNING "osst%d:W: Expected to find marker at ppos %d, not found\n", dev, next_mark_ppos); return (-EIO); } if (ntohl(STp->buffer->aux->filemark_cnt) != cnt + mt_count) { - printk(KERN_INFO "osst%i: Expected to find marker %d at block %d, not %d\n", + printk(KERN_WARNING "osst%d:W: Expected to find marker %d at ppos %d, not %d\n", dev, cnt+mt_count, next_mark_ppos, ntohl(STp->buffer->aux->filemark_cnt)); return (-EIO); @@ -1544,24 +1769,28 @@ break; if (STp->buffer->aux->frame_type == OS_FRAME_TYPE_EOD) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: space_fwd: EOD reached\n", dev); + printk(OSST_DEB_MSG "osst%d:D: space_fwd: EOD reached\n", dev); #endif return (-EIO); } if (ntohl(STp->buffer->aux->filemark_cnt) == 0) { if (STp->first_mark_ppos == -1) { - printk(KERN_INFO "osst%i: Reverting to slow filemark space\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Reverting to slow filemark space\n", dev); +#endif return osst_space_over_filemarks_forward_slow(STp, aSCpnt, mt_op, mt_count); } osst_set_frame_position(STp, aSCpnt, STp->first_mark_ppos, 0); - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO - "osst%i: Couldn't get logical blk num in space_filemarks_fwd_fast\n", + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG + "osst%d:D: Couldn't get logical blk num in space_filemarks_fwd_fast\n", dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "osst%i: Expected to find filemark at %d\n", + printk(KERN_WARNING "osst%d:W: Expected to find filemark at %d\n", dev, STp->first_mark_ppos); return (-EIO); } @@ -1575,28 +1804,35 @@ while (cnt != mt_count) { next_mark_ppos = ntohl(STp->buffer->aux->next_mark_ppos); if (!next_mark_ppos || next_mark_ppos > STp->eod_frame_ppos) { - printk(KERN_INFO "osst%i: Reverting to slow filemark space\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Reverting to slow filemark space\n", dev); +#endif return osst_space_over_filemarks_forward_slow(STp, aSCpnt, mt_op, mt_count - cnt); } #if DEBUG - else printk(OSST_DEB_MSG "osst%i: Positioning to next mark at %d\n", dev, next_mark_ppos); + else printk(OSST_DEB_MSG "osst%d:D: Positioning to next mark at %d\n", dev, next_mark_ppos); #endif osst_set_frame_position(STp, aSCpnt, next_mark_ppos, 0); cnt++; - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { - printk(KERN_INFO "osst%i: Couldn't get logical blk num in space_filemarks\n", dev); + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in space_filemarks\n", + dev); +#endif return (-EIO); } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "osst%i: Expected to find marker at block %d, not found\n", + printk(KERN_WARNING "osst%d:W: Expected to find marker at ppos %d, not found\n", dev, next_mark_ppos); return (-EIO); } } } - if (mt_op == MTFSF) - STp->logical_blk_num++; - STp->logical_blk_in_buffer = 0; + if (mt_op == MTFSF) { + STp->frame_seq_number++; + STp->frame_in_buffer = 0; + STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt); + } return 0; } @@ -1626,75 +1862,22 @@ (STp->buffer)->b_data[MODE_HEADER_LENGTH + 3] = retries; if (debugging) - printk(OSST_DEB_MSG "osst%i: Setting number of retries on OnStream tape to %d\n", dev, retries); + printk(OSST_DEB_MSG "osst%d:D: Setting number of retries on OnStream tape to %d\n", dev, retries); SCpnt = osst_do_scsi(SCpnt, STp, cmd, cmd[4], STp->timeout, 0, TRUE); *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal) - printk (KERN_ERR "osst%d: Couldn't set retries to %d\n", dev, retries); + printk (KERN_ERR "osst%d:D: Couldn't set retries to %d\n", dev, retries); } #endif -#if 0 -static void osst_update_markers(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int last_mark_ppos, int this_mark_ppos) -{ - int dev = TAPE_NR(STp->devt); - int frame, - reslt; - - if (STp->raw) return; - - STp->last_mark_ppos = this_mark_ppos; - if (STp->header_cache != NULL && STp->filemark_cnt < OS_FM_TAB_MAX) - STp->header_cache->dat_fm_tab.fm_tab_ent[STp->filemark_cnt] = htonl(this_mark_ppos); - if (STp->filemark_cnt++ == 0) - STp->first_mark_ppos = this_mark_ppos; - - if (STp->linux_media_version >= 4) return; - if (last_mark_ppos == -1) return; - - STp->write_type = OS_WRITE_LAST_MARK; - frame = osst_get_frame_position(STp, aSCpnt); -#if DEBUG - printk(OSST_DEB_MSG "osst%i: Update last_marker at frame %d\n", dev, last_mark_ppos); - printk(OSST_DEB_MSG "osst%i: current position %d, lblk %d, tape blk %d\n", - dev, frame, STp->logical_blk_num, STp->last_frame_position); -#endif - osst_set_frame_position(STp, aSCpnt, last_mark_ppos, 0); - osst_initiate_read (STp, aSCpnt); - reslt = osst_read_block(STp, aSCpnt, 180); - - if (reslt) { - printk(KERN_WARNING "osst%i: couldn't read last marker\n", dev); - osst_set_frame_position(STp, aSCpnt, frame, 0); - return; - } - if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_WARNING "osst%i: expected marker at addr %d\n", dev, last_mark_ppos); - osst_set_frame_position(STp, aSCpnt, frame, 0); - return; - } -#if DEBUG - printk(OSST_DEB_MSG "osst%i: writing back marker\n", dev); -#endif - STp->buffer->aux->next_mark_ppos = htonl(this_mark_ppos); - osst_set_frame_position(STp, aSCpnt, last_mark_ppos, 0); - STp->dirty = 1; - if (osst_flush_write_buffer(STp, aSCpnt, 0) || - osst_flush_drive_buffer(STp, aSCpnt) ) { - printk(KERN_WARNING "osst%i: couldn't write marker back at addr %d\n", dev, last_mark_ppos); - } - osst_set_frame_position(STp, aSCpnt, frame, 0); - - return; /* FIXME -- errors should go back to user space */ -} -#endif static int osst_write_filemark(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt) { int result; - int this_mark_ppos; + int this_mark_ppos = STp->first_frame_position; + int this_mark_lbn = STp->logical_blk_num; #if DEBUG int dev = TAPE_NR(STp->devt); #endif @@ -1702,22 +1885,20 @@ if (STp->raw) return 0; STp->write_type = OS_WRITE_NEW_MARK; - this_mark_ppos = osst_get_frame_position(STp, aSCpnt); #if DEBUG - printk(OSST_DEB_MSG "osst%i: Writing Filemark %i at frame %d (lblk %d)\n", - dev, STp->filemark_cnt, this_mark_ppos, STp->logical_blk_num); + printk(OSST_DEB_MSG "osst%d:D: Writing Filemark %i at fppos %d (fseq %d, lblk %d)\n", + dev, STp->filemark_cnt, this_mark_ppos, STp->frame_seq_number, this_mark_lbn); #endif - osst_init_aux(STp, OS_FRAME_TYPE_MARKER, STp->logical_blk_num++); STp->dirty = 1; - result = osst_flush_write_buffer(STp, aSCpnt, 0); + result = osst_flush_write_buffer(STp, aSCpnt); result |= osst_flush_drive_buffer(STp, aSCpnt); -//printk(OSST_DEB_MSG "osst%d: Finished writing file\n",TAPE_NR(STp->devt)); + STp->last_mark_ppos = this_mark_ppos; + STp->last_mark_lbn = this_mark_lbn; if (STp->header_cache != NULL && STp->filemark_cnt < OS_FM_TAB_MAX) STp->header_cache->dat_fm_tab.fm_tab_ent[STp->filemark_cnt] = htonl(this_mark_ppos); if (STp->filemark_cnt++ == 0) STp->first_mark_ppos = this_mark_ppos; -// osst_update_markers(STp, aSCpnt, STp->last_mark_ppos, this_mark_ppos); return result; } @@ -1731,70 +1912,67 @@ if (STp->raw) return 0; STp->write_type = OS_WRITE_EOD; - STp->eod_frame_ppos = osst_get_frame_position(STp, aSCpnt); + STp->eod_frame_ppos = STp->first_frame_position; #if DEBUG - printk(OSST_DEB_MSG "osst%i: Writing EOD at %d=>%d\n", dev, STp->logical_blk_num, STp->eod_frame_ppos); + printk(OSST_DEB_MSG "osst%d:D: Writing EOD at fppos %d (fseq %d, lblk %d)\n", dev, + STp->eod_frame_ppos, STp->frame_seq_number, STp->logical_blk_num); #endif - osst_init_aux(STp, OS_FRAME_TYPE_EOD, STp->logical_blk_num++); STp->dirty = 1; - result = osst_flush_write_buffer(STp, aSCpnt, 0); + result = osst_flush_write_buffer(STp, aSCpnt); result |= osst_flush_drive_buffer(STp, aSCpnt); - STp->eod_frame_lfa = --(STp->logical_blk_num); + STp->eod_frame_lfa = --(STp->frame_seq_number); return result; } -static int osst_write_filler(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int block, int count) +static int osst_write_filler(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int where, int count) { int dev = TAPE_NR(STp->devt); #if DEBUG - printk(OSST_DEB_MSG "osst%i: Reached onstream write filler group %d\n", dev, block); + printk(OSST_DEB_MSG "osst%d:D: Reached onstream write filler group %d\n", dev, where); #endif osst_wait_ready(STp, aSCpnt, 60 * 5); - osst_set_frame_position(STp, aSCpnt, block, 0); + osst_set_frame_position(STp, aSCpnt, where, 0); STp->write_type = OS_WRITE_FILLER; - osst_init_aux(STp, OS_FRAME_TYPE_FILL, 0); while (count--) { memcpy(STp->buffer->b_data, "Filler", 6); STp->buffer->buffer_bytes = 6; STp->dirty = 1; - if (osst_flush_write_buffer(STp, aSCpnt, 0)) { - printk(KERN_INFO "osst%i: Couldn't write filler frame\n", dev); + if (osst_flush_write_buffer(STp, aSCpnt)) { + printk(KERN_INFO "osst%i:I: Couldn't write filler frame\n", dev); return (-EIO); } } #if DEBUG - printk(OSST_DEB_MSG "osst%i: Exiting onstream write filler group\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Exiting onstream write filler group\n", dev); #endif return osst_flush_drive_buffer(STp, aSCpnt); } -static int __osst_write_header(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int block, int count) +static int __osst_write_header(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int where, int count) { int dev = TAPE_NR(STp->devt); int result; #if DEBUG - printk(OSST_DEB_MSG "osst%i: Reached onstream write header group %d\n", dev, block); + printk(OSST_DEB_MSG "osst%d:D: Reached onstream write header group %d\n", dev, where); #endif osst_wait_ready(STp, aSCpnt, 60 * 5); - osst_set_frame_position(STp, aSCpnt, block, 0); + osst_set_frame_position(STp, aSCpnt, where, 0); STp->write_type = OS_WRITE_HEADER; - osst_init_aux(STp, OS_FRAME_TYPE_HEADER, STp->logical_blk_num); while (count--) { osst_copy_to_buffer(STp->buffer, (unsigned char *)STp->header_cache); -// memcpy(STp->buffer->b_data, STp->header_cache, sizeof(os_header_t)); STp->buffer->buffer_bytes = sizeof(os_header_t); STp->dirty = 1; - if (osst_flush_write_buffer(STp, aSCpnt, 0)) { - printk(KERN_INFO "osst%i: Couldn't write header frame\n", dev); + if (osst_flush_write_buffer(STp, aSCpnt)) { + printk(KERN_INFO "osst%i:I: Couldn't write header frame\n", dev); return (-EIO); } } result = osst_flush_drive_buffer(STp, aSCpnt); #if DEBUG - printk(OSST_DEB_MSG "osst%i: Write onstream header group %s\n", dev, result?"failed":"done"); + printk(OSST_DEB_MSG "osst%d:D: Write onstream header group %s\n", dev, result?"failed":"done"); #endif return result; } @@ -1806,18 +1984,18 @@ int dev = TAPE_NR(STp->devt); #if DEBUG - printk(OSST_DEB_MSG "osst%i: Writing tape header\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Writing tape header\n", dev); #endif if (STp->raw) return 0; if (STp->header_cache == NULL) { if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { - printk(KERN_ERR "osst%i: Failed to allocate header cache\n", dev); + printk(KERN_ERR "osst%i:E: Failed to allocate header cache\n", dev); return (-ENOMEM); } memset(STp->header_cache, 0, sizeof(os_header_t)); #if DEBUG - printk(OSST_DEB_MSG "osst%d: Allocated and cleared memory for header cache\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Allocated and cleared memory for header cache\n", dev); #endif } if (STp->header_ok) STp->update_frame_cntr++; @@ -1858,12 +2036,12 @@ if (locate_eod) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: locating back to eod frame addr %d\n", dev, STp->eod_frame_ppos); + printk(OSST_DEB_MSG "osst%d:D: Locating back to eod frame addr %d\n", dev, STp->eod_frame_ppos); #endif osst_set_frame_position(STp, aSCpnt, STp->eod_frame_ppos, 0); } if (reslt) - printk(KERN_WARNING "osst%i: write header failed\n", dev); + printk(KERN_ERR "osst%d:E: Write header failed\n", dev); else { memcpy(STp->application_sig, "LIN4", 4); STp->linux_media = 1; @@ -1878,15 +2056,15 @@ if (STp->header_cache != NULL) memset(STp->header_cache, 0, sizeof(os_header_t)); - STp->logical_blk_num = 0; - STp->logical_blk_in_buffer = 0; + STp->logical_blk_num = STp->frame_seq_number = 0; + STp->frame_in_buffer = 0; STp->eod_frame_ppos = STp->first_data_ppos = 0x0000000A; STp->filemark_cnt = 0; - STp->first_mark_ppos = STp->last_mark_ppos = -1; + STp->first_mark_ppos = STp->last_mark_ppos = STp->last_mark_lbn = -1; return osst_write_header(STp, aSCpnt, 1); } -static int __osst_analyze_headers(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int block) +static int __osst_analyze_headers(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int ppos) { int dev = TAPE_NR(STp->devt); os_header_t * header; @@ -1898,17 +2076,17 @@ if (STp->raw) return 1; - if (block == 5 || block == 0xbae || STp->buffer->last_result_fatal) { - if (osst_set_frame_position(STp, aSCpnt, block, 0)) - printk(KERN_WARNING "osst%i: Couldn't position tape\n", dev); + if (ppos == 5 || ppos == 0xbae || STp->buffer->last_result_fatal) { + if (osst_set_frame_position(STp, aSCpnt, ppos, 0)) + printk(KERN_WARNING "osst%i:W: Couldn't position tape\n", dev); if (osst_initiate_read (STp, aSCpnt)) { - printk(KERN_WARNING "osst%i: Couldn't initiate read\n", dev); + printk(KERN_WARNING "osst%i:W: Couldn't initiate read\n", dev); return 0; } } - if (osst_read_block(STp, aSCpnt, 180)) { + if (osst_read_frame(STp, aSCpnt, 180)) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Couldn't read header frame\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Couldn't read header frame\n", dev); #endif return 0; } @@ -1916,7 +2094,20 @@ aux = STp->buffer->aux; if (aux->frame_type != OS_FRAME_TYPE_HEADER) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Skipping non-header frame (%d)\n", dev, block); + printk(OSST_DEB_MSG "osst%d:D: Skipping non-header frame (%d)\n", dev, ppos); +#endif + return 0; + } + if (ntohl(aux->frame_seq_num) != 0 || + ntohl(aux->logical_blk_num) != 0 || + aux->partition.partition_num != OS_CONFIG_PARTITION || + ntohl(aux->partition.first_frame_ppos) != 0 || + ntohl(aux->partition.last_frame_ppos) != 0xbb7 ) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Invalid header frame (%d,%d,%d,%d,%d)\n", dev, + ntohl(aux->frame_seq_num), ntohl(aux->logical_blk_num), + aux->partition.partition_num, ntohl(aux->partition.first_frame_ppos), + ntohl(aux->partition.last_frame_ppos)); #endif return 0; } @@ -1924,51 +2115,57 @@ strncmp(header->ident_str, "ADR-SEQ", 7) != 0) { strncpy(id_string, header->ident_str, 7); id_string[7] = 0; - printk(KERN_INFO "osst%i: Invalid header identification string %s\n", dev, id_string); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Invalid header identification string %s\n", dev, id_string); +#endif return 0; } update_frame_cntr = ntohl(aux->update_frame_cntr); if (update_frame_cntr < STp->update_frame_cntr) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Skipping frame %d with update_frame_counter %d<%d\n", - dev, block, update_frame_cntr, STp->update_frame_cntr); + printk(OSST_DEB_MSG "osst%d:D: Skipping frame %d with update_frame_counter %d<%d\n", + dev, ppos, update_frame_cntr, STp->update_frame_cntr); #endif return 0; } if (header->major_rev != 1 || header->minor_rev != 4 ) { - printk(KERN_INFO "osst%i: %s revision %d.%d detected (1.4 supported)\n", +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: %s revision %d.%d detected (1.4 supported)\n", dev, (header->major_rev != 1 || header->minor_rev < 2 || header->minor_rev > 4 )? "Invalid" : "Warning:", header->major_rev, header->minor_rev); +#endif if (header->major_rev != 1 || header->minor_rev < 2 || header->minor_rev > 4) return 0; } +#if DEBUG if (header->pt_par_num != 1) - printk(KERN_INFO "osst%i: Warning: %d partitions defined, only one supported\n", + printk(KERN_INFO "osst%i:W: %d partitions defined, only one supported\n", dev, header->pt_par_num); +#endif memcpy(id_string, aux->application_sig, 4); id_string[4] = 0; if (memcmp(id_string, "LIN", 3) == 0) { STp->linux_media = 1; linux_media_version = id_string[3] - '0'; if (linux_media_version != 4) - printk(KERN_INFO "osst%i: Linux media version %d detected (current 4)\n", + printk(KERN_INFO "osst%i:I: Linux media version %d detected (current 4)\n", dev, linux_media_version); } else { - printk(KERN_WARNING "osst%i: non Linux media detected (%s)\n", dev, id_string); + printk(KERN_WARNING "osst%i:W: Non Linux media detected (%s)\n", dev, id_string); return 0; } if (linux_media_version < STp->linux_media_version) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Skipping frame %d with linux_media_version %d\n", - dev, block, linux_media_version); + printk(OSST_DEB_MSG "osst%d:D: Skipping frame %d with linux_media_version %d\n", + dev, ppos, linux_media_version); #endif return 0; } if (linux_media_version > STp->linux_media_version) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Frame %d sets linux_media_version to %d\n", - dev, block, linux_media_version); + printk(OSST_DEB_MSG "osst%d:D: Frame %d sets linux_media_version to %d\n", + dev, ppos, linux_media_version); #endif memcpy(STp->application_sig, id_string, 5); STp->linux_media_version = linux_media_version; @@ -1976,16 +2173,16 @@ } if (update_frame_cntr > STp->update_frame_cntr) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Frame %d sets update_frame_counter to %d\n", - dev, block, update_frame_cntr); + printk(OSST_DEB_MSG "osst%d:D: Frame %d sets update_frame_counter to %d\n", + dev, ppos, update_frame_cntr); #endif if (STp->header_cache == NULL) { if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { - printk(KERN_ERR "osst%i: Failed to allocate header cache\n", dev); + printk(KERN_ERR "osst%i:E: Failed to allocate header cache\n", dev); return 0; } #if DEBUG - printk(OSST_DEB_MSG "osst%d: Allocated memory for header cache\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Allocated memory for header cache\n", dev); #endif } osst_copy_from_buffer(STp->buffer, (unsigned char *)STp->header_cache); @@ -1998,19 +2195,22 @@ STp->filemark_cnt = ntohl(aux->filemark_cnt); STp->first_mark_ppos = ntohl(aux->next_mark_ppos); STp->last_mark_ppos = ntohl(aux->last_mark_ppos); + STp->last_mark_lbn = ntohl(aux->last_mark_lbn); STp->update_frame_cntr = update_frame_cntr; #if DEBUG - printk(OSST_DEB_MSG "osst%i: detected write pass %d, update frame counter %d, filemark counter %d\n", + printk(OSST_DEB_MSG "osst%d:D: Detected write pass %d, update frame counter %d, filemark counter %d\n", dev, STp->wrt_pass_cntr, STp->update_frame_cntr, STp->filemark_cnt); - printk(OSST_DEB_MSG "osst%i: first data frame on tape = %d, last = %d, eod frame = %d\n", dev, + printk(OSST_DEB_MSG "osst%d:D: first data frame on tape = %d, last = %d, eod frame = %d\n", dev, STp->first_data_ppos, ntohl(header->partition[0].last_frame_ppos), ntohl(header->partition[0].eod_frame_ppos)); - printk(OSST_DEB_MSG "osst%i: first mark on tape = %d, last = %d, eod frame = %d\n", + printk(OSST_DEB_MSG "osst%d:D: first mark on tape = %d, last = %d, eod frame = %d\n", dev, STp->first_mark_ppos, STp->last_mark_ppos, STp->eod_frame_ppos); #endif if (header->minor_rev < 4 && STp->linux_media_version == 4) { - printk(OSST_DEB_MSG "osst%i: Moving filemark list to ADR 1.4 location\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%i:D: Moving filemark list to ADR 1.4 location\n", dev); +#endif memcpy((void *)header->dat_fm_tab.fm_tab_ent, (void *)header->old_filemark_list, sizeof(header->dat_fm_tab.fm_tab_ent)); memset((void *)header->old_filemark_list, 0, sizeof(header->old_filemark_list)); @@ -2034,9 +2234,8 @@ header->dat_fm_tab.fm_tab_ent_sz != 4 || header->dat_fm_tab.fm_tab_ent_cnt != htons(STp->filemark_cntfilemark_cnt:OS_FM_TAB_MAX))) - printk(KERN_WARNING "osst%i: Failed consistency check ADR 1.4 format\n", dev); + printk(KERN_WARNING "osst%i:W: Failed consistency check ADR 1.4 format\n", dev); -// memcpy(STp->header_cache, header, sizeof(os_header_t)); } return 1; @@ -2044,7 +2243,7 @@ static int osst_analyze_headers(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt) { - int position, block; + int position, ppos; int first, last; int valid = 0; int dev = TAPE_NR(STp->devt); @@ -2059,37 +2258,37 @@ STp->header_ok = STp->linux_media = STp->linux_media_version = 0; STp->wrt_pass_cntr = STp->update_frame_cntr = -1; STp->eod_frame_ppos = STp->first_data_ppos = -1; - STp->first_mark_ppos = STp->last_mark_ppos = -1; + STp->first_mark_ppos = STp->last_mark_ppos = STp->last_mark_lbn = -1; #if DEBUG - printk(OSST_DEB_MSG "osst%i: Reading header\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Reading header\n", dev); #endif - /* optimization for speed - if we are positioned at block 10, read second group first */ + /* optimization for speed - if we are positioned at ppos 10, read second group first */ /* TODO try the ADR 1.1 locations for the second group if we have no valid one yet... */ first = position==10?0xbae: 5; last = position==10?0xbb3:10; - for (block = first; block < last; block++) - if (__osst_analyze_headers(STp, aSCpnt, block)) + for (ppos = first; ppos < last; ppos++) + if (__osst_analyze_headers(STp, aSCpnt, ppos)) valid = 1; first = position==10? 5:0xbae; last = position==10?10:0xbb3; - for (block = first; block < last; block++) - if (__osst_analyze_headers(STp, aSCpnt, block)) + for (ppos = first; ppos < last; ppos++) + if (__osst_analyze_headers(STp, aSCpnt, ppos)) valid = 1; if (!valid) { - printk(KERN_ERR "osst%i: Failed to find valid ADRL header, new media?\n", dev); + printk(KERN_ERR "osst%i:E: Failed to find valid ADRL header, new media?\n", dev); STp->eod_frame_ppos = STp->first_data_ppos = 0; osst_set_frame_position(STp, aSCpnt, 10, 0); return 0; } if (position <= STp->first_data_ppos) { position = STp->first_data_ppos; - STp->ps[0].drv_file = STp->ps[0].drv_block = STp->logical_blk_num = 0; + STp->ps[0].drv_file = STp->ps[0].drv_block = STp->frame_seq_number = STp->logical_blk_num = 0; } osst_set_frame_position(STp, aSCpnt, position, 0); STp->header_ok = 1; @@ -2100,18 +2299,21 @@ static int osst_verify_position(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt) { int frame_position = STp->first_frame_position; + int frame_seq_numbr = STp->frame_seq_number; int logical_blk_num = STp->logical_blk_num; + int halfway_frame = STp->frame_in_buffer; + int read_pointer = STp->buffer->read_pointer; int prev_mark_ppos = -1; int actual_mark_ppos, i, n; -#if 1 //DEBUG +#if DEBUG int dev = TAPE_NR(STp->devt); - printk(OSST_DEB_MSG "osst%i: Verify that the tape is really the one we think before writing\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Verify that the tape is really the one we think before writing\n", dev); #endif osst_set_frame_position(STp, aSCpnt, frame_position - 1, 0); - if (osst_get_logical_blk(STp, aSCpnt, -1, 0) < 0) { + if (osst_get_logical_frame(STp, aSCpnt, -1, 0) < 0) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Couldn't get logical blk num in verify_position\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Couldn't get logical blk num in verify_position\n", dev); #endif return (-EIO); } @@ -2123,42 +2325,48 @@ prev_mark_ppos = frame_position - 1; /* usually - we don't really know */ actual_mark_ppos = STp->buffer->aux->frame_type == OS_FRAME_TYPE_MARKER ? frame_position - 1 : ntohl(STp->buffer->aux->last_mark_ppos); - if (frame_position != STp->first_frame_position || - logical_blk_num != STp->logical_blk_num + 1 || - prev_mark_ppos != actual_mark_ppos ) { -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%i: Block mismatch: frame %d-%d, lblk %d-%d, mark %d-%d\n", dev, - STp->first_frame_position, frame_position, STp->logical_blk_num + 1, - logical_blk_num, actual_mark_ppos, prev_mark_ppos); + if (frame_position != STp->first_frame_position || + frame_seq_numbr != STp->frame_seq_number + (halfway_frame?0:1) || + prev_mark_ppos != actual_mark_ppos ) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Block mismatch: fppos %d-%d, fseq %d-%d, mark %d-%d\n", dev, + STp->first_frame_position, frame_position, + STp->frame_seq_number + (halfway_frame?0:1), + frame_seq_numbr, actual_mark_ppos, prev_mark_ppos); #endif return (-EIO); } - STp->logical_blk_in_buffer = 0; - STp->logical_blk_num = logical_blk_num; + if (halfway_frame) { + /* prepare buffer for append and rewrite on top of original */ + osst_set_frame_position(STp, aSCpnt, frame_position - 1, 0); + STp->buffer->buffer_bytes = read_pointer; + STp->ps[STp->partition].rw = ST_WRITING; + STp->dirty = 1; + } + STp->frame_in_buffer = halfway_frame; + STp->frame_seq_number = frame_seq_numbr; + STp->logical_blk_num = logical_blk_num; return 0; } /* Acc. to OnStream, the vers. numbering is the following: * X.XX for released versions (X=digit), * XXXY for unreleased versions (Y=letter) - * Ordering 1.05 < 106A < 106a < 106B < ... < 1.06 + * Ordering 1.05 < 106A < 106B < ... < 106a < ... < 1.06 * This fn makes monoton numbers out of this scheme ... */ static unsigned int osst_parse_firmware_rev (const char * str) { - unsigned int rev; if (str[1] == '.') { - rev = (str[0]-0x30)*10000 - +(str[2]-0x30)*1000 - +(str[3]-0x30)*100; + return (str[0]-'0')*10000 + +(str[2]-'0')*1000 + +(str[3]-'0')*100; } else { - rev = (str[0]-0x30)*10000 - +(str[1]-0x30)*1000 - +(str[2]-0x30)*100 - 100; - rev += 2*(str[3] & 0x1f) - +(str[3] >= 0x60? 1: 0); + return (str[0]-'0')*10000 + +(str[1]-'0')*1000 + +(str[2]-'0')*100 - 100 + +(str[3]-'@'); } - return rev; } /* @@ -2166,9 +2374,9 @@ */ static int osst_configure_onstream(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt) { - int dev = TAPE_NR(STp->devt); unsigned char cmd[MAX_COMMAND_SIZE]; - Scsi_Cmnd * SCpnt = * aSCpnt; + int dev = TAPE_NR(STp->devt); + Scsi_Cmnd * SCpnt = * aSCpnt; osst_mode_parameter_header_t * header; osst_block_size_page_t * bs; osst_capabilities_page_t * cp; @@ -2177,21 +2385,19 @@ if (STp->ready != ST_READY) { #if DEBUG - printk(OSST_DEB_MSG "osst%i: Not Ready\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Not Ready\n", dev); #endif return (-EIO); } if (STp->os_fw_rev < 10600) { - printk("osst%i: Old OnStream firmware revision detected (%s)\n", - dev, STp->device->rev); - printk("osst%i: An upgrade to version 1.06 or above is recommended\n", - dev); + printk(KERN_INFO "osst%i:I: Old OnStream firmware revision detected (%s),\n", dev, STp->device->rev); + printk(KERN_INFO "osst%d:I: an upgrade to version 1.06 or above is recommended\n", dev); } /* * Configure 32.5KB (data+aux) frame size. - * Get the current block size from the block size mode page + * Get the current frame size from the block size mode page */ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = MODE_SENSE; @@ -2202,13 +2408,13 @@ SCpnt = osst_do_scsi(SCpnt, STp, cmd, cmd[4], STp->timeout, 0, TRUE); if (SCpnt == NULL) { #if DEBUG - printk(OSST_DEB_MSG "osst: Busy\n"); + printk(OSST_DEB_MSG "osst :D: Busy\n"); #endif return (-EBUSY); } *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal != 0) { - printk (KERN_ERR "osst%i: Can't get tape block size mode page\n", dev); + printk (KERN_ERR "osst%d:E: Can't get tape block size mode page\n", dev); return (-EIO); } @@ -2216,10 +2422,10 @@ bs = (osst_block_size_page_t *) ((STp->buffer)->b_data + sizeof(osst_mode_parameter_header_t) + header->bdl); #if DEBUG - printk(KERN_INFO "osst%i: 32KB play back: %s\n", dev, bs->play32 ? "Yes" : "No"); - printk(KERN_INFO "osst%i: 32.5KB play back: %s\n", dev, bs->play32_5 ? "Yes" : "No"); - printk(KERN_INFO "osst%i: 32KB record: %s\n", dev, bs->record32 ? "Yes" : "No"); - printk(KERN_INFO "osst%i: 32.5KB record: %s\n", dev, bs->record32_5 ? "Yes" : "No"); + printk(OSST_DEB_MSG "osst%d:D: 32KB play back: %s\n", dev, bs->play32 ? "Yes" : "No"); + printk(OSST_DEB_MSG "osst%d:D: 32.5KB play back: %s\n", dev, bs->play32_5 ? "Yes" : "No"); + printk(OSST_DEB_MSG "osst%d:D: 32KB record: %s\n", dev, bs->record32 ? "Yes" : "No"); + printk(OSST_DEB_MSG "osst%d:D: 32.5KB record: %s\n", dev, bs->record32_5 ? "Yes" : "No"); #endif /* @@ -2239,16 +2445,12 @@ SCpnt = osst_do_scsi(SCpnt, STp, cmd, cmd[4], STp->timeout, 0, TRUE); *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal != 0) { - printk (KERN_ERR "osst%i: Couldn't set tape block size mode page\n", dev); + printk (KERN_ERR "osst%d:E: Couldn't set tape block size mode page\n", dev); return (-EIO); } - STp->block_size = (STp->raw) ? OS_FRAME_SIZE : OS_DATA_SIZE; - STp->min_block = OS_FRAME_SIZE; /* FIXME */ - STp->max_block = STp->block_size; - #if DEBUG - printk(KERN_INFO "osst%i: Block Size changed to 32.5K\n", dev); + printk(KERN_INFO "osst%d:D: Block Size changed to 32.5K\n", dev); /* * In debug mode, we want to see as many errors as possible * to test the error recovery mechanism. @@ -2284,7 +2486,7 @@ *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal != 0) { - printk (KERN_ERR "osst%i: Couldn't set vendor name to %s\n", dev, + printk (KERN_ERR "osst%d:E: Couldn't set vendor name to %s\n", dev, (char *) ((STp->buffer)->b_data + MODE_HEADER_LENGTH + 2)); return (-EIO); } @@ -2299,7 +2501,7 @@ *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal != 0) { - printk (KERN_ERR "osst%i: can't get capabilities page\n", dev); + printk (KERN_ERR "osst%d:E: Can't get capabilities page\n", dev); return (-EIO); } @@ -2319,7 +2521,7 @@ *aSCpnt = SCpnt; if ((STp->buffer)->last_result_fatal != 0) { - printk (KERN_ERR "osst%i: can't get tape parameter page\n", dev); + printk (KERN_ERR "osst%d:E: Can't get tape parameter page\n", dev); return (-EIO); } @@ -2330,7 +2532,7 @@ STp->density = prm->density; STp->capacity = ntohs(prm->segtrk) * ntohs(prm->trks); #if DEBUG - printk(OSST_DEB_MSG "osst%d: Density %d, tape length: %dMB, drive buffer size: %dKB\n", + printk(OSST_DEB_MSG "osst%d:D: Density %d, tape length: %dMB, drive buffer size: %dKB\n", dev, STp->density, STp->capacity / 32, drive_buffer_size); #endif @@ -2348,7 +2550,7 @@ #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Stepping over filemark %s.\n", + printk(OSST_DEB_MSG "osst%d:D: Stepping over filemark %s.\n", dev, forward ? "forward" : "backward"); #endif @@ -2361,7 +2563,7 @@ result = osst_seek_logical_blk(STp, aSCpnt, STp->logical_blk_num - 1); if (result < 0) - printk(KERN_ERR "osst%d: Stepping over filemark %s failed.\n", + printk(KERN_WARNING "osst%d:W: Stepping over filemark %s failed.\n", dev, forward ? "forward" : "backward"); return result; @@ -2401,7 +2603,7 @@ result = ((SCpnt->sense_buffer[2] & 0x0f) == 3) ? -EIO : -EINVAL; if (result == -EINVAL) - printk(KERN_ERR "osst%d: Can't read tape position.\n", dev); + printk(KERN_ERR "osst%d:E: Can't read tape position.\n", dev); else { if (result == -EIO) { /* re-read position */ @@ -2425,7 +2627,7 @@ STp->cur_frames = (STp->buffer)->b_data[15]; #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: Drive Positions: host %d, tape %d%s, buffer %d\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Drive Positions: host %d, tape %d%s, buffer %d\n", dev, STp->first_frame_position, STp->last_frame_position, ((STp->buffer)->b_data[0]&0x80)?" (BOP)": ((STp->buffer)->b_data[0]&0x40)?" (EOP)":"", @@ -2434,7 +2636,7 @@ #endif if (STp->cur_frames == 0 && STp->first_frame_position != STp->last_frame_position) { #if DEBUG - printk(KERN_WARNING "osst%d: Correcting read position %d, %d, %d\n", dev, + printk(KERN_WARNING "osst%d:D: Correcting read position %d, %d, %d\n", dev, STp->first_frame_position, STp->last_frame_position, STp->cur_frames); #endif STp->first_frame_position = STp->last_frame_position; @@ -2446,60 +2648,66 @@ } -/* Set the tape block */ -static int osst_set_frame_position(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt, int block, int skip) +/* Set the physical tape position */ +static int osst_set_frame_position(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt, int ppos, int skip) { - ST_partstat *STps; - int result = 0; - int timeout; + ST_partstat * STps; + int result = 0; + int pp = (ppos == 3000 && !skip) ? 0 : ppos; unsigned char scmd[MAX_COMMAND_SIZE]; Scsi_Cmnd * SCpnt; - int dev = TAPE_NR(STp->devt); + int dev = TAPE_NR(STp->devt); if (STp->ready != ST_READY) return (-EIO); - timeout = STp->long_timeout; STps = &(STp->ps[STp->partition]); - if (block < 0 || block > STp->capacity) { - printk(KERN_ERR "osst%d: Reposition request %d out of range\n", dev, block); - block = block < 0 ? 0 : (STp->capacity - 1); + if (ppos < 0 || ppos > STp->capacity) { + printk(KERN_WARNING "osst%d:W: Reposition request %d out of range\n", dev, ppos); + pp = ppos = ppos < 0 ? 0 : (STp->capacity - 1); result = (-EINVAL); } + + do { #if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: Setting block to %d.\n", dev, block); + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Setting physical position to %d.\n", dev, pp); #endif - memset (scmd, 0, MAX_COMMAND_SIZE); - scmd[0] = SEEK_10; - scmd[1] = 1; - scmd[3] = (block >> 24); - scmd[4] = (block >> 16); - scmd[5] = (block >> 8); - scmd[6] = block; - if (skip) - scmd[9] = 0x80; + memset (scmd, 0, MAX_COMMAND_SIZE); + scmd[0] = SEEK_10; + scmd[1] = 1; + scmd[3] = (pp >> 24); + scmd[4] = (pp >> 16); + scmd[5] = (pp >> 8); + scmd[6] = pp; + if (skip) + scmd[9] = 0x80; - SCpnt = osst_do_scsi(*aSCpnt, STp, scmd, 20, timeout, MAX_READY_RETRIES, TRUE); - if (!SCpnt) { + SCpnt = osst_do_scsi(*aSCpnt, STp, scmd, 20, STp->long_timeout, MAX_READY_RETRIES, TRUE); + if (!SCpnt) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Busy\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Busy\n", dev); #endif - return (-EBUSY); - } - *aSCpnt = SCpnt; + return (-EBUSY); + } + *aSCpnt = SCpnt; - STp->first_frame_position = STp->last_frame_position = block; - STps->eof = ST_NOEOF; - if ((STp->buffer)->last_result_fatal != 0) { + if ((STp->buffer)->last_result_fatal != 0) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: SEEK command failed.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: SEEK command from %d to %d failed.\n", + dev, STp->first_frame_position, pp); #endif - result = (-EIO); - } + result = (-EIO); + } + if (pp != ppos) + osst_wait_ready(STp, aSCpnt, 5 * 60); + } while ((pp != ppos) && (pp = ppos)); + + STp->first_frame_position = STp->last_frame_position = ppos; + STps->eof = ST_NOEOF; STps->at_sm = 0; STps->rw = ST_IDLE; - STp->logical_blk_in_buffer = 0; + STp->frame_in_buffer = 0; return result; } @@ -2508,7 +2716,7 @@ /* osst versions of st functions - augmented and stripped to suit OnStream only */ /* Flush the write buffer (never need to write if variable blocksize). */ -static int osst_flush_write_buffer(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt, int file_blk) +static int osst_flush_write_buffer(OS_Scsi_Tape *STp, Scsi_Cmnd ** aSCpnt) { int offset, transfer, blks = 0; int result = 0; @@ -2521,19 +2729,19 @@ if (SCpnt == (STp->buffer)->last_SCpnt) #if DEBUG { printk(OSST_DEB_MSG - "osst%d: aSCpnt points to Scsi_Cmnd that write_behind_check will release -- cleared\n", dev); + "osst%d:D: aSCpnt points to Scsi_Cmnd that write_behind_check will release -- cleared\n", dev); #endif *aSCpnt = SCpnt = NULL; #if DEBUG } else if (SCpnt) printk(OSST_DEB_MSG - "osst%d: aSCpnt does not point to Scsi_Cmnd that write_behind_check will release -- strange\n", dev); + "osst%d:D: aSCpnt does not point to Scsi_Cmnd that write_behind_check will release -- strange\n", dev); #endif osst_write_behind_check(STp); if ((STp->buffer)->last_result_fatal) { #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Async write error (flush) %x.\n", + printk(OSST_DEB_MSG "osst%d:D: Async write error (flush) %x.\n", dev, (STp->buffer)->last_result); #endif if ((STp->buffer)->last_result == INT_MAX) @@ -2545,15 +2753,13 @@ result = 0; if (STp->dirty == 1) { + STp->write_count++; + STps = &(STp->ps[STp->partition]); + STps->rw = ST_WRITING; offset = STp->buffer->buffer_bytes; + blks = (offset + STp->block_size - 1) / STp->block_size; transfer = OS_FRAME_SIZE; - blks = 1; -#if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: Flushing %d bytes, Tranfering %d bytes in %d blocks.\n", - dev, offset, transfer, blks); -#endif if (offset < OS_DATA_SIZE) osst_zero_buffer_tail(STp->buffer); @@ -2564,17 +2770,48 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = WRITE_6; cmd[1] = 1; - cmd[4] = blks; + cmd[4] = 1; + + switch (STp->write_type) { + case OS_WRITE_DATA: +#if DEBUG + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Writing %d blocks to frame %d, lblks %d-%d\n", + dev, blks, STp->frame_seq_number, + STp->logical_blk_num - blks, STp->logical_blk_num - 1); +#endif + osst_init_aux(STp, OS_FRAME_TYPE_DATA, STp->frame_seq_number++, + STp->logical_blk_num - blks, STp->block_size, blks); + break; + case OS_WRITE_EOD: + osst_init_aux(STp, OS_FRAME_TYPE_EOD, STp->frame_seq_number++, STp->logical_blk_num, 0, 0); + break; + case OS_WRITE_NEW_MARK: + osst_init_aux(STp, OS_FRAME_TYPE_MARKER, STp->frame_seq_number++, STp->logical_blk_num++, + 0, blks=1); + break; + case OS_WRITE_HEADER: + osst_init_aux(STp, OS_FRAME_TYPE_HEADER, 0, 0, 0, blks=0); + break; + default: /* probably FILLER */ + osst_init_aux(STp, OS_FRAME_TYPE_FILL, 0, 0, 0, 0); + } +#if DEBUG + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Flushing %d bytes, Transfering %d bytes in %d lblocks.\n", + dev, offset, transfer, blks); +#endif SCpnt = osst_do_scsi(*aSCpnt, STp, cmd, transfer, STp->timeout, MAX_WRITE_RETRIES, TRUE); *aSCpnt = SCpnt; if (!SCpnt) return (-EBUSY); - STps = &(STp->ps[STp->partition]); if ((STp->buffer)->last_result_fatal != 0) { - printk(OSST_DEB_MSG "osst%d: write sense [0]=0x%02x [2]=%02x [12]=%02x [13]=%02x\n", TAPE_NR(STp->devt), +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: write sense [0]=0x%02x [2]=%02x [12]=%02x [13]=%02x\n", TAPE_NR(STp->devt), SCpnt->sense_buffer[0], SCpnt->sense_buffer[2], SCpnt->sense_buffer[12], SCpnt->sense_buffer[13]); +#endif if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 && (SCpnt->sense_buffer[2] & 0x40) && /* FIXME - SC-30 drive doesn't assert EOM bit */ (SCpnt->sense_buffer[2] & 0x0f) == NO_SENSE) { @@ -2584,7 +2821,7 @@ } else { if (osst_write_error_recovery(STp, aSCpnt, 1)) { - printk(KERN_ERR "osst%d: Error on flush.\n", dev); + printk(KERN_ERR "osst%d:E: Error on flush write.\n", dev); result = (-EIO); } } @@ -2592,15 +2829,12 @@ } else { STp->first_frame_position++; - if (file_blk && STps->drv_block >= 0) - STps->drv_block += blks; - STp->first_frame_position += blks; STp->dirty = 0; (STp->buffer)->buffer_bytes = 0; } } #if DEBUG - printk(OSST_DEB_MSG "osst%d: Exit flush write buffer with code %d\n", dev, result); + printk(OSST_DEB_MSG "osst%d:D: Exit flush write buffer with code %d\n", dev, result); #endif return result; } @@ -2610,15 +2844,12 @@ seek_next is true. */ static int osst_flush_buffer(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int seek_next) { - int backspace, result; - OSST_buffer * STbuffer; + int backspace = 0, result = 0; ST_partstat * STps; #if DEBUG int dev = TAPE_NR(STp->devt); #endif - STbuffer = STp->buffer; - /* * If there was a bus reset, block further access * to this device. @@ -2631,21 +2862,25 @@ STps = &(STp->ps[STp->partition]); if (STps->rw == ST_WRITING) /* Writing */ - return osst_flush_write_buffer(STp, aSCpnt, 1); + return osst_flush_write_buffer(STp, aSCpnt); if (STp->block_size == 0) return 0; #if DEBUG - printk(OSST_DEB_MSG "osst%i: Reached flush (read) buffer\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Reached flush (read) buffer\n", dev); #endif - backspace = ((STp->buffer)->buffer_bytes + - (STp->buffer)->read_pointer) / STp->block_size - - ((STp->buffer)->read_pointer + STp->block_size - 1) / - STp->block_size; - (STp->buffer)->buffer_bytes = 0; - (STp->buffer)->read_pointer = 0; - result = 0; + + if (!STp->can_bsr) { + backspace = ((STp->buffer)->buffer_bytes + + (STp->buffer)->read_pointer) / STp->block_size - + ((STp->buffer)->read_pointer + STp->block_size - 1) / + STp->block_size; /* FIXME is this relevant w. OSST? */ + STp->buffer->buffer_bytes = 0; + STp->buffer->read_pointer = 0; + STp->frame_in_buffer = 0; + } + if (!seek_next) { if (STps->eof == ST_FM_HIT) { result = cross_eof(STp, aSCpnt, FALSE); /* Back over the EOF hit */ @@ -2671,6 +2906,87 @@ } +static int osst_write_frame(OS_Scsi_Tape * STp, Scsi_Cmnd ** aSCpnt, int synchronous) +{ + unsigned char cmd[MAX_COMMAND_SIZE]; + Scsi_Cmnd * SCpnt; + int blks; +#if DEBUG + int dev = TAPE_NR(STp->devt); +#endif + + if ((!STp-> raw) && (STp->first_frame_position == 0xbae)) { /* _must_ preserve buffer! */ +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Reaching config partition.\n", dev); +#endif + if (osst_flush_drive_buffer(STp, aSCpnt) < 0) { + return (-EIO); + } + /* error recovery may have bumped us past the header partition */ + if (osst_get_frame_position(STp, aSCpnt) < 0xbb8) { +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Skipping over config partition.\n", dev); +#endif + osst_position_tape_and_confirm(STp, aSCpnt, 0xbb8); + } + } + + if (STp->poll) + osst_wait_frame (STp, aSCpnt, STp->first_frame_position, -50, 60); + /* TODO: Check for an error ! */ + +// osst_build_stats(STp, &SCpnt); + + STp->ps[STp->partition].rw = ST_WRITING; + STp->write_type = OS_WRITE_DATA; + + memset(cmd, 0, MAX_COMMAND_SIZE); + cmd[0] = WRITE_6; + cmd[1] = 1; + cmd[4] = 1; /* one frame at a time... */ + blks = STp->buffer->buffer_bytes / STp->block_size; +#if DEBUG + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Writing %d blocks to frame %d, lblks %d-%d\n", dev, blks, + STp->frame_seq_number, STp->logical_blk_num - blks, STp->logical_blk_num - 1); +#endif + osst_init_aux(STp, OS_FRAME_TYPE_DATA, STp->frame_seq_number++, + STp->logical_blk_num - blks, STp->block_size, blks); + +#if DEBUG + if (!synchronous) + STp->write_pending = 1; +#endif + SCpnt = osst_do_scsi(*aSCpnt, STp, cmd, OS_FRAME_SIZE, STp->timeout, MAX_WRITE_RETRIES, synchronous); + if (!SCpnt) + return (-EBUSY); + *aSCpnt = SCpnt; + + if (synchronous) { + if (STp->buffer->last_result_fatal != 0) { +#if DEBUG + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Error on write:\n", dev); +#endif + if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 && + (SCpnt->sense_buffer[2] & 0x40)) { + if ((SCpnt->sense_buffer[2] & 0x0f) == VOLUME_OVERFLOW) + return (-ENOSPC); + } + else { + if (osst_write_error_recovery(STp, aSCpnt, 1)) + return (-EIO); + } + } + else + STp->first_frame_position++; + } + + STp->write_count++; + + return 0; +} + /* Entry points to osst */ @@ -2682,7 +2998,6 @@ ssize_t i, do_count, blks, retval, transfer; int write_threshold; int doing_write = 0; - unsigned char cmd[MAX_COMMAND_SIZE]; const char *b_point; Scsi_Cmnd * SCpnt = NULL; OS_Scsi_Tape * STp; @@ -2728,7 +3043,7 @@ #if DEBUG if (!STp->in_use) { - printk(OSST_DEB_MSG "osst%d: Incorrect device.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Incorrect device.\n", dev); return (-EIO); } #endif @@ -2738,13 +3053,13 @@ /* Write must be integral number of blocks */ if (STp->block_size != 0 && (count % STp->block_size) != 0) { - printk(KERN_WARNING "osst%d: Write (%d bytes) not multiple of tape block size (32k).\n", - dev, count); + printk(KERN_ERR "osst%d:E: Write (%d bytes) not multiple of tape block size (%d%c).\n", dev, count, + STp->block_size<1024?STp->block_size:STp->block_size/1024, STp->block_size<1024?'b':'k'); return (-EIO); } - if (STp->first_frame_position >= STp->capacity - 164) { - printk(KERN_WARNING "osst%d: Write truncated at EOM early warning (frame %d).\n", + if (STp->first_frame_position >= STp->capacity - OSST_EOM_RESERVE) { + printk(KERN_ERR "osst%d:E: Write truncated at EOM early warning (frame %d).\n", dev, STp->first_frame_position); return (-ENOSPC); } @@ -2765,63 +3080,64 @@ } else if (STps->rw != ST_WRITING) { /* Are we totally rewriting this tape? */ - if (!STp->header_ok || STp->first_frame_position == STp->first_data_ppos || - (STps->drv_file == 0 && STps->drv_block == 0)) { + if (!STp->header_ok || + (STp->first_frame_position == STp->first_data_ppos && STps->drv_block < 0) || + (STps->drv_file == 0 && STps->drv_block == 0)) { STp->wrt_pass_cntr++; #if DEBUG - printk(OSST_DEB_MSG "osst%d: Allocating next write pass counter: %d\n", + printk(OSST_DEB_MSG "osst%d:D: Allocating next write pass counter: %d\n", dev, STp->wrt_pass_cntr); #endif osst_reset_header(STp, &SCpnt); - STps->drv_file = STps->drv_block = STp->logical_blk_num = 0; + STps->drv_file = STps->drv_block = 0; } /* Do we know where we'll be writing on the tape? */ else { if ((STp->fast_open && osst_verify_position(STp, &SCpnt)) || STps->drv_file < 0 || STps->drv_block < 0) { - if (STp->first_frame_position == STp->eod_frame_ppos) { + if (STp->first_frame_position == STp->eod_frame_ppos) { /* at EOD */ STps->drv_file = STp->filemark_cnt; STps->drv_block = 0; } else { /* We have no idea where the tape is positioned - give up */ #if DEBUG - printk(OSST_DEB_MSG "osst%d: Cannot write at indeterminate position.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Cannot write at indeterminate position.\n", dev); #endif if (SCpnt) scsi_release_command(SCpnt); return (-EIO); } } - if (STps->drv_file > 0 && STps->drv_file < STp->filemark_cnt) { - STp->filemark_cnt = STps->drv_file; + if ((STps->drv_file + STps->drv_block) > 0 && STps->drv_file < STp->filemark_cnt) { + STp->filemark_cnt = STps->drv_file; STp->last_mark_ppos = ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[STp->filemark_cnt-1]); - printk(KERN_WARNING "osst%d: Overwriting file %d with old write pass counter %d\n", + STp->last_mark_lbn = STp->logical_blk_num - STps->drv_block; + printk(KERN_WARNING "osst%d:W: Overwriting file %d with old write pass counter %d\n", dev, STps->drv_file, STp->wrt_pass_cntr); - printk(KERN_WARNING "osst%d: may lead to stale data being accepted on reading back!\n", + printk(KERN_WARNING "osst%d:W: may lead to stale data being accepted on reading back!\n", dev); #if DEBUG - printk(OSST_DEB_MSG "osst%d: resetting filemark count to %d and last mark ppos to %d\n", - dev, STp->filemark_cnt, STp->last_mark_ppos); + printk(OSST_DEB_MSG "osst%d:D: resetting filemark count to %d and last mark ppos,lbn to %d,%d\n", + dev, STp->filemark_cnt, STp->last_mark_ppos, STp->last_mark_lbn); #endif } } STp->fast_open = FALSE; -//printk(OSST_DEB_MSG "osst%d: Starting write next file\n",dev); } if (!STp->header_ok) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Write cannot proceed without valid headers\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Write cannot proceed without valid headers\n", dev); #endif if (SCpnt) scsi_release_command(SCpnt); return (-EIO); } if ((STp->buffer)->writing) { -if (SCpnt) printk(KERN_ERR "osst%d: Not supposed to have SCpnt at line %d\n", dev, __LINE__); +if (SCpnt) printk(KERN_ERR "osst%d:A: Not supposed to have SCpnt at line %d\n", dev, __LINE__); osst_write_behind_check(STp); if ((STp->buffer)->last_result_fatal) { #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Async write error (write) %x.\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Async write error (write) %x.\n", dev, (STp->buffer)->last_result); #endif if ((STp->buffer)->last_result == INT_MAX) @@ -2844,10 +3160,6 @@ return (-EFAULT); if (!STm->do_buffer_writes) { -#if 0 - if (STp->block_size != 0 && (count % STp->block_size) != 0) - return (-EIO); /* Write must be integral number of blocks */ -#endif write_threshold = 1; } else @@ -2856,35 +3168,11 @@ write_threshold--; total = count; - - if ((!STp-> raw) && (STp->first_frame_position == 0xbae)) { -#if DEBUG - printk(OSST_DEB_MSG "osst%d: Skipping over config partition.\n", dev); -#endif - if (osst_flush_drive_buffer(STp, &SCpnt) < 0) { - if (SCpnt) scsi_release_command(SCpnt); - return (-EIO); - } - /* error recovery may have bumped us past the header partition */ - if (osst_get_frame_position(STp, &SCpnt) < 0xbb8) - osst_position_tape_and_confirm(STp, &SCpnt, 0xbb8); - } - - if (STp->poll) - retval = osst_wait_frame (STp, &SCpnt, STp->first_frame_position, -50, 60); - /* TODO: Check for an error ! */ -//osst_build_stats(STp, &SCpnt); - memset(cmd, 0, MAX_COMMAND_SIZE); - cmd[0] = WRITE_6; - cmd[1] = 1; - - STps->rw = ST_WRITING; - STp->write_type = OS_WRITE_DATA; - #if DEBUG - printk(OSST_DEB_MSG "osst%d: Writing %d bytes to file %d block %d lblk %d frame %d\n", + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Writing %d bytes to file %d block %d lblk %d fseq %d fppos %d\n", dev, count, STps->drv_file, STps->drv_block, - STp->logical_blk_num, STp->first_frame_position); + STp->logical_blk_num, STp->frame_seq_number, STp->first_frame_position); #endif b_point = buf; @@ -2905,84 +3193,60 @@ return i; } - transfer = OS_FRAME_SIZE; - blks = 1; - - osst_init_aux(STp, OS_FRAME_TYPE_DATA, STp->logical_blk_num++ ); + blks = do_count / STp->block_size; + STp->logical_blk_num += blks; /* logical_blk_num is incremented as data is moved from user */ - cmd[2] = blks >> 16; - cmd[3] = blks >> 8; - cmd[4] = blks; + i = osst_write_frame(STp, &SCpnt, TRUE); - SCpnt = osst_do_scsi(SCpnt, STp, cmd, transfer, STp->timeout, MAX_WRITE_RETRIES, TRUE); - if (!SCpnt) - return (-EBUSY); - - if ((STp->buffer)->last_result_fatal != 0) { -#if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: Error on write:\n", dev); -#endif - if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 && - (SCpnt->sense_buffer[2] & 0x40)) { - if ((SCpnt->sense_buffer[0] & 0x80) != 0) - transfer = (SCpnt->sense_buffer[3] << 24) | - (SCpnt->sense_buffer[4] << 16) | - (SCpnt->sense_buffer[5] << 8) | SCpnt->sense_buffer[6]; - else - transfer = 0; - transfer *= STp->block_size; + if (i == (-ENOSPC)) { + transfer = STp->buffer->writing; /* FIXME -- check this logic */ if (transfer <= do_count) { - filp->f_pos += do_count - transfer; - count -= do_count - transfer; - if (STps->drv_block >= 0) { - STps->drv_block += (do_count - transfer) / STp->block_size; - } - STps->eof = ST_EOM_OK; - retval = (-ENOSPC); /* EOM within current request */ + filp->f_pos += do_count - transfer; /* some of the data made it */ + count -= do_count - transfer; + if (STps->drv_block >= 0) { + STps->drv_block += (do_count - transfer) / STp->block_size; + } + STps->eof = ST_EOM_OK; + retval = (-ENOSPC); /* EOM within current request */ #if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: EOM with %d bytes unwritten.\n", - dev, transfer); + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: EOM with %d bytes unwritten.\n", dev, transfer); #endif } else { - STps->eof = ST_EOM_ERROR; - STps->drv_block = (-1); /* Too cautious? */ - retval = (-EIO); /* EOM for old data */ + STps->eof = ST_EOM_ERROR; + STps->drv_block = (-1); /* Too cautious? */ + retval = (-EIO); /* EOM for old data */ #if DEBUG - if (debugging) - printk(OSST_DEB_MSG "osst%d: EOM with lost data.\n", dev); + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: EOM with lost data.\n", dev); #endif } - } - else { - if (osst_write_error_recovery(STp, &SCpnt, 1) == 0) goto ok; - STps->drv_block = (-1); /* Too cautious? */ - retval = (-EIO); - } + } else + retval = i; - scsi_release_command(SCpnt); - SCpnt = NULL; - (STp->buffer)->buffer_bytes = 0; - STp->dirty = 0; - if (count < total) - return total - count; - else - return retval; - } - STp->first_frame_position++; -ok: + if (retval < 0) { + if (SCpnt != NULL) { + scsi_release_command(SCpnt); + SCpnt = NULL; + } + STp->buffer->buffer_bytes = 0; + STp->dirty = 0; + if (count < total) + return total - count; + else + return retval; + } filp->f_pos += do_count; b_point += do_count; count -= do_count; if (STps->drv_block >= 0) { STps->drv_block += blks; } - STp->first_frame_position += blks; - (STp->buffer)->buffer_bytes = 0; + STp->buffer->buffer_bytes = 0; STp->dirty = 0; - } + } /* end while write threshold exceeded */ + if (count != 0) { STp->dirty = 1; i = append_to_buffer(b_point, STp->buffer, count); @@ -2993,6 +3257,11 @@ } return i; } + blks = count / STp->block_size; + STp->logical_blk_num += blks; + if (STps->drv_block >= 0) { + STps->drv_block += blks; + } filp->f_pos += count; count = 0; } @@ -3004,28 +3273,15 @@ } if (STm->do_async_writes && - ((STp->buffer)->buffer_bytes >= STp->write_threshold && - (STp->buffer)->buffer_bytes >= OS_DATA_SIZE) ) { + (STp->buffer->buffer_bytes >= STp->write_threshold)) { /* Schedule an asynchronous write */ (STp->buffer)->writing = ((STp->buffer)->buffer_bytes / STp->block_size) * STp->block_size; STp->dirty = !((STp->buffer)->writing == (STp->buffer)->buffer_bytes); - transfer = OS_FRAME_SIZE; - blks = 1; - - osst_init_aux(STp, OS_FRAME_TYPE_DATA, STp->logical_blk_num++ ); - - cmd[2] = blks >> 16; - cmd[3] = blks >> 8; - cmd[4] = blks; -#if DEBUG - STp->write_pending = 1; -#endif - - SCpnt = osst_do_scsi(SCpnt, STp, cmd, transfer, STp->timeout, MAX_WRITE_RETRIES, FALSE); - if (SCpnt == NULL) + i = osst_write_frame(STp, &SCpnt, FALSE); + if (i < 0) return (-EIO); } else if (SCpnt != NULL) { @@ -3036,7 +3292,7 @@ if (total > 0) STps->eof = ST_NOEOF; - return( total); + return total; } @@ -3081,19 +3337,13 @@ return (-ENXIO); #if DEBUG if (!STp->in_use) { - printk(OSST_DEB_MSG "osst%d: Incorrect device.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Incorrect device.\n", dev); return (-EIO); } #endif /* Must have initialized medium */ if (!STp->header_ok) return (-EIO); - if ((count % STp->block_size) != 0) { - printk(KERN_WARNING "osst%d: Use multiple of %d bytes as block size (%d requested)\n", - dev, STp->block_size, count); - return (-EIO); /* Read must be integral number of blocks */ - } - if (STp->do_auto_lock && STp->door_locked == ST_UNLOCKED && !osst_int_ioctl(STp, &SCpnt, MTLOCK, 0)) STp->door_locked = ST_LOCKED_AUTO; @@ -3108,9 +3358,14 @@ STps->rw = ST_IDLE; } + if ((count % STp->block_size) != 0) { + printk(KERN_WARNING "osst%d:W: Read (%d bytes) not multiple of tape block size (%d%c).\n", dev, count, + STp->block_size<1024?STp->block_size:STp->block_size/1024, STp->block_size<1024?'b':'k'); + } + #if DEBUG if (debugging && STps->eof != ST_NOEOF) - printk(OSST_DEB_MSG "osst%d: EOF/EOM flag up (%d). Bytes %d\n", dev, + printk(OSST_DEB_MSG "osst%d:D: EOF/EOM flag up (%d). Bytes %d\n", dev, STps->eof, (STp->buffer)->buffer_bytes); #endif if ((STp->buffer)->buffer_bytes == 0 && @@ -3134,39 +3389,49 @@ } /* Loop until enough data in buffer or a special condition found */ - for (total = 0, special = 0; total < count && !special; ) { + for (total = 0, special = 0; total < count - STp->block_size + 1 && !special; ) { /* Get new data if the buffer is empty */ if ((STp->buffer)->buffer_bytes == 0) { - special = osst_get_logical_blk(STp, &SCpnt, STp->logical_blk_num, 0); - STp->buffer->buffer_bytes = special ? 0 : OS_DATA_SIZE; - STp->buffer->read_pointer = 0; - STp->logical_blk_num++; /* block to look for next time */ - STp->logical_blk_in_buffer = 0; + if (STps->eof == ST_FM_HIT) + break; + special = osst_get_logical_frame(STp, &SCpnt, STp->frame_seq_number, 0); if (special < 0) { /* No need to continue read */ + STp->frame_in_buffer = 0; if (SCpnt) scsi_release_command(SCpnt); return special; - } - STps->drv_block++; + } } /* Move the data from driver buffer to user buffer */ if ((STp->buffer)->buffer_bytes > 0) { #if DEBUG if (debugging && STps->eof != ST_NOEOF) - printk(OSST_DEB_MSG "osst%d: EOF up (%d). Left %d, needed %d.\n", dev, + printk(OSST_DEB_MSG "osst%d:D: EOF up (%d). Left %d, needed %d.\n", dev, STps->eof, (STp->buffer)->buffer_bytes, count - total); #endif - transfer = (STp->buffer)->buffer_bytes < count - total ? - (STp->buffer)->buffer_bytes : count - total; + transfer = (((STp->buffer)->buffer_bytes < count - total ? + (STp->buffer)->buffer_bytes : count - total)/ + STp->block_size) * STp->block_size; /* force multiple of block size */ i = from_buffer(STp->buffer, buf, transfer); if (i) { if (SCpnt) scsi_release_command(SCpnt); return i; } - filp->f_pos += transfer; - buf += transfer; - total += transfer; + STp->logical_blk_num += transfer / STp->block_size; + STps->drv_block += transfer / STp->block_size; + filp->f_pos += transfer; + buf += transfer; + total += transfer; + } + + if ((STp->buffer)->buffer_bytes == 0) { +#if DEBUG + if (debugging) + printk(OSST_DEB_MSG "osst%d:D: Finished with frame %d\n", dev, STp->frame_seq_number); +#endif + STp->frame_in_buffer = 0; + STp->frame_seq_number++; /* frame to look for next time */ } } /* for (total = 0, special = 0; total < count && !special; ) */ @@ -3200,21 +3465,21 @@ static void osst_log_options(OS_Scsi_Tape *STp, ST_mode *STm, int dev) { printk(KERN_INFO -"osst%d: Mode %d options: buffer writes: %d, async writes: %d, read ahead: %d\n", +"osst%d:I: Mode %d options: buffer writes: %d, async writes: %d, read ahead: %d\n", dev, STp->current_mode, STm->do_buffer_writes, STm->do_async_writes, STm->do_read_ahead); printk(KERN_INFO -"osst%d: can bsr: %d, two FMs: %d, fast mteom: %d, auto lock: %d,\n", +"osst%d:I: can bsr: %d, two FMs: %d, fast mteom: %d, auto lock: %d,\n", dev, STp->can_bsr, STp->two_fm, STp->fast_mteom, STp->do_auto_lock); printk(KERN_INFO -"osst%d: defs for wr: %d, no block limits: %d, partitions: %d, s2 log: %d\n", +"osst%d:I: defs for wr: %d, no block limits: %d, partitions: %d, s2 log: %d\n", dev, STm->defaults_for_writes, STp->omit_blklims, STp->can_partitions, STp->scsi2_logical); printk(KERN_INFO -"osst%d: sysv: %d\n", dev, STm->sysv); +"osst%d:I: sysv: %d\n", dev, STm->sysv); #if DEBUG printk(KERN_INFO - "osst%d: debugging: %d\n", + "osst%d:D: debugging: %d\n", dev, debugging); #endif } @@ -3233,7 +3498,7 @@ modes_defined = TRUE; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Initialized mode %d definition from mode 0\n", + printk(OSST_DEB_MSG "osst%d:D: Initialized mode %d definition from mode 0\n", dev, STp->current_mode); #endif } @@ -3294,23 +3559,28 @@ else if (code == MT_ST_WRITE_THRESHOLD) { value = (options & ~MT_ST_OPTIONS) * ST_KILOBYTE; if (value < 1 || value > osst_buffer_size) { - printk(KERN_WARNING "osst%d: Write threshold %d too small or too large.\n", + printk(KERN_WARNING "osst%d:W: Write threshold %d too small or too large.\n", dev, value); return (-EIO); } STp->write_threshold = value; - printk(KERN_INFO "osst%d: Write threshold set to %d bytes.\n", + printk(KERN_INFO "osst%d:I: Write threshold set to %d bytes.\n", dev, value); } else if (code == MT_ST_DEF_BLKSIZE) { value = (options & ~MT_ST_OPTIONS); if (value == ~MT_ST_OPTIONS) { STm->default_blksize = (-1); - printk(KERN_INFO "osst%d: Default block size disabled.\n", dev); + printk(KERN_INFO "osst%d:I: Default block size disabled.\n", dev); } else { + if (value < 512 || value > OS_DATA_SIZE || OS_DATA_SIZE % value) { + printk(KERN_WARNING "osst%d:W: Default block size cannot be set to %d.\n", + dev, value); + return (-EINVAL); + } STm->default_blksize = value; - printk(KERN_INFO "osst%d: Default block size set to %d bytes.\n", + printk(KERN_INFO "osst%d:I: Default block size set to %d bytes.\n", dev, STm->default_blksize); } } @@ -3318,12 +3588,12 @@ value = (options & ~MT_ST_OPTIONS); if ((value & MT_ST_SET_LONG_TIMEOUT) != 0) { STp->long_timeout = (value & ~MT_ST_SET_LONG_TIMEOUT) * HZ; - printk(KERN_INFO "osst%d: Long timeout set to %d seconds.\n", dev, + printk(KERN_INFO "osst%d:I: Long timeout set to %d seconds.\n", dev, (value & ~MT_ST_SET_LONG_TIMEOUT)); } else { STp->timeout = value * HZ; - printk(KERN_INFO "osst%d: Normal timeout set to %d seconds.\n", dev, + printk(KERN_INFO "osst%d:I: Normal timeout set to %d seconds.\n", dev, value); } } @@ -3333,33 +3603,33 @@ if (code == MT_ST_DEF_DENSITY) { if (value == MT_ST_CLEAR_DEFAULT) { STm->default_density = (-1); - printk(KERN_INFO "osst%d: Density default disabled.\n", dev); + printk(KERN_INFO "osst%d:I: Density default disabled.\n", dev); } else { STm->default_density = value & 0xff; - printk(KERN_INFO "osst%d: Density default set to %x\n", + printk(KERN_INFO "osst%d:I: Density default set to %x\n", dev, STm->default_density); } } else if (code == MT_ST_DEF_DRVBUFFER) { if (value == MT_ST_CLEAR_DEFAULT) { STp->default_drvbuffer = 0xff; - printk(KERN_INFO "osst%d: Drive buffer default disabled.\n", dev); + printk(KERN_INFO "osst%d:I: Drive buffer default disabled.\n", dev); } else { STp->default_drvbuffer = value & 7; - printk(KERN_INFO "osst%d: Drive buffer default set to %x\n", + printk(KERN_INFO "osst%d:I: Drive buffer default set to %x\n", dev, STp->default_drvbuffer); } } else if (code == MT_ST_DEF_COMPRESSION) { if (value == MT_ST_CLEAR_DEFAULT) { STm->default_compression = ST_DONT_TOUCH; - printk(KERN_INFO "osst%d: Compression default disabled.\n", dev); + printk(KERN_INFO "osst%d:I: Compression default disabled.\n", dev); } else { STm->default_compression = (value & 1 ? ST_YES : ST_NO); - printk(KERN_INFO "osst%d: Compression default set to %x\n", + printk(KERN_INFO "osst%d:I: Compression default set to %x\n", dev, (value & 1)); } } @@ -3382,7 +3652,7 @@ Scsi_Cmnd * SCpnt = *aSCpnt; ST_partstat * STps; int fileno, blkno, at_sm, datalen; - int logical_blk_num; + int frame_seq_numbr, logical_blk_num; int dev = TAPE_NR(STp->devt); if (STp->ready != ST_READY && cmd_in != MTLOAD) { @@ -3396,6 +3666,7 @@ fileno = STps->drv_file; blkno = STps->drv_block; at_sm = STps->at_sm; + frame_seq_numbr = STp->frame_seq_number; logical_blk_num = STp->logical_blk_num; memset(cmd, 0, MAX_COMMAND_SIZE); @@ -3410,7 +3681,6 @@ ioctl_result = osst_space_over_filemarks_forward_fast(STp, &SCpnt, cmd_in, arg); else ioctl_result = osst_space_over_filemarks_forward_slow(STp, &SCpnt, cmd_in, arg); - logical_blk_num = STp->logical_blk_num; if (fileno >= 0) fileno += arg; blkno = 0; @@ -3423,7 +3693,6 @@ if (STp->raw) return (-EIO); ioctl_result = osst_space_over_filemarks_backward(STp, &SCpnt, cmd_in, arg); - logical_blk_num = STp->logical_blk_num; if (fileno >= 0) fileno -= arg; blkno = (-1); /* We can't know the block number */ @@ -3434,7 +3703,7 @@ case MTBSR: #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%i: Skipping %lu blocks %s from logical block %d\n", + printk(OSST_DEB_MSG "osst%d:D: Skipping %lu blocks %s from logical block %d\n", dev, arg, cmd_in==MTFSR?"forward":"backward", logical_blk_num); #endif if (cmd_in == MTFSR) { @@ -3445,8 +3714,9 @@ logical_blk_num -= arg; if (blkno >= 0) blkno -= arg; } - ioctl_result = osst_seek_logical_blk(STp, &SCpnt, logical_blk_num-1); - STp->logical_blk_in_buffer = 0; + ioctl_result = osst_seek_logical_blk(STp, &SCpnt, logical_blk_num); + fileno = STps->drv_file; + blkno = STps->drv_block; at_sm &= (arg == 0); goto os_bypass; @@ -3458,7 +3728,7 @@ cmd[4] = arg; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Spacing tape forward %d setmarks.\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Spacing tape forward %d setmarks.\n", dev, cmd[2] * 65536 + cmd[3] * 256 + cmd[4]); #endif if (arg != 0) { @@ -3478,7 +3748,7 @@ if (cmd[2] & 0x80) ltmp = 0xff000000; ltmp = ltmp | (cmd[2] << 16) | (cmd[3] << 8) | cmd[4]; - printk(OSST_DEB_MSG "osst%d: Spacing tape backward %ld setmarks.\n", + printk(OSST_DEB_MSG "osst%d:D: Spacing tape backward %ld setmarks.\n", dev, (-ltmp)); } #endif @@ -3489,12 +3759,11 @@ break; case MTWEOF: if ( STps->rw == ST_WRITING && !(STp->device)->was_reset) - ioctl_result = osst_flush_write_buffer(STp, &SCpnt, 1); + ioctl_result = osst_flush_write_buffer(STp, &SCpnt); else ioctl_result = 0; for (i=0; ilogical_blk_num; if (fileno >= 0) fileno += arg; if (blkno >= 0) blkno = 0; goto os_bypass; @@ -3514,10 +3783,10 @@ #if DEBUG if (debugging) { if (cmd_in == MTWEOF) - printk(OSST_DEB_MSG "osst%d: Writing %d filemarks.\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Writing %d filemarks.\n", dev, cmd[2] * 65536 + cmd[3] * 256 + cmd[4]); else - printk(OSST_DEB_MSG "osst%d: Writing %d setmarks.\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Writing %d setmarks.\n", dev, cmd[2] * 65536 + cmd[3] * 256 + cmd[4]); } #endif @@ -3543,50 +3812,49 @@ if (debugging) { switch (cmd_in) { case MTUNLOAD: - printk(OSST_DEB_MSG "osst%d: Unloading tape.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Unloading tape.\n", dev); break; case MTLOAD: - printk(OSST_DEB_MSG "osst%d: Loading tape.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Loading tape.\n", dev); break; case MTRETEN: - printk(OSST_DEB_MSG "osst%d: Retensioning tape.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Retensioning tape.\n", dev); break; case MTOFFL: - printk(OSST_DEB_MSG "osst%d: Ejecting tape.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Ejecting tape.\n", dev); break; } } #endif - fileno = blkno = at_sm = logical_blk_num = 0 ; + fileno = blkno = at_sm = frame_seq_numbr = logical_blk_num = 0 ; break; case MTNOP: #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: No op on tape.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: No-op on tape.\n", dev); #endif return 0; /* Should do something ? */ break; case MTEOM: #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Spacing to end of recorded medium.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Spacing to end of recorded medium.\n", dev); #endif osst_set_frame_position(STp, &SCpnt, STp->eod_frame_ppos, 0); - if (osst_get_logical_blk(STp, &SCpnt, -1, 0) < 0) { + if (osst_get_logical_frame(STp, &SCpnt, -1, 0) < 0) { ioctl_result = -EIO; goto os_bypass; } if (STp->buffer->aux->frame_type != OS_FRAME_TYPE_EOD) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: No EOD frame found where expected.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: No EOD frame found where expected.\n", dev); #endif ioctl_result = -EIO; goto os_bypass; } ioctl_result = osst_set_frame_position(STp, &SCpnt, STp->eod_frame_ppos, 0); - logical_blk_num = STp->logical_blk_num; - fileno = STp->filemark_cnt; - blkno = at_sm = 0; + fileno = STp->filemark_cnt; + blkno = at_sm = 0; goto os_bypass; case MTERASE: @@ -3597,7 +3865,7 @@ if (i < ioctl_result) ioctl_result = i; i = osst_position_tape_and_confirm(STp, &SCpnt, STp->eod_frame_ppos); if (i < ioctl_result) ioctl_result = i; - fileno = blkno = at_sm = logical_blk_num = 0 ; + fileno = blkno = at_sm = 0 ; goto os_bypass; case MTREW: @@ -3605,9 +3873,9 @@ cmd[1] = 1; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Rewinding tape, Immed=%d.\n", dev, cmd[1]); + printk(OSST_DEB_MSG "osst%d:D: Rewinding tape, Immed=%d.\n", dev, cmd[1]); #endif - fileno = blkno = at_sm = logical_blk_num = 0 ; + fileno = blkno = at_sm = frame_seq_numbr = logical_blk_num = 0 ; break; case MTLOCK: @@ -3616,8 +3884,8 @@ cmd[4] = SCSI_REMOVAL_PREVENT; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Locking drive door.\n", dev); -#endif; + printk(OSST_DEB_MSG "osst%d:D: Locking drive door.\n", dev); +#endif break; case MTUNLOCK: @@ -3626,8 +3894,8 @@ cmd[4] = SCSI_REMOVAL_ALLOW; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Unlocking drive door.\n", dev); -#endif; + printk(OSST_DEB_MSG "osst%d:D: Unlocking drive door.\n", dev); +#endif break; case MTSETBLK: /* Set block length */ @@ -3642,10 +3910,10 @@ ((arg & MT_ST_BLKSIZE_MASK) < STp->min_block || (arg & MT_ST_BLKSIZE_MASK) > STp->max_block || (arg & MT_ST_BLKSIZE_MASK) > osst_buffer_size)) { - printk(KERN_WARNING "osst%d: Illegal block size.\n", dev); + printk(KERN_WARNING "osst%d:W: Illegal block size.\n", dev); return (-EINVAL); } - return 0; /* silently ignore if block size didn't change */ + return 0; /* FIXME silently ignore if block size didn't change */ default: return (-ENOSYS); @@ -3654,20 +3922,25 @@ SCpnt = osst_do_scsi(SCpnt, STp, cmd, datalen, timeout, MAX_RETRIES, TRUE); if (!SCpnt) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Couldn't exec scsi cmd for IOCTL\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Couldn't exec scsi cmd for IOCTL\n", dev); #endif return (-EBUSY); } ioctl_result = (STp->buffer)->last_result_fatal; + if (!ioctl_result) { /* SCSI command successful */ + STp->frame_seq_number = frame_seq_numbr; + STp->logical_blk_num = logical_blk_num; + } + os_bypass: #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: IOCTL (%d) Result=%d\n", dev, cmd_in, ioctl_result); + printk(OSST_DEB_MSG "osst%d:D: IOCTL (%d) Result=%d\n", dev, cmd_in, ioctl_result); #endif - if (!ioctl_result) { /* SCSI command successful */ + if (!ioctl_result) { if (cmd_in == MTFSFM) { fileno--; @@ -3680,7 +3953,6 @@ STps->drv_block = blkno; STps->drv_file = fileno; STps->at_sm = at_sm; - STp->logical_blk_num = logical_blk_num; if (cmd_in == MTLOCK) STp->door_locked = ST_LOCKED_EXPLICIT; @@ -3700,7 +3972,7 @@ /* STp->rew_at_close = (MINOR(inode->i_rdev) & 0x80) == 0; FIXME */ for (i=0; i < ST_NBR_PARTITIONS; i++) { STp->ps[i].rw = ST_IDLE; - STp->ps[i].last_block_valid = FALSE; + STp->ps[i].last_block_valid = FALSE; /* FIXME - where else is this field maintained? */ } STp->partition = 0; } @@ -3769,12 +4041,12 @@ return (-ENXIO); if( !scsi_block_when_processing_errors(STp->device) ) { - return -ENXIO; + return (-ENXIO); } if (STp->in_use) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Device already in use.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Device already in use.\n", dev); #endif return (-EBUSY); } @@ -3789,7 +4061,7 @@ if (mode != STp->current_mode) { #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Mode change from %d to %d.\n", + printk(OSST_DEB_MSG "osst%d:D: Mode change from %d to %d.\n", dev, STp->current_mode, mode); #endif new_session = TRUE; @@ -3811,7 +4083,7 @@ if (i >= osst_nbr_buffers) { STp->buffer = new_tape_buffer(FALSE, need_dma_buffer); if (STp->buffer == NULL) { - printk(KERN_WARNING "osst%d: Can't allocate tape buffer.\n", dev); + printk(KERN_WARNING "osst%d:W: Can't allocate tape buffer.\n", dev); STp->in_use = 0; if (STp->device->host->hostt->module) __MOD_DEC_USE_COUNT(STp->device->host->hostt->module); @@ -3842,7 +4114,6 @@ STps->rw = ST_IDLE; } STp->ready = ST_READY; - STp->recover_count = 0; #if DEBUG STp->nbr_waits = STp->nbr_finished = 0; #endif @@ -3865,7 +4136,7 @@ (SCpnt->sense_buffer[2] & 0x0f) == NOT_READY && SCpnt->sense_buffer[12] == 4 ) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: Unit not ready, cause %x\n", dev, SCpnt->sense_buffer[13]); + printk(OSST_DEB_MSG "osst%d:D: Unit not ready, cause %x\n", dev, SCpnt->sense_buffer[13]); #endif if (SCpnt->sense_buffer[13] == 2) { /* initialize command required (LOAD) */ memset (cmd, 0, MAX_COMMAND_SIZE); @@ -3879,7 +4150,7 @@ if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 && (SCpnt->sense_buffer[2] & 0x0f) == UNIT_ATTENTION) { /* New media? */ #if DEBUG - printk(OSST_DEB_MSG "osst%d: Unit wants attention\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Unit wants attention\n", dev); #endif STp->header_ok = 0; @@ -3900,7 +4171,7 @@ STp->nbr_partitions = 1; /* This guess will be updated later if necessary */ for (i=0; i < ST_NBR_PARTITIONS; i++) { STps = &(STp->ps[i]); - STps->rw = ST_IDLE; + STps->rw = ST_IDLE; /* FIXME - seems to be redundant... */ STps->eof = ST_NOEOF; STps->at_sm = 0; STps->last_block_valid = FALSE; @@ -3908,6 +4179,7 @@ STps->drv_file = 0 ; } new_session = TRUE; + STp->recover_count = 0; } /* * if we have valid headers from before, and the drive/tape seem untouched, @@ -3930,7 +4202,7 @@ STp->buffer->b_data[MODE_HEADER_LENGTH + 4] != 'N' || STp->buffer->b_data[MODE_HEADER_LENGTH + 5] != '4' ) { #if DEBUG - printk(OSST_DEB_MSG "osst%d: signature was changed to %c%c%c%c\n", dev, + printk(OSST_DEB_MSG "osst%d:D: Signature was changed to %c%c%c%c\n", dev, STp->buffer->b_data[MODE_HEADER_LENGTH + 2], STp->buffer->b_data[MODE_HEADER_LENGTH + 3], STp->buffer->b_data[MODE_HEADER_LENGTH + 4], @@ -3942,17 +4214,23 @@ if (STp->header_ok && i == osst_get_frame_position(STp, &SCpnt)) { if (STp->door_locked == ST_UNLOCKED) { if (osst_int_ioctl(STp, &SCpnt, MTLOCK, 0)) - printk(KERN_WARNING "osst%d: Can't lock drive door\n", dev); + printk(KERN_INFO "osst%d:I: Can't lock drive door\n", dev); else STp->door_locked = ST_LOCKED_AUTO; } + if (!STp->frame_in_buffer) { + STp->block_size = (STp->raw) ? OS_FRAME_SIZE : ( + (STm->default_blksize > 0) ? STm->default_blksize : OS_DATA_SIZE); + STp->buffer->buffer_bytes = STp->buffer->read_pointer = 0; + } + STp->buffer->buffer_blocks = OS_DATA_SIZE / STp->block_size; STp->fast_open = TRUE; scsi_release_command(SCpnt); return 0; } #if DEBUG if (i != STp->first_frame_position) - printk(OSST_DEB_MSG "osst%d: tape position changed from %d to %d\n", dev, i, STp->first_frame_position); + printk(OSST_DEB_MSG "osst%d:D: Tape position changed from %d to %d\n", dev, i, STp->first_frame_position); #endif STp->header_ok = 0; } @@ -3975,8 +4253,8 @@ (STp->buffer)->b_data[MODE_HEADER_LENGTH + 2] = 2; (STp->buffer)->b_data[MODE_HEADER_LENGTH + 3] = 3; -#if 1 //DEBUG - printk(OSST_DEB_MSG "osst%i: Applying soft reset\n", dev); +#if DEBUG + printk(OSST_DEB_MSG "osst%d:D: Applying soft reset\n", dev); #endif SCpnt = osst_do_scsi(SCpnt, STp, cmd, cmd[4], STp->timeout, 0, TRUE); @@ -4012,7 +4290,7 @@ } if (osst_wait_ready(STp, &SCpnt, 3 * 60)) /* FIXME - not allowed with NOBLOCK */ - printk(KERN_WARNING "osst%i: Device did not become Ready in open\n",dev); + printk(KERN_INFO "osst%i:I: Device did not become Ready in open\n",dev); if ((STp->buffer)->last_result_fatal != 0) { if ((STp->device)->scsi_level >= SCSI_2 && @@ -4041,7 +4319,7 @@ if (OS_FRAME_SIZE > (STp->buffer)->buffer_size && !enlarge_buffer(STp->buffer, OS_FRAME_SIZE, STp->restr_dma)) { - printk(KERN_NOTICE "osst%d: Framesize %d too large for buffer.\n", dev, + printk(KERN_NOTICE "osst%d:A: Framesize %d too large for buffer.\n", dev, OS_FRAME_SIZE); scsi_release_command(SCpnt); SCpnt = NULL; @@ -4061,22 +4339,26 @@ b_size += STp->buffer->sg[i++].length); STp->buffer->aux = (os_aux_t *) (STp->buffer->sg[i].address + OS_DATA_SIZE - b_size); #if DEBUG - printk(OSST_DEB_MSG "osst%d: b_data points to %p in segment 0 at %p\n", dev, + printk(OSST_DEB_MSG "osst%d:D: b_data points to %p in segment 0 at %p\n", dev, STp->buffer->b_data, STp->buffer->sg[0].address); - printk(OSST_DEB_MSG "osst%d: AUX points to %p in segment %d at %p\n", dev, + printk(OSST_DEB_MSG "osst%d:D: AUX points to %p in segment %d at %p\n", dev, STp->buffer->aux, i, STp->buffer->sg[i].address); #endif } else STp->buffer->aux = NULL; /* this had better never happen! */ - (STp->buffer)->buffer_blocks = 1; + STp->block_size = (STp->raw) ? OS_FRAME_SIZE : ( + (STm->default_blksize > 0) ? STm->default_blksize : OS_DATA_SIZE); + STp->min_block = 512; + STp->max_block = OS_DATA_SIZE; + (STp->buffer)->buffer_blocks = OS_DATA_SIZE / STp->block_size; (STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = - STp->logical_blk_in_buffer = 0; + STp->frame_in_buffer = 0; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Block size: %d, frame size: %d, buffer size: %d (%d blocks).\n", + printk(OSST_DEB_MSG "osst%d:D: Block size: %d, frame size: %d, buffer size: %d (%d blocks).\n", dev, STp->block_size, OS_FRAME_SIZE, (STp->buffer)->buffer_size, (STp->buffer)->buffer_blocks); #endif @@ -4085,7 +4367,7 @@ STp->write_prot = 1; #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Write protected\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Write protected\n", dev); #endif if ((flags & O_ACCMODE) == O_WRONLY || (flags & O_ACCMODE) == O_RDWR) { (STp->buffer)->in_use = 0; @@ -4105,7 +4387,7 @@ if (new_session) { /* Change the drive parameters for the new mode */ #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: New Session\n", dev); + printk(OSST_DEB_MSG "osst%d:D: New Session\n", dev); #endif STp->density_changed = STp->blksize_changed = FALSE; STp->compression_changed = FALSE; @@ -4116,7 +4398,7 @@ */ if (STp->door_locked == ST_UNLOCKED) { if (osst_int_ioctl(STp, &SCpnt, MTLOCK, 0)) - printk(KERN_WARNING "osst%d: Can't lock drive door\n", dev); + printk(KERN_INFO "osst%d:I: Can't lock drive door\n", dev); else STp->door_locked = ST_LOCKED_AUTO; } @@ -4152,7 +4434,7 @@ STps = &(STp->ps[STp->partition]); if ( STps->rw == ST_WRITING && !(STp->device)->was_reset) { - result = osst_flush_write_buffer(STp, &SCpnt, 1); + result = osst_flush_write_buffer(STp, &SCpnt); if (result != 0 && result != (-ENOSPC)) goto out; } @@ -4161,9 +4443,9 @@ #if DEBUG if (debugging) { - printk(OSST_DEB_MSG "osst%d: File length %ld bytes.\n", + printk(OSST_DEB_MSG "osst%d:D: File length %ld bytes.\n", dev, (long)(filp->f_pos)); - printk(OSST_DEB_MSG "osst%d: Async write waits %d, finished %d.\n", + printk(OSST_DEB_MSG "osst%d:D: Async write waits %d, finished %d.\n", dev, STp->nbr_waits, STp->nbr_finished); } #endif @@ -4184,7 +4466,7 @@ #if DEBUG if (debugging) - printk(OSST_DEB_MSG "osst%d: Buffer flushed, %d EOF(s) written\n", + printk(OSST_DEB_MSG "osst%d:D: Buffer flushed, %d EOF(s) written\n", dev, 1+STp->two_fm); #endif } @@ -4192,7 +4474,7 @@ STps = &(STp->ps[STp->partition]); if (!STm->sysv || STps->rw != ST_READING) { if (STp->can_bsr) - result = osst_flush_buffer(STp, &SCpnt, 0); + result = osst_flush_buffer(STp, &SCpnt, 0); /* this is the default path */ else if (STps->eof == ST_FM_HIT) { result = cross_eof(STp, &SCpnt, FALSE); if (result) { @@ -4218,12 +4500,24 @@ out: if (STp->rew_at_close) { result2 = osst_position_tape_and_confirm(STp, &SCpnt, STp->first_data_ppos); - STps->drv_file = STps->drv_block = STp->logical_blk_num = 0; - if (result == 0) + STps->drv_file = STps->drv_block = STp->frame_seq_number = STp->logical_blk_num = 0; + if (result == 0 && result2 < 0) result = result2; } if (SCpnt) scsi_release_command(SCpnt); + if (STp->recover_count) { + printk(KERN_INFO "osst%d:I: %d recovered errors in", dev, STp->recover_count); + if (STp->write_count) + printk(" %d frames written", STp->write_count); + if (STp->read_count) + printk(" %d frames read", STp->read_count); + printk("\n"); + STp->recover_count = 0; + } + STp->write_count = 0; + STp->read_count = 0; + return result; } @@ -4275,7 +4569,7 @@ STp = os_scsi_tapes[dev]; #if DEBUG if (debugging && !STp->in_use) { - printk(OSST_DEB_MSG "osst%d: Incorrect device.\n", dev); + printk(OSST_DEB_MSG "osst%d:D: Incorrect device.\n", dev); return (-EIO); } #endif @@ -4304,7 +4598,7 @@ return (-EFAULT); if (mtc.mt_op == MTSETDRVBUFFER && !capable(CAP_SYS_ADMIN)) { - printk(KERN_WARNING "osst%d: MTSETDRVBUFFER only allowed for root.\n", dev); + printk(KERN_WARNING "osst%d:W: MTSETDRVBUFFER only allowed for root.\n", dev); return (-EPERM); } if (!STm->defined && @@ -4359,7 +4653,7 @@ if (STp->door_locked != ST_UNLOCKED && STp->door_locked != ST_LOCK_FAILS) { if (osst_int_ioctl(STp, &SCpnt, MTLOCK, 0)) { - printk(KERN_NOTICE "osst%d: Could not relock door after bus reset.\n", + printk(KERN_NOTICE "osst%d:I: Could not relock door after bus reset.\n", dev); STp->door_locked = ST_UNLOCKED; } @@ -4409,7 +4703,7 @@ return 0; } if (mtc.mt_op == MTSEEK) { - i = osst_seek_frame(STp, &SCpnt, mtc.mt_count); + i = osst_seek_sector(STp, &SCpnt, mtc.mt_count); if (SCpnt) scsi_release_command(SCpnt); if (!STp->can_partitions) STp->ps[0].rw = ST_IDLE; @@ -4502,7 +4796,7 @@ if (cmd_type == _IOC_TYPE(MTIOCPOS) && cmd_nr == _IOC_NR(MTIOCPOS)) { if (_IOC_SIZE(cmd_in) != sizeof(struct mtpos)) return (-EINVAL); - blk = osst_get_frame_position(STp, &SCpnt); + blk = osst_get_sector(STp, &SCpnt); if (SCpnt) scsi_release_command(SCpnt); if (blk < 0) return blk; @@ -4594,7 +4888,7 @@ } } if (!tb) { - printk(KERN_NOTICE "osst: Can't allocate new tape buffer (nbr %d).\n", + printk(KERN_NOTICE "osst :I: Can't allocate new tape buffer (nbr %d).\n", osst_nbr_buffers); return NULL; } @@ -4604,10 +4898,10 @@ #if DEBUG if (debugging) { printk(OSST_DEB_MSG - "osst: Allocated tape buffer %d (%d bytes, %d segments, dma: %d, a: %p).\n", + "osst :D: Allocated tape buffer %d (%d bytes, %d segments, dma: %d, a: %p).\n", osst_nbr_buffers, got, tb->sg_segs, need_dma, tb->b_data); printk(OSST_DEB_MSG - "osst: segment sizes: first %d, last %d bytes.\n", + "osst :D: segment sizes: first %d, last %d bytes.\n", tb->sg[0].length, tb->sg[segs-1].length); } #endif @@ -4652,8 +4946,7 @@ order--; continue; } - printk(KERN_NOTICE "osst: Failed to enlarge buffer to %d bytes.\n", - new_size); + printk(KERN_WARNING "osst :W: Failed to enlarge buffer to %d bytes.\n", new_size); #if DEBUG STbuffer->buffer_size = got; #endif @@ -4671,10 +4964,10 @@ if (debugging) { for (nbr=0; osst_buffers[nbr] != STbuffer && nbr < osst_nbr_buffers; nbr++); printk(OSST_DEB_MSG - "osst: Expanded tape buffer %d (%d bytes, %d->%d segments, dma: %d, a: %p).\n", + "osst :D: Expanded tape buffer %d (%d bytes, %d->%d segments, dma: %d, a: %p).\n", nbr, got, STbuffer->orig_sg_segs, STbuffer->sg_segs, need_dma, STbuffer->b_data); printk(OSST_DEB_MSG - "osst: segment sizes: first %d, last %d bytes.\n", + "osst :D: segment sizes: first %d, last %d bytes.\n", STbuffer->sg[0].length, STbuffer->sg[segs-1].length); } #endif @@ -4699,7 +4992,7 @@ } #if DEBUG if (debugging && STbuffer->orig_sg_segs < STbuffer->sg_segs) - printk(OSST_DEB_MSG "osst: Buffer at %p normalized to %d bytes (segs %d).\n", + printk(OSST_DEB_MSG "osst :D: Buffer at %p normalized to %d bytes (segs %d).\n", STbuffer->b_data, STbuffer->buffer_size, STbuffer->sg_segs); #endif STbuffer->sg_segs = STbuffer->orig_sg_segs; @@ -4716,7 +5009,7 @@ i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++) offset -= st_bp->sg[i].length; if (i == st_bp->sg_segs) { /* Should never happen */ - printk(KERN_WARNING "osst: Append_to_buffer offset overflow.\n"); + printk(KERN_WARNING "osst :A: Append_to_buffer offset overflow.\n"); return (-EIO); } for ( ; i < st_bp->sg_segs && do_count > 0; i++) { @@ -4731,7 +5024,7 @@ offset = 0; } if (do_count) { /* Should never happen */ - printk(KERN_WARNING "osst: Append_to_buffer overflow (left %d).\n", + printk(KERN_WARNING "osst :A: Append_to_buffer overflow (left %d).\n", do_count); return (-EIO); } @@ -4749,7 +5042,7 @@ i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++) offset -= st_bp->sg[i].length; if (i == st_bp->sg_segs) { /* Should never happen */ - printk(KERN_WARNING "osst: From_buffer offset overflow.\n"); + printk(KERN_WARNING "osst :A: From_buffer offset overflow.\n"); return (-EIO); } for ( ; i < st_bp->sg_segs && do_count > 0; i++) { @@ -4765,7 +5058,7 @@ offset = 0; } if (do_count) { /* Should never happen */ - printk(KERN_WARNING "osst: From_buffer overflow (left %d).\n", + printk(KERN_WARNING "osst :A: From_buffer overflow (left %d).\n", do_count); return (-EIO); } @@ -4782,10 +5075,10 @@ i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++) offset -= st_bp->sg[i].length; if (i == st_bp->sg_segs) { /* Should never happen */ - printk(KERN_WARNING "osst: Zero_buffer offset overflow.\n"); + printk(KERN_WARNING "osst :A: Zero_buffer offset overflow.\n"); return (-EIO); } - for (do_count = OS_DATA_SIZE - st_bp->read_pointer; + for (do_count = OS_DATA_SIZE - st_bp->buffer_bytes; i < st_bp->sg_segs && do_count > 0; i++) { cnt = st_bp->sg[i].length - offset < do_count ? st_bp->sg[i].length - offset : do_count ; @@ -4794,13 +5087,13 @@ offset = 0; } if (do_count) { /* Should never happen */ - printk(KERN_WARNING "osst: Zero_buffer overflow (left %d).\n", do_count); + printk(KERN_WARNING "osst :A: Zero_buffer overflow (left %d).\n", do_count); return (-EIO); } return 0; } -/* Copy a osst 32K block of memory into the buffer. +/* Copy a osst 32K chunk of memory into the buffer. Returns zero (success) or negative error code. */ static int osst_copy_to_buffer(OSST_buffer *st_bp, unsigned char *ptr) { @@ -4814,14 +5107,14 @@ ptr += cnt; } if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */ - printk(KERN_WARNING "osst: Copy_to_buffer overflow (left %d at sg %d).\n", + printk(KERN_WARNING "osst :A: Copy_to_buffer overflow (left %d at sg %d).\n", do_count, i); return (-EIO); } return 0; } -/* Copy a osst 32K block of memory from the buffer. +/* Copy a osst 32K chunk of memory from the buffer. Returns zero (success) or negative error code. */ static int osst_copy_from_buffer(OSST_buffer *st_bp, unsigned char *ptr) { @@ -4835,7 +5128,7 @@ ptr += cnt; } if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */ - printk(KERN_WARNING "osst: Copy_from_buffer overflow (left %d at sg %d).\n", + printk(KERN_WARNING "osst :A: Copy_from_buffer overflow (left %d at sg %d).\n", do_count, i); return (-EIO); } @@ -4847,8 +5140,8 @@ #ifndef MODULE /* Set the boot options. Syntax: st=xxx,yyy - where xxx is buffer size in 1024 byte blocks and yyy is write threshold - in 1024 byte blocks. */ + where xxx is buffer size in 1024 byte chunks and yyy is write threshold + in 1024 byte chunks. */ __initfunc( void osst_setup(char *str, int *ints)) { if (ints[0] > 0 && ints[1] > 0) @@ -4883,7 +5176,7 @@ OS_Scsi_Tape * tpnt; ST_mode * STm; ST_partstat * STps; - int i; + int i, dev; #ifdef CONFIG_DEVFS_FS int mode; #endif @@ -4904,16 +5197,17 @@ tpnt = (OS_Scsi_Tape *)kmalloc(sizeof(OS_Scsi_Tape), GFP_ATOMIC); if (tpnt == NULL) { SDp->attached--; - printk(KERN_ERR "osst: Can't allocate device descriptor.\n"); + printk(KERN_WARNING "osst :W: Can't allocate device descriptor.\n"); return 1; } memset(tpnt, 0, sizeof(OS_Scsi_Tape)); os_scsi_tapes[i] = tpnt; + dev = i; tpnt->capacity = 0xfffff; /* allocate a buffer for this device */ if (!new_tape_buffer(TRUE, TRUE)) - printk(KERN_ERR "osst: Unable to allocate a tape buffer.\n"); + printk(KERN_ERR "osst :W: Unable to allocate a tape buffer.\n"); #ifdef CONFIG_DEVFS_FS for (mode = 0; mode < ST_NBR_MODES; ++mode) { @@ -4960,17 +5254,12 @@ tpnt->long_timeout = OSST_LONG_TIMEOUT; /* Recognize OnStream tapes */ - printk ("osst%i: Tape driver with OnStream support osst %s\nosst%i: %s\n", - i, osst_version, i, cvsid); /* We don't need to test for OnStream, as this has been done in detect () */ tpnt->os_fw_rev = osst_parse_firmware_rev (SDp->rev); -#if DEBUG - printk ("osst%i: OnStream tape drive recognized, Model %s\n", i, SDp->model); -#endif tpnt->omit_blklims = 1; tpnt->poll = (strncmp(SDp->model, "DI-", 3) == 0) || OSST_FW_NEED_POLL(tpnt->os_fw_rev,SDp); - tpnt->logical_blk_in_buffer = 0; + tpnt->frame_in_buffer = 0; tpnt->header_ok = 0; tpnt->linux_media = 0; tpnt->header_cache = NULL; @@ -4984,7 +5273,7 @@ STm->do_buffer_writes = OSST_BUFFER_WRITES; STm->do_read_ahead = OSST_READ_AHEAD; STm->default_compression = ST_DONT_TOUCH; - STm->default_blksize = 32 * ST_KILOBYTE; /* No forced size */ + STm->default_blksize = 512; STm->default_density = (-1); /* No forced density */ } @@ -5005,6 +5294,10 @@ tpnt->blksize_changed = FALSE; osst_template.nr_dev++; + + printk(KERN_INFO "osst :I: Attached OnStream %.5s tape at scsi%d, channel %d, id %d, lun %d as osst%d\n", + SDp->model, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun, dev); + return 0; }; @@ -5016,10 +5309,7 @@ * layer (ide-scsi, usb-storage, ...) */ if (!OSST_SUPPORTS(SDp)) return 0; - printk(KERN_WARNING - "Detected OnStream scsi tape osst%d at scsi%d, channel %d, id %d, lun %d\n", - osst_template.dev_noticed++, - SDp->host->host_no, SDp->channel, SDp->id, SDp->lun); + osst_template.dev_noticed++; return 1; } @@ -5039,7 +5329,7 @@ #else if (register_chrdev(MAJOR_NR,"osst",&osst_fops)) { #endif - printk(KERN_ERR "osst: Unable to get major %d for OnStream tapes\n",MAJOR_NR); + printk(KERN_ERR "osst :W: Unable to get major %d for OnStream tapes\n",MAJOR_NR); return 1; } osst_registered++; @@ -5048,12 +5338,12 @@ if (os_scsi_tapes) return 0; osst_template.dev_max = OSST_MAX_TAPES; if (osst_template.dev_max > 128 / ST_NBR_MODES) - printk(KERN_INFO "osst: Only %d tapes accessible.\n", 128 / ST_NBR_MODES); + printk(KERN_INFO "osst :I: Only %d tapes accessible.\n", 128 / ST_NBR_MODES); os_scsi_tapes = (OS_Scsi_Tape **)kmalloc(osst_template.dev_max * sizeof(OS_Scsi_Tape *), GFP_ATOMIC); if (os_scsi_tapes == NULL) { - printk(KERN_ERR "osst: Unable to allocate array for OnStream SCSI tapes.\n"); + printk(KERN_ERR "osst :W: Unable to allocate array for OnStream SCSI tapes.\n"); #ifdef CONFIG_DEVFS_FS devfs_unregister_chrdev(MAJOR_NR, "osst"); #else @@ -5069,7 +5359,7 @@ (OSST_buffer **)kmalloc(osst_template.dev_max * sizeof(OSST_buffer *), GFP_ATOMIC); if (osst_buffers == NULL) { - printk(KERN_ERR "osst: Unable to allocate tape buffer pointers.\n"); + printk(KERN_ERR "osst :W: Unable to allocate tape buffer pointers.\n"); #ifdef CONFIG_DEVFS_FS devfs_unregister_chrdev(MAJOR_NR, "osst"); #else @@ -5080,8 +5370,10 @@ } osst_nbr_buffers = 0; + printk(KERN_INFO "osst :I: Tape driver with OnStream support version %s\nosst :I: %s\n", osst_version, cvsid); + #if DEBUG - printk(OSST_DEB_MSG "osst: Buffer size %d bytes, write threshold %d bytes.\n", + printk(OSST_DEB_MSG "osst :D: Buffer size %d bytes, write threshold %d bytes.\n", osst_buffer_size, osst_write_threshold); #endif return 0; @@ -5135,9 +5427,12 @@ osst_max_buffers = max_buffers; if (max_sg_segs >= OSST_FIRST_SG) osst_max_sg_segs = max_sg_segs; - printk(KERN_INFO "osst: bufsize %d, wrt %d, max buffers %d, s/g segs %d.\n", +#if DEBUG + printk(OSST_DEB_MSG "osst :D: bufsize %d, wrt %d, max buffers %d, s/g segs %d.\n", osst_buffer_size, osst_write_threshold, osst_max_buffers, osst_max_sg_segs); -//printk(OSST_DEB_MSG "osst: sizeof(header) = %d (%s)\n",sizeof(os_header_t),sizeof(os_header_t)==OS_DATA_SIZE?"ok":"error"); +//printk(OSST_DEB_MSG "osst :D: sizeof(header) = %d (%s)\n", +// sizeof(os_header_t),sizeof(os_header_t)==OS_DATA_SIZE?"ok":"error"); +#endif osst_template.module = &__this_module; result = scsi_register_module(MODULE_SCSI_DEV, &osst_template); if (result) @@ -5179,6 +5474,6 @@ } } osst_template.dev_max = 0; - printk(KERN_INFO "osst: Unloaded.\n"); + printk(KERN_INFO "osst :I: Unloaded.\n"); } #endif /* MODULE */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/osst.h linux.20p9/drivers/scsi/osst.h --- linux.vanilla/drivers/scsi/osst.h Sun Mar 25 17:37:36 2001 +++ linux.20p9/drivers/scsi/osst.h Thu Jul 26 18:13:59 2001 @@ -1,5 +1,5 @@ /* - * $Header: /home/cvsroot/Driver/osst.h,v 1.5.2.2 2000/10/08 03:07:33 riede Exp $ + * $Header: /home/cvsroot/Driver/osst.h,v 1.5.2.4 2001/01/26 01:30:56 riede Exp $ */ #include @@ -319,7 +319,8 @@ * Linux specific fields: */ __u32 next_mark_ppos; /* when known, points to next marker */ - __u8 linux_specific[28]; + __u32 last_mark_lbn; /* storing log_blk_num of last mark is extends ADR spec */ + __u8 linux_specific[24]; __u8 reserved_256_511[256]; } os_aux_t; @@ -459,6 +460,8 @@ int min_block; int max_block; int recover_count; /* from tape opening */ + int write_count; + int read_count; int recover_erreg; /* from last status call */ /* * OnStream specific data @@ -466,8 +469,9 @@ int os_fw_rev; /* the firmware revision * 10000 */ unsigned char raw; /* flag OnStream raw access (32.5KB block size) */ unsigned char poll; /* flag that this drive needs polling (IDE|firmware) */ - unsigned char logical_blk_in_buffer; /* flag that the block as per logical_blk_num + unsigned char frame_in_buffer; /* flag that the frame as per frame_seq_number * has been read into STp->buffer and is valid */ + int frame_seq_number; /* logical frame number */ int logical_blk_num; /* logical block number */ unsigned first_frame_position; /* physical frame to be transfered to/from host */ unsigned last_frame_position; /* physical frame to be transferd to/from tape */ @@ -485,6 +489,7 @@ int filemark_cnt; int first_mark_ppos; int last_mark_ppos; + int last_mark_lbn; /* storing log_blk_num of last mark is extends ADR spec */ int first_data_ppos; int eod_frame_ppos; int eod_frame_lfa; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/osst_options.h linux.20p9/drivers/scsi/osst_options.h --- linux.vanilla/drivers/scsi/osst_options.h Sun Mar 25 17:37:36 2001 +++ linux.20p9/drivers/scsi/osst_options.h Wed Jul 4 16:03:58 2001 @@ -8,7 +8,7 @@ Changed (and renamed) for OnStream SCSI drives garloff@suse.de 2000-06-21 - $Header: /home/cvsroot/Driver/osst_options.h,v 1.4 2000/06/26 01:44:01 riede Exp $ + $Header: /home/cvsroot/Driver/osst_options.h,v 1.4.2.1 2000/11/25 22:02:44 riede Exp $ */ #ifndef _OSST_OPTIONS_H @@ -24,7 +24,7 @@ because of buffered reads. Should be set to zero to support also drives that can't space backwards over records. NOTE: The tape will be spaced backwards over an "accidentally" crossed filemark in any case. */ -#define OSST_IN_FILE_POS 0 +#define OSST_IN_FILE_POS 1 /* The tape driver buffer size in kilobytes. */ /* Don't change, as this is the HW blocksize */ @@ -33,7 +33,13 @@ /* The number of kilobytes of data in the buffer that triggers an asynchronous write in fixed block mode. See also OSST_ASYNC_WRITES below. */ -#define OSST_WRITE_THRESHOLD_BLOCKS 30 +#define OSST_WRITE_THRESHOLD_BLOCKS 32 + +/* OSST_EOM_RESERVE defines the number of frames are kept in reserve for + * * write error recovery when writing near end of medium. ENOSPC is returned + * * when write() is called and the tape write position is within this number + * * of blocks from the tape capacity. */ +#define OSST_EOM_RESERVE 300 /* The maximum number of tape buffers the driver allocates. The number is also constrained by the number of drives detected. Determines the @@ -64,7 +70,7 @@ /* If OSST_BUFFER_WRITES is non-zero, writes in fixed block mode are buffered until the driver buffer is full or asynchronous write is - triggered. May make detection of End-Of-Medium early enough fail. */ + triggered. */ #define OSST_BUFFER_WRITES 1 /* If OSST_ASYNC_WRITES is non-zero, the SCSI write command may be started diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/qlogicfc.c linux.20p9/drivers/scsi/qlogicfc.c --- linux.vanilla/drivers/scsi/qlogicfc.c Sun Mar 25 17:31:33 2001 +++ linux.20p9/drivers/scsi/qlogicfc.c Thu Jul 26 15:42:11 2001 @@ -1324,6 +1324,7 @@ case WRITE_6: case WRITE_BUFFER: case MODE_SELECT: + case MODE_SELECT_10: cmd->control_flags = CFLAG_WRITE; break; case REQUEST_SENSE: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/qlogicpti.c linux.20p9/drivers/scsi/qlogicpti.c --- linux.vanilla/drivers/scsi/qlogicpti.c Sun Mar 25 17:31:32 2001 +++ linux.20p9/drivers/scsi/qlogicpti.c Wed Jul 4 16:03:58 2001 @@ -648,7 +648,8 @@ /* Is this a red snapper? */ if(strcmp(qpti_dev->prom_name, "ptisp") && strcmp(qpti_dev->prom_name, "PTI,ptisp") && - strcmp(qpti_dev->prom_name, "QLGC,isp")) + strcmp(qpti_dev->prom_name, "QLGC,isp") && + strcmp(qpti_dev->prom_name, "SUNW,isp")) continue; /* Sometimes Antares cards come up not completely diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/sd_ioctl.c linux.20p9/drivers/scsi/sd_ioctl.c --- linux.vanilla/drivers/scsi/sd_ioctl.c Sun Mar 25 17:31:30 2001 +++ linux.20p9/drivers/scsi/sd_ioctl.c Wed Jul 4 16:03:58 2001 @@ -57,6 +57,7 @@ diskinfo[2] = rscsi_disks[DEVICE_NR(dev)].capacity >> 11; /* override with calculated, extended default, or driver values */ +/* this is the only call of hostt->bios_param() */ if(host->hostt->bios_param != NULL) host->hostt->bios_param(&rscsi_disks[DEVICE_NR(dev)], diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/sg.c linux.20p9/drivers/scsi/sg.c --- linux.vanilla/drivers/scsi/sg.c Sun Mar 25 17:31:30 2001 +++ linux.20p9/drivers/scsi/sg.c Wed Jul 4 16:03:58 2001 @@ -7,7 +7,7 @@ * Original driver (sg.c): * Copyright (C) 1992 Lawrence Foard * 2.x extensions to driver: - * Copyright (C) 1998 - 2000 Douglas Gilbert + * Copyright (C) 1998 - 2001 Douglas Gilbert * * 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 @@ -16,8 +16,8 @@ * * Borrows code from st driver. Thanks to Alessandro Rubini's "dd" book. */ - static char * sg_version_str = "Version: 2.1.39 (20000626)"; - static int sg_version_num = 20139; /* 2 digits for each component */ + static char * sg_version_str = "Version: 2.1.40 (20010620)"; + static int sg_version_num = 20140; /* 2 digits for each component */ /* * D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes: * - scsi logging is available via SCSI_LOG_TIMEOUT macros. First @@ -1635,18 +1635,14 @@ } /* If retSzp==NULL want exact size or fail */ -/* sg_low_malloc() should always be called from a process context allowing - GFP_KERNEL to be used instead of GFP_ATOMIC */ static char * sg_low_malloc(int rqSz, int lowDma, int mem_src, int * retSzp) { char * resp = NULL; - int page_mask = lowDma ? (GFP_KERNEL | GFP_DMA) : GFP_KERNEL; + int page_mask = lowDma ? (GFP_ATOMIC | GFP_DMA) : GFP_ATOMIC; if (rqSz <= 0) return resp; if (SG_HEAP_KMAL == mem_src) { - page_mask = lowDma ? (GFP_ATOMIC | GFP_DMA) : GFP_ATOMIC; - /* Seen kmalloc(..,GFP_KERNEL) hang for 40 secs! */ resp = kmalloc(rqSz, page_mask); if (resp && retSzp) *retSzp = rqSz; #ifdef SG_DEBUG diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/sym53c8xx.c linux.20p9/drivers/scsi/sym53c8xx.c --- linux.vanilla/drivers/scsi/sym53c8xx.c Sun Mar 25 17:31:33 2001 +++ linux.20p9/drivers/scsi/sym53c8xx.c Wed Jul 4 16:03:58 2001 @@ -3646,7 +3646,7 @@ ** some target to reset or some disconnected ** job to abort. Since error recovery is a serious ** busyness, we will really reset the SCSI BUS, if - ** case of a SCSI interrupt occuring in this path. + ** case of a SCSI interrupt occurring in this path. */ /* @@ -8635,7 +8635,7 @@ ** si: sist ** ** SCSI bus lines: -** so: control lines as driver by NCR. +** so: control lines as driven by NCR. ** si: control lines as seen by NCR. ** sd: scsi data lines as seen by NCR. ** @@ -8644,7 +8644,7 @@ ** scntl3: (see the manual) ** ** current script command: -** dsp: script adress (relative to start of script). +** dsp: script address (relative to start of script). ** dbc: first word of script command. ** ** First 24 register of the chip: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/scsi/sym53c8xx_defs.h linux.20p9/drivers/scsi/sym53c8xx_defs.h --- linux.vanilla/drivers/scsi/sym53c8xx_defs.h Sun Mar 25 17:31:33 2001 +++ linux.20p9/drivers/scsi/sym53c8xx_defs.h Wed Aug 8 22:41:06 2001 @@ -483,7 +483,7 @@ #endif /* - * If the CPU and the NCR use same endian-ness adressing, + * If the CPU and the NCR use same endian-ness addressing, * no byte reordering is needed for script patching. * Macro cpu_to_scr() is to be used for script patching. * Macro scr_to_cpu() is to be used for getting a DWORD @@ -517,7 +517,7 @@ * would have been correctly designed for PCI, this * option would be useless. * - * If the CPU and the NCR use same endian-ness adressing, + * If the CPU and the NCR use same endian-ness addressing, * no byte reordering is needed for accessing chip io * registers. Functions suffixed by '_raw' are assumed * to access the chip over the PCI without doing byte diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/Makefile linux.20p9/drivers/usb/Makefile --- linux.vanilla/drivers/usb/Makefile Sun Mar 25 17:31:42 2001 +++ linux.20p9/drivers/usb/Makefile Wed Aug 8 22:23:53 2001 @@ -23,7 +23,7 @@ # Multipart objects. list-multi := usbcore.o -usbcore-objs := usb.o usb-debug.o usb-core.o hub.o +usbcore-objs := usb.o usb-debug.o hub.o # Optional parts of multipart objects. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/acm.c linux.20p9/drivers/usb/acm.c --- linux.vanilla/drivers/usb/acm.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/acm.c Wed Aug 8 22:23:50 2001 @@ -1,5 +1,5 @@ /* - * acm.c Version 0.16 + * acm.c Version 0.18 * * Copyright (c) 1999 Armin Fuerst * Copyright (c) 1999 Pavel Machek @@ -19,6 +19,8 @@ * v0.14 - sized down struct acm * v0.15 - fixed flow control again - characters could be lost * v0.16 - added code for modems with swapped data and control interfaces + * v0.17 - added new style probing + * v0.18 - fixed new style probing for devices with more configurations */ /* @@ -45,15 +47,22 @@ #include #include #include +#include #include #include -#include #include -//#define DEBUG +#undef DEBUG #include #include /* + * Version Information + */ +#define DRIVER_VERSION "v0.18" +#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik" +#define DRIVER_DESC "USB Abstract Control Model driver for USB modems and ISDN adapters" + +/* * CMSPAR, some architectures can't have space and mark parity. */ @@ -145,7 +154,7 @@ static struct usb_driver acm_driver; static struct tty_driver acm_tty_driver; -static struct acm *acm_table[ACM_TTY_MINORS] = { NULL, /* .... */ }; +static struct acm *acm_table[ACM_TTY_MINORS]; #define ACM_READY(acm) (acm && acm->dev && acm->used) @@ -232,8 +241,14 @@ dbg("nonzero read bulk status received: %d", urb->status); if (!urb->status & !acm->throttle) { - for (i = 0; i < urb->actual_length && !acm->throttle; i++) + for (i = 0; i < urb->actual_length && !acm->throttle; i++) { + /* if we insert more than TTY_FLIPBUF_SIZE characters, + * we drop them. */ + if (tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty_flip_buffer_push(tty); + } tty_insert_flip_char(tty, data[i], 0); + } tty_flip_buffer_push(tty); } @@ -244,6 +259,7 @@ } urb->actual_length = 0; + urb->dev = acm->dev; if (usb_submit_urb(urb)) dbg("failed resubmitting read urb"); @@ -292,14 +308,20 @@ if (acm->used++) return 0; + acm->ctrlurb.dev = acm->dev; if (usb_submit_urb(&acm->ctrlurb)) dbg("usb_submit_urb(ctrl irq) failed"); + acm->readurb.dev = acm->dev; if (usb_submit_urb(&acm->readurb)) dbg("usb_submit_urb(read bulk) failed"); acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS); + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates data can get lost. */ + tty->low_latency = 1; + return 0; } @@ -340,6 +362,7 @@ memcpy(acm->writeurb.transfer_buffer, buf, count); acm->writeurb.transfer_buffer_length = count; + acm->writeurb.dev = acm->dev; if (usb_submit_urb(&acm->writeurb)) dbg("usb_submit_urb(write bulk) failed"); @@ -500,7 +523,7 @@ ifcom = cfacm->interface[0].altsetting + 0; ifdata = cfacm->interface[1].altsetting + 0; - if (ifdata->bInterfaceClass != 10 || ifdata->bNumEndpoints != 2) { + if (ifdata->bInterfaceClass != 10 || ifdata->bNumEndpoints < 2) { ifcom = cfacm->interface[1].altsetting + 0; ifdata = cfacm->interface[0].altsetting + 0; if (ifdata->bInterfaceClass != 10 || ifdata->bNumEndpoints < 2) @@ -563,7 +586,7 @@ FILL_BULK_URB(&acm->writeurb, dev, usb_sndbulkpipe(dev, epwrite->bEndpointAddress), buf += readsize, acm->writesize, acm_write_bulk, acm); - + printk(KERN_INFO "ttyACM%d: USB ACM device\n", minor); acm_set_control(acm, acm->ctrlout); @@ -679,6 +702,8 @@ return -1; } + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -691,5 +716,6 @@ module_init(acm_init); module_exit(acm_exit); -MODULE_AUTHOR("Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik"); -MODULE_DESCRIPTION("USB Abstract Control Model driver for USB modems and ISDN adapters"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/bluetooth.c linux.20p9/drivers/usb/bluetooth.c --- linux.vanilla/drivers/usb/bluetooth.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/bluetooth.c Wed Aug 8 22:24:15 2001 @@ -1,10 +1,19 @@ /* - * bluetooth.c Version 0.7 + * bluetooth.c Version 0.8 * * Copyright (c) 2000 Greg Kroah-Hartman * Copyright (c) 2000 Mark Douglas Corner * * USB Bluetooth driver, based on the Bluetooth Spec version 1.0B + * + * (08/04/2001) gb + * Identify version on module load. + * + * (2001/03/10) Version 0.8 gkh + * Fixed problem with not unlinking interrupt urb on device close + * and resubmitting the read urb on error with bluetooth struct. + * Thanks to Narayan Mohanram for the + * fixes. * * (11/29/2000) Version 0.7 gkh * Fixed problem with overrunning the tty flip buffer. @@ -86,9 +95,12 @@ #define DEBUG #include -/* Module information */ -MODULE_AUTHOR("Greg Kroah-Hartman, Mark Douglas Corner"); -MODULE_DESCRIPTION("USB Bluetooth driver"); +/* + * Version Information + */ +#define DRIVER_VERSION "v0.8" +#define DRIVER_AUTHOR "Greg Kroah-Hartman, Mark Douglas Corner" +#define DRIVER_DESC "USB Bluetooth driver" /* define this if you have hardware that is not good */ /*#define BTBUGGYHARDWARE */ @@ -371,6 +383,7 @@ for (i = 0; i < NUM_BULK_URBS; ++i) usb_unlink_urb (bluetooth->write_urb_pool[i]); usb_unlink_urb (bluetooth->read_urb); + usb_unlink_urb (bluetooth->interrupt_in_urb); bluetooth->active = 0; } @@ -844,7 +857,7 @@ if (!bluetooth) { dbg(__FUNCTION__ " - bad bluetooth pointer, exiting"); - goto exit; + return; } if (urb->status) { @@ -1274,6 +1287,8 @@ return -1; } + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -1288,4 +1303,7 @@ module_init(usb_bluetooth_init); module_exit(usb_bluetooth_exit); +/* Module information */ +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/dabusb.c linux.20p9/drivers/usb/dabusb.c --- linux.vanilla/drivers/usb/dabusb.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/dabusb.c Wed Aug 8 22:24:15 2001 @@ -43,6 +43,13 @@ #include "dabusb.h" #include "dabfirmware.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.54" +#define DRIVER_AUTHOR "Deti Fliegl, deti@fliegl.de" +#define DRIVER_DESC "DAB-USB Interface Driver for Linux (c)1999" + /* --------------------------------------------------------------------- */ #define NRDABUSB 4 @@ -173,8 +180,8 @@ // process if URB was not killed if (purb->status != -ENOENT) { - unsigned int pipe = usb_rcvisocpipe (s->usbdev, _DABUSB_ISOPIPE); - int pipesize = usb_maxpacket (s->usbdev, pipe, usb_pipeout (pipe)); + unsigned int pipe = usb_rcvisocpipe (purb->dev, _DABUSB_ISOPIPE); + int pipesize = usb_maxpacket (purb->dev, pipe, usb_pipeout (pipe)); for (i = 0; i < purb->number_of_packets; i++) if (!purb->iso_frame_desc[i].status) { len = purb->iso_frame_desc[i].actual_length; @@ -456,8 +463,6 @@ end = list_entry (s->rec_buff_list.prev, buff_t, buff_list); - end->purb->dev=s->usbdev; - ret = usb_submit_urb (end->purb); if (ret) { err("usb_submit_urb returned:%d", ret); @@ -793,11 +798,11 @@ static struct usb_driver dabusb_driver = { - "dabusb", - dabusb_probe, - dabusb_disconnect, - {NULL, NULL}, - &dabusb_fops, + name: "dabusb", + probe: dabusb_probe, + disconnect: dabusb_disconnect, + fops: &dabusb_fops, + minor: DABUSB_MINOR, DABUSB_MINOR }; @@ -826,6 +831,9 @@ return -1; dbg("dabusb_init: driver registered"); + + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -838,8 +846,9 @@ /* --------------------------------------------------------------------- */ -MODULE_AUTHOR ("Deti Fliegl, deti@fliegl.de"); -MODULE_DESCRIPTION ("DAB-USB Interface Driver for Linux (c)1999"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + MODULE_PARM (buffers, "i"); MODULE_PARM_DESC (buffers, "Number of buffers (default=256)"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/dabusb.h linux.20p9/drivers/usb/dabusb.h --- linux.vanilla/drivers/usb/dabusb.h Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/dabusb.h Wed Jul 4 16:03:58 2001 @@ -23,7 +23,7 @@ wait_queue_head_t wait; wait_queue_head_t remove_ok; spinlock_t lock; - volatile atomic_t pending_io; + atomic_t pending_io; driver_state_t state; int remove_pending; int got_mem; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/dc2xx.c linux.20p9/drivers/usb/dc2xx.c --- linux.vanilla/drivers/usb/dc2xx.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/dc2xx.c Wed Aug 8 22:24:15 2001 @@ -44,11 +44,13 @@ * 03 Nov, 1999 -- update for 2.3.25 kernel API changes. * 08 Jan, 2000 .. multiple camera support * 12 Aug, 2000 .. add some real locking, remove an Oops + * 08 Apr, 2001 .. Identify version on module load. gb * * Thanks to: the folk who've provided USB product IDs, sent in - * patches, and shared their sucesses! + * patches, and shared their successes! */ +#include #include #include #include @@ -59,6 +61,7 @@ #include #include #include + #ifdef CONFIG_USB_DEBUG #define DEBUG #else @@ -67,6 +70,13 @@ #include +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "David Brownell, " +#define DRIVER_DESC "USB Camera Driver for Kodak DC-2xx series cameras" + /* current USB framework handles max of 16 USB devices per driver */ #define MAX_CAMERAS 16 @@ -170,7 +180,7 @@ usb_rcvbulkpipe (camera->dev, camera->inEP), camera->buf, len, &count, HZ*10); - dbg ("read (%d) - 0x%x %d", len, retval, count); + dbg ("read (%Zd) - 0x%x %d", len, retval, count); if (!retval) { if (copy_to_user (buf, camera->buf, count)) @@ -183,7 +193,7 @@ break; interruptible_sleep_on_timeout (&camera->wait, RETRY_TIMEOUT); - dbg ("read (%d) - retry", len); + dbg ("read (%Zd) - retry", len); } up (&camera->sem); return retval; @@ -267,7 +277,7 @@ } done: up (&camera->sem); - dbg ("wrote %d", bytes_written); + dbg ("wrote %Zd", bytes_written); return bytes_written; } @@ -324,8 +334,9 @@ if (!camera->dev) { minor_data [subminor] = NULL; kfree (camera); - } - up (&camera->sem); + } else + up (&camera->sem); + up (&state_table_mutex); dbg ("close #%d", subminor); @@ -396,7 +407,6 @@ } if (i >= MAX_CAMERAS) { info ("Ignoring additional USB Camera"); - up (&state_table_mutex); goto bye; } @@ -404,7 +414,6 @@ camera = minor_data [i] = kmalloc (sizeof *camera, GFP_KERNEL); if (!camera) { err ("no memory!"); - up (&state_table_mutex); goto bye; } @@ -471,13 +480,15 @@ if (!camera->buf) { minor_data [subminor] = NULL; kfree (camera); + camera = NULL; } else camera->dev = NULL; info ("USB Camera #%d disconnected", subminor); usb_dec_dev_use (dev); - up (&camera->sem); + if (camera != NULL) + up (&camera->sem); up (&state_table_mutex); } @@ -496,6 +507,7 @@ { if (usb_register (&camera_driver) < 0) return -1; + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -504,9 +516,9 @@ usb_deregister (&camera_driver); } - -MODULE_AUTHOR("David Brownell, dbrownell@users.sourceforge.net"); -MODULE_DESCRIPTION("USB Camera Driver for Kodak DC-2xx series cameras"); - module_init (usb_dc2xx_init); module_exit (usb_dc2xx_cleanup); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/hub.c linux.20p9/drivers/usb/hub.c --- linux.vanilla/drivers/usb/hub.c Sun Mar 25 17:31:42 2001 +++ linux.20p9/drivers/usb/hub.c Wed Aug 8 22:23:57 2001 @@ -35,7 +35,7 @@ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); static int khubd_pid = 0; /* PID of khubd */ -static int khubd_running = 0; +static DECLARE_MUTEX_LOCKED(khubd_exited); static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size) { @@ -76,34 +76,33 @@ data, sizeof(struct usb_hub_status), HZ); } -/* - * A irq handler returns non-zero to indicate to - * the low-level driver that it wants to be re-activated, - * or zero to say "I'm done". - */ static void hub_irq(struct urb *urb) { struct usb_hub *hub = (struct usb_hub *)urb->context; unsigned long flags; + /* Cause a hub reset after 10 consecutive errors */ if (urb->status) { - if (urb->status != -ENOENT) - dbg("nonzero status in irq %d", urb->status); + if (urb->status == -ENOENT) + return; - return; + dbg("nonzero status in irq %d", urb->status); + + if ((++hub->nerrors < 10) || hub->error) + return; + + hub->error = urb->status; } + hub->nerrors = 0; + /* Something happened, let khubd figure it out */ - if (waitqueue_active(&khubd_wait)) { - /* Add the hub to the event queue */ - spin_lock_irqsave(&hub_event_lock, flags); - if (hub->event_list.next == &hub->event_list) { - list_add(&hub->event_list, &hub_event_list); - /* Wake up khubd */ - wake_up(&khubd_wait); - } - spin_unlock_irqrestore(&hub_event_lock, flags); + spin_lock_irqsave(&hub_event_lock, flags); + if (list_empty(&hub->event_list)) { + list_add(&hub->event_list, &hub_event_list); + wake_up(&khubd_wait); } + spin_unlock_irqrestore(&hub_event_lock, flags); } static void usb_hub_power_on(struct usb_hub *hub) @@ -114,40 +113,46 @@ dbg("enabling power on all ports"); for (i = 0; i < hub->nports; i++) usb_set_port_feature(hub->dev, i + 1, USB_PORT_FEAT_POWER); + + /* Wait for power to be enabled */ + wait_ms(hub->descriptor->bPwrOn2PwrGood * 2); } -static int usb_hub_configure(struct usb_hub *hub) +static int usb_hub_configure(struct usb_hub *hub, struct usb_endpoint_descriptor *endpoint) { struct usb_device *dev = hub->dev; - unsigned char buffer[HUB_DESCRIPTOR_MAX_SIZE], *bitmap; - struct usb_hub_descriptor *descriptor; - struct usb_descriptor_header *header; - struct usb_hub_status *hubsts; - int i, ret; + struct usb_hub_status hubstatus; + char portstr[USB_MAXCHILDREN + 1]; + unsigned int pipe; + int i, maxp, ret; + + hub->descriptor = kmalloc(HUB_DESCRIPTOR_MAX_SIZE, GFP_KERNEL); + if (!hub->descriptor) { + err("Unable to kmalloc %d bytes for hub descriptor", HUB_DESCRIPTOR_MAX_SIZE); + return -1; + } /* Request the entire hub descriptor. */ - header = (struct usb_descriptor_header *)buffer; - ret = usb_get_hub_descriptor(dev, buffer, sizeof(buffer)); - /* is large enough for a hub with 127 ports; + ret = usb_get_hub_descriptor(dev, hub->descriptor, HUB_DESCRIPTOR_MAX_SIZE); + /* descriptor> is large enough for a hub with 127 ports; * the hub can/will return fewer bytes here. */ if (ret < 0) { err("Unable to get hub descriptor (err = %d)", ret); + kfree(hub->descriptor); return -1; } - bitmap = kmalloc(header->bLength, GFP_KERNEL); - if (!bitmap) { - err("Unable to kmalloc %d bytes for bitmap", header->bLength); - return -1; - } - - memcpy (bitmap, buffer, header->bLength); - descriptor = (struct usb_hub_descriptor *)bitmap; + le16_to_cpus(&hub->descriptor->wHubCharacteristics); - hub->nports = dev->maxchild = descriptor->bNbrPorts; + hub->nports = dev->maxchild = hub->descriptor->bNbrPorts; info("%d port%s detected", hub->nports, (hub->nports == 1) ? "" : "s"); - switch (descriptor->wHubCharacteristics & HUB_CHAR_LPSM) { + if (hub->descriptor->wHubCharacteristics & HUB_CHAR_COMPOUND) + dbg("part of a compound device"); + else + dbg("standalone hub"); + + switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) { case 0x00: dbg("ganged power switching"); break; @@ -160,12 +165,7 @@ break; } - if (descriptor->wHubCharacteristics & HUB_CHAR_COMPOUND) - dbg("part of a compound device"); - else - dbg("standalone hub"); - - switch (descriptor->wHubCharacteristics & HUB_CHAR_OCPM) { + switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) { case 0x00: dbg("global over-current protection"); break; @@ -178,28 +178,55 @@ break; } - dbg("power on to power good time: %dms", descriptor->bPwrOn2PwrGood * 2); - dbg("hub controller current requirement: %dmA", descriptor->bHubContrCurrent); + dbg("power on to power good time: %dms", hub->descriptor->bPwrOn2PwrGood * 2); + dbg("hub controller current requirement: %dmA", hub->descriptor->bHubContrCurrent); for (i = 0; i < dev->maxchild; i++) - dbg("port %d is%s removable", i + 1, - bitmap[7 + ((i + 1)/8)] & (1 << ((i + 1) % 8)) - ? " not" : ""); + portstr[i] = hub->descriptor->bitmap[((i + 1) / 8)] & (1 << ((i + 1) % 8)) ? 'F' : 'R'; + portstr[dev->maxchild] = 0; - kfree(bitmap); + dbg("port removable status: %s", portstr); - ret = usb_get_hub_status(dev, buffer); + ret = usb_get_hub_status(dev, &hubstatus); if (ret < 0) { err("Unable to get hub status (err = %d)", ret); + kfree(hub->descriptor); return -1; } - hubsts = (struct usb_hub_status *)buffer; + le16_to_cpus(&hubstatus.wHubStatus); + dbg("local power source is %s", - (le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_LOCAL_POWER) ? "lost (inactive)" : "good"); + (hubstatus.wHubStatus & HUB_STATUS_LOCAL_POWER) ? "lost (inactive)" : "good"); dbg("%sover-current condition exists", - (le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_OVERCURRENT) ? "" : "no "); + (hubstatus.wHubStatus & HUB_STATUS_OVERCURRENT) ? "" : "no "); + + /* Start the interrupt endpoint */ + pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); + maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + + if (maxp > sizeof(hub->buffer)) + maxp = sizeof(hub->buffer); + + hub->urb = usb_alloc_urb(0); + if (!hub->urb) { + err("couldn't allocate interrupt urb"); + kfree(hub->descriptor); + return -1; + } + + FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq, + hub, endpoint->bInterval); + ret = usb_submit_urb(hub->urb); + if (ret) { + err("usb_submit_urb failed (%d)", ret); + kfree(hub->descriptor); + return -1; + } + + /* Wake up khubd */ + wake_up(&khubd_wait); usb_hub_power_on(hub); @@ -212,8 +239,6 @@ struct usb_endpoint_descriptor *endpoint; struct usb_hub *hub; unsigned long flags; - unsigned int pipe; - int maxp, ret; interface = &dev->actconfig->interface[i].altsetting[0]; @@ -224,24 +249,32 @@ /* Some hubs have a subclass of 1, which AFAICT according to the */ /* specs is not defined, but it works */ if ((interface->bInterfaceSubClass != 0) && - (interface->bInterfaceSubClass != 1)) + (interface->bInterfaceSubClass != 1)) { + err("invalid subclass (%d) for USB hub device #%d", + interface->bInterfaceSubClass, dev->devnum); return NULL; + } /* Multiple endpoints? What kind of mutant ninja-hub is this? */ - if (interface->bNumEndpoints != 1) + if (interface->bNumEndpoints != 1) { + err("invalid bNumEndpoints (%d) for USB hub device #%d", + interface->bNumEndpoints, dev->devnum); return NULL; + } endpoint = &interface->endpoint[0]; /* Output endpoint? Curiousier and curiousier.. */ if (!(endpoint->bEndpointAddress & USB_DIR_IN)) { - err("Device is hub class, but has output endpoint?"); + err("Device #%d is hub class, but has output endpoint?", + dev->devnum); return NULL; } /* If it's not an interrupt endpoint, we'd better punt! */ - if ((endpoint->bmAttributes & 3) != 3) { - err("Device is hub class, but has endpoint other than interrupt?"); + if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) { + err("Device #%d is hub class, but has endpoint other than interrupt?", + dev->devnum); return NULL; } @@ -258,6 +291,7 @@ INIT_LIST_HEAD(&hub->event_list); hub->dev = dev; + atomic_set(&hub->refcnt, 1); /* Record the new hub's existence */ spin_lock_irqsave(&hub_event_lock, flags); @@ -265,34 +299,11 @@ list_add(&hub->hub_list, &hub_list); spin_unlock_irqrestore(&hub_event_lock, flags); - if (usb_hub_configure(hub) >= 0) { - pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); - maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); - - if (maxp > sizeof(hub->buffer)) - maxp = sizeof(hub->buffer); - - hub->urb = usb_alloc_urb(0); - if (!hub->urb) { - err("couldn't allocate interrupt urb"); - goto fail; - } - - FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq, - hub, endpoint->bInterval); - ret = usb_submit_urb(hub->urb); - if (ret) { - err("usb_submit_urb failed (%d)", ret); - goto fail; - } - - /* Wake up khubd */ - wake_up(&khubd_wait); - } + if (usb_hub_configure(hub, endpoint) >= 0) + return hub; - return hub; + err("hub configuration failed for device #%d", dev->devnum); -fail: /* free hub, but first clean up its list. */ spin_lock_irqsave(&hub_event_lock, flags); @@ -309,11 +320,34 @@ return NULL; } +static void hub_get(struct usb_hub *hub) +{ + atomic_inc(&hub->refcnt); +} + +static void hub_put(struct usb_hub *hub) +{ + if (atomic_dec_and_test(&hub->refcnt)) { + if (hub->descriptor) { + kfree(hub->descriptor); + hub->descriptor = NULL; + } + + kfree(hub); + } +} + static void hub_disconnect(struct usb_device *dev, void *ptr) { struct usb_hub *hub = (struct usb_hub *)ptr; unsigned long flags; + if (hub->urb) { + usb_unlink_urb(hub->urb); + usb_free_urb(hub->urb); + hub->urb = NULL; + } + spin_lock_irqsave(&hub_event_lock, flags); /* Delete it and then reset it */ @@ -324,17 +358,10 @@ spin_unlock_irqrestore(&hub_event_lock, flags); - if (hub->urb) { - usb_unlink_urb(hub->urb); - usb_free_urb(hub->urb); - hub->urb = NULL; - } - - /* Free the memory */ - kfree(hub); + hub_put(hub); } -static int hub_ioctl (struct usb_device *hub, unsigned int code, void *user_data) +static int hub_ioctl(struct usb_device *hub, unsigned int code, void *user_data) { /* assert ifno == 0 (part of hub spec) */ switch (code) { @@ -343,19 +370,19 @@ unsigned long flags; int i; - spin_lock_irqsave (&hub_event_lock, flags); + spin_lock_irqsave(&hub_event_lock, flags); if (hub->devnum <= 0) info->nports = 0; else { info->nports = hub->maxchild; for (i = 0; i < info->nports; i++) { - if (hub->children [i] == NULL) - info->port [i] = 0; + if (hub->children[i] == NULL) + info->port[i] = 0; else - info->port [i] = hub->children [i]->devnum; + info->port[i] = hub->children[i]->devnum; } } - spin_unlock_irqrestore (&hub_event_lock, flags); + spin_unlock_irqrestore(&hub_event_lock, flags); return info->nports + 1; } @@ -365,121 +392,262 @@ } } -static void usb_hub_port_connect_change(struct usb_device *hub, int port) +static int usb_hub_reset(struct usb_hub *hub) { - struct usb_device *usb; - struct usb_port_status portsts; - unsigned short portstatus, portchange; - int ret, tries; - - wait_ms(100); + struct usb_device *dev = hub->dev; + int i; - ret = usb_get_port_status(hub, port + 1, &portsts); - if (ret < 0) { - err("get_port_status(%d) failed (err = %d)", port + 1, ret); - return; + /* Disconnect any attached devices */ + for (i = 0; i < hub->nports; i++) { + if (dev->children[i]) + usb_disconnect(&dev->children[i]); } - portstatus = le16_to_cpu(portsts.wPortStatus); - portchange = le16_to_cpu(portsts.wPortChange); - dbg("portstatus %x, change %x, %s", portstatus, portchange, - portstatus&(1<urb) + usb_unlink_urb(hub->urb); + else + return -1; - /* Clear the connection change status */ - usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_CONNECTION); + if (usb_reset_device(dev)) + return -1; - /* Disconnect any existing devices under this port */ - if (((!(portstatus & USB_PORT_STAT_CONNECTION)) && - (!(portstatus & USB_PORT_STAT_ENABLE)))|| (hub->children[port])) { - usb_disconnect(&hub->children[port]); - /* Return now if nothing is connected */ - if (!(portstatus & USB_PORT_STAT_CONNECTION)) - return; + hub->urb->dev = dev; + if (usb_submit_urb(hub->urb)) + return -1; + + usb_hub_power_on(hub); + + return 0; +} + +static void usb_hub_disconnect(struct usb_device *dev) +{ + struct usb_device *parent = dev->parent; + int i; + + /* Find the device pointer to disconnect */ + if (parent) { + for (i = 0; i < parent->maxchild; i++) { + if (parent->children[i] == dev) { + usb_disconnect(&parent->children[i]); + return; + } + } } - wait_ms(400); - down(&usb_address0_sem); + err("cannot disconnect hub %d", dev->devnum); +} -#define MAX_TRIES 5 - /* Reset the port */ - for (tries = 0; tries < MAX_TRIES ; tries++) { - usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); - wait_ms(200); +#define HUB_RESET_TRIES 5 +#define HUB_PROBE_TRIES 2 +#define HUB_SHORT_RESET_TIME 10 +#define HUB_LONG_RESET_TIME 200 +#define HUB_RESET_TIMEOUT 500 + +static int usb_hub_port_wait_reset(struct usb_device *hub, int port, + struct usb_device *dev, unsigned int delay) +{ + int delay_time, ret; + struct usb_port_status portsts; + unsigned short portchange, portstatus; + + for (delay_time = 0; delay_time < HUB_RESET_TIMEOUT; delay_time += delay) { + /* wait to give the device a chance to reset */ + wait_ms(delay); + /* read and decode port status */ ret = usb_get_port_status(hub, port + 1, &portsts); if (ret < 0) { err("get_port_status(%d) failed (err = %d)", port + 1, ret); - goto out; + return -1; } portstatus = le16_to_cpu(portsts.wPortStatus); portchange = le16_to_cpu(portsts.wPortChange); - dbg("portstatus %x, change %x, %s", portstatus ,portchange, - portstatus&(1<slow = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0; + return 0; + } + + /* switch to the long delay after two short delay failures */ + if (delay_time >= 2 * HUB_SHORT_RESET_TIME) + delay = HUB_LONG_RESET_TIME; - wait_ms(200); + dbg("port %d of hub %d not reset yet, waiting %dms", port + 1, + hub->devnum, delay); } - if (tries >= MAX_TRIES) { - err("Cannot enable port %i after %i retries, disabling port.", port+1, MAX_TRIES); - err("Maybe the USB cable is bad?"); - goto out; + return -1; +} + +static int usb_hub_port_reset(struct usb_device *hub, int port, + struct usb_device *dev, unsigned int delay) +{ + int i; + + /* Reset the port */ + for (i = 0; i < HUB_RESET_TRIES; i++) { + usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); + + /* return success if the port reset OK */ + if (!usb_hub_port_wait_reset(hub, port, dev, delay)) { + usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); + return 0; + } + + dbg("port %d of hub %d not enabled, trying reset again...", + port + 1, hub->devnum); + delay = HUB_LONG_RESET_TIME; } - usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); + err("Cannot enable port %i of hub %d, disabling port.", + port + 1, hub->devnum); + err("Maybe the USB cable is bad?"); - /* Allocate a new device struct for it */ - usb = usb_alloc_dev(hub, hub->bus); - if (!usb) { - err("couldn't allocate usb_device"); - goto out; + return -1; +} + +void usb_hub_port_disable(struct usb_device *hub, int port) +{ + int ret; + + ret = usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_ENABLE); + if (ret) + err("cannot disable port %d of hub %d (err = %d)", + port + 1, hub->devnum, ret); +} + +static void usb_hub_port_connect_change(struct usb_device *hub, int port, + struct usb_port_status *portsts) +{ + struct usb_device *dev; + unsigned short portstatus, portchange; + unsigned int delay = HUB_SHORT_RESET_TIME; + int i; + char *portstr, *tempstr; + + portstatus = le16_to_cpu(portsts->wPortStatus); + portchange = le16_to_cpu(portsts->wPortChange); + dbg("port %d, portstatus %x, change %x, %s", port + 1, portstatus, + portchange, portstatus & (1 << USB_PORT_FEAT_LOWSPEED) ? "1.5 Mb/s" : "12 Mb/s"); + + /* Clear the connection change status */ + usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_CONNECTION); + + /* Disconnect any existing devices under this port */ + if (hub->children[port]) + usb_disconnect(&hub->children[port]); + + /* Return now if nothing is connected */ + if (!(portstatus & USB_PORT_STAT_CONNECTION)) { + if (portstatus & USB_PORT_STAT_ENABLE) + usb_hub_port_disable(hub, port); + + return; } - usb->slow = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0; + /* Some low speed devices have problems with the quick delay, so */ + /* be a bit pessimistic with those devices. RHbug #23670 */ + if (portstatus & USB_PORT_STAT_LOW_SPEED) { + wait_ms(400); + delay = HUB_LONG_RESET_TIME; + } - hub->children[port] = usb; + down(&usb_address0_sem); - /* Find a new device ID for it */ - usb_connect(usb); + tempstr = kmalloc(1024, GFP_KERNEL); + portstr = kmalloc(1024, GFP_KERNEL); - /* Run it through the hoops (find a driver, etc) */ - ret = usb_new_device(usb); - if (ret) { - /* Try resetting the device. Windows does this and it */ - /* gets some devices working correctly */ - usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); + for (i = 0; i < HUB_PROBE_TRIES; i++) { + struct usb_device *pdev, *cdev; + + /* Allocate a new device struct */ + dev = usb_alloc_dev(hub, hub->bus); + if (!dev) { + err("couldn't allocate usb_device"); + break; + } - ret = usb_new_device(usb); - if (ret) { - usb_disconnect(&hub->children[port]); + hub->children[port] = dev; - /* Woops, disable the port */ - dbg("hub: disabling port %d", port + 1); - usb_clear_port_feature(hub, port + 1, - USB_PORT_FEAT_ENABLE); + /* Reset the device */ + if (usb_hub_port_reset(hub, port, dev, delay)) { + usb_free_dev(dev); + break; } - } -out: + /* Find a new device ID for it */ + usb_connect(dev); + + /* Create a readable topology string */ + cdev = dev; + pdev = dev->parent; + if (portstr && tempstr) { + portstr[0] = 0; + while (pdev) { + int port; + + for (port = 0; port < pdev->maxchild; port++) + if (pdev->children[port] == cdev) + break; + + strcpy(tempstr, portstr); + if (!strlen(tempstr)) + sprintf(portstr, "%d", port + 1); + else + sprintf(portstr, "%d/%s", port + 1, tempstr); + + cdev = pdev; + pdev = pdev->parent; + } + info("USB new device connect on bus%d/%s, assigned device number %d", + dev->bus->busnum, portstr, dev->devnum); + } else + info("USB new device connect on bus%d, assigned device number %d", + dev->bus->busnum, dev->devnum); + + /* Run it through the hoops (find a driver, etc) */ + if (!usb_new_device(dev)) + goto done; + + /* Free the configuration if there was an error */ + usb_free_dev(dev); + + /* Switch to a long reset time */ + delay = HUB_LONG_RESET_TIME; + } + + hub->children[port] = NULL; + usb_hub_port_disable(hub, port); +done: up(&usb_address0_sem); + if (portstr) + kfree(portstr); + if (tempstr) + kfree(tempstr); } static void usb_hub_events(void) { unsigned long flags; - int i; struct list_head *tmp; struct usb_device *dev; struct usb_hub *hub; struct usb_hub_status hubsts; unsigned short hubstatus, hubchange; + int i, ret; /* * We restart the list everytime to avoid a deadlock with @@ -491,7 +659,7 @@ spin_lock_irqsave(&hub_event_lock, flags); if (list_empty(&hub_event_list)) - goto he_unlock; + break; /* Grab the next entry from the beginning of the list */ tmp = hub_event_list.next; @@ -502,14 +670,30 @@ list_del(tmp); INIT_LIST_HEAD(tmp); + hub_get(hub); spin_unlock_irqrestore(&hub_event_lock, flags); + if (hub->error) { + dbg("resetting hub %d for error %d", dev->devnum, hub->error); + + if (usb_hub_reset(hub)) { + err("error resetting hub %d - disconnecting", dev->devnum); + usb_hub_disconnect(dev); + hub_put(hub); + continue; + } + + hub->nerrors = 0; + hub->error = 0; + } + for (i = 0; i < hub->nports; i++) { struct usb_port_status portsts; unsigned short portstatus, portchange; - if (usb_get_port_status(dev, i + 1, &portsts) < 0) { - err("get_port_status failed"); + ret = usb_get_port_status(dev, i + 1, &portsts); + if (ret < 0) { + err("get_port_status failed (err = %d)", ret); continue; } @@ -519,27 +703,27 @@ if (portchange & USB_PORT_STAT_C_CONNECTION) { dbg("port %d connection change", i + 1); - usb_hub_port_connect_change(dev, i); - } - - if (portchange & USB_PORT_STAT_C_ENABLE) { + usb_hub_port_connect_change(dev, i, &portsts); + } else if (portchange & USB_PORT_STAT_C_ENABLE) { dbg("port %d enable change, status %x", i + 1, portstatus); usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_ENABLE); - // EM interference sometimes causes bad shielded USB devices to - // be shutdown by the hub, this hack enables them again. - // Works at least with mouse driver. + /* + * EM interference sometimes causes bad shielded USB devices to + * be shutdown by the hub, this hack enables them again. + * Works at least with mouse driver. + */ if (!(portstatus & USB_PORT_STAT_ENABLE) && (portstatus & USB_PORT_STAT_CONNECTION) && (dev->children[i])) { err("already running port %i disabled by hub (EMI?), re-enabling...", i + 1); - usb_hub_port_connect_change(dev, i); + usb_hub_port_connect_change(dev, i, &portsts); } } - if (portstatus & USB_PORT_STAT_SUSPEND) { + if (portchange & USB_PORT_STAT_C_SUSPEND) { dbg("port %d suspend change", i + 1); - usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_SUSPEND); + usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_SUSPEND); } if (portchange & USB_PORT_STAT_C_OVERCURRENT) { @@ -555,9 +739,9 @@ } /* end for i */ /* deal with hub status changes */ - if (usb_get_hub_status(dev, &hubsts) < 0) { + if (usb_get_hub_status(dev, &hubsts) < 0) err("get_hub_status failed"); - } else { + else { hubstatus = le16_to_cpup(&hubsts.wHubStatus); hubchange = le16_to_cpup(&hubsts.wHubChange); if (hubchange & HUB_CHANGE_LOCAL_POWER) { @@ -566,21 +750,19 @@ } if (hubchange & HUB_CHANGE_OVERCURRENT) { dbg("hub overcurrent change"); - wait_ms(500); //Cool down + wait_ms(500); /* Cool down */ usb_clear_hub_feature(dev, C_HUB_OVER_CURRENT); usb_hub_power_on(hub); } } + hub_put(hub); } /* end while (1) */ -he_unlock: spin_unlock_irqrestore(&hub_event_lock, flags); } static int usb_hub_thread(void *__hub) { - khubd_running = 1; - lock_kernel(); /* @@ -602,11 +784,12 @@ } while (!signal_pending(current)); dbg("usb_hub_thread exiting"); - khubd_running = 0; + up(&khubd_exited); return 0; } + static struct usb_driver hub_driver = { name: "hub", probe: hub_probe, @@ -636,6 +819,7 @@ /* Fall through if kernel_thread failed */ usb_deregister(&hub_driver); + err("failed to start usb_hub_thread"); return -1; } @@ -646,21 +830,11 @@ /* Kill the thread */ ret = kill_proc(khubd_pid, SIGTERM, 1); - if (!ret) { - /* Wait 10 seconds */ - int count = 10 * HZ; - while (khubd_running && --count) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - } - - if (!count) - err("giving up on killing khubd"); - } + down(&khubd_exited); /* - * Hub resources are freed for us by usb_deregister. It + * Hub resources are freed for us by usb_deregister. It calls * usb_driver_purge on every device which in turn calls that * devices disconnect function if it is using this driver. * The hub_disconnect function takes care of releasing the @@ -701,23 +875,23 @@ down(&usb_address0_sem); /* Send a reset to the device */ - usb_set_port_feature(parent, port + 1, USB_PORT_FEAT_RESET); - - wait_ms(200); - - usb_clear_port_feature(parent, port + 1, USB_PORT_FEAT_C_RESET); + if (usb_hub_port_reset(parent, port, dev, HUB_SHORT_RESET_TIME)) { + usb_hub_port_disable(parent, port); + up(&usb_address0_sem); + return(-ENODEV); + } /* Reprogram the Address */ ret = usb_set_address(dev); if (ret < 0) { err("USB device not accepting new address (error=%d)", ret); - clear_bit(dev->devnum, &dev->bus->devmap.devicemap); - dev->devnum = -1; + usb_hub_port_disable(parent, port); up(&usb_address0_sem); return ret; } - wait_ms(10); /* Let the SET_ADDRESS settle */ + /* Let the SET_ADDRESS settle */ + wait_ms(10); up(&usb_address0_sem); @@ -748,7 +922,7 @@ if (ret < 0) err("unable to get device descriptor (error=%d)", ret); else - err("USB device descriptor short read (expected %i, got %i)", sizeof(dev->descriptor), ret); + err("USB device descriptor short read (expected %Zi, got %i)", sizeof(dev->descriptor), ret); clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; @@ -768,30 +942,23 @@ usb_set_maxpacket(dev); return 1; - } else { - ret = usb_set_configuration(dev, - dev->actconfig->bConfigurationValue); - if (ret < 0) { - err("failed to set active configuration (error=%d)", - ret); - return ret; - } + } - for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { - struct usb_interface *intf = - &dev->actconfig->interface[i]; - struct usb_interface_descriptor *as = - &intf->altsetting[intf->act_altsetting]; + ret = usb_set_configuration(dev, dev->actconfig->bConfigurationValue); + if (ret < 0) { + err("failed to set active configuration (error=%d)", ret); + return ret; + } - ret = usb_set_interface(dev, as->bInterfaceNumber, - as->bAlternateSetting); - if (ret < 0) { - err("failed to set active alternate setting for interface %d (error=%d)", i, ret); - return ret; - } - } + for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { + struct usb_interface *intf = &dev->actconfig->interface[i]; + struct usb_interface_descriptor *as = &intf->altsetting[intf->act_altsetting]; - return 0; + ret = usb_set_interface(dev, as->bInterfaceNumber, as->bAlternateSetting); + if (ret < 0) { + err("failed to set active alternate setting for interface %d (error=%d)", i, ret); + return ret; + } } return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/hub.h linux.20p9/drivers/usb/hub.h --- linux.vanilla/drivers/usb/hub.h Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/hub.h Wed Aug 8 22:23:57 2001 @@ -82,48 +82,34 @@ __u16 wHubCharacteristics; __u8 bPwrOn2PwrGood; __u8 bHubContrCurrent; + /* DeviceRemovable and PortPwrCtrlMask want to be variable-length bitmaps that hold max 256 entries, but for now they're ignored */ + __u8 bitmap[0]; } __attribute__ ((packed)); struct usb_device; -typedef enum { - USB_PORT_UNPOWERED = 0, /* Default state */ - USB_PORT_POWERED, /* When we've put power to it */ - USB_PORT_ENABLED, /* When it's been enabled */ - USB_PORT_DISABLED, /* If it's been disabled */ - USB_PORT_ADMINDISABLED, /* Forced down */ -} usb_hub_port_state; - -struct usb_hub_port { - usb_hub_port_state cstate; /* Configuration state */ - - struct usb_device *child; /* Device attached to this port */ - - struct usb_hub *parent; /* Parent hub */ -}; - struct usb_hub { - /* Device structure */ struct usb_device *dev; - /* Interrupt polling pipe */ - struct urb *urb; + struct urb *urb; /* Interrupt polling pipe */ char buffer[(USB_MAXCHILDREN + 1 + 7) / 8]; /* add 1 bit for hub status change */ /* and add 7 bits to round up to byte boundary */ + int error; + int nerrors; - /* List of hubs */ struct list_head hub_list; - /* Temporary event list */ struct list_head event_list; /* Number of ports on the hub */ int nports; - struct usb_hub_port ports[0]; /* Dynamically allocated */ + struct usb_hub_descriptor *descriptor; + + atomic_t refcnt; }; #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/mdc800.c linux.20p9/drivers/usb/mdc800.c --- linux.vanilla/drivers/usb/mdc800.c Sun Mar 25 17:31:42 2001 +++ linux.20p9/drivers/usb/mdc800.c Wed Aug 8 22:24:15 2001 @@ -22,13 +22,26 @@ * (c) 1999/2000 Henning Zabel * * - * The driver brings the USB functions of the MDC800 to Linux. + * The driver brings the USB functions of the MDC800 to Linux. * To use the Camera you must support the USB Protocoll of the camera * to the Kernel Node. * The Driver uses a misc device Node. Create it with : * mknod /dev/mustek c 180 32 * * The driver supports only one camera. + * + * (08/04/2001) gb + * Identify version on module load. + * + * version 0.7.5 + * Fixed potential SMP races with Spinlocks. + * Thanks to Oliver Neukum who + * noticed the race conditions. + * (30/10/2000) + * + * Fixed: Setting urb->dev before submitting urb. + * by Greg KH + * (13/10/2000) * * version 0.7.3 * bugfix : The mdc800->state field gets set to READY after the @@ -61,7 +74,7 @@ * (09/11/1999) * * version 0.5.0: - * first Version that gets a version number. Most of the needed + * first Version that gets a version number. Most of the needed * functions work. * (20/10/1999) */ @@ -80,8 +93,12 @@ #include -#define VERSION "0.7.3" -#define RELEASE_DATE "(24/04/2000)" +/* + * Version Information + */ +#define DRIVER_VERSION "v0.7.5 (30/10/2000)" +#define DRIVER_AUTHOR "Henning Zabel " +#define DRIVER_DESC "USB Driver for Mustek MDC800 Digital Camera" /* Vendor and Product Information */ #define MDC800_VENDOR_ID 0x055f @@ -123,7 +140,7 @@ int camera_busy; // is camera busy ? int camera_request_ready; // Status to synchronize with irq - char camera_response [8]; // last Bytes send after busy + char camera_response [8]; // last Bytes send after busy purb_t write_urb; char* write_urb_buffer; @@ -138,16 +155,16 @@ /* Device Data */ char out [64]; // Answer Buffer - int out_ptr; // Index to the first not readen byte + int out_ptr; // Index to the first not readen byte int out_count; // Bytes in the buffer - int open; // Camera device open ? - int rw_lock; // Block read <-> write + int open; // Camera device open ? + spinlock_t io_lock; // IO -lock - char in [8]; // Command Input Buffer + char in [8]; // Command Input Buffer int in_count; - int pic_index; // Cache for the Imagesize (-1 for nothing cached ) + int pic_index; // Cache for the Imagesize (-1 for nothing cached ) int pic_len; }; @@ -253,16 +270,16 @@ } } wake_up= ( mdc800->camera_request_ready > 0 ) - && - ( - ((mdc800->camera_request_ready == 1) && (!mdc800->camera_busy)) - || - ((mdc800->camera_request_ready == 2) && data_received) - || - ((mdc800->camera_request_ready == 3) && (mdc800->camera_busy)) - || - (urb->status < 0) - ); + && + ( + ((mdc800->camera_request_ready == 1) && (!mdc800->camera_busy)) + || + ((mdc800->camera_request_ready == 2) && data_received) + || + ((mdc800->camera_request_ready == 3) && (mdc800->camera_busy)) + || + (urb->status < 0) + ); if (wake_up) { @@ -362,7 +379,7 @@ */ static void* mdc800_usb_probe (struct usb_device *dev ,unsigned int ifnum ) { - int i,j; + int i,j; struct usb_interface_descriptor *intf_desc; int irq_interval=0; @@ -432,10 +449,10 @@ info ("Found Mustek MDC800 on USB."); + spin_lock (&mdc800->io_lock); + mdc800->dev=dev; - mdc800->state=READY; mdc800->open=0; - mdc800->rw_lock=0; /* Setup URB Structs */ FILL_INT_URB ( @@ -469,6 +486,10 @@ mdc800 ); + mdc800->state=READY; + + spin_unlock (&mdc800->io_lock); + return mdc800; } @@ -539,18 +560,21 @@ static int mdc800_device_open (struct inode* inode, struct file *file) { int retval=0; + int errn=0; + + spin_lock (&mdc800->io_lock); if (mdc800->state == NOT_CONNECTED) { - return -EBUSY; + errn=-EBUSY; + goto error_out; } - if (mdc800->open) { - return -EBUSY; + errn=-EBUSY; + goto error_out; } - mdc800->rw_lock=0; mdc800->in_count=0; mdc800->out_count=0; mdc800->out_ptr=0; @@ -562,16 +586,20 @@ mdc800->camera_request_ready=0; retval=0; + mdc800->irq_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->irq_urb)) { err ("request USB irq fails (submit_retval=%i urb_status=%i).",retval, mdc800->irq_urb->status); - return -EIO; + errn = -EIO; + goto error_out; } mdc800->open=1; - dbg ("Mustek MDC800 device opened."); - return 0; + +error_out: + spin_unlock (&mdc800->io_lock); + return errn; } @@ -583,7 +611,7 @@ int retval=0; dbg ("Mustek MDC800 device closed."); - lock_kernel(); + spin_lock (&mdc800->io_lock); if (mdc800->open && (mdc800->state != NOT_CONNECTED)) { mdc800->open=0; @@ -595,7 +623,7 @@ { retval=-EIO; } - unlock_kernel(); + spin_unlock (&mdc800->io_lock); return retval; } @@ -609,23 +637,29 @@ int left=len, sts=len; /* single transfer size */ char* ptr=buf; + spin_lock (&mdc800->io_lock); if (mdc800->state == NOT_CONNECTED) + { + spin_unlock (&mdc800->io_lock); return -EBUSY; - + } if (mdc800->state == WORKING) { warn ("Illegal State \"working\" reached during read ?!"); + spin_unlock (&mdc800->io_lock); return -EBUSY; } - - if (!mdc800->open || mdc800->rw_lock) + if (!mdc800->open) + { + spin_unlock (&mdc800->io_lock); return -EBUSY; - mdc800->rw_lock=1; + } while (left) { - if (signal_pending (current)) { - mdc800->rw_lock=0; + if (signal_pending (current)) + { + spin_unlock (&mdc800->io_lock); return -EINTR; } @@ -640,24 +674,25 @@ mdc800->out_ptr=0; /* Download -> Request new bytes */ + mdc800->download_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->download_urb)) { err ("Can't submit download urb (status=%i)",mdc800->download_urb->status); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return len-left; } interruptible_sleep_on_timeout (&mdc800->download_wait, TO_DOWNLOAD_GET_READY*HZ/1000); if (mdc800->download_urb->status != 0) { err ("request download-bytes fails (status=%i)",mdc800->download_urb->status); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return len-left; } } else { /* No more bytes -> that's an error*/ - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } } @@ -671,7 +706,7 @@ } } - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return len-left; } @@ -686,17 +721,23 @@ { int i=0; + spin_lock (&mdc800->io_lock); if (mdc800->state != READY) + { + spin_unlock (&mdc800->io_lock); return -EBUSY; - - if (!mdc800->open || mdc800->rw_lock) + } + if (!mdc800->open ) + { + spin_unlock (&mdc800->io_lock); return -EBUSY; - mdc800->rw_lock=1; + } while (irw_lock=0; + if (signal_pending (current)) + { + spin_unlock (&mdc800->io_lock); return -EINTR; } @@ -718,7 +759,7 @@ else { err ("Command is to long !\n"); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } @@ -730,7 +771,7 @@ if (mdc800_usb_waitForIRQ (0,TO_GET_READY)) { err ("Camera didn't get ready.\n"); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } @@ -738,17 +779,18 @@ mdc800->state=WORKING; memcpy (mdc800->write_urb->transfer_buffer, mdc800->in,8); + mdc800->write_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->write_urb)) { err ("submitting write urb fails (status=%i)", mdc800->write_urb->status); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } interruptible_sleep_on_timeout (&mdc800->write_wait, TO_WRITE_GET_READY*HZ/1000); if (mdc800->state == WORKING) { usb_unlink_urb (mdc800->write_urb); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } @@ -760,7 +802,7 @@ { err ("call 0x07 before 0x05,0x3e"); mdc800->state=READY; - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } mdc800->pic_len=-1; @@ -779,7 +821,7 @@ if (mdc800_usb_waitForIRQ (1,TO_READ_FROM_IRQ)) { err ("requesting answer from irq fails"); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } @@ -807,7 +849,7 @@ if (mdc800_usb_waitForIRQ (0,TO_DEFAULT_COMMAND)) { err ("Command Timeout."); - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return -EIO; } } @@ -817,7 +859,7 @@ } i++; } - mdc800->rw_lock=0; + spin_unlock (&mdc800->io_lock); return i; } @@ -842,12 +884,11 @@ */ static struct usb_driver mdc800_usb_driver = { - "mdc800", - mdc800_usb_probe, - mdc800_usb_disconnect, - { 0,0 }, - &mdc800_device_ops, - MDC800_DEVICE_MINOR_BASE + name: "mdc800", + probe: mdc800_usb_probe, + disconnect: mdc800_usb_disconnect, + fops: &mdc800_device_ops, + minor: MDC800_DEVICE_MINOR_BASE, }; @@ -865,10 +906,11 @@ /* Allocate Memory */ try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL)); + memset(mdc800, 0, sizeof(struct mdc800_data)); mdc800->dev=0; mdc800->open=0; mdc800->state=NOT_CONNECTED; - memset(mdc800, 0, sizeof(struct mdc800_data)); + spin_lock_init (&mdc800->io_lock); init_waitqueue_head (&mdc800->irq_wait); init_waitqueue_head (&mdc800->write_wait); @@ -886,8 +928,7 @@ if (usb_register (&mdc800_usb_driver) < 0) goto cleanup_on_fail; - info ("Mustek Digital Camera Driver " VERSION " (MDC800)"); - info (RELEASE_DATE " Henning Zabel "); + info (DRIVER_VERSION " " DRIVER_DESC); return 0; @@ -930,9 +971,9 @@ mdc800=0; } - -MODULE_AUTHOR ("Henning Zabel "); -MODULE_DESCRIPTION ("USB Driver for Mustek MDC800 Digital Camera"); - module_init (usb_mdc800_init); module_exit (usb_mdc800_cleanup); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/ov511.c linux.20p9/drivers/usb/ov511.c --- linux.vanilla/drivers/usb/ov511.c Sun Mar 25 17:31:42 2001 +++ linux.20p9/drivers/usb/ov511.c Wed Aug 8 22:24:15 2001 @@ -30,8 +30,6 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static const char version[] = "1.25"; - #define __NO_VERSION__ #include @@ -55,7 +53,12 @@ #include "ov511.h" -#undef OV511_GBR422 /* Experimental -- sets the 7610 to GBR422 */ +/* + * Version Information + */ +#define DRIVER_VERSION "v1.28" +#define DRIVER_AUTHOR "Mark McClelland & Bret Wallach & Orion Sky Lawlor & Kevin Moore & Charl P. Botha & Claudio Matsuoka " +#define DRIVER_DESC "OV511 USB Camera Driver" #define OV511_I2C_RETRIES 3 @@ -64,8 +67,6 @@ #define MAX_DATA_SIZE (MAX_FRAME_SIZE + sizeof(struct timeval)) #define GET_SEGSIZE(p) ((p) == VIDEO_PALETTE_GREY ? 256 : 384) -#define GET_DEPTH(p) ((p) == VIDEO_PALETTE_GREY ? 8 : \ - ((p) == VIDEO_PALETTE_YUV422 ? 16 : 24)) /* PARAMETER VARIABLES: */ static int autoadjust = 1; /* CCD dynamically changes exposure, etc... */ @@ -78,7 +79,7 @@ * 5=highly repetitive mesgs * NOTE: This should be changed to 0, 1, or 2 for production kernels */ -static int debug = 3; +static int debug = 0; /* Fix vertical misalignment of red and blue at 640x480 */ static int fix_rgb_offset = 0; @@ -116,6 +117,13 @@ /* Display test pattern - doesn't work yet either */ static int testpat = 0; +/* Setting this to 1 will make the sensor output GBR422 instead on YUV420. Only + * affects RGB24 mode. */ +static int sensor_gbr = 0; + +/* Dump raw pixel data, in one of 3 formats. See ov511_dumppix() for details. */ +static int dumppix = 0; + MODULE_PARM(autoadjust, "i"); MODULE_PARM_DESC(autoadjust, "CCD dynamically changes exposure"); MODULE_PARM(debug, "i"); @@ -142,11 +150,13 @@ MODULE_PARM_DESC(compress, "Turn on compression (not functional yet)"); MODULE_PARM(testpat, "i"); MODULE_PARM_DESC(testpat, "Replace image with vertical bar testpattern (only partially working)"); +MODULE_PARM(sensor_gbr, "i"); +MODULE_PARM_DESC(sensor_gbr, "Make sensor output GBR422 rather than YUV420"); +MODULE_PARM(dumppix, "i"); +MODULE_PARM_DESC(dumppix, "Dump raw pixel data, in one of 3 formats. See ov511_dumppix() for details"); -MODULE_AUTHOR("Mark McClelland & Bret Wallach & Orion Sky Lawlor & Kevin Moore & Charl P. Botha & Claudio Matsuoka "); -MODULE_DESCRIPTION("OV511 USB Camera Driver"); - -static char kernel_version[] = UTS_RELEASE; +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); static struct usb_driver ov511_driver; @@ -223,9 +233,10 @@ if (!pmd_none(*pmd)) { ptep = pte_offset(pmd, adr); pte = *ptep; - if (pte_present(pte)) - ret = page_address(pte_page(pte)) | - (adr & (PAGE_SIZE-1)); + if (pte_present(pte)) { + ret = (unsigned long) page_address(pte_page(pte)); + ret |= (adr & (PAGE_SIZE - 1)); + } } } @@ -360,6 +371,7 @@ ov511->bridge == BRG_OV511PLUS ? "OV511+" : "unknown"); out += sprintf (out, "sensor : %s\n", + ov511->sensor == SEN_OV6620 ? "OV6620" : ov511->sensor == SEN_OV7610 ? "OV7610" : ov511->sensor == SEN_OV7620 ? "OV7620" : ov511->sensor == SEN_OV7620AE ? "OV7620AE" : @@ -451,7 +463,6 @@ } #endif /* CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS */ - /********************************************************************** * * Camera interface @@ -703,7 +714,7 @@ { int rc; - PDEBUG(3, "Reset: type=0x%X", reset_type); + PDEBUG(4, "Reset: type=0x%X", reset_type); rc = ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, reset_type); rc = ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, 0); @@ -832,14 +843,21 @@ } else if ((ov511->sensor == SEN_OV7620) || (ov511->sensor == SEN_OV7620AE)) { #if 0 - cur_con = ov511_i2c_read(dev, OV7610_REG_CNT); - cur_brt = ov511_i2c_read(dev, OV7610_REG_BRT); - // DEBUG_CODE - PDEBUG(1, "con=%d brt=%d", ov511_i2c_read(dev, OV7610_REG_CNT), - ov511_i2c_read(dev, OV7610_REG_BRT)); + int cur_sat, new_sat, tmp; - if (ov511_i2c_write(dev, OV7610_REG_CNT, p->contrast >> 8) < 0) + cur_sat = ov511_i2c_read(dev, OV7610_REG_BLUE); + + tmp = (p->hue >> 8) - cur_sat; + new_sat = (tmp < 0) ? (-tmp) | 0x80 : tmp; + + PDEBUG(1, "cur=%d target=%d diff=%d", cur_sat, p->hue >> 8, tmp); + + if (ov511_i2c_write(dev, OV7610_REG_BLUE, new_sat) < 0) return -EIO; + + // DEBUG_CODE + PDEBUG(1, "hue=%d", ov511_i2c_read(dev, OV7610_REG_BLUE)); + #endif } @@ -885,6 +903,23 @@ return 0; } +/* Returns number of bits per pixel (regardless of where they are located; planar or + * not), or zero for unsupported format. + */ +static int ov511_get_depth(int palette) +{ + switch (palette) { + case VIDEO_PALETTE_GREY: return 8; + case VIDEO_PALETTE_RGB565: return 16; + case VIDEO_PALETTE_RGB24: return 24; + case VIDEO_PALETTE_YUV422: return 16; + case VIDEO_PALETTE_YUYV: return 16; + case VIDEO_PALETTE_YUV420: return 24; + case VIDEO_PALETTE_YUV422P: return 24; /* Planar */ + default: return 0; /* Invalid format */ + } +} + /* LNCNT values fixed by Lawrence Glaister */ static struct mode_list mlist[] = { /* W H C PXCNT LNCNT PXDIV LNDIV M420 COMA COML */ @@ -920,6 +955,12 @@ if (ov511_stop(ov511->dev) < 0) return -EIO; + /* Dumppix only works with RGB24 */ + if (dumppix && (mode != VIDEO_PALETTE_RGB24)) { + err("dumppix only supported with RGB 24"); + return -EINVAL; + } + if (mode == VIDEO_PALETTE_GREY) { ov511_reg_write(dev, 0x16, 0x00); if (ov511->sensor == SEN_OV7610 @@ -956,9 +997,9 @@ break; case SEN_OV6620: hwsbase = 0x38; - hwebase = 0x39; - vwsbase = 0x03; - vwebase = 0x04; + hwebase = 0x3a; + vwsbase = 0x05; + vwebase = 0x06; break; case SEN_OV7620: hwsbase = 0x2c; @@ -1042,13 +1083,16 @@ /* Calculate and set the clock divisor */ clock = ((sub_flag ? ov511->subw * ov511->subh : width * height) * (mlist[i].color ? 3 : 2) / 2) / 66000; +#if 0 + clock *= cams; +#endif ov511_i2c_write(dev, 0x11, clock); -#ifdef OV511_GBR422 - ov511_i2c_write(dev, 0x12, mlist[i].common_A | 0x08); -#else - ov511_i2c_write(dev, 0x12, mlist[i].common_A | (testpat?0x02:0x00)); -#endif + /* We only have code to convert GBR -> RGB24 */ + if ((mode == VIDEO_PALETTE_RGB24) && sensor_gbr) + ov511_i2c_write(dev, 0x12, mlist[i].common_A | (testpat?0x0a:0x08)); + else + ov511_i2c_write(dev, 0x12, mlist[i].common_A | (testpat?0x02:0x00)); /* 7620/6620 don't have register 0x35, so play it safe */ if (ov511->sensor == SEN_OV7610 || @@ -1116,7 +1160,7 @@ static inline void ov511_move_420_block(int yTL, int yTR, int yBL, int yBR, int u, int v, - int rowPixels, unsigned char * rgb) + int rowPixels, unsigned char * rgb, int bits) { const int rvScale = 91881; const int guScale = -22553; @@ -1137,14 +1181,32 @@ yTL *= yScale; yTR *= yScale; yBL *= yScale; yBR *= yScale; - /* Write out top two pixels */ - rgb[0] = LIMIT(b+yTL); rgb[1] = LIMIT(g+yTL); rgb[2] = LIMIT(r+yTL); - rgb[3] = LIMIT(b+yTR); rgb[4] = LIMIT(g+yTR); rgb[5] = LIMIT(r+yTR); - - /* Skip down to next line to write out bottom two pixels */ - rgb += 3 * rowPixels; - rgb[0] = LIMIT(b+yBL); rgb[1] = LIMIT(g+yBL); rgb[2] = LIMIT(r+yBL); - rgb[3] = LIMIT(b+yBR); rgb[4] = LIMIT(g+yBR); rgb[5] = LIMIT(r+yBR); + if (bits == 24) { + /* Write out top two pixels */ + rgb[0] = LIMIT(b+yTL); rgb[1] = LIMIT(g+yTL); rgb[2] = LIMIT(r+yTL); + rgb[3] = LIMIT(b+yTR); rgb[4] = LIMIT(g+yTR); rgb[5] = LIMIT(r+yTR); + + /* Skip down to next line to write out bottom two pixels */ + rgb += 3 * rowPixels; + rgb[0] = LIMIT(b+yBL); rgb[1] = LIMIT(g+yBL); rgb[2] = LIMIT(r+yBL); + rgb[3] = LIMIT(b+yBR); rgb[4] = LIMIT(g+yBR); rgb[5] = LIMIT(r+yBR); + } else if (bits == 16) { + /* Write out top two pixels */ + rgb[0] = ((LIMIT(b+yTL) >> 3) & 0x1F) | ((LIMIT(g+yTL) << 3) & 0xE0); + rgb[1] = ((LIMIT(g+yTL) >> 5) & 0x07) | (LIMIT(r+yTL) & 0xF8); + + rgb[2] = ((LIMIT(b+yTR) >> 3) & 0x1F) | ((LIMIT(g+yTR) << 3) & 0xE0); + rgb[3] = ((LIMIT(g+yTR) >> 5) & 0x07) | (LIMIT(r+yTR) & 0xF8); + + /* Skip down to next line to write out bottom two pixels */ + rgb += 2 * rowPixels; + + rgb[0] = ((LIMIT(b+yBL) >> 3) & 0x1F) | ((LIMIT(g+yBL) << 3) & 0xE0); + rgb[1] = ((LIMIT(g+yBL) >> 5) & 0x07) | (LIMIT(r+yBL) & 0xF8); + + rgb[2] = ((LIMIT(b+yBR) >> 3) & 0x1F) | ((LIMIT(g+yBR) << 3) & 0xE0); + rgb[3] = ((LIMIT(g+yBR) >> 5) & 0x07) | (LIMIT(r+yBR) & 0xF8); + } } /* @@ -1170,7 +1232,7 @@ * Note that the U and V data in one segment represents a 16 x 16 pixel * area, but the Y data represents a 32 x 8 pixel area. * - * If OV511_DUMPPIX is defined, _parse_data just dumps the incoming segments, + * If dumppix module param is set, _parse_data just dumps the incoming segments, * verbatim, in order, into the frame. When used with vidcat -f ppm -s 640x480 * this puts the data on the standard output and can be analyzed with the * parseppm.c utility I wrote. That's a much faster way for figuring out how @@ -1180,14 +1242,8 @@ #define HDIV 8 #define WDIV (256/HDIV) -#undef OV511_DUMPPIX - -/* #define this and OV511_DUMPPIX to disable parsing of UV data */ -#undef OV511_FORCE_MONO - -#ifdef OV511_GBR422 static void -ov511_parse_data_rgb24(unsigned char *pIn0, unsigned char *pOut0, +ov511_parse_gbr422_to_rgb24(unsigned char *pIn0, unsigned char *pOut0, int iOutY, int iOutUV, int iHalf, int iWidth) { int k, l, m; @@ -1234,14 +1290,12 @@ } } -#else - static void -ov511_parse_data_rgb24(unsigned char *pIn0, unsigned char *pOut0, - int iOutY, int iOutUV, int iHalf, int iWidth) +ov511_parse_yuv420_to_rgb(unsigned char *pIn0, unsigned char *pOut0, + int iOutY, int iOutUV, int iHalf, int iWidth, int bits) { -#ifndef OV511_DUMPPIX int k, l, m; + int bytes = bits >> 3; unsigned char *pIn; unsigned char *pOut, *pOut1; @@ -1254,11 +1308,11 @@ for (l = 0; l < 8; l++) { for (m = 0; m < 8; m++) { *pOut1 = *pIn++; - pOut1 += 3; + pOut1 += bytes; } - pOut1 += (iWidth - 8) * 3; + pOut1 += (iWidth - 8) * bytes; } - pOut += 8 * 3; + pOut += 8 * bytes; } } @@ -1268,16 +1322,16 @@ for (l = 0; l < 4; l++) { for (m=0; m<8; m++) { int y00 = *(pOut); - int y01 = *(pOut+3); - int y10 = *(pOut+iWidth*3); - int y11 = *(pOut+iWidth*3+3); + int y01 = *(pOut+bytes); + int y10 = *(pOut+iWidth*bytes); + int y11 = *(pOut+iWidth*bytes+bytes); int v = *(pIn+64) - 128; int u = *pIn++ - 128; ov511_move_420_block(y00, y01, y10, y11, u, v, iWidth, - pOut); - pOut += 6; + pOut, bits); + pOut += 2 * bytes; } - pOut += (iWidth*2 - 16) * 3; + pOut += (iWidth*2 - 16) * bytes; } /* Just copy the other UV rows */ @@ -1285,9 +1339,9 @@ for (m = 0; m < 8; m++) { *pOut++ = *(pIn + 64); *pOut = *pIn++; - pOut += 5; + pOut += 2 * bytes - 1; } - pOut += (iWidth*2 - 16) * 3; + pOut += (iWidth*2 - 16) * bytes; } /* Calculate values if it's the second half */ @@ -1305,72 +1359,65 @@ int v = *pOut1 - 128; int u = *(pOut1+1) - 128; ov511_move_420_block(y00, y01, y10, - y11, u, v, iWidth, pOut1); - pOut1 += 6; + y11, u, v, iWidth, pOut1, bits); + pOut1 += 2 * bytes; } - pOut1 += (iWidth*2 - 8) * 3; + pOut1 += (iWidth*2 - 8) * bytes; pIn += 8; } - pOut += 8 * 3; + pOut += 8 * bytes; } } -#else +} -#ifndef OV511_FORCE_MONO - /* Just dump pix data straight out for debug */ - int i, j; - - pOut0 += iOutY; - for (i = 0; i < HDIV; i++) { - for (j = 0; j < WDIV; j++) { - *pOut0++ = *pIn0++; - *pOut0++ = *pIn0++; - *pOut0++ = *pIn0++; - } - pOut0 += (iWidth - WDIV) * 3; - } -#else - -#if 1 - /* This converts the Y data to "black-and-white" RGB data */ - /* Useful for experimenting with compression */ - int k, l, m; +static void +ov511_dumppix(unsigned char *pIn0, unsigned char *pOut0, + int iOutY, int iOutUV, int iHalf, int iWidth) +{ + int i, j, k; unsigned char *pIn, *pOut, *pOut1; - pIn = pIn0 + 128; - pOut = pOut0 + iOutY; - for (k = 0; k < 4; k++) { - pOut1 = pOut; - for (l = 0; l < 8; l++) { - for (m = 0; m < 8; m++) { - *pOut1++ = *pIn; - *pOut1++ = *pIn; - *pOut1++ = *pIn++; + switch (dumppix) { + case 1: /* Just dump YUV data straight out for debug */ + pOut0 += iOutY; + for (i = 0; i < HDIV; i++) { + for (j = 0; j < WDIV; j++) { + *pOut0++ = *pIn0++; + *pOut0++ = *pIn0++; + *pOut0++ = *pIn0++; } - pOut1 += (iWidth - 8) * 3; + pOut0 += (iWidth - WDIV) * 3; } - pOut += 8 * 3; - } -#else - /* This will dump the Y channel data stream as-is */ - int count; - unsigned char *pIn, *pOut; - - pIn = pIn0 + 128; - pOut = pOut0 + output_offset; - for (count = 0; count < 256; count++) { - *pOut++ = *pIn; - *pOut++ = *pIn; - *pOut++ = *pIn++; - output_offset += 3; - } -#endif - -#endif - -#endif + break; + case 2: /* This converts the Y data to "black-and-white" RGB data */ + /* Useful for experimenting with compression */ + pIn = pIn0 + 128; + pOut = pOut0 + iOutY; + for (i = 0; i < 4; i++) { + pOut1 = pOut; + for (j = 0; j < 8; j++) { + for (k = 0; k < 8; k++) { + *pOut1++ = *pIn; + *pOut1++ = *pIn; + *pOut1++ = *pIn++; + } + pOut1 += (iWidth - 8) * 3; + } + pOut += 8 * 3; + } + break; + case 3: /* This will dump only the Y channel data stream as-is */ + pIn = pIn0 + 128; + pOut = pOut0 + output_offset; + for (i = 0; i < 256; i++) { + *pOut++ = *pIn; + *pOut++ = *pIn; + *pOut++ = *pIn++; + output_offset += 3; + } + break; + } /* End switch (dumppix) */ } -#endif /* This converts YUV420 segments to YUYV */ static void @@ -1665,6 +1712,11 @@ /* Frame start */ PDEBUG(4, "Frame start, framenum = %d", ov511->curframe); +#if 0 + /* Make sure no previous data carries over; necessary + * for compression experimentation */ + memset(frame->data, 0, MAX_DATA_SIZE); +#endif output_offset = 0; /* Check to see if it's a snapshot frame */ @@ -1743,8 +1795,19 @@ ov511_parse_data_grey (pData, pOut, iOutY, frame->width); break; case VIDEO_PALETTE_RGB24: - ov511_parse_data_rgb24 (pData, pOut, iOutY, iOutUV, - iY & 1, frame->width); + if (dumppix) + ov511_dumppix(pData, pOut, iOutY, iOutUV, + iY & 1, frame->width); + else if (sensor_gbr) + ov511_parse_gbr422_to_rgb24(pData, pOut, iOutY, iOutUV, + iY & 1, frame->width); + else + ov511_parse_yuv420_to_rgb(pData, pOut, iOutY, iOutUV, + iY & 1, frame->width, 24); + break; + case VIDEO_PALETTE_RGB565: + ov511_parse_yuv420_to_rgb(pData, pOut, iOutY, iOutUV, + iY & 1, frame->width, 16); break; case VIDEO_PALETTE_YUV422: case VIDEO_PALETTE_YUYV: @@ -1785,11 +1848,20 @@ static void ov511_isoc_irq(struct urb *urb) { int len; - struct usb_ov511 *ov511 = urb->context; + struct usb_ov511 *ov511; struct ov511_sbuf *sbuf; - if (!ov511->dev) + if (!urb->context) { + PDEBUG(4, "no context"); return; + } + + ov511 = (struct usb_ov511 *) urb->context; + + if (!ov511->dev || !ov511->user) { + PDEBUG(4, "no device, or not open"); + return; + } if (!ov511->streaming) { PDEBUG(4, "hmmm... not streaming, but got interrupt"); @@ -1808,6 +1880,8 @@ /* Move to the next sbuf */ ov511->cursbuf = (ov511->cursbuf + 1) % OV511_NUMSBUF; + urb->dev = ov511->dev; + return; } @@ -1875,6 +1949,7 @@ ov511->sbuf[n].urb->next = ov511->sbuf[n+1].urb; for (n = 0; n < OV511_NUMSBUF; n++) { + ov511->sbuf[n].urb->dev = ov511->dev; err = usb_submit_urb(ov511->sbuf[n].urb); if (err) err("init isoc: usb_submit_urb(%d) ret %d", n, err); @@ -2082,7 +2157,7 @@ static int ov511_open(struct video_device *dev, int flags) { struct usb_ov511 *ov511 = (struct usb_ov511 *)dev; - int err = 0; + int err; MOD_INC_USE_COUNT; PDEBUG(4, "opening"); @@ -2171,14 +2246,15 @@ PDEBUG (4, "VIDIOCGCAP"); + memset(&b, 0, sizeof(b)); strcpy(b.name, "OV511 USB Camera"); b.type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE; b.channels = 1; b.audios = 0; b.maxwidth = ov511->maxwidth; b.maxheight = ov511->maxheight; - b.minwidth = 32; - b.minheight = 16; + b.minwidth = 160; + b.minheight = 120; if (copy_to_user(arg, &b, sizeof(b))) return -EFAULT; @@ -2222,9 +2298,11 @@ PDEBUG (4, "VIDIOCGPICT"); + memset(&p, 0, sizeof(p)); + if (ov7610_get_picture(ov511, &p)) return -EIO; - + if (copy_to_user(arg, &p, sizeof(p))) return -EFAULT; @@ -2240,12 +2318,7 @@ if (copy_from_user(&p, arg, sizeof(p))) return -EFAULT; - if (p.palette != VIDEO_PALETTE_GREY && - p.palette != VIDEO_PALETTE_RGB24 && - p.palette != VIDEO_PALETTE_YUV422 && - p.palette != VIDEO_PALETTE_YUYV && - p.palette != VIDEO_PALETTE_YUV420 && - p.palette != VIDEO_PALETTE_YUV422P) + if (!ov511_get_depth(p.palette)) return -EINVAL; if (ov7610_set_picture(ov511, &p)) @@ -2344,11 +2417,11 @@ { struct video_window vw; + memset(&vw, 0, sizeof(vw)); vw.x = 0; /* FIXME */ vw.y = 0; vw.width = ov511->frame[0].width; vw.height = ov511->frame[0].height; - vw.chromakey = 0; vw.flags = 30; PDEBUG (4, "VIDIOCGWIN: %dx%d", vw.width, vw.height); @@ -2361,12 +2434,16 @@ case VIDIOCGMBUF: { struct video_mbuf vm; + int i; memset(&vm, 0, sizeof(vm)); vm.size = OV511_NUMFRAMES * MAX_DATA_SIZE; vm.frames = OV511_NUMFRAMES; vm.offsets[0] = 0; - vm.offsets[1] = MAX_FRAME_SIZE + sizeof (struct timeval); + for (i = 1; i < OV511_NUMFRAMES; i++) { + vm.offsets[i] = vm.offsets[i-1] + MAX_FRAME_SIZE + + sizeof (struct timeval); + } if (copy_to_user((void *)arg, (void *)&vm, sizeof(vm))) return -EFAULT; @@ -2376,7 +2453,7 @@ case VIDIOCMCAPTURE: { struct video_mmap vm; - int ret; + int ret, depth; if (copy_from_user((void *)&vm, (void *)arg, sizeof(vm))) return -EFAULT; @@ -2385,19 +2462,26 @@ PDEBUG(4, "frame: %d, size: %dx%d, format: %d", vm.frame, vm.width, vm.height, vm.format); - if (vm.format != VIDEO_PALETTE_RGB24 && - vm.format != VIDEO_PALETTE_YUV422 && - vm.format != VIDEO_PALETTE_YUYV && - vm.format != VIDEO_PALETTE_YUV420 && - vm.format != VIDEO_PALETTE_YUV422P && - vm.format != VIDEO_PALETTE_GREY) + depth = ov511_get_depth(vm.format); + if (!depth) { + err("VIDIOCMCAPTURE: invalid format (%d)", vm.format); return -EINVAL; + } - if ((vm.frame != 0) && (vm.frame != 1)) + if ((vm.frame != 0) && (vm.frame != 1)) { + err("VIDIOCMCAPTURE: invalid frame (%d)", vm.frame); return -EINVAL; - - if (vm.width > ov511->maxwidth || vm.height > ov511->maxheight) + } + + if ((unsigned)vm.frame >= OV511_NUMFRAMES) { + err("VIDIOCMCAPTURE: invalid frame (%d)", vm.frame); + return -EINVAL; + } + + if (vm.width > ov511->maxwidth || vm.height > ov511->maxheight) { + err("VIDIOCMCAPTURE: requested dimensions too big"); return -EINVAL; + } if (ov511->frame[vm.frame].grabstate == FRAME_GRABBING) return -EBUSY; @@ -2425,7 +2509,7 @@ ov511->frame[vm.frame].format = vm.format; ov511->frame[vm.frame].sub_flag = ov511->sub_flag; ov511->frame[vm.frame].segsize = GET_SEGSIZE(vm.format); - ov511->frame[vm.frame].depth = GET_DEPTH(vm.format); + ov511->frame[vm.frame].depth = depth; /* Mark it as ready */ ov511->frame[vm.frame].grabstate = FRAME_READY; @@ -2439,6 +2523,11 @@ if (copy_from_user((void *)&frame, arg, sizeof(int))) return -EFAULT; + if ((unsigned)frame >= OV511_NUMFRAMES) { + err("VIDIOCSYNC: invalid frame (%d)", frame); + return -EINVAL; + } + PDEBUG(4, "syncing to frame %d, grabstate = %d", frame, ov511->frame[frame].grabstate); @@ -2484,6 +2573,13 @@ goto redo; } case FRAME_DONE: + if (ov511->snap_enabled && !ov511->frame[frame].snapshot) { + int ret; + if ((ret = ov511_new_frame(ov511, frame)) < 0) + return ret; + goto redo; + } + ov511->frame[frame].grabstate = FRAME_UNUSED; /* Reset the hardware snapshot button */ @@ -2660,7 +2756,7 @@ PDEBUG(4, "mmap: %ld (%lX) bytes", size, size); - if (size > (((2 * MAX_DATA_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) + if (size > (((OV511_NUMFRAMES * MAX_DATA_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) return -EINVAL; pos = (unsigned long)ov511->fbuf; @@ -3171,7 +3267,7 @@ return NULL; /* Checking vendor/product should be enough, but what the hell */ - if (interface->bInterfaceClass != 0xFF) + if (interface->bInterfaceClass != 0xFF) return NULL; if (interface->bInterfaceSubClass != 0x00) return NULL; @@ -3266,7 +3362,8 @@ } -static void ov511_disconnect(struct usb_device *dev, void *ptr) +static void +ov511_disconnect(struct usb_device *dev, void *ptr) { struct usb_ov511 *ov511 = (struct usb_ov511 *) ptr; int n; @@ -3324,10 +3421,9 @@ } static struct usb_driver ov511_driver = { - "ov511", - ov511_probe, - ov511_disconnect, - { NULL, NULL } + name: "ov511", + probe: ov511_probe, + disconnect: ov511_disconnect }; @@ -3346,7 +3442,7 @@ if (usb_register(&ov511_driver) < 0) return -1; - info("ov511 driver version %s registered", version); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/pegasus.c linux.20p9/drivers/usb/pegasus.c --- linux.vanilla/drivers/usb/pegasus.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/pegasus.c Wed Aug 8 22:23:59 2001 @@ -40,7 +40,6 @@ */ -#include #include #include #include @@ -48,162 +47,39 @@ #include #include #include +#include +#include "pegasus.h" - -static const char *version = __FILE__ ": v0.4.13 2000/10/13 (C) 1999-2000 Petko Manolov (petkan@dce.bg)"; - +/* + * Version Information + */ +#define DRIVER_VERSION "v0.4.18 2001/03/18 (C) 1999-2000" +#define DRIVER_AUTHOR "Petko Manolov " +#define DRIVER_DESC "ADMtek AN986 Pegasus USB Ethernet driver" #define PEGASUS_USE_INTR - - -#define PEGASUS_II 0x80000000 -#define HAS_HOME_PNA 0x40000000 - -#define PEGASUS_MTU 1500 -#define PEGASUS_MAX_MTU 1536 - -#define EPROM_WRITE 0x01 -#define EPROM_READ 0x02 -#define EPROM_DONE 0x04 -#define EPROM_WR_ENABLE 0x10 -#define EPROM_LOAD 0x20 - -#define MII_BMCR 0x00 -#define MII_BMSR 0x01 -#define BMSR_MEDIA 0x7808 -#define MII_ANLPA 0x05 -#define ANLPA_100TX_FD 0x0100 -#define ANLPA_100TX_HD 0x0080 -#define ANLPA_10T_FD 0x0040 -#define ANLPA_10T_HD 0x0020 -#define PHY_DONE 0x80 -#define PHY_READ 0x40 -#define PHY_WRITE 0x20 -#define DEFAULT_GPIO_RESET 0x24 -#define LINKSYS_GPIO_RESET 0x24 -#define DEFAULT_GPIO_SET 0x26 - -#define PEGASUS_PRESENT 0x00000001 -#define PEGASUS_RUNNING 0x00000002 -#define PEGASUS_TX_BUSY 0x00000004 -#define PEGASUS_RX_BUSY 0x00000008 -#define CTRL_URB_RUNNING 0x00000010 -#define CTRL_URB_SLEEP 0x00000020 -#define PEGASUS_UNPLUG 0x00000040 -#define ETH_REGS_CHANGE 0x40000000 -#define ETH_REGS_CHANGED 0x80000000 - -#define RX_MULTICAST 2 -#define RX_PROMISCUOUS 4 - -#define REG_TIMEOUT (HZ) -#define PEGASUS_TX_TIMEOUT (HZ*10) - -#define TX_UNDERRUN 0x80 -#define EXCESSIVE_COL 0x40 -#define LATE_COL 0x20 -#define NO_CARRIER 0x10 -#define LOSS_CARRIER 0x08 -#define JABBER_TIMEOUT 0x04 - -#define PEGASUS_REQT_READ 0xc0 -#define PEGASUS_REQT_WRITE 0x40 -#define PEGASUS_REQ_GET_REGS 0xf0 -#define PEGASUS_REQ_SET_REGS 0xf1 -#define PEGASUS_REQ_SET_REG PEGASUS_REQ_SET_REGS -#define NUM_CTRL_URBS 0x10 -#define ALIGN(x) x __attribute__((aligned(L1_CACHE_BYTES))) - -enum pegasus_registers { - EthCtrl0 = 0, - EthCtrl1 = 1, - EthCtrl2 = 2, - EthID = 0x10, - Reg1d = 0x1d, - EpromOffset = 0x20, - EpromData = 0x21, /* 0x21 low, 0x22 high byte */ - EpromCtrl = 0x23, - PhyAddr = 0x25, - PhyData = 0x26, /* 0x26 low, 0x27 high byte */ - PhyCtrl = 0x28, - UsbStst = 0x2a, - EthTxStat0 = 0x2b, - EthTxStat1 = 0x2c, - EthRxStat = 0x2d, - Reg7b = 0x7b, - Gpio0 = 0x7e, - Gpio1 = 0x7f, - Reg81 = 0x81, -}; - - -typedef struct pegasus { - struct usb_device *usb; - struct net_device *net; - struct net_device_stats stats; - unsigned flags; - unsigned features; - int intr_interval; - struct urb ctrl_urb, rx_urb, tx_urb, intr_urb; - devrequest dr; - wait_queue_head_t ctrl_wait; - struct semaphore ctrl_sem; - unsigned char ALIGN(rx_buff[PEGASUS_MAX_MTU]); - unsigned char ALIGN(tx_buff[PEGASUS_MAX_MTU]); - unsigned char ALIGN(intr_buff[8]); - __u8 eth_regs[4]; - __u8 phy; - __u8 gpio_res; -} pegasus_t; - -struct usb_eth_dev { - char *name; - __u16 vendor; - __u16 device; - __u32 private; /* LSB is gpio reset value */ -}; - +#define PEGASUS_WRITE_EEPROM static int loopback = 0; static int mii_mode = 0; static int multicast_filter_limit = 32; +static struct usb_eth_dev usb_dev_id[] = { +#define PEGASUS_DEV(pn, vid, pid, flags) \ + {name:pn, vendor:vid, device:pid, private:flags}, +#include "pegasus.h" +#undef PEGASUS_DEV + {NULL, 0, 0, 0} +}; -MODULE_AUTHOR("Petko Manolov "); -MODULE_DESCRIPTION("ADMtek AN986 Pegasus USB Ethernet driver"); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); MODULE_PARM(loopback, "i"); -MODULE_PARM(mode, "i"); +MODULE_PARM(mii_mode, "i"); MODULE_PARM_DESC(loopback, "Enable MAC loopback mode (bit 0)"); -MODULE_PARM_DESC(mode, "Enable HomePNA mode (bit 0) - default = MII mode = 0"); - +MODULE_PARM_DESC(mii_mode, "Enable HomePNA mode (bit 0),default=MII mode = 0"); -static struct usb_eth_dev usb_dev_id[] = { - {"Billionton USB-100", 0x08dd, 0x0986, DEFAULT_GPIO_RESET}, - {"Corega FEter USB-TX", 0x7aa, 0x0004, DEFAULT_GPIO_RESET}, - {"MELCO/BUFFALO LUA-TX", 0x0411, 0x0001, DEFAULT_GPIO_RESET}, - {"D-Link DSB-650TX", 0x2001, 0x4001, LINKSYS_GPIO_RESET}, - {"D-Link DSB-650TX", 0x2001, 0x4002, LINKSYS_GPIO_RESET}, - {"D-Link DSB-650TX(PNA)", 0x2001, 0x4003, - HAS_HOME_PNA | DEFAULT_GPIO_RESET}, - {"D-Link DSB-650", 0x2001, 0xabc1, DEFAULT_GPIO_RESET}, - {"D-Link DU-E10", 0x07b8, 0xabc1, DEFAULT_GPIO_RESET}, - {"D-Link DU-E100", 0x07b8, 0x4002, DEFAULT_GPIO_RESET}, - {"Linksys USB10TX", 0x066b, 0x2202, LINKSYS_GPIO_RESET}, - {"Linksys USB100TX", 0x066b, 0x2203, LINKSYS_GPIO_RESET}, - {"Linksys USB100TX", 0x066b, 0x2204, HAS_HOME_PNA | LINKSYS_GPIO_RESET}, - {"Linksys USB Ethernet Adapter", 0x066b, 0x2206, LINKSYS_GPIO_RESET}, - {"SMC 202 USB Ethernet", 0x0707, 0x0200, DEFAULT_GPIO_RESET}, - {"ADMtek AN986 \"Pegasus\" USB Ethernet (eval board)", 0x07a6, 0x0986, - HAS_HOME_PNA | DEFAULT_GPIO_RESET}, - {"Accton USB 10/100 Ethernet Adapter", 0x083a, 0x1046, - DEFAULT_GPIO_RESET}, - {"IO DATA USB ET/TX", 0x04bb, 0x0904, DEFAULT_GPIO_RESET}, - {"LANEED USB Ethernet LD-USB/TX", 0x056e, 0x4002, DEFAULT_GPIO_RESET}, - {"SOHOware NUB100 Ethernet", 0x15e8, 0x9100, DEFAULT_GPIO_RESET}, - {"ADMtek ADM8511 \"Pegasus II\" USB Ethernet", 0x07a6, 0x8511, - PEGASUS_II | DEFAULT_GPIO_RESET}, - {NULL, 0, 0, 0} -}; static int update_eth_regs_async( pegasus_t * ); @@ -242,29 +118,35 @@ static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) { int ret; + DECLARE_WAITQUEUE(wait, current); - if ( pegasus->flags & ETH_REGS_CHANGED ) { + while ( pegasus->flags & ETH_REGS_CHANGED ) { pegasus->flags |= CTRL_URB_SLEEP; interruptible_sleep_on( &pegasus->ctrl_wait ); } pegasus->dr.requesttype = PEGASUS_REQT_READ; pegasus->dr.request = PEGASUS_REQ_GET_REGS; - pegasus->dr.value = 0; + pegasus->dr.value = cpu_to_le16 (0); pegasus->dr.index = cpu_to_le16p(&indx); - pegasus->dr.length = - pegasus->ctrl_urb.transfer_buffer_length = cpu_to_le16p(&size); + pegasus->dr.length = cpu_to_le16p(&size); + pegasus->ctrl_urb.transfer_buffer_length = size; FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, usb_rcvctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, data, size, ctrl_callback, pegasus ); + add_wait_queue( &pegasus->ctrl_wait, &wait ); + set_current_state( TASK_INTERRUPTIBLE ); + pegasus->flags |= CTRL_URB_SLEEP; + if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRLs %d", ret); goto out; } - pegasus->flags |= CTRL_URB_SLEEP; - interruptible_sleep_on( &pegasus->ctrl_wait ); + + schedule(); + remove_wait_queue( &pegasus->ctrl_wait, &wait ); out: return ret; } @@ -273,29 +155,35 @@ static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) { int ret; + DECLARE_WAITQUEUE(wait, current); - if ( pegasus->flags & ETH_REGS_CHANGED ) { + while ( pegasus->flags & ETH_REGS_CHANGED ) { pegasus->flags |= CTRL_URB_SLEEP ; interruptible_sleep_on( &pegasus->ctrl_wait ); } pegasus->dr.requesttype = PEGASUS_REQT_WRITE; pegasus->dr.request = PEGASUS_REQ_SET_REGS; - pegasus->dr.value = 0; + pegasus->dr.value = cpu_to_le16 (0); pegasus->dr.index = cpu_to_le16p( &indx ); - pegasus->dr.length = - pegasus->ctrl_urb.transfer_buffer_length = cpu_to_le16p( &size ); + pegasus->dr.length = cpu_to_le16p( &size ); + pegasus->ctrl_urb.transfer_buffer_length = size; FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, usb_sndctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, data, size, ctrl_callback, pegasus ); + + add_wait_queue( &pegasus->ctrl_wait, &wait ); + set_current_state( TASK_INTERRUPTIBLE ); + pegasus->flags |= CTRL_URB_SLEEP; if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRL %d", ret); return ret; } - pegasus->flags |= CTRL_URB_SLEEP; - interruptible_sleep_on( &pegasus->ctrl_wait ); + + schedule(); + remove_wait_queue( &pegasus->ctrl_wait, &wait ); return ret; } @@ -304,29 +192,37 @@ static int set_register( pegasus_t *pegasus, __u16 indx, __u8 data ) { int ret; - - if ( pegasus->flags & ETH_REGS_CHANGED ) { + __u16 dat = data; + DECLARE_WAITQUEUE(wait, current); + + while ( pegasus->flags & ETH_REGS_CHANGED ) { pegasus->flags |= CTRL_URB_SLEEP; interruptible_sleep_on( &pegasus->ctrl_wait ); } pegasus->dr.requesttype = PEGASUS_REQT_WRITE; pegasus->dr.request = PEGASUS_REQ_SET_REG; - pegasus->dr.value = data; + pegasus->dr.value = cpu_to_le16p( &dat); pegasus->dr.index = cpu_to_le16p( &indx ); - pegasus->dr.length = pegasus->ctrl_urb.transfer_buffer_length = 1; + pegasus->dr.length = cpu_to_le16( 1 ); + pegasus->ctrl_urb.transfer_buffer_length = 1; FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, usb_sndctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, &data, 1, ctrl_callback, pegasus ); + add_wait_queue( &pegasus->ctrl_wait, &wait ); + set_current_state( TASK_INTERRUPTIBLE ); + pegasus->flags |= CTRL_URB_SLEEP; + if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRL %d", ret); return ret; } - pegasus->flags |= CTRL_URB_SLEEP; - interruptible_sleep_on( &pegasus->ctrl_wait ); - + + schedule(); + remove_wait_queue( &pegasus->ctrl_wait, &wait ); + return ret; } @@ -338,8 +234,8 @@ pegasus->dr.requesttype = PEGASUS_REQT_WRITE; pegasus->dr.request = PEGASUS_REQ_SET_REGS; pegasus->dr.value = 0; - pegasus->dr.index = EthCtrl0; - pegasus->dr.length = + pegasus->dr.index = cpu_to_le16(EthCtrl0); + pegasus->dr.length = cpu_to_le16(3); pegasus->ctrl_urb.transfer_buffer_length = 3; FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, @@ -354,11 +250,12 @@ } -static int read_phy_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 *regd ) +static int read_mii_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 *regd ) { int i; __u8 data[4] = { phy, 0, 0, indx }; - + __u16 regdi; + set_register( pegasus, PhyCtrl, 0 ); set_registers( pegasus, PhyAddr, sizeof(data), data ); set_register( pegasus, PhyCtrl, (indx | PHY_READ) ); @@ -368,7 +265,8 @@ break; } if ( i < REG_TIMEOUT ) { - get_registers( pegasus, PhyData, 2, regd ); + get_registers( pegasus, PhyData, 2, ®di ); + *regd = le16_to_cpu(regdi); return 0; } warn( __FUNCTION__ " failed" ); @@ -377,7 +275,7 @@ } -static int write_phy_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 regd ) +static int write_mii_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 regd ) { int i; __u8 data[4] = { phy, 0, 0, indx }; @@ -401,18 +299,22 @@ static int read_eprom_word( pegasus_t *pegasus, __u8 index, __u16 *retdata ) { - int i, tmp; - + int i; + __u8 tmp; + __u16 retdatai; + set_register( pegasus, EpromCtrl, 0 ); set_register( pegasus, EpromOffset, index ); set_register( pegasus, EpromCtrl, EPROM_READ); + for ( i=0; i < REG_TIMEOUT; i++ ) { get_registers( pegasus, EpromCtrl, 1, &tmp ); if ( tmp & EPROM_DONE ) break; } if ( i < REG_TIMEOUT ) { - get_registers( pegasus, EpromData, 2, retdata ); + get_registers( pegasus, EpromData, 2, &retdatai ); + *retdata = le16_to_cpu (retdatai); return 0; } warn( __FUNCTION__ " failed" ); @@ -467,9 +369,12 @@ static inline void get_node_id( pegasus_t *pegasus, __u8 *id ) { int i; - - for (i = 0; i < 3; i++) - read_eprom_word( pegasus, i, (__u16 *)&id[i*2]); + __u16 w16; + + for (i = 0; i < 3; i++) { + read_eprom_word( pegasus, i, &w16); + ((__u16 *) id)[i] = cpu_to_le16p (&w16); + } } @@ -505,6 +410,15 @@ } if ( i == REG_TIMEOUT ) return 1; + + if ( usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS || + usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK1 ) { + __u16 auxmode; + + read_mii_word( pegasus, 0, 0x1b, &auxmode ); + write_mii_word( pegasus, 0, 0x1b, auxmode | 4 ); + } + return 0; } @@ -516,13 +430,13 @@ pegasus_t *pegasus = dev->priv; - if ( read_phy_word(pegasus, pegasus->phy, MII_BMSR, &bmsr) ) - return 2; + if ( read_mii_word(pegasus, pegasus->phy, MII_BMSR, &bmsr) ) + return 1; if ( !(bmsr & 0x20) && !loopback ) warn( "%s: link NOT established (0x%x) - check the cable.", dev->name, bmsr ); - if ( read_phy_word(pegasus, pegasus->phy, MII_ANLPA, &linkpart) ) - return 4; + if ( read_mii_word(pegasus, pegasus->phy, MII_ANLPA, &linkpart) ) + return 2; if ( !(linkpart & 1) ) warn( "link partner stat %x", linkpart ); @@ -536,7 +450,7 @@ data[1] = 0; data[2] = (loopback & 1) ? 0x09 : 0x01; - *(unsigned *)pegasus->eth_regs = *(unsigned *)data; + memcpy( pegasus->eth_regs, data, sizeof(data) ); set_registers( pegasus, EthCtrl0, 3, data ); @@ -562,23 +476,29 @@ if ( pegasus->flags & PEGASUS_RX_BUSY ) { pegasus->stats.rx_errors++; + dbg("pegasus Rx busy"); return; } pegasus->flags |= PEGASUS_RX_BUSY; - rx_status = *(int *)(pegasus->rx_buff + count - 4); - - if (urb->status) { - dbg("%s: RX status %d", net->name, urb->status); - goto goon; + switch ( urb->status ) { + case USB_ST_NOERROR: + break; + case USB_ST_NORESPONSE: + dbg( "reset MAC" ); + pegasus->flags &= ~PEGASUS_RX_BUSY; + break; + default: + dbg( "%s: RX status %d", net->name, urb->status ); + goto goon; } if ( !count ) goto goon; + rx_status = le32_to_cpu(*(int *)(pegasus->rx_buff + count - 4)); if ( rx_status & 0x000e0000 ) { - - dbg("%s: error receiving packet %x", net->name, rx_status & 0xe0000); + dbg("%s: RX packet error %x", net->name, rx_status & 0xe0000); pegasus->stats.rx_errors++; if ( rx_status & 0x060000 ) pegasus->stats.rx_length_errors++; @@ -586,7 +506,6 @@ pegasus->stats.rx_crc_errors++; if ( rx_status & 0x100000 ) pegasus->stats.rx_frame_errors++; - goto goon; } @@ -629,6 +548,7 @@ if ( urb->status ) info("%s: TX status %d", pegasus->net->name, urb->status); + pegasus->net->trans_start = jiffies; netif_wake_queue( pegasus->net ); } @@ -641,6 +561,16 @@ if ( !pegasus ) return; + + switch ( urb->status ) { + case USB_ST_NOERROR: + break; + case USB_ST_URB_KILLED: + return; + default: + info("intr status %d", urb->status); + } + d = urb->transfer_buffer; net = pegasus->net; if ( d[0] & 0xfc ) { @@ -654,31 +584,23 @@ if ( d[0] & (NO_CARRIER | LOSS_CARRIER) ) pegasus->stats.tx_carrier_errors++; } - switch ( urb->status ) { - case USB_ST_NOERROR: - break; - case USB_ST_URB_KILLED: - break; - default: - info("intr status %d", urb->status); - } } #endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,48) static void pegasus_tx_timeout( struct net_device *net ) { pegasus_t *pegasus = net->priv; if ( !pegasus ) return; - - usb_unlink_urb( &pegasus->tx_urb ); + warn("%s: Tx timed out.", net->name); + pegasus->tx_urb.transfer_flags |= USB_ASYNC_UNLINK; + usb_unlink_urb( &pegasus->tx_urb ); pegasus->stats.tx_errors++; - net->trans_start = jiffies; - - netif_wake_queue( net ); } +#endif static int pegasus_start_xmit( struct sk_buff *skb, struct net_device *net ) @@ -686,17 +608,17 @@ pegasus_t *pegasus = net->priv; int count = ((skb->len+2) & 0x3f) ? skb->len+2 : skb->len+3; int res; - + __u16 l16 = skb->len; + netif_stop_queue( net ); - ((__u16 *)pegasus->tx_buff)[0] = skb->len; + ((__u16 *)pegasus->tx_buff)[0] = cpu_to_le16( l16 ); memcpy(pegasus->tx_buff+2, skb->data, skb->len); FILL_BULK_URB( &pegasus->tx_urb, pegasus->usb, usb_sndbulkpipe(pegasus->usb, 2), pegasus->tx_buff, PEGASUS_MAX_MTU, write_bulk_callback, pegasus ); pegasus->tx_urb.transfer_buffer_length = count; - pegasus->tx_urb.transfer_flags |= USB_ASYNC_UNLINK; if ((res = usb_submit_urb(&pegasus->tx_urb))) { warn("failed tx_urb %d", res); pegasus->stats.tx_errors++; @@ -732,6 +654,14 @@ __u8 data[2]; read_eprom_word( pegasus, 4, (__u16 *)data ); + if ( data[1] < 0x80 ) { + info( "intr interval will be changed from %ums to %ums", + data[1], 0x80 ); + data[1] = 0x80; +#ifdef PEGASUS_WRITE_EEPROM + write_eprom_word( pegasus, 4, *(__u16 *)data ); +#endif + } pegasus->intr_interval = data[1]; } @@ -754,7 +684,6 @@ if ( (res = usb_submit_urb(&pegasus->rx_urb)) ) warn( __FUNCTION__ " failed rx_urb %d", res ); #ifdef PEGASUS_USE_INTR - get_interrupt_interval( pegasus ); FILL_INT_URB( &pegasus->intr_urb, pegasus->usb, usb_rcvintpipe(pegasus->usb, 3), pegasus->intr_buff, sizeof(pegasus->intr_buff), @@ -781,8 +710,9 @@ usb_unlink_urb( &pegasus->rx_urb ); usb_unlink_urb( &pegasus->tx_urb ); usb_unlink_urb( &pegasus->ctrl_urb ); +#ifdef PEGASUS_USE_INTR usb_unlink_urb( &pegasus->intr_urb ); - +#endif MOD_DEC_USE_COUNT; return 0; @@ -798,12 +728,12 @@ case SIOCDEVPRIVATE: data[0] = pegasus->phy; case SIOCDEVPRIVATE+1: - read_phy_word(pegasus, data[0], data[1]&0x1f, &data[3]); + read_mii_word(pegasus, data[0], data[1]&0x1f, &data[3]); return 0; case SIOCDEVPRIVATE+2: if ( !capable(CAP_NET_ADMIN) ) return -EPERM; - write_phy_word(pegasus, pegasus->phy, data[1] & 0x1f, data[2]); + write_mii_word(pegasus, pegasus->phy, data[1] & 0x1f, data[2]); return 0; default: return -EOPNOTSUPP; @@ -858,14 +788,14 @@ __u16 tmp; for ( i=0; i < 32; i++ ) { - read_phy_word( pegasus, i, MII_BMSR, &tmp ); + read_mii_word( pegasus, i, MII_BMSR, &tmp ); if ( tmp == 0 || tmp == 0xffff || (tmp & BMSR_MEDIA) == 0 ) continue; else return i; } - return 0; + return 0xff; } @@ -882,11 +812,11 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) { - struct net_device *net; - pegasus_t *pegasus; - int dev_indx; + struct net_device *net; + pegasus_t *pegasus; + int dev_index; - if ( (dev_indx = check_device_ids(dev->descriptor.idVendor, dev->descriptor.idProduct)) == -1 ) { + if ( (dev_index = check_device_ids(dev->descriptor.idVendor, dev->descriptor.idProduct)) == -1 ) { return NULL; } @@ -902,7 +832,7 @@ usb_inc_dev_use( dev ); memset(pegasus, 0, sizeof(struct pegasus)); - init_MUTEX( &pegasus-> ctrl_sem ); + pegasus->dev_index = dev_index; init_waitqueue_head( &pegasus->ctrl_wait ); net = init_etherdev( NULL, 0 ); @@ -926,7 +856,10 @@ net->get_stats = pegasus_netdev_stats; net->mtu = PEGASUS_MTU; - pegasus->features = usb_dev_id[dev_indx].private; + pegasus->features = usb_dev_id[dev_index].private; +#ifdef PEGASUS_USE_INTR + get_interrupt_interval( pegasus ); +#endif if ( reset_mac(pegasus) ) { err("can't reset MAC"); unregister_netdev( pegasus->net ); @@ -935,21 +868,21 @@ return NULL; } + info( "%s: %s", net->name, usb_dev_id[dev_index].name ); + set_ethernet_addr( pegasus ); - + if ( pegasus->features & PEGASUS_II ) { info( "setup Pegasus II specific registers" ); setup_pegasus_II( pegasus ); } pegasus->phy = mii_phy_probe( pegasus ); - if ( !pegasus->phy ) { + if ( pegasus->phy == 0xff ) { warn( "can't locate MII phy, using default" ); pegasus->phy = 1; } - info( "%s: %s", net->name, usb_dev_id[dev_indx].name ); - return pegasus; } @@ -979,7 +912,8 @@ int __init pegasus_init(void) { - info( "%s", version ); + info(DRIVER_VERSION " " DRIVER_AUTHOR); + info(DRIVER_DESC); return usb_register( &pegasus_driver ); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/pegasus.h linux.20p9/drivers/usb/pegasus.h --- linux.vanilla/drivers/usb/pegasus.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/pegasus.h Wed Aug 8 22:23:59 2001 @@ -0,0 +1,202 @@ +/* + * Copyright (c) 1999,2000 Petko Manolov - Petkan (petkan@dce.bg) + * + * 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 + */ + + +#ifndef PEGASUS_DEV + +#define PEGASUS_II 0x80000000 +#define HAS_HOME_PNA 0x40000000 + +#define PEGASUS_MTU 1500 +#define PEGASUS_MAX_MTU 1536 + +#define EPROM_WRITE 0x01 +#define EPROM_READ 0x02 +#define EPROM_DONE 0x04 +#define EPROM_WR_ENABLE 0x10 +#define EPROM_LOAD 0x20 + +#define MII_BMCR 0x00 +#define MII_BMSR 0x01 +#define BMSR_MEDIA 0x7808 +#define MII_ANLPA 0x05 +#define ANLPA_100TX_FD 0x0100 +#define ANLPA_100TX_HD 0x0080 +#define ANLPA_10T_FD 0x0040 +#define ANLPA_10T_HD 0x0020 +#define PHY_DONE 0x80 +#define PHY_READ 0x40 +#define PHY_WRITE 0x20 +#define DEFAULT_GPIO_RESET 0x24 +#define LINKSYS_GPIO_RESET 0x24 +#define DEFAULT_GPIO_SET 0x26 + +#define PEGASUS_PRESENT 0x00000001 +#define PEGASUS_RUNNING 0x00000002 +#define PEGASUS_TX_BUSY 0x00000004 +#define PEGASUS_RX_BUSY 0x00000008 +#define CTRL_URB_RUNNING 0x00000010 +#define CTRL_URB_SLEEP 0x00000020 +#define PEGASUS_UNPLUG 0x00000040 +#define ETH_REGS_CHANGE 0x40000000 +#define ETH_REGS_CHANGED 0x80000000 + +#define RX_MULTICAST 2 +#define RX_PROMISCUOUS 4 + +#define REG_TIMEOUT (HZ) +#define PEGASUS_TX_TIMEOUT (HZ*10) + +#define TX_UNDERRUN 0x80 +#define EXCESSIVE_COL 0x40 +#define LATE_COL 0x20 +#define NO_CARRIER 0x10 +#define LOSS_CARRIER 0x08 +#define JABBER_TIMEOUT 0x04 + +#define PEGASUS_REQT_READ 0xc0 +#define PEGASUS_REQT_WRITE 0x40 +#define PEGASUS_REQ_GET_REGS 0xf0 +#define PEGASUS_REQ_SET_REGS 0xf1 +#define PEGASUS_REQ_SET_REG PEGASUS_REQ_SET_REGS +#define ALIGN(x) x __attribute__((aligned(L1_CACHE_BYTES))) + +enum pegasus_registers { + EthCtrl0 = 0, + EthCtrl1 = 1, + EthCtrl2 = 2, + EthID = 0x10, + Reg1d = 0x1d, + EpromOffset = 0x20, + EpromData = 0x21, /* 0x21 low, 0x22 high byte */ + EpromCtrl = 0x23, + PhyAddr = 0x25, + PhyData = 0x26, /* 0x26 low, 0x27 high byte */ + PhyCtrl = 0x28, + UsbStst = 0x2a, + EthTxStat0 = 0x2b, + EthTxStat1 = 0x2c, + EthRxStat = 0x2d, + Reg7b = 0x7b, + Gpio0 = 0x7e, + Gpio1 = 0x7f, + Reg81 = 0x81, +}; + + +typedef struct pegasus { + struct usb_device *usb; + struct net_device *net; + struct net_device_stats stats; + unsigned flags; + unsigned features; + int dev_index; + int intr_interval; + struct urb ctrl_urb, rx_urb, tx_urb, intr_urb; + devrequest dr; + wait_queue_head_t ctrl_wait; + struct semaphore ctrl_sem; + unsigned char ALIGN(rx_buff[PEGASUS_MAX_MTU]); + unsigned char ALIGN(tx_buff[PEGASUS_MAX_MTU]); + unsigned char ALIGN(intr_buff[8]); + __u8 eth_regs[4]; + __u8 phy; + __u8 gpio_res; +} pegasus_t; + + +struct usb_eth_dev { + char *name; + __u16 vendor; + __u16 device; + __u32 private; /* LSB is gpio reset value */ +}; + +#define VENDOR_3COM 0x0506 +#define VENDOR_ACCTON 0x083a +#define VENDOR_ADMTEK 0x07a6 +#define VENDOR_BILLIONTON 0x08dd +#define VENDOR_COREGA 0x07aa +#define VENDOR_DLINK1 0x2001 +#define VENDOR_DLINK2 0x07b8 +#define VENDOR_IODATA 0x04bb +#define VENDOR_LANEED 0x056e +#define VENDOR_LINKSYS 0x066b +#define VENDOR_MELCO 0x0411 +#define VENDOR_SMARTBRIDGES 0x08d1 +#define VENDOR_SMC 0x0707 +#define VENDOR_SOHOWARE 0x15e8 + +#else /* PEGASUS_DEV */ + +PEGASUS_DEV( "3Com USB Ethernet 3C460B", VENDOR_3COM, 0x4601, + DEFAULT_GPIO_RESET | PEGASUS_II ) +PEGASUS_DEV( "Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "ADMtek ADM8511 \"Pegasus II\" USB Ethernet", + VENDOR_ADMTEK, 0x8511, + DEFAULT_GPIO_RESET | PEGASUS_II ) +PEGASUS_DEV( "ADMtek AN986 \"Pegasus\" USB Ethernet (eval board)", + VENDOR_ADMTEK, 0x0986, + DEFAULT_GPIO_RESET | HAS_HOME_PNA ) +PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987, + DEFAULT_GPIO_RESET | HAS_HOME_PNA ) +PEGASUS_DEV( "Billionton USBEL-100", VENDOR_BILLIONTON, 0x0988, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "Billionton USBE-100", VENDOR_BILLIONTON, 0x8511, + DEFAULT_GPIO_RESET | PEGASUS_II ) +PEGASUS_DEV( "Corega FEter USB-TX", VENDOR_COREGA, 0x0004, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK1, 0x4001, + LINKSYS_GPIO_RESET ) +PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK1, 0x4002, + LINKSYS_GPIO_RESET ) +PEGASUS_DEV( "D-Link DSB-650TX(PNA)", VENDOR_DLINK1, 0x4003, + DEFAULT_GPIO_RESET | HAS_HOME_PNA ) +PEGASUS_DEV( "D-Link DSB-650", VENDOR_DLINK1, 0xabc1, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "D-Link DU-E10", VENDOR_DLINK2, 0xabc1, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "D-Link DU-E100", VENDOR_DLINK2, 0x4002, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "FiberLine USB", VENDOR_DLINK2, 0x4102, + DEFAULT_GPIO_RESET | PEGASUS_II ) +PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR_IODATA, 0x0904, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "Linksys USB10TX", VENDOR_LINKSYS, 0x2202, + LINKSYS_GPIO_RESET ) +PEGASUS_DEV( "Linksys USB100TX", VENDOR_LINKSYS, 0x2203, + LINKSYS_GPIO_RESET ) +PEGASUS_DEV( "Linksys USB100TX", VENDOR_LINKSYS, 0x2204, + LINKSYS_GPIO_RESET | HAS_HOME_PNA ) +PEGASUS_DEV( "Linksys USB Ethernet Adapter", VENDOR_LINKSYS, 0x2206, + LINKSYS_GPIO_RESET ) +PEGASUS_DEV( "MELCO/BUFFALO LUA-TX", VENDOR_MELCO, 0x0001, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "smartNIC 2 PnP Adapter", VENDOR_SMARTBRIDGES, 0x0003, + DEFAULT_GPIO_RESET | PEGASUS_II ) +PEGASUS_DEV( "SMC 202 USB Ethernet", VENDOR_SMC, 0x0200, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "SOHOware NUB100 Ethernet", VENDOR_SOHOWARE, 0x9100, + DEFAULT_GPIO_RESET ) + +#endif /* PEGASUS_DEV */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/plusb.c linux.20p9/drivers/usb/plusb.c --- linux.vanilla/drivers/usb/plusb.c Sun Mar 25 17:31:42 2001 +++ linux.20p9/drivers/usb/plusb.c Wed Aug 8 22:24:01 2001 @@ -1,9 +1,11 @@ /*****************************************************************************/ /* - * plusb.c -- prolific pl-2302 driver. + * plusb.c -- prolific pl-2301/pl-2302 driver. * * Copyright (C) 2000 Deti Fliegl (deti@fliegl.de) + * Copyright (C) 2000 Pavel Machek (pavel@suse.cz) + * Copyright (C) 2000 Eric Z. Ayers (eric@compgen.com) * * 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 @@ -20,9 +22,100 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * + * This driver creates a network interface (plusb0, plusb1, ...) that will + * send messages over a USB host-host cable based on the Prolific ASIC. + * It works a lot like plip or PP over an RS-232C null modem cable. + * + * Expect speeds of around 330Kbytes/second over a UHCI host controller. + * OHCI should be faster. Increase the MTU for faster transfers of large + * files (up-to 800Kbytes/second). (16384 is a good size) * * $Id: plusb.c,v 1.18 2000/02/14 10:38:58 fliegl Exp $ * + * Changelog: + * + * v0.1 deti + * Original Version of driver. + * v0.2 15 Sep 2000 pavel + * Patches to decrease latency by rescheduling the bottom half of + * interrupt code. + * v0.3 10 Oct 2000 eric + * Patches to work in v2.2 backport (v2.4 changes the way net_dev.name + * is allocated) + * v0.4 19 Oct 2000 eric + * Some more performance fixes. Lock re-submitting urbs. + * Lower the number of sk_buff's to queue. + * v0.5 25 Oct 2000 eric + * Removed use of usb_bulk_msg() all together. This caused + * the driver to block in an interrupt context. + * Consolidate read urb submission into read_urb_submit(). + * Performance is the same as v0.4. + * v0.5.1 27 Oct 2000 eric + * Extra debugging messages to help diagnose problem with uchi.o stack. + * v0.5.2 27 Oct 2000 eric + * Set the 'start' flag for the network device in plusb_net_start() + * and plusb_net_stop() (doesn't help) + * v0.5.3 27 Oct 2000 pavel + * Commented out handlers when -EPIPE is received, + * (remove calls to usb_clear_halt()) Since the callback is in + * an interrupt context, it doesn't help, it just panics + * the kernel. (what do we do?) + * Under high load, dev_alloc_skb() fails, the read URB must + * be re-submitted. + * Added plusb_change_mtu() and increased the size of _BULK_DATA_LEN + * v0.5.4 31 Oct 2000 eric + * Fix race between plusb_net_xmit() and plusb_bulk_write_complete() + * v0.5.5 1 Nov 2000 eric + * Remove dev->start field, otherwise, it won't compile in 2.4 + * Use dev_kfree_skb_any(). (important in 2.4 kernel) + * v0.5.6 2 Nov 2000 pavel,eric + * Add calls to netif_stop_queue() and netif_start_queue() + * Drop packets that come in while the free list is empty. + * (This version is being submitted after the release of 2.4-test10) + * v0.5.7 6 Nov 2000 + * Fix to not re-submit the urb on error to help when cables + * are yanked (not tested) + * + * + * KNOWN PROBLEMS: (Any suggestions greatfully accepted!) + * + * 2 Nov 2000 + * - The shutdown for this may not be entirely clean. Sometimes, the + * kernel will Oops when the cable is unplugged, or + * if the plusb module is removed. + * - If you ifdown a device and then ifup it again, the link will not + * always work. You have to 'rmmod plusb ; modprobe plusb' on + * both machines to get it to work again. Something must be wrong with + * plusb_net_open() and plusb_net_start() ? Maybe + * the 'suspend' and 'resume' entry points need to be + * implemented? + * - Needs to handle -EPIPE correctly in bulk complete handlers. + * (replace usb_clear_halt() function with async urbs?) + * - I think this code relies too much on one spinlock and does + * too much in the interrupt handler. The net1080 code is + * much more elegant, and should work for this chip. Its + * only drawback is that it is going to be tough to backport + * it to v2.2. + * - Occasionally the device will hang under the 'uhci.o' + * driver. The workaround is to ifdown the device and + * remove the modules, then re-insert them. You may have + * better luck with the 'usb-uhci.o' driver. + * - After using ifconfig down ; ifconfig up, sometimes packets + * continue to be received, but there is a framing problem. + * + * FUTURE DIRECTIONS: + * + * - Fix the known problems. + * - There isn't much functional difference between the net1080 + * driver and this one. It would be neat if the same driver + * could handle both types of chips. Or if both drivers + * could handle both types of chips - this one is easier to + * backport to the 2.2 kernel. + * - Get rid of plusb_add_buf_tail and the single spinlock. + * Use a separate spinlock for the 2 lists, and use atomic + * operators for writeurb_submitted and readurb_submitted members. + * + * */ /*****************************************************************************/ @@ -40,23 +133,113 @@ #include #include #include -#define DEBUG +//#define DEBUG 1 #include -#include "plusb.h" +#if (LINUX_VERSION_CODE < 0x020300) +#define dev_kfree_skb_any dev_kfree_skb +#endif + +/* + * Version Information + */ +#define DRIVER_VERSION "v0.5.7" +#define DRIVER_AUTHOR "Deti Fliegl, deti@fliegl.de" +#define DRIVER_DESC "PL-2302 USB Interface Driver for Linux (c)2000" + +/* Definitions formerly in plusb.h relocated. No need to export them -EZA */ + +#define _PLUSB_INTPIPE 0x1 +#define _PLUSB_BULKOUTPIPE 0x2 +#define _PLUSB_BULKINPIPE 0x3 + +#define _SKB_NUM 32 + +/* increase size of BULK_DATA_LEN so we can use bigger MTU's*/ +#define _BULK_DATA_LEN 32768 + + +typedef struct +{ + int connected; /* indicates if this structure is active */ + struct usb_device *usbdev; + /* keep track of USB structure */ + int status; /* Prolific status byte returned from interrupt */ + int in_bh; /* flag to indicate that we are in the bulk handler */ + int opened; /* flag to indicate that network dev is open */ + + spinlock_t lock; /* Lock for the buffer list. re-used for + locking around submitting the readurb member. + */ + urb_t *inturb; /* Read buffer for the interrupt callback */ + unsigned char * interrupt_in_buffer; + /* holds data for the inturb*/ + urb_t *readurb; /* Read buffer for the bulk data callback */ + unsigned char * bulk_in_buffer; + /* kmalloc'ed data for the readurb */ + int readurb_submitted; + /* Flag to indicate that readurb already sent */ + urb_t *writeurb; /* Write buffer for the bulk data callback */ + int writeurb_submitted; + /* Flag to indicate that writeurb already sent */ + + struct list_head tx_skb_list; + /* sk_buff's read from net device */ + struct list_head free_skb_list; + /* free sk_buff list */ + struct net_device net_dev; + /* handle to linux network device */ + struct net_device_stats net_stats; + /* stats to return for ifconfig output */ +} plusb_t,*pplusb_t; + +/* + * skb_list - queue of packets from the network driver to be delivered to USB + */ +typedef struct +{ + struct list_head skb_list; + struct sk_buff *skb; + int state; + plusb_t *s; +} skb_list_t,*pskb_list_t; + /* --------------------------------------------------------------------- */ #define NRPLUSB 4 +/* + * Interrupt endpoint status byte, from Prolific PL-2301 docs + * Check the 'download' link at www.prolifictech.com + */ +#define _PL_INT_RES1 0x80 /* reserved */ +#define _PL_INT_RES2 0x40 /* reserved */ +#define _PL_INT_RXD _PL_INT_RES2 /* Read data ready - Not documented by Prolific, but seems to work! */ +#define _PL_INT_TX_RDY 0x20 /* OK to transmit data */ +#define _PL_INT_RESET_O 0x10 /* reset output pipe */ +#define _PL_INT_RESET_I 0x08 /* reset input pipe */ +#define _PL_INT_TX_C 0x04 /* transmission complete */ +#define _PL_INT_TX_REQ 0x02 /* transmission received */ +#define _PL_INT_PEER_E 0x01 /* peer exists */ + /*-------------------------------------------------------------------*/ static plusb_t plusb[NRPLUSB]; +static void plusb_write_bulk_complete(urb_t *purb); +static void plusb_read_bulk_complete(urb_t *purb); +static void plusb_int_complete(urb_t *purb); + /* --------------------------------------------------------------------- */ + +/* + * plusb_add_buf_tail - Take the head of the src list and append it to + * the tail of the dest list + */ static int plusb_add_buf_tail (plusb_t *s, struct list_head *dst, struct list_head *src) { - unsigned long flags; + unsigned long flags = 0; struct list_head *tmp; int ret = 0; @@ -76,126 +259,218 @@ } /*-------------------------------------------------------------------*/ -static int plusb_my_bulk(plusb_t *s, int pipe, void *data, int size, int *actual_length) +/* + * dequeue_next_skb - submit the first thing on the tx_skb_list to the + * USB stack. This function should be called each time we get a new + * message to send to the other host, or each time a message is successfully + * sent. + */ +static void dequeue_next_skb(char * func, plusb_t * s) { - int ret; + skb_list_t * skb_list; + unsigned long flags = 0; - dbg("plusb_my_bulk: len:%d",size); + if (!s->connected) + return; + + spin_lock_irqsave (&s->lock, flags); + + if (!list_empty (&s->tx_skb_list) && !s->writeurb_submitted) { + int submit_ret; + skb_list = list_entry (s->tx_skb_list.next, skb_list_t, skb_list); - ret=usb_bulk_msg(s->usbdev, pipe, data, size, actual_length, 500); - if(ret<0) { - err("plusb: usb_bulk_msg failed(%d)",ret); + if (skb_list->skb) { + s->writeurb_submitted = 1; + + /* Use the buffer inside the sk_buff directly. why copy? */ + FILL_BULK_URB_TO(s->writeurb, s->usbdev, + usb_sndbulkpipe(s->usbdev, _PLUSB_BULKOUTPIPE), + skb_list->skb->data, skb_list->skb->len, + plusb_write_bulk_complete, skb_list, 500); + + dbg ("%s: %s: submitting urb. skb_list %p", s->net_dev.name, func, skb_list); + + submit_ret = usb_submit_urb(s->writeurb); + if (submit_ret) { + s->writeurb_submitted = 0; + printk (KERN_CRIT "%s: %s: can't submit writeurb: %d\n", + s->net_dev.name, func, submit_ret); + } + } /* end if the skb value has been filled in */ } - if( ret == -EPIPE ) { - warn("CLEAR_FEATURE request to remove STALL condition."); - if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe))) - err("request failed"); - } - - dbg("plusb_my_bulk: finished act: %d", *actual_length); - return ret; + spin_unlock_irqrestore (&s->lock, flags); } -/* --------------------------------------------------------------------- */ - -static void plusb_bh(void *context) +/* + * submit_read_urb - re-submit the read URB to the stack + */ +void submit_read_urb(char * func, plusb_t * s) { - plusb_t *s=context; - struct net_device_stats *stats=&s->net_stats; - int ret=0; - int actual_length; - skb_list_t *skb_list; - struct sk_buff *skb; + unsigned long flags=0; - dbg("plusb_bh: i:%d",in_interrupt()); - - while(!list_empty(&s->tx_skb_list)) { - - if(!(s->status&_PLUSB_TXOK)) - break; - - skb_list = list_entry (s->tx_skb_list.next, skb_list_t, skb_list); - if(!skb_list->state) { - dbg("plusb_bh: not yet ready"); - schedule(); - continue; - } - - skb=skb_list->skb; - ret=plusb_my_bulk(s, usb_sndbulkpipe (s->usbdev, _PLUSB_BULKOUTPIPE), - skb->data, skb->len, &actual_length); - - if(ret || skb->len != actual_length ||!(skb->len%64)) { - plusb_my_bulk(s, usb_sndbulkpipe (s->usbdev, _PLUSB_BULKOUTPIPE), - NULL, 0, &actual_length); - } - - if(!ret) { - stats->tx_packets++; - stats->tx_bytes+=skb->len; - } - else { - stats->tx_errors++; - stats->tx_aborted_errors++; + if (!s->connected) + return; + + spin_lock_irqsave (&s->lock, flags); + + if (!s->readurb_submitted) { + int ret; + s->readurb_submitted=1; + s->readurb->dev=s->usbdev; + ret = usb_submit_urb(s->readurb); + if (ret) { + printk (KERN_CRIT "%s: %s: error %d submitting read URB\n", + s->net_dev.name, func, ret); + s->readurb_submitted=0; } - - dbg("plusb_bh: dev_kfree_skb"); - - dev_kfree_skb(skb); - skb_list->state=0; - plusb_add_buf_tail (s, &s->free_skb_list, &s->tx_skb_list); } - dbg("plusb_bh: finished"); - s->in_bh=0; + spin_unlock_irqrestore (&s->lock, flags); + } - /* --------------------------------------------------------------------- */ +/* + * plusb_net_xmit - callback from the network device driver for outgoing data + * + * Data has arrived to the network device from the local machine and needs + * to be sent over the USB cable. This is in an interrupt, so we don't + * want to spend too much time in this function. + * + */ static int plusb_net_xmit(struct sk_buff *skb, struct net_device *dev) { plusb_t *s=dev->priv; skb_list_t *skb_list; - int ret=NET_XMIT_SUCCESS; + unsigned int flags; dbg("plusb_net_xmit: len:%d i:%d",skb->len,in_interrupt()); - if(!s->connected || list_empty(&s->free_skb_list)) { - ret=NET_XMIT_CN; - goto lab; - } + if(!s->connected || !s->opened) { + /* + NOTE: If we get to this point, you'll return the error + kernel: virtual device plusb0 asks to queue packet + + Other things we could do: + 1) just drop this packet + 2) drop other packets in the queue + */ + return 1; + } + + spin_lock_irqsave (&s->lock, flags); - plusb_add_buf_tail (s, &s->tx_skb_list, &s->free_skb_list); + if (list_empty(&s->free_skb_list) + || plusb_add_buf_tail (s, &s->tx_skb_list, &s->free_skb_list)) { + /* The buffers on this side are full. DROP the packet + I think that this shouldn't happen with the correct + use of the netif_XXX functions -EZA + */ + dbg ("plusb: Free list is empty."); + kfree_skb(skb); + s->net_stats.tx_dropped++; + spin_unlock_irqrestore (&s->lock, flags); + return 0; + } + skb_list = list_entry (s->tx_skb_list.prev, skb_list_t, skb_list); skb_list->skb=skb; skb_list->state=1; + skb_list->s=s; -lab: - if(s->in_bh) - return ret; + if (list_empty(&s->free_skb_list)) { + /* apply "backpressure". Tell the net layer to stop sending + the driver packets. + */ + netif_stop_queue(dev); + } + + spin_unlock_irqrestore (&s->lock, flags); + + /* If there is no write urb outstanding, pull the first thing + off of the list and submit it to the USB stack + */ + dequeue_next_skb("plusb_net_xmit", s); + + return 0; +} - dbg("plusb_net_xmit: queue_task"); +/* --------------------------------------------------------------------- */ - s->in_bh=1; - queue_task(&s->bh, &tq_scheduler); +/* + * plusb_write_bulk_complete () - callback after the data has been + * sent to the USB device, or a timeout occurred. + */ +static void plusb_write_bulk_complete(urb_t *purb) +{ + skb_list_t * skb_list=purb->context; + plusb_t *s=skb_list->s; - dbg("plusb_net_xmit: finished"); - return ret; + dbg ("%s: plusb_write_bulk_complete: status:%d skb_list:%p\n", + s->net_dev.name, purb->status, skb_list); -} + skb_list->state=0; -/* --------------------------------------------------------------------- */ + if( purb->status == -EPIPE ) + printk(KERN_CRIT "%s: plusb_write_bulk_complete: got -EPIPE and don't know what to do!\n", + s->net_dev.name); + + if(!purb->status) { + s->net_stats.tx_packets++; + s->net_stats.tx_bytes+=skb_list->skb->len; + } + else { + err ("%s: plusb_write_bulk_complete: returned ERROR status:%d\n", + s->net_dev.name, purb->status); -static void plusb_bulk_complete(urb_t *purb) + s->net_stats.tx_errors++; + s->net_stats.tx_aborted_errors++; + } + + dbg("plusb_bh: dev_kfree_skb"); + + /* NOTE: In 2.4 it's a problem to call dev_kfree_skb() in a hard IRQ: + Oct 28 23:42:14 bug kernel: Warning: kfree_skb on hard IRQ c023329a + */ + dev_kfree_skb_any(skb_list->skb); + + skb_list->skb = NULL; + if (plusb_add_buf_tail (s, &s->free_skb_list, &s->tx_skb_list)) { + err ("plusb: tx list empty. This shouldn't happen."); + } + + purb->status = 0; + s->writeurb_submitted = 0; + + netif_wake_queue((&s->net_dev)); + + dequeue_next_skb("plusb_write_bulk_complete", s); + + +} + +/* + * plusb_read_bulk_complete - Callback for data arriving from the USB device + * + * This gets called back when a full 'urb' is received from the remote system. + * This urb was allocated by this driver and is kept in the member: s->readurb + * + */ +static void plusb_read_bulk_complete(urb_t *purb) { + plusb_t *s=purb->context; - dbg("plusb_bulk_complete: status:%d length:%d",purb->status,purb->actual_length); + dbg("plusb_read_bulk_complete: status:%d length:%d", purb->status,purb->actual_length); + if(!s->connected) return; - if( !purb->status) { + if( purb->status == -EPIPE ) + printk(KERN_CRIT "%s: plusb_read_bulk_complete: got -EPIPE and I don't know what to do!\n", + s->net_dev.name); + else if (!purb->status) { struct sk_buff *skb; unsigned char *dst; int len=purb->transfer_buffer_length; @@ -204,31 +479,69 @@ skb=dev_alloc_skb(len); if(!skb) { - err("plusb_bulk_complete: dev_alloc_skb(%d)=NULL, dropping frame",len); + printk (KERN_CRIT "%s: plusb_read_bulk_complete: dev_alloc_skb(%d)=NULL, dropping frame\n", s->net_dev.name, len); stats->rx_dropped++; - return; + } else { + dst=(char *)skb_put(skb, len); + memcpy( dst, purb->transfer_buffer, len); + + skb->dev=&s->net_dev; + skb->protocol=eth_type_trans(skb, skb->dev); + stats->rx_packets++; + stats->rx_bytes+=len; + netif_rx(skb); } + + } + + s->readurb_submitted = 0; + + if (purb->status) { + /* Give the system a chance to "catch its breath". Shortcut + re-submitting the read URB> It will be re-submitted if + another interrupt comes back. The problem scenario is that + the plub is pulled and the read returns an error. + You don't want to resumbit in this case. + */ + err ("%s: plusb_read_bulk_complete: returned status %d\n", + s->net_dev.name, purb->status); + return; + } - dst=(char *)skb_put(skb, len); - memcpy( dst, purb->transfer_buffer, len); - skb->dev=&s->net_dev; - skb->protocol=eth_type_trans(skb, skb->dev); - stats->rx_packets++; - stats->rx_bytes+=len; - netif_rx(skb); - } - else - purb->status=0; + purb->status=0; + + /* Keep it coming! resubmit the URB for reading.. Make sure + we aren't in contention with the interrupt callback. + */ + submit_read_urb("plusb_read_bulk_complete", s); } /* --------------------------------------------------------------------- */ - +/* + * plusb_int_complete - USB driver callback for interrupt msg from the device + * + * Interrupts are scheduled to go off on a periodic basis (see FILL_INT_URB) + * For the prolific device, this is basically just returning a register + * filled with bits. See the macro definitions for _PL_INT_XXX above. + * Most of these bits are for implementing a machine-machine protocol + * and can be set with a special message (described as the "Quicklink" + * feature in the prolific documentation.) + * + * I don't think we need any of that to work as a network device. If a + * message is lost, big deal - that's what UNIX networking expects from + * the physical layer. + * + */ static void plusb_int_complete(urb_t *purb) { plusb_t *s=purb->context; s->status=((unsigned char*)purb->transfer_buffer)[0]&255; + #if 0 + /* This isn't right because 0x20 is TX_RDY and + sometimes will not be set + */ if((s->status&0x3f)!=0x20) { warn("invalid device status %02X", s->status); return; @@ -237,66 +550,95 @@ if(!s->connected) return; - if(s->status&_PLUSB_RXD) { - int ret; - - if(s->bulkurb->status) { - err("plusb_int_complete: URB still in use"); - return; - } - - ret=usb_submit_urb(s->bulkurb); - if(ret && ret!=-EBUSY) { - err("plusb_int_complete: usb_submit_urb failed"); - } - } - - if(purb->status || s->status!=160) - dbg("status: %p %d buf: %02X", purb->dev, purb->status, s->status); + /* Don't turn this on unless you want to see the log flooded. */ +#if 0 + printk("plusb_int_complete: PEER_E:%d TX_REQ:%d TX_C:%d RESET_IN:%d RESET_O: %d TX_RDY:%d RES1:%d RES2:%d\n", + s->status & _PL_INT_PEER_E ? 1 : 0, + s->status & _PL_INT_TX_REQ ? 1 : 0, + s->status & _PL_INT_TX_C ? 1 : 0, + s->status & _PL_INT_RESET_I ? 1 : 0, + s->status & _PL_INT_RESET_O ? 1 : 0, + s->status & _PL_INT_TX_RDY ? 1 : 0, + s->status & _PL_INT_RES1 ? 1 : 0, + s->status & _PL_INT_RES2 ? 1 : 0); +#endif + +#if 1 + /* At first glance, this logic appears to not really be needed, but + it can help recover from intermittent problems where the + usb_submit_urb() fails in the read callback. -EZA + */ + + /* Try to submit the read URB again. Make sure + we aren't in contention with the bulk read callback + */ + submit_read_urb ("plusb_int_complete", s); + + /* While we are at it, why not check to see if the + write urb should be re-submitted? + */ + dequeue_next_skb("plusb_int_complete", s); + +#endif + } /* --------------------------------------------------------------------- */ - +/* + * plusb_free_all - deallocate all memory kept for an instance of the device. + */ static void plusb_free_all(plusb_t *s) { struct list_head *skb; skb_list_t *skb_list; dbg("plusb_free_all"); + + /* set a flag to tell all callbacks to cease and desist */ + s->connected = 0; + + /* If the interrupt handler is about to fire, let it finish up */ run_task_queue(&tq_immediate); if(s->inturb) { dbg("unlink inturb"); usb_unlink_urb(s->inturb); - } - - if(s->inturb && s->inturb->transfer_buffer) { - dbg("kfree inturb->transfer_buffer"); - kfree(s->inturb->transfer_buffer); - s->inturb->transfer_buffer=NULL; - } - - if(s->inturb) { dbg("free_urb inturb"); usb_free_urb(s->inturb); s->inturb=NULL; } + + if(s->interrupt_in_buffer) { + dbg("kfree s->interrupt_in_buffer"); + kfree(s->interrupt_in_buffer); + s->interrupt_in_buffer=NULL; + } + + if(s->readurb) { + dbg("unlink readurb"); + usb_unlink_urb(s->readurb); + dbg("free_urb readurb:"); + usb_free_urb(s->readurb); + s->readurb=NULL; + } - if(s->bulkurb) { - dbg("unlink bulkurb"); - usb_unlink_urb(s->bulkurb); + if(s->bulk_in_buffer) { + dbg("kfree s->bulk_in_buffer"); + kfree(s->bulk_in_buffer); + s->bulk_in_buffer=NULL; } - if(s->bulkurb && s->bulkurb->transfer_buffer) { - dbg("kfree bulkurb->transfer_buffer"); - kfree(s->bulkurb->transfer_buffer); - s->bulkurb->transfer_buffer=NULL; - } - if(s->bulkurb) { - dbg("free_urb bulkurb"); - usb_free_urb(s->bulkurb); - s->bulkurb=NULL; + s->readurb_submitted = 0; + + if(s->writeurb) { + dbg("unlink writeurb"); + usb_unlink_urb(s->writeurb); + dbg("free_urb writeurb:"); + usb_free_urb(s->writeurb); + s->writeurb=NULL; } + + s->writeurb_submitted = 0; while(!list_empty(&s->free_skb_list)) { skb=s->free_skb_list.next; @@ -309,20 +651,30 @@ skb=s->tx_skb_list.next; list_del(skb); skb_list = list_entry (skb, skb_list_t, skb_list); - kfree(skb_list); + if (skb_list->skb) { + dbg ("Freeing SKB in queue"); + dev_kfree_skb_any(skb_list->skb); + skb_list->skb = NULL; + } + kfree(skb_list); } + + s->in_bh=0; + dbg("plusb_free_all: finished"); } /*-------------------------------------------------------------------*/ - +/* + * plusb_alloc - allocate memory associated with one instance of the device + */ static int plusb_alloc(plusb_t *s) { int i; skb_list_t *skb; dbg("plusb_alloc"); - + for(i=0 ; i < _SKB_NUM ; i++) { skb=kmalloc(sizeof(skb_list_t), GFP_KERNEL); if(!skb) { @@ -340,47 +692,63 @@ goto reject; } - dbg("bulkurb allocation:"); - s->bulkurb=usb_alloc_urb(0); - if(!s->bulkurb) { + dbg("bulk read urb allocation:"); + s->readurb=usb_alloc_urb(0); + if(!s->readurb) { err("alloc_urb failed"); goto reject; } - dbg("bulkurb/inturb init:"); - s->inturb->dev=s->usbdev; - s->inturb->pipe=usb_rcvintpipe (s->usbdev, _PLUSB_INTPIPE); - s->inturb->transfer_buffer=kmalloc(64, GFP_KERNEL); - if(!s->inturb->transfer_buffer) { - err("kmalloc failed"); + dbg("bulk write urb allocation:"); + s->writeurb=usb_alloc_urb(0); + if(!s->writeurb) { + err("alloc_urb for writeurb failed"); goto reject; } - s->inturb->transfer_buffer_length=1; - s->inturb->complete=plusb_int_complete; - s->inturb->context=s; - s->inturb->interval=10; + dbg("readurb/inturb init:"); + s->interrupt_in_buffer=kmalloc(64, GFP_KERNEL); + if(!s->interrupt_in_buffer) { + err("kmalloc failed"); + goto reject; + } + + /* The original value of '10' makes this interrupt fire off a LOT. + It was set so low because the callback determined when to + sumbit the buld read URB. I've lowered it to 100 - the driver + doesn't depend on that logic anymore. -EZA + */ + FILL_INT_URB(s->inturb, s->usbdev, + usb_rcvintpipe (s->usbdev, _PLUSB_INTPIPE), + s->interrupt_in_buffer, 1, + plusb_int_complete, s, HZ); dbg("inturb submission:"); if(usb_submit_urb(s->inturb)<0) { err("usb_submit_urb failed"); goto reject; } - - dbg("bulkurb init:"); - s->bulkurb->dev=s->usbdev; - s->bulkurb->pipe=usb_rcvbulkpipe (s->usbdev, _PLUSB_BULKINPIPE); - s->bulkurb->transfer_buffer=kmalloc(_BULK_DATA_LEN, GFP_KERNEL); - if(!s->bulkurb->transfer_buffer) { - err("kmalloc failed"); - goto reject; - } - - s->bulkurb->transfer_buffer_length=_BULK_DATA_LEN; - s->bulkurb->complete=plusb_bulk_complete; - s->bulkurb->context=s; - dbg("plusb_alloc: finished"); + dbg("readurb init:"); + s->bulk_in_buffer = kmalloc(_BULK_DATA_LEN, GFP_KERNEL); + if (!s->bulk_in_buffer) { + err("kmalloc %d bytes for bulk in buffer failed", _BULK_DATA_LEN); + } + + FILL_BULK_URB(s->readurb, s->usbdev, + usb_rcvbulkpipe(s->usbdev, _PLUSB_BULKINPIPE), + s->bulk_in_buffer, _BULK_DATA_LEN, + plusb_read_bulk_complete, s); + + /* The write urb will be initialized inside the network + interrupt. + */ + + /* get the bulk read going */ + submit_read_urb("plusb_alloc", s); + + dbg ("plusb_alloc: finished. readurb=%p writeurb=%p inturb=%p", + s->readurb, s->writeurb, s->inturb); return 0; @@ -403,8 +771,11 @@ return -ENOMEM; s->opened=1; - MOD_INC_USE_COUNT; + MOD_INC_USE_COUNT; + + netif_start_queue(dev); + dbg("plusb_net_open: success"); return 0; @@ -416,11 +787,14 @@ static int plusb_net_stop(struct net_device *dev) { plusb_t *s=dev->priv; + + netif_stop_queue(dev); dbg("plusb_net_stop"); - plusb_free_all(s); s->opened=0; + plusb_free_all(s); + MOD_DEC_USE_COUNT; dbg("plusb_net_stop:finished"); return 0; @@ -457,33 +831,43 @@ { plusb_t *s = ptr; - printk ("plusb_net_disconnect: Starting\n"); - dbg("plusb_disconnect"); - s->connected = 0; - plusb_free_all(s); if(!s->opened && s->net_dev.name) { dbg("unregistering netdev: %s",s->net_dev.name); unregister_netdev(&s->net_dev); s->net_dev.name[0] = '\0'; -#if (LINUX_VERSION_CODE < 0x020300) - kfree (s->net_dev.name); - s->net_dev.name = NULL; -#endif +#if (LINUX_VERSION_CODE < 0x020300) + dbg("plusb_disconnect: About to free name"); + kfree (s->net_dev.name); + s->net_dev.name = NULL; +#endif } dbg("plusb_disconnect: finished"); - - printk ("plusb_net_disconnect: Finished\n"); - MOD_DEC_USE_COUNT; } /* --------------------------------------------------------------------- */ +static int plusb_change_mtu(struct net_device *dev, int new_mtu) +{ + if ((new_mtu < 68) || (new_mtu > _BULK_DATA_LEN)) + return -EINVAL; + + printk("plusb: changing mtu to %d\n", new_mtu); + dev->mtu = new_mtu; + + /* NOTE: Could we change the size of the READ URB here dynamically + to save kernel memory? + */ + return 0; +} + +/* --------------------------------------------------------------------- */ + int plusb_net_init(struct net_device *dev) { dbg("plusb_net_init"); @@ -493,7 +877,14 @@ dev->hard_start_xmit=plusb_net_xmit; dev->get_stats = plusb_net_get_stats; ether_setup(dev); - dev->tx_queue_len = 0; + dev->change_mtu = plusb_change_mtu; + /* Setting the default MTU to 16K gives good performance for + me, and keeps the ping latency low too. Setting it up + to 32K made performance go down. -EZA + Pavel says it would be best not to do this... + */ + /*dev->mtu=16384; */ + dev->tx_queue_len = 0; dev->flags = IFF_POINTOPOINT|IFF_NOARP; @@ -507,14 +898,8 @@ { plusb_t *s; - printk ("plusb_probe: Starting\n"); - - if (usbdev) { - printk("plusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d\n", - usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, ifnum); - } else { - printk ("plusb: usbdev is NULL!\n"); - } + dbg("plusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d", + usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, ifnum); if (usbdev->descriptor.idVendor != 0x067b || usbdev->descriptor.idProduct > 0x1) return NULL; @@ -523,61 +908,58 @@ if (usbdev->descriptor.bNumConfigurations != 1) return NULL; - printk ("plusb_probe: Looking for Struct\n"); s = plusb_find_struct (); if (!s) return NULL; s->usbdev = usbdev; - printk ("plusb_probe: Setting Configuration\n"); if (usb_set_configuration (s->usbdev, usbdev->config[0].bConfigurationValue) < 0) { err("set_configuration failed"); return NULL; } - printk ("plusb_probe: Setting Interface\n"); if (usb_set_interface (s->usbdev, 0, 0) < 0) { err("set_interface failed"); return NULL; } - printk ("plusb_probe: Checking device name\n"); - #if (LINUX_VERSION_CODE < 0x020300) - { - int i; + { + int i; - /* EZA: find the device number... we seem to have lost it...*/ - for (i=0; inet_dev.name) { - s->net_dev.name = kmalloc(strlen("plusbXXXX"), GFP_KERNEL); - sprintf (s->net_dev.name, "plusb%d", i); - s->net_dev.init=plusb_net_init; - s->net_dev.priv=s; - - printk ("plusb_probe: Registering Device\n"); - if(!register_netdev(&s->net_dev)) - info("registered: %s", s->net_dev.name); - else { - err("register_netdev failed"); - s->net_dev.name[0] = '\0'; - } - printk ("plusb_probe: Connected!\n"); - } - } + /* For Kernel version 2.2, the driver is responsible for + allocating this memory. For version 2.4, the rules + have apparently changed, but there is a nifty function + 'init_netdev' that might make this easier... It's in + ../net/net_init.c - but can we get there from here? (no) + -EZA + */ + + /* Find the device number... we seem to have lost it... -EZA */ + for (i=0; inet_dev.name) { + s->net_dev.name = kmalloc(strlen("plusbXXXX"), GFP_KERNEL); + sprintf (s->net_dev.name, "plusb%d", i); + s->net_dev.init=plusb_net_init; + s->net_dev.priv=s; + + printk ("plusb_probe: Registering Device\n"); + if(!register_netdev(&s->net_dev)) + info("registered: %s", s->net_dev.name); + else { + err("register_netdev failed"); + s->net_dev.name[0] = '\0'; + } + dbg ("plusb_probe: Connected!"); + } + } #else - /* Kernel version 2.3+ works a little bit differently */ + /* Kernel version 2.3+ works a little bit differently than 2.2 */ if(!s->net_dev.name[0]) { strcpy(s->net_dev.name, "plusb%d"); s->net_dev.init=plusb_net_init; @@ -589,10 +971,9 @@ s->net_dev.name[0] = '\0'; } } - #endif + s->connected = 1; - printk ("plusb_probe: Set Connected\n"); if(s->opened) { dbg("net device already allocated, restarting USB transfers"); @@ -617,32 +998,24 @@ static int __init plusb_init (void) { unsigned u; - dbg("plusb_init"); /* initialize struct */ for (u = 0; u < NRPLUSB; u++) { - plusb_t *s; - dbg("plusb_init: u=%ud about to assign s\n", u); - s= &plusb[u]; - dbg("plusb_init: u=%ud about to memset\n", u); + plusb_t *s = &plusb[u]; memset (s, 0, sizeof (plusb_t)); - s->bh.routine = (void (*)(void *))plusb_bh; - s->bh.data = s; - dbg("plusb_init: u=%ud about to init list head\n", u); INIT_LIST_HEAD (&s->tx_skb_list); INIT_LIST_HEAD (&s->free_skb_list); - dbg("plusb_init: u=%ud about to init spin lock\n", u); spin_lock_init (&s->lock); } - - dbg ("plusb_init: Initialized structure\n"); - + /* register misc device */ usb_register (&plusb_driver); dbg("plusb_init: driver registered"); + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -655,10 +1028,21 @@ dbg("plusb_cleanup"); for (u = 0; u < NRPLUSB; u++) { plusb_t *s = &plusb[u]; +#if (LINUX_VERSION_CODE < 0x020300) + if(s->net_dev.name) { + dbg("unregistering netdev: %s",s->net_dev.name); + unregister_netdev(&s->net_dev); + s->net_dev.name[0] = '\0'; + kfree (s->net_dev.name); + s->net_dev.name = NULL; + } +#else if(s->net_dev.name[0]) { dbg("unregistering netdev: %s",s->net_dev.name); unregister_netdev(&s->net_dev); + s->net_dev.name[0] = '\0'; } +#endif } usb_deregister (&plusb_driver); dbg("plusb_cleanup: finished"); @@ -666,8 +1050,8 @@ /* --------------------------------------------------------------------- */ -MODULE_AUTHOR ("Deti Fliegl, deti@fliegl.de"); -MODULE_DESCRIPTION ("PL-2302 USB Interface Driver for Linux (c)2000"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); module_init (plusb_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/printer.c linux.20p9/drivers/usb/printer.c --- linux.vanilla/drivers/usb/printer.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/printer.c Wed Jul 4 16:03:58 2001 @@ -460,7 +460,7 @@ struct usb_endpoint_descriptor *epread, *epwrite; struct usblp *usblp; int minor, i, bidir = 0, quirks; - int alts = dev->actconfig->interface[ifnum].act_altsetting; + int alts = -1; int length, err; char *buf; @@ -474,6 +474,9 @@ (interface->bInterfaceProtocol > 1 && interface->bNumEndpoints < 2)) continue; + if (alts == -1) + alts = i; + if (interface->bInterfaceProtocol > 1) { bidir = 1; alts = i; @@ -481,6 +484,9 @@ } } + if (alts == -1) + return NULL; + interface = &dev->actconfig->interface[ifnum].altsetting[alts]; if (usb_set_interface(dev, ifnum, alts)) err("can't set desired altsetting %d on interface %d", alts, ifnum); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/rio500.c linux.20p9/drivers/usb/rio500.c --- linux.vanilla/drivers/usb/rio500.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/rio500.c Wed Aug 8 22:24:15 2001 @@ -40,6 +40,13 @@ #include "rio500_usb.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Cesar Miquel " +#define DRIVER_DESC "USB Rio 500 driver" + #define RIO_MINOR 64 /* stall/wait timeout for rio */ @@ -121,16 +128,21 @@ data = (void *) arg; if (data == NULL) break; - if (copy_from_user(&rio_cmd, data, sizeof(struct RioCommand))) - return -EFAULT; - if (rio_cmd.length > PAGE_SIZE) - return -EINVAL; + if (copy_from_user(&rio_cmd, data, sizeof(struct RioCommand))) { + retval = -EFAULT; + goto err_out; + } + if (rio_cmd.length > PAGE_SIZE) { + retval = -EINVAL; + goto err_out; + } buffer = (unsigned char *) __get_free_page(GFP_KERNEL); if (buffer == NULL) return -ENOMEM; if (copy_from_user(buffer, rio_cmd.buffer, rio_cmd.length)) { + retval = -EFAULT; free_page((unsigned long) buffer); - return -EFAULT; + goto err_out; } requesttype = rio_cmd.requesttype | USB_DIR_IN | @@ -466,8 +478,7 @@ release: close_rio, }; -static struct -usb_driver rio_driver = { +static struct usb_driver rio_driver = { name: "rio500", probe: probe_rio, disconnect: disconnect_rio, @@ -481,6 +492,8 @@ return -1; info("USB Rio support registered."); + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -498,5 +511,6 @@ module_init(usb_rio_init); module_exit(usb_rio_cleanup); -MODULE_AUTHOR("Cesar Miquel "); -MODULE_DESCRIPTION("USB Rio 500 driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/scanner.c linux.20p9/drivers/usb/scanner.c --- linux.vanilla/drivers/usb/scanner.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/scanner.c Wed Jul 4 16:03:58 2001 @@ -1,7 +1,7 @@ /* -*- linux-c -*- */ /* - * Driver for USB Scanners (linux-2.4.0test1-ac7) + * Driver for USB Scanners (linux-2.4.0) * * Copyright (C) 1999, 2000 David E. Nelson * @@ -199,6 +199,34 @@ * - Fixed HP S20 ID's...again..sigh. Thanks to Ruud * Linders . * + * 0.4.4 + * - Added addtional Mustek ID's (BearPaw 1200, 600 CU, 1200 USB, + * and 1200 UB. Thanks to Henning Meier-Geinitz . + * - Added the Vuego Scan Brisa 340U ID's. Apparently this scanner is + * marketed by Acer Peripherals as a cheap 300 dpi model. Thanks to + * David Gundersen . + * - Added the Epson Expression1600 ID's. Thanks to Karl Heinz + * Kremer . + * + * 0.4.5 2/28/2001 + * - Added Mustek ID's (BearPaw 2400, 1200 CU Plus, BearPaw 1200F). + * Thanks to Henning Meier-Geinitz . + * - Added read_timeout module parameter to override RD_NAK_TIMEOUT + * when read()'ing from devices. + * - Stalled pipes are now checked and cleared with + * usb_clear_halt() for the read_scanner() function. This should + * address the "funky result: -32" error messages. + * - Removed Microtek scanner ID's. Microtek scanners are now + * supported via the drivers/usb/microtek.c driver. + * - Added scanner specific read timeout's. + * - Return status errors are NEGATIVE!!! This should address the + * "funky result: -110" error messages. + * - Replaced USB_ST_TIMEOUT with ETIMEDOUT. + * - rd_nak was still defined in MODULE_PARM. It's been updated with + * read_timeout. Thanks to Mark W. Webb for + * reporting this bug. + * - Added Epson Perfection 1640SU and 1640SU Photo. Thanks to + * Jean-Luc . * * TODO * @@ -236,6 +264,7 @@ */ #include "scanner.h" + static void irq_scanner(struct urb *urb) { @@ -266,13 +295,18 @@ kdev_t scn_minor; + int err=0; + + lock_kernel(); + scn_minor = USB_SCN_MINOR(inode); dbg("open_scanner: scn_minor:%d", scn_minor); if (!p_scn_table[scn_minor]) { err("open_scanner(%d): Unable to access minor data", scn_minor); - return -ENODEV; + err = -ENODEV; + goto out_error; } scn = p_scn_table[scn_minor]; @@ -281,17 +315,20 @@ if (!dev) { err("open_scanner(%d): Scanner device not present", scn_minor); - return -ENODEV; + err = -ENODEV; + goto out_error; } if (!scn->present) { err("open_scanner(%d): Scanner is not present", scn_minor); - return -ENODEV; + err = -ENODEV; + goto out_error; } if (scn->isopen) { err("open_scanner(%d): Scanner device is already open", scn_minor); - return -EBUSY; + err = -EBUSY; + goto out_error; } init_waitqueue_head(&scn->rd_wait_q); @@ -302,7 +339,11 @@ MOD_INC_USE_COUNT; - return 0; +out_error: + + unlock_kernel(); + + return err; } static int @@ -338,7 +379,7 @@ { struct scn_usb_data *scn; struct usb_device *dev; - + ssize_t bytes_written = 0; /* Overall count of bytes written */ ssize_t ret = 0; @@ -347,7 +388,7 @@ int this_write; /* Number of bytes to write */ int partial; /* Number of bytes successfully written */ int result = 0; - + char *obuf; scn = file->private_data; @@ -360,6 +401,8 @@ file->f_dentry->d_inode->i_atime = CURRENT_TIME; + down(&(scn->gen_lock)); + while (count > 0) { if (signal_pending(current)) { @@ -368,7 +411,7 @@ } this_write = (count >= OBUF_SIZE) ? OBUF_SIZE : count; - + if (copy_from_user(scn->obuf, buffer, this_write)) { ret = -EFAULT; break; @@ -377,15 +420,15 @@ result = usb_bulk_msg(dev,usb_sndbulkpipe(dev, scn->bulk_out_ep), obuf, this_write, &partial, 60*HZ); dbg("write stats(%d): result:%d this_write:%d partial:%d", scn_minor, result, this_write, partial); - if (result == USB_ST_TIMEOUT) { /* NAK -- shouldn't happen */ + if (result == -ETIMEDOUT) { /* NAK -- shouldn't happen */ warn("write_scanner: NAK received."); - ret = -ETIME; + ret = result; break; } else if (result < 0) { /* We should not get any I/O errors */ warn("write_scanner(%d): funky result: %d. Please notify the maintainer.", scn_minor, result); ret = -EIO; break; - } + } #ifdef WR_DATA_DUMP if (partial) { @@ -412,6 +455,7 @@ break; } } + up(&(scn->gen_lock)); mdelay(5); /* This seems to help with SANE queries */ return ret ? ret : bytes_written; } @@ -450,6 +494,7 @@ atime of the device node */ + down(&(scn->gen_lock)); while (count > 0) { if (signal_pending(current)) { @@ -458,11 +503,11 @@ } this_read = (count >= IBUF_SIZE) ? IBUF_SIZE : count; - - result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_in_ep), ibuf, this_read, &partial, RD_NAK_TIMEOUT); + + result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_in_ep), ibuf, this_read, &partial, scn->rd_nak_timeout); dbg("read stats(%d): result:%d this_read:%d partial:%d count:%d", scn_minor, result, this_read, partial, count); -/* +/* * Scanners are sometimes inheriently slow since they are mechanical * in nature. USB bulk reads tend to timeout while the scanner is * positioning, resetting, warming up the lamp, etc if the timeout is @@ -473,26 +518,38 @@ * that something had hung or crashed when in fact the USB read was * just waiting on data. So, the below code retains the same long * timeout period, but splits it up into smaller parts so that - * Ctrl-C's are acted upon in a reasonable amount of time. + * Ctrl-C's are acted upon in a reasonable amount of time. */ - if (result == USB_ST_TIMEOUT && !partial) { /* Timeout - and no - data */ - if (--rd_expire <= 0) { - warn("read_scanner(%d): excessive NAK's received", scn_minor); - ret = -ETIME; - break; - } else { - interruptible_sleep_on_timeout(&scn->rd_wait_q, RD_NAK_TIMEOUT); - continue; + if (result == -ETIMEDOUT) { /* NAK */ + if (!partial) { /* No data */ + if (--rd_expire <= 0) { /* Give it up */ + warn("read_scanner(%d): excessive NAK's received", scn_minor); + ret = result; + break; + } else { /* Keep trying to read data */ + interruptible_sleep_on_timeout(&scn->rd_wait_q, scn->rd_nak_timeout); + continue; + } + } else { /* Timeout w/ some data */ + goto data_recvd; } + } + + if (result == -EPIPE) { /* No hope */ + if(usb_clear_halt(dev, scn->bulk_in_ep)) { + err("read_scanner(%d): Failure to clear endpoint halt condition (%Zd).", scn_minor, ret); + } + ret = result; + break; } else if ((result < 0) && (result != USB_ST_DATAUNDERRUN)) { warn("read_scanner(%d): funky result:%d. Please notify the maintainer.", scn_minor, (int)result); ret = -EIO; break; } + data_recvd: + #ifdef RD_DATA_DUMP if (partial) { unsigned char cnt, cnt_max; @@ -518,7 +575,8 @@ break; } } - + up(&(scn->gen_lock)); + return ret ? ret : bytes_read; } @@ -528,7 +586,7 @@ struct scn_usb_data *scn; struct usb_interface_descriptor *interface; struct usb_endpoint_descriptor *endpoint; - + int ep_cnt; int ix; @@ -550,7 +608,7 @@ * 3. Determine/Assign Intr Endpoint */ -/* +/* * There doesn't seem to be an imaging class defined in the USB * Spec. (yet). If there is, HP isn't following it and it doesn't * look like anybody else is either. Therefore, we have to test the @@ -577,7 +635,7 @@ dev->descriptor.idProduct == product) { /* User specified */ valid_device = 1; } - + if (!valid_device) return NULL; /* We didn't find anything pleasing */ @@ -599,7 +657,7 @@ interface = dev->config[0].interface[ifnum].altsetting; endpoint = interface[ifnum].endpoint; -/* +/* * Start checking for two bulk endpoints OR two bulk endpoints *and* one * interrupt endpoint. If we have an interrupt endpoint go ahead and * setup the handler. FIXME: This is a future enhancement... @@ -622,7 +680,7 @@ dbg("probe_scanner: bulk_in_ep:%d", have_bulk_in); continue; } - + if (!have_bulk_out && IS_EP_BULK_OUT(endpoint[ep_cnt])) { ep_cnt++; have_bulk_out = ep_cnt; @@ -665,7 +723,7 @@ } -/* +/* * Determine a minor number and initialize the structure associated * with it. The problem with this is that we are counting on the fact * that the user will sequentially add device nodes for the scanner @@ -695,7 +753,7 @@ /* Ok, if we detected an interrupt EP, setup a handler for it */ if (have_intr) { dbg("probe_scanner(%d): Configuring IRQ handler for intr EP:%d", scn_minor, have_intr); - FILL_INT_URB(&scn->scn_irq, dev, + FILL_INT_URB(&scn->scn_irq, dev, usb_rcvintpipe(dev, have_intr), &scn->button, 1, irq_scanner, scn, // endpoint[(int)have_intr].bInterval); @@ -724,6 +782,26 @@ return NULL; } dbg("probe_scanner(%d): ibuf address:%p", scn_minor, scn->ibuf); + + + switch (dev->descriptor.idVendor) { /* Scanner specific read timeout parameters */ + case 0x04b8: /* Seiko/Epson */ + scn->rd_nak_timeout = HZ * 40; + break; + case 0x055f: /* Mustek */ + case 0x0400: /* Another Mustek */ + case 0x0ff5: /* And yet another Mustek */ + scn->rd_nak_timeout = HZ * 1; + default: + scn->rd_nak_timeout = RD_NAK_TIMEOUT; + } + + + if (read_timeout > 0) { /* User specified read timeout overrides everything */ + info("probe_scanner: User specified USB read timeout - %d", read_timeout); + scn->rd_nak_timeout = read_timeout; + } + scn->bulk_in_ep = have_bulk_in; scn->bulk_out_ep = have_bulk_out; @@ -733,6 +811,8 @@ scn->scn_minor = scn_minor; scn->isopen = 0; + init_MUTEX(&(scn->gen_lock)); + return p_scn_table[scn_minor] = scn; } @@ -740,7 +820,7 @@ disconnect_scanner(struct usb_device *dev, void *ptr) { struct scn_usb_data *scn = (struct scn_usb_data *) ptr; - + if(scn->intr_ep) { dbg("disconnect_scanner(%d): Unlinking IRQ URB", scn->scn_minor); usb_unlink_urb(&scn->scn_irq); @@ -762,11 +842,11 @@ unsigned int cmd, unsigned long arg) { struct usb_device *dev; - + int result; kdev_t scn_minor; - + scn_minor = USB_SCN_MINOR(inode); if (!p_scn_table[scn_minor]) { @@ -775,7 +855,7 @@ } dev = p_scn_table[scn_minor]->scn_dev; - + switch (cmd) { case PV8630_IOCTL_INREQUEST : @@ -786,10 +866,10 @@ __u16 value; __u16 index; } args; - + if (copy_from_user(&args, (void *)arg, sizeof(args))) return -EFAULT; - + result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), args.request, USB_TYPE_VENDOR| USB_RECIP_DEVICE|USB_DIR_IN, @@ -802,7 +882,7 @@ return -EFAULT; dbg("ioctl_scanner(%d): inreq: result:%d\n", scn_minor, result); - + return result; } case PV8630_IOCTL_OUTREQUEST : @@ -812,10 +892,10 @@ __u16 value; __u16 index; } args; - + if (copy_from_user(&args, (void *)arg, sizeof(args))) return -EFAULT; - + dbg("ioctl_scanner(%d): outreq: args.value:%x args.index:%x args.request:%x\n", scn_minor, args.value, args.index, args.request); result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), @@ -825,7 +905,7 @@ 0, HZ*5); dbg("ioctl_scanner(%d): outreq: result:%d\n", scn_minor, result); - + return result; } default: @@ -848,12 +928,11 @@ static struct usb_driver scanner_driver = { - "usbscanner", - probe_scanner, - disconnect_scanner, - { NULL, NULL }, - &usb_scanner_fops, - SCN_BASE_MNR + name: "usbscanner", + probe: probe_scanner, + disconnect: disconnect_scanner, + fops: &usb_scanner_fops, + minor: SCN_BASE_MNR, }; void __exit diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/scanner.h linux.20p9/drivers/usb/scanner.h --- linux.vanilla/drivers/usb/scanner.h Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/scanner.h Wed Aug 8 22:40:28 2001 @@ -1,5 +1,5 @@ /* - * Driver for USB Scanners (linux-2.4.0test1-ac7) + * Driver for USB Scanners (linux-2.4.0) * * Copyright (C) 1999, 2000 David E. Nelson * @@ -30,12 +30,13 @@ #include #include #include +#include // #define DEBUG #include -static __s32 vendor=-1, product=-1; +static __s32 vendor=-1, product=-1, read_timeout=0; MODULE_AUTHOR("David E. Nelson, dnelson@jump.net, http://www.jump.net/~dnelson"); MODULE_DESCRIPTION("USB Scanner Driver"); @@ -46,6 +47,9 @@ MODULE_PARM(product, "i"); MODULE_PARM_DESC(product, "User specified USB idProduct"); +MODULE_PARM(read_timeout, "i"); +MODULE_PARM_DESC(read_timeout, "User specified read timeout in seconds"); + /* Enable to activate the ioctl interface. This is mainly meant for */ /* development purposes until an ioctl number is officially registered */ @@ -72,7 +76,7 @@ #define OBUF_SIZE 4096 /* read_scanner timeouts -- RD_NAK_TIMEOUT * RD_EXPIRE = Number of seconds */ -#define RD_NAK_TIMEOUT (10*HZ) /* Number of X seconds to wait */ +#define RD_NAK_TIMEOUT (10*HZ) /* Default number of X seconds to wait */ #define RD_EXPIRE 12 /* Number of attempts to wait X seconds */ @@ -89,11 +93,13 @@ unsigned int ifnum; /* Interface number of the USB device */ kdev_t scn_minor; /* Scanner minor - used in disconnect() */ unsigned char button; /* Front panel buffer */ - char isopen; /* Not zero if the device is open */ + char isopen; /* Not zero if the device is open */ char present; /* Not zero if device is present */ char *obuf, *ibuf; /* transfer buffers */ char bulk_in_ep, bulk_out_ep, intr_ep; /* Endpoint assignments */ wait_queue_head_t rd_wait_q; /* read timeouts */ + struct semaphore gen_lock; /* lock to prevent concurrent reads or writes */ + unsigned int rd_nak_timeout; /* Seconds to wait before read() timeout. */ }; static struct scn_usb_data *p_scn_table[SCN_MAX_MNR] = { NULL, /* ... */}; @@ -106,8 +112,10 @@ /* Acer */ { 0x04a5, 0x2060 }, /* Prisa Acerscan 620U & 640U (!) */ { 0x04a5, 0x2040 }, /* Prisa AcerScan 620U (!) */ + { 0x04a5, 0x2022 }, /* Vuego Scan Brisa 340U */ /* Agfa */ { 0x06bd, 0x0001 }, /* SnapScan 1212U */ + { 0x06bd, 0x0002 }, /* SnapScan 1236U */ { 0x06bd, 0x2061 }, /* Another SnapScan 1212U (?) */ { 0x06bd, 0x0100 }, /* SnapScan Touch */ /* Colorado -- See Primax/Colorado below */ @@ -120,20 +128,28 @@ { 0x03f0, 0x0105 }, /* 4200C */ { 0x03f0, 0x0102 }, /* PhotoSmart S20 */ { 0x03f0, 0x0401 }, /* 5200C */ + // { 0x03f0, 0x0701 }, /* 5300C - NOT SUPPORTED - see http://www.neatech.nl/oss/HP5300C/ */ { 0x03f0, 0x0201 }, /* 6200C */ { 0x03f0, 0x0601 }, /* 6300C */ /* iVina */ { 0x0638, 0x0268 }, /* 1200U */ - /* Microtek */ - { 0x05da, 0x0099 }, /* ScanMaker X6 - X6U */ - { 0x05da, 0x0094 }, /* Phantom 336CX - C3 */ - { 0x05da, 0x00a0 }, /* Phantom 336CX - C3 #2 */ - { 0x05da, 0x009a }, /* Phantom C6 */ - { 0x05da, 0x00a3 }, /* ScanMaker V6USL */ - { 0x05da, 0x80a3 }, /* ScanMaker V6USL #2 */ - { 0x05da, 0x80ac }, /* ScanMaker V6UL - SpicyU */ + /* Microtek No longer supported - Enable SCSI and USB Microtek in kernel config */ + // { 0x05da, 0x0099 }, /* ScanMaker X6 - X6U */ + // { 0x05da, 0x0094 }, /* Phantom 336CX - C3 */ + // { 0x05da, 0x00a0 }, /* Phantom 336CX - C3 #2 */ + // { 0x05da, 0x009a }, /* Phantom C6 */ + // { 0x05da, 0x00a3 }, /* ScanMaker V6USL */ + // { 0x05da, 0x80a3 }, /* ScanMaker V6USL #2 */ + // { 0x05da, 0x80ac }, /* ScanMaker V6UL - SpicyU */ /* Mustek */ { 0x055f, 0x0001 }, /* 1200 CU */ + { 0x0400, 0x1000 }, /* BearPaw 1200 */ + { 0x055f, 0x0002 }, /* 600 CU */ + { 0x055f, 0x0003 }, /* 1200 USB */ + { 0x055f, 0x0006 }, /* 1200 UB */ + { 0x0400, 0x1001 }, /* BearPaw 2400 */ + { 0x055f, 0x0008 }, /* 1200 CU Plus */ + { 0x0ff5, 0x0010 }, /* BearPaw 1200F */ /* Primax/Colorado */ { 0x0461, 0x0300 }, /* G2-300 #1 */ { 0x0461, 0x0380 }, /* G2-600 #1 */ @@ -151,7 +167,11 @@ { 0x04b8, 0x0101 }, /* Perfection 636U and 636Photo */ { 0x04b8, 0x0103 }, /* Perfection 610 */ { 0x04b8, 0x0104 }, /* Perfection 1200U and 1200Photo */ + { 0x04b8, 0x0106 }, /* Stylus Scan 2500 */ + { 0x04b8, 0x0107 }, /* Expression 1600 */ + { 0x04b8, 0x010a }, /* Perfection 1640SU and 1640SU Photo */ { 0x04b8, 0x010b }, /* Perfection 1240U and 1240Photo */ + { 0x04b8, 0x010c }, /* Perfection 640U */ /* Umax */ { 0x1606, 0x0010 }, /* Astra 1220U */ { 0x1606, 0x0002 }, /* Astra 1236U */ @@ -161,6 +181,10 @@ { 0x04a7, 0x0221 }, /* OneTouch 5300 */ { 0x04a7, 0x0221 }, /* OneTouch 7600 duplicate ID (!) */ { 0x04a7, 0x0231 }, /* 6100 */ + { 0x04a7, 0x0211 }, /* OneTouch 7600 USB */ + { 0x04a7, 0x0311 }, /* 6200 EPP/USB */ + { 0x04a7, 0x0321 }, /* OneTouch 8100 EPP/USB */ + { 0x04a7, 0x0331 }, /* OneTouch 8600 EPP/USB */ }; /* Forward declarations */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/Config.in linux.20p9/drivers/usb/serial/Config.in --- linux.vanilla/drivers/usb/serial/Config.in Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/Config.in Wed Jul 4 16:03:58 2001 @@ -6,7 +6,9 @@ tristate 'USB Serial Converter support' CONFIG_USB_SERIAL $CONFIG_USB if [ "$CONFIG_USB_SERIAL" != "n" ]; then - bool ' USB Serial Converter verbose debug' CONFIG_USB_SERIAL_DEBUG + if [ "$CONFIG_USB_SERIAL" = "y" ]; then + bool ' USB Serial Converter verbose debug' CONFIG_USB_SERIAL_DEBUG + fi bool ' USB Generic Serial Driver' CONFIG_USB_SERIAL_GENERIC dep_tristate ' USB Belkin and Peracom Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_BELKIN $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB ConnectTech WhiteHEAT Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_WHITEHEAT $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL @@ -14,9 +16,10 @@ dep_tristate ' USB Empeg empeg-car Mark I/II Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_EMPEG $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB Handspring Visor Driver' CONFIG_USB_SERIAL_VISOR $CONFIG_USB_SERIAL + dep_tristate ' USB Inside Out Edgeport Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_EDGEPORT $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB Keyspan PDA Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN_PDA $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB Keyspan USA-xxx Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL - if [ "$CONFIG_USB_SERIAL_KEYSPAN" = "y" -o "$CONFIG_USB_SERIAL_KEYSPAN" = "m" ]; then + if [ "$CONFIG_USB_SERIAL_KEYSPAN" != "n" ]; then bool ' USB Keyspan USA-28 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28 bool ' USB Keyspan USA-28X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28X bool ' USB Keyspan USA-19 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19 @@ -24,6 +27,7 @@ bool ' USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W bool ' USB Keyspan USA-49W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA49W fi + dep_tristate ' USB MCT Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_MCT_U232 $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_OMNINET $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/Makefile linux.20p9/drivers/usb/serial/Makefile --- linux.vanilla/drivers/usb/serial/Makefile Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/Makefile Wed Jul 4 16:03:58 2001 @@ -24,6 +24,8 @@ obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT) += digi_acceleport.o obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o +obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o +obj-$(CONFIG_USB_SERIAL_EDGEPORT) += io_edgeport.o # Objects that export symbols. export-objs := usbserial.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/belkin_sa.c linux.20p9/drivers/usb/serial/belkin_sa.c --- linux.vanilla/drivers/usb/serial/belkin_sa.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/belkin_sa.c Wed Aug 8 22:24:15 2001 @@ -23,8 +23,15 @@ * framework in, but haven't analyzed the "tty_flip" interface yet. * -- Add support for flush commands * -- Add everything that is missing :) + * + * 08-Apr-2001 gb + * - Identify version on module load. * - * (11/06/2000) gkh + * 12-Mar-2001 gkh + * - Added support for the GoHubs GO-COM232 device which is the same as the + * Peracom device. + * + * 06-Nov-2000 gkh * - Added support for the old Belkin and Peracom devices. * - Made the port able to be opened multiple times. * - Added some defaults incase the line settings are things these devices @@ -59,22 +66,29 @@ #include #include #include +#include #include #include -#include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" #include "belkin_sa.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "William Greathouse " +#define DRIVER_DESC "USB Belkin Serial converter driver" + /* function prototypes for a Belkin USB Serial Adapter F5U103 */ static int belkin_sa_startup (struct usb_serial *serial); static void belkin_sa_shutdown (struct usb_serial *serial); @@ -158,6 +172,30 @@ shutdown: belkin_sa_shutdown, }; +/* the GoHubs Go-COM232 device is the same as the Peracom single port adapter */ +static __u16 gocom232_vendor_id = PERACOM_VID; +static __u16 gocom232_product_id = PERACOM_PID; +struct usb_serial_device_type gocom232_device = { + name: "GO-COM232 USB Serial Converter", + idVendor: &gocom232_vendor_id, /* the Go-COM232 vendor ID */ + idProduct: &gocom232_product_id, /* the Go-COM232 product id */ + needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ + needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ + needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 1, + open: belkin_sa_open, + close: belkin_sa_close, + read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ + ioctl: belkin_sa_ioctl, + set_termios: belkin_sa_set_termios, + break_ctl: belkin_sa_break_ctl, + startup: belkin_sa_startup, + shutdown: belkin_sa_shutdown, +}; + struct belkin_sa_private { unsigned long control_state; @@ -217,8 +255,8 @@ belkin_sa_close (&serial->port[i], NULL); } /* My special items, the standard routines free my urbs */ - if (serial->port->private) - kfree(serial->port->private); + if (serial->port[i].private) + kfree(serial->port[i].private); } } @@ -284,7 +322,6 @@ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct belkin_sa_private *priv = (struct belkin_sa_private *)port->private; struct usb_serial *serial; - struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; /* the urb might have been killed. */ @@ -360,7 +397,7 @@ unsigned int cflag = port->tty->termios->c_cflag; unsigned int old_iflag = old_termios->c_iflag; unsigned int old_cflag = old_termios->c_cflag; - __u16 urb_value; /* Will hold the new flags */ + __u16 urb_value = 0; /* Will hold the new flags */ /* Set the baud rate */ if( (cflag&CBAUD) != (old_cflag&CBAUD) ) { @@ -543,6 +580,8 @@ usb_serial_register (&belkin_sa_device); usb_serial_register (&belkin_old_device); usb_serial_register (&peracom_device); + usb_serial_register (&gocom232_device); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -552,10 +591,16 @@ usb_serial_deregister (&belkin_sa_device); usb_serial_deregister (&belkin_old_device); usb_serial_deregister (&peracom_device); + usb_serial_deregister (&gocom232_device); } module_init (belkin_sa_init); -module_exit(belkin_sa_exit); +module_exit (belkin_sa_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); -MODULE_DESCRIPTION("USB Belkin Serial converter driver"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/belkin_sa.h linux.20p9/drivers/usb/serial/belkin_sa.h --- linux.vanilla/drivers/usb/serial/belkin_sa.h Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/belkin_sa.h Wed Jul 4 16:03:58 2001 @@ -15,7 +15,10 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * - * (11/06/2000) gkh + * 12-Mar-2001 gkh + * Added GoHubs GO-COM232 device id. + * + * 06-Nov-2000 gkh * Added old Belkin and Peracom device ids, which this driver supports * * 12-Oct-2000 William Greathouse @@ -39,6 +42,9 @@ #define PERACOM_VID 0x0565 /* Peracom's vendor id */ #define PERACOM_PID 0x0001 /* Peracom's single port serial converter's id */ +#define GOHUBS_VID 0x0921 /* GoHubs vendor id */ +#define GOHUBS_PID 0x1000 /* GoHubs single port serial converter's id (identical to the Peracom device) */ + /* Vendor Request Interface */ #define BELKIN_SA_SET_BAUDRATE_REQUEST 0 /* Set baud rate */ #define BELKIN_SA_SET_STOP_BITS_REQUEST 1 /* Set stop bits (1,2) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/digi_acceleport.c linux.20p9/drivers/usb/serial/digi_acceleport.c --- linux.vanilla/drivers/usb/serial/digi_acceleport.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/digi_acceleport.c Wed Aug 8 22:24:15 2001 @@ -13,6 +13,9 @@ * * Peter Berger (pberger@brimson.com) * Al Borchers (borchers@steinerpoint.com) +* +* (04/08/2001) gb +* Identify version on module load. * * (11/01/2000) pberger and borchers * -- Turned off the USB_DISABLE_SPD flag for write bulk urbs--it caused @@ -232,25 +235,32 @@ #include #include #include +#include #include #include -#include #include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" /* Defines */ +/* + * Version Information + */ +#define DRIVER_VERSION "v1.80.1.2" +#define DRIVER_AUTHOR "Peter Berger , Al Borchers " +#define DRIVER_DESC "Digi AccelePort USB-2/USB-4 Serial Converter driver" + /* port output buffer length -- must be <= transfer buffer length - 2 */ /* so we can be sure to send the full buffer in one urb */ #define DIGI_OUT_BUF_SIZE 8 @@ -585,7 +595,7 @@ spin_lock_irqsave( &priv->dp_port_lock, flags ); digi_wakeup_write( port ); spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - + MOD_DEC_USE_COUNT; } static void digi_wakeup_write( struct usb_serial_port *port ) @@ -1266,12 +1276,10 @@ || priv->dp_write_urb_in_use ) { /* buffer data if count is 1 (probably put_char) if possible */ - if( count == 1 ) { - new_len = MIN( count, - DIGI_OUT_BUF_SIZE-priv->dp_out_buf_len ); - memcpy( priv->dp_out_buf+priv->dp_out_buf_len, buf, - new_len ); - priv->dp_out_buf_len += new_len; + if( count == 1 && priv->dp_out_buf_len < DIGI_OUT_BUF_SIZE ) { + priv->dp_out_buf[priv->dp_out_buf_len++] + = *(from_user ? user_buf : buf); + new_len = 1; } else { new_len = 0; } @@ -1393,7 +1401,9 @@ /* also queue up a wakeup at scheduler time, in case we */ /* lost the race in write_chan(). */ - queue_task( &priv->dp_wakeup_task, &tq_scheduler ); + MOD_INC_USE_COUNT; + if (schedule_task(&priv->dp_wakeup_task) == 0) + MOD_DEC_USE_COUNT; spin_unlock( &priv->dp_port_lock ); @@ -2052,6 +2062,7 @@ { usb_serial_register (&digi_acceleport_2_device); usb_serial_register (&digi_acceleport_4_device); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -2067,6 +2078,9 @@ module_exit(digi_exit); -MODULE_AUTHOR("Peter Berger , Al Borchers "); -MODULE_DESCRIPTION("Digi AccelePort USB-2/USB-4 Serial Converter driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/empeg.c linux.20p9/drivers/usb/serial/empeg.c --- linux.vanilla/drivers/usb/serial/empeg.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/empeg.c Wed Aug 8 22:23:55 2001 @@ -13,6 +13,13 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * + * (07/29/2001) gb + * remove unused code in empeg_close() (thanks to Oliver Neukum for pointing this + * out) and rewrote empeg_set_termios(). + * + * (04/08/2001) gb + * Identify version on module load. + * * (01/22/2001) gb * Added write_room() and chars_in_buffer() support. * @@ -55,15 +62,23 @@ #include #include #include +#include + #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.1" +#define DRIVER_AUTHOR "Greg Kroah-Hartman , Gary Brubaker " +#define DRIVER_DESC "USB Empeg Mark I/II Driver" + #define EMPEG_VENDOR_ID 0x084f #define EMPEG_PRODUCT_ID 0x0001 @@ -147,55 +162,8 @@ if (!port->active) { - /* gb - 2000/11/05 - * personally, I think these termios should be set in - * empeg_startup(), but it appears doing so leads to one - * of those chicken/egg problems. :) - */ - port->tty->termios->c_iflag - &= ~(IGNBRK - | BRKINT - | PARMRK - | ISTRIP - | INLCR - | IGNCR - | ICRNL - | IXON); - - port->tty->termios->c_oflag - &= ~OPOST; - - port->tty->termios->c_lflag - &= ~(ECHO - | ECHONL - | ICANON - | ISIG - | IEXTEN); - - port->tty->termios->c_cflag - &= ~(CSIZE - | PARENB); - - port->tty->termios->c_cflag - |= CS8; - - /* gb - 2000/12/03 - * Contributed by Borislav Deianov - * Notify the tty driver that the termios have changed!! - */ - port->tty->ldisc.set_termios(port->tty, NULL); - - /* gb - 2000/11/05 - * force low_latency on - * - * The tty_flip_buffer_push()'s in empeg_read_bulk_callback() will actually - * force the data through if low_latency is set. Otherwise the pushes are - * scheduled; this is bad as it opens up the possibility of dropping bytes - * on the floor. We are trying to sustain high data transfer rates; and - * don't want to drop bytes on the floor. - * Moral: use low_latency - drop no bytes - life is good. :) - */ - port->tty->low_latency = 1; + /* Force default termio settings */ + empeg_set_termios (port, NULL) ; port->active = 1; bytes_in = 0; @@ -230,7 +198,6 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp) { struct usb_serial *serial; - unsigned char *transfer_buffer; unsigned long flags; if (port_paranoia_check (port, __FUNCTION__)) @@ -247,14 +214,6 @@ --port->open_count; if (port->open_count <= 0) { - transfer_buffer = kmalloc (0x12, GFP_KERNEL); - - if (!transfer_buffer) { - err(__FUNCTION__ " - kmalloc(%d) failed.", 0x12); - } else { - kfree (transfer_buffer); - } - /* shutdown our bulk read */ usb_unlink_urb (port->read_urb); port->active = 0; @@ -575,65 +534,63 @@ } -/* This function is all nice and good, but we don't change anything based on it :) */ static void empeg_set_termios (struct usb_serial_port *port, struct termios *old_termios) { - unsigned int cflag = port->tty->termios->c_cflag; dbg(__FUNCTION__ " - port %d", port->number); - /* check that they really want us to change something */ - if (old_termios) { - if ((cflag == old_termios->c_cflag) && - (RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { - dbg(__FUNCTION__ " - nothing to change..."); - return; - } - } - if ((!port->tty) || (!port->tty->termios)) { dbg(__FUNCTION__" - no tty structures"); return; } - /* get the byte size */ - switch (cflag & CSIZE) { - case CS5: dbg(__FUNCTION__ " - data bits = 5"); break; - case CS6: dbg(__FUNCTION__ " - data bits = 6"); break; - case CS7: dbg(__FUNCTION__ " - data bits = 7"); break; - default: - case CS8: dbg(__FUNCTION__ " - data bits = 8"); break; - } - - /* determine the parity */ - if (cflag & PARENB) - if (cflag & PARODD) - dbg(__FUNCTION__ " - parity = odd"); - else - dbg(__FUNCTION__ " - parity = even"); - else - dbg(__FUNCTION__ " - parity = none"); - - /* figure out the stop bits requested */ - if (cflag & CSTOPB) - dbg(__FUNCTION__ " - stop bits = 2"); - else - dbg(__FUNCTION__ " - stop bits = 1"); - - /* figure out the flow control settings */ - if (cflag & CRTSCTS) - dbg(__FUNCTION__ " - RTS/CTS is enabled"); - else - dbg(__FUNCTION__ " - RTS/CTS is disabled"); - - /* determine software flow control */ - if (I_IXOFF(port->tty)) - dbg(__FUNCTION__ " - XON/XOFF is enabled, XON = %2x, XOFF = %2x", START_CHAR(port->tty), STOP_CHAR(port->tty)); - else - dbg(__FUNCTION__ " - XON/XOFF is disabled"); + /* + * The empeg-car player wants these particular tty settings. + * You could, for example, change the baud rate, however the + * player only supports 115200 (currently), so there is really + * no point in support for changes to the tty settings. + * (at least for now) + * + * The default requirements for this device are: + */ + port->tty->termios->c_iflag + &= ~(IGNBRK /* disable ignore break */ + | BRKINT /* disable break causes interrupt */ + | PARMRK /* disable mark parity errors */ + | ISTRIP /* disable clear high bit of input characters */ + | INLCR /* disable translate NL to CR */ + | IGNCR /* disable ignore CR */ + | ICRNL /* disable translate CR to NL */ + | IXON); /* disable enable XON/XOFF flow control */ + + port->tty->termios->c_oflag + &= ~OPOST; /* disable postprocess output characters */ + + port->tty->termios->c_lflag + &= ~(ECHO /* disable echo input characters */ + | ECHONL /* disable echo new line */ + | ICANON /* disable erase, kill, werase, and rprnt special characters */ + | ISIG /* disable interrupt, quit, and suspend special characters */ + | IEXTEN); /* disable non-POSIX special characters */ + + port->tty->termios->c_cflag + &= ~(CSIZE /* no size */ + | PARENB /* disable parity bit */ + | CBAUD); /* clear current baud rate */ + + port->tty->termios->c_cflag + |= (CS8 /* character size 8 bits */ + | B115200); /* baud rate 115200 */ + + /* + * Force low_latency on; otherwise the pushes are scheduled; + * this is bad as it opens up the possibility of dropping bytes + * on the floor. We don't want to drop bytes on the floor. :) + */ + port->tty->low_latency = 1; - /* get the baud rate wanted */ - dbg(__FUNCTION__ " - baud rate = %d", tty_get_baud_rate(port->tty)); + /* Notify the tty driver that the termios have changed. */ + port->tty->ldisc.set_termios(port->tty, NULL); return; @@ -665,6 +622,8 @@ } } + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -699,5 +658,9 @@ module_init(empeg_init); module_exit(empeg_exit); -MODULE_AUTHOR("Gary Brubaker "); -MODULE_DESCRIPTION("USB Empeg Mark I/II Driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/ftdi_sio.c linux.20p9/drivers/usb/serial/ftdi_sio.c --- linux.vanilla/drivers/usb/serial/ftdi_sio.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/ftdi_sio.c Wed Aug 8 22:24:15 2001 @@ -14,7 +14,22 @@ * * See http://reality.sgi.com/bryder_wellington/ftdi_sio for upto date testing info * and extra documentation + * + * (23/May/2001) Bill Ryder + * Added runtime debug patch (thanx Tyson D Sawyer). + * Cleaned up comments for 8U232 + * Added parity, framing and overrun error handling + * Added receive break handling. + * + * (04/08/2001) gb + * Identify version on module load. * + * (18/March/2001) Bill Ryder + * (Not released) + * Added send break handling. (requires kernel patch too) + * Fixed 8U232AM hardware RTS/CTS etc status reporting. + * Added flipbuf fix copied from generic device + * * (12/3/2000) Bill Ryder * Added support for 8U232AM device. * Moved PID and VIDs into header file only. @@ -70,31 +85,35 @@ #include #include #include +#include #include #include -#include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" - #include "ftdi_sio.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.1.0" +#define DRIVER_AUTHOR "Greg Kroah-Hartman , Bill Ryder " +#define DRIVER_DESC "USB FTDI RS232 Converters Driver" + struct ftdi_private { ftdi_type_t ftdi_type; - char last_status_byte; /* device sends this every 40ms when open */ - - + __u16 last_set_data_urb_value ; /* the last data state set - needed for doing a break */ }; /* function prototypes for a FTDI serial converter */ static int ftdi_sio_startup (struct usb_serial *serial); @@ -107,6 +126,10 @@ static void ftdi_sio_read_bulk_callback (struct urb *urb); static void ftdi_sio_set_termios (struct usb_serial_port *port, struct termios * old); static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); +static void ftdi_sio_break_ctl (struct usb_serial_port *port, int break_state ); + +/* Should rename most ftdi_sio's to ftdi_ now since there are two devices + which share common code */ /* All of the device info needed for the FTDI SIO serial converter */ static __u16 ftdi_vendor_id = FTDI_VID; @@ -130,6 +153,7 @@ write_bulk_callback: ftdi_sio_write_bulk_callback, ioctl: ftdi_sio_ioctl, set_termios: ftdi_sio_set_termios, + break_ctl: ftdi_sio_break_ctl, startup: ftdi_sio_startup, shutdown: ftdi_sio_shutdown, }; @@ -152,6 +176,7 @@ write_bulk_callback: ftdi_sio_write_bulk_callback, ioctl: ftdi_sio_ioctl, set_termios: ftdi_sio_set_termios, + break_ctl: ftdi_sio_break_ctl, startup: ftdi_8U232AM_startup, shutdown: ftdi_sio_shutdown, }; @@ -269,7 +294,8 @@ spin_unlock_irqrestore (&port->port_lock, flags); - /* do not allow a task to be queued to deliver received data */ + /* This will push the characters through immediately rather + than queue a task to deliver them */ port->tty->low_latency = 1; /* No error checking for this (will get errors later anyway) */ @@ -498,9 +524,9 @@ static void ftdi_sio_read_bulk_callback (struct urb *urb) { /* ftdi_sio_serial_buld_callback */ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; - struct ftdi_private *priv = (struct ftdi_private *)port->private; struct usb_serial *serial; struct tty_struct *tty = port->tty ; + char error_flag; unsigned char *data = urb->transfer_buffer; const int data_offset = 2; @@ -527,23 +553,76 @@ if (urb->actual_length > 2) { usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); } else { - dbg("Just status"); + dbg("Just status 0o%03o0o%03o",data[0],data[1]); } - priv->last_status_byte = data[0]; /* this has modem control lines */ /* TO DO -- check for hung up line and handle appropriately: */ /* send hangup */ /* See acm.c - you do a tty_hangup - eg tty_hangup(tty) */ /* if CD is dropped and the line is not CLOCAL then we should hangup */ - + /* Handle errors and break */ + error_flag = TTY_NORMAL; + /* Although the device uses a bitmask and hence can have multiple */ + /* errors on a packet - the order here sets the priority the */ + /* error is returned to the tty layer */ + + if ( data[1] & FTDI_RS_OE ) { + error_flag = TTY_OVERRUN; + dbg("OVERRRUN error"); + } + if ( data[1] & FTDI_RS_BI ) { + error_flag = TTY_BREAK; + dbg("BREAK received"); + } + if ( data[1] & FTDI_RS_PE ) { + error_flag = TTY_PARITY; + dbg("PARITY error"); + } + if ( data[1] & FTDI_RS_FE ) { + error_flag = TTY_FRAME; + dbg("FRAMING error"); + } if (urb->actual_length > data_offset) { + for (i = data_offset ; i < urb->actual_length ; ++i) { - tty_insert_flip_char(tty, data[i], 0); - } + /* have to make sure we don't overflow the buffer + with tty_insert_flip_char's */ + if(tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty_flip_buffer_push(tty); + } + /* Note that the error flag is duplicated for + every character received since we don't know + which character it applied to */ + tty_insert_flip_char(tty, data[i], error_flag); + } tty_flip_buffer_push(tty); + + + } + +#ifdef NOT_CORRECT_BUT_KEEPING_IT_FOR_NOW + /* if a parity error is detected you get status packets forever + until a character is sent without a parity error. + This doesn't work well since the application receives a never + ending stream of bad data - even though new data hasn't been sent. + Therefore I (bill) have taken this out. + However - this might make sense for framing errors and so on + so I am leaving the code in for now. + */ + else { + if (error_flag != TTY_NORMAL){ + dbg("error_flag is not normal"); + /* In this case it is just status - if that is an error send a bad character */ + if(tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty_flip_buffer_push(tty); + } + tty_insert_flip_char(tty, 0xff, error_flag); + tty_flip_buffer_push(tty); + } } +#endif /* Continue trying to always read */ FILL_BULK_URB(urb, serial->dev, @@ -605,6 +684,38 @@ return(urb_value); } +static void ftdi_sio_break_ctl( struct usb_serial_port *port, int break_state ) +{ + struct usb_serial *serial = port->serial; + struct ftdi_private *priv = (struct ftdi_private *)port->private; + __u16 urb_value = 0; + char buf[1]; + + /* break_state = -1 to turn on break, and 0 to turn off break */ + /* see drivers/char/tty_io.c to see it used */ + /* last_set_data_urb_value NEVER has the break bit set in it */ + + if (break_state) { + urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK; + } else { + urb_value = priv->last_set_data_urb_value; + } + + + if (usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + FTDI_SIO_SET_DATA_REQUEST, + FTDI_SIO_SET_DATA_REQUEST_TYPE, + urb_value , 0, + buf, 0, WDR_TIMEOUT) < 0) { + err(__FUNCTION__ " FAILED to enable/disable break state (state was %d)",break_state); + } + + dbg(__FUNCTION__ " break state is %d - urb is %d",break_state, urb_value); + +} + + + /* As I understand this - old_termios contains the original termios settings */ /* and tty->termios contains the new setting to be used */ /* */ @@ -648,6 +759,11 @@ err("CSIZE was set but not CS5-CS8"); } } + + /* This is needed by the break command since it uses the same command - but is + * or'ed with this value */ + priv->last_set_data_urb_value = urb_value; + if (usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), FTDI_SIO_SET_DATA_REQUEST, FTDI_SIO_SET_DATA_REQUEST_TYPE, @@ -721,7 +837,7 @@ struct usb_serial *serial = port->serial; struct ftdi_private *priv = (struct ftdi_private *)port->private; __u16 urb_value=0; /* Will hold the new flags */ - char buf[1]; + char buf[2]; int ret, mask; dbg(__FUNCTION__ " cmd 0x%04x", cmd); @@ -731,12 +847,7 @@ case TIOCMGET: dbg(__FUNCTION__ " TIOCMGET"); - /* The MODEM_STATUS_REQUEST works for the sio but not the 232 */ if (priv->ftdi_type == sio){ - /* TO DECIDE - use the 40ms status packets or not? */ - /* PRO: No need to send urb */ - /* CON: Could be 40ms out of date */ - /* Request the status from the device */ if ((ret = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), @@ -749,8 +860,18 @@ return(ret); } } else { - /* This gets updated every 40ms - so just copy it in */ - buf[0] = priv->last_status_byte; + /* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same + format as the data returned from the in point */ + if ((ret = usb_control_msg(serial->dev, + usb_rcvctrlpipe(serial->dev, 0), + FTDI_SIO_GET_MODEM_STATUS_REQUEST, + FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, + 0, 0, + buf, 2, WDR_TIMEOUT)) < 0 ) { + err(__FUNCTION__ " Could not get modem status of device - err: %d", + ret); + return(ret); + } } return put_user((buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | @@ -841,6 +962,7 @@ dbg(__FUNCTION__); usb_serial_register (&ftdi_sio_device); usb_serial_register (&ftdi_8U232AM_device); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -856,5 +978,9 @@ module_init(ftdi_sio_init); module_exit(ftdi_sio_exit); -MODULE_AUTHOR("Greg Kroah-Hartman , Bill Ryder "); -MODULE_DESCRIPTION("USB FTDI RS232 converters driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/ftdi_sio.h linux.20p9/drivers/usb/serial/ftdi_sio.h --- linux.vanilla/drivers/usb/serial/ftdi_sio.h Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/ftdi_sio.h Wed Jul 4 16:03:58 2001 @@ -146,7 +146,7 @@ #define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11 ) #define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11 ) #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11 ) - +#define FTDI_SIO_SET_BREAK (0x1 << 14) /* FTDI_SIO_SET_DATA */ /* @@ -170,7 +170,10 @@ * 0 = 1 * 1 = 1.5 * 2 = 2 - * B14..15 Reserved + * B14 + * 1 = TX ON (break) + * 0 = TX OFF (normal state) + * B15 Reserved * */ @@ -434,6 +437,17 @@ * B6 Transmitter Empty (TEMT) * B7 Error in RCVR FIFO * + */ +#define FTDI_RS_DR 1 +#define FTDI_RS_OE (1<<1) +#define FTDI_RS_PE (1<<2) +#define FTDI_RS_FE (1<<3) +#define FTDI_RS_BI (1<<4) +#define FTDI_RS_THRE (1<<5) +#define FTDI_RS_TEMT (1<<6) +#define FTDI_RS_FIFO (1<<7) + +/* * OUT Endpoint * * This device reserves the first bytes of data on this endpoint contain the length diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_16654.h linux.20p9/drivers/usb/serial/io_16654.h --- linux.vanilla/drivers/usb/serial/io_16654.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_16654.h Wed Jul 4 16:03:58 2001 @@ -0,0 +1,195 @@ +/************************************************************************ + * + * 16654.H Definitions for 16C654 UART used on EdgePorts + * + * Copyright (c) 1998 Inside Out Networks, Inc. + * 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. + * + ************************************************************************/ + +#if !defined(_16654_H) +#define _16654_H + +/************************************************************************ + * + * D e f i n e s / T y p e d e f s + * + ************************************************************************/ + + // + // UART register numbers + // Numbers 0-7 are passed to the Edgeport directly. Numbers 8 and + // above are used internally to indicate that we must enable access + // to them via LCR bit 0x80 or LCR = 0xBF. + // The register number sent to the Edgeport is then (x & 0x7). + // + // Driver must not access registers that affect operation of the + // the EdgePort firmware -- that includes THR, RHR, IER, FCR. + + +#define THR 0 // ! Transmit Holding Register (Write) +#define RDR 0 // ! Receive Holding Register (Read) +#define IER 1 // ! Interrupt Enable Register +#define FCR 2 // ! Fifo Control Register (Write) +#define ISR 2 // Interrupt Status Register (Read) +#define LCR 3 // Line Control Register +#define MCR 4 // Modem Control Register +#define LSR 5 // Line Status Register +#define MSR 6 // Modem Status Register +#define SPR 7 // ScratchPad Register +#define DLL 8 // Bank2[ 0 ] Divisor Latch LSB +#define DLM 9 // Bank2[ 1 ] Divisor Latch MSB +#define EFR 10 // Bank2[ 2 ] Extended Function Register +//efine unused 11 // Bank2[ 3 ] +#define XON1 12 // Bank2[ 4 ] Xon-1 +#define XON2 13 // Bank2[ 5 ] Xon-2 +#define XOFF1 14 // Bank2[ 6 ] Xoff-1 +#define XOFF2 15 // Bank2[ 7 ] Xoff-2 + +#define NUM_16654_REGS 16 + +#define IS_REG_2ND_BANK(x) ((x) >= 8) + + // + // Bit definitions for each register + // + +#define IER_RX 0x01 // Enable receive interrupt +#define IER_TX 0x02 // Enable transmit interrupt +#define IER_RXS 0x04 // Enable receive status interrupt +#define IER_MDM 0x08 // Enable modem status interrupt +#define IER_SLEEP 0x10 // Enable sleep mode +#define IER_XOFF 0x20 // Enable s/w flow control (XOFF) interrupt +#define IER_RTS 0x40 // Enable RTS interrupt +#define IER_CTS 0x80 // Enable CTS interrupt +#define IER_ENABLE_ALL 0xFF // Enable all ints + + +#define FCR_FIFO_EN 0x01 // Enable FIFOs +#define FCR_RXCLR 0x02 // Reset Rx FIFO +#define FCR_TXCLR 0x04 // Reset Tx FIFO +#define FCR_DMA_BLK 0x08 // Enable DMA block mode +#define FCR_TX_LEVEL_MASK 0x30 // Mask for Tx FIFO Level +#define FCR_TX_LEVEL_8 0x00 // Tx FIFO Level = 8 bytes +#define FCR_TX_LEVEL_16 0x10 // Tx FIFO Level = 16 bytes +#define FCR_TX_LEVEL_32 0x20 // Tx FIFO Level = 32 bytes +#define FCR_TX_LEVEL_56 0x30 // Tx FIFO Level = 56 bytes +#define FCR_RX_LEVEL_MASK 0xC0 // Mask for Rx FIFO Level +#define FCR_RX_LEVEL_8 0x00 // Rx FIFO Level = 8 bytes +#define FCR_RX_LEVEL_16 0x40 // Rx FIFO Level = 16 bytes +#define FCR_RX_LEVEL_56 0x80 // Rx FIFO Level = 56 bytes +#define FCR_RX_LEVEL_60 0xC0 // Rx FIFO Level = 60 bytes + + +#define ISR_INT_MDM_STATUS 0x00 // Modem status int pending +#define ISR_INT_NONE 0x01 // No interrupt pending +#define ISR_INT_TXRDY 0x02 // Tx ready int pending +#define ISR_INT_RXRDY 0x04 // Rx ready int pending +#define ISR_INT_LINE_STATUS 0x06 // Line status int pending +#define ISR_INT_RX_TIMEOUT 0x0C // Rx timeout int pending +#define ISR_INT_RX_XOFF 0x10 // Rx Xoff int pending +#define ISR_INT_RTS_CTS 0x20 // RTS/CTS change int pending +#define ISR_FIFO_ENABLED 0xC0 // Bits set if FIFOs enabled +#define ISR_INT_BITS_MASK 0x3E // Mask to isolate valid int causes + + +#define LCR_BITS_5 0x00 // 5 bits/char +#define LCR_BITS_6 0x01 // 6 bits/char +#define LCR_BITS_7 0x02 // 7 bits/char +#define LCR_BITS_8 0x03 // 8 bits/char +#define LCR_BITS_MASK 0x03 // Mask for bits/char field + +#define LCR_STOP_1 0x00 // 1 stop bit +#define LCR_STOP_1_5 0x04 // 1.5 stop bits (if 5 bits/char) +#define LCR_STOP_2 0x04 // 2 stop bits (if 6-8 bits/char) +#define LCR_STOP_MASK 0x04 // Mask for stop bits field + +#define LCR_PAR_NONE 0x00 // No parity +#define LCR_PAR_ODD 0x08 // Odd parity +#define LCR_PAR_EVEN 0x18 // Even parity +#define LCR_PAR_MARK 0x28 // Force parity bit to 1 +#define LCR_PAR_SPACE 0x38 // Force parity bit to 0 +#define LCR_PAR_MASK 0x38 // Mask for parity field + +#define LCR_SET_BREAK 0x40 // Set Break condition +#define LCR_DL_ENABLE 0x80 // Enable access to divisor latch + +#define LCR_ACCESS_EFR 0xBF // Load this value to access DLL,DLM, + // and also the '654-only registers + // EFR, XON1, XON2, XOFF1, XOFF2 + + +#define MCR_DTR 0x01 // Assert DTR +#define MCR_RTS 0x02 // Assert RTS +#define MCR_OUT1 0x04 // Loopback only: Sets state of RI +#define MCR_MASTER_IE 0x08 // Enable interrupt outputs +#define MCR_LOOPBACK 0x10 // Set internal (digital) loopback mode +#define MCR_XON_ANY 0x20 // Enable any char to exit XOFF mode +#define MCR_IR_ENABLE 0x40 // Enable IrDA functions +#define MCR_BRG_DIV_4 0x80 // Divide baud rate clk by /4 instead of /1 + + +#define LSR_RX_AVAIL 0x01 // Rx data available +#define LSR_OVER_ERR 0x02 // Rx overrun +#define LSR_PAR_ERR 0x04 // Rx parity error +#define LSR_FRM_ERR 0x08 // Rx framing error +#define LSR_BREAK 0x10 // Rx break condition detected +#define LSR_TX_EMPTY 0x20 // Tx Fifo empty +#define LSR_TX_ALL_EMPTY 0x40 // Tx Fifo and shift register empty +#define LSR_FIFO_ERR 0x80 // Rx Fifo contains at least 1 erred char + + +#define MSR_DELTA_CTS 0x01 // CTS changed from last read +#define MSR_DELTA_DSR 0x02 // DSR changed from last read +#define MSR_DELTA_RI 0x04 // RI changed from 0 -> 1 +#define MSR_DELTA_CD 0x08 // CD changed from last read +#define MSR_CTS 0x10 // Current state of CTS +#define MSR_DSR 0x20 // Current state of DSR +#define MSR_RI 0x40 // Current state of RI +#define MSR_CD 0x80 // Current state of CD + + + + // Tx Rx + //------------------------------- +#define EFR_SWFC_NONE 0x00 // None None +#define EFR_SWFC_RX1 0x02 // None XOFF1 +#define EFR_SWFC_RX2 0x01 // None XOFF2 +#define EFR_SWFC_RX12 0x03 // None XOFF1 & XOFF2 +#define EFR_SWFC_TX1 0x08 // XOFF1 None +#define EFR_SWFC_TX1_RX1 0x0a // XOFF1 XOFF1 +#define EFR_SWFC_TX1_RX2 0x09 // XOFF1 XOFF2 +#define EFR_SWFC_TX1_RX12 0x0b // XOFF1 XOFF1 & XOFF2 +#define EFR_SWFC_TX2 0x04 // XOFF2 None +#define EFR_SWFC_TX2_RX1 0x06 // XOFF2 XOFF1 +#define EFR_SWFC_TX2_RX2 0x05 // XOFF2 XOFF2 +#define EFR_SWFC_TX2_RX12 0x07 // XOFF2 XOFF1 & XOFF2 +#define EFR_SWFC_TX12 0x0c // XOFF1 & XOFF2 None +#define EFR_SWFC_TX12_RX1 0x0e // XOFF1 & XOFF2 XOFF1 +#define EFR_SWFC_TX12_RX2 0x0d // XOFF1 & XOFF2 XOFF2 +#define EFR_SWFC_TX12_RX12 0x0f // XOFF1 & XOFF2 XOFF1 & XOFF2 + +#define EFR_TX_FC_MASK 0x0c // Mask to isolate Rx flow control +#define EFR_TX_FC_NONE 0x00 // No Tx Xon/Xoff flow control +#define EFR_TX_FC_X1 0x08 // Transmit Xon1/Xoff1 +#define EFR_TX_FC_X2 0x04 // Transmit Xon2/Xoff2 +#define EFR_TX_FC_X1_2 0x0c // Transmit Xon1&2/Xoff1&2 + +#define EFR_RX_FC_MASK 0x03 // Mask to isolate Rx flow control +#define EFR_RX_FC_NONE 0x00 // No Rx Xon/Xoff flow control +#define EFR_RX_FC_X1 0x02 // Receiver compares Xon1/Xoff1 +#define EFR_RX_FC_X2 0x01 // Receiver compares Xon2/Xoff2 +#define EFR_RX_FC_X1_2 0x03 // Receiver compares Xon1&2/Xoff1&2 + + +#define EFR_SWFC_MASK 0x0F // Mask for software flow control field +#define EFR_ENABLE_16654 0x10 // Enable 16C654 features +#define EFR_SPEC_DETECT 0x20 // Enable special character detect interrupt +#define EFR_AUTO_RTS 0x40 // Use RTS for Rx flow control +#define EFR_AUTO_CTS 0x80 // Use CTS for Tx flow control + +#endif // if !defined(_16654_H) + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_edgeport.c linux.20p9/drivers/usb/serial/io_edgeport.c --- linux.vanilla/drivers/usb/serial/io_edgeport.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_edgeport.c Wed Aug 8 22:24:15 2001 @@ -0,0 +1,3079 @@ +/* + * Edgeport USB Serial Converter driver + * + * Copyright(c) 2000 Inside Out Networks, All rights reserved. + * Copyright(c) 2001 Greg Kroah-Hartman + * + * 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. + * + * Supports the following devices: + * Edgeport/4 + * Edgeport/4t + * Edgeport/2 + * Edgeport/4i + * Edgeport/2i + * Edgeport/421 + * Edgeport/21 + * Rapidport/4 + * Edgeport/8 + * Edgeport/2D8 + * Edgeport/4D8 + * Edgeport/8i + * + * Version history: + * + * (04/08/2001) gb + * - Identify version on module load. + * + * 2.0 2001_03_05 greg kroah-hartman + * - reworked entire driver to fit properly in with the other usb-serial + * drivers. Occasional oopses still happen, but it's a good start. + * + * 1.2.3 (02/23/2001) greg kroah-hartman + * - changed device table to work properly for 2.4.x final format. + * - fixed problem with dropping data at high data rates. + * + * 1.2.2 (11/27/2000) greg kroah-hartman + * - cleaned up more NTisms. + * - Added device table for 2.4.0-test11 + * + * 1.2.1 (11/08/2000) greg kroah-hartman + * - Started to clean up NTisms. + * - Fixed problem with dev field of urb for kernels >= 2.4.0-test9 + * + * 1.2 (10/17/2000) David Iacovelli + * Remove all EPIC code and GPL source + * Fix RELEVANT_IFLAG macro to include flow control + * changes port configuration changes. + * Fix redefinition of SERIAL_MAGIC + * Change all timeout values to 5 seconds + * Tried to fix the UHCI multiple urb submission, but failed miserably. + * it seems to work fine with OHCI. + * ( Greg take a look at the #if 0 at end of WriteCmdUsb() we must + * find a way to work arount this UHCI bug ) + * + * 1.1 (10/11/2000) David Iacovelli + * Fix XON/XOFF flow control to support both IXON and IXOFF + * + * 0.9.27 (06/30/2000) David Iacovelli + * Added transmit queue and now allocate urb for command writes. + * + * 0.9.26 (06/29/2000) David Iacovelli + * Add support for 80251 based edgeport + * + * 0.9.25 (06/27/2000) David Iacovelli + * Do not close the port if it has multiple opens. + * + * 0.9.24 (05/26/2000) David Iacovelli + * Add IOCTLs to support RXTX and JAVA POS + * and first cut at running BlackBox Demo + * + * 0.9.23 (05/24/2000) David Iacovelli + * Add IOCTLs to support RXTX and JAVA POS + * + * 0.9.22 (05/23/2000) David Iacovelli + * fixed bug in enumeration. If epconfig turns on mapping by + * path after a device is already plugged in, we now update + * the mapping correctly + * + * 0.9.21 (05/16/2000) David Iacovelli + * Added BlockUntilChaseResp() to also wait for txcredits + * Updated the way we allocate and handle write URBs + * Add debug code to dump buffers + * + * 0.9.20 (05/01/2000) David Iacovelli + * change driver to use usb/tts/ + * + * 0.9.19 (05/01/2000) David Iacovelli + * Update code to compile if DEBUG is off + * + * 0.9.18 (04/28/2000) David Iacovelli + * cleanup and test tty_register with devfs + * + * 0.9.17 (04/27/2000) greg kroah-hartman + * changed tty_register around to be like the way it + * was before, but now it works properly with devfs. + * + * 0.9.16 (04/26/2000) david iacovelli + * Fixed bug in GetProductInfo() + * + * 0.9.15 (04/25/2000) david iacovelli + * Updated enumeration + * + * 0.9.14 (04/24/2000) david iacovelli + * Removed all config/status IOCTLS and + * converted to using /proc/edgeport + * still playing with devfs + * + * 0.9.13 (04/24/2000) david iacovelli + * Removed configuration based on ttyUSB0 + * Added support for configuration using /prod/edgeport + * first attempt at using devfs (not working yet!) + * Added IOCTL to GetProductInfo() + * Added support for custom baud rates + * Add support for random port numbers + * + * 0.9.12 (04/18/2000) david iacovelli + * added additional configuration IOCTLs + * use ttyUSB0 for configuration + * + * 0.9.11 (04/17/2000) greg kroah-hartman + * fixed module initialization race conditions. + * made all urbs dynamically allocated. + * made driver devfs compatible. now it only registers the tty device + * when the device is actually plugged in. + * + * 0.9.10 (04/13/2000) greg kroah-hartman + * added proc interface framework. + * + * 0.9.9 (04/13/2000) david iacovelli + * added enumeration code and ioctls to configure the device + * + * 0.9.8 (04/12/2000) david iacovelli + * Change interrupt read start when device is plugged in + * and stop when device is removed + * process interrupt reads when all ports are closed + * (keep value of rxBytesAvail consistent with the edgeport) + * set the USB_BULK_QUEUE flag so that we can shove a bunch + * of urbs at once down the pipe + * + * 0.9.7 (04/10/2000) david iacovelli + * start to add enumeration code. + * generate serial number for epic devices + * add support for kdb + * + * 0.9.6 (03/30/2000) david iacovelli + * add IOCTL to get string, manufacture, and boot descriptors + * + * 0.9.5 (03/14/2000) greg kroah-hartman + * more error checking added to SerialOpen to try to fix UHCI open problem + * + * 0.9.4 (03/09/2000) greg kroah-hartman + * added more error checking to handle oops when data is hanging + * around and tty is abruptly closed. + * + * 0.9.3 (03/09/2000) david iacovelli + * Add epic support for xon/xoff chars + * play with performance + * + * 0.9.2 (03/08/2000) greg kroah-hartman + * changed most "info" calls to "dbg" + * implemented flow control properly in the termios call + * + * 0.9.1 (03/08/2000) david iacovelli + * added EPIC support + * enabled bootloader update + * + * 0.9 (03/08/2000) greg kroah-hartman + * Release to IO networks. + * Integrated changes that David made + * made getting urbs for writing SMP safe + * + * 0.8 (03/07/2000) greg kroah-hartman + * Release to IO networks. + * Fixed problems that were seen in code by David. + * Now both Edgeport/4 and Edgeport/2 works properly. + * Changed most of the functions to use port instead of serial. + * + * 0.7 (02/27/2000) greg kroah-hartman + * Milestone 3 release. + * Release to IO Networks + * ioctl for waiting on line change implemented. + * ioctl for getting statistics implemented. + * multiport support working. + * lsr and msr registers are now handled properly. + * change break now hooked up and working. + * support for all known Edgeport devices. + * + * 0.6 (02/22/2000) greg kroah-hartman + * Release to IO networks. + * CHASE is implemented correctly when port is closed. + * SerialOpen now blocks correctly until port is fully opened. + * + * 0.5 (02/20/2000) greg kroah-hartman + * Release to IO networks. + * Known problems: + * modem status register changes are not sent on to the user + * CHASE is not implemented when the port is closed. + * + * 0.4 (02/16/2000) greg kroah-hartman + * Second cut at the CeBit demo. + * Doesn't leak memory on every write to the port + * Still small leaks on startup. + * Added support for Edgeport/2 and Edgeport/8 + * + * 0.3 (02/15/2000) greg kroah-hartman + * CeBit demo release. + * Force the line settings to 4800, 8, 1, e for the demo. + * Warning! This version leaks memory like crazy! + * + * 0.2 (01/30/2000) greg kroah-hartman + * Milestone 1 release. + * Device is found by USB subsystem, enumerated, fimware is downloaded + * and the descriptors are printed to the debug log, config is set, and + * green light starts to blink. Open port works, and data can be sent + * and received at the default settings of the UART. Loopback connector + * and debug log confirms this. + * + * 0.1 (01/23/2000) greg kroah-hartman + * Initial release to help IO Networks try to set up their test system. + * Edgeport4 is recognized, firmware is downloaded, config is set so + * device blinks green light every 3 sec. Port is bound, but opening, + * closing, and sending data do not work properly. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_USB_SERIAL_DEBUG + static int debug = 1; +#else + static int debug; +#endif + +#include "usb-serial.h" + +#include "io_edgeport.h" +#include "io_ionsp.h" /* info for the iosp messages */ +#include "io_16654.h" /* 16654 UART defines */ + +/* + * Version Information + */ +#define DRIVER_VERSION "v2.0.0" +#define DRIVER_AUTHOR "Greg Kroah-Hartman and David Iacovelli" +#define DRIVER_DESC "Edgeport USB Serial Driver" + +/* First, the latest boot code - for first generation edgeports */ +#define IMAGE_ARRAY_NAME BootCodeImage_GEN1 +#define IMAGE_VERSION_NAME BootCodeImageVersion_GEN1 +#include "io_fw_boot.h" /* the bootloader firmware to download to a device, if it needs it */ + +/* for second generation edgeports */ +#define IMAGE_ARRAY_NAME BootCodeImage_GEN2 +#define IMAGE_VERSION_NAME BootCodeImageVersion_GEN2 +#include "io_fw_boot2.h" /* the bootloader firmware to download to a device, if it needs it */ + +/* Then finally the main run-time operational code - for first generation edgeports */ +#define IMAGE_ARRAY_NAME OperationalCodeImage_GEN1 +#define IMAGE_VERSION_NAME OperationalCodeImageVersion_GEN1 +#include "io_fw_down.h" /* Define array OperationalCodeImage[] */ + +/* for second generation edgeports */ +#define IMAGE_ARRAY_NAME OperationalCodeImage_GEN2 +#define IMAGE_VERSION_NAME OperationalCodeImageVersion_GEN2 +#include "io_fw_down2.h" /* Define array OperationalCodeImage[] */ + + +#define MAX_NAME_LEN 64 + + +#define CHASE_TIMEOUT (5*HZ) /* 5 seconds */ +#define OPEN_TIMEOUT (5*HZ) /* 5 seconds */ +#define COMMAND_TIMEOUT (5*HZ) /* 5 seconds */ + +#ifndef SERIAL_MAGIC + #define SERIAL_MAGIC 0x6702 +#endif +#define PORT_MAGIC 0x7301 + + +/* receive port state */ +enum RXSTATE { + EXPECT_HDR1 = 0, /* Expect header byte 1 */ + EXPECT_HDR2 = 1, /* Expect header byte 2 */ + EXPECT_DATA = 2, /* Expect 'RxBytesRemaining' data */ + EXPECT_HDR3 = 3, /* Expect header byte 3 (for status hdrs only) */ +}; + + +/* the info for all of the devices that this driver supports */ +int EdgeportDevices[] = EDGEPORT_DEVICE_IDS; +#define NUM_EDGEPORT_DEVICES (sizeof(EdgeportDevices) / sizeof(int)) + + +/* Transmit Fifo + * This Transmit queue is an extension of the edgeport Rx buffer. + * The maximum amount of data buffered in both the edgeport + * Rx buffer (maxTxCredits) and this buffer will never exceed maxTxCredits. + */ +struct TxFifo { + unsigned int head; /* index to head pointer (write) */ + unsigned int tail; /* index to tail pointer (read) */ + unsigned int count; /* Bytes in queue */ + unsigned int size; /* Max size of queue (equal to Max number of TxCredits) */ + unsigned char *fifo; /* allocated Buffer */ +}; + +/* This structure holds all of the local port information */ +struct edgeport_port { + __u16 txCredits; /* our current credits for this port */ + __u16 maxTxCredits; /* the max size of the port */ + + struct TxFifo txfifo; /* transmit fifo -- size will be maxTxCredits */ + struct urb *write_urb; /* write URB for this port */ + char write_in_progress; /* TRUE while a write URB is outstanding */ + + __u8 shadowLCR; /* last LCR value received */ + __u8 shadowMCR; /* last MCR value received */ + __u8 shadowMSR; /* last MSR value received */ + __u8 shadowLSR; /* last LSR value received */ + __u8 shadowXonChar; /* last value set as XON char in Edgeport */ + __u8 shadowXoffChar; /* last value set as XOFF char in Edgeport */ + __u8 validDataMask; + __u32 baudRate; + + char open; + char openPending; + char commandPending; + char closePending; + char chaseResponsePending; + + wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */ + wait_queue_head_t wait_open; /* for handling sleeping while waiting for open to finish */ + wait_queue_head_t wait_command; /* for handling sleeping while waiting for command to finish */ + wait_queue_head_t delta_msr_wait; /* for handling sleeping while waiting for msr change to happen */ + + struct async_icount icount; + struct usb_serial_port *port; /* loop back to the owner of this object */ +}; + + +/* This structure holds all of the individual device information */ +struct edgeport_serial { + char name[MAX_NAME_LEN+1]; /* string name of this device */ + + EDGE_MANUF_DESCRIPTOR manuf_descriptor; /* the manufacturer descriptor */ + EDGE_BOOT_DESCRIPTOR boot_descriptor; /* the boot firmware descriptor */ + struct edgeport_product_info product_info; /* Product Info */ + + __u8 interrupt_in_endpoint; /* the interrupt endpoint handle */ + unsigned char * interrupt_in_buffer; /* the buffer we use for the interrupt endpoint */ + struct urb * interrupt_read_urb; /* our interrupt urb */ + + __u8 bulk_in_endpoint; /* the bulk in endpoint handle */ + unsigned char * bulk_in_buffer; /* the buffer we use for the bulk in endpoint */ + struct urb * read_urb; /* our bulk read urb */ + + __u8 bulk_out_endpoint; /* the bulk out endpoint handle */ + + __s16 rxBytesAvail; /* the number of bytes that we need to read from this device */ + + enum RXSTATE rxState; /* the current state of the bulk receive processor */ + __u8 rxHeader1; /* receive header byte 1 */ + __u8 rxHeader2; /* receive header byte 2 */ + __u8 rxHeader3; /* receive header byte 3 */ + __u8 rxPort; /* the port that we are currently receiving data for */ + __u8 rxStatusCode; /* the receive status code */ + __u8 rxStatusParam; /* the receive status paramater */ + __s16 rxBytesRemaining; /* the number of port bytes left to read */ + struct usb_serial *serial; /* loop back to the owner of this object */ +}; + +/* baud rate information */ +typedef struct _DIVISOR_TABLE_ENTRY { + __u32 BaudRate; + __u16 Divisor; +} DIVISOR_TABLE_ENTRY, *PDIVISOR_TABLE_ENTRY; + +// +// Define table of divisors for Rev A EdgePort/4 hardware +// These assume a 3.6864MHz crystal, the standard /16, and +// MCR.7 = 0. +// +static DIVISOR_TABLE_ENTRY DivisorTable[] = { + { 75, 3072}, + { 110, 2095}, /* 2094.545455 => 230450 => .0217 % over */ + { 134, 1713}, /* 1713.011152 => 230398.5 => .00065% under */ + { 150, 1536}, + { 300, 768}, + { 600, 384}, + { 1200, 192}, + { 1800, 128}, + { 2400, 96}, + { 4800, 48}, + { 7200, 32}, + { 9600, 24}, + { 14400, 16}, + { 19200, 12}, + { 38400, 6}, + { 57600, 4}, + { 115200, 2}, + { 230400, 1}, +}; + +/* local variables */ +static int CmdUrbs = 0; /* Number of outstanding Command Write Urbs */ + + +/* local function prototypes */ + +/* function prototypes for all URB callbacks */ +static void edge_interrupt_callback (struct urb *urb); +static void edge_bulk_in_callback (struct urb *urb); +static void edge_bulk_out_data_callback (struct urb *urb); +static void edge_bulk_out_cmd_callback (struct urb *urb); + +/* function prototypes for the usbserial callbacks */ +static int edge_open (struct usb_serial_port *port, struct file *filp); +static void edge_close (struct usb_serial_port *port, struct file *filp); +static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count); +static int edge_write_room (struct usb_serial_port *port); +static int edge_chars_in_buffer (struct usb_serial_port *port); +static void edge_throttle (struct usb_serial_port *port); +static void edge_unthrottle (struct usb_serial_port *port); +static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios); +static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); +static void edge_break (struct usb_serial_port *port, int break_state); +static int edge_startup (struct usb_serial *serial); +static void edge_shutdown (struct usb_serial *serial); + + +#include "io_tables.h" /* all of the devices that this driver supports */ + + +/* function prototypes for all of our local functions */ +static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char *buffer, __u16 bufferLength); +static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2, __u8 byte3); +static void handle_new_msr (struct edgeport_port *edge_port, __u8 newMsr); +static void handle_new_lsr (struct edgeport_port *edge_port, __u8 lsrData, __u8 lsr, __u8 data); +static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u8 param); +static int calc_baud_rate_divisor (int baud_rate, int *divisor); +static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRate); +static void change_port_settings (struct edgeport_port *edge_port, struct termios *old_termios); +static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 regNum, __u8 regValue); +static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer, int writeLength); +static void send_more_port_data (struct edgeport_serial *edge_serial, struct edgeport_port *edge_port); + +static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data); +static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data); +static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data); +static void get_manufacturing_desc (struct edgeport_serial *edge_serial); +static void get_boot_desc (struct edgeport_serial *edge_serial); +static void load_application_firmware (struct edgeport_serial *edge_serial); + + +static void unicode_to_ascii (char *string, short *unicode, int unicode_size); + +static int get_string_desc (struct usb_device *dev, int Id, struct usb_string_descriptor **pRetDesc); + + + + +// ************************************************************************ +// ************************************************************************ +// ************************************************************************ +// ************************************************************************ + +// These functions should be in firmware.c + +/************************************************************************ + * * + * update_edgeport_E2PROM() Compare current versions of * + * Boot ROM and Manufacture * + * Descriptors with versions * + * embedded in this driver * + * * + ************************************************************************/ +void update_edgeport_E2PROM (struct edgeport_serial *edge_serial) +{ + __u32 BootCurVer; + __u32 BootNewVer; + __u8 BootMajorVersion; + __u8 BootMinorVersion; + __u16 BootBuildNumber; + __u8 *BootImage; + __u32 BootSize; + PEDGE_FIRMWARE_IMAGE_RECORD record; + unsigned char *firmware; + int response; + + + switch (edge_serial->product_info.iDownloadFile) { + case EDGE_DOWNLOAD_FILE_I930: + BootMajorVersion = BootCodeImageVersion_GEN1.MajorVersion; + BootMinorVersion = BootCodeImageVersion_GEN1.MinorVersion; + BootBuildNumber = BootCodeImageVersion_GEN1.BuildNumber; + BootImage = &BootCodeImage_GEN1[0]; + BootSize = sizeof( BootCodeImage_GEN1 ); + break; + + case EDGE_DOWNLOAD_FILE_80251: + BootMajorVersion = BootCodeImageVersion_GEN2.MajorVersion; + BootMinorVersion = BootCodeImageVersion_GEN2.MinorVersion; + BootBuildNumber = BootCodeImageVersion_GEN2.BuildNumber; + BootImage = &BootCodeImage_GEN2[0]; + BootSize = sizeof( BootCodeImage_GEN2 ); + break; + + default: + return; + } + + // Check Boot Image Version + BootCurVer = (edge_serial->boot_descriptor.MajorVersion << 24) + + (edge_serial->boot_descriptor.MinorVersion << 16) + + edge_serial->boot_descriptor.BuildNumber; + + BootNewVer = (BootMajorVersion << 24) + + (BootMinorVersion << 16) + + BootBuildNumber; + + dbg("Current Boot Image version %d.%d.%d", + edge_serial->boot_descriptor.MajorVersion, + edge_serial->boot_descriptor.MinorVersion, + edge_serial->boot_descriptor.BuildNumber); + + + if (BootNewVer > BootCurVer) { + dbg("**Update Boot Image from %d.%d.%d to %d.%d.%d", + edge_serial->boot_descriptor.MajorVersion, + edge_serial->boot_descriptor.MinorVersion, + edge_serial->boot_descriptor.BuildNumber, + BootMajorVersion, + BootMinorVersion, + BootBuildNumber); + + + dbg("Downloading new Boot Image"); + + firmware = BootImage; + + for (;;) { + record = (PEDGE_FIRMWARE_IMAGE_RECORD)firmware; + response = rom_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); + if (response < 0) { + err("sram_write failed (%x, %x, %d)", record->ExtAddr, record->Addr, record->Len); + break; + } + firmware += sizeof (EDGE_FIRMWARE_IMAGE_RECORD) + record->Len; + if (firmware >= &BootImage[BootSize]) { + break; + } + } + } else { + dbg("Boot Image -- already up to date"); + } +} + + +/************************************************************************ + * * + * Get string descriptor from device * + * * + ************************************************************************/ +static int get_string (struct usb_device *dev, int Id, char *string) +{ + struct usb_string_descriptor StringDesc; + struct usb_string_descriptor *pStringDesc; + + dbg(__FUNCTION__ " - USB String ID = %d", Id ); + + if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { + return 0; + } + + pStringDesc = kmalloc (StringDesc.bLength, GFP_KERNEL); + + if (!pStringDesc) { + return 0; + } + + if (!usb_get_descriptor(dev, USB_DT_STRING, Id, pStringDesc, StringDesc.bLength )) { + kfree(pStringDesc); + return 0; + } + + unicode_to_ascii(string, pStringDesc->wData, pStringDesc->bLength/2-1); + + kfree(pStringDesc); + return strlen(string); +} + + +/************************************************************************ + * + * Get string descriptor from device + * + ************************************************************************/ +static int get_string_desc (struct usb_device *dev, int Id, struct usb_string_descriptor **pRetDesc) +{ + struct usb_string_descriptor StringDesc; + struct usb_string_descriptor *pStringDesc; + + dbg(__FUNCTION__ " - USB String ID = %d", Id ); + + if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { + return 0; + } + + pStringDesc = kmalloc (StringDesc.bLength, GFP_KERNEL); + + if (!pStringDesc) { + return -1; + } + + if (!usb_get_descriptor(dev, USB_DT_STRING, Id, pStringDesc, StringDesc.bLength )) { + kfree(pStringDesc); + return -1; + } + + *pRetDesc = pStringDesc; + return 0; +} + + + + +/************************************************************************ + * * + * * + ************************************************************************/ +static void get_product_info(struct edgeport_serial *edge_serial) +{ + struct edgeport_product_info *product_info = &edge_serial->product_info; + + memset (product_info, 0, sizeof(struct edgeport_product_info)); + + product_info->ProductId = (__u16)(edge_serial->serial->dev->descriptor.idProduct & ~ION_DEVICE_ID_GENERATION_2); + product_info->NumPorts = edge_serial->manuf_descriptor.NumPorts; + product_info->ProdInfoVer = 0; + + product_info->RomSize = edge_serial->manuf_descriptor.RomSize; + product_info->RamSize = edge_serial->manuf_descriptor.RamSize; + product_info->CpuRev = edge_serial->manuf_descriptor.CpuRev; + product_info->BoardRev = edge_serial->manuf_descriptor.BoardRev; + + product_info->BootMajorVersion = edge_serial->boot_descriptor.MajorVersion; + product_info->BootMinorVersion = edge_serial->boot_descriptor.MinorVersion; + product_info->BootBuildNumber = edge_serial->boot_descriptor.BuildNumber; + + memcpy(product_info->ManufactureDescDate, edge_serial->manuf_descriptor.DescDate, sizeof(edge_serial->manuf_descriptor.DescDate)); + + // check if this is 2nd generation hardware + if (edge_serial->serial->dev->descriptor.idProduct & ION_DEVICE_ID_GENERATION_2) { + product_info->FirmwareMajorVersion = OperationalCodeImageVersion_GEN2.MajorVersion; + product_info->FirmwareMinorVersion = OperationalCodeImageVersion_GEN2.MinorVersion; + product_info->FirmwareBuildNumber = OperationalCodeImageVersion_GEN2.BuildNumber; + product_info->iDownloadFile = EDGE_DOWNLOAD_FILE_80251; + } else { + product_info->FirmwareMajorVersion = OperationalCodeImageVersion_GEN1.MajorVersion; + product_info->FirmwareMinorVersion = OperationalCodeImageVersion_GEN1.MinorVersion; + product_info->FirmwareBuildNumber = OperationalCodeImageVersion_GEN1.BuildNumber; + product_info->iDownloadFile = EDGE_DOWNLOAD_FILE_I930; + } + + // Determine Product type and set appropriate flags + switch (DEVICE_ID_FROM_USB_PRODUCT_ID(product_info->ProductId)) { + case ION_DEVICE_ID_EDGEPORT_COMPATIBLE: + case ION_DEVICE_ID_EDGEPORT_4T: + case ION_DEVICE_ID_EDGEPORT_4: + case ION_DEVICE_ID_EDGEPORT_2: + case ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU: + case ION_DEVICE_ID_EDGEPORT_8: + case ION_DEVICE_ID_EDGEPORT_421: + case ION_DEVICE_ID_EDGEPORT_21: + case ION_DEVICE_ID_EDGEPORT_2_DIN: + case ION_DEVICE_ID_EDGEPORT_4_DIN: + case ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU: + product_info->IsRS232 = 1; + break; + + case ION_DEVICE_ID_EDGEPORT_2I: // Edgeport/2 RS422/RS485 + product_info->IsRS422 = 1; + product_info->IsRS485 = 1; + break; + + case ION_DEVICE_ID_EDGEPORT_8I: // Edgeport/4 RS422 + case ION_DEVICE_ID_EDGEPORT_4I: // Edgeport/4 RS422 + product_info->IsRS422 = 1; + break; + } + + // Dump Product Info structure + dbg("**Product Information:"); + dbg(" ProductId %x", product_info->ProductId ); + dbg(" NumPorts %d", product_info->NumPorts ); + dbg(" ProdInfoVer %d", product_info->ProdInfoVer ); + dbg(" IsServer %d", product_info->IsServer); + dbg(" IsRS232 %d", product_info->IsRS232 ); + dbg(" IsRS422 %d", product_info->IsRS422 ); + dbg(" IsRS485 %d", product_info->IsRS485 ); + dbg(" RomSize %d", product_info->RomSize ); + dbg(" RamSize %d", product_info->RamSize ); + dbg(" CpuRev %x", product_info->CpuRev ); + dbg(" BoardRev %x", product_info->BoardRev); + dbg(" BootMajorVersion %d.%d.%d", product_info->BootMajorVersion, + product_info->BootMinorVersion, + product_info->BootBuildNumber); + dbg(" FirmwareMajorVersion %d.%d.%d", product_info->FirmwareMajorVersion, + product_info->FirmwareMinorVersion, + product_info->FirmwareBuildNumber); + dbg(" ManufactureDescDate %d/%d/%d", product_info->ManufactureDescDate[0], + product_info->ManufactureDescDate[1], + product_info->ManufactureDescDate[2]+1900); + dbg(" iDownloadFile 0x%x", product_info->iDownloadFile); + +} + + +/************************************************************************/ +/************************************************************************/ +/* U S B C A L L B A C K F U N C T I O N S */ +/* U S B C A L L B A C K F U N C T I O N S */ +/************************************************************************/ +/************************************************************************/ + +/***************************************************************************** + * edge_interrupt_callback + * this is the callback function for when we have received data on the + * interrupt endpoint. + *****************************************************************************/ +static void edge_interrupt_callback (struct urb *urb) +{ + struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; + struct edgeport_port *edge_port; + struct usb_serial_port *port; + unsigned char *data = urb->transfer_buffer; + int length = urb->actual_length; + int bytes_avail; + int position; + int txCredits; + int portNumber; + int result; + + dbg(__FUNCTION__); + + if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { + return; + } + + if (urb->status) { + dbg(__FUNCTION__" - nonzero control read status received: %d", urb->status); + return; + } + + // process this interrupt-read even if there are no ports open + if (length) { + usb_serial_debug_data (__FILE__, __FUNCTION__, length, data); + + if (length > 1) { + bytes_avail = data[0] | (data[1] << 8); + if (bytes_avail) { + edge_serial->rxBytesAvail += bytes_avail; + dbg(__FUNCTION__" - bytes_avail = %d, rxBytesAvail %d", bytes_avail, edge_serial->rxBytesAvail); + + if ((edge_serial->rxBytesAvail > 0) && + (edge_serial->read_urb->status != -EINPROGRESS)) { + dbg(" --- Posting a read"); + + /* we have pending bytes on the bulk in pipe, send a request */ + edge_serial->read_urb->dev = edge_serial->serial->dev; + result = usb_submit_urb(edge_serial->read_urb); + if (result) { + dbg(__FUNCTION__" - usb_submit_urb(read bulk) failed with result = %d", result); + } + } + } + } + /* grab the txcredits for the ports if available */ + position = 2; + portNumber = 0; + while ((position < length) && (portNumber < edge_serial->serial->num_ports)) { + txCredits = data[position] | (data[position+1] << 8); + if (txCredits) { + port = &edge_serial->serial->port[portNumber]; + if (port_paranoia_check (port, __FUNCTION__) == 0) { + edge_port = (struct edgeport_port *)port->private; + if (edge_port->open) { + edge_port->txCredits += txCredits; + dbg(__FUNCTION__" - txcredits for port%d = %d", portNumber, edge_port->txCredits); + + /* tell the tty driver that something has changed */ + wake_up_interruptible(&edge_port->port->tty->write_wait); + + // Since we have more credit, check if more data can be sent + send_more_port_data(edge_serial, edge_port); + } + } + } + position += 2; + ++portNumber; + } + } +} + + +/***************************************************************************** + * edge_bulk_in_callback + * this is the callback function for when we have received data on the + * bulk in endpoint. + *****************************************************************************/ +static void edge_bulk_in_callback (struct urb *urb) +{ + struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; + unsigned char *data = urb->transfer_buffer; + int status; + __u16 raw_data_length; + + dbg(__FUNCTION__); + + if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { + return; + } + + if (urb->status) { + dbg(__FUNCTION__" - nonzero read bulk status received: %d", urb->status); + return; + } + + if (urb->actual_length) { + raw_data_length = urb->actual_length; + + usb_serial_debug_data (__FILE__, __FUNCTION__, raw_data_length, data); + + /* decrement our rxBytes available by the number that we just got */ + edge_serial->rxBytesAvail -= raw_data_length; + + dbg(__FUNCTION__" - Received = %d, rxBytesAvail %d", raw_data_length, edge_serial->rxBytesAvail); + + process_rcvd_data (edge_serial, data, urb->actual_length); + + /* check to see if there's any more data for us to read */ + if ((edge_serial->rxBytesAvail > 0) && + (edge_serial->read_urb->status != -EINPROGRESS)) { + dbg(" --- Posting a read"); + + /* there is, so resubmit our urb */ + edge_serial->read_urb->dev = edge_serial->serial->dev; + status = usb_submit_urb(edge_serial->read_urb); + if (status) { + err(__FUNCTION__" - usb_submit_urb(read bulk) failed, status = %d", status); + } + } + } +} + + +/***************************************************************************** + * edge_bulk_out_data_callback + * this is the callback function for when we have finished sending serial data + * on the bulk out endpoint. + *****************************************************************************/ +static void edge_bulk_out_data_callback (struct urb *urb) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; + struct tty_struct *tty; + + dbg(__FUNCTION__); + + if (port_paranoia_check (edge_port->port, __FUNCTION__)) { + return; + } + + if (urb->status) { + dbg(__FUNCTION__" - nonzero write bulk status received: %d", urb->status); + } + + tty = edge_port->port->tty; + + /* let the tty driver wakeup if it has a special write_wakeup function */ + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) { + (tty->ldisc.write_wakeup)(tty); + } + + /* tell the tty driver that something has changed */ + wake_up_interruptible(&tty->write_wait); + + // Release the Write URB + edge_port->write_in_progress = FALSE; + + // Check if more data needs to be sent + send_more_port_data((struct edgeport_serial *)(edge_port->port->serial->private), edge_port); +} + + +/***************************************************************************** + * BulkOutCmdCallback + * this is the callback function for when we have finished sending a command + * on the bulk out endpoint. + *****************************************************************************/ +static void edge_bulk_out_cmd_callback (struct urb *urb) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; + struct tty_struct *tty; + int status = urb->status; + + dbg(__FUNCTION__); + + CmdUrbs--; + dbg(__FUNCTION__" - FREE URB %p (outstanding %d)", urb, CmdUrbs); + + + /* if this urb had a transfer buffer already (old transfer) free it */ + if (urb->transfer_buffer != NULL) { + kfree(urb->transfer_buffer); + } + + // Free the command urb + usb_unlink_urb (urb); + usb_free_urb (urb); + + if (port_paranoia_check (edge_port->port, __FUNCTION__)) { + return; + } + + if (status) { + dbg(__FUNCTION__" - nonzero write bulk status received: %d", urb->status); + return; + } + + /* Get pointer to tty */ + tty = edge_port->port->tty; + + /* tell the tty driver that something has changed */ + wake_up_interruptible(&tty->write_wait); + + + /* we have completed the command */ + edge_port->commandPending = FALSE; + wake_up_interruptible(&edge_port->wait_command); +} + + +/***************************************************************************** + * Driver tty interface functions + *****************************************************************************/ + +/***************************************************************************** + * SerialOpen + * this function is called by the tty driver when a port is opened + * If successful, we return 0 + * Otherwise we return a negative error number. + *****************************************************************************/ +static int edge_open (struct usb_serial_port *port, struct file * filp) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)port->private; + struct usb_serial *serial; + struct edgeport_serial *edge_serial; + int response; + int timeout; + + if (port_paranoia_check (port, __FUNCTION__)) + return -ENODEV; + + dbg(__FUNCTION__ " - port %d", port->number); + + ++port->open_count; + MOD_INC_USE_COUNT; + + if (!port->active) { + port->active = 1; + + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates (like with OHCI) data + can get lost. */ + port->tty->low_latency = 1; + + /* see if we've set up our endpoint info yet (can't set it up in edge_startup + as the structures were not set up at that time.) */ + serial = port->serial; + edge_serial = (struct edgeport_serial *)serial->private; + if (edge_serial->interrupt_in_buffer == NULL) { + struct usb_serial_port *port0 = &serial->port[0]; + + /* not set up yet, so do it now */ + edge_serial->interrupt_in_buffer = port0->interrupt_in_buffer; + edge_serial->interrupt_in_endpoint = port0->interrupt_in_endpointAddress; + edge_serial->interrupt_read_urb = port0->interrupt_in_urb; + edge_serial->bulk_in_buffer = port0->bulk_in_buffer; + edge_serial->bulk_in_endpoint = port0->bulk_in_endpointAddress; + edge_serial->read_urb = port0->read_urb; + edge_serial->bulk_out_endpoint = port0->bulk_out_endpointAddress; + + /* set up our interrupt urb */ + /* Like to use FILL_INT_URB, but we don't know wMaxPacketSize or bInterval, something to change for 2.5... */ + edge_serial->interrupt_read_urb->complete = edge_interrupt_callback; + edge_serial->interrupt_read_urb->context = edge_serial; + /* FILL_INT_URB(edge_serial->interrupt_read_urb, serial->dev, + usb_rcvintpipe (serial->dev, edge_serial->interrupt_in_endpoint), + edge_serial->interrupt_in_buffer, edge_serial->interrupt_in_endpoint.wMaxPacketSize, + edge_interrupt_callback, edge_serial, edge_serial->interrupt_in_endpoint.bInterval); + */ + + /* set up our bulk in urb */ + /* Like to use FILL_BULK_URB, but we don't know wMaxPacketSize or bInterval, something to change for 2.5... */ + edge_serial->read_urb->complete = edge_bulk_in_callback; + edge_serial->read_urb->context = edge_serial; + /* FILL_BULK_URB(edge_serial->read_urb, serial->dev, + usb_rcvbulkpipe (serial->dev, edge_serial->bulk_in_endpoint), + edge_serial->bulk_in_buffer, edge_serial->bulk_in_endpoint->wMaxPacketSize, + edge_bulk_in_callback, edge_serial); + */ + + /* start interrupt read for this edgeport + * this interrupt will continue as long as the edgeport is connected */ + response = usb_submit_urb (edge_serial->interrupt_read_urb); + if (response) { + err(__FUNCTION__" - Error %d submitting control urb", response); + } + } + + /* initialize our wait queues */ + init_waitqueue_head(&edge_port->wait_open); + init_waitqueue_head(&edge_port->wait_chase); + init_waitqueue_head(&edge_port->delta_msr_wait); + init_waitqueue_head(&edge_port->wait_command); + + /* initialize our icount structure */ + memset (&(edge_port->icount), 0x00, sizeof(edge_port->icount)); + + /* initialize our port settings */ + edge_port->txCredits = 0; /* Can't send any data yet */ + edge_port->shadowMCR = MCR_MASTER_IE; /* Must always set this bit to enable ints! */ + edge_port->chaseResponsePending = FALSE; + + /* send a open port command */ + edge_port->openPending = TRUE; + edge_port->open = FALSE; + response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); + + if (response < 0) { + err(__FUNCTION__" - error sending open port command"); + edge_port->openPending = FALSE; + port->active = 0; + port->open_count = 0; + MOD_DEC_USE_COUNT; + return -ENODEV; + } + + /* now wait for the port to be completly opened */ + timeout = OPEN_TIMEOUT; + while (timeout && edge_port->openPending == TRUE) { + timeout = interruptible_sleep_on_timeout (&edge_port->wait_open, timeout); + } + + if (edge_port->open == FALSE) { + /* open timed out */ + dbg(__FUNCTION__" - open timedout"); + edge_port->openPending = FALSE; + port->active = 0; + port->open_count = 0; + MOD_DEC_USE_COUNT; + return -ENODEV; + } + + /* create the txfifo */ + edge_port->txfifo.head = 0; + edge_port->txfifo.tail = 0; + edge_port->txfifo.count = 0; + edge_port->txfifo.size = edge_port->maxTxCredits; + edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL); + + if (!edge_port->txfifo.fifo) { + dbg(__FUNCTION__" - no memory"); + edge_close (port, filp); + return -ENOMEM; + } + + /* Allocate a URB for the write */ + edge_port->write_urb = usb_alloc_urb (0); + + if (!edge_port->write_urb) { + dbg(__FUNCTION__" - no memory"); + edge_close (port, filp); + return -ENOMEM; + } + + dbg(__FUNCTION__"(%d) - Initialize TX fifo to %d bytes", port->number, edge_port->maxTxCredits); + } + + dbg(__FUNCTION__" exited"); + + return 0; +} + + +/************************************************************************ + * + * block_until_chase_response + * + * This function will block the close until one of the following: + * 1. Response to our Chase comes from Edgeport + * 2. A timout of 10 seconds without activity has expired + * (1K of Edgeport data @ 2400 baud ==> 4 sec to empty) + * + ************************************************************************/ +static void block_until_chase_response(struct edgeport_port *edge_port) +{ + __u16 lastCredits; + int timeout = 1*HZ; + int wait = 10; + + while (1) { + // Save Last credits + lastCredits = edge_port->txCredits; + + // Did we get our Chase response + if (edge_port->chaseResponsePending == FALSE) { + dbg(__FUNCTION__" - Got Chase Response"); + + // did we get all of our credit back? + if (edge_port->txCredits == edge_port->maxTxCredits ) { + dbg(__FUNCTION__" - Got all credits"); + return; + } + } + + // Block the thread for a while + interruptible_sleep_on_timeout (&edge_port->wait_chase, timeout); + + if (lastCredits == edge_port->txCredits) { + // No activity.. count down. + wait--; + if (wait == 0) { + edge_port->chaseResponsePending = FALSE; + dbg(__FUNCTION__" - Chase TIMEOUT"); + return; + } + } else { + // Reset timout value back to 10 seconds + dbg(__FUNCTION__" - Last %d, Current %d", lastCredits, edge_port->txCredits); + wait = 10; + } + } +} + + +/************************************************************************ + * + * block_until_tx_empty + * + * This function will block the close until one of the following: + * 1. TX count are 0 + * 2. The edgeport has stopped + * 3. A timout of 3 seconds without activity has expired + * + ************************************************************************/ +static void block_until_tx_empty (struct edgeport_port *edge_port) +{ + struct TxFifo *fifo = &edge_port->txfifo; + __u32 lastCount; + int timeout = HZ/10; + int wait = 30; + + while (1) { + // Save Last count + lastCount = fifo->count; + + // Is the Edgeport Buffer empty? + if (lastCount == 0) { + dbg(__FUNCTION__" - TX Buffer Empty"); + return; + } + + // Block the thread for a while + interruptible_sleep_on_timeout (&edge_port->wait_chase, timeout); + + dbg(__FUNCTION__ " wait"); + + if (lastCount == fifo->count) { + // No activity.. count down. + wait--; + if (wait == 0) { + dbg(__FUNCTION__" - TIMEOUT"); + return; + } + } else { + // Reset timout value back to seconds + wait = 30; + } + } +} + + +/***************************************************************************** + * edge_close + * this function is called by the tty driver when a port is closed + *****************************************************************************/ +static void edge_close (struct usb_serial_port *port, struct file * filp) +{ + struct usb_serial *serial; + struct edgeport_serial *edge_serial; + struct edgeport_port *edge_port; + int status; + + if (port_paranoia_check (port, __FUNCTION__)) + return; + + dbg(__FUNCTION__ " - port %d", port->number); + + serial = get_usb_serial (port, __FUNCTION__); + if (!serial) + return; + + edge_serial = (struct edgeport_serial *)serial->private; + edge_port = (struct edgeport_port *)port->private; + + --port->open_count; + + if (port->open_count <= 0) { + // block until tx is empty + block_until_tx_empty(edge_port); + + edge_port->closePending = TRUE; + + /* flush and chase */ + edge_port->chaseResponsePending = TRUE; + + dbg(__FUNCTION__" - Sending IOSP_CMD_CHASE_PORT"); + status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); + if (status == 0) { + // block until chase finished + block_until_chase_response(edge_port); + } else { + edge_port->chaseResponsePending = FALSE; + } + + /* close the port */ + dbg(__FUNCTION__" - Sending IOSP_CMD_CLOSE_PORT"); + send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0); + + //port->close = TRUE; + edge_port->closePending = FALSE; + edge_port->open = FALSE; + edge_port->openPending = FALSE; + + if (edge_port->write_urb) { + /* if this urb had a transfer buffer already (old transfer) free it */ + if (edge_port->write_urb->transfer_buffer != NULL) { + kfree(edge_port->write_urb->transfer_buffer); + } + + usb_unlink_urb (edge_port->write_urb); + usb_free_urb (edge_port->write_urb); + } + + if (edge_port->txfifo.fifo) { + kfree(edge_port->txfifo.fifo); + } + } + + MOD_DEC_USE_COUNT; + dbg(__FUNCTION__" exited"); +} + + + + +/***************************************************************************** + * SerialWrite + * this function is called by the tty driver when data should be written to + * the port. + * If successful, we return the number of bytes written, otherwise we return + * a negative error number. + *****************************************************************************/ +static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *data, int count) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)port->private; + struct TxFifo *fifo; + int copySize; + int bytesleft; + int firsthalf; + int secondhalf; + + dbg(__FUNCTION__ " - port %d", port->number); + + // get a pointer to the Tx fifo + fifo = &edge_port->txfifo; + + // calculate number of bytes to put in fifo + copySize = MIN(count, (edge_port->txCredits - fifo->count)); + + dbg(__FUNCTION__"(%d) of %d byte(s) Fifo room %d -- will copy %d bytes", + port->number, count, edge_port->txCredits - fifo->count, copySize); + + /* catch writes of 0 bytes which the tty driver likes to give us, and when txCredits is empty */ + if (copySize == 0) { + dbg (__FUNCTION__" - copySize = Zero"); + return 0; + } + + // queue the data + // since we can never overflow the buffer we do not have to check for full condition + + // the copy is done is two parts -- first fill to the end of the buffer + // then copy the reset from the start of the buffer + + bytesleft = fifo->size - fifo->head; + firsthalf = MIN(bytesleft,copySize); + dbg (__FUNCTION__" - copy %d bytes of %d into fifo ", firsthalf, bytesleft); + + /* now copy our data */ + if (from_user) { + copy_from_user(&fifo->fifo[fifo->head], data, firsthalf); + } else { + memcpy(&fifo->fifo[fifo->head], data, firsthalf); + } + + // update the index and size + fifo->head += firsthalf; + fifo->count += firsthalf; + + // wrap the index + if (fifo->head == fifo->size) { + fifo->head = 0; + } + + secondhalf = copySize-firsthalf; + + if (secondhalf) { + dbg (__FUNCTION__" - copy rest of data %d", secondhalf); + if (from_user) { + copy_from_user(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf); + } else { + memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf); + } + // update the index and size + fifo->count += secondhalf; + fifo->head += secondhalf; + // No need to check for wrap since we can not get to end of fifo in this part + } + + if (copySize) { + usb_serial_debug_data (__FILE__, __FUNCTION__, copySize, data); + } + + send_more_port_data((struct edgeport_serial *)port->serial->private, edge_port); + + dbg(__FUNCTION__" wrote %d byte(s) TxCredits %d, Fifo %d", copySize, edge_port->txCredits, fifo->count); + + return copySize; +} + + +/************************************************************************ + * + * send_more_port_data() + * + * This routine attempts to write additional UART transmit data + * to a port over the USB bulk pipe. It is called (1) when new + * data has been written to a port's TxBuffer from higher layers + * (2) when the peripheral sends us additional TxCredits indicating + * that it can accept more Tx data for a given port; and (3) when + * a bulk write completes successfully and we want to see if we + * can transmit more. + * + ************************************************************************/ +static void send_more_port_data(struct edgeport_serial *edge_serial, struct edgeport_port *edge_port) +{ + struct TxFifo *fifo = &edge_port->txfifo; + struct urb *urb; + unsigned char *buffer; + int status; + unsigned long flags; + int count; + int bytesleft; + int firsthalf; + int secondhalf; + + dbg(__FUNCTION__"(%d)", edge_port->port->number); + + /* find our next free urb */ // ICK!!! FIXME!!! + save_flags(flags); cli(); + + if (edge_port->write_in_progress || + !edge_port->open || + (fifo->count == 0)) { + restore_flags(flags); + dbg(__FUNCTION__"(%d) EXIT - fifo %d, PendingWrite = %d", edge_port->port->number, fifo->count, edge_port->write_in_progress); + return; + } + + // since the amount of data in the fifo will always fit into the + // edgeport buffer we do not need to check the write length + + // Do we have enough credits for this port to make it worthwhile + // to bother queueing a write. If it's too small, say a few bytes, + // it's better to wait for more credits so we can do a larger + // write. + if (edge_port->txCredits < EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(edge_port->maxTxCredits)) { + restore_flags(flags); + dbg(__FUNCTION__"(%d) Not enough credit - fifo %d TxCredit %d", edge_port->port->number, fifo->count, edge_port->txCredits ); + return; + } + + // lock this write + edge_port->write_in_progress = TRUE; + restore_flags(flags); + + // get a pointer to the write_urb + urb = edge_port->write_urb; + + /* if this urb had a transfer buffer already (old transfer) free it */ + if (urb->transfer_buffer != NULL) { + kfree(urb->transfer_buffer); + urb->transfer_buffer = NULL; + } + + /* build the data header for the buffer and port that we are about to send out */ + count = fifo->count; + buffer = kmalloc (count+2, GFP_KERNEL); + if (buffer == NULL) { + err(__FUNCTION__" - no more kernel memory..."); + edge_port->write_in_progress = FALSE; + return; + } + buffer[0] = IOSP_BUILD_DATA_HDR1 (edge_port->port->number, count); + buffer[1] = IOSP_BUILD_DATA_HDR2 (edge_port->port->number, count); + + /* now copy our data */ + bytesleft = fifo->size - fifo->tail; + firsthalf = MIN(bytesleft,count); + memcpy(&buffer[2], &fifo->fifo[fifo->tail], firsthalf); + fifo->tail += firsthalf; + fifo->count -= firsthalf; + if (fifo->tail == fifo->size) { + fifo->tail = 0; + } + + secondhalf = count-firsthalf; + if (secondhalf) { + memcpy(&buffer[2+firsthalf], &fifo->fifo[fifo->tail], secondhalf); + fifo->tail += secondhalf; + fifo->count -= secondhalf; + } + + if (count) { + usb_serial_debug_data (__FILE__, __FUNCTION__, count, &buffer[2]); + } + + /* fill up the urb with all of our data and submit it */ + FILL_BULK_URB (urb, edge_serial->serial->dev, + usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), + buffer, count+2, edge_bulk_out_data_callback, edge_port); + + /* set the USB_BULK_QUEUE flag so that we can shove a bunch of urbs at once down the pipe */ + urb->transfer_flags |= USB_QUEUE_BULK; + + urb->dev = edge_serial->serial->dev; + status = usb_submit_urb(urb); + if (status) { + /* something went wrong */ + dbg(__FUNCTION__" - usb_submit_urb(write bulk) failed"); + edge_port->write_in_progress = FALSE; + } else { + /* decrement the number of credits we have by the number we just sent */ + edge_port->txCredits -= count; + edge_port->icount.tx += count; + } + dbg(__FUNCTION__" wrote %d byte(s) TxCredit %d, Fifo %d", count, edge_port->txCredits, fifo->count); +} + + +/***************************************************************************** + * edge_write_room + * this function is called by the tty driver when it wants to know how many + * bytes of data we can accept for a specific port. + * If successful, we return the amount of room that we have for this port + * (the txCredits), + * Otherwise we return a negative error number. + *****************************************************************************/ +static int edge_write_room (struct usb_serial_port *port) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + int room; + + dbg(__FUNCTION__); + + if (edge_port->closePending == TRUE) { + return -ENODEV; + } + + dbg(__FUNCTION__" - port %d", port->number); + + if (!edge_port->open) { + dbg (__FUNCTION__" - port not opened"); + return -EINVAL; + } + + // total of both buffers is still txCredit + room = edge_port->txCredits - edge_port->txfifo.count; + + dbg(__FUNCTION__" - returns %d", room); + return room; +} + + +/***************************************************************************** + * edge_chars_in_buffer + * this function is called by the tty driver when it wants to know how many + * bytes of data we currently have outstanding in the port (data that has + * been written, but hasn't made it out the port yet) + * If successful, we return the number of bytes left to be written in the + * system, + * Otherwise we return a negative error number. + *****************************************************************************/ +static int edge_chars_in_buffer (struct usb_serial_port *port) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + int num_chars; + + dbg(__FUNCTION__); + + if (!edge_port->open) { + dbg (__FUNCTION__" - port not opened"); + return -EINVAL; + } + + num_chars = edge_port->maxTxCredits - edge_port->txCredits + edge_port->txfifo.count; + if (num_chars) { + dbg(__FUNCTION__"(port %d) - returns %d", port->number, num_chars); + } + + return num_chars; +} + + +/***************************************************************************** + * SerialThrottle + * this function is called by the tty driver when it wants to stop the data + * being read from the port. + *****************************************************************************/ +static void edge_throttle (struct usb_serial_port *port) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + struct tty_struct *tty; + int status; + + dbg(__FUNCTION__" - port %d", port->number); + + if (!edge_port->open) { + dbg (__FUNCTION__" - port not opened"); + return; + } + + tty = port->tty; + + /* if we are implementing XON/XOFF, send the stop character */ + if (I_IXOFF(tty)) { + unsigned char stop_char = STOP_CHAR(tty); + status = edge_write (port, 0, &stop_char, 1); + if (status <= 0) { + return; + } + } + + /* if we are implementing RTS/CTS, toggle that line */ + if (tty->termios->c_cflag & CRTSCTS) { + edge_port->shadowMCR &= ~MCR_RTS; + status = send_cmd_write_uart_register(edge_port, MCR, edge_port->shadowMCR); + if (status != 0) { + return; + } + } + + return; +} + + +/***************************************************************************** + * edge_unthrottle + * this function is called by the tty driver when it wants to resume the data + * being read from the port (called after SerialThrottle is called) + *****************************************************************************/ +static void edge_unthrottle (struct usb_serial_port *port) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + struct tty_struct *tty; + int status; + + dbg(__FUNCTION__" - port %d", port->number); + + if (!edge_port->open) { + dbg (__FUNCTION__" - port not opened"); + return; + } + + tty = port->tty; + + /* if we are implementing XON/XOFF, send the start character */ + if (I_IXOFF(tty)) { + unsigned char start_char = START_CHAR(tty); + status = edge_write (port, 0, &start_char, 1); + if (status <= 0) { + return; + } + } + + /* if we are implementing RTS/CTS, toggle that line */ + if (tty->termios->c_cflag & CRTSCTS) { + edge_port->shadowMCR |= MCR_RTS; + status = send_cmd_write_uart_register(edge_port, MCR, edge_port->shadowMCR); + if (status != 0) { + return; + } + } + + return; +} + + +/***************************************************************************** + * SerialSetTermios + * this function is called by the tty driver when it wants to change the termios structure + *****************************************************************************/ +static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + struct tty_struct *tty = port->tty; + unsigned int cflag = tty->termios->c_cflag; + + dbg(__FUNCTION__" - clfag %08x %08x iflag %08x %08x", + tty->termios->c_cflag, + old_termios->c_cflag, + RELEVANT_IFLAG(tty->termios->c_iflag), + RELEVANT_IFLAG(old_termios->c_iflag) + ); + + /* check that they really want us to change something */ + if (old_termios) { + if ((cflag == old_termios->c_cflag) && + (RELEVANT_IFLAG(tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { + dbg(__FUNCTION__" - nothing to change"); + return; + } + } + + dbg(__FUNCTION__" - port %d", port->number); + + if (!edge_port->open) { + dbg (__FUNCTION__" - port not opened"); + return; + } + + /* change the port settings to the new ones specified */ + change_port_settings (edge_port, old_termios); + + return; +} + + +/***************************************************************************** + * get_lsr_info - get line status register info + * + * Purpose: Let user call ioctl() to get info when the UART physically + * is emptied. On bus types like RS485, the transmitter must + * release the bus after transmitting. This must be done when + * the transmit shift register is empty, not be done when the + * transmit holding register is empty. This functionality + * allows an RS485 driver to be written in user space. + *****************************************************************************/ +static int get_lsr_info(struct edgeport_port *edge_port, unsigned int *value) +{ + unsigned int result = 0; + + if (edge_port->maxTxCredits == edge_port->txCredits && + edge_port->txfifo.count == 0) { + dbg(__FUNCTION__" -- Empty"); + result = TIOCSER_TEMT; + } + + if (copy_to_user(value, &result, sizeof(int))) + return -EFAULT; + return 0; +} + +static int get_number_bytes_avail(struct edgeport_port *edge_port, unsigned int *value) +{ + unsigned int result = 0; + struct tty_struct *tty = edge_port->port->tty; + + result = tty->read_cnt; + + dbg(__FUNCTION__"(%d) = %d", edge_port->port->number, result); + if (copy_to_user(value, &result, sizeof(int))) + return -EFAULT; + //return 0; + return -ENOIOCTLCMD; +} + +static int set_modem_info(struct edgeport_port *edge_port, unsigned int *value) +{ + unsigned int mcr = edge_port->shadowMCR; + unsigned int arg; + + if (copy_from_user(&arg, value, sizeof(int))) + return -EFAULT; + + // turn off the RTS and DTR + mcr &= ~(MCR_RTS | MCR_DTR); + + mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0); + mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0); + + edge_port->shadowMCR = mcr; + + send_cmd_write_uart_register(edge_port, MCR, edge_port->shadowMCR); + + return 0; +} + +static int get_modem_info(struct edgeport_port *edge_port, unsigned int *value) +{ + unsigned int result = 0; + unsigned int msr = edge_port->shadowMSR; + unsigned int mcr = edge_port->shadowMCR; + + result = ((mcr & MCR_DTR) ? TIOCM_DTR: 0) /* 0x002 */ + | ((mcr & MCR_RTS) ? TIOCM_RTS: 0) /* 0x004 */ + | ((msr & MSR_CTS) ? TIOCM_CTS: 0) /* 0x020 */ + | ((msr & MSR_CD) ? TIOCM_CAR: 0) /* 0x040 */ + | ((msr & MSR_RI) ? TIOCM_RI: 0) /* 0x080 */ + | ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */ + + + dbg(__FUNCTION__" -- %x", result); + + if (copy_to_user(value, &result, sizeof(int))) + return -EFAULT; + return 0; +} + + + +static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct * retinfo) +{ + struct serial_struct tmp; + + if (!retinfo) + return -EFAULT; + + memset(&tmp, 0, sizeof(tmp)); + + tmp.type = PORT_16550A; + tmp.line = edge_port->port->serial->minor; + tmp.port = edge_port->port->number; + tmp.irq = 0; + tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; + tmp.xmit_fifo_size = edge_port->maxTxCredits; + tmp.baud_base = 9600; + tmp.close_delay = 5*HZ; + tmp.closing_wait = 30*HZ; +// 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; +} + + + +/***************************************************************************** + * SerialIoctl + * this function handles any ioctl calls to the driver + *****************************************************************************/ +static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + struct async_icount cnow; + struct async_icount cprev; + struct serial_icounter_struct icount; + unsigned long flags; + + + dbg(__FUNCTION__" - port %d, cmd = 0x%x", port->number, cmd); + + switch (cmd) { + // return number of bytes available + case TIOCINQ: + dbg(__FUNCTION__" (%d) TIOCINQ", port->number); + return get_number_bytes_avail(edge_port, (unsigned int *) arg); + break; + +// case TCGETS: +// dbg(__FUNCTION__" (%d) TCGETS", port->number); +// break; + +// case TCSETS: +// dbg(__FUNCTION__" (%d) TCSETS", port->number); +// break; + + case TIOCSERGETLSR: + dbg(__FUNCTION__" (%d) TIOCSERGETLSR", port->number); + return get_lsr_info(edge_port, (unsigned int *) arg); + return 0; + + case TIOCMSET: + dbg(__FUNCTION__" (%d) TIOCMSET", port->number); + return set_modem_info(edge_port, (unsigned int *) arg); + + case TIOCMGET: + dbg(__FUNCTION__" (%d) TIOCMGET", port->number); + return get_modem_info(edge_port, (unsigned int *) arg); + + case TIOCGSERIAL: + dbg(__FUNCTION__" (%d) TIOCGSERIAL", port->number); + return get_serial_info(edge_port, (struct serial_struct *) arg); + + case TIOCSSERIAL: + dbg(__FUNCTION__" (%d) TIOCSSERIAL", port->number); + break; + + case TIOCMIWAIT: + dbg(__FUNCTION__" (%d) TIOCMIWAIT", port->number); + save_flags(flags); cli(); + cprev = edge_port->icount; + restore_flags(flags); + while (1) { + interruptible_sleep_on(&edge_port->delta_msr_wait); + /* see if a signal did it */ + if (signal_pending(current)) + return -ERESTARTSYS; + save_flags(flags); cli(); + cnow = edge_port->icount; /* atomic copy */ + restore_flags(flags); + if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && + cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) + return -EIO; /* no change => error */ + if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || + ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || + ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || + ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) { + return 0; + } + cprev = cnow; + } + /* NOTREACHED */ + break; + + case TIOCGICOUNT: + save_flags(flags); cli(); + cnow = edge_port->icount; + restore_flags(flags); + icount.cts = cnow.cts; + icount.dsr = cnow.dsr; + icount.rng = cnow.rng; + icount.dcd = cnow.dcd; + icount.rx = cnow.rx; + icount.tx = cnow.tx; + icount.frame = cnow.frame; + icount.overrun = cnow.overrun; + icount.parity = cnow.parity; + icount.brk = cnow.brk; + icount.buf_overrun = cnow.buf_overrun; + + dbg(__FUNCTION__" (%d) TIOCGICOUNT RX=%d, TX=%d", port->number, icount.rx, icount.tx ); + if (copy_to_user((void *)arg, &icount, sizeof(icount))) + return -EFAULT; + return 0; + } + + return -ENOIOCTLCMD; +} + + +/***************************************************************************** + * SerialBreak + * this function sends a break to the port + *****************************************************************************/ +static void edge_break (struct usb_serial_port *port, int break_state) +{ + struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); + int status; + + /* flush and chase */ + edge_port->chaseResponsePending = TRUE; + + dbg(__FUNCTION__" - Sending IOSP_CMD_CHASE_PORT"); + status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); + if (status == 0) { + // block until chase finished + block_until_chase_response(edge_port); + } else { + edge_port->chaseResponsePending = FALSE; + } + + if (break_state == -1) { + dbg(__FUNCTION__" - Sending IOSP_CMD_SET_BREAK"); + status = send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_BREAK, 0); + } else { + dbg(__FUNCTION__" - Sending IOSP_CMD_CLEAR_BREAK"); + status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CLEAR_BREAK, 0); + } + if (status) { + dbg(__FUNCTION__" - error sending break set/clear command."); + } + + return; +} + + +/***************************************************************************** + * process_rcvd_data + * this function handles the data received on the bulk in pipe. + *****************************************************************************/ +static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char * buffer, __u16 bufferLength) +{ + struct usb_serial_port *port; + struct edgeport_port *edge_port; + struct tty_struct *tty; + __u16 lastBufferLength; + __u16 rxLen; + int i; + + dbg(__FUNCTION__); + + lastBufferLength = bufferLength + 1; + + while (bufferLength > 0) { + /* failsafe incase we get a message that we don't understand */ + if (lastBufferLength == bufferLength) { + dbg(__FUNCTION__" - stuck in loop, exiting it."); + break; + } + lastBufferLength = bufferLength; + + switch (edge_serial->rxState) { + case EXPECT_HDR1: + edge_serial->rxHeader1 = *buffer; + ++buffer; + --bufferLength; + + if (bufferLength == 0) { + edge_serial->rxState = EXPECT_HDR2; + break; + } + /* otherwise, drop on through */ + + case EXPECT_HDR2: + edge_serial->rxHeader2 = *buffer; + ++buffer; + --bufferLength; + + dbg(__FUNCTION__" - Hdr1=%02X Hdr2=%02X", edge_serial->rxHeader1, edge_serial->rxHeader2); + + // Process depending on whether this header is + // data or status + + if (IS_CMD_STAT_HDR(edge_serial->rxHeader1)) { + // Decode this status header and goto EXPECT_HDR1 (if we + // can process the status with only 2 bytes), or goto + // EXPECT_HDR3 to get the third byte. + + edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); + edge_serial->rxStatusCode = IOSP_GET_STATUS_CODE(edge_serial->rxHeader1); + + if (!IOSP_STATUS_IS_2BYTE(edge_serial->rxStatusCode)) { + // This status needs additional bytes. Save what we have + // and then wait for more data. + edge_serial->rxStatusParam = edge_serial->rxHeader2; + + edge_serial->rxState = EXPECT_HDR3; + break; + } + + // We have all the header bytes, process the status now + process_rcvd_status (edge_serial, edge_serial->rxHeader2, 0); + + edge_serial->rxState = EXPECT_HDR1; + break; + } else { + edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); + edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1, edge_serial->rxHeader2); + + dbg(__FUNCTION__" - Data for Port %u Len %u", edge_serial->rxPort, edge_serial->rxBytesRemaining); + + //ASSERT( DevExt->RxPort < DevExt->NumPorts ); + //ASSERT( DevExt->RxBytesRemaining < IOSP_MAX_DATA_LENGTH ); + + if (bufferLength == 0 ) { + edge_serial->rxState = EXPECT_DATA; + break; + } + // Else, drop through + } + + case EXPECT_DATA: // Expect data + + if (bufferLength < edge_serial->rxBytesRemaining) { + rxLen = bufferLength; + edge_serial->rxState = EXPECT_DATA; // Expect data to start next buffer + } else { + // BufLen >= RxBytesRemaining + rxLen = edge_serial->rxBytesRemaining; + edge_serial->rxState = EXPECT_HDR1; // Start another header next time + } + + bufferLength -= rxLen; + edge_serial->rxBytesRemaining -= rxLen; + + /* spit this data back into the tty driver if this port is open */ + if (rxLen) { + port = &edge_serial->serial->port[edge_serial->rxPort]; + if (port_paranoia_check (port, __FUNCTION__) == 0) { + edge_port = (struct edgeport_port *)port->private; + if (edge_port->open) { + tty = edge_port->port->tty; + if (tty) { + dbg (__FUNCTION__" - Sending %d bytes to TTY for port %d", rxLen, edge_serial->rxPort); + for (i = 0; i < rxLen ; ++i) { + /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ + if(tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty_flip_buffer_push(tty); + } + /* this doesn't actually push the data through unless tty->low_latency is set */ + tty_insert_flip_char(tty, buffer[i], 0); + } + tty_flip_buffer_push(tty); + } + edge_port->icount.rx += rxLen; + } + } + buffer += rxLen; + } + + break; + + case EXPECT_HDR3: // Expect 3rd byte of status header + edge_serial->rxHeader3 = *buffer; + ++buffer; + --bufferLength; + + // We have all the header bytes, process the status now + process_rcvd_status (edge_serial, edge_serial->rxStatusParam, edge_serial->rxHeader3); + edge_serial->rxState = EXPECT_HDR1; + break; + + } + } + + return 0; +} + + +/***************************************************************************** + * process_rcvd_status + * this function handles the any status messages received on the bulk in pipe. + *****************************************************************************/ +static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2, __u8 byte3) +{ + struct usb_serial_port *port; + struct edgeport_port *edge_port; + __u8 code = edge_serial->rxStatusCode; + + /* switch the port pointer to the one being currently talked about */ + port = &edge_serial->serial->port[edge_serial->rxPort]; + if (port_paranoia_check (port, __FUNCTION__)) { + return; + } + edge_port = (struct edgeport_port *)port->private; + if (edge_port == NULL) { + err (__FUNCTION__ " - edge_port == NULL for port %d", edge_serial->rxPort); + return; + } + + dbg(__FUNCTION__" - port %d", edge_serial->rxPort); + + if (code == IOSP_EXT_STATUS) { + switch (byte2) { + case IOSP_EXT_STATUS_CHASE_RSP: + // we want to do EXT status regardless of port open/closed + dbg(__FUNCTION__" - Port %u EXT CHASE_RSP Data = %02x", edge_serial->rxPort, byte3 ); + // Currently, the only EXT_STATUS is Chase, so process here instead of one more call + // to one more subroutine. If/when more EXT_STATUS, there'll be more work to do. + // Also, we currently clear flag and close the port regardless of content of above's Byte3. + // We could choose to do something else when Byte3 says Timeout on Chase from Edgeport, + // like wait longer in block_until_chase_response, but for now we don't. + edge_port->chaseResponsePending = FALSE; + wake_up_interruptible (&edge_port->wait_chase); + return; + + case IOSP_EXT_STATUS_RX_CHECK_RSP: + dbg( __FUNCTION__" ========== Port %u CHECK_RSP Sequence = %02x =============\n", edge_serial->rxPort, byte3 ); + //Port->RxCheckRsp = TRUE; + return; + } + } + + if (code == IOSP_STATUS_OPEN_RSP) { + edge_port->txCredits = GET_TX_BUFFER_SIZE(byte3); + edge_port->maxTxCredits = edge_port->txCredits; + dbg (__FUNCTION__" - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", edge_serial->rxPort, byte2, edge_port->txCredits); + handle_new_msr (edge_port, byte2); + + /* send the current line settings to the port so we are in sync with any further termios calls */ + change_port_settings (edge_port, edge_port->port->tty->termios); + + /* we have completed the open */ + edge_port->openPending = FALSE; + edge_port->open = TRUE; + wake_up_interruptible(&edge_port->wait_open); + return; + } + + // If port is closed, silently discard all rcvd status. We can + // have cases where buffered status is received AFTER the close + // port command is sent to the Edgeport. + if ((!edge_port->open ) || (edge_port->closePending)) { + return; + } + + switch (code) { + // Not currently sent by Edgeport + case IOSP_STATUS_LSR: + dbg(__FUNCTION__" - Port %u LSR Status = %02x", edge_serial->rxPort, byte2); + handle_new_lsr (edge_port, FALSE, byte2, 0); + break; + + case IOSP_STATUS_LSR_DATA: + dbg(__FUNCTION__" - Port %u LSR Status = %02x, Data = %02x", edge_serial->rxPort, byte2, byte3); + // byte2 is LSR Register + // byte3 is broken data byte + handle_new_lsr (edge_port, TRUE, byte2, byte3); + break; + // + // case IOSP_EXT_4_STATUS: + // dbg(__FUNCTION__" - Port %u LSR Status = %02x Data = %02x", edge_serial->rxPort, byte2, byte3); + // break; + // + case IOSP_STATUS_MSR: + dbg(__FUNCTION__" - Port %u MSR Status = %02x", edge_serial->rxPort, byte2); + + // Process this new modem status and generate appropriate + // events, etc, based on the new status. This routine + // also saves the MSR in Port->ShadowMsr. + handle_new_msr(edge_port, byte2); + break; + + default: + dbg(__FUNCTION__" - Unrecognized IOSP status code %u\n", code); + break; + } + + return; +} + + +/***************************************************************************** + * handle_new_msr + * this function handles any change to the msr register for a port. + *****************************************************************************/ +static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr) +{ + struct async_icount *icount; + + dbg(__FUNCTION__" %02x", newMsr); + + if (newMsr & (MSR_DELTA_CTS | MSR_DELTA_DSR | MSR_DELTA_RI | MSR_DELTA_CD)) { + icount = &edge_port->icount; + + /* update input line counters */ + if (newMsr & MSR_DELTA_CTS) { + icount->cts++; + } + if (newMsr & MSR_DELTA_DSR) { + icount->dsr++; + } + if (newMsr & MSR_DELTA_CD) { + icount->dcd++; + } + if (newMsr & MSR_DELTA_RI) { + icount->rng++; + } + wake_up_interruptible(&edge_port->delta_msr_wait); + } + + /* Save the new modem status */ + edge_port->shadowMSR = newMsr & 0xf0; + + return; +} + + +/***************************************************************************** + * handle_new_lsr + * this function handles any change to the lsr register for a port. + *****************************************************************************/ +static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, __u8 lsr, __u8 data) +{ + __u8 newLsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK)); + struct async_icount *icount; + + dbg(__FUNCTION__" - %02x", newLsr); + + edge_port->shadowLSR = lsr; + + if (newLsr & LSR_BREAK) { + // + // Parity and Framing errors only count if they + // occur exclusive of a break being + // received. + // + newLsr &= (__u8)(LSR_OVER_ERR | LSR_BREAK); + } + + /* Place LSR data byte into Rx buffer */ + if (lsrData) { + tty_insert_flip_char(edge_port->port->tty, data, 0); + tty_flip_buffer_push(edge_port->port->tty); + } + + /* update input line counters */ + icount = &edge_port->icount; + if (newLsr & LSR_BREAK) { + icount->brk++; + } + if (newLsr & LSR_OVER_ERR) { + icount->overrun++; + } + if (newLsr & LSR_PAR_ERR) { + icount->parity++; + } + if (newLsr & LSR_FRM_ERR) { + icount->frame++; + } + + return; +} + + +/**************************************************************************** + * sram_write + * writes a number of bytes to the Edgeport device's sram starting at the + * given address. + * If successful returns the number of bytes written, otherwise it returns + * a negative error number of the problem. + ****************************************************************************/ +static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data) +{ + int result; + __u16 current_length; + unsigned char *transfer_buffer; + +// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); + + transfer_buffer = kmalloc (64, GFP_KERNEL); + if (!transfer_buffer) { + err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + return -ENOMEM; + } + + /* need to split these writes up into 64 byte chunks */ + result = 0; + while (length > 0) { + if (length > 64) { + current_length = 64; + } else { + current_length = length; + } +// dbg (__FUNCTION__" - writing %x, %x, %d", extAddr, addr, current_length); + memcpy (transfer_buffer, data, current_length); + result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_RAM, + 0x40, addr, extAddr, transfer_buffer, current_length, 300); + if (result < 0) + break; + length -= current_length; + addr += current_length; + data += current_length; + } + + kfree (transfer_buffer); + return result; +} + + +/**************************************************************************** + * rom_write + * writes a number of bytes to the Edgeport device's ROM starting at the + * given address. + * If successful returns the number of bytes written, otherwise it returns + * a negative error number of the problem. + ****************************************************************************/ +static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data) +{ + int result; + __u16 current_length; + unsigned char *transfer_buffer; + +// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); + + transfer_buffer = kmalloc (64, GFP_KERNEL); + if (!transfer_buffer) { + err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + return -ENOMEM; + } + + /* need to split these writes up into 64 byte chunks */ + result = 0; + while (length > 0) { + if (length > 64) { + current_length = 64; + } else { + current_length = length; + } +// dbg (__FUNCTION__" - writing %x, %x, %d", extAddr, addr, current_length); + memcpy (transfer_buffer, data, current_length); + result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_ROM, + 0x40, addr, extAddr, transfer_buffer, current_length, 300); + if (result < 0) + break; + length -= current_length; + addr += current_length; + data += current_length; + } + + kfree (transfer_buffer); + return result; +} + + +/**************************************************************************** + * rom_read + * reads a number of bytes from the Edgeport device starting at the given + * address. + * If successful returns the number of bytes read, otherwise it returns + * a negative error number of the problem. + ****************************************************************************/ +static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 length, __u8 *data) +{ + int result; + __u16 current_length; + unsigned char *transfer_buffer; + + dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); + + transfer_buffer = kmalloc (64, GFP_KERNEL); + if (!transfer_buffer) { + err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + return -ENOMEM; + } + + /* need to split these reads up into 64 byte chunks */ + result = 0; + while (length > 0) { + if (length > 64) { + current_length = 64; + } else { + current_length = length; + } +// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, current_length); + result = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), USB_REQUEST_ION_READ_ROM, + 0xC0, addr, extAddr, transfer_buffer, current_length, 300); + if (result < 0) + break; + memcpy (data, transfer_buffer, current_length); + length -= current_length; + addr += current_length; + data += current_length; + } + + kfree (transfer_buffer); + return result; +} + + +/**************************************************************************** + * send_iosp_ext_cmd + * Is used to send a IOSP message to the Edgeport device + ****************************************************************************/ +static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u8 param) +{ + unsigned char *buffer; + unsigned char *currentCommand; + int length = 0; + int status = 0; + + dbg(__FUNCTION__" - %d, %d", command, param); + + buffer = kmalloc (10, GFP_KERNEL); + if (!buffer) { + err(__FUNCTION__" - kmalloc(%d) failed.\n", 10); + return -ENOMEM; + } + + currentCommand = buffer; + + MAKE_CMD_EXT_CMD( ¤tCommand, &length, edge_port->port->number, command, param); + + status = write_cmd_usb (edge_port, buffer, length); + if (status) { + /* something bad happened, let's free up the memory */ + kfree(buffer); + } + + return status; +} + + +/***************************************************************************** + * write_cmd_usb + * this function writes the given buffer out to the bulk write endpoint. + *****************************************************************************/ +static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer, int length) +{ + struct edgeport_serial *edge_serial = (struct edgeport_serial *)edge_port->port->serial->private; + int status = 0; + urb_t *urb; + int timeout; + + usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer); + + /* Allocate our next urb */ + urb = usb_alloc_urb (0); + + CmdUrbs++; + + dbg(__FUNCTION__" - ALLOCATE URB %p (outstanding %d)", urb, CmdUrbs); + + if (!urb) { + return -ENOMEM; + } + + FILL_BULK_URB (urb, edge_serial->serial->dev, + usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), + buffer, length, edge_bulk_out_cmd_callback, edge_port); + + /* set the USB_BULK_QUEUE flag so that we can shove a bunch of urbs at once down the pipe */ + urb->transfer_flags |= USB_QUEUE_BULK; + + edge_port->commandPending = TRUE; + urb->dev = edge_serial->serial->dev; + status = usb_submit_urb(urb); + + if (status) { + /* something went wrong */ + dbg(__FUNCTION__" - usb_submit_urb(write bulk) failed"); + + /* if this urb had a transfer buffer already (old transfer) free it */ + if (urb->transfer_buffer != NULL) { + kfree(urb->transfer_buffer); + } + usb_unlink_urb (urb); + usb_free_urb (urb); + return status; + } + + // wait for command to finish + timeout = COMMAND_TIMEOUT; +#if 0 + while (timeout && edge_port->commandPending == TRUE) { + timeout = interruptible_sleep_on_timeout (&edge_port->wait_command, timeout); + } + + if (edge_port->commandPending == TRUE) { + /* command timed out */ + dbg(__FUNCTION__" - command timed out"); + status = -EINVAL; + } +#endif + return status; +} + + +/***************************************************************************** + * send_cmd_write_baud_rate + * this function sends the proper command to change the baud rate of the + * specified port. + *****************************************************************************/ +static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRate) +{ + unsigned char *cmdBuffer; + unsigned char *currCmd; + int cmdLen = 0; + int divisor; + int status; + unsigned char number = edge_port->port->number; + + dbg(__FUNCTION__" - port = %d, baud = %d", number, baudRate); + + status = calc_baud_rate_divisor (baudRate, &divisor); + if (status) { + err(__FUNCTION__" - bad baud rate"); + return status; + } + + // Alloc memory for the string of commands. + cmdBuffer = kmalloc (0x100, GFP_KERNEL); + if (!cmdBuffer) { + err(__FUNCTION__" - kmalloc(%d) failed.\n", 0x100); + return -ENOMEM; + } + currCmd = cmdBuffer; + + // Enable access to divisor latch + MAKE_CMD_WRITE_REG( &currCmd, &cmdLen, number, LCR, LCR_DL_ENABLE ); + + // Write the divisor itself + MAKE_CMD_WRITE_REG( &currCmd, &cmdLen, number, DLL, LOW8 (divisor) ); + MAKE_CMD_WRITE_REG( &currCmd, &cmdLen, number, DLM, HIGH8(divisor) ); + + // Restore original value to disable access to divisor latch + MAKE_CMD_WRITE_REG( &currCmd, &cmdLen, number, LCR, edge_port->shadowLCR); + + status = write_cmd_usb(edge_port, cmdBuffer, cmdLen ); + + return status; +} + + +/***************************************************************************** + * calc_baud_rate_divisor + * this function calculates the proper baud rate divisor for the specified + * baud rate. + *****************************************************************************/ +static int calc_baud_rate_divisor (int baudrate, int *divisor) +{ + int i; + __u16 custom; + __u16 round1; + __u16 round; + + + dbg(__FUNCTION__" - %d", baudrate); + + for (i = 0; i < NUM_ENTRIES(DivisorTable); i++) { + if ( DivisorTable[i].BaudRate == baudrate ) { + *divisor = DivisorTable[i].Divisor; + return 0; + } + } + + // We have tried all of the standard baud rates + // lets try to calculate the divisor for this baud rate + // Make sure the baud rate is reasonable + if (baudrate > 75 && baudrate < 230400) { + // get divisor + custom = (__u16)(230400L / baudrate); + + // Check for round off + round1 = (__u16)(2304000L / baudrate); + round = (__u16)(round1 - (custom * 10)); + if (round > 4) { + custom++; + } + *divisor = custom; + + dbg(__FUNCTION__" - Baud %d = %d\n", baudrate, custom); + return 0; + } + + return -1; +} + + +/***************************************************************************** + * send_cmd_write_uart_register + * this function builds up a uart register message and sends to to the device. + *****************************************************************************/ +static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 regNum, __u8 regValue) +{ + unsigned char *cmdBuffer; + unsigned char *currCmd; + unsigned long cmdLen = 0; + int status; + + dbg (__FUNCTION__" - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", regValue); + + // Alloc memory for the string of commands. + cmdBuffer = kmalloc (0x10, GFP_KERNEL); + if (cmdBuffer == NULL ) { + return -ENOMEM; + } + + currCmd = cmdBuffer; + + // Build a cmd in the buffer to write the given register + MAKE_CMD_WRITE_REG(&currCmd, &cmdLen, edge_port->port->number, regNum, regValue); + + status = write_cmd_usb(edge_port, cmdBuffer, cmdLen); + + return status; +} + + +/***************************************************************************** + * change_port_settings + * This routine is called to set the UART on the device to match the specified + * new settings. + *****************************************************************************/ +static void change_port_settings (struct edgeport_port *edge_port, struct termios *old_termios) +{ + struct tty_struct *tty; + int baud; + unsigned cflag; + __u8 mask = 0xff; + __u8 lData; + __u8 lParity; + __u8 lStop; + __u8 rxFlow; + __u8 txFlow; + int status; + + dbg(__FUNCTION__" - port %d", edge_port->port->number); + + if ((!edge_port->open) && + (!edge_port->openPending)) { + dbg(__FUNCTION__" - port not opened"); + return; + } + + tty = edge_port->port->tty; + if ((!tty) || + (!tty->termios)) { + dbg(__FUNCTION__" - no tty structures"); + return; + } + + cflag = tty->termios->c_cflag; + + switch (cflag & CSIZE) { + case CS5: lData = LCR_BITS_5; mask = 0x1f; dbg(__FUNCTION__" - data bits = 5"); break; + case CS6: lData = LCR_BITS_6; mask = 0x3f; dbg(__FUNCTION__" - data bits = 6"); break; + case CS7: lData = LCR_BITS_7; mask = 0x7f; dbg(__FUNCTION__" - data bits = 7"); break; + default: + case CS8: lData = LCR_BITS_8; dbg(__FUNCTION__" - data bits = 8"); break; + } + + lParity = LCR_PAR_NONE; + if (cflag & PARENB) { + if (cflag & PARODD) { + lParity = LCR_PAR_ODD; + dbg(__FUNCTION__" - parity = odd"); + } else { + lParity = LCR_PAR_EVEN; + dbg(__FUNCTION__" - parity = even"); + } + } else { + dbg(__FUNCTION__" - parity = none"); + } + + if (cflag & CSTOPB) { + lStop = LCR_STOP_2; + dbg(__FUNCTION__" - stop bits = 2"); + } else { + lStop = LCR_STOP_1; + dbg(__FUNCTION__" - stop bits = 1"); + } + + /* figure out the flow control settings */ + rxFlow = txFlow = 0x00; + if (cflag & CRTSCTS) { + rxFlow |= IOSP_RX_FLOW_RTS; + txFlow |= IOSP_TX_FLOW_CTS; + dbg(__FUNCTION__" - RTS/CTS is enabled"); + } else { + dbg(__FUNCTION__" - RTS/CTS is disabled"); + } + + /* if we are implementing XON/XOFF, set the start and stop character in the device */ + if (I_IXOFF(tty) || I_IXON(tty)) { + unsigned char stop_char = STOP_CHAR(tty); + unsigned char start_char = START_CHAR(tty); + + { + send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_XON_CHAR, start_char); + send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_XOFF_CHAR, stop_char); + } + + /* if we are implementing INBOUND XON/XOFF */ + if (I_IXOFF(tty)) { + rxFlow |= IOSP_RX_FLOW_XON_XOFF; + dbg(__FUNCTION__" - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", start_char, stop_char); + } else { + dbg(__FUNCTION__" - INBOUND XON/XOFF is disabled"); + } + + /* if we are implementing OUTBOUND XON/XOFF */ + if (I_IXON(tty)) { + txFlow |= IOSP_TX_FLOW_XON_XOFF; + dbg(__FUNCTION__" - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", start_char, stop_char); + } else { + dbg(__FUNCTION__" - OUTBOUND XON/XOFF is disabled"); + } + } + + /* Set flow control to the configured value */ + send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_RX_FLOW, rxFlow); + send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_TX_FLOW, txFlow); + + + edge_port->shadowLCR &= ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK); + edge_port->shadowLCR |= (lData | lParity | lStop); + + edge_port->validDataMask = mask; + + /* Send the updated LCR value to the EdgePort */ + status = send_cmd_write_uart_register(edge_port, LCR, edge_port->shadowLCR); + if (status != 0) { + return; + } + + /* set up the MCR register and send it to the EdgePort */ + edge_port->shadowMCR = MCR_MASTER_IE; + if (cflag & CBAUD) { + edge_port->shadowMCR |= (MCR_DTR | MCR_RTS); + } + status = send_cmd_write_uart_register(edge_port, MCR, edge_port->shadowMCR); + if (status != 0) { + return; + } + + /* Determine divisor based on baud rate */ + baud = tty_get_baud_rate(tty); + if (!baud) { + /* pick a default, any default... */ + baud = 9600; + } + + dbg(__FUNCTION__ " - baud rate = %d", baud); + status = send_cmd_write_baud_rate (edge_port, baud); + + return; +} + + +/**************************************************************************** + * unicode_to_ascii + * Turns a string from Unicode into ASCII. + * Doesn't do a good job with any characters that are outside the normal + * ASCII range, but it's only for debugging... + ****************************************************************************/ +static void unicode_to_ascii (char *string, short *unicode, int unicode_size) +{ + int i; + for (i = 0; i < unicode_size; ++i) { + string[i] = (char)(unicode[i]); + } + string[unicode_size] = 0x00; +} + + +/**************************************************************************** + * get_manufacturing_desc + * reads in the manufacturing descriptor and stores it into the serial + * structure. + ****************************************************************************/ +static void get_manufacturing_desc (struct edgeport_serial *edge_serial) +{ + int response; + + dbg("getting manufacturer descriptor"); + + response = rom_read (edge_serial->serial, (EDGE_MANUF_DESC_ADDR & 0xffff0000) >> 16, + (__u16)(EDGE_MANUF_DESC_ADDR & 0x0000ffff), EDGE_MANUF_DESC_LEN, + (__u8 *)(&edge_serial->manuf_descriptor)); + + if (response < 1) { + err("error in getting manufacturer descriptor"); + } else { + char string[30]; + dbg("**Manufacturer Descriptor"); + dbg(" RomSize: %dK", edge_serial->manuf_descriptor.RomSize); + dbg(" RamSize: %dK", edge_serial->manuf_descriptor.RamSize); + dbg(" CpuRev: %d", edge_serial->manuf_descriptor.CpuRev); + dbg(" BoardRev: %d", edge_serial->manuf_descriptor.BoardRev); + dbg(" NumPorts: %d", edge_serial->manuf_descriptor.NumPorts); + dbg(" DescDate: %d/%d/%d", edge_serial->manuf_descriptor.DescDate[0], edge_serial->manuf_descriptor.DescDate[1], edge_serial->manuf_descriptor.DescDate[2]+1900); + unicode_to_ascii (string, edge_serial->manuf_descriptor.SerialNumber, edge_serial->manuf_descriptor.SerNumLength/2-1); + dbg(" SerialNumber: %s", string); + unicode_to_ascii (string, edge_serial->manuf_descriptor.AssemblyNumber, edge_serial->manuf_descriptor.AssemblyNumLength/2-1); + dbg(" AssemblyNumber: %s", string); + unicode_to_ascii (string, edge_serial->manuf_descriptor.OemAssyNumber, edge_serial->manuf_descriptor.OemAssyNumLength/2-1); + dbg(" OemAssyNumber: %s", string); + dbg(" UartType: %d", edge_serial->manuf_descriptor.UartType); + dbg(" IonPid: %d", edge_serial->manuf_descriptor.IonPid); + dbg(" IonConfig: %d", edge_serial->manuf_descriptor.IonConfig); + } +} + + +/**************************************************************************** + * get_boot_desc + * reads in the bootloader descriptor and stores it into the serial + * structure. + ****************************************************************************/ +static void get_boot_desc (struct edgeport_serial *edge_serial) +{ + int response; + + dbg("getting boot descriptor"); + + response = rom_read (edge_serial->serial, (EDGE_BOOT_DESC_ADDR & 0xffff0000) >> 16, + (__u16)(EDGE_BOOT_DESC_ADDR & 0x0000ffff), EDGE_BOOT_DESC_LEN, + (__u8 *)(&edge_serial->boot_descriptor)); + + if (response < 1) { + err("error in getting boot descriptor"); + } else { + dbg("**Boot Descriptor:"); + dbg(" BootCodeLength: %d", edge_serial->boot_descriptor.BootCodeLength); + dbg(" MajorVersion: %d", edge_serial->boot_descriptor.MajorVersion); + dbg(" MinorVersion: %d", edge_serial->boot_descriptor.MinorVersion); + dbg(" BuildNumber: %d", edge_serial->boot_descriptor.BuildNumber); + dbg(" Capabilities: 0x%x", edge_serial->boot_descriptor.Capabilities); + dbg(" UConfig0: %d", edge_serial->boot_descriptor.UConfig0); + dbg(" UConfig1: %d", edge_serial->boot_descriptor.UConfig1); + } +} + + +/**************************************************************************** + * load_application_firmware + * This is called to load the application firmware to the device + ****************************************************************************/ +static void load_application_firmware (struct edgeport_serial *edge_serial) +{ + PEDGE_FIRMWARE_IMAGE_RECORD record; + unsigned char *firmware; + unsigned char *FirmwareImage; + int ImageSize; + int response; + + + switch (edge_serial->product_info.iDownloadFile) { + case EDGE_DOWNLOAD_FILE_I930: + dbg("downloading firmware version (930) %d.%d.%d", + OperationalCodeImageVersion_GEN1.MajorVersion, + OperationalCodeImageVersion_GEN1.MinorVersion, + OperationalCodeImageVersion_GEN1.BuildNumber); + firmware = &OperationalCodeImage_GEN1[0]; + FirmwareImage = &OperationalCodeImage_GEN1[0]; + ImageSize = sizeof(OperationalCodeImage_GEN1); + break; + + case EDGE_DOWNLOAD_FILE_80251: + dbg("downloading firmware version (80251) %d.%d.%d", + OperationalCodeImageVersion_GEN2.MajorVersion, + OperationalCodeImageVersion_GEN2.MinorVersion, + OperationalCodeImageVersion_GEN2.BuildNumber); + firmware = &OperationalCodeImage_GEN2[0]; + FirmwareImage = &OperationalCodeImage_GEN2[0]; + ImageSize = sizeof(OperationalCodeImage_GEN2); + break; + + case EDGE_DOWNLOAD_FILE_NONE: + dbg ("No download file specified, skipping download\n"); + return; + + default: + return; + } + + + for (;;) { + record = (PEDGE_FIRMWARE_IMAGE_RECORD)firmware; + response = sram_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); + if (response < 0) { + err("sram_write failed (%x, %x, %d)", record->ExtAddr, record->Addr, record->Len); + break; + } + firmware += sizeof (EDGE_FIRMWARE_IMAGE_RECORD) + record->Len; + if (firmware >= &FirmwareImage[ImageSize]) { + break; + } + } + + dbg("sending exec_dl_code"); + response = usb_control_msg (edge_serial->serial->dev, + usb_sndctrlpipe(edge_serial->serial->dev, 0), + USB_REQUEST_ION_EXEC_DL_CODE, + 0x40, 0x4000, 0x0001, NULL, 0, 3000); + + return; +} + + + + +/**************************************************************************** + * edge_startup + ****************************************************************************/ +static int edge_startup (struct usb_serial *serial) +{ + struct edgeport_serial *edge_serial; + struct edgeport_port *edge_port; + struct usb_device *dev; + int i; + + dev = serial->dev; + + /* create our private serial structure */ + edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); + if (edge_serial == NULL) { + err(__FUNCTION__" - Out of memory"); + return -ENOMEM; + } + memset (edge_serial, 0, sizeof(struct edgeport_serial)); + edge_serial->serial = serial; + serial->private = edge_serial; + + /* get the name for the device from the device */ + if ( (i = get_string(dev, dev->descriptor.iManufacturer, &edge_serial->name[0])) != 0) { + edge_serial->name[i-1] = ' '; + } + + get_string(dev, dev->descriptor.iProduct, &edge_serial->name[i]); + + info("%s detected", edge_serial->name); + + /* get the manufacturing descriptor for this device */ + get_manufacturing_desc (edge_serial); + + /* get the boot descriptor */ + get_boot_desc (edge_serial); + + get_product_info(edge_serial); + + /* set the number of ports from the manufacturing description */ + // FIXME should we override this??? + //serial->num_ports = serial->product_info.NumPorts; + if (edge_serial->product_info.NumPorts != serial->num_ports) { + warn(__FUNCTION__ " - Device Reported %d serial ports vs core thinking we have %d ports, email greg@kroah.com this info.", edge_serial->product_info.NumPorts, serial->num_ports); + } + + dbg(__FUNCTION__ " - time 1 %ld", jiffies); + + /* now load the application firmware into this device */ + load_application_firmware (edge_serial); + + dbg(__FUNCTION__ " - time 2 %ld", jiffies); + + /* Check current Edgeport EEPROM and update if necessary */ + update_edgeport_E2PROM (edge_serial); + + dbg(__FUNCTION__ " - time 3 %ld", jiffies); + + /* set the configuration to use #1 */ +// dbg("set_configuration 1"); +// usb_set_configuration (dev, 1); + + /* we set up the pointers to the endpoints in the edge_open function, + * as the structures aren't created yet. */ + + /* set up our port private structures */ + for (i = 0; i < serial->num_ports; ++i) { + edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); + if (edge_port == NULL) { + err(__FUNCTION__" - Out of memory"); + return -ENOMEM; + } + memset (edge_port, 0, sizeof(struct edgeport_port)); + edge_port->port = &serial->port[i]; + serial->port[i].private = edge_port; + } + + return 0; +} + + + +/**************************************************************************** + * usb_edgeport_disconnect + * This function is called whenever the device is removed from the usb bus. + ****************************************************************************/ +//static void usb_edgeport_disconnect (struct usb_device *dev, void *ptr) +static void edge_shutdown (struct usb_serial *serial) +{ + int i; + + dbg (__FUNCTION__); + + /* stop reads and writes on all ports */ + for (i=0; i < serial->num_ports; ++i) { + while (serial->port[i].open_count > 0) { + edge_close (&serial->port[i], NULL); + } + } + + /* free up any memory that we allocated */ + // FIXME + +} + + +/**************************************************************************** + * edgeport_init + * This is called by the module subsystem, or on startup to initialize us + ****************************************************************************/ +int __init edgeport_init(void) +{ + usb_serial_register (&edgeport_4_device); + usb_serial_register (&rapidport_4_device); + usb_serial_register (&edgeport_4t_device); + usb_serial_register (&edgeport_2_device); + usb_serial_register (&edgeport_4i_device); + usb_serial_register (&edgeport_2i_device); + usb_serial_register (&edgeport_prl_device); + usb_serial_register (&edgeport_421_device); + usb_serial_register (&edgeport_21_device); + usb_serial_register (&edgeport_8dual_device); + usb_serial_register (&edgeport_8_device); + usb_serial_register (&edgeport_2din_device); + usb_serial_register (&edgeport_4din_device); + usb_serial_register (&edgeport_16dual_device); + usb_serial_register (&edgeport_compat_id_device); + usb_serial_register (&edgeport_8i_device); + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; +} + + + +/**************************************************************************** + * edgeport_exit + * Called when the driver is about to be unloaded. + ****************************************************************************/ +void __exit edgeport_exit (void) +{ + usb_serial_deregister (&edgeport_4_device); + usb_serial_deregister (&rapidport_4_device); + usb_serial_deregister (&edgeport_4t_device); + usb_serial_deregister (&edgeport_2_device); + usb_serial_deregister (&edgeport_4i_device); + usb_serial_deregister (&edgeport_2i_device); + usb_serial_deregister (&edgeport_prl_device); + usb_serial_deregister (&edgeport_421_device); + usb_serial_deregister (&edgeport_21_device); + usb_serial_deregister (&edgeport_8dual_device); + usb_serial_deregister (&edgeport_8_device); + usb_serial_deregister (&edgeport_2din_device); + usb_serial_deregister (&edgeport_4din_device); + usb_serial_deregister (&edgeport_16dual_device); + usb_serial_deregister (&edgeport_compat_id_device); + usb_serial_deregister (&edgeport_8i_device); +} + +module_init(edgeport_init); +module_exit(edgeport_exit); + +/* Module information */ +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_edgeport.h linux.20p9/drivers/usb/serial/io_edgeport.h --- linux.vanilla/drivers/usb/serial/io_edgeport.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_edgeport.h Thu Jul 26 18:13:34 2001 @@ -0,0 +1,152 @@ +/************************************************************************ + * + * io_edgeport.h Edgeport Linux Interface definitions + * + * Copyright (c) 2000 Inside Out Networks, Inc. + * + * 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. + * + * + ************************************************************************/ + +#if !defined(_IO_EDGEPORT_H_) +#define _IO_EDGEPORT_H_ + + +#define MAX_RS232_PORTS 8 /* Max # of RS-232 ports per device */ + +/* typedefs that the insideout headers need */ +#ifndef TRUE + #define TRUE (1) +#endif +#ifndef FALSE + #define FALSE (0) +#endif +#ifndef MIN + #define MIN(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef MAX + #define MAX(a,b) (((a)>(b))?(a):(b)) +#endif +#ifndef max + #define max MAX +#endif + +#ifndef LOW8 + #define LOW8(a) ((unsigned char)(a & 0xff)) +#endif +#ifndef HIGH8 + #define HIGH8(a) ((unsigned char)((a & 0xff00) >> 8)) +#endif +#ifndef NUM_ENTRIES + #define NUM_ENTRIES(x) (sizeof(x)/sizeof((x)[0])) +#endif + +#ifndef __KERNEL__ +#define __KERNEL__ +#endif + +#include "io_usbvend.h" + + + +/* The following table is used to map the USBx port number to + * the device serial number (or physical USB path), */ +#define MAX_EDGEPORTS 64 + +struct comMapper { + char SerialNumber[MAX_SERIALNUMBER_LEN+1]; /* Serial number/usb path */ + int numPorts; /* Number of ports */ + int Original[MAX_RS232_PORTS]; /* Port numbers set by IOCTL */ + int Port[MAX_RS232_PORTS]; /* Actual used port numbers */ +}; + + +#define EDGEPORT_CONFIG_DEVICE "/proc/edgeport" + +/* /proc/edgeport Interface + * This interface uses read/write/lseek interface to talk to the edgeport driver + * the following read functions are supported: */ +#define PROC_GET_MAPPING_TO_PATH 1 +#define PROC_GET_COM_ENTRY 2 +#define PROC_GET_EDGE_MANUF_DESCRIPTOR 3 +#define PROC_GET_BOOT_DESCRIPTOR 4 +#define PROC_GET_PRODUCT_INFO 5 +#define PROC_GET_STRINGS 6 +#define PROC_GET_CURRENT_COM_MAPPING 7 + +/* The parameters to the lseek() for the read is: */ +#define PROC_READ_SETUP(Command, Argument) ((Command) + ((Argument)<<8)) + + +/* the following write functions are supported: */ +#define PROC_SET_COM_MAPPING 1 +#define PROC_SET_COM_ENTRY 2 + + +/* The following sturcture is passed to the write */ +struct procWrite { + int Command; + union { + struct comMapper Entry; + int ComMappingBasedOnUSBPort; /* Boolean value */ + } u; +}; + +/* + * Product information read from the Edgeport + */ +struct edgeport_product_info { + __u16 ProductId; /* Product Identifier */ + __u8 NumPorts; /* Number of ports on edgeport */ + __u8 ProdInfoVer; /* What version of structure is this? */ + + __u32 IsServer :1; /* Set if Server */ + __u32 IsRS232 :1; /* Set if RS-232 ports exist */ + __u32 IsRS422 :1; /* Set if RS-422 ports exist */ + __u32 IsRS485 :1; /* Set if RS-485 ports exist */ + __u32 IsReserved :28; /* Reserved for later expansion */ + + __u8 RomSize; /* Size of ROM/E2PROM in K */ + __u8 RamSize; /* Size of external RAM in K */ + __u8 CpuRev; /* CPU revision level (chg only if s/w visible) */ + __u8 BoardRev; /* PCB revision level (chg only if s/w visible) */ + + __u8 BootMajorVersion; /* Boot Firmware version: xx. */ + __u8 BootMinorVersion; /* yy. */ + __u16 BootBuildNumber; /* zzzz (LE format) */ + + __u8 FirmwareMajorVersion; /* Operational Firmware version:xx. */ + __u8 FirmwareMinorVersion; /* yy. */ + __u16 FirmwareBuildNumber; /* zzzz (LE format) */ + + __u8 ManufactureDescDate[3]; /* MM/DD/YY when descriptor template was compiled */ + __u8 Unused1[1]; /* Available */ + + __u8 iDownloadFile; /* What to download to EPiC device */ + __u8 Unused2[2]; /* Available */ +}; + +/* + * Edgeport Stringblock String locations + */ +#define EDGESTRING_MANUFNAME 1 /* Manufacture Name */ +#define EDGESTRING_PRODNAME 2 /* Product Name */ +#define EDGESTRING_SERIALNUM 3 /* Serial Number */ +#define EDGESTRING_ASSEMNUM 4 /* Assembly Number */ +#define EDGESTRING_OEMASSEMNUM 5 /* OEM Assembly Number */ +#define EDGESTRING_MANUFDATE 6 /* Manufacture Date */ +#define EDGESTRING_ORIGSERIALNUM 7 /* Serial Number */ + +struct string_block { + __u16 NumStrings; /* Number of strings in block */ + __u16 Strings[1]; /* Start of string block */ +}; + +typedef struct string_block STRING_BLOCK, *PSTRING_BLOCK; + + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_fw_boot.h linux.20p9/drivers/usb/serial/io_fw_boot.h --- linux.vanilla/drivers/usb/serial/io_fw_boot.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_fw_boot.h Wed Jul 4 16:03:58 2001 @@ -0,0 +1,558 @@ +//************************************************************** +//* Edgeport/4 Binary Image +//* Generated by HEX2C v1.06 +//* Copyright(c) 1998 Inside Out Networks, All rights reserved. +//* This program is free software; you can redistribute it and/or modify +//* it under the terms of the GNU General Public License as published by +//* the Free Software Foundation; either version 2 of the License, or +//* (at your option) any later version. +//************************************************************** + + +//Image structure definition +#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) +#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD + typedef struct _EDGE_FIRMWARE_IMAGE_RECORD + { + unsigned short ExtAddr; + unsigned short Addr; + unsigned short Len; + unsigned char Data[0]; + } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + + typedef struct _EDGE_FIRMWARE_VERSION_INFO + { + unsigned char MajorVersion; + unsigned char MinorVersion; + unsigned short BuildNumber; + } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + +#endif + +#if !defined(IMAGE_ARRAY_NAME) +#define IMAGE_ARRAY_NAME FirmwareImage +#define IMAGE_VERSION_NAME FirmwareImageVersion +#endif + +static unsigned char IMAGE_ARRAY_NAME[] = { + +// Segment #1, Start Address 00ff0000, Length 6 +0xff,0x00,0x00,0x00,0x06,0x00, + 0x02, 0x00, 0x80, 0x02, 0x00, 0x03, + +// Segment #2, Start Address 00ff000b, Length 3 +0xff,0x00,0x0b,0x00,0x03,0x00, + 0x02, 0x00, 0x0b, + +// Segment #3, Start Address 00ff0013, Length 3 +0xff,0x00,0x13,0x00,0x03,0x00, + 0x02, 0x01, 0xb8, + +// Segment #4, Start Address 00ff001b, Length 3 +0xff,0x00,0x1b,0x00,0x03,0x00, + 0x02, 0x00, 0x1b, + +// Segment #5, Start Address 00ff0023, Length 3 +0xff,0x00,0x23,0x00,0x03,0x00, + 0x02, 0x00, 0x23, + +// Segment #6, Start Address 00ff002b, Length 3 +0xff,0x00,0x2b,0x00,0x03,0x00, + 0x02, 0x00, 0x2b, + +// Segment #7, Start Address 00ff0033, Length 3 +0xff,0x00,0x33,0x00,0x03,0x00, + 0x02, 0x00, 0x33, + +// Segment #8, Start Address 00ff003b, Length 3 +0xff,0x00,0x3b,0x00,0x03,0x00, + 0x02, 0x00, 0x3b, + +// Segment #9, Start Address 00ff0043, Length 3 +0xff,0x00,0x43,0x00,0x03,0x00, + 0x02, 0x01, 0xbd, + +// Segment #10, Start Address 00ff004b, Length 3 +0xff,0x00,0x4b,0x00,0x03,0x00, + 0x02, 0x01, 0xd0, + +// Segment #11, Start Address 00ff0053, Length 3 +0xff,0x00,0x53,0x00,0x03,0x00, + 0x02, 0x01, 0x21, + +// Segment #12, Start Address 00ff007b, Length 3 +0xff,0x00,0x7b,0x00,0x03,0x00, + 0x02, 0x00, 0x7b, + +// Segment #13, Start Address 00ff0080, Length 358 +0xff,0x00,0x80,0x00,0x66,0x01, + 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x3f, 0xf2, 0x7e, 0xf8, 0x00, 0x23, 0x7e, 0x00, 0x01, 0x7e, 0x10, + 0x00, 0x12, 0x07, 0x5f, 0x69, 0x20, 0x00, 0x0a, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x05, 0x75, 0x90, + 0x0d, 0x80, 0x03, 0x75, 0x90, 0x1d, 0xd2, 0xb5, 0x7e, 0x00, 0x00, 0xa5, 0xd8, 0xfd, 0x75, 0xa8, + 0x00, 0x75, 0xb1, 0x00, 0xa9, 0xd5, 0x87, 0xca, 0x29, 0x12, 0x09, 0xcc, 0x12, 0x09, 0xa0, 0xf5, + 0x09, 0x7a, 0xa1, 0x20, 0x12, 0x01, 0xe6, 0xda, 0x29, 0xa9, 0xd0, 0xc7, 0x7e, 0x00, 0x05, 0x7a, + 0x01, 0xf1, 0x75, 0xe1, 0x10, 0xa9, 0xd7, 0xf4, 0xa9, 0xd7, 0xe4, 0xa5, 0xd8, 0xf1, 0x75, 0xf1, + 0x00, 0x75, 0xe1, 0x3f, 0x75, 0xa2, 0x03, 0x75, 0xa3, 0x00, 0x75, 0xc0, 0x00, 0x75, 0xc1, 0x00, + 0xa9, 0xd1, 0xb1, 0xa9, 0xd0, 0xb1, 0xa9, 0xd5, 0xd3, 0xd2, 0xaf, 0xe4, 0x7e, 0x04, 0x28, 0x00, + 0x8d, 0xef, 0x1b, 0x04, 0x78, 0xfa, 0x04, 0xa9, 0x34, 0xd3, 0x03, 0x30, 0xe0, 0xee, 0xbe, 0x24, + 0x00, 0x00, 0x78, 0x05, 0x63, 0x90, 0x30, 0x80, 0xe3, 0xb2, 0x95, 0x80, 0xdf, 0xbe, 0xb0, 0x02, + 0x22, 0xc0, 0xd0, 0xa9, 0x20, 0xdf, 0x0f, 0xa9, 0x31, 0xdf, 0x03, 0x02, 0x01, 0xb5, 0x75, 0x08, + 0x01, 0x12, 0x08, 0x33, 0x80, 0xfe, 0x75, 0x08, 0xfe, 0x12, 0x08, 0x33, 0x75, 0xa8, 0x00, 0x7e, + 0xb3, 0x3f, 0xf2, 0x30, 0xe0, 0x4b, 0x30, 0x01, 0x46, 0xc2, 0x92, 0x7e, 0x24, 0x80, 0x00, 0x7e, + 0x11, 0x09, 0x74, 0x08, 0x19, 0xb2, 0x00, 0x10, 0x74, 0x0e, 0x19, 0xb2, 0x00, 0x04, 0x2e, 0x24, + 0x01, 0x00, 0xa5, 0xd9, 0xed, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0xe4, 0xd5, 0xe0, 0xfd, + 0x09, 0xb2, 0x00, 0x08, 0x20, 0xe0, 0x0a, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, 0x18, 0x80, + 0xeb, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xe4, 0x43, 0x90, 0x30, 0xd2, 0xaa, 0x80, 0x05, 0xd2, + 0xaa, 0x43, 0x90, 0x34, 0xd2, 0xaf, 0xa9, 0xd1, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa9, 0x11, + 0xdf, 0x03, 0xa9, 0xd2, 0xdf, 0x75, 0x08, 0xff, 0x12, 0x08, 0x33, 0xc0, 0xd1, 0xca, 0x02, 0xff, + 0xca, 0x06, 0x83, 0x00, 0x32, 0xd0, 0xd0, 0x32, 0xc2, 0x8b, 0xc2, 0xaa, 0x32, 0x75, 0x08, 0x08, + 0x12, 0x08, 0x33, 0xa9, 0xc0, 0xb1, 0xa9, 0xc5, 0xd3, 0xa9, 0xc6, 0xd3, 0xa9, 0xd2, 0xb1, 0x32, + 0xca, 0xb8, 0x75, 0x08, 0x02, 0x12, 0x08, 0x33, 0xe5, 0xc0, 0x54, 0x03, 0x68, 0x05, 0x12, 0x01, + 0xee, 0x80, 0xf5, 0xda, 0xb8, 0x32, + +// Segment #14, Start Address 00ff1bca, Length 1 +0xff,0x00,0xca,0x1b,0x01,0x00, + 0x00, + +// Segment #15, Start Address 00ff01e6, Length 1613 +0xff,0x00,0xe6,0x01,0x4d,0x06, + 0xe4, 0x7a, 0xb3, 0x3f, 0xf1, 0x02, 0x02, 0x63, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0xca, 0x3b, + 0xca, 0x4b, 0xca, 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0xc0, 0xf1, 0x7e, 0xb3, 0x01, 0x2b, + 0xb4, 0x00, 0x02, 0x80, 0x19, 0xb4, 0x01, 0x16, 0x30, 0xc0, 0x08, 0x75, 0xf1, 0x00, 0x12, 0x02, + 0x4d, 0x80, 0x1f, 0x30, 0xc1, 0x1c, 0x75, 0xf1, 0x00, 0x12, 0x02, 0xde, 0x80, 0x14, 0x30, 0xc1, + 0x08, 0x75, 0xf1, 0x00, 0x12, 0x02, 0xde, 0x80, 0x09, 0x30, 0xc0, 0x06, 0x75, 0xf1, 0x00, 0x12, + 0x02, 0x4d, 0xd0, 0xf1, 0xda, 0xeb, 0xda, 0x7b, 0xda, 0x6b, 0xda, 0x5b, 0xda, 0x4b, 0xda, 0x3b, + 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0xc2, 0xc0, 0x7e, 0xb3, 0x01, 0x2b, 0xb4, 0x02, 0x07, + 0x12, 0x02, 0x6f, 0x02, 0x02, 0x63, 0x22, 0xb4, 0x01, 0xfc, 0x02, 0x02, 0xa9, 0x7e, 0x00, 0x00, + 0x7a, 0x03, 0x01, 0x2b, 0x7a, 0x03, 0x01, 0x2c, 0x22, 0x7e, 0xb3, 0x01, 0x23, 0x54, 0x60, 0x60, + 0x05, 0xb4, 0x40, 0x15, 0x80, 0x13, 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x05, 0x0c, 0x75, 0x08, 0x71, + 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x26, 0xf5, 0x8f, 0x22, 0x75, 0xf6, 0x00, 0x22, 0xbe, 0x57, + 0x01, 0x29, 0x28, 0x04, 0x7e, 0x57, 0x01, 0x29, 0x7a, 0x0f, 0x01, 0x2e, 0x7a, 0x57, 0x01, 0x32, + 0x02, 0x02, 0xa9, 0x7e, 0xef, 0x01, 0x2e, 0x7e, 0xf7, 0x01, 0x32, 0x7e, 0x07, 0x01, 0x32, 0x4d, + 0x00, 0x68, 0x21, 0x7e, 0x00, 0x00, 0x7e, 0xeb, 0xb0, 0xf5, 0xf3, 0xa3, 0xa5, 0x08, 0x1b, 0xf4, + 0x68, 0x04, 0xa5, 0xb8, 0x08, 0xf0, 0x7a, 0xef, 0x01, 0x2e, 0x7a, 0xf7, 0x01, 0x32, 0x75, 0x08, + 0x06, 0x12, 0x08, 0x33, 0x7a, 0x01, 0xf6, 0x22, 0xc2, 0xc1, 0x75, 0x08, 0x03, 0x12, 0x08, 0x33, + 0xa9, 0x36, 0xe2, 0x16, 0xe5, 0xf5, 0x54, 0xc0, 0x68, 0x07, 0xa9, 0xd7, 0xf4, 0xa9, 0x27, 0xf4, + 0xfc, 0x53, 0xe1, 0x3f, 0x43, 0xf2, 0x88, 0x02, 0x03, 0x55, 0x7e, 0xb3, 0x01, 0x2c, 0xb4, 0x02, + 0x0f, 0xa9, 0xd4, 0xe4, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x01, 0x2c, 0x7a, 0xb3, 0x01, 0x2b, 0x22, + 0xb4, 0x01, 0x39, 0x7e, 0x21, 0xe6, 0x7c, 0x32, 0x7e, 0x13, 0x01, 0x2d, 0x2c, 0x21, 0x7a, 0x23, + 0x01, 0x2d, 0x7e, 0x00, 0x00, 0x2e, 0x04, 0x01, 0x34, 0xe5, 0xe3, 0x7a, 0x09, 0xb0, 0x0b, 0x04, + 0xa5, 0xdb, 0xf6, 0xa9, 0xd4, 0xe4, 0x75, 0x08, 0x70, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x2d, + 0x7e, 0xa3, 0x01, 0x2a, 0xbc, 0xab, 0x78, 0x03, 0x12, 0x03, 0xec, 0x22, 0x02, 0x07, 0x55, 0xe5, + 0xe6, 0xb4, 0x08, 0x65, 0xa9, 0xc4, 0xe2, 0x7e, 0x01, 0xe3, 0x7e, 0x11, 0xe3, 0x7e, 0x31, 0xe3, + 0x7e, 0x21, 0xe3, 0x7e, 0x51, 0xe3, 0x7e, 0x41, 0xe3, 0x7e, 0x71, 0xe3, 0x7e, 0x61, 0xe3, 0x7a, + 0x0f, 0x01, 0x23, 0x7a, 0x1f, 0x01, 0x27, 0x75, 0x08, 0x04, 0x12, 0x08, 0x33, 0x7a, 0x01, 0x08, + 0x12, 0x08, 0x33, 0x7a, 0x11, 0x08, 0x12, 0x08, 0x33, 0x7a, 0x21, 0x08, 0x12, 0x08, 0x33, 0x7a, + 0x31, 0x08, 0x12, 0x08, 0x33, 0x7a, 0x41, 0x08, 0x12, 0x08, 0x33, 0x7a, 0x51, 0x08, 0x12, 0x08, + 0x33, 0x7a, 0x61, 0x08, 0x12, 0x08, 0x33, 0x7a, 0x71, 0x08, 0x12, 0x08, 0x33, 0xa9, 0xd4, 0xe4, + 0xa9, 0xd7, 0xf4, 0xa9, 0xc6, 0xe2, 0x12, 0x03, 0xc0, 0x22, 0x6d, 0x00, 0x7e, 0x14, 0x01, 0x02, + 0x7a, 0x07, 0x01, 0x32, 0x7a, 0x03, 0x01, 0x2d, 0x7e, 0xb3, 0x01, 0x23, 0x20, 0xe7, 0x0f, 0x7a, + 0x23, 0x01, 0x2c, 0x7a, 0x33, 0x01, 0x2b, 0xbe, 0x07, 0x01, 0x29, 0x68, 0x09, 0x22, 0x7a, 0x33, + 0x01, 0x2c, 0x7a, 0x23, 0x01, 0x2b, 0x7e, 0xb3, 0x01, 0x23, 0x54, 0xe3, 0x23, 0x23, 0x30, 0xe0, + 0x02, 0xd2, 0xe5, 0x30, 0xe7, 0x02, 0xd2, 0xe4, 0x30, 0xe5, 0x06, 0x30, 0xe4, 0x03, 0x02, 0x07, + 0x55, 0x54, 0x3e, 0xf5, 0xf0, 0x03, 0x54, 0x1f, 0xc3, 0x25, 0xf0, 0x90, 0x04, 0x18, 0x75, 0x84, + 0xff, 0x73, 0x02, 0x05, 0x6c, 0x02, 0x04, 0x60, 0x02, 0x06, 0x09, 0x02, 0x06, 0x24, 0x02, 0x05, + 0x05, 0x02, 0x04, 0xc6, 0x02, 0x06, 0x3d, 0x02, 0x06, 0x3d, 0x02, 0x06, 0x40, 0x02, 0x06, 0x40, + 0x02, 0x06, 0x40, 0x02, 0x06, 0x40, 0x02, 0x06, 0x40, 0x02, 0x06, 0x40, 0x02, 0x06, 0x40, 0x02, + 0x06, 0x40, 0x02, 0x06, 0x46, 0x02, 0x06, 0xfa, 0x02, 0x06, 0x43, 0x02, 0x06, 0x43, 0x02, 0x06, + 0x43, 0x02, 0x06, 0x43, 0x02, 0x06, 0x43, 0x02, 0x06, 0x43, 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x06, + 0x2a, 0x7e, 0xb3, 0x01, 0x25, 0x60, 0x56, 0x7c, 0x0b, 0x7e, 0x13, 0x01, 0x26, 0x7e, 0x17, 0x01, + 0x27, 0x75, 0x08, 0x72, 0x12, 0x08, 0x33, 0x7a, 0x01, 0x08, 0x12, 0x08, 0x33, 0x7a, 0x11, 0x08, + 0x12, 0x08, 0x33, 0x12, 0x07, 0x5f, 0x40, 0x35, 0x02, 0x02, 0x94, 0xb4, 0x08, 0x10, 0x75, 0x08, + 0x74, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x3f, 0xf1, 0xf5, 0xf3, 0x75, 0xf6, 0x01, 0x22, 0xb4, 0x00, + 0x1c, 0x75, 0x08, 0x75, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x3f, 0xf2, 0x30, 0xe0, 0x05, 0x75, 0xf3, + 0x02, 0x80, 0x03, 0x75, 0xf3, 0x00, 0x75, 0xf3, 0x00, 0x75, 0xf6, 0x02, 0x22, 0x02, 0x07, 0x55, + 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x00, 0x35, 0x75, 0x08, 0x76, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, + 0x28, 0x54, 0x0f, 0xf5, 0xf1, 0x7e, 0xb3, 0x01, 0x28, 0x20, 0xe7, 0x09, 0xe5, 0xe1, 0x30, 0xe7, + 0x0d, 0x74, 0x01, 0x80, 0x0b, 0xe5, 0xe1, 0x30, 0xe6, 0x04, 0x74, 0x01, 0x80, 0x02, 0x74, 0x00, + 0x53, 0xf1, 0x80, 0xf5, 0xf3, 0x75, 0xf3, 0x00, 0x75, 0xf6, 0x02, 0x22, 0x02, 0x07, 0x55, 0xc0, + 0xf1, 0x7e, 0xb3, 0x01, 0x28, 0x54, 0x0f, 0x42, 0xf1, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x00, 0x45, + 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x01, 0x24, 0x75, 0x08, 0x77, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, + 0x28, 0x54, 0x0f, 0x78, 0x05, 0x53, 0xe1, 0x3f, 0x80, 0x37, 0x7e, 0xb3, 0x01, 0x28, 0x20, 0xe7, + 0x05, 0x53, 0xe1, 0x7f, 0x80, 0x2b, 0x53, 0xe1, 0xbf, 0x80, 0x26, 0xb4, 0x03, 0x17, 0x75, 0x08, + 0x78, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x28, 0x20, 0xe7, 0x05, 0x43, 0xe1, 0x80, 0x80, 0x11, + 0x43, 0xe1, 0x40, 0x80, 0x0c, 0x43, 0xe1, 0xc0, 0xd0, 0xf1, 0x75, 0x08, 0x07, 0x12, 0x08, 0x33, + 0x22, 0xd0, 0xf1, 0x02, 0x02, 0x90, 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x09, 0x23, 0x75, 0x08, 0x79, + 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x26, 0xbe, 0xb3, 0x3f, 0xf1, 0x68, 0x11, 0xca, 0xb8, 0xc0, + 0xf1, 0x12, 0x01, 0x1d, 0xd0, 0xf1, 0xda, 0xb8, 0x50, 0x76, 0x7a, 0xb3, 0x3f, 0xf1, 0x80, 0x6d, + 0xb4, 0x05, 0x08, 0x75, 0x08, 0x7a, 0x12, 0x08, 0x33, 0x80, 0x62, 0xb4, 0x03, 0x19, 0x75, 0x08, + 0x7b, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x01, 0x55, 0x7e, 0xb3, 0x3f, 0xf2, 0x44, + 0x01, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x46, 0xb4, 0x01, 0x19, 0x75, 0x08, 0x7c, 0x12, 0x08, 0x33, + 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x01, 0x39, 0x7e, 0xb3, 0x3f, 0xf2, 0x54, 0xfe, 0x7a, 0xb3, 0x3f, + 0xf2, 0x80, 0x2a, 0xb4, 0x07, 0x2a, 0x7e, 0xb3, 0x01, 0x25, 0x60, 0x24, 0x7c, 0x0b, 0x7e, 0x13, + 0x01, 0x26, 0x7e, 0x17, 0x01, 0x27, 0x75, 0x08, 0x73, 0x12, 0x08, 0x33, 0x7a, 0x01, 0x08, 0x12, + 0x08, 0x33, 0x7a, 0x11, 0x08, 0x12, 0x08, 0x33, 0x12, 0x07, 0x8b, 0x40, 0x03, 0x02, 0x02, 0x90, + 0x02, 0x07, 0x55, 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x0b, 0xf6, 0x75, 0x08, 0x7d, 0x12, 0x08, 0x33, + 0x7e, 0xb3, 0x01, 0x26, 0x7e, 0xa3, 0x01, 0x28, 0x4c, 0xab, 0x78, 0xe4, 0x80, 0xdf, 0x7e, 0xb3, + 0x01, 0x24, 0xb4, 0x0a, 0xdb, 0x75, 0x08, 0x7e, 0x12, 0x08, 0x33, 0x7e, 0xb3, 0x01, 0x26, 0x70, + 0xcf, 0xf5, 0xf3, 0x75, 0xf6, 0x01, 0x22, 0x02, 0x07, 0x55, 0x02, 0x07, 0x55, 0x02, 0x07, 0x55, + 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x04, 0x20, 0x75, 0x08, 0xc3, 0x12, 0x08, 0x33, 0x7e, 0x04, 0x00, + 0x01, 0x7e, 0x17, 0x01, 0x25, 0x7e, 0x18, 0x01, 0x34, 0x7a, 0x1c, 0x00, 0x00, 0x7e, 0x47, 0x01, + 0x29, 0x12, 0x08, 0x3f, 0x02, 0x06, 0xf4, 0xb4, 0x06, 0x3a, 0x75, 0x08, 0xc1, 0x12, 0x08, 0x33, + 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7d, 0xca, 0x7e, 0xd7, 0x01, 0x25, 0x7e, 0x78, + 0x01, 0x34, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x01, 0x29, 0x75, 0x08, 0xc1, 0x12, 0x08, 0x33, + 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x12, 0x08, 0xd6, 0xd0, 0x87, 0xd0, 0xa8, + 0x40, 0x4f, 0x80, 0x4a, 0xb4, 0x00, 0x1c, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x12, 0x02, 0x90, 0xe4, + 0x8d, 0xef, 0x8d, 0xef, 0x8d, 0xef, 0xd5, 0xe0, 0xf7, 0xc0, 0xd1, 0xca, 0x02, 0xff, 0xca, 0x06, + 0x00, 0x00, 0x32, 0xb4, 0x09, 0x12, 0x7e, 0x57, 0x01, 0x25, 0x4d, 0x55, 0x68, 0x05, 0xa9, 0xd2, + 0xb1, 0x80, 0x03, 0xa9, 0xc2, 0xb1, 0x80, 0x16, 0xb4, 0x07, 0x16, 0xc2, 0xaf, 0x7e, 0x07, 0x01, + 0x27, 0x7e, 0x17, 0x01, 0x25, 0xc0, 0xd1, 0xca, 0x18, 0xca, 0x38, 0xca, 0x28, 0x32, 0x02, 0x02, + 0x90, 0x02, 0x07, 0x55, 0x7e, 0xb3, 0x01, 0x24, 0xb4, 0x03, 0x15, 0x75, 0x08, 0xc2, 0x12, 0x08, + 0x33, 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x17, 0x01, 0x25, 0x7e, 0x57, 0x01, 0x29, 0x02, 0x02, 0x94, + 0xb4, 0x05, 0x39, 0x75, 0x08, 0xc0, 0x12, 0x08, 0x33, 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, 0xa9, + 0xd5, 0x87, 0x7e, 0x08, 0x01, 0x34, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x37, + 0x01, 0x25, 0x7e, 0x47, 0x01, 0x29, 0x12, 0x08, 0x3f, 0xd0, 0x87, 0xd0, 0xa8, 0x7e, 0x08, 0x01, + 0x34, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x57, 0x01, 0x29, 0x02, 0x02, 0x94, 0x02, 0x07, 0x55, 0x75, + 0x08, 0x07, 0x12, 0x08, 0x33, 0x43, 0xe1, 0xc0, 0x22, 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, 0xa9, + 0xd5, 0x87, 0x12, 0x07, 0xca, 0x40, 0x19, 0x7e, 0x08, 0x01, 0x34, 0x7a, 0x0c, 0x00, 0x00, 0xca, + 0x0b, 0xca, 0x49, 0x12, 0x08, 0x3f, 0xda, 0x59, 0xda, 0x0b, 0xd0, 0x87, 0xd0, 0xa8, 0xc3, 0x22, + 0xd0, 0x87, 0xd0, 0xa8, 0x22, 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x12, 0x07, + 0xca, 0x40, 0x2b, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7f, 0x61, 0x7e, 0x78, 0x01, + 0x34, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x01, 0x29, 0xbd, 0x74, 0x78, 0x11, 0x75, 0x08, 0xc1, + 0x12, 0x08, 0x33, 0x12, 0x08, 0xd6, 0x40, 0x06, 0xd0, 0x87, 0xd0, 0xa8, 0xc3, 0x22, 0xd0, 0x87, + 0xd0, 0xa8, 0xd3, 0x22, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x34, 0x7f, 0xca, 0x0b, 0x1a, 0x50, 0xc5, + 0xf0, 0x7d, 0x62, 0x7d, 0x75, 0x7d, 0x87, 0x7e, 0x34, 0x7f, 0x03, 0x7e, 0x1b, 0xb0, 0xbc, 0x0b, + 0x50, 0x49, 0x3e, 0x00, 0x3e, 0x00, 0x0a, 0x50, 0x2d, 0x75, 0x0b, 0x3a, 0x30, 0x69, 0x53, 0x00, + 0x02, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, 0xbc, 0x1b, 0x50, 0x30, 0x3e, 0x10, 0x3e, 0x10, 0x0a, + 0x51, 0x2d, 0x35, 0x69, 0x41, 0x00, 0x02, 0x0b, 0x1a, 0x30, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, + 0xbe, 0x44, 0xff, 0xff, 0x78, 0x05, 0x7e, 0x1b, 0x90, 0x0a, 0x49, 0x4d, 0x44, 0x68, 0x0c, 0xbe, + 0x44, 0x00, 0xff, 0x28, 0x04, 0x7e, 0x44, 0x00, 0xff, 0xc3, 0x22, 0xd3, 0x22, + +// Segment #16, EXCLUDED Start Address 00ff7c00, Length 199 + + +// Segment #17, EXCLUDED Start Address 00ff7f00, Length 192 + + +// Segment #17, Start Address 00ff7fc0, Length 64 +0xff,0x00,0xc0,0x7f,0x40,0x00, + 0x40, 0x01, 0x02, 0x00, 0xca, 0x1b, 0x01, 0x0c, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + +// Segment #18, Start Address 00ff0833, Length 5015 +0xff,0x00,0x33,0x08,0x97,0x13, + 0xca, 0x08, 0x7e, 0x01, 0x08, 0x7a, 0x03, 0x3f, 0xf0, 0xda, 0x08, 0x22, 0x80, 0x50, 0x0b, 0x1a, + 0x60, 0x0b, 0x35, 0x0b, 0x1a, 0x70, 0x0b, 0x35, 0x0b, 0x1a, 0x80, 0x0b, 0x35, 0x0b, 0x1a, 0x90, + 0x0b, 0x35, 0x0b, 0x1a, 0xa0, 0x0b, 0x35, 0x0b, 0x1a, 0xb0, 0x0b, 0x35, 0x0b, 0x1a, 0xc0, 0x0b, + 0x35, 0x0b, 0x1a, 0xd0, 0x0b, 0x35, 0x1b, 0x0a, 0x60, 0x0b, 0x15, 0x1b, 0x0a, 0x70, 0x0b, 0x15, + 0x1b, 0x0a, 0x80, 0x0b, 0x15, 0x1b, 0x0a, 0x90, 0x0b, 0x15, 0x1b, 0x0a, 0xa0, 0x0b, 0x15, 0x1b, + 0x0a, 0xb0, 0x0b, 0x15, 0x1b, 0x0a, 0xc0, 0x0b, 0x15, 0x1b, 0x0a, 0xd0, 0x0b, 0x15, 0x9e, 0x44, + 0x00, 0x10, 0x50, 0xaa, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x0e, 0x7e, 0x1b, 0xc0, 0x7a, 0x0b, 0xc0, + 0x0b, 0x14, 0x0b, 0x34, 0x1b, 0x44, 0x78, 0xf2, 0x22, 0x7f, 0x6f, 0x7f, 0xf0, 0x1b, 0xfc, 0x7c, + 0x54, 0x7d, 0x32, 0x80, 0x08, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0x9e, 0x44, 0x00, + 0x10, 0x50, 0xf2, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x06, 0xca, 0x48, 0x1b, 0x44, 0x78, 0xfa, 0x7f, + 0xf6, 0x89, 0xe4, 0xca, 0x6b, 0x5e, 0xd4, 0x00, 0x3f, 0x68, 0x20, 0x7e, 0x84, 0x00, 0x40, 0x9d, + 0x8d, 0xda, 0x6b, 0xbd, 0x87, 0x38, 0x16, 0xca, 0x79, 0x7d, 0x78, 0x12, 0x09, 0x00, 0xda, 0x79, + 0x40, 0x08, 0x9d, 0x78, 0x68, 0x02, 0x80, 0x05, 0xc2, 0xd7, 0x22, 0xda, 0x6b, 0x43, 0x90, 0x30, + 0x74, 0xaa, 0x39, 0xb5, 0x55, 0x55, 0x74, 0x55, 0x39, 0xb5, 0x2a, 0xaa, 0x74, 0xa0, 0x39, 0xb5, + 0x55, 0x55, 0x7e, 0x04, 0x00, 0x40, 0x9d, 0x70, 0x50, 0x06, 0x2d, 0x70, 0x7d, 0x07, 0x6d, 0x77, + 0x7c, 0x31, 0x7e, 0x7b, 0x00, 0x7a, 0x6b, 0x00, 0x0b, 0x7c, 0x0b, 0x6c, 0xa5, 0xd9, 0xf3, 0x7f, + 0x16, 0x1b, 0x1c, 0x7e, 0x54, 0x27, 0x10, 0x7e, 0x1b, 0x10, 0xbc, 0x10, 0x68, 0x06, 0x1b, 0x54, + 0x78, 0xf5, 0x80, 0x2c, 0x6d, 0x00, 0x7c, 0x20, 0x7f, 0x16, 0x9f, 0x10, 0x7f, 0x27, 0x9f, 0x20, + 0x7e, 0x2b, 0x00, 0x7e, 0x1b, 0x10, 0xbc, 0x01, 0x78, 0x16, 0x0b, 0x2c, 0x0b, 0x1c, 0xa5, 0xdb, + 0xef, 0x7c, 0xb6, 0x20, 0xe0, 0x03, 0x63, 0x90, 0x30, 0x4d, 0x77, 0x78, 0x93, 0xc2, 0xd7, 0x22, + 0xd2, 0xd7, 0x22, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x04, 0x02, 0x04, 0x00, 0x02, 0x01, + 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x04, 0x00, 0x08, 0x10, 0x02, 0x10, 0x04, 0x02, 0x08, 0x00, 0x01, 0x01, 0x08, 0x7e, 0x18, 0x7f, + 0xbd, 0x7a, 0x1c, 0x00, 0xff, 0x0b, 0x1a, 0x00, 0xbe, 0x10, 0x14, 0x38, 0x1a, 0x0a, 0x51, 0x23, + 0x7e, 0x18, 0x09, 0x76, 0x7a, 0x1c, 0x00, 0xff, 0x2d, 0x35, 0x0b, 0x1a, 0x50, 0x60, 0x08, 0xa5, + 0xb8, 0x02, 0x03, 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, 0x7e, 0xe8, 0x7f, 0xbf, 0x7a, 0xec, 0x00, + 0xff, 0xe0, 0xf5, 0x22, 0x54, 0xc0, 0x68, 0x16, 0x7e, 0xe8, 0x7f, 0xbe, 0x7a, 0xec, 0x00, 0xff, + 0xe0, 0x60, 0x0c, 0x12, 0x09, 0xa0, 0xf5, 0x09, 0x7a, 0xa1, 0x20, 0x02, 0x0f, 0x0a, 0x22, 0xc2, + 0x95, 0xd2, 0x94, 0x12, 0x19, 0xfb, 0x53, 0x90, 0xcf, 0x12, 0x19, 0xfb, 0x80, 0xf1, 0x0d, 0x0a, + 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0d, + 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, + 0x45, 0x64, 0x67, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x34, 0x20, 0x2d, 0x20, 0x48, 0x61, 0x72, + 0x64, 0x77, 0x61, 0x72, 0x65, 0x20, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x2c, 0x20, 0x52, 0x65, 0x76, 0x20, 0x31, 0x2e, 0x30, 0x30, 0x3b, 0x20, 0x43, 0x6f, 0x70, + 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x31, 0x39, 0x39, 0x38, 0x20, 0x49, 0x6e, 0x73, 0x69, + 0x64, 0x65, 0x20, 0x4f, 0x75, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x0d, + 0x0a, 0x00, 0x50, 0x61, 0x73, 0x73, 0x00, 0x46, 0x41, 0x49, 0x4c, 0x20, 0x21, 0x21, 0x00, 0x50, + 0x61, 0x73, 0x73, 0x20, 0x20, 0x20, 0x20, 0x00, 0x46, 0x41, 0x49, 0x4c, 0x20, 0x21, 0x21, 0x20, + 0x00, 0x0d, 0x0a, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x20, 0x52, 0x61, 0x6d, 0x3a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x61, 0x6d, 0x20, 0x54, 0x65, 0x73, 0x74, 0x3a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x62, + 0x69, 0x74, 0x20, 0x30, 0x2d, 0x31, 0x34, 0x20, 0x74, 0x65, 0x73, 0x74, 0x3a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x57, 0x72, 0x6f, 0x74, 0x65, 0x20, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x30, 0x30, 0x3a, 0x00, 0x20, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x20, 0x00, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x72, 0x65, 0x61, 0x64, 0x3a, 0x20, 0x00, 0x0d, 0x0a, 0x4f, 0x6e, 0x65, 0x20, 0x6f, 0x72, 0x20, + 0x62, 0x6f, 0x74, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x62, 0x69, + 0x74, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x0d, 0x0a, 0x74, 0x6f, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x00, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x00, 0x0d, 0x0a, 0x44, 0x65, + 0x74, 0x65, 0x63, 0x74, 0x20, 0x55, 0x61, 0x72, 0x74, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, + 0x53, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x20, 0x50, 0x61, 0x64, 0x2c, 0x46, 0x69, 0x46, 0x6f, + 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x26, 0x20, 0x52, 0x53, 0x54, 0x3a, 0x20, 0x00, + 0x0d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x55, 0x61, 0x72, 0x74, 0x20, 0x54, 0x65, 0x73, 0x74, 0x73, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x50, 0x6f, 0x72, 0x74, 0x31, 0x20, 0x20, 0x20, 0x50, 0x6f, 0x72, 0x74, + 0x32, 0x20, 0x20, 0x20, 0x50, 0x6f, 0x72, 0x74, 0x33, 0x20, 0x20, 0x20, 0x50, 0x6f, 0x72, 0x74, + 0x34, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x00, 0x0d, 0x0a, 0x50, 0x6f, 0x72, 0x74, 0x20, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, + 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x44, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x20, + 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x41, 0x6e, 0x61, 0x6c, + 0x6f, 0x67, 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x3a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, + 0x52, 0x58, 0x44, 0x2c, 0x54, 0x58, 0x44, 0x20, 0x74, 0x6f, 0x20, 0x52, 0x54, 0x53, 0x2c, 0x43, + 0x54, 0x53, 0x2c, 0x52, 0x49, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x58, 0x44, 0x2c, 0x54, 0x58, 0x44, 0x20, 0x74, 0x6f, 0x20, 0x44, + 0x54, 0x52, 0x2c, 0x44, 0x53, 0x52, 0x2c, 0x43, 0x44, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x54, 0x53, 0x5b, 0x43, 0x54, 0x53, 0x2c, + 0x52, 0x49, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x44, 0x54, 0x52, 0x2c, 0x44, 0x53, 0x52, 0x2c, 0x43, + 0x44, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x54, 0x53, 0x5b, + 0x43, 0x54, 0x53, 0x2c, 0x43, 0x44, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x44, 0x53, 0x52, 0x2c, 0x52, + 0x49, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, + 0x44, 0x54, 0x52, 0x5b, 0x44, 0x53, 0x52, 0x2c, 0x43, 0x44, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x52, + 0x54, 0x53, 0x2c, 0x43, 0x54, 0x53, 0x2c, 0x52, 0x49, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, + 0x20, 0x00, 0x0d, 0x0a, 0x44, 0x54, 0x52, 0x20, 0x74, 0x6f, 0x20, 0x43, 0x54, 0x53, 0x2c, 0x43, + 0x44, 0x20, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x54, 0x53, 0x20, 0x74, 0x6f, 0x20, 0x43, + 0x54, 0x53, 0x2c, 0x52, 0x49, 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x3a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x52, 0x54, 0x53, 0x20, + 0x74, 0x6f, 0x20, 0x43, 0x54, 0x53, 0x2c, 0x43, 0x44, 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, + 0x63, 0x6b, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, + 0x44, 0x54, 0x52, 0x20, 0x74, 0x6f, 0x20, 0x44, 0x53, 0x52, 0x2c, 0x43, 0x44, 0x20, 0x4c, 0x6f, + 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x0d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x45, 0x20, 0x52, 0x20, 0x52, 0x20, 0x4f, 0x20, + 0x52, 0x20, 0x21, 0x21, 0x21, 0x2c, 0x20, 0x45, 0x20, 0x52, 0x20, 0x52, 0x20, 0x4f, 0x20, 0x52, + 0x20, 0x21, 0x21, 0x21, 0x20, 0x2c, 0x20, 0x45, 0x20, 0x52, 0x20, 0x52, 0x20, 0x4f, 0x20, 0x52, + 0x20, 0x21, 0x21, 0x21, 0x0d, 0x0a, 0x0a, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x20, 0x61, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x20, 0x6c, 0x6f, 0x6f, 0x70, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x64, 0x65, 0x74, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x00, 0x0d, 0x0a, 0x0a, 0x4e, + 0x6f, 0x20, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x73, 0x20, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x00, 0x43, 0x6f, + 0x70, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, + 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x53, 0x6c, 0x61, 0x76, 0x65, 0x27, + 0x73, 0x20, 0x45, 0x45, 0x70, 0x72, 0x6f, 0x6d, 0x20, 0x2e, 0x2e, 0x2e, 0x00, 0x44, 0x6f, 0x6e, + 0x65, 0x0d, 0x0a, 0x0a, 0x2d, 0x3e, 0x20, 0x54, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x74, + 0x20, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x20, 0x63, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x73, + 0x74, 0x61, 0x6e, 0x64, 0x61, 0x6c, 0x6f, 0x6e, 0x65, 0x20, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x00, 0xc2, 0xaf, 0xc2, 0x09, 0xc2, 0x0a, 0x75, 0x90, 0x0d, + 0x20, 0x17, 0x02, 0xd2, 0xb5, 0x43, 0x90, 0x30, 0x6c, 0x00, 0x7e, 0x10, 0x03, 0x12, 0x0f, 0x38, + 0x7e, 0x68, 0x0a, 0x01, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x0b, 0x00, 0x30, 0xb4, 0x02, + 0x80, 0x24, 0x02, 0x1b, 0x3c, 0x20, 0x09, 0x1d, 0xc2, 0x94, 0xd2, 0x95, 0x12, 0x19, 0xfb, 0x53, + 0x90, 0xcf, 0x12, 0x19, 0xfb, 0xc2, 0x95, 0xd2, 0x94, 0x12, 0x19, 0xfb, 0xa5, 0xd9, 0xe6, 0x43, + 0x90, 0x30, 0x12, 0x19, 0xfb, 0x22, 0x7e, 0x68, 0x0a, 0x94, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, + 0x93, 0x7e, 0xe4, 0x10, 0x00, 0x7e, 0x40, 0x55, 0x7a, 0xe9, 0x40, 0x0b, 0xe4, 0x7e, 0x50, 0xaa, + 0x7a, 0xe9, 0x50, 0x1b, 0xe4, 0xbe, 0xe9, 0x40, 0x68, 0x19, 0x7e, 0x68, 0x0a, 0x7a, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x13, 0x7a, 0xe9, 0x40, 0x7e, 0xe9, + 0x10, 0x80, 0xf8, 0x7e, 0x68, 0x0a, 0x75, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x0b, 0x00, + 0x7e, 0x68, 0x0a, 0xd8, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x78, 0x00, 0x00, 0x7e, + 0x70, 0x0e, 0x7e, 0xa4, 0xff, 0xff, 0x7e, 0xb4, 0xbf, 0xff, 0x7d, 0xcb, 0x0e, 0xc4, 0x7d, 0xdc, + 0x5d, 0xdb, 0x6c, 0xbb, 0x7d, 0xfa, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x0b, 0xb0, 0x7d, + 0xfb, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x0b, 0xb0, 0x7d, 0xfc, 0x5e, 0xf4, 0x7f, 0xff, + 0x7a, 0x7b, 0xb0, 0x0b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x6c, 0xbb, + 0x7d, 0xfa, 0x5e, 0xf4, 0x7f, 0xff, 0xbe, 0x7b, 0xb0, 0x78, 0x41, 0x0b, 0xb0, 0x7d, 0xfb, 0x5e, + 0xf4, 0x7f, 0xff, 0xbe, 0x7b, 0xb0, 0x78, 0x34, 0x0b, 0xb0, 0x7d, 0xfc, 0x5e, 0xf4, 0x7f, 0xff, + 0xbe, 0x7b, 0xb0, 0x78, 0x27, 0x0b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0xbe, 0x7b, 0xb0, + 0x78, 0x1a, 0x0b, 0xb0, 0xbe, 0xc4, 0xff, 0xfe, 0x78, 0x92, 0x0e, 0xb4, 0xa5, 0xdf, 0x8b, 0x7e, + 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x77, 0xca, 0x5b, 0xca, 0x6b, + 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x68, 0x0b, 0x2a, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x0a, 0x47, 0x12, 0x1a, 0xc9, 0x7e, 0x68, 0x0b, 0x79, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x6c, 0x77, 0xda, 0x6b, 0xca, 0x6b, 0x0b, 0x70, 0x0e, 0xc4, + 0xbe, 0xc4, 0xff, 0xff, 0x78, 0xf6, 0x1b, 0x70, 0x0a, 0x47, 0x12, 0x1a, 0xc9, 0x12, 0x1a, 0x08, + 0x30, 0x09, 0x30, 0xda, 0x6b, 0xda, 0x5b, 0x6c, 0xbb, 0x7e, 0x78, 0x00, 0x00, 0x7d, 0xfa, 0x5e, + 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x7d, 0xfb, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x7d, + 0xfc, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, + 0xb0, 0x80, 0xd4, 0x7e, 0x68, 0x0a, 0xb6, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x30, 0x17, + 0x0e, 0x7e, 0x78, 0x04, 0x20, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x44, 0x7b, 0xe0, 0x80, 0x0c, 0x7e, + 0x78, 0x00, 0x00, 0x7a, 0x7c, 0x00, 0x01, 0x7e, 0x44, 0x80, 0x00, 0x0b, 0x00, 0x7e, 0x40, 0x3a, + 0x7c, 0x54, 0x7f, 0x57, 0x7d, 0x84, 0x6c, 0x66, 0x7a, 0x5b, 0x50, 0x0b, 0x5c, 0x0b, 0x50, 0xa5, + 0xde, 0x02, 0x0b, 0x50, 0x1b, 0x84, 0x78, 0xf0, 0x7c, 0x54, 0x7f, 0x57, 0x7d, 0x84, 0x6c, 0x66, + 0xbe, 0x5b, 0x50, 0x78, 0x1a, 0x0b, 0x5c, 0x0b, 0x50, 0xa5, 0xde, 0x02, 0x0b, 0x50, 0x1b, 0x84, + 0x78, 0xee, 0x7e, 0x68, 0x0a, 0x75, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x4b, 0x7f, + 0x45, 0x7e, 0x68, 0x0a, 0x7a, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x68, 0x0a, 0xfa, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7d, 0x4b, 0x12, 0x1a, 0xc9, 0x7e, 0x68, 0x0b, 0x0f, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x6c, 0x88, 0x7c, 0x95, 0x12, 0x1a, 0xc9, 0x7e, 0x68, + 0x0b, 0x1d, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x4b, 0x90, 0x12, 0x1a, 0xc9, 0x12, + 0x1a, 0x08, 0x30, 0x09, 0x05, 0x7e, 0x4b, 0x90, 0x80, 0xfb, 0x7e, 0x68, 0x0b, 0x7f, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x1a, 0x93, 0x0b, 0x00, 0xd2, 0x92, 0x7e, 0x24, 0x80, 0x00, 0x09, 0xb2, 0x00, + 0x08, 0xbe, 0xb0, 0x01, 0x78, 0x0b, 0x09, 0xb2, 0x00, 0x14, 0xbe, 0xb0, 0x60, 0x78, 0x02, 0x80, + 0x17, 0x7e, 0x68, 0x0a, 0x7a, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, + 0x09, 0x11, 0x09, 0xb2, 0x00, 0x08, 0x80, 0xfa, 0x7e, 0x68, 0x0a, 0x75, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x1a, 0x93, 0x7e, 0x68, 0x0b, 0xa1, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x0b, 0x00, + 0xc2, 0x92, 0x12, 0x19, 0xee, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x1c, + 0x7e, 0xb0, 0x01, 0x19, 0xb2, 0x00, 0x08, 0x09, 0xb2, 0x00, 0x1c, 0xbc, 0xab, 0x78, 0x37, 0x09, + 0xb2, 0x00, 0x08, 0x5e, 0xb0, 0xc0, 0xbe, 0xb0, 0xc0, 0x78, 0x2b, 0x7e, 0xa0, 0xaa, 0x19, 0xa2, + 0x00, 0x1c, 0x6c, 0xbb, 0x19, 0xb2, 0x00, 0x08, 0x09, 0xb2, 0x00, 0x1c, 0xbc, 0xab, 0x78, 0x16, + 0x09, 0xb2, 0x00, 0x08, 0x5e, 0xb0, 0xc0, 0x78, 0x0d, 0x7e, 0x68, 0x0a, 0x75, 0x7a, 0x6c, 0x00, + 0xff, 0x12, 0x1a, 0x93, 0x80, 0x1b, 0x7e, 0x68, 0x0a, 0x7a, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, + 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x0a, 0x19, 0xa2, 0x00, 0x1c, 0x09, 0xb2, 0x00, 0x1c, 0x80, + 0xf6, 0x7e, 0x68, 0x0b, 0xc3, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x68, 0x0c, 0x45, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x7e, 0xb0, + 0x01, 0x19, 0xb2, 0x00, 0x1c, 0x2e, 0x24, 0x01, 0x00, 0x0b, 0xb0, 0xa5, 0xd9, 0xf3, 0x7e, 0x24, + 0x80, 0x00, 0x7e, 0x11, 0x09, 0x7e, 0xb0, 0x01, 0x0b, 0x00, 0x09, 0xa2, 0x00, 0x1c, 0xbc, 0xab, + 0x78, 0x16, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x2e, 0x24, 0x01, + 0x00, 0x0b, 0xb0, 0xa5, 0xd9, 0xe2, 0x80, 0x25, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0xe4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, + 0x09, 0xa2, 0x00, 0x1c, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xf5, 0x80, 0xec, 0x7e, 0x68, 0x0c, + 0x69, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x13, 0x8a, 0x7e, 0x24, 0x80, 0x00, 0x7e, + 0x11, 0x09, 0x0b, 0x00, 0x74, 0x10, 0x19, 0xb2, 0x00, 0x10, 0x12, 0x13, 0x03, 0x2e, 0x24, 0x01, + 0x00, 0xa5, 0xd9, 0xee, 0x7e, 0x68, 0x0c, 0x8d, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0xe4, 0x19, 0xb2, 0x00, 0x10, 0x12, 0x13, 0x03, + 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xef, 0x30, 0x00, 0x03, 0x02, 0x18, 0xb7, 0x02, 0x13, 0xbb, + 0x74, 0x07, 0x19, 0xb2, 0x00, 0x08, 0x12, 0x19, 0xfb, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xc2, 0x0b, 0x7e, 0xb0, 0x55, 0x12, 0x13, + 0x64, 0x7e, 0xb0, 0xaa, 0x12, 0x13, 0x64, 0x7e, 0xb0, 0x00, 0x12, 0x13, 0x64, 0x7e, 0xb0, 0xff, + 0x12, 0x13, 0x64, 0x30, 0x0b, 0x0f, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, + 0x93, 0x12, 0x1a, 0x08, 0x22, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, + 0x22, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x09, 0xa2, 0x00, 0x00, 0xbc, 0xab, 0x78, 0x01, + 0x22, 0x20, 0x09, 0x03, 0xd2, 0x0b, 0x22, 0x12, 0x1a, 0x08, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x19, + 0xee, 0x09, 0xa2, 0x00, 0x00, 0x80, 0xf3, 0xd2, 0x92, 0x12, 0x19, 0xee, 0xc2, 0x92, 0x12, 0x19, + 0xee, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x74, 0x80, 0x19, 0xb2, 0x00, 0x0c, 0x7e, 0x54, + 0x00, 0x02, 0x19, 0xa2, 0x00, 0x04, 0x19, 0xb2, 0x00, 0x00, 0x74, 0x03, 0x19, 0xb2, 0x00, 0x0c, + 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xe1, 0x22, 0x7e, 0x68, 0x0c, 0xb1, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x12, 0x19, 0xee, 0x09, + 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, + 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x0d, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, + 0x93, 0x80, 0x1a, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, + 0x08, 0x30, 0x09, 0x09, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x80, 0xf7, 0x2e, 0x24, 0x01, + 0x00, 0xa5, 0xd9, 0xb6, 0x7e, 0x68, 0x0c, 0xd5, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, + 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x0a, + 0x78, 0x0d, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x1a, 0x7e, + 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x09, + 0x19, 0xa2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x80, 0xf7, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xb6, + 0x30, 0x04, 0x03, 0x02, 0x16, 0x8c, 0x7e, 0x68, 0x0c, 0xf9, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, + 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, + 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, + 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x0a, 0x78, 0x3c, + 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, + 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, + 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x0a, 0x78, 0x14, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x1a, 0x93, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, 0x0a, 0x8b, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0xe6, 0x7e, 0xa0, 0x02, + 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, 0x0d, 0x41, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, + 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x01, + 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, + 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x3c, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, + 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x02, 0x19, 0xa2, + 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x14, 0x7e, 0x68, + 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, + 0x80, 0x20, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, + 0x30, 0x09, 0xe6, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, + 0x80, 0xf1, 0x7e, 0x68, 0x0d, 0x89, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, + 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, + 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x50, 0xbe, 0xb0, 0x50, 0x78, 0x1f, 0x6c, 0xaa, 0x19, 0xa2, + 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x50, 0x78, 0x0d, 0x7e, 0x68, + 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x20, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x0f, 0x7e, 0xa0, 0x02, 0x19, + 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x2e, 0x24, 0x01, 0x00, 0xa5, + 0xd9, 0xa2, 0x7e, 0x68, 0x0d, 0xd1, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, + 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, + 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0xa0, 0xbe, 0xb0, 0xa0, 0x78, 0x1f, + 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0xa0, + 0x78, 0x0d, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x20, 0x7e, + 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x0f, + 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x2e, + 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x02, 0x18, 0x2b, 0x7e, 0x68, 0x0d, 0x1d, 0x7a, 0x6c, 0x00, + 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x6c, 0xaa, 0x19, + 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, + 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, + 0x06, 0x78, 0x3c, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, + 0x18, 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, + 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x06, 0x78, 0x14, 0x7e, 0x68, 0x0a, 0x82, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, + 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0xe6, + 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, + 0x68, 0x0d, 0x65, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, + 0x09, 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, + 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, + 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x09, 0x78, 0x3c, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, + 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, + 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x09, 0x78, + 0x14, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x2e, 0x24, 0x01, 0x00, + 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, + 0x12, 0x1a, 0x08, 0x30, 0x09, 0xe6, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, + 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, 0x0d, 0xad, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, + 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, + 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x90, 0xbe, 0xb0, 0x90, 0x78, 0x1f, 0x6c, + 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x90, 0x78, + 0x0d, 0x7e, 0x68, 0x0a, 0x82, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x80, 0x20, 0x7e, 0x68, + 0x0a, 0x8b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1a, 0x08, 0x30, 0x09, 0x0f, 0x7e, + 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x2e, 0x24, + 0x01, 0x00, 0xa5, 0xd9, 0xa2, 0x02, 0x18, 0xb7, 0x30, 0x17, 0x03, 0x02, 0x19, 0x3b, 0xc2, 0x8a, + 0x12, 0x19, 0x22, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x04, + 0x12, 0x19, 0xee, 0x0b, 0x00, 0x7e, 0xa0, 0x08, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x20, + 0x8b, 0x3e, 0x20, 0x89, 0x3b, 0x7e, 0xa0, 0x08, 0x19, 0xa2, 0x00, 0x04, 0x09, 0xa2, 0x00, 0x10, + 0x4e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x30, 0x8b, 0x23, 0x30, 0x89, 0x20, + 0x09, 0xa2, 0x00, 0x10, 0x5e, 0xa0, 0xfd, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, 0x7e, 0xa0, + 0x00, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x19, 0xee, 0x20, 0x8b, 0x05, 0x20, 0x89, 0x02, 0x80, 0x1a, + 0x12, 0x1a, 0x08, 0x30, 0x09, 0x14, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x5e, + 0xa0, 0xfd, 0x19, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x80, 0xec, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, + 0x89, 0x02, 0x19, 0x3b, 0x20, 0x17, 0xfa, 0x12, 0x13, 0x8a, 0x12, 0x19, 0x22, 0x7e, 0x24, 0x80, + 0x00, 0x7e, 0x11, 0x09, 0x0b, 0x00, 0x20, 0x89, 0x26, 0x7e, 0xa0, 0xff, 0x19, 0xa2, 0x00, 0x04, + 0x12, 0x19, 0xee, 0x7e, 0xb0, 0x55, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x30, 0x89, 0x0f, + 0x7e, 0xa0, 0x00, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x19, 0xee, 0x20, 0x89, 0x02, 0x80, 0x26, 0x12, + 0x1a, 0x08, 0x30, 0x09, 0x20, 0x7e, 0xa0, 0xff, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x19, 0xee, 0x7e, + 0xb0, 0x55, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x19, 0xee, 0x7e, 0xa0, 0x00, 0x19, 0xa2, 0x00, 0x04, + 0x12, 0x19, 0xee, 0x80, 0xe0, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xa8, 0x02, 0x19, 0x3b, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0x11, 0x09, 0x7e, 0xa0, 0x08, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x19, 0xee, + 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xef, 0x22, 0x30, 0x0a, 0x19, 0x7e, 0x68, 0x0d, 0xf5, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0xd2, 0x09, 0x12, 0x19, 0xee, 0x12, 0x19, 0xee, 0x12, 0x19, + 0xee, 0x02, 0x0f, 0x10, 0x30, 0x17, 0x1c, 0x7e, 0x68, 0x0e, 0x6f, 0x7a, 0x6c, 0x00, 0xff, 0x12, + 0x1a, 0x93, 0x7e, 0x68, 0x0e, 0x91, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x1a, 0x93, 0x12, 0x1b, 0x3c, + 0x02, 0x19, 0xe6, 0x0b, 0x00, 0x7e, 0x78, 0x19, 0xa0, 0x7a, 0x7c, 0x00, 0xff, 0x7f, 0x67, 0x7a, + 0x6c, 0x00, 0x00, 0x7e, 0x70, 0x3e, 0x7e, 0x7b, 0xb0, 0x7a, 0x6b, 0xb0, 0x0b, 0x7c, 0x0b, 0x6c, + 0xa5, 0xdf, 0xf3, 0x7e, 0x78, 0x19, 0xa0, 0x7a, 0x7c, 0x00, 0x00, 0x89, 0x78, 0x7e, 0x78, 0x00, + 0x00, 0x7a, 0x7c, 0x00, 0xfe, 0x7e, 0x68, 0x7f, 0xbf, 0x7a, 0x6c, 0x00, 0xfe, 0x74, 0xaa, 0x39, + 0xb7, 0x55, 0x55, 0x74, 0x55, 0x39, 0xb7, 0x2a, 0xaa, 0x74, 0xa0, 0x39, 0xb7, 0x55, 0x55, 0x6c, + 0x99, 0x7a, 0x6b, 0x90, 0x7e, 0x54, 0x27, 0x10, 0x7e, 0x6b, 0x80, 0xbc, 0x89, 0x68, 0x08, 0x1b, + 0x54, 0x78, 0xf5, 0x8a, 0xff, 0x19, 0xde, 0x8a, 0xff, 0x19, 0xe6, 0x12, 0x1a, 0x08, 0x7e, 0x6b, + 0x80, 0x80, 0xfb, 0x7e, 0x10, 0xff, 0x12, 0x1a, 0x85, 0x80, 0xf8, 0xca, 0xf9, 0x7e, 0xf4, 0x00, + 0xff, 0x1b, 0xf4, 0x78, 0xfc, 0xda, 0xf9, 0x22, 0xca, 0xf9, 0x7e, 0xf4, 0x00, 0x00, 0x1b, 0xf4, + 0x78, 0xfc, 0xda, 0xf9, 0x22, 0x20, 0x09, 0x19, 0xd2, 0x0a, 0x12, 0x19, 0xfb, 0xc2, 0x95, 0xd2, + 0x94, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x43, 0x90, 0x30, + 0x22, 0xca, 0x0b, 0x7e, 0x10, 0x03, 0x7c, 0x30, 0x6c, 0x22, 0x0b, 0x20, 0x9e, 0x30, 0x0a, 0x50, + 0xf9, 0x2e, 0x30, 0x0b, 0x1b, 0x20, 0x68, 0x18, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x53, 0x90, + 0xcf, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x43, 0x90, 0x30, 0xa5, 0xda, 0xe8, + 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x1b, 0x30, 0x68, 0x19, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, + 0xc2, 0x95, 0xd2, 0x94, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x12, 0x19, 0xfb, 0x43, 0x90, 0x30, + 0xa5, 0xdb, 0xe7, 0x7e, 0x20, 0x0a, 0x12, 0x19, 0xfb, 0xa5, 0xda, 0xfa, 0xa5, 0xd9, 0xa7, 0xda, + 0x0b, 0x22, 0x20, 0x09, 0x0a, 0x12, 0x19, 0xfb, 0xb2, 0x94, 0x12, 0x19, 0xfb, 0xb2, 0x94, 0x22, + 0x30, 0x17, 0x32, 0x20, 0x09, 0x2f, 0xca, 0x2b, 0xca, 0x7b, 0x7e, 0x78, 0x80, 0x00, 0x7a, 0x7c, + 0x00, 0xfe, 0x12, 0x1b, 0x1c, 0x7e, 0x6b, 0xa0, 0x5c, 0xaa, 0x68, 0x10, 0x29, 0xb7, 0x00, 0x14, + 0x54, 0x60, 0x68, 0xf8, 0x39, 0xa7, 0x00, 0x00, 0x0b, 0x6c, 0x80, 0xe9, 0x12, 0x19, 0xee, 0xd2, + 0xb5, 0xda, 0x7b, 0xda, 0x2b, 0x22, 0x12, 0x1a, 0xd4, 0x7e, 0x68, 0x00, 0x0b, 0x12, 0x1a, 0x93, + 0x22, 0xca, 0x59, 0xca, 0x5b, 0x7e, 0xb4, 0x00, 0x0b, 0x7c, 0xb8, 0xc4, 0x12, 0x1b, 0x04, 0x7c, + 0xb8, 0x12, 0x1b, 0x04, 0x7c, 0xb9, 0xc4, 0x12, 0x1b, 0x04, 0x7c, 0xb9, 0x12, 0x1b, 0x04, 0x7e, + 0xb0, 0x68, 0x7a, 0xb9, 0xb0, 0x0b, 0xb4, 0x6c, 0xbb, 0x7a, 0xb9, 0xb0, 0xda, 0x59, 0xda, 0x5b, + 0x22, 0x5e, 0xb0, 0x0f, 0x7c, 0xab, 0x9e, 0xa0, 0x0a, 0x40, 0x05, 0x2e, 0xb0, 0x37, 0x80, 0x03, + 0x2e, 0xb0, 0x30, 0x7a, 0xb9, 0xb0, 0x0b, 0xb4, 0x22, 0xc2, 0xb5, 0xc2, 0x92, 0x12, 0x19, 0xee, + 0x74, 0x80, 0x39, 0xb7, 0x00, 0x0c, 0x7e, 0x54, 0x00, 0x06, 0x39, 0xa7, 0x00, 0x04, 0x39, 0xb7, + 0x00, 0x00, 0x74, 0x03, 0x39, 0xb7, 0x00, 0x0c, 0x22, 0x7e, 0x78, 0x00, 0x00, 0x7a, 0x7c, 0x00, + 0xff, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0x01, 0x7f, 0x65, 0x7e, 0x74, 0x20, 0x00, 0x12, + 0x08, 0xd6, 0x40, 0x54, 0x7e, 0x78, 0x7c, 0x00, 0x7a, 0x7c, 0x00, 0xff, 0x7e, 0x58, 0x00, 0x00, + 0x7a, 0x5c, 0x00, 0x01, 0x7e, 0x68, 0x7c, 0x00, 0x7a, 0x6c, 0x00, 0x01, 0x7e, 0x74, 0x04, 0x00, + 0x12, 0x08, 0xd6, 0x40, 0x33, 0x74, 0x80, 0x12, 0x1b, 0xb1, 0x40, 0x2c, 0x53, 0x90, 0xcf, 0xd2, + 0x08, 0x7e, 0x04, 0x00, 0x08, 0x7e, 0x14, 0x00, 0x00, 0x84, 0xa5, 0xdb, 0xfc, 0xa5, 0xda, 0xf9, + 0xa5, 0xd9, 0xf6, 0x74, 0x40, 0x12, 0x1b, 0xb1, 0x40, 0x0e, 0x7e, 0x68, 0x0e, 0xc0, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x1a, 0x93, 0x02, 0x19, 0xe6, 0xc2, 0x95, 0xd2, 0x94, 0x80, 0xfe, 0xf5, 0x0a, + 0x7e, 0x78, 0x00, 0x0a, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x68, 0x7f, 0xbf, 0x7a, 0x6c, 0x00, 0x01, + 0x7e, 0x74, 0x00, 0x01, 0x02, 0x08, 0xd6, +}; + +static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { + 1, 12, 2 }; // Major, Minor, Build + +#undef IMAGE_VERSION_NAME + +#undef IMAGE_ARRAY_NAME + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_fw_boot2.h linux.20p9/drivers/usb/serial/io_fw_boot2.h --- linux.vanilla/drivers/usb/serial/io_fw_boot2.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_fw_boot2.h Wed Jul 4 16:03:58 2001 @@ -0,0 +1,548 @@ +//************************************************************** +//* Edgeport/4 Binary Image +//* Generated by HEX2C v1.06 +//* Copyright(c) 1998 Inside Out Networks, All rights reserved. +//* This program is free software; you can redistribute it and/or modify +//* it under the terms of the GNU General Public License as published by +//* the Free Software Foundation; either version 2 of the License, or +//* (at your option) any later version. +//************************************************************** + + +//Image structure definition +#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) +#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD + typedef struct _EDGE_FIRMWARE_IMAGE_RECORD + { + unsigned short ExtAddr; + unsigned short Addr; + unsigned short Len; + unsigned char Data[0]; + } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + + typedef struct _EDGE_FIRMWARE_VERSION_INFO + { + unsigned char MajorVersion; + unsigned char MinorVersion; + unsigned short BuildNumber; + } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + +#endif + +#if !defined(IMAGE_ARRAY_NAME) +#define IMAGE_ARRAY_NAME FirmwareImage +#define IMAGE_VERSION_NAME FirmwareImageVersion +#endif + +static unsigned char IMAGE_ARRAY_NAME[] = { + +// Segment #1, Start Address 00ff0000, Length 6 +0xff,0x00,0x00,0x00,0x06,0x00, + 0x02, 0x00, 0x80, 0x02, 0x00, 0x03, + +// Segment #2, Start Address 00ff000b, Length 3 +0xff,0x00,0x0b,0x00,0x03,0x00, + 0x02, 0x00, 0x0b, + +// Segment #3, Start Address 00ff0013, Length 3 +0xff,0x00,0x13,0x00,0x03,0x00, + 0x02, 0x02, 0x56, + +// Segment #4, Start Address 00ff001b, Length 3 +0xff,0x00,0x1b,0x00,0x03,0x00, + 0x02, 0x00, 0x1b, + +// Segment #5, Start Address 00ff0023, Length 3 +0xff,0x00,0x23,0x00,0x03,0x00, + 0x02, 0x00, 0x23, + +// Segment #6, Start Address 00ff002b, Length 3 +0xff,0x00,0x2b,0x00,0x03,0x00, + 0x02, 0x00, 0x2b, + +// Segment #7, Start Address 00ff0033, Length 3 +0xff,0x00,0x33,0x00,0x03,0x00, + 0x02, 0x00, 0x33, + +// Segment #8, Start Address 00ff003b, Length 3 +0xff,0x00,0x3b,0x00,0x03,0x00, + 0x02, 0x00, 0x3b, + +// Segment #9, Start Address 00ff0043, Length 3 +0xff,0x00,0x43,0x00,0x03,0x00, + 0x02, 0x00, 0x43, + +// Segment #10, Start Address 00ff004b, Length 3 +0xff,0x00,0x4b,0x00,0x03,0x00, + 0x02, 0x00, 0x4b, + +// Segment #11, Start Address 00ff0053, Length 3 +0xff,0x00,0x53,0x00,0x03,0x00, + 0x02, 0x01, 0xf5, + +// Segment #12, Start Address 00ff007b, Length 3 +0xff,0x00,0x7b,0x00,0x03,0x00, + 0x02, 0x00, 0x7b, + +// Segment #13, Start Address 00ff0080, Length 534 +0xff,0x00,0x80,0x00,0x16,0x02, + 0x7e, 0xb3, 0x91, 0x01, 0x20, 0xe3, 0x0c, 0x7e, 0xb3, 0x3f, 0xf2, 0x54, 0xfe, 0x7a, 0xb3, 0x3f, + 0xf2, 0x80, 0x0a, 0x7e, 0xb3, 0x3f, 0xf2, 0x44, 0x01, 0x7a, 0xb3, 0x3f, 0xf2, 0x74, 0x00, 0x7a, + 0xb3, 0x91, 0x00, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x7e, 0xf8, 0x00, 0x24, 0x7e, 0x00, 0x01, + 0x7e, 0x10, 0x00, 0x12, 0x09, 0xd0, 0x69, 0x20, 0x00, 0x0a, 0x5e, 0x40, 0x1f, 0xbe, 0x24, 0x00, + 0x00, 0x78, 0x09, 0x7e, 0x00, 0x03, 0x7a, 0x03, 0x90, 0x00, 0x80, 0x07, 0x7e, 0x00, 0x02, 0x7a, + 0x03, 0x90, 0x00, 0x75, 0xb0, 0xdf, 0x7e, 0x00, 0x01, 0x7a, 0x03, 0x94, 0x00, 0x7a, 0x03, 0x01, + 0x24, 0x7e, 0x00, 0x01, 0x7a, 0x03, 0x93, 0x00, 0x7e, 0x00, 0x00, 0xa5, 0xd8, 0xfd, 0x75, 0xa8, + 0x00, 0x75, 0xb1, 0x00, 0xca, 0x29, 0x12, 0x0c, 0x66, 0x12, 0x0c, 0x37, 0xf5, 0x21, 0x7a, 0xa1, + 0x20, 0x20, 0x09, 0x08, 0x20, 0x0a, 0x0a, 0x7e, 0xb0, 0x0c, 0x80, 0x08, 0x7e, 0xb0, 0x00, 0x80, + 0x03, 0x7e, 0xb0, 0x08, 0x7a, 0xb3, 0x92, 0x00, 0x12, 0x02, 0x96, 0xda, 0x29, 0x74, 0x10, 0x7a, + 0xb3, 0x91, 0x01, 0x7e, 0x20, 0x04, 0x7c, 0xb2, 0xc2, 0xd7, 0x13, 0x13, 0x13, 0x13, 0x7a, 0xb3, + 0x91, 0x00, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x10, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x74, 0x02, + 0x7a, 0xb3, 0x91, 0x12, 0xa5, 0xda, 0xdf, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x1c, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x07, 0x74, + 0x34, 0x7a, 0xb3, 0x91, 0x13, 0x74, 0x3f, 0x7a, 0xb3, 0x91, 0x14, 0x74, 0x02, 0x7a, 0xb3, 0x91, + 0x06, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x07, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x44, 0x7a, + 0xb3, 0x91, 0x07, 0x74, 0xef, 0x7a, 0xb3, 0x91, 0x04, 0x74, 0x07, 0x7a, 0xb3, 0x91, 0x06, 0x7e, + 0xb3, 0x91, 0x07, 0x7a, 0xb1, 0x0a, 0x75, 0x09, 0x01, 0xd2, 0xaa, 0xd2, 0xaf, 0xe4, 0x7e, 0x60, + 0x02, 0x4d, 0x22, 0x78, 0x03, 0x7e, 0x60, 0x03, 0x7c, 0x76, 0x7e, 0x04, 0x28, 0x00, 0x8d, 0xef, + 0x1b, 0x04, 0x78, 0xfa, 0x04, 0x7e, 0x20, 0x07, 0x7a, 0x23, 0x91, 0x06, 0x7e, 0x23, 0x91, 0x07, + 0x7e, 0x31, 0x0a, 0xbc, 0x32, 0x68, 0x22, 0x7a, 0x21, 0x0a, 0x7e, 0x21, 0x09, 0x68, 0x17, 0xca, + 0xb8, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0xb3, 0x91, 0x07, 0x44, 0x02, 0x7a, 0xb3, 0x91, + 0x07, 0xda, 0xb8, 0x75, 0x09, 0x00, 0x30, 0xe0, 0xc1, 0x6c, 0x67, 0x7a, 0x63, 0x90, 0x00, 0x80, + 0xb9, 0xbe, 0xb0, 0x02, 0x22, 0xc0, 0xd0, 0x75, 0x08, 0xfe, 0x12, 0x0a, 0xc0, 0x74, 0x02, 0x7a, + 0xb3, 0x91, 0x06, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x07, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x74, + 0x00, 0x7a, 0xb3, 0x91, 0x07, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x04, 0x7e, 0xb3, 0x3f, 0xf2, 0x30, + 0xe0, 0x08, 0x74, 0x18, 0x7a, 0xb3, 0x91, 0x01, 0x80, 0x06, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x01, + 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x04, 0x02, 0x02, 0x36, 0x75, 0x08, 0xff, 0x12, 0x0a, 0xc0, 0x74, + 0x01, 0x7a, 0xb3, 0x91, 0x04, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0xb3, 0x91, 0x07, 0x54, + 0xfc, 0x7a, 0xb3, 0x91, 0x07, 0x32, 0xca, 0xb8, 0x75, 0x08, 0x02, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, + 0x91, 0x03, 0x20, 0xe5, 0x08, 0x30, 0xe0, 0x2b, 0x12, 0x02, 0x9e, 0x80, 0xf1, 0x7e, 0xb3, 0x91, + 0x04, 0x30, 0xe0, 0x05, 0xda, 0xb8, 0x02, 0x02, 0x39, 0x30, 0xe1, 0x05, 0xda, 0xb8, 0x02, 0x01, + 0xf5, 0x30, 0xe6, 0x05, 0x12, 0x04, 0x03, 0x80, 0xd5, 0x30, 0xe2, 0x05, 0xda, 0xb8, 0x02, 0x00, + 0x80, 0x80, 0xcb, 0xda, 0xb8, 0x32, + +// Segment #14, EXCLUDED Start Address 00ff31d7, Length 1 + + +// Segment #15, Start Address 00ff0296, Length 2090 +0xff,0x00,0x96,0x02,0x2a,0x08, + 0xe4, 0x7a, 0xb3, 0x3f, 0xf1, 0x02, 0x03, 0x41, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0xca, 0x3b, + 0xca, 0x4b, 0xca, 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, + 0x7e, 0xb3, 0x01, 0x2e, 0xb4, 0x00, 0x02, 0x80, 0x1c, 0xb4, 0x01, 0x19, 0x7e, 0xb3, 0x91, 0x14, + 0x54, 0x14, 0x68, 0x05, 0x12, 0x03, 0x05, 0x80, 0x23, 0x7e, 0xb3, 0x91, 0x14, 0x30, 0xe5, 0x1c, + 0x12, 0x04, 0x43, 0x80, 0x17, 0x7e, 0xb3, 0x91, 0x14, 0x30, 0xe5, 0x05, 0x12, 0x04, 0x43, 0x80, + 0x0b, 0x7e, 0xb3, 0x91, 0x14, 0x54, 0x14, 0x68, 0x03, 0x12, 0x03, 0x05, 0xda, 0xeb, 0xda, 0x7b, + 0xda, 0x6b, 0xda, 0x5b, 0xda, 0x4b, 0xda, 0x3b, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x20, + 0xe4, 0x19, 0x75, 0x08, 0x0a, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, 0x2d, 0x70, 0x0a, 0x7e, 0xb3, + 0x01, 0x2e, 0xb4, 0x01, 0x1f, 0x02, 0x03, 0x9d, 0x02, 0x09, 0x8b, 0x75, 0x08, 0x0b, 0x12, 0x0a, + 0xc0, 0x74, 0x14, 0x7a, 0xb3, 0x91, 0x14, 0x7e, 0xb3, 0x01, 0x2e, 0xb4, 0x02, 0x0c, 0x12, 0x03, + 0x4d, 0x02, 0x03, 0x41, 0x74, 0x04, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0x7e, 0x00, 0x00, 0x7a, 0x03, + 0x01, 0x2e, 0x7a, 0x03, 0x01, 0x2f, 0x22, 0x7e, 0xb3, 0x01, 0x25, 0x54, 0x60, 0x60, 0x05, 0xb4, + 0x40, 0x1e, 0x80, 0x1c, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x05, 0x15, 0x75, 0x08, 0x71, 0x12, 0x0a, + 0xc0, 0x7e, 0xb3, 0x01, 0x28, 0x7e, 0xa0, 0x01, 0x7a, 0xa3, 0x91, 0x06, 0x7a, 0xb3, 0x91, 0x07, + 0x22, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x12, 0x22, 0xbe, 0x57, + 0x01, 0x2b, 0x28, 0x04, 0x7e, 0x57, 0x01, 0x2b, 0x7a, 0x0f, 0x01, 0x31, 0x7a, 0x57, 0x01, 0x35, + 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x12, 0x22, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, + 0x1a, 0x70, 0x53, 0x7e, 0xb3, 0x91, 0x14, 0x20, 0xe4, 0x4c, 0x7e, 0xef, 0x01, 0x31, 0x7e, 0xf7, + 0x01, 0x35, 0x7e, 0x07, 0x01, 0x35, 0x4d, 0x00, 0x68, 0x21, 0x7e, 0x00, 0x00, 0xe0, 0x7a, 0xb3, + 0x91, 0x17, 0xa3, 0xa5, 0x08, 0x1b, 0xf4, 0x68, 0x06, 0xa5, 0xb8, 0x10, 0xf0, 0x80, 0x19, 0x7e, + 0xb0, 0x00, 0x7a, 0xb3, 0x01, 0x2e, 0xbe, 0x00, 0x10, 0x68, 0x0d, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, + 0x01, 0x2e, 0x74, 0x80, 0x7a, 0xb3, 0x91, 0x1e, 0x7a, 0xef, 0x01, 0x31, 0x7a, 0xf7, 0x01, 0x35, + 0x75, 0x08, 0x06, 0x12, 0x0a, 0xc0, 0x74, 0x04, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0xca, 0x0b, 0xca, + 0x1b, 0xca, 0x2b, 0xca, 0x3b, 0xca, 0x4b, 0xca, 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0x75, + 0x08, 0x03, 0x12, 0x0a, 0xc0, 0x74, 0x00, 0x7a, 0xb3, 0x01, 0x2d, 0x74, 0x00, 0x7a, 0xb3, 0x91, + 0x00, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x12, 0x04, 0xb2, 0xda, 0xeb, 0xda, 0x7b, 0xda, 0x6b, + 0xda, 0x5b, 0xda, 0x4b, 0xda, 0x3b, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x75, 0x08, 0x03, + 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, 0x2f, 0xb4, 0x02, 0x11, 0x74, 0x00, 0x7a, 0xb3, 0x01, 0x2f, + 0x7a, 0xb3, 0x01, 0x2e, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0xb4, 0x01, 0x46, 0x7e, 0xb3, + 0x91, 0x04, 0x20, 0xe6, 0x42, 0x7e, 0x23, 0x91, 0x1a, 0x7c, 0x32, 0x7e, 0x13, 0x01, 0x30, 0x2c, + 0x21, 0x7a, 0x23, 0x01, 0x30, 0x7e, 0x00, 0x00, 0x2e, 0x04, 0x01, 0x37, 0x7e, 0xb3, 0x91, 0x16, + 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0xa5, 0xdb, 0xf4, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x14, 0x75, 0x08, + 0x70, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, 0x30, 0x7e, 0xa3, 0x01, 0x2c, 0xbc, 0xab, 0x78, 0x03, + 0x12, 0x05, 0x52, 0x22, 0x02, 0x09, 0x8b, 0xda, 0x59, 0x02, 0x04, 0x15, 0x74, 0xe0, 0x7a, 0xb3, + 0x91, 0x00, 0x7e, 0x03, 0x91, 0x10, 0x7e, 0x13, 0x91, 0x11, 0x7e, 0x33, 0x91, 0x12, 0x7e, 0x23, + 0x91, 0x13, 0x7e, 0x53, 0x91, 0x14, 0x7e, 0x43, 0x91, 0x15, 0x7e, 0x73, 0x91, 0x16, 0x7e, 0x63, + 0x91, 0x17, 0x7a, 0x0f, 0x01, 0x25, 0x7a, 0x1f, 0x01, 0x29, 0x75, 0x08, 0x04, 0x12, 0x0a, 0xc0, + 0x7a, 0x01, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x11, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x21, 0x08, 0x12, + 0x0a, 0xc0, 0x7a, 0x31, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x41, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x51, + 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x61, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x71, 0x08, 0x12, 0x0a, 0xc0, + 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x04, 0x12, 0x05, 0x26, 0x22, + 0x6d, 0x00, 0x7e, 0x14, 0x01, 0x02, 0x7a, 0x07, 0x01, 0x35, 0x7a, 0x03, 0x01, 0x30, 0x7e, 0xb3, + 0x01, 0x25, 0x20, 0xe7, 0x0f, 0x7a, 0x23, 0x01, 0x2f, 0x7a, 0x33, 0x01, 0x2e, 0xbe, 0x07, 0x01, + 0x2b, 0x68, 0x09, 0x22, 0x7a, 0x33, 0x01, 0x2f, 0x7a, 0x23, 0x01, 0x2e, 0x7e, 0xb3, 0x01, 0x25, + 0x54, 0xe3, 0x23, 0x23, 0x30, 0xe0, 0x02, 0xd2, 0xe5, 0x30, 0xe7, 0x02, 0xd2, 0xe4, 0x30, 0xe5, + 0x06, 0x30, 0xe4, 0x03, 0x02, 0x09, 0x8b, 0x54, 0x3e, 0xf5, 0xf0, 0x03, 0x54, 0x1f, 0xc3, 0x25, + 0xf0, 0x90, 0x05, 0x7e, 0x75, 0x84, 0xff, 0x73, 0x02, 0x07, 0x39, 0x02, 0x05, 0xc6, 0x02, 0x07, + 0xd2, 0x02, 0x07, 0xed, 0x02, 0x06, 0xd0, 0x02, 0x06, 0x5b, 0x02, 0x08, 0x1e, 0x02, 0x08, 0x1e, + 0x02, 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, + 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, 0x08, 0x21, 0x02, 0x08, 0x27, 0x02, 0x08, 0xf9, 0x02, 0x08, + 0x24, 0x02, 0x08, 0x24, 0x02, 0x08, 0x24, 0x02, 0x08, 0x24, 0x02, 0x08, 0x24, 0x02, 0x08, 0x24, + 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x7e, 0xb3, 0x01, 0x26, + 0xb4, 0x06, 0x2a, 0x7e, 0xb3, 0x01, 0x27, 0x60, 0x79, 0x7c, 0x0b, 0x7e, 0x13, 0x01, 0x28, 0x7e, + 0x17, 0x01, 0x29, 0x75, 0x08, 0x72, 0x12, 0x0a, 0xc0, 0x7a, 0x01, 0x08, 0x12, 0x0a, 0xc0, 0x7a, + 0x11, 0x08, 0x12, 0x0a, 0xc0, 0x12, 0x09, 0xd0, 0x40, 0x58, 0x02, 0x03, 0x84, 0xb4, 0x08, 0x1c, + 0x75, 0x08, 0x74, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x3f, 0xf1, 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, + 0x00, 0x00, 0x7a, 0x0b, 0xb0, 0x7e, 0x54, 0x00, 0x01, 0x02, 0x03, 0x84, 0xb4, 0x00, 0x33, 0x75, + 0x08, 0x75, 0x12, 0x0a, 0xc0, 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, 0x00, 0x00, 0xca, 0x0b, 0x7e, + 0xb3, 0x3f, 0xf2, 0x30, 0xe0, 0x07, 0x74, 0x02, 0x7a, 0x0b, 0xb0, 0x80, 0x05, 0x74, 0x00, 0x7a, + 0x0b, 0xb0, 0x0b, 0x14, 0x74, 0x00, 0x7a, 0x0b, 0xb0, 0x7e, 0x54, 0x00, 0x02, 0xda, 0x0b, 0x02, + 0x03, 0x84, 0x02, 0x09, 0x8b, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, + 0x1c, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x00, 0x5f, 0x75, 0x08, 0x76, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, + 0x01, 0x2a, 0x54, 0x0f, 0xb4, 0x02, 0x05, 0x7e, 0xb0, 0x60, 0x80, 0x17, 0xb4, 0x00, 0x05, 0x7e, + 0xb0, 0x00, 0x80, 0x0f, 0x7e, 0xb3, 0x01, 0x2a, 0x20, 0xe7, 0x05, 0x7e, 0xb0, 0x40, 0x80, 0x03, + 0x7e, 0xb0, 0x20, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, 0x11, 0x30, 0xe0, 0x04, 0x74, 0x01, + 0x80, 0x02, 0x74, 0x00, 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, 0x00, 0x00, 0xca, 0x0b, 0x7a, 0x0b, + 0xb0, 0x0b, 0x14, 0x74, 0x00, 0x7a, 0x0b, 0xb0, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0x54, + 0x00, 0x02, 0xda, 0x0b, 0x02, 0x03, 0x84, 0x02, 0x09, 0x8b, 0x7e, 0xb3, 0x01, 0x2a, 0x54, 0x0f, + 0xb4, 0x02, 0x05, 0x7e, 0xb0, 0x60, 0x80, 0x17, 0xb4, 0x00, 0x05, 0x7e, 0xb0, 0x00, 0x80, 0x0f, + 0x7e, 0xb3, 0x01, 0x2a, 0x20, 0xe7, 0x05, 0x7e, 0xb0, 0x40, 0x80, 0x03, 0x7e, 0xb0, 0x20, 0x7a, + 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x01, 0x28, 0xb4, 0x00, 0x26, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x01, + 0x0e, 0x75, 0x08, 0x77, 0x12, 0x0a, 0xc0, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x80, 0x1b, 0xb4, + 0x03, 0x0e, 0x75, 0x08, 0x78, 0x12, 0x0a, 0xc0, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x11, 0x80, 0x0a, + 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x12, 0x09, 0x8b, 0x22, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, + 0x02, 0x03, 0x77, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x09, 0x1f, 0x75, 0x08, 0x79, 0x12, 0x0a, 0xc0, + 0x7e, 0xb3, 0x01, 0x28, 0xbe, 0xb3, 0x3f, 0xf1, 0x68, 0x0d, 0xca, 0xb8, 0x12, 0x01, 0xf1, 0xda, + 0xb8, 0x50, 0x76, 0x7a, 0xb3, 0x3f, 0xf1, 0x80, 0x6d, 0xb4, 0x05, 0x08, 0x75, 0x08, 0x7a, 0x12, + 0x0a, 0xc0, 0x80, 0x62, 0xb4, 0x03, 0x19, 0x75, 0x08, 0x7b, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, + 0x28, 0xb4, 0x01, 0x55, 0x7e, 0xb3, 0x3f, 0xf2, 0x44, 0x01, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x46, + 0xb4, 0x01, 0x19, 0x75, 0x08, 0x7c, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, 0x28, 0xb4, 0x01, 0x39, + 0x7e, 0xb3, 0x3f, 0xf2, 0x54, 0xfe, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x2a, 0xb4, 0x07, 0x2a, 0x7e, + 0xb3, 0x01, 0x27, 0x60, 0x24, 0x7c, 0x0b, 0x7e, 0x13, 0x01, 0x28, 0x7e, 0x17, 0x01, 0x29, 0x75, + 0x08, 0x73, 0x12, 0x0a, 0xc0, 0x7a, 0x01, 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x11, 0x08, 0x12, 0x0a, + 0xc0, 0x12, 0x0a, 0x0a, 0x40, 0x03, 0x02, 0x03, 0x77, 0x02, 0x09, 0x8b, 0x7e, 0xb3, 0x01, 0x26, + 0xb4, 0x0b, 0xf6, 0x75, 0x08, 0x7d, 0x12, 0x0a, 0xc0, 0x7e, 0xb3, 0x01, 0x28, 0x7e, 0xa3, 0x01, + 0x2a, 0x4c, 0xab, 0x78, 0xe4, 0x80, 0xdf, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x1c, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x0a, 0xcf, 0x75, 0x08, 0x7e, 0x12, 0x0a, 0xc0, + 0x7e, 0xb3, 0x01, 0x28, 0x70, 0xc3, 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, 0x00, 0x00, 0x7a, 0x0b, + 0xb0, 0x7e, 0x54, 0x00, 0x01, 0x02, 0x03, 0x84, 0x02, 0x09, 0x8b, 0x02, 0x09, 0x8b, 0x02, 0x09, + 0x8b, 0x7e, 0xb3, 0x01, 0x26, 0xb4, 0x04, 0x20, 0x75, 0x08, 0xc3, 0x12, 0x0a, 0xc0, 0x7e, 0x04, + 0x00, 0x01, 0x7e, 0x17, 0x01, 0x27, 0x7e, 0x18, 0x01, 0x37, 0x7a, 0x1c, 0x00, 0x00, 0x7e, 0x47, + 0x01, 0x2b, 0x12, 0x0a, 0xcc, 0x02, 0x08, 0xf3, 0xb4, 0x06, 0x42, 0x75, 0x08, 0xc1, 0x12, 0x0a, + 0xc0, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7d, 0xca, 0x7e, 0xd7, 0x01, 0x27, 0x7e, + 0x78, 0x01, 0x37, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x01, 0x2b, 0x75, 0x08, 0xc1, 0x12, 0x0a, + 0xc0, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x12, 0x0b, 0x63, 0x7e, + 0x43, 0x01, 0x24, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0x40, 0x65, 0x80, 0x60, 0xb4, 0x00, 0x24, + 0xc2, 0xaf, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x94, 0x00, 0x7a, 0xb3, 0x01, 0x24, 0x12, 0x03, 0x77, + 0xe4, 0x8d, 0xef, 0x8d, 0xef, 0x8d, 0xef, 0xd5, 0xe0, 0xf7, 0xc0, 0xd1, 0xca, 0x02, 0xff, 0xca, + 0x06, 0x00, 0x00, 0x32, 0xb4, 0x09, 0x20, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0x23, 0x91, + 0x07, 0x7e, 0x57, 0x01, 0x27, 0x4d, 0x55, 0x68, 0x05, 0x4e, 0x20, 0x02, 0x80, 0x03, 0x5e, 0x20, + 0xfd, 0x7a, 0x23, 0x91, 0x07, 0x80, 0x16, 0xb4, 0x07, 0x16, 0xc2, 0xaf, 0x7e, 0x07, 0x01, 0x29, + 0x7e, 0x17, 0x01, 0x27, 0xc0, 0xd1, 0xca, 0x18, 0xca, 0x38, 0xca, 0x28, 0x32, 0x02, 0x03, 0x77, + 0x02, 0x09, 0x8b, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x7e, + 0xb3, 0x01, 0x26, 0xb4, 0x03, 0x15, 0x75, 0x08, 0xc2, 0x12, 0x0a, 0xc0, 0x7e, 0x04, 0x00, 0x01, + 0x7e, 0x17, 0x01, 0x27, 0x7e, 0x57, 0x01, 0x2b, 0x02, 0x03, 0x84, 0xb4, 0x05, 0x41, 0x75, 0x08, + 0xc0, 0x12, 0x0a, 0xc0, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x7e, + 0x08, 0x01, 0x37, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x37, 0x01, 0x27, 0x7e, + 0x47, 0x01, 0x2b, 0x12, 0x0a, 0xcc, 0x7e, 0x43, 0x01, 0x24, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, + 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x57, 0x01, 0x2b, 0x02, 0x03, 0x84, 0xb4, + 0x01, 0x20, 0x7e, 0x00, 0x00, 0x7e, 0x10, 0x01, 0x75, 0x08, 0x72, 0x12, 0x0a, 0xc0, 0x7a, 0x01, + 0x08, 0x12, 0x0a, 0xc0, 0x7a, 0x11, 0x08, 0x12, 0x0a, 0xc0, 0x12, 0x09, 0xd0, 0x40, 0x03, 0x02, + 0x03, 0x84, 0x02, 0x09, 0x8b, 0x75, 0x08, 0x07, 0x12, 0x0a, 0xc0, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, + 0x90, 0x00, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x15, 0x74, 0x01, + 0x7a, 0xb3, 0x91, 0x11, 0x7e, 0xb3, 0x91, 0x15, 0x54, 0x60, 0xbe, 0xb0, 0x40, 0x68, 0x08, 0x74, + 0x20, 0x7a, 0xb3, 0x91, 0x15, 0x80, 0xed, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x74, 0x04, 0x7a, + 0xb3, 0x91, 0x14, 0x74, 0xff, 0x7a, 0xb3, 0x01, 0x2d, 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, + 0x01, 0x7a, 0x43, 0x94, 0x00, 0x12, 0x0a, 0x57, 0x40, 0x1f, 0x7e, 0x08, 0x01, 0x37, 0x7a, 0x0c, + 0x00, 0x00, 0xca, 0x0b, 0xca, 0x49, 0x12, 0x0a, 0xcc, 0xda, 0x59, 0xda, 0x0b, 0x7e, 0x43, 0x01, + 0x24, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0xc3, 0x22, 0x7e, 0x43, 0x01, 0x24, 0x7a, 0x43, 0x94, + 0x00, 0xd0, 0xa8, 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x12, + 0x0a, 0x57, 0x40, 0x31, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7f, 0x61, 0x7e, 0x78, + 0x01, 0x37, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x01, 0x2b, 0xbd, 0x74, 0x78, 0x17, 0x75, 0x08, + 0xc1, 0x12, 0x0a, 0xc0, 0x12, 0x0b, 0x63, 0x40, 0x0c, 0x7e, 0x43, 0x01, 0x24, 0x7a, 0x43, 0x94, + 0x00, 0xd0, 0xa8, 0xc3, 0x22, 0x7e, 0x43, 0x01, 0x24, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0xd3, + 0x22, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x34, 0x7f, 0xca, 0x0b, 0x1a, 0x50, 0xc5, 0xf0, 0x7d, 0x62, + 0x7d, 0x75, 0x7d, 0x87, 0x7e, 0x34, 0x7f, 0x03, 0x7e, 0x1b, 0xb0, 0xbc, 0x0b, 0x50, 0x49, 0x3e, + 0x00, 0x3e, 0x00, 0x0a, 0x50, 0x2d, 0x75, 0x0b, 0x3a, 0x30, 0x69, 0x53, 0x00, 0x02, 0xbd, 0x38, + 0x50, 0x02, 0x2d, 0x38, 0xbc, 0x1b, 0x50, 0x30, 0x3e, 0x10, 0x3e, 0x10, 0x0a, 0x51, 0x2d, 0x35, + 0x69, 0x41, 0x00, 0x02, 0x0b, 0x1a, 0x30, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, 0xbe, 0x44, 0xff, + 0xff, 0x78, 0x05, 0x7e, 0x1b, 0x90, 0x0a, 0x49, 0x4d, 0x44, 0x68, 0x0c, 0xbe, 0x44, 0x00, 0xff, + 0x28, 0x04, 0x7e, 0x44, 0x00, 0xff, 0xc3, 0x22, 0xd3, 0x22, + +// Segment #16, EXCLUDED Start Address 00ff7c00, Length 227 + + +// Segment #17, EXCLUDED Start Address 00ff7f00, Length 192 + + +// Segment #17, Start Address 00ff7fc0, Length 64 +0xff,0x00,0xc0,0x7f,0x40,0x00, + 0x40, 0x01, 0x02, 0x00, 0xd7, 0x31, 0x02, 0x00, 0x03, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + +// Segment #18, Start Address 00ff0ac0, Length 4163 +0xff,0x00,0xc0,0x0a,0x43,0x10, + 0xca, 0x08, 0x7e, 0x01, 0x08, 0x7a, 0x03, 0x3f, 0xf0, 0xda, 0x08, 0x22, 0x80, 0x50, 0x0b, 0x1a, + 0x60, 0x0b, 0x35, 0x0b, 0x1a, 0x70, 0x0b, 0x35, 0x0b, 0x1a, 0x80, 0x0b, 0x35, 0x0b, 0x1a, 0x90, + 0x0b, 0x35, 0x0b, 0x1a, 0xa0, 0x0b, 0x35, 0x0b, 0x1a, 0xb0, 0x0b, 0x35, 0x0b, 0x1a, 0xc0, 0x0b, + 0x35, 0x0b, 0x1a, 0xd0, 0x0b, 0x35, 0x1b, 0x0a, 0x60, 0x0b, 0x15, 0x1b, 0x0a, 0x70, 0x0b, 0x15, + 0x1b, 0x0a, 0x80, 0x0b, 0x15, 0x1b, 0x0a, 0x90, 0x0b, 0x15, 0x1b, 0x0a, 0xa0, 0x0b, 0x15, 0x1b, + 0x0a, 0xb0, 0x0b, 0x15, 0x1b, 0x0a, 0xc0, 0x0b, 0x15, 0x1b, 0x0a, 0xd0, 0x0b, 0x15, 0x9e, 0x44, + 0x00, 0x10, 0x50, 0xaa, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x0e, 0x7e, 0x1b, 0xc0, 0x7a, 0x0b, 0xc0, + 0x0b, 0x14, 0x0b, 0x34, 0x1b, 0x44, 0x78, 0xf2, 0x22, 0x7f, 0x6f, 0x7f, 0xf0, 0x1b, 0xfc, 0x7c, + 0x54, 0x7d, 0x32, 0x80, 0x08, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0x9e, 0x44, 0x00, + 0x10, 0x50, 0xf2, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x06, 0xca, 0x48, 0x1b, 0x44, 0x78, 0xfa, 0x7f, + 0xf6, 0x89, 0xe4, 0xca, 0x6b, 0x5e, 0xd4, 0x00, 0x3f, 0x68, 0x20, 0x7e, 0x84, 0x00, 0x40, 0x9d, + 0x8d, 0xda, 0x6b, 0xbd, 0x87, 0x38, 0x16, 0xca, 0x79, 0x7d, 0x78, 0x12, 0x0b, 0x8d, 0xda, 0x79, + 0x40, 0x08, 0x9d, 0x78, 0x68, 0x02, 0x80, 0x05, 0xc2, 0xd7, 0x22, 0xda, 0x6b, 0x7e, 0xc0, 0x03, + 0x7e, 0xd0, 0x00, 0x7a, 0xd3, 0x90, 0x00, 0x74, 0xaa, 0x39, 0xb5, 0x55, 0x55, 0x74, 0x55, 0x39, + 0xb5, 0x2a, 0xaa, 0x74, 0xa0, 0x39, 0xb5, 0x55, 0x55, 0x7e, 0x04, 0x00, 0x40, 0x9d, 0x70, 0x50, + 0x06, 0x2d, 0x70, 0x7d, 0x07, 0x6d, 0x77, 0x7c, 0x31, 0x7e, 0x7b, 0x00, 0x7a, 0x6b, 0x00, 0x0b, + 0x7c, 0x0b, 0x6c, 0xa5, 0xd9, 0xf3, 0x7f, 0x16, 0x1b, 0x1c, 0x7e, 0x54, 0x27, 0x10, 0x7e, 0x1b, + 0x10, 0xbc, 0x10, 0x68, 0x06, 0x1b, 0x54, 0x78, 0xf5, 0x80, 0x2f, 0x6d, 0x00, 0x7c, 0x20, 0x7f, + 0x16, 0x9f, 0x10, 0x7f, 0x27, 0x9f, 0x20, 0x7e, 0x2b, 0x00, 0x7e, 0x1b, 0x10, 0xbc, 0x01, 0x78, + 0x19, 0x0b, 0x2c, 0x0b, 0x1c, 0xa5, 0xdb, 0xef, 0x7c, 0xb6, 0x20, 0xe0, 0x06, 0x6c, 0xdc, 0x7a, + 0xd3, 0x90, 0x00, 0x4d, 0x77, 0x78, 0x90, 0xc2, 0xd7, 0x22, 0xd2, 0xd7, 0x22, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x00, 0x06, 0x04, 0x02, 0x04, 0x00, 0x02, 0x01, 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x00, 0x08, 0x10, 0x02, 0x10, + 0x04, 0x02, 0x08, 0x00, 0x01, 0x01, 0x08, 0x7e, 0x18, 0x7f, 0xbd, 0x7a, 0x1c, 0x00, 0xff, 0x0b, + 0x1a, 0x00, 0x5e, 0x10, 0x1f, 0xbe, 0x10, 0x14, 0x38, 0x1a, 0x0a, 0x51, 0x23, 0x7e, 0x18, 0x0c, + 0x0d, 0x7a, 0x1c, 0x00, 0xff, 0x2d, 0x35, 0x0b, 0x1a, 0x50, 0x60, 0x08, 0xa5, 0xb8, 0x02, 0x03, + 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, 0x7e, 0xe8, 0x7f, 0xbf, 0x7a, 0xec, 0x00, 0xff, 0xe0, 0xf5, + 0x23, 0x54, 0xc0, 0x68, 0x38, 0x7e, 0xe8, 0x7f, 0xbe, 0x7a, 0xec, 0x00, 0xff, 0xe0, 0x60, 0x2e, + 0x12, 0x0c, 0x37, 0xf5, 0x21, 0x7a, 0xa1, 0x20, 0x20, 0x09, 0x0c, 0x20, 0x0a, 0x12, 0x7e, 0xb0, + 0x0e, 0x7a, 0xb3, 0x92, 0x00, 0x80, 0x10, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, 0x92, 0x00, 0x80, 0x07, + 0x7e, 0xb0, 0x0a, 0x7a, 0xb3, 0x92, 0x00, 0x7a, 0xb1, 0x0d, 0x02, 0x0c, 0xc4, 0x22, 0x7e, 0xb0, + 0x02, 0x7a, 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x03, 0x7a, 0xb3, 0x90, 0x00, 0x12, + 0x19, 0x0c, 0x80, 0xea, 0xc2, 0xaf, 0xc2, 0x11, 0xc2, 0x12, 0x75, 0xb0, 0xdf, 0x7e, 0x00, 0x01, + 0x7a, 0x03, 0x93, 0x00, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x90, 0x00, 0x6c, 0x00, 0x7e, 0x10, 0x03, + 0x12, 0x0c, 0xf5, 0x7e, 0x68, 0x2c, 0x66, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x0b, 0x00, + 0x80, 0x32, 0x02, 0x1a, 0x6e, 0x20, 0x11, 0x2b, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x90, 0x00, 0x12, + 0x19, 0x0c, 0x7e, 0xb0, 0x03, 0x7a, 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x02, 0x7a, + 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0xa5, 0xd9, 0xdc, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x90, 0x00, + 0x12, 0x19, 0x0c, 0x22, 0x7e, 0x68, 0x2c, 0xf9, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, + 0xe4, 0x10, 0x00, 0x7e, 0x40, 0x55, 0x7a, 0xe9, 0x40, 0x0b, 0xe4, 0x7e, 0x50, 0xaa, 0x7a, 0xe9, + 0x50, 0x1b, 0xe4, 0xbe, 0xe9, 0x40, 0x68, 0x19, 0x7e, 0x68, 0x2c, 0xdf, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0x13, 0x7a, 0xe9, 0x40, 0x7e, 0xe9, 0x10, 0x80, + 0xf8, 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x0b, 0x00, 0x7e, 0x68, + 0x2d, 0x3d, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x78, 0x00, 0x00, 0x7e, 0x70, 0x0e, + 0x7e, 0xa4, 0xff, 0xff, 0x7e, 0xb4, 0xbf, 0xff, 0x7d, 0xcb, 0x0e, 0xc4, 0x7d, 0xdc, 0x5d, 0xdb, + 0x6c, 0xbb, 0x7d, 0xfa, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x0b, 0xb0, 0x7d, 0xfb, 0x5e, + 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x0b, 0xb0, 0x7d, 0xfc, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, + 0xb0, 0x0b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x6c, 0xbb, 0x7d, 0xfa, + 0x5e, 0xf4, 0x7f, 0xff, 0xbe, 0x7b, 0xb0, 0x78, 0x41, 0x0b, 0xb0, 0x7d, 0xfb, 0x5e, 0xf4, 0x7f, + 0xff, 0xbe, 0x7b, 0xb0, 0x78, 0x34, 0x0b, 0xb0, 0x7d, 0xfc, 0x5e, 0xf4, 0x7f, 0xff, 0xbe, 0x7b, + 0xb0, 0x78, 0x27, 0x0b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0xbe, 0x7b, 0xb0, 0x78, 0x1a, + 0x0b, 0xb0, 0xbe, 0xc4, 0xff, 0xfe, 0x78, 0x92, 0x0e, 0xb4, 0xa5, 0xdf, 0x8b, 0x7e, 0x68, 0x2c, + 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, 0x77, 0xca, 0x5b, 0xca, 0x6b, 0x7e, 0x68, + 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x68, 0x2d, 0x8f, 0x7a, 0x6c, 0x00, + 0xff, 0x12, 0x19, 0xc4, 0x0a, 0x47, 0x12, 0x19, 0xfa, 0x7e, 0x68, 0x2d, 0xde, 0x7a, 0x6c, 0x00, + 0xff, 0x12, 0x19, 0xc4, 0x6c, 0x77, 0xda, 0x6b, 0xca, 0x6b, 0x0b, 0x70, 0x0e, 0xc4, 0xbe, 0xc4, + 0xff, 0xff, 0x78, 0xf6, 0x1b, 0x70, 0x0a, 0x47, 0x12, 0x19, 0xfa, 0x12, 0x19, 0x19, 0x30, 0x11, + 0x30, 0xda, 0x6b, 0xda, 0x5b, 0x6c, 0xbb, 0x7e, 0x78, 0x00, 0x00, 0x7d, 0xfa, 0x5e, 0xf4, 0x7f, + 0xff, 0x7a, 0x7b, 0xb0, 0x7d, 0xfb, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x7d, 0xfc, 0x5e, + 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x7d, 0xfd, 0x5e, 0xf4, 0x7f, 0xff, 0x7a, 0x7b, 0xb0, 0x80, + 0xd4, 0x7e, 0x68, 0x2d, 0x1b, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x30, 0x1f, 0x0e, 0x7e, + 0x78, 0x04, 0x20, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x44, 0x7b, 0xe0, 0x80, 0x0c, 0x7e, 0x78, 0x00, + 0x00, 0x7a, 0x7c, 0x00, 0x01, 0x7e, 0x44, 0x80, 0x00, 0x0b, 0x00, 0x7e, 0x40, 0x3a, 0x7c, 0x54, + 0x7f, 0x57, 0x7d, 0x84, 0x6c, 0x66, 0x7a, 0x5b, 0x50, 0x0b, 0x5c, 0x0b, 0x50, 0xa5, 0xde, 0x02, + 0x0b, 0x50, 0x1b, 0x84, 0x78, 0xf0, 0x7c, 0x54, 0x7f, 0x57, 0x7d, 0x84, 0x6c, 0x66, 0xbe, 0x5b, + 0x50, 0x78, 0x1a, 0x0b, 0x5c, 0x0b, 0x50, 0xa5, 0xde, 0x02, 0x0b, 0x50, 0x1b, 0x84, 0x78, 0xee, + 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, 0x4b, 0x7f, 0x45, 0x7e, + 0x68, 0x2c, 0xdf, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x68, 0x2d, 0x5f, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7d, 0x4b, 0x12, 0x19, 0xfa, 0x7e, 0x68, 0x2d, 0x74, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x6c, 0x88, 0x7c, 0x95, 0x12, 0x19, 0xfa, 0x7e, 0x68, 0x2d, 0x82, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x4b, 0x90, 0x12, 0x19, 0xfa, 0x12, 0x19, 0x19, + 0x30, 0x11, 0x05, 0x7e, 0x4b, 0x90, 0x80, 0xfb, 0x7e, 0x68, 0x2e, 0x28, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x0b, 0x00, 0x7e, 0xb0, 0x80, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xa0, 0x55, 0x7a, + 0xa3, 0x91, 0x10, 0x7e, 0xb3, 0x91, 0x07, 0x7e, 0xb3, 0x91, 0x10, 0xbc, 0xab, 0x78, 0x20, 0x7e, + 0xa0, 0xaa, 0x7a, 0xa3, 0x91, 0x10, 0x7e, 0xb3, 0x91, 0x07, 0x7e, 0xb3, 0x91, 0x10, 0xbc, 0xab, + 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, 0x1b, 0x7e, + 0x68, 0x2c, 0xdf, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0x0a, + 0x7a, 0xa3, 0x91, 0x10, 0x7e, 0xb3, 0x91, 0x10, 0x80, 0xf6, 0x7e, 0x68, 0x2e, 0x4a, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x12, 0x31, 0x0b, 0x00, 0x7e, 0xe4, 0x10, 0x00, 0x7e, 0xa0, + 0xa5, 0xca, 0xa8, 0x7a, 0xe9, 0xa0, 0x7e, 0xb0, 0x30, 0x7a, 0xb3, 0x95, 0x00, 0x7e, 0xe9, 0xa0, + 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x95, 0x00, 0x12, 0x19, 0x0c, 0x0b, 0xe5, 0x7e, 0xb0, 0x20, 0x7a, + 0xb3, 0x95, 0x00, 0x7e, 0xe9, 0xb0, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x95, 0x00, 0x7e, 0xe9, 0xb0, + 0xda, 0xa8, 0xbc, 0xab, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, + 0xc4, 0x80, 0x1d, 0x7e, 0x68, 0x2c, 0xdf, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, + 0x19, 0x30, 0x11, 0x0c, 0x7e, 0xb0, 0x38, 0x7a, 0xb3, 0x95, 0x00, 0x7e, 0xe9, 0xb0, 0x80, 0xfb, + 0x80, 0x00, 0x7e, 0x68, 0x2d, 0xe4, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x0b, 0x00, 0x75, + 0xb0, 0xdf, 0x7e, 0x24, 0x80, 0x00, 0x09, 0xb2, 0x00, 0x08, 0xbe, 0xb0, 0x01, 0x78, 0x0b, 0x09, + 0xb2, 0x00, 0x14, 0xbe, 0xb0, 0x60, 0x78, 0x02, 0x80, 0x17, 0x7e, 0x68, 0x2c, 0xdf, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0x11, 0x09, 0xb2, 0x00, 0x08, 0x80, + 0xfa, 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x68, 0x2e, 0x06, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x0b, 0x00, 0x75, 0xb0, 0xef, 0x12, 0x18, 0xff, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x1c, 0x7e, 0xb0, 0x01, 0x19, 0xb2, 0x00, + 0x08, 0x09, 0xb2, 0x00, 0x1c, 0xbc, 0xab, 0x78, 0x37, 0x09, 0xb2, 0x00, 0x08, 0x5e, 0xb0, 0xc0, + 0xbe, 0xb0, 0xc0, 0x78, 0x2b, 0x7e, 0xa0, 0xaa, 0x19, 0xa2, 0x00, 0x1c, 0x6c, 0xbb, 0x19, 0xb2, + 0x00, 0x08, 0x09, 0xb2, 0x00, 0x1c, 0xbc, 0xab, 0x78, 0x16, 0x09, 0xb2, 0x00, 0x08, 0x5e, 0xb0, + 0xc0, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xda, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, 0x1b, + 0x7e, 0x68, 0x2c, 0xdf, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, + 0x0a, 0x19, 0xa2, 0x00, 0x1c, 0x09, 0xb2, 0x00, 0x1c, 0x80, 0xf6, 0x7e, 0x68, 0x2e, 0x6c, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x68, 0x2e, 0xee, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, + 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x7e, 0xb0, 0x01, 0x19, 0xb2, 0x00, 0x1c, 0x2e, + 0x24, 0x01, 0x00, 0x0b, 0xb0, 0xa5, 0xd9, 0xf3, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x7e, + 0xb0, 0x01, 0x0b, 0x00, 0x09, 0xa2, 0x00, 0x1c, 0xbc, 0xab, 0x78, 0x16, 0x7e, 0x68, 0x2c, 0xe7, + 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x2e, 0x24, 0x01, 0x00, 0x0b, 0xb0, 0xa5, 0xd9, 0xe2, + 0x80, 0x25, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, + 0x30, 0x11, 0xe4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x09, 0xa2, 0x00, 0x1c, 0x2e, 0x24, + 0x01, 0x00, 0xa5, 0xd9, 0xf5, 0x80, 0xec, 0x7e, 0x68, 0x2f, 0x12, 0x7a, 0x6c, 0x00, 0xff, 0x12, + 0x19, 0xc4, 0x12, 0x12, 0x31, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x74, 0x10, + 0x19, 0xb2, 0x00, 0x10, 0x12, 0x11, 0xaa, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xee, 0x7e, 0x68, + 0x2f, 0x36, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, + 0x0b, 0x00, 0xe4, 0x19, 0xb2, 0x00, 0x10, 0x12, 0x11, 0xaa, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, + 0xef, 0x30, 0x00, 0x03, 0x02, 0x17, 0x3b, 0x02, 0x12, 0x6a, 0x74, 0x07, 0x19, 0xb2, 0x00, 0x08, + 0x12, 0x19, 0x0c, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, + 0xb2, 0x00, 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, 0xb2, 0x00, 0x14, 0x09, 0xb2, 0x00, 0x00, 0x09, + 0xb2, 0x00, 0x14, 0xc2, 0x13, 0x7e, 0xb0, 0x55, 0x12, 0x12, 0x0b, 0x7e, 0xb0, 0xaa, 0x12, 0x12, + 0x0b, 0x7e, 0xb0, 0x00, 0x12, 0x12, 0x0b, 0x7e, 0xb0, 0xff, 0x12, 0x12, 0x0b, 0x30, 0x13, 0x0f, + 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x22, 0x7e, + 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x22, 0x19, 0xb2, 0x00, 0x00, 0x12, + 0x18, 0xff, 0x09, 0xa2, 0x00, 0x00, 0xbc, 0xab, 0x78, 0x01, 0x22, 0x20, 0x11, 0x03, 0xd2, 0x13, + 0x22, 0x12, 0x19, 0x19, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x18, 0xff, 0x09, 0xa2, 0x00, 0x00, 0x80, + 0xf3, 0x75, 0xb0, 0xdf, 0x12, 0x18, 0xff, 0x75, 0xb0, 0xef, 0x12, 0x18, 0xff, 0x7e, 0x24, 0x80, + 0x00, 0x7e, 0x11, 0x21, 0x74, 0x80, 0x19, 0xb2, 0x00, 0x0c, 0x7e, 0x54, 0x00, 0x02, 0x19, 0xa2, + 0x00, 0x04, 0x19, 0xb2, 0x00, 0x00, 0x74, 0x03, 0x19, 0xb2, 0x00, 0x0c, 0x74, 0x06, 0x19, 0xb2, + 0x00, 0x08, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xdb, 0x22, 0x7e, 0x68, 0x2f, 0x5a, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x12, 0x18, + 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x18, 0xff, 0x09, + 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x80, 0x1a, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, + 0x12, 0x19, 0x19, 0x30, 0x11, 0x09, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x18, 0xff, 0x80, 0xf7, 0x2e, + 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xb6, 0x7e, 0x68, 0x2f, 0x7e, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, + 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, + 0x18, 0x7e, 0xa0, 0x55, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, + 0xb0, 0x0a, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, + 0x1a, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, + 0x11, 0x09, 0x19, 0xa2, 0x00, 0x00, 0x12, 0x18, 0xff, 0x80, 0xf7, 0x2e, 0x24, 0x01, 0x00, 0xa5, + 0xd9, 0xb6, 0x30, 0x04, 0x03, 0x02, 0x15, 0x9f, 0x7e, 0x68, 0x2f, 0xa2, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, + 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, + 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x0a, + 0x78, 0x3c, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, + 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, + 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x0a, 0x78, 0x14, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, + 0x00, 0xff, 0x12, 0x19, 0xc4, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, + 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0xe6, 0x7e, + 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, + 0x2f, 0xea, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, + 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, + 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, + 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x3c, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, + 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x02, + 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x05, 0x78, 0x14, + 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x2e, 0x24, 0x01, 0x00, 0xa5, + 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, + 0x19, 0x19, 0x30, 0x11, 0xe6, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, + 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, 0x30, 0x32, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, + 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x50, 0xbe, 0xb0, 0x50, 0x78, 0x1f, 0x6c, 0xaa, + 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x50, 0x78, 0x0d, + 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, 0x20, 0x7e, 0x68, 0x2c, + 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0x0f, 0x7e, 0xa0, + 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x2e, 0x24, 0x01, + 0x00, 0xa5, 0xd9, 0xa2, 0x7e, 0x68, 0x30, 0x7a, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, + 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x01, 0x19, + 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0xa0, 0xbe, 0xb0, 0xa0, + 0x78, 0x1f, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, + 0xb0, 0xa0, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x80, + 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, + 0x11, 0x0f, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, + 0xf1, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x7e, 0x68, 0x30, 0x9e, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x20, 0xb1, 0x26, 0x7e, + 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x30, 0xb1, 0x19, 0x6c, 0xaa, 0x19, 0xa2, + 0x00, 0x10, 0x12, 0x18, 0xff, 0x20, 0xb1, 0x0d, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, + 0x12, 0x19, 0xc4, 0x80, 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, + 0x12, 0x19, 0x19, 0x30, 0x11, 0x0f, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, + 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xae, 0x02, 0x17, 0x3b, 0x7e, + 0x68, 0x2f, 0xc6, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, + 0x21, 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, + 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, + 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x06, 0x78, 0x3c, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, + 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x03, 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, + 0x01, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x06, 0x78, + 0x14, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x2e, 0x24, 0x01, 0x00, + 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, + 0x12, 0x19, 0x19, 0x30, 0x11, 0xe6, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, + 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, 0x30, 0x0e, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, + 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, + 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x01, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, + 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x09, 0x78, 0x3c, 0x7e, + 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x7e, 0xa0, 0x03, + 0x19, 0xa2, 0x00, 0x10, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, + 0x00, 0x18, 0x5e, 0xb0, 0x09, 0x78, 0x14, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, + 0x19, 0xc4, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0x9e, 0x80, 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, 0x19, 0x19, 0x30, 0x11, 0xe6, 0x7e, 0xa0, 0x01, 0x19, + 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x80, 0xf1, 0x7e, 0x68, 0x30, 0x56, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x7e, + 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, 0x00, 0x18, 0x5e, 0xb0, 0x90, + 0xbe, 0xb0, 0x90, 0x78, 0x1f, 0x6c, 0xaa, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x09, 0xb2, + 0x00, 0x18, 0x5e, 0xb0, 0x90, 0x78, 0x0d, 0x7e, 0x68, 0x2c, 0xe7, 0x7a, 0x6c, 0x00, 0xff, 0x12, + 0x19, 0xc4, 0x80, 0x20, 0x7e, 0x68, 0x2c, 0xf0, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x12, + 0x19, 0x19, 0x30, 0x11, 0x0f, 0x7e, 0xa0, 0x02, 0x19, 0xa2, 0x00, 0x10, 0x6c, 0xaa, 0x19, 0xa2, + 0x00, 0x10, 0x80, 0xf1, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xa2, 0x20, 0x1f, 0x68, 0x12, 0x12, + 0x31, 0x12, 0x17, 0xa9, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, 0x0b, 0x00, 0x20, 0x89, 0x26, + 0x7e, 0xa0, 0xff, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x18, 0xff, 0x7e, 0xb0, 0x55, 0x19, 0xb2, 0x00, + 0x00, 0x12, 0x18, 0xff, 0x30, 0x89, 0x0f, 0x7e, 0xa0, 0x00, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x18, + 0xff, 0x20, 0x89, 0x02, 0x80, 0x26, 0x12, 0x19, 0x19, 0x30, 0x11, 0x20, 0x7e, 0xa0, 0xff, 0x19, + 0xa2, 0x00, 0x04, 0x12, 0x18, 0xff, 0x7e, 0xb0, 0x55, 0x19, 0xb2, 0x00, 0x00, 0x12, 0x18, 0xff, + 0x7e, 0xa0, 0x00, 0x19, 0xa2, 0x00, 0x04, 0x12, 0x18, 0xff, 0x80, 0xe0, 0x2e, 0x24, 0x01, 0x00, + 0xa5, 0xd9, 0xa8, 0x02, 0x17, 0xc2, 0x02, 0x18, 0x4c, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x21, + 0x7e, 0xa0, 0x08, 0x19, 0xa2, 0x00, 0x10, 0x12, 0x18, 0xff, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, + 0xef, 0x22, 0x30, 0x1f, 0x03, 0x02, 0x18, 0x4c, 0xc2, 0x8a, 0x12, 0x17, 0xa9, 0x0b, 0x00, 0x12, + 0x18, 0x16, 0x20, 0x8b, 0x24, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x02, 0x7a, 0xb3, 0x91, + 0x07, 0x74, 0x0c, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x07, 0x12, 0x19, 0x0c, + 0x30, 0x8b, 0x06, 0x12, 0x18, 0x16, 0x30, 0x8b, 0xad, 0x12, 0x19, 0x19, 0x30, 0x11, 0xa7, 0x12, + 0x18, 0x16, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x07, 0x12, 0x19, + 0x0c, 0x12, 0x18, 0x16, 0x80, 0xe9, 0x7e, 0xa0, 0x00, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x06, 0x7a, + 0xa3, 0x91, 0x07, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7a, 0xa3, 0x91, 0x07, 0x12, 0x18, 0xff, + 0x74, 0xef, 0x7a, 0xb3, 0x91, 0x04, 0x74, 0x80, 0x7a, 0xb3, 0x91, 0x03, 0x74, 0x0c, 0x7a, 0xb3, + 0x91, 0x06, 0x74, 0x08, 0x7a, 0xb3, 0x91, 0x07, 0x12, 0x19, 0x0c, 0x22, 0x30, 0x12, 0x19, 0x7e, + 0x68, 0x30, 0xc2, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0xd2, 0x11, 0x12, 0x18, 0xff, 0x12, + 0x18, 0xff, 0x12, 0x18, 0xff, 0x02, 0x0c, 0xca, 0x30, 0x1f, 0x1c, 0x7e, 0x68, 0x31, 0x3c, 0x7a, + 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x7e, 0x68, 0x31, 0x5e, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, + 0xc4, 0x12, 0x1a, 0x6e, 0x02, 0x18, 0xf7, 0x0b, 0x00, 0x7e, 0x78, 0x18, 0xb1, 0x7a, 0x7c, 0x00, + 0xff, 0x7f, 0x67, 0x7a, 0x6c, 0x00, 0x00, 0x7e, 0x70, 0x3e, 0x7e, 0x7b, 0xb0, 0x7a, 0x6b, 0xb0, + 0x0b, 0x7c, 0x0b, 0x6c, 0xa5, 0xdf, 0xf3, 0x7e, 0x78, 0x18, 0xb1, 0x7a, 0x7c, 0x00, 0x00, 0x89, + 0x78, 0x7e, 0x78, 0x00, 0x00, 0x7a, 0x7c, 0x00, 0xfe, 0x7e, 0x68, 0x7f, 0xbf, 0x7a, 0x6c, 0x00, + 0xfe, 0x74, 0xaa, 0x39, 0xb7, 0x55, 0x55, 0x74, 0x55, 0x39, 0xb7, 0x2a, 0xaa, 0x74, 0xa0, 0x39, + 0xb7, 0x55, 0x55, 0x6c, 0x99, 0x7a, 0x6b, 0x90, 0x7e, 0x54, 0x27, 0x10, 0x7e, 0x6b, 0x80, 0xbc, + 0x89, 0x68, 0x08, 0x1b, 0x54, 0x78, 0xf5, 0x8a, 0xff, 0x18, 0xef, 0x8a, 0xff, 0x18, 0xf7, 0x12, + 0x19, 0x19, 0x7e, 0x6b, 0x80, 0x80, 0xfb, 0x7e, 0x10, 0xff, 0x12, 0x19, 0xac, 0x80, 0xf8, 0xca, + 0xf9, 0x7e, 0xf4, 0x00, 0xff, 0x1b, 0xf4, 0x78, 0xfc, 0xda, 0xf9, 0x22, 0xca, 0xf9, 0x7e, 0xf4, + 0x00, 0x00, 0x1b, 0xf4, 0x78, 0xfc, 0xda, 0xf9, 0x22, 0x20, 0x11, 0x20, 0xd2, 0x12, 0x12, 0x19, + 0x0c, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, 0x12, 0x19, + 0x0c, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x90, 0x00, 0x22, 0xca, 0x0b, 0x7e, 0x10, + 0x03, 0x7c, 0x30, 0x6c, 0x22, 0x0b, 0x20, 0x9e, 0x30, 0x0a, 0x50, 0xf9, 0x2e, 0x30, 0x0b, 0x1b, + 0x20, 0x68, 0x20, 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x03, 0x7a, 0xb3, 0x90, 0x00, + 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x90, 0x00, + 0xa5, 0xda, 0xe0, 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, 0x1b, 0x30, 0x68, 0x20, 0x12, 0x19, 0x0c, + 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0x12, 0x19, 0x0c, + 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x90, 0x00, 0xa5, 0xdb, 0xe0, 0x7e, 0x20, 0x0a, + 0x12, 0x19, 0x0c, 0xa5, 0xda, 0xfa, 0xa5, 0xd9, 0x98, 0xda, 0x0b, 0x22, 0x20, 0x11, 0x14, 0x12, + 0x19, 0x0c, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x90, 0x00, 0x12, 0x19, 0x0c, 0x7e, 0xb0, 0x00, 0x7a, + 0xb3, 0x90, 0x00, 0x22, 0x30, 0x1f, 0x32, 0x20, 0x11, 0x2f, 0xca, 0x2b, 0xca, 0x7b, 0x7e, 0x78, + 0x80, 0x00, 0x7a, 0x7c, 0x00, 0xfe, 0x12, 0x1a, 0x4d, 0x7e, 0x6b, 0xa0, 0x5c, 0xaa, 0x68, 0x10, + 0x29, 0xb7, 0x00, 0x14, 0x54, 0x60, 0x68, 0xf8, 0x39, 0xa7, 0x00, 0x00, 0x0b, 0x6c, 0x80, 0xe9, + 0x12, 0x18, 0xff, 0xd2, 0xb5, 0xda, 0x7b, 0xda, 0x2b, 0x22, 0x12, 0x1a, 0x05, 0x7e, 0x68, 0x00, + 0x0c, 0x12, 0x19, 0xc4, 0x22, 0xca, 0x59, 0xca, 0x5b, 0x7e, 0xb4, 0x00, 0x0c, 0x7c, 0xb8, 0xc4, + 0x12, 0x1a, 0x35, 0x7c, 0xb8, 0x12, 0x1a, 0x35, 0x7c, 0xb9, 0xc4, 0x12, 0x1a, 0x35, 0x7c, 0xb9, + 0x12, 0x1a, 0x35, 0x7e, 0xb0, 0x68, 0x7a, 0xb9, 0xb0, 0x0b, 0xb4, 0x6c, 0xbb, 0x7a, 0xb9, 0xb0, + 0xda, 0x59, 0xda, 0x5b, 0x22, 0x5e, 0xb0, 0x0f, 0x7c, 0xab, 0x9e, 0xa0, 0x0a, 0x40, 0x05, 0x2e, + 0xb0, 0x37, 0x80, 0x03, 0x2e, 0xb0, 0x30, 0x7a, 0xb9, 0xb0, 0x0b, 0xb4, 0x22, 0xc2, 0xb5, 0x75, + 0xb0, 0xef, 0x12, 0x18, 0xff, 0x74, 0x80, 0x39, 0xb7, 0x00, 0x0c, 0x7e, 0x54, 0x00, 0x06, 0x39, + 0xa7, 0x00, 0x04, 0x39, 0xb7, 0x00, 0x00, 0x74, 0x03, 0x39, 0xb7, 0x00, 0x0c, 0x22, 0x7e, 0x78, + 0x00, 0x00, 0x7a, 0x7c, 0x00, 0xff, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0x01, 0x7f, 0x65, + 0x7e, 0x74, 0x20, 0x00, 0x12, 0x0b, 0x63, 0x40, 0x58, 0x7e, 0x78, 0x7c, 0x00, 0x7a, 0x7c, 0x00, + 0xff, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0x01, 0x7e, 0x68, 0x7c, 0x00, 0x7a, 0x6c, 0x00, + 0x01, 0x7e, 0x74, 0x04, 0x00, 0x12, 0x0b, 0x63, 0x40, 0x37, 0x74, 0x80, 0x12, 0x1a, 0xea, 0x40, + 0x30, 0x7e, 0x00, 0x03, 0x7a, 0x03, 0x90, 0x00, 0xd2, 0x10, 0x7e, 0x04, 0x00, 0x08, 0x7e, 0x14, + 0x00, 0x00, 0x84, 0xa5, 0xdb, 0xfc, 0xa5, 0xda, 0xf9, 0xa5, 0xd9, 0xf6, 0x74, 0x40, 0x12, 0x1a, + 0xea, 0x40, 0x0e, 0x7e, 0x68, 0x31, 0x8d, 0x7a, 0x6c, 0x00, 0xff, 0x12, 0x19, 0xc4, 0x02, 0x18, + 0xf7, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, 0x90, 0x00, 0x80, 0xfe, 0xf5, 0x0b, 0x7e, 0x78, 0x00, 0x0b, + 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x68, 0x7f, 0xbf, 0x7a, 0x6c, 0x00, 0x01, 0x7e, 0x74, 0x00, 0x01, + 0x02, 0x0b, 0x63, + +// Segment #19, EXCLUDED Start Address 00ff2c66, Length 1393 + +}; + +static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { + 2, 0, 3 }; // Major, Minor, Build + +#undef IMAGE_VERSION_NAME + +#undef IMAGE_ARRAY_NAME + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_fw_down.h linux.20p9/drivers/usb/serial/io_fw_down.h --- linux.vanilla/drivers/usb/serial/io_fw_down.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_fw_down.h Wed Jul 4 16:03:58 2001 @@ -0,0 +1,1123 @@ +//************************************************************** +//* Edgeport/4 Binary Image +//* Generated by HEX2C v1.06 +//* Copyright(c) 1998 Inside Out Networks, All rights reserved. +//* This program is free software; you can redistribute it and/or modify +//* it under the terms of the GNU General Public License as published by +//* the Free Software Foundation; either version 2 of the License, or +//* (at your option) any later version. +//************************************************************** + + +//Image structure definition +#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) + #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD + typedef struct _EDGE_FIRMWARE_IMAGE_RECORD + { + unsigned short ExtAddr; + unsigned short Addr; + unsigned short Len; + unsigned char Data[0]; + } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + + typedef struct _EDGE_FIRMWARE_VERSION_INFO + { + unsigned char MajorVersion; + unsigned char MinorVersion; + unsigned short BuildNumber; + } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + +#endif + +#if !defined(IMAGE_ARRAY_NAME) + #define IMAGE_ARRAY_NAME FirmwareImage + #define IMAGE_VERSION_NAME FirmwareImageVersion +#endif + +static unsigned char IMAGE_ARRAY_NAME[] = { + +// Segment #1, Start Address 00ff0000, Length 6 +0xff,0x00,0x00,0x00,0x06,0x00, + 0x02, 0x00, 0x80, 0x02, 0x49, 0x39, + +// Segment #2, Start Address 00ff000b, Length 3 +0xff,0x00,0x0b,0x00,0x03,0x00, + 0x02, 0x44, 0x1a, + +// Segment #3, Start Address 00ff0013, Length 3 +0xff,0x00,0x13,0x00,0x03,0x00, + 0x02, 0x00, 0x13, + +// Segment #4, Start Address 00ff001b, Length 3 +0xff,0x00,0x1b,0x00,0x03,0x00, + 0x02, 0x00, 0x1b, + +// Segment #5, Start Address 00ff0023, Length 3 +0xff,0x00,0x23,0x00,0x03,0x00, + 0x02, 0x00, 0x23, + +// Segment #6, Start Address 00ff002b, Length 3 +0xff,0x00,0x2b,0x00,0x03,0x00, + 0x02, 0x00, 0x2b, + +// Segment #7, Start Address 00ff0033, Length 3 +0xff,0x00,0x33,0x00,0x03,0x00, + 0x02, 0x00, 0x33, + +// Segment #8, Start Address 00ff003b, Length 3 +0xff,0x00,0x3b,0x00,0x03,0x00, + 0x02, 0x00, 0x3b, + +// Segment #9, Start Address 00ff0043, Length 3 +0xff,0x00,0x43,0x00,0x03,0x00, + 0x02, 0x00, 0x43, + +// Segment #10, Start Address 00ff004b, Length 3 +0xff,0x00,0x4b,0x00,0x03,0x00, + 0x02, 0x70, 0xd4, + +// Segment #11, Start Address 00ff0053, Length 3 +0xff,0x00,0x53,0x00,0x03,0x00, + 0x02, 0x77, 0x9d, + +// Segment #12, Start Address 00ff007b, Length 3 +0xff,0x00,0x7b,0x00,0x03,0x00, + 0x02, 0x00, 0x7b, + +// Segment #13, Start Address 00ff0080, Length 7 +0xff,0x00,0x80,0x00,0x07,0x00, + 0x7e, 0x14, 0x00, 0x00, 0x02, 0x40, 0x51, + +// Segment #14, Start Address 00ff4000, Length 15920 +0xff,0x00,0x00,0x40,0x30,0x3e, + 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x14, 0x7f, 0xf8, 0x7e, 0x24, 0x00, 0xfe, 0x7d, 0x31, 0x0b, 0x1a, + 0x50, 0x1b, 0x0a, 0x50, 0x7e, 0x14, 0x40, 0x1b, 0x02, 0x40, 0x6a, 0x7e, 0xf8, 0x00, 0x59, 0xd2, + 0x04, 0xc2, 0x94, 0xd2, 0x95, 0x7e, 0xf4, 0x40, 0x2c, 0x02, 0x40, 0x7c, 0x12, 0x7f, 0x3f, 0xf5, + 0x2e, 0x7a, 0xa1, 0x2d, 0x7a, 0x11, 0x58, 0x12, 0x77, 0xda, 0x12, 0x40, 0xdc, 0x7e, 0xb3, 0x3f, + 0xf1, 0x60, 0x03, 0x12, 0x43, 0x68, 0x75, 0xf1, 0x00, 0x12, 0x78, 0x7f, 0xd2, 0xaf, 0x02, 0x44, + 0x06, 0x7e, 0x04, 0x00, 0xff, 0x7e, 0x18, 0x40, 0x5f, 0x7a, 0x1c, 0x00, 0x01, 0x89, 0x18, 0xa9, + 0x25, 0x87, 0x03, 0xa9, 0xd5, 0x87, 0xd2, 0x93, 0x89, 0x08, 0x7e, 0x04, 0x00, 0xff, 0x7e, 0x18, + 0x40, 0x78, 0x7a, 0x1c, 0x00, 0x01, 0x89, 0x18, 0xc2, 0x93, 0x89, 0x08, 0x7e, 0x08, 0x00, 0x20, + 0x7e, 0x44, 0x04, 0x00, 0x7e, 0x40, 0x00, 0x7e, 0xe4, 0x40, 0x8e, 0x02, 0x7e, 0x4b, 0x7e, 0x08, + 0x01, 0x59, 0x7e, 0x44, 0x28, 0x7c, 0x7e, 0x40, 0x00, 0x7e, 0xe4, 0x40, 0xa0, 0x02, 0x7e, 0x4b, + 0x7e, 0x08, 0x00, 0x59, 0x7e, 0x44, 0x01, 0x00, 0x7e, 0x40, 0x53, 0x7e, 0xe4, 0x40, 0xb2, 0x02, + 0x7e, 0x4b, 0x75, 0x57, 0x20, 0x75, 0x56, 0x30, 0x7e, 0x04, 0x00, 0x08, 0x75, 0x54, 0x58, 0x75, + 0x55, 0x08, 0x75, 0x51, 0x08, 0x75, 0x53, 0x01, 0x75, 0x89, 0x01, 0x75, 0x8a, 0x01, 0x75, 0x8c, + 0x00, 0xd2, 0x8c, 0x7e, 0x04, 0x00, 0x02, 0x7a, 0x05, 0x42, 0x89, 0xf4, 0x75, 0xb7, 0x7f, 0x75, + 0xb8, 0x7f, 0x75, 0xb3, 0x07, 0x75, 0xb2, 0x07, 0xd2, 0xa9, 0x22, 0xd2, 0x92, 0xe4, 0xd5, 0xe0, + 0xfd, 0xc2, 0x92, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x2e, 0x7e, 0xa0, 0x08, 0x19, 0xa2, 0x00, + 0x10, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xf2, 0x7e, 0x20, 0x00, 0x12, 0x41, 0x72, 0x0b, 0x20, + 0xbe, 0x21, 0x2e, 0x78, 0xf6, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x74, 0xbf, 0x19, 0xb0, + 0x00, 0x0c, 0x74, 0x10, 0x19, 0xb0, 0x00, 0x08, 0x74, 0x80, 0x19, 0xb0, 0x00, 0x0c, 0x7e, 0x54, + 0x00, 0x02, 0x19, 0xa0, 0x00, 0x04, 0x19, 0xb0, 0x00, 0x00, 0x74, 0x03, 0x19, 0xb0, 0x00, 0x0c, + 0x74, 0x07, 0x20, 0x68, 0x02, 0x74, 0x0f, 0x19, 0xb0, 0x00, 0x04, 0x30, 0x6b, 0x17, 0x74, 0xbf, + 0x19, 0xb0, 0x00, 0x0c, 0x74, 0x28, 0x20, 0x68, 0x02, 0x74, 0x20, 0x19, 0xb0, 0x00, 0x04, 0x74, + 0x03, 0x19, 0xb0, 0x00, 0x0c, 0x74, 0xa7, 0x19, 0xb0, 0x00, 0x08, 0x74, 0x0c, 0x19, 0xb0, 0x00, + 0x10, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0xe4, 0x19, 0xb0, 0x00, 0x04, 0x09, 0xb0, 0x00, + 0x10, 0x54, 0x08, 0x19, 0xb0, 0x00, 0x10, 0x74, 0xa7, 0x19, 0xb0, 0x00, 0x08, 0x22, 0x7c, 0xb2, + 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x41, 0x99, 0x89, 0x24, 0x41, 0xa9, 0x41, 0xc6, 0x41, 0xe3, 0x42, + 0x00, 0x42, 0x1d, 0x42, 0x3a, 0x42, 0x57, 0x42, 0x74, 0xc2, 0x10, 0xc2, 0x18, 0xc2, 0x08, 0x7e, + 0x04, 0x09, 0xcd, 0x7a, 0x07, 0x01, 0x59, 0x7a, 0x07, 0x01, 0x69, 0x6d, 0x00, 0x7a, 0x07, 0x01, + 0x79, 0x7a, 0x07, 0x01, 0x89, 0x22, 0xc2, 0x11, 0xc2, 0x19, 0xc2, 0x09, 0x7e, 0x04, 0x0d, 0xcd, + 0x7a, 0x07, 0x01, 0x5b, 0x7a, 0x07, 0x01, 0x6b, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7b, 0x7a, 0x07, + 0x01, 0x8b, 0x22, 0xc2, 0x12, 0xc2, 0x1a, 0xc2, 0x0a, 0x7e, 0x04, 0x11, 0xcd, 0x7a, 0x07, 0x01, + 0x5d, 0x7a, 0x07, 0x01, 0x6d, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7d, 0x7a, 0x07, 0x01, 0x8d, 0x22, + 0xc2, 0x13, 0xc2, 0x1b, 0xc2, 0x0b, 0x7e, 0x04, 0x15, 0xcd, 0x7a, 0x07, 0x01, 0x5f, 0x7a, 0x07, + 0x01, 0x6f, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7f, 0x7a, 0x07, 0x01, 0x8f, 0x22, 0xc2, 0x14, 0xc2, + 0x1c, 0xc2, 0x0c, 0x7e, 0x04, 0x19, 0xcd, 0x7a, 0x07, 0x01, 0x61, 0x7a, 0x07, 0x01, 0x71, 0x6d, + 0x00, 0x7a, 0x07, 0x01, 0x81, 0x7a, 0x07, 0x01, 0x91, 0x22, 0xc2, 0x15, 0xc2, 0x1d, 0xc2, 0x0d, + 0x7e, 0x04, 0x1d, 0xcd, 0x7a, 0x07, 0x01, 0x63, 0x7a, 0x07, 0x01, 0x73, 0x6d, 0x00, 0x7a, 0x07, + 0x01, 0x83, 0x7a, 0x07, 0x01, 0x93, 0x22, 0xc2, 0x16, 0xc2, 0x1e, 0xc2, 0x0e, 0x7e, 0x04, 0x21, + 0xcd, 0x7a, 0x07, 0x01, 0x65, 0x7a, 0x07, 0x01, 0x75, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x85, 0x7a, + 0x07, 0x01, 0x95, 0x22, 0xc2, 0x17, 0xc2, 0x1f, 0xc2, 0x0f, 0x7e, 0x04, 0x25, 0xcd, 0x7a, 0x07, + 0x01, 0x67, 0x7a, 0x07, 0x01, 0x77, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x87, 0x7a, 0x07, 0x01, 0x97, + 0x22, 0x7c, 0xb2, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x42, 0x9c, 0x89, 0x24, 0x42, 0xac, 0x42, 0xc3, + 0x42, 0xda, 0x42, 0xf1, 0x43, 0x08, 0x43, 0x1f, 0x43, 0x36, 0x43, 0x4d, 0x30, 0x40, 0x07, 0x20, + 0x58, 0x04, 0xc2, 0x28, 0x80, 0x0c, 0x30, 0x48, 0x07, 0x20, 0x50, 0x04, 0xc2, 0x28, 0x80, 0x02, + 0xd2, 0x28, 0x22, 0x30, 0x41, 0x07, 0x20, 0x59, 0x04, 0xc2, 0x29, 0x80, 0x0c, 0x30, 0x49, 0x07, + 0x20, 0x51, 0x04, 0xc2, 0x29, 0x80, 0x02, 0xd2, 0x29, 0x22, 0x30, 0x42, 0x07, 0x20, 0x5a, 0x04, + 0xc2, 0x2a, 0x80, 0x0c, 0x30, 0x4a, 0x07, 0x20, 0x52, 0x04, 0xc2, 0x2a, 0x80, 0x02, 0xd2, 0x2a, + 0x22, 0x30, 0x43, 0x07, 0x20, 0x5b, 0x04, 0xc2, 0x2b, 0x80, 0x0c, 0x30, 0x4b, 0x07, 0x20, 0x53, + 0x04, 0xc2, 0x2b, 0x80, 0x02, 0xd2, 0x2b, 0x22, 0x30, 0x44, 0x07, 0x20, 0x5c, 0x04, 0xc2, 0x2c, + 0x80, 0x0c, 0x30, 0x4c, 0x07, 0x20, 0x54, 0x04, 0xc2, 0x2c, 0x80, 0x02, 0xd2, 0x2c, 0x22, 0x30, + 0x45, 0x07, 0x20, 0x5d, 0x04, 0xc2, 0x2d, 0x80, 0x0c, 0x30, 0x4d, 0x07, 0x20, 0x55, 0x04, 0xc2, + 0x2d, 0x80, 0x02, 0xd2, 0x2d, 0x22, 0x30, 0x46, 0x07, 0x20, 0x5e, 0x04, 0xc2, 0x2e, 0x80, 0x0c, + 0x30, 0x4e, 0x07, 0x20, 0x56, 0x04, 0xc2, 0x2e, 0x80, 0x02, 0xd2, 0x2e, 0x22, 0x30, 0x47, 0x07, + 0x20, 0x5f, 0x04, 0xc2, 0x2f, 0x80, 0x0c, 0x30, 0x4f, 0x07, 0x20, 0x57, 0x04, 0xc2, 0x2f, 0x80, + 0x02, 0xd2, 0x2f, 0x22, 0x43, 0xcc, 0x43, 0x79, 0xbe, 0xb0, 0x02, 0x40, 0x01, 0x22, 0x23, 0x0a, + 0x5b, 0x49, 0x55, 0x43, 0x64, 0x99, 0x54, 0xd3, 0x22, 0xa9, 0xc5, 0x87, 0x12, 0x43, 0xd7, 0x7e, + 0x04, 0x05, 0xcd, 0x7a, 0x07, 0x01, 0xc1, 0x7a, 0x07, 0x01, 0xc3, 0x7e, 0x04, 0x01, 0xcd, 0x7a, + 0x07, 0x01, 0xc7, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x04, 0x76, 0xbd, 0x7a, 0x05, 0x4b, 0x75, 0xf1, + 0x01, 0x75, 0xe1, 0x1f, 0x75, 0xe4, 0x04, 0x75, 0xf4, 0x04, 0x75, 0xf1, 0x02, 0x75, 0xe1, 0x03, + 0x75, 0xe4, 0x04, 0x75, 0xf4, 0x04, 0x43, 0xa2, 0x1c, 0x12, 0x40, 0xeb, 0x7e, 0x20, 0x00, 0x12, + 0x41, 0x8e, 0x0b, 0x20, 0xbe, 0x21, 0x2e, 0x78, 0xf6, 0xd2, 0xa8, 0x22, 0xa9, 0xd5, 0x87, 0x12, + 0x43, 0xd7, 0xd2, 0x92, 0xc2, 0xa8, 0x22, 0x75, 0xa3, 0x00, 0x53, 0xa2, 0x03, 0x75, 0xc1, 0x00, + 0x53, 0xc0, 0x03, 0x7e, 0x00, 0x05, 0x7a, 0x01, 0xf1, 0x43, 0xf4, 0x80, 0x43, 0xe4, 0x80, 0xe5, + 0xf2, 0x54, 0x7f, 0x44, 0x08, 0xf5, 0xf2, 0xe5, 0xe2, 0x54, 0x7f, 0x44, 0x08, 0xf5, 0xe2, 0x75, + 0xe1, 0x10, 0xa5, 0xd8, 0xe1, 0x22, 0x12, 0x44, 0x76, 0x12, 0x44, 0x8c, 0x12, 0x45, 0x27, 0x12, + 0x45, 0x57, 0x12, 0x49, 0x0f, 0x12, 0x44, 0xd8, 0x80, 0xec, 0xca, 0x09, 0x12, 0x44, 0x58, 0x10, + 0x01, 0x12, 0xd5, 0x51, 0x1e, 0x63, 0x53, 0x01, 0x7e, 0x00, 0x54, 0x2e, 0x01, 0x53, 0xa5, 0xe6, + 0xf5, 0x51, 0x80, 0x12, 0x20, 0x02, 0x1e, 0x75, 0x53, 0x00, 0x85, 0x54, 0x51, 0xd2, 0x02, 0x74, + 0x00, 0x80, 0x0d, 0x30, 0x02, 0x0f, 0xc2, 0x02, 0x7e, 0x00, 0x56, 0x2e, 0x01, 0x53, 0xa5, 0xe6, + 0x53, 0x90, 0xcf, 0x42, 0x90, 0xda, 0x09, 0x32, 0xe5, 0x23, 0x60, 0x19, 0x7e, 0x14, 0x00, 0x00, + 0x09, 0xb1, 0x01, 0xb9, 0xb4, 0x00, 0x02, 0x80, 0x05, 0x14, 0x19, 0xb1, 0x01, 0xb9, 0xa5, 0x0a, + 0xbe, 0x21, 0x2e, 0x78, 0xeb, 0x22, 0xc2, 0xaf, 0x7e, 0xb3, 0x3f, 0xf1, 0xb4, 0x01, 0x0a, 0xc0, + 0xf1, 0x75, 0xf1, 0x02, 0x12, 0x72, 0xff, 0xd0, 0xf1, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0xe5, 0x22, + 0x60, 0x43, 0x7e, 0x07, 0x01, 0xcb, 0xbe, 0x04, 0x03, 0x80, 0x38, 0x39, 0x7e, 0x04, 0x80, 0x00, + 0x7e, 0x20, 0x00, 0x13, 0x50, 0x21, 0x09, 0xa0, 0x00, 0x04, 0x4e, 0xa0, 0x05, 0x19, 0xa0, 0x00, + 0x04, 0x0a, 0x32, 0x09, 0x53, 0x6a, 0x93, 0x5e, 0x51, 0x27, 0x68, 0x0b, 0x09, 0xa0, 0x00, 0x10, + 0x4e, 0xa0, 0x01, 0x19, 0xa0, 0x00, 0x10, 0x2e, 0x04, 0x01, 0x00, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, + 0x78, 0xd1, 0x75, 0x22, 0x00, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0xe5, 0x26, 0x60, 0x36, 0x7e, 0x20, + 0x00, 0x7e, 0x30, 0x01, 0xe5, 0x26, 0xa5, 0x5b, 0x68, 0x21, 0x7c, 0xb2, 0x23, 0x0a, 0x2b, 0x49, + 0x32, 0x01, 0x79, 0xbe, 0x34, 0x00, 0x00, 0x68, 0x12, 0x7e, 0xb1, 0x21, 0xa5, 0x4b, 0x7a, 0xb1, + 0x21, 0xca, 0x19, 0x49, 0x22, 0x45, 0x17, 0x99, 0x24, 0xda, 0x19, 0x3e, 0x30, 0xa5, 0x0a, 0xbe, + 0x21, 0x2e, 0x78, 0xd0, 0xd2, 0xaf, 0x22, 0x4a, 0x98, 0x4d, 0xcd, 0x51, 0x02, 0x54, 0x37, 0x57, + 0x6c, 0x5a, 0xa1, 0x5d, 0xd6, 0x61, 0x0b, 0xc2, 0xaf, 0xe5, 0x24, 0x60, 0x14, 0x7e, 0x20, 0x00, + 0x13, 0x50, 0x07, 0xca, 0xb8, 0x12, 0x45, 0x44, 0xda, 0xb8, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, + 0xef, 0xd2, 0xaf, 0x22, 0xca, 0x28, 0x12, 0x6a, 0xac, 0xda, 0x28, 0x40, 0x09, 0x0a, 0x22, 0x09, + 0xb2, 0x6a, 0x93, 0xf4, 0x52, 0x24, 0x22, 0xc2, 0xaf, 0xe5, 0x23, 0x60, 0x14, 0x7e, 0x20, 0x00, + 0x13, 0x50, 0x07, 0xca, 0xb8, 0x12, 0x45, 0x74, 0xda, 0xb8, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, + 0xef, 0xd2, 0xaf, 0x22, 0x7c, 0xb2, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x45, 0x7f, 0x89, 0x24, 0x45, + 0x8f, 0x45, 0xff, 0x46, 0x6f, 0x46, 0xdf, 0x47, 0x4f, 0x47, 0xbf, 0x48, 0x2f, 0x48, 0x9f, 0x7e, + 0x27, 0x01, 0x79, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x80, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x4d, + 0x96, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x89, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x89, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xb9, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xb9, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x18, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xb9, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x7b, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x81, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x50, + 0xcb, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x8b, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x8b, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xba, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xba, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x19, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xba, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x7d, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x82, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x54, + 0x00, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x8d, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x8d, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbb, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xbb, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1a, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xbb, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x7f, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x83, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x57, + 0x35, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x8f, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x8f, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbc, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xbc, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1b, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xbc, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x81, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x84, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x5a, + 0x6a, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x91, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x91, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbd, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xbd, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1c, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xbd, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x83, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x85, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x5d, + 0x9f, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x93, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x93, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbe, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xbe, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1d, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xbe, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x85, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x86, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x60, + 0xd4, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x95, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x95, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbf, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xbf, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1e, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xbf, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0x7e, + 0x27, 0x01, 0x87, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x87, 0x00, 0x09, 0xb2, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x64, + 0x09, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, + 0x97, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x97, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xc0, 0x80, 0x2e, + 0x7e, 0x63, 0x01, 0xc0, 0xa5, 0xbe, 0x00, 0x26, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, + 0xc8, 0x12, 0x65, 0xbf, 0x40, 0x18, 0x75, 0x2f, 0xb3, 0x12, 0x7e, 0x30, 0xc2, 0x1f, 0x6c, 0x00, + 0x7a, 0x03, 0x01, 0xc0, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0x22, 0xc2, + 0xaf, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0xa9, 0x32, 0xf2, 0x1a, 0x7e, 0x07, 0x01, 0xcb, 0xbe, 0x04, + 0x00, 0x00, 0x78, 0x10, 0xe5, 0xf5, 0x33, 0x82, 0xe7, 0x40, 0x09, 0x85, 0x31, 0x2f, 0x12, 0x7e, + 0x30, 0x75, 0xf6, 0x00, 0xd0, 0xf1, 0xd2, 0xaf, 0x22, 0xc0, 0xd0, 0xc0, 0xd1, 0xc0, 0xe0, 0xc0, + 0xf0, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0xd2, 0x01, 0x75, 0x2f, 0x89, 0x12, 0x7e, 0x30, 0x7e, + 0x14, 0x80, 0x00, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, 0x49, 0xd8, 0x20, 0x70, 0x5a, + 0xa5, 0x0a, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, 0x49, 0xf0, 0x20, 0x71, 0x4b, 0xa5, + 0x0a, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, 0x4a, 0x08, 0xa5, 0x0a, 0x09, 0xb1, 0x00, + 0x08, 0x20, 0xe0, 0x03, 0x02, 0x4a, 0x20, 0x20, 0x72, 0x30, 0xa5, 0x0a, 0x09, 0xb1, 0x00, 0x08, + 0x20, 0xe0, 0x03, 0x02, 0x4a, 0x38, 0xa5, 0x0a, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, + 0x4a, 0x50, 0xa5, 0x0a, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, 0x4a, 0x68, 0xa5, 0x0a, + 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x03, 0x02, 0x4a, 0x80, 0x30, 0x04, 0x0c, 0xc2, 0x04, 0xc0, + 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0xd0, + 0xf0, 0xd0, 0xe0, 0xd0, 0xd1, 0xd0, 0xd0, 0x32, 0x75, 0x2f, 0x80, 0x12, 0x7e, 0x30, 0x54, 0x3e, + 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x66, 0x34, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, + 0x75, 0x2f, 0x81, 0x12, 0x7e, 0x30, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, + 0x66, 0x74, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, 0x75, 0x2f, 0x82, 0x12, 0x7e, 0x30, 0x54, 0x3e, + 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x66, 0xb4, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, + 0x75, 0x2f, 0x83, 0x12, 0x7e, 0x30, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, + 0x66, 0xf4, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, 0x75, 0x2f, 0x84, 0x12, 0x7e, 0x30, 0x54, 0x3e, + 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x67, 0x34, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, + 0x75, 0x2f, 0x85, 0x12, 0x7e, 0x30, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, + 0x67, 0x74, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, 0x75, 0x2f, 0x86, 0x12, 0x7e, 0x30, 0x54, 0x3e, + 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x67, 0xb4, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, + 0x75, 0x2f, 0x87, 0x12, 0x7e, 0x30, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, + 0x67, 0xf4, 0xca, 0x06, 0x4f, 0x49, 0x89, 0x54, 0x10, 0x08, 0x01, 0x22, 0x20, 0x28, 0x03, 0xd2, + 0x08, 0x22, 0x75, 0x2f, 0xa0, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x80, 0x00, 0x80, 0x06, 0x20, 0x28, + 0x03, 0xd2, 0x08, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, + 0x03, 0x12, 0x4d, 0x96, 0x30, 0x30, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x08, 0x22, 0x30, 0xe6, 0x02, + 0xd2, 0x60, 0x7e, 0x37, 0x01, 0x79, 0x7e, 0x27, 0x01, 0x99, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, + 0x2e, 0x05, 0x32, 0x7a, 0x05, 0x32, 0x7a, 0x37, 0x01, 0x79, 0x7e, 0x37, 0x01, 0x59, 0x7d, 0x43, + 0x2d, 0x42, 0xbe, 0x44, 0x0d, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x59, 0x75, 0x2f, 0x94, 0x12, + 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, 0x60, 0xc4, 0x22, 0xc2, + 0x60, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x79, 0xbe, 0x24, 0x00, + 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x99, 0x28, 0x04, 0x7e, 0x27, 0x01, 0x99, 0x7e, 0x37, 0x01, + 0x79, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x32, 0x7a, 0x05, 0x32, 0x7a, 0x37, 0x01, 0x79, 0x7e, + 0x37, 0x01, 0x59, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x0d, 0xcc, 0x38, 0x13, 0x7a, 0x47, 0x01, + 0x59, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x02, 0x68, 0x34, + 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x0d, 0xcd, + 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, 0x09, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, + 0x59, 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x4b, 0x0b, 0x22, 0xd2, 0x08, 0x7e, + 0x04, 0x09, 0xcd, 0x7a, 0x07, 0x01, 0x59, 0x7a, 0x07, 0x01, 0x69, 0x75, 0x2f, 0x94, 0x12, 0x7e, + 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, 0x30, 0xd2, 0x04, + 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, 0x37, 0x01, 0xcb, + 0x7e, 0x27, 0x01, 0xa9, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x3c, + 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, + 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, + 0x00, 0x00, 0x2e, 0x27, 0x01, 0xa9, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x7e, + 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, 0x2f, 0x99, 0x12, + 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x38, 0x0a, 0x09, + 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x10, 0x22, 0x80, 0x7f, 0x7a, 0x51, + 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x00, 0x00, 0x2e, 0x67, + 0x01, 0xa9, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x69, 0x04, + 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x69, 0x04, 0x7a, + 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, + 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x00, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, + 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0xbd, 0x04, + 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, + 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, + 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, 0x7e, 0x04, 0x01, + 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, + 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, + 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, + 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, + 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x4c, 0x6f, 0x75, + 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, + 0x38, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x10, 0x22, 0xda, + 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x4c, 0x6f, 0xda, 0xb8, 0x02, + 0x4d, 0x96, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, + 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, + 0x68, 0x04, 0xd2, 0x58, 0x80, 0x02, 0xc2, 0x58, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, + 0x50, 0x80, 0x02, 0xc2, 0x50, 0x12, 0x42, 0xac, 0x02, 0x65, 0x9c, 0x75, 0x2f, 0x91, 0x12, 0x7e, + 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, 0x08, 0xd2, 0x04, + 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x65, + 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, + 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x4c, 0xc3, 0x75, + 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, 0x10, 0x09, 0x01, + 0x22, 0x20, 0x29, 0x03, 0xd2, 0x09, 0x22, 0x75, 0x2f, 0xa1, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x81, + 0x00, 0x80, 0x06, 0x20, 0x29, 0x03, 0xd2, 0x09, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, + 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x50, 0xcb, 0x30, 0x31, 0x06, 0x20, 0xe6, 0x4f, 0xd2, + 0x09, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x61, 0x7e, 0x37, 0x01, 0x7b, 0x7e, 0x27, 0x01, 0x9b, 0x9d, + 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x34, 0x7a, 0x05, 0x34, 0x7a, 0x37, 0x01, 0x7b, 0x7e, + 0x37, 0x01, 0x5b, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x11, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, + 0x5b, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, + 0x10, 0x61, 0xc4, 0x22, 0xc2, 0x61, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, + 0x01, 0x7b, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x9b, 0x28, 0x04, 0x7e, 0x27, + 0x01, 0x9b, 0x7e, 0x37, 0x01, 0x7b, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x34, 0x7a, 0x05, 0x34, + 0x7a, 0x37, 0x01, 0x7b, 0x7e, 0x37, 0x01, 0x5b, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x11, 0xcc, + 0x38, 0x13, 0x7a, 0x47, 0x01, 0x5b, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, + 0x7e, 0x30, 0x02, 0x68, 0x34, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, + 0x30, 0x9e, 0x44, 0x11, 0xcd, 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, 0x0d, 0xcd, 0x7d, 0x24, + 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x5b, 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x4e, + 0x40, 0x22, 0xd2, 0x09, 0x7e, 0x04, 0x0d, 0xcd, 0x7a, 0x07, 0x01, 0x5b, 0x7a, 0x07, 0x01, 0x6b, + 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, + 0x12, 0x7e, 0x30, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, + 0x70, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xab, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, + 0x34, 0x04, 0x00, 0x38, 0x3c, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, + 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, + 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x01, 0x00, 0x2e, 0x27, 0x01, 0xab, 0x1b, 0x38, 0x20, 0x0b, 0x35, + 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, + 0x04, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, + 0x04, 0x30, 0x39, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x11, + 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, + 0x64, 0x01, 0x00, 0x2e, 0x67, 0x01, 0xab, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, + 0x0b, 0x35, 0x12, 0x69, 0x04, 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, + 0xc9, 0x02, 0x69, 0x04, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, + 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x01, 0x7a, + 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, + 0x12, 0x7e, 0x30, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, + 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, + 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, + 0x80, 0x2a, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, + 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, + 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, + 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, + 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, + 0xe7, 0x02, 0x4f, 0xa4, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, + 0x19, 0xb1, 0x00, 0x04, 0x30, 0x39, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, + 0x10, 0xd2, 0x11, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, + 0x4f, 0xa4, 0xda, 0xb8, 0x02, 0x50, 0xcb, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, + 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, + 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x59, 0x80, 0x02, 0xc2, 0x59, 0xa5, 0xfd, 0x5e, + 0x50, 0x80, 0x68, 0x04, 0xd2, 0x51, 0x80, 0x02, 0xc2, 0x51, 0x12, 0x42, 0xc3, 0x02, 0x65, 0x9c, + 0x75, 0x2f, 0x91, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, + 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, + 0x7e, 0xa0, 0x80, 0x12, 0x65, 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, + 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, + 0x22, 0x02, 0x4f, 0xf8, 0x75, 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, + 0x30, 0x22, 0x10, 0x0a, 0x01, 0x22, 0x20, 0x2a, 0x03, 0xd2, 0x0a, 0x22, 0x75, 0x2f, 0xa2, 0x12, + 0x7e, 0x30, 0x7e, 0x14, 0x82, 0x00, 0x80, 0x06, 0x20, 0x2a, 0x03, 0xd2, 0x0a, 0x22, 0x09, 0xb1, + 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x54, 0x00, 0x30, 0x32, + 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0a, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x62, 0x7e, 0x37, 0x01, 0x7d, + 0x7e, 0x27, 0x01, 0x9d, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x36, 0x7a, 0x05, 0x36, + 0x7a, 0x37, 0x01, 0x7d, 0x7e, 0x37, 0x01, 0x5d, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x15, 0xcc, + 0x38, 0x68, 0x7a, 0x47, 0x01, 0x5d, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, + 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, 0x62, 0xc4, 0x22, 0xc2, 0x62, 0x2d, 0x23, 0x68, 0x78, 0x6d, + 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x7d, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, + 0x9d, 0x28, 0x04, 0x7e, 0x27, 0x01, 0x9d, 0x7e, 0x37, 0x01, 0x7d, 0x9d, 0x32, 0x7d, 0x02, 0x2e, + 0x05, 0x36, 0x7a, 0x05, 0x36, 0x7a, 0x37, 0x01, 0x7d, 0x7e, 0x37, 0x01, 0x5d, 0x7d, 0x43, 0x2d, + 0x42, 0xbe, 0x44, 0x15, 0xcc, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x5d, 0x75, 0x2f, 0x94, 0x12, 0x7e, + 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x02, 0x68, 0x34, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, + 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x15, 0xcd, 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, + 0x34, 0x11, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x5d, 0x12, 0x68, 0x34, 0xbe, 0x25, + 0x20, 0x78, 0x03, 0x02, 0x51, 0x75, 0x22, 0xd2, 0x0a, 0x7e, 0x04, 0x11, 0xcd, 0x7a, 0x07, 0x01, + 0x5d, 0x7a, 0x07, 0x01, 0x6d, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, + 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, 0x30, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, + 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xad, 0x2e, 0x24, + 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x3c, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, + 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, + 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x02, 0x00, 0x2e, 0x27, 0x01, 0xad, + 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, + 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, + 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3a, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, + 0xb1, 0x00, 0x10, 0xd2, 0x12, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, + 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x02, 0x00, 0x2e, 0x67, 0x01, 0xad, 0x9e, 0x24, 0x00, 0x02, + 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x69, 0x04, 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, + 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x69, 0x04, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, + 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, + 0x23, 0x23, 0x44, 0x02, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, + 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, + 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, + 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, + 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, + 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, + 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, + 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, + 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, + 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x52, 0xd9, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, + 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3a, 0x0a, 0x09, 0xb1, 0x00, 0x10, + 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x12, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, + 0x68, 0x07, 0xca, 0xb8, 0x12, 0x52, 0xd9, 0xda, 0xb8, 0x02, 0x54, 0x00, 0x09, 0xb1, 0x00, 0x18, + 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, + 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5a, 0x80, 0x02, + 0xc2, 0x5a, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x52, 0x80, 0x02, 0xc2, 0x52, 0x12, + 0x42, 0xda, 0x02, 0x65, 0x9c, 0x75, 0x2f, 0x91, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, + 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, + 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x65, 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, + 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, + 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x53, 0x2d, 0x75, 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, + 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, 0x10, 0x0b, 0x01, 0x22, 0x20, 0x2b, 0x03, 0xd2, 0x0b, + 0x22, 0x75, 0x2f, 0xa3, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x83, 0x00, 0x80, 0x06, 0x20, 0x2b, 0x03, + 0xd2, 0x0b, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, + 0x12, 0x57, 0x35, 0x30, 0x33, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0b, 0x22, 0x30, 0xe6, 0x02, 0xd2, + 0x63, 0x7e, 0x37, 0x01, 0x7f, 0x7e, 0x27, 0x01, 0x9f, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, + 0x05, 0x38, 0x7a, 0x05, 0x38, 0x7a, 0x37, 0x01, 0x7f, 0x7e, 0x37, 0x01, 0x5f, 0x7d, 0x43, 0x2d, + 0x42, 0xbe, 0x44, 0x19, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x5f, 0x75, 0x2f, 0x94, 0x12, 0x7e, + 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, 0x63, 0xc4, 0x22, 0xc2, 0x63, + 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x7f, 0xbe, 0x24, 0x00, 0x00, + 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x9f, 0x28, 0x04, 0x7e, 0x27, 0x01, 0x9f, 0x7e, 0x37, 0x01, 0x7f, + 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x38, 0x7a, 0x05, 0x38, 0x7a, 0x37, 0x01, 0x7f, 0x7e, 0x37, + 0x01, 0x5f, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x19, 0xcc, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x5f, + 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x02, 0x68, 0x34, 0x75, + 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x19, 0xcd, 0x9d, + 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, 0x15, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x5f, + 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x54, 0xaa, 0x22, 0xd2, 0x0b, 0x7e, 0x04, + 0x15, 0xcd, 0x7a, 0x07, 0x01, 0x5f, 0x7a, 0x07, 0x01, 0x6f, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, + 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, 0x30, 0xd2, 0x04, 0x09, + 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, 0x37, 0x01, 0xcb, 0x7e, + 0x27, 0x01, 0xaf, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x3c, 0x7d, + 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, + 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x03, + 0x00, 0x2e, 0x27, 0x01, 0xaf, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, + 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, 0x2f, 0x99, 0x12, 0x7e, + 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3b, 0x0a, 0x09, 0xb1, + 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x13, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, + 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x03, 0x00, 0x2e, 0x67, 0x01, + 0xaf, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x69, 0x04, 0x7e, + 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x69, 0x04, 0x7a, 0x39, + 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, + 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x03, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, + 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0xbd, 0x04, 0x68, + 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, + 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, + 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, 0x7e, 0x04, 0x01, 0xcd, + 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, + 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, + 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, + 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, + 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x56, 0x0e, 0x75, 0x2f, + 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3b, + 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x13, 0x22, 0xda, 0xb8, + 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x56, 0x0e, 0xda, 0xb8, 0x02, 0x57, + 0x35, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, + 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, + 0x04, 0xd2, 0x5b, 0x80, 0x02, 0xc2, 0x5b, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x53, + 0x80, 0x02, 0xc2, 0x53, 0x12, 0x42, 0xf1, 0x02, 0x65, 0x9c, 0x75, 0x2f, 0x91, 0x12, 0x7e, 0x30, + 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, + 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x65, 0x9c, + 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, + 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x56, 0x62, 0x75, 0x2f, + 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, 0x10, 0x0c, 0x01, 0x22, + 0x20, 0x2c, 0x03, 0xd2, 0x0c, 0x22, 0x75, 0x2f, 0xa4, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x84, 0x00, + 0x80, 0x06, 0x20, 0x2c, 0x03, 0xd2, 0x0c, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, + 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x5a, 0x6a, 0x30, 0x34, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0c, + 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x64, 0x7e, 0x37, 0x01, 0x81, 0x7e, 0x27, 0x01, 0xa1, 0x9d, 0x32, + 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x3a, 0x7a, 0x05, 0x3a, 0x7a, 0x37, 0x01, 0x81, 0x7e, 0x37, + 0x01, 0x61, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x1d, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x61, + 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, + 0x64, 0xc4, 0x22, 0xc2, 0x64, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, + 0x81, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa1, 0x28, 0x04, 0x7e, 0x27, 0x01, + 0xa1, 0x7e, 0x37, 0x01, 0x81, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x3a, 0x7a, 0x05, 0x3a, 0x7a, + 0x37, 0x01, 0x81, 0x7e, 0x37, 0x01, 0x61, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x1d, 0xcc, 0x38, + 0x13, 0x7a, 0x47, 0x01, 0x61, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, + 0x30, 0x02, 0x68, 0x34, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, + 0x9e, 0x44, 0x1d, 0xcd, 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, 0x19, 0xcd, 0x7d, 0x24, 0x2d, + 0x43, 0x7a, 0x47, 0x01, 0x61, 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x57, 0xdf, + 0x22, 0xd2, 0x0c, 0x7e, 0x04, 0x19, 0xcd, 0x7a, 0x07, 0x01, 0x61, 0x7a, 0x07, 0x01, 0x71, 0x75, + 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, + 0x7e, 0x30, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, + 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb1, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, + 0x04, 0x00, 0x38, 0x3c, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, + 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, + 0x01, 0xc9, 0x7e, 0x24, 0x04, 0x00, 0x2e, 0x27, 0x01, 0xb1, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, + 0x51, 0x2f, 0x12, 0x7e, 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, + 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, + 0x30, 0x3c, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x14, 0x22, + 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, + 0x04, 0x00, 0x2e, 0x67, 0x01, 0xb1, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, + 0x35, 0x12, 0x69, 0x04, 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, + 0x02, 0x69, 0x04, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, + 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x04, 0x7a, 0x69, + 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, + 0x7e, 0x30, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, + 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, + 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, + 0x2a, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, + 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, + 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, + 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, + 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, + 0x02, 0x59, 0x43, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, + 0xb1, 0x00, 0x04, 0x30, 0x3c, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, + 0xd2, 0x14, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x59, + 0x43, 0xda, 0xb8, 0x02, 0x5a, 0x6a, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, + 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, + 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5c, 0x80, 0x02, 0xc2, 0x5c, 0xa5, 0xfd, 0x5e, 0x50, + 0x80, 0x68, 0x04, 0xd2, 0x54, 0x80, 0x02, 0xc2, 0x54, 0x12, 0x43, 0x08, 0x02, 0x65, 0x9c, 0x75, + 0x2f, 0x91, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, + 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, + 0xa0, 0x80, 0x12, 0x65, 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, + 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, + 0x02, 0x59, 0x97, 0x75, 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, + 0x22, 0x10, 0x0d, 0x01, 0x22, 0x20, 0x2d, 0x03, 0xd2, 0x0d, 0x22, 0x75, 0x2f, 0xa5, 0x12, 0x7e, + 0x30, 0x7e, 0x14, 0x85, 0x00, 0x80, 0x06, 0x20, 0x2d, 0x03, 0xd2, 0x0d, 0x22, 0x09, 0xb1, 0x00, + 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x5d, 0x9f, 0x30, 0x35, 0x06, + 0x20, 0xe6, 0x4f, 0xd2, 0x0d, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x65, 0x7e, 0x37, 0x01, 0x83, 0x7e, + 0x27, 0x01, 0xa3, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x3c, 0x7a, 0x05, 0x3c, 0x7a, + 0x37, 0x01, 0x83, 0x7e, 0x37, 0x01, 0x63, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x21, 0xcc, 0x38, + 0x68, 0x7a, 0x47, 0x01, 0x63, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, + 0x30, 0x12, 0x68, 0x34, 0x10, 0x65, 0xc4, 0x22, 0xc2, 0x65, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, + 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x83, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa3, + 0x28, 0x04, 0x7e, 0x27, 0x01, 0xa3, 0x7e, 0x37, 0x01, 0x83, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, + 0x3c, 0x7a, 0x05, 0x3c, 0x7a, 0x37, 0x01, 0x83, 0x7e, 0x37, 0x01, 0x63, 0x7d, 0x43, 0x2d, 0x42, + 0xbe, 0x44, 0x21, 0xcc, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x63, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, + 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x02, 0x68, 0x34, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, + 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x21, 0xcd, 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, + 0x1d, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x63, 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, + 0x78, 0x03, 0x02, 0x5b, 0x14, 0x22, 0xd2, 0x0d, 0x7e, 0x04, 0x1d, 0xcd, 0x7a, 0x07, 0x01, 0x63, + 0x7a, 0x07, 0x01, 0x73, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, + 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, 0x30, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, + 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb3, 0x2e, 0x24, 0x00, + 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x3c, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, + 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, + 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x05, 0x00, 0x2e, 0x27, 0x01, 0xb3, 0x1b, + 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, + 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, + 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3d, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, + 0x00, 0x10, 0xd2, 0x15, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, + 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x05, 0x00, 0x2e, 0x67, 0x01, 0xb3, 0x9e, 0x24, 0x00, 0x02, 0x40, + 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x69, 0x04, 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, + 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x69, 0x04, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, + 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, + 0x23, 0x44, 0x05, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, + 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, + 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, + 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, + 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, + 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, + 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, + 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, + 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, + 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x5c, 0x78, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, + 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3d, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, + 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x15, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, + 0x07, 0xca, 0xb8, 0x12, 0x5c, 0x78, 0xda, 0xb8, 0x02, 0x5d, 0x9f, 0x09, 0xb1, 0x00, 0x18, 0x7e, + 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, + 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5d, 0x80, 0x02, 0xc2, + 0x5d, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x55, 0x80, 0x02, 0xc2, 0x55, 0x12, 0x43, + 0x1f, 0x02, 0x65, 0x9c, 0x75, 0x2f, 0x91, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, + 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, + 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x65, 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, + 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, + 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x5c, 0xcc, 0x75, 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, + 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, 0x10, 0x0e, 0x01, 0x22, 0x20, 0x2e, 0x03, 0xd2, 0x0e, 0x22, + 0x75, 0x2f, 0xa6, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x86, 0x00, 0x80, 0x06, 0x20, 0x2e, 0x03, 0xd2, + 0x0e, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, + 0x60, 0xd4, 0x30, 0x36, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0e, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x66, + 0x7e, 0x37, 0x01, 0x85, 0x7e, 0x27, 0x01, 0xa5, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, + 0x3e, 0x7a, 0x05, 0x3e, 0x7a, 0x37, 0x01, 0x85, 0x7e, 0x37, 0x01, 0x65, 0x7d, 0x43, 0x2d, 0x42, + 0xbe, 0x44, 0x25, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x65, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, + 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, 0x66, 0xc4, 0x22, 0xc2, 0x66, 0x2d, + 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x85, 0xbe, 0x24, 0x00, 0x00, 0x68, + 0x6a, 0xbe, 0x27, 0x01, 0xa5, 0x28, 0x04, 0x7e, 0x27, 0x01, 0xa5, 0x7e, 0x37, 0x01, 0x85, 0x9d, + 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x3e, 0x7a, 0x05, 0x3e, 0x7a, 0x37, 0x01, 0x85, 0x7e, 0x37, 0x01, + 0x65, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x25, 0xcc, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x65, 0x75, + 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x02, 0x68, 0x34, 0x75, 0x2f, + 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x25, 0xcd, 0x9d, 0x24, + 0x12, 0x68, 0x34, 0x7e, 0x34, 0x21, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x65, 0x12, + 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x5e, 0x49, 0x22, 0xd2, 0x0e, 0x7e, 0x04, 0x21, + 0xcd, 0x7a, 0x07, 0x01, 0x65, 0x7a, 0x07, 0x01, 0x75, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x75, + 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, 0x30, 0xd2, 0x04, 0x09, 0xb1, + 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, + 0x01, 0xb5, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x3c, 0x7d, 0x02, + 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, + 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x06, 0x00, + 0x2e, 0x27, 0x01, 0xb5, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0xbe, + 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, + 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3e, 0x0a, 0x09, 0xb1, 0x00, + 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x16, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, + 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x06, 0x00, 0x2e, 0x67, 0x01, 0xb5, + 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x69, 0x04, 0x7e, 0x34, + 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x69, 0x04, 0x7a, 0x39, 0xc0, + 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, + 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x06, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, + 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0xbd, 0x04, 0x68, 0x2b, + 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, + 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, + 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, 0x7e, 0x04, 0x01, 0xcd, 0x80, + 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, + 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, + 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, + 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, + 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x5f, 0xad, 0x75, 0x2f, 0x99, + 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3e, 0x0a, + 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x16, 0x22, 0xda, 0xb8, 0x30, + 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x5f, 0xad, 0xda, 0xb8, 0x02, 0x60, 0xd4, + 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, + 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, + 0xd2, 0x5e, 0x80, 0x02, 0xc2, 0x5e, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x56, 0x80, + 0x02, 0xc2, 0x56, 0x12, 0x43, 0x36, 0x02, 0x65, 0x9c, 0x75, 0x2f, 0x91, 0x12, 0x7e, 0x30, 0x09, + 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, + 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x65, 0x9c, 0xca, + 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, + 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x60, 0x01, 0x75, 0x2f, 0x95, + 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, 0x10, 0x0f, 0x01, 0x22, 0x20, + 0x2f, 0x03, 0xd2, 0x0f, 0x22, 0x75, 0x2f, 0xa7, 0x12, 0x7e, 0x30, 0x7e, 0x14, 0x87, 0x00, 0x80, + 0x06, 0x20, 0x2f, 0x03, 0xd2, 0x0f, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, + 0xda, 0xb8, 0x68, 0x03, 0x12, 0x64, 0x09, 0x30, 0x37, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0f, 0x22, + 0x30, 0xe6, 0x02, 0xd2, 0x67, 0x7e, 0x37, 0x01, 0x87, 0x7e, 0x27, 0x01, 0xa7, 0x9d, 0x32, 0x40, + 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x40, 0x7a, 0x05, 0x40, 0x7a, 0x37, 0x01, 0x87, 0x7e, 0x37, 0x01, + 0x67, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x29, 0xcc, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x67, 0x75, + 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x68, 0x34, 0x10, 0x67, + 0xc4, 0x22, 0xc2, 0x67, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x87, + 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa7, 0x28, 0x04, 0x7e, 0x27, 0x01, 0xa7, + 0x7e, 0x37, 0x01, 0x87, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x40, 0x7a, 0x05, 0x40, 0x7a, 0x37, + 0x01, 0x87, 0x7e, 0x37, 0x01, 0x67, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x29, 0xcc, 0x38, 0x13, + 0x7a, 0x47, 0x01, 0x67, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, + 0x02, 0x68, 0x34, 0x75, 0x2f, 0x94, 0x12, 0x7e, 0x30, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, + 0x44, 0x29, 0xcd, 0x9d, 0x24, 0x12, 0x68, 0x34, 0x7e, 0x34, 0x25, 0xcd, 0x7d, 0x24, 0x2d, 0x43, + 0x7a, 0x47, 0x01, 0x67, 0x12, 0x68, 0x34, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x61, 0x7e, 0x22, + 0xd2, 0x0f, 0x7e, 0x04, 0x25, 0xcd, 0x7a, 0x07, 0x01, 0x67, 0x7a, 0x07, 0x01, 0x77, 0x75, 0x2f, + 0x94, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x7e, + 0x30, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x70, 0x7e, + 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb7, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, + 0x00, 0x38, 0x3c, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, + 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x44, 0x7a, 0x47, 0x01, + 0xc9, 0x7e, 0x24, 0x07, 0x00, 0x2e, 0x27, 0x01, 0xb7, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, + 0x2f, 0x12, 0x7e, 0x30, 0xbe, 0x50, 0x38, 0x78, 0x03, 0x02, 0x69, 0x1f, 0x02, 0x69, 0x04, 0x75, + 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, + 0x3f, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x17, 0x22, 0x80, + 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x24, 0x7e, 0x64, 0x07, + 0x00, 0x2e, 0x67, 0x01, 0xb7, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, + 0x12, 0x69, 0x04, 0x7e, 0x34, 0x01, 0xcd, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, + 0x69, 0x04, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x01, 0xcd, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, + 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x07, 0x7a, 0x69, 0xb0, + 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, + 0x30, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, + 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, + 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x28, 0x7e, 0x04, 0x01, 0xcd, 0x80, 0x2a, + 0x7e, 0x04, 0x01, 0xcd, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, + 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, + 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, + 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, + 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, + 0x62, 0xe2, 0x75, 0x2f, 0x99, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, + 0x00, 0x04, 0x30, 0x3f, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, + 0x17, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x62, 0xe2, + 0xda, 0xb8, 0x02, 0x64, 0x09, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, + 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, + 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5f, 0x80, 0x02, 0xc2, 0x5f, 0xa5, 0xfd, 0x5e, 0x50, 0x80, + 0x68, 0x04, 0xd2, 0x57, 0x80, 0x02, 0xc2, 0x57, 0x12, 0x43, 0x4d, 0x02, 0x65, 0x9c, 0x75, 0x2f, + 0x91, 0x12, 0x7e, 0x30, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x20, 0xe0, + 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x65, 0x9c, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, + 0x80, 0x12, 0x65, 0x9c, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, + 0x09, 0x61, 0x00, 0x00, 0x12, 0x65, 0xbf, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, + 0x63, 0x36, 0x75, 0x2f, 0x95, 0x12, 0x7e, 0x30, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x7e, 0x30, 0x22, + 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, + 0x20, 0x68, 0x04, 0xd2, 0x58, 0x80, 0x02, 0xc2, 0x58, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, + 0xd2, 0x50, 0x80, 0x02, 0xc2, 0x50, 0x02, 0x65, 0x88, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, + 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x59, 0x80, 0x02, + 0xc2, 0x59, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x51, 0x80, 0x02, 0xc2, 0x51, 0x02, + 0x65, 0x88, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, + 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5a, 0x80, 0x02, 0xc2, 0x5a, 0xa5, 0xfd, 0x5e, 0x50, 0x80, + 0x68, 0x04, 0xd2, 0x52, 0x80, 0x02, 0xc2, 0x52, 0x02, 0x65, 0x88, 0x7c, 0x02, 0x7e, 0x14, 0x80, + 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5b, + 0x80, 0x02, 0xc2, 0x5b, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x53, 0x80, 0x02, 0xc2, + 0x53, 0x02, 0x65, 0x88, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, + 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5c, 0x80, 0x02, 0xc2, 0x5c, 0xa5, 0xfd, 0x5e, + 0x50, 0x80, 0x68, 0x04, 0xd2, 0x54, 0x80, 0x02, 0xc2, 0x54, 0x02, 0x65, 0x88, 0x7c, 0x02, 0x7e, + 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, + 0xd2, 0x5d, 0x80, 0x02, 0xc2, 0x5d, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x55, 0x80, + 0x02, 0xc2, 0x55, 0x02, 0x65, 0x88, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, + 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5e, 0x80, 0x02, 0xc2, 0x5e, 0xa5, + 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x56, 0x80, 0x02, 0xc2, 0x56, 0x02, 0x65, 0x88, 0x7c, + 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, + 0x68, 0x04, 0xd2, 0x5f, 0x80, 0x02, 0xc2, 0x5f, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, + 0x57, 0x80, 0x02, 0xc2, 0x57, 0x02, 0x65, 0x88, 0x54, 0xf0, 0xc4, 0xa5, 0xff, 0xc4, 0xa5, 0x4f, + 0x75, 0x2f, 0x90, 0x12, 0x7e, 0x30, 0xf5, 0x2f, 0x12, 0x7e, 0x30, 0x22, 0xca, 0x19, 0x5e, 0x20, + 0x07, 0x4c, 0xa2, 0x7e, 0x74, 0x29, 0xcd, 0xca, 0x79, 0x7a, 0x79, 0xa0, 0x0b, 0x74, 0x7a, 0x79, + 0xb0, 0x0b, 0x74, 0xda, 0x79, 0x7e, 0x30, 0x02, 0x7e, 0x64, 0x00, 0x02, 0x02, 0x65, 0xe7, 0xca, + 0x19, 0x5e, 0x20, 0x07, 0x4c, 0xa2, 0x7e, 0x74, 0x29, 0xcd, 0xca, 0x79, 0x7a, 0x79, 0xa0, 0x0b, + 0x74, 0x7a, 0x79, 0xb0, 0x0b, 0x74, 0x7a, 0x79, 0x60, 0x0b, 0x74, 0xda, 0x79, 0x7e, 0x30, 0x03, + 0x7e, 0x64, 0x00, 0x03, 0x02, 0x65, 0xe7, 0xd2, 0x04, 0x7e, 0x27, 0x01, 0xcb, 0x2d, 0x26, 0xbe, + 0x24, 0x04, 0x00, 0x38, 0x2e, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x05, 0xcd, 0x7e, 0x79, 0xa0, + 0x7a, 0x09, 0xa0, 0x0b, 0x04, 0x0b, 0x74, 0xbd, 0x04, 0x68, 0x23, 0xa5, 0xdb, 0xef, 0x7a, 0x27, + 0x01, 0xcb, 0x7e, 0x25, 0x30, 0x2d, 0x26, 0x7a, 0x25, 0x30, 0x7a, 0x07, 0x01, 0xc9, 0xda, 0x19, + 0xc2, 0xd7, 0x22, 0x75, 0x2f, 0x9a, 0x12, 0x7e, 0x30, 0xda, 0x19, 0xd2, 0xd7, 0x22, 0x7e, 0x04, + 0x01, 0xcd, 0x80, 0xd7, 0x4d, 0x42, 0x4a, 0xae, 0x4b, 0xa8, 0x4d, 0x7b, 0x49, 0x4f, 0x49, 0x4f, + 0x4c, 0xa7, 0x49, 0x4f, 0x4d, 0xbf, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x4d, 0xc6, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x50, 0x77, 0x4d, 0xe3, 0x4e, 0xdd, 0x50, 0xb0, 0x49, 0x4f, 0x49, 0x4f, + 0x4f, 0xdc, 0x49, 0x4f, 0x50, 0xf4, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x50, 0xfb, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x53, 0xac, 0x51, 0x18, 0x52, 0x12, 0x53, 0xe5, 0x49, 0x4f, 0x49, 0x4f, + 0x53, 0x11, 0x49, 0x4f, 0x54, 0x29, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x54, 0x30, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x56, 0xe1, 0x54, 0x4d, 0x55, 0x47, 0x57, 0x1a, 0x49, 0x4f, 0x49, 0x4f, + 0x56, 0x46, 0x49, 0x4f, 0x57, 0x5e, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x57, 0x65, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x5a, 0x16, 0x57, 0x82, 0x58, 0x7c, 0x5a, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x59, 0x7b, 0x49, 0x4f, 0x5a, 0x93, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x5a, 0x9a, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x5d, 0x4b, 0x5a, 0xb7, 0x5b, 0xb1, 0x5d, 0x84, 0x49, 0x4f, 0x49, 0x4f, + 0x5c, 0xb0, 0x49, 0x4f, 0x5d, 0xc8, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x5d, 0xcf, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x60, 0x80, 0x5d, 0xec, 0x5e, 0xe6, 0x60, 0xb9, 0x49, 0x4f, 0x49, 0x4f, + 0x5f, 0xe5, 0x49, 0x4f, 0x60, 0xfd, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x61, 0x04, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x63, 0xb5, 0x61, 0x21, 0x62, 0x1b, 0x63, 0xee, 0x49, 0x4f, 0x49, 0x4f, + 0x63, 0x1a, 0x49, 0x4f, 0x64, 0x32, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x64, 0x39, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, 0x49, 0x4f, + 0x49, 0x4f, 0x49, 0x4f, 0xca, 0x29, 0x1e, 0x50, 0x40, 0x0d, 0x7e, 0x54, 0x0b, 0x10, 0x9c, 0xb5, + 0xa4, 0x2e, 0x54, 0x68, 0x51, 0x89, 0x54, 0x7e, 0x39, 0x00, 0x7a, 0x19, 0x00, 0x0b, 0x34, 0x80, + 0xe9, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, + 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, + 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, + 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, + 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, + 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, + 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, + 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, + 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, + 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, + 0x00, 0x7a, 0x19, 0x10, 0x0b, 0x35, 0x0b, 0x38, 0x00, 0x7a, 0x19, 0x00, 0x7a, 0x19, 0x10, 0x0b, + 0x35, 0xda, 0x29, 0x22, 0x1e, 0x50, 0x40, 0x0d, 0x7e, 0x54, 0x0b, 0x1c, 0x9c, 0xb5, 0xa4, 0x2e, + 0x54, 0x69, 0x1f, 0x89, 0x54, 0x7e, 0x19, 0x00, 0x7a, 0x39, 0x00, 0x0b, 0x34, 0x80, 0xe9, 0x7e, + 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, + 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, + 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, + 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, + 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, + 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, + 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, + 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, + 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, + 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, + 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, + 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, + 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, + 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, + 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, + 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, + 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, + 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, + 0x7e, 0x19, 0x10, 0x1b, 0x38, 0x00, 0x0b, 0x35, 0x7e, 0x19, 0x00, 0x7e, 0x19, 0x10, 0x1b, 0x38, + 0x00, 0x0b, 0x35, 0x22, 0x6a, 0x9b, 0x6c, 0x4f, 0x6c, 0x67, 0x6c, 0x82, 0x6d, 0x1d, 0x6d, 0xb5, + 0x6d, 0xd0, 0x6e, 0x62, 0x6d, 0xeb, 0x6e, 0x2c, 0x7c, 0xb3, 0xbe, 0xb0, 0x09, 0x28, 0x14, 0x75, + 0x2f, 0x09, 0x12, 0x7e, 0x30, 0x75, 0x57, 0x10, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x43, 0xe1, 0xc0, + 0xd0, 0xf1, 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x23, 0x6c, 0xaa, 0x2e, 0x54, 0x6a, 0x54, 0x0b, 0x58, + 0x50, 0x89, 0x54, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x75, 0x2f, 0xb0, 0x12, 0x7e, + 0x30, 0x0a, 0x22, 0x09, 0xb2, 0x6a, 0x93, 0x42, 0x24, 0xd0, 0xa8, 0x22, 0x7c, 0xb2, 0x23, 0x0a, + 0x3b, 0x49, 0x33, 0x6a, 0xb7, 0x89, 0x34, 0x6a, 0xc7, 0x6a, 0xf5, 0x6b, 0x23, 0x6b, 0x51, 0x6b, + 0x7f, 0x6b, 0xad, 0x6b, 0xdb, 0x6c, 0x09, 0x12, 0x41, 0xa9, 0xd2, 0x28, 0xd2, 0x08, 0xc2, 0x40, + 0xc2, 0x48, 0xc2, 0x38, 0xc2, 0x30, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xb9, 0x7e, 0x04, 0x00, 0x20, + 0x7a, 0x07, 0x01, 0x99, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xa9, 0x12, 0x41, 0x16, 0x12, + 0x64, 0x40, 0x02, 0x6c, 0x37, 0x12, 0x41, 0xc6, 0xd2, 0x29, 0xd2, 0x09, 0xc2, 0x41, 0xc2, 0x49, + 0xc2, 0x39, 0xc2, 0x31, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xba, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, + 0x01, 0x9b, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xab, 0x12, 0x41, 0x16, 0x12, 0x64, 0x69, + 0x02, 0x6c, 0x37, 0x12, 0x41, 0xe3, 0xd2, 0x2a, 0xd2, 0x0a, 0xc2, 0x42, 0xc2, 0x4a, 0xc2, 0x3a, + 0xc2, 0x32, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbb, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0x9d, + 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xad, 0x12, 0x41, 0x16, 0x12, 0x64, 0x92, 0x02, 0x6c, + 0x37, 0x12, 0x42, 0x00, 0xd2, 0x2b, 0xd2, 0x0b, 0xc2, 0x43, 0xc2, 0x4b, 0xc2, 0x3b, 0xc2, 0x33, + 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbc, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0x9f, 0x7e, 0x04, + 0x00, 0x38, 0x7a, 0x07, 0x01, 0xaf, 0x12, 0x41, 0x16, 0x12, 0x64, 0xbb, 0x02, 0x6c, 0x37, 0x12, + 0x42, 0x1d, 0xd2, 0x2c, 0xd2, 0x0c, 0xc2, 0x44, 0xc2, 0x4c, 0xc2, 0x3c, 0xc2, 0x34, 0x6d, 0x00, + 0x7a, 0x03, 0x01, 0xbd, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa1, 0x7e, 0x04, 0x00, 0x38, + 0x7a, 0x07, 0x01, 0xb1, 0x12, 0x41, 0x16, 0x12, 0x64, 0xe4, 0x02, 0x6c, 0x37, 0x12, 0x42, 0x3a, + 0xd2, 0x2d, 0xd2, 0x0d, 0xc2, 0x45, 0xc2, 0x4d, 0xc2, 0x3d, 0xc2, 0x35, 0x6d, 0x00, 0x7a, 0x03, + 0x01, 0xbe, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa3, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, + 0x01, 0xb3, 0x12, 0x41, 0x16, 0x12, 0x65, 0x0d, 0x02, 0x6c, 0x37, 0x12, 0x42, 0x57, 0xd2, 0x2e, + 0xd2, 0x0e, 0xc2, 0x46, 0xc2, 0x4e, 0xc2, 0x3e, 0xc2, 0x36, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbf, + 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa5, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xb5, + 0x12, 0x41, 0x16, 0x12, 0x65, 0x36, 0x02, 0x6c, 0x37, 0x12, 0x42, 0x74, 0xd2, 0x2f, 0xd2, 0x0f, + 0xc2, 0x47, 0xc2, 0x4f, 0xc2, 0x3f, 0xc2, 0x37, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xc0, 0x7e, 0x04, + 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa7, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xb7, 0x12, 0x41, + 0x16, 0x12, 0x65, 0x5f, 0x02, 0x6c, 0x37, 0x7e, 0xa0, 0xd0, 0x7e, 0x60, 0x0f, 0x12, 0x65, 0xbf, + 0x40, 0x0c, 0xc0, 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0xc2, 0xd7, 0x22, 0x75, + 0x2f, 0xb1, 0x12, 0x7e, 0x30, 0x0a, 0x52, 0x23, 0x6d, 0x00, 0x59, 0x05, 0x00, 0x32, 0x12, 0x41, + 0x72, 0x12, 0x41, 0x8e, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb2, 0x12, 0x7e, 0x30, 0x0a, 0x22, 0x09, + 0xb2, 0x6a, 0x93, 0x42, 0x23, 0x7e, 0xb0, 0x9c, 0x19, 0xb2, 0x01, 0xb9, 0x12, 0x45, 0x74, 0xd0, + 0xa8, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, + 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x08, 0x19, 0x30, 0x00, 0x0c, 0x7c, 0x74, 0x5e, 0x70, 0x01, 0x68, + 0x12, 0x44, 0x40, 0xca, 0xb8, 0x09, 0xb0, 0x00, 0x10, 0x44, 0x02, 0x19, 0xb0, 0x00, 0x10, 0xda, + 0xb8, 0x80, 0x02, 0x54, 0xbf, 0x7c, 0x74, 0x5e, 0x70, 0x08, 0x68, 0x04, 0x44, 0x08, 0x80, 0x02, + 0x54, 0xf7, 0x09, 0x30, 0x00, 0x0c, 0xca, 0xb8, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0xda, 0xb8, + 0x19, 0xb0, 0x00, 0x08, 0x19, 0x30, 0x00, 0x0c, 0x0a, 0x62, 0x09, 0xb6, 0x6a, 0x93, 0x3e, 0x20, + 0x0a, 0x62, 0x7c, 0x74, 0x5e, 0x70, 0x02, 0x68, 0x20, 0x42, 0x27, 0xca, 0xb8, 0x74, 0x61, 0x19, + 0xb0, 0x00, 0x08, 0x7e, 0x44, 0x00, 0x10, 0x59, 0x46, 0x01, 0xa9, 0x09, 0xb0, 0x00, 0x10, 0x44, + 0x01, 0x19, 0xb0, 0x00, 0x10, 0xda, 0xb8, 0x80, 0x11, 0xf4, 0x52, 0x27, 0x74, 0xa1, 0x19, 0xb0, + 0x00, 0x08, 0x7e, 0x44, 0x00, 0x38, 0x59, 0x46, 0x01, 0xa9, 0xd0, 0xa8, 0x22, 0x7c, 0x74, 0x7e, + 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x09, + 0xb0, 0x00, 0x08, 0x7c, 0x74, 0x5e, 0x70, 0x01, 0x68, 0x04, 0x44, 0x80, 0x80, 0x02, 0x54, 0x7f, + 0x7c, 0x74, 0x5e, 0x70, 0x08, 0x68, 0x04, 0x44, 0x02, 0x80, 0x02, 0x54, 0xfd, 0x19, 0xb0, 0x00, + 0x08, 0x19, 0x30, 0x00, 0x0c, 0x0a, 0x62, 0x09, 0xb6, 0x6a, 0x93, 0xa5, 0xfd, 0xf4, 0xa5, 0xfe, + 0xca, 0x28, 0x3e, 0x20, 0x0a, 0x62, 0xda, 0x28, 0x7c, 0x74, 0x5e, 0x70, 0x02, 0x68, 0x10, 0xa5, + 0xed, 0x42, 0x28, 0x42, 0x26, 0x7e, 0x44, 0x00, 0x08, 0x59, 0x46, 0x01, 0x99, 0x80, 0x04, 0xa5, + 0xee, 0x52, 0x28, 0x7c, 0x74, 0x5e, 0x70, 0x04, 0x68, 0x10, 0xa5, 0xed, 0x42, 0x29, 0x42, 0x26, + 0x7e, 0x44, 0x00, 0x08, 0x59, 0x46, 0x01, 0x99, 0x80, 0x15, 0xa5, 0xee, 0x52, 0x29, 0x7c, 0x74, + 0x5e, 0x70, 0x02, 0x78, 0x0a, 0x52, 0x26, 0x7e, 0x44, 0x00, 0x20, 0x59, 0x46, 0x01, 0x99, 0x12, + 0x42, 0x91, 0xd0, 0xa8, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, + 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x19, 0x40, 0x00, 0x10, 0x19, 0x30, 0x00, 0x0c, 0xd0, 0xa8, 0x22, + 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, + 0x19, 0x40, 0x00, 0x18, 0x19, 0x30, 0x00, 0x0c, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb5, 0x12, 0x7e, + 0x30, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0xb0, 0x00, 0x0c, 0x44, 0x40, 0x19, 0xb0, 0x00, + 0x0c, 0xe5, 0x58, 0xb4, 0x07, 0x23, 0x09, 0xb0, 0x00, 0x10, 0x4e, 0xb0, 0x02, 0x19, 0xb0, 0x00, + 0x10, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x04, 0x54, + 0xf7, 0x19, 0xb0, 0x00, 0x04, 0x19, 0x30, 0x00, 0x0c, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb6, 0x12, + 0x7e, 0x30, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0xe5, 0x58, 0xb4, 0x07, 0x18, 0x09, 0x30, 0x00, + 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x04, 0x44, 0x08, 0x19, 0xb0, 0x00, + 0x04, 0x19, 0x30, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x0c, 0x54, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0xd0, + 0xa8, 0x22, 0x75, 0x2f, 0xb4, 0x12, 0x7e, 0x30, 0x7a, 0x21, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x41, + 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0xb0, 0x01, 0x7e, 0xa0, 0xc8, 0x7c, 0x64, 0x12, 0x65, 0xbf, 0xc0, + 0xf1, 0x75, 0xf1, 0x01, 0x12, 0x71, 0xe9, 0xd0, 0xf1, 0xd0, 0xa8, 0x22, 0x6e, 0x9c, 0x6e, 0xe3, + 0x6f, 0x2a, 0x6f, 0x71, 0x6f, 0xb8, 0x6f, 0xff, 0x70, 0x46, 0x70, 0x8d, 0x75, 0x2f, 0x55, 0x12, + 0x7e, 0x30, 0x75, 0x2f, 0x00, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, + 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x69, 0x7e, 0x27, 0x01, 0x79, 0x2d, 0x23, 0x7e, 0x09, + 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x0d, 0xcc, 0x38, 0x0f, 0x1b, 0x34, + 0x78, 0xec, 0x7a, 0x17, 0x01, 0x69, 0x7a, 0x27, 0x01, 0x79, 0x02, 0x4a, 0x98, 0x7e, 0x14, 0x09, + 0xcd, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x01, 0x12, 0x7e, 0x30, 0x7a, + 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x6b, 0x7e, + 0x27, 0x01, 0x7b, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, + 0x14, 0x11, 0xcc, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x6b, 0x7a, 0x27, 0x01, + 0x7b, 0x02, 0x4d, 0xcd, 0x7e, 0x14, 0x0d, 0xcd, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x7e, 0x30, + 0x75, 0x2f, 0x02, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, + 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x6d, 0x7e, 0x27, 0x01, 0x7d, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, + 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x15, 0xcc, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, + 0x7a, 0x17, 0x01, 0x6d, 0x7a, 0x27, 0x01, 0x7d, 0x02, 0x51, 0x02, 0x7e, 0x14, 0x11, 0xcd, 0x80, + 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x03, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, + 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x6f, 0x7e, 0x27, 0x01, + 0x7f, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x19, + 0xcc, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x6f, 0x7a, 0x27, 0x01, 0x7f, 0x02, + 0x54, 0x37, 0x7e, 0x14, 0x15, 0xcd, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x7e, 0x30, 0x75, 0x2f, + 0x04, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, + 0x7e, 0x17, 0x01, 0x71, 0x7e, 0x27, 0x01, 0x81, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, + 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x1d, 0xcc, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, + 0x01, 0x71, 0x7a, 0x27, 0x01, 0x81, 0x02, 0x57, 0x6c, 0x7e, 0x14, 0x19, 0xcd, 0x80, 0xeb, 0x75, + 0x2f, 0x55, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x05, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, + 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x73, 0x7e, 0x27, 0x01, 0x83, 0x2d, + 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x21, 0xcc, 0x38, + 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x73, 0x7a, 0x27, 0x01, 0x83, 0x02, 0x5a, 0xa1, + 0x7e, 0x14, 0x1d, 0xcd, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x06, 0x12, + 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, + 0x01, 0x75, 0x7e, 0x27, 0x01, 0x85, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, + 0x0b, 0x14, 0xbe, 0x14, 0x25, 0xcc, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x75, + 0x7a, 0x27, 0x01, 0x85, 0x02, 0x5d, 0xd6, 0x7e, 0x14, 0x21, 0xcd, 0x80, 0xeb, 0x75, 0x2f, 0x55, + 0x12, 0x7e, 0x30, 0x75, 0x2f, 0x07, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, + 0x71, 0x2f, 0x12, 0x7e, 0x30, 0x7e, 0x17, 0x01, 0x77, 0x7e, 0x27, 0x01, 0x87, 0x2d, 0x23, 0x7e, + 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x29, 0xcc, 0x38, 0x0f, 0x1b, + 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x77, 0x7a, 0x27, 0x01, 0x87, 0x02, 0x61, 0x0b, 0x7e, 0x14, + 0x25, 0xcd, 0x80, 0xeb, 0xca, 0xb8, 0xc0, 0xf1, 0x75, 0x2f, 0x02, 0x12, 0x7e, 0x30, 0xe5, 0xc0, + 0x54, 0x03, 0x68, 0x05, 0x12, 0x77, 0xdd, 0x80, 0xf5, 0x30, 0xc2, 0x08, 0x75, 0xf1, 0x01, 0x12, + 0x71, 0xe9, 0x80, 0x14, 0x30, 0xc3, 0x08, 0x75, 0xf1, 0x01, 0x12, 0x71, 0x0d, 0x80, 0x09, 0x30, + 0xc4, 0x06, 0x75, 0xf1, 0x02, 0x12, 0x72, 0xf9, 0xd0, 0xf1, 0xda, 0xb8, 0x32, 0x75, 0x2f, 0x10, + 0x12, 0x7e, 0x30, 0xca, 0x0b, 0xca, 0x39, 0xca, 0x59, 0xc2, 0xc3, 0xa9, 0x21, 0xe2, 0x5c, 0xe5, + 0xe5, 0x54, 0xc0, 0x68, 0x4f, 0xe5, 0xe6, 0x6c, 0xaa, 0x7e, 0x37, 0x01, 0xc5, 0x2d, 0x35, 0xbe, + 0x34, 0x04, 0x00, 0x38, 0x4a, 0x7a, 0x37, 0x01, 0xc5, 0x7e, 0x37, 0x01, 0xc3, 0x7d, 0x43, 0x2d, + 0x45, 0xbe, 0x44, 0x09, 0xcc, 0x38, 0x40, 0x7a, 0x47, 0x01, 0xc3, 0x75, 0x2f, 0x11, 0x12, 0x7e, + 0x30, 0x7a, 0xb1, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x73, 0xc8, 0xa9, 0x21, 0xe5, 0x1f, 0xa9, 0xd4, + 0xe4, 0xa9, 0x24, 0xe4, 0xfc, 0xc2, 0xc3, 0xa9, 0x21, 0xe2, 0x3b, 0xe5, 0xe5, 0x54, 0xc0, 0x78, + 0xb4, 0x12, 0x76, 0x6a, 0xda, 0x59, 0xda, 0x39, 0xda, 0x0b, 0x22, 0x80, 0x29, 0x80, 0x58, 0x75, + 0x2f, 0x16, 0x12, 0x7e, 0x30, 0x80, 0xed, 0x75, 0x2f, 0x12, 0x12, 0x7e, 0x30, 0x7a, 0xb1, 0x2f, + 0x12, 0x7e, 0x30, 0x9e, 0x44, 0x09, 0xcd, 0x9d, 0x54, 0x12, 0x73, 0xc8, 0x7e, 0x34, 0x05, 0xcd, + 0x7d, 0x54, 0x2d, 0x43, 0x80, 0xa1, 0xe5, 0xe5, 0x54, 0x03, 0x78, 0x12, 0x75, 0x2f, 0x13, 0x12, + 0x7e, 0x30, 0x7e, 0x0f, 0x29, 0xe9, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xe9, 0x80, 0xa7, 0x75, 0x2f, + 0x14, 0x12, 0x7e, 0x30, 0x7e, 0x0f, 0x29, 0xed, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xed, 0xa9, 0xd7, + 0xe4, 0xa9, 0x27, 0xe4, 0xfc, 0x80, 0x9d, 0x75, 0x2f, 0x15, 0x12, 0x7e, 0x30, 0x7e, 0x0f, 0x29, + 0xf1, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xf1, 0x80, 0xe5, 0x75, 0x2f, 0x18, 0x12, 0x7e, 0x30, 0xca, + 0x09, 0xca, 0x39, 0xca, 0x2b, 0xc2, 0xc2, 0xa9, 0x21, 0xf2, 0x52, 0xe5, 0xf5, 0x33, 0x82, 0xe7, + 0x40, 0x44, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x54, 0x00, 0x40, 0x9d, 0x35, 0x40, 0x43, 0x7a, 0x37, + 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc7, 0x7d, 0x43, 0x2d, 0x45, 0xbe, 0x44, 0x05, 0xcc, 0x38, 0x52, + 0x7a, 0x47, 0x01, 0xc7, 0x7d, 0x45, 0x12, 0x75, 0x26, 0xa9, 0x20, 0xf5, 0x22, 0x75, 0x2f, 0x19, + 0x12, 0x7e, 0x30, 0x7a, 0x91, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x81, 0xf7, 0x7a, 0x91, 0xf6, 0xe5, + 0xf5, 0x33, 0x82, 0xe7, 0x50, 0xbc, 0xda, 0x2b, 0xda, 0x39, 0xda, 0x09, 0x22, 0x80, 0x41, 0x80, + 0x64, 0x2d, 0x53, 0x6d, 0x33, 0x70, 0xb7, 0x7e, 0x04, 0x01, 0xcd, 0x7a, 0x07, 0x01, 0xc9, 0x7a, + 0x07, 0x01, 0xc7, 0xa9, 0x32, 0xf2, 0xdf, 0x85, 0x30, 0x2f, 0x12, 0x7e, 0x30, 0x75, 0xf6, 0x00, + 0x80, 0xd4, 0xca, 0x59, 0x9e, 0x44, 0x05, 0xcd, 0x9d, 0x54, 0x12, 0x75, 0x26, 0x7e, 0x34, 0x01, + 0xcd, 0x7d, 0x54, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc7, 0x12, 0x75, 0x26, 0xda, 0x49, 0x80, 0x99, + 0xe5, 0xf5, 0x54, 0x03, 0x78, 0x1f, 0x7e, 0x0f, 0x29, 0xd9, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xd9, + 0x80, 0x9d, 0x7e, 0x0f, 0x29, 0xe1, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xe1, 0xa9, 0xd7, 0xf4, 0xa9, + 0x27, 0xf4, 0xfc, 0x80, 0x8a, 0x7e, 0x0f, 0x29, 0xdd, 0x0b, 0x0c, 0x7a, 0x0f, 0x29, 0xdd, 0x80, + 0xeb, 0xe5, 0xf5, 0x54, 0x03, 0x78, 0x1f, 0x7e, 0x2f, 0x29, 0xf9, 0x0b, 0x2c, 0x7a, 0x2f, 0x29, + 0xf9, 0x80, 0x34, 0x7e, 0x2f, 0x2a, 0x01, 0x0b, 0x2c, 0x7a, 0x2f, 0x2a, 0x01, 0xa9, 0xd7, 0xf4, + 0xa9, 0x27, 0xf4, 0xfc, 0x80, 0x21, 0x7e, 0x2f, 0x29, 0xfd, 0x0b, 0x2c, 0x7a, 0x2f, 0x29, 0xfd, + 0x80, 0xeb, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x75, 0x2f, 0x28, 0x12, 0x7e, 0x30, 0xca, + 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0xc2, 0xc4, 0xa9, 0x21, 0xf2, 0xb6, 0xe5, 0xf5, 0x33, 0x72, 0xe7, + 0x40, 0xe0, 0x7e, 0x0d, 0x30, 0x7e, 0x1d, 0x34, 0x7e, 0x2d, 0x38, 0x7e, 0x3d, 0x3c, 0x7e, 0x85, + 0x40, 0x7d, 0x90, 0x4d, 0x91, 0x4d, 0x92, 0x4d, 0x93, 0x4d, 0x94, 0x4d, 0x95, 0x4d, 0x96, 0x4d, + 0x97, 0x4d, 0x98, 0x68, 0x72, 0x7a, 0x11, 0xf3, 0x7a, 0x01, 0xf3, 0x7a, 0x31, 0xf3, 0x7a, 0x21, + 0xf3, 0x7a, 0x51, 0xf3, 0x7a, 0x41, 0xf3, 0x7a, 0x71, 0xf3, 0x7a, 0x61, 0xf3, 0x7a, 0x91, 0xf3, + 0x7a, 0x81, 0xf3, 0x30, 0x73, 0x1a, 0x7a, 0xb1, 0xf3, 0x7a, 0xa1, 0xf3, 0x7a, 0xd1, 0xf3, 0x7a, + 0xc1, 0xf3, 0x7a, 0xf1, 0xf3, 0x7a, 0xe1, 0xf3, 0x7d, 0x78, 0x7a, 0xf1, 0xf3, 0x7a, 0xe1, 0xf3, + 0xa9, 0x30, 0xf5, 0x03, 0x02, 0x72, 0xe6, 0x75, 0x2f, 0x29, 0x12, 0x7e, 0x30, 0x20, 0x73, 0x0b, + 0x75, 0x2f, 0x0a, 0x12, 0x7e, 0x30, 0x75, 0xf6, 0x0a, 0x80, 0x09, 0x75, 0x2f, 0x12, 0x12, 0x7e, + 0x30, 0x75, 0xf6, 0x12, 0x6d, 0x00, 0x7d, 0x10, 0x7a, 0x0d, 0x30, 0x7a, 0x0d, 0x34, 0x7a, 0x0d, + 0x38, 0x7a, 0x0d, 0x3c, 0x7a, 0x05, 0x40, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x1e, 0xb0, + 0x40, 0x0c, 0x7e, 0xa0, 0x0a, 0xa4, 0x7e, 0x04, 0x75, 0x0b, 0x9d, 0x05, 0x89, 0x04, 0x7e, 0xa1, + 0xe3, 0x7a, 0x39, 0xa0, 0x0b, 0x34, 0x80, 0xea, 0xb4, 0x40, 0xe3, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, + 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, + 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, + 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, + 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, + 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, + 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, + 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, + 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, + 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, + 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, + 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, + 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, + 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, + 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, + 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, + 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, + 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, + 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, + 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, + 0x35, 0x7e, 0xa1, 0xe3, 0xe5, 0xe3, 0x1b, 0x38, 0x50, 0x0b, 0x35, 0x22, 0x1e, 0xb0, 0x40, 0x0c, + 0x7e, 0xa0, 0x0a, 0xa4, 0x7e, 0x04, 0x76, 0x69, 0x9d, 0x05, 0x89, 0x04, 0x7e, 0x39, 0xa0, 0x7a, + 0xa1, 0xf3, 0x0b, 0x34, 0x80, 0xea, 0xb4, 0x40, 0xe3, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, + 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, + 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, + 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, + 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, + 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, + 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, + 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, + 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, + 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, + 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, + 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, + 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, + 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, + 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, + 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, + 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, + 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, + 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, + 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x0b, + 0x38, 0x50, 0x7a, 0xa1, 0xf3, 0xf5, 0xf3, 0x0b, 0x35, 0x22, 0xc2, 0xaf, 0x7e, 0x37, 0x01, 0xc5, + 0x4d, 0x33, 0x68, 0x3b, 0x7e, 0x07, 0x01, 0xc1, 0x7e, 0x54, 0x09, 0xcd, 0x9d, 0x50, 0xbd, 0x35, + 0x40, 0x02, 0x7d, 0x35, 0xca, 0x39, 0x7e, 0x65, 0x4b, 0x99, 0x64, 0xda, 0x39, 0x7e, 0x07, 0x01, + 0xc5, 0x9d, 0x03, 0x7a, 0x07, 0x01, 0xc5, 0x2e, 0x37, 0x01, 0xc1, 0x7a, 0x37, 0x01, 0xc1, 0xbe, + 0x34, 0x09, 0xcc, 0x28, 0xc7, 0x7e, 0x34, 0x05, 0xcd, 0x7a, 0x37, 0x01, 0xc1, 0x80, 0xbd, 0xd2, + 0xaf, 0x22, 0x75, 0x2f, 0x53, 0x12, 0x7e, 0x30, 0x7e, 0x15, 0x4d, 0x80, 0x11, 0x75, 0x2f, 0x51, + 0x12, 0x7e, 0x30, 0x0b, 0x08, 0x10, 0x0b, 0x05, 0x9e, 0x34, 0x00, 0x02, 0x28, 0x4d, 0x7c, 0xb2, + 0x20, 0xe7, 0x27, 0x54, 0x07, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x6e, 0x8c, 0x7c, 0xb2, 0x54, 0x78, + 0x03, 0x03, 0x03, 0x7c, 0x2b, 0x9d, 0x13, 0x40, 0x1a, 0x68, 0x12, 0x7a, 0x15, 0x4d, 0x7a, 0x25, + 0x4f, 0x7e, 0x64, 0x77, 0x47, 0x7a, 0x65, 0x4b, 0x89, 0x24, 0x02, 0x77, 0x55, 0x7e, 0x64, 0x76, + 0xbd, 0x80, 0xf2, 0x2d, 0x13, 0x9d, 0x31, 0xca, 0x39, 0x7d, 0x31, 0x2d, 0x10, 0xca, 0x19, 0xca, + 0x29, 0x99, 0x24, 0xda, 0x29, 0xda, 0x09, 0xda, 0x39, 0x80, 0xa2, 0x7a, 0x15, 0x4d, 0x7e, 0x64, + 0x77, 0x33, 0x4d, 0x33, 0x78, 0x09, 0x7c, 0xb2, 0x20, 0xe7, 0x2a, 0x7e, 0x64, 0x76, 0xb2, 0x7a, + 0x65, 0x4b, 0x22, 0x75, 0x2f, 0x52, 0x12, 0x7e, 0x30, 0x7e, 0x21, 0x4d, 0x7e, 0x09, 0x30, 0x0b, + 0x04, 0x1b, 0x34, 0x78, 0x89, 0x80, 0xd4, 0x75, 0x2f, 0x54, 0x12, 0x7e, 0x30, 0x7e, 0x15, 0x4d, + 0x7e, 0x25, 0x4f, 0x80, 0x90, 0x5e, 0x20, 0x07, 0x54, 0x78, 0x7e, 0x44, 0x77, 0xd1, 0x30, 0xe6, + 0x16, 0x4d, 0x33, 0x68, 0x26, 0x1b, 0x34, 0x7e, 0x09, 0x40, 0x0b, 0x04, 0x7e, 0x44, 0x6a, 0x68, + 0x20, 0xe3, 0x04, 0x7e, 0x44, 0x77, 0xd9, 0xca, 0x09, 0xca, 0x39, 0x99, 0x44, 0xda, 0x39, 0xda, + 0x09, 0x7e, 0x64, 0x76, 0xbd, 0x4d, 0x33, 0x68, 0xa6, 0x89, 0x64, 0x7a, 0x15, 0x4d, 0xf5, 0x4f, + 0x7e, 0x64, 0x77, 0x96, 0x80, 0x99, 0x7e, 0x15, 0x4d, 0xe5, 0x4f, 0x80, 0xc4, 0xc0, 0xd0, 0xc0, + 0xd1, 0xc0, 0xe0, 0xca, 0x19, 0xa9, 0x20, 0xdf, 0x12, 0xa9, 0x21, 0xdf, 0x1b, 0x75, 0x2f, 0x01, + 0x12, 0x7e, 0x30, 0x53, 0xdf, 0xf7, 0x12, 0x40, 0xdc, 0x80, 0x0d, 0x75, 0x2f, 0xfe, 0x12, 0x7e, + 0x30, 0x7e, 0x14, 0x00, 0x53, 0x02, 0x40, 0x51, 0xda, 0x19, 0xd0, 0xe0, 0xd0, 0xd1, 0xd0, 0xd0, + 0x32, 0x03, 0xa5, 0xcb, 0x19, 0xb1, 0x80, 0x00, 0x22, 0x22, 0x02, 0x78, 0x52, 0xca, 0x0b, 0xca, + 0x1b, 0xca, 0x2b, 0xca, 0x3b, 0xca, 0x4b, 0xca, 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0xc0, + 0xf1, 0x7e, 0xb3, 0x2a, 0x1d, 0xb4, 0x00, 0x02, 0x80, 0x19, 0xb4, 0x01, 0x16, 0x30, 0xc0, 0x08, + 0x75, 0xf1, 0x00, 0x12, 0x78, 0x3c, 0x80, 0x1f, 0x30, 0xc1, 0x1c, 0x75, 0xf1, 0x00, 0x12, 0x78, + 0xcd, 0x80, 0x14, 0x30, 0xc1, 0x08, 0x75, 0xf1, 0x00, 0x12, 0x78, 0xcd, 0x80, 0x09, 0x30, 0xc0, + 0x06, 0x75, 0xf1, 0x00, 0x12, 0x78, 0x3c, 0xd0, 0xf1, 0xda, 0xeb, 0xda, 0x7b, 0xda, 0x6b, 0xda, + 0x5b, 0xda, 0x4b, 0xda, 0x3b, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0xc2, 0xc0, 0x7e, 0xb3, + 0x2a, 0x1d, 0xb4, 0x02, 0x07, 0x12, 0x78, 0x5e, 0x02, 0x78, 0x52, 0x22, 0xb4, 0x01, 0xfc, 0x02, + 0x78, 0x98, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x2a, 0x1d, 0x7a, 0x03, 0x2a, 0x1e, 0x22, 0x7e, 0xb3, + 0x2a, 0x15, 0x54, 0x60, 0x60, 0x05, 0xb4, 0x40, 0x15, 0x80, 0x13, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, + 0x05, 0x0c, 0x75, 0x2f, 0x71, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x18, 0xf5, 0x8f, 0x22, 0x75, + 0xf6, 0x00, 0x22, 0xbe, 0x57, 0x2a, 0x1b, 0x28, 0x04, 0x7e, 0x57, 0x2a, 0x1b, 0x7a, 0x0f, 0x2a, + 0x20, 0x7a, 0x57, 0x2a, 0x24, 0x02, 0x78, 0x98, 0x7e, 0xef, 0x2a, 0x20, 0x7e, 0xf7, 0x2a, 0x24, + 0x7e, 0x07, 0x2a, 0x24, 0x4d, 0x00, 0x68, 0x21, 0x7e, 0x00, 0x00, 0x7e, 0xeb, 0xb0, 0xf5, 0xf3, + 0xa3, 0xa5, 0x08, 0x1b, 0xf4, 0x68, 0x04, 0xa5, 0xb8, 0x08, 0xf0, 0x7a, 0xef, 0x2a, 0x20, 0x7a, + 0xf7, 0x2a, 0x24, 0x75, 0x2f, 0x06, 0x12, 0x7e, 0x30, 0x7a, 0x01, 0xf6, 0x22, 0xc2, 0xc1, 0x75, + 0x2f, 0x03, 0x12, 0x7e, 0x30, 0xa9, 0x36, 0xe2, 0x16, 0xe5, 0xf5, 0x54, 0xc0, 0x68, 0x07, 0xa9, + 0xd7, 0xf4, 0xa9, 0x27, 0xf4, 0xfc, 0x53, 0xe1, 0x3f, 0x43, 0xf2, 0x88, 0x02, 0x79, 0x44, 0x7e, + 0xb3, 0x2a, 0x1e, 0xb4, 0x02, 0x0f, 0xa9, 0xd4, 0xe4, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x2a, 0x1e, + 0x7a, 0xb3, 0x2a, 0x1d, 0x22, 0xb4, 0x01, 0x39, 0x7e, 0x21, 0xe6, 0x7c, 0x32, 0x7e, 0x13, 0x2a, + 0x1f, 0x2c, 0x21, 0x7a, 0x23, 0x2a, 0x1f, 0x7e, 0x00, 0x00, 0x2e, 0x04, 0x2a, 0x26, 0xe5, 0xe3, + 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0xa5, 0xdb, 0xf6, 0xa9, 0xd4, 0xe4, 0x75, 0x2f, 0x70, 0x12, 0x7e, + 0x30, 0x7e, 0xb3, 0x2a, 0x1f, 0x7e, 0xa3, 0x2a, 0x1c, 0xbc, 0xab, 0x78, 0x03, 0x12, 0x79, 0xdb, + 0x22, 0x02, 0x7d, 0x44, 0xe5, 0xe6, 0xb4, 0x08, 0x65, 0xa9, 0xc4, 0xe2, 0x7e, 0x01, 0xe3, 0x7e, + 0x11, 0xe3, 0x7e, 0x31, 0xe3, 0x7e, 0x21, 0xe3, 0x7e, 0x51, 0xe3, 0x7e, 0x41, 0xe3, 0x7e, 0x71, + 0xe3, 0x7e, 0x61, 0xe3, 0x7a, 0x0f, 0x2a, 0x15, 0x7a, 0x1f, 0x2a, 0x19, 0x75, 0x2f, 0x04, 0x12, + 0x7e, 0x30, 0x7a, 0x01, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x11, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x21, + 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x31, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x41, 0x2f, 0x12, 0x7e, 0x30, + 0x7a, 0x51, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x61, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x71, 0x2f, 0x12, + 0x7e, 0x30, 0xa9, 0xd4, 0xe4, 0xa9, 0xd7, 0xf4, 0xa9, 0xc6, 0xe2, 0x12, 0x79, 0xaf, 0x22, 0x6d, + 0x00, 0x7e, 0x14, 0x01, 0x02, 0x7a, 0x07, 0x2a, 0x24, 0x7a, 0x03, 0x2a, 0x1f, 0x7e, 0xb3, 0x2a, + 0x15, 0x20, 0xe7, 0x0f, 0x7a, 0x23, 0x2a, 0x1e, 0x7a, 0x33, 0x2a, 0x1d, 0xbe, 0x07, 0x2a, 0x1b, + 0x68, 0x09, 0x22, 0x7a, 0x33, 0x2a, 0x1e, 0x7a, 0x23, 0x2a, 0x1d, 0x7e, 0xb3, 0x2a, 0x15, 0x54, + 0xe3, 0x23, 0x23, 0x30, 0xe0, 0x02, 0xd2, 0xe5, 0x30, 0xe7, 0x02, 0xd2, 0xe4, 0x30, 0xe5, 0x06, + 0x30, 0xe4, 0x03, 0x02, 0x7d, 0x44, 0x54, 0x3e, 0xf5, 0xf0, 0x03, 0x54, 0x1f, 0xc3, 0x25, 0xf0, + 0x90, 0x7a, 0x07, 0x75, 0x84, 0xff, 0x73, 0x02, 0x7b, 0x5b, 0x02, 0x7a, 0x4f, 0x02, 0x7b, 0xf8, + 0x02, 0x7c, 0x13, 0x02, 0x7a, 0xf4, 0x02, 0x7a, 0xb5, 0x02, 0x7c, 0x2c, 0x02, 0x7c, 0x2c, 0x02, + 0x7c, 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, + 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, 0x2f, 0x02, 0x7c, 0x35, 0x02, 0x7c, 0xe9, 0x02, 0x7c, 0x32, + 0x02, 0x7c, 0x32, 0x02, 0x7c, 0x32, 0x02, 0x7c, 0x32, 0x02, 0x7c, 0x32, 0x02, 0x7c, 0x32, 0x7e, + 0xb3, 0x2a, 0x16, 0xb4, 0x06, 0x2a, 0x7e, 0xb3, 0x2a, 0x17, 0x60, 0x56, 0x7c, 0x0b, 0x7e, 0x13, + 0x2a, 0x18, 0x7e, 0x17, 0x2a, 0x19, 0x75, 0x2f, 0x72, 0x12, 0x7e, 0x30, 0x7a, 0x01, 0x2f, 0x12, + 0x7e, 0x30, 0x7a, 0x11, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x7d, 0x4e, 0x40, 0x35, 0x02, 0x78, 0x83, + 0xb4, 0x08, 0x10, 0x75, 0x2f, 0x74, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x3f, 0xf1, 0xf5, 0xf3, 0x75, + 0xf6, 0x01, 0x22, 0xb4, 0x00, 0x1c, 0x75, 0x2f, 0x75, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x3f, 0xf2, + 0x30, 0xe0, 0x05, 0x75, 0xf3, 0x02, 0x80, 0x03, 0x75, 0xf3, 0x00, 0x75, 0xf3, 0x00, 0x75, 0xf6, + 0x02, 0x22, 0x02, 0x7d, 0x44, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x00, 0x35, 0x75, 0x2f, 0x76, 0x12, + 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x1a, 0x54, 0x0f, 0xf5, 0xf1, 0x7e, 0xb3, 0x2a, 0x1a, 0x20, 0xe7, + 0x09, 0xe5, 0xe1, 0x30, 0xe7, 0x0d, 0x74, 0x01, 0x80, 0x0b, 0xe5, 0xe1, 0x30, 0xe6, 0x04, 0x74, + 0x01, 0x80, 0x02, 0x74, 0x00, 0x53, 0xf1, 0x80, 0xf5, 0xf3, 0x75, 0xf3, 0x00, 0x75, 0xf6, 0x02, + 0x22, 0x02, 0x7d, 0x44, 0xc0, 0xf1, 0x7e, 0xb3, 0x2a, 0x1a, 0x54, 0x0f, 0x42, 0xf1, 0x7e, 0xb3, + 0x2a, 0x18, 0xb4, 0x00, 0x45, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x01, 0x24, 0x75, 0x2f, 0x77, 0x12, + 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x1a, 0x54, 0x0f, 0x78, 0x05, 0x53, 0xe1, 0x3f, 0x80, 0x37, 0x7e, + 0xb3, 0x2a, 0x1a, 0x20, 0xe7, 0x05, 0x53, 0xe1, 0x7f, 0x80, 0x2b, 0x53, 0xe1, 0xbf, 0x80, 0x26, + 0xb4, 0x03, 0x17, 0x75, 0x2f, 0x78, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x1a, 0x20, 0xe7, 0x05, + 0x43, 0xe1, 0x80, 0x80, 0x11, 0x43, 0xe1, 0x40, 0x80, 0x0c, 0x43, 0xe1, 0xc0, 0xd0, 0xf1, 0x75, + 0x2f, 0x07, 0x12, 0x7e, 0x30, 0x22, 0xd0, 0xf1, 0x02, 0x78, 0x7f, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, + 0x09, 0x23, 0x75, 0x2f, 0x79, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x18, 0xbe, 0xb3, 0x3f, 0xf1, + 0x68, 0x11, 0xca, 0xb8, 0xc0, 0xf1, 0x12, 0x43, 0x68, 0xd0, 0xf1, 0xda, 0xb8, 0x50, 0x76, 0x7a, + 0xb3, 0x3f, 0xf1, 0x80, 0x6d, 0xb4, 0x05, 0x08, 0x75, 0x2f, 0x7a, 0x12, 0x7e, 0x30, 0x80, 0x62, + 0xb4, 0x03, 0x19, 0x75, 0x2f, 0x7b, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x18, 0xb4, 0x01, 0x55, + 0x7e, 0xb3, 0x3f, 0xf2, 0x44, 0x01, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x46, 0xb4, 0x01, 0x19, 0x75, + 0x2f, 0x7c, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x18, 0xb4, 0x01, 0x39, 0x7e, 0xb3, 0x3f, 0xf2, + 0x54, 0xfe, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x2a, 0xb4, 0x07, 0x2a, 0x7e, 0xb3, 0x2a, 0x17, 0x60, + 0x24, 0x7c, 0x0b, 0x7e, 0x13, 0x2a, 0x18, 0x7e, 0x17, 0x2a, 0x19, 0x75, 0x2f, 0x73, 0x12, 0x7e, + 0x30, 0x7a, 0x01, 0x2f, 0x12, 0x7e, 0x30, 0x7a, 0x11, 0x2f, 0x12, 0x7e, 0x30, 0x12, 0x7d, 0x7a, + 0x40, 0x03, 0x02, 0x78, 0x7f, 0x02, 0x7d, 0x44, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x0b, 0xf6, 0x75, + 0x2f, 0x7d, 0x12, 0x7e, 0x30, 0x7e, 0xb3, 0x2a, 0x18, 0x7e, 0xa3, 0x2a, 0x1a, 0x4c, 0xab, 0x78, + 0xe4, 0x80, 0xdf, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x0a, 0xdb, 0x75, 0x2f, 0x7e, 0x12, 0x7e, 0x30, + 0x7e, 0xb3, 0x2a, 0x18, 0x70, 0xcf, 0xf5, 0xf3, 0x75, 0xf6, 0x01, 0x22, 0x02, 0x7d, 0x44, 0x02, + 0x7d, 0x44, 0x02, 0x7d, 0x44, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x04, 0x20, 0x75, 0x2f, 0xc3, 0x12, + 0x7e, 0x30, 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x17, 0x2a, 0x17, 0x7e, 0x18, 0x2a, 0x26, 0x7a, 0x1c, + 0x00, 0x00, 0x7e, 0x47, 0x2a, 0x1b, 0x12, 0x7e, 0x3c, 0x02, 0x7c, 0xe3, 0xb4, 0x06, 0x3a, 0x75, + 0x2f, 0xc1, 0x12, 0x7e, 0x30, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7d, 0xca, 0x7e, + 0xd7, 0x2a, 0x17, 0x7e, 0x78, 0x2a, 0x26, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x2a, 0x1b, 0x75, + 0x2f, 0xc1, 0x12, 0x7e, 0x30, 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x12, 0x7e, + 0x75, 0xd0, 0x87, 0xd0, 0xa8, 0x40, 0x4f, 0x80, 0x4a, 0xb4, 0x00, 0x1c, 0xc2, 0xaf, 0xa9, 0xd5, + 0x87, 0x12, 0x78, 0x7f, 0xe4, 0x8d, 0xef, 0x8d, 0xef, 0x8d, 0xef, 0xd5, 0xe0, 0xf7, 0xc0, 0xd1, + 0xca, 0x02, 0xff, 0xca, 0x06, 0x00, 0x00, 0x32, 0xb4, 0x09, 0x12, 0x7e, 0x57, 0x2a, 0x17, 0x4d, + 0x55, 0x68, 0x05, 0xa9, 0xd2, 0xb1, 0x80, 0x03, 0xa9, 0xc2, 0xb1, 0x80, 0x16, 0xb4, 0x07, 0x16, + 0xc2, 0xaf, 0x7e, 0x07, 0x2a, 0x19, 0x7e, 0x17, 0x2a, 0x17, 0xc0, 0xd1, 0xca, 0x18, 0xca, 0x38, + 0xca, 0x28, 0x32, 0x02, 0x78, 0x7f, 0x02, 0x7d, 0x44, 0x7e, 0xb3, 0x2a, 0x16, 0xb4, 0x03, 0x15, + 0x75, 0x2f, 0xc2, 0x12, 0x7e, 0x30, 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x17, 0x2a, 0x17, 0x7e, 0x57, + 0x2a, 0x1b, 0x02, 0x78, 0x83, 0xb4, 0x05, 0x39, 0x75, 0x2f, 0xc0, 0x12, 0x7e, 0x30, 0xc0, 0xa8, + 0xc0, 0x87, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x7e, 0x08, 0x2a, 0x26, 0x7a, 0x0c, 0x00, 0x00, 0x7e, + 0x24, 0x00, 0xfe, 0x7e, 0x37, 0x2a, 0x17, 0x7e, 0x47, 0x2a, 0x1b, 0x12, 0x7e, 0x3c, 0xd0, 0x87, + 0xd0, 0xa8, 0x7e, 0x08, 0x2a, 0x26, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x57, 0x2a, 0x1b, 0x02, 0x78, + 0x83, 0x02, 0x7d, 0x44, 0x75, 0x2f, 0x07, 0x12, 0x7e, 0x30, 0x43, 0xe1, 0xc0, 0x22, 0xc0, 0xa8, + 0xc0, 0x87, 0xc2, 0xaf, 0xa9, 0xd5, 0x87, 0x12, 0x7d, 0xb9, 0x40, 0x19, 0x7e, 0x08, 0x2a, 0x26, + 0x7a, 0x0c, 0x00, 0x00, 0xca, 0x0b, 0xca, 0x49, 0x12, 0x7e, 0x3c, 0xda, 0x59, 0xda, 0x0b, 0xd0, + 0x87, 0xd0, 0xa8, 0xc3, 0x22, 0xd0, 0x87, 0xd0, 0xa8, 0x22, 0xc0, 0xa8, 0xc0, 0x87, 0xc2, 0xaf, + 0xa9, 0xd5, 0x87, 0x12, 0x7d, 0xb9, 0x40, 0x2b, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, + 0x7f, 0x61, 0x7e, 0x78, 0x2a, 0x26, 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x2a, 0x1b, 0xbd, 0x74, + 0x78, 0x11, 0x75, 0x2f, 0xc1, 0x12, 0x7e, 0x30, 0x12, 0x7e, 0x75, 0x40, 0x06, 0xd0, 0x87, 0xd0, + 0xa8, 0xc3, 0x22, 0xd0, 0x87, 0xd0, 0xa8, 0xd3, 0x22, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x34, 0x7f, + 0xca, 0x0b, 0x1a, 0x50, 0xc5, 0xf0, 0x7d, 0x62, 0x7d, 0x75, 0x7d, 0x87, 0x7e, 0x34, 0x7f, 0xc2, + 0x7e, 0x1b, 0xb0, 0x7e, 0x34, 0x7f, 0x03, 0xb4, 0x01, 0x04, 0x7e, 0x34, 0x7f, 0xcc, 0x7e, 0x1b, + 0xb0, 0xbc, 0x0b, 0x50, 0x49, 0x3e, 0x00, 0x3e, 0x00, 0x0a, 0x50, 0x2d, 0x75, 0x0b, 0x3a, 0x30, + 0x69, 0x53, 0x00, 0x02, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, 0xbc, 0x1b, 0x50, 0x30, 0x3e, 0x10, + 0x3e, 0x10, 0x0a, 0x51, 0x2d, 0x35, 0x69, 0x41, 0x00, 0x02, 0x0b, 0x1a, 0x30, 0xbd, 0x38, 0x50, + 0x02, 0x2d, 0x38, 0xbe, 0x44, 0xff, 0xff, 0x78, 0x05, 0x7e, 0x1b, 0x90, 0x0a, 0x49, 0x4d, 0x44, + 0x68, 0x0c, 0xbe, 0x44, 0x00, 0xff, 0x28, 0x04, 0x7e, 0x44, 0x00, 0xff, 0xc3, 0x22, 0xd3, 0x22, + +// Segment #15, Start Address 00ff7fc6, Length 4 +0xff,0x00,0xc6,0x7f,0x04,0x00, + 0x01, 0x0c, 0x03, 0x00, + +// Segment #16, Start Address 00ff7e30, Length 315 +0xff,0x00,0x30,0x7e,0x3b,0x01, + 0xca, 0x08, 0x7e, 0x01, 0x2f, 0x7a, 0x03, 0x3f, 0xf0, 0xda, 0x08, 0x22, 0x7e, 0x1b, 0xc0, 0x7a, + 0x0b, 0xc0, 0x0b, 0x14, 0x0b, 0x34, 0x1b, 0x44, 0x78, 0xf2, 0x22, 0x7f, 0x6f, 0x7f, 0xf0, 0x1b, + 0xfc, 0x7c, 0x54, 0x7d, 0x32, 0x80, 0x08, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0x9e, + 0x44, 0x00, 0x10, 0x50, 0xf2, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x06, 0xca, 0x48, 0x1b, 0x44, 0x78, + 0xfa, 0x7f, 0xf6, 0x89, 0xe4, 0xca, 0x6b, 0x5e, 0xd4, 0x00, 0x3f, 0x68, 0x20, 0x7e, 0x84, 0x00, + 0x40, 0x9d, 0x8d, 0xda, 0x6b, 0xbd, 0x87, 0x38, 0x16, 0xca, 0x79, 0x7d, 0x78, 0x12, 0x7e, 0x9f, + 0xda, 0x79, 0x40, 0x08, 0x9d, 0x78, 0x68, 0x02, 0x80, 0x05, 0xc2, 0xd7, 0x22, 0xda, 0x6b, 0x43, + 0x90, 0x30, 0x74, 0xaa, 0x39, 0xb5, 0x55, 0x55, 0x74, 0x55, 0x39, 0xb5, 0x2a, 0xaa, 0x74, 0xa0, + 0x39, 0xb5, 0x55, 0x55, 0x7e, 0x04, 0x00, 0x40, 0x9d, 0x70, 0x50, 0x06, 0x2d, 0x70, 0x7d, 0x07, + 0x6d, 0x77, 0x7c, 0x31, 0x7e, 0x7b, 0x00, 0x7a, 0x6b, 0x00, 0x0b, 0x7c, 0x0b, 0x6c, 0xa5, 0xd9, + 0xf3, 0x7f, 0x16, 0x1b, 0x1c, 0x7e, 0x54, 0x27, 0x10, 0x7e, 0x1b, 0x10, 0xbc, 0x10, 0x68, 0x06, + 0x1b, 0x54, 0x78, 0xf5, 0x80, 0x2c, 0x6d, 0x00, 0x7c, 0x20, 0x7f, 0x16, 0x9f, 0x10, 0x7f, 0x27, + 0x9f, 0x20, 0x7e, 0x2b, 0x00, 0x7e, 0x1b, 0x10, 0xbc, 0x01, 0x78, 0x16, 0x0b, 0x2c, 0x0b, 0x1c, + 0xa5, 0xdb, 0xef, 0x7c, 0xb6, 0x20, 0xe0, 0x03, 0x63, 0x90, 0x30, 0x4d, 0x77, 0x78, 0x93, 0xc2, + 0xd7, 0x22, 0xd2, 0xd7, 0x22, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x04, 0x02, 0x04, 0x00, + 0x02, 0x01, 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x04, 0x00, 0x08, 0x10, 0x02, 0x10, 0x04, 0x02, 0x08, 0x00, 0x01, 0x01, 0x08, 0x7e, + 0x18, 0x7f, 0xbd, 0x7a, 0x1c, 0x00, 0xfe, 0x0b, 0x1a, 0x00, 0xbe, 0x10, 0x14, 0x38, 0x1a, 0x0a, + 0x51, 0x23, 0x7e, 0x18, 0x7f, 0x15, 0x7a, 0x1c, 0x00, 0xff, 0x2d, 0x35, 0x0b, 0x1a, 0x50, 0x60, + 0x08, 0xa5, 0xb8, 0x02, 0x03, 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, +}; + +static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { + 1, 12, 3 }; // Major, Minor, Build + +#undef IMAGE_VERSION_NAME + +#undef IMAGE_ARRAY_NAME + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_fw_down2.h linux.20p9/drivers/usb/serial/io_fw_down2.h --- linux.vanilla/drivers/usb/serial/io_fw_down2.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_fw_down2.h Wed Jul 4 16:03:59 2001 @@ -0,0 +1,1135 @@ +//************************************************************** +//* Edgeport/4 Binary Image +//* Generated by HEX2C v1.06 +//* Copyright(c) 1998 Inside Out Networks, All rights reserved. +//* This program is free software; you can redistribute it and/or modify +//* it under the terms of the GNU General Public License as published by +//* the Free Software Foundation; either version 2 of the License, or +//* (at your option) any later version. +//************************************************************** + + +//Image structure definition +#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) + #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD + typedef struct _EDGE_FIRMWARE_IMAGE_RECORD + { + unsigned short ExtAddr; + unsigned short Addr; + unsigned short Len; + unsigned char Data[0]; + } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + + typedef struct _EDGE_FIRMWARE_VERSION_INFO + { + unsigned char MajorVersion; + unsigned char MinorVersion; + unsigned short BuildNumber; + } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + +#endif + +#if !defined(IMAGE_ARRAY_NAME) + #define IMAGE_ARRAY_NAME FirmwareImage + #define IMAGE_VERSION_NAME FirmwareImageVersion +#endif + +static unsigned char IMAGE_ARRAY_NAME[] = { + +// Segment #1, Start Address 00ff0000, Length 6 +0xff,0x00,0x00,0x00,0x06,0x00, + 0x02, 0x00, 0x80, 0x02, 0x45, 0x14, + +// Segment #2, Start Address 00ff000b, Length 3 +0xff,0x00,0x0b,0x00,0x03,0x00, + 0x02, 0x44, 0xa5, + +// Segment #3, Start Address 00ff0013, Length 3 +0xff,0x00,0x13,0x00,0x03,0x00, + 0x02, 0x63, 0xab, + +// Segment #4, Start Address 00ff001b, Length 3 +0xff,0x00,0x1b,0x00,0x03,0x00, + 0x02, 0x00, 0x1b, + +// Segment #5, Start Address 00ff0023, Length 3 +0xff,0x00,0x23,0x00,0x03,0x00, + 0x02, 0x00, 0x23, + +// Segment #6, Start Address 00ff002b, Length 3 +0xff,0x00,0x2b,0x00,0x03,0x00, + 0x02, 0x00, 0x2b, + +// Segment #7, Start Address 00ff0033, Length 3 +0xff,0x00,0x33,0x00,0x03,0x00, + 0x02, 0x00, 0x33, + +// Segment #8, Start Address 00ff003b, Length 3 +0xff,0x00,0x3b,0x00,0x03,0x00, + 0x02, 0x00, 0x3b, + +// Segment #9, Start Address 00ff0043, Length 3 +0xff,0x00,0x43,0x00,0x03,0x00, + 0x02, 0x00, 0x43, + +// Segment #10, Start Address 00ff004b, Length 3 +0xff,0x00,0x4b,0x00,0x03,0x00, + 0x02, 0x00, 0x4b, + +// Segment #11, Start Address 00ff0053, Length 3 +0xff,0x00,0x53,0x00,0x03,0x00, + 0x02, 0x67, 0x5f, + +// Segment #12, Start Address 00ff007b, Length 3 +0xff,0x00,0x7b,0x00,0x03,0x00, + 0x02, 0x00, 0x7b, + +// Segment #13, Start Address 00ff0080, Length 7 +0xff,0x00,0x80,0x00,0x07,0x00, + 0x7e, 0x14, 0x00, 0x00, 0x02, 0x40, 0x52, + +// Segment #14, Start Address 00ff3000, Length 2918 +0xff,0x00,0x00,0x30,0x66,0x0b, + 0x12, 0x30, 0x64, 0x12, 0x30, 0xff, 0x12, 0x31, 0x2f, 0x12, 0x30, 0xb0, 0x80, 0xf2, 0xe5, 0x23, + 0x60, 0x19, 0x7e, 0x14, 0x00, 0x00, 0x09, 0xb1, 0x01, 0xb9, 0xb4, 0x00, 0x02, 0x80, 0x05, 0x14, + 0x19, 0xb1, 0x01, 0xb9, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, 0xeb, 0x22, 0xc2, 0xaf, 0x7e, 0xb3, + 0x3f, 0xf1, 0xb4, 0x01, 0x03, 0x12, 0x65, 0x67, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0x7e, 0xb3, 0x3f, + 0xf1, 0xb4, 0x01, 0x1d, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, 0x1a, 0x6c, 0xaa, + 0x60, 0x0f, 0xca, 0x0b, 0xca, 0x39, 0xca, 0x59, 0x12, 0x64, 0x24, 0xda, 0x59, 0xda, 0x39, 0xda, + 0x0b, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0xe5, 0x22, 0x60, 0x43, 0x7e, 0x07, 0x01, 0xcb, 0xbe, 0x04, + 0x03, 0x80, 0x38, 0x39, 0x7e, 0x04, 0x80, 0x00, 0x7e, 0x20, 0x00, 0x13, 0x50, 0x21, 0x09, 0xa0, + 0x00, 0x04, 0x4e, 0xa0, 0x05, 0x19, 0xa0, 0x00, 0x04, 0x0a, 0x32, 0x09, 0x53, 0x35, 0x33, 0x5e, + 0x51, 0x27, 0x68, 0x0b, 0x09, 0xa0, 0x00, 0x10, 0x4e, 0xa0, 0x01, 0x19, 0xa0, 0x00, 0x10, 0x2e, + 0x04, 0x01, 0x00, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, 0xd1, 0x75, 0x22, 0x00, 0xd2, 0xaf, 0x22, + 0xc2, 0xaf, 0xe5, 0x26, 0x60, 0x36, 0x7e, 0x20, 0x00, 0x7e, 0x30, 0x01, 0xe5, 0x26, 0xa5, 0x5b, + 0x68, 0x21, 0x7c, 0xb2, 0x23, 0x0a, 0x2b, 0x49, 0x32, 0x01, 0x79, 0xbe, 0x34, 0x00, 0x00, 0x68, + 0x12, 0x7e, 0xb1, 0x21, 0xa5, 0x4b, 0x7a, 0xb1, 0x21, 0xca, 0x19, 0x49, 0x22, 0x30, 0xef, 0x99, + 0x24, 0xda, 0x19, 0x3e, 0x30, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, 0xd0, 0xd2, 0xaf, 0x22, 0x46, + 0x4f, 0x49, 0x7c, 0x4c, 0xa9, 0x4f, 0xd6, 0x53, 0x03, 0x56, 0x30, 0x59, 0x5d, 0x5c, 0x8a, 0xc2, + 0xaf, 0xe5, 0x24, 0x60, 0x14, 0x7e, 0x20, 0x00, 0x13, 0x50, 0x07, 0xca, 0xb8, 0x12, 0x31, 0x1c, + 0xda, 0xb8, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, 0xef, 0xd2, 0xaf, 0x22, 0xca, 0x28, 0x12, 0x35, + 0x4c, 0xda, 0x28, 0x40, 0x09, 0x0a, 0x22, 0x09, 0xb2, 0x35, 0x33, 0xf4, 0x52, 0x24, 0x22, 0xc2, + 0xaf, 0xe5, 0x23, 0x60, 0x14, 0x7e, 0x20, 0x00, 0x13, 0x50, 0x07, 0xca, 0xb8, 0x12, 0x31, 0x4c, + 0xda, 0xb8, 0xa5, 0x0a, 0xbe, 0x21, 0x2e, 0x78, 0xef, 0xd2, 0xaf, 0x22, 0x7c, 0xb2, 0x23, 0x0a, + 0x2b, 0x49, 0x22, 0x31, 0x57, 0x89, 0x24, 0x31, 0x67, 0x31, 0xd0, 0x32, 0x39, 0x32, 0xa2, 0x33, + 0x0b, 0x33, 0x74, 0x33, 0xdd, 0x34, 0x46, 0x7e, 0x27, 0x01, 0x79, 0xbe, 0x24, 0x00, 0x00, 0x78, + 0x24, 0x7e, 0x24, 0x80, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, + 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x49, 0x45, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, + 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x89, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x89, 0x7e, + 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xb9, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xb9, 0xa5, 0xbe, 0x00, 0x1f, + 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, + 0xb3, 0x12, 0x73, 0x35, 0xc2, 0x18, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xb9, 0x12, 0x64, 0x86, 0x22, + 0x7e, 0x27, 0x01, 0x7b, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x81, 0x00, 0x09, 0xb2, + 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, + 0x4c, 0x72, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, + 0x01, 0x8b, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x8b, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xba, 0x80, + 0x27, 0x7e, 0x63, 0x01, 0xba, 0xa5, 0xbe, 0x00, 0x1f, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, + 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, 0xb3, 0x12, 0x73, 0x35, 0xc2, 0x19, 0x6c, + 0x00, 0x7a, 0x03, 0x01, 0xba, 0x12, 0x64, 0x86, 0x22, 0x7e, 0x27, 0x01, 0x7d, 0xbe, 0x24, 0x00, + 0x00, 0x78, 0x24, 0x7e, 0x24, 0x82, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, + 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x4f, 0x9f, 0x7d, 0x21, 0xda, 0x19, 0x30, + 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x8d, 0x68, 0x0d, 0x7a, 0x27, 0x01, + 0x8d, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbb, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xbb, 0xa5, 0xbe, + 0x00, 0x1f, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, + 0x75, 0x2f, 0xb3, 0x12, 0x73, 0x35, 0xc2, 0x1a, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xbb, 0x12, 0x64, + 0x86, 0x22, 0x7e, 0x27, 0x01, 0x7f, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x83, 0x00, + 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, + 0x12, 0x12, 0x52, 0xcc, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, + 0xbe, 0x27, 0x01, 0x8f, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x8f, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, + 0xbc, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xbc, 0xa5, 0xbe, 0x00, 0x1f, 0x7e, 0x60, 0x01, 0x7e, 0xb0, + 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, 0xb3, 0x12, 0x73, 0x35, 0xc2, + 0x1b, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xbc, 0x12, 0x64, 0x86, 0x22, 0x7e, 0x27, 0x01, 0x81, 0xbe, + 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x84, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, + 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x55, 0xf9, 0x7d, 0x21, 0xda, + 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x91, 0x68, 0x0d, 0x7a, + 0x27, 0x01, 0x91, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbd, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xbd, + 0xa5, 0xbe, 0x00, 0x1f, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, + 0x40, 0x11, 0x75, 0x2f, 0xb3, 0x12, 0x73, 0x35, 0xc2, 0x1c, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xbd, + 0x12, 0x64, 0x86, 0x22, 0x7e, 0x27, 0x01, 0x83, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, + 0x85, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, + 0x19, 0x7d, 0x12, 0x12, 0x59, 0x26, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, + 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x93, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x93, 0x7e, 0x60, 0x9c, 0x7a, + 0x63, 0x01, 0xbe, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xbe, 0xa5, 0xbe, 0x00, 0x1f, 0x7e, 0x60, 0x01, + 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, 0xb3, 0x12, 0x73, + 0x35, 0xc2, 0x1d, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xbe, 0x12, 0x64, 0x86, 0x22, 0x7e, 0x27, 0x01, + 0x85, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, 0x7e, 0x24, 0x86, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, + 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x5c, 0x53, 0x7d, + 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x95, 0x68, + 0x0d, 0x7a, 0x27, 0x01, 0x95, 0x7e, 0x60, 0x9c, 0x7a, 0x63, 0x01, 0xbf, 0x80, 0x27, 0x7e, 0x63, + 0x01, 0xbf, 0xa5, 0xbe, 0x00, 0x1f, 0x7e, 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, + 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, 0xb3, 0x12, 0x73, 0x35, 0xc2, 0x1e, 0x6c, 0x00, 0x7a, 0x03, + 0x01, 0xbf, 0x12, 0x64, 0x86, 0x22, 0x7e, 0x27, 0x01, 0x87, 0xbe, 0x24, 0x00, 0x00, 0x78, 0x24, + 0x7e, 0x24, 0x87, 0x00, 0x09, 0xb2, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, + 0x0b, 0xca, 0x19, 0x7d, 0x12, 0x12, 0x5f, 0x80, 0x7d, 0x21, 0xda, 0x19, 0x30, 0xe6, 0x18, 0x7e, + 0x60, 0x00, 0x80, 0x1e, 0xbe, 0x27, 0x01, 0x97, 0x68, 0x0d, 0x7a, 0x27, 0x01, 0x97, 0x7e, 0x60, + 0x9c, 0x7a, 0x63, 0x01, 0xc0, 0x80, 0x27, 0x7e, 0x63, 0x01, 0xc0, 0xa5, 0xbe, 0x00, 0x1f, 0x7e, + 0x60, 0x01, 0x7e, 0xb0, 0x00, 0x7e, 0xa0, 0xc8, 0x12, 0x61, 0x36, 0x40, 0x11, 0x75, 0x2f, 0xb3, + 0x12, 0x73, 0x35, 0xc2, 0x1f, 0x6c, 0x00, 0x7a, 0x03, 0x01, 0xc0, 0x12, 0x64, 0x86, 0x22, 0xc2, + 0xaf, 0x7e, 0x07, 0x01, 0xcb, 0xbe, 0x04, 0x00, 0x00, 0x78, 0x28, 0x74, 0x20, 0x7a, 0xb3, 0x91, + 0x00, 0x7e, 0xb3, 0x91, 0x15, 0x30, 0xe5, 0x1b, 0x7e, 0xb3, 0x91, 0x1a, 0xbe, 0xb0, 0x3f, 0x38, + 0x0c, 0x85, 0x31, 0x2f, 0x12, 0x73, 0x35, 0x74, 0x80, 0x7a, 0xb3, 0x91, 0x1e, 0x74, 0x20, 0x7a, + 0xb3, 0x91, 0x15, 0xd2, 0xaf, 0x22, 0x35, 0x3b, 0x36, 0xe8, 0x37, 0x00, 0x37, 0x1b, 0x37, 0xb6, + 0x38, 0x4e, 0x38, 0x69, 0x38, 0xfb, 0x38, 0x84, 0x38, 0xc5, 0x7c, 0xb3, 0xbe, 0xb0, 0x09, 0x28, + 0x22, 0x75, 0x2f, 0x09, 0x12, 0x73, 0x35, 0x75, 0x57, 0x02, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x00, + 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x11, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x01, 0x7a, 0xb3, + 0x91, 0x11, 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x23, 0x6c, 0xaa, 0x2e, 0x54, 0x34, 0xe6, 0x0b, 0x58, + 0x50, 0x89, 0x54, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x75, 0x2f, 0xb0, 0x12, 0x73, + 0x35, 0x0a, 0x22, 0x09, 0xb2, 0x35, 0x33, 0x42, 0x24, 0xd0, 0xa8, 0x22, 0x7c, 0xb2, 0x23, 0x0a, + 0x3b, 0x49, 0x33, 0x35, 0x57, 0x89, 0x34, 0x35, 0x67, 0x35, 0x95, 0x35, 0xc3, 0x35, 0xf1, 0x36, + 0x1f, 0x36, 0x4d, 0x36, 0x7b, 0x36, 0xa9, 0x12, 0x41, 0xba, 0xd2, 0x28, 0xd2, 0x08, 0xc2, 0x40, + 0xc2, 0x48, 0xc2, 0x38, 0xc2, 0x30, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xb9, 0x7e, 0x04, 0x00, 0x20, + 0x7a, 0x07, 0x01, 0x99, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xa9, 0x12, 0x41, 0x27, 0x12, + 0x5f, 0xb7, 0x02, 0x36, 0xd7, 0x12, 0x41, 0xd7, 0xd2, 0x29, 0xd2, 0x09, 0xc2, 0x41, 0xc2, 0x49, + 0xc2, 0x39, 0xc2, 0x31, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xba, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, + 0x01, 0x9b, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xab, 0x12, 0x41, 0x27, 0x12, 0x5f, 0xe0, + 0x02, 0x36, 0xd7, 0x12, 0x41, 0xf4, 0xd2, 0x2a, 0xd2, 0x0a, 0xc2, 0x42, 0xc2, 0x4a, 0xc2, 0x3a, + 0xc2, 0x32, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbb, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0x9d, + 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xad, 0x12, 0x41, 0x27, 0x12, 0x60, 0x09, 0x02, 0x36, + 0xd7, 0x12, 0x42, 0x11, 0xd2, 0x2b, 0xd2, 0x0b, 0xc2, 0x43, 0xc2, 0x4b, 0xc2, 0x3b, 0xc2, 0x33, + 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbc, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0x9f, 0x7e, 0x04, + 0x00, 0x38, 0x7a, 0x07, 0x01, 0xaf, 0x12, 0x41, 0x27, 0x12, 0x60, 0x32, 0x02, 0x36, 0xd7, 0x12, + 0x42, 0x2e, 0xd2, 0x2c, 0xd2, 0x0c, 0xc2, 0x44, 0xc2, 0x4c, 0xc2, 0x3c, 0xc2, 0x34, 0x6d, 0x00, + 0x7a, 0x03, 0x01, 0xbd, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa1, 0x7e, 0x04, 0x00, 0x38, + 0x7a, 0x07, 0x01, 0xb1, 0x12, 0x41, 0x27, 0x12, 0x60, 0x5b, 0x02, 0x36, 0xd7, 0x12, 0x42, 0x4b, + 0xd2, 0x2d, 0xd2, 0x0d, 0xc2, 0x45, 0xc2, 0x4d, 0xc2, 0x3d, 0xc2, 0x35, 0x6d, 0x00, 0x7a, 0x03, + 0x01, 0xbe, 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa3, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, + 0x01, 0xb3, 0x12, 0x41, 0x27, 0x12, 0x60, 0x84, 0x02, 0x36, 0xd7, 0x12, 0x42, 0x68, 0xd2, 0x2e, + 0xd2, 0x0e, 0xc2, 0x46, 0xc2, 0x4e, 0xc2, 0x3e, 0xc2, 0x36, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xbf, + 0x7e, 0x04, 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa5, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xb5, + 0x12, 0x41, 0x27, 0x12, 0x60, 0xad, 0x02, 0x36, 0xd7, 0x12, 0x42, 0x85, 0xd2, 0x2f, 0xd2, 0x0f, + 0xc2, 0x47, 0xc2, 0x4f, 0xc2, 0x3f, 0xc2, 0x37, 0x6d, 0x00, 0x7a, 0x03, 0x01, 0xc0, 0x7e, 0x04, + 0x00, 0x20, 0x7a, 0x07, 0x01, 0xa7, 0x7e, 0x04, 0x00, 0x38, 0x7a, 0x07, 0x01, 0xb7, 0x12, 0x41, + 0x27, 0x12, 0x60, 0xd6, 0x02, 0x36, 0xd7, 0x7e, 0xa0, 0xd0, 0x7e, 0x60, 0x0f, 0x12, 0x61, 0x36, + 0x40, 0x05, 0x12, 0x64, 0x86, 0xc2, 0xd7, 0x22, 0x75, 0x2f, 0xb1, 0x12, 0x73, 0x35, 0x0a, 0x52, + 0x23, 0x6d, 0x00, 0x59, 0x05, 0x00, 0x32, 0x12, 0x41, 0x83, 0x12, 0x41, 0x9f, 0xd0, 0xa8, 0x22, + 0x75, 0x2f, 0xb2, 0x12, 0x73, 0x35, 0x0a, 0x22, 0x09, 0xb2, 0x35, 0x33, 0x42, 0x23, 0x7e, 0xb0, + 0x9c, 0x19, 0xb2, 0x01, 0xb9, 0x12, 0x31, 0x4c, 0xd0, 0xa8, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, + 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x08, 0x19, + 0x30, 0x00, 0x0c, 0x7c, 0x74, 0x5e, 0x70, 0x01, 0x68, 0x12, 0x44, 0x40, 0xca, 0xb8, 0x09, 0xb0, + 0x00, 0x10, 0x44, 0x02, 0x19, 0xb0, 0x00, 0x10, 0xda, 0xb8, 0x80, 0x02, 0x54, 0xbf, 0x7c, 0x74, + 0x5e, 0x70, 0x08, 0x68, 0x04, 0x44, 0x08, 0x80, 0x02, 0x54, 0xf7, 0x09, 0x30, 0x00, 0x0c, 0xca, + 0xb8, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0xda, 0xb8, 0x19, 0xb0, 0x00, 0x08, 0x19, 0x30, 0x00, + 0x0c, 0x0a, 0x62, 0x09, 0xb6, 0x35, 0x33, 0x3e, 0x20, 0x0a, 0x62, 0x7c, 0x74, 0x5e, 0x70, 0x02, + 0x68, 0x20, 0x42, 0x27, 0xca, 0xb8, 0x74, 0x61, 0x19, 0xb0, 0x00, 0x08, 0x7e, 0x44, 0x00, 0x10, + 0x59, 0x46, 0x01, 0xa9, 0x09, 0xb0, 0x00, 0x10, 0x44, 0x01, 0x19, 0xb0, 0x00, 0x10, 0xda, 0xb8, + 0x80, 0x11, 0xf4, 0x52, 0x27, 0x74, 0xa1, 0x19, 0xb0, 0x00, 0x08, 0x7e, 0x44, 0x00, 0x38, 0x59, + 0x46, 0x01, 0xa9, 0xd0, 0xa8, 0x22, 0x7c, 0x74, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, + 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x08, 0x7c, 0x74, 0x5e, 0x70, + 0x01, 0x68, 0x04, 0x44, 0x80, 0x80, 0x02, 0x54, 0x7f, 0x7c, 0x74, 0x5e, 0x70, 0x08, 0x68, 0x04, + 0x44, 0x02, 0x80, 0x02, 0x54, 0xfd, 0x19, 0xb0, 0x00, 0x08, 0x19, 0x30, 0x00, 0x0c, 0x0a, 0x62, + 0x09, 0xb6, 0x35, 0x33, 0xa5, 0xfd, 0xf4, 0xa5, 0xfe, 0xca, 0x28, 0x3e, 0x20, 0x0a, 0x62, 0xda, + 0x28, 0x7c, 0x74, 0x5e, 0x70, 0x02, 0x68, 0x10, 0xa5, 0xed, 0x42, 0x28, 0x42, 0x26, 0x7e, 0x44, + 0x00, 0x08, 0x59, 0x46, 0x01, 0x99, 0x80, 0x04, 0xa5, 0xee, 0x52, 0x28, 0x7c, 0x74, 0x5e, 0x70, + 0x04, 0x68, 0x10, 0xa5, 0xed, 0x42, 0x29, 0x42, 0x26, 0x7e, 0x44, 0x00, 0x08, 0x59, 0x46, 0x01, + 0x99, 0x80, 0x15, 0xa5, 0xee, 0x52, 0x29, 0x7c, 0x74, 0x5e, 0x70, 0x02, 0x78, 0x0a, 0x52, 0x26, + 0x7e, 0x44, 0x00, 0x20, 0x59, 0x46, 0x01, 0x99, 0x12, 0x42, 0xa2, 0xd0, 0xa8, 0x22, 0x7e, 0x04, + 0x80, 0x00, 0x4c, 0x02, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x19, 0x40, + 0x00, 0x10, 0x19, 0x30, 0x00, 0x0c, 0xd0, 0xa8, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x09, + 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x19, 0x40, 0x00, 0x18, 0x19, 0x30, 0x00, + 0x0c, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb5, 0x12, 0x73, 0x35, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, + 0x09, 0xb0, 0x00, 0x0c, 0x44, 0x40, 0x19, 0xb0, 0x00, 0x0c, 0xe5, 0x58, 0xb4, 0x07, 0x23, 0x09, + 0xb0, 0x00, 0x10, 0x4e, 0xb0, 0x02, 0x19, 0xb0, 0x00, 0x10, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, + 0x19, 0xb0, 0x00, 0x0c, 0x09, 0xb0, 0x00, 0x04, 0x54, 0xf7, 0x19, 0xb0, 0x00, 0x04, 0x19, 0x30, + 0x00, 0x0c, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb6, 0x12, 0x73, 0x35, 0x7e, 0x04, 0x80, 0x00, 0x4c, + 0x02, 0xe5, 0x58, 0xb4, 0x07, 0x18, 0x09, 0x30, 0x00, 0x0c, 0x74, 0xbf, 0x19, 0xb0, 0x00, 0x0c, + 0x09, 0xb0, 0x00, 0x04, 0x44, 0x08, 0x19, 0xb0, 0x00, 0x04, 0x19, 0x30, 0x00, 0x0c, 0x09, 0xb0, + 0x00, 0x0c, 0x54, 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0xd0, 0xa8, 0x22, 0x75, 0x2f, 0xb4, 0x12, 0x73, + 0x35, 0x7a, 0x21, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x41, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0xb0, 0x01, + 0x7e, 0xa0, 0xc8, 0x7c, 0x64, 0x12, 0x61, 0x36, 0x12, 0x64, 0x86, 0xd0, 0xa8, 0x22, 0x39, 0x2e, + 0x39, 0x75, 0x39, 0xbc, 0x3a, 0x03, 0x3a, 0x4a, 0x3a, 0x91, 0x3a, 0xd8, 0x3b, 0x1f, 0x75, 0x2f, + 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, + 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, 0x69, 0x7e, 0x27, 0x01, 0x79, 0x2d, 0x23, + 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x08, 0x2c, 0x38, 0x0f, + 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x69, 0x7a, 0x27, 0x01, 0x79, 0x02, 0x46, 0x4f, 0x7e, + 0x14, 0x04, 0x2d, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x01, 0x12, 0x73, + 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, + 0x6b, 0x7e, 0x27, 0x01, 0x7b, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, + 0x14, 0xbe, 0x14, 0x0c, 0x2c, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x6b, 0x7a, + 0x27, 0x01, 0x7b, 0x02, 0x49, 0x7c, 0x7e, 0x14, 0x08, 0x2d, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, + 0x73, 0x35, 0x75, 0x2f, 0x02, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, + 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, 0x6d, 0x7e, 0x27, 0x01, 0x7d, 0x2d, 0x23, 0x7e, 0x09, + 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x10, 0x2c, 0x38, 0x0f, 0x1b, 0x34, + 0x78, 0xec, 0x7a, 0x17, 0x01, 0x6d, 0x7a, 0x27, 0x01, 0x7d, 0x02, 0x4c, 0xa9, 0x7e, 0x14, 0x0c, + 0x2d, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x03, 0x12, 0x73, 0x35, 0x7a, + 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, 0x6f, 0x7e, + 0x27, 0x01, 0x7f, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, + 0x14, 0x14, 0x2c, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x6f, 0x7a, 0x27, 0x01, + 0x7f, 0x02, 0x4f, 0xd6, 0x7e, 0x14, 0x10, 0x2d, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x73, 0x35, + 0x75, 0x2f, 0x04, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, + 0x73, 0x35, 0x7e, 0x17, 0x01, 0x71, 0x7e, 0x27, 0x01, 0x81, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, + 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x18, 0x2c, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, + 0x7a, 0x17, 0x01, 0x71, 0x7a, 0x27, 0x01, 0x81, 0x02, 0x53, 0x03, 0x7e, 0x14, 0x14, 0x2d, 0x80, + 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x05, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, + 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, 0x73, 0x7e, 0x27, 0x01, + 0x83, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x1c, + 0x2c, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x73, 0x7a, 0x27, 0x01, 0x83, 0x02, + 0x56, 0x30, 0x7e, 0x14, 0x18, 0x2d, 0x80, 0xeb, 0x75, 0x2f, 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, + 0x06, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, + 0x7e, 0x17, 0x01, 0x75, 0x7e, 0x27, 0x01, 0x85, 0x2d, 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, + 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x20, 0x2c, 0x38, 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, + 0x01, 0x75, 0x7a, 0x27, 0x01, 0x85, 0x02, 0x59, 0x5d, 0x7e, 0x14, 0x1c, 0x2d, 0x80, 0xeb, 0x75, + 0x2f, 0x55, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x07, 0x12, 0x73, 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, + 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x7e, 0x17, 0x01, 0x77, 0x7e, 0x27, 0x01, 0x87, 0x2d, + 0x23, 0x7e, 0x09, 0xb0, 0x0b, 0x04, 0x7a, 0x19, 0xb0, 0x0b, 0x14, 0xbe, 0x14, 0x24, 0x2c, 0x38, + 0x0f, 0x1b, 0x34, 0x78, 0xec, 0x7a, 0x17, 0x01, 0x77, 0x7a, 0x27, 0x01, 0x87, 0x02, 0x5c, 0x8a, + 0x7e, 0x14, 0x20, 0x2d, 0x80, 0xeb, + +// Segment #15, Start Address 00ff4000, Length 13109 +0xff,0x00,0x00,0x40,0x35,0x33, + 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x14, 0x7f, 0xf8, 0x7e, 0x24, 0x00, 0xfe, 0x7d, 0x31, 0x0b, 0x1a, + 0x50, 0x1b, 0x0a, 0x50, 0x7e, 0x14, 0x40, 0x1b, 0x02, 0x40, 0x74, 0x7e, 0xf8, 0x00, 0x59, 0x75, + 0xb0, 0xdf, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x90, 0x00, 0x7e, 0xf4, 0x40, 0x30, 0x02, 0x40, 0x8b, + 0x12, 0x74, 0x4e, 0xf5, 0x2e, 0x7a, 0xa1, 0x2d, 0x7a, 0x11, 0x58, 0x12, 0x6b, 0x02, 0x12, 0x40, + 0xeb, 0x7e, 0xb3, 0x3f, 0xf1, 0x60, 0x03, 0x12, 0x43, 0x79, 0x12, 0x6b, 0xde, 0xd2, 0xaf, 0x02, + 0x30, 0x00, 0x7e, 0x04, 0x00, 0xff, 0x7e, 0x18, 0x40, 0x60, 0x7a, 0x1c, 0x00, 0x01, 0x89, 0x18, + 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x94, 0x00, 0x7a, 0xb3, 0x2c, 0x35, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, + 0x93, 0x00, 0x89, 0x08, 0x7e, 0x04, 0x00, 0xff, 0x7e, 0x18, 0x40, 0x82, 0x7a, 0x1c, 0x00, 0x01, + 0x89, 0x18, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x93, 0x00, 0x89, 0x08, 0x7e, 0x08, 0x00, 0x20, 0x7e, + 0x44, 0x04, 0x00, 0x7e, 0x40, 0x00, 0x7e, 0xe4, 0x40, 0x9d, 0x02, 0x73, 0x50, 0x7e, 0x08, 0x01, + 0x59, 0x7e, 0x44, 0x2a, 0xdd, 0x7e, 0x40, 0x00, 0x7e, 0xe4, 0x40, 0xaf, 0x02, 0x73, 0x50, 0x7e, + 0x08, 0x00, 0x59, 0x7e, 0x44, 0x01, 0x00, 0x7e, 0x40, 0x53, 0x7e, 0xe4, 0x40, 0xc1, 0x02, 0x73, + 0x50, 0x75, 0x57, 0x01, 0x75, 0x56, 0x00, 0x7e, 0x04, 0x00, 0x08, 0x75, 0x54, 0x58, 0x75, 0x55, + 0x08, 0x75, 0x51, 0x08, 0x75, 0x53, 0x01, 0x75, 0x89, 0x01, 0x75, 0x8a, 0x01, 0x75, 0x8c, 0x00, + 0xd2, 0x8c, 0x7e, 0x04, 0x00, 0x02, 0x7a, 0x05, 0x42, 0x89, 0xf4, 0x75, 0xb7, 0x7f, 0x75, 0xb8, + 0x7f, 0x75, 0xb3, 0x01, 0x75, 0xb2, 0x01, 0xd2, 0xa9, 0x22, 0x75, 0xb0, 0xdf, 0xe4, 0xd5, 0xe0, + 0xfd, 0x75, 0xb0, 0xef, 0x7e, 0x24, 0x80, 0x00, 0x7e, 0x11, 0x2e, 0x7e, 0xa0, 0x08, 0x19, 0xa2, + 0x00, 0x10, 0x2e, 0x24, 0x01, 0x00, 0xa5, 0xd9, 0xf2, 0x7e, 0x20, 0x00, 0x12, 0x41, 0x83, 0x0b, + 0x20, 0xbe, 0x21, 0x2e, 0x78, 0xf6, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0x74, 0xbf, 0x19, + 0xb0, 0x00, 0x0c, 0x74, 0x10, 0x19, 0xb0, 0x00, 0x08, 0x74, 0x80, 0x19, 0xb0, 0x00, 0x0c, 0x7e, + 0x54, 0x00, 0x02, 0x19, 0xa0, 0x00, 0x04, 0x19, 0xb0, 0x00, 0x00, 0x74, 0x03, 0x19, 0xb0, 0x00, + 0x0c, 0x74, 0x07, 0x20, 0x68, 0x02, 0x74, 0x0f, 0x19, 0xb0, 0x00, 0x04, 0x30, 0x6b, 0x17, 0x74, + 0xbf, 0x19, 0xb0, 0x00, 0x0c, 0x74, 0x28, 0x20, 0x68, 0x02, 0x74, 0x20, 0x19, 0xb0, 0x00, 0x04, + 0x74, 0x03, 0x19, 0xb0, 0x00, 0x0c, 0x74, 0xa7, 0x19, 0xb0, 0x00, 0x08, 0x74, 0x0c, 0x19, 0xb0, + 0x00, 0x10, 0x22, 0x7e, 0x04, 0x80, 0x00, 0x4c, 0x02, 0xe4, 0x19, 0xb0, 0x00, 0x04, 0x09, 0xb0, + 0x00, 0x10, 0x54, 0x08, 0x19, 0xb0, 0x00, 0x10, 0x74, 0xa7, 0x19, 0xb0, 0x00, 0x08, 0x22, 0x7c, + 0xb2, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x41, 0xaa, 0x89, 0x24, 0x41, 0xba, 0x41, 0xd7, 0x41, 0xf4, + 0x42, 0x11, 0x42, 0x2e, 0x42, 0x4b, 0x42, 0x68, 0x42, 0x85, 0xc2, 0x10, 0xc2, 0x18, 0xc2, 0x08, + 0x7e, 0x04, 0x04, 0x2d, 0x7a, 0x07, 0x01, 0x59, 0x7a, 0x07, 0x01, 0x69, 0x6d, 0x00, 0x7a, 0x07, + 0x01, 0x79, 0x7a, 0x07, 0x01, 0x89, 0x22, 0xc2, 0x11, 0xc2, 0x19, 0xc2, 0x09, 0x7e, 0x04, 0x08, + 0x2d, 0x7a, 0x07, 0x01, 0x5b, 0x7a, 0x07, 0x01, 0x6b, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7b, 0x7a, + 0x07, 0x01, 0x8b, 0x22, 0xc2, 0x12, 0xc2, 0x1a, 0xc2, 0x0a, 0x7e, 0x04, 0x0c, 0x2d, 0x7a, 0x07, + 0x01, 0x5d, 0x7a, 0x07, 0x01, 0x6d, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7d, 0x7a, 0x07, 0x01, 0x8d, + 0x22, 0xc2, 0x13, 0xc2, 0x1b, 0xc2, 0x0b, 0x7e, 0x04, 0x10, 0x2d, 0x7a, 0x07, 0x01, 0x5f, 0x7a, + 0x07, 0x01, 0x6f, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x7f, 0x7a, 0x07, 0x01, 0x8f, 0x22, 0xc2, 0x14, + 0xc2, 0x1c, 0xc2, 0x0c, 0x7e, 0x04, 0x14, 0x2d, 0x7a, 0x07, 0x01, 0x61, 0x7a, 0x07, 0x01, 0x71, + 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x81, 0x7a, 0x07, 0x01, 0x91, 0x22, 0xc2, 0x15, 0xc2, 0x1d, 0xc2, + 0x0d, 0x7e, 0x04, 0x18, 0x2d, 0x7a, 0x07, 0x01, 0x63, 0x7a, 0x07, 0x01, 0x73, 0x6d, 0x00, 0x7a, + 0x07, 0x01, 0x83, 0x7a, 0x07, 0x01, 0x93, 0x22, 0xc2, 0x16, 0xc2, 0x1e, 0xc2, 0x0e, 0x7e, 0x04, + 0x1c, 0x2d, 0x7a, 0x07, 0x01, 0x65, 0x7a, 0x07, 0x01, 0x75, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x85, + 0x7a, 0x07, 0x01, 0x95, 0x22, 0xc2, 0x17, 0xc2, 0x1f, 0xc2, 0x0f, 0x7e, 0x04, 0x20, 0x2d, 0x7a, + 0x07, 0x01, 0x67, 0x7a, 0x07, 0x01, 0x77, 0x6d, 0x00, 0x7a, 0x07, 0x01, 0x87, 0x7a, 0x07, 0x01, + 0x97, 0x22, 0x7c, 0xb2, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x42, 0xad, 0x89, 0x24, 0x42, 0xbd, 0x42, + 0xd4, 0x42, 0xeb, 0x43, 0x02, 0x43, 0x19, 0x43, 0x30, 0x43, 0x47, 0x43, 0x5e, 0x30, 0x40, 0x07, + 0x20, 0x58, 0x04, 0xc2, 0x28, 0x80, 0x0c, 0x30, 0x48, 0x07, 0x20, 0x50, 0x04, 0xc2, 0x28, 0x80, + 0x02, 0xd2, 0x28, 0x22, 0x30, 0x41, 0x07, 0x20, 0x59, 0x04, 0xc2, 0x29, 0x80, 0x0c, 0x30, 0x49, + 0x07, 0x20, 0x51, 0x04, 0xc2, 0x29, 0x80, 0x02, 0xd2, 0x29, 0x22, 0x30, 0x42, 0x07, 0x20, 0x5a, + 0x04, 0xc2, 0x2a, 0x80, 0x0c, 0x30, 0x4a, 0x07, 0x20, 0x52, 0x04, 0xc2, 0x2a, 0x80, 0x02, 0xd2, + 0x2a, 0x22, 0x30, 0x43, 0x07, 0x20, 0x5b, 0x04, 0xc2, 0x2b, 0x80, 0x0c, 0x30, 0x4b, 0x07, 0x20, + 0x53, 0x04, 0xc2, 0x2b, 0x80, 0x02, 0xd2, 0x2b, 0x22, 0x30, 0x44, 0x07, 0x20, 0x5c, 0x04, 0xc2, + 0x2c, 0x80, 0x0c, 0x30, 0x4c, 0x07, 0x20, 0x54, 0x04, 0xc2, 0x2c, 0x80, 0x02, 0xd2, 0x2c, 0x22, + 0x30, 0x45, 0x07, 0x20, 0x5d, 0x04, 0xc2, 0x2d, 0x80, 0x0c, 0x30, 0x4d, 0x07, 0x20, 0x55, 0x04, + 0xc2, 0x2d, 0x80, 0x02, 0xd2, 0x2d, 0x22, 0x30, 0x46, 0x07, 0x20, 0x5e, 0x04, 0xc2, 0x2e, 0x80, + 0x0c, 0x30, 0x4e, 0x07, 0x20, 0x56, 0x04, 0xc2, 0x2e, 0x80, 0x02, 0xd2, 0x2e, 0x22, 0x30, 0x47, + 0x07, 0x20, 0x5f, 0x04, 0xc2, 0x2f, 0x80, 0x0c, 0x30, 0x4f, 0x07, 0x20, 0x57, 0x04, 0xc2, 0x2f, + 0x80, 0x02, 0xd2, 0x2f, 0x22, 0x44, 0x66, 0x43, 0x8a, 0xbe, 0xb0, 0x02, 0x40, 0x01, 0x22, 0x23, + 0x0a, 0x5b, 0x49, 0x55, 0x43, 0x75, 0x99, 0x54, 0xd3, 0x22, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x94, + 0x00, 0x7a, 0xb3, 0x2c, 0x35, 0x12, 0x44, 0x7a, 0x7e, 0x04, 0x28, 0x2d, 0x7a, 0x07, 0x01, 0xc1, + 0x7a, 0x07, 0x01, 0xc3, 0x7e, 0x04, 0x24, 0x2d, 0x7a, 0x07, 0x01, 0xc7, 0x7a, 0x07, 0x01, 0xc9, + 0x7e, 0x04, 0x66, 0x7f, 0x7a, 0x05, 0x4b, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x1c, 0x74, 0x12, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x07, 0x74, + 0x1e, 0x7a, 0xb3, 0x91, 0x10, 0x74, 0x48, 0x7a, 0xb3, 0x91, 0x12, 0x74, 0x10, 0x7a, 0xb3, 0x91, + 0x13, 0x74, 0x3f, 0x7a, 0xb3, 0x91, 0x14, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x1c, 0x74, 0x14, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x07, 0x74, + 0x16, 0x7a, 0xb3, 0x91, 0x10, 0x74, 0x08, 0x7a, 0xb3, 0x91, 0x11, 0x74, 0x20, 0x7a, 0xb3, 0x91, + 0x13, 0x74, 0x3f, 0x7a, 0xb3, 0x91, 0x14, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x1c, 0x74, 0x16, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x07, 0x74, + 0x2f, 0x7a, 0xb3, 0x91, 0x10, 0x74, 0x48, 0x7a, 0xb3, 0x91, 0x12, 0x74, 0x10, 0x7a, 0xb3, 0x91, + 0x13, 0x74, 0x3f, 0x7a, 0xb3, 0x91, 0x14, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x06, 0x74, 0x0f, 0x7a, + 0xb3, 0x91, 0x07, 0x12, 0x40, 0xfa, 0x7e, 0x20, 0x00, 0x12, 0x41, 0x9f, 0x0b, 0x20, 0xbe, 0x21, + 0x2e, 0x78, 0xf6, 0xd2, 0xa8, 0x22, 0x7e, 0xb0, 0x01, 0x7a, 0xb3, 0x94, 0x00, 0x7a, 0xb3, 0x2c, + 0x35, 0x12, 0x44, 0x7a, 0x75, 0xb0, 0xdf, 0xc2, 0xa8, 0x22, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x06, + 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x07, 0x7e, 0x20, 0x04, 0x7c, 0xb2, 0xc2, 0xd7, 0x13, 0x13, 0x13, + 0x13, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x74, 0x02, 0x7a, 0xb3, 0x91, + 0x12, 0xa5, 0xda, 0xe5, 0x22, 0xca, 0x09, 0x12, 0x30, 0x0e, 0x10, 0x01, 0x34, 0xd5, 0x51, 0x40, + 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0xb3, 0x91, 0x07, + 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0xb3, 0x91, 0x07, 0x7e, 0xb3, 0x91, 0x14, 0x7e, 0xb3, + 0x91, 0x04, 0x63, 0x53, 0x01, 0x7e, 0x00, 0x54, 0x2e, 0x01, 0x53, 0xa5, 0xe6, 0xf5, 0x51, 0x80, + 0x12, 0x20, 0x02, 0x1d, 0x75, 0x53, 0x00, 0x85, 0x54, 0x51, 0xd2, 0x02, 0x74, 0x03, 0x80, 0x0d, + 0x30, 0x02, 0x0e, 0xc2, 0x02, 0x7e, 0x00, 0x56, 0x2e, 0x01, 0x53, 0xa5, 0xe6, 0x7a, 0xb3, 0x90, + 0x00, 0xda, 0x09, 0x32, 0x45, 0x6f, 0x45, 0x8b, 0x45, 0xa7, 0x45, 0xc3, 0x45, 0xdf, 0x45, 0xfb, + 0x46, 0x17, 0x46, 0x33, 0xc0, 0xd0, 0xc0, 0xd1, 0xc0, 0xe0, 0xc0, 0xf0, 0xca, 0x0b, 0xca, 0x1b, + 0xca, 0x2b, 0xd2, 0x01, 0x75, 0x2f, 0x89, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x90, 0x00, 0x60, 0x28, + 0x7e, 0x14, 0x80, 0x00, 0x7e, 0x00, 0x00, 0x13, 0x50, 0x13, 0xca, 0x0b, 0xca, 0x59, 0x7c, 0xb0, + 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x45, 0x04, 0x99, 0x24, 0xda, 0x59, 0xda, 0x0b, 0xa5, 0x0a, 0xa5, + 0x08, 0xbe, 0x01, 0x2e, 0x78, 0xe1, 0x80, 0xd2, 0x30, 0x04, 0x05, 0xc2, 0x04, 0x12, 0x64, 0x86, + 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0xd0, 0xf0, 0xd0, 0xe0, 0xd0, 0xd1, 0xd0, 0xd0, 0x32, 0x09, + 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, 0x80, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, + 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x61, 0xab, 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, + 0xe0, 0x14, 0x75, 0x2f, 0x81, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, + 0x69, 0x52, 0x61, 0xeb, 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, + 0x82, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x62, 0x2b, + 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, 0x83, 0x12, 0x73, 0x35, + 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x62, 0x6b, 0x89, 0x54, 0x22, 0x09, + 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, 0x84, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, + 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x62, 0xab, 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, + 0xe0, 0x14, 0x75, 0x2f, 0x85, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, + 0x69, 0x52, 0x62, 0xeb, 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, + 0x86, 0x12, 0x73, 0x35, 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x63, 0x2b, + 0x89, 0x54, 0x22, 0x09, 0xb1, 0x00, 0x08, 0x20, 0xe0, 0x14, 0x75, 0x2f, 0x87, 0x12, 0x73, 0x35, + 0x54, 0x3e, 0x0a, 0x5b, 0x7e, 0x44, 0x00, 0xff, 0x69, 0x52, 0x63, 0x6b, 0x89, 0x54, 0x22, 0x10, + 0x08, 0x01, 0x22, 0x20, 0x28, 0x03, 0xd2, 0x08, 0x22, 0x75, 0x2f, 0xa0, 0x12, 0x73, 0x35, 0x7e, + 0x14, 0x80, 0x00, 0x80, 0x06, 0x20, 0x28, 0x03, 0xd2, 0x08, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, + 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x49, 0x45, 0x30, 0x30, 0x06, 0x20, 0xe6, + 0x4f, 0xd2, 0x08, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x60, 0x7e, 0x37, 0x01, 0x79, 0x7e, 0x27, 0x01, + 0x99, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x32, 0x7a, 0x05, 0x32, 0x7a, 0x37, 0x01, + 0x79, 0x7e, 0x37, 0x01, 0x59, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x08, 0x2c, 0x38, 0x68, 0x7a, + 0x47, 0x01, 0x59, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, + 0x69, 0xf0, 0x10, 0x60, 0xc4, 0x22, 0xc2, 0x60, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, + 0x7e, 0x27, 0x01, 0x79, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x99, 0x28, 0x04, + 0x7e, 0x27, 0x01, 0x99, 0x7e, 0x37, 0x01, 0x79, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x32, 0x7a, + 0x05, 0x32, 0x7a, 0x37, 0x01, 0x79, 0x7e, 0x37, 0x01, 0x59, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, + 0x08, 0x2c, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x59, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, + 0x2f, 0x12, 0x73, 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, + 0x12, 0x73, 0x35, 0x9e, 0x44, 0x08, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x04, 0x2d, + 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x59, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, + 0x02, 0x46, 0xc2, 0x22, 0xd2, 0x08, 0x7e, 0x04, 0x04, 0x2d, 0x7a, 0x07, 0x01, 0x59, 0x7a, 0x07, + 0x01, 0x69, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, + 0x2f, 0x92, 0x12, 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, + 0xb8, 0x78, 0x68, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xa9, 0x2e, 0x24, 0x00, 0x02, 0x2d, + 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, + 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, + 0x3c, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x00, 0x00, 0x2e, 0x27, 0x01, 0xa9, 0x1b, 0x38, 0x20, + 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, + 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x38, 0x0a, 0x09, 0xb1, + 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x10, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, + 0x12, 0x73, 0x35, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x00, 0x00, 0x2e, 0x67, 0x01, + 0xa9, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, + 0x34, 0x24, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, + 0xc0, 0x7e, 0x34, 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, + 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x00, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, + 0x35, 0x75, 0x2f, 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, + 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, + 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, + 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, + 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, + 0x01, 0xc9, 0x7e, 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, + 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, + 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, + 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x48, 0x1e, 0x75, 0x2f, + 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x38, + 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x10, 0x22, 0xda, 0xb8, + 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x48, 0x1e, 0xda, 0xb8, 0x02, 0x49, + 0x45, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, + 0x12, 0x73, 0x35, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, + 0x04, 0xd2, 0x58, 0x80, 0x02, 0xc2, 0x58, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x50, + 0x80, 0x02, 0xc2, 0x50, 0x12, 0x42, 0xbd, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, + 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, + 0xa0, 0x80, 0x02, 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, + 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, + 0x12, 0x61, 0x36, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x48, 0x72, 0x75, 0x2f, + 0x95, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x10, 0x09, 0x01, 0x22, + 0x20, 0x29, 0x03, 0xd2, 0x09, 0x22, 0x75, 0x2f, 0xa1, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x81, 0x00, + 0x80, 0x06, 0x20, 0x29, 0x03, 0xd2, 0x09, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, + 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x4c, 0x72, 0x30, 0x31, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x09, + 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x61, 0x7e, 0x37, 0x01, 0x7b, 0x7e, 0x27, 0x01, 0x9b, 0x9d, 0x32, + 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x34, 0x7a, 0x05, 0x34, 0x7a, 0x37, 0x01, 0x7b, 0x7e, 0x37, + 0x01, 0x5b, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x0c, 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x5b, + 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, 0x10, + 0x61, 0xc4, 0x22, 0xc2, 0x61, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, + 0x7b, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x9b, 0x28, 0x04, 0x7e, 0x27, 0x01, + 0x9b, 0x7e, 0x37, 0x01, 0x7b, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x34, 0x7a, 0x05, 0x34, 0x7a, + 0x37, 0x01, 0x7b, 0x7e, 0x37, 0x01, 0x5b, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x0c, 0x2c, 0x38, + 0x13, 0x7a, 0x47, 0x01, 0x5b, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, + 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, + 0x9e, 0x44, 0x0c, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x08, 0x2d, 0x7d, 0x24, 0x2d, + 0x43, 0x7a, 0x47, 0x01, 0x5b, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x49, 0xef, + 0x22, 0xd2, 0x09, 0x7e, 0x04, 0x08, 0x2d, 0x7a, 0x07, 0x01, 0x5b, 0x7a, 0x07, 0x01, 0x6b, 0x75, + 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, 0x12, + 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x68, + 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xab, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, + 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, + 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, 0x47, + 0x01, 0xc9, 0x7e, 0x24, 0x01, 0x00, 0x2e, 0x27, 0x01, 0xab, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, + 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, + 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x39, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, + 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x11, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, + 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x01, 0x00, 0x2e, 0x67, 0x01, 0xab, 0x9e, 0x24, + 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, 0x2d, + 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, 0x34, + 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, + 0x0f, 0x23, 0x23, 0x23, 0x44, 0x01, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, + 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, + 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, + 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x24, + 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, 0x7e, + 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, + 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, + 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, + 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, + 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x4b, 0x4b, 0x75, 0x2f, 0x99, 0x12, 0x73, + 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x39, 0x0a, 0x09, 0xb1, + 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x11, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, + 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x4b, 0x4b, 0xda, 0xb8, 0x02, 0x4c, 0x72, 0x09, 0xb1, + 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, 0x35, + 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x59, + 0x80, 0x02, 0xc2, 0x59, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x51, 0x80, 0x02, 0xc2, + 0x51, 0x12, 0x42, 0xd4, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, + 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, + 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, 0x5e, + 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, 0x36, + 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x4b, 0x9f, 0x75, 0x2f, 0x95, 0x12, 0x73, + 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x10, 0x0a, 0x01, 0x22, 0x20, 0x2a, 0x03, + 0xd2, 0x0a, 0x22, 0x75, 0x2f, 0xa2, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x82, 0x00, 0x80, 0x06, 0x20, + 0x2a, 0x03, 0xd2, 0x0a, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, + 0x68, 0x03, 0x12, 0x4f, 0x9f, 0x30, 0x32, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0a, 0x22, 0x30, 0xe6, + 0x02, 0xd2, 0x62, 0x7e, 0x37, 0x01, 0x7d, 0x7e, 0x27, 0x01, 0x9d, 0x9d, 0x32, 0x40, 0x31, 0x7d, + 0x02, 0x2e, 0x05, 0x36, 0x7a, 0x05, 0x36, 0x7a, 0x37, 0x01, 0x7d, 0x7e, 0x37, 0x01, 0x5d, 0x7d, + 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x10, 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x5d, 0x75, 0x2f, 0x94, + 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, 0x10, 0x62, 0xc4, 0x22, + 0xc2, 0x62, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x7d, 0xbe, 0x24, + 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0x9d, 0x28, 0x04, 0x7e, 0x27, 0x01, 0x9d, 0x7e, 0x37, + 0x01, 0x7d, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x36, 0x7a, 0x05, 0x36, 0x7a, 0x37, 0x01, 0x7d, + 0x7e, 0x37, 0x01, 0x5d, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x10, 0x2c, 0x38, 0x13, 0x7a, 0x47, + 0x01, 0x5d, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x69, + 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x10, + 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x0c, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, + 0x01, 0x5d, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x4d, 0x1c, 0x22, 0xd2, 0x0a, + 0x7e, 0x04, 0x0c, 0x2d, 0x7a, 0x07, 0x01, 0x5d, 0x7a, 0x07, 0x01, 0x6d, 0x75, 0x2f, 0x94, 0x12, + 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x73, 0x35, 0xd2, + 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x68, 0x7e, 0x37, 0x01, + 0xcb, 0x7e, 0x27, 0x01, 0xad, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, + 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, + 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, 0x47, 0x01, 0xc9, 0x7e, + 0x24, 0x02, 0x00, 0x2e, 0x27, 0x01, 0xad, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, + 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, + 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3a, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, + 0x00, 0x10, 0xd2, 0x12, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x28, + 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x02, 0x00, 0x2e, 0x67, 0x01, 0xad, 0x9e, 0x24, 0x00, 0x02, 0x40, + 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, 0x2d, 0x7d, 0x24, 0x2d, + 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x24, 0x2d, 0x7a, + 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, + 0x23, 0x44, 0x02, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x73, + 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, + 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, + 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x28, + 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, + 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x28, 0x2d, + 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, + 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, + 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, + 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x4e, 0x78, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, + 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3a, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, + 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x12, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, + 0x07, 0xca, 0xb8, 0x12, 0x4e, 0x78, 0xda, 0xb8, 0x02, 0x4f, 0x9f, 0x09, 0xb1, 0x00, 0x18, 0x7e, + 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, 0x35, 0xa5, 0xfd, 0x5e, + 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5a, 0x80, 0x02, 0xc2, + 0x5a, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x52, 0x80, 0x02, 0xc2, 0x52, 0x12, 0x42, + 0xeb, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, + 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x61, 0x13, 0xd2, + 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, + 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, 0x36, 0x09, 0xb1, 0x00, + 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x4e, 0xcc, 0x75, 0x2f, 0x95, 0x12, 0x73, 0x35, 0x22, 0x75, + 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x10, 0x0b, 0x01, 0x22, 0x20, 0x2b, 0x03, 0xd2, 0x0b, 0x22, + 0x75, 0x2f, 0xa3, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x83, 0x00, 0x80, 0x06, 0x20, 0x2b, 0x03, 0xd2, + 0x0b, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, + 0x52, 0xcc, 0x30, 0x33, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0b, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x63, + 0x7e, 0x37, 0x01, 0x7f, 0x7e, 0x27, 0x01, 0x9f, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, + 0x38, 0x7a, 0x05, 0x38, 0x7a, 0x37, 0x01, 0x7f, 0x7e, 0x37, 0x01, 0x5f, 0x7d, 0x43, 0x2d, 0x42, + 0xbe, 0x44, 0x14, 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x5f, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, + 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, 0x10, 0x63, 0xc4, 0x22, 0xc2, 0x63, 0x2d, + 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x7f, 0xbe, 0x24, 0x00, 0x00, 0x68, + 0x6a, 0xbe, 0x27, 0x01, 0x9f, 0x28, 0x04, 0x7e, 0x27, 0x01, 0x9f, 0x7e, 0x37, 0x01, 0x7f, 0x9d, + 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x38, 0x7a, 0x05, 0x38, 0x7a, 0x37, 0x01, 0x7f, 0x7e, 0x37, 0x01, + 0x5f, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x14, 0x2c, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x5f, 0x75, + 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, + 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x14, 0x2d, 0x9d, 0x24, + 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x10, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x5f, 0x12, + 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x50, 0x49, 0x22, 0xd2, 0x0b, 0x7e, 0x04, 0x10, + 0x2d, 0x7a, 0x07, 0x01, 0x5f, 0x7a, 0x07, 0x01, 0x6f, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, + 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, + 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x68, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, + 0x01, 0xaf, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, + 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, + 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x03, 0x00, + 0x2e, 0x27, 0x01, 0xaf, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, + 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, + 0x00, 0x04, 0x30, 0x3b, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, + 0x13, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, + 0x7e, 0x64, 0x03, 0x00, 0x2e, 0x67, 0x01, 0xaf, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, + 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, + 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, + 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x03, + 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, + 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, + 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, + 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, + 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, + 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, + 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, + 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, + 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, + 0x78, 0xe7, 0x02, 0x51, 0xa5, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, + 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3b, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, + 0x00, 0x10, 0xd2, 0x13, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, + 0x12, 0x51, 0xa5, 0xda, 0xb8, 0x02, 0x52, 0xcc, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, + 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, 0x35, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, + 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5b, 0x80, 0x02, 0xc2, 0x5b, 0xa5, 0xfd, + 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x53, 0x80, 0x02, 0xc2, 0x53, 0x12, 0x43, 0x02, 0x02, 0x61, + 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, + 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, + 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, + 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, 0x36, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, + 0xdb, 0x22, 0x02, 0x51, 0xf9, 0x75, 0x2f, 0x95, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, + 0x73, 0x35, 0x22, 0x10, 0x0c, 0x01, 0x22, 0x20, 0x2c, 0x03, 0xd2, 0x0c, 0x22, 0x75, 0x2f, 0xa4, + 0x12, 0x73, 0x35, 0x7e, 0x14, 0x84, 0x00, 0x80, 0x06, 0x20, 0x2c, 0x03, 0xd2, 0x0c, 0x22, 0x09, + 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x55, 0xf9, 0x30, + 0x34, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0c, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x64, 0x7e, 0x37, 0x01, + 0x81, 0x7e, 0x27, 0x01, 0xa1, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x3a, 0x7a, 0x05, + 0x3a, 0x7a, 0x37, 0x01, 0x81, 0x7e, 0x37, 0x01, 0x61, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x18, + 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x61, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, + 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, 0x10, 0x64, 0xc4, 0x22, 0xc2, 0x64, 0x2d, 0x23, 0x68, 0x78, + 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x81, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, + 0x01, 0xa1, 0x28, 0x04, 0x7e, 0x27, 0x01, 0xa1, 0x7e, 0x37, 0x01, 0x81, 0x9d, 0x32, 0x7d, 0x02, + 0x2e, 0x05, 0x3a, 0x7a, 0x05, 0x3a, 0x7a, 0x37, 0x01, 0x81, 0x7e, 0x37, 0x01, 0x61, 0x7d, 0x43, + 0x2d, 0x42, 0xbe, 0x44, 0x18, 0x2c, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x61, 0x75, 0x2f, 0x94, 0x12, + 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, + 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x18, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, + 0x7e, 0x34, 0x14, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x61, 0x12, 0x69, 0xf0, 0xbe, + 0x25, 0x20, 0x78, 0x03, 0x02, 0x53, 0x76, 0x22, 0xd2, 0x0c, 0x7e, 0x04, 0x14, 0x2d, 0x7a, 0x07, + 0x01, 0x61, 0x7a, 0x07, 0x01, 0x71, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, + 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, + 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x68, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb1, 0x2e, + 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, + 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, + 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x04, 0x00, 0x2e, 0x27, 0x01, + 0xb1, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, + 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, + 0x3c, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x14, 0x22, 0x80, + 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x04, + 0x00, 0x2e, 0x67, 0x01, 0xb1, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, + 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, + 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, + 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x04, 0x7a, 0x69, 0xb0, + 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, + 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, + 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, + 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, + 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, + 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, + 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, + 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, + 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, + 0x54, 0xd2, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, + 0x00, 0x04, 0x30, 0x3c, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, + 0x14, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x54, 0xd2, + 0xda, 0xb8, 0x02, 0x55, 0xf9, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, + 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, 0x35, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, + 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5c, 0x80, 0x02, 0xc2, 0x5c, 0xa5, 0xfd, 0x5e, 0x50, 0x80, + 0x68, 0x04, 0xd2, 0x54, 0x80, 0x02, 0xc2, 0x54, 0x12, 0x43, 0x19, 0x02, 0x61, 0x13, 0x75, 0x2f, + 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, + 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, + 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, + 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, 0x36, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, + 0x55, 0x26, 0x75, 0x2f, 0x95, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, + 0x10, 0x0d, 0x01, 0x22, 0x20, 0x2d, 0x03, 0xd2, 0x0d, 0x22, 0x75, 0x2f, 0xa5, 0x12, 0x73, 0x35, + 0x7e, 0x14, 0x85, 0x00, 0x80, 0x06, 0x20, 0x2d, 0x03, 0xd2, 0x0d, 0x22, 0x09, 0xb1, 0x00, 0x14, + 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x59, 0x26, 0x30, 0x35, 0x06, 0x20, + 0xe6, 0x4f, 0xd2, 0x0d, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x65, 0x7e, 0x37, 0x01, 0x83, 0x7e, 0x27, + 0x01, 0xa3, 0x9d, 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x3c, 0x7a, 0x05, 0x3c, 0x7a, 0x37, + 0x01, 0x83, 0x7e, 0x37, 0x01, 0x63, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x1c, 0x2c, 0x38, 0x68, + 0x7a, 0x47, 0x01, 0x63, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, + 0x12, 0x69, 0xf0, 0x10, 0x65, 0xc4, 0x22, 0xc2, 0x65, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, + 0x1a, 0x7e, 0x27, 0x01, 0x83, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa3, 0x28, + 0x04, 0x7e, 0x27, 0x01, 0xa3, 0x7e, 0x37, 0x01, 0x83, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x3c, + 0x7a, 0x05, 0x3c, 0x7a, 0x37, 0x01, 0x83, 0x7e, 0x37, 0x01, 0x63, 0x7d, 0x43, 0x2d, 0x42, 0xbe, + 0x44, 0x1c, 0x2c, 0x38, 0x13, 0x7a, 0x47, 0x01, 0x63, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, + 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, + 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x1c, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x18, + 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x63, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, + 0x03, 0x02, 0x56, 0xa3, 0x22, 0xd2, 0x0d, 0x7e, 0x04, 0x18, 0x2d, 0x7a, 0x07, 0x01, 0x63, 0x7a, + 0x07, 0x01, 0x73, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, + 0x75, 0x2f, 0x92, 0x12, 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, + 0xda, 0xb8, 0x78, 0x68, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb3, 0x2e, 0x24, 0x00, 0x02, + 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, + 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, + 0x38, 0x3c, 0x7a, 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x05, 0x00, 0x2e, 0x27, 0x01, 0xb3, 0x1b, 0x38, + 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, + 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3d, 0x0a, 0x09, + 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x15, 0x22, 0x80, 0x7f, 0x7a, 0x51, + 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x05, 0x00, 0x2e, 0x67, + 0x01, 0xb3, 0x9e, 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, + 0x7e, 0x34, 0x24, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, + 0x39, 0xc0, 0x7e, 0x34, 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, + 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x05, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, + 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, + 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, + 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, + 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, + 0x2d, 0x80, 0xcf, 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, + 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, + 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, + 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, + 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x57, 0xff, 0x75, + 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, + 0x3d, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x15, 0x22, 0xda, + 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x57, 0xff, 0xda, 0xb8, 0x02, + 0x59, 0x26, 0x09, 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, + 0x2f, 0x12, 0x73, 0x35, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, + 0x68, 0x04, 0xd2, 0x5d, 0x80, 0x02, 0xc2, 0x5d, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, + 0x55, 0x80, 0x02, 0xc2, 0x55, 0x12, 0x43, 0x30, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, + 0x35, 0x09, 0xb1, 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, + 0x7e, 0xa0, 0x80, 0x02, 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, + 0x13, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, + 0x00, 0x12, 0x61, 0x36, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x58, 0x53, 0x75, + 0x2f, 0x95, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x10, 0x0e, 0x01, + 0x22, 0x20, 0x2e, 0x03, 0xd2, 0x0e, 0x22, 0x75, 0x2f, 0xa6, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x86, + 0x00, 0x80, 0x06, 0x20, 0x2e, 0x03, 0xd2, 0x0e, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, + 0xb0, 0x1e, 0xda, 0xb8, 0x68, 0x03, 0x12, 0x5c, 0x53, 0x30, 0x36, 0x06, 0x20, 0xe6, 0x4f, 0xd2, + 0x0e, 0x22, 0x30, 0xe6, 0x02, 0xd2, 0x66, 0x7e, 0x37, 0x01, 0x85, 0x7e, 0x27, 0x01, 0xa5, 0x9d, + 0x32, 0x40, 0x31, 0x7d, 0x02, 0x2e, 0x05, 0x3e, 0x7a, 0x05, 0x3e, 0x7a, 0x37, 0x01, 0x85, 0x7e, + 0x37, 0x01, 0x65, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x20, 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, + 0x65, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, + 0x10, 0x66, 0xc4, 0x22, 0xc2, 0x66, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, + 0x01, 0x85, 0xbe, 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa5, 0x28, 0x04, 0x7e, 0x27, + 0x01, 0xa5, 0x7e, 0x37, 0x01, 0x85, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x3e, 0x7a, 0x05, 0x3e, + 0x7a, 0x37, 0x01, 0x85, 0x7e, 0x37, 0x01, 0x65, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x20, 0x2c, + 0x38, 0x13, 0x7a, 0x47, 0x01, 0x65, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, + 0x73, 0x35, 0x02, 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, + 0x35, 0x9e, 0x44, 0x20, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x1c, 0x2d, 0x7d, 0x24, + 0x2d, 0x43, 0x7a, 0x47, 0x01, 0x65, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x59, + 0xd0, 0x22, 0xd2, 0x0e, 0x7e, 0x04, 0x1c, 0x2d, 0x7a, 0x07, 0x01, 0x65, 0x7a, 0x07, 0x01, 0x75, + 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, + 0x12, 0x73, 0x35, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, + 0x68, 0x7e, 0x37, 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb5, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, + 0x34, 0x04, 0x00, 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, + 0xcb, 0x7e, 0x37, 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, + 0x47, 0x01, 0xc9, 0x7e, 0x24, 0x06, 0x00, 0x2e, 0x27, 0x01, 0xb5, 0x1b, 0x38, 0x20, 0x0b, 0x35, + 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, + 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3e, 0x0a, 0x09, 0xb1, 0x00, 0x10, + 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x16, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, + 0x35, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x06, 0x00, 0x2e, 0x67, 0x01, 0xb5, 0x9e, + 0x24, 0x00, 0x02, 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, + 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, + 0x34, 0x24, 0x2d, 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, + 0x54, 0x0f, 0x23, 0x23, 0x23, 0x44, 0x06, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, + 0x2f, 0x93, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, + 0x07, 0x01, 0xc9, 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, + 0x7a, 0x35, 0x30, 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, + 0x24, 0x2d, 0x80, 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, + 0x7e, 0x07, 0x01, 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, + 0x7e, 0x44, 0x28, 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, + 0xbd, 0x04, 0x68, 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, + 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, + 0x7a, 0x09, 0xb0, 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x5b, 0x2c, 0x75, 0x2f, 0x99, 0x12, + 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3e, 0x0a, 0x09, + 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x16, 0x22, 0xda, 0xb8, 0x30, 0xe0, + 0xd8, 0xbd, 0x32, 0x68, 0x07, 0xca, 0xb8, 0x12, 0x5b, 0x2c, 0xda, 0xb8, 0x02, 0x5c, 0x53, 0x09, + 0xb1, 0x00, 0x18, 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, + 0x35, 0xa5, 0xfd, 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, + 0x5e, 0x80, 0x02, 0xc2, 0x5e, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x56, 0x80, 0x02, + 0xc2, 0x56, 0x12, 0x43, 0x47, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, + 0x00, 0x14, 0x7a, 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, + 0x02, 0x61, 0x13, 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, + 0x5e, 0xb0, 0x1c, 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, + 0x36, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x5b, 0x80, 0x75, 0x2f, 0x95, 0x12, + 0x73, 0x35, 0x22, 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x10, 0x0f, 0x01, 0x22, 0x20, 0x2f, + 0x03, 0xd2, 0x0f, 0x22, 0x75, 0x2f, 0xa7, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x87, 0x00, 0x80, 0x06, + 0x20, 0x2f, 0x03, 0xd2, 0x0f, 0x22, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x5e, 0xb0, 0x1e, 0xda, + 0xb8, 0x68, 0x03, 0x12, 0x5f, 0x80, 0x30, 0x37, 0x06, 0x20, 0xe6, 0x4f, 0xd2, 0x0f, 0x22, 0x30, + 0xe6, 0x02, 0xd2, 0x67, 0x7e, 0x37, 0x01, 0x87, 0x7e, 0x27, 0x01, 0xa7, 0x9d, 0x32, 0x40, 0x31, + 0x7d, 0x02, 0x2e, 0x05, 0x40, 0x7a, 0x05, 0x40, 0x7a, 0x37, 0x01, 0x87, 0x7e, 0x37, 0x01, 0x67, + 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x24, 0x2c, 0x38, 0x68, 0x7a, 0x47, 0x01, 0x67, 0x75, 0x2f, + 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x69, 0xf0, 0x10, 0x67, 0xc4, + 0x22, 0xc2, 0x67, 0x2d, 0x23, 0x68, 0x78, 0x6d, 0x33, 0x80, 0x1a, 0x7e, 0x27, 0x01, 0x87, 0xbe, + 0x24, 0x00, 0x00, 0x68, 0x6a, 0xbe, 0x27, 0x01, 0xa7, 0x28, 0x04, 0x7e, 0x27, 0x01, 0xa7, 0x7e, + 0x37, 0x01, 0x87, 0x9d, 0x32, 0x7d, 0x02, 0x2e, 0x05, 0x40, 0x7a, 0x05, 0x40, 0x7a, 0x37, 0x01, + 0x87, 0x7e, 0x37, 0x01, 0x67, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x24, 0x2c, 0x38, 0x13, 0x7a, + 0x47, 0x01, 0x67, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x02, + 0x69, 0xf0, 0x75, 0x2f, 0x94, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, + 0x24, 0x2d, 0x9d, 0x24, 0x12, 0x69, 0xf0, 0x7e, 0x34, 0x20, 0x2d, 0x7d, 0x24, 0x2d, 0x43, 0x7a, + 0x47, 0x01, 0x67, 0x12, 0x69, 0xf0, 0xbe, 0x25, 0x20, 0x78, 0x03, 0x02, 0x5c, 0xfd, 0x22, 0xd2, + 0x0f, 0x7e, 0x04, 0x20, 0x2d, 0x7a, 0x07, 0x01, 0x67, 0x7a, 0x07, 0x01, 0x77, 0x75, 0x2f, 0x94, + 0x12, 0x73, 0x35, 0x75, 0x2f, 0x00, 0x12, 0x73, 0x35, 0x22, 0x75, 0x2f, 0x92, 0x12, 0x73, 0x35, + 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0xca, 0xb8, 0x54, 0x82, 0xda, 0xb8, 0x78, 0x68, 0x7e, 0x37, + 0x01, 0xcb, 0x7e, 0x27, 0x01, 0xb7, 0x2e, 0x24, 0x00, 0x02, 0x2d, 0x32, 0xbe, 0x34, 0x04, 0x00, + 0x38, 0x34, 0x7d, 0x02, 0x2e, 0x05, 0x30, 0x7a, 0x05, 0x30, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, + 0x01, 0xc9, 0x7d, 0x43, 0x2d, 0x42, 0xbe, 0x44, 0x28, 0x2c, 0x38, 0x3c, 0x7a, 0x47, 0x01, 0xc9, + 0x7e, 0x24, 0x07, 0x00, 0x2e, 0x27, 0x01, 0xb7, 0x1b, 0x38, 0x20, 0x0b, 0x35, 0x7a, 0x51, 0x2f, + 0x12, 0x73, 0x35, 0x02, 0x6a, 0x63, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x04, + 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3f, 0x0a, 0x09, 0xb1, 0x00, 0x10, 0x54, 0xfe, 0x19, + 0xb1, 0x00, 0x10, 0xd2, 0x17, 0x22, 0x80, 0x7f, 0x7a, 0x51, 0x2f, 0x12, 0x73, 0x35, 0x9e, 0x44, + 0x28, 0x2d, 0x9d, 0x24, 0x7e, 0x64, 0x07, 0x00, 0x2e, 0x67, 0x01, 0xb7, 0x9e, 0x24, 0x00, 0x02, + 0x40, 0x17, 0x1b, 0x38, 0x60, 0x0b, 0x35, 0x12, 0x6a, 0x63, 0x7e, 0x34, 0x24, 0x2d, 0x7d, 0x24, + 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc9, 0x02, 0x6a, 0x63, 0x7a, 0x39, 0xc0, 0x7e, 0x34, 0x24, 0x2d, + 0x7a, 0x39, 0xd0, 0x0b, 0x34, 0x1b, 0x44, 0x80, 0xe5, 0x9d, 0x32, 0x7c, 0xb6, 0x54, 0x0f, 0x23, + 0x23, 0x23, 0x44, 0x07, 0x7a, 0x69, 0xb0, 0x7a, 0x79, 0x70, 0x0b, 0x35, 0x75, 0x2f, 0x93, 0x12, + 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0xbd, 0x04, 0x68, 0x2b, 0x7a, 0x07, 0x01, 0xc9, + 0x7e, 0x47, 0x01, 0xcb, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xcb, 0x2e, 0x35, 0x30, 0x7a, 0x35, 0x30, + 0x22, 0xd2, 0x04, 0x09, 0xb1, 0x00, 0x14, 0x20, 0xe0, 0x13, 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, + 0x28, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0x2a, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xcf, 0x7e, 0x07, 0x01, + 0xcb, 0x7e, 0x24, 0x03, 0xfe, 0x9d, 0x20, 0x28, 0x40, 0x7e, 0x07, 0x01, 0xc9, 0x7e, 0x44, 0x28, + 0x2d, 0x7d, 0x60, 0x0b, 0x04, 0xbd, 0x04, 0x68, 0xd2, 0x7d, 0x70, 0x0b, 0x04, 0xbd, 0x04, 0x68, + 0xd0, 0x7d, 0x54, 0x9d, 0x50, 0xbd, 0x25, 0x40, 0x02, 0x7d, 0x25, 0x7d, 0x32, 0x09, 0xb1, 0x00, + 0x14, 0xca, 0xb8, 0x54, 0x1f, 0xb4, 0x01, 0x31, 0xda, 0xb8, 0x7e, 0x19, 0xb0, 0x7a, 0x09, 0xb0, + 0x0b, 0x04, 0x1b, 0x24, 0x78, 0xe7, 0x02, 0x5e, 0x59, 0x75, 0x2f, 0x99, 0x12, 0x73, 0x35, 0x09, + 0xb1, 0x00, 0x04, 0x54, 0xfa, 0x19, 0xb1, 0x00, 0x04, 0x30, 0x3f, 0x0a, 0x09, 0xb1, 0x00, 0x10, + 0x54, 0xfe, 0x19, 0xb1, 0x00, 0x10, 0xd2, 0x17, 0x22, 0xda, 0xb8, 0x30, 0xe0, 0xd8, 0xbd, 0x32, + 0x68, 0x07, 0xca, 0xb8, 0x12, 0x5e, 0x59, 0xda, 0xb8, 0x02, 0x5f, 0x80, 0x09, 0xb1, 0x00, 0x18, + 0x7e, 0xa0, 0x88, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, 0x73, 0x35, 0xa5, 0xfd, + 0x5e, 0x50, 0x0a, 0x68, 0x1d, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5f, 0x80, 0x02, + 0xc2, 0x5f, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x57, 0x80, 0x02, 0xc2, 0x57, 0x12, + 0x43, 0x5e, 0x02, 0x61, 0x13, 0x75, 0x2f, 0x91, 0x12, 0x73, 0x35, 0x09, 0xb1, 0x00, 0x14, 0x7a, + 0xb1, 0x2f, 0x12, 0x73, 0x35, 0x20, 0xe0, 0x08, 0xd2, 0x04, 0x7e, 0xa0, 0x80, 0x02, 0x61, 0x13, + 0xd2, 0x04, 0x30, 0xe1, 0x06, 0x7e, 0xa0, 0x80, 0x12, 0x61, 0x13, 0xca, 0xb8, 0x5e, 0xb0, 0x1c, + 0xda, 0xb8, 0x68, 0x12, 0x7e, 0xa0, 0xc0, 0x09, 0x61, 0x00, 0x00, 0x12, 0x61, 0x36, 0x09, 0xb1, + 0x00, 0x14, 0x20, 0xe0, 0xdb, 0x22, 0x02, 0x5e, 0xad, 0x75, 0x2f, 0x95, 0x12, 0x73, 0x35, 0x22, + 0x75, 0x2f, 0x96, 0x12, 0x73, 0x35, 0x22, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, + 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x58, 0x80, 0x02, 0xc2, 0x58, + 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x50, 0x80, 0x02, 0xc2, 0x50, 0x02, 0x60, 0xff, + 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, + 0x20, 0x68, 0x04, 0xd2, 0x59, 0x80, 0x02, 0xc2, 0x59, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, + 0xd2, 0x51, 0x80, 0x02, 0xc2, 0x51, 0x02, 0x60, 0xff, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, + 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5a, 0x80, 0x02, + 0xc2, 0x5a, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x52, 0x80, 0x02, 0xc2, 0x52, 0x02, + 0x60, 0xff, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, + 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5b, 0x80, 0x02, 0xc2, 0x5b, 0xa5, 0xfd, 0x5e, 0x50, 0x80, + 0x68, 0x04, 0xd2, 0x53, 0x80, 0x02, 0xc2, 0x53, 0x02, 0x60, 0xff, 0x7c, 0x02, 0x7e, 0x14, 0x80, + 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5c, + 0x80, 0x02, 0xc2, 0x5c, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x54, 0x80, 0x02, 0xc2, + 0x54, 0x02, 0x60, 0xff, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, + 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5d, 0x80, 0x02, 0xc2, 0x5d, 0xa5, 0xfd, 0x5e, + 0x50, 0x80, 0x68, 0x04, 0xd2, 0x55, 0x80, 0x02, 0xc2, 0x55, 0x02, 0x60, 0xff, 0x7c, 0x02, 0x7e, + 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, + 0xd2, 0x5e, 0x80, 0x02, 0xc2, 0x5e, 0xa5, 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x56, 0x80, + 0x02, 0xc2, 0x56, 0x02, 0x60, 0xff, 0x7c, 0x02, 0x7e, 0x14, 0x80, 0x00, 0x4c, 0x20, 0x09, 0xb1, + 0x00, 0x18, 0xa5, 0xfd, 0x5e, 0x50, 0x20, 0x68, 0x04, 0xd2, 0x5f, 0x80, 0x02, 0xc2, 0x5f, 0xa5, + 0xfd, 0x5e, 0x50, 0x80, 0x68, 0x04, 0xd2, 0x57, 0x80, 0x02, 0xc2, 0x57, 0x02, 0x60, 0xff, 0x54, + 0xf0, 0xc4, 0xa5, 0xff, 0xc4, 0xa5, 0x4f, 0x75, 0x2f, 0x90, 0x12, 0x73, 0x35, 0xf5, 0x2f, 0x12, + 0x73, 0x35, 0x22, 0xca, 0x19, 0x5e, 0x20, 0x07, 0x4c, 0xa2, 0x7e, 0x74, 0x2c, 0x2d, 0xca, 0x79, + 0x7a, 0x79, 0xa0, 0x0b, 0x74, 0x7a, 0x79, 0xb0, 0x0b, 0x74, 0xda, 0x79, 0x7e, 0x30, 0x02, 0x7e, + 0x64, 0x00, 0x02, 0x02, 0x61, 0x5e, 0xca, 0x19, 0x5e, 0x20, 0x07, 0x4c, 0xa2, 0x7e, 0x74, 0x2c, + 0x2d, 0xca, 0x79, 0x7a, 0x79, 0xa0, 0x0b, 0x74, 0x7a, 0x79, 0xb0, 0x0b, 0x74, 0x7a, 0x79, 0x60, + 0x0b, 0x74, 0xda, 0x79, 0x7e, 0x30, 0x03, 0x7e, 0x64, 0x00, 0x03, 0x02, 0x61, 0x5e, 0xd2, 0x04, + 0x7e, 0x27, 0x01, 0xcb, 0x2d, 0x26, 0xbe, 0x24, 0x04, 0x00, 0x38, 0x2e, 0x7e, 0x07, 0x01, 0xc9, + 0x7e, 0x44, 0x28, 0x2d, 0x7e, 0x79, 0xa0, 0x7a, 0x09, 0xa0, 0x0b, 0x04, 0x0b, 0x74, 0xbd, 0x04, + 0x68, 0x23, 0xa5, 0xdb, 0xef, 0x7a, 0x27, 0x01, 0xcb, 0x7e, 0x25, 0x30, 0x2d, 0x26, 0x7a, 0x25, + 0x30, 0x7a, 0x07, 0x01, 0xc9, 0xda, 0x19, 0xc2, 0xd7, 0x22, 0x75, 0x2f, 0x9a, 0x12, 0x73, 0x35, + 0xda, 0x19, 0xd2, 0xd7, 0x22, 0x7e, 0x04, 0x24, 0x2d, 0x80, 0xd7, 0x48, 0xf1, 0x46, 0x65, 0x47, + 0x5f, 0x49, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x48, 0x56, 0x45, 0x2a, 0x49, 0x6e, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x49, 0x75, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x4c, 0x1e, 0x49, 0x92, 0x4a, + 0x8c, 0x4c, 0x57, 0x45, 0x2a, 0x45, 0x2a, 0x4b, 0x83, 0x45, 0x2a, 0x4c, 0x9b, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x4c, 0xa2, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x4f, 0x4b, 0x4c, 0xbf, 0x4d, + 0xb9, 0x4f, 0x84, 0x45, 0x2a, 0x45, 0x2a, 0x4e, 0xb0, 0x45, 0x2a, 0x4f, 0xc8, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x4f, 0xcf, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x52, 0x78, 0x4f, 0xec, 0x50, + 0xe6, 0x52, 0xb1, 0x45, 0x2a, 0x45, 0x2a, 0x51, 0xdd, 0x45, 0x2a, 0x52, 0xf5, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x52, 0xfc, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x55, 0xa5, 0x53, 0x19, 0x54, + 0x13, 0x55, 0xde, 0x45, 0x2a, 0x45, 0x2a, 0x55, 0x0a, 0x45, 0x2a, 0x56, 0x22, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x56, 0x29, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x58, 0xd2, 0x56, 0x46, 0x57, + 0x40, 0x59, 0x0b, 0x45, 0x2a, 0x45, 0x2a, 0x58, 0x37, 0x45, 0x2a, 0x59, 0x4f, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x59, 0x56, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x5b, 0xff, 0x59, 0x73, 0x5a, + 0x6d, 0x5c, 0x38, 0x45, 0x2a, 0x45, 0x2a, 0x5b, 0x64, 0x45, 0x2a, 0x5c, 0x7c, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x5c, 0x83, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x5f, 0x2c, 0x5c, 0xa0, 0x5d, + 0x9a, 0x5f, 0x65, 0x45, 0x2a, 0x45, 0x2a, 0x5e, 0x91, 0x45, 0x2a, 0x5f, 0xa9, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x5f, 0xb0, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, + 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0x45, 0x2a, 0xca, 0xb8, 0x75, 0x2f, 0x02, + 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x91, 0x03, 0x20, 0xe5, 0x20, 0x30, 0xe0, 0x05, 0x12, 0x6b, 0x05, + 0x80, 0x30, 0x30, 0xe1, 0x05, 0x12, 0x64, 0x86, 0x80, 0x28, 0x30, 0xe2, 0x05, 0x12, 0x63, 0xf5, + 0x80, 0x20, 0x30, 0xe3, 0x1d, 0x12, 0x65, 0x61, 0x80, 0x18, 0x7e, 0xb3, 0x91, 0x04, 0x30, 0xe1, + 0x03, 0x02, 0x67, 0x5f, 0x30, 0xe6, 0x05, 0x12, 0x6c, 0x6a, 0x80, 0x06, 0x20, 0xe2, 0x03, 0x02, + 0x00, 0x80, 0xda, 0xb8, 0x32, 0x75, 0x2f, 0x10, 0x12, 0x73, 0x35, 0xca, 0x0b, 0xca, 0x39, 0xca, + 0x59, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, 0x1a, 0x6c, 0xaa, 0xbe, 0xb0, 0x40, + 0x28, 0x0a, 0x12, 0x64, 0x24, 0xda, 0x59, 0xda, 0x39, 0xda, 0x0b, 0x22, 0x74, 0x20, 0x7a, 0xb3, + 0x91, 0x14, 0x80, 0xf1, 0x7e, 0x37, 0x01, 0xc5, 0x2d, 0x35, 0xbe, 0x34, 0x04, 0x00, 0x38, 0x2f, + 0x7a, 0x37, 0x01, 0xc5, 0x7e, 0x37, 0x01, 0xc3, 0x7d, 0x43, 0x2d, 0x45, 0xbe, 0x44, 0x2c, 0x2c, + 0x38, 0x25, 0x7a, 0x47, 0x01, 0xc3, 0x75, 0x2f, 0x11, 0x12, 0x73, 0x35, 0x7a, 0xb1, 0x2f, 0x12, + 0x73, 0x35, 0x12, 0x67, 0x9f, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x14, 0x12, 0x66, 0x30, 0x22, 0x75, + 0x2f, 0x16, 0x12, 0x73, 0x35, 0x80, 0xf4, 0x75, 0x2f, 0x12, 0x12, 0x73, 0x35, 0x7a, 0xb1, 0x2f, + 0x12, 0x73, 0x35, 0x9e, 0x44, 0x2c, 0x2d, 0x9d, 0x54, 0x12, 0x67, 0x9f, 0x7e, 0x34, 0x28, 0x2d, + 0x7d, 0x54, 0x2d, 0x43, 0x80, 0xbc, 0x75, 0x2f, 0x18, 0x12, 0x73, 0x35, 0xca, 0x09, 0xca, 0x39, + 0xca, 0x2b, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0x63, 0x91, 0x1a, 0x74, 0x10, 0x7a, 0xb3, + 0x91, 0x14, 0x7e, 0xb0, 0x80, 0x9c, 0xb6, 0x60, 0x38, 0x6c, 0xaa, 0x7e, 0x37, 0x01, 0xcb, 0x9d, + 0x35, 0x40, 0x37, 0x7a, 0x37, 0x01, 0xcb, 0x7e, 0x37, 0x01, 0xc7, 0x7d, 0x43, 0x2d, 0x45, 0xbe, + 0x44, 0x28, 0x2c, 0x38, 0x3b, 0x7a, 0x47, 0x01, 0xc7, 0x7d, 0x45, 0x12, 0x68, 0xd4, 0x7e, 0xb3, + 0x91, 0x1e, 0x20, 0xe5, 0x13, 0x75, 0x2f, 0x19, 0x12, 0x73, 0x35, 0x7a, 0x91, 0x2f, 0x12, 0x73, + 0x35, 0xda, 0x2b, 0xda, 0x39, 0xda, 0x09, 0x22, 0x80, 0x34, 0x2d, 0x53, 0x6d, 0x33, 0x60, 0x02, + 0x80, 0xc1, 0x7e, 0x04, 0x24, 0x2d, 0x7a, 0x07, 0x01, 0xc9, 0x7a, 0x07, 0x01, 0xc7, 0x80, 0xe1, + 0xca, 0x59, 0x9e, 0x44, 0x28, 0x2d, 0x9d, 0x54, 0x12, 0x68, 0xd4, 0x7e, 0x34, 0x24, 0x2d, 0x7d, + 0x54, 0x2d, 0x43, 0x7a, 0x47, 0x01, 0xc7, 0x12, 0x68, 0xd4, 0xda, 0x49, 0x80, 0xb0, 0x7e, 0x0f, + 0x2c, 0x3e, 0x0b, 0x0c, 0x7a, 0x0f, 0x2c, 0x3e, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x1e, 0x74, 0x60, + 0x7a, 0xb3, 0x91, 0x1c, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x12, 0x80, 0xa5, 0x7e, 0x2f, 0x2c, 0x5e, + 0x0b, 0x2c, 0x7a, 0x2f, 0x2c, 0x5e, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x1e, 0x74, 0x60, 0x7a, 0xb3, + 0x91, 0x1c, 0x74, 0x02, 0x7a, 0xb3, 0x91, 0x12, 0x80, 0x1f, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, + 0x22, 0x75, 0x2f, 0x28, 0x12, 0x73, 0x35, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0x74, 0x60, 0x7a, + 0xb3, 0x91, 0x00, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x14, 0x7e, 0xb3, 0x91, 0x1a, 0x70, 0xdb, 0x7e, + 0x0d, 0x30, 0x7e, 0x1d, 0x34, 0x7e, 0x2d, 0x38, 0x7e, 0x3d, 0x3c, 0x7e, 0x85, 0x40, 0x7d, 0x90, + 0x4d, 0x91, 0x4d, 0x92, 0x4d, 0x93, 0x4d, 0x94, 0x4d, 0x95, 0x4d, 0x96, 0x4d, 0x97, 0x4d, 0x98, + 0x68, 0xb8, 0x7a, 0x13, 0x91, 0x17, 0x7a, 0x03, 0x91, 0x17, 0x7a, 0x33, 0x91, 0x17, 0x7a, 0x23, + 0x91, 0x17, 0x7a, 0x53, 0x91, 0x17, 0x7a, 0x43, 0x91, 0x17, 0x7a, 0x73, 0x91, 0x17, 0x7a, 0x63, + 0x91, 0x17, 0x7a, 0x93, 0x91, 0x17, 0x7a, 0x83, 0x91, 0x17, 0x30, 0x73, 0x22, 0x7a, 0xb3, 0x91, + 0x17, 0x7a, 0xa3, 0x91, 0x17, 0x7a, 0xd3, 0x91, 0x17, 0x7a, 0xc3, 0x91, 0x17, 0x7a, 0xf3, 0x91, + 0x17, 0x7a, 0xe3, 0x91, 0x17, 0x7d, 0x78, 0x7a, 0xf3, 0x91, 0x17, 0x7a, 0xe3, 0x91, 0x17, 0x7e, + 0xb3, 0x91, 0x1e, 0x30, 0xe5, 0x03, 0x02, 0x65, 0x3c, 0x75, 0x2f, 0x29, 0x12, 0x73, 0x35, 0x20, + 0x73, 0x08, 0x75, 0x2f, 0x0a, 0x12, 0x73, 0x35, 0x80, 0x06, 0x75, 0x2f, 0x12, 0x12, 0x73, 0x35, + 0x74, 0x80, 0x7a, 0xb3, 0x91, 0x1e, 0x6d, 0x00, 0x7d, 0x10, 0x7a, 0x0d, 0x30, 0x7a, 0x0d, 0x34, + 0x7a, 0x0d, 0x38, 0x7a, 0x0d, 0x3c, 0x7a, 0x05, 0x40, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, + 0x7e, 0x37, 0x01, 0xc5, 0x4d, 0x33, 0x68, 0x3b, 0x7e, 0x07, 0x01, 0xc1, 0x7e, 0x54, 0x2c, 0x2d, + 0x9d, 0x50, 0xbd, 0x35, 0x40, 0x02, 0x7d, 0x35, 0xca, 0x39, 0x7e, 0x65, 0x4b, 0x99, 0x64, 0xda, + 0x39, 0x7e, 0x07, 0x01, 0xc5, 0x9d, 0x03, 0x7a, 0x07, 0x01, 0xc5, 0x2e, 0x37, 0x01, 0xc1, 0x7a, + 0x37, 0x01, 0xc1, 0xbe, 0x34, 0x2c, 0x2c, 0x28, 0xc7, 0x7e, 0x34, 0x28, 0x2d, 0x7a, 0x37, 0x01, + 0xc1, 0x80, 0xbd, 0x22, 0x75, 0x2f, 0x53, 0x12, 0x73, 0x35, 0x7e, 0x15, 0x4d, 0x80, 0x11, 0x75, + 0x2f, 0x51, 0x12, 0x73, 0x35, 0x0b, 0x08, 0x10, 0x0b, 0x05, 0x9e, 0x34, 0x00, 0x02, 0x28, 0x4d, + 0x7c, 0xb2, 0x20, 0xe7, 0x27, 0x54, 0x07, 0x23, 0x0a, 0x2b, 0x49, 0x22, 0x39, 0x1e, 0x7c, 0xb2, + 0x54, 0x78, 0x03, 0x03, 0x03, 0x7c, 0x2b, 0x9d, 0x13, 0x40, 0x1a, 0x68, 0x12, 0x7a, 0x15, 0x4d, + 0x7a, 0x25, 0x4f, 0x7e, 0x64, 0x67, 0x09, 0x7a, 0x65, 0x4b, 0x89, 0x24, 0x02, 0x67, 0x17, 0x7e, + 0x64, 0x66, 0x7f, 0x80, 0xf2, 0x2d, 0x13, 0x9d, 0x31, 0xca, 0x39, 0x7d, 0x31, 0x2d, 0x10, 0xca, + 0x19, 0xca, 0x29, 0x99, 0x24, 0xda, 0x29, 0xda, 0x09, 0xda, 0x39, 0x80, 0xa2, 0x7a, 0x15, 0x4d, + 0x7e, 0x64, 0x66, 0xf5, 0x4d, 0x33, 0x78, 0x09, 0x7c, 0xb2, 0x20, 0xe7, 0x2a, 0x7e, 0x64, 0x66, + 0x74, 0x7a, 0x65, 0x4b, 0x22, 0x75, 0x2f, 0x52, 0x12, 0x73, 0x35, 0x7e, 0x21, 0x4d, 0x7e, 0x09, + 0x30, 0x0b, 0x04, 0x1b, 0x34, 0x78, 0x89, 0x80, 0xd4, 0x75, 0x2f, 0x54, 0x12, 0x73, 0x35, 0x7e, + 0x15, 0x4d, 0x7e, 0x25, 0x4f, 0x80, 0x90, 0x5e, 0x20, 0x07, 0x54, 0x78, 0x7e, 0x44, 0x67, 0x7d, + 0x30, 0xe6, 0x16, 0x4d, 0x33, 0x68, 0x26, 0x1b, 0x34, 0x7e, 0x09, 0x40, 0x0b, 0x04, 0x7e, 0x44, + 0x34, 0xfa, 0x20, 0xe3, 0x04, 0x7e, 0x44, 0x67, 0x85, 0xca, 0x09, 0xca, 0x39, 0x99, 0x44, 0xda, + 0x39, 0xda, 0x09, 0x7e, 0x64, 0x66, 0x7f, 0x4d, 0x33, 0x68, 0xa6, 0x89, 0x64, 0x7a, 0x15, 0x4d, + 0xf5, 0x4f, 0x7e, 0x64, 0x67, 0x58, 0x80, 0x99, 0x7e, 0x15, 0x4d, 0xe5, 0x4f, 0x80, 0xc4, 0xc0, + 0xd0, 0xc0, 0xd1, 0xc0, 0xe0, 0xca, 0x19, 0x75, 0x2f, 0xfe, 0x12, 0x73, 0x35, 0x7e, 0x14, 0x00, + 0x53, 0x02, 0x40, 0x52, 0xda, 0x19, 0xd0, 0xe0, 0xd0, 0xd1, 0xd0, 0xd0, 0x32, 0x03, 0xa5, 0xcb, + 0x19, 0xb1, 0x80, 0x00, 0x22, 0x22, 0x7e, 0x24, 0x00, 0x00, 0x7f, 0xe1, 0x7e, 0xa0, 0x02, 0xa4, + 0x7e, 0x04, 0x68, 0xb1, 0x9d, 0x05, 0x7e, 0xb0, 0x28, 0x7a, 0xb3, 0x95, 0x00, 0x89, 0x04, 0xca, + 0x29, 0xb4, 0x80, 0xe2, 0x7e, 0x24, 0x00, 0x00, 0x7f, 0xe1, 0x7e, 0x00, 0x28, 0x7a, 0x03, 0x95, + 0x00, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x95, 0x00, 0xda, 0x29, 0x22, 0x7e, 0x24, 0x00, 0x00, 0x7f, + 0xe1, 0x7e, 0xa0, 0x02, 0xa4, 0x7e, 0x04, 0x69, 0xe6, 0x9d, 0x05, 0x7e, 0xb0, 0x38, 0x7a, 0xb3, + 0x95, 0x00, 0x89, 0x04, 0xca, 0x29, 0xb4, 0x80, 0xe2, 0x7e, 0x24, 0x00, 0x00, 0x7f, 0xe1, 0x7e, + 0x00, 0x38, 0x7a, 0x03, 0x95, 0x00, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x95, 0x00, 0xda, 0x29, 0x22, + 0xca, 0x29, 0xca, 0x19, 0xca, 0x58, 0x7e, 0x24, 0x00, 0x00, 0x7f, 0xe1, 0xda, 0x58, 0x7e, 0x54, + 0x02, 0x20, 0x9c, 0xb5, 0xa4, 0x7e, 0x50, 0x30, 0x5e, 0x20, 0x07, 0x2c, 0x52, 0x7a, 0x53, 0x95, + 0x00, 0x2e, 0x54, 0x6a, 0x17, 0x89, 0x54, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, + 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x95, 0x00, 0xda, 0x19, + 0xda, 0x29, 0x22, 0xca, 0x19, 0xca, 0x58, 0x7e, 0x24, 0x00, 0x00, 0x7f, 0xe1, 0xda, 0x58, 0x7e, + 0x54, 0x02, 0x38, 0x9c, 0xb5, 0xa4, 0x7e, 0x50, 0x20, 0x5e, 0x20, 0x07, 0x2c, 0x52, 0x7a, 0x53, + 0x95, 0x00, 0x2e, 0x54, 0x6a, 0x88, 0x89, 0x54, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, + 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0xe0, 0xa3, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x95, 0x00, 0xda, + 0x19, 0x22, 0x02, 0x6b, 0xa8, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, 0xca, 0x3b, 0xca, 0x4b, 0xca, + 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x2c, + 0x7f, 0xb4, 0x00, 0x02, 0x80, 0x1c, 0xb4, 0x01, 0x19, 0x7e, 0xb3, 0x91, 0x14, 0x54, 0x14, 0x68, + 0x05, 0x12, 0x6b, 0x6c, 0x80, 0x23, 0x7e, 0xb3, 0x91, 0x14, 0x30, 0xe5, 0x1c, 0x12, 0x6c, 0xaa, + 0x80, 0x17, 0x7e, 0xb3, 0x91, 0x14, 0x30, 0xe5, 0x05, 0x12, 0x6c, 0xaa, 0x80, 0x0b, 0x7e, 0xb3, + 0x91, 0x14, 0x54, 0x14, 0x68, 0x03, 0x12, 0x6b, 0x6c, 0xda, 0xeb, 0xda, 0x7b, 0xda, 0x6b, 0xda, + 0x5b, 0xda, 0x4b, 0xda, 0x3b, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x20, 0xe4, 0x19, 0x75, + 0x2f, 0x0a, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, 0x7e, 0x70, 0x0a, 0x7e, 0xb3, 0x2c, 0x7f, 0xb4, + 0x01, 0x1f, 0x02, 0x6c, 0x04, 0x02, 0x71, 0xf2, 0x75, 0x2f, 0x0b, 0x12, 0x73, 0x35, 0x74, 0x14, + 0x7a, 0xb3, 0x91, 0x14, 0x7e, 0xb3, 0x2c, 0x7f, 0xb4, 0x02, 0x0c, 0x12, 0x6b, 0xb4, 0x02, 0x6b, + 0xa8, 0x74, 0x04, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0x7e, 0x00, 0x00, 0x7a, 0x03, 0x2c, 0x7f, 0x7a, + 0x03, 0x2c, 0x80, 0x22, 0x7e, 0xb3, 0x2c, 0x76, 0x54, 0x60, 0x60, 0x05, 0xb4, 0x40, 0x1e, 0x80, + 0x1c, 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x05, 0x15, 0x75, 0x2f, 0x71, 0x12, 0x73, 0x35, 0x7e, 0xb3, + 0x2c, 0x79, 0x7e, 0xa0, 0x01, 0x7a, 0xa3, 0x91, 0x06, 0x7a, 0xb3, 0x91, 0x07, 0x22, 0x74, 0x00, + 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x10, 0x7a, 0xb3, 0x91, 0x12, 0x22, 0xbe, 0x57, 0x2c, 0x7c, 0x28, + 0x04, 0x7e, 0x57, 0x2c, 0x7c, 0x7a, 0x0f, 0x2c, 0x82, 0x7a, 0x57, 0x2c, 0x86, 0x74, 0x10, 0x7a, + 0xb3, 0x91, 0x12, 0x22, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, 0x1a, 0x70, 0x53, + 0x7e, 0xb3, 0x91, 0x14, 0x20, 0xe4, 0x4c, 0x7e, 0xef, 0x2c, 0x82, 0x7e, 0xf7, 0x2c, 0x86, 0x7e, + 0x07, 0x2c, 0x86, 0x4d, 0x00, 0x68, 0x21, 0x7e, 0x00, 0x00, 0xe0, 0x7a, 0xb3, 0x91, 0x17, 0xa3, + 0xa5, 0x08, 0x1b, 0xf4, 0x68, 0x06, 0xa5, 0xb8, 0x10, 0xf0, 0x80, 0x19, 0x7e, 0xb0, 0x00, 0x7a, + 0xb3, 0x2c, 0x7f, 0xbe, 0x00, 0x10, 0x68, 0x0d, 0x7e, 0xb0, 0x00, 0x7a, 0xb3, 0x2c, 0x7f, 0x74, + 0x80, 0x7a, 0xb3, 0x91, 0x1e, 0x7a, 0xef, 0x2c, 0x82, 0x7a, 0xf7, 0x2c, 0x86, 0x75, 0x2f, 0x06, + 0x12, 0x73, 0x35, 0x74, 0x04, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0xca, 0x0b, 0xca, 0x1b, 0xca, 0x2b, + 0xca, 0x3b, 0xca, 0x4b, 0xca, 0x5b, 0xca, 0x6b, 0xca, 0x7b, 0xca, 0xeb, 0x75, 0x2f, 0x03, 0x12, + 0x73, 0x35, 0x74, 0x00, 0x7a, 0xb3, 0x2c, 0x7e, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x01, + 0x7a, 0xb3, 0x91, 0x12, 0x12, 0x6d, 0x19, 0xda, 0xeb, 0xda, 0x7b, 0xda, 0x6b, 0xda, 0x5b, 0xda, + 0x4b, 0xda, 0x3b, 0xda, 0x2b, 0xda, 0x1b, 0xda, 0x0b, 0x22, 0x75, 0x2f, 0x03, 0x12, 0x73, 0x35, + 0x7e, 0xb3, 0x2c, 0x80, 0xb4, 0x02, 0x11, 0x74, 0x00, 0x7a, 0xb3, 0x2c, 0x80, 0x7a, 0xb3, 0x2c, + 0x7f, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x14, 0x22, 0xb4, 0x01, 0x46, 0x7e, 0xb3, 0x91, 0x04, 0x20, + 0xe6, 0x42, 0x7e, 0x23, 0x91, 0x1a, 0x7c, 0x32, 0x7e, 0x13, 0x2c, 0x81, 0x2c, 0x21, 0x7a, 0x23, + 0x2c, 0x81, 0x7e, 0x00, 0x00, 0x2e, 0x04, 0x2c, 0x88, 0x7e, 0xb3, 0x91, 0x16, 0x7a, 0x09, 0xb0, + 0x0b, 0x04, 0xa5, 0xdb, 0xf4, 0x74, 0x20, 0x7a, 0xb3, 0x91, 0x14, 0x75, 0x2f, 0x70, 0x12, 0x73, + 0x35, 0x7e, 0xb3, 0x2c, 0x81, 0x7e, 0xa3, 0x2c, 0x7d, 0xbc, 0xab, 0x78, 0x03, 0x12, 0x6d, 0xb9, + 0x22, 0x02, 0x71, 0xf2, 0xda, 0x59, 0x02, 0x6c, 0x7c, 0x74, 0xe0, 0x7a, 0xb3, 0x91, 0x00, 0x7e, + 0x03, 0x91, 0x10, 0x7e, 0x13, 0x91, 0x11, 0x7e, 0x33, 0x91, 0x12, 0x7e, 0x23, 0x91, 0x13, 0x7e, + 0x53, 0x91, 0x14, 0x7e, 0x43, 0x91, 0x15, 0x7e, 0x73, 0x91, 0x16, 0x7e, 0x63, 0x91, 0x17, 0x7a, + 0x0f, 0x2c, 0x76, 0x7a, 0x1f, 0x2c, 0x7a, 0x75, 0x2f, 0x04, 0x12, 0x73, 0x35, 0x7a, 0x01, 0x2f, + 0x12, 0x73, 0x35, 0x7a, 0x11, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x21, 0x2f, 0x12, 0x73, 0x35, 0x7a, + 0x31, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x41, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x51, 0x2f, 0x12, 0x73, + 0x35, 0x7a, 0x61, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x71, 0x2f, 0x12, 0x73, 0x35, 0x74, 0x00, 0x7a, + 0xb3, 0x91, 0x00, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x04, 0x12, 0x6d, 0x8d, 0x22, 0x6d, 0x00, 0x7e, + 0x14, 0x01, 0x02, 0x7a, 0x07, 0x2c, 0x86, 0x7a, 0x03, 0x2c, 0x81, 0x7e, 0xb3, 0x2c, 0x76, 0x20, + 0xe7, 0x0f, 0x7a, 0x23, 0x2c, 0x80, 0x7a, 0x33, 0x2c, 0x7f, 0xbe, 0x07, 0x2c, 0x7c, 0x68, 0x09, + 0x22, 0x7a, 0x33, 0x2c, 0x80, 0x7a, 0x23, 0x2c, 0x7f, 0x7e, 0xb3, 0x2c, 0x76, 0x54, 0xe3, 0x23, + 0x23, 0x30, 0xe0, 0x02, 0xd2, 0xe5, 0x30, 0xe7, 0x02, 0xd2, 0xe4, 0x30, 0xe5, 0x06, 0x30, 0xe4, + 0x03, 0x02, 0x71, 0xf2, 0x54, 0x3e, 0xf5, 0xf0, 0x03, 0x54, 0x1f, 0xc3, 0x25, 0xf0, 0x90, 0x6d, + 0xe5, 0x75, 0x84, 0xff, 0x73, 0x02, 0x6f, 0xa0, 0x02, 0x6e, 0x2d, 0x02, 0x70, 0x39, 0x02, 0x70, + 0x54, 0x02, 0x6f, 0x37, 0x02, 0x6e, 0xc2, 0x02, 0x70, 0x85, 0x02, 0x70, 0x85, 0x02, 0x70, 0x88, + 0x02, 0x70, 0x88, 0x02, 0x70, 0x88, 0x02, 0x70, 0x88, 0x02, 0x70, 0x88, 0x02, 0x70, 0x88, 0x02, + 0x70, 0x88, 0x02, 0x70, 0x88, 0x02, 0x70, 0x8e, 0x02, 0x71, 0x60, 0x02, 0x70, 0x8b, 0x02, 0x70, + 0x8b, 0x02, 0x70, 0x8b, 0x02, 0x70, 0x8b, 0x02, 0x70, 0x8b, 0x02, 0x70, 0x8b, 0x74, 0x00, 0x7a, + 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x06, 0x2a, + 0x7e, 0xb3, 0x2c, 0x78, 0x60, 0x79, 0x7c, 0x0b, 0x7e, 0x13, 0x2c, 0x79, 0x7e, 0x17, 0x2c, 0x7a, + 0x75, 0x2f, 0x72, 0x12, 0x73, 0x35, 0x7a, 0x01, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x11, 0x2f, 0x12, + 0x73, 0x35, 0x12, 0x72, 0x37, 0x40, 0x58, 0x02, 0x6b, 0xeb, 0xb4, 0x08, 0x1c, 0x75, 0x2f, 0x74, + 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x3f, 0xf1, 0x7e, 0x08, 0x2c, 0x88, 0x7a, 0x0c, 0x00, 0x00, 0x7a, + 0x0b, 0xb0, 0x7e, 0x54, 0x00, 0x01, 0x02, 0x6b, 0xeb, 0xb4, 0x00, 0x33, 0x75, 0x2f, 0x75, 0x12, + 0x73, 0x35, 0x7e, 0x08, 0x2c, 0x88, 0x7a, 0x0c, 0x00, 0x00, 0xca, 0x0b, 0x7e, 0xb3, 0x3f, 0xf2, + 0x30, 0xe0, 0x07, 0x74, 0x02, 0x7a, 0x0b, 0xb0, 0x80, 0x05, 0x74, 0x00, 0x7a, 0x0b, 0xb0, 0x0b, + 0x14, 0x74, 0x00, 0x7a, 0x0b, 0xb0, 0x7e, 0x54, 0x00, 0x02, 0xda, 0x0b, 0x02, 0x6b, 0xeb, 0x02, + 0x71, 0xf2, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x7e, 0xb3, + 0x2c, 0x77, 0xb4, 0x00, 0x5f, 0x75, 0x2f, 0x76, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, 0x7b, 0x54, + 0x0f, 0xb4, 0x02, 0x05, 0x7e, 0xb0, 0x60, 0x80, 0x17, 0xb4, 0x00, 0x05, 0x7e, 0xb0, 0x00, 0x80, + 0x0f, 0x7e, 0xb3, 0x2c, 0x7b, 0x20, 0xe7, 0x05, 0x7e, 0xb0, 0x40, 0x80, 0x03, 0x7e, 0xb0, 0x20, + 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0xb3, 0x91, 0x11, 0x30, 0xe0, 0x04, 0x74, 0x01, 0x80, 0x02, 0x74, + 0x00, 0x7e, 0x08, 0x2c, 0x88, 0x7a, 0x0c, 0x00, 0x00, 0xca, 0x0b, 0x7a, 0x0b, 0xb0, 0x0b, 0x14, + 0x74, 0x00, 0x7a, 0x0b, 0xb0, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x7e, 0x54, 0x00, 0x02, 0xda, + 0x0b, 0x02, 0x6b, 0xeb, 0x02, 0x71, 0xf2, 0x7e, 0xb3, 0x2c, 0x7b, 0x54, 0x0f, 0xb4, 0x02, 0x05, + 0x7e, 0xb0, 0x60, 0x80, 0x17, 0xb4, 0x00, 0x05, 0x7e, 0xb0, 0x00, 0x80, 0x0f, 0x7e, 0xb3, 0x2c, + 0x7b, 0x20, 0xe7, 0x05, 0x7e, 0xb0, 0x40, 0x80, 0x03, 0x7e, 0xb0, 0x20, 0x7a, 0xb3, 0x91, 0x00, + 0x7e, 0xb3, 0x2c, 0x79, 0xb4, 0x00, 0x26, 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x01, 0x0e, 0x75, 0x2f, + 0x77, 0x12, 0x73, 0x35, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x80, 0x1b, 0xb4, 0x03, 0x0e, 0x75, + 0x2f, 0x78, 0x12, 0x73, 0x35, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x11, 0x80, 0x0a, 0x74, 0x00, 0x7a, + 0xb3, 0x91, 0x00, 0x12, 0x71, 0xf2, 0x22, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x02, 0x6b, 0xde, + 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x09, 0x1f, 0x75, 0x2f, 0x79, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, + 0x79, 0xbe, 0xb3, 0x3f, 0xf1, 0x68, 0x0d, 0xca, 0xb8, 0x12, 0x43, 0x79, 0xda, 0xb8, 0x50, 0x76, + 0x7a, 0xb3, 0x3f, 0xf1, 0x80, 0x6d, 0xb4, 0x05, 0x08, 0x75, 0x2f, 0x7a, 0x12, 0x73, 0x35, 0x80, + 0x62, 0xb4, 0x03, 0x19, 0x75, 0x2f, 0x7b, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, 0x79, 0xb4, 0x01, + 0x55, 0x7e, 0xb3, 0x3f, 0xf2, 0x44, 0x01, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x46, 0xb4, 0x01, 0x19, + 0x75, 0x2f, 0x7c, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, 0x79, 0xb4, 0x01, 0x39, 0x7e, 0xb3, 0x3f, + 0xf2, 0x54, 0xfe, 0x7a, 0xb3, 0x3f, 0xf2, 0x80, 0x2a, 0xb4, 0x07, 0x2a, 0x7e, 0xb3, 0x2c, 0x78, + 0x60, 0x24, 0x7c, 0x0b, 0x7e, 0x13, 0x2c, 0x79, 0x7e, 0x17, 0x2c, 0x7a, 0x75, 0x2f, 0x73, 0x12, + 0x73, 0x35, 0x7a, 0x01, 0x2f, 0x12, 0x73, 0x35, 0x7a, 0x11, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x72, + 0x71, 0x40, 0x03, 0x02, 0x6b, 0xde, 0x02, 0x71, 0xf2, 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x0b, 0xf6, + 0x75, 0x2f, 0x7d, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, 0x79, 0x7e, 0xa3, 0x2c, 0x7b, 0x4c, 0xab, + 0x78, 0xe4, 0x80, 0xdf, 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, + 0x7e, 0xb3, 0x2c, 0x77, 0xb4, 0x0a, 0xcf, 0x75, 0x2f, 0x7e, 0x12, 0x73, 0x35, 0x7e, 0xb3, 0x2c, + 0x79, 0x70, 0xc3, 0x7e, 0x08, 0x2c, 0x88, 0x7a, 0x0c, 0x00, 0x00, 0x7a, 0x0b, 0xb0, 0x7e, 0x54, + 0x00, 0x01, 0x02, 0x6b, 0xeb, 0x02, 0x71, 0xf2, 0x02, 0x71, 0xf2, 0x02, 0x71, 0xf2, 0x7e, 0xb3, + 0x2c, 0x77, 0xb4, 0x04, 0x20, 0x75, 0x2f, 0xc3, 0x12, 0x73, 0x35, 0x7e, 0x04, 0x00, 0x01, 0x7e, + 0x17, 0x2c, 0x78, 0x7e, 0x18, 0x2c, 0x88, 0x7a, 0x1c, 0x00, 0x00, 0x7e, 0x47, 0x2c, 0x7c, 0x12, + 0x73, 0x41, 0x02, 0x71, 0x5a, 0xb4, 0x06, 0x42, 0x75, 0x2f, 0xc1, 0x12, 0x73, 0x35, 0x7e, 0x58, + 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7d, 0xca, 0x7e, 0xd7, 0x2c, 0x78, 0x7e, 0x78, 0x2c, 0x88, + 0x7a, 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x2c, 0x7c, 0x75, 0x2f, 0xc1, 0x12, 0x73, 0x35, 0xc0, 0xa8, + 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x12, 0x73, 0x7a, 0x7e, 0x43, 0x2c, 0x35, + 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0x40, 0x65, 0x80, 0x60, 0xb4, 0x00, 0x24, 0xc2, 0xaf, 0x7e, + 0xb0, 0x01, 0x7a, 0xb3, 0x94, 0x00, 0x7a, 0xb3, 0x2c, 0x35, 0x12, 0x6b, 0xde, 0xe4, 0x8d, 0xef, + 0x8d, 0xef, 0x8d, 0xef, 0xd5, 0xe0, 0xf7, 0xc0, 0xd1, 0xca, 0x02, 0xff, 0xca, 0x06, 0x00, 0x00, + 0x32, 0xb4, 0x09, 0x20, 0x74, 0x03, 0x7a, 0xb3, 0x91, 0x06, 0x7e, 0x23, 0x91, 0x07, 0x7e, 0x57, + 0x2c, 0x78, 0x4d, 0x55, 0x68, 0x05, 0x4e, 0x20, 0x02, 0x80, 0x03, 0x5e, 0x20, 0xfd, 0x7a, 0x23, + 0x91, 0x07, 0x80, 0x16, 0xb4, 0x07, 0x16, 0xc2, 0xaf, 0x7e, 0x07, 0x2c, 0x7a, 0x7e, 0x17, 0x2c, + 0x78, 0xc0, 0xd1, 0xca, 0x18, 0xca, 0x38, 0xca, 0x28, 0x32, 0x02, 0x6b, 0xde, 0x02, 0x71, 0xf2, + 0x74, 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x60, 0x7a, 0xb3, 0x91, 0x1c, 0x7e, 0xb3, 0x2c, 0x77, + 0xb4, 0x03, 0x15, 0x75, 0x2f, 0xc2, 0x12, 0x73, 0x35, 0x7e, 0x04, 0x00, 0x01, 0x7e, 0x17, 0x2c, + 0x78, 0x7e, 0x57, 0x2c, 0x7c, 0x02, 0x6b, 0xeb, 0xb4, 0x05, 0x41, 0x75, 0x2f, 0xc0, 0x12, 0x73, + 0x35, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x7e, 0x08, 0x2c, 0x88, + 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x24, 0x00, 0xfe, 0x7e, 0x37, 0x2c, 0x78, 0x7e, 0x47, 0x2c, 0x7c, + 0x12, 0x73, 0x41, 0x7e, 0x43, 0x2c, 0x35, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0x7e, 0x08, 0x2c, + 0x88, 0x7a, 0x0c, 0x00, 0x00, 0x7e, 0x57, 0x2c, 0x7c, 0x02, 0x6b, 0xeb, 0xb4, 0x01, 0x20, 0x7e, + 0x00, 0x00, 0x7e, 0x10, 0x01, 0x75, 0x2f, 0x72, 0x12, 0x73, 0x35, 0x7a, 0x01, 0x2f, 0x12, 0x73, + 0x35, 0x7a, 0x11, 0x2f, 0x12, 0x73, 0x35, 0x12, 0x72, 0x37, 0x40, 0x03, 0x02, 0x6b, 0xeb, 0x02, + 0x71, 0xf2, 0x75, 0x2f, 0x07, 0x12, 0x73, 0x35, 0x7e, 0xb0, 0x02, 0x7a, 0xb3, 0x90, 0x00, 0x74, + 0x00, 0x7a, 0xb3, 0x91, 0x00, 0x74, 0x40, 0x7a, 0xb3, 0x91, 0x15, 0x74, 0x01, 0x7a, 0xb3, 0x91, + 0x11, 0x7e, 0xb3, 0x91, 0x15, 0x54, 0x60, 0xbe, 0xb0, 0x40, 0x68, 0x08, 0x74, 0x20, 0x7a, 0xb3, + 0x91, 0x15, 0x80, 0xed, 0x74, 0x01, 0x7a, 0xb3, 0x91, 0x12, 0x74, 0x04, 0x7a, 0xb3, 0x91, 0x14, + 0x74, 0xff, 0x7a, 0xb3, 0x2c, 0x7e, 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, + 0x94, 0x00, 0x12, 0x72, 0xbe, 0x40, 0x1f, 0x7e, 0x08, 0x2c, 0x88, 0x7a, 0x0c, 0x00, 0x00, 0xca, + 0x0b, 0xca, 0x49, 0x12, 0x73, 0x41, 0xda, 0x59, 0xda, 0x0b, 0x7e, 0x43, 0x2c, 0x35, 0x7a, 0x43, + 0x94, 0x00, 0xd0, 0xa8, 0xc3, 0x22, 0x7e, 0x43, 0x2c, 0x35, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, + 0x22, 0xc0, 0xa8, 0xc2, 0xaf, 0x7e, 0x40, 0x01, 0x7a, 0x43, 0x94, 0x00, 0x12, 0x72, 0xbe, 0x40, + 0x31, 0x7e, 0x58, 0x00, 0x00, 0x7a, 0x5c, 0x00, 0xfe, 0x7f, 0x61, 0x7e, 0x78, 0x2c, 0x88, 0x7a, + 0x7c, 0x00, 0x00, 0x7e, 0x77, 0x2c, 0x7c, 0xbd, 0x74, 0x78, 0x17, 0x75, 0x2f, 0xc1, 0x12, 0x73, + 0x35, 0x12, 0x73, 0x7a, 0x40, 0x0c, 0x7e, 0x43, 0x2c, 0x35, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, + 0xc3, 0x22, 0x7e, 0x43, 0x2c, 0x35, 0x7a, 0x43, 0x94, 0x00, 0xd0, 0xa8, 0xd3, 0x22, 0x7e, 0x24, + 0x00, 0xfe, 0x7e, 0x34, 0x7f, 0xca, 0x0b, 0x1a, 0x50, 0xc5, 0xf0, 0x7d, 0x62, 0x7d, 0x75, 0x7d, + 0x87, 0x7e, 0x34, 0x7f, 0xc2, 0x7e, 0x1b, 0xb0, 0x7e, 0x34, 0x7f, 0x03, 0xb4, 0x01, 0x04, 0x7e, + 0x34, 0x7f, 0xcc, 0x7e, 0x1b, 0xb0, 0xbc, 0x0b, 0x50, 0x49, 0x3e, 0x00, 0x3e, 0x00, 0x0a, 0x50, + 0x2d, 0x75, 0x0b, 0x3a, 0x30, 0x69, 0x53, 0x00, 0x02, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, 0xbc, + 0x1b, 0x50, 0x30, 0x3e, 0x10, 0x3e, 0x10, 0x0a, 0x51, 0x2d, 0x35, 0x69, 0x41, 0x00, 0x02, 0x0b, + 0x1a, 0x30, 0xbd, 0x38, 0x50, 0x02, 0x2d, 0x38, 0xbe, 0x44, 0xff, 0xff, 0x78, 0x05, 0x7e, 0x1b, + 0x90, 0x0a, 0x49, 0x4d, 0x44, 0x68, 0x0c, 0xbe, 0x44, 0x00, 0xff, 0x28, 0x04, 0x7e, 0x44, 0x00, + 0xff, 0xc3, 0x22, 0xd3, 0x22, + +// Segment #16, Start Address 00ff7fc6, Length 4 +0xff,0x00,0xc6,0x7f,0x04,0x00, + 0x02, 0x00, 0x03, 0x00, + +// Segment #17, Start Address 00ff7335, Length 328 +0xff,0x00,0x35,0x73,0x48,0x01, + 0xca, 0x08, 0x7e, 0x01, 0x2f, 0x7a, 0x03, 0x3f, 0xf0, 0xda, 0x08, 0x22, 0x7e, 0x1b, 0xc0, 0x7a, + 0x0b, 0xc0, 0x0b, 0x14, 0x0b, 0x34, 0x1b, 0x44, 0x78, 0xf2, 0x22, 0x7f, 0x6f, 0x7f, 0xf0, 0x1b, + 0xfc, 0x7c, 0x54, 0x7d, 0x32, 0x80, 0x08, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0xca, 0x1b, 0x9e, + 0x44, 0x00, 0x10, 0x50, 0xf2, 0x2e, 0x44, 0x00, 0x10, 0x68, 0x06, 0xca, 0x48, 0x1b, 0x44, 0x78, + 0xfa, 0x7f, 0xf6, 0x89, 0xe4, 0xca, 0x6b, 0x5e, 0xd4, 0x00, 0x3f, 0x68, 0x20, 0x7e, 0x84, 0x00, + 0x40, 0x9d, 0x8d, 0xda, 0x6b, 0xbd, 0x87, 0x38, 0x16, 0xca, 0x79, 0x7d, 0x78, 0x12, 0x73, 0xa4, + 0xda, 0x79, 0x40, 0x08, 0x9d, 0x78, 0x68, 0x02, 0x80, 0x05, 0xc2, 0xd7, 0x22, 0xda, 0x6b, 0x7e, + 0xc0, 0x03, 0x7e, 0xd0, 0x00, 0x7a, 0xd3, 0x90, 0x00, 0x74, 0xaa, 0x39, 0xb5, 0x55, 0x55, 0x74, + 0x55, 0x39, 0xb5, 0x2a, 0xaa, 0x74, 0xa0, 0x39, 0xb5, 0x55, 0x55, 0x7e, 0x04, 0x00, 0x40, 0x9d, + 0x70, 0x50, 0x06, 0x2d, 0x70, 0x7d, 0x07, 0x6d, 0x77, 0x7c, 0x31, 0x7e, 0x7b, 0x00, 0x7a, 0x6b, + 0x00, 0x0b, 0x7c, 0x0b, 0x6c, 0xa5, 0xd9, 0xf3, 0x7f, 0x16, 0x1b, 0x1c, 0x7e, 0x54, 0x27, 0x10, + 0x7e, 0x1b, 0x10, 0xbc, 0x10, 0x68, 0x06, 0x1b, 0x54, 0x78, 0xf5, 0x80, 0x2f, 0x6d, 0x00, 0x7c, + 0x20, 0x7f, 0x16, 0x9f, 0x10, 0x7f, 0x27, 0x9f, 0x20, 0x7e, 0x2b, 0x00, 0x7e, 0x1b, 0x10, 0xbc, + 0x01, 0x78, 0x19, 0x0b, 0x2c, 0x0b, 0x1c, 0xa5, 0xdb, 0xef, 0x7c, 0xb6, 0x20, 0xe0, 0x06, 0x6c, + 0xdc, 0x7a, 0xd3, 0x90, 0x00, 0x4d, 0x77, 0x78, 0x90, 0xc2, 0xd7, 0x22, 0xd2, 0xd7, 0x22, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x04, 0x02, 0x04, 0x00, 0x02, 0x01, 0x04, 0x01, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x00, 0x08, 0x10, + 0x02, 0x10, 0x04, 0x02, 0x08, 0x00, 0x01, 0x01, 0x08, 0x7e, 0x18, 0x7f, 0xbd, 0x7a, 0x1c, 0x00, + 0xfe, 0x0b, 0x1a, 0x00, 0x5e, 0x10, 0x1f, 0xbe, 0x10, 0x14, 0x38, 0x1a, 0x0a, 0x51, 0x23, 0x7e, + 0x18, 0x74, 0x24, 0x7a, 0x1c, 0x00, 0xff, 0x2d, 0x35, 0x0b, 0x1a, 0x50, 0x60, 0x08, 0xa5, 0xb8, + 0x02, 0x03, 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, +}; + +static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { + 2, 0, 3 }; // Major, Minor, Build + +#undef IMAGE_VERSION_NAME + +#undef IMAGE_ARRAY_NAME + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_ionsp.h linux.20p9/drivers/usb/serial/io_ionsp.h --- linux.vanilla/drivers/usb/serial/io_ionsp.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_ionsp.h Wed Jul 4 16:03:59 2001 @@ -0,0 +1,454 @@ +/************************************************************************ + * + * IONSP.H Definitions for I/O Networks Serial Protocol + * + * Copyright (c) 1997-1998 Inside Out Networks, Inc. + * + * 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. + * + * These definitions are used by both kernel-mode driver and the + * peripheral firmware and MUST be kept in sync. + * + ************************************************************************/ + +/************************************************************************ + +The data to and from all ports on the peripheral is multiplexed +through a single endpoint pair (EP1 since it supports 64-byte +MaxPacketSize). Therefore, the data, commands, and status for +each port must be preceeded by a short header identifying the +destination port. The header also identifies the bytes that follow +as data or as command/status info. + +Header format, first byte: + + CLLLLPPP + -------- + | | |------ Port Number: 0-7 + | |--------- Length: MSB bits of length + |----------- Data/Command: 0 = Data header + 1 = Cmd / Status (Cmd if OUT, Status if IN) + +This gives 2 possible formats: + + + Data header: 0LLLLPPP LLLLLLLL + ============ + + Where (LLLL,LLLLLLL) is 12-bit length of data that follows for + port number (PPP). The length is 0-based (0-FFF means 0-4095 + bytes). The ~4K limit allows the host driver (which deals in + transfer requests instead of individual packets) to write a + large chunk of data in a single request. Note, however, that + the length must always be <= the current TxCredits for a given + port due to buffering limitations on the peripheral. + + + Cmd/Status header: 1ccccPPP [ CCCCCCCC, Params ]... + ================== + + Where (cccc) or (cccc,CCCCCCCC) is the cmd or status identifier. + Frequently-used values are encoded as (cccc), longer ones using + (cccc,CCCCCCCC). Subsequent bytes are optional parameters and are + specific to the cmd or status code. This may include a length + for command and status codes that need variable-length parameters. + + +In addition, we use another interrupt pipe (endpoint) which the host polls +periodically for flow control information. The peripheral, when there has +been a change, sends the following 10-byte packet: + + RRRRRRRRRRRRRRRR + T0T0T0T0T0T0T0T0 + T1T1T1T1T1T1T1T1 + T2T2T2T2T2T2T2T2 + T3T3T3T3T3T3T3T3 + +The first field is the 16-bit RxBytesAvail field, which indicates the +number of bytes which may be read by the host from EP1. This is necessary: +(a) because OSR2.1 has a bug which causes data loss if the peripheral returns +fewer bytes than the host expects to read, and (b) because, on Microsoft +platforms at least, an outstanding read posted on EP1 consumes about 35% of +the CPU just polling the device for data. + +The next 4 fields are the 16-bit TxCredits for each port, which indicate how +many bytes the host is allowed to send on EP1 for transmit to a given port. +After an OPEN_PORT command, the Edgeport sends the initial TxCredits for that +port. + +All 16-bit fields are sent in little-endian (Intel) format. + +************************************************************************/ + +// +// Define format of InterruptStatus packet returned from the +// Interrupt pipe +// + +typedef struct _INT_STATUS_PKT { + __u16 RxBytesAvail; // Additional bytes available to + // be read from Bulk IN pipe + __u16 TxCredits[ MAX_RS232_PORTS ]; // Additional space available in + // given port's TxBuffer +} INT_STATUS_PKT, *PINT_STATUS_PKT; + + +#define GET_INT_STATUS_SIZE(NumPorts) (sizeof(__u16) + (sizeof(__u16) * (NumPorts))) + + + +// +// Define cmd/status header values and macros to extract them. +// +// Data: 0LLLLPPP LLLLLLLL +// Cmd/Stat: 1ccccPPP CCCCCCCC + +#define IOSP_DATA_HDR_SIZE 2 +#define IOSP_CMD_HDR_SIZE 2 + +#define IOSP_MAX_DATA_LENGTH 0x0FFF // 12 bits -> 4K + +#define IOSP_PORT_MASK 0x07 // Mask to isolate port number +#define IOSP_CMD_STAT_BIT 0x80 // If set, this is command/status header + +#define IS_CMD_STAT_HDR(Byte1) ((Byte1) & IOSP_CMD_STAT_BIT) +#define IS_DATA_HDR(Byte1) (! IS_CMD_STAT_HDR(Byte1)) + +#define IOSP_GET_HDR_PORT(Byte1) ((__u8) ((Byte1) & IOSP_PORT_MASK)) +#define IOSP_GET_HDR_DATA_LEN(Byte1, Byte2) ((__u16) ( ((__u16)((Byte1) & 0x78)) << 5) | (Byte2)) +#define IOSP_GET_STATUS_CODE(Byte1) ((__u8) (((Byte1) & 0x78) >> 3)) + + +// +// These macros build the 1st and 2nd bytes for a data header +// +#define IOSP_BUILD_DATA_HDR1(Port, Len) ((__u8) (((Port) | ((__u8) (((__u16) (Len)) >> 5) & 0x78 )))) +#define IOSP_BUILD_DATA_HDR2(Port, Len) ((__u8) (Len)) + + +// +// These macros build the 1st and 2nd bytes for a command header +// +#define IOSP_BUILD_CMD_HDR1(Port, Cmd) ((__u8) ( IOSP_CMD_STAT_BIT | (Port) | ((__u8) ((Cmd) << 3)) )) + + +//-------------------------------------------------------------- +// +// Define values for commands and command parameters +// (sent from Host to Edgeport) +// +// 1ccccPPP P1P1P1P1 [ P2P2P2P2P2 ]... +// +// cccc: 00-07 2-byte commands. Write UART register 0-7 with +// value in P1. See 16650.H for definitions of +// UART register numbers and contents. +// +// 08-0B 3-byte commands: ==== P1 ==== ==== P2 ==== +// 08 available for expansion +// 09 1-param commands Command Code Param +// 0A available for expansion +// 0B available for expansion +// +// 0C-0D 4-byte commands. P1 = extended cmd and P2,P3 = params +// Currently unimplemented. +// +// 0E-0F N-byte commands: P1 = num bytes after P1 (ie, TotalLen - 2) +// P2 = extended cmd, P3..Pn = parameters. +// Currently unimplemented. +// + +#define IOSP_WRITE_UART_REG(n) ((n) & 0x07) // UartReg[ n ] := P1 + +// Register numbers and contents +// defined in 16554.H. + +// 0x08 // Available for expansion. +#define IOSP_EXT_CMD 0x09 // P1 = Command code (defined below) + +// P2 = Parameter + +// +// Extended Command values, used with IOSP_EXT_CMD, may +// or may not use parameter P2. +// + +#define IOSP_CMD_OPEN_PORT 0x00 // Enable ints, init UART. (NO PARAM) +#define IOSP_CMD_CLOSE_PORT 0x01 // Disable ints, flush buffers. (NO PARAM) +#define IOSP_CMD_CHASE_PORT 0x02 // Wait for Edgeport TX buffers to empty. (NO PARAM) +#define IOSP_CMD_SET_RX_FLOW 0x03 // Set Rx Flow Control in Edgeport +#define IOSP_CMD_SET_TX_FLOW 0x04 // Set Tx Flow Control in Edgeport +#define IOSP_CMD_SET_XON_CHAR 0x05 // Set XON Character in Edgeport +#define IOSP_CMD_SET_XOFF_CHAR 0x06 // Set XOFF Character in Edgeport +#define IOSP_CMD_RX_CHECK_REQ 0x07 // Request Edgeport to insert a Checkpoint into + +// the receive data stream (Parameter = 1 byte sequence number) + +#define IOSP_CMD_SET_BREAK 0x08 // Turn on the BREAK (LCR bit 6) +#define IOSP_CMD_CLEAR_BREAK 0x09 // Turn off the BREAK (LCR bit 6) + + +// +// Define macros to simplify building of IOSP cmds +// + +#define MAKE_CMD_WRITE_REG(ppBuf, pLen, Port, Reg, Val) \ + do { \ + (*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1( (Port), IOSP_WRITE_UART_REG(Reg) ); \ + (*(ppBuf))[1] = (Val); \ + \ + *ppBuf += 2; \ + *pLen += 2; \ + } while (0) + +#define MAKE_CMD_EXT_CMD(ppBuf, pLen, Port, ExtCmd, Param) \ + do { \ + (*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1( (Port), IOSP_EXT_CMD ); \ + (*(ppBuf))[1] = (ExtCmd); \ + (*(ppBuf))[2] = (Param); \ + \ + *ppBuf += 3; \ + *pLen += 3; \ + } while (0) + + + +//-------------------------------------------------------------- +// +// Define format of flow control commands +// (sent from Host to Edgeport) +// +// 11001PPP FlowCmd FlowTypes +// +// Note that the 'FlowTypes' parameter is a bit mask; that is, +// more than one flow control type can be active at the same time. +// FlowTypes = 0 means 'no flow control'. +// + +// +// IOSP_CMD_SET_RX_FLOW +// +// Tells Edgeport how it can stop incoming UART data +// +// Example for Port 0 +// P0 = 11001000 +// P1 = IOSP_CMD_SET_RX_FLOW +// P2 = Bit mask as follows: + +#define IOSP_RX_FLOW_RTS 0x01 // Edgeport drops RTS to stop incoming data +#define IOSP_RX_FLOW_DTR 0x02 // Edgeport drops DTR to stop incoming data +#define IOSP_RX_FLOW_DSR_SENSITIVITY 0x04 // Ignores Rx data unless DSR high + +// Not currently implemented by firmware. +#define IOSP_RX_FLOW_XON_XOFF 0x08 // Edgeport sends XOFF char to stop incoming data. + +// Host must have previously programmed the +// XON/XOFF values with SET_XON/SET_XOFF +// before enabling this bit. + +// +// IOSP_CMD_SET_TX_FLOW +// +// Tells Edgeport what signal(s) will stop it from transmitting UART data +// +// Example for Port 0 +// P0 = 11001000 +// P1 = IOSP_CMD_SET_TX_FLOW +// P2 = Bit mask as follows: + +#define IOSP_TX_FLOW_CTS 0x01 // Edgeport stops Tx if CTS low +#define IOSP_TX_FLOW_DSR 0x02 // Edgeport stops Tx if DSR low +#define IOSP_TX_FLOW_DCD 0x04 // Edgeport stops Tx if DCD low +#define IOSP_TX_FLOW_XON_XOFF 0x08 // Edgeport stops Tx upon receiving XOFF char. + +// Host must have previously programmed the +// XON/XOFF values with SET_XON/SET_XOFF +// before enabling this bit. +#define IOSP_TX_FLOW_XOFF_CONTINUE 0x10 // If not set, Edgeport stops Tx when + +// sending XOFF in order to fix broken +// systems that interpret the next +// received char as XON. +// If set, Edgeport continues Tx +// normally after transmitting XOFF. +// Not currently implemented by firmware. +#define IOSP_TX_TOGGLE_RTS 0x20 // Edgeport drives RTS as a true half-duplex + +// Request-to-Send signal: it is raised before +// beginning transmission and lowered after +// the last Tx char leaves the UART. +// Not currently implemented by firmware. + +// +// IOSP_CMD_SET_XON_CHAR +// +// Sets the character which Edgeport transmits/interprets as XON. +// Note: This command MUST be sent before sending a SET_RX_FLOW or +// SET_TX_FLOW with the XON_XOFF bit set. +// +// Example for Port 0 +// P0 = 11001000 +// P1 = IOSP_CMD_SET_XON_CHAR +// P2 = 0x11 + + +// +// IOSP_CMD_SET_XOFF_CHAR +// +// Sets the character which Edgeport transmits/interprets as XOFF. +// Note: This command must be sent before sending a SET_RX_FLOW or +// SET_TX_FLOW with the XON_XOFF bit set. +// +// Example for Port 0 +// P0 = 11001000 +// P1 = IOSP_CMD_SET_XOFF_CHAR +// P2 = 0x13 + + +// +// IOSP_CMD_RX_CHECK_REQ +// +// This command is used to assist in the implementation of the +// IOCTL_SERIAL_PURGE Windows IOCTL. +// This IOSP command tries to place a marker at the end of the RX +// queue in the Edgeport. If the Edgeport RX queue is full then +// the Check will be discarded. +// It is up to the device driver to timeout waiting for the +// RX_CHECK_RSP. If a RX_CHECK_RSP is received, the driver is +// sure that all data has been received from the edgeport and +// may now purge any internal RX buffers. +// Note tat the sequence numbers may be used to detect lost +// CHECK_REQs. + +// Example for Port 0 +// P0 = 11001000 +// P1 = IOSP_CMD_RX_CHECK_REQ +// P2 = Sequence number + + +// Response will be: +// P1 = IOSP_EXT_RX_CHECK_RSP +// P2 = Request Sequence number + + + +//-------------------------------------------------------------- +// +// Define values for status and status parameters +// (received by Host from Edgeport) +// +// 1ssssPPP P1P1P1P1 [ P2P2P2P2P2 ]... +// +// ssss: 00-07 2-byte status. ssss identifies which UART register +// has changed value, and the new value is in P1. +// Note that the ssss values do not correspond to the +// 16554 register numbers given in 16554.H. Instead, +// see below for definitions of the ssss numbers +// used in this status message. +// +// 08-0B 3-byte status: ==== P1 ==== ==== P2 ==== +// 08 LSR_DATA: New LSR Errored byte +// 09 1-param responses Response Code Param +// 0A OPEN_RSP: InitialMsr TxBufferSize +// 0B available for expansion +// +// 0C-0D 4-byte status. P1 = extended status code and P2,P3 = params +// Not currently implemented. +// +// 0E-0F N-byte status: P1 = num bytes after P1 (ie, TotalLen - 2) +// P2 = extended status, P3..Pn = parameters. +// Not currently implemented. +// + +/**************************************************** + * SSSS values for 2-byte status messages (0-8) + ****************************************************/ + +#define IOSP_STATUS_LSR 0x00 // P1 is new value of LSR register. + +// Bits defined in 16554.H. Edgeport +// returns this in order to report +// line status errors (overrun, +// parity, framing, break). This form +// is used when a errored receive data +// character was NOT present in the +// UART when the LSR error occurred +// (ie, when LSR bit 0 = 0). + +#define IOSP_STATUS_MSR 0x01 // P1 is new value of MSR register. + +// Bits defined in 16554.H. Edgeport +// returns this in order to report +// changes in modem status lines +// (CTS, DSR, RI, CD) +// + +// 0x02 // Available for future expansion +// 0x03 // +// 0x04 // +// 0x05 // +// 0x06 // +// 0x07 // + + +/**************************************************** + * SSSS values for 3-byte status messages (8-A) + ****************************************************/ + +#define IOSP_STATUS_LSR_DATA 0x08 // P1 is new value of LSR register (same as STATUS_LSR) + +// P2 is errored character read from +// RxFIFO after LSR reported an error. + +#define IOSP_EXT_STATUS 0x09 // P1 is status/response code, param in P2. + + +// Response Codes (P1 values) for 3-byte status messages + +#define IOSP_EXT_STATUS_CHASE_RSP 0 // Reply to CHASE_PORT cmd. P2 is outcome: +#define IOSP_EXT_STATUS_CHASE_PASS 0 // P2 = 0: All Tx data drained successfully +#define IOSP_EXT_STATUS_CHASE_FAIL 1 // P2 = 1: Timed out (stuck due to flow + +// control from remote device). + +#define IOSP_EXT_STATUS_RX_CHECK_RSP 1 // Reply to RX_CHECK cmd. P2 is sequence number + + +#define IOSP_STATUS_OPEN_RSP 0x0A // Reply to OPEN_PORT cmd. + +// P1 is Initial MSR value +// P2 is encoded TxBuffer Size: +// TxBufferSize = (P2 + 1) * 64 + +// 0x0B // Available for future expansion + +#define GET_TX_BUFFER_SIZE(P2) (((P2) + 1) * 64) + + + + +/**************************************************** + * SSSS values for 4-byte status messages + ****************************************************/ + +#define IOSP_EXT4_STATUS 0x0C // Extended status code in P1, + +// Params in P2, P3 +// Currently unimplemented. + +// 0x0D // Currently unused, available. + + + +// +// Macros to parse status messages +// + +#define IOSP_GET_STATUS_LEN(code) ( (code) < 8 ? 2 : ((code) < 0x0A ? 3 : 4) ) + +#define IOSP_STATUS_IS_2BYTE(code) ( (code) < 0x08 ) +#define IOSP_STATUS_IS_3BYTE(code) ( ((code) >= 0x08) && ((code) <= 0x0B) ) +#define IOSP_STATUS_IS_4BYTE(code) ( ((code) >= 0x0C) && ((code) <= 0x0D) ) + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_tables.h linux.20p9/drivers/usb/serial/io_tables.h --- linux.vanilla/drivers/usb/serial/io_tables.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_tables.h Wed Jul 4 16:03:59 2001 @@ -0,0 +1,437 @@ +/* + * IO Edgeport Driver tables + * + * Copyright (C) 2001 + * Greg Kroah-Hartman (greg@kroah.com) + * + * 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. + * + */ + +/* Devices that this driver supports */ +static __u16 ionetworks_vendor_id = USB_VENDOR_ID_ION; +static __u16 edgeport_4_id = ION_DEVICE_ID_EDGEPORT_4; +static __u16 rapidport_4_id = ION_DEVICE_ID_RAPIDPORT_4; +static __u16 edgeport_4t_id = ION_DEVICE_ID_EDGEPORT_4T; +static __u16 edgeport_2_id = ION_DEVICE_ID_EDGEPORT_2; +static __u16 edgeport_4i_id = ION_DEVICE_ID_EDGEPORT_4I; +static __u16 edgeport_2i_id = ION_DEVICE_ID_EDGEPORT_2I; +static __u16 edgeport_prl_id = ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT; +static __u16 edgeport_421_id = ION_DEVICE_ID_EDGEPORT_421; +static __u16 edgeport_21_id = ION_DEVICE_ID_EDGEPORT_21; +static __u16 edgeport_8dual_id = ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU; +static __u16 edgeport_8_id = ION_DEVICE_ID_EDGEPORT_8; +static __u16 edgeport_2din_id = ION_DEVICE_ID_EDGEPORT_2_DIN; +static __u16 edgeport_4din_id = ION_DEVICE_ID_EDGEPORT_4_DIN; +static __u16 edgeport_16dual_id = ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU; +static __u16 edgeport_compat_id = ION_DEVICE_ID_EDGEPORT_COMPATIBLE; +static __u16 edgeport_8i_id = ION_DEVICE_ID_EDGEPORT_8I; + + +/* build up the list of devices that this driver supports */ +struct usb_serial_device_type edgeport_4_device = { + name: "Edgeport 4", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_4_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type rapidport_4_device = { + name: "Rapidport 4", + idVendor: &ionetworks_vendor_id, + idProduct: &rapidport_4_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_4t_device = { + name: "Edgeport 4t", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_4t_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_2_device = { + name: "Edgeport 2", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_2_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 2, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_4i_device = { + name: "Edgeport 4i", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_4i_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_2i_device = { + name: "Edgeport 2i", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_2i_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 2, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_prl_device = { + name: "Edgeport Parallel", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_prl_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 1, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_421_device = { + name: "Edgeport 421", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_421_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 2, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_21_device = { + name: "Edgeport 21", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_21_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 2, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_8dual_device = { + name: "Edgeport 8 dual cpu", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_8dual_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_8_device = { + name: "Edgeport 8", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_8_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 8, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_2din_device = { + name: "Edgeport 2din", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_2din_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 2, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_4din_device = { + name: "Edgeport 4din", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_4din_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_16dual_device = { + name: "Edgeport 16 dual cpu", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_16dual_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 8, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_compat_id_device = { + name: "Edgeport Compatible", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_compat_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 4, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + +struct usb_serial_device_type edgeport_8i_device = { + name: "Edgeport 8i", + idVendor: &ionetworks_vendor_id, + idProduct: &edgeport_8i_id, + needs_interrupt_in: MUST_HAVE, + needs_bulk_in: MUST_HAVE, + needs_bulk_out: MUST_HAVE, + num_interrupt_in: 1, + num_bulk_in: 1, + num_bulk_out: 1, + num_ports: 8, + open: edge_open, + close: edge_close, + throttle: edge_throttle, + unthrottle: edge_unthrottle, + startup: edge_startup, + shutdown: edge_shutdown, + ioctl: edge_ioctl, + set_termios: edge_set_termios, + write: edge_write, + write_room: edge_write_room, + chars_in_buffer: edge_chars_in_buffer, + break_ctl: edge_break, +}; + + + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/io_usbvend.h linux.20p9/drivers/usb/serial/io_usbvend.h --- linux.vanilla/drivers/usb/serial/io_usbvend.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/io_usbvend.h Wed Jul 4 16:03:59 2001 @@ -0,0 +1,374 @@ +/************************************************************************ + * + * USBVEND.H Vendor-specific USB definitions + * + * NOTE: This must be kept in sync with the Edgeport firmware and + * must be kept backward-compatible with older firmware. + * + ************************************************************************ + * + * Copyright (c) 1998 Inside Out Networks, Inc. + * 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. + * + ************************************************************************/ + +#if !defined(_USBVEND_H) +#define _USBVEND_H + +#ifndef __KERNEL__ +#include "ionprag.h" /* Extra I/O Networks pragmas */ + +#include + +#include "iondef.h" /* Standard I/O Networks definitions */ +#endif + +/************************************************************************ + * + * D e f i n e s / T y p e d e f s + * + ************************************************************************/ + +// +// Definitions of USB product IDs +// + +#define USB_VENDOR_ID_ION 0x1608 // Our VID + +// +// Definitions of USB product IDs (PID) +// We break the USB-defined PID into an OEM Id field (upper 6 bits) +// and a Device Id (bottom 10 bits). The Device Id defines what +// device this actually is regardless of what the OEM wants to +// call it. +// + +// ION-device OEM IDs +#define ION_OEM_ID_ION 0 // 00h Inside Out Networks +#define ION_OEM_ID_NLYNX 1 // 01h NLynx Systems +#define ION_OEM_ID_GENERIC 2 // 02h Generic OEM +#define ION_OEM_ID_MAC 3 // 03h Mac Version +#define ION_OEM_ID_MEGAWOLF 4 // 04h Lupusb OEM Mac version (MegaWolf) +#define ION_OEM_ID_MULTITECH 5 // 05h Multitech Rapidports + + +// ION-device Device IDs +// Product IDs - assigned to match middle digit of serial number + + +// The ION_DEVICE_ID_GENERATION_2 bit (0x20) will be ORed into the existing edgeport +// PIDs to identify 80251+Netchip hardware. This will guarantee that if a second +// generation edgeport device is plugged into a PC with an older (pre 2.0) driver, +// it will not enumerate. + +#define ION_DEVICE_ID_GENERATION_2 0x020 // This bit is set in the PID if this edgeport hardware + // is based on the 80251+Netchip. + +#define EDGEPORT_DEVICE_ID_MASK 0x3df // Not including GEN_2 bit + +#define ION_DEVICE_ID_UNCONFIGURED_EDGE_DEVICE 0x000 // In manufacturing only +#define ION_DEVICE_ID_EDGEPORT_4 0x001 // Edgeport/4 RS232 +// ION_DEVICE_ID_HUBPORT_7 0x002 // Hubport/7 (Placeholder, not used by software) +#define ION_DEVICE_ID_RAPIDPORT_4 0x003 // Rapidport/4 +#define ION_DEVICE_ID_EDGEPORT_4T 0x004 // Edgeport/4 RS232 for Telxon (aka "Fleetport") +#define ION_DEVICE_ID_EDGEPORT_2 0x005 // Edgeport/2 RS232 +#define ION_DEVICE_ID_EDGEPORT_4I 0x006 // Edgeport/4 RS422 +#define ION_DEVICE_ID_EDGEPORT_2I 0x007 // Edgeport/2 RS422/RS485 +// ION_DEVICE_ID_HUBPORT_4 0x008 // Hubport/4 (Placeholder, not used by software) +// ION_DEVICE_ID_EDGEPORT_8_HANDBUILT 0x009 // Hand-built Edgeport/8 (Placeholder, used in middle digit of serial number only!) +// ION_DEVICE_ID_MULTIMODEM_4X56 0x00A // MultiTech version of RP/4 (Placeholder, used in middle digit of serial number only!) +#define ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT 0x00B // Edgeport/(4)21 Parallel port (USS720) +#define ION_DEVICE_ID_EDGEPORT_421 0x00C // Edgeport/421 Hub+RS232+Parallel +#define ION_DEVICE_ID_EDGEPORT_21 0x00D // Edgeport/21 RS232+Parallel +#define ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU 0x00E // Half of an Edgeport/8 (the kind with 2 EP/4s on 1 PCB) +#define ION_DEVICE_ID_EDGEPORT_8 0x00F // Edgeport/8 (single-CPU) +#define ION_DEVICE_ID_EDGEPORT_2_DIN 0x010 // Edgeport/2 RS232 with Apple DIN connector +#define ION_DEVICE_ID_EDGEPORT_4_DIN 0x011 // Edgeport/4 RS232 with Apple DIN connector +#define ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU 0x012 // Half of an Edgeport/16 (the kind with 2 EP/8s) +#define ION_DEVICE_ID_EDGEPORT_COMPATIBLE 0x013 // Edgeport Compatible, for NCR, Axiohm etc. testing +#define ION_DEVICE_ID_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU) + +// These IDs are used by the Edgeport.exe program for uninstalling. +// +#define EDGEPORT_DEVICE_IDS {0x001, 0x003, 0x004, 0x005, 0x006, 0x007, 0x00B, \ + 0x00C, 0x00D, 0x00E, 0x00F, 0x010, 0x011, 0x012, \ + 0x013, 0x014 } + + +#define MAKE_USB_PRODUCT_ID( OemId, DeviceId ) \ + ( (__u16) (((OemId) << 10) || (DeviceId)) ) + +#define DEVICE_ID_FROM_USB_PRODUCT_ID( ProductId ) \ + ( (__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)) ) + +#define OEM_ID_FROM_USB_PRODUCT_ID( ProductId ) \ + ( (__u16) (((ProductId) >> 10) & 0x3F) ) + +// +// Definitions of parameters for download code. Note that these are +// specific to a given version of download code and must change if the +// corresponding download code changes. +// + +// TxCredits value below which driver won't bother sending (to prevent too many small writes). +// Send only if above 25% +#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit) (max( ((InitialCredit) / 4), EDGE_FW_BULK_MAX_PACKET_SIZE )) + +#define EDGE_FW_BULK_MAX_PACKET_SIZE 64 // Max Packet Size for Bulk In Endpoint (EP1) +#define EDGE_FW_BULK_READ_BUFFER_SIZE 1024 // Size to use for Bulk reads + +#define EDGE_FW_INT_MAX_PACKET_SIZE 32 // Max Packet Size for Interrupt In Endpoint + // Note that many units were shipped with MPS=16, we + // force an upgrade to this value). +#define EDGE_FW_INT_INTERVAL 2 // 2ms polling on IntPipe + + +// +// Definitions of I/O Networks vendor-specific requests +// for default endpoint +// +// bmRequestType = 00100000 Set vendor-specific, to device +// bmRequestType = 10100000 Get vendor-specific, to device +// +// These are the definitions for the bRequest field for the +// above bmRequestTypes. +// +// For the read/write Edgeport memory commands, the parameters +// are as follows: +// wValue = 16-bit address +// wIndex = unused (though we could put segment 00: or FF: here) +// wLength = # bytes to read/write (max 64) +// + +#define USB_REQUEST_ION_RESET_DEVICE 0 // Warm reboot Edgeport, retaining USB address +#define USB_REQUEST_ION_GET_EPIC_DESC 1 // Get Edgeport Compatibility Descriptor +// unused 2 // Unused, available +#define USB_REQUEST_ION_READ_RAM 3 // Read EdgePort RAM at specified addr +#define USB_REQUEST_ION_WRITE_RAM 4 // Write EdgePort RAM at specified addr +#define USB_REQUEST_ION_READ_ROM 5 // Read EdgePort ROM at specified addr +#define USB_REQUEST_ION_WRITE_ROM 6 // Write EdgePort ROM at specified addr +#define USB_REQUEST_ION_EXEC_DL_CODE 7 // Begin execution of RAM-based download + // code by jumping to address in wIndex:wValue +// 8 // Unused, available +#define USB_REQUEST_ION_ENABLE_SUSPEND 9 // Enable/Disable suspend feature + // (wValue != 0: Enable; wValue = 0: Disable) + + +// +// Define parameter values for our vendor-specific commands +// + + +// Values for iDownloadFile +#define EDGE_DOWNLOAD_FILE_NONE 0 // No download requested +#define EDGE_DOWNLOAD_FILE_INTERNAL 0xFF // Download the file compiled into driver (930 version) +#define EDGE_DOWNLOAD_FILE_I930 0xFF // Download the file compiled into driver (930 version) +#define EDGE_DOWNLOAD_FILE_80251 0xFE // Download the file compiled into driver (80251 version) + + + +/* + * Special addresses for READ/WRITE_RAM/ROM + */ + +// Version 1 (original) format of DeviceParams +#define EDGE_MANUF_DESC_ADDR_V1 0x00FF7F00 +#define EDGE_MANUF_DESC_LEN_V1 sizeof(EDGE_MANUF_DESCRIPTOR_V1) + +// Version 2 format of DeviceParams. This format is longer (3C0h) +// and starts lower in memory, at the uppermost 1K in ROM. +#define EDGE_MANUF_DESC_ADDR 0x00FF7C00 +#define EDGE_MANUF_DESC_LEN sizeof(EDGE_MANUF_DESCRIPTOR) + +// Boot params descriptor +#define EDGE_BOOT_DESC_ADDR 0x00FF7FC0 +#define EDGE_BOOT_DESC_LEN sizeof(EDGE_BOOT_DESCRIPTOR) + +// Define the max block size that may be read or written +// in a read/write RAM/ROM command. +#define MAX_SIZE_REQ_ION_READ_MEM ( (__u16) 64 ) +#define MAX_SIZE_REQ_ION_WRITE_MEM ( (__u16) 64 ) + + +// +// Notes for the following two ION vendor-specific param descriptors: +// +// 1. These have a standard USB descriptor header so they look like a +// normal descriptor. +// 2. Any strings in the structures are in USB-defined string +// descriptor format, so that they may be separately retrieved, +// if necessary, with a minimum of work on the 930. This also +// requires them to be in UNICODE format, which, for English at +// least, simply means extending each UCHAR into a USHORT. +// 3. For all fields, 00 means 'uninitialized'. +// 4. All unused areas should be set to 00 for future expansion. +// + +// This structure is ver 2 format. It contains ALL USB descriptors as +// well as the configuration parameters that were in the original V1 +// structure. It is NOT modified when new boot code is downloaded; rather, +// these values are set or modified by manufacturing. It is located at +// xC00-xFBF (length 3C0h) in the ROM. +// This structure is a superset of the v1 structure and is arranged so +// that all of the v1 fields remain at the same address. We are just +// adding more room to the front of the structure to hold the descriptors. +// +// The actual contents of this structure are defined in a 930 assembly +// file, converted to a binary image, and then written by the serialization +// program. The C definition of this structure just defines a dummy +// area for general USB descriptors and the descriptor tables (the root +// descriptor starts at xC00). At the bottom of the structure are the +// fields inherited from the v1 structure. + +#define MAX_SERIALNUMBER_LEN 12 +#define MAX_ASSEMBLYNUMBER_LEN 14 + +typedef struct _EDGE_MANUF_DESCRIPTOR { + + __u16 RootDescTable[0x10]; // C00 Root of descriptor tables (just a placeholder) + __u8 DescriptorArea[0x2E0]; // C20 Descriptors go here, up to 2E0h (just a placeholder) + + // Start of v1-compatible section + __u8 Length; // F00 Desc length for what follows, per USB (= C0h ) + __u8 DescType; // F01 Desc type, per USB (=DEVICE type) + __u8 DescVer; // F02 Desc version/format (currently 2) + __u8 NumRootDescEntries; // F03 # entries in RootDescTable + + __u8 RomSize; // F04 Size of ROM/E2PROM in K + __u8 RamSize; // F05 Size of external RAM in K + __u8 CpuRev; // F06 CPU revision level (chg only if s/w visible) + __u8 BoardRev; // F07 PCB revision level (chg only if s/w visible) + + __u8 NumPorts; // F08 Number of ports + __u8 DescDate[3]; // F09 MM/DD/YY when descriptor template was compiler, + // so host can track changes to USB-only descriptors. + + __u8 SerNumLength; // F0C USB string descriptor len + __u8 SerNumDescType; // F0D USB descriptor type (=STRING type) + __u16 SerialNumber[MAX_SERIALNUMBER_LEN]; // F0E "01-01-000100" Unicode Serial Number + + __u8 AssemblyNumLength; // F26 USB string descriptor len + __u8 AssemblyNumDescType; // F27 USB descriptor type (=STRING type) + __u16 AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F28 "350-1000-01-A " assembly number + + __u8 OemAssyNumLength; // F44 USB string descriptor len + __u8 OemAssyNumDescType; // F45 USB descriptor type (=STRING type) + __u16 OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F46 "xxxxxxxxxxxxxx" OEM assembly number + + __u8 ManufDateLength; // F62 USB string descriptor len + __u8 ManufDateDescType; // F63 USB descriptor type (=STRING type) + __u16 ManufDate[6]; // F64 "MMDDYY" manufacturing date + + __u8 Reserved3[0x4D]; // F70 -- unused, set to 0 -- + + __u8 UartType; // FBD Uart Type + __u8 IonPid; // FBE Product ID, == LSB of USB DevDesc.PID + // (Note: Edgeport/4s before 11/98 will have + // 00 here instead of 01) + __u8 IonConfig; // FBF Config byte for ION manufacturing use + // FBF end of structure, total len = 3C0h + +} EDGE_MANUF_DESCRIPTOR, *PEDGE_MANUF_DESCRIPTOR; + + +#define MANUF_DESC_VER_1 1 // Original definition of MANUF_DESC +#define MANUF_DESC_VER_2 2 // Ver 2, starts at xC00h len 3C0h + + +// Uart Types +// Note: Since this field was added only recently, all Edgeport/4 units +// shipped before 11/98 will have 00 in this field. Therefore, +// both 00 and 01 values mean '654. +#define MANUF_UART_EXAR_654_EARLY 0 // Exar 16C654 in Edgeport/4s before 11/98 +#define MANUF_UART_EXAR_654 1 // Exar 16C654 +#define MANUF_UART_EXAR_2852 2 // Exar 16C2852 + +// +// Note: The CpuRev and BoardRev values do not conform to manufacturing +// revisions; they are to be incremented only when the CPU or hardware +// changes in a software-visible way, such that the 930 software or +// the host driver needs to handle the hardware differently. +// + +// Values of bottom 5 bits of CpuRev & BoardRev for +// Implementation 0 (ie, 930-based) +#define MANUF_CPU_REV_AD4 1 // 930 AD4, with EP1 Rx bug (needs RXSPM) +#define MANUF_CPU_REV_AD5 2 // 930 AD5, with above bug (supposedly) fixed +#define MANUF_CPU_80251 0x20 // Intel 80251 + + +#define MANUF_BOARD_REV_A 1 // Original version, == Manuf Rev A +#define MANUF_BOARD_REV_B 2 // Manuf Rev B, wakeup interrupt works +#define MANUF_BOARD_REV_C 3 // Manuf Rev C, 2/4 ports, rs232/rs422 +#define MANUF_BOARD_REV_GENERATION_2 0x20 // Second generaiton edgeport + + + + +// Values of bottom 5 bits of CpuRev & BoardRev for +// Implementation 1 (ie, 251+Netchip-based) +#define MANUF_CPU_REV_1 1 // C251TB Rev 1 (Need actual Intel rev here) + +#define MANUF_BOARD_REV_A 1 // First rev of 251+Netchip design + + + +#define MANUF_SERNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->SerialNumber) +#define MANUF_ASSYNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->AssemblyNumber) +#define MANUF_OEMASSYNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->OemAssyNumber) +#define MANUF_MANUFDATE_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->ManufDate) + +#define MANUF_ION_CONFIG_MASTER 0x80 // 1=Master mode, 0=Normal +#define MANUF_ION_CONFIG_DIAG 0x40 // 1=Run h/w diags, 0=norm +#define MANUF_ION_CONFIG_DIAG_NO_LOOP 0x20 // As above but no ext loopback test + + +// +// This structure describes parameters for the boot code, and +// is programmed along with new boot code. These are values +// which are specific to a given build of the boot code. It +// is exactly 64 bytes long and is fixed at address FF:xFC0 +// - FF:xFFF. Note that the 930-mandated UCONFIG bytes are +// included in this structure. +// +typedef struct _EDGE_BOOT_DESCRIPTOR { + __u8 Length; // C0 Desc length, per USB (= 40h) + __u8 DescType; // C1 Desc type, per USB (= DEVICE type) + __u8 DescVer; // C2 Desc version/format + __u8 Reserved1; // C3 -- unused, set to 0 -- + + __u16 BootCodeLength; // C4 Boot code goes from FF:0000 to FF:(len-1) + // (LE format) + + __u8 MajorVersion; // C6 Firmware version: xx. + __u8 MinorVersion; // C7 yy. + __u16 BuildNumber; // C8 zzzz (LE format) + + __u16 EnumRootDescTable; // CA Root of ROM-based descriptor table + __u8 NumDescTypes; // CC Number of supported descriptor types + + __u8 Reserved4; // CD Fix Compiler Packing + + __u16 Capabilities; // CE-CF Capabilities flags (LE format) + __u8 Reserved2[0x28]; // D0 -- unused, set to 0 -- + __u8 UConfig0; // F8 930-defined CPU configuration byte 0 + __u8 UConfig1; // F9 930-defined CPU configuration byte 1 + __u8 Reserved3[6]; // FA -- unused, set to 0 -- + // FF end of structure, total len = 80 + +} EDGE_BOOT_DESCRIPTOR, *PEDGE_BOOT_DESCRIPTOR; + + +#define BOOT_DESC_VER_1 1 // Original definition of BOOT_PARAMS +#define BOOT_DESC_VER_2 2 // 2nd definition, descriptors not included in boot + + + // Capabilities flags + +#define BOOT_CAP_RESET_CMD 0x0001 // If set, boot correctly supports ION_RESET_DEVICE + +#endif // if !defined() + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/keyspan.c linux.20p9/drivers/usb/serial/keyspan.c --- linux.vanilla/drivers/usb/serial/keyspan.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/keyspan.c Wed Aug 8 22:24:15 2001 @@ -28,6 +28,9 @@ open source projects. Change History + (04/08/2001) gb + Identify version on module load. + Tue Oct 10 23:15:33 EST 2000 Hugh Merged Paul's changes with my USA-49W mods. Work in progress still... @@ -46,6 +49,7 @@ */ +#include #include #include #include @@ -59,16 +63,24 @@ #include #include #include - -#define DEBUG -/* #ifdef CONFIG_USB_SERIAL_DEBUG */ - #define DEBUG -/* #endif */ #include +#ifdef CONFIG_USB_SERIAL_DEBUG + static int debug = 1; +#else + static int debug; +#endif + #include "usb-serial.h" #include "keyspan.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Hugh Blemings " +#define DRIVER_DESC "Keyspan USB to Serial Converter Driver" + #define INSTAT_BUFLEN 32 #define GLOCONT_BUFLEN 64 @@ -161,6 +173,9 @@ usb_serial_register (&keyspan_usa28_device); usb_serial_register (&keyspan_usa28x_device); usb_serial_register (&keyspan_usa49w_device); + + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -1282,7 +1297,21 @@ msg.setPrescaler = 0xff; } - msg.lcr = USA_DATABITS_8 | STOPBITS_5678_1; + msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + switch (p_priv->cflag & CSIZE) { + case CS5: + msg.lcr |= USA_DATABITS_5; + break; + case CS6: + msg.lcr |= USA_DATABITS_6; + break; + case CS7: + msg.lcr |= USA_DATABITS_7; + break; + case CS8: + msg.lcr |= USA_DATABITS_8; + break; + } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ msg.lcr |= (p_priv->cflag & PARODD)? @@ -1475,7 +1504,21 @@ //msg.setPrescaler = 0xff; } - msg.lcr = USA_DATABITS_8 | STOPBITS_5678_1; + msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + switch (p_priv->cflag & CSIZE) { + case CS5: + msg.lcr |= USA_DATABITS_5; + break; + case CS6: + msg.lcr |= USA_DATABITS_6; + break; + case CS7: + msg.lcr |= USA_DATABITS_7; + break; + case CS8: + msg.lcr |= USA_DATABITS_8; + break; + } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ msg.lcr |= (p_priv->cflag & PARODD)? @@ -1668,3 +1711,10 @@ kfree(port->private); } } + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/keyspan_pda.c linux.20p9/drivers/usb/serial/keyspan_pda.c --- linux.vanilla/drivers/usb/serial/keyspan_pda.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/keyspan_pda.c Wed Aug 8 22:24:15 2001 @@ -12,6 +12,13 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * + * (04/08/2001) gb + * Identify version on module load. + * + * (10/05/2000) gkh + * Fixed bug with urb->dev not being set properly, now that the usb + * core needs it. + * * (08/28/2000) gkh * Added locks for SMP safeness. * Fixed MOD_INC and MOD_DEC logic and the ability to open a port more @@ -54,19 +61,20 @@ #include #include #include +#include #include #include -#include #include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include + struct ezusb_hex_record { __u16 address; @@ -75,9 +83,15 @@ }; #include "keyspan_pda_fw.h" - #include "usb-serial.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Brian Warner " +#define DRIVER_DESC "USB Keyspan PDA Converter driver" + struct keyspan_pda_private { int tx_room; int tx_throttled; @@ -112,7 +126,7 @@ /* wake up other tty processes */ wake_up_interruptible( &tty->write_wait ); /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */ - + MOD_DEC_USE_COUNT; } static void keyspan_pda_request_unthrottle( struct usb_serial *serial ) @@ -131,7 +145,7 @@ NULL, 0, 2*HZ); - + MOD_DEC_USE_COUNT; } @@ -180,7 +194,9 @@ tty = serial->port[0].tty; priv->tx_throttled = 0; /* queue up a wakeup at scheduler time */ - queue_task( &priv->wakeup_task, &tq_scheduler ); + MOD_INC_USE_COUNT; + if (schedule_task(&priv->wakeup_task) == 0) + MOD_DEC_USE_COUNT; break; default: break; @@ -212,6 +228,7 @@ { /* just restart the receive interrupt URB */ dbg("keyspan_pda_rx_unthrottle port %d", port->number); + port->interrupt_in_urb->dev = port->serial->dev; if (usb_submit_urb(port->interrupt_in_urb)) dbg(" usb_submit_urb(read urb) failed"); return; @@ -506,6 +523,7 @@ priv->tx_room -= count; + port->write_urb->dev = port->serial->dev; if (usb_submit_urb(port->write_urb)) { dbg(" usb_submit_urb(write bulk) failed"); spin_unlock_irqrestore (&port->port_lock, flags); @@ -520,7 +538,9 @@ if (request_unthrottle) { priv->tx_throttled = 1; /* block writers */ - queue_task( &priv->unthrottle_task, &tq_scheduler ); + MOD_INC_USE_COUNT; + if (schedule_task(&priv->unthrottle_task) == 0) + MOD_DEC_USE_COUNT; } spin_unlock_irqrestore (&port->port_lock, flags); @@ -546,8 +566,9 @@ } /* queue up a wakeup at scheduler time */ - queue_task( &priv->wakeup_task, &tq_scheduler ); - + MOD_INC_USE_COUNT; + if (schedule_task(&priv->wakeup_task) == 0) + MOD_DEC_USE_COUNT; } @@ -627,6 +648,7 @@ keyspan_pda_set_modem_info(serial, 0); /*Start reading from the device*/ + port->interrupt_in_urb->dev = serial->dev; if (usb_submit_urb(port->interrupt_in_urb)) dbg(__FUNCTION__" - usb_submit_urb(read int) failed"); } else { @@ -783,6 +805,7 @@ { usb_serial_register (&keyspan_pda_fake_device); usb_serial_register (&keyspan_pda_device); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -797,5 +820,9 @@ module_init(keyspan_pda_init); module_exit(keyspan_pda_exit); -MODULE_AUTHOR("Brian Warner "); -MODULE_DESCRIPTION("USB Keyspan PDA Converter driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/keyspan_pda_fw.h linux.20p9/drivers/usb/serial/keyspan_pda_fw.h --- linux.vanilla/drivers/usb/serial/keyspan_pda_fw.h Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/keyspan_pda_fw.h Wed Jul 4 16:03:59 2001 @@ -1,9 +1,15 @@ /* - * keyspan_pda_fw.h + * USB Keyspan PDA Firmware + * + * Copyright (c) 1999, 2000 Brian Warner + * + * 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. * * Generated from keyspan_pda.s by ezusb_convert.pl - * This file is presumed to be under the same copyright as the source file - * from which it was derived. + * */ static const struct ezusb_hex_record keyspan_pda_firmware[] = { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/mct_u232.c linux.20p9/drivers/usb/serial/mct_u232.c --- linux.vanilla/drivers/usb/serial/mct_u232.c Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/mct_u232.c Wed Aug 8 22:24:15 2001 @@ -0,0 +1,883 @@ +/* + * MCT (Magic Control Technology Corp.) USB RS232 Converter Driver + * + * Copyright (C) 2000 Wolfgang Grandegger (wolfgang@ces.ch) + * + * 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 largely derived from the Belkin USB Serial Adapter Driver + * (see belkin_sa.[ch]). All of the information about the device was acquired + * by using SniffUSB on Windows98. For technical details see mct_u232.h. + * + * William G. Greathouse and Greg Kroah-Hartman provided great help on how to + * do the reverse engineering and how to write a USB serial device driver. + * + * TO BE DONE, TO BE CHECKED: + * DTR/RTS signal handling may be incomplete or incorrect. I have mainly + * implemented what I have seen with SniffUSB or found in belkin_sa.c. + * For further TODOs check also belkin_sa.c. + * + * TEST STATUS: + * Basic tests have been performed with minicom/zmodem transfers and + * modem dialing under Linux 2.4.0-test10 (for me it works fine). + * + * 04-May-2001 Stelian Pop + * - Set the maximum bulk output size for Sitecom U232-P25 model to 16 bytes + * instead of the device reported 32 (using 32 bytes causes many data + * loss, Windows driver uses 16 too). + * + * 02-May-2001 Stelian Pop + * - Fixed the baud calculation for Sitecom U232-P25 model + * + * 08-Apr-2001 gb + * - Identify version on module load. + * + * 06-Jan-2001 Cornel Ciocirlan + * - Added support for Sitecom U232-P25 model (Product Id 0x0230) + * - Added support for D-Link DU-H3SP USB BAY (Product Id 0x0200) + * + * 29-Nov-2000 Greg Kroah-Hartman + * - Added device id table to fit with 2.4.0-test11 structure. + * - took out DEAL_WITH_TWO_INT_IN_ENDPOINTS #define as it's not needed + * (lots of things will change if/when the usb-serial core changes to + * handle these issues. + * + * 27-Nov-2000 Wolfgang Grandegger + * A version for kernel 2.4.0-test10 released to the Linux community + * (via linux-usb-devel). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_USB_SERIAL_DEBUG + static int debug = 1; +#else + static int debug; +#endif + +#include "usb-serial.h" +#include "mct_u232.h" + + +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Wolfgang Grandegger " +#define DRIVER_DESC "Magic Control Technology USB-RS232 converter driver" + +/* + * Some not properly written applications do not handle the return code of + * write() correctly. This can result in character losses. A work-a-round + * can be compiled in with the following definition. This work-a-round + * should _NOT_ be part of an 'official' kernel release, of course! + */ +#undef FIX_WRITE_RETURN_CODE_PROBLEM +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM +static int write_blocking = 0; /* disabled by default */ +#endif + +/* + * Function prototypes + */ +static int mct_u232_startup (struct usb_serial *serial); +static void mct_u232_shutdown (struct usb_serial *serial); +static int mct_u232_open (struct usb_serial_port *port, + struct file *filp); +static void mct_u232_close (struct usb_serial_port *port, + struct file *filp); +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM +static int mct_u232_write (struct usb_serial_port *port, + int from_user, + const unsigned char *buf, + int count); +static void mct_u232_write_bulk_callback (struct urb *urb); +#endif +static void mct_u232_read_int_callback (struct urb *urb); +static void mct_u232_set_termios (struct usb_serial_port *port, + struct termios * old); +static int mct_u232_ioctl (struct usb_serial_port *port, + struct file * file, + unsigned int cmd, + unsigned long arg); +static void mct_u232_break_ctl (struct usb_serial_port *port, + int break_state ); + +/* + * All of the device info needed for the MCT USB-RS232 converter. + */ +static __u16 mct_u232_vendor_id = MCT_U232_VID; +static __u16 mct_u232_product_id = MCT_U232_PID; +static __u16 mct_u232_sitecom_id = MCT_U232_SITECOM_PID; +static __u16 mct_u232_du_h3sp_id = MCT_U232_DU_H3SP_PID; + +struct usb_serial_device_type mct_u232_device = { + name: "Magic Control Technology USB-RS232", + idVendor: &mct_u232_vendor_id, + idProduct: &mct_u232_product_id, + needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ + needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ + needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ + num_interrupt_in: 2, + num_bulk_in: 0, + num_bulk_out: 1, + num_ports: 1, + open: mct_u232_open, + close: mct_u232_close, +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM + write: mct_u232_write, + write_bulk_callback: mct_u232_write_bulk_callback, +#endif + read_int_callback: mct_u232_read_int_callback, + ioctl: mct_u232_ioctl, + set_termios: mct_u232_set_termios, + break_ctl: mct_u232_break_ctl, + startup: mct_u232_startup, + shutdown: mct_u232_shutdown, +}; + +struct usb_serial_device_type mct_u232_sitecom_device = { + name: "MCT/Sitecom USB-RS232", + idVendor: &mct_u232_vendor_id, + idProduct: &mct_u232_sitecom_id, + needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ + needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ + needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ + num_interrupt_in: 2, + num_bulk_in: 0, + num_bulk_out: 1, + num_ports: 1, + open: mct_u232_open, + close: mct_u232_close, +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM + write: mct_u232_write, + write_bulk_callback: mct_u232_write_bulk_callback, +#endif + read_int_callback: mct_u232_read_int_callback, + ioctl: mct_u232_ioctl, + set_termios: mct_u232_set_termios, + break_ctl: mct_u232_break_ctl, + startup: mct_u232_startup, + shutdown: mct_u232_shutdown, +}; + +struct usb_serial_device_type mct_u232_du_h3sp_device = { + name: "MCT/D-Link DU-H3SP USB BAY", + idVendor: &mct_u232_vendor_id, + idProduct: &mct_u232_du_h3sp_id, + needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ + needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ + needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ + num_interrupt_in: 2, + num_bulk_in: 0, + num_bulk_out: 1, + num_ports: 1, + open: mct_u232_open, + close: mct_u232_close, +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM + write: mct_u232_write, + write_bulk_callback: mct_u232_write_bulk_callback, +#endif + read_int_callback: mct_u232_read_int_callback, + ioctl: mct_u232_ioctl, + set_termios: mct_u232_set_termios, + break_ctl: mct_u232_break_ctl, + startup: mct_u232_startup, + shutdown: mct_u232_shutdown, +}; + + + + +struct mct_u232_private { + unsigned long control_state; /* Modem Line Setting (TIOCM) */ + unsigned char last_lcr; /* Line Control Register */ + unsigned char last_lsr; /* Line Status Register */ + unsigned char last_msr; /* Modem Status Register */ +}; + +/* + * Handle vendor specific USB requests + */ + +#define WDR_TIMEOUT (HZ * 5 ) /* default urb timeout */ + +static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value) { + if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID) { + switch (value) { + case 300: return 0x01; + case 600: return 0x02; /* this one not tested */ + case 1200: return 0x03; + case 2400: return 0x04; + case 4800: return 0x06; + case 9600: return 0x08; + case 19200: return 0x09; + case 38400: return 0x0a; + case 57600: return 0x0b; + case 115200: return 0x0c; + default: return -1; /* normally not reached */ + } + } + else + return MCT_U232_BAUD_RATE(value); +} + +static int mct_u232_set_baud_rate(struct usb_serial *serial, int value) +{ + unsigned int divisor; + int rc; + divisor = mct_u232_calculate_baud_rate(serial, value); + rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + MCT_U232_SET_BAUD_RATE_REQUEST, + MCT_U232_SET_REQUEST_TYPE, + 0, 0, &divisor, MCT_U232_SET_BAUD_RATE_SIZE, + WDR_TIMEOUT); + if (rc < 0) + err("Set BAUD RATE %d failed (error = %d)", value, rc); + dbg("set_baud_rate: value: %d, divisor: 0x%x", value, divisor); + return rc; +} /* mct_u232_set_baud_rate */ + +static int mct_u232_set_line_ctrl(struct usb_serial *serial, unsigned char lcr) +{ + int rc; + rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + MCT_U232_SET_LINE_CTRL_REQUEST, + MCT_U232_SET_REQUEST_TYPE, + 0, 0, &lcr, MCT_U232_SET_LINE_CTRL_SIZE, + WDR_TIMEOUT); + if (rc < 0) + err("Set LINE CTRL 0x%x failed (error = %d)", lcr, rc); + dbg("set_line_ctrl: 0x%x", lcr); + return rc; +} /* mct_u232_set_line_ctrl */ + +static int mct_u232_set_modem_ctrl(struct usb_serial *serial, + unsigned long control_state) +{ + int rc; + unsigned char mcr = MCT_U232_MCR_NONE; + + if (control_state & TIOCM_DTR) + mcr |= MCT_U232_MCR_DTR; + if (control_state & TIOCM_RTS) + mcr |= MCT_U232_MCR_RTS; + + rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + MCT_U232_SET_MODEM_CTRL_REQUEST, + MCT_U232_SET_REQUEST_TYPE, + 0, 0, &mcr, MCT_U232_SET_MODEM_CTRL_SIZE, + WDR_TIMEOUT); + if (rc < 0) + err("Set MODEM CTRL 0x%x failed (error = %d)", mcr, rc); + dbg("set_modem_ctrl: state=0x%lx ==> mcr=0x%x", control_state, mcr); + + return rc; +} /* mct_u232_set_modem_ctrl */ + +static int mct_u232_get_modem_stat(struct usb_serial *serial, unsigned char *msr) +{ + int rc; + rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), + MCT_U232_GET_MODEM_STAT_REQUEST, + MCT_U232_GET_REQUEST_TYPE, + 0, 0, msr, MCT_U232_GET_MODEM_STAT_SIZE, + WDR_TIMEOUT); + if (rc < 0) { + err("Get MODEM STATus failed (error = %d)", rc); + *msr = 0; + } + dbg("get_modem_stat: 0x%x", *msr); + return rc; +} /* mct_u232_get_modem_stat */ + +static void mct_u232_msr_to_state(unsigned long *control_state, unsigned char msr) +{ + /* Translate Control Line states */ + if (msr & MCT_U232_MSR_DSR) + *control_state |= TIOCM_DSR; + else + *control_state &= ~TIOCM_DSR; + if (msr & MCT_U232_MSR_CTS) + *control_state |= TIOCM_CTS; + else + *control_state &= ~TIOCM_CTS; + if (msr & MCT_U232_MSR_RI) + *control_state |= TIOCM_RI; + else + *control_state &= ~TIOCM_RI; + if (msr & MCT_U232_MSR_CD) + *control_state |= TIOCM_CD; + else + *control_state &= ~TIOCM_CD; + dbg("msr_to_state: msr=0x%x ==> state=0x%lx", msr, *control_state); +} /* mct_u232_msr_to_state */ + +/* + * Driver's tty interface functions + */ + +static int mct_u232_startup (struct usb_serial *serial) +{ + struct mct_u232_private *priv; + + /* allocate the private data structure */ + serial->port->private = kmalloc(sizeof(struct mct_u232_private), + GFP_KERNEL); + if (!serial->port->private) + return (-1); /* error */ + priv = (struct mct_u232_private *)serial->port->private; + /* set initial values for control structures */ + priv->control_state = 0; + priv->last_lsr = 0; + priv->last_msr = 0; + + init_waitqueue_head(&serial->port->write_wait); + + return (0); +} /* mct_u232_startup */ + + +static void mct_u232_shutdown (struct usb_serial *serial) +{ + int i; + + dbg (__FUNCTION__); + + /* stop reads and writes on all ports */ + for (i=0; i < serial->num_ports; ++i) { + while (serial->port[i].open_count > 0) { + mct_u232_close (&serial->port[i], NULL); + } + /* My special items, the standard routines free my urbs */ + if (serial->port[i].private) + kfree(serial->port[i].private); + } +} /* mct_u232_shutdown */ + +static int mct_u232_open (struct usb_serial_port *port, struct file *filp) +{ + unsigned long flags; + struct usb_serial *serial = port->serial; + struct mct_u232_private *priv = (struct mct_u232_private *)port->private; + + dbg(__FUNCTION__" port %d", port->number); + + spin_lock_irqsave (&port->port_lock, flags); + + ++port->open_count; + MOD_INC_USE_COUNT; + + if (!port->active) { + port->active = 1; + + /* Compensate for a hardware bug: although the Sitecom U232-P25 + * device reports a maximum output packet size of 32 bytes, + * it seems to be able to accept only 16 bytes (and that's what + * SniffUSB says too...) + */ + if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID) + port->bulk_out_size = 16; + + /* Do a defined restart: the normal serial device seems to + * always turn on DTR and RTS here, so do the same. I'm not + * sure if this is really necessary. But it should not harm + * either. + */ + if (port->tty->termios->c_cflag & CBAUD) + priv->control_state = TIOCM_DTR | TIOCM_RTS; + else + priv->control_state = 0; + mct_u232_set_modem_ctrl(serial, priv->control_state); + + priv->last_lcr = (MCT_U232_DATA_BITS_8 | + MCT_U232_PARITY_NONE | + MCT_U232_STOP_BITS_1); + mct_u232_set_line_ctrl(serial, priv->last_lcr); + + /* Read modem status and update control state */ + mct_u232_get_modem_stat(serial, &priv->last_msr); + mct_u232_msr_to_state(&priv->control_state, priv->last_msr); + + { + /* Puh, that's dirty */ + struct usb_serial_port *rport; + rport = &serial->port[1]; + rport->tty = port->tty; + rport->private = port->private; + port->read_urb = rport->interrupt_in_urb; + } + + port->read_urb->dev = port->serial->dev; + if (usb_submit_urb(port->read_urb)) + err("usb_submit_urb(read bulk) failed"); + + port->interrupt_in_urb->dev = port->serial->dev; + if (usb_submit_urb(port->interrupt_in_urb)) + err(" usb_submit_urb(read int) failed"); + + } + + spin_unlock_irqrestore (&port->port_lock, flags); + + return 0; +} /* mct_u232_open */ + + +static void mct_u232_close (struct usb_serial_port *port, struct file *filp) +{ + unsigned long flags; + + dbg(__FUNCTION__" port %d", port->number); + + spin_lock_irqsave (&port->port_lock, flags); + + --port->open_count; + MOD_DEC_USE_COUNT; + + if (port->open_count <= 0) { + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + /* wgg - do I need this? I think so. */ + usb_unlink_urb (port->interrupt_in_urb); + port->active = 0; + } + + spin_unlock_irqrestore (&port->port_lock, flags); + +} /* mct_u232_close */ + + +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM +/* The generic routines work fine otherwise */ + +static int mct_u232_write (struct usb_serial_port *port, int from_user, + const unsigned char *buf, int count) +{ + struct usb_serial *serial = port->serial; + unsigned long flags; + int result, bytes_sent, size; + + dbg(__FUNCTION__ " - port %d", port->number); + + if (count == 0) { + dbg(__FUNCTION__ " - write request of 0 bytes"); + return (0); + } + + /* only do something if we have a bulk out endpoint */ + if (!serial->num_bulk_out) + return(0);; + + /* another write is still pending? */ + if (port->write_urb->status == -EINPROGRESS) { + dbg (__FUNCTION__ " - already writing"); + return (0); + } + + bytes_sent = 0; + while (count > 0) { + + spin_lock_irqsave (&port->port_lock, flags); + + size = (count > port->bulk_out_size) ? port->bulk_out_size : count; + + usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf); + + if (from_user) { + copy_from_user(port->write_urb->transfer_buffer, buf, size); + } + else { + memcpy (port->write_urb->transfer_buffer, buf, size); + } + + /* set up our urb */ + FILL_BULK_URB(port->write_urb, serial->dev, + usb_sndbulkpipe(serial->dev, + port->bulk_out_endpointAddress), + port->write_urb->transfer_buffer, size, + ((serial->type->write_bulk_callback) ? + serial->type->write_bulk_callback : + mct_u232_write_bulk_callback), + port); + + /* send the data out the bulk port */ + result = usb_submit_urb(port->write_urb); + if (result) { + err(__FUNCTION__ + " - failed submitting write urb, error %d", result); + spin_unlock_irqrestore (&port->port_lock, flags); + return bytes_sent; + } + + spin_unlock_irqrestore (&port->port_lock, flags); + + bytes_sent += size; + if (write_blocking) + interruptible_sleep_on(&port->write_wait); + else + break; + + buf += size; + count -= size; + } + + return bytes_sent; +} /* mct_u232_write */ + +static void mct_u232_write_bulk_callback (struct urb *urb) +{ + struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct usb_serial *serial = port->serial; + struct tty_struct *tty = port->tty; + + dbg(__FUNCTION__ " - port %d", port->number); + + if (!serial) { + dbg(__FUNCTION__ " - bad serial pointer, exiting"); + return; + } + + if (urb->status) { + dbg(__FUNCTION__ " - nonzero write bulk status received: %d", + urb->status); + return; + } + + if (write_blocking) { + wake_up_interruptible(&port->write_wait); + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && + tty->ldisc.write_wakeup) + (tty->ldisc.write_wakeup)(tty); + wake_up_interruptible(&tty->write_wait); + + } else { + /* from generic_write_bulk_callback */ + queue_task(&port->tqueue, &tq_immediate); + mark_bh(IMMEDIATE_BH); + } + + return; +} /* mct_u232_write_bulk_callback */ +#endif + +static void mct_u232_read_int_callback (struct urb *urb) +{ + struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct mct_u232_private *priv = (struct mct_u232_private *)port->private; + struct usb_serial *serial = port->serial; + struct tty_struct *tty; + unsigned char *data = urb->transfer_buffer; + + dbg(__FUNCTION__ " - port %d", port->number); + + /* The urb might have been killed. */ + if (urb->status) { + dbg(__FUNCTION__ " - nonzero read bulk status received: %d", + urb->status); + return; + } + if (!serial) { + dbg(__FUNCTION__ " - bad serial pointer, exiting"); + return; + } + + usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); + + /* + * Work-a-round: handle the 'usual' bulk-in pipe here + */ + if (urb->transfer_buffer_length > 2) { + int i; + tty = port->tty; + if (urb->actual_length) { + for (i = 0; i < urb->actual_length ; ++i) { + tty_insert_flip_char(tty, data[i], 0); + } + tty_flip_buffer_push(tty); + } + /* INT urbs are automatically re-submitted */ + return; + } + + /* + * The interrupt-in pipe signals exceptional conditions (modem line + * signal changes and errors). data[0] holds MSR, data[1] holds LSR. + */ + priv->last_msr = data[MCT_U232_MSR_INDEX]; + + /* Record Control Line states */ + mct_u232_msr_to_state(&priv->control_state, priv->last_msr); + +#if 0 + /* Not yet handled. See belin_sa.c for further information */ + /* Now to report any errors */ + priv->last_lsr = data[MCT_U232_LSR_INDEX]; + /* + * fill in the flip buffer here, but I do not know the relation + * to the current/next receive buffer or characters. I need + * to look in to this before committing any code. + */ + if (priv->last_lsr & MCT_U232_LSR_ERR) { + tty = port->tty; + /* Overrun Error */ + if (priv->last_lsr & MCT_U232_LSR_OE) { + } + /* Parity Error */ + if (priv->last_lsr & MCT_U232_LSR_PE) { + } + /* Framing Error */ + if (priv->last_lsr & MCT_U232_LSR_FE) { + } + /* Break Indicator */ + if (priv->last_lsr & MCT_U232_LSR_BI) { + } + } +#endif + + /* INT urbs are automatically re-submitted */ +} /* mct_u232_read_int_callback */ + + +static void mct_u232_set_termios (struct usb_serial_port *port, + struct termios *old_termios) +{ + struct usb_serial *serial = port->serial; + struct mct_u232_private *priv = (struct mct_u232_private *)port->private; + unsigned int iflag = port->tty->termios->c_iflag; + unsigned int old_iflag = old_termios->c_iflag; + unsigned int cflag = port->tty->termios->c_cflag; + unsigned int old_cflag = old_termios->c_cflag; + + /* + * Update baud rate + */ + if( (cflag & CBAUD) != (old_cflag & CBAUD) ) { + /* reassert DTR and (maybe) RTS on transition from B0 */ + if( (old_cflag & CBAUD) == B0 ) { + dbg(__FUNCTION__ ": baud was B0"); + priv->control_state |= TIOCM_DTR; + /* don't set RTS if using hardware flow control */ + if (!(old_cflag & CRTSCTS)) { + priv->control_state |= TIOCM_RTS; + } + mct_u232_set_modem_ctrl(serial, priv->control_state); + } + + switch(cflag & CBAUD) { + case B0: /* handled below */ + break; + case B300: mct_u232_set_baud_rate(serial, 300); + break; + case B600: mct_u232_set_baud_rate(serial, 600); + break; + case B1200: mct_u232_set_baud_rate(serial, 1200); + break; + case B2400: mct_u232_set_baud_rate(serial, 2400); + break; + case B4800: mct_u232_set_baud_rate(serial, 4800); + break; + case B9600: mct_u232_set_baud_rate(serial, 9600); + break; + case B19200: mct_u232_set_baud_rate(serial, 19200); + break; + case B38400: mct_u232_set_baud_rate(serial, 38400); + break; + case B57600: mct_u232_set_baud_rate(serial, 57600); + break; + case B115200: mct_u232_set_baud_rate(serial, 115200); + break; + default: err("MCT USB-RS232 converter: unsupported baudrate request, using default of 9600"); + mct_u232_set_baud_rate(serial, 9600); break; + } + if ((cflag & CBAUD) == B0 ) { + dbg(__FUNCTION__ ": baud is B0"); + /* Drop RTS and DTR */ + priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); + mct_u232_set_modem_ctrl(serial, priv->control_state); + } + } + + /* + * Update line control register (LCR) + */ + if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD)) + || (cflag & CSIZE) != (old_cflag & CSIZE) + || (cflag & CSTOPB) != (old_cflag & CSTOPB) ) { + + + priv->last_lcr = 0; + + /* set the parity */ + if (cflag & PARENB) + priv->last_lcr |= (cflag & PARODD) ? + MCT_U232_PARITY_ODD : MCT_U232_PARITY_EVEN; + else + priv->last_lcr |= MCT_U232_PARITY_NONE; + + /* set the number of data bits */ + switch (cflag & CSIZE) { + case CS5: + priv->last_lcr |= MCT_U232_DATA_BITS_5; break; + case CS6: + priv->last_lcr |= MCT_U232_DATA_BITS_6; break; + case CS7: + priv->last_lcr |= MCT_U232_DATA_BITS_7; break; + case CS8: + priv->last_lcr |= MCT_U232_DATA_BITS_8; break; + default: + err("CSIZE was not CS5-CS8, using default of 8"); + priv->last_lcr |= MCT_U232_DATA_BITS_8; + break; + } + + /* set the number of stop bits */ + priv->last_lcr |= (cflag & CSTOPB) ? + MCT_U232_STOP_BITS_2 : MCT_U232_STOP_BITS_1; + + mct_u232_set_line_ctrl(serial, priv->last_lcr); + } + + /* + * Set flow control: well, I do not really now how to handle DTR/RTS. + * Just do what we have seen with SniffUSB on Win98. + */ + if( (iflag & IXOFF) != (old_iflag & IXOFF) + || (iflag & IXON) != (old_iflag & IXON) + || (cflag & CRTSCTS) != (old_cflag & CRTSCTS) ) { + + /* Drop DTR/RTS if no flow control otherwise assert */ + if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS) ) + priv->control_state |= TIOCM_DTR | TIOCM_RTS; + else + priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); + mct_u232_set_modem_ctrl(serial, priv->control_state); + } +} /* mct_u232_set_termios */ + + +static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state ) +{ + struct usb_serial *serial = port->serial; + struct mct_u232_private *priv = (struct mct_u232_private *)port->private; + unsigned char lcr = priv->last_lcr; + + dbg (__FUNCTION__ "state=%d", break_state); + + if (break_state) + lcr |= MCT_U232_SET_BREAK; + + mct_u232_set_line_ctrl(serial, lcr); +} /* mct_u232_break_ctl */ + + +static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, + unsigned int cmd, unsigned long arg) +{ + struct usb_serial *serial = port->serial; + struct mct_u232_private *priv = (struct mct_u232_private *)port->private; + int ret, mask; + + dbg (__FUNCTION__ "cmd=0x%x", cmd); + + /* Based on code from acm.c and others */ + switch (cmd) { + case TIOCMGET: + return put_user(priv->control_state, (unsigned long *) arg); + break; + + case TIOCMSET: /* Turns on and off the lines as specified by the mask */ + case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */ + case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */ + if ((ret = get_user(mask, (unsigned long *) arg))) return ret; + + if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) { + /* RTS needs set */ + if( ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) || + (cmd == TIOCMBIS) ) + priv->control_state |= TIOCM_RTS; + else + priv->control_state &= ~TIOCM_RTS; + } + + if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) { + /* DTR needs set */ + if( ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) || + (cmd == TIOCMBIS) ) + priv->control_state |= TIOCM_DTR; + else + priv->control_state &= ~TIOCM_DTR; + } + mct_u232_set_modem_ctrl(serial, priv->control_state); + break; + + case TIOCMIWAIT: + /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ + /* TODO */ + return( 0 ); + + case TIOCGICOUNT: + /* return count of modemline transitions */ + /* TODO */ + return 0; + + default: + dbg(__FUNCTION__ ": arg not supported - 0x%04x",cmd); + return(-ENOIOCTLCMD); + break; + } + return 0; +} /* mct_u232_ioctl */ + + +static int __init mct_u232_init (void) +{ + usb_serial_register (&mct_u232_device); + usb_serial_register (&mct_u232_sitecom_device); + usb_serial_register (&mct_u232_du_h3sp_device); + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; +} + + +static void __exit mct_u232_exit (void) +{ + usb_serial_deregister (&mct_u232_device); + usb_serial_deregister (&mct_u232_sitecom_device); + usb_serial_deregister (&mct_u232_du_h3sp_device); +} + + +module_init (mct_u232_init); +module_exit(mct_u232_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +#ifdef FIX_WRITE_RETURN_CODE_PROBLEM +MODULE_PARM(write_blocking, "i"); +MODULE_PARM_DESC(write_blocking, + "The write function will block to write out all data"); +#endif + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/mct_u232.h linux.20p9/drivers/usb/serial/mct_u232.h --- linux.vanilla/drivers/usb/serial/mct_u232.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/drivers/usb/serial/mct_u232.h Wed Jul 4 16:03:59 2001 @@ -0,0 +1,369 @@ +/* + * Definitions for MCT (Magic Control Technology) USB-RS232 Converter Driver + * + * Copyright (C) 2000 Wolfgang Grandegger (wolfgang@ces.ch) + * + * 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 driver is for the device MCT USB-RS232 Converter (25 pin, Model No. + * U232-P25) from Magic Control Technology Corp. (there is also a 9 pin + * Model No. U232-P9). See http://www.mct.com.tw/p_u232.html for further + * information. The properties of this device are listed at the end of this + * file. This device is available from various distributors. I know Hana, + * http://www.hana.de and D-Link, http://www.dlink.com/products/usb/dsbs25. + * + * All of the information about the device was acquired by using SniffUSB + * on Windows98. The technical details of the reverse engineering are + * summarized at the end of this file. + */ + +#ifndef __LINUX_USB_SERIAL_MCT_U232_H +#define __LINUX_USB_SERIAL_MCT_U232_H + +#define MCT_U232_VID 0x0711 /* Vendor Id */ +#define MCT_U232_PID 0x0210 /* Original MCT Product Id */ + +/* U232-P25, Sitecom */ +#define MCT_U232_SITECOM_PID 0x0230 /* Sitecom Product Id */ + +/* DU-H3SP USB BAY hub */ + +#define MCT_U232_DU_H3SP_PID 0x0200 /* D-Link DU-H3SP USB BAY */ + +/* + * Vendor Request Interface + */ +#define MCT_U232_SET_REQUEST_TYPE 0x40 +#define MCT_U232_GET_REQUEST_TYPE 0xc0 + +#define MCT_U232_GET_MODEM_STAT_REQUEST 2 /* Get Modem Status Register (MSR) */ +#define MCT_U232_GET_MODEM_STAT_SIZE 1 + +#define MCT_U232_GET_LINE_CTRL_REQUEST 6 /* Get Line Control Register (LCR) */ +#define MCT_U232_GET_LINE_CTRL_SIZE 1 /* ... not used by this driver */ + +#define MCT_U232_SET_BAUD_RATE_REQUEST 5 /* Set Baud Rate Divisor */ +#define MCT_U232_SET_BAUD_RATE_SIZE 4 + +#define MCT_U232_SET_LINE_CTRL_REQUEST 7 /* Set Line Control Register (LCR) */ +#define MCT_U232_SET_LINE_CTRL_SIZE 1 + +#define MCT_U232_SET_MODEM_CTRL_REQUEST 10 /* Set Modem Control Register (MCR) */ +#define MCT_U232_SET_MODEM_CTRL_SIZE 1 + +/* + * Baud rate (divisor) + */ +#define MCT_U232_BAUD_RATE(b) (115200/b) + +/* + * Line Control Register (LCR) + */ +#define MCT_U232_SET_BREAK 0x40 + +#define MCT_U232_PARITY_SPACE 0x38 +#define MCT_U232_PARITY_MARK 0x28 +#define MCT_U232_PARITY_EVEN 0x18 +#define MCT_U232_PARITY_ODD 0x08 +#define MCT_U232_PARITY_NONE 0x00 + +#define MCT_U232_DATA_BITS_5 0x00 +#define MCT_U232_DATA_BITS_6 0x01 +#define MCT_U232_DATA_BITS_7 0x02 +#define MCT_U232_DATA_BITS_8 0x03 + +#define MCT_U232_STOP_BITS_2 0x04 +#define MCT_U232_STOP_BITS_1 0x00 + +/* + * Modem Control Register (MCR) + */ +#define MCT_U232_MCR_NONE 0x8 /* Deactivate DTR and RTS */ +#define MCT_U232_MCR_RTS 0xa /* Activate RTS */ +#define MCT_U232_MCR_DTR 0x9 /* Activate DTR */ + +/* + * Modem Status Register (MSR) + */ +#define MCT_U232_MSR_INDEX 0x0 /* data[index] */ +#define MCT_U232_MSR_CD 0x80 /* Current CD */ +#define MCT_U232_MSR_RI 0x40 /* Current RI */ +#define MCT_U232_MSR_DSR 0x20 /* Current DSR */ +#define MCT_U232_MSR_CTS 0x10 /* Current CTS */ +#define MCT_U232_MSR_DCD 0x08 /* Delta CD */ +#define MCT_U232_MSR_DRI 0x04 /* Delta RI */ +#define MCT_U232_MSR_DDSR 0x02 /* Delta DSR */ +#define MCT_U232_MSR_DCTS 0x01 /* Delta CTS */ + +/* + * Line Status Register (LSR) + */ +#define MCT_U232_LSR_INDEX 1 /* data[index] */ +#define MCT_U232_LSR_ERR 0x80 /* OE | PE | FE | BI */ +#define MCT_U232_LSR_TEMT 0x40 /* transmit register empty */ +#define MCT_U232_LSR_THRE 0x20 /* transmit holding register empty */ +#define MCT_U232_LSR_BI 0x10 /* break indicator */ +#define MCT_U232_LSR_FE 0x08 /* framing error */ +#define MCT_U232_LSR_OE 0x02 /* overrun error */ +#define MCT_U232_LSR_PE 0x04 /* parity error */ +#define MCT_U232_LSR_OE 0x02 /* overrun error */ +#define MCT_U232_LSR_DR 0x01 /* receive data ready */ + + +/* ----------------------------------------------------------------------------- + * Technical Specification reverse engineered with SniffUSB on Windows98 + * ===================================================================== + * + * The technical details of the device have been acquired be using "SniffUSB" + * and the vendor-supplied device driver (version 2.3A) under Windows98. To + * identify the USB vendor-specific requests and to assign them to terminal + * settings (flow control, baud rate, etc.) the program "SerialSettings" from + * William G. Greathouse has been proven to be very useful. I also used the + * Win98 "HyperTerminal" and "usb-robot" on Linux for testing. The results and + * observations are summarized below: + * + * The USB requests seem to be directly mapped to the registers of a 8250, + * 16450 or 16550 UART. The FreeBSD handbook (appendix F.4 "Input/Output + * devices") contains a comprehensive description of UARTs and its registers. + * The bit descriptions are actually taken from there. + * + * + * Baud rate (divisor) + * ------------------- + * + * BmRequestType: 0x4 (0100 0000B) + * bRequest: 0x5 + * wValue: 0x0 + * wIndex: 0x0 + * wLength: 0x4 + * Data: divisor = 115200 / baud_rate + * + * + * Line Control Register (LCR) + * --------------------------- + * + * BmRequestType: 0x4 (0100 0000B) 0xc (1100 0000B) + * bRequest: 0x7 0x6 + * wValue: 0x0 + * wIndex: 0x0 + * wLength: 0x1 + * Data: LCR (see below) + * + * Bit 7: Divisor Latch Access Bit (DLAB). When set, access to the data + * transmit/receive register (THR/RBR) and the Interrupt Enable Register + * (IER) is disabled. Any access to these ports is now redirected to the + * Divisor Latch Registers. Setting this bit, loading the Divisor + * Registers, and clearing DLAB should be done with interrupts disabled. + * Bit 6: Set Break. When set to "1", the transmitter begins to transmit + * continuous Spacing until this bit is set to "0". This overrides any + * bits of characters that are being transmitted. + * Bit 5: Stick Parity. When parity is enabled, setting this bit causes parity + * to always be "1" or "0", based on the value of Bit 4. + * Bit 4: Even Parity Select (EPS). When parity is enabled and Bit 5 is "0", + * setting this bit causes even parity to be transmitted and expected. + * Otherwise, odd parity is used. + * Bit 3: Parity Enable (PEN). When set to "1", a parity bit is inserted + * between the last bit of the data and the Stop Bit. The UART will also + * expect parity to be present in the received data. + * Bit 2: Number of Stop Bits (STB). If set to "1" and using 5-bit data words, + * 1.5 Stop Bits are transmitted and expected in each data word. For + * 6, 7 and 8-bit data words, 2 Stop Bits are transmitted and expected. + * When this bit is set to "0", one Stop Bit is used on each data word. + * Bit 1: Word Length Select Bit #1 (WLSB1) + * Bit 0: Word Length Select Bit #0 (WLSB0) + * Together these bits specify the number of bits in each data word. + * 1 0 Word Length + * 0 0 5 Data Bits + * 0 1 6 Data Bits + * 1 0 7 Data Bits + * 1 1 8 Data Bits + * + * SniffUSB observations: Bit 7 seems not to be used. There seem to be two bugs + * in the Win98 driver: the break does not work (bit 6 is not asserted) and the + * sticky parity bit is not cleared when set once. The LCR can also be read + * back with USB request 6 but this has never been observed with SniffUSB. + * + * + * Modem Control Register (MCR) + * ---------------------------- + * + * BmRequestType: 0x4 (0100 0000B) + * bRequest: 0xa + * wValue: 0x0 + * wIndex: 0x0 + * wLength: 0x1 + * Data: MCR (Bit 4..7, see below) + * + * Bit 7: Reserved, always 0. + * Bit 6: Reserved, always 0. + * Bit 5: Reserved, always 0. + * Bit 4: Loop-Back Enable. When set to "1", the UART transmitter and receiver + * are internally connected together to allow diagnostic operations. In + * addition, the UART modem control outputs are connected to the UART + * modem control inputs. CTS is connected to RTS, DTR is connected to + * DSR, OUT1 is connected to RI, and OUT 2 is connected to DCD. + * Bit 3: OUT 2. An auxiliary output that the host processor may set high or + * low. In the IBM PC serial adapter (and most clones), OUT 2 is used + * to tri-state (disable) the interrupt signal from the + * 8250/16450/16550 UART. + * Bit 2: OUT 1. An auxiliary output that the host processor may set high or + * low. This output is not used on the IBM PC serial adapter. + * Bit 1: Request to Send (RTS). When set to "1", the output of the UART -RTS + * line is Low (Active). + * Bit 0: Data Terminal Ready (DTR). When set to "1", the output of the UART + * -DTR line is Low (Active). + * + * SniffUSB observations: Bit 2 and 4 seem not to be used but bit 3 has been + * seen _always_ set. + * + * + * Modem Status Register (MSR) + * --------------------------- + * + * BmRequestType: 0xc (1100 0000B) + * bRequest: 0x2 + * wValue: 0x0 + * wIndex: 0x0 + * wLength: 0x1 + * Data: MSR (see below) + * + * Bit 7: Data Carrier Detect (CD). Reflects the state of the DCD line on the + * UART. + * Bit 6: Ring Indicator (RI). Reflects the state of the RI line on the UART. + * Bit 5: Data Set Ready (DSR). Reflects the state of the DSR line on the UART. + * Bit 4: Clear To Send (CTS). Reflects the state of the CTS line on the UART. + * Bit 3: Delta Data Carrier Detect (DDCD). Set to "1" if the -DCD line has + * changed state one more more times since the last time the MSR was + * read by the host. + * Bit 2: Trailing Edge Ring Indicator (TERI). Set to "1" if the -RI line has + * had a low to high transition since the last time the MSR was read by + * the host. + * Bit 1: Delta Data Set Ready (DDSR). Set to "1" if the -DSR line has changed + * state one more more times since the last time the MSR was read by the + * host. + * Bit 0: Delta Clear To Send (DCTS). Set to "1" if the -CTS line has changed + * state one more times since the last time the MSR was read by the + * host. + * + * SniffUSB observations: the MSR is also returned as first byte on the + * interrupt-in endpoint 0x83 to signal changes of modem status lines. The USB + * request to read MSR cannot be applied during normal device operation. + * + * + * Line Status Register (LSR) + * -------------------------- + * + * Bit 7 Error in Receiver FIFO. On the 8250/16450 UART, this bit is zero. + * This bit is set to "1" when any of the bytes in the FIFO have one or + * more of the following error conditions: PE, FE, or BI. + * Bit 6 Transmitter Empty (TEMT). When set to "1", there are no words + * remaining in the transmit FIFO or the transmit shift register. The + * transmitter is completely idle. + * Bit 5 Transmitter Holding Register Empty (THRE). When set to "1", the FIFO + * (or holding register) now has room for at least one additional word + * to transmit. The transmitter may still be transmitting when this bit + * is set to "1". + * Bit 4 Break Interrupt (BI). The receiver has detected a Break signal. + * Bit 3 Framing Error (FE). A Start Bit was detected but the Stop Bit did not + * appear at the expected time. The received word is probably garbled. + * Bit 2 Parity Error (PE). The parity bit was incorrect for the word received. + * Bit 1 Overrun Error (OE). A new word was received and there was no room in + * the receive buffer. The newly-arrived word in the shift register is + * discarded. On 8250/16450 UARTs, the word in the holding register is + * discarded and the newly- arrived word is put in the holding register. + * Bit 0 Data Ready (DR). One or more words are in the receive FIFO that the + * host may read. A word must be completely received and moved from the + * shift register into the FIFO (or holding register for 8250/16450 + * designs) before this bit is set. + * + * SniffUSB observations: the LSR is returned as second byte on the interrupt-in + * endpoint 0x83 to signal error conditions. Such errors have been seen with + * minicom/zmodem transfers (CRC errors). + * + * + * Flow control + * ------------ + * + * SniffUSB observations: no flow control specific requests have been realized + * apart from DTR/RTS settings. Both signals are dropped for no flow control + * but asserted for hardware or software flow control. + * + * + * Endpoint usage + * -------------- + * + * SniffUSB observations: the bulk-out endpoint 0x1 and interrupt-in endpoint + * 0x81 is used to transmit and receive characters. The second interrupt-in + * endpoint 0x83 signals exceptional conditions like modem line changes and + * errors. The first byte returned is the MSR and the second byte the LSR. + * + * + * Other observations + * ------------------ + * + * Queued bulk transfers like used in visor.c did not work. + * + * + * Properties of the USB device used (as found in /var/log/messages) + * ----------------------------------------------------------------- + * + * Manufacturer: MCT Corporation. + * Product: USB-232 Interfact Controller + * SerialNumber: U2S22050 + * + * Length = 18 + * DescriptorType = 01 + * USB version = 1.00 + * Vendor:Product = 0711:0210 + * MaxPacketSize0 = 8 + * NumConfigurations = 1 + * Device version = 1.02 + * Device Class:SubClass:Protocol = 00:00:00 + * Per-interface classes + * Configuration: + * bLength = 9 + * bDescriptorType = 02 + * wTotalLength = 0027 + * bNumInterfaces = 01 + * bConfigurationValue = 01 + * iConfiguration = 00 + * bmAttributes = c0 + * MaxPower = 100mA + * + * Interface: 0 + * Alternate Setting: 0 + * bLength = 9 + * bDescriptorType = 04 + * bInterfaceNumber = 00 + * bAlternateSetting = 00 + * bNumEndpoints = 03 + * bInterface Class:SubClass:Protocol = 00:00:00 + * iInterface = 00 + * Endpoint: + * bLength = 7 + * bDescriptorType = 05 + * bEndpointAddress = 81 (in) + * bmAttributes = 03 (Interrupt) + * wMaxPacketSize = 0040 + * bInterval = 02 + * Endpoint: + * bLength = 7 + * bDescriptorType = 05 + * bEndpointAddress = 01 (out) + * bmAttributes = 02 (Bulk) + * wMaxPacketSize = 0040 + * bInterval = 00 + * Endpoint: + * bLength = 7 + * bDescriptorType = 05 + * bEndpointAddress = 83 (in) + * bmAttributes = 03 (Interrupt) + * wMaxPacketSize = 0002 + * bInterval = 02 + */ + +#endif /* __LINUX_USB_SERIAL_MCT_U232_H */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/omninet.c linux.20p9/drivers/usb/serial/omninet.c --- linux.vanilla/drivers/usb/serial/omninet.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/omninet.c Wed Aug 8 22:24:15 2001 @@ -9,7 +9,14 @@ * See Documentation/usb/usb-serial.txt for more information on using this driver * * Please report both successes and troubles to the author at omninet@kroah.com + * + * (04/08/2001) gb + * Identify version on module load. * + * (10/05/2000) gkh + * Fixed bug with urb->dev not being set properly, now that the usb + * core needs it. + * * (08/28/2000) gkh * Added locks for SMP safeness. * Fixed MOD_INC and MOD_DEC logic and the ability to open a port more @@ -31,25 +38,29 @@ #include #include #include +#include #include #include -#include #include #include - +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define isalpha(x) ( ( x > 96 && x < 123) || ( x > 64 && x < 91) || (x > 47 && x < 58) ) - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include - #include "usb-serial.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Anonymous" +#define DRIVER_DESC "USB ZyXEL omni.net LCD PLUS Driver" + #define ZYXEL_VENDOR_ID 0x0586 #define ZYXEL_OMNINET_ID 0x1000 @@ -129,6 +140,7 @@ struct usb_serial_port *wport; struct omninet_data *od; unsigned long flags; + int result; if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; @@ -149,7 +161,7 @@ od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL ); if( !od ) { - err(__FUNCTION__"- kmalloc(%d) failed.", sizeof(struct omninet_data)); + err(__FUNCTION__"- kmalloc(%Zd) failed.", sizeof(struct omninet_data)); --port->open_count; port->active = 0; spin_unlock_irqrestore (&port->port_lock, flags); @@ -162,8 +174,13 @@ wport->tty = port->tty; /* Start reading from the device */ - if (usb_submit_urb(port->read_urb)) - dbg(__FUNCTION__" - read bulk (%p) failed", port->read_urb); + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, + omninet_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) + err(__FUNCTION__ " - failed submitting read urb, error %d", result); } spin_unlock_irqrestore (&port->port_lock, flags); @@ -222,6 +239,7 @@ struct omninet_header *header = (struct omninet_header *) &data[0]; int i; + int result; // dbg("omninet_read_bulk_callback"); @@ -235,8 +253,7 @@ return; } -#ifdef DEBUG - if(header->oh_xxx != 0x30) { + if ((debug) && (header->oh_xxx != 0x30)) { if (urb->actual_length) { printk (KERN_DEBUG __FILE__ ": omninet_read %d: ", header->oh_len); for (i = 0; i < (header->oh_len + OMNINET_HEADERLEN); i++) { @@ -245,7 +262,6 @@ printk ("\n"); } } -#endif if (urb->actual_length && header->oh_len) { for (i = 0; i < header->oh_len; i++) { @@ -255,8 +271,13 @@ } /* Continue trying to always read */ - if (usb_submit_urb(urb)) - dbg(__FUNCTION__" - failed resubmitting read urb"); + FILL_BULK_URB(urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + urb->transfer_buffer, urb->transfer_buffer_length, + omninet_read_bulk_callback, port); + result = usb_submit_urb(urb); + if (result) + err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); return; } @@ -270,11 +291,7 @@ struct omninet_header *header = (struct omninet_header *) wport->write_urb->transfer_buffer; unsigned long flags; -/* -#ifdef DEBUG - int i; -#endif -*/ + int result; // dbg("omninet_write port %d", port->number); @@ -282,18 +299,6 @@ dbg(__FUNCTION__" - write request of 0 bytes"); return (0); } -/* -#ifdef DEBUG - printk (KERN_DEBUG __FILE__ ": omninet_write %d: ", count); - for (i = 0; i < count; i++) { - if( isalpha(buf[i]) ) - printk ("%c ", buf[i]); - else - printk ("%.2x ", buf[i]); - } - printk ("\n"); -#endif -*/ if (wport->write_urb->status == -EINPROGRESS) { dbg (__FUNCTION__" - already writing"); return (0); @@ -310,6 +315,7 @@ memcpy (wport->write_urb->transfer_buffer + OMNINET_DATAOFFSET, buf, count); } + usb_serial_debug_data (__FILE__, __FUNCTION__, count, wport->write_urb->transfer_buffer); header->oh_seq = od->od_outseq++; header->oh_len = count; @@ -319,8 +325,10 @@ /* send the data out the bulk port, always 64 bytes */ wport->write_urb->transfer_buffer_length = 64; - if (usb_submit_urb(wport->write_urb)) { - dbg(__FUNCTION__" - usb_submit_urb(write bulk) failed"); + wport->write_urb->dev = serial->dev; + result = usb_submit_urb(wport->write_urb); + if (result) { + err(__FUNCTION__ " - failed submitting write urb, error %d", result); spin_unlock_irqrestore (&port->port_lock, flags); return 0; } @@ -392,6 +400,7 @@ static int __init omninet_init (void) { usb_serial_register (&zyxel_omninet_device); + info(DRIVER_VERSION ":" DRIVER_DESC); return 0; } @@ -405,3 +414,9 @@ module_init(omninet_init); module_exit(omninet_exit); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/usb-serial.h linux.20p9/drivers/usb/serial/usb-serial.h --- linux.vanilla/drivers/usb/serial/usb-serial.h Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/usb-serial.h Thu Jul 26 18:13:28 2001 @@ -220,15 +220,24 @@ static inline void usb_serial_debug_data (const char *file, const char *function, int size, const unsigned char *data) { -#ifdef CONFIG_USB_SERIAL_DEBUG int i; + + if (!debug) + return; + printk (KERN_DEBUG "%s: %s - length = %d, data = ", file, function, size); for (i = 0; i < size; ++i) { printk ("%.2x ", data[i]); } printk ("\n"); -#endif } + +/* Use our own dbg macro */ +#undef dbg +#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0) + + + #endif /* ifdef __LINUX_USB_SERIAL_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/usbserial.c linux.20p9/drivers/usb/serial/usbserial.c --- linux.vanilla/drivers/usb/serial/usbserial.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/usbserial.c Wed Aug 8 22:24:15 2001 @@ -14,6 +14,9 @@ * based on a driver by Brad Keryan) * * See Documentation/usb/usb-serial.txt for more information on using this driver + * + * (04/08/2001) gb + * Identify version on module load. * * 2001_02_05 gkh * Fixed buffer overflows bug with the generic serial driver. Thanks to @@ -264,20 +267,23 @@ #include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include - -/* Module information */ -MODULE_AUTHOR("Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/"); -MODULE_DESCRIPTION("USB Serial Driver"); #include "usb-serial.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/" +#define DRIVER_DESC "USB Serial Driver core" + #define MAX(a,b) (((a)>(b))?(a):(b)) /* function prototypes for a "generic" type serial converter (no flow control, not all endpoints needed) */ @@ -296,11 +302,6 @@ #ifdef CONFIG_USB_SERIAL_GENERIC static __u16 vendor = 0x05f9; static __u16 product = 0xffff; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); /* All of the device info needed for the Generic Serial Converter */ static struct usb_serial_device_type generic_device = { @@ -346,6 +347,7 @@ static struct termios * serial_termios_locked[SERIAL_TTY_MINORS]; static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */ + LIST_HEAD(usb_serial_driver_list); @@ -808,8 +810,6 @@ spin_lock_irqsave (&port->port_lock, flags); count = (count > port->bulk_out_size) ? port->bulk_out_size : count; - usb_serial_debug_data (__FILE__, __FUNCTION__, count, buf); - if (from_user) { copy_from_user(port->write_urb->transfer_buffer, buf, count); } @@ -817,6 +817,8 @@ memcpy (port->write_urb->transfer_buffer, buf, count); } + usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); + /* set up our urb */ FILL_BULK_URB(port->write_urb, serial->dev, usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress), @@ -1194,6 +1196,7 @@ /* we don't use num_ports here cauz some devices have more endpoint pairs than ports */ max_endpoints = MAX(num_bulk_in, num_bulk_out); max_endpoints = MAX(max_endpoints, num_interrupt_in); + max_endpoints = MAX(max_endpoints, serial->num_ports); dbg (__FUNCTION__ " - setting up %d port structures for this device", max_endpoints); for (i = 0; i < max_endpoints; ++i) { port = &serial->port[i]; @@ -1371,8 +1374,9 @@ err("usb_register failed for the usb-serial driver. Error number %d", result); return -1; } - - + + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -1437,3 +1441,17 @@ EXPORT_SYMBOL(ezusb_set_reset); #endif + +/* Module information */ +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + +MODULE_PARM(vendor, "i"); +MODULE_PARM_DESC(vendor, "User specified USB idVendor"); + +MODULE_PARM(product, "i"); +MODULE_PARM_DESC(product, "User specified USB idProduct"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/visor.c linux.20p9/drivers/usb/serial/visor.c --- linux.vanilla/drivers/usb/serial/visor.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/serial/visor.c Wed Aug 8 22:24:15 2001 @@ -10,6 +10,9 @@ * (at your option) any later version. * * See Documentation/usb/usb-serial.txt for more information on using this driver + * + * (04/08/2001) gb + * Identify version on module load. * * (01/21/2000) gkh * Added write_room and chars_in_buffer, as they were previously using the @@ -89,18 +92,24 @@ #include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" - #include "visor.h" +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Greg Kroah-Hartman " +#define DRIVER_DESC "USB HandSpring Visor driver" + #define MIN(a,b) (((a)<(b))?(a):(b)) /* function prototypes for a handspring visor */ @@ -149,7 +158,7 @@ #define NUM_URBS 24 -#define URB_TRANSFER_BUFFER_SIZE 64 +#define URB_TRANSFER_BUFFER_SIZE 768 static struct urb *write_urb_pool[NUM_URBS]; static spinlock_t write_urb_pool_lock; static int bytes_in; @@ -644,7 +653,9 @@ continue; } } - + + info(DRIVER_VERSION ":" DRIVER_DESC); + return 0; } @@ -677,5 +688,9 @@ module_init(visor_init); module_exit(visor_exit); -MODULE_AUTHOR("Greg Kroah-Hartman "); -MODULE_DESCRIPTION("USB HandSpring Visor driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/whiteheat.c linux.20p9/drivers/usb/serial/whiteheat.c --- linux.vanilla/drivers/usb/serial/whiteheat.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/whiteheat.c Wed Aug 8 22:24:04 2001 @@ -1,7 +1,7 @@ /* * USB ConnectTech WhiteHEAT driver * - * Copyright (C) 1999, 2000 + * Copyright (C) 1999 - 2001 * Greg Kroah-Hartman (greg@kroah.com) * * This program is free software; you can redistribute it and/or modify @@ -10,7 +10,27 @@ * (at your option) any later version. * * See Documentation/usb/usb-serial.txt for more information on using this driver + * + * (04/08/2001) gb + * Identify version on module load. + * + * 2001_Mar_19 gkh + * Fixed MOD_INC and MOD_DEC logic, the ability to open a port more + * than once, and the got the proper usb_device_id table entries so + * the driver works again. + * + * (10/05/2000) gkh + * Fixed bug with urb->dev not being set properly, now that the usb + * core needs it. * + * (10/03/2000) smd + * firmware is improved to guard against crap sent to device + * firmware now replies CMD_FAILURE on bad things + * read_callback fix you provided for private info struct + * command_finished now indicates success or fail + * setup_port struct now packed to avoid gcc padding + * firmware uses 1 based port numbering, driver now handles that + * * (09/11/2000) gkh * Removed DEBUG #ifdefs with call to usb_serial_debug_data * @@ -42,25 +62,30 @@ #include #include #include +#include #include #include -#include #include #include +#include #ifdef CONFIG_USB_SERIAL_DEBUG - #define DEBUG + static int debug = 1; #else - #undef DEBUG + static int debug; #endif -#include #include "usb-serial.h" - #include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */ - #include "whiteheat.h" /* WhiteHEAT specific commands */ +/* + * Version Information + */ +#define DRIVER_VERSION "v1.0.0" +#define DRIVER_AUTHOR "Greg Kroah-Hartman " +#define DRIVER_DESC "USB ConnectTech WhiteHEAT driver" + #define CONNECT_TECH_VENDOR_ID 0x0710 #define CONNECT_TECH_FAKE_WHITE_HEAT_ID 0x0001 #define CONNECT_TECH_WHITE_HEAT_ID 0x8001 @@ -148,8 +173,11 @@ static void command_port_read_callback (struct urb *urb) { - struct whiteheat_private *info = (struct whiteheat_private *)urb->context; + struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + struct whiteheat_private *info; unsigned char *data = urb->transfer_buffer; + int result; dbg (__FUNCTION__); @@ -158,15 +186,39 @@ return; } + if (!serial) { + dbg(__FUNCTION__ " - bad serial pointer, exiting"); + return; + } + usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); + info = (struct whiteheat_private *)port->private; + if (!info) { + dbg (__FUNCTION__ " - info is NULL, exiting."); + return; + } + /* right now, if the command is COMMAND_COMPLETE, just flip the bit saying the command finished */ /* in the future we're going to have to pay attention to the actual command that completed */ if (data[0] == WHITEHEAT_CMD_COMPLETE) { - info->command_finished = TRUE; + info->command_finished = WHITEHEAT_CMD_COMPLETE; + wake_up_interruptible(&info->wait_command); } - return; + if (data[0] == WHITEHEAT_CMD_FAILURE) { + info->command_finished = WHITEHEAT_CMD_FAILURE; + wake_up_interruptible(&info->wait_command); + } + + /* Continue trying to always read */ + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, + command_port_read_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) + dbg(__FUNCTION__ " - failed resubmitting read urb, error %d", result); } @@ -187,6 +239,7 @@ transfer_buffer[0] = command; memcpy (&transfer_buffer[1], data, datasize); port->write_urb->transfer_buffer_length = datasize + 1; + port->write_urb->dev = serial->dev; if (usb_submit_urb (port->write_urb)) { dbg (__FUNCTION__" - submit urb failed"); return -1; @@ -203,6 +256,16 @@ return -1; } + if (info->command_finished == WHITEHEAT_CMD_FAILURE) { + dbg (__FUNCTION__ " - command failed."); + return -1; + } + + if (info->command_finished == WHITEHEAT_CMD_COMPLETE) { + dbg (__FUNCTION__ " - command completed."); + return 0; + } + return 0; } @@ -212,41 +275,48 @@ struct whiteheat_min_set open_command; struct usb_serial_port *command_port; struct whiteheat_private *info; + int result; dbg(__FUNCTION__" - port %d", port->number); - if (port->active) { - dbg (__FUNCTION__ " - device already open"); - return -EINVAL; - } - port->active = 1; - - /* set up some stuff for our command port */ - command_port = &port->serial->port[COMMAND_PORT]; - if (command_port->private == NULL) { - info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL); - if (info == NULL) { - err(__FUNCTION__ " - out of memory"); - return -ENOMEM; + ++port->open_count; + MOD_INC_USE_COUNT; + + if (!port->active) { + port->active = 1; + + /* set up some stuff for our command port */ + command_port = &port->serial->port[COMMAND_PORT]; + if (command_port->private == NULL) { + info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL); + if (info == NULL) { + err(__FUNCTION__ " - out of memory"); + return -ENOMEM; + } + + init_waitqueue_head(&info->wait_command); + command_port->private = info; + command_port->write_urb->complete = command_port_write_callback; + command_port->read_urb->complete = command_port_read_callback; + command_port->read_urb->dev = port->serial->dev; + command_port->tty = port->tty; /* need this to "fake" our our sanity check macros */ + usb_submit_urb (command_port->read_urb); } - init_waitqueue_head(&info->wait_command); - command_port->private = info; - command_port->write_urb->complete = command_port_write_callback; - command_port->read_urb->complete = command_port_read_callback; - usb_submit_urb (command_port->read_urb); - } - - /* Start reading from the device */ - if (usb_submit_urb(port->read_urb)) - dbg(__FUNCTION__ " - usb_submit_urb(read bulk) failed"); - - /* send an open port command */ - open_command.port = port->number - port->serial->minor; - whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command)); - - /* Need to do device specific setup here (control lines, baud rate, etc.) */ - /* FIXME!!! */ + /* Start reading from the device */ + port->read_urb->dev = port->serial->dev; + result = usb_submit_urb(port->read_urb); + if (result) + err(__FUNCTION__ " - failed submitting read urb, error %d", result); + + /* send an open port command */ + /* firmware uses 1 based port numbering */ + open_command.port = port->number - port->serial->minor + 1; + whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command)); + + /* Need to do device specific setup here (control lines, baud rate, etc.) */ + /* FIXME!!! */ + } dbg(__FUNCTION__ " - exit"); @@ -260,17 +330,23 @@ dbg(__FUNCTION__ " - port %d", port->number); - /* send a close command to the port */ - close_command.port = port->number - port->serial->minor; - whiteheat_send_cmd (port->serial, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command)); - - /* Need to change the control lines here */ - /* FIXME */ - - /* shutdown our bulk reads and writes */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - port->active = 0; + --port->open_count; + + if (port->open_count <= 0) { + /* send a close command to the port */ + /* firmware uses 1 based port numbering */ + close_command.port = port->number - port->serial->minor + 1; + whiteheat_send_cmd (port->serial, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command)); + + /* Need to change the control lines here */ + /* FIXME */ + + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + port->active = 0; + } + MOD_DEC_USE_COUNT; } @@ -303,6 +379,10 @@ return; } + /* set the port number */ + /* firmware uses 1 based port numbering */ + port_settings.port = port->number + 1; + /* get the byte size */ switch (cflag & CSIZE) { case CS5: port_settings.bits = 5; break; @@ -337,10 +417,10 @@ else port_settings.hflow = 0; dbg(__FUNCTION__ " - hardware flow control = %s %s %s %s", - (port_settings.hflow | WHITEHEAT_CTS_FLOW) ? "CTS" : "", - (port_settings.hflow | WHITEHEAT_RTS_FLOW) ? "RTS" : "", - (port_settings.hflow | WHITEHEAT_DSR_FLOW) ? "DSR" : "", - (port_settings.hflow | WHITEHEAT_DTR_FLOW) ? "DTR" : ""); + (port_settings.hflow & WHITEHEAT_CTS_FLOW) ? "CTS" : "", + (port_settings.hflow & WHITEHEAT_RTS_FLOW) ? "RTS" : "", + (port_settings.hflow & WHITEHEAT_DSR_FLOW) ? "DSR" : "", + (port_settings.hflow & WHITEHEAT_DTR_FLOW) ? "DTR" : ""); /* determine software flow control */ if (I_IXOFF(port->tty)) @@ -464,9 +544,17 @@ static void whiteheat_shutdown (struct usb_serial *serial) { struct usb_serial_port *command_port; + int i; dbg(__FUNCTION__); + /* stop reads and writes on all ports */ + for (i=0; i < serial->num_ports; ++i) { + while (serial->port[i].open_count > 0) { + whiteheat_close (&serial->port[i], NULL); + } + } + /* free up our private data for our command port */ command_port = &serial->port[COMMAND_PORT]; if (command_port->private != NULL) { @@ -485,7 +573,8 @@ struct whiteheat_rdb_set rdb_command; /* send a set rts command to the port */ - rdb_command.port = port->number - port->serial->minor; + /* firmware uses 1 based port numbering */ + rdb_command.port = port->number - port->serial->minor + 1; rdb_command.state = state; whiteheat_send_cmd (port->serial, command, (__u8 *)&rdb_command, sizeof(rdb_command)); @@ -514,6 +603,7 @@ { usb_serial_register (&whiteheat_fake_device); usb_serial_register (&whiteheat_device); + info(DRIVER_VERSION " " DRIVER_DESC); return 0; } @@ -528,5 +618,9 @@ module_init(whiteheat_init); module_exit(whiteheat_exit); -MODULE_AUTHOR("Greg Kroah-Hartman "); -MODULE_DESCRIPTION("USB ConnectTech WhiteHEAT driver"); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); + +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug enabled or not"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/whiteheat.h linux.20p9/drivers/usb/serial/whiteheat.h --- linux.vanilla/drivers/usb/serial/whiteheat.h Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/whiteheat.h Wed Jul 4 16:03:59 2001 @@ -37,6 +37,7 @@ #define WHITEHEAT_ECHO 14 /* send data to the indicated IN endpoint */ #define WHITEHEAT_DO_TEST 15 /* perform the specified test */ #define WHITEHEAT_CMD_COMPLETE 16 /* reply for certain commands */ +#define WHITEHEAT_CMD_FAILURE 17 /* reply for failed commands */ /* Data for the WHITEHEAT_SETUP_PORT command */ #define WHITEHEAT_CTS_FLOW 0x08 @@ -64,7 +65,7 @@ * RTS (0x80) (RTS off/on when receiver fills/empties) * DTR (0x02) (DTR off/on when receiver fills/empties) */ __u8 lloop; /* local loopback 0 or 1, default 0 */ -}; +} __attribute__ ((packed)); /* data for WHITEHEAT_SET_RTS, WHITEHEAT_SET_DTR, and WHITEHEAT_SET_BREAK commands */ struct whiteheat_rdb_set { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/serial/whiteheat_fw.h linux.20p9/drivers/usb/serial/whiteheat_fw.h --- linux.vanilla/drivers/usb/serial/whiteheat_fw.h Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/serial/whiteheat_fw.h Wed Jul 4 16:03:59 2001 @@ -47,159 +47,154 @@ }; static const struct whiteheat_hex_record whiteheat_firmware[] = { -{ 0x0000, 3, {0x02, 0x93, 0xa9} }, +{ 0x0000, 3, {0x02, 0x95, 0x09} }, { 0x0003, 3, {0x02, 0x13, 0x12} }, -{ 0x000b, 3, {0x02, 0x0a, 0x80} }, -{ 0x0033, 3, {0x02, 0x08, 0x15} }, +{ 0x000b, 3, {0x02, 0x0a, 0x91} }, +{ 0x0033, 3, {0x02, 0x08, 0x1b} }, { 0x0043, 3, {0x02, 0x0a, 0x00} }, -{ 0x005b, 3, {0x02, 0x82, 0x31} }, +{ 0x005b, 3, {0x02, 0x1a, 0xd2} }, { 0x0370, 16, {0x90, 0x7f, 0xe9, 0xe0, 0x70, 0x03, 0x02, 0x04, 0x73, 0x14, 0x70, 0x03, 0x02, 0x04, 0xe7, 0x24} }, -{ 0x0380, 16, {0xfe, 0x70, 0x03, 0x02, 0x05, 0x45, 0x24, 0xfb, 0x70, 0x03, 0x02, 0x04, 0x64, 0x14, 0x70, 0x03} }, +{ 0x0380, 16, {0xfe, 0x70, 0x03, 0x02, 0x05, 0x4f, 0x24, 0xfb, 0x70, 0x03, 0x02, 0x04, 0x64, 0x14, 0x70, 0x03} }, { 0x0390, 16, {0x02, 0x04, 0x52, 0x14, 0x70, 0x03, 0x02, 0x04, 0x3a, 0x14, 0x70, 0x03, 0x02, 0x04, 0x49, 0x24} }, -{ 0x03a0, 16, {0x05, 0x60, 0x03, 0x02, 0x05, 0x94, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60} }, +{ 0x03a0, 16, {0x05, 0x60, 0x03, 0x02, 0x05, 0x9e, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60} }, { 0x03b0, 16, {0x36, 0x24, 0x02, 0x70, 0x7b, 0x74, 0x12, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5} }, -{ 0x03c0, 16, {0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x09, 0x7b, 0xea, 0x49, 0x60, 0x0d} }, -{ 0x03d0, 16, {0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xb4} }, -{ 0x03e0, 16, {0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x09, 0x3a, 0xea} }, -{ 0x03f0, 16, {0x49, 0x60, 0x33, 0x12, 0x9b, 0x72, 0xf5, 0x4b, 0x90, 0x7f, 0xee, 0xe0, 0xff, 0xe5, 0x4b, 0xd3} }, +{ 0x03c0, 16, {0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x09, 0x81, 0xea, 0x49, 0x60, 0x0d} }, +{ 0x03d0, 16, {0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xb4} }, +{ 0x03e0, 16, {0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x09, 0x40, 0xea} }, +{ 0x03f0, 16, {0x49, 0x60, 0x33, 0x12, 0x9f, 0x48, 0xf5, 0x4b, 0x90, 0x7f, 0xee, 0xe0, 0xff, 0xe5, 0x4b, 0xd3} }, { 0x0400, 16, {0x9f, 0x40, 0x03, 0xe0, 0xf5, 0x4b, 0xe5, 0x4b, 0xd3, 0x94, 0x40, 0x40, 0x03, 0x75, 0x4b, 0x40} }, -{ 0x0410, 16, {0xae, 0x02, 0xaf, 0x01, 0x7c, 0x7f, 0x7d, 0x00, 0xab, 0x4b, 0x12, 0x8d, 0xd9, 0x90, 0x7f, 0xb5} }, -{ 0x0420, 16, {0xe5, 0x4b, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0x9b} }, -{ 0x0430, 16, {0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0x00, 0xe5, 0x21, 0xf0} }, -{ 0x0440, 16, {0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x21, 0x02} }, -{ 0x0450, 16, {0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x31, 0xd2, 0x02, 0x43, 0x88, 0x10, 0xd2, 0xeb, 0xd2} }, -{ 0x0460, 16, {0xa8, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0x00, 0xe5, 0x31, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0} }, -{ 0x0470, 16, {0x02, 0x05, 0x9b, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02} }, +{ 0x0410, 16, {0xae, 0x02, 0xaf, 0x01, 0x7c, 0x7f, 0x7d, 0x00, 0xab, 0x4b, 0x12, 0x8e, 0x81, 0x90, 0x7f, 0xb5} }, +{ 0x0420, 16, {0xe5, 0x4b, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0xa5} }, +{ 0x0430, 16, {0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0x00, 0xe5, 0x21, 0xf0} }, +{ 0x0440, 16, {0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x21, 0x02} }, +{ 0x0450, 16, {0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x31, 0xd2, 0x02, 0x43, 0x88, 0x10, 0xd2, 0xeb, 0xd2} }, +{ 0x0460, 16, {0xa8, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0x00, 0xe5, 0x31, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0} }, +{ 0x0470, 16, {0x02, 0x05, 0xa5, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02} }, { 0x0480, 16, {0x70, 0x5b, 0xa2, 0x00, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x05, 0xe4, 0x33, 0x4f, 0x90} }, -{ 0x0490, 16, {0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0x9b, 0xe4} }, -{ 0x04a0, 16, {0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0x9b, 0x90} }, +{ 0x0490, 16, {0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0xa5, 0xe4} }, +{ 0x04a0, 16, {0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0xa5, 0x90} }, { 0x04b0, 16, {0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25} }, { 0x04c0, 16, {0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0x01, 0x90, 0x7f, 0x00} }, -{ 0x04d0, 16, {0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xb4} }, -{ 0x04e0, 16, {0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24} }, -{ 0x04f0, 16, {0x02, 0x60, 0x03, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x00, 0x02} }, -{ 0x0500, 16, {0x05, 0x9b, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0x9b, 0x90, 0x7f, 0xea, 0xe0} }, -{ 0x0510, 16, {0x70, 0x2a, 0x90, 0x7f, 0xec, 0xe0, 0xff, 0xf4, 0x54, 0x80, 0xfe, 0xc4, 0x54, 0x0f, 0xfe, 0xef} }, -{ 0x0520, 16, {0x54, 0x07, 0xfd, 0x2e, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4} }, -{ 0x0530, 16, {0xf0, 0x90, 0x7f, 0xd7, 0xed, 0xf0, 0xef, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0} }, -{ 0x0540, 16, {0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70} }, -{ 0x0550, 16, {0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x00, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0} }, -{ 0x0560, 16, {0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4} }, -{ 0x0570, 16, {0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5} }, -{ 0x0580, 16, {0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44} }, -{ 0x0590, 16, {0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44} }, -{ 0x05a0, 2, {0x02, 0xf0} }, -{ 0x05a2, 1, {0x22} }, -{ 0x05a3, 16, {0x75, 0x47, 0xff, 0x75, 0x46, 0xff, 0x75, 0x45, 0x0f, 0x75, 0x44, 0x00, 0xd2, 0x03, 0xc2, 0x06} }, -{ 0x05b3, 16, {0xc2, 0x02, 0xc2, 0x00, 0xc2, 0x05, 0xc2, 0x01, 0x90, 0x03, 0x00, 0x74, 0x19, 0xf0, 0xe4, 0x90} }, -{ 0x05c3, 16, {0x01, 0xbc, 0xf0, 0xc2, 0x04, 0x90, 0x01, 0xc0, 0xf0, 0xa3, 0xf0, 0xc2, 0xaf, 0xc2, 0xa8, 0x12} }, -{ 0x05d3, 16, {0x0b, 0x8d, 0xe4, 0x90, 0x02, 0xaf, 0xf0, 0x90, 0x01, 0x00, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3} }, -{ 0x05e3, 16, {0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0x7e} }, -{ 0x05f3, 16, {0x01, 0x7f, 0x00, 0x12, 0x19, 0xc1, 0x75, 0x49, 0x12, 0x75, 0x4a, 0x0a, 0x90, 0x01, 0x0b, 0xe0} }, -{ 0x0603, 16, {0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83} }, -{ 0x0613, 16, {0xef, 0xf0, 0x90, 0x01, 0x0c, 0xe0, 0x44, 0x80, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70} }, -{ 0x0623, 16, {0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x01, 0x0d, 0xe0, 0xff, 0x05} }, -{ 0x0633, 16, {0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0} }, -{ 0x0643, 16, {0x90, 0x01, 0x0e, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14} }, -{ 0x0653, 16, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x12, 0x0a, 0xe4, 0x93, 0xff, 0x74, 0x01, 0x93, 0x90} }, -{ 0x0663, 16, {0x01, 0x1c, 0xcf, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x01, 0x1c, 0xe0, 0xff, 0xa3, 0xe0, 0xfe, 0xef} }, -{ 0x0673, 16, {0x6e, 0xff, 0x90, 0x01, 0x1c, 0xf0, 0xa3, 0xe0, 0x6f, 0xff, 0xf0, 0x90, 0x01, 0x1c, 0xe0, 0x6f} }, -{ 0x0683, 16, {0xf0, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe4, 0xfc, 0xfd, 0x75, 0x4f, 0x10, 0x75, 0x50, 0x02, 0x75} }, -{ 0x0693, 16, {0x51, 0x12, 0x75, 0x52, 0xac, 0x12, 0x90, 0x15, 0x75, 0x49, 0x12, 0x75, 0x4a, 0xb2, 0x90, 0x01} }, -{ 0x06a3, 16, {0x0d, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82} }, -{ 0x06b3, 16, {0x8c, 0x83, 0xef, 0xf0, 0x90, 0x01, 0x0e, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70} }, -{ 0x06c3, 16, {0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x7f, 0x92, 0xe0, 0xff, 0xc4} }, -{ 0x06d3, 16, {0x54, 0x0f, 0x24, 0x41, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14} }, -{ 0x06e3, 16, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x05, 0x4a, 0xe5, 0x4a, 0xae, 0x49, 0x70, 0x02, 0x05, 0x49} }, -{ 0x06f3, 16, {0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe4, 0xf0, 0x75, 0x82, 0x10, 0x75, 0x83, 0x01, 0xe0, 0xfc, 0xa3} }, -{ 0x0703, 16, {0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x90, 0x01, 0x18, 0x12, 0x9d, 0x25, 0x7e, 0x01} }, -{ 0x0713, 16, {0x7f, 0x18, 0x12, 0x85, 0x08, 0x90, 0x01, 0x18, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe} }, -{ 0x0723, 16, {0xa3, 0xe0, 0xff, 0x75, 0x4f, 0x0a, 0x75, 0x50, 0x06, 0x75, 0x51, 0x12, 0x75, 0x52, 0xb8, 0x12} }, -{ 0x0733, 16, {0x90, 0x15, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x53, 0x91, 0xef} }, -{ 0x0743, 16, {0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x1f, 0xf0, 0xd2, 0xaf} }, -{ 0x0753, 16, {0x20, 0x01, 0x2e, 0x20, 0x01, 0x2b, 0xa2, 0x03, 0x92, 0x07, 0x12, 0x09, 0xca, 0x75, 0x43, 0x50} }, -{ 0x0763, 16, {0x75, 0x42, 0x6d, 0x75, 0x41, 0x33, 0x75, 0x40, 0x00, 0x20, 0x01, 0xe4, 0x7f, 0xff, 0x7e, 0xff} }, -{ 0x0773, 16, {0x7d, 0xff, 0x7c, 0xff, 0x78, 0x40, 0x12, 0x9d, 0x0e, 0xec, 0x4d, 0x4e, 0x4f, 0x60, 0xd1, 0x80} }, -{ 0x0783, 16, {0xe8, 0x30, 0x01, 0x05, 0x12, 0x03, 0x70, 0xc2, 0x01, 0x30, 0x06, 0x0d, 0x12, 0x0a, 0xed, 0x50} }, -{ 0x0793, 16, {0x06, 0x12, 0x0b, 0x00, 0x12, 0x0a, 0xf2, 0xc2, 0x06, 0x12, 0x92, 0x38, 0x90, 0x01, 0xbd, 0xe0} }, -{ 0x07a3, 16, {0x60, 0x10, 0x7e, 0x7b, 0x7f, 0x40, 0x12, 0x8e, 0xc1, 0xe4, 0x90, 0x01, 0xbd, 0xf0, 0x90, 0x7f} }, -{ 0x07b3, 16, {0xd3, 0xf0, 0x90, 0x02, 0xaf, 0xe0, 0xb4, 0x0f, 0x03, 0x12, 0x95, 0x30, 0x12, 0x99, 0xcc, 0xe4} }, -{ 0x07c3, 16, {0xff, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xfe, 0x90, 0x01, 0xbc} }, -{ 0x07d3, 16, {0xe0, 0x5e, 0x60, 0x14, 0x74, 0x27, 0x2f, 0xf8, 0xe6, 0xd3, 0x94, 0x0a, 0x40, 0x04, 0x7e, 0x01} }, -{ 0x07e3, 16, {0x80, 0x02, 0x7e, 0x00, 0x8e, 0x48, 0x80, 0x03, 0x75, 0x48, 0x01, 0x74, 0x68, 0x2f, 0xf5, 0x82} }, -{ 0x07f3, 16, {0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe5, 0x48, 0xf0, 0x0f, 0xbf, 0x04, 0xc5, 0xe5, 0x2b, 0xd3, 0x94} }, -{ 0x0803, 16, {0x0a, 0x40, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0x90, 0x20, 0x6c, 0xef, 0xf0, 0x02, 0x07} }, -{ 0x0813, 1, {0x84} }, -{ 0x0814, 1, {0x22} }, -{ 0x0815, 4, {0x53, 0xd8, 0xef, 0x32} }, -{ 0x0819, 16, {0xe4, 0x90, 0x7f, 0x9c, 0xf0, 0x7f, 0x0a, 0xfe, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0x74, 0x89} }, -{ 0x0829, 16, {0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xcf, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x09, 0x23, 0x90, 0x7f} }, -{ 0x0839, 16, {0x96, 0xe0, 0x54, 0xfe, 0xf0, 0x7f, 0x0a, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x7f, 0x02, 0x7d, 0xff} }, -{ 0x0849, 16, {0x12, 0x81, 0xe0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x02} }, -{ 0x0859, 16, {0xf0, 0xe0, 0x54, 0x7f, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0} }, -{ 0x0869, 16, {0x44, 0x40, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0, 0x54, 0xbf} }, -{ 0x0879, 16, {0xf0, 0x7f, 0x32, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x40, 0xf0, 0x7f} }, -{ 0x0889, 7, {0x32, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x22} }, -{ 0x0890, 16, {0x90, 0x7f, 0x96, 0xe0, 0x54, 0xfd, 0xf0, 0xe0, 0x44, 0x80, 0xf0, 0x7f, 0x0a, 0x7e, 0x00, 0x12} }, -{ 0x08a0, 16, {0x09, 0x23, 0x7f, 0x02, 0xe4, 0xfd, 0x12, 0x81, 0xe0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23} }, -{ 0x08b0, 16, {0x90, 0x7f, 0x96, 0xe0, 0x54, 0xbf, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f} }, -{ 0x08c0, 16, {0x96, 0xe0, 0x44, 0x04, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0} }, -{ 0x08d0, 16, {0x54, 0xf7, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x01} }, -{ 0x08e0, 12, {0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x12, 0x0b, 0x00, 0x22} }, -{ 0x08ec, 16, {0x90, 0x11, 0xfc, 0xe4, 0x93, 0x70, 0x2f, 0x90, 0x7f, 0x93, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x94} }, -{ 0x08fc, 16, {0x74, 0x3c, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc6, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90, 0x7f} }, -{ 0x090c, 16, {0x9d, 0x74, 0x02, 0xf0, 0x90, 0x7f, 0xe2, 0x74, 0x12, 0xf0, 0x12, 0x08, 0x19, 0x75, 0x82, 0xfc} }, -{ 0x091c, 7, {0x75, 0x83, 0x11, 0x74, 0xff, 0xf0, 0x22} }, -{ 0x0923, 16, {0x8e, 0x58, 0x8f, 0x59, 0xe5, 0x59, 0x15, 0x59, 0xae, 0x58, 0x70, 0x02, 0x15, 0x58, 0x4e, 0x60} }, -{ 0x0933, 7, {0x05, 0x12, 0x09, 0xef, 0x80, 0xee, 0x22} }, -{ 0x093a, 2, {0x8f, 0x4c} }, -{ 0x093c, 16, {0xe4, 0xf5, 0x4d, 0x75, 0x4e, 0xff, 0x75, 0x4f, 0x12, 0x75, 0x50, 0x6a, 0xab, 0x4e, 0xaa, 0x4f} }, -{ 0x094c, 16, {0xa9, 0x50, 0x90, 0x00, 0x01, 0x12, 0x9b, 0x8b, 0xb4, 0x03, 0x1d, 0xaf, 0x4d, 0x05, 0x4d, 0xef} }, -{ 0x095c, 16, {0xb5, 0x4c, 0x01, 0x22, 0x12, 0x9b, 0x72, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75} }, -{ 0x096c, 14, {0x4e, 0xff, 0xf5, 0x4f, 0x89, 0x50, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00} }, -{ 0x097a, 1, {0x22} }, -{ 0x097b, 16, {0xe4, 0xfe, 0x75, 0x4e, 0xff, 0x75, 0x4f, 0x12, 0x75, 0x50, 0x12, 0xab, 0x4e, 0xaa, 0x4f, 0xa9} }, -{ 0x098b, 16, {0x50, 0x90, 0x00, 0x01, 0x12, 0x9b, 0x8b, 0x64, 0x02, 0x70, 0x2d, 0xad, 0x06, 0x0e, 0xed, 0xb5} }, -{ 0x099b, 16, {0x07, 0x01, 0x22, 0x90, 0x00, 0x02, 0x12, 0x9b, 0xe4, 0x85, 0xf0, 0x4c, 0xf5, 0x4d, 0x62, 0x4c} }, -{ 0x09ab, 16, {0xe5, 0x4c, 0x62, 0x4d, 0xe5, 0x4d, 0x62, 0x4c, 0x29, 0xfd, 0xe5, 0x4c, 0x3a, 0xa9, 0x05, 0x75} }, -{ 0x09bb, 14, {0x4e, 0xff, 0xf5, 0x4f, 0x89, 0x50, 0x80, 0xc3, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00} }, -{ 0x09c9, 1, {0x22} }, -{ 0x09ca, 16, {0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x07, 0x04, 0xe0, 0x44} }, -{ 0x09da, 16, {0x02, 0xf0, 0x7f, 0xd0, 0x7e, 0x07, 0x12, 0x09, 0x23, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0} }, -{ 0x09ea, 5, {0xe0, 0x44, 0x04, 0xf0, 0x22} }, -{ 0x09ef, 16, {0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9} }, -{ 0x09ff, 1, {0x22} }, +{ 0x04d0, 16, {0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xb4} }, +{ 0x04e0, 16, {0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24} }, +{ 0x04f0, 16, {0x02, 0x60, 0x03, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x00, 0x02} }, +{ 0x0500, 16, {0x05, 0xa5, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x05, 0xa5, 0x90, 0x7f, 0xea, 0xe0} }, +{ 0x0510, 16, {0x70, 0x34, 0x90, 0x7f, 0xec, 0xe0, 0xff, 0x54, 0x07, 0xfe, 0xf5, 0x4b, 0xef, 0x30, 0xe7, 0x03} }, +{ 0x0520, 16, {0x43, 0x4b, 0x10, 0x90, 0x7f, 0xd7, 0xe5, 0x4b, 0xf0, 0xe5, 0x4b, 0x44, 0x20, 0xf0, 0xef, 0xf4} }, +{ 0x0530, 16, {0x54, 0x80, 0xfd, 0xc4, 0x54, 0x0f, 0x2e, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f} }, +{ 0x0540, 16, {0xf5, 0x83, 0xe4, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90} }, +{ 0x0550, 16, {0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4} }, +{ 0x0560, 16, {0x01, 0x04, 0xd2, 0x00, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90} }, +{ 0x0570, 16, {0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f} }, +{ 0x0580, 16, {0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83} }, +{ 0x0590, 16, {0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f} }, +{ 0x05a0, 12, {0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0} }, +{ 0x05ac, 1, {0x22} }, +{ 0x05ad, 16, {0x75, 0x47, 0xff, 0x75, 0x46, 0xff, 0x75, 0x45, 0x0f, 0x75, 0x44, 0x00, 0xd2, 0x03, 0xc2, 0x06} }, +{ 0x05bd, 16, {0xc2, 0x02, 0xc2, 0x00, 0xc2, 0x05, 0xc2, 0x01, 0x90, 0x03, 0x00, 0x74, 0x19, 0xf0, 0xe4, 0x90} }, +{ 0x05cd, 16, {0x01, 0xbc, 0xf0, 0xc2, 0x04, 0x90, 0x01, 0xc0, 0xf0, 0xa3, 0xf0, 0xc2, 0xaf, 0xc2, 0xa8, 0x12} }, +{ 0x05dd, 16, {0x0b, 0x8d, 0xe4, 0x90, 0x02, 0xaf, 0xf0, 0x90, 0x01, 0x00, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3} }, +{ 0x05ed, 16, {0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0x7e} }, +{ 0x05fd, 16, {0x01, 0x7f, 0x00, 0x12, 0x10, 0x2c, 0x75, 0x49, 0x12, 0x75, 0x4a, 0x0a, 0x90, 0x01, 0x0b, 0xe0} }, +{ 0x060d, 16, {0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83} }, +{ 0x061d, 16, {0xef, 0xf0, 0x90, 0x01, 0x0c, 0xe0, 0x44, 0x80, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70} }, +{ 0x062d, 16, {0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x01, 0x0d, 0xe0, 0xff, 0x05} }, +{ 0x063d, 16, {0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0} }, +{ 0x064d, 16, {0x90, 0x01, 0x0e, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14} }, +{ 0x065d, 16, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x12, 0x0a, 0xe4, 0x93, 0xff, 0x74, 0x01, 0x93, 0x90} }, +{ 0x066d, 16, {0x01, 0x1c, 0xcf, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x01, 0x1c, 0xe0, 0xff, 0xa3, 0xe0, 0xfe, 0xef} }, +{ 0x067d, 16, {0x6e, 0xff, 0x90, 0x01, 0x1c, 0xf0, 0xa3, 0xe0, 0x6f, 0xff, 0xf0, 0x90, 0x01, 0x1c, 0xe0, 0x6f} }, +{ 0x068d, 16, {0xf0, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe4, 0xfc, 0xfd, 0x75, 0x4f, 0x10, 0x75, 0x50, 0x02, 0x75} }, +{ 0x069d, 16, {0x51, 0x12, 0x75, 0x52, 0xac, 0x12, 0x91, 0x7a, 0x75, 0x49, 0x12, 0x75, 0x4a, 0xb2, 0x90, 0x01} }, +{ 0x06ad, 16, {0x0d, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14, 0xf5, 0x82} }, +{ 0x06bd, 16, {0x8c, 0x83, 0xef, 0xf0, 0x90, 0x01, 0x0e, 0xe0, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70} }, +{ 0x06cd, 16, {0x02, 0x05, 0x49, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x90, 0x7f, 0x92, 0xe0, 0xff, 0xc4} }, +{ 0x06dd, 16, {0x54, 0x0f, 0x24, 0x41, 0xff, 0x05, 0x4a, 0xe5, 0x4a, 0xac, 0x49, 0x70, 0x02, 0x05, 0x49, 0x14} }, +{ 0x06ed, 16, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x05, 0x4a, 0xe5, 0x4a, 0xae, 0x49, 0x70, 0x02, 0x05, 0x49} }, +{ 0x06fd, 16, {0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe4, 0xf0, 0x75, 0x82, 0x10, 0x75, 0x83, 0x01, 0xe0, 0xfc, 0xa3} }, +{ 0x070d, 16, {0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x90, 0x01, 0x18, 0x12, 0xa0, 0xfb, 0x7e, 0x01} }, +{ 0x071d, 16, {0x7f, 0x18, 0x12, 0x85, 0x2f, 0x90, 0x01, 0x18, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe} }, +{ 0x072d, 16, {0xa3, 0xe0, 0xff, 0x75, 0x4f, 0x0a, 0x75, 0x50, 0x06, 0x75, 0x51, 0x12, 0x75, 0x52, 0xb8, 0x12} }, +{ 0x073d, 16, {0x91, 0x7a, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x53, 0x91, 0xef} }, +{ 0x074d, 16, {0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x1f, 0xf0, 0xd2, 0xaf} }, +{ 0x075d, 16, {0x20, 0x01, 0x2e, 0x20, 0x01, 0x2b, 0xa2, 0x03, 0x92, 0x07, 0x12, 0x09, 0xd0, 0x75, 0x43, 0x50} }, +{ 0x076d, 16, {0x75, 0x42, 0x6d, 0x75, 0x41, 0x33, 0x75, 0x40, 0x00, 0x20, 0x01, 0xe4, 0x7f, 0xff, 0x7e, 0xff} }, +{ 0x077d, 16, {0x7d, 0xff, 0x7c, 0xff, 0x78, 0x40, 0x12, 0xa0, 0xe4, 0xec, 0x4d, 0x4e, 0x4f, 0x60, 0xd1, 0x80} }, +{ 0x078d, 16, {0xe8, 0x30, 0x01, 0x05, 0x12, 0x03, 0x70, 0xc2, 0x01, 0x30, 0x06, 0x0d, 0x12, 0x09, 0xf5, 0x50} }, +{ 0x079d, 16, {0x06, 0x12, 0x0b, 0x00, 0x12, 0x09, 0xfa, 0xc2, 0x06, 0x12, 0x93, 0x98, 0x90, 0x01, 0xbd, 0xe0} }, +{ 0x07ad, 16, {0x60, 0x0c, 0x12, 0x8f, 0x55, 0xe4, 0x90, 0x01, 0xbd, 0xf0, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x02} }, +{ 0x07bd, 16, {0xaf, 0xe0, 0xb4, 0x0f, 0x03, 0x12, 0x96, 0xe2, 0x12, 0x9d, 0xa2, 0xe4, 0xff, 0x74, 0x01, 0xa8} }, +{ 0x07cd, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xfe, 0x90, 0x01, 0xbc, 0xe0, 0x5e, 0x60, 0x14} }, +{ 0x07dd, 16, {0x74, 0x27, 0x2f, 0xf8, 0xe6, 0xd3, 0x94, 0x0a, 0x40, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00} }, +{ 0x07ed, 16, {0x8e, 0x48, 0x80, 0x03, 0x75, 0x48, 0x01, 0x74, 0x68, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5} }, +{ 0x07fd, 16, {0x83, 0xe5, 0x48, 0xf0, 0x0f, 0xbf, 0x04, 0xc5, 0xe5, 0x2b, 0xd3, 0x94, 0x0a, 0x40, 0x04, 0x7f} }, +{ 0x080d, 13, {0x01, 0x80, 0x02, 0x7f, 0x00, 0x90, 0x20, 0x6c, 0xef, 0xf0, 0x02, 0x07, 0x8e} }, +{ 0x081a, 1, {0x22} }, +{ 0x081b, 4, {0x53, 0xd8, 0xef, 0x32} }, +{ 0x081f, 16, {0xe4, 0x90, 0x7f, 0x9c, 0xf0, 0x7f, 0x0a, 0xfe, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0x74, 0x89} }, +{ 0x082f, 16, {0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xcf, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x09, 0x29, 0x90, 0x7f} }, +{ 0x083f, 16, {0x96, 0xe0, 0x54, 0xfe, 0xf0, 0x7f, 0x0a, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x7f, 0x02, 0x7d, 0xff} }, +{ 0x084f, 16, {0x12, 0x11, 0x77, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x02} }, +{ 0x085f, 16, {0xf0, 0xe0, 0x54, 0x7f, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0} }, +{ 0x086f, 16, {0x44, 0x40, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0, 0x54, 0xbf} }, +{ 0x087f, 16, {0xf0, 0x7f, 0x32, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x40, 0xf0, 0x7f} }, +{ 0x088f, 7, {0x32, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x22} }, +{ 0x0896, 16, {0x90, 0x7f, 0x96, 0xe0, 0x54, 0xfd, 0xf0, 0xe0, 0x44, 0x80, 0xf0, 0x7f, 0x0a, 0x7e, 0x00, 0x12} }, +{ 0x08a6, 16, {0x09, 0x29, 0x7f, 0x02, 0xe4, 0xfd, 0x12, 0x11, 0x77, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29} }, +{ 0x08b6, 16, {0x90, 0x7f, 0x96, 0xe0, 0x54, 0xbf, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f} }, +{ 0x08c6, 16, {0x96, 0xe0, 0x44, 0x04, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0} }, +{ 0x08d6, 16, {0x54, 0xf7, 0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x01} }, +{ 0x08e6, 12, {0xf0, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x12, 0x0b, 0x00, 0x22} }, +{ 0x08f2, 16, {0x90, 0x95, 0xbe, 0xe4, 0x93, 0x70, 0x2f, 0x90, 0x7f, 0x93, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x94} }, +{ 0x0902, 16, {0x74, 0x3c, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc6, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90, 0x7f} }, +{ 0x0912, 16, {0x9d, 0x74, 0x02, 0xf0, 0x90, 0x7f, 0xe2, 0x74, 0x12, 0xf0, 0x12, 0x08, 0x1f, 0x75, 0x82, 0xbe} }, +{ 0x0922, 7, {0x75, 0x83, 0x95, 0x74, 0xff, 0xf0, 0x22} }, +{ 0x0929, 16, {0x8e, 0x58, 0x8f, 0x59, 0xe5, 0x59, 0x15, 0x59, 0xae, 0x58, 0x70, 0x02, 0x15, 0x58, 0x4e, 0x60} }, +{ 0x0939, 7, {0x05, 0x12, 0x0a, 0x58, 0x80, 0xee, 0x22} }, +{ 0x0940, 2, {0x8f, 0x4c} }, +{ 0x0942, 16, {0xe4, 0xf5, 0x4d, 0x75, 0x4e, 0xff, 0x75, 0x4f, 0x12, 0x75, 0x50, 0x6a, 0xab, 0x4e, 0xaa, 0x4f} }, +{ 0x0952, 16, {0xa9, 0x50, 0x90, 0x00, 0x01, 0x12, 0x9f, 0x61, 0xb4, 0x03, 0x1d, 0xaf, 0x4d, 0x05, 0x4d, 0xef} }, +{ 0x0962, 16, {0xb5, 0x4c, 0x01, 0x22, 0x12, 0x9f, 0x48, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75} }, +{ 0x0972, 14, {0x4e, 0xff, 0xf5, 0x4f, 0x89, 0x50, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00} }, +{ 0x0980, 1, {0x22} }, +{ 0x0981, 16, {0xe4, 0xfe, 0x75, 0x4e, 0xff, 0x75, 0x4f, 0x12, 0x75, 0x50, 0x12, 0xab, 0x4e, 0xaa, 0x4f, 0xa9} }, +{ 0x0991, 16, {0x50, 0x90, 0x00, 0x01, 0x12, 0x9f, 0x61, 0x64, 0x02, 0x70, 0x2d, 0xad, 0x06, 0x0e, 0xed, 0xb5} }, +{ 0x09a1, 16, {0x07, 0x01, 0x22, 0x90, 0x00, 0x02, 0x12, 0x9f, 0xba, 0x85, 0xf0, 0x4c, 0xf5, 0x4d, 0x62, 0x4c} }, +{ 0x09b1, 16, {0xe5, 0x4c, 0x62, 0x4d, 0xe5, 0x4d, 0x62, 0x4c, 0x29, 0xfd, 0xe5, 0x4c, 0x3a, 0xa9, 0x05, 0x75} }, +{ 0x09c1, 14, {0x4e, 0xff, 0xf5, 0x4f, 0x89, 0x50, 0x80, 0xc3, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00} }, +{ 0x09cf, 1, {0x22} }, +{ 0x09d0, 16, {0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x07, 0x04, 0xe0, 0x44} }, +{ 0x09e0, 16, {0x02, 0xf0, 0x7f, 0xd0, 0x7e, 0x07, 0x12, 0x09, 0x29, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0} }, +{ 0x09f0, 5, {0xe0, 0x44, 0x04, 0xf0, 0x22} }, +{ 0x09f5, 5, {0x12, 0x08, 0x96, 0xd3, 0x22} }, +{ 0x09fa, 5, {0x12, 0x08, 0x1f, 0xd3, 0x22} }, +{ 0x09ff, 1, {0x32} }, { 0x0a00, 16, {0x02, 0x0b, 0xaa, 0x00, 0x02, 0x0b, 0xdd, 0x00, 0x02, 0x0b, 0xc2, 0x00, 0x02, 0x0c, 0x1c, 0x00} }, -{ 0x0a10, 16, {0x02, 0x0c, 0x06, 0x00, 0x02, 0x0a, 0xf7, 0x00, 0x02, 0x0a, 0xf8, 0x00, 0x02, 0x0a, 0xf9, 0x00} }, -{ 0x0a20, 16, {0x02, 0x0c, 0x37, 0x00, 0x02, 0x0d, 0x27, 0x00, 0x02, 0x0c, 0x73, 0x00, 0x02, 0x0d, 0x7b, 0x00} }, -{ 0x0a30, 16, {0x02, 0x0c, 0xaf, 0x00, 0x02, 0x0d, 0xcf, 0x00, 0x02, 0x0c, 0xeb, 0x00, 0x02, 0x0e, 0x23, 0x00} }, -{ 0x0a40, 16, {0x02, 0x0a, 0xfa, 0x00, 0x02, 0x0a, 0xfc, 0x00, 0x02, 0x0a, 0xfb, 0x00, 0x02, 0x0a, 0xfd, 0x00} }, -{ 0x0a50, 8, {0x02, 0x0e, 0x77, 0x00, 0x02, 0x0e, 0x8d, 0x00} }, -{ 0x0a58, 16, {0x53, 0x8e, 0xf7, 0xe5, 0x89, 0x54, 0xf1, 0x44, 0x01, 0xf5, 0x89, 0x75, 0x8c, 0xb1, 0xd2, 0xa9} }, -{ 0x0a68, 16, {0x75, 0x98, 0x40, 0x75, 0xcb, 0xff, 0x75, 0xca, 0xf3, 0x75, 0xc8, 0x34, 0xe4, 0xff, 0x7f, 0x05} }, -{ 0x0a78, 7, {0x78, 0x27, 0xe4, 0xf6, 0x08, 0xdf, 0xfc} }, -{ 0x0a7f, 1, {0x22} }, -{ 0x0a80, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x06, 0xc0} }, -{ 0x0a90, 1, {0x07} }, -{ 0x0a91, 16, {0x30, 0x04, 0x16, 0x75, 0x8c, 0xf8, 0x75, 0x8a, 0x30, 0x7f, 0x2f, 0xae, 0x07, 0x1f, 0xee, 0x60} }, -{ 0x0aa1, 16, {0x3c, 0x90, 0x20, 0x00, 0x74, 0x55, 0xf0, 0x80, 0xf2, 0x75, 0x8c, 0xb1, 0x7f, 0x27, 0xef, 0xd3} }, -{ 0x0ab1, 16, {0x94, 0x2b, 0x50, 0x09, 0xa8, 0x07, 0xe6, 0x60, 0x01, 0x16, 0x0f, 0x80, 0xf1, 0x90, 0x03, 0x00} }, -{ 0x0ac1, 16, {0xe0, 0x60, 0x02, 0x14, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x60, 0x0e, 0x90} }, -{ 0x0ad1, 13, {0x01, 0xc1, 0xe0, 0x24, 0xff, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x34, 0xff, 0xf0} }, -{ 0x0ade, 15, {0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0aed, 5, {0x12, 0x08, 0x90, 0xd3, 0x22} }, -{ 0x0af2, 5, {0x12, 0x08, 0x19, 0xd3, 0x22} }, -{ 0x0af7, 1, {0x32} }, -{ 0x0af8, 1, {0x32} }, -{ 0x0af9, 1, {0x32} }, -{ 0x0afa, 1, {0x32} }, -{ 0x0afb, 1, {0x32} }, -{ 0x0afc, 1, {0x32} }, -{ 0x0afd, 1, {0x32} }, +{ 0x0a10, 16, {0x02, 0x0c, 0x06, 0x00, 0x02, 0x09, 0xff, 0x00, 0x02, 0x0a, 0xfe, 0x00, 0x02, 0x0a, 0xff, 0x00} }, +{ 0x0a20, 16, {0x02, 0x0c, 0x37, 0x00, 0x02, 0x0d, 0x29, 0x00, 0x02, 0x0c, 0x73, 0x00, 0x02, 0x0d, 0x7d, 0x00} }, +{ 0x0a30, 16, {0x02, 0x0c, 0xaf, 0x00, 0x02, 0x0d, 0xd1, 0x00, 0x02, 0x0c, 0xeb, 0x00, 0x02, 0x0e, 0x25, 0x00} }, +{ 0x0a40, 16, {0x02, 0x0d, 0x27, 0x00, 0x02, 0x0e, 0x79, 0x00, 0x02, 0x0d, 0x28, 0x00, 0x02, 0x0e, 0x7a, 0x00} }, +{ 0x0a50, 8, {0x02, 0x0e, 0x7b, 0x00, 0x02, 0x0e, 0x91, 0x00} }, +{ 0x0a58, 16, {0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9} }, +{ 0x0a68, 1, {0x22} }, +{ 0x0a69, 16, {0x53, 0x8e, 0xf7, 0xe5, 0x89, 0x54, 0xf1, 0x44, 0x01, 0xf5, 0x89, 0x75, 0x8c, 0xb1, 0xd2, 0xa9} }, +{ 0x0a79, 16, {0x75, 0x98, 0x40, 0x75, 0xcb, 0xff, 0x75, 0xca, 0xf3, 0x75, 0xc8, 0x34, 0xe4, 0xff, 0x7f, 0x05} }, +{ 0x0a89, 7, {0x78, 0x27, 0xe4, 0xf6, 0x08, 0xdf, 0xfc} }, +{ 0x0a90, 1, {0x22} }, +{ 0x0a91, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x06, 0xc0} }, +{ 0x0aa1, 1, {0x07} }, +{ 0x0aa2, 16, {0x30, 0x04, 0x16, 0x75, 0x8c, 0xf8, 0x75, 0x8a, 0x30, 0x7f, 0x2f, 0xae, 0x07, 0x1f, 0xee, 0x60} }, +{ 0x0ab2, 16, {0x3c, 0x90, 0x20, 0x00, 0x74, 0x55, 0xf0, 0x80, 0xf2, 0x75, 0x8c, 0xb1, 0x7f, 0x27, 0xef, 0xd3} }, +{ 0x0ac2, 16, {0x94, 0x2b, 0x50, 0x09, 0xa8, 0x07, 0xe6, 0x60, 0x01, 0x16, 0x0f, 0x80, 0xf1, 0x90, 0x03, 0x00} }, +{ 0x0ad2, 16, {0xe0, 0x60, 0x02, 0x14, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x60, 0x0e, 0x90} }, +{ 0x0ae2, 13, {0x01, 0xc1, 0xe0, 0x24, 0xff, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x34, 0xff, 0xf0} }, +{ 0x0aef, 15, {0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0afe, 1, {0x32} }, +{ 0x0aff, 1, {0x32} }, { 0x0b00, 9, {0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x80, 0x74} }, { 0x0b7d, 16, {0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22} }, -{ 0x0b8d, 16, {0xd2, 0x00, 0x75, 0x8e, 0x10, 0xe4, 0x90, 0x7f, 0x92, 0xf0, 0x12, 0x10, 0x0c, 0x12, 0x08, 0xec} }, -{ 0x0b9d, 13, {0x12, 0x0e, 0xa9, 0x12, 0x90, 0xe6, 0x12, 0x1b, 0x0c, 0x12, 0x0a, 0x58, 0x22} }, +{ 0x0b8d, 16, {0xd2, 0x00, 0x75, 0x8e, 0x10, 0xe4, 0x90, 0x7f, 0x92, 0xf0, 0x12, 0x80, 0x00, 0x12, 0x08, 0xf2} }, +{ 0x0b9d, 13, {0x12, 0x0e, 0xad, 0x12, 0x11, 0xe5, 0x12, 0x11, 0xc8, 0x12, 0x0a, 0x69, 0x22} }, { 0x0baa, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xd2, 0x01, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01} }, { 0x0bba, 8, {0xf0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, { 0x0bc2, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f} }, @@ -227,91 +222,97 @@ { 0x0cfb, 16, {0xa9, 0x74, 0x10, 0xf0, 0xe5, 0x30, 0x30, 0xe3, 0x13, 0xe5, 0x3b, 0x30, 0xe3, 0x07, 0x90, 0x20} }, { 0x0d0b, 16, {0x1c, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x20, 0x19, 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x2b, 0x70, 0x03} }, { 0x0d1b, 12, {0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0d27, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, -{ 0x0d37, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x02, 0xf0, 0xe5, 0x30, 0x20} }, -{ 0x0d47, 16, {0xe0, 0x06, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe0, 0x0a, 0x90, 0x7f, 0xc7} }, -{ 0x0d57, 16, {0xe0, 0x90, 0x02, 0xf8, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x01, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, -{ 0x0d67, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, -{ 0x0d77, 4, {0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0d7b, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, -{ 0x0d8b, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x04, 0xf0, 0xe5, 0x30, 0x20} }, -{ 0x0d9b, 16, {0xe1, 0x06, 0x90, 0x7f, 0xc9, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe1, 0x0a, 0x90, 0x7f, 0xc9} }, -{ 0x0dab, 16, {0xe0, 0x90, 0x02, 0xf9, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x09, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, -{ 0x0dbb, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, -{ 0x0dcb, 4, {0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0dcf, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, -{ 0x0ddf, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x08, 0xf0, 0xe5, 0x30, 0x20} }, -{ 0x0def, 16, {0xe2, 0x06, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe2, 0x0a, 0x90, 0x7f, 0xcb} }, -{ 0x0dff, 16, {0xe0, 0x90, 0x02, 0xfa, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x11, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, -{ 0x0e0f, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, -{ 0x0e1f, 4, {0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0e23, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, -{ 0x0e33, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x10, 0xf0, 0xe5, 0x30, 0x20} }, -{ 0x0e43, 16, {0xe3, 0x06, 0x90, 0x7f, 0xcd, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe3, 0x0a, 0x90, 0x7f, 0xcd} }, -{ 0x0e53, 16, {0xe0, 0x90, 0x02, 0xfb, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x19, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, -{ 0x0e63, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, -{ 0x0e73, 4, {0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0e77, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74, 0x80, 0xf0, 0xd0} }, -{ 0x0e87, 6, {0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0e8d, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x80, 0xf0, 0x90} }, -{ 0x0e9d, 12, {0x01, 0xbd, 0x74, 0xff, 0xf0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x0ea9, 16, {0x90, 0x01, 0x20, 0x12, 0x9d, 0x31, 0x00, 0x00, 0x25, 0x80, 0x90, 0x01, 0x24, 0x74, 0x08, 0xf0} }, -{ 0x0eb9, 16, {0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x6e, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x13, 0xf0, 0xa3, 0x74} }, -{ 0x0ec9, 16, {0x11, 0xf0, 0xe4, 0xa3, 0xf0, 0xa3, 0xf0, 0x90, 0x01, 0x1e, 0xf0, 0x90, 0x01, 0x1e, 0xe0, 0xff} }, -{ 0x0ed9, 16, {0xc3, 0x94, 0x04, 0x50, 0x13, 0xef, 0x04, 0xa3, 0xf0, 0x7e, 0x01, 0x7f, 0x1f, 0x12, 0x85, 0xe1} }, -{ 0x0ee9, 16, {0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0x80, 0xe3, 0xe4, 0xf5, 0x26, 0x90, 0x01, 0x1e, 0xf0, 0x90} }, -{ 0x0ef9, 16, {0x01, 0x1e, 0xe0, 0xff, 0xc3, 0x94, 0x04, 0x50, 0x1a, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, 0x34} }, -{ 0x0f09, 16, {0x02, 0xf5, 0x83, 0xe4, 0xf0, 0x74, 0x22, 0x2f, 0xf8, 0xe4, 0xf6, 0x90, 0x01, 0x1e, 0xe0, 0x04} }, -{ 0x0f19, 16, {0xf0, 0x80, 0xdc, 0xe4, 0xf5, 0x30, 0xe5, 0xc0, 0x60, 0x2f, 0x90, 0x01, 0x1e, 0x74, 0x01, 0xf0} }, -{ 0x0f29, 16, {0x90, 0x01, 0x1e, 0xe0, 0xff, 0xd3, 0x94, 0x04, 0x50, 0x1f, 0xef, 0x14, 0xff, 0x74, 0x01, 0xa8} }, -{ 0x0f39, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x30, 0x7e, 0x01, 0x7f, 0x1e, 0x12, 0x83} }, -{ 0x0f49, 16, {0x5f, 0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0x80, 0xd7, 0xe4, 0xf5, 0x3a, 0x90, 0x01, 0x1e, 0xf0} }, -{ 0x0f59, 16, {0x90, 0x01, 0x1e, 0xe0, 0xff, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x34, 0x20} }, -{ 0x0f69, 16, {0xf5, 0x83, 0xe0, 0x54, 0xf0, 0xfe, 0x74, 0xc5, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5, 0x83} }, -{ 0x0f79, 16, {0xee, 0xf0, 0x74, 0x36, 0x2f, 0xf8, 0xa6, 0x06, 0x74, 0x32, 0x2f, 0xf8, 0xe4, 0xf6, 0x74, 0x2c} }, -{ 0x0f89, 16, {0x2f, 0xf8, 0xe4, 0xf6, 0x74, 0xfc, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0xf0} }, -{ 0x0f99, 16, {0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0xe0, 0xb4, 0x04, 0xb6, 0x90, 0x20, 0x60, 0xe0, 0x54, 0x0f} }, -{ 0x0fa9, 16, {0xf5, 0x4b, 0x60, 0x5e, 0xe4, 0x90, 0x01, 0x1e, 0xf0, 0x90, 0x01, 0x1e, 0xe0, 0xff, 0xc3, 0x94} }, -{ 0x0fb9, 16, {0x04, 0x50, 0xe7, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x55, 0x4b} }, -{ 0x0fc9, 16, {0x60, 0x38, 0x90, 0x01, 0x1e, 0xe0, 0xff, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4} }, -{ 0x0fd9, 16, {0x34, 0x20, 0xf5, 0x83, 0xe0, 0xfe, 0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x05, 0xf5, 0x82, 0xe4} }, -{ 0x0fe9, 16, {0x34, 0x20, 0xf5, 0x83, 0xe0, 0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x34} }, -{ 0x0ff9, 16, {0x20, 0xf5, 0x83, 0xe0, 0xfe, 0x7d, 0x06, 0x12, 0x82, 0xd5, 0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0} }, -{ 0x1009, 3, {0x80, 0xa7, 0x22} }, -{ 0x100c, 16, {0x7b, 0xff, 0x7a, 0x12, 0x79, 0x1b, 0x90, 0x00, 0x04, 0x12, 0x9b, 0x8b, 0xfd, 0x8b, 0x4d, 0x75} }, -{ 0x101c, 16, {0x4e, 0x12, 0x75, 0x4f, 0x24, 0xe4, 0x90, 0x7f, 0xe1, 0xf0, 0x90, 0x7f, 0xe0, 0xf0, 0xf5, 0x4b} }, -{ 0x102c, 16, {0xf5, 0x4c, 0x90, 0x02, 0xae, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0x90, 0x7f} }, -{ 0x103c, 16, {0xa9, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0xe4, 0xfc, 0xec, 0x25, 0xe0, 0x24, 0xb4, 0xf5} }, -{ 0x104c, 16, {0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x0c, 0xbc, 0x10, 0xee, 0xe4, 0x90, 0x7f, 0xdd} }, -{ 0x105c, 16, {0xf0, 0xaf, 0x05, 0x1d, 0xef, 0x70, 0x03, 0x02, 0x11, 0xd2, 0xab, 0x4d, 0xaa, 0x4e, 0xa9, 0x4f} }, -{ 0x106c, 16, {0x90, 0x00, 0x01, 0x12, 0x9b, 0x8b, 0x64, 0x05, 0x60, 0x03, 0x02, 0x11, 0xc1, 0x90, 0x00, 0x03} }, -{ 0x107c, 16, {0x12, 0x9b, 0x8b, 0x64, 0x01, 0x60, 0x03, 0x02, 0x11, 0x48, 0x90, 0x00, 0x02, 0x12, 0x9b, 0x8b} }, -{ 0x108c, 16, {0xff, 0x54, 0x7f, 0xfc, 0xd3, 0x94, 0x07, 0x50, 0x03, 0x02, 0x11, 0x22, 0xec, 0xc3, 0x94, 0x10} }, -{ 0x109c, 16, {0x40, 0x03, 0x02, 0x11, 0x22, 0xef, 0x30, 0xe7, 0x42, 0xe5, 0x4c, 0xae, 0x4b, 0x78, 0x02, 0xce} }, -{ 0x10ac, 16, {0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x74, 0xf0, 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5} }, -{ 0x10bc, 16, {0x83, 0xef, 0xf0, 0x90, 0x7f, 0xe0, 0xe0, 0xff, 0xec, 0x24, 0xf8, 0xfe, 0x74, 0x01, 0xa8, 0x06} }, -{ 0x10cc, 16, {0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x4f, 0x90, 0x7f, 0xe0, 0xf0, 0x90, 0x02, 0xae, 0xe0} }, -{ 0x10dc, 16, {0x04, 0xf0, 0x90, 0x7f, 0xdd, 0xe0, 0x44, 0x80, 0xf0, 0x80, 0x3e, 0xe5, 0x4c, 0xae, 0x4b, 0x78} }, -{ 0x10ec, 16, {0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x74, 0xe8, 0x2c, 0xf5, 0x82, 0xe4, 0x34} }, -{ 0x10fc, 16, {0x7f, 0xf5, 0x83, 0xef, 0xf0, 0x90, 0x7f, 0xe1, 0xe0, 0xff, 0xec, 0x24, 0xf8, 0xfe, 0x74, 0x01} }, -{ 0x110c, 16, {0xa8, 0x06, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x4f, 0x90, 0x7f, 0xe1, 0xf0, 0x90, 0x02} }, -{ 0x111c, 16, {0xae, 0xe0, 0x04, 0xf0, 0x80, 0x03, 0x7f, 0xff, 0x22, 0x90, 0x00, 0x04, 0x12, 0x9b, 0x8b, 0x25} }, -{ 0x112c, 16, {0x4c, 0xf5, 0x4c, 0xe4, 0x35, 0x4b, 0xf5, 0x4b, 0x90, 0x00, 0x05, 0x12, 0x9b, 0x8b, 0xfe, 0xe4} }, -{ 0x113c, 16, {0x25, 0x4c, 0xf5, 0x4c, 0xee, 0x35, 0x4b, 0xf5, 0x4b, 0x02, 0x11, 0xc4, 0xab, 0x4d, 0xaa, 0x4e} }, -{ 0x114c, 16, {0xa9, 0x4f, 0x90, 0x00, 0x03, 0x12, 0x9b, 0x8b, 0xff, 0x64, 0x02, 0x60, 0x05, 0xef, 0x64, 0x03} }, -{ 0x115c, 16, {0x70, 0x60, 0x90, 0x00, 0x02, 0x12, 0x9b, 0x8b, 0xff, 0x54, 0x7f, 0xfc, 0xd3, 0x94, 0x07, 0x50} }, -{ 0x116c, 16, {0x4e, 0xef, 0x30, 0xe7, 0x1e, 0x90, 0x7f, 0xde, 0xe0, 0xff, 0x74, 0x01, 0xa8, 0x04, 0x08, 0x80} }, -{ 0x117c, 16, {0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xfe, 0x4f, 0x90, 0x7f, 0xde, 0xf0, 0x90, 0x7f, 0xac, 0xe0, 0x4e} }, -{ 0x118c, 16, {0xf0, 0x80, 0x35, 0x90, 0x7f, 0xdf, 0xe0, 0xff, 0x74, 0x01, 0xa8, 0x04, 0x08, 0x80, 0x02, 0xc3} }, -{ 0x119c, 16, {0x33, 0xd8, 0xfc, 0xfe, 0x4f, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xad, 0xe0, 0x4e, 0xf0, 0xec} }, -{ 0x11ac, 16, {0x25, 0xe0, 0x24, 0xc5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xec, 0xf0, 0x80, 0x09, 0x7f} }, -{ 0x11bc, 16, {0xff, 0x22, 0x7f, 0xff, 0x22, 0x7f, 0xff, 0x22, 0x74, 0x07, 0x25, 0x4f, 0xf5, 0x4f, 0xe4, 0x35} }, -{ 0x11cc, 16, {0x4e, 0xf5, 0x4e, 0x02, 0x10, 0x5d, 0x20, 0x03, 0x0d, 0x90, 0x02, 0xae, 0xe0, 0x60, 0x07, 0x90} }, -{ 0x11dc, 8, {0x7f, 0xae, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0x00} }, -{ 0x11e4, 1, {0x22} }, -{ 0x11e5, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xff, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33} }, -{ 0x11f5, 7, {0xd8, 0xfc, 0x42, 0x3a, 0x7f, 0x00, 0x22} }, -{ 0x11fc, 3, {0x00, 0x03, 0x15} }, +{ 0x0d27, 1, {0x32} }, +{ 0x0d28, 1, {0x32} }, +{ 0x0d29, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, +{ 0x0d39, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x02, 0xf0, 0xe5, 0x30, 0x20} }, +{ 0x0d49, 16, {0xe0, 0x06, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe0, 0x0a, 0x90, 0x7f, 0xc7} }, +{ 0x0d59, 16, {0xe0, 0x90, 0x02, 0xf8, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x01, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, +{ 0x0d69, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, +{ 0x0d79, 4, {0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0d7d, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, +{ 0x0d8d, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x04, 0xf0, 0xe5, 0x30, 0x20} }, +{ 0x0d9d, 16, {0xe1, 0x06, 0x90, 0x7f, 0xc9, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe1, 0x0a, 0x90, 0x7f, 0xc9} }, +{ 0x0dad, 16, {0xe0, 0x90, 0x02, 0xf9, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x09, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, +{ 0x0dbd, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, +{ 0x0dcd, 4, {0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0dd1, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, +{ 0x0de1, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x08, 0xf0, 0xe5, 0x30, 0x20} }, +{ 0x0df1, 16, {0xe2, 0x06, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe2, 0x0a, 0x90, 0x7f, 0xcb} }, +{ 0x0e01, 16, {0xe0, 0x90, 0x02, 0xfa, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x11, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, +{ 0x0e11, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, +{ 0x0e21, 4, {0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0e25, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0} }, +{ 0x0e35, 16, {0xd0, 0x75, 0xd0, 0x10, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x10, 0xf0, 0xe5, 0x30, 0x20} }, +{ 0x0e45, 16, {0xe3, 0x06, 0x90, 0x7f, 0xcd, 0xf0, 0x80, 0x16, 0xe5, 0x3b, 0x30, 0xe3, 0x0a, 0x90, 0x7f, 0xcd} }, +{ 0x0e55, 16, {0xe0, 0x90, 0x02, 0xfb, 0xf0, 0x80, 0x07, 0x90, 0x20, 0x19, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x2b} }, +{ 0x0e65, 16, {0x70, 0x03, 0x75, 0x2b, 0x14, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0} }, +{ 0x0e75, 4, {0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0e79, 1, {0x32} }, +{ 0x0e7a, 1, {0x32} }, +{ 0x0e7b, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74, 0x80, 0xf0, 0xd0} }, +{ 0x0e8b, 6, {0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0e91, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x80, 0xf0, 0x90} }, +{ 0x0ea1, 12, {0x01, 0xbd, 0x74, 0xff, 0xf0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, +{ 0x0ead, 16, {0x90, 0x01, 0x20, 0x12, 0xa1, 0x07, 0x00, 0x00, 0x25, 0x80, 0x90, 0x01, 0x24, 0x74, 0x08, 0xf0} }, +{ 0x0ebd, 16, {0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x6e, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x13, 0xf0, 0xa3, 0x74} }, +{ 0x0ecd, 16, {0x11, 0xf0, 0xe4, 0xa3, 0xf0, 0xa3, 0xf0, 0x90, 0x01, 0x1e, 0xf0, 0x90, 0x01, 0x1e, 0xe0, 0xff} }, +{ 0x0edd, 16, {0x04, 0xa3, 0xf0, 0xef, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x01, 0xf9, 0x74, 0x03, 0x35, 0xf0, 0xa8} }, +{ 0x0eed, 16, {0x01, 0xfc, 0x7d, 0x01, 0x7b, 0x01, 0x7a, 0x01, 0x79, 0x1f, 0x7e, 0x00, 0x7f, 0x0d, 0x12, 0x9f} }, +{ 0x0efd, 16, {0x1f, 0x7e, 0x01, 0x7f, 0x1f, 0x12, 0x86, 0x17, 0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0xe0, 0xc3} }, +{ 0x0f0d, 16, {0x94, 0x04, 0x40, 0xc7, 0xe4, 0xf5, 0x26, 0x90, 0x01, 0x1e, 0xf0, 0x90, 0x01, 0x1e, 0xe0, 0xff} }, +{ 0x0f1d, 16, {0xc3, 0x94, 0x04, 0x50, 0x1a, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4} }, +{ 0x0f2d, 16, {0xf0, 0x74, 0x22, 0x2f, 0xf8, 0xe4, 0xf6, 0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0x80, 0xdc, 0xe4} }, +{ 0x0f3d, 16, {0xf5, 0x30, 0xe5, 0xc0, 0x60, 0x2f, 0x90, 0x01, 0x1e, 0x74, 0x01, 0xf0, 0x90, 0x01, 0x1e, 0xe0} }, +{ 0x0f4d, 16, {0xff, 0xd3, 0x94, 0x04, 0x50, 0x1f, 0xef, 0x14, 0xff, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02} }, +{ 0x0f5d, 16, {0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x30, 0x7e, 0x01, 0x7f, 0x1e, 0x12, 0x83, 0xb7, 0x90, 0x01, 0x1e} }, +{ 0x0f6d, 16, {0xe0, 0x04, 0xf0, 0x80, 0xd7, 0xe4, 0xf5, 0x3a, 0x90, 0x01, 0x1e, 0xf0, 0x90, 0x01, 0x1e, 0xe0} }, +{ 0x0f7d, 16, {0xff, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x54} }, +{ 0x0f8d, 16, {0xf0, 0xfe, 0x74, 0xc5, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5, 0x83, 0xee, 0xf0, 0x74, 0x36} }, +{ 0x0f9d, 16, {0x2f, 0xf8, 0xa6, 0x06, 0x74, 0x32, 0x2f, 0xf8, 0xe4, 0xf6, 0x74, 0x2c, 0x2f, 0xf8, 0xe4, 0xf6} }, +{ 0x0fad, 16, {0x74, 0xfc, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x01, 0x1e, 0xe0} }, +{ 0x0fbd, 16, {0x04, 0xf0, 0xe0, 0xb4, 0x04, 0xb6, 0x90, 0x20, 0x60, 0xe0, 0x54, 0x0f, 0xf5, 0x4b, 0x60, 0x5e} }, +{ 0x0fcd, 4, {0xe4, 0x90, 0x01, 0x1e} }, +{ 0x0fd1, 16, {0xf0, 0x90, 0x01, 0x1e, 0xe0, 0xff, 0xc3, 0x94, 0x04, 0x50, 0xe7, 0x74, 0x01, 0xa8, 0x07, 0x08} }, +{ 0x0fe1, 16, {0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x55, 0x4b, 0x60, 0x38, 0x90, 0x01, 0x1e, 0xe0, 0xff, 0x75} }, +{ 0x0ff1, 16, {0xf0, 0x08, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0xfe, 0xef, 0x75} }, +{ 0x1001, 16, {0xf0, 0x08, 0xa4, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0xef, 0x75, 0xf0} }, +{ 0x1011, 16, {0x08, 0xa4, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0xfe, 0x7d, 0x06, 0x12} }, +{ 0x1021, 11, {0x83, 0x2d, 0x90, 0x01, 0x1e, 0xe0, 0x04, 0xf0, 0x80, 0xa7, 0x22} }, +{ 0x102c, 4, {0xad, 0x07, 0xac, 0x06} }, +{ 0x1030, 16, {0x79, 0x06, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb} }, +{ 0x1040, 16, {0x4a, 0x70, 0x03, 0x02, 0x11, 0x74, 0xe9, 0xb4, 0x07, 0x00, 0x40, 0x03, 0x02, 0x11, 0x46, 0x90} }, +{ 0x1050, 16, {0x10, 0x56, 0xf8, 0x28, 0x28, 0x73, 0x02, 0x11, 0x24, 0x02, 0x10, 0xdc, 0x02, 0x10, 0xc5, 0x02} }, +{ 0x1060, 16, {0x10, 0xab, 0x02, 0x10, 0x9a, 0x02, 0x10, 0x85, 0x02, 0x10, 0x6b, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, +{ 0x1070, 16, {0x80, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90, 0x7f, 0xa6} }, +{ 0x1080, 16, {0xf0, 0x19, 0x02, 0x11, 0x46, 0x19, 0x8d, 0x82, 0x8c, 0x83, 0xe0, 0xc3, 0x94, 0x20, 0x40, 0x0a} }, +{ 0x1090, 16, {0xa3, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x02, 0x11, 0x46, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xa3} }, +{ 0x10a0, 16, {0xe0, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x19, 0x02, 0x11, 0x46, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, +{ 0x10b0, 16, {0x80, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa1, 0x90, 0x7f, 0xa6} }, +{ 0x10c0, 16, {0xf0, 0x19, 0x02, 0x11, 0x46, 0xeb, 0x64, 0x01, 0x4a, 0x70, 0x08, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, +{ 0x10d0, 16, {0x20, 0xf0, 0x19, 0x90, 0x7f, 0xa6, 0xe0, 0xf5, 0x54, 0x19, 0x80, 0x6a, 0xed, 0x24, 0x04, 0xf5} }, +{ 0x10e0, 16, {0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0x64, 0x02, 0x4e, 0x70, 0x08, 0x90, 0x7f} }, +{ 0x10f0, 16, {0xa5, 0xe0, 0x44, 0x20, 0xf0, 0x19, 0x90, 0x7f, 0xa6, 0xe0, 0xff, 0xed, 0x24, 0x06, 0xf5, 0x82} }, +{ 0x1100, 16, {0xe4, 0x3c, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83} }, +{ 0x1110, 16, {0xef, 0xf0, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0x74, 0xff, 0xf5, 0xf0, 0x12} }, +{ 0x1120, 16, {0x9f, 0x8e, 0x80, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xff} }, +{ 0x1130, 16, {0xed, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xf5, 0x82, 0x8a} }, +{ 0x1140, 16, {0x83, 0xef, 0xf0, 0x7f, 0x08, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0xf5, 0x54, 0x30, 0xe0, 0xf7, 0x30} }, +{ 0x1150, 16, {0xe2, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06, 0x22, 0xe9, 0xd3, 0x94, 0x02, 0x50, 0x03, 0x02} }, +{ 0x1160, 16, {0x10, 0x32, 0xe5, 0x54, 0x30, 0xe1, 0x03, 0x02, 0x10, 0x32, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40} }, +{ 0x1170, 6, {0xf0, 0x7f, 0x07, 0x22, 0x7f, 0x08} }, +{ 0x1176, 1, {0x22} }, +{ 0x1177, 2, {0xae, 0x07} }, +{ 0x1179, 16, {0x7c, 0x02, 0xec, 0x14, 0x60, 0x15, 0x14, 0x70, 0x1e, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0} }, +{ 0x1189, 16, {0xee, 0x25, 0xe0, 0x44, 0x40, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x0c, 0x90, 0x7f, 0xa6, 0xed, 0xf0} }, +{ 0x1199, 16, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0xfb, 0x30, 0xe0, 0xf8, 0xbc} }, +{ 0x11a9, 16, {0x02, 0x0a, 0x20, 0xe1, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x07, 0x22, 0xeb, 0x30, 0xe2, 0x0a} }, +{ 0x11b9, 14, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06, 0x22, 0xdc, 0xb6, 0x7f, 0x08} }, +{ 0x11c7, 1, {0x22} }, +{ 0x11c8, 16, {0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x7f, 0x02, 0x7d, 0xff, 0x12, 0x11, 0x77, 0x7f, 0x05} }, +{ 0x11d8, 13, {0x7e, 0x00, 0x12, 0x09, 0x29, 0x7f, 0x03, 0x7d, 0xff, 0x12, 0x11, 0x77, 0x22} }, +{ 0x11e5, 16, {0xe4, 0x90, 0x01, 0xc9, 0xf0, 0x7e, 0x01, 0x7f, 0xca, 0x90, 0x01, 0xbe, 0xee, 0xf0, 0xa3, 0xef} }, +{ 0x11f5, 10, {0xf0, 0x90, 0x01, 0xc2, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22} }, { 0x1200, 16, {0x12, 0x01, 0x00, 0x01, 0xff, 0xff, 0xff, 0x40, 0x10, 0x07, 0x01, 0x80, 0x42, 0x00, 0x01, 0x02} }, { 0x1210, 16, {0x03, 0x01, 0x09, 0x02, 0x58, 0x00, 0x01, 0x01, 0x04, 0x80, 0x3c, 0x09, 0x04, 0x00, 0x00, 0x0a} }, { 0x1220, 16, {0xff, 0xff, 0xff, 0x05, 0x07, 0x05, 0x81, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40} }, @@ -438,557 +439,623 @@ { 0x19a0, 16, {0x80, 0x1b, 0xe0, 0xde, 0xfd, 0x90, 0x7f, 0xe2, 0xe0, 0x54, 0xbf, 0xf0, 0x90, 0x20, 0x58, 0x74} }, { 0x19b0, 16, {0x00, 0xf0, 0x90, 0x20, 0x19, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0xcd, 0xf0, 0x02, 0x13, 0x43} }, { 0x19c0, 1, {0x32} }, -{ 0x19c1, 4, {0xad, 0x07, 0xac, 0x06} }, -{ 0x19c5, 16, {0x79, 0x06, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb} }, -{ 0x19d5, 16, {0x4a, 0x70, 0x03, 0x02, 0x1b, 0x09, 0xe9, 0xb4, 0x07, 0x00, 0x40, 0x03, 0x02, 0x1a, 0xdb, 0x90} }, -{ 0x19e5, 16, {0x19, 0xeb, 0xf8, 0x28, 0x28, 0x73, 0x02, 0x1a, 0xb9, 0x02, 0x1a, 0x71, 0x02, 0x1a, 0x5a, 0x02} }, -{ 0x19f5, 16, {0x1a, 0x40, 0x02, 0x1a, 0x2f, 0x02, 0x1a, 0x1a, 0x02, 0x1a, 0x00, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, -{ 0x1a05, 16, {0x80, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90, 0x7f, 0xa6} }, -{ 0x1a15, 16, {0xf0, 0x19, 0x02, 0x1a, 0xdb, 0x19, 0x8d, 0x82, 0x8c, 0x83, 0xe0, 0xc3, 0x94, 0x20, 0x40, 0x0a} }, -{ 0x1a25, 16, {0xa3, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x02, 0x1a, 0xdb, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xa3} }, -{ 0x1a35, 16, {0xe0, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x19, 0x02, 0x1a, 0xdb, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, -{ 0x1a45, 16, {0x80, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa1, 0x90, 0x7f, 0xa6} }, -{ 0x1a55, 16, {0xf0, 0x19, 0x02, 0x1a, 0xdb, 0xeb, 0x64, 0x01, 0x4a, 0x70, 0x08, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, -{ 0x1a65, 16, {0x20, 0xf0, 0x19, 0x90, 0x7f, 0xa6, 0xe0, 0xf5, 0x54, 0x19, 0x80, 0x6a, 0xed, 0x24, 0x04, 0xf5} }, -{ 0x1a75, 16, {0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0x64, 0x02, 0x4e, 0x70, 0x08, 0x90, 0x7f} }, -{ 0x1a85, 16, {0xa5, 0xe0, 0x44, 0x20, 0xf0, 0x19, 0x90, 0x7f, 0xa6, 0xe0, 0xff, 0xed, 0x24, 0x06, 0xf5, 0x82} }, -{ 0x1a95, 16, {0xe4, 0x3c, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83} }, -{ 0x1aa5, 16, {0xef, 0xf0, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0x74, 0xff, 0xf5, 0xf0, 0x12} }, -{ 0x1ab5, 16, {0x9b, 0xb8, 0x80, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xff} }, -{ 0x1ac5, 16, {0xed, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xf5, 0x82, 0x8a} }, -{ 0x1ad5, 16, {0x83, 0xef, 0xf0, 0x7f, 0x08, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0xf5, 0x54, 0x30, 0xe0, 0xf7, 0x30} }, -{ 0x1ae5, 16, {0xe2, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06, 0x22, 0xe9, 0xd3, 0x94, 0x02, 0x50, 0x03, 0x02} }, -{ 0x1af5, 16, {0x19, 0xc7, 0xe5, 0x54, 0x30, 0xe1, 0x03, 0x02, 0x19, 0xc7, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40} }, -{ 0x1b05, 6, {0xf0, 0x7f, 0x07, 0x22, 0x7f, 0x08} }, -{ 0x1b0b, 1, {0x22} }, -{ 0x1b0c, 16, {0x7f, 0x05, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x7f, 0x02, 0x7d, 0xff, 0x12, 0x81, 0xe0, 0x7f, 0x05} }, -{ 0x1b1c, 13, {0x7e, 0x00, 0x12, 0x09, 0x23, 0x7f, 0x03, 0x7d, 0xff, 0x12, 0x81, 0xe0, 0x22} }, -{ 0x1b29, 16, {0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0} }, -{ 0x8000, 4, {0x8e, 0x54, 0x8f, 0x55} }, -{ 0x8004, 16, {0x75, 0x56, 0x03, 0xe5, 0x55, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xfe} }, -{ 0x8014, 16, {0xa3, 0xe0, 0x4e, 0x70, 0x03, 0x02, 0x81, 0x0e, 0xe5, 0x56, 0x60, 0x4e, 0x14, 0x60, 0x38, 0x14} }, -{ 0x8024, 16, {0x60, 0x20, 0x14, 0x60, 0x03, 0x02, 0x80, 0xb2, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0x85} }, -{ 0x8034, 16, {0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90, 0x7f, 0xa6, 0xf0} }, -{ 0x8044, 16, {0x80, 0x6c, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0xc3, 0x94, 0x20, 0x40, 0x09, 0xa3, 0xa3} }, -{ 0x8054, 16, {0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x57, 0x15, 0x56, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3} }, -{ 0x8064, 16, {0xa3, 0xe0, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x44, 0xe5, 0x55, 0x24, 0x06, 0xf5, 0x82} }, -{ 0x8074, 16, {0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5} }, -{ 0x8084, 16, {0x83, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0xe5, 0x55, 0x24} }, -{ 0x8094, 16, {0x04, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0x74, 0xff, 0xf5, 0xf0, 0x12, 0x9b, 0xb8, 0x85} }, -{ 0x80a4, 16, {0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xb8, 0x90, 0x7f} }, -{ 0x80b4, 16, {0xa5, 0xe0, 0xf5, 0x57, 0x30, 0xe0, 0xf7, 0x30, 0xe2, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06} }, -{ 0x80c4, 16, {0x22, 0xe5, 0x57, 0x20, 0xe1, 0x0a, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x07, 0x22} }, -{ 0x80d4, 16, {0xe5, 0x56, 0x70, 0x31, 0x7f, 0x01, 0x7e, 0x00, 0x12, 0x09, 0x23, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, -{ 0x80e4, 16, {0x80, 0xf0, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90} }, -{ 0x80f4, 16, {0x7f, 0xa6, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0xf5, 0x57, 0x30, 0xe0, 0xf7, 0x30, 0xe1, 0xd5, 0x75} }, -{ 0x8104, 12, {0x56, 0x03, 0x02, 0x80, 0x07, 0x15, 0x56, 0x02, 0x80, 0x07, 0x7f, 0x08} }, -{ 0x8110, 1, {0x22} }, -{ 0x8111, 2, {0xac, 0x07} }, -{ 0x8113, 16, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0xec, 0x25, 0xe0, 0x44, 0x41, 0x90, 0x7f, 0xa6, 0xf0} }, -{ 0x8123, 16, {0x7b, 0x3c, 0xaf, 0x03, 0x1b, 0xef, 0x70, 0x16, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90} }, -{ 0x8133, 16, {0x7f, 0xa6, 0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x60, 0xd4, 0x80, 0xf8, 0x90, 0x7f} }, -{ 0x8143, 16, {0xa5, 0xe0, 0xfd, 0x30, 0xe0, 0xdc, 0x20, 0xe1, 0x09, 0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f} }, -{ 0x8153, 16, {0xf9, 0x22, 0xed, 0x30, 0xe2, 0x0c, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f} }, -{ 0x8163, 16, {0xfa, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x20, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0x7b, 0x1e} }, -{ 0x8173, 16, {0xaf, 0x03, 0x1b, 0xef, 0x70, 0x16, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6} }, -{ 0x8183, 16, {0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x60, 0x86, 0x80, 0xf8, 0x90, 0x7f, 0xa5, 0xe0} }, -{ 0x8193, 16, {0xfd, 0x20, 0xe0, 0xdc, 0x7b, 0x3c, 0xaf, 0x03, 0x1b, 0xef, 0x70, 0x19, 0x90, 0x7f, 0xa5, 0xe0} }, -{ 0x81a3, 16, {0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x70, 0x03} }, -{ 0x81b3, 16, {0x02, 0x81, 0x13, 0x80, 0xf5, 0x90, 0x7f, 0xa5, 0xe0, 0xfd, 0x30, 0xe0, 0xd9, 0x30, 0xe2, 0x09} }, -{ 0x81c3, 16, {0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f, 0xfa, 0x22, 0xc2, 0xaf, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, -{ 0x81d3, 12, {0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0xd2, 0xaf, 0xff, 0x7e, 0x00} }, -{ 0x81df, 1, {0x22} }, -{ 0x81e0, 2, {0xae, 0x07} }, -{ 0x81e2, 16, {0x7c, 0x02, 0xec, 0x14, 0x60, 0x15, 0x14, 0x70, 0x1e, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0} }, -{ 0x81f2, 16, {0xee, 0x25, 0xe0, 0x44, 0x40, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x0c, 0x90, 0x7f, 0xa6, 0xed, 0xf0} }, -{ 0x8202, 16, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0xfb, 0x30, 0xe0, 0xf8, 0xbc} }, -{ 0x8212, 16, {0x02, 0x0a, 0x20, 0xe1, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x07, 0x22, 0xeb, 0x30, 0xe2, 0x0a} }, -{ 0x8222, 14, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06, 0x22, 0xdc, 0xb6, 0x7f, 0x08} }, -{ 0x8230, 1, {0x22} }, -{ 0x8231, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc2, 0xa9, 0x90, 0x03, 0x00, 0x74, 0x19, 0xf0, 0xd2, 0xa9} }, -{ 0x8241, 15, {0x53, 0x91, 0x7f, 0x90, 0x01, 0xc4, 0xe4, 0xf0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x8250, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xab, 0x82, 0xfa, 0xf5} }, -{ 0x8260, 16, {0x83, 0xa3, 0xe4, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0xf5, 0x5e, 0x74, 0xbf} }, -{ 0x8270, 16, {0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xe0, 0x44, 0x10, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3} }, -{ 0x8280, 16, {0xa3, 0xa3, 0xe4, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xf0, 0xf9, 0xed, 0x60, 0x1d, 0x74, 0x01} }, -{ 0x8290, 16, {0x7e, 0x00, 0xa8, 0x07, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe4} }, -{ 0x82a0, 16, {0xef, 0x55, 0x3b, 0x60, 0x04, 0x79, 0x09, 0x80, 0x02, 0x79, 0x0d, 0x8b, 0x82, 0x8a, 0x83, 0xa3} }, -{ 0x82b0, 16, {0xa3, 0xa3, 0x74, 0xbf, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xe0, 0x54, 0xef, 0xf0, 0x8b} }, -{ 0x82c0, 16, {0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xa3, 0xe5, 0x5e, 0xf0, 0xae, 0x02, 0xaf, 0x03, 0x8f, 0x82, 0x8e} }, -{ 0x82d0, 4, {0x83, 0xa3, 0xe9, 0xf0} }, -{ 0x82d4, 1, {0x22} }, -{ 0x82d5, 4, {0x8f, 0x5e, 0x8d, 0x5f} }, -{ 0x82d9, 16, {0xe4, 0xf5, 0x60, 0x74, 0x3c, 0x2f, 0xf8, 0x76, 0x08, 0xe5, 0x5e, 0x75, 0xf0, 0x0d, 0xa4, 0x24} }, -{ 0x82e9, 16, {0x02, 0xf5, 0x82, 0xe4, 0x34, 0x03, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe} }, -{ 0x82f9, 16, {0xa3, 0xe0, 0xff, 0x7b, 0x80, 0x7a, 0x25, 0x79, 0x00, 0x78, 0x00, 0xc3, 0x12, 0x9c, 0xea, 0x50} }, -{ 0x8309, 16, {0x3c, 0xe5, 0x5e, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4, 0x34, 0x03, 0xf5, 0x83} }, -{ 0x8319, 16, {0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x7b, 0x00, 0x7a, 0x96, 0x78} }, -{ 0x8329, 16, {0x00, 0xc3, 0x12, 0x9c, 0xea, 0x40, 0x0c, 0x75, 0x60, 0x40, 0x74, 0x3c, 0x25, 0x5e, 0xf8, 0x76} }, -{ 0x8339, 16, {0x10, 0x80, 0x0a, 0x75, 0x60, 0x80, 0x74, 0x3c, 0x25, 0x5e, 0xf8, 0x76, 0x38, 0xe5, 0x60, 0x45} }, -{ 0x8349, 16, {0x5f, 0x44, 0x01, 0xff, 0xe5, 0x5e, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4, 0x34} }, -{ 0x8359, 5, {0x20, 0xf5, 0x83, 0xef, 0xf0} }, -{ 0x835e, 1, {0x22} }, -{ 0x835f, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x54, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82} }, -{ 0x836f, 16, {0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5, 0x55, 0x8f, 0x56, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc6, 0xf5} }, -{ 0x837f, 16, {0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x20, 0xe1, 0x0f, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc7} }, -{ 0x838f, 16, {0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x74, 0x22, 0x25, 0x54, 0xf8, 0xe4, 0xf6} }, -{ 0x839f, 16, {0xe5, 0x56, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x55, 0xf5, 0x83, 0xe0, 0x44, 0x03, 0xf0, 0xaf} }, -{ 0x83af, 16, {0x54, 0x7d, 0x06, 0x12, 0x82, 0xd5, 0xaf, 0x54, 0x7d, 0x01, 0x12, 0x82, 0x50, 0x85, 0x56, 0x82} }, -{ 0x83bf, 16, {0x85, 0x55, 0x83, 0xa3, 0xa3, 0xe0, 0x20, 0xe0, 0x22, 0xe0, 0xff, 0xe5, 0x56, 0x24, 0x05, 0xf5} }, -{ 0x83cf, 16, {0x82, 0xe4, 0x35, 0x55, 0xf5, 0x83, 0xe0, 0xe5, 0x56, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x55} }, -{ 0x83df, 16, {0xf5, 0x83, 0xe0, 0xff, 0xaf, 0x54, 0x7d, 0x06, 0x12, 0x82, 0xd5, 0x74, 0xf8, 0x25, 0x54, 0xf5} }, -{ 0x83ef, 16, {0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x54, 0x25, 0xe0, 0xff, 0xc3, 0x74, 0x0c} }, -{ 0x83ff, 16, {0x9f, 0x75, 0xf0, 0x40, 0xa4, 0x24, 0x40, 0xf5, 0x82, 0xe5, 0xf0, 0x34, 0x7b, 0xaf, 0x82, 0xfe} }, -{ 0x840f, 16, {0xe5, 0x54, 0x25, 0xe0, 0x24, 0xef, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xee, 0xf0, 0xa3} }, -{ 0x841f, 16, {0xef, 0xf0, 0xaf, 0x54, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42} }, -{ 0x842f, 3, {0x30, 0x7f, 0x00} }, -{ 0x8432, 1, {0x22} }, -{ 0x8433, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x54, 0xff, 0xe4, 0xfd, 0x12, 0x82, 0x50, 0x74, 0xf8} }, -{ 0x8443, 16, {0x25, 0x54, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x54, 0x75, 0xf0, 0x08} }, -{ 0x8453, 16, {0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5, 0x56, 0x8f, 0x57, 0xf5, 0x83} }, -{ 0x8463, 16, {0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0xfc, 0xf0, 0xaf} }, -{ 0x8473, 16, {0x54, 0x7d, 0x06, 0x12, 0x82, 0xd5, 0xe5, 0x57, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x56, 0xf5} }, -{ 0x8483, 16, {0x83, 0xe0, 0x30, 0xe0, 0x09, 0x85, 0x57, 0x82, 0x85, 0x56, 0x83, 0xe0, 0xf5, 0x55, 0xaf, 0x54} }, -{ 0x8493, 16, {0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf4, 0x52, 0x30, 0xe5, 0x54} }, -{ 0x84a3, 16, {0x25, 0xe0, 0x24, 0xc6, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x20, 0xe1, 0x0f, 0xe5} }, -{ 0x84b3, 16, {0x54, 0x25, 0xe0, 0x24, 0xc7, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x7f, 0x00} }, -{ 0x84c3, 1, {0x22} }, -{ 0x84c4, 4, {0x8e, 0x54, 0x8f, 0x55} }, -{ 0x84c8, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x56, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x01, 0xf5, 0x82} }, -{ 0x84d8, 16, {0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x54, 0x03, 0x70, 0x23, 0x85, 0x55, 0x82, 0x8e, 0x83, 0xa3} }, -{ 0x84e8, 16, {0xe0, 0x30, 0xe0, 0x07, 0xaf, 0x56, 0x7d, 0x02, 0x12, 0x82, 0xd5, 0x85, 0x55, 0x82, 0x85, 0x54} }, -{ 0x84f8, 15, {0x83, 0xa3, 0xe0, 0x30, 0xe1, 0x07, 0xaf, 0x56, 0x7d, 0x04, 0x12, 0x82, 0xd5, 0x7f, 0x00} }, -{ 0x8507, 1, {0x22} }, -{ 0x8508, 16, {0x8f, 0x82, 0x8e, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0xa3, 0xa3, 0xa3, 0xe0, 0xfc, 0xed} }, -{ 0x8518, 16, {0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xa3, 0xc0, 0x83, 0xc0} }, -{ 0x8528, 16, {0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0} }, -{ 0x8538, 16, {0x8f, 0x82, 0x8e, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xa3, 0xa3, 0xa3, 0xe0, 0xfd, 0xec, 0x6d, 0xd0} }, -{ 0x8548, 16, {0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0x8f} }, -{ 0x8558, 16, {0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82} }, -{ 0x8568, 16, {0x8e, 0x83, 0xa3, 0xa3, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xe0} }, -{ 0x8578, 16, {0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xc0, 0x83, 0xc0} }, -{ 0x8588, 16, {0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xe0, 0xff, 0xed, 0x6f, 0xd0, 0x82, 0xd0} }, -{ 0x8598, 3, {0x83, 0xf0, 0x22} }, -{ 0x859b, 16, {0x79, 0x0d, 0x8e, 0x54, 0x8f, 0x55, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x75, 0xf0, 0x0d, 0xa4, 0x24} }, -{ 0x85ab, 16, {0xf4, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xaf, 0x82, 0xfe, 0xad, 0x01, 0x19, 0xed, 0x60, 0x24, 0x0f} }, -{ 0x85bb, 16, {0xef, 0xac, 0x06, 0x70, 0x01, 0x0e, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfd, 0x05, 0x55, 0xe5} }, -{ 0x85cb, 16, {0x55, 0xaa, 0x54, 0x70, 0x02, 0x05, 0x54, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xe0, 0x6d, 0x60, 0xd9} }, -{ 0x85db, 5, {0x7f, 0x01, 0x22, 0x7f, 0x00} }, -{ 0x85e0, 1, {0x22} }, -{ 0x85e1, 4, {0x8e, 0x54, 0x8f, 0x55} }, -{ 0x85e5, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x5b, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82} }, -{ 0x85f5, 16, {0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5, 0x5c, 0x8f, 0x5d, 0xaa, 0x06, 0xa9, 0x55, 0x7b, 0x01, 0xc0} }, -{ 0x8605, 16, {0x03, 0xc0, 0x01, 0xe5, 0x5b, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x01, 0xf9, 0x74, 0x03, 0x35, 0xf0} }, -{ 0x8615, 16, {0xa8, 0x01, 0xfc, 0xad, 0x03, 0xd0, 0x01, 0xd0, 0x03, 0x7e, 0x00, 0x7f, 0x0d, 0x12, 0x9b, 0x49} }, -{ 0x8625, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3} }, -{ 0x8635, 16, {0xe0, 0xff, 0x7b, 0x08, 0x7a, 0x00, 0x79, 0x00, 0x78, 0x00, 0xd3, 0x12, 0x9c, 0xea, 0x40, 0x10} }, -{ 0x8645, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0x12, 0x9d, 0x31, 0x00, 0x00, 0x00, 0x08, 0x80, 0x2e} }, -{ 0x8655, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3} }, -{ 0x8665, 16, {0xe0, 0xff, 0x7b, 0x00, 0x7a, 0x08, 0x79, 0x07, 0x78, 0x00, 0xc3, 0x12, 0x9c, 0xea, 0x50, 0x0e} }, -{ 0x8675, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0x12, 0x9d, 0x31, 0x00, 0x07, 0x08, 0x00, 0x85, 0x55} }, -{ 0x8685, 16, {0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xf8, 0xa3, 0xe0, 0xf9, 0xa3, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb} }, -{ 0x8695, 16, {0x7f, 0x00, 0x7e, 0x50, 0x7d, 0x46, 0x7c, 0x00, 0x12, 0x9c, 0x58, 0x8f, 0x59, 0x8e, 0x58, 0x8d} }, -{ 0x86a5, 16, {0x57, 0x8c, 0x56, 0x7b, 0x0a, 0x7a, 0x00, 0x79, 0x00, 0x78, 0x00, 0x12, 0x9c, 0x58, 0xaf, 0x03} }, -{ 0x86b5, 16, {0x8f, 0x5a, 0xaf, 0x59, 0xae, 0x58, 0xad, 0x57, 0xac, 0x56, 0x7b, 0x0a, 0x7a, 0x00, 0x79, 0x00} }, -{ 0x86c5, 16, {0x78, 0x00, 0x12, 0x9c, 0x58, 0x8f, 0x59, 0x8e, 0x58, 0x8d, 0x57, 0x8c, 0x56, 0xe5, 0x5a, 0xc3} }, -{ 0x86d5, 16, {0x94, 0x05, 0x40, 0x15, 0xe5, 0x59, 0x24, 0x01, 0xf5, 0x59, 0xe4, 0x35, 0x58, 0xf5, 0x58, 0xe4} }, -{ 0x86e5, 16, {0x35, 0x57, 0xf5, 0x57, 0xe4, 0x35, 0x56, 0xf5, 0x56, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3} }, -{ 0x86f5, 16, {0xe4, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x44, 0x80, 0xf0, 0x85} }, -{ 0x8705, 16, {0x5d, 0x82, 0x85, 0x5c, 0x83, 0xe5, 0x59, 0xf0, 0xaf, 0x59, 0xae, 0x58, 0xad, 0x57, 0xac, 0x56} }, -{ 0x8715, 16, {0x78, 0x08, 0x12, 0x9c, 0xfb, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xef, 0xf0, 0x85, 0x5d} }, -{ 0x8725, 16, {0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x5a, 0xe5, 0x55} }, -{ 0x8735, 16, {0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xb4, 0x62, 0x05, 0x43, 0x5a} }, -{ 0x8745, 16, {0x0a, 0x80, 0x10, 0xef, 0xb4, 0x72, 0x05, 0x43, 0x5a, 0x08, 0x80, 0x07, 0xef, 0xb4, 0x74, 0x03} }, -{ 0x8755, 16, {0x43, 0x5a, 0x02, 0xe5, 0x55, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff} }, -{ 0x8765, 16, {0x30, 0xe3, 0x03, 0x43, 0x5a, 0x80, 0xef, 0x30, 0xe7, 0x12, 0x43, 0x5a, 0x40, 0xe5, 0x5d, 0x24} }, -{ 0x8775, 16, {0x04, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x55, 0x24, 0x0b} }, -{ 0x8785, 16, {0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0x20, 0xe1, 0x03, 0x30, 0xe4, 0x23, 0xaf} }, -{ 0x8795, 16, {0x5b, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x3b, 0xe5, 0x5d} }, -{ 0x87a5, 16, {0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x44, 0x01, 0xf0, 0xe4, 0xf5, 0x5a} }, -{ 0x87b5, 16, {0x80, 0x10, 0xaf, 0x5b, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf4} }, -{ 0x87c5, 16, {0x52, 0x3b, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0x74, 0xbf, 0xf0, 0x85, 0x5d} }, -{ 0x87d5, 16, {0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xe4, 0xf0, 0xe5, 0x5a, 0xf0, 0xe5, 0x55, 0x24, 0x0a, 0xf5} }, -{ 0x87e5, 16, {0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35} }, -{ 0x87f5, 16, {0x5c, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x55, 0x24, 0x0a, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83} }, -{ 0x8805, 16, {0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xef, 0xf0, 0xe5} }, -{ 0x8815, 16, {0x55, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x06} }, -{ 0x8825, 16, {0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x55, 0x24, 0x09, 0xf5, 0x82, 0xe4} }, -{ 0x8835, 16, {0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5} }, -{ 0x8845, 16, {0x83, 0xef, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe4, 0xf0, 0x85, 0x5d} }, -{ 0x8855, 16, {0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xf0, 0xaf, 0x5b, 0x7d, 0x06, 0x12, 0x82, 0xd5, 0x75, 0x5a} }, -{ 0x8865, 16, {0x08, 0xe5, 0x55, 0x24, 0x0c, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0x60, 0x03, 0x43} }, -{ 0x8875, 16, {0x5a, 0x10, 0xe5, 0x5d, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x54, 0x03} }, -{ 0x8885, 16, {0x45, 0x5a, 0xf0, 0xe5, 0x55, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0x14} }, -{ 0x8895, 16, {0xff, 0x25, 0xe0, 0x25, 0xe0, 0xff, 0xe5, 0x55, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5} }, -{ 0x88a5, 16, {0x83, 0xe0, 0x24, 0xfb, 0x4f, 0xf5, 0x5a, 0xe5, 0x55, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x35, 0x54} }, -{ 0x88b5, 16, {0xf5, 0x83, 0xe0, 0x24, 0xd0, 0x60, 0x15, 0x14, 0x60, 0x17, 0x24, 0xc2, 0x60, 0x09, 0x24, 0x0a} }, -{ 0x88c5, 16, {0x70, 0x12, 0x43, 0x5a, 0x18, 0x80, 0x0d, 0x43, 0x5a, 0x08, 0x80, 0x08, 0x43, 0x5a, 0x38, 0x80} }, -{ 0x88d5, 16, {0x03, 0x43, 0x5a, 0x28, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe5, 0x5a, 0xf0} }, -{ 0x88e5, 9, {0xaf, 0x5b, 0x7d, 0x01, 0x12, 0x82, 0x50, 0x7f, 0x00} }, -{ 0x88ee, 1, {0x22} }, -{ 0x88ef, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xff, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4} }, -{ 0x88ff, 16, {0x34, 0x20, 0xad, 0x82, 0xfc, 0x90, 0x01, 0x2c, 0x74, 0x08, 0xf0, 0xef, 0x04, 0xa3, 0xf0, 0xe4} }, -{ 0x890f, 16, {0xa3, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xe5, 0x82, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5} }, -{ 0x891f, 16, {0x83, 0xe0, 0x90, 0x01, 0x2f, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xe5, 0x82, 0x24, 0x05, 0xf5, 0x82} }, -{ 0x892f, 16, {0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0x1e, 0x90, 0x01, 0x30, 0xf0, 0x74, 0x2c, 0x2f, 0xf8} }, -{ 0x893f, 16, {0xe6, 0xa3, 0xf0, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x54} }, -{ 0x894f, 16, {0x7f, 0x02, 0x12, 0x81, 0x11, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, 0xf3, 0xe5, 0x54, 0x5f} }, -{ 0x895f, 16, {0x90, 0x01, 0x32, 0xf0, 0x7e, 0x01, 0x7f, 0x2c, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00, 0x75, 0x5e} }, -{ 0x896f, 11, {0x00, 0x75, 0x5d, 0x00, 0x7d, 0x07, 0x12, 0x8e, 0x0c, 0x7f, 0x00} }, -{ 0x897a, 1, {0x22} }, -{ 0x897b, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0xf8, 0xf5, 0x82, 0xe4, 0x34, 0x1f} }, -{ 0x898b, 16, {0xaf, 0x82, 0xfe, 0x90, 0x01, 0x33, 0x74, 0x0a, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xe5, 0x82, 0x24} }, -{ 0x899b, 16, {0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x90, 0x01, 0x34, 0xf0, 0x7e, 0x01, 0x7f} }, -{ 0x89ab, 16, {0x33, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00, 0x75, 0x5e, 0x00, 0x75, 0x5d, 0x00, 0x7d, 0x02, 0x12} }, -{ 0x89bb, 4, {0x8e, 0x0c, 0x7f, 0x00} }, -{ 0x89bf, 1, {0x22} }, -{ 0x89c0, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0xf8, 0xf5, 0x82, 0xe4, 0x34, 0x1f} }, -{ 0x89d0, 16, {0xad, 0x82, 0xfc, 0x8f, 0x82, 0xa3, 0xe0, 0x60, 0x0f, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c} }, -{ 0x89e0, 16, {0xf5, 0x83, 0xe0, 0x44, 0x02, 0xf0, 0x80, 0x11, 0xae, 0x04, 0xaf, 0x05, 0xef, 0x24, 0x04, 0xf5} }, -{ 0x89f0, 11, {0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0xf0, 0x7f, 0x00} }, -{ 0x89fb, 1, {0x22} }, -{ 0x89fc, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0xf8, 0xf5, 0x82, 0xe4, 0x34, 0x1f} }, -{ 0x8a0c, 16, {0xad, 0x82, 0xfc, 0x8f, 0x82, 0xa3, 0xe0, 0x60, 0x0f, 0xed, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3c} }, -{ 0x8a1c, 16, {0xf5, 0x83, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x11, 0xae, 0x04, 0xaf, 0x05, 0xef, 0x24, 0x04, 0xf5} }, -{ 0x8a2c, 11, {0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0x54, 0xfe, 0xf0, 0x7f, 0x00} }, -{ 0x8a37, 1, {0x22} }, -{ 0x8a38, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0xf8, 0xf5, 0x82, 0xe4, 0x34, 0x1f} }, -{ 0x8a48, 16, {0xad, 0x82, 0xfc, 0x8f, 0x82, 0xa3, 0xe0, 0x60, 0x0d, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xa3, 0xa3} }, -{ 0x8a58, 16, {0xe0, 0x44, 0x40, 0xf0, 0x80, 0x0f, 0xae, 0x04, 0xaf, 0x05, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3} }, -{ 0x8a68, 7, {0xa3, 0xe0, 0x54, 0xbf, 0xf0, 0x7f, 0x00} }, -{ 0x8a6f, 1, {0x22} }, -{ 0x8a70, 4, {0x8e, 0x54, 0x8f, 0x55} }, -{ 0x8a74, 16, {0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xe0, 0xf5, 0x58, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x24, 0xfe, 0x60} }, -{ 0x8a84, 16, {0x16, 0x14, 0x60, 0x1f, 0x14, 0x60, 0x28, 0x24, 0x03, 0x70, 0x2e, 0x7e, 0x7e, 0x7f, 0x80, 0x75} }, -{ 0x8a94, 16, {0x56, 0x7e, 0x75, 0x57, 0x80, 0x80, 0x22, 0x7e, 0x7e, 0x7f, 0x00, 0x75, 0x56, 0x7e, 0x75, 0x57} }, -{ 0x8aa4, 16, {0x00, 0x80, 0x16, 0x7e, 0x7d, 0x7f, 0x80, 0x75, 0x56, 0x7d, 0x75, 0x57, 0x80, 0x80, 0x0a, 0x7e} }, -{ 0x8ab4, 16, {0x7d, 0x7f, 0x00, 0x75, 0x56, 0x7d, 0x75, 0x57, 0x00, 0xe5, 0x58, 0x70, 0x20, 0x85, 0x57, 0x82} }, -{ 0x8ac4, 16, {0x85, 0x56, 0x83, 0x74, 0xff, 0xf0, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0x25, 0xe0, 0x24} }, -{ 0x8ad4, 16, {0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x4d, 0xe5, 0x55, 0x24} }, -{ 0x8ae4, 16, {0x02, 0xff, 0xe4, 0x35, 0x54, 0xfe, 0xe5, 0x58, 0x60, 0x23, 0x0f, 0xef, 0xac, 0x06, 0x70, 0x01} }, -{ 0x8af4, 16, {0x0e, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfd, 0x05, 0x57, 0xe5, 0x57, 0xaa, 0x56, 0x70, 0x02} }, -{ 0x8b04, 16, {0x05, 0x56, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xed, 0xf0, 0x15, 0x58, 0x80, 0xd9, 0x85, 0x55, 0x82} }, -{ 0x8b14, 16, {0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0x25, 0xe0, 0x24} }, -{ 0x8b24, 12, {0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xef, 0xf0, 0x7f, 0x00} }, -{ 0x8b30, 1, {0x22} }, -{ 0x8b31, 16, {0xef, 0x24, 0x05, 0xf5, 0x55, 0xe4, 0x3e, 0xf5, 0x54, 0x90, 0x01, 0x35, 0x74, 0x07, 0xf0, 0x90} }, -{ 0x8b41, 16, {0x01, 0x7a, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x36, 0xf0, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3} }, -{ 0x8b51, 16, {0xa3, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x56, 0xf5, 0x57, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, -{ 0x8b61, 16, {0xe0, 0x24, 0x9e, 0x60, 0x61, 0x24, 0xf9, 0x60, 0x0e, 0x24, 0xf1, 0x70, 0x03, 0x02, 0x8c, 0x12} }, -{ 0x8b71, 16, {0x24, 0x14, 0x60, 0x03, 0x02, 0x8c, 0x5e, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe} }, -{ 0x8b81, 16, {0xa3, 0xe0, 0xff, 0xc3, 0xe4, 0x9f, 0xf5, 0x59, 0x74, 0x01, 0x9e, 0xf5, 0x58, 0xd3, 0xe5, 0x59} }, -{ 0x8b91, 16, {0x94, 0x40, 0xe5, 0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x40, 0xd3, 0xe5} }, -{ 0x8ba1, 16, {0x57, 0x95, 0x59, 0xe5, 0x56, 0x95, 0x58, 0x50, 0x03, 0x02, 0x8c, 0x61, 0xae, 0x58, 0xaf, 0x59} }, -{ 0x8bb1, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e} }, -{ 0x8bc1, 16, {0x56, 0xf5, 0x57, 0x02, 0x8c, 0x61, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3} }, -{ 0x8bd1, 16, {0xe0, 0xff, 0xc3, 0x74, 0x30, 0x9f, 0xf5, 0x59, 0xe4, 0x9e, 0xf5, 0x58, 0xd3, 0xe5, 0x59, 0x94} }, -{ 0x8be1, 16, {0x10, 0xe5, 0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x10, 0xd3, 0xe5, 0x57} }, -{ 0x8bf1, 16, {0x95, 0x59, 0xe5, 0x56, 0x95, 0x58, 0x40, 0x68, 0xae, 0x58, 0xaf, 0x59, 0x85, 0x55, 0x82, 0x85} }, -{ 0x8c01, 16, {0x54, 0x83, 0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e, 0x56, 0xf5, 0x57, 0x80} }, -{ 0x8c11, 16, {0x4f, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0xe4, 0x9f} }, -{ 0x8c21, 16, {0xf5, 0x59, 0xe4, 0x9e, 0xf5, 0x58, 0x45, 0x59, 0x60, 0x0b, 0xd3, 0xe5, 0x59, 0x94, 0x40, 0xe5} }, -{ 0x8c31, 16, {0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x40, 0xd3, 0xe5, 0x57, 0x95, 0x59} }, -{ 0x8c41, 16, {0xe5, 0x56, 0x95, 0x58, 0x40, 0x17, 0xae, 0x58, 0xaf, 0x59, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, -{ 0x8c51, 16, {0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e, 0x56, 0xf5, 0x57, 0x7f, 0x01, 0x22} }, -{ 0x8c61, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0x24, 0x9e, 0x70, 0x03, 0x02, 0x8d, 0x21, 0x24, 0xf9} }, -{ 0x8c71, 16, {0x60, 0x58, 0x24, 0xf1, 0x70, 0x03, 0x02, 0x8d, 0x71, 0x24, 0x14, 0x60, 0x03, 0x02, 0x8d, 0xb5} }, -{ 0x8c81, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xd3, 0x94, 0xff, 0xee} }, -{ 0x8c91, 16, {0x94, 0x00, 0x40, 0x03, 0x02, 0x8d, 0xb5, 0x90, 0x01, 0x75, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57} }, -{ 0x8ca1, 16, {0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x70, 0x03, 0x02, 0x8d, 0xb5, 0x90, 0x01, 0x75, 0xe0} }, -{ 0x8cb1, 16, {0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b} }, -{ 0x8cc1, 16, {0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd2, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, -{ 0x8cd1, 16, {0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x80, 0xee, 0x94, 0x00, 0x50, 0x03, 0x02, 0x8d} }, -{ 0x8ce1, 16, {0xb5, 0xd3, 0xef, 0x94, 0xff, 0xee, 0x94, 0x00, 0x40, 0x03, 0x02, 0x8d, 0xb5, 0x90, 0x01, 0x76} }, -{ 0x8cf1, 16, {0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x70, 0x03, 0x02} }, -{ 0x8d01, 16, {0x8d, 0xb5, 0x90, 0x01, 0x76, 0xe0, 0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a} }, -{ 0x8d11, 16, {0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd2} }, -{ 0x8d21, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x20, 0xee} }, -{ 0x8d31, 16, {0x94, 0x00, 0x50, 0x03, 0x02, 0x8d, 0xb5, 0xd3, 0xef, 0x94, 0x2f, 0xee, 0x94, 0x00, 0x50, 0x74} }, -{ 0x8d41, 16, {0x90, 0x01, 0x77, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e} }, -{ 0x8d51, 16, {0x60, 0x62, 0x90, 0x01, 0x77, 0xe0, 0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a} }, -{ 0x8d61, 16, {0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd5} }, -{ 0x8d71, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0xa3, 0xe0, 0x90, 0x01, 0x78, 0xcf, 0xf0} }, -{ 0x8d81, 16, {0xa3, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x60, 0x24} }, -{ 0x8d91, 16, {0x90, 0x01, 0x78, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xe0} }, -{ 0x8da1, 16, {0xff, 0x90, 0x01, 0x7a, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83} }, -{ 0x8db1, 16, {0xef, 0xf0, 0x80, 0xcf, 0x7e, 0x01, 0x7f, 0x35, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3} }, -{ 0x8dc1, 16, {0xa3, 0xe0, 0xa3, 0xe0, 0x04, 0xfd, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00, 0x75, 0x5e, 0x00, 0x75} }, -{ 0x8dd1, 7, {0x5d, 0x00, 0x12, 0x8e, 0x0c, 0x7f, 0x00} }, -{ 0x8dd8, 1, {0x22} }, -{ 0x8dd9, 16, {0x8e, 0x61, 0x8f, 0x62, 0x8c, 0x63, 0x8d, 0x64, 0xaf, 0x03, 0x1b, 0xef, 0x60, 0x24, 0x05, 0x62} }, -{ 0x8de9, 16, {0xe5, 0x62, 0xae, 0x61, 0x70, 0x02, 0x05, 0x61, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe0, 0xff, 0x05} }, -{ 0x8df9, 16, {0x64, 0xe5, 0x64, 0xac, 0x63, 0x70, 0x02, 0x05, 0x63, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0} }, -{ 0x8e09, 3, {0x80, 0xd6, 0x22} }, -{ 0x8e0c, 16, {0x8d, 0x5c, 0xab, 0x07, 0xaa, 0x06, 0xaf, 0x60, 0xae, 0x5f, 0xad, 0x5e, 0xac, 0x5d, 0xec, 0x4d} }, -{ 0x8e1c, 16, {0x4e, 0x4f, 0x60, 0x1c, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x1c, 0x7f, 0xff, 0x7e, 0xff, 0x7d} }, -{ 0x8e2c, 16, {0xff, 0x7c, 0xff, 0x78, 0x5d, 0x12, 0x9d, 0x0e, 0xec, 0x4d, 0x4e, 0x4f, 0x60, 0x09, 0x80, 0xe4} }, -{ 0x8e3c, 16, {0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0xf9, 0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0x16, 0xaf, 0x03} }, -{ 0x8e4c, 16, {0xae, 0x02, 0x7c, 0x7b, 0x7d, 0x80, 0xab, 0x5c, 0x12, 0x8d, 0xd9, 0x90, 0x7f, 0xc3, 0xe5, 0x5c} }, -{ 0x8e5c, 7, {0xf0, 0x7f, 0x01, 0x22, 0x7f, 0x00, 0x22} }, -{ 0x8e63, 16, {0x90, 0x01, 0x84, 0x74, 0x0b, 0xf0, 0x90, 0x20, 0x70, 0xe0, 0x54, 0xf0, 0xff, 0xc4, 0x54, 0x0f} }, -{ 0x8e73, 16, {0x90, 0x01, 0x85, 0xf0, 0x90, 0x11, 0xfd, 0xe4, 0x93, 0x90, 0x01, 0x86, 0xf0, 0x90, 0x11, 0xfe} }, -{ 0x8e83, 16, {0xe4, 0x93, 0x90, 0x01, 0x87, 0xf0, 0xe4, 0x90, 0x01, 0x7c, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3} }, -{ 0x8e93, 16, {0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x88, 0xf0, 0x7e} }, -{ 0x8ea3, 16, {0x01, 0x7f, 0x7c, 0x12, 0x19, 0xc1, 0x7e, 0x01, 0x7f, 0x84, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00} }, -{ 0x8eb3, 13, {0x75, 0x5e, 0x00, 0x75, 0x5d, 0x00, 0x7d, 0x14, 0x12, 0x8e, 0x0c, 0x7f, 0x00} }, -{ 0x8ec0, 1, {0x22} }, -{ 0x8ec1, 4, {0x8e, 0x4b, 0x8f, 0x4c} }, -{ 0x8ec5, 16, {0x85, 0x4b, 0x4e, 0x85, 0x4c, 0x4f, 0xe5, 0x4f, 0x24, 0x01, 0xf5, 0x53, 0xe4, 0x35, 0x4e, 0xf5} }, -{ 0x8ed5, 16, {0x52, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xe0, 0x14, 0xb4, 0x0f, 0x00, 0x40, 0x03, 0x02, 0x8f} }, -{ 0x8ee5, 16, {0xd6, 0x90, 0x8e, 0xed, 0xf8, 0x28, 0x28, 0x73, 0x02, 0x8f, 0x1a, 0x02, 0x8f, 0x26, 0x02, 0x8f} }, -{ 0x8ef5, 16, {0x32, 0x02, 0x8f, 0x5c, 0x02, 0x8f, 0x67, 0x02, 0x8f, 0x72, 0x02, 0x8f, 0x7d, 0x02, 0x8f, 0x88} }, -{ 0x8f05, 16, {0x02, 0x8f, 0x93, 0x02, 0x8f, 0x9e, 0x02, 0x8f, 0xa9, 0x02, 0x8f, 0xb0, 0x02, 0x8f, 0xd6, 0x02} }, -{ 0x8f15, 16, {0x8f, 0xbb, 0x02, 0x8f, 0xc6, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x83, 0x5f, 0x8f, 0x4d, 0x02, 0x8f} }, -{ 0x8f25, 16, {0xd6, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x84, 0x33, 0x8f, 0x4d, 0x02, 0x8f, 0xd6, 0x85, 0x52, 0x50} }, -{ 0x8f35, 16, {0x85, 0x53, 0x51, 0xe5, 0x51, 0x24, 0x01, 0xff, 0xe4, 0x35, 0x50, 0xfe, 0x12, 0x85, 0x08, 0xaf} }, -{ 0x8f45, 16, {0x51, 0xae, 0x50, 0x12, 0x85, 0x9b, 0xef, 0x70, 0x03, 0x02, 0x8f, 0xd6, 0xaf, 0x51, 0xae, 0x50} }, -{ 0x8f55, 16, {0x12, 0x85, 0xe1, 0x8f, 0x4d, 0x80, 0x7a, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x89, 0xc0, 0x8f, 0x4d} }, -{ 0x8f65, 16, {0x80, 0x6f, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x89, 0xfc, 0x8f, 0x4d, 0x80, 0x64, 0xaf, 0x53, 0xae} }, -{ 0x8f75, 16, {0x52, 0x12, 0x8a, 0x38, 0x8f, 0x4d, 0x80, 0x59, 0xaf, 0x4c, 0xae, 0x4b, 0x12, 0x8b, 0x31, 0x8f} }, -{ 0x8f85, 16, {0x4d, 0x80, 0x4e, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x88, 0xef, 0x8f, 0x4d, 0x80, 0x43, 0xaf, 0x53} }, -{ 0x8f95, 16, {0xae, 0x52, 0x12, 0x84, 0xc4, 0x8f, 0x4d, 0x80, 0x38, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x89, 0x7b} }, -{ 0x8fa5, 16, {0x8f, 0x4d, 0x80, 0x2d, 0x12, 0x8e, 0x63, 0x8f, 0x4d, 0x80, 0x26, 0xaf, 0x53, 0xae, 0x52, 0x12} }, -{ 0x8fb5, 16, {0x11, 0xe5, 0x8f, 0x4d, 0x80, 0x1b, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x8a, 0x70, 0x8f, 0x4d, 0x80} }, -{ 0x8fc5, 16, {0x10, 0xaf, 0x4c, 0xae, 0x4b, 0x7c, 0x02, 0x7d, 0xaf, 0x7b, 0x40, 0x12, 0x8d, 0xd9, 0xe4, 0xf5} }, -{ 0x8fd5, 16, {0x4d, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xe0, 0xff, 0x14, 0x24, 0xfa, 0x50, 0x04, 0x24, 0xfe} }, -{ 0x8fe5, 16, {0x70, 0x2b, 0x90, 0x01, 0x98, 0x74, 0x10, 0xf0, 0xa3, 0xef, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, -{ 0x8ff5, 16, {0x83, 0xe0, 0x90, 0x01, 0x9a, 0xf0, 0x7e, 0x01, 0x7f, 0x98, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00} }, -{ 0x9005, 15, {0x75, 0x5e, 0x00, 0x75, 0x5d, 0x00, 0x7d, 0x03, 0x12, 0x8e, 0x0c, 0x8f, 0x4d, 0xaf, 0x4d} }, -{ 0x9014, 1, {0x22} }, -{ 0x9015, 8, {0x8f, 0x4e, 0x8e, 0x4d, 0x8d, 0x4c, 0x8c, 0x4b} }, -{ 0x901d, 16, {0x75, 0x55, 0x01, 0x75, 0x56, 0x9c, 0xe4, 0xf5, 0x54, 0xaf, 0x50, 0x15, 0x50, 0xef, 0x70, 0x03} }, -{ 0x902d, 16, {0x02, 0x90, 0xb3, 0xaf, 0x4f, 0xe4, 0xfc, 0xfd, 0xfe, 0xf8, 0xf9, 0xfa, 0xab, 0x07, 0xaf, 0x4e} }, -{ 0x903d, 16, {0xae, 0x4d, 0xad, 0x4c, 0xac, 0x4b, 0x12, 0x9c, 0x58, 0xaf, 0x03, 0x8f, 0x53, 0xaf, 0x4e, 0xae} }, -{ 0x904d, 16, {0x4d, 0xad, 0x4c, 0xac, 0x4b, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, 0x4f, 0xe4} }, -{ 0x905d, 16, {0xfc, 0xfd, 0xfe, 0xf8, 0xf9, 0xfa, 0xab, 0x07, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04} }, -{ 0x906d, 16, {0x12, 0x9c, 0x58, 0x8f, 0x4e, 0x8e, 0x4d, 0x8d, 0x4c, 0x8c, 0x4b, 0xe5, 0x53, 0x24, 0x30, 0xf5} }, -{ 0x907d, 16, {0x53, 0xd3, 0x94, 0x39, 0x40, 0x06, 0x74, 0x07, 0x25, 0x53, 0xf5, 0x53, 0x05, 0x56, 0xe5, 0x56} }, -{ 0x908d, 16, {0xae, 0x55, 0x70, 0x02, 0x05, 0x55, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe4, 0xf0, 0x05, 0x56, 0xe5} }, -{ 0x909d, 16, {0x56, 0xae, 0x55, 0x70, 0x02, 0x05, 0x55, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x53, 0xf0, 0x05} }, -{ 0x90ad, 16, {0x54, 0x05, 0x54, 0x02, 0x90, 0x26, 0xe5, 0x56, 0x15, 0x56, 0x70, 0x02, 0x15, 0x55, 0xaf, 0x54} }, -{ 0x90bd, 16, {0x15, 0x54, 0xef, 0x60, 0x23, 0xe5, 0x56, 0x15, 0x56, 0xae, 0x55, 0x70, 0x02, 0x15, 0x55, 0xf5} }, -{ 0x90cd, 16, {0x82, 0x8e, 0x83, 0xe0, 0xff, 0x05, 0x52, 0xe5, 0x52, 0xac, 0x51, 0x70, 0x02, 0x05, 0x51, 0x14} }, -{ 0x90dd, 8, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x80, 0xd6} }, -{ 0x90e5, 1, {0x22} }, -{ 0x90e6, 16, {0xe4, 0x90, 0x01, 0xc9, 0xf0, 0x7e, 0x01, 0x7f, 0xca, 0x90, 0x01, 0xbe, 0xee, 0xf0, 0xa3, 0xef} }, -{ 0x90f6, 10, {0xf0, 0x90, 0x01, 0xc2, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22} }, -{ 0x9100, 16, {0xaa, 0x07, 0xa9, 0x05, 0x90, 0x01, 0xc9, 0xe0, 0xc3, 0x94, 0x40, 0x50, 0x61, 0xac, 0x02, 0x74} }, -{ 0x9110, 16, {0x01, 0x7e, 0x00, 0xa8, 0x04, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff} }, -{ 0x9120, 16, {0xe4, 0xef, 0x55, 0x30, 0x60, 0x45, 0xea, 0x04, 0xff, 0x90, 0x01, 0xc2, 0xe0, 0xfc, 0xa3, 0xe0} }, -{ 0x9130, 16, {0xfd, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0xa3, 0xe9, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xa3} }, -{ 0x9140, 16, {0xeb, 0xf0, 0x90, 0x01, 0xc2, 0xe4, 0x75, 0xf0, 0x03, 0x12, 0x9b, 0xb8, 0xfc, 0xd3, 0xe5, 0xf0} }, -{ 0x9150, 16, {0x94, 0x87, 0xec, 0x94, 0x02, 0x40, 0x0a, 0x90, 0x01, 0xc2, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0xca} }, -{ 0x9160, 16, {0xf0, 0xc2, 0xaf, 0x90, 0x01, 0xc9, 0xe0, 0x04, 0xf0, 0xd2, 0xaf, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, -{ 0x9170, 1, {0x22} }, -{ 0x9171, 16, {0x90, 0x01, 0xc9, 0xe0, 0xd3, 0x94, 0x00, 0x40, 0x55, 0x90, 0x01, 0xbe, 0xe0, 0xfc, 0xa3, 0xe0} }, -{ 0x9181, 16, {0xaa, 0x04, 0xf9, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0xaa, 0x06, 0xa9, 0x07, 0xa8} }, -{ 0x9191, 16, {0x01, 0xac, 0x02, 0xad, 0x03, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, 0x7e, 0x00, 0x7f, 0x03, 0x12} }, -{ 0x91a1, 16, {0x9b, 0x49, 0x90, 0x01, 0xbe, 0xe4, 0x75, 0xf0, 0x03, 0x12, 0x9b, 0xb8, 0xfc, 0xd3, 0xe5, 0xf0} }, -{ 0x91b1, 16, {0x94, 0x87, 0xec, 0x94, 0x02, 0x40, 0x0a, 0x90, 0x01, 0xbe, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0xca} }, -{ 0x91c1, 16, {0xf0, 0xc2, 0xaf, 0x90, 0x01, 0xc9, 0xe0, 0x14, 0xf0, 0xd2, 0xaf, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, -{ 0x91d1, 1, {0x22} }, -{ 0x91d2, 16, {0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0x5e, 0x7e, 0x7b, 0x7f, 0x80, 0x75, 0x50, 0x7b, 0x75, 0x51} }, -{ 0x91e2, 16, {0x80, 0xe5, 0x51, 0x24, 0x01, 0xff, 0xe4, 0x35, 0x50, 0xa9, 0x07, 0x7b, 0x01, 0x8b, 0x52, 0xf5} }, -{ 0x91f2, 16, {0x53, 0x89, 0x54, 0xfe, 0x12, 0x91, 0x71, 0xef, 0x60, 0x3b, 0xab, 0x52, 0xaa, 0x53, 0xa9, 0x54} }, -{ 0x9202, 16, {0x12, 0x9b, 0x72, 0x14, 0xff, 0x90, 0x00, 0x01, 0x12, 0x9b, 0x8b, 0xb4, 0x02, 0x16, 0xc2, 0xaf} }, -{ 0x9212, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x44} }, -{ 0x9222, 16, {0x04, 0xf0, 0xd2, 0xaf, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0x74, 0x0d, 0xf0, 0x90, 0x7f, 0xc3} }, -{ 0x9232, 5, {0x74, 0x04, 0xf0, 0xd2, 0xaf} }, -{ 0x9237, 1, {0x22} }, -{ 0x9238, 16, {0x12, 0x91, 0xd2, 0xe4, 0xf5, 0x4b, 0x74, 0x36, 0x25, 0x4b, 0xf8, 0xe6, 0x54, 0xf0, 0xf5, 0x4c} }, -{ 0x9248, 16, {0x74, 0xc5, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5, 0x83, 0xe0, 0x65, 0x4c, 0xff, 0xc4} }, -{ 0x9258, 16, {0x54, 0x0f, 0xf5, 0x4d, 0x60, 0x22, 0x74, 0xc5, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5} }, -{ 0x9268, 16, {0x83, 0xe5, 0x4c, 0xf0, 0xaf, 0x4b, 0x7d, 0x01, 0xe5, 0x4c, 0x45, 0x4d, 0xfb, 0x12, 0x91, 0x00} }, -{ 0x9278, 16, {0xef, 0x70, 0x05, 0x12, 0x91, 0xd2, 0x80, 0xec, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40} }, -{ 0x9288, 16, {0xb5, 0x12, 0x91, 0xd2, 0xe5, 0x3a, 0x60, 0x48, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8} }, -{ 0x9298, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x55, 0x3a, 0x60, 0x29, 0xe5, 0x4b} }, -{ 0x92a8, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x30, 0xe6} }, -{ 0x92b8, 16, {0x16, 0xaf, 0x4b, 0x7d, 0x04, 0x7b, 0x80, 0x12, 0x91, 0x00, 0xef, 0x70, 0x05, 0x12, 0x91, 0xd2} }, -{ 0x92c8, 16, {0x80, 0xef, 0xe5, 0x4c, 0xf4, 0x52, 0x3a, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0xbb} }, -{ 0x92d8, 16, {0x90, 0x03, 0x00, 0xe0, 0x60, 0x03, 0x02, 0x93, 0xa5, 0x74, 0x19, 0xf0, 0x7f, 0x02, 0x12, 0x81} }, -{ 0x92e8, 16, {0x11, 0x8e, 0x4e, 0x8f, 0x4f, 0xc3, 0xe5, 0x4e, 0x64, 0x80, 0x94, 0x80, 0x40, 0xee, 0x90, 0x01} }, -{ 0x92f8, 16, {0xbc, 0xe0, 0x65, 0x4f, 0xf0, 0x60, 0x37, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8, 0x07} }, -{ 0x9308, 16, {0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x90, 0x01, 0xbc, 0xe0, 0x55, 0x4c, 0x60} }, -{ 0x9318, 16, {0x14, 0xaf, 0x4b, 0x7d, 0x08, 0xe5, 0x4c, 0x55, 0x4f, 0xfb, 0x12, 0x91, 0x00, 0xef, 0x70, 0x05} }, -{ 0x9328, 16, {0x12, 0x91, 0xd2, 0x80, 0xec, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0xcc, 0x90, 0x01} }, -{ 0x9338, 16, {0xbc, 0xe5, 0x4f, 0xf0, 0xe4, 0xf5, 0x4b, 0xc2, 0xaf, 0x74, 0x32, 0x25, 0x4b, 0xf8, 0xe6, 0xf5} }, -{ 0x9348, 16, {0x4c, 0xe4, 0xf6, 0xd2, 0xaf, 0x53, 0x4c, 0x1e, 0xe5, 0x4c, 0x60, 0x11, 0xaf, 0x4b, 0x7d, 0x02} }, -{ 0x9358, 16, {0xab, 0x4c, 0x12, 0x91, 0x00, 0xef, 0x70, 0x05, 0x12, 0x91, 0xd2, 0x80, 0xef, 0x74, 0x2c, 0x25} }, -{ 0x9368, 16, {0x4b, 0xf8, 0xe6, 0xf5, 0x4c, 0x74, 0xfc, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83} }, -{ 0x9378, 16, {0xe0, 0x65, 0x4c, 0x60, 0x11, 0xaf, 0x4b, 0x7d, 0x04, 0xab, 0x4c, 0x12, 0x91, 0x00, 0xef, 0x70} }, -{ 0x9388, 16, {0x05, 0x12, 0x91, 0xd2, 0x80, 0xef, 0x74, 0xfc, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5} }, -{ 0x9398, 16, {0x83, 0xe5, 0x4c, 0xf0, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0x9a, 0x12, 0x91, 0xd2} }, -{ 0x93a8, 1, {0x22} }, -{ 0x93a9, 12, {0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x64, 0x02, 0x93, 0xf0} }, -{ 0x93b5, 16, {0x02, 0x05, 0xa3, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2} }, -{ 0x93c5, 16, {0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33} }, -{ 0x93d5, 16, {0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf} }, -{ 0x93e5, 16, {0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x94, 0x35, 0xe4, 0x7e} }, -{ 0x93f5, 16, {0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93} }, -{ 0x9405, 16, {0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3} }, -{ 0x9415, 16, {0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca} }, -{ 0x9425, 16, {0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe} }, -{ 0x9435, 16, {0x60, 0x24, 0x02, 0x8a, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x81, 0x82, 0x84, 0x88} }, -{ 0x9445, 16, {0x90, 0xa0, 0xc0, 0xc1, 0xc2, 0xc4, 0xc8, 0xd0, 0xe0, 0xe1, 0xe2, 0xe4, 0xe8, 0xf0, 0xf1, 0xf2} }, -{ 0x9455, 8, {0xf4, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xfe, 0xff} }, -{ 0x945d, 1, {0x00} }, -{ 0x945e, 11, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18} }, -{ 0x9469, 16, {0x90, 0x20, 0x60, 0xe0, 0x54, 0x0f, 0xfe, 0x30, 0xe0, 0x05, 0x90, 0x20, 0x02, 0xe0, 0xff, 0xee} }, -{ 0x9479, 16, {0x30, 0xe1, 0x05, 0x90, 0x20, 0x0a, 0xe0, 0xff, 0xee, 0x30, 0xe2, 0x05, 0x90, 0x20, 0x12, 0xe0} }, -{ 0x9489, 16, {0xff, 0xee, 0x30, 0xe3, 0x05, 0x90, 0x20, 0x1a, 0xe0, 0xff, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x1e} }, -{ 0x9499, 10, {0x04, 0xe4, 0xf0, 0x80, 0x05, 0x90, 0x01, 0xc4, 0xee, 0xf0} }, -{ 0x94a3, 9, {0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, -{ 0x94ac, 2, {0xa9, 0x03} }, -{ 0x94ae, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xab, 0x82, 0xfa, 0xe5} }, -{ 0x94be, 16, {0x57, 0x45, 0x58, 0xf5, 0x59, 0xe9, 0x60, 0x14, 0x8a, 0x83, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82} }, -{ 0x94ce, 16, {0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x4d, 0xf0, 0xe4, 0xfe, 0x80, 0x13, 0xeb, 0x24, 0x04, 0xf5} }, -{ 0x94de, 16, {0x82, 0xe4, 0x3a, 0xf5, 0x83, 0xe0, 0xff, 0xed, 0xf4, 0xfc, 0xef, 0x5c, 0xf0, 0xae, 0x59, 0xeb} }, -{ 0x94ee, 16, {0x24, 0x06, 0xf5, 0x82, 0xe4, 0x3a, 0xf5, 0x83, 0xe0, 0x55, 0x59, 0xfc, 0xb5, 0x06, 0x03, 0xaf} }, -{ 0x94fe, 16, {0x05, 0x22, 0xe5, 0x57, 0x5c, 0xfe, 0xe5, 0x58, 0x5c, 0xfd, 0xe9, 0x60, 0x16, 0xee, 0x70, 0x04} }, -{ 0x950e, 16, {0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xae, 0x07, 0xed, 0x70, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f} }, -{ 0x951e, 16, {0x00, 0xad, 0x07, 0xee, 0x60, 0x03, 0xaf, 0x57, 0x22, 0xed, 0x60, 0x03, 0xaf, 0x58, 0x22, 0x7f} }, -{ 0x952e, 1, {0x00} }, -{ 0x952f, 1, {0x22} }, -{ 0x9530, 16, {0x75, 0x50, 0x02, 0x75, 0x51, 0xb0, 0x90, 0x03, 0x35, 0x74, 0x0f, 0xf0, 0x85, 0x51, 0x82, 0x85} }, -{ 0x9540, 16, {0x50, 0x83, 0xe0, 0xff, 0x90, 0x03, 0x36, 0xf0, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xa3, 0xe0} }, -{ 0x9550, 16, {0x90, 0x03, 0x37, 0xf0, 0xa3, 0x74, 0xff, 0xf0, 0x75, 0x52, 0x03, 0x75, 0x53, 0x39, 0xef, 0x14} }, -{ 0x9560, 16, {0xb4, 0x0b, 0x00, 0x40, 0x03, 0x02, 0x99, 0x98, 0x90, 0x95, 0x6f, 0xf8, 0x28, 0x28, 0x73, 0x02} }, -{ 0x9570, 16, {0x95, 0x90, 0x02, 0x96, 0x2f, 0x02, 0x97, 0x34, 0x02, 0x97, 0x54, 0x02, 0x97, 0x54, 0x02, 0x97} }, -{ 0x9580, 16, {0xef, 0x02, 0x98, 0x2a, 0x02, 0x98, 0x4f, 0x02, 0x99, 0x0d, 0x02, 0x99, 0x39, 0x02, 0x99, 0x65} }, -{ 0x9590, 16, {0xe4, 0xf5, 0x4b, 0xe5, 0x4b, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20} }, -{ 0x95a0, 16, {0xaf, 0x82, 0xf5, 0x4e, 0x8f, 0x4f, 0xe4, 0xff, 0xe4, 0xfe, 0xef, 0x60, 0x10, 0x74, 0x8a, 0x2e} }, -{ 0x95b0, 16, {0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xf4, 0xf5, 0x4c, 0x80, 0x0d, 0x74, 0x8a, 0x2e} }, -{ 0x95c0, 16, {0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xf5, 0x4c, 0xe5, 0x4f, 0x24, 0x07, 0xf5, 0x82} }, -{ 0x95d0, 16, {0xe4, 0x35, 0x4e, 0xf5, 0x83, 0xe5, 0x4c, 0xf0, 0xe0, 0xf5, 0x4d, 0x65, 0x4c, 0x60, 0x38, 0xe4} }, -{ 0x95e0, 16, {0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xfd, 0x05, 0x53, 0xe5, 0x53, 0xaa, 0x52, 0x70, 0x02} }, -{ 0x95f0, 16, {0x05, 0x52, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xed, 0xf0, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52, 0x70} }, -{ 0x9600, 16, {0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe5, 0x4c, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, -{ 0x9610, 16, {0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x99, 0x9e, 0x0e, 0xbe, 0x24, 0x8f, 0x0f, 0xef, 0x64, 0x02, 0x70} }, -{ 0x9620, 16, {0x87, 0x05, 0x4b, 0xe5, 0x4b, 0x64, 0x04, 0x60, 0x03, 0x02, 0x95, 0x93, 0x02, 0x99, 0x9e, 0xe4} }, -{ 0x9630, 16, {0xf5, 0x4b, 0xaf, 0x4b, 0xe4, 0xfd, 0x12, 0x82, 0x50, 0x05, 0x4b, 0xe5, 0x4b, 0xd3, 0x94, 0x03} }, -{ 0x9640, 16, {0x40, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x94, 0xf0, 0xa3, 0x74, 0x5e, 0xf0, 0xe4, 0xf5, 0x4d, 0x7e} }, -{ 0x9650, 16, {0x20, 0x7f, 0x00, 0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8} }, -{ 0x9660, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x90, 0x01, 0xc4, 0xf0, 0x90, 0x01} }, -{ 0x9670, 16, {0xc0, 0xe4, 0xf0, 0xa3, 0x74, 0x0a, 0xf0, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0x74, 0x02} }, -{ 0x9680, 16, {0xf0, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x4c, 0x34, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0} }, -{ 0x9690, 16, {0x70, 0xef, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xff, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52} }, -{ 0x96a0, 16, {0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, -{ 0x96b0, 16, {0x83, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x01, 0xc4, 0xf0, 0x75, 0x4d, 0xff, 0x90, 0x01, 0xc4, 0xe0} }, -{ 0x96c0, 16, {0xff, 0x60, 0x37, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xfe, 0x05, 0x53, 0xe5, 0x53} }, -{ 0x96d0, 16, {0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xee, 0xf0, 0x05, 0x53, 0xe5} }, -{ 0x96e0, 16, {0x53, 0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x85, 0x53} }, -{ 0x96f0, 16, {0x82, 0x85, 0x52, 0x83, 0xe5, 0x4c, 0xf0, 0x75, 0x4d, 0xff, 0xe5, 0x4d, 0x70, 0x16, 0x74, 0x08} }, -{ 0x9700, 16, {0x25, 0x4f, 0xf5, 0x4f, 0xe4, 0x35, 0x4e, 0xf5, 0x4e, 0x05, 0x4b, 0xe5, 0x4b, 0x64, 0x04, 0x60} }, -{ 0x9710, 16, {0x03, 0x02, 0x96, 0x5b, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x7d, 0x01, 0x12, 0x82, 0x50, 0x05, 0x4b} }, -{ 0x9720, 16, {0xe5, 0x4b, 0xd3, 0x94, 0x03, 0x40, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x13, 0xf0, 0xa3, 0x74, 0x12} }, -{ 0x9730, 16, {0xf0, 0x02, 0x99, 0x9e, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xa3, 0xe0, 0x14, 0xff, 0x74, 0x01} }, -{ 0x9740, 16, {0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x90, 0x02, 0xf7, 0xf0, 0x90, 0x01, 0xc4} }, -{ 0x9750, 16, {0xf0, 0x02, 0x99, 0x9e, 0x90, 0x01, 0xc0, 0x74, 0x03, 0xf0, 0xa3, 0x74, 0xe8, 0xf0, 0xe4, 0xf5} }, -{ 0x9760, 16, {0x4d, 0x90, 0x02, 0xf7, 0xe0, 0xff, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x07, 0x19, 0x90, 0x01, 0xc0} }, -{ 0x9770, 16, {0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70, 0xea, 0x90, 0x03, 0x38, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, -{ 0x9780, 16, {0x83, 0x74, 0xff, 0xf0, 0xf5, 0x4d, 0xe5, 0x4d, 0x60, 0x03, 0x02, 0x99, 0x9e, 0x90, 0x01, 0xc0} }, -{ 0x9790, 16, {0xf0, 0xa3, 0x74, 0x96, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70, 0xf6, 0x7f} }, -{ 0x97a0, 16, {0x02, 0x12, 0x81, 0x11, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, 0xf3, 0xef, 0x54, 0x0f, 0xf5} }, -{ 0x97b0, 16, {0x4d, 0x90, 0x02, 0xf7, 0xe0, 0x55, 0x4d, 0x70, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0x8f} }, -{ 0x97c0, 16, {0x4c, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xe0, 0xb4, 0x05, 0x0c, 0xe5, 0x4c, 0x70, 0x04, 0x7f} }, -{ 0x97d0, 16, {0x01, 0x80, 0x02, 0x7f, 0x00, 0x8f, 0x4c, 0xe5, 0x4c, 0x70, 0x03, 0x02, 0x99, 0x9e, 0xe4, 0x90} }, -{ 0x97e0, 16, {0x03, 0x38, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52, 0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x99, 0x9e, 0xe4} }, -{ 0x97f0, 16, {0xff, 0xfd, 0x12, 0x82, 0x50, 0x7e, 0x20, 0x7f, 0x00, 0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0x85} }, -{ 0x9800, 16, {0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x44, 0x80, 0xf0, 0x85, 0x4f, 0x82, 0x85} }, -{ 0x9810, 16, {0x4e, 0x83, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0xa3} }, -{ 0x9820, 16, {0xa3, 0xe0, 0x54, 0x7f, 0xf0, 0xd2, 0x04, 0x02, 0x99, 0x9e, 0xc2, 0x04, 0x7e, 0x20, 0x7f, 0x00} }, -{ 0x9830, 16, {0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0xe5, 0x4f, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x4e, 0xf5} }, -{ 0x9840, 16, {0x83, 0xe0, 0x30, 0xe6, 0xf1, 0xe4, 0xff, 0x7d, 0x01, 0x12, 0x82, 0x50, 0x02, 0x99, 0x9e, 0xe4} }, -{ 0x9850, 16, {0xf5, 0x4d, 0xf5, 0x4b, 0xaf, 0x4b, 0xe4, 0xfd, 0x12, 0x82, 0x50, 0xe5, 0x4b, 0x75, 0xf0, 0x08} }, -{ 0x9860, 16, {0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5, 0x4e, 0x8f, 0x4f, 0xf5, 0x83} }, -{ 0x9870, 16, {0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0xfc, 0xf0, 0xaf} }, -{ 0x9880, 16, {0x4b, 0x7d, 0x01, 0x7b, 0x01, 0x75, 0x57, 0x80, 0x75, 0x58, 0x40, 0x12, 0x94, 0xac, 0x8f, 0x4d} }, -{ 0x9890, 16, {0xe5, 0x4d, 0x70, 0x11, 0xaf, 0x4b, 0x7d, 0x02, 0x7b, 0x01, 0x75, 0x57, 0x10, 0x75, 0x58, 0x20} }, -{ 0x98a0, 16, {0x12, 0x94, 0xac, 0x8f, 0x4d, 0xe5, 0x4d, 0x70, 0x10, 0xaf, 0x4b, 0x7d, 0x01, 0xfb, 0x75, 0x57} }, -{ 0x98b0, 16, {0x80, 0x75, 0x58, 0x40, 0x12, 0x94, 0xac, 0x8f, 0x4d, 0xe5, 0x4d, 0x70, 0x10, 0xaf, 0x4b, 0x7d} }, -{ 0x98c0, 16, {0x02, 0xfb, 0x75, 0x57, 0x10, 0x75, 0x58, 0x20, 0x12, 0x94, 0xac, 0x8f, 0x4d, 0xaf, 0x4b, 0x7d} }, -{ 0x98d0, 16, {0x01, 0x12, 0x82, 0x50, 0xe5, 0x4d, 0x60, 0x26, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04} }, -{ 0x98e0, 16, {0xff, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83} }, -{ 0x98f0, 16, {0xef, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52, 0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x99, 0x9e, 0x05, 0x4b} }, -{ 0x9900, 16, {0xe5, 0x4b, 0xd3, 0x94, 0x03, 0x50, 0x03, 0x02, 0x98, 0x54, 0x02, 0x99, 0x9e, 0xe4, 0x90, 0x03} }, -{ 0x9910, 16, {0x59, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74} }, -{ 0x9920, 16, {0x1b, 0xf0, 0xa3, 0x74, 0x29, 0xf0, 0x7e, 0x03, 0x7f, 0x59, 0x12, 0x80, 0x00, 0xef, 0x64, 0x08} }, -{ 0x9930, 16, {0x60, 0x6c, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x80, 0x65, 0xe4, 0x90, 0x03, 0x59, 0xf0, 0xa3, 0xf0} }, -{ 0x9940, 16, {0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0xe5, 0x52, 0xf0, 0xa3, 0xe5} }, -{ 0x9950, 16, {0x53, 0xf0, 0x7e, 0x03, 0x7f, 0x59, 0x12, 0x19, 0xc1, 0xef, 0x64, 0x08, 0x60, 0x40, 0xe4, 0x90} }, -{ 0x9960, 16, {0x03, 0x38, 0xf0, 0x80, 0x39, 0xe4, 0x90, 0x03, 0x59, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0} }, -{ 0x9970, 16, {0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xe5, 0x51, 0x24, 0x02, 0x90, 0x03, 0x60, 0xf0, 0xe4, 0x35} }, -{ 0x9980, 16, {0x50, 0x90, 0x03, 0x5f, 0xf0, 0x7e, 0x03, 0x7f, 0x59, 0x12, 0x80, 0x00, 0xef, 0x64, 0x08, 0x60} }, -{ 0x9990, 16, {0x0d, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x80, 0x06, 0x90, 0x03, 0x38, 0x74, 0x01, 0xf0, 0x90, 0x01} }, -{ 0x99a0, 16, {0xc0, 0xe4, 0xf0, 0xa3, 0x74, 0x0a, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70} }, -{ 0x99b0, 16, {0xf6, 0x7e, 0x03, 0x7f, 0x35, 0x75, 0x60, 0x00, 0x75, 0x5f, 0x00, 0x75, 0x5e, 0x00, 0x75, 0x5d} }, -{ 0x99c0, 11, {0x00, 0x7d, 0x24, 0x12, 0x8e, 0x0c, 0xe4, 0x90, 0x02, 0xaf, 0xf0} }, -{ 0x99cb, 1, {0x22} }, -{ 0x99cc, 16, {0xe4, 0xff, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0x70, 0x03, 0x02} }, -{ 0x99dc, 16, {0x9a, 0x6f, 0x74, 0x36, 0x2f, 0xf8, 0xe6, 0x20, 0xe5, 0x03, 0x02, 0x9a, 0x6f, 0xef, 0x75, 0xf0} }, -{ 0x99ec, 16, {0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xad, 0x82, 0xfc, 0xf5, 0x83, 0xe5, 0x82} }, -{ 0x99fc, 16, {0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0x60, 0x64, 0x60, 0x70, 0x63} }, -{ 0x9a0c, 16, {0xef, 0x25, 0xe0, 0x24, 0xef, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01} }, -{ 0x9a1c, 16, {0x12, 0x9b, 0xce, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xe0, 0x8d, 0x82, 0x8c, 0x83, 0xf0, 0x74, 0xf8} }, -{ 0x9a2c, 16, {0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0x14, 0xf0, 0x70, 0x36, 0xef, 0x25, 0xe0} }, -{ 0x9a3c, 16, {0x24, 0xc7, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0xef, 0x25, 0xe0, 0xfe, 0xc3} }, -{ 0x9a4c, 16, {0x74, 0x0c, 0x9e, 0x75, 0xf0, 0x40, 0xa4, 0x24, 0x40, 0xf5, 0x82, 0xe5, 0xf0, 0x34, 0x7b, 0xad} }, -{ 0x9a5c, 16, {0x82, 0xfc, 0xef, 0x25, 0xe0, 0x24, 0xef, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xec, 0xf0} }, -{ 0x9a6c, 12, {0xa3, 0xed, 0xf0, 0x0f, 0xef, 0x64, 0x04, 0x60, 0x03, 0x02, 0x99, 0xce} }, -{ 0x9a78, 1, {0x22} }, -{ 0x9a79, 16, {0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, 0xe7, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x3e} }, -{ 0x9a89, 16, {0x88, 0x82, 0x8c, 0x83, 0xe7, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x32, 0xe3, 0x09, 0xf6, 0x08} }, -{ 0x9a99, 16, {0xdf, 0xfa, 0x80, 0x78, 0xe3, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x70, 0x88, 0x82, 0x8c, 0x83} }, -{ 0x9aa9, 16, {0xe3, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x64, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf6, 0x08} }, -{ 0x9ab9, 16, {0xdf, 0xfa, 0x80, 0x58, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x4c} }, -{ 0x9ac9, 16, {0x80, 0xd2, 0x80, 0xfa, 0x80, 0xc6, 0x80, 0xd4, 0x80, 0x69, 0x80, 0xf2, 0x80, 0x33, 0x80, 0x10} }, -{ 0x9ad9, 16, {0x80, 0xa6, 0x80, 0xea, 0x80, 0x9a, 0x80, 0xa8, 0x80, 0xda, 0x80, 0xe2, 0x80, 0xca, 0x80, 0x33} }, -{ 0x9ae9, 16, {0x89, 0x82, 0x8a, 0x83, 0xec, 0xfa, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83} }, -{ 0x9af9, 16, {0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xe9, 0xde, 0xe7, 0x80} }, -{ 0x9b09, 16, {0x0d, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf6, 0x08, 0xdf, 0xf9, 0xec, 0xfa, 0xa9, 0xf0} }, -{ 0x9b19, 16, {0xed, 0xfb, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xec, 0xfa, 0xe0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc} }, -{ 0x9b29, 16, {0xc5, 0x83, 0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xea, 0xde} }, -{ 0x9b39, 16, {0xe8, 0x80, 0xdb, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf2, 0x08, 0xdf, 0xf9, 0x80, 0xcc} }, -{ 0x9b49, 16, {0x88, 0xf0, 0xed, 0x24, 0x02, 0xb4, 0x04, 0x00, 0x50, 0xc2, 0xf5, 0x82, 0xeb, 0x24, 0x02, 0xb4} }, -{ 0x9b59, 16, {0x04, 0x00, 0x50, 0xb8, 0x23, 0x23, 0x45, 0x82, 0xf5, 0x82, 0xef, 0x4e, 0x60, 0xae, 0xef, 0x60} }, -{ 0x9b69, 9, {0x01, 0x0e, 0xe5, 0x82, 0x23, 0x90, 0x9a, 0xc9, 0x73} }, -{ 0x9b72, 16, {0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02} }, -{ 0x9b82, 9, {0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22} }, -{ 0x9b8b, 16, {0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50} }, -{ 0x9b9b, 16, {0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22} }, -{ 0x9bab, 13, {0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22} }, -{ 0x9bb8, 16, {0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02} }, -{ 0x9bc8, 6, {0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22} }, -{ 0x9bce, 16, {0xa3, 0xf8, 0xe0, 0xc5, 0xf0, 0x25, 0xf0, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83} }, -{ 0x9bde, 6, {0xe0, 0xc8, 0x38, 0xf0, 0xe8, 0x22} }, -{ 0x9be4, 16, {0xbb, 0x01, 0x10, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0xf5, 0xf0} }, -{ 0x9bf4, 16, {0xa3, 0xe0, 0x22, 0x50, 0x09, 0xe9, 0x25, 0x82, 0xf8, 0x86, 0xf0, 0x08, 0xe6, 0x22, 0xbb, 0xfe} }, -{ 0x9c04, 16, {0x0a, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0xf5, 0xf0, 0x08, 0xe2, 0x22, 0xe5, 0x83, 0x2a, 0xf5, 0x83} }, -{ 0x9c14, 8, {0xe9, 0x93, 0xf5, 0xf0, 0xa3, 0xe9, 0x93, 0x22} }, -{ 0x9c1c, 16, {0x75, 0xf0, 0x08, 0x75, 0x82, 0x00, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xcd, 0x33, 0xcd, 0xcc} }, -{ 0x9c2c, 16, {0x33, 0xcc, 0xc5, 0x82, 0x33, 0xc5, 0x82, 0x9b, 0xed, 0x9a, 0xec, 0x99, 0xe5, 0x82, 0x98, 0x40} }, -{ 0x9c3c, 16, {0x0c, 0xf5, 0x82, 0xee, 0x9b, 0xfe, 0xed, 0x9a, 0xfd, 0xec, 0x99, 0xfc, 0x0f, 0xd5, 0xf0, 0xd6} }, -{ 0x9c4c, 16, {0xe4, 0xce, 0xfb, 0xe4, 0xcd, 0xfa, 0xe4, 0xcc, 0xf9, 0xa8, 0x82, 0x22, 0xb8, 0x00, 0xc1, 0xb9} }, -{ 0x9c5c, 16, {0x00, 0x59, 0xba, 0x00, 0x2d, 0xec, 0x8b, 0xf0, 0x84, 0xcf, 0xce, 0xcd, 0xfc, 0xe5, 0xf0, 0xcb} }, -{ 0x9c6c, 16, {0xf9, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc, 0xeb} }, -{ 0x9c7c, 16, {0x33, 0xfb, 0x10, 0xd7, 0x03, 0x99, 0x40, 0x04, 0xeb, 0x99, 0xfb, 0x0f, 0xd8, 0xe5, 0xe4, 0xf9} }, -{ 0x9c8c, 16, {0xfa, 0x22, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc} }, -{ 0x9c9c, 16, {0xc9, 0x33, 0xc9, 0x10, 0xd7, 0x05, 0x9b, 0xe9, 0x9a, 0x40, 0x07, 0xec, 0x9b, 0xfc, 0xe9, 0x9a} }, -{ 0x9cac, 16, {0xf9, 0x0f, 0xd8, 0xe0, 0xe4, 0xc9, 0xfa, 0xe4, 0xcc, 0xfb, 0x22, 0x75, 0xf0, 0x10, 0xef, 0x2f} }, -{ 0x9cbc, 16, {0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xcc, 0x33, 0xcc, 0xc8, 0x33, 0xc8, 0x10, 0xd7, 0x07} }, -{ 0x9ccc, 16, {0x9b, 0xec, 0x9a, 0xe8, 0x99, 0x40, 0x0a, 0xed, 0x9b, 0xfd, 0xec, 0x9a, 0xfc, 0xe8, 0x99, 0xf8} }, -{ 0x9cdc, 14, {0x0f, 0xd5, 0xf0, 0xda, 0xe4, 0xcd, 0xfb, 0xe4, 0xcc, 0xfa, 0xe4, 0xc8, 0xf9, 0x22} }, -{ 0x9cea, 16, {0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, 0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, 0xe8, 0x9c, 0x45, 0xf0} }, -{ 0x9cfa, 1, {0x22} }, -{ 0x9cfb, 16, {0xe8, 0x60, 0x0f, 0xec, 0xc3, 0x13, 0xfc, 0xed, 0x13, 0xfd, 0xee, 0x13, 0xfe, 0xef, 0x13, 0xff} }, -{ 0x9d0b, 3, {0xd8, 0xf1, 0x22} }, -{ 0x9d0e, 16, {0x08, 0x08, 0x08, 0xe6, 0xcf, 0x2f, 0xf6, 0x18, 0xe6, 0xce, 0x3e, 0xf6, 0x18, 0xe6, 0xcd, 0x3d} }, -{ 0x9d1e, 7, {0xf6, 0x18, 0xe6, 0xcc, 0x3c, 0xf6, 0x22} }, -{ 0x9d25, 12, {0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xa3, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22} }, -{ 0x9d31, 16, {0xa8, 0x82, 0x85, 0x83, 0xf0, 0xd0, 0x83, 0xd0, 0x82, 0x12, 0x9d, 0x48, 0x12, 0x9d, 0x48, 0x12} }, -{ 0x9d41, 16, {0x9d, 0x48, 0x12, 0x9d, 0x48, 0xe4, 0x73, 0xe4, 0x93, 0xa3, 0xc5, 0x83, 0xc5, 0xf0, 0xc5, 0x83} }, -{ 0x9d51, 16, {0xc8, 0xc5, 0x82, 0xc8, 0xf0, 0xa3, 0xc5, 0x83, 0xc5, 0xf0, 0xc5, 0x83, 0xc8, 0xc5, 0x82, 0xc8} }, -{ 0x9d61, 1, {0x22} }, +{ 0x19c1, 4, {0x8e, 0x54, 0x8f, 0x55} }, +{ 0x19c5, 16, {0x75, 0x56, 0x03, 0xe5, 0x55, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xfe} }, +{ 0x19d5, 16, {0xa3, 0xe0, 0x4e, 0x70, 0x03, 0x02, 0x1a, 0xcf, 0xe5, 0x56, 0x60, 0x4e, 0x14, 0x60, 0x38, 0x14} }, +{ 0x19e5, 16, {0x60, 0x20, 0x14, 0x60, 0x03, 0x02, 0x1a, 0x73, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0x85} }, +{ 0x19f5, 16, {0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90, 0x7f, 0xa6, 0xf0} }, +{ 0x1a05, 16, {0x80, 0x6c, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0xc3, 0x94, 0x20, 0x40, 0x09, 0xa3, 0xa3} }, +{ 0x1a15, 16, {0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x57, 0x15, 0x56, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3} }, +{ 0x1a25, 16, {0xa3, 0xe0, 0xa3, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x80, 0x44, 0xe5, 0x55, 0x24, 0x06, 0xf5, 0x82} }, +{ 0x1a35, 16, {0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5} }, +{ 0x1a45, 16, {0x83, 0xe0, 0x90, 0x7f, 0xa6, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0xe5, 0x55, 0x24} }, +{ 0x1a55, 16, {0x04, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0x74, 0xff, 0xf5, 0xf0, 0x12, 0x9f, 0x8e, 0x85} }, +{ 0x1a65, 16, {0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0x8e, 0x90, 0x7f} }, +{ 0x1a75, 16, {0xa5, 0xe0, 0xf5, 0x57, 0x30, 0xe0, 0xf7, 0x30, 0xe2, 0x07, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x06} }, +{ 0x1a85, 16, {0x22, 0xe5, 0x57, 0x20, 0xe1, 0x0a, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7f, 0x07, 0x22} }, +{ 0x1a95, 16, {0xe5, 0x56, 0x70, 0x31, 0x7f, 0x01, 0x7e, 0x00, 0x12, 0x09, 0x29, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, +{ 0x1aa5, 16, {0x80, 0xf0, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0x25, 0xe0, 0x44, 0xa0, 0x90} }, +{ 0x1ab5, 16, {0x7f, 0xa6, 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0xf5, 0x57, 0x30, 0xe0, 0xf7, 0x30, 0xe1, 0xd5, 0x75} }, +{ 0x1ac5, 12, {0x56, 0x03, 0x02, 0x19, 0xc8, 0x15, 0x56, 0x02, 0x19, 0xc8, 0x7f, 0x08} }, +{ 0x1ad1, 1, {0x22} }, +{ 0x1ad2, 16, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc2, 0xa9, 0x90, 0x03, 0x00, 0x74, 0x19, 0xf0, 0xd2, 0xa9} }, +{ 0x1ae2, 15, {0x53, 0x91, 0x7f, 0x90, 0x01, 0xc4, 0xe4, 0xf0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, +{ 0x1af1, 4, {0x8e, 0x54, 0x8f, 0x55} }, +{ 0x1af5, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x56, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22} }, +{ 0x1b05, 16, {0xe5, 0x56, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0} }, +{ 0x1b15, 16, {0x54, 0x03, 0x70, 0x24, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0x30, 0xe0, 0x07, 0xaf} }, +{ 0x1b25, 16, {0x56, 0x7d, 0x02, 0x12, 0x83, 0x2d, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0x30, 0xe1} }, +{ 0x1b35, 10, {0x07, 0xaf, 0x56, 0x7d, 0x04, 0x12, 0x83, 0x2d, 0x7f, 0x00} }, +{ 0x1b3f, 1, {0x22} }, +{ 0x8000, 16, {0x7b, 0xff, 0x7a, 0x12, 0x79, 0x1b, 0x90, 0x00, 0x04, 0x12, 0x9f, 0x61, 0xfd, 0x8b, 0x4d, 0x75} }, +{ 0x8010, 16, {0x4e, 0x12, 0x75, 0x4f, 0x24, 0xe4, 0x90, 0x7f, 0xe1, 0xf0, 0x90, 0x7f, 0xe0, 0xf0, 0xf5, 0x4b} }, +{ 0x8020, 16, {0xf5, 0x4c, 0x90, 0x02, 0xae, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0x90, 0x7f} }, +{ 0x8030, 16, {0xa9, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0xe4, 0xfc, 0xec, 0x25, 0xe0, 0x24, 0xb4, 0xf5} }, +{ 0x8040, 16, {0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x0c, 0xbc, 0x10, 0xee, 0xe4, 0x90, 0x7f, 0xdd} }, +{ 0x8050, 16, {0xf0, 0xaf, 0x05, 0x1d, 0xef, 0x70, 0x03, 0x02, 0x81, 0xc6, 0xab, 0x4d, 0xaa, 0x4e, 0xa9, 0x4f} }, +{ 0x8060, 16, {0x90, 0x00, 0x01, 0x12, 0x9f, 0x61, 0x64, 0x05, 0x60, 0x03, 0x02, 0x81, 0xb5, 0x90, 0x00, 0x03} }, +{ 0x8070, 16, {0x12, 0x9f, 0x61, 0x64, 0x01, 0x60, 0x03, 0x02, 0x81, 0x3c, 0x90, 0x00, 0x02, 0x12, 0x9f, 0x61} }, +{ 0x8080, 16, {0xff, 0x54, 0x7f, 0xfc, 0xd3, 0x94, 0x07, 0x50, 0x03, 0x02, 0x81, 0x16, 0xec, 0xc3, 0x94, 0x10} }, +{ 0x8090, 16, {0x40, 0x03, 0x02, 0x81, 0x16, 0xef, 0x30, 0xe7, 0x42, 0xe5, 0x4c, 0xae, 0x4b, 0x78, 0x02, 0xce} }, +{ 0x80a0, 16, {0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x74, 0xf0, 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5} }, +{ 0x80b0, 16, {0x83, 0xef, 0xf0, 0x90, 0x7f, 0xe0, 0xe0, 0xff, 0xec, 0x24, 0xf8, 0xfe, 0x74, 0x01, 0xa8, 0x06} }, +{ 0x80c0, 16, {0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x4f, 0x90, 0x7f, 0xe0, 0xf0, 0x90, 0x02, 0xae, 0xe0} }, +{ 0x80d0, 16, {0x04, 0xf0, 0x90, 0x7f, 0xdd, 0xe0, 0x44, 0x80, 0xf0, 0x80, 0x3e, 0xe5, 0x4c, 0xae, 0x4b, 0x78} }, +{ 0x80e0, 16, {0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x74, 0xe8, 0x2c, 0xf5, 0x82, 0xe4, 0x34} }, +{ 0x80f0, 16, {0x7f, 0xf5, 0x83, 0xef, 0xf0, 0x90, 0x7f, 0xe1, 0xe0, 0xff, 0xec, 0x24, 0xf8, 0xfe, 0x74, 0x01} }, +{ 0x8100, 16, {0xa8, 0x06, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x4f, 0x90, 0x7f, 0xe1, 0xf0, 0x90, 0x02} }, +{ 0x8110, 16, {0xae, 0xe0, 0x04, 0xf0, 0x80, 0x03, 0x7f, 0xff, 0x22, 0x90, 0x00, 0x04, 0x12, 0x9f, 0x61, 0x25} }, +{ 0x8120, 16, {0x4c, 0xf5, 0x4c, 0xe4, 0x35, 0x4b, 0xf5, 0x4b, 0x90, 0x00, 0x05, 0x12, 0x9f, 0x61, 0xfe, 0xe4} }, +{ 0x8130, 16, {0x25, 0x4c, 0xf5, 0x4c, 0xee, 0x35, 0x4b, 0xf5, 0x4b, 0x02, 0x81, 0xb8, 0xab, 0x4d, 0xaa, 0x4e} }, +{ 0x8140, 16, {0xa9, 0x4f, 0x90, 0x00, 0x03, 0x12, 0x9f, 0x61, 0xff, 0x64, 0x02, 0x60, 0x05, 0xef, 0x64, 0x03} }, +{ 0x8150, 16, {0x70, 0x60, 0x90, 0x00, 0x02, 0x12, 0x9f, 0x61, 0xff, 0x54, 0x7f, 0xfc, 0xd3, 0x94, 0x07, 0x50} }, +{ 0x8160, 16, {0x4e, 0xef, 0x30, 0xe7, 0x1e, 0x90, 0x7f, 0xde, 0xe0, 0xff, 0x74, 0x01, 0xa8, 0x04, 0x08, 0x80} }, +{ 0x8170, 16, {0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xfe, 0x4f, 0x90, 0x7f, 0xde, 0xf0, 0x90, 0x7f, 0xac, 0xe0, 0x4e} }, +{ 0x8180, 16, {0xf0, 0x80, 0x35, 0x90, 0x7f, 0xdf, 0xe0, 0xff, 0x74, 0x01, 0xa8, 0x04, 0x08, 0x80, 0x02, 0xc3} }, +{ 0x8190, 16, {0x33, 0xd8, 0xfc, 0xfe, 0x4f, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xad, 0xe0, 0x4e, 0xf0, 0xec} }, +{ 0x81a0, 16, {0x25, 0xe0, 0x24, 0xc5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xec, 0xf0, 0x80, 0x09, 0x7f} }, +{ 0x81b0, 16, {0xff, 0x22, 0x7f, 0xff, 0x22, 0x7f, 0xff, 0x22, 0x74, 0x07, 0x25, 0x4f, 0xf5, 0x4f, 0xe4, 0x35} }, +{ 0x81c0, 16, {0x4e, 0xf5, 0x4e, 0x02, 0x80, 0x51, 0x20, 0x03, 0x0d, 0x90, 0x02, 0xae, 0xe0, 0x60, 0x07, 0x90} }, +{ 0x81d0, 8, {0x7f, 0xae, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0x00} }, +{ 0x81d8, 1, {0x22} }, +{ 0x81d9, 2, {0xac, 0x07} }, +{ 0x81db, 16, {0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0xec, 0x25, 0xe0, 0x44, 0x41, 0x90, 0x7f, 0xa6, 0xf0} }, +{ 0x81eb, 16, {0x7b, 0x3c, 0xaf, 0x03, 0x1b, 0xef, 0x70, 0x16, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90} }, +{ 0x81fb, 16, {0x7f, 0xa6, 0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x60, 0xd4, 0x80, 0xf8, 0x90, 0x7f} }, +{ 0x820b, 16, {0xa5, 0xe0, 0xfd, 0x30, 0xe0, 0xdc, 0x20, 0xe1, 0x09, 0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f} }, +{ 0x821b, 16, {0xf9, 0x22, 0xed, 0x30, 0xe2, 0x0c, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f} }, +{ 0x822b, 16, {0xfa, 0x22, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x20, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0x7b, 0x1e} }, +{ 0x823b, 16, {0xaf, 0x03, 0x1b, 0xef, 0x70, 0x16, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6} }, +{ 0x824b, 16, {0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x60, 0x86, 0x80, 0xf8, 0x90, 0x7f, 0xa5, 0xe0} }, +{ 0x825b, 16, {0xfd, 0x20, 0xe0, 0xdc, 0x7b, 0x3c, 0xaf, 0x03, 0x1b, 0xef, 0x70, 0x19, 0x90, 0x7f, 0xa5, 0xe0} }, +{ 0x826b, 16, {0x44, 0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0x7d, 0x32, 0xaf, 0x05, 0x1d, 0xef, 0x70, 0x03} }, +{ 0x827b, 16, {0x02, 0x81, 0xdb, 0x80, 0xf5, 0x90, 0x7f, 0xa5, 0xe0, 0xfd, 0x30, 0xe0, 0xd9, 0x30, 0xe2, 0x09} }, +{ 0x828b, 16, {0xe0, 0x44, 0x40, 0xf0, 0x7e, 0xff, 0x7f, 0xfa, 0x22, 0xc2, 0xaf, 0x90, 0x7f, 0xa5, 0xe0, 0x44} }, +{ 0x829b, 12, {0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xfd, 0xd2, 0xaf, 0xff, 0x7e, 0x00} }, +{ 0x82a7, 1, {0x22} }, +{ 0x82a8, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xab, 0x82, 0xfa, 0xf5} }, +{ 0x82b8, 16, {0x83, 0xa3, 0xe4, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0xf5, 0x5e, 0x74, 0xbf} }, +{ 0x82c8, 16, {0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xe0, 0x44, 0x10, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3} }, +{ 0x82d8, 16, {0xa3, 0xa3, 0xe4, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xf0, 0xf9, 0xed, 0x60, 0x1d, 0x74, 0x01} }, +{ 0x82e8, 16, {0x7e, 0x00, 0xa8, 0x07, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe4} }, +{ 0x82f8, 16, {0xef, 0x55, 0x3b, 0x60, 0x04, 0x79, 0x09, 0x80, 0x02, 0x79, 0x0d, 0x8b, 0x82, 0x8a, 0x83, 0xa3} }, +{ 0x8308, 16, {0xa3, 0xa3, 0x74, 0xbf, 0xf0, 0x8b, 0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xe0, 0x54, 0xef, 0xf0, 0x8b} }, +{ 0x8318, 16, {0x82, 0x8a, 0x83, 0xa3, 0xa3, 0xa3, 0xe5, 0x5e, 0xf0, 0xae, 0x02, 0xaf, 0x03, 0x8f, 0x82, 0x8e} }, +{ 0x8328, 4, {0x83, 0xa3, 0xe9, 0xf0} }, +{ 0x832c, 1, {0x22} }, +{ 0x832d, 4, {0x8f, 0x5e, 0x8d, 0x5f} }, +{ 0x8331, 16, {0xe4, 0xf5, 0x60, 0x74, 0x3c, 0x2f, 0xf8, 0x76, 0x08, 0xe5, 0x5e, 0x75, 0xf0, 0x0d, 0xa4, 0x24} }, +{ 0x8341, 16, {0x02, 0xf5, 0x82, 0xe4, 0x34, 0x03, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe} }, +{ 0x8351, 16, {0xa3, 0xe0, 0xff, 0x7b, 0x80, 0x7a, 0x25, 0x79, 0x00, 0x78, 0x00, 0xc3, 0x12, 0xa0, 0xc0, 0x50} }, +{ 0x8361, 16, {0x3c, 0xe5, 0x5e, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4, 0x34, 0x03, 0xf5, 0x83} }, +{ 0x8371, 16, {0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x7b, 0x00, 0x7a, 0x96, 0x78} }, +{ 0x8381, 16, {0x00, 0xc3, 0x12, 0xa0, 0xc0, 0x40, 0x0c, 0x75, 0x60, 0x40, 0x74, 0x3c, 0x25, 0x5e, 0xf8, 0x76} }, +{ 0x8391, 16, {0x10, 0x80, 0x0a, 0x75, 0x60, 0x80, 0x74, 0x3c, 0x25, 0x5e, 0xf8, 0x76, 0x38, 0xe5, 0x60, 0x45} }, +{ 0x83a1, 16, {0x5f, 0x44, 0x01, 0xff, 0xe5, 0x5e, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x02, 0xf5, 0x82, 0xe4, 0x34} }, +{ 0x83b1, 5, {0x20, 0xf5, 0x83, 0xef, 0xf0} }, +{ 0x83b6, 1, {0x22} }, +{ 0x83b7, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x54, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22} }, +{ 0x83c7, 16, {0xe5, 0x54, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5} }, +{ 0x83d7, 16, {0x55, 0x8f, 0x56, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc6, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83} }, +{ 0x83e7, 16, {0xe0, 0x20, 0xe1, 0x0f, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc7, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5} }, +{ 0x83f7, 16, {0x83, 0xe4, 0xf0, 0x74, 0x22, 0x25, 0x54, 0xf8, 0xe4, 0xf6, 0xe5, 0x56, 0x24, 0x04, 0xf5, 0x82} }, +{ 0x8407, 16, {0xe4, 0x35, 0x55, 0xf5, 0x83, 0xe0, 0x44, 0x03, 0xf0, 0xaf, 0x54, 0x7d, 0x06, 0x12, 0x83, 0x2d} }, +{ 0x8417, 16, {0xaf, 0x54, 0x7d, 0x01, 0x12, 0x82, 0xa8, 0x85, 0x56, 0x82, 0x85, 0x55, 0x83, 0xa3, 0xa3, 0xe0} }, +{ 0x8427, 16, {0x20, 0xe0, 0x22, 0xe0, 0xff, 0xe5, 0x56, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x55, 0xf5, 0x83} }, +{ 0x8437, 16, {0xe0, 0xe5, 0x56, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x55, 0xf5, 0x83, 0xe0, 0xff, 0xaf, 0x54} }, +{ 0x8447, 16, {0x7d, 0x06, 0x12, 0x83, 0x2d, 0x74, 0xf8, 0x25, 0x54, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83} }, +{ 0x8457, 16, {0xe4, 0xf0, 0xe5, 0x54, 0x25, 0xe0, 0xff, 0xc3, 0x74, 0x0c, 0x9f, 0x75, 0xf0, 0x40, 0xa4, 0x24} }, +{ 0x8467, 16, {0x40, 0xf5, 0x82, 0xe5, 0xf0, 0x34, 0x7b, 0xaf, 0x82, 0xfe, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xef} }, +{ 0x8477, 16, {0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0xaf, 0x54, 0x74, 0x01} }, +{ 0x8487, 13, {0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x30, 0x7f, 0x00} }, +{ 0x8494, 1, {0x22} }, +{ 0x8495, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x54, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22} }, +{ 0x84a5, 16, {0xaf, 0x54, 0xe4, 0xfd, 0x12, 0x82, 0xa8, 0x74, 0xf8, 0x25, 0x54, 0xf5, 0x82, 0xe4, 0x34, 0x02} }, +{ 0x84b5, 16, {0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x54, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34} }, +{ 0x84c5, 16, {0x20, 0xaf, 0x82, 0xf5, 0x56, 0x8f, 0x57, 0xf5, 0x83, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4} }, +{ 0x84d5, 16, {0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0xfc, 0xf0, 0xaf, 0x54, 0x7d, 0x06, 0x12, 0x83, 0x2d, 0xe5} }, +{ 0x84e5, 16, {0x57, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x56, 0xf5, 0x83, 0xe0, 0x30, 0xe0, 0x09, 0x85, 0x57} }, +{ 0x84f5, 16, {0x82, 0x85, 0x56, 0x83, 0xe0, 0xf5, 0x55, 0xaf, 0x54, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02} }, +{ 0x8505, 16, {0xc3, 0x33, 0xd8, 0xfc, 0xf4, 0x52, 0x30, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc6, 0xf5, 0x82, 0xe4} }, +{ 0x8515, 16, {0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x20, 0xe1, 0x0f, 0xe5, 0x54, 0x25, 0xe0, 0x24, 0xc7, 0xf5, 0x82} }, +{ 0x8525, 9, {0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x7f, 0x00} }, +{ 0x852e, 1, {0x22} }, +{ 0x852f, 16, {0x8f, 0x82, 0x8e, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0xa3, 0xa3, 0xa3, 0xe0, 0xfc, 0xed} }, +{ 0x853f, 16, {0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xa3, 0xc0, 0x83, 0xc0} }, +{ 0x854f, 16, {0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0} }, +{ 0x855f, 16, {0x8f, 0x82, 0x8e, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xa3, 0xa3, 0xa3, 0xe0, 0xfd, 0xec, 0x6d, 0xd0} }, +{ 0x856f, 16, {0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0x8f} }, +{ 0x857f, 16, {0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82} }, +{ 0x858f, 16, {0x8e, 0x83, 0xa3, 0xa3, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xe0} }, +{ 0x859f, 16, {0xfc, 0xed, 0x6c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xc0, 0x83, 0xc0} }, +{ 0x85af, 16, {0x82, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xe0, 0xff, 0xed, 0x6f, 0xd0, 0x82, 0xd0} }, +{ 0x85bf, 3, {0x83, 0xf0, 0x22} }, +{ 0x85c2, 4, {0xad, 0x07, 0xac, 0x06} }, +{ 0x85c6, 16, {0x79, 0x0d, 0x8d, 0x82, 0x8c, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff} }, +{ 0x85d6, 16, {0x22, 0x8c, 0x54, 0x8d, 0x55, 0xee, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34} }, +{ 0x85e6, 16, {0x03, 0xaf, 0x82, 0xfe, 0xad, 0x01, 0x19, 0xed, 0x60, 0x24, 0x0f, 0xef, 0xac, 0x06, 0x70, 0x01} }, +{ 0x85f6, 16, {0x0e, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfd, 0x05, 0x55, 0xe5, 0x55, 0xaa, 0x54, 0x70, 0x02} }, +{ 0x8606, 16, {0x05, 0x54, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xe0, 0x6d, 0x60, 0xd9, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, +{ 0x8616, 1, {0x22} }, +{ 0x8617, 4, {0x8e, 0x54, 0x8f, 0x55} }, +{ 0x861b, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xf5, 0x5b, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22} }, +{ 0x862b, 16, {0xe5, 0x5b, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5} }, +{ 0x863b, 16, {0x5c, 0x8f, 0x5d, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3} }, +{ 0x864b, 16, {0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x7b, 0x08, 0x7a, 0x00, 0x79, 0x00, 0x78, 0x00, 0xd3, 0x12, 0xa0} }, +{ 0x865b, 16, {0xc0, 0x40, 0x10, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0x12, 0xa1, 0x07, 0x00, 0x00, 0x00} }, +{ 0x866b, 16, {0x08, 0x80, 0x2e, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3} }, +{ 0x867b, 16, {0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x7b, 0x00, 0x7a, 0x08, 0x79, 0x07, 0x78, 0x00, 0xc3, 0x12, 0xa0} }, +{ 0x868b, 16, {0xc0, 0x50, 0x0e, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0x12, 0xa1, 0x07, 0x00, 0x07, 0x08} }, +{ 0x869b, 16, {0x00, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xf8, 0xa3, 0xe0, 0xf9, 0xa3, 0xe0, 0xfa} }, +{ 0x86ab, 16, {0xa3, 0xe0, 0xfb, 0x7f, 0x00, 0x7e, 0x50, 0x7d, 0x46, 0x7c, 0x00, 0x12, 0xa0, 0x2e, 0x8f, 0x59} }, +{ 0x86bb, 16, {0x8e, 0x58, 0x8d, 0x57, 0x8c, 0x56, 0x7b, 0x0a, 0x7a, 0x00, 0x79, 0x00, 0x78, 0x00, 0x12, 0xa0} }, +{ 0x86cb, 16, {0x2e, 0xaf, 0x03, 0x8f, 0x5a, 0xaf, 0x59, 0xae, 0x58, 0xad, 0x57, 0xac, 0x56, 0x7b, 0x0a, 0x7a} }, +{ 0x86db, 16, {0x00, 0x79, 0x00, 0x78, 0x00, 0x12, 0xa0, 0x2e, 0x8f, 0x59, 0x8e, 0x58, 0x8d, 0x57, 0x8c, 0x56} }, +{ 0x86eb, 16, {0xe5, 0x5a, 0xc3, 0x94, 0x05, 0x40, 0x15, 0xe5, 0x59, 0x24, 0x01, 0xf5, 0x59, 0xe4, 0x35, 0x58} }, +{ 0x86fb, 16, {0xf5, 0x58, 0xe4, 0x35, 0x57, 0xf5, 0x57, 0xe4, 0x35, 0x56, 0xf5, 0x56, 0x85, 0x5d, 0x82, 0x85} }, +{ 0x870b, 16, {0x5c, 0x83, 0xa3, 0xe4, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x44} }, +{ 0x871b, 16, {0x80, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xe5, 0x59, 0xf0, 0xaf, 0x59, 0xae, 0x58, 0xad} }, +{ 0x872b, 16, {0x57, 0xac, 0x56, 0x78, 0x08, 0x12, 0xa0, 0xd1, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xef} }, +{ 0x873b, 16, {0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5} }, +{ 0x874b, 16, {0x5a, 0xe5, 0x55, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xb4, 0x62} }, +{ 0x875b, 16, {0x05, 0x43, 0x5a, 0x0a, 0x80, 0x1a, 0xef, 0xb4, 0x72, 0x05, 0x43, 0x5a, 0x08, 0x80, 0x11, 0xef} }, +{ 0x876b, 16, {0xb4, 0x74, 0x05, 0x43, 0x5a, 0x02, 0x80, 0x08, 0xef, 0x64, 0x6e, 0x60, 0x03, 0x7f, 0xff, 0x22} }, +{ 0x877b, 16, {0xe5, 0x55, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0x30, 0xe3, 0x03} }, +{ 0x878b, 16, {0x43, 0x5a, 0x80, 0xef, 0x30, 0xe7, 0x12, 0x43, 0x5a, 0x40, 0xe5, 0x5d, 0x24, 0x04, 0xf5, 0x82} }, +{ 0x879b, 16, {0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x55, 0x24, 0x0b, 0xf5, 0x82, 0xe4} }, +{ 0x87ab, 16, {0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0x20, 0xe1, 0x03, 0x30, 0xe4, 0x23, 0xaf, 0x5b, 0x74, 0x01} }, +{ 0x87bb, 16, {0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x3b, 0xe5, 0x5d, 0x24, 0x04, 0xf5} }, +{ 0x87cb, 16, {0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x44, 0x01, 0xf0, 0xe4, 0xf5, 0x5a, 0x80, 0x10, 0xaf} }, +{ 0x87db, 16, {0x5b, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf4, 0x52, 0x3b, 0x85} }, +{ 0x87eb, 16, {0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0x74, 0xbf, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c} }, +{ 0x87fb, 16, {0x83, 0xa3, 0xa3, 0xe4, 0xf0, 0xe5, 0x5a, 0xf0, 0xe5, 0x55, 0x24, 0x0a, 0xf5, 0x82, 0xe4, 0x35} }, +{ 0x880b, 16, {0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83} }, +{ 0x881b, 16, {0xef, 0xf0, 0xe5, 0x55, 0x24, 0x0a, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5} }, +{ 0x882b, 16, {0x5d, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x55, 0x24, 0x09} }, +{ 0x883b, 16, {0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x06, 0xf5, 0x82, 0xe4} }, +{ 0x884b, 16, {0x35, 0x5c, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x55, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5} }, +{ 0x885b, 16, {0x83, 0xe0, 0xff, 0xe5, 0x5d, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xef, 0xf0} }, +{ 0x886b, 16, {0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3, 0xa3, 0xa3, 0xe4, 0xf0, 0x85, 0x5d, 0x82, 0x85, 0x5c} }, +{ 0x887b, 16, {0x83, 0xa3, 0xa3, 0xf0, 0xaf, 0x5b, 0x7d, 0x06, 0x12, 0x83, 0x2d, 0x75, 0x5a, 0x08, 0xe5, 0x55} }, +{ 0x888b, 16, {0x24, 0x0c, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0x60, 0x03, 0x43, 0x5a, 0x10, 0xe5} }, +{ 0x889b, 16, {0x5d, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x5c, 0xf5, 0x83, 0xe0, 0x54, 0x03, 0x45, 0x5a, 0xf0} }, +{ 0x88ab, 16, {0xe5, 0x55, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xfe, 0xc3, 0x94, 0x05} }, +{ 0x88bb, 16, {0x40, 0x06, 0xee, 0xd3, 0x94, 0x08, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xe5, 0x55, 0x24, 0x06, 0xf5} }, +{ 0x88cb, 16, {0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0, 0xfd, 0xc3, 0x94, 0x01, 0x40, 0x06, 0xed, 0xd3, 0x94} }, +{ 0x88db, 16, {0x02, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xed, 0x14, 0xff, 0x25, 0xe0, 0x25, 0xe0, 0xff, 0xee, 0x24} }, +{ 0x88eb, 16, {0xfb, 0x4f, 0xf5, 0x5a, 0xe5, 0x55, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x35, 0x54, 0xf5, 0x83, 0xe0} }, +{ 0x88fb, 16, {0x24, 0xd0, 0x60, 0x18, 0x14, 0x60, 0x1a, 0x24, 0xc3, 0x60, 0x1e, 0x14, 0x60, 0x09, 0x24, 0x0a} }, +{ 0x890b, 16, {0x70, 0x14, 0x43, 0x5a, 0x18, 0x80, 0x12, 0x43, 0x5a, 0x08, 0x80, 0x0d, 0x43, 0x5a, 0x38, 0x80} }, +{ 0x891b, 16, {0x08, 0x43, 0x5a, 0x28, 0x80, 0x03, 0x7f, 0xff, 0x22, 0x85, 0x5d, 0x82, 0x85, 0x5c, 0x83, 0xa3} }, +{ 0x892b, 16, {0xa3, 0xa3, 0xe5, 0x5a, 0xf0, 0xaf, 0x5b, 0x7d, 0x01, 0x12, 0x82, 0xa8, 0xaa, 0x54, 0xa9, 0x55} }, +{ 0x893b, 16, {0x7b, 0x01, 0xc0, 0x01, 0xe5, 0x5b, 0x75, 0xf0, 0x0d, 0xa4, 0x24, 0x01, 0xf9, 0x74, 0x03, 0x35} }, +{ 0x894b, 15, {0xf0, 0xa8, 0x01, 0xfc, 0xd0, 0x01, 0x7e, 0x00, 0x7f, 0x0d, 0x12, 0x9f, 0x1f, 0x7f, 0x00} }, +{ 0x895a, 1, {0x22} }, +{ 0x895b, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xee} }, +{ 0x896b, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xad, 0x82, 0xfc, 0x90, 0x01} }, +{ 0x897b, 16, {0x2c, 0x74, 0x08, 0xf0, 0xee, 0x04, 0xa3, 0xf0, 0xe4, 0xa3, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xe5} }, +{ 0x898b, 16, {0x82, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x90, 0x01, 0x2f, 0xf0, 0x8d} }, +{ 0x899b, 16, {0x82, 0x8c, 0x83, 0xe5, 0x82, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54} }, +{ 0x89ab, 16, {0x1e, 0x90, 0x01, 0x30, 0xf0, 0x74, 0x2c, 0x2e, 0xf8, 0xe6, 0xa3, 0xf0, 0xaf, 0x06, 0x74, 0x01} }, +{ 0x89bb, 16, {0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x54, 0x7f, 0x02, 0x12, 0x81, 0xd9} }, +{ 0x89cb, 16, {0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, 0xf3, 0xe5, 0x54, 0x5f, 0x90, 0x01, 0x32, 0xf0, 0x7e} }, +{ 0x89db, 10, {0x01, 0x7f, 0x2c, 0x7d, 0x07, 0x12, 0x8e, 0xb4, 0x7f, 0x00} }, +{ 0x89e5, 1, {0x22} }, +{ 0x89e6, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xee} }, +{ 0x89f6, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xfe, 0x90, 0x01} }, +{ 0x8a06, 16, {0x33, 0x74, 0x0a, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35} }, +{ 0x8a16, 16, {0x83, 0xf5, 0x83, 0xe0, 0x90, 0x01, 0x34, 0xf0, 0x7e, 0x01, 0x7f, 0x33, 0x7d, 0x02, 0x12, 0x8e} }, +{ 0x8a26, 3, {0xb4, 0x7f, 0x00} }, +{ 0x8a29, 1, {0x22} }, +{ 0x8a2a, 4, {0xad, 0x07, 0xac, 0x06} }, +{ 0x8a2e, 16, {0x8d, 0x82, 0x8c, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xee} }, +{ 0x8a3e, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xfe, 0x8d, 0x82} }, +{ 0x8a4e, 16, {0x8c, 0x83, 0xa3, 0xe0, 0x60, 0x0f, 0xef, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0} }, +{ 0x8a5e, 16, {0x44, 0x02, 0xf0, 0x80, 0x0d, 0xef, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0x54} }, +{ 0x8a6e, 4, {0xfd, 0xf0, 0x7f, 0x00} }, +{ 0x8a72, 1, {0x22} }, +{ 0x8a73, 4, {0xad, 0x07, 0xac, 0x06} }, +{ 0x8a77, 16, {0x8d, 0x82, 0x8c, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xee} }, +{ 0x8a87, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xfe, 0x8d, 0x82} }, +{ 0x8a97, 16, {0x8c, 0x83, 0xa3, 0xe0, 0x60, 0x0f, 0xef, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0} }, +{ 0x8aa7, 16, {0x44, 0x01, 0xf0, 0x80, 0x0d, 0xef, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0x54} }, +{ 0x8ab7, 4, {0xfe, 0xf0, 0x7f, 0x00} }, +{ 0x8abb, 1, {0x22} }, +{ 0x8abc, 4, {0xad, 0x07, 0xac, 0x06} }, +{ 0x8ac0, 16, {0x8d, 0x82, 0x8c, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xee} }, +{ 0x8ad0, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xfe, 0x8d, 0x82} }, +{ 0x8ae0, 16, {0x8c, 0x83, 0xa3, 0xe0, 0x60, 0x0d, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x44, 0x40} }, +{ 0x8af0, 16, {0xf0, 0x80, 0x0b, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x54, 0xbf, 0xf0, 0x7f, 0x00} }, +{ 0x8b00, 1, {0x22} }, +{ 0x8b01, 16, {0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x14, 0xfe, 0xc3, 0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xaf} }, +{ 0x8b11, 16, {0x06, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x3a, 0x7f, 0x00} }, +{ 0x8b21, 1, {0x22} }, +{ 0x8b22, 4, {0x8e, 0x54, 0x8f, 0x55} }, +{ 0x8b26, 16, {0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xe0, 0xf5, 0x59, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xf5, 0x56, 0xc3} }, +{ 0x8b36, 16, {0x94, 0x04, 0x40, 0x03, 0x7f, 0xff, 0x22, 0xe5, 0x56, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60, 0x1f} }, +{ 0x8b46, 16, {0x14, 0x60, 0x28, 0x24, 0x03, 0x70, 0x2e, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x57, 0x7e, 0x75, 0x58} }, +{ 0x8b56, 16, {0x80, 0x80, 0x22, 0x7e, 0x7e, 0x7f, 0x00, 0x75, 0x57, 0x7e, 0x75, 0x58, 0x00, 0x80, 0x16, 0x7e} }, +{ 0x8b66, 16, {0x7d, 0x7f, 0x80, 0x75, 0x57, 0x7d, 0x75, 0x58, 0x80, 0x80, 0x0a, 0x7e, 0x7d, 0x7f, 0x00, 0x75} }, +{ 0x8b76, 16, {0x57, 0x7d, 0x75, 0x58, 0x00, 0xe5, 0x59, 0x70, 0x1b, 0x85, 0x58, 0x82, 0x85, 0x57, 0x83, 0x74} }, +{ 0x8b86, 16, {0xff, 0xf0, 0xe5, 0x56, 0x25, 0xe0, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74} }, +{ 0x8b96, 16, {0x01, 0xf0, 0x80, 0x48, 0xe5, 0x55, 0x24, 0x02, 0xff, 0xe4, 0x35, 0x54, 0xfe, 0xe5, 0x59, 0x60} }, +{ 0x8ba6, 16, {0x23, 0x0f, 0xef, 0xac, 0x06, 0x70, 0x01, 0x0e, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfd, 0x05} }, +{ 0x8bb6, 16, {0x58, 0xe5, 0x58, 0xaa, 0x57, 0x70, 0x02, 0x05, 0x57, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xed, 0xf0} }, +{ 0x8bc6, 16, {0x15, 0x59, 0x80, 0xd9, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0xe5, 0x56, 0x25} }, +{ 0x8bd6, 14, {0xe0, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xef, 0xf0, 0x7f, 0x00} }, +{ 0x8be4, 1, {0x22} }, +{ 0x8be5, 16, {0xef, 0x24, 0x05, 0xf5, 0x55, 0xe4, 0x3e, 0xf5, 0x54, 0x90, 0x01, 0x35, 0x74, 0x07, 0xf0, 0x90} }, +{ 0x8bf5, 16, {0x01, 0x7a, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x36, 0xf0, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3} }, +{ 0x8c05, 16, {0xa3, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x56, 0xf5, 0x57, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, +{ 0x8c15, 16, {0xe0, 0x24, 0x9e, 0x60, 0x61, 0x24, 0xf9, 0x60, 0x0e, 0x24, 0xf1, 0x70, 0x03, 0x02, 0x8c, 0xc6} }, +{ 0x8c25, 16, {0x24, 0x14, 0x60, 0x03, 0x02, 0x8d, 0x12, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe} }, +{ 0x8c35, 16, {0xa3, 0xe0, 0xff, 0xc3, 0xe4, 0x9f, 0xf5, 0x59, 0x74, 0x01, 0x9e, 0xf5, 0x58, 0xd3, 0xe5, 0x59} }, +{ 0x8c45, 16, {0x94, 0x40, 0xe5, 0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x40, 0xd3, 0xe5} }, +{ 0x8c55, 16, {0x57, 0x95, 0x59, 0xe5, 0x56, 0x95, 0x58, 0x50, 0x03, 0x02, 0x8d, 0x15, 0xae, 0x58, 0xaf, 0x59} }, +{ 0x8c65, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e} }, +{ 0x8c75, 16, {0x56, 0xf5, 0x57, 0x02, 0x8d, 0x15, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3} }, +{ 0x8c85, 16, {0xe0, 0xff, 0xc3, 0x74, 0x30, 0x9f, 0xf5, 0x59, 0xe4, 0x9e, 0xf5, 0x58, 0xd3, 0xe5, 0x59, 0x94} }, +{ 0x8c95, 16, {0x10, 0xe5, 0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x10, 0xd3, 0xe5, 0x57} }, +{ 0x8ca5, 16, {0x95, 0x59, 0xe5, 0x56, 0x95, 0x58, 0x40, 0x68, 0xae, 0x58, 0xaf, 0x59, 0x85, 0x55, 0x82, 0x85} }, +{ 0x8cb5, 16, {0x54, 0x83, 0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e, 0x56, 0xf5, 0x57, 0x80} }, +{ 0x8cc5, 16, {0x4f, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0xe4, 0x9f} }, +{ 0x8cd5, 16, {0xf5, 0x59, 0xe4, 0x9e, 0xf5, 0x58, 0x45, 0x59, 0x60, 0x0b, 0xd3, 0xe5, 0x59, 0x94, 0x40, 0xe5} }, +{ 0x8ce5, 16, {0x58, 0x94, 0x00, 0x40, 0x06, 0x75, 0x58, 0x00, 0x75, 0x59, 0x40, 0xd3, 0xe5, 0x57, 0x95, 0x59} }, +{ 0x8cf5, 16, {0xe5, 0x56, 0x95, 0x58, 0x40, 0x17, 0xae, 0x58, 0xaf, 0x59, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, +{ 0x8d05, 16, {0xa3, 0xa3, 0xa3, 0xee, 0xf0, 0xfe, 0xa3, 0xef, 0xf0, 0x8e, 0x56, 0xf5, 0x57, 0x7f, 0x01, 0x22} }, +{ 0x8d15, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xe0, 0x24, 0x9e, 0x70, 0x03, 0x02, 0x8d, 0xd5, 0x24, 0xf9} }, +{ 0x8d25, 16, {0x60, 0x58, 0x24, 0xf1, 0x70, 0x03, 0x02, 0x8e, 0x25, 0x24, 0x14, 0x60, 0x03, 0x02, 0x8e, 0x69} }, +{ 0x8d35, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xd3, 0x94, 0xff, 0xee} }, +{ 0x8d45, 16, {0x94, 0x00, 0x40, 0x03, 0x02, 0x8e, 0x69, 0x90, 0x01, 0x75, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57} }, +{ 0x8d55, 16, {0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x70, 0x03, 0x02, 0x8e, 0x69, 0x90, 0x01, 0x75, 0xe0} }, +{ 0x8d65, 16, {0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f} }, +{ 0x8d75, 16, {0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd2, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83} }, +{ 0x8d85, 16, {0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x80, 0xee, 0x94, 0x00, 0x50, 0x03, 0x02, 0x8e} }, +{ 0x8d95, 16, {0x69, 0xd3, 0xef, 0x94, 0xff, 0xee, 0x94, 0x00, 0x40, 0x03, 0x02, 0x8e, 0x69, 0x90, 0x01, 0x76} }, +{ 0x8da5, 16, {0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x70, 0x03, 0x02} }, +{ 0x8db5, 16, {0x8e, 0x69, 0x90, 0x01, 0x76, 0xe0, 0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a} }, +{ 0x8dc5, 16, {0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd2} }, +{ 0x8dd5, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x20, 0xee} }, +{ 0x8de5, 16, {0x94, 0x00, 0x50, 0x03, 0x02, 0x8e, 0x69, 0xd3, 0xef, 0x94, 0x2f, 0xee, 0x94, 0x00, 0x50, 0x74} }, +{ 0x8df5, 16, {0x90, 0x01, 0x77, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e} }, +{ 0x8e05, 16, {0x60, 0x62, 0x90, 0x01, 0x77, 0xe0, 0xff, 0x04, 0xf0, 0xa8, 0x07, 0xe6, 0xff, 0x90, 0x01, 0x7a} }, +{ 0x8e15, 16, {0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xef, 0xf0, 0x80, 0xd5} }, +{ 0x8e25, 16, {0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xe0, 0xff, 0xa3, 0xe0, 0x90, 0x01, 0x78, 0xcf, 0xf0} }, +{ 0x8e35, 16, {0xa3, 0xef, 0xf0, 0xe5, 0x57, 0x15, 0x57, 0xae, 0x56, 0x70, 0x02, 0x15, 0x56, 0x4e, 0x60, 0x24} }, +{ 0x8e45, 16, {0x90, 0x01, 0x78, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xe0} }, +{ 0x8e55, 16, {0xff, 0x90, 0x01, 0x7a, 0xe4, 0x75, 0xf0, 0x01, 0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83} }, +{ 0x8e65, 16, {0xef, 0xf0, 0x80, 0xcf, 0x7e, 0x01, 0x7f, 0x35, 0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xa3, 0xa3} }, +{ 0x8e75, 11, {0xa3, 0xe0, 0xa3, 0xe0, 0x04, 0xfd, 0x12, 0x8e, 0xb4, 0x7f, 0x00} }, +{ 0x8e80, 1, {0x22} }, +{ 0x8e81, 16, {0x8e, 0x5f, 0x8f, 0x60, 0x8c, 0x61, 0x8d, 0x62, 0xaf, 0x03, 0x1b, 0xef, 0x60, 0x24, 0x05, 0x60} }, +{ 0x8e91, 16, {0xe5, 0x60, 0xae, 0x5f, 0x70, 0x02, 0x05, 0x5f, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe0, 0xff, 0x05} }, +{ 0x8ea1, 16, {0x62, 0xe5, 0x62, 0xac, 0x61, 0x70, 0x02, 0x05, 0x61, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0} }, +{ 0x8eb1, 3, {0x80, 0xd6, 0x22} }, +{ 0x8eb4, 6, {0x8d, 0x5a, 0xab, 0x07, 0xaa, 0x06} }, +{ 0x8eba, 16, {0x75, 0x5e, 0x40, 0x75, 0x5d, 0x0d, 0x75, 0x5c, 0x03, 0x75, 0x5b, 0x00, 0x90, 0x7f, 0xc2, 0xe0} }, +{ 0x8eca, 16, {0x20, 0xe1, 0xf9, 0xaf, 0x5e, 0xae, 0x5d, 0xad, 0x5c, 0xac, 0x5b, 0xec, 0x4d, 0x4e, 0x4f, 0x70} }, +{ 0x8eda, 16, {0x08, 0x90, 0x7f, 0xc2, 0x74, 0x02, 0xf0, 0x80, 0xd7, 0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0x16} }, +{ 0x8eea, 16, {0xaf, 0x03, 0xae, 0x02, 0x7c, 0x7b, 0x7d, 0x80, 0xab, 0x5a, 0x12, 0x8e, 0x81, 0x90, 0x7f, 0xc3} }, +{ 0x8efa, 8, {0xe5, 0x5a, 0xf0, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, +{ 0x8f02, 1, {0x22} }, +{ 0x8f03, 16, {0x90, 0x01, 0x84, 0x74, 0x0b, 0xf0, 0x90, 0x20, 0x70, 0xe0, 0x54, 0xf0, 0xff, 0xc4, 0x54, 0x0f} }, +{ 0x8f13, 16, {0x90, 0x01, 0x85, 0xf0, 0x90, 0x95, 0xbf, 0xe4, 0x93, 0x90, 0x01, 0x86, 0xf0, 0x90, 0x95, 0xc0} }, +{ 0x8f23, 16, {0xe4, 0x93, 0x90, 0x01, 0x87, 0xf0, 0xe4, 0x90, 0x01, 0x7c, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3} }, +{ 0x8f33, 16, {0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0x88, 0xf0, 0x7e} }, +{ 0x8f43, 16, {0x01, 0x7f, 0x7c, 0x12, 0x10, 0x2c, 0x7e, 0x01, 0x7f, 0x84, 0x7d, 0x14, 0x12, 0x8e, 0xb4, 0x7f} }, +{ 0x8f53, 1, {0x00} }, +{ 0x8f54, 1, {0x22} }, +{ 0x8f55, 16, {0x7e, 0x7b, 0x7f, 0x40, 0x75, 0x4b, 0x7b, 0x75, 0x4c, 0x40, 0x90, 0x7f, 0xd3, 0xe0, 0xff, 0x85} }, +{ 0x8f65, 16, {0x4b, 0x4e, 0x85, 0x4c, 0x4f, 0xe5, 0x4f, 0x24, 0x01, 0xf5, 0x53, 0xe4, 0x35, 0x4e, 0xf5, 0x52} }, +{ 0x8f75, 16, {0xe4, 0xf5, 0x4d, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xe0, 0xfe, 0x14, 0xb4, 0x0c, 0x00, 0x50} }, +{ 0x8f85, 16, {0x5b, 0x90, 0x8f, 0x8d, 0xf8, 0x28, 0x28, 0x73, 0x02, 0x8f, 0xb1, 0x02, 0x8f, 0xb1, 0x02, 0x8f} }, +{ 0x8f95, 16, {0xbb, 0x02, 0x8f, 0xc5, 0x02, 0x8f, 0xc5, 0x02, 0x8f, 0xc5, 0x02, 0x8f, 0xd9, 0x02, 0x8f, 0xb1} }, +{ 0x8fa5, 16, {0x02, 0x8f, 0xcf, 0x02, 0x8f, 0xb1, 0x02, 0x8f, 0xe1, 0x02, 0x8f, 0xb1, 0xef, 0x64, 0x02, 0x60} }, +{ 0x8fb5, 16, {0x2b, 0x75, 0x4d, 0xff, 0x80, 0x26, 0xef, 0x64, 0x0e, 0x60, 0x21, 0x75, 0x4d, 0xff, 0x80, 0x1c} }, +{ 0x8fc5, 16, {0xef, 0x64, 0x03, 0x60, 0x17, 0x75, 0x4d, 0xff, 0x80, 0x12, 0xef, 0x64, 0x03, 0x60, 0x0d, 0x75} }, +{ 0x8fd5, 16, {0x4d, 0xff, 0x80, 0x08, 0xef, 0x64, 0x06, 0x60, 0x03, 0x75, 0x4d, 0xff, 0xe5, 0x4d, 0x60, 0x15} }, +{ 0x8fe5, 16, {0x90, 0x01, 0x98, 0x74, 0x11, 0xf0, 0xa3, 0xee, 0xf0, 0x7e, 0x01, 0x7f, 0x98, 0x7d, 0x02, 0x12} }, +{ 0x8ff5, 16, {0x8e, 0xb4, 0xaf, 0x4d, 0x22, 0xe4, 0xf5, 0x4d, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xe0, 0x14} }, +{ 0x9005, 16, {0xb4, 0x0f, 0x00, 0x40, 0x03, 0x02, 0x91, 0x23, 0x90, 0x90, 0x14, 0xf8, 0x28, 0x28, 0x73, 0x02} }, +{ 0x9015, 16, {0x90, 0x41, 0x02, 0x90, 0x4d, 0x02, 0x90, 0x59, 0x02, 0x90, 0xa7, 0x02, 0x90, 0xb2, 0x02, 0x90} }, +{ 0x9025, 16, {0xbd, 0x02, 0x90, 0xc8, 0x02, 0x90, 0xd3, 0x02, 0x90, 0xde, 0x02, 0x90, 0xe9, 0x02, 0x90, 0xf4} }, +{ 0x9035, 16, {0x02, 0x90, 0xfb, 0x02, 0x91, 0x23, 0x02, 0x91, 0x06, 0x02, 0x91, 0x11, 0xaf, 0x53, 0xae, 0x52} }, +{ 0x9045, 16, {0x12, 0x83, 0xb7, 0x8f, 0x4d, 0x02, 0x91, 0x26, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x84, 0x95, 0x8f} }, +{ 0x9055, 16, {0x4d, 0x02, 0x91, 0x26, 0x85, 0x52, 0x50, 0x85, 0x53, 0x51, 0xe5, 0x51, 0x24, 0x01, 0xff, 0xe4} }, +{ 0x9065, 16, {0x35, 0x50, 0xfe, 0x12, 0x85, 0x2f, 0xaf, 0x51, 0xae, 0x50, 0x12, 0x85, 0xc2, 0x8f, 0x4d, 0xef} }, +{ 0x9075, 16, {0x64, 0x01, 0x60, 0x03, 0x02, 0x91, 0x26, 0xaf, 0x51, 0xae, 0x50, 0x12, 0x86, 0x17, 0x8f, 0x4d} }, +{ 0x9085, 16, {0xe5, 0x4d, 0x70, 0x03, 0x02, 0x91, 0x26, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xe0, 0x75, 0xf0} }, +{ 0x9095, 16, {0x0d, 0xa4, 0x24, 0xf4, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xaf, 0x82, 0xfe, 0x12, 0x86, 0x17, 0x02} }, +{ 0x90a5, 16, {0x91, 0x26, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x8a, 0x2a, 0x8f, 0x4d, 0x80, 0x74, 0xaf, 0x53, 0xae} }, +{ 0x90b5, 16, {0x52, 0x12, 0x8a, 0x73, 0x8f, 0x4d, 0x80, 0x69, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x8a, 0xbc, 0x8f} }, +{ 0x90c5, 16, {0x4d, 0x80, 0x5e, 0xaf, 0x4c, 0xae, 0x4b, 0x12, 0x8b, 0xe5, 0x8f, 0x4d, 0x80, 0x53, 0xaf, 0x53} }, +{ 0x90d5, 16, {0xae, 0x52, 0x12, 0x89, 0x5b, 0x8f, 0x4d, 0x80, 0x48, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x1a, 0xf1} }, +{ 0x90e5, 16, {0x8f, 0x4d, 0x80, 0x3d, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x89, 0xe6, 0x8f, 0x4d, 0x80, 0x32, 0x12} }, +{ 0x90f5, 16, {0x8f, 0x03, 0x8f, 0x4d, 0x80, 0x2b, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x8b, 0x01, 0x8f, 0x4d, 0x80} }, +{ 0x9105, 16, {0x20, 0xaf, 0x53, 0xae, 0x52, 0x12, 0x8b, 0x22, 0x8f, 0x4d, 0x80, 0x15, 0xaf, 0x4c, 0xae, 0x4b} }, +{ 0x9115, 16, {0x7c, 0x02, 0x7d, 0xaf, 0x7b, 0x40, 0x12, 0x8e, 0x81, 0xe4, 0xf5, 0x4d, 0x80, 0x03, 0x75, 0x4d} }, +{ 0x9125, 16, {0xff, 0xe5, 0x4d, 0x60, 0x1d, 0x90, 0x01, 0x98, 0x74, 0x11, 0xf0, 0x85, 0x4f, 0x82, 0x85, 0x4e} }, +{ 0x9135, 16, {0x83, 0xe0, 0x90, 0x01, 0x99, 0xf0, 0x7e, 0x01, 0x7f, 0x98, 0x7d, 0x02, 0x12, 0x8e, 0xb4, 0xaf} }, +{ 0x9145, 16, {0x4d, 0x22, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xe0, 0xff, 0x14, 0x24, 0xfa, 0x50, 0x04, 0x24} }, +{ 0x9155, 16, {0xfe, 0x70, 0x1f, 0x90, 0x01, 0x98, 0x74, 0x10, 0xf0, 0xa3, 0xef, 0xf0, 0x85, 0x53, 0x82, 0x85} }, +{ 0x9165, 16, {0x52, 0x83, 0xe0, 0x90, 0x01, 0x9a, 0xf0, 0x7e, 0x01, 0x7f, 0x98, 0x7d, 0x03, 0x12, 0x8e, 0xb4} }, +{ 0x9175, 4, {0x8f, 0x4d, 0xaf, 0x4d} }, +{ 0x9179, 1, {0x22} }, +{ 0x917a, 8, {0x8f, 0x4e, 0x8e, 0x4d, 0x8d, 0x4c, 0x8c, 0x4b} }, +{ 0x9182, 16, {0x75, 0x55, 0x01, 0x75, 0x56, 0x9c, 0xe4, 0xf5, 0x54, 0xaf, 0x50, 0x15, 0x50, 0xef, 0x70, 0x03} }, +{ 0x9192, 16, {0x02, 0x92, 0x18, 0xaf, 0x4f, 0xe4, 0xfc, 0xfd, 0xfe, 0xf8, 0xf9, 0xfa, 0xab, 0x07, 0xaf, 0x4e} }, +{ 0x91a2, 16, {0xae, 0x4d, 0xad, 0x4c, 0xac, 0x4b, 0x12, 0xa0, 0x2e, 0xaf, 0x03, 0x8f, 0x53, 0xaf, 0x4e, 0xae} }, +{ 0x91b2, 16, {0x4d, 0xad, 0x4c, 0xac, 0x4b, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, 0x4f, 0xe4} }, +{ 0x91c2, 16, {0xfc, 0xfd, 0xfe, 0xf8, 0xf9, 0xfa, 0xab, 0x07, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04} }, +{ 0x91d2, 16, {0x12, 0xa0, 0x2e, 0x8f, 0x4e, 0x8e, 0x4d, 0x8d, 0x4c, 0x8c, 0x4b, 0xe5, 0x53, 0x24, 0x30, 0xf5} }, +{ 0x91e2, 16, {0x53, 0xd3, 0x94, 0x39, 0x40, 0x06, 0x74, 0x07, 0x25, 0x53, 0xf5, 0x53, 0x05, 0x56, 0xe5, 0x56} }, +{ 0x91f2, 16, {0xae, 0x55, 0x70, 0x02, 0x05, 0x55, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe4, 0xf0, 0x05, 0x56, 0xe5} }, +{ 0x9202, 16, {0x56, 0xae, 0x55, 0x70, 0x02, 0x05, 0x55, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x53, 0xf0, 0x05} }, +{ 0x9212, 16, {0x54, 0x05, 0x54, 0x02, 0x91, 0x8b, 0xe5, 0x56, 0x15, 0x56, 0x70, 0x02, 0x15, 0x55, 0xaf, 0x54} }, +{ 0x9222, 16, {0x15, 0x54, 0xef, 0x60, 0x23, 0xe5, 0x56, 0x15, 0x56, 0xae, 0x55, 0x70, 0x02, 0x15, 0x55, 0xf5} }, +{ 0x9232, 16, {0x82, 0x8e, 0x83, 0xe0, 0xff, 0x05, 0x52, 0xe5, 0x52, 0xac, 0x51, 0x70, 0x02, 0x05, 0x51, 0x14} }, +{ 0x9242, 8, {0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x80, 0xd6} }, +{ 0x924a, 1, {0x22} }, +{ 0x924b, 16, {0xaa, 0x07, 0xa9, 0x05, 0x90, 0x01, 0xc9, 0xe0, 0xc3, 0x94, 0x40, 0x50, 0x61, 0xac, 0x02, 0x74} }, +{ 0x925b, 16, {0x01, 0x7e, 0x00, 0xa8, 0x04, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff} }, +{ 0x926b, 16, {0xe4, 0xef, 0x55, 0x30, 0x60, 0x45, 0xea, 0x04, 0xff, 0x90, 0x01, 0xc2, 0xe0, 0xfc, 0xa3, 0xe0} }, +{ 0x927b, 16, {0xfd, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0xa3, 0xe9, 0xf0, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xa3} }, +{ 0x928b, 16, {0xeb, 0xf0, 0x90, 0x01, 0xc2, 0xe4, 0x75, 0xf0, 0x03, 0x12, 0x9f, 0x8e, 0xfc, 0xd3, 0xe5, 0xf0} }, +{ 0x929b, 16, {0x94, 0x87, 0xec, 0x94, 0x02, 0x40, 0x0a, 0x90, 0x01, 0xc2, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0xca} }, +{ 0x92ab, 16, {0xf0, 0xc2, 0xaf, 0x90, 0x01, 0xc9, 0xe0, 0x04, 0xf0, 0xd2, 0xaf, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, +{ 0x92bb, 1, {0x22} }, +{ 0x92bc, 16, {0x90, 0x01, 0xc9, 0xe0, 0xd3, 0x94, 0x00, 0x40, 0x55, 0x90, 0x01, 0xbe, 0xe0, 0xfc, 0xa3, 0xe0} }, +{ 0x92cc, 16, {0xaa, 0x04, 0xf9, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0xaa, 0x06, 0xa9, 0x07, 0xa8} }, +{ 0x92dc, 16, {0x01, 0xac, 0x02, 0xad, 0x03, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, 0x7e, 0x00, 0x7f, 0x03, 0x12} }, +{ 0x92ec, 16, {0x9f, 0x1f, 0x90, 0x01, 0xbe, 0xe4, 0x75, 0xf0, 0x03, 0x12, 0x9f, 0x8e, 0xfc, 0xd3, 0xe5, 0xf0} }, +{ 0x92fc, 16, {0x94, 0x87, 0xec, 0x94, 0x02, 0x40, 0x0a, 0x90, 0x01, 0xbe, 0x74, 0x01, 0xf0, 0xa3, 0x74, 0xca} }, +{ 0x930c, 16, {0xf0, 0xc2, 0xaf, 0x90, 0x01, 0xc9, 0xe0, 0x14, 0xf0, 0xd2, 0xaf, 0x7f, 0x01, 0x22, 0x7f, 0x00} }, +{ 0x931c, 1, {0x22} }, +{ 0x931d, 16, {0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0x73, 0x7e, 0x7b, 0x7f, 0x80, 0x75, 0x50, 0x7b, 0x75, 0x51} }, +{ 0x932d, 16, {0x80, 0xe5, 0x51, 0x24, 0x01, 0xff, 0xe4, 0x35, 0x50, 0xa9, 0x07, 0x7b, 0x01, 0x8b, 0x52, 0xf5} }, +{ 0x933d, 16, {0x53, 0x89, 0x54, 0xfe, 0x12, 0x92, 0xbc, 0xef, 0x60, 0x50, 0xab, 0x52, 0xaa, 0x53, 0xa9, 0x54} }, +{ 0x934d, 16, {0x12, 0x9f, 0x48, 0x14, 0xff, 0x90, 0x00, 0x01, 0x12, 0x9f, 0x61, 0xb4, 0x02, 0x16, 0xc2, 0xaf} }, +{ 0x935d, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x44} }, +{ 0x936d, 16, {0x04, 0xf0, 0xd2, 0xaf, 0x74, 0x01, 0x7e, 0x00, 0xa8, 0x07, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce} }, +{ 0x937d, 16, {0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe4, 0xef, 0x55, 0x30, 0x60, 0x0f, 0x85, 0x51, 0x82, 0x85, 0x50} }, +{ 0x938d, 10, {0x83, 0x74, 0x0d, 0xf0, 0x90, 0x7f, 0xc3, 0x74, 0x04, 0xf0} }, +{ 0x9397, 1, {0x22} }, +{ 0x9398, 16, {0x12, 0x93, 0x1d, 0xe4, 0xf5, 0x4b, 0x74, 0x36, 0x25, 0x4b, 0xf8, 0xe6, 0x54, 0xf0, 0xf5, 0x4c} }, +{ 0x93a8, 16, {0x74, 0xc5, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5, 0x83, 0xe0, 0x65, 0x4c, 0xff, 0xc4} }, +{ 0x93b8, 16, {0x54, 0x0f, 0xf5, 0x4d, 0x60, 0x22, 0x74, 0xc5, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x01, 0xf5} }, +{ 0x93c8, 16, {0x83, 0xe5, 0x4c, 0xf0, 0xaf, 0x4b, 0x7d, 0x01, 0xe5, 0x4c, 0x45, 0x4d, 0xfb, 0x12, 0x92, 0x4b} }, +{ 0x93d8, 16, {0xef, 0x70, 0x05, 0x12, 0x93, 0x1d, 0x80, 0xec, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40} }, +{ 0x93e8, 16, {0xb5, 0x12, 0x93, 0x1d, 0xe5, 0x3a, 0x60, 0x48, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8} }, +{ 0x93f8, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x55, 0x3a, 0x60, 0x29, 0xe5, 0x4b} }, +{ 0x9408, 16, {0x75, 0xf0, 0x08, 0xa4, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xf5, 0x83, 0xe0, 0x30, 0xe6} }, +{ 0x9418, 16, {0x16, 0xaf, 0x4b, 0x7d, 0x04, 0x7b, 0x80, 0x12, 0x92, 0x4b, 0xef, 0x70, 0x05, 0x12, 0x93, 0x1d} }, +{ 0x9428, 16, {0x80, 0xef, 0xe5, 0x4c, 0xf4, 0x52, 0x3a, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0xbb} }, +{ 0x9438, 16, {0x90, 0x03, 0x00, 0xe0, 0x60, 0x03, 0x02, 0x95, 0x05, 0x74, 0x19, 0xf0, 0x7f, 0x02, 0x12, 0x81} }, +{ 0x9448, 16, {0xd9, 0x8e, 0x4e, 0x8f, 0x4f, 0xc3, 0xe5, 0x4e, 0x64, 0x80, 0x94, 0x80, 0x40, 0xee, 0x90, 0x01} }, +{ 0x9458, 16, {0xbc, 0xe0, 0x65, 0x4f, 0xf0, 0x60, 0x37, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8, 0x07} }, +{ 0x9468, 16, {0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x90, 0x01, 0xbc, 0xe0, 0x55, 0x4c, 0x60} }, +{ 0x9478, 16, {0x14, 0xaf, 0x4b, 0x7d, 0x08, 0xe5, 0x4c, 0x55, 0x4f, 0xfb, 0x12, 0x92, 0x4b, 0xef, 0x70, 0x05} }, +{ 0x9488, 16, {0x12, 0x93, 0x1d, 0x80, 0xec, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0xcc, 0x90, 0x01} }, +{ 0x9498, 16, {0xbc, 0xe5, 0x4f, 0xf0, 0xe4, 0xf5, 0x4b, 0xc2, 0xaf, 0x74, 0x32, 0x25, 0x4b, 0xf8, 0xe6, 0xf5} }, +{ 0x94a8, 16, {0x4c, 0xe4, 0xf6, 0xd2, 0xaf, 0x53, 0x4c, 0x1e, 0xe5, 0x4c, 0x60, 0x11, 0xaf, 0x4b, 0x7d, 0x02} }, +{ 0x94b8, 16, {0xab, 0x4c, 0x12, 0x92, 0x4b, 0xef, 0x70, 0x05, 0x12, 0x93, 0x1d, 0x80, 0xef, 0x74, 0x2c, 0x25} }, +{ 0x94c8, 16, {0x4b, 0xf8, 0xe6, 0xf5, 0x4c, 0x74, 0xfc, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83} }, +{ 0x94d8, 16, {0xe0, 0x65, 0x4c, 0x60, 0x11, 0xaf, 0x4b, 0x7d, 0x04, 0xab, 0x4c, 0x12, 0x92, 0x4b, 0xef, 0x70} }, +{ 0x94e8, 16, {0x05, 0x12, 0x93, 0x1d, 0x80, 0xef, 0x74, 0xfc, 0x25, 0x4b, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5} }, +{ 0x94f8, 16, {0x83, 0xe5, 0x4c, 0xf0, 0x05, 0x4b, 0xe5, 0x4b, 0xc3, 0x94, 0x04, 0x40, 0x9a, 0x12, 0x93, 0x1d} }, +{ 0x9508, 1, {0x22} }, +{ 0x9509, 12, {0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x62, 0x02, 0x95, 0x50} }, +{ 0x9515, 16, {0x02, 0x05, 0xad, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2} }, +{ 0x9525, 16, {0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33} }, +{ 0x9535, 16, {0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf} }, +{ 0x9545, 16, {0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x95, 0x95, 0xe4, 0x7e} }, +{ 0x9555, 16, {0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93} }, +{ 0x9565, 16, {0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3} }, +{ 0x9575, 16, {0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca} }, +{ 0x9585, 16, {0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe} }, +{ 0x9595, 16, {0x60, 0x24, 0x02, 0x8a, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x81, 0x82, 0x84, 0x88} }, +{ 0x95a5, 16, {0x90, 0xa0, 0xc0, 0xc1, 0xc2, 0xc4, 0xc8, 0xd0, 0xe0, 0xe1, 0xe2, 0xe4, 0xe8, 0xf0, 0xf1, 0xf2} }, +{ 0x95b5, 8, {0xf4, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xfe, 0xff} }, +{ 0x95bd, 1, {0x00} }, +{ 0x95be, 3, {0x00, 0x03, 0x1d} }, +{ 0x95c1, 8, {0x8b, 0x54, 0x8a, 0x55, 0x89, 0x56, 0x8d, 0x57} }, +{ 0x95c9, 16, {0xe4, 0xf5, 0x58, 0xf5, 0x59, 0xaf, 0x57, 0x15, 0x57, 0xef, 0x60, 0x36, 0xab, 0x54, 0x05, 0x56} }, +{ 0x95d9, 16, {0xe5, 0x56, 0xaa, 0x55, 0x70, 0x02, 0x05, 0x55, 0x14, 0xf9, 0x12, 0x9f, 0x48, 0xff, 0xe5, 0x58} }, +{ 0x95e9, 16, {0xe5, 0x59, 0x6f, 0x25, 0xe0, 0xff, 0xe4, 0x33, 0xfe, 0x74, 0xa2, 0x2f, 0xf5, 0x82, 0xee, 0x34} }, +{ 0x95f9, 16, {0x9b, 0xf5, 0x83, 0xe5, 0x58, 0xff, 0xe4, 0x93, 0xf5, 0x58, 0x74, 0x01, 0x93, 0x6f, 0xf5, 0x59} }, +{ 0x9609, 6, {0x80, 0xc3, 0xae, 0x58, 0xaf, 0x59} }, +{ 0x960f, 1, {0x22} }, +{ 0x9610, 11, {0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18} }, +{ 0x961b, 16, {0x90, 0x20, 0x60, 0xe0, 0x54, 0x0f, 0xfe, 0x30, 0xe0, 0x05, 0x90, 0x20, 0x02, 0xe0, 0xff, 0xee} }, +{ 0x962b, 16, {0x30, 0xe1, 0x05, 0x90, 0x20, 0x0a, 0xe0, 0xff, 0xee, 0x30, 0xe2, 0x05, 0x90, 0x20, 0x12, 0xe0} }, +{ 0x963b, 16, {0xff, 0xee, 0x30, 0xe3, 0x05, 0x90, 0x20, 0x1a, 0xe0, 0xff, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x1e} }, +{ 0x964b, 10, {0x04, 0xe4, 0xf0, 0x80, 0x05, 0x90, 0x01, 0xc4, 0xee, 0xf0} }, +{ 0x9655, 9, {0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32} }, +{ 0x965e, 2, {0xa9, 0x03} }, +{ 0x9660, 16, {0xef, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xab, 0x82, 0xfa, 0xe5} }, +{ 0x9670, 16, {0x57, 0x45, 0x58, 0xf5, 0x59, 0xe9, 0x60, 0x14, 0x8a, 0x83, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82} }, +{ 0x9680, 16, {0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x4d, 0xf0, 0xe4, 0xfe, 0x80, 0x13, 0xeb, 0x24, 0x04, 0xf5} }, +{ 0x9690, 16, {0x82, 0xe4, 0x3a, 0xf5, 0x83, 0xe0, 0xff, 0xed, 0xf4, 0xfc, 0xef, 0x5c, 0xf0, 0xae, 0x59, 0xeb} }, +{ 0x96a0, 16, {0x24, 0x06, 0xf5, 0x82, 0xe4, 0x3a, 0xf5, 0x83, 0xe0, 0x55, 0x59, 0xfc, 0xb5, 0x06, 0x03, 0xaf} }, +{ 0x96b0, 16, {0x05, 0x22, 0xe5, 0x57, 0x5c, 0xfe, 0xe5, 0x58, 0x5c, 0xfd, 0xe9, 0x60, 0x16, 0xee, 0x70, 0x04} }, +{ 0x96c0, 16, {0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xae, 0x07, 0xed, 0x70, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f} }, +{ 0x96d0, 16, {0x00, 0xad, 0x07, 0xee, 0x60, 0x03, 0xaf, 0x57, 0x22, 0xed, 0x60, 0x03, 0xaf, 0x58, 0x22, 0x7f} }, +{ 0x96e0, 1, {0x00} }, +{ 0x96e1, 1, {0x22} }, +{ 0x96e2, 16, {0x75, 0x50, 0x02, 0x75, 0x51, 0xb0, 0x90, 0x03, 0x35, 0x74, 0x0f, 0xf0, 0x85, 0x51, 0x82, 0x85} }, +{ 0x96f2, 16, {0x50, 0x83, 0xe0, 0xff, 0x90, 0x03, 0x36, 0xf0, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xa3, 0xe0} }, +{ 0x9702, 16, {0x90, 0x03, 0x37, 0xf0, 0xa3, 0x74, 0xff, 0xf0, 0x75, 0x52, 0x03, 0x75, 0x53, 0x39, 0xef, 0x14} }, +{ 0x9712, 16, {0xb4, 0x0b, 0x00, 0x40, 0x03, 0x02, 0x9b, 0x6a, 0x90, 0x97, 0x21, 0xf8, 0x28, 0x28, 0x73, 0x02} }, +{ 0x9722, 16, {0x97, 0x42, 0x02, 0x97, 0xe1, 0x02, 0x98, 0xe6, 0x02, 0x99, 0x06, 0x02, 0x99, 0x06, 0x02, 0x99} }, +{ 0x9732, 16, {0xa1, 0x02, 0x99, 0xdc, 0x02, 0x9a, 0x01, 0x02, 0x9a, 0xbf, 0x02, 0x9a, 0xef, 0x02, 0x9b, 0x1b} }, +{ 0x9742, 16, {0xe4, 0xf5, 0x4b, 0xe5, 0x4b, 0x75, 0xf0, 0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20} }, +{ 0x9752, 16, {0xaf, 0x82, 0xf5, 0x4e, 0x8f, 0x4f, 0xe4, 0xff, 0xe4, 0xfe, 0xef, 0x60, 0x10, 0x74, 0x8a, 0x2e} }, +{ 0x9762, 16, {0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xf4, 0xf5, 0x4c, 0x80, 0x0d, 0x74, 0x8a, 0x2e} }, +{ 0x9772, 16, {0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xf5, 0x4c, 0xe5, 0x4f, 0x24, 0x07, 0xf5, 0x82} }, +{ 0x9782, 16, {0xe4, 0x35, 0x4e, 0xf5, 0x83, 0xe5, 0x4c, 0xf0, 0xe0, 0xf5, 0x4d, 0x65, 0x4c, 0x60, 0x38, 0xe4} }, +{ 0x9792, 16, {0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xfd, 0x05, 0x53, 0xe5, 0x53, 0xaa, 0x52, 0x70, 0x02} }, +{ 0x97a2, 16, {0x05, 0x52, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xed, 0xf0, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52, 0x70} }, +{ 0x97b2, 16, {0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xe5, 0x4c, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, +{ 0x97c2, 16, {0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x9b, 0x70, 0x0e, 0xbe, 0x24, 0x8f, 0x0f, 0xef, 0x64, 0x02, 0x70} }, +{ 0x97d2, 16, {0x87, 0x05, 0x4b, 0xe5, 0x4b, 0x64, 0x04, 0x60, 0x03, 0x02, 0x97, 0x45, 0x02, 0x9b, 0x70, 0xe4} }, +{ 0x97e2, 16, {0xf5, 0x4b, 0xaf, 0x4b, 0xe4, 0xfd, 0x12, 0x82, 0xa8, 0x05, 0x4b, 0xe5, 0x4b, 0xd3, 0x94, 0x03} }, +{ 0x97f2, 16, {0x40, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x96, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xe4, 0xf5, 0x4d, 0x7e} }, +{ 0x9802, 16, {0x20, 0x7f, 0x00, 0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0xf5, 0x4b, 0xaf, 0x4b, 0x74, 0x01, 0xa8} }, +{ 0x9812, 16, {0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf5, 0x4c, 0x90, 0x01, 0xc4, 0xf0, 0x90, 0x01} }, +{ 0x9822, 16, {0xc0, 0xe4, 0xf0, 0xa3, 0x74, 0x0a, 0xf0, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0x74, 0x02} }, +{ 0x9832, 16, {0xf0, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x4c, 0x34, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0} }, +{ 0x9842, 16, {0x70, 0xef, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xff, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52} }, +{ 0x9852, 16, {0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, +{ 0x9862, 16, {0x83, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x01, 0xc4, 0xf0, 0x75, 0x4d, 0xff, 0x90, 0x01, 0xc4, 0xe0} }, +{ 0x9872, 16, {0xff, 0x60, 0x37, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04, 0xfe, 0x05, 0x53, 0xe5, 0x53} }, +{ 0x9882, 16, {0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xee, 0xf0, 0x05, 0x53, 0xe5} }, +{ 0x9892, 16, {0x53, 0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x85, 0x53} }, +{ 0x98a2, 16, {0x82, 0x85, 0x52, 0x83, 0xe5, 0x4c, 0xf0, 0x75, 0x4d, 0xff, 0xe5, 0x4d, 0x70, 0x16, 0x74, 0x08} }, +{ 0x98b2, 16, {0x25, 0x4f, 0xf5, 0x4f, 0xe4, 0x35, 0x4e, 0xf5, 0x4e, 0x05, 0x4b, 0xe5, 0x4b, 0x64, 0x04, 0x60} }, +{ 0x98c2, 16, {0x03, 0x02, 0x98, 0x0d, 0xe4, 0xf5, 0x4b, 0xaf, 0x4b, 0x7d, 0x01, 0x12, 0x82, 0xa8, 0x05, 0x4b} }, +{ 0x98d2, 16, {0xe5, 0x4b, 0xd3, 0x94, 0x03, 0x40, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x13, 0xf0, 0xa3, 0x74, 0x12} }, +{ 0x98e2, 16, {0xf0, 0x02, 0x9b, 0x70, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xa3, 0xe0, 0x14, 0xff, 0x74, 0x01} }, +{ 0x98f2, 16, {0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x90, 0x02, 0xf7, 0xf0, 0x90, 0x01, 0xc4} }, +{ 0x9902, 16, {0xf0, 0x02, 0x9b, 0x70, 0x90, 0x01, 0xc0, 0x74, 0x03, 0xf0, 0xa3, 0x74, 0xe8, 0xf0, 0xe4, 0xf5} }, +{ 0x9912, 16, {0x4d, 0x90, 0x02, 0xf7, 0xe0, 0xff, 0x90, 0x01, 0xc4, 0xe0, 0xb5, 0x07, 0x19, 0x90, 0x01, 0xc0} }, +{ 0x9922, 16, {0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70, 0xea, 0x90, 0x03, 0x38, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52} }, +{ 0x9932, 16, {0x83, 0x74, 0xff, 0xf0, 0xf5, 0x4d, 0xe5, 0x4d, 0x60, 0x03, 0x02, 0x9b, 0x70, 0x90, 0x01, 0xc0} }, +{ 0x9942, 16, {0xf0, 0xa3, 0x74, 0x96, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70, 0xf6, 0x7f} }, +{ 0x9952, 16, {0x02, 0x12, 0x81, 0xd9, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, 0xf3, 0xef, 0x54, 0x0f, 0xf5} }, +{ 0x9962, 16, {0x4d, 0x90, 0x02, 0xf7, 0xe0, 0x55, 0x4d, 0x70, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0x8f} }, +{ 0x9972, 16, {0x4c, 0x85, 0x51, 0x82, 0x85, 0x50, 0x83, 0xe0, 0xb4, 0x05, 0x0c, 0xe5, 0x4c, 0x70, 0x04, 0x7f} }, +{ 0x9982, 16, {0x01, 0x80, 0x02, 0x7f, 0x00, 0x8f, 0x4c, 0xe5, 0x4c, 0x70, 0x03, 0x02, 0x9b, 0x70, 0xe4, 0x90} }, +{ 0x9992, 16, {0x03, 0x38, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52, 0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x9b, 0x70, 0xe4} }, +{ 0x99a2, 16, {0xff, 0xfd, 0x12, 0x82, 0xa8, 0x7e, 0x20, 0x7f, 0x00, 0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0x85} }, +{ 0x99b2, 16, {0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0xa3, 0xa3, 0xe0, 0x44, 0x80, 0xf0, 0x85, 0x4f, 0x82, 0x85} }, +{ 0x99c2, 16, {0x4e, 0x83, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x85, 0x4f, 0x82, 0x85, 0x4e, 0x83, 0xa3, 0xa3} }, +{ 0x99d2, 16, {0xa3, 0xe0, 0x54, 0x7f, 0xf0, 0xd2, 0x04, 0x02, 0x9b, 0x70, 0xc2, 0x04, 0x7e, 0x20, 0x7f, 0x00} }, +{ 0x99e2, 16, {0x75, 0x4e, 0x20, 0x75, 0x4f, 0x00, 0xe5, 0x4f, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x4e, 0xf5} }, +{ 0x99f2, 16, {0x83, 0xe0, 0x30, 0xe6, 0xf1, 0xe4, 0xff, 0x7d, 0x01, 0x12, 0x82, 0xa8, 0x02, 0x9b, 0x70, 0xe4} }, +{ 0x9a02, 16, {0xf5, 0x4d, 0xf5, 0x4b, 0xaf, 0x4b, 0xe4, 0xfd, 0x12, 0x82, 0xa8, 0xe5, 0x4b, 0x75, 0xf0, 0x08} }, +{ 0x9a12, 16, {0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xaf, 0x82, 0xf5, 0x4e, 0x8f, 0x4f, 0xf5, 0x83} }, +{ 0x9a22, 16, {0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0xfc, 0xf0, 0xaf} }, +{ 0x9a32, 16, {0x4b, 0x7d, 0x01, 0x7b, 0x01, 0x75, 0x57, 0x80, 0x75, 0x58, 0x40, 0x12, 0x96, 0x5e, 0x8f, 0x4d} }, +{ 0x9a42, 16, {0xe5, 0x4d, 0x70, 0x11, 0xaf, 0x4b, 0x7d, 0x02, 0x7b, 0x01, 0x75, 0x57, 0x10, 0x75, 0x58, 0x20} }, +{ 0x9a52, 16, {0x12, 0x96, 0x5e, 0x8f, 0x4d, 0xe5, 0x4d, 0x70, 0x10, 0xaf, 0x4b, 0x7d, 0x01, 0xfb, 0x75, 0x57} }, +{ 0x9a62, 16, {0x80, 0x75, 0x58, 0x40, 0x12, 0x96, 0x5e, 0x8f, 0x4d, 0xe5, 0x4d, 0x70, 0x10, 0xaf, 0x4b, 0x7d} }, +{ 0x9a72, 16, {0x02, 0xfb, 0x75, 0x57, 0x10, 0x75, 0x58, 0x20, 0x12, 0x96, 0x5e, 0x8f, 0x4d, 0xaf, 0x4b, 0x7d} }, +{ 0x9a82, 16, {0x01, 0x12, 0x82, 0xa8, 0xe5, 0x4d, 0x60, 0x26, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0xe5, 0x4b, 0x04} }, +{ 0x9a92, 16, {0xff, 0x05, 0x53, 0xe5, 0x53, 0xac, 0x52, 0x70, 0x02, 0x05, 0x52, 0x14, 0xf5, 0x82, 0x8c, 0x83} }, +{ 0x9aa2, 16, {0xef, 0xf0, 0x85, 0x53, 0x82, 0x85, 0x52, 0x83, 0xe5, 0x4d, 0xf0, 0x02, 0x9b, 0x70, 0x05, 0x4b} }, +{ 0x9ab2, 16, {0xe5, 0x4b, 0xd3, 0x94, 0x03, 0x50, 0x03, 0x02, 0x9a, 0x06, 0x02, 0x9b, 0x70, 0xe4, 0x90, 0x03} }, +{ 0x9ac2, 16, {0x59, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0x74} }, +{ 0x9ad2, 16, {0x9b, 0xf0, 0xa3, 0x74, 0x92, 0xf0, 0x7e, 0x03, 0x7f, 0x59, 0x12, 0x19, 0xc1, 0xef, 0x64, 0x08} }, +{ 0x9ae2, 16, {0x70, 0x03, 0x02, 0x9b, 0x70, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x02, 0x9b, 0x70, 0xe4, 0x90, 0x03} }, +{ 0x9af2, 16, {0x59, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xa3, 0xe5} }, +{ 0x9b02, 16, {0x52, 0xf0, 0xa3, 0xe5, 0x53, 0xf0, 0x7e, 0x03, 0x7f, 0x59, 0x12, 0x10, 0x2c, 0xef, 0x64, 0x08} }, +{ 0x9b12, 16, {0x60, 0x5c, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x80, 0x55, 0xe5, 0x51, 0x24, 0x02, 0xff, 0xe4, 0x35} }, +{ 0x9b22, 16, {0x50, 0xfa, 0xa9, 0x07, 0x7b, 0x01, 0x7d, 0x10, 0x12, 0x95, 0xc1, 0xef, 0x4e, 0x70, 0x32, 0x90} }, +{ 0x9b32, 16, {0x03, 0x59, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0xe5} }, +{ 0x9b42, 16, {0x51, 0x24, 0x02, 0x90, 0x03, 0x60, 0xf0, 0xe4, 0x35, 0x50, 0x90, 0x03, 0x5f, 0xf0, 0x7e, 0x03} }, +{ 0x9b52, 16, {0x7f, 0x59, 0x12, 0x19, 0xc1, 0xef, 0x64, 0x08, 0x60, 0x14, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x80} }, +{ 0x9b62, 16, {0x0d, 0xe4, 0x90, 0x03, 0x38, 0xf0, 0x80, 0x06, 0x90, 0x03, 0x38, 0x74, 0x01, 0xf0, 0x90, 0x01} }, +{ 0x9b72, 16, {0xc0, 0xe4, 0xf0, 0xa3, 0x74, 0x0a, 0xf0, 0x90, 0x01, 0xc0, 0xe0, 0x70, 0x02, 0xa3, 0xe0, 0x70} }, +{ 0x9b82, 15, {0xf6, 0x7e, 0x03, 0x7f, 0x35, 0x7d, 0x24, 0x12, 0x8e, 0xb4, 0xe4, 0x90, 0x02, 0xaf, 0xf0} }, +{ 0x9b91, 1, {0x22} }, +{ 0x9b92, 16, {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f} }, +{ 0x9ba2, 16, {0x00, 0x00, 0xc0, 0xc1, 0xc1, 0x81, 0x01, 0x40, 0xc3, 0x01, 0x03, 0xc0, 0x02, 0x80, 0xc2, 0x41} }, +{ 0x9bb2, 16, {0xc6, 0x01, 0x06, 0xc0, 0x07, 0x80, 0xc7, 0x41, 0x05, 0x00, 0xc5, 0xc1, 0xc4, 0x81, 0x04, 0x40} }, +{ 0x9bc2, 16, {0xcc, 0x01, 0x0c, 0xc0, 0x0d, 0x80, 0xcd, 0x41, 0x0f, 0x00, 0xcf, 0xc1, 0xce, 0x81, 0x0e, 0x40} }, +{ 0x9bd2, 16, {0x0a, 0x00, 0xca, 0xc1, 0xcb, 0x81, 0x0b, 0x40, 0xc9, 0x01, 0x09, 0xc0, 0x08, 0x80, 0xc8, 0x41} }, +{ 0x9be2, 16, {0xd8, 0x01, 0x18, 0xc0, 0x19, 0x80, 0xd9, 0x41, 0x1b, 0x00, 0xdb, 0xc1, 0xda, 0x81, 0x1a, 0x40} }, +{ 0x9bf2, 16, {0x1e, 0x00, 0xde, 0xc1, 0xdf, 0x81, 0x1f, 0x40, 0xdd, 0x01, 0x1d, 0xc0, 0x1c, 0x80, 0xdc, 0x41} }, +{ 0x9c02, 16, {0x14, 0x00, 0xd4, 0xc1, 0xd5, 0x81, 0x15, 0x40, 0xd7, 0x01, 0x17, 0xc0, 0x16, 0x80, 0xd6, 0x41} }, +{ 0x9c12, 16, {0xd2, 0x01, 0x12, 0xc0, 0x13, 0x80, 0xd3, 0x41, 0x11, 0x00, 0xd1, 0xc1, 0xd0, 0x81, 0x10, 0x40} }, +{ 0x9c22, 16, {0xf0, 0x01, 0x30, 0xc0, 0x31, 0x80, 0xf1, 0x41, 0x33, 0x00, 0xf3, 0xc1, 0xf2, 0x81, 0x32, 0x40} }, +{ 0x9c32, 16, {0x36, 0x00, 0xf6, 0xc1, 0xf7, 0x81, 0x37, 0x40, 0xf5, 0x01, 0x35, 0xc0, 0x34, 0x80, 0xf4, 0x41} }, +{ 0x9c42, 16, {0x3c, 0x00, 0xfc, 0xc1, 0xfd, 0x81, 0x3d, 0x40, 0xff, 0x01, 0x3f, 0xc0, 0x3e, 0x80, 0xfe, 0x41} }, +{ 0x9c52, 16, {0xfa, 0x01, 0x3a, 0xc0, 0x3b, 0x80, 0xfb, 0x41, 0x39, 0x00, 0xf9, 0xc1, 0xf8, 0x81, 0x38, 0x40} }, +{ 0x9c62, 16, {0x28, 0x00, 0xe8, 0xc1, 0xe9, 0x81, 0x29, 0x40, 0xeb, 0x01, 0x2b, 0xc0, 0x2a, 0x80, 0xea, 0x41} }, +{ 0x9c72, 16, {0xee, 0x01, 0x2e, 0xc0, 0x2f, 0x80, 0xef, 0x41, 0x2d, 0x00, 0xed, 0xc1, 0xec, 0x81, 0x2c, 0x40} }, +{ 0x9c82, 16, {0xe4, 0x01, 0x24, 0xc0, 0x25, 0x80, 0xe5, 0x41, 0x27, 0x00, 0xe7, 0xc1, 0xe6, 0x81, 0x26, 0x40} }, +{ 0x9c92, 16, {0x22, 0x00, 0xe2, 0xc1, 0xe3, 0x81, 0x23, 0x40, 0xe1, 0x01, 0x21, 0xc0, 0x20, 0x80, 0xe0, 0x41} }, +{ 0x9ca2, 16, {0xa0, 0x01, 0x60, 0xc0, 0x61, 0x80, 0xa1, 0x41, 0x63, 0x00, 0xa3, 0xc1, 0xa2, 0x81, 0x62, 0x40} }, +{ 0x9cb2, 16, {0x66, 0x00, 0xa6, 0xc1, 0xa7, 0x81, 0x67, 0x40, 0xa5, 0x01, 0x65, 0xc0, 0x64, 0x80, 0xa4, 0x41} }, +{ 0x9cc2, 16, {0x6c, 0x00, 0xac, 0xc1, 0xad, 0x81, 0x6d, 0x40, 0xaf, 0x01, 0x6f, 0xc0, 0x6e, 0x80, 0xae, 0x41} }, +{ 0x9cd2, 16, {0xaa, 0x01, 0x6a, 0xc0, 0x6b, 0x80, 0xab, 0x41, 0x69, 0x00, 0xa9, 0xc1, 0xa8, 0x81, 0x68, 0x40} }, +{ 0x9ce2, 16, {0x78, 0x00, 0xb8, 0xc1, 0xb9, 0x81, 0x79, 0x40, 0xbb, 0x01, 0x7b, 0xc0, 0x7a, 0x80, 0xba, 0x41} }, +{ 0x9cf2, 16, {0xbe, 0x01, 0x7e, 0xc0, 0x7f, 0x80, 0xbf, 0x41, 0x7d, 0x00, 0xbd, 0xc1, 0xbc, 0x81, 0x7c, 0x40} }, +{ 0x9d02, 16, {0xb4, 0x01, 0x74, 0xc0, 0x75, 0x80, 0xb5, 0x41, 0x77, 0x00, 0xb7, 0xc1, 0xb6, 0x81, 0x76, 0x40} }, +{ 0x9d12, 16, {0x72, 0x00, 0xb2, 0xc1, 0xb3, 0x81, 0x73, 0x40, 0xb1, 0x01, 0x71, 0xc0, 0x70, 0x80, 0xb0, 0x41} }, +{ 0x9d22, 16, {0x50, 0x00, 0x90, 0xc1, 0x91, 0x81, 0x51, 0x40, 0x93, 0x01, 0x53, 0xc0, 0x52, 0x80, 0x92, 0x41} }, +{ 0x9d32, 16, {0x96, 0x01, 0x56, 0xc0, 0x57, 0x80, 0x97, 0x41, 0x55, 0x00, 0x95, 0xc1, 0x94, 0x81, 0x54, 0x40} }, +{ 0x9d42, 16, {0x9c, 0x01, 0x5c, 0xc0, 0x5d, 0x80, 0x9d, 0x41, 0x5f, 0x00, 0x9f, 0xc1, 0x9e, 0x81, 0x5e, 0x40} }, +{ 0x9d52, 16, {0x5a, 0x00, 0x9a, 0xc1, 0x9b, 0x81, 0x5b, 0x40, 0x99, 0x01, 0x59, 0xc0, 0x58, 0x80, 0x98, 0x41} }, +{ 0x9d62, 16, {0x88, 0x01, 0x48, 0xc0, 0x49, 0x80, 0x89, 0x41, 0x4b, 0x00, 0x8b, 0xc1, 0x8a, 0x81, 0x4a, 0x40} }, +{ 0x9d72, 16, {0x4e, 0x00, 0x8e, 0xc1, 0x8f, 0x81, 0x4f, 0x40, 0x8d, 0x01, 0x4d, 0xc0, 0x4c, 0x80, 0x8c, 0x41} }, +{ 0x9d82, 16, {0x44, 0x00, 0x84, 0xc1, 0x85, 0x81, 0x45, 0x40, 0x87, 0x01, 0x47, 0xc0, 0x46, 0x80, 0x86, 0x41} }, +{ 0x9d92, 16, {0x82, 0x01, 0x42, 0xc0, 0x43, 0x80, 0x83, 0x41, 0x41, 0x00, 0x81, 0xc1, 0x80, 0x81, 0x40, 0x40} }, +{ 0x9da2, 16, {0xe4, 0xff, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0x70, 0x03, 0x02} }, +{ 0x9db2, 16, {0x9e, 0x45, 0x74, 0x36, 0x2f, 0xf8, 0xe6, 0x20, 0xe5, 0x03, 0x02, 0x9e, 0x45, 0xef, 0x75, 0xf0} }, +{ 0x9dc2, 16, {0x08, 0xa4, 0x24, 0x00, 0xf5, 0x82, 0xe4, 0x34, 0x20, 0xad, 0x82, 0xfc, 0xf5, 0x83, 0xe5, 0x82} }, +{ 0x9dd2, 16, {0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe0, 0x54, 0x60, 0x64, 0x60, 0x70, 0x63} }, +{ 0x9de2, 16, {0xef, 0x25, 0xe0, 0x24, 0xef, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe4, 0x75, 0xf0, 0x01} }, +{ 0x9df2, 16, {0x12, 0x9f, 0xa4, 0x85, 0xf0, 0x82, 0xf5, 0x83, 0xe0, 0x8d, 0x82, 0x8c, 0x83, 0xf0, 0x74, 0xf8} }, +{ 0x9e02, 16, {0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0x14, 0xf0, 0x70, 0x36, 0xef, 0x25, 0xe0} }, +{ 0x9e12, 16, {0x24, 0xc7, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0xef, 0x25, 0xe0, 0xfe, 0xc3} }, +{ 0x9e22, 16, {0x74, 0x0c, 0x9e, 0x75, 0xf0, 0x40, 0xa4, 0x24, 0x40, 0xf5, 0x82, 0xe5, 0xf0, 0x34, 0x7b, 0xad} }, +{ 0x9e32, 16, {0x82, 0xfc, 0xef, 0x25, 0xe0, 0x24, 0xef, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xec, 0xf0} }, +{ 0x9e42, 12, {0xa3, 0xed, 0xf0, 0x0f, 0xef, 0x64, 0x04, 0x60, 0x03, 0x02, 0x9d, 0xa4} }, +{ 0x9e4e, 1, {0x22} }, +{ 0x9e4f, 16, {0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, 0xe7, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x3e} }, +{ 0x9e5f, 16, {0x88, 0x82, 0x8c, 0x83, 0xe7, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x32, 0xe3, 0x09, 0xf6, 0x08} }, +{ 0x9e6f, 16, {0xdf, 0xfa, 0x80, 0x78, 0xe3, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x70, 0x88, 0x82, 0x8c, 0x83} }, +{ 0x9e7f, 16, {0xe3, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x64, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf6, 0x08} }, +{ 0x9e8f, 16, {0xdf, 0xfa, 0x80, 0x58, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x4c} }, +{ 0x9e9f, 16, {0x80, 0xd2, 0x80, 0xfa, 0x80, 0xc6, 0x80, 0xd4, 0x80, 0x69, 0x80, 0xf2, 0x80, 0x33, 0x80, 0x10} }, +{ 0x9eaf, 16, {0x80, 0xa6, 0x80, 0xea, 0x80, 0x9a, 0x80, 0xa8, 0x80, 0xda, 0x80, 0xe2, 0x80, 0xca, 0x80, 0x33} }, +{ 0x9ebf, 16, {0x89, 0x82, 0x8a, 0x83, 0xec, 0xfa, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83} }, +{ 0x9ecf, 16, {0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xe9, 0xde, 0xe7, 0x80} }, +{ 0x9edf, 16, {0x0d, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf6, 0x08, 0xdf, 0xf9, 0xec, 0xfa, 0xa9, 0xf0} }, +{ 0x9eef, 16, {0xed, 0xfb, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xec, 0xfa, 0xe0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc} }, +{ 0x9eff, 16, {0xc5, 0x83, 0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xea, 0xde} }, +{ 0x9f0f, 16, {0xe8, 0x80, 0xdb, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf2, 0x08, 0xdf, 0xf9, 0x80, 0xcc} }, +{ 0x9f1f, 16, {0x88, 0xf0, 0xed, 0x24, 0x02, 0xb4, 0x04, 0x00, 0x50, 0xc2, 0xf5, 0x82, 0xeb, 0x24, 0x02, 0xb4} }, +{ 0x9f2f, 16, {0x04, 0x00, 0x50, 0xb8, 0x23, 0x23, 0x45, 0x82, 0xf5, 0x82, 0xef, 0x4e, 0x60, 0xae, 0xef, 0x60} }, +{ 0x9f3f, 9, {0x01, 0x0e, 0xe5, 0x82, 0x23, 0x90, 0x9e, 0x9f, 0x73} }, +{ 0x9f48, 16, {0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02} }, +{ 0x9f58, 9, {0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22} }, +{ 0x9f61, 16, {0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50} }, +{ 0x9f71, 16, {0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22} }, +{ 0x9f81, 13, {0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22} }, +{ 0x9f8e, 16, {0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02} }, +{ 0x9f9e, 6, {0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22} }, +{ 0x9fa4, 16, {0xa3, 0xf8, 0xe0, 0xc5, 0xf0, 0x25, 0xf0, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83} }, +{ 0x9fb4, 6, {0xe0, 0xc8, 0x38, 0xf0, 0xe8, 0x22} }, +{ 0x9fba, 16, {0xbb, 0x01, 0x10, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0xf5, 0xf0} }, +{ 0x9fca, 16, {0xa3, 0xe0, 0x22, 0x50, 0x09, 0xe9, 0x25, 0x82, 0xf8, 0x86, 0xf0, 0x08, 0xe6, 0x22, 0xbb, 0xfe} }, +{ 0x9fda, 16, {0x0a, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0xf5, 0xf0, 0x08, 0xe2, 0x22, 0xe5, 0x83, 0x2a, 0xf5, 0x83} }, +{ 0x9fea, 8, {0xe9, 0x93, 0xf5, 0xf0, 0xa3, 0xe9, 0x93, 0x22} }, +{ 0x9ff2, 16, {0x75, 0xf0, 0x08, 0x75, 0x82, 0x00, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xcd, 0x33, 0xcd, 0xcc} }, +{ 0xa002, 16, {0x33, 0xcc, 0xc5, 0x82, 0x33, 0xc5, 0x82, 0x9b, 0xed, 0x9a, 0xec, 0x99, 0xe5, 0x82, 0x98, 0x40} }, +{ 0xa012, 16, {0x0c, 0xf5, 0x82, 0xee, 0x9b, 0xfe, 0xed, 0x9a, 0xfd, 0xec, 0x99, 0xfc, 0x0f, 0xd5, 0xf0, 0xd6} }, +{ 0xa022, 16, {0xe4, 0xce, 0xfb, 0xe4, 0xcd, 0xfa, 0xe4, 0xcc, 0xf9, 0xa8, 0x82, 0x22, 0xb8, 0x00, 0xc1, 0xb9} }, +{ 0xa032, 16, {0x00, 0x59, 0xba, 0x00, 0x2d, 0xec, 0x8b, 0xf0, 0x84, 0xcf, 0xce, 0xcd, 0xfc, 0xe5, 0xf0, 0xcb} }, +{ 0xa042, 16, {0xf9, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc, 0xeb} }, +{ 0xa052, 16, {0x33, 0xfb, 0x10, 0xd7, 0x03, 0x99, 0x40, 0x04, 0xeb, 0x99, 0xfb, 0x0f, 0xd8, 0xe5, 0xe4, 0xf9} }, +{ 0xa062, 16, {0xfa, 0x22, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc} }, +{ 0xa072, 16, {0xc9, 0x33, 0xc9, 0x10, 0xd7, 0x05, 0x9b, 0xe9, 0x9a, 0x40, 0x07, 0xec, 0x9b, 0xfc, 0xe9, 0x9a} }, +{ 0xa082, 16, {0xf9, 0x0f, 0xd8, 0xe0, 0xe4, 0xc9, 0xfa, 0xe4, 0xcc, 0xfb, 0x22, 0x75, 0xf0, 0x10, 0xef, 0x2f} }, +{ 0xa092, 16, {0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xcc, 0x33, 0xcc, 0xc8, 0x33, 0xc8, 0x10, 0xd7, 0x07} }, +{ 0xa0a2, 16, {0x9b, 0xec, 0x9a, 0xe8, 0x99, 0x40, 0x0a, 0xed, 0x9b, 0xfd, 0xec, 0x9a, 0xfc, 0xe8, 0x99, 0xf8} }, +{ 0xa0b2, 14, {0x0f, 0xd5, 0xf0, 0xda, 0xe4, 0xcd, 0xfb, 0xe4, 0xcc, 0xfa, 0xe4, 0xc8, 0xf9, 0x22} }, +{ 0xa0c0, 16, {0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, 0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, 0xe8, 0x9c, 0x45, 0xf0} }, +{ 0xa0d0, 1, {0x22} }, +{ 0xa0d1, 16, {0xe8, 0x60, 0x0f, 0xec, 0xc3, 0x13, 0xfc, 0xed, 0x13, 0xfd, 0xee, 0x13, 0xfe, 0xef, 0x13, 0xff} }, +{ 0xa0e1, 3, {0xd8, 0xf1, 0x22} }, +{ 0xa0e4, 16, {0x08, 0x08, 0x08, 0xe6, 0xcf, 0x2f, 0xf6, 0x18, 0xe6, 0xce, 0x3e, 0xf6, 0x18, 0xe6, 0xcd, 0x3d} }, +{ 0xa0f4, 7, {0xf6, 0x18, 0xe6, 0xcc, 0x3c, 0xf6, 0x22} }, +{ 0xa0fb, 12, {0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xa3, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22} }, +{ 0xa107, 16, {0xa8, 0x82, 0x85, 0x83, 0xf0, 0xd0, 0x83, 0xd0, 0x82, 0x12, 0xa1, 0x1e, 0x12, 0xa1, 0x1e, 0x12} }, +{ 0xa117, 16, {0xa1, 0x1e, 0x12, 0xa1, 0x1e, 0xe4, 0x73, 0xe4, 0x93, 0xa3, 0xc5, 0x83, 0xc5, 0xf0, 0xc5, 0x83} }, +{ 0xa127, 16, {0xc8, 0xc5, 0x82, 0xc8, 0xf0, 0xa3, 0xc5, 0x83, 0xc5, 0xf0, 0xc5, 0x83, 0xc8, 0xc5, 0x82, 0xc8} }, +{ 0xa137, 1, {0x22} }, { 0xffff, 0, {0x00} } }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/usb-storage.c linux.20p9/drivers/usb/usb-storage.c --- linux.vanilla/drivers/usb/usb-storage.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/usb-storage.c Wed Jul 4 16:03:59 2001 @@ -1636,10 +1636,23 @@ "Shuttle eUSCSI Bridge", US_SC_SCSI, US_PR_BULK, US_FL_ALT_LENGTH}, { 0x04e6, 0x0006, 0x0100, "Shuttle eUSB MMC Adapter", US_SC_SCSI, US_PR_CB, US_FL_SINGLE_LUN}, + { 0x054c, 0x0010, 0x0210, "Sony DSC", US_SC_SCSI, US_PR_CB, + US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE | US_FL_ALT_LENGTH}, + { 0x054c, 0x0010, 0x0322, + "Sony DSC-S75", US_SC_SCSI, US_PR_CB, + US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE | US_FL_ALT_LENGTH}, { 0x057b, 0x0000, 0x0114, "Y-E Data Flashbuster-U", US_SC_UFI, US_PR_CB, US_FL_SINGLE_LUN}, { 0x059b, 0x0030, 0x0100, "Iomega Zip 250", US_SC_SCSI, US_PR_BULK, US_FL_SINGLE_LUN}, + { 0x059b, 0x0031, 0x0100, + "Iomega USB Zip 100", US_SC_SCSI, US_PR_BULK, US_FL_SINGLE_LUN}, + { 0x059b, 0x0032, 0x0100, + "Iomega USB Zip 250", US_SC_SCSI, US_PR_BULK, US_FL_SINGLE_LUN}, + { 0x059b, 0x0034, 0x0100, + "Iomega Zip 100", US_SC_SCSI, US_PR_BULK, US_FL_SINGLE_LUN}, + { 0x0644, 0x1000, 0x0133, + "TEAC CD-210PU", US_SC_8020, US_PR_BULK, US_FL_ALT_LENGTH}, { 0x0693, 0x0002, 0x0100, "Hagiwara FlashGate SmartMedia", US_SC_SCSI, US_PR_BULK, US_FL_ALT_LENGTH}, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/usb-uhci.c linux.20p9/drivers/usb/usb-uhci.c --- linux.vanilla/drivers/usb/usb-uhci.c Sun Mar 25 17:31:43 2001 +++ linux.20p9/drivers/usb/usb-uhci.c Wed Jul 4 16:03:59 2001 @@ -2297,7 +2297,7 @@ usb_endpoint_halt (urb->dev, usb_pipeendpoint (urb->pipe), usb_pipeout (urb->pipe)); } - // if any error occured: ignore this td, and continue + // if any error occurred: ignore this td, and continue if (status != 0) { //uhci_show_td (desc); urb->error_count++; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/usb/usb.c linux.20p9/drivers/usb/usb.c --- linux.vanilla/drivers/usb/usb.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/usb/usb.c Wed Aug 8 22:23:53 2001 @@ -2,7 +2,7 @@ * drivers/usb/usb.c * * (C) Copyright Linus Torvalds 1999 - * (C) Copyright Johannes Erdfelt 1999 + * (C) Copyright Johannes Erdfelt 1999-2001 * (C) Copyright Andreas Gal 1999 * (C) Copyright Gregory P. Smith 1999 * (C) Copyright Deti Fliegl 1999 (new USB architecture) @@ -15,8 +15,6 @@ * Think of this as a "USB library" rather than anything else. * It should be considered a slave, with no callbacks. Callbacks * are evil. - * - * $Id: usb.c,v 1.53 2000/01/14 16:19:09 acher Exp $ */ #include @@ -25,6 +23,7 @@ #include #include #include /* for in_interrupt() */ +#include #if defined(CONFIG_KMOD) && defined(CONFIG_HOTPLUG) @@ -54,6 +53,9 @@ 0; #endif +extern int usb_hub_init(void); +extern void usb_hub_cleanup(void); + /* * Prototypes for the device driver probing/loading functions */ @@ -71,6 +73,15 @@ static struct usb_driver *usb_minors[16]; +/** + * usb_register - register a USB driver + * @new_driver: USB operations for the driver + * + * Registers a USB driver with the USB core. The list of unattached + * interfaces will be rescanned whenever a new driver is added, allowing + * the new driver to attach to any recognized devices. + * Returns a negative error code on failure and 0 on success. + */ int usb_register(struct usb_driver *new_driver) { if (new_driver->fops != NULL) { @@ -86,19 +97,21 @@ init_MUTEX(&new_driver->serialize); /* Add it to the list of known drivers */ - list_add(&new_driver->driver_list, &usb_driver_list); + list_add_tail(&new_driver->driver_list, &usb_driver_list); usb_scan_devices(); return 0; } -/* - * We go through all existing devices, and see if any of them would - * be acceptable to the new driver.. This is done using a depth-first - * search for devices without a registered driver already, then - * running 'probe' with each of the drivers registered on every one - * of these. +/** + * usb_scan_devices - scans all unclaimed USB interfaces + * + * Goes through all unclaimed USB interfaces, and offers them to all + * registered USB drivers through the 'probe' function. + * This will automatically be called after usb_register is called. + * It is called by some of the USB subsystems after one of their subdrivers + * are registered. */ void usb_scan_devices(void) { @@ -140,7 +153,9 @@ down(&driver->serialize); driver->disconnect(dev, interface->private_data); up(&driver->serialize); - usb_driver_release_interface(driver, interface); + /* if driver->disconnect didn't release the interface */ + if (interface->driver) + usb_driver_release_interface(driver, interface); /* * This will go through the list looking for another * driver that can handle the device @@ -150,8 +165,11 @@ } } -/* - * Unlink a driver from the driver list when it is unloaded +/** + * usb_deregister - unregister a USB driver + * @driver: USB operations of the driver to unregister + * + * Unlinks the specified driver from the internal USB driver list. */ void usb_deregister(struct usb_driver *driver) { @@ -327,8 +345,28 @@ urb->bandwidth = 0; } -/* - * New functions for (de)registering a controller +static void usb_bus_get(struct usb_bus *bus) +{ + atomic_inc(&bus->refcnt); +} + +static void usb_bus_put(struct usb_bus *bus) +{ + if (atomic_dec_and_test(&bus->refcnt)) + kfree(bus); +} + +/** + * usb_alloc_bus - creates a new USB host controller structure + * @op: pointer to a struct usb_operations that this bus structure should use + * + * Creates a USB host controller bus structure with the specified + * usb_operations and initializes all the necessary internal objects. + * (For use only by USB Host Controller Drivers.) + * + * If no memory is available, NULL is returned. + * + * The caller should call usb_free_bus() when it is finished with the structure. */ struct usb_bus *usb_alloc_bus(struct usb_operations *op) { @@ -340,6 +378,10 @@ memset(&bus->devmap, 0, sizeof(struct usb_devmap)); +#ifdef DEVNUM_ROUND_ROBIN + bus->devnum_next = 1; +#endif /* DEVNUM_ROUND_ROBIN */ + bus->op = op; bus->root_hub = NULL; bus->hcpriv = NULL; @@ -351,17 +393,31 @@ INIT_LIST_HEAD(&bus->bus_list); INIT_LIST_HEAD(&bus->inodes); + atomic_set(&bus->refcnt, 1); + return bus; } +/** + * usb_free_bus - frees the memory used by a bus structure + * @bus: pointer to the bus to free + * + * (For use only by USB Host Controller Drivers.) + */ void usb_free_bus(struct usb_bus *bus) { if (!bus) return; - kfree(bus); + usb_bus_put(bus); } +/** + * usb_register_bus - registers the USB host controller with the usb core + * @bus: pointer to the bus to register + * + * (For use only by USB Host Controller Drivers.) + */ void usb_register_bus(struct usb_bus *bus) { int busnum; @@ -373,6 +429,8 @@ } else warn("too many buses"); + usb_bus_get(bus); + /* Add it to the list of buses */ list_add(&bus->bus_list, &usb_bus_list); @@ -381,6 +439,12 @@ info("new USB bus registered, assigned bus number %d", bus->busnum); } +/** + * usb_deregister_bus - deregisters the USB host controller + * @bus: pointer to the bus to deregister + * + * (For use only by USB Host Controller Drivers.) + */ void usb_deregister_bus(struct usb_bus *bus) { info("USB bus %d deregistered", bus->busnum); @@ -395,6 +459,8 @@ usbdevfs_remove_bus(bus); clear_bit(bus->busnum, busmap.busmap); + + usb_bus_put(bus); } /* @@ -722,7 +788,8 @@ value = call_usermodehelper (argv [0], argv, envp); kfree (buf); kfree (envp); - dbg ("kusbd policy returned 0x%x", value); + if (value != 0) + dbg ("kusbd policy returned 0x%x", value); } #else @@ -783,6 +850,8 @@ memset(dev, 0, sizeof(*dev)); + usb_bus_get(bus); + dev->bus = bus; dev->parent = parent; atomic_set(&dev->refcnt, 1); @@ -799,6 +868,9 @@ if (atomic_dec_and_test(&dev->refcnt)) { dev->bus->op->deallocate(dev); usb_destroy_configuration(dev); + + usb_bus_put(dev->bus); + kfree(dev); } } @@ -807,10 +879,23 @@ { atomic_inc(&dev->refcnt); } + /* ------------------------------------------------------------------------------------- * New USB Core Functions * -------------------------------------------------------------------------------------*/ +/** + * usb_alloc_urb - creates a new urb for a USB driver to use + * @iso_packets: number of iso packets for this urb + * + * Creates an urb for the USB driver to use and returns a pointer to it. + * If no memory is available, NULL is returned. + * + * If the driver want to use this urb for interrupt, control, or bulk + * endpoints, pass '0' as the number of iso packets. + * + * The driver should call usb_free_urb() when it is finished with the urb. + */ urb_t *usb_alloc_urb(int iso_packets) { urb_t *urb; @@ -829,7 +914,14 @@ return urb; } -/*-------------------------------------------------------------------*/ +/** + * usb_free_urb - frees the memory used by a urb + * @urb: pointer to the urb to free + * + * If an urb is created with a call to usb_create_urb() it should be + * cleaned up with a call to usb_free_urb() when the driver is finished + * with it. + */ void usb_free_urb(urb_t* urb) { if (urb) @@ -894,6 +986,7 @@ if (status) { // something went wrong usb_free_urb(urb); + current->state = TASK_RUNNING; remove_wait_queue(&wqh, &wait); return status; } @@ -904,6 +997,7 @@ } else status = 1; + current->state = TASK_RUNNING; remove_wait_queue(&wqh, &wait); if (!status) { @@ -945,7 +1039,27 @@ } -/*-------------------------------------------------------------------*/ +/** + * usb_control_msg - Builds a control urb, sends it off and waits for completion + * @dev: pointer to the usb device to send the message to + * @pipe: endpoint "pipe" to send the message to + * @request: USB message request value + * @requesttype: USB message request type value + * @value: USB message value + * @index: USB message index value + * @data: pointer to the data to send + * @size: length in bytes of the data to send + * @timeout: time to wait for the message to complete before timing out (if 0 the wait is forever) + * + * This function sends a simple control message to a specified endpoint + * and waits for the message to complete, or timeout. + * + * If successful, it returns 0, othwise a negative error number. + * + * Don't use this function from within an interrupt context, like a + * bottom half handler. If you need a asyncronous message, or need to send + * a message from within interrupt context, use usb_submit_urb() + */ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout) { @@ -970,10 +1084,27 @@ return ret; } -/*-------------------------------------------------------------------*/ -/* compatibility wrapper, builds bulk urb, and waits for completion */ -/* synchronous behavior */ +/** + * usb_bulk_msg - Builds a bulk urb, sends it off and waits for completion + * @usb_dev: pointer to the usb device to send the message to + * @pipe: endpoint "pipe" to send the message to + * @data: pointer to the data to send + * @len: length in bytes of the data to send + * @actual_length: pointer to a location to put the actual length transfered in bytes + * @timeout: time to wait for the message to complete before timing out (if 0 the wait is forever) + * + * This function sends a simple bulk message to a specified endpoint + * and waits for the message to complete, or timeout. + * + * If successful, it returns 0, othwise a negative error number. + * The number of actual bytes transferred will be plaed in the + * actual_timeout paramater. + * + * Don't use this function from within an interrupt context, like a + * bottom half handler. If you need a asyncronous message, or need to + * send a message from within interrupt context, use usb_submit_urb() + */ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, void *data, int len, int *actual_length, int timeout) { @@ -1479,8 +1610,6 @@ info("USB disconnect on device %d", dev->devnum); - call_policy ("remove", dev); - if (dev->actconfig) { for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { struct usb_interface *interface = &dev->actconfig->interface[i]; @@ -1489,7 +1618,9 @@ down(&driver->serialize); driver->disconnect(dev, interface->private_data); up(&driver->serialize); - usb_driver_release_interface(driver, interface); + /* if driver->disconnect didn't release the interface */ + if (interface->driver) + usb_driver_release_interface(driver, interface); } } } @@ -1501,6 +1632,9 @@ usb_disconnect(child); } + /* Let policy agent unload modules etc */ + call_policy ("remove", dev); + /* Free the device number and remove the /proc/bus/usb entry */ if (dev->devnum > 0) { clear_bit(dev->devnum, &dev->bus->devmap.devicemap); @@ -1522,10 +1656,20 @@ int devnum; // FIXME needs locking for SMP!! /* why? this is called only from the hub thread, - * which hopefully doesn't run on multiple CPU's simulatenously 8-) + * which hopefully doesn't run on multiple CPU's simultaneously 8-) */ dev->descriptor.bMaxPacketSize0 = 8; /* Start off at 8 bytes */ +#ifndef DEVNUM_ROUND_ROBIN devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, 1); +#else /* round_robin alloc of devnums */ + /* Try to allocate the next devnum beginning at bus->devnum_next. */ + devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, dev->bus->devnum_next); + if (devnum >= 128) + devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, 1); + + dev->bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1); +#endif /* round_robin alloc of devnums */ + if (devnum < 128) { set_bit(devnum, dev->bus->devmap.devicemap); dev->devnum = devnum; @@ -1556,9 +1700,9 @@ while (i--) { if ((result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, - (type << 8) + index, 0, buf, size, HZ * GET_TIMEOUT)) >= 0 || + (type << 8) + index, 0, buf, size, HZ * GET_TIMEOUT)) > 0 || result == -EPIPE) - break; + break; /* retry if the returned length was 0; flaky device */ } return result; } @@ -1933,7 +2077,8 @@ err = usb_set_address(dev); if (err < 0) { - err("USB device not accepting new address (error=%d)", err); + err("USB device not accepting new address=%d (error=%d)", + dev->devnum, err); clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; return 1; @@ -1959,7 +2104,8 @@ if (err < 0) err("unable to get device descriptor (error=%d)", err); else - err("USB device descriptor short read (expected %i, got %i)", sizeof(dev->descriptor), err); + err("USB device descriptor short read (expected %Zi, got %i)", + sizeof(dev->descriptor), err); clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; @@ -1968,17 +2114,18 @@ err = usb_get_configuration(dev); if (err < 0) { - err("unable to get configuration (error=%d)", err); - usb_destroy_configuration(dev); + err("unable to get device %d configuration (error=%d)", dev->devnum, err); clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; + usb_free_dev(dev); return 1; } /* we set the default configuration here */ err = usb_set_configuration(dev, dev->config[0].bConfigurationValue); if (err) { - err("failed to set default configuration (error=%d)", err); + err("failed to set device %d default configuration (error=%d)", + dev->devnum, err); clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; return 1; @@ -2052,6 +2199,32 @@ } #endif + +/* + * Init + */ +static int __init usb_init(void) +{ + usb_major_init(); + usbdevfs_init(); + usb_hub_init(); + + return 0; +} + +/* + * Cleanup + */ +static void __exit usb_exit(void) +{ + usb_major_cleanup(); + usbdevfs_cleanup(); + usb_hub_cleanup(); +} + +module_init(usb_init); +module_exit(usb_exit); + /* * USB may be built into the kernel or be built as modules. * If the USB core [and maybe a host controller driver] is built diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/video/aty128fb.c linux.20p9/drivers/video/aty128fb.c --- linux.vanilla/drivers/video/aty128fb.c Sun Mar 25 17:37:37 2001 +++ linux.20p9/drivers/video/aty128fb.c Wed Aug 8 22:16:01 2001 @@ -1747,15 +1747,43 @@ memset(&var, 0, sizeof(var)); #ifdef CONFIG_FB_OF - /* New iBook */ - if (default_vmode == VMODE_CHOOSE && - machine_is_compatible("PowerBook2,2")) - default_vmode = VMODE_800_600_60; - - if (default_vmode == VMODE_CHOOSE) - var = default_var; - else if (mac_vmode_to_var(default_vmode, default_cmode, &var)) - var = default_var; + if (_machine == _MACH_Pmac) { + if (mode_option) { + if (mac_vmode_to_var(default_vmode, default_cmode, &var)) + var = default_var; + } else { + if (default_vmode <= 0 || default_vmode > VMODE_MAX) + default_vmode = VMODE_1024_768_60; + + /* iBook SE */ + if (machine_is_compatible("PowerBook2,2")) + default_vmode = VMODE_800_600_60; + + /* iMacs and newer iBooks need to use 1024x768 + * PowerMac2,1 first r128 iMacs + * PowerMac4,1 january 2001 iMacs "flower power" + */ + if (machine_is_compatible("PowerMac2,1") || + machine_is_compatible("PowerMac2,2") || + machine_is_compatible("PowerMac4,1")) + default_vmode = VMODE_1024_768_75; + + /* PowerBook Firewire (Pismo) and iBook2 */ + if (machine_is_compatible("PowerBook3,1") || + machine_is_compatible("PowerBook4,1")) + default_vmode = VMODE_1024_768_60; + + /* PowerBook Titanium */ + if (machine_is_compatible("PowerBook3,2")) + default_vmode = VMODE_1152_768_60; + + if (default_cmode < CMODE_8 || default_cmode > CMODE_32) + default_cmode = CMODE_8; + + if (mac_vmode_to_var(default_vmode, default_cmode, &var)) + var = default_var; + } + } else #else /* CONFIG_FB_OF */ var = default_var; #endif /* CONFIG_FB_OF */ @@ -2089,6 +2117,11 @@ if (dp->name && !strcmp(dp->name, "ATY,RageM3pB")) return; + if (dp->name && !strcmp(dp->name, "ATY,RageM3p12A") && dp->parent) + dp = dp->parent; + if (dp->name && !strcmp(dp->name, "ATY,RageM3p12B")) + return; + switch (dp->n_addrs) { case 3: fb_addr = dp->addrs[0].address; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/video/atyfb.c linux.20p9/drivers/video/atyfb.c --- linux.vanilla/drivers/video/atyfb.c Sun Mar 25 17:31:39 2001 +++ linux.20p9/drivers/video/atyfb.c Wed Jul 4 16:03:59 2001 @@ -3268,7 +3268,7 @@ addr = dp->addrs[1].address; break; default: - printk("Warning: got %d adresses for ATY:\n", dp->n_addrs); + printk("Warning: got %d addresses for ATY:\n", dp->n_addrs); for (i = 0; i < dp->n_addrs; i++) printk(" %08x-%08x", dp->addrs[i].address, dp->addrs[i].address+dp->addrs[i].size-1); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/video/fbmem.c linux.20p9/drivers/video/fbmem.c --- linux.vanilla/drivers/video/fbmem.c Sun Mar 25 17:31:40 2001 +++ linux.20p9/drivers/video/fbmem.c Wed Jul 4 16:03:59 2001 @@ -251,14 +251,16 @@ { struct fb_info **fi; - len = 0; + int buflen = 0; for (fi = registered_fb; fi < ®istered_fb[FB_MAX] && len < 4000; fi++) if (*fi) - len += sprintf(buf + len, "%d %s\n", + buflen += sprintf(buf + buflen, "%d %s\n", GET_FB_IDX((*fi)->node), (*fi)->modename); *start = buf + offset; - return len > offset ? len - offset : 0; + + buflen = buflen > offset ? buflen - offset : 0; + return len < buflen ? len : buflen; } static ssize_t @@ -498,6 +500,8 @@ (*info->blank)(arg, info); return 0; default: + if (fb->fb_ioctl == NULL) + return -EINVAL; return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(info), info); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/video/macmodes.c linux.20p9/drivers/video/macmodes.c --- linux.vanilla/drivers/video/macmodes.c Sun Mar 25 17:31:40 2001 +++ linux.20p9/drivers/video/macmodes.c Wed Aug 8 22:16:01 2001 @@ -202,8 +202,22 @@ FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED }; + /* 1152x768, 60 Hz, Titanium PowerBook */ -static const struct mac_mode *mac_modes[20] = { +static const struct mac_mode mac_mode_21 = { + VMODE_1152_768_60, 1152, 768, + 15386, 158, 26, 29, 3, 136, 6, + FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED +}; + + /* 1600x1024, 60 Hz, Non-Interlaced (112.27 MHz dotclock) */ +static const struct mac_mode mac_mode_22 = { + VMODE_1600_1024_60, 1600, 1024, + 8908, 88, 104, 1, 10, 16, 1, + FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED +}; + +static const struct mac_mode *mac_modes[22] = { NULL, /* 512x384, 60Hz interlaced (NTSC) */ NULL, /* 512x384, 60Hz */ NULL, /* 640x480, 50Hz interlaced (PAL) */ @@ -224,6 +238,8 @@ &mac_mode_18, /* 1152x870, 75Hz */ &mac_mode_19, /* 1280x960, 75Hz */ &mac_mode_20, /* 1280x1024, 75Hz */ + &mac_mode_21, /* 1152x768, 60Hz */ + &mac_mode_22, /* 1600x1024, 60Hz */ }; static const struct mac_mode *mac_modes_inv[] = { @@ -241,6 +257,7 @@ &mac_mode_18, /* 1152x870, 75Hz */ &mac_mode_19, /* 1280x960, 75Hz */ &mac_mode_20, /* 1280x1024, 75Hz */ + &mac_mode_22, /* 1600x1024, 60Hz */ }; @@ -267,6 +284,7 @@ { 0x730, VMODE_768_576_50I }, /* PAL (Alternate) */ { 0x73a, VMODE_1152_870_75 }, /* 3rd party 19" */ { 0x73f, VMODE_640_480_67 }, /* no sense lines connected at all */ + { 0xBEEF, VMODE_1600_1024_60 }, /* 22" Apple Cinema Display */ { -1, VMODE_640_480_60 }, /* catch-all, must be last */ }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/video/offb.c linux.20p9/drivers/video/offb.c --- linux.vanilla/drivers/video/offb.c Sun Mar 25 17:31:40 2001 +++ linux.20p9/drivers/video/offb.c Wed Aug 8 22:16:01 2001 @@ -447,6 +447,7 @@ #ifdef CONFIG_FB_ATY128 if (!strncmp(dp->name, "ATY,Rage128", 11) || !strncmp(dp->name, "ATY,RageM3p1", 12) || + !strncmp(dp->name, "ATY,RageM3p2", 12) || !strncmp(dp->name, "ATY,RageM3pA", 12)) { aty128fb_of_init(dp); return 1; @@ -733,7 +734,7 @@ disp->scrollmode = SCROLL_YREDRAW; strcpy(info->info.modename, "OFfb "); - strncat(info->info.modename, full_name, sizeof(info->info.modename)); + strncat(info->info.modename, full_name, sizeof(info->info.modename)-6); info->info.node = -1; info->info.fbops = &offb_ops; info->info.disp = disp; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_aout.c linux.20p9/fs/binfmt_aout.c --- linux.vanilla/fs/binfmt_aout.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/binfmt_aout.c Thu Jul 26 15:53:56 2001 @@ -30,17 +30,17 @@ #include static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); -static int load_aout_library(int fd); -static int aout_core_dump(long signr, struct pt_regs * regs); +static int load_aout_library(struct file *file); +static int aout_core_dump(long signr, struct pt_regs * regs, struct file *); extern void dump_thread(struct pt_regs *, struct user *); static struct linux_binfmt aout_format = { -#ifndef MODULE - NULL, NULL, load_aout_binary, load_aout_library, aout_core_dump -#else - NULL, &__this_module, load_aout_binary, load_aout_library, aout_core_dump -#endif + module: THIS_MODULE, + load_binary: load_aout_binary, + load_shlib: load_aout_library, + core_dump: aout_core_dump, + min_coredump: PAGE_SIZE, }; static void set_brk(unsigned long start, unsigned long end) @@ -88,15 +88,11 @@ * dumping of the process results in another error.. */ -static inline int -do_aout_core_dump(long signr, struct pt_regs * regs) +static int +aout_core_dump(long signr, struct pt_regs * regs, struct file * file) { - struct dentry * dentry = NULL; - struct inode * inode = NULL; - struct file * file; mm_segment_t fs; int has_dumped = 0; - char corefile[6+sizeof(current->comm)]; unsigned long dump_start, dump_size; struct user dump; #if defined(__alpha__) @@ -112,32 +108,8 @@ # define START_STACK(u) (u.start_stack) #endif - if (!current->dumpable || atomic_read(¤t->mm->count) != 1) - return 0; - current->dumpable = 0; - -/* See if we have enough room to write the upage. */ - if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE) - return 0; fs = get_fs(); set_fs(KERNEL_DS); - memcpy(corefile,"core.",5); -#if 0 - memcpy(corefile+5,current->comm,sizeof(current->comm)); -#else - corefile[4] = '\0'; -#endif - file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); - if (IS_ERR(file)) - goto end_coredump; - dentry = file->f_dentry; - inode = dentry->d_inode; - if (!S_ISREG(inode->i_mode)) - goto close_coredump; - if (!inode->i_op || !inode->i_op->default_file_ops) - goto close_coredump; - if (!file->f_op->write) - goto close_coredump; has_dumped = 1; current->flags |= PF_DUMPCORE; strncpy(dump.u_comm, current->comm, sizeof(current->comm)); @@ -217,23 +189,10 @@ set_fs(KERNEL_DS); DUMP_WRITE(current,sizeof(*current)); close_coredump: - filp_close(file, NULL); -end_coredump: set_fs(fs); return has_dumped; } -static int -aout_core_dump(long signr, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_aout_core_dump(signr, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* * create_aout_tables() parses the env- and arg-strings in new user * memory and creates the pointer tables from them, and puts their @@ -303,7 +262,7 @@ * libraries. There is no binary dependent code anywhere else. */ -static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) +static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct exec ex; struct file * file; @@ -452,16 +411,12 @@ } } beyond_if: + set_binfmt(&aout_format); if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); - current->binfmt = &aout_format; if (current->exec_domain && current->exec_domain->module) __MOD_INC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_INC_USE_COUNT(current->binfmt->module); set_brk(current->mm->start_brk, current->mm->brk); @@ -473,27 +428,13 @@ regs->gp = ex.a_gpvalue; #endif start_thread(regs, ex.a_entry, p); - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); return 0; } - -static int -load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - -static inline int -do_load_aout_library(int fd) +static int load_aout_library(struct file *file) { - struct file * file; struct inode * inode; unsigned long bss, start_addr, len; unsigned long error; @@ -501,12 +442,6 @@ loff_t offset = 0; struct exec ex; - retval = -EACCES; - file = fget(fd); - if (!file) - goto out; - if (!file->f_op) - goto out_putf; inode = file->f_dentry->d_inode; retval = -ENOEXEC; @@ -569,23 +504,9 @@ retval = 0; out_putf: - fput(file); -out: return retval; } -static int -load_aout_library(int fd) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout_library(fd); - MOD_DEC_USE_COUNT; - return retval; -} - - int __init init_aout_binfmt(void) { return register_binfmt(&aout_format); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_elf.c linux.20p9/fs/binfmt_elf.c --- linux.vanilla/fs/binfmt_elf.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/binfmt_elf.c Thu Jul 26 15:54:03 2001 @@ -40,7 +40,7 @@ #include static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs); -static int load_elf_library(int fd); +static int load_elf_library(struct file *file); extern int dump_fpu (struct pt_regs *, elf_fpregset_t *); extern void dump_thread(struct pt_regs *, struct user *); @@ -54,7 +54,7 @@ * don't even try. */ #ifdef USE_ELF_CORE_DUMP -static int elf_core_dump(long signr, struct pt_regs * regs); +static int elf_core_dump(long signr, struct pt_regs * regs, struct file *); #else #define elf_core_dump NULL #endif @@ -64,11 +64,11 @@ #define ELF_PAGEALIGN(_v) (((_v) + ELF_EXEC_PAGESIZE - 1) & ~(ELF_EXEC_PAGESIZE - 1)) static struct linux_binfmt elf_format = { -#ifndef MODULE - NULL, NULL, load_elf_binary, load_elf_library, elf_core_dump -#else - NULL, &__this_module, load_elf_binary, load_elf_library, elf_core_dump -#endif + module: THIS_MODULE, + load_binary: load_elf_binary, + load_shlib: load_elf_library, + core_dump: elf_core_dump, + min_coredump: ELF_EXEC_PAGESIZE, }; static void set_brk(unsigned long start, unsigned long end) @@ -415,8 +415,7 @@ #define INTERPRETER_ELF 2 -static inline int -do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) +static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct file * file; struct dentry *interpreter_dentry = NULL; /* to shut gcc up */ @@ -727,16 +726,12 @@ if (interpreter_type != INTERPRETER_AOUT) sys_close(elf_exec_fileno); + set_binfmt(&elf_format); if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); - current->binfmt = &elf_format; if (current->exec_domain && current->exec_domain->module) __MOD_INC_USE_COUNT(current->exec_domain->module); - if (current->binfmt && current->binfmt->module) - __MOD_INC_USE_COUNT(current->binfmt->module); compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; @@ -799,7 +794,7 @@ #endif start_thread(regs, elf_entry, bprm->p); - if (current->flags & PF_PTRACED) + if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); retval = 0; out: @@ -819,24 +814,11 @@ goto out; } -static int -load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_elf_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* This is really simpleminded and specialized - we are loading an a.out library that is given an ELF header. */ -static inline int -do_load_elf_library(int fd) +static int load_elf_library(struct file *file) { - struct file * file; struct dentry * dentry; struct inode * inode; struct elf_phdr *elf_phdata; @@ -845,10 +827,6 @@ struct elfhdr elf_ex; loff_t offset = 0; - error = -EACCES; - file = fget(fd); - if (!file || !file->f_op) - goto out; dentry = file->f_dentry; inode = dentry->d_inode; @@ -924,21 +902,9 @@ out_free_ph: kfree(elf_phdata); out_putf: - fput(file); -out: return error; } -static int load_elf_library(int fd) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_elf_library(fd); - MOD_DEC_USE_COUNT; - return retval; -} - /* * Note that some platforms still use traditional core dumps and not * the ELF core dump. Each platform can select it as appropriate. @@ -1078,14 +1044,10 @@ * and then they are actually written out. If we run out of core limit * we just truncate. */ -static int elf_core_dump(long signr, struct pt_regs * regs) +static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) { int has_dumped = 0; - struct file *file; - struct dentry *dentry; - struct inode *inode; mm_segment_t fs; - char corefile[6+sizeof(current->comm)]; int segs; int i; size_t size = 0; @@ -1099,16 +1061,6 @@ elf_fpregset_t fpu; /* NT_PRFPREG */ struct elf_prpsinfo psinfo; /* NT_PRPSINFO */ - if (!current->dumpable || - limit < ELF_EXEC_PAGESIZE || - atomic_read(¤t->mm->count) != 1) - return 0; - current->dumpable = 0; - -#ifndef CONFIG_BINFMT_ELF - MOD_INC_USE_COUNT; -#endif - segs = current->mm->map_count; #ifdef DEBUG @@ -1139,27 +1091,6 @@ fs = get_fs(); set_fs(KERNEL_DS); - memcpy(corefile,"core.",5); -#if 0 - memcpy(corefile+5,current->comm,sizeof(current->comm)); -#else - corefile[4] = '\0'; -#endif - file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); - if (IS_ERR(file)) - goto end_coredump; - dentry = file->f_dentry; - inode = dentry->d_inode; - if (inode->i_nlink > 1) - goto close_coredump; /* multiple links - don't dump */ - - if (!S_ISREG(inode->i_mode)) - goto close_coredump; - if (!inode->i_op || !inode->i_op->default_file_ops) - goto close_coredump; - if (!file->f_op->write) - goto close_coredump; - has_dumped = 1; current->flags |= PF_DUMPCORE; @@ -1358,13 +1289,8 @@ } close_coredump: - filp_close(file, NULL); - end_coredump: set_fs(fs); -#ifndef CONFIG_BINFMT_ELF - MOD_DEC_USE_COUNT; -#endif return has_dumped; } #endif /* USE_ELF_CORE_DUMP */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_em86.c linux.20p9/fs/binfmt_em86.c --- linux.vanilla/fs/binfmt_em86.c Sun Mar 25 17:30:59 2001 +++ linux.20p9/fs/binfmt_em86.c Thu Jul 26 15:53:29 2001 @@ -20,7 +20,7 @@ #define EM86_INTERP "/usr/bin/em86" #define EM86_I_NAME "em86" -static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) { char *interp, *i_name, *i_arg; struct dentry * dentry; @@ -93,21 +93,9 @@ return search_binary_handler(bprm, regs); } -static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_em86(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - struct linux_binfmt em86_format = { -#ifndef MODULE - NULL, 0, load_em86, NULL, NULL -#else - NULL, &__this_module, load_em86, NULL, NULL -#endif + module: THIS_MODULE, + load_binary: load_em86, }; int __init init_em86_binfmt(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_java.c linux.20p9/fs/binfmt_java.c --- linux.vanilla/fs/binfmt_java.c Sun Mar 25 17:30:59 2001 +++ linux.20p9/fs/binfmt_java.c Thu Jul 26 15:53:36 2001 @@ -23,7 +23,7 @@ char binfmt_java_interpreter[65] = _PATH_JAVA; char binfmt_java_appletviewer[65] = _PATH_APPLET; -static int do_load_java(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_java(struct linux_binprm *bprm,struct pt_regs *regs) { char *i_name; int len; @@ -93,7 +93,7 @@ return search_binary_handler(bprm,regs); } -static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs) { char *i_name; struct dentry * dentry; @@ -140,38 +140,14 @@ return search_binary_handler(bprm,regs); } -static int load_java(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_java(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - static struct linux_binfmt java_format = { -#ifndef MODULE - NULL, 0, load_java, NULL, NULL -#else - NULL, &__this_module, load_java, NULL, NULL -#endif + module: THIS_MODULE, + load_binary: load_java, }; -static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_applet(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - static struct linux_binfmt applet_format = { -#ifndef MODULE - NULL, 0, load_applet, NULL, NULL -#else - NULL, &__this_module, load_applet, NULL, NULL -#endif + module: THIS_MODULE, + load_binary: load_applet, }; int __init init_java_binfmt(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_misc.c linux.20p9/fs/binfmt_misc.c --- linux.vanilla/fs/binfmt_misc.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/binfmt_misc.c Thu Jul 26 15:53:41 2001 @@ -48,7 +48,7 @@ typedef struct binfmt_entry { struct binfmt_entry *next; long id; - int flags; /* type, status, etc. */ + long flags; /* type, status, etc. */ int offset; /* offset of magic */ int size; /* size of magic/mask */ char *magic; /* magic or filename extension */ @@ -65,11 +65,8 @@ static int entry_proc_setup(Node *e); static struct linux_binfmt misc_format = { -#ifndef MODULE - NULL, 0, load_misc_binary, NULL, NULL -#else - NULL, &__this_module, load_misc_binary, NULL, NULL -#endif + module: THIS_MODULE, + load_binary: load_misc_binary, }; static struct proc_dir_entry *bm_dir = NULL; @@ -190,7 +187,6 @@ char *iname_addr = iname; int retval; - MOD_INC_USE_COUNT; retval = -ENOEXEC; if (!enabled) goto _ret; @@ -230,7 +226,6 @@ if (retval >= 0) retval = search_binary_handler(bprm, regs); _ret: - MOD_DEC_USE_COUNT; return retval; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/binfmt_script.c linux.20p9/fs/binfmt_script.c --- linux.vanilla/fs/binfmt_script.c Sun Mar 25 17:30:59 2001 +++ linux.20p9/fs/binfmt_script.c Thu Jul 26 15:53:41 2001 @@ -12,7 +12,7 @@ #include #include -static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) { char *cp, *i_name, *i_name_start, *i_arg; struct dentry * dentry; @@ -90,21 +90,9 @@ return search_binary_handler(bprm,regs); } -static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_script(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - struct linux_binfmt script_format = { -#ifndef MODULE - NULL, 0, load_script, NULL, NULL -#else - NULL, &__this_module, load_script, NULL, NULL -#endif + module: THIS_MODULE, + load_binary: load_script, }; int __init init_script_binfmt(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/dcache.c linux.20p9/fs/dcache.c --- linux.vanilla/fs/dcache.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/dcache.c Wed Jul 4 16:03:59 2001 @@ -702,7 +702,7 @@ * Note that we have to be a lot more careful about getting the hash * switched - we have to switch the hash value properly even if it * then no longer matches the actual (corrupted) string of the target. - * The has value has to match the hash queue that the dentry is on.. + * The hash value has to match the hash queue that the dentry is on.. */ static inline void switch_names(struct dentry * dentry, struct dentry * target) { @@ -829,7 +829,7 @@ struct dentry *pwd = current->fs->pwd; error = -ENOENT; - /* Has the current directory has been unlinked? */ + /* Has the current directory been unlinked? */ if (pwd->d_parent == pwd || !list_empty(&pwd->d_hash)) { char *page = (char *) __get_free_page(GFP_USER); error = -ENOMEM; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/dquot.c linux.20p9/fs/dquot.c --- linux.vanilla/fs/dquot.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/dquot.c Wed Jul 4 16:03:59 2001 @@ -667,8 +667,6 @@ { int cnt; - if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) - return 0; if (is_quotafile(inode)) return 0; if (type != -1) @@ -1082,38 +1080,34 @@ unsigned int id = 0; short cnt; - if (S_ISREG(inode->i_mode) || - S_ISDIR(inode->i_mode) || - S_ISLNK(inode->i_mode)) { - /* We don't want to have quotas on quota files - nasty deadlocks possible */ - if (is_quotafile(inode)) - return; - for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (type != -1 && cnt != type) + /* We don't want to have quotas on quota files - nasty deadlocks possible */ + if (is_quotafile(inode)) + return; + for (cnt = 0; cnt < MAXQUOTAS; cnt++) { + if (type != -1 && cnt != type) + continue; + + if (!sb_has_quota_enabled(inode->i_sb, cnt)) + continue; + + if (inode->i_dquot[cnt] == NODQUOT) { + switch (cnt) { + case USRQUOTA: + id = inode->i_uid; + break; + case GRPQUOTA: + id = inode->i_gid; + break; + } + dquot = dqget(inode->i_dev, id, cnt); + if (dquot == NODQUOT) continue; - - if (!sb_has_quota_enabled(inode->i_sb, cnt)) + if (inode->i_dquot[cnt] != NODQUOT) { + dqput(dquot); continue; - - if (inode->i_dquot[cnt] == NODQUOT) { - switch (cnt) { - case USRQUOTA: - id = inode->i_uid; - break; - case GRPQUOTA: - id = inode->i_gid; - break; - } - dquot = dqget(inode->i_dev, id, cnt); - if (dquot == NODQUOT) - continue; - if (inode->i_dquot[cnt] != NODQUOT) { - dqput(dquot); - continue; - } - inode->i_dquot[cnt] = dquot; - inode->i_flags |= S_QUOTA; - } + } + inode->i_dquot[cnt] = dquot; + inode->i_flags |= S_QUOTA; } } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/exec.c linux.20p9/fs/exec.c --- linux.vanilla/fs/exec.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/exec.c Thu Jul 26 15:55:59 2001 @@ -31,6 +31,8 @@ #include #include #include +#define __NO_VERSION__ +#include #include #include @@ -168,30 +170,40 @@ */ asmlinkage int sys_uselib(const char * library) { - int fd, retval; + int retval; struct file * file; struct linux_binfmt * fmt; + char * tmp = getname(library); lock_kernel(); - fd = sys_open(library, 0, 0); - retval = fd; - if (fd < 0) + retval = PTR_ERR(tmp); + if (IS_ERR(tmp)) + goto out; + + file = filp_open(tmp, 0, 0); + putname(tmp); + + retval = PTR_ERR(file); + if (IS_ERR(file)) goto out; - file = fget(fd); + + retval = -EINVAL; + if (!S_ISREG(file->f_dentry->d_inode->i_mode)) + goto out_fput; + retval = -ENOEXEC; - if (file && file->f_dentry && file->f_op && file->f_op->read) { + if (file->f_op && file->f_op->read) { for (fmt = formats ; fmt ; fmt = fmt->next) { - int (*fn)(int) = fmt->load_shlib; + int (*fn)(struct file *) = fmt->load_shlib; if (!fn) continue; - /* N.B. Should use file instead of fd */ - retval = fn(fd); + retval = fn(file); if (retval != -ENOEXEC) break; } } +out_fput: fput(file); - sys_close(fd); out: unlock_kernel(); return retval; @@ -520,6 +532,8 @@ bprm->dumpable = 0; if (current->euid == current->uid && current->egid == current->gid) bprm->dumpable = !bprm->priv_change; + else + current->dumpable = 0; name = bprm->filename; for (i=0; (ch = *(name++)) != '\0';) { if (ch == '/') @@ -533,8 +547,10 @@ flush_thread(); if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || - permission(bprm->dentry->d_inode, MAY_READ)) + permission(bprm->dentry->d_inode, MAY_READ)) { bprm->dumpable = 0; + current->dumpable = 0; + } current->self_exec_id++; @@ -557,7 +573,7 @@ */ static inline int must_not_trace_exec(struct task_struct * p) { - return (p->flags & PF_PTRACED) && !cap_raised(p->p_pptr->cap_effective, CAP_SYS_PTRACE); + return (p->ptrace & PT_PTRACED) && !cap_raised(p->p_pptr->cap_effective, CAP_SYS_PTRACE); } /* @@ -649,6 +665,7 @@ bprm->priv_change = id_change || cap_raised; if (bprm->priv_change) { + current->dumpable = 0; /* We can't suid-execute if we're sharing parts of the executable */ /* or if we're being traced (or if suid execs are not allowed) */ /* (current->mm->count > 1 is ok, as we'll get a new mm anyway) */ @@ -705,8 +722,10 @@ current->suid = current->euid = current->fsuid = bprm->e_uid; current->sgid = current->egid = current->fsgid = bprm->e_gid; if (current->euid != current->uid || current->egid != current->gid || - !cap_issubset(new_permitted, current->cap_permitted)) - bprm->dumpable = 0; + !cap_issubset(new_permitted, current->cap_permitted)) { + bprm->dumpable = 0; + current->dumpable = 0; + } current->keep_capabilities = 0; } @@ -888,3 +907,66 @@ return retval; } + +void set_binfmt(struct linux_binfmt *new) +{ + struct linux_binfmt *old = current->binfmt; + if (new && new->module) + __MOD_INC_USE_COUNT(new->module); + current->binfmt = new; + if (old && old->module) + __MOD_DEC_USE_COUNT(old->module); +} + +int do_coredump(long signr, struct pt_regs * regs) +{ + struct linux_binfmt *binfmt; + char corename[6+sizeof(current->comm)]; + struct file * file; + struct inode * inode; + + lock_kernel(); + binfmt = current->binfmt; + if (!binfmt || !binfmt->core_dump) + goto fail; + if (!current->dumpable || atomic_read(¤t->mm->count) != 1) + goto fail; + if (current->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump) + goto fail; + current->dumpable = 0; + + memcpy(corename,"core.", 5); +#if 0 + memcpy(corename+5,current->comm,sizeof(current->comm)); +#else + corename[4] = '\0'; +#endif + file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600); + if (IS_ERR(file)) + goto fail; + inode = file->f_dentry->d_inode; + if (inode->i_nlink > 1) + goto close_fail; /* multiple links - don't dump */ + if (list_empty(&file->f_dentry->d_hash)) + goto close_fail; + + if (!S_ISREG(inode->i_mode)) + goto close_fail; + if (!file->f_op) + goto close_fail; + if (!file->f_op->write) + goto close_fail; + if (do_truncate(file->f_dentry, 0) != 0) + goto close_fail; + if (!binfmt->core_dump(signr, regs, file)) + goto close_fail; + filp_close(file, NULL); + unlock_kernel(); + return 1; + +close_fail: + filp_close(file, NULL); +fail: + unlock_kernel(); + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/locks.c linux.20p9/fs/locks.c --- linux.vanilla/fs/locks.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/locks.c Wed Jul 4 16:03:59 2001 @@ -734,6 +734,7 @@ fl->fl_end = OFFSET_MAX; fl->fl_file = filp; fl->fl_owner = NULL; + fl->fl_pid = current->pid; return (1); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/nfsd/nfssvc.c linux.20p9/fs/nfsd/nfssvc.c --- linux.vanilla/fs/nfsd/nfssvc.c Sun Mar 25 17:30:59 2001 +++ linux.20p9/fs/nfsd/nfssvc.c Wed Jul 4 16:03:59 2001 @@ -6,6 +6,11 @@ * Authors: Olaf Kirch (okir@monad.swb.de) * * Copyright (C) 1995-1999 Olaf Kirch + * + * Apr 24, 2001: Added semaphores around nfsd_cache calls + * to protect it since it can yeild the processor + * in its kmalloc call. + * Craig I. Hagan */ #define __NO_VERSION__ @@ -44,6 +49,8 @@ struct timeval nfssvc_boot = { 0, 0 }; static atomic_t nfsd_active = ATOMIC_INIT(0); +static struct semaphore nfsd_cache_sem = MUTEX; + /* * Maximum number of nfsd processes */ @@ -81,8 +88,9 @@ if (error < 0) goto failure; #endif - + down(&nfsd_cache_sem); nfsd_racache_init(); /* Readahead param cache */ + up(&nfsd_cache_sem); while (nrservs--) { error = svc_create_thread(nfsd, serv); @@ -146,7 +154,6 @@ if (err < 0) break; - /* Lock the export hash tables for reading. */ exp_readlock(); @@ -160,6 +167,7 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); + svc_process(serv, rqstp); /* Unlock export hash tables */ @@ -180,8 +188,10 @@ /* Count active threads */ if (atomic_dec_and_test(&nfsd_active)) { + down(&nfsd_cache_sem); nfsd_export_shutdown(); /* revoke all exports */ nfsd_racache_shutdown(); /* release read-ahead cache */ + up(&nfsd_cache_sem); } /* Release lockd */ @@ -200,13 +210,19 @@ struct svc_procedure *proc; kxdrproc_t xdr; u32 nfserr; + int res_lookup; dprintk("nfsd_dispatch: vers %d proc %d\n", rqstp->rq_vers, rqstp->rq_proc); proc = rqstp->rq_procinfo; /* Check whether we have this call in the cache. */ - switch (nfsd_cache_lookup(rqstp, proc->pc_cachetype)) { + + down(&nfsd_cache_sem); + res_lookup = nfsd_cache_lookup(rqstp, proc->pc_cachetype); + up(&nfsd_cache_sem); + + switch (res_lookup) { case RC_INTR: case RC_DROPIT: return 0; @@ -220,7 +236,9 @@ xdr = proc->pc_decode; if (xdr && !xdr(rqstp, rqstp->rq_argbuf.buf, rqstp->rq_argp)) { dprintk("nfsd: failed to decode arguments!\n"); + down(&nfsd_cache_sem); nfsd_cache_update(rqstp, RC_NOCACHE, NULL); + up(&nfsd_cache_sem); *statp = rpc_garbage_args; return 1; } @@ -239,7 +257,9 @@ if (xdr && !xdr(rqstp, rqstp->rq_resbuf.buf, rqstp->rq_resp)) { /* Failed to encode result. Release cache entry */ dprintk("nfsd: failed to encode result!\n"); + down(&nfsd_cache_sem); nfsd_cache_update(rqstp, RC_NOCACHE, NULL); + up(&nfsd_cache_sem); *statp = rpc_system_err; return 1; } @@ -250,14 +270,18 @@ && !xdr(rqstp, rqstp->rq_resbuf.buf, rqstp->rq_resp)) { /* Failed to encode result. Release cache entry */ dprintk("nfsd: failed to encode result!\n"); + down(&nfsd_cache_sem); nfsd_cache_update(rqstp, RC_NOCACHE, NULL); + up(&nfsd_cache_sem); *statp = rpc_system_err; return 1; } #endif /* CONFIG_NFSD_V3 */ /* Store reply in cache. */ + down(&nfsd_cache_sem); nfsd_cache_update(rqstp, proc->pc_cachetype, statp + 1); + up(&nfsd_cache_sem); return 1; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/nls/nls_koi8-r.c linux.20p9/fs/nls/nls_koi8-r.c --- linux.vanilla/fs/nls/nls_koi8-r.c Sun Mar 25 17:31:00 2001 +++ linux.20p9/fs/nls/nls_koi8-r.c Wed Jul 4 16:03:59 2001 @@ -5,6 +5,7 @@ * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. + * Patched to include KOI8-U and KOI8-RU support */ #include @@ -66,14 +67,14 @@ {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00}, /* 0xa0*/ {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04}, - {0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25}, + {0x54, 0x04}, {0x54, 0x25}, {0x56, 0x04}, {0x57, 0x04}, {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25}, - {0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25}, + {0x5b, 0x25}, {0x91, 0x04}, {0x5e, 0x04}, {0x5e, 0x25}, /* 0xb0*/ {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04}, - {0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25}, + {0x04, 0x04}, {0x63, 0x25}, {0x06, 0x04}, {0x07, 0x04}, {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25}, - {0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00}, + {0x6a, 0x25}, {0x90, 0x04}, {0x0e, 0x04}, {0xa9, 0x00}, /* 0xc0*/ {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04}, @@ -133,8 +134,8 @@ }; static unsigned char page04[256] = { - 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0xb3, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0xb7, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x00, /* 0x08-0x0f */ 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */ 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */ @@ -143,8 +144,8 @@ 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */ 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */ 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */ - 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xa3, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ @@ -152,7 +153,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xbd, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ @@ -306,8 +307,8 @@ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ - 0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xa0, 0xa1, 0xa2, 0x00, 0xb4, 0xa5, 0xb6, 0xb7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xbd, 0xbe, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/ntfs/fs.c linux.20p9/fs/ntfs/fs.c --- linux.vanilla/fs/ntfs/fs.c Sun Mar 25 17:31:02 2001 +++ linux.20p9/fs/ntfs/fs.c Thu Jul 26 15:38:58 2001 @@ -29,6 +29,7 @@ #include #include #include +#include /* Forward declarations */ static struct inode_operations ntfs_dir_inode_operations; @@ -942,6 +943,13 @@ NTFS_SB(vol)=sb; ntfs_debug(DEBUG_OTHER, "Done to init volume\n"); + /* Check the cluster size is within allowed blocksize limits. */ + if (vol->clustersize > PAGE_SIZE) { + ntfs_error("Partition cluster size is not supported yet (it " + "is > max kernel blocksize).\n"); + goto ntfs_read_super_unl; + } + /* Inform the kernel that a device block is a NTFS cluster */ sb->s_blocksize=vol->clustersize; for(i=sb->s_blocksize,sb->s_blocksize_bits=0;i != 1;i>>=1) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/ntfs/support.c linux.20p9/fs/ntfs/support.c --- linux.vanilla/fs/ntfs/support.c Sun Mar 25 17:31:02 2001 +++ linux.20p9/fs/ntfs/support.c Wed Jul 4 16:03:59 2001 @@ -102,7 +102,7 @@ memmove(dest, src, n); } -/* Warn that an error occured. */ +/* Warn that an error occurred. */ void ntfs_error(const char *fmt,...) { va_list ap; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/open.c linux.20p9/fs/open.c --- linux.vanilla/fs/open.c Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/open.c Wed Jul 4 16:03:59 2001 @@ -305,9 +305,15 @@ res = PTR_ERR(dentry); if (!IS_ERR(dentry)) { res = permission(dentry->d_inode, mode); - /* SuS v2 requires we report a read only fs too */ - if(!res && (mode & S_IWOTH) && IS_RDONLY(dentry->d_inode)) - res = -EROFS; + + /* SUSv2 says to return EROFS for open() and access() + for files on a read-only filesystem, when writing + is requested. Clearly, we want to be able to run + a system from read-only media, so should not + interpret this to mean that open("/dev/tty") should + fail when the device node lives on a CDROM. + In other words, no additional check is needed here. */ + dput(dentry); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/proc/mem.c linux.20p9/fs/proc/mem.c --- linux.vanilla/fs/proc/mem.c Sun Mar 25 17:30:58 2001 +++ linux.20p9/fs/proc/mem.c Wed Jul 4 16:04:00 2001 @@ -62,7 +62,7 @@ * that we would allow ptrace to work. */ if (tsk) { - if (!(tsk->flags & PF_PTRACED) + if (!(tsk->ptrace & PT_PTRACED) || tsk->state != TASK_STOPPED || tsk->p_pptr != current) tsk = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/smbfs/ChangeLog linux.20p9/fs/smbfs/ChangeLog --- linux.vanilla/fs/smbfs/ChangeLog Sun Mar 25 17:37:38 2001 +++ linux.20p9/fs/smbfs/ChangeLog Wed Jul 4 16:04:00 2001 @@ -1,5 +1,16 @@ ChangeLog for smbfs. +2001-05-24 Urban Widmark + + * proc.c: fix smb_proc_open to allow open being called more than once + with different modes (O_RDONLY -> O_WRONLY) without closing. + (bugfix from 2.4.3, fix by Michael Kockelkorn) + * inode.c: tail -f fix for non-readonly opened files + (related to the smb_proc_open change). + (bugfix from 2.4.3) + * inode.c: tail -f fix for fast size changes with the same mtime. + (bugfix from 2.4.3) + 2000-11-22 Igor Zhbanov * proc.c: fixed date_unix2dos for dates earlier than 01/01/1980 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/smbfs/inode.c linux.20p9/fs/smbfs/inode.c --- linux.vanilla/fs/smbfs/inode.c Sun Mar 25 17:30:59 2001 +++ linux.20p9/fs/smbfs/inode.c Wed Jul 4 16:04:00 2001 @@ -242,21 +242,12 @@ { struct inode *inode = dentry->d_inode; time_t last_time; + off_t last_sz; int error = 0; DEBUG1("\n"); /* - * If this is a file opened with write permissions, - * the inode will be up-to-date. - */ - if (S_ISREG(inode->i_mode) && smb_is_open(inode)) - { - if (inode->u.smbfs_i.access != SMB_O_RDONLY) - goto out; - } - - /* * Check whether we've recently refreshed the inode. */ if (time_before(jiffies, inode->u.smbfs_i.oldmtime + HZ/10)) @@ -271,8 +262,9 @@ * (Note: a size change should have a different mtime.) */ last_time = inode->i_mtime; + last_sz = inode->i_size; error = smb_refresh_inode(dentry); - if (error || inode->i_mtime != last_time) + if (error || inode->i_mtime != last_time || inode->i_size != last_sz) { VERBOSE("%s/%s changed, old=%ld, new=%ld\n", DENTRY_PATH(dentry), diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/smbfs/proc.c linux.20p9/fs/smbfs/proc.c --- linux.vanilla/fs/smbfs/proc.c Sun Mar 25 17:37:39 2001 +++ linux.20p9/fs/smbfs/proc.c Wed Jul 4 16:04:00 2001 @@ -609,7 +609,7 @@ * Check for a valid connection. */ if (server->state == CONN_VALID) { - PARANOIA("sucessful, new pid=%d, generation=%d\n", + PARANOIA("successful, new pid=%d, generation=%d\n", server->conn_pid, server->generation); result = 1; } @@ -890,8 +890,6 @@ /* smb_vwv2 has mtime */ /* smb_vwv4 has size */ ino->u.smbfs_i.access = (WVAL(server->packet, smb_vwv6) & SMB_ACCMASK); - if (!(wish & (O_WRONLY | O_RDWR))) - ino->u.smbfs_i.access = SMB_O_RDONLY; ino->u.smbfs_i.open = server->generation; out: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/fs/super.c linux.20p9/fs/super.c --- linux.vanilla/fs/super.c Sun Mar 25 17:30:58 2001 +++ linux.20p9/fs/super.c Wed Jul 4 16:04:00 2001 @@ -589,7 +589,7 @@ * filesystems which don't use real block-devices. -- jrs */ -static unsigned int unnamed_dev_in_use[256/(8*sizeof(unsigned int))] = { 0, }; +static unsigned long unnamed_dev_in_use[256/(8*sizeof(unsigned long))] = { 0, }; kdev_t get_unnamed_dev(void) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-alpha/pci.h linux.20p9/include/asm-alpha/pci.h --- linux.vanilla/include/asm-alpha/pci.h Sun Mar 25 17:31:06 2001 +++ linux.20p9/include/asm-alpha/pci.h Wed Jul 4 16:04:00 2001 @@ -53,4 +53,13 @@ #define IOBASE_SPARSE_IO 3 #define IOBASE_DENSE_IO 4 +/* Return the index of the PCI controller for device PDEV. */ +static __inline__ int pci_controller_num(struct pci_dev *pdev) +{ + if (bus2hose[pdev->bus->number] == NULL) + return -ENXIO; + + return bus2hose[pdev->bus->number]->pci_host_index; +} + #endif /* __ALPHA_PCI_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-alpha/resource.h linux.20p9/include/asm-alpha/resource.h --- linux.vanilla/include/asm-alpha/resource.h Sun Mar 25 17:31:06 2001 +++ linux.20p9/include/asm-alpha/resource.h Wed Jul 4 16:04:00 2001 @@ -25,7 +25,7 @@ {LONG_MAX, LONG_MAX}, /* RLIMIT_CPU */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_FSIZE */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_DATA */ \ - {_STK_LIM, _STK_LIM}, /* RLIMIT_STACK */ \ + {_STK_LIM, LONG_MAX}, /* RLIMIT_STACK */ \ { 0, LONG_MAX}, /* RLIMIT_CORE */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_RSS */ \ {INR_OPEN, INR_OPEN}, /* RLIMIT_NOFILE */ \ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-arm/pci.h linux.20p9/include/asm-arm/pci.h --- linux.vanilla/include/asm-arm/pci.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/include/asm-arm/pci.h Wed Jul 4 16:04:00 2001 @@ -0,0 +1,7 @@ +#ifndef _ARM_PCI_H +#define _ARM_PCI_H + +/* Return the index of the PCI controller for device PDEV. */ +#define pci_controller_num(PDEV) (0) + +#endif /* !(_ARM_PCI_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-i386/pci.h linux.20p9/include/asm-i386/pci.h --- linux.vanilla/include/asm-i386/pci.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/include/asm-i386/pci.h Wed Jul 4 16:04:00 2001 @@ -0,0 +1,7 @@ +#ifndef _I386_PCI_H +#define _I386_PCI_H + +/* Return the index of the PCI controller for device PDEV. */ +#define pci_controller_num(PDEV) (0) + +#endif /* !(_I386_PCI_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-m68k/entry.h linux.20p9/include/asm-m68k/entry.h --- linux.vanilla/include/asm-m68k/entry.h Sun Mar 25 17:31:07 2001 +++ linux.20p9/include/asm-m68k/entry.h Wed Jul 4 16:04:00 2001 @@ -52,12 +52,12 @@ LSIGTRAP = 5 /* process bits for task_struct.flags */ -PF_TRACESYS_OFF = 3 -PF_TRACESYS_BIT = 5 -PF_PTRACED_OFF = 3 -PF_PTRACED_BIT = 4 -PF_DTRACE_OFF = 1 -PF_DTRACE_BIT = 5 +PT_TRACESYS_OFF = 3 +PT_TRACESYS_BIT = 5 +PT_PTRACED_OFF = 3 +PT_PTRACED_BIT = 4 +PT_DTRACE_OFF = 1 +PT_DTRACE_BIT = 5 #define SAVE_ALL_INT save_all_int #define SAVE_ALL_SYS save_all_sys diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-mips/offset.h linux.20p9/include/asm-mips/offset.h --- linux.vanilla/include/asm-mips/offset.h Sun Mar 25 17:31:06 2001 +++ linux.20p9/include/asm-mips/offset.h Wed Jul 4 16:04:00 2001 @@ -49,9 +49,10 @@ #define TASK_FLAGS 4 #define TASK_SIGPENDING 8 #define TASK_NEED_RESCHED 20 -#define TASK_COUNTER 24 -#define TASK_PRIORITY 28 -#define TASK_MM 920 +#define TASK_PTRACE 24 +#define TASK_COUNTER 28 +#define TASK_PRIORITY 32 +#define TASK_MM 924 /* MIPS specific thread_struct offsets. */ #define THREAD_REG16 560 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-mips/pci.h linux.20p9/include/asm-mips/pci.h --- linux.vanilla/include/asm-mips/pci.h Sun Mar 25 17:31:06 2001 +++ linux.20p9/include/asm-mips/pci.h Wed Jul 4 16:04:00 2001 @@ -39,4 +39,7 @@ extern struct pci_ops *pci_ops; +/* Return the index of the PCI controller for device PDEV. */ +#define pci_controller_num(PDEV) (0) + #endif /* __ASM_MIPS_PCI_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-ppc/pci.h linux.20p9/include/asm-ppc/pci.h --- linux.vanilla/include/asm-ppc/pci.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-ppc/pci.h Wed Jul 4 16:04:00 2001 @@ -9,5 +9,7 @@ #define IOBASE_MEMORY 1 #define IOBASE_IO 2 +/* Return the index of the PCI controller for device PDEV. */ +#define pci_controller_num(PDEV) (0) #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/bitops.h linux.20p9/include/asm-s390/bitops.h --- linux.vanilla/include/asm-s390/bitops.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/bitops.h Wed Aug 8 22:12:51 2001 @@ -841,7 +841,7 @@ " icm %0,2,1(%1)\n" " icm %0,4,2(%1)\n" " icm %0,8,3(%1)" - : "=&a" (word) : "a" (p) ); + : "=&a" (word) : "a" (p) : "cc" ); word >>= bit; res = bit; /* Look for zero in first longword */ @@ -857,7 +857,7 @@ "1: nr %1,0\n" " ic %1,0(%1,%2)\n" " alr %0,%1" - : "+&d" (res), "+&d" (word) + : "+&d" (res), "+&a" (word) : "a" (&_zb_findmap) : "cc", "0" ); if (res < 32) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/byteorder.h linux.20p9/include/asm-s390/byteorder.h --- linux.vanilla/include/asm-s390/byteorder.h Sun Mar 25 17:31:10 2001 +++ linux.20p9/include/asm-s390/byteorder.h Wed Aug 8 22:12:51 2001 @@ -23,7 +23,7 @@ " icm %0,4,2(%1)\n" " icm %0,2,1(%1)\n" " ic %0,0(%1)" - : "+&d" (x) : "a" (&temp) : "memory" ); + : "+&d" (x) : "a" (&temp) : "memory", "cc" ); return x; } @@ -36,7 +36,7 @@ " icm %0,4,2(%1)\n" " icm %0,2,1(%1)\n" " ic %0,0(%1)" - : "=&d" (result) : "a" (x) ); + : "=&d" (result) : "a" (x) : "cc" ); return result; } @@ -48,7 +48,7 @@ " icm 0,2,1(%0)\n" " ic 0,0(%0)\n" " st 0,0(%0)" - : : "a" (x) : "0", "memory"); + : : "a" (x) : "0", "memory", "cc" ); } static __inline__ __const__ __u16 ___arch__swab16(__u16 x) @@ -59,7 +59,7 @@ " sth %0,0(%1)\n" " icm %0,2,1(%1)\n" " ic %0,0(%1)\n" - : "+&d" (x) : "a" (&temp) : "memory"); + : "+&d" (x) : "a" (&temp) : "memory", "cc" ); return x; } @@ -71,7 +71,7 @@ " sr %0,%0\n" " icm %0,2,1(%1)\n" " ic %0,0(%1)\n" - : "=&d" (result) : "a" (x) ); + : "=&d" (result) : "a" (x) : "cc" ); return result; } @@ -81,7 +81,7 @@ " icm 0,2,1(%0)\n" " ic 0,0(%0)\n" " sth 0,0(%0)" - : : "a" (x) : "0", "memory"); + : : "a" (x) : "0", "memory", "cc" ); } #define __arch__swab32(x) ___arch__swab32(x) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/ccwcache.h linux.20p9/include/asm-s390/ccwcache.h --- linux.vanilla/include/asm-s390/ccwcache.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/ccwcache.h Wed Jul 4 16:04:00 2001 @@ -62,7 +62,7 @@ #define CQR_STATUS_FILLED 0x01 /* request is ready to be preocessed */ #define CQR_STATUS_QUEUED 0x02 /* request is queued to be processed */ #define CQR_STATUS_IN_IO 0x04 /* request is currently in IO */ -#define CQR_STATUS_DONE 0x08 /* request is completed sucessfully */ +#define CQR_STATUS_DONE 0x08 /* request is completed successfully */ #define CQR_STATUS_ERROR 0x10 /* request is completed with error */ #define CQR_STATUS_FAILED 0x20 /* request is finally failed */ #define CQR_STATUS_PENDING 0x07 /* request is waiting for interrupt - ERP only */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/current.h linux.20p9/include/asm-s390/current.h --- linux.vanilla/include/asm-s390/current.h Sun Mar 25 17:31:10 2001 +++ linux.20p9/include/asm-s390/current.h Wed Aug 8 22:12:51 2001 @@ -20,7 +20,7 @@ struct task_struct *current; __asm__("lhi %0,-8192\n\t" "nr %0,15" - : "=&r" (current) ); + : "=&r" (current) : : "cc" ); return current; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/debug.h linux.20p9/include/asm-s390/debug.h --- linux.vanilla/include/asm-s390/debug.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/debug.h Wed Aug 8 22:12:51 2001 @@ -53,7 +53,7 @@ #define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */ /* the entry information */ -#define STCK(x) asm volatile ("STCK %0":"=m" (x)) +#define STCK(x) asm volatile ("STCK %0" : "=m" (x) : : "cc" ) typedef struct __debug_entry debug_entry_t; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/io.h linux.20p9/include/asm-s390/io.h --- linux.vanilla/include/asm-s390/io.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/io.h Wed Aug 8 22:12:51 2001 @@ -29,7 +29,7 @@ " jz 0f\n" " sr %0,%0\n" "0:" - : "=a" (real_address) : "a" (address) ); + : "=a" (real_address) : "a" (address) : "cc" ); return real_address; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/irq.h linux.20p9/include/asm-s390/irq.h --- linux.vanilla/include/asm-s390/irq.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/irq.h Wed Jul 4 16:04:00 2001 @@ -147,7 +147,7 @@ typedef struct { __u8 cmd_code;/* command code */ - __u8 flags; /* flags, like IDA adressing, etc. */ + __u8 flags; /* flags, like IDA addressing, etc. */ __u16 count; /* byte count */ __u32 cda; /* data address */ } __attribute__ ((packed,aligned(8))) ccw1_t; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/lowcore.h linux.20p9/include/asm-s390/lowcore.h --- linux.vanilla/include/asm-s390/lowcore.h Sun Mar 25 17:31:10 2001 +++ linux.20p9/include/asm-s390/lowcore.h Wed Aug 8 22:14:20 2001 @@ -32,9 +32,9 @@ #define __LC_SUBCHANNEL_NR 0x0BA #define __LC_IO_INT_PARM 0x0BC #define __LC_MCCK_CODE 0x0E8 -#define __LC_AREGS_SAVE_AREA 0x200 -#define __LC_CREGS_SAVE_AREA 0x240 -#define __LC_RETURN_PSW 0x280 +#define __LC_AREGS_SAVE_AREA 0x120 +#define __LC_CREGS_SAVE_AREA 0x1c0 +#define __LC_RETURN_PSW 0x200 #define __LC_SYNC_IO_WORD 0x400 @@ -44,6 +44,7 @@ #define __LC_CPUID 0xC50 #define __LC_CPUADDR 0xC58 #define __LC_IPLDEV 0xC6C +#define __LC_PANIC_MAGIC 0xE00 /* interrupt handler start with all io, external and mcck interrupt disabled */ @@ -126,15 +127,14 @@ __u32 failing_storage_address; /* 0x0f8 */ __u8 pad5[0x100-0xfc]; /* 0x0fc */ __u32 st_status_fixed_logout[4];/* 0x100 */ - __u8 pad6[0x160-0x110]; /* 0x110 */ + __u8 pad6[0x120-0x110]; /* 0x110 */ + __u32 access_regs_save_area[16];/* 0x120 */ __u32 floating_pt_save_area[8]; /* 0x160 */ __u32 gpregs_save_area[16]; /* 0x180 */ - __u8 pad7[0x200-0x1c0]; /* 0x1c0 */ + __u32 cregs_save_area[16]; /* 0x1c0 */ - __u32 access_regs_save_area[16];/* 0x200 */ - __u32 cregs_save_area[16]; /* 0x240 */ - psw_t return_psw; /* 0x280 */ - __u8 pad8[0x400-0x288]; /* 0x288 */ + psw_t return_psw; /* 0x200 */ + __u8 pad8[0x400-0x208]; /* 0x208 */ __u32 sync_io_word; /* 0x400 */ @@ -154,9 +154,14 @@ atomic_t ext_call_fast; /* 0xc78 */ atomic_t ext_call_queue; /* 0xc7c */ atomic_t ext_call_count; /* 0xc80 */ + __u8 pad10[0xe00-0xc84]; /* 0xc84 */ - /* Align SMP info to the top 1k of prefix area */ - __u8 pad10[0x1000-0xc84]; /* 0xc84 */ + /* 0xe00 is used as indicator for dump tools */ + /* whether the kernel died with panic() or not */ + __u32 panic_magic; /* 0xe00 */ + + /* Align to the top 1k of prefix area */ + __u8 pad11[0x1000-0xe04]; /* 0xe04 */ } __attribute__((packed)); /* End structure*/ extern __inline__ void set_prefix(__u32 address) @@ -177,5 +182,7 @@ #endif #endif /* __ASSEMBLY__ */ +#define __PANIC_MAGIC 0xDEADC0DE + #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/pgtable.h linux.20p9/include/asm-s390/pgtable.h --- linux.vanilla/include/asm-s390/pgtable.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/pgtable.h Wed Aug 8 22:12:51 2001 @@ -115,7 +115,7 @@ "lr 4,%2\n\t" "csp 2,4" : : "d" (cs1), "d" (dum), "d" (adr) - : "2", "3", "4"); + : "2", "3", "4", "cc" ); } static inline void __flush_global_tlb(void) @@ -529,7 +529,7 @@ __asm__ __volatile(" ic 0,2(%0)\n" " ipte %1,%2\n" " stc 0,2(%0)" - : : "a" (pte), "a" (pto), "a" (addr): "0"); + : : "a" (pte), "a" (pto), "a" (addr): "0", "cc" ); } /* @@ -711,10 +711,10 @@ } /* - * a page-table entry has only 19 bit for offset and 7 bit for type - * if bits 0, 20 or 23 are set, a translation specification exceptions occures, and it's - * hard to find out the failing address - * therefor, we zero out this bits + * a page-table entry has only 19 bits for offset and 7 bits for type + * if bits 0, 20 or 23 are set, a translation specification exception occurs, + * and it's hard to find out the failing address + * therefore, we zero out these bits */ #define SWP_TYPE(entry) (((entry) >> 1) & 0x3f) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/processor.h linux.20p9/include/asm-s390/processor.h --- linux.vanilla/include/asm-s390/processor.h Sun Mar 25 17:31:10 2001 +++ linux.20p9/include/asm-s390/processor.h Wed Aug 8 22:12:51 2001 @@ -193,7 +193,7 @@ " stctl 0,15,0x1c0\n" /* store control registers */ " oi 0x1c0,0x10\n" /* fake protection bit */ " lpsw 0(%0)" - : : "a" (dw_psw), "a" (&ctl_buf)); + : : "a" (dw_psw), "a" (&ctl_buf) : "cc" ); } #endif /* __ASM_S390_PROCESSOR_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/system.h linux.20p9/include/asm-s390/system.h --- linux.vanilla/include/asm-s390/system.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/system.h Wed Aug 8 22:12:51 2001 @@ -50,7 +50,7 @@ " jl 1b\n" " ex 0,4(2)" /* store *ptr to x */ : "+a&" (ptr) : "a" (&x) - : "memory", "0", "1", "2"); + : "memory", "cc", "0", "1", "2"); break; case 2: if(((__u32)ptr)&1) @@ -73,7 +73,7 @@ " jl 1b\n" " ex 0,4(2)" /* store *ptr to x */ : "+a&" (ptr) : "a" (&x) - : "memory", "0", "1", "2"); + : "memory", "cc", "0", "1", "2"); break; case 4: if(((__u32)ptr)&3) @@ -84,7 +84,7 @@ " jl 0b\n" " lr %0,0\n" : "+d&" (x) : "a" (ptr) - : "memory", "0" ); + : "memory", "cc", "0" ); break; default: abort(); @@ -140,7 +140,7 @@ " st 0,0(1)\n" \ "1: ex %1,4(2)" /* execute lctl */ \ : "=m" (dummy) : "a" (cr*17), "a" (1<<(bit)) \ - : "0", "1", "2"); \ + : "cc", "0", "1", "2"); \ }) #define __ctl_clear_bit(cr, bit) ({ \ @@ -159,7 +159,7 @@ " st 0,0(1)\n" \ "1: ex %1,4(2)" /* execute lctl */ \ : "=m" (dummy) : "a" (cr*17), "a" (~(1<<(bit))) \ - : "0", "1", "2"); \ + : "cc", "0", "1", "2"); \ }) #ifdef __SMP__ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-s390/uaccess.h linux.20p9/include/asm-s390/uaccess.h --- linux.vanilla/include/asm-s390/uaccess.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-s390/uaccess.h Wed Aug 8 22:12:51 2001 @@ -104,7 +104,7 @@ ".previous" : "=m" (*((__u32*) ptr)) , "=&d" (err) : "d" (x), "K" (-EFAULT) - : "4" ); + : "cc", "4" ); return err; } @@ -132,7 +132,7 @@ ".previous" : "=m" (*((__u16*) ptr)) , "=&d" (err) : "d" (x), "K" (-EFAULT) - : "4" ); + : "cc", "4" ); return err; } @@ -160,7 +160,7 @@ ".previous" : "=m" (*((__u8*) ptr)) , "=&d" (err) : "d" (x), "K" (-EFAULT) - : "4" ); + : "cc", "4" ); return err; } @@ -225,7 +225,7 @@ ".previous" \ : "=d" (x) , "=&d" (err) \ : "m" (*(const __u32*) ptr), "K" (-EFAULT) \ - : "4" ); \ + : "cc", "4" ); \ }) #define __get_user_asm_2(x, ptr, err) \ @@ -250,7 +250,7 @@ ".previous" \ : "=d" (x) , "=&d" (err) \ : "m" (*(const __u16*) ptr), "K" (-EFAULT) \ - : "4" ); \ + : "cc", "4" ); \ }) #define __get_user_asm_1(x, ptr, err) \ @@ -276,7 +276,7 @@ ".previous" \ : "=d" (x) , "=&d" (err) \ : "m" (*(const __u8*) ptr), "K" (-EFAULT) \ - : "4" ); \ + : "cc", "4" ); \ }) #define __get_user(x, ptr) \ @@ -359,7 +359,7 @@ " .long 0b,__copy_to_user_fixup\n" ".previous" : "+&d" (n) : "d" (to), "d" (from) - : "1", "2", "3", "4", "5" ); + : "cc", "1", "2", "3", "4", "5" ); return n; } @@ -397,7 +397,7 @@ " .long 0b,__copy_from_user_fixup\n" ".previous" : "+&d" (n) : "d" (to), "d" (from) - : "1", "2", "3", "4", "5" ); + : "cc", "1", "2", "3", "4", "5" ); return n; } @@ -458,7 +458,7 @@ : "=&a" (len) : "a" (dst), "d" (src), "d" (count), "K" (-EFAULT) - : "2", "3", "4", "memory" ); + : "2", "3", "4", "memory", "cc" ); return len; } @@ -505,6 +505,7 @@ : "cc", "0", "4" ); return n; } +#define strlen_user(str) strnlen_user(str, ~0UL) /* * Zero Userspace diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc/asm_offsets.h linux.20p9/include/asm-sparc/asm_offsets.h --- linux.vanilla/include/asm-sparc/asm_offsets.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-sparc/asm_offsets.h Wed Jul 4 16:04:00 2001 @@ -18,147 +18,149 @@ #define ASIZ_task_exec_domain 0x00000004 #define AOFF_task_need_resched 0x00000014 #define ASIZ_task_need_resched 0x00000004 -#define AOFF_task_counter 0x00000018 +#define AOFF_task_ptrace 0x00000018 +#define ASIZ_task_ptrace 0x00000004 +#define AOFF_task_counter 0x0000001c #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x0000001c +#define AOFF_task_priority 0x00000020 #define ASIZ_task_priority 0x00000004 -#define AOFF_task_avg_slice 0x00000020 +#define AOFF_task_avg_slice 0x00000024 #define ASIZ_task_avg_slice 0x00000004 -#define AOFF_task_has_cpu 0x00000024 +#define AOFF_task_has_cpu 0x00000028 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000028 +#define AOFF_task_processor 0x0000002c #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x0000002c +#define AOFF_task_last_processor 0x00000030 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000030 +#define AOFF_task_lock_depth 0x00000034 #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000034 +#define AOFF_task_next_task 0x00000038 #define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000038 +#define AOFF_task_prev_task 0x0000003c #define ASIZ_task_prev_task 0x00000004 -#define AOFF_task_next_run 0x0000003c +#define AOFF_task_next_run 0x00000040 #define ASIZ_task_next_run 0x00000004 -#define AOFF_task_prev_run 0x00000040 +#define AOFF_task_prev_run 0x00000044 #define ASIZ_task_prev_run 0x00000004 -#define AOFF_task_task_exclusive 0x00000044 +#define AOFF_task_task_exclusive 0x00000048 #define ASIZ_task_task_exclusive 0x00000004 -#define AOFF_task_binfmt 0x00000048 +#define AOFF_task_binfmt 0x0000004c #define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_exit_code 0x0000004c +#define AOFF_task_exit_code 0x00000050 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x00000050 +#define AOFF_task_exit_signal 0x00000054 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000054 +#define AOFF_task_pdeath_signal 0x00000058 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000058 +#define AOFF_task_personality 0x0000005c #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x00000060 +#define AOFF_task_pid 0x00000064 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000064 +#define AOFF_task_pgrp 0x00000068 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x00000068 +#define AOFF_task_tty_old_pgrp 0x0000006c #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x0000006c +#define AOFF_task_session 0x00000070 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x00000070 +#define AOFF_task_leader 0x00000074 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000074 +#define AOFF_task_p_opptr 0x00000078 #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x00000078 +#define AOFF_task_p_pptr 0x0000007c #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x0000007c +#define AOFF_task_p_cptr 0x00000080 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x00000080 +#define AOFF_task_p_ysptr 0x00000084 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000084 +#define AOFF_task_p_osptr 0x00000088 #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x00000088 +#define AOFF_task_pidhash_next 0x0000008c #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x0000008c +#define AOFF_task_pidhash_pprev 0x00000090 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_tarray_ptr 0x00000090 +#define AOFF_task_tarray_ptr 0x00000094 #define ASIZ_task_tarray_ptr 0x00000004 -#define AOFF_task_wait_chldexit 0x00000094 +#define AOFF_task_wait_chldexit 0x00000098 #define ASIZ_task_wait_chldexit 0x00000004 -#define AOFF_task_vfork_sem 0x00000098 +#define AOFF_task_vfork_sem 0x0000009c #define ASIZ_task_vfork_sem 0x00000004 -#define AOFF_task_policy 0x0000009c +#define AOFF_task_policy 0x000000a0 #define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000a0 +#define AOFF_task_rt_priority 0x000000a4 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000a4 +#define AOFF_task_it_real_value 0x000000a8 #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000a8 +#define AOFF_task_it_prof_value 0x000000ac #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000ac +#define AOFF_task_it_virt_value 0x000000b0 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000b0 +#define AOFF_task_it_real_incr 0x000000b4 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000b4 +#define AOFF_task_it_prof_incr 0x000000b8 #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000b8 +#define AOFF_task_it_virt_incr 0x000000bc #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000bc +#define AOFF_task_real_timer 0x000000c0 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000d0 +#define AOFF_task_times 0x000000d4 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000e0 +#define AOFF_task_start_time 0x000000e4 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000e4 +#define AOFF_task_per_cpu_utime 0x000000e8 #define ASIZ_task_per_cpu_utime 0x00000004 -#define AOFF_task_min_flt 0x000000ec +#define AOFF_task_min_flt 0x000000f0 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000000f0 +#define AOFF_task_maj_flt 0x000000f4 #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000000f4 +#define AOFF_task_nswap 0x000000f8 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000000f8 +#define AOFF_task_cmin_flt 0x000000fc #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x000000fc +#define AOFF_task_cmaj_flt 0x00000100 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x00000100 +#define AOFF_task_cnswap 0x00000104 #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x00000106 +#define AOFF_task_uid 0x0000010a #define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x00000108 +#define AOFF_task_euid 0x0000010c #define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x0000010a +#define AOFF_task_suid 0x0000010e #define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x0000010c +#define AOFF_task_fsuid 0x00000110 #define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x0000010e +#define AOFF_task_gid 0x00000112 #define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x00000110 +#define AOFF_task_egid 0x00000114 #define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x00000112 +#define AOFF_task_sgid 0x00000116 #define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x00000114 +#define AOFF_task_fsgid 0x00000118 #define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x00000118 +#define AOFF_task_ngroups 0x0000011c #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x0000011c +#define AOFF_task_groups 0x00000120 #define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x0000015c +#define AOFF_task_cap_effective 0x00000160 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000160 +#define AOFF_task_cap_inheritable 0x00000164 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000164 +#define AOFF_task_cap_permitted 0x00000168 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x0000016c +#define AOFF_task_user 0x00000170 #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x00000170 +#define AOFF_task_rlim 0x00000174 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000001c0 +#define AOFF_task_used_math 0x000001c4 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000001c2 +#define AOFF_task_comm 0x000001c6 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000001d4 +#define AOFF_task_link_count 0x000001d8 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000001d8 +#define AOFF_task_tty 0x000001dc #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000001dc +#define AOFF_task_semundo 0x000001e0 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000001e0 +#define AOFF_task_semsleeping 0x000001e4 #define ASIZ_task_semsleeping 0x00000004 #define AOFF_task_tss 0x000001e8 #define ASIZ_task_tss 0x00000388 @@ -309,147 +311,149 @@ #define ASIZ_task_exec_domain 0x00000004 #define AOFF_task_need_resched 0x00000014 #define ASIZ_task_need_resched 0x00000004 -#define AOFF_task_counter 0x00000018 +#define AOFF_task_ptrace 0x00000018 +#define ASIZ_task_ptrace 0x00000004 +#define AOFF_task_counter 0x0000001c #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x0000001c +#define AOFF_task_priority 0x00000020 #define ASIZ_task_priority 0x00000004 -#define AOFF_task_avg_slice 0x00000020 +#define AOFF_task_avg_slice 0x00000024 #define ASIZ_task_avg_slice 0x00000004 -#define AOFF_task_has_cpu 0x00000024 +#define AOFF_task_has_cpu 0x00000028 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000028 +#define AOFF_task_processor 0x0000002c #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x0000002c +#define AOFF_task_last_processor 0x00000030 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000030 +#define AOFF_task_lock_depth 0x00000034 #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000034 +#define AOFF_task_next_task 0x00000038 #define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000038 +#define AOFF_task_prev_task 0x0000003c #define ASIZ_task_prev_task 0x00000004 -#define AOFF_task_next_run 0x0000003c +#define AOFF_task_next_run 0x00000040 #define ASIZ_task_next_run 0x00000004 -#define AOFF_task_prev_run 0x00000040 +#define AOFF_task_prev_run 0x00000044 #define ASIZ_task_prev_run 0x00000004 -#define AOFF_task_task_exclusive 0x00000044 +#define AOFF_task_task_exclusive 0x00000048 #define ASIZ_task_task_exclusive 0x00000004 -#define AOFF_task_binfmt 0x00000048 +#define AOFF_task_binfmt 0x0000004c #define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_exit_code 0x0000004c +#define AOFF_task_exit_code 0x00000050 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x00000050 +#define AOFF_task_exit_signal 0x00000054 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000054 +#define AOFF_task_pdeath_signal 0x00000058 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000058 +#define AOFF_task_personality 0x0000005c #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x00000060 +#define AOFF_task_pid 0x00000064 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000064 +#define AOFF_task_pgrp 0x00000068 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x00000068 +#define AOFF_task_tty_old_pgrp 0x0000006c #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x0000006c +#define AOFF_task_session 0x00000070 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x00000070 +#define AOFF_task_leader 0x00000074 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000074 +#define AOFF_task_p_opptr 0x00000078 #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x00000078 +#define AOFF_task_p_pptr 0x0000007c #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x0000007c +#define AOFF_task_p_cptr 0x00000080 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x00000080 +#define AOFF_task_p_ysptr 0x00000084 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000084 +#define AOFF_task_p_osptr 0x00000088 #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x00000088 +#define AOFF_task_pidhash_next 0x0000008c #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x0000008c +#define AOFF_task_pidhash_pprev 0x00000090 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_tarray_ptr 0x00000090 +#define AOFF_task_tarray_ptr 0x00000094 #define ASIZ_task_tarray_ptr 0x00000004 -#define AOFF_task_wait_chldexit 0x00000094 +#define AOFF_task_wait_chldexit 0x00000098 #define ASIZ_task_wait_chldexit 0x00000004 -#define AOFF_task_vfork_sem 0x00000098 +#define AOFF_task_vfork_sem 0x0000009c #define ASIZ_task_vfork_sem 0x00000004 -#define AOFF_task_policy 0x0000009c +#define AOFF_task_policy 0x000000a0 #define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000a0 +#define AOFF_task_rt_priority 0x000000a4 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000a4 +#define AOFF_task_it_real_value 0x000000a8 #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000a8 +#define AOFF_task_it_prof_value 0x000000ac #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000ac +#define AOFF_task_it_virt_value 0x000000b0 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000b0 +#define AOFF_task_it_real_incr 0x000000b4 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000b4 +#define AOFF_task_it_prof_incr 0x000000b8 #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000b8 +#define AOFF_task_it_virt_incr 0x000000bc #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000bc +#define AOFF_task_real_timer 0x000000c0 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000d0 +#define AOFF_task_times 0x000000d4 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000e0 +#define AOFF_task_start_time 0x000000e4 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000e4 +#define AOFF_task_per_cpu_utime 0x000000e8 #define ASIZ_task_per_cpu_utime 0x00000080 -#define AOFF_task_min_flt 0x000001e4 +#define AOFF_task_min_flt 0x000001e8 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000001e8 +#define AOFF_task_maj_flt 0x000001ec #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000001ec +#define AOFF_task_nswap 0x000001f0 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000001f0 +#define AOFF_task_cmin_flt 0x000001f4 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x000001f4 +#define AOFF_task_cmaj_flt 0x000001f8 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x000001f8 +#define AOFF_task_cnswap 0x000001fc #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x000001fe +#define AOFF_task_uid 0x00000202 #define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x00000200 +#define AOFF_task_euid 0x00000204 #define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x00000202 +#define AOFF_task_suid 0x00000206 #define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x00000204 +#define AOFF_task_fsuid 0x00000208 #define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x00000206 +#define AOFF_task_gid 0x0000020a #define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x00000208 +#define AOFF_task_egid 0x0000020c #define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x0000020a +#define AOFF_task_sgid 0x0000020e #define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x0000020c +#define AOFF_task_fsgid 0x00000210 #define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x00000210 +#define AOFF_task_ngroups 0x00000214 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000214 +#define AOFF_task_groups 0x00000218 #define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x00000254 +#define AOFF_task_cap_effective 0x00000258 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000258 +#define AOFF_task_cap_inheritable 0x0000025c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x0000025c +#define AOFF_task_cap_permitted 0x00000260 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000264 +#define AOFF_task_user 0x00000268 #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x00000268 +#define AOFF_task_rlim 0x0000026c #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000002b8 +#define AOFF_task_used_math 0x000002bc #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000002ba +#define AOFF_task_comm 0x000002be #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000002cc +#define AOFF_task_link_count 0x000002d0 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000002d0 +#define AOFF_task_tty 0x000002d4 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000002d4 +#define AOFF_task_semundo 0x000002d8 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000002d8 +#define AOFF_task_semsleeping 0x000002dc #define ASIZ_task_semsleeping 0x00000004 #define AOFF_task_tss 0x000002e0 #define ASIZ_task_tss 0x00000388 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc/pci.h linux.20p9/include/asm-sparc/pci.h --- linux.vanilla/include/asm-sparc/pci.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/include/asm-sparc/pci.h Wed Jul 4 16:04:00 2001 @@ -0,0 +1,7 @@ +#ifndef _SPARC_PCI_H +#define _SPARC_PCI_H + +/* Return the index of the PCI controller for device PDEV. */ +#define pci_controller_num(PDEV) (0) + +#endif /* !(_SPARC_PCI_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc/siginfo.h linux.20p9/include/asm-sparc/siginfo.h --- linux.vanilla/include/asm-sparc/siginfo.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-sparc/siginfo.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: siginfo.h,v 1.4 1999/04/28 19:45:20 davem Exp $ +/* $Id: siginfo.h,v 1.4.2.1 2001/03/01 00:49:02 davem Exp $ * siginfo.c: */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc/uaccess.h linux.20p9/include/asm-sparc/uaccess.h --- linux.vanilla/include/asm-sparc/uaccess.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-sparc/uaccess.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: uaccess.h,v 1.18.2.1 1999/09/10 09:54:34 davem Exp $ +/* $Id: uaccess.h,v 1.18.2.2 2001/03/01 00:49:02 davem Exp $ * uaccess.h: User space memore access functions. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/asm_offsets.h linux.20p9/include/asm-sparc64/asm_offsets.h --- linux.vanilla/include/asm-sparc64/asm_offsets.h Sun Mar 25 17:37:39 2001 +++ linux.20p9/include/asm-sparc64/asm_offsets.h Wed Jul 4 16:04:00 2001 @@ -18,147 +18,149 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000028 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000030 +#define AOFF_task_ptrace 0x00000030 +#define ASIZ_task_ptrace 0x00000008 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000038 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000040 +#define AOFF_task_avg_slice 0x00000048 #define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000048 +#define AOFF_task_has_cpu 0x00000050 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x0000004c +#define AOFF_task_processor 0x00000054 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000050 +#define AOFF_task_last_processor 0x00000058 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000054 +#define AOFF_task_lock_depth 0x0000005c #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000058 +#define AOFF_task_next_task 0x00000060 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000060 +#define AOFF_task_prev_task 0x00000068 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_next_run 0x00000068 +#define AOFF_task_next_run 0x00000070 #define ASIZ_task_next_run 0x00000008 -#define AOFF_task_prev_run 0x00000070 +#define AOFF_task_prev_run 0x00000078 #define ASIZ_task_prev_run 0x00000008 -#define AOFF_task_task_exclusive 0x00000078 +#define AOFF_task_task_exclusive 0x00000080 #define ASIZ_task_task_exclusive 0x00000004 -#define AOFF_task_binfmt 0x00000080 +#define AOFF_task_binfmt 0x00000088 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000088 +#define AOFF_task_exit_code 0x00000090 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000008c +#define AOFF_task_exit_signal 0x00000094 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000090 +#define AOFF_task_pdeath_signal 0x00000098 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000098 +#define AOFF_task_personality 0x000000a0 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x000000a4 +#define AOFF_task_pid 0x000000ac #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x000000a8 +#define AOFF_task_pgrp 0x000000b0 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x000000ac +#define AOFF_task_tty_old_pgrp 0x000000b4 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000b0 +#define AOFF_task_session 0x000000b8 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000b4 +#define AOFF_task_leader 0x000000bc #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000b8 +#define AOFF_task_p_opptr 0x000000c0 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000c0 +#define AOFF_task_p_pptr 0x000000c8 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000c8 +#define AOFF_task_p_cptr 0x000000d0 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000d0 +#define AOFF_task_p_ysptr 0x000000d8 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000d8 +#define AOFF_task_p_osptr 0x000000e0 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000e0 +#define AOFF_task_pidhash_next 0x000000e8 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000e8 +#define AOFF_task_pidhash_pprev 0x000000f0 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_tarray_ptr 0x000000f0 +#define AOFF_task_tarray_ptr 0x000000f8 #define ASIZ_task_tarray_ptr 0x00000008 -#define AOFF_task_wait_chldexit 0x000000f8 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000008 -#define AOFF_task_vfork_sem 0x00000100 +#define AOFF_task_vfork_sem 0x00000108 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000108 +#define AOFF_task_policy 0x00000110 #define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000110 +#define AOFF_task_rt_priority 0x00000118 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000118 +#define AOFF_task_it_real_value 0x00000120 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000120 +#define AOFF_task_it_prof_value 0x00000128 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000128 +#define AOFF_task_it_virt_value 0x00000130 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000130 +#define AOFF_task_it_real_incr 0x00000138 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000138 +#define AOFF_task_it_prof_incr 0x00000140 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000140 +#define AOFF_task_it_virt_incr 0x00000148 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000148 +#define AOFF_task_real_timer 0x00000150 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000170 +#define AOFF_task_times 0x00000178 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x00000190 +#define AOFF_task_start_time 0x00000198 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x00000198 +#define AOFF_task_per_cpu_utime 0x000001a0 #define ASIZ_task_per_cpu_utime 0x00000008 -#define AOFF_task_min_flt 0x000001a8 +#define AOFF_task_min_flt 0x000001b0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000001b0 +#define AOFF_task_maj_flt 0x000001b8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000001b8 +#define AOFF_task_nswap 0x000001c0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000001c0 +#define AOFF_task_cmin_flt 0x000001c8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000001c8 +#define AOFF_task_cmaj_flt 0x000001d0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000001d0 +#define AOFF_task_cnswap 0x000001d8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000001dc +#define AOFF_task_uid 0x000001e4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000001e0 +#define AOFF_task_euid 0x000001e8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000001e4 +#define AOFF_task_suid 0x000001ec #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000001e8 +#define AOFF_task_fsuid 0x000001f0 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000001ec +#define AOFF_task_gid 0x000001f4 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000001f0 +#define AOFF_task_egid 0x000001f8 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000001f4 +#define AOFF_task_sgid 0x000001fc #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000001f8 +#define AOFF_task_fsgid 0x00000200 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000001fc +#define AOFF_task_ngroups 0x00000204 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000200 +#define AOFF_task_groups 0x00000208 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000280 +#define AOFF_task_cap_effective 0x00000288 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000284 +#define AOFF_task_cap_inheritable 0x0000028c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000288 +#define AOFF_task_cap_permitted 0x00000290 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000290 +#define AOFF_task_user 0x00000298 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000298 +#define AOFF_task_rlim 0x000002a0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000338 +#define AOFF_task_used_math 0x00000340 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000033a +#define AOFF_task_comm 0x00000342 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000034c +#define AOFF_task_link_count 0x00000354 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000350 +#define AOFF_task_tty 0x00000358 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000358 +#define AOFF_task_semundo 0x00000360 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000360 +#define AOFF_task_semsleeping 0x00000368 #define ASIZ_task_semsleeping 0x00000008 #define AOFF_task_tss 0x00000370 #define ASIZ_task_tss 0x00000470 @@ -320,147 +322,149 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000028 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000030 +#define AOFF_task_ptrace 0x00000030 +#define ASIZ_task_ptrace 0x00000008 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000038 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000040 +#define AOFF_task_avg_slice 0x00000048 #define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000048 +#define AOFF_task_has_cpu 0x00000050 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x0000004c +#define AOFF_task_processor 0x00000054 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000050 +#define AOFF_task_last_processor 0x00000058 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000054 +#define AOFF_task_lock_depth 0x0000005c #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000058 +#define AOFF_task_next_task 0x00000060 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000060 +#define AOFF_task_prev_task 0x00000068 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_next_run 0x00000068 +#define AOFF_task_next_run 0x00000070 #define ASIZ_task_next_run 0x00000008 -#define AOFF_task_prev_run 0x00000070 +#define AOFF_task_prev_run 0x00000078 #define ASIZ_task_prev_run 0x00000008 -#define AOFF_task_task_exclusive 0x00000078 +#define AOFF_task_task_exclusive 0x00000080 #define ASIZ_task_task_exclusive 0x00000004 -#define AOFF_task_binfmt 0x00000080 +#define AOFF_task_binfmt 0x00000088 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000088 +#define AOFF_task_exit_code 0x00000090 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000008c +#define AOFF_task_exit_signal 0x00000094 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000090 +#define AOFF_task_pdeath_signal 0x00000098 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000098 +#define AOFF_task_personality 0x000000a0 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x000000a4 +#define AOFF_task_pid 0x000000ac #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x000000a8 +#define AOFF_task_pgrp 0x000000b0 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x000000ac +#define AOFF_task_tty_old_pgrp 0x000000b4 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000b0 +#define AOFF_task_session 0x000000b8 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000b4 +#define AOFF_task_leader 0x000000bc #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000b8 +#define AOFF_task_p_opptr 0x000000c0 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000c0 +#define AOFF_task_p_pptr 0x000000c8 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000c8 +#define AOFF_task_p_cptr 0x000000d0 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000d0 +#define AOFF_task_p_ysptr 0x000000d8 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000d8 +#define AOFF_task_p_osptr 0x000000e0 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000e0 +#define AOFF_task_pidhash_next 0x000000e8 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000e8 +#define AOFF_task_pidhash_pprev 0x000000f0 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_tarray_ptr 0x000000f0 +#define AOFF_task_tarray_ptr 0x000000f8 #define ASIZ_task_tarray_ptr 0x00000008 -#define AOFF_task_wait_chldexit 0x000000f8 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000008 -#define AOFF_task_vfork_sem 0x00000100 +#define AOFF_task_vfork_sem 0x00000108 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000108 +#define AOFF_task_policy 0x00000110 #define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000110 +#define AOFF_task_rt_priority 0x00000118 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000118 +#define AOFF_task_it_real_value 0x00000120 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000120 +#define AOFF_task_it_prof_value 0x00000128 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000128 +#define AOFF_task_it_virt_value 0x00000130 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000130 +#define AOFF_task_it_real_incr 0x00000138 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000138 +#define AOFF_task_it_prof_incr 0x00000140 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000140 +#define AOFF_task_it_virt_incr 0x00000148 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000148 +#define AOFF_task_real_timer 0x00000150 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000170 +#define AOFF_task_times 0x00000178 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x00000190 +#define AOFF_task_start_time 0x00000198 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x00000198 +#define AOFF_task_per_cpu_utime 0x000001a0 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x00000398 +#define AOFF_task_min_flt 0x000003a0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003a0 +#define AOFF_task_maj_flt 0x000003a8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003a8 +#define AOFF_task_nswap 0x000003b0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003b0 +#define AOFF_task_cmin_flt 0x000003b8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003b8 +#define AOFF_task_cmaj_flt 0x000003c0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003c0 +#define AOFF_task_cnswap 0x000003c8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003cc +#define AOFF_task_uid 0x000003d4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003d0 +#define AOFF_task_euid 0x000003d8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003d4 +#define AOFF_task_suid 0x000003dc #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000003d8 +#define AOFF_task_fsuid 0x000003e0 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000003dc +#define AOFF_task_gid 0x000003e4 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000003e0 +#define AOFF_task_egid 0x000003e8 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000003e4 +#define AOFF_task_sgid 0x000003ec #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000003e8 +#define AOFF_task_fsgid 0x000003f0 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000003ec +#define AOFF_task_ngroups 0x000003f4 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x000003f0 +#define AOFF_task_groups 0x000003f8 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000470 +#define AOFF_task_cap_effective 0x00000478 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000474 +#define AOFF_task_cap_inheritable 0x0000047c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000478 +#define AOFF_task_cap_permitted 0x00000480 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000480 +#define AOFF_task_user 0x00000488 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000488 +#define AOFF_task_rlim 0x00000490 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000528 +#define AOFF_task_used_math 0x00000530 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000052a +#define AOFF_task_comm 0x00000532 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000053c +#define AOFF_task_link_count 0x00000544 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000540 +#define AOFF_task_tty 0x00000548 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000548 +#define AOFF_task_semundo 0x00000550 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000550 +#define AOFF_task_semsleeping 0x00000558 #define ASIZ_task_semsleeping 0x00000008 #define AOFF_task_tss 0x00000560 #define ASIZ_task_tss 0x00000470 @@ -620,147 +624,149 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000028 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000030 +#define AOFF_task_ptrace 0x00000030 +#define ASIZ_task_ptrace 0x00000008 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000038 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000040 +#define AOFF_task_avg_slice 0x00000048 #define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000048 +#define AOFF_task_has_cpu 0x00000050 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x0000004c +#define AOFF_task_processor 0x00000054 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000050 +#define AOFF_task_last_processor 0x00000058 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000054 +#define AOFF_task_lock_depth 0x0000005c #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000058 +#define AOFF_task_next_task 0x00000060 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000060 +#define AOFF_task_prev_task 0x00000068 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_next_run 0x00000068 +#define AOFF_task_next_run 0x00000070 #define ASIZ_task_next_run 0x00000008 -#define AOFF_task_prev_run 0x00000070 +#define AOFF_task_prev_run 0x00000078 #define ASIZ_task_prev_run 0x00000008 -#define AOFF_task_task_exclusive 0x00000078 +#define AOFF_task_task_exclusive 0x00000080 #define ASIZ_task_task_exclusive 0x00000004 -#define AOFF_task_binfmt 0x00000080 +#define AOFF_task_binfmt 0x00000088 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000088 +#define AOFF_task_exit_code 0x00000090 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000008c +#define AOFF_task_exit_signal 0x00000094 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000090 +#define AOFF_task_pdeath_signal 0x00000098 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000098 +#define AOFF_task_personality 0x000000a0 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x000000a4 +#define AOFF_task_pid 0x000000ac #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x000000a8 +#define AOFF_task_pgrp 0x000000b0 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x000000ac +#define AOFF_task_tty_old_pgrp 0x000000b4 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000b0 +#define AOFF_task_session 0x000000b8 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000b4 +#define AOFF_task_leader 0x000000bc #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000b8 +#define AOFF_task_p_opptr 0x000000c0 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000c0 +#define AOFF_task_p_pptr 0x000000c8 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000c8 +#define AOFF_task_p_cptr 0x000000d0 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000d0 +#define AOFF_task_p_ysptr 0x000000d8 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000d8 +#define AOFF_task_p_osptr 0x000000e0 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000e0 +#define AOFF_task_pidhash_next 0x000000e8 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000e8 +#define AOFF_task_pidhash_pprev 0x000000f0 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_tarray_ptr 0x000000f0 +#define AOFF_task_tarray_ptr 0x000000f8 #define ASIZ_task_tarray_ptr 0x00000008 -#define AOFF_task_wait_chldexit 0x000000f8 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000008 -#define AOFF_task_vfork_sem 0x00000100 +#define AOFF_task_vfork_sem 0x00000108 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000108 +#define AOFF_task_policy 0x00000110 #define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000110 +#define AOFF_task_rt_priority 0x00000118 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000118 +#define AOFF_task_it_real_value 0x00000120 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000120 +#define AOFF_task_it_prof_value 0x00000128 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000128 +#define AOFF_task_it_virt_value 0x00000130 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000130 +#define AOFF_task_it_real_incr 0x00000138 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000138 +#define AOFF_task_it_prof_incr 0x00000140 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000140 +#define AOFF_task_it_virt_incr 0x00000148 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000148 +#define AOFF_task_real_timer 0x00000150 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000170 +#define AOFF_task_times 0x00000178 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x00000190 +#define AOFF_task_start_time 0x00000198 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x00000198 +#define AOFF_task_per_cpu_utime 0x000001a0 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x00000398 +#define AOFF_task_min_flt 0x000003a0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003a0 +#define AOFF_task_maj_flt 0x000003a8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003a8 +#define AOFF_task_nswap 0x000003b0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003b0 +#define AOFF_task_cmin_flt 0x000003b8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003b8 +#define AOFF_task_cmaj_flt 0x000003c0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003c0 +#define AOFF_task_cnswap 0x000003c8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003cc +#define AOFF_task_uid 0x000003d4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003d0 +#define AOFF_task_euid 0x000003d8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003d4 +#define AOFF_task_suid 0x000003dc #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000003d8 +#define AOFF_task_fsuid 0x000003e0 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000003dc +#define AOFF_task_gid 0x000003e4 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000003e0 +#define AOFF_task_egid 0x000003e8 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000003e4 +#define AOFF_task_sgid 0x000003ec #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000003e8 +#define AOFF_task_fsgid 0x000003f0 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000003ec +#define AOFF_task_ngroups 0x000003f4 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x000003f0 +#define AOFF_task_groups 0x000003f8 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000470 +#define AOFF_task_cap_effective 0x00000478 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000474 +#define AOFF_task_cap_inheritable 0x0000047c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000478 +#define AOFF_task_cap_permitted 0x00000480 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000480 +#define AOFF_task_user 0x00000488 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000488 +#define AOFF_task_rlim 0x00000490 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000528 +#define AOFF_task_used_math 0x00000530 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000052a +#define AOFF_task_comm 0x00000532 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000053c +#define AOFF_task_link_count 0x00000544 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000540 +#define AOFF_task_tty 0x00000548 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000548 +#define AOFF_task_semundo 0x00000550 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000550 +#define AOFF_task_semsleeping 0x00000558 #define ASIZ_task_semsleeping 0x00000008 #define AOFF_task_tss 0x00000560 #define ASIZ_task_tss 0x00000470 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/bitops.h linux.20p9/include/asm-sparc64/bitops.h --- linux.vanilla/include/asm-sparc64/bitops.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-sparc64/bitops.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.26.2.1 2000/08/10 23:50:04 davem Exp $ +/* $Id: bitops.h,v 1.26.2.2 2001/06/07 06:19:33 davem Exp $ * bitops.h: Bit string operations on the V9. * * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -20,7 +20,7 @@ * all bit-ops return 0 if bit was previously clear and != 0 otherwise. */ -extern __inline__ unsigned long test_and_set_bit(unsigned long nr, void *addr) +extern __inline__ unsigned long test_and_set_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); unsigned long oldbit; @@ -41,7 +41,7 @@ return oldbit != 0; } -extern __inline__ void set_bit(unsigned long nr, void *addr) +extern __inline__ void set_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); @@ -60,7 +60,7 @@ : "g5", "g7", "cc", "memory"); } -extern __inline__ unsigned long test_and_clear_bit(unsigned long nr, void *addr) +extern __inline__ unsigned long test_and_clear_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); unsigned long oldbit; @@ -81,7 +81,7 @@ return oldbit != 0; } -extern __inline__ void clear_bit(unsigned long nr, void *addr) +extern __inline__ void clear_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); @@ -100,7 +100,7 @@ : "g5", "g7", "cc", "memory"); } -extern __inline__ unsigned long test_and_change_bit(unsigned long nr, void *addr) +extern __inline__ unsigned long test_and_change_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); unsigned long oldbit; @@ -119,7 +119,7 @@ return oldbit != 0; } -extern __inline__ void change_bit(unsigned long nr, void *addr) +extern __inline__ void change_bit(unsigned long nr, volatile void *addr) { unsigned long * m = ((unsigned long *) addr) + (nr >> 6); @@ -135,7 +135,7 @@ : "g5", "g7", "cc", "memory"); } -extern __inline__ unsigned long test_bit(int nr, __const__ void *addr) +extern __inline__ unsigned long test_bit(int nr, __const__ volatile void *addr) { return 1UL & (((__const__ long *) addr)[nr >> 6] >> (nr & 63)); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/pbm.h linux.20p9/include/asm-sparc64/pbm.h --- linux.vanilla/include/asm-sparc64/pbm.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-sparc64/pbm.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: pbm.h,v 1.16.2.1 2000/06/14 07:41:19 davem Exp $ +/* $Id: pbm.h,v 1.16.2.2 2001/05/16 07:28:43 davem Exp $ * pbm.h: U2P PCI bus module pseudo driver software state. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -64,6 +64,7 @@ unsigned long *pci_mem_space; u32 upa_portid; int index; + int pbms_same_domain; struct linux_pbm_info pbm_A; struct linux_pbm_info pbm_B; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/pci.h linux.20p9/include/asm-sparc64/pci.h --- linux.vanilla/include/asm-sparc64/pci.h Thu Jan 1 01:00:00 1970 +++ linux.20p9/include/asm-sparc64/pci.h Wed Jul 4 16:04:00 2001 @@ -0,0 +1,19 @@ +#ifndef _SPARC64_PCI_H +#define _SPARC64_PCI_H + +#include +#include + +/* Return the index of the PCI controller for device PDEV. */ + +extern int pci_controller_num(struct pci_dev *pdev); + +/* Platform support for /proc/bus/pci/X/Y mmap()s. */ + +#define HAVE_PCI_MMAP + +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, + int write_combine); + +#endif /* !(_SPARC64_PCI_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/sab82532.h linux.20p9/include/asm-sparc64/sab82532.h --- linux.vanilla/include/asm-sparc64/sab82532.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-sparc64/sab82532.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: sab82532.h,v 1.4 1998/10/25 23:04:29 ecd Exp $ +/* $Id: sab82532.h,v 1.4.2.1 2001/05/28 23:13:36 ecd Exp $ * sab82532.h: Register Definitions for the Siemens SAB82532 DUSCC * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -148,7 +148,7 @@ int close_delay; unsigned short closing_wait; unsigned short closing_wait2; - int all_sent; + unsigned long irqflags; int is_console; unsigned char interrupt_mask0; unsigned char interrupt_mask1; @@ -180,6 +180,10 @@ struct sab82532 *prev; }; +/* irqflags bits */ +#define SAB82532_ALLS 0x00000001 +#define SAB82532_XPR 0x00000002 + /* RFIFO Status Byte */ #define SAB82532_RSTAT_PE 0x80 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/smp.h linux.20p9/include/asm-sparc64/smp.h --- linux.vanilla/include/asm-sparc64/smp.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-sparc64/smp.h Wed Jul 4 16:04:00 2001 @@ -38,7 +38,7 @@ unsigned int multiplier; unsigned int counter; unsigned int idle_volume; - unsigned int __pad; + unsigned int clock_tick; /* %tick's per second */ unsigned long udelay_val; /* Dcache line 2 */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/ttable.h linux.20p9/include/asm-sparc64/ttable.h --- linux.vanilla/include/asm-sparc64/ttable.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/asm-sparc64/ttable.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: ttable.h,v 1.11.2.3 1999/10/07 20:48:25 davem Exp $ */ +/* $Id: ttable.h,v 1.11.2.5 2001/03/28 11:24:15 davem Exp $ */ #ifndef _SPARC64_TTABLE_H #define _SPARC64_TTABLE_H @@ -54,12 +54,22 @@ clr %l6; \ nop; + /* The grotty trick to save %g1 into current->thread.kernel_cntd0 + * is because when we take this trap we could be interrupting trap + * code already using the trap alternate global registers. It is + * better to corrupt a performance counter than corrupt trap register + * state. We cross our fingers and pray that this store/load does + * not cause yet another CEE trap. + */ #define TRAPTL1_CEE \ + membar #Sync; \ + stx %g1, [%g6 + AOFF_task_tss + AOFF_thread_kernel_cntd0]; \ ldxa [%g0] ASI_AFSR, %g1; \ membar #Sync; \ stxa %g1, [%g0] ASI_AFSR; \ membar #Sync; \ - retry; nop; nop; nop; + ldx [%g6 + AOFF_task_tss + AOFF_thread_kernel_cntd0], %g1; \ + retry; #define TRAP_ARG(routine, arg) \ sethi %hi(109f), %g7; \ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/asm-sparc64/uaccess.h linux.20p9/include/asm-sparc64/uaccess.h --- linux.vanilla/include/asm-sparc64/uaccess.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/asm-sparc64/uaccess.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: uaccess.h,v 1.29.2.1 1999/09/10 09:54:38 davem Exp $ */ +/* $Id: uaccess.h,v 1.29.2.2 2001/03/01 00:49:03 davem Exp $ */ #ifndef _ASM_UACCESS_H #define _ASM_UACCESS_H diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/agp_backend.h linux.20p9/include/linux/agp_backend.h --- linux.vanilla/include/linux/agp_backend.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/agp_backend.h Thu Jul 26 18:04:40 2001 @@ -58,7 +58,16 @@ AMD_GENERIC, AMD_IRONGATE, ALI_M1541, - ALI_GENERIC + ALI_M1621, + ALI_M1631, + ALI_M1632, + ALI_M1641, + ALI_M1647, + ALI_M1651, + ALI_GENERIC, + SVWRKS_HE, + SVWRKS_LE, + SVWRKS_GENERIC }; typedef struct _agp_version { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/b1lli.h linux.20p9/include/linux/b1lli.h --- linux.vanilla/include/linux/b1lli.h Sun Mar 25 17:31:04 2001 +++ linux.20p9/include/linux/b1lli.h Wed Jul 4 16:04:00 2001 @@ -1,75 +1,10 @@ /* - * $Id: b1lli.h,v 1.8 1999/07/01 15:26:54 calle Exp $ + * $Id: b1lli.h,v 1.8.8.2 2001/05/17 20:41:52 kai Exp $ * * ISDN lowlevel-module for AVM B1-card. * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1lli.h,v $ - * Revision 1.8 1999/07/01 15:26:54 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * - * Revision 1.7 1999/06/21 15:24:25 calle - * extend information in /proc. - * - * Revision 1.6 1999/04/15 19:49:36 calle - * fix fuer die B1-PCI. Jetzt geht z.B. auch IRQ 17 ... - * - * Revision 1.5 1998/10/25 14:50:28 fritz - * Backported from MIPS (Cobalt). - * - * Revision 1.4 1998/03/29 16:05:02 calle - * changes from 2.0 tree merged. - * - * Revision 1.1.2.9 1998/03/20 14:30:02 calle - * added cardnr to detect if you try to add same T1 to different io address. - * change number of nccis depending on number of channels. - * - * Revision 1.1.2.8 1998/03/04 17:32:33 calle - * Changes for T1. - * - * Revision 1.1.2.7 1998/02/27 15:38:29 calle - * T1 running with slow link. - * - * Revision 1.1.2.6 1998/02/24 17:57:36 calle - * changes for T1. - * - * Revision 1.3 1998/01/31 10:54:37 calle - * include changes for PCMCIA cards from 2.0 version - * - * Revision 1.2 1997/12/10 19:38:42 calle - * get changes from 2.0 tree - * - * Revision 1.1.2.2 1997/11/26 16:57:26 calle - * more changes for B1/M1/T1. - * - * Revision 1.1.2.1 1997/11/26 10:47:01 calle - * prepared for M1 (Mobile) and T1 (PMX) cards. - * prepared to set configuration after load to support other D-channel - * protocols, point-to-point and leased lines. - * - * Revision 1.1 1997/03/04 21:27:32 calle - * First 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 _B1LLI_H_ @@ -129,7 +64,7 @@ #define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */ #define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */ #define AVMB1_GET_CARDINFO 5 /* get cardtype */ -#define AVMB1_REMOVECARD 6 /* remove a card (usefull for T1) */ +#define AVMB1_REMOVECARD 6 /* remove a card (useful for T1) */ #define AVMB1_REGISTERCARD_IS_OBSOLETE diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/b1pcmcia.h linux.20p9/include/linux/b1pcmcia.h --- linux.vanilla/include/linux/b1pcmcia.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/b1pcmcia.h Wed Jul 4 16:04:00 2001 @@ -1,28 +1,11 @@ /* - * $Id: b1pcmcia.h,v 1.1 1999/07/01 15:26:56 calle Exp $ + * $Id: b1pcmcia.h,v 1.1.8.1 2001/05/17 20:41:52 kai Exp $ * * Exported functions of module b1pcmcia to be called by * avm_cs card services module. * * Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * - * $Log: b1pcmcia.h,v $ - * Revision 1.1 1999/07/01 15:26:56 calle - * complete new version (I love it): - * + new hardware independed "capi_driver" interface that will make it easy to: - * - support other controllers with CAPI-2.0 (i.e. USB Controller) - * - write a CAPI-2.0 for the passive cards - * - support serial link CAPI-2.0 boxes. - * + wrote "capi_driver" for all supported cards. - * + "capi_driver" (supported cards) now have to be configured with - * make menuconfig, in the past all supported cards where included - * at once. - * + new and better informations in /proc/capi/ - * + new ioctl to switch trace of capi messages per controller - * using "avmcapictrl trace [contr] on|off|...." - * + complete testcircle with all supported cards and also the - * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. - * */ #ifndef _B1PCMCIA_H_ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/binfmts.h linux.20p9/include/linux/binfmts.h --- linux.vanilla/include/linux/binfmts.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/binfmts.h Thu Jul 26 15:54:14 2001 @@ -32,6 +32,8 @@ int priv_change; }; +struct file; + /* * This structure defines the functions that are used to load the binary formats that * linux accepts. @@ -40,10 +42,13 @@ struct linux_binfmt * next; struct module *module; int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); - int (*load_shlib)(int fd); - int (*core_dump)(long signr, struct pt_regs * regs); + int (*load_shlib)(struct file *file); + int (*core_dump)(long signr, struct pt_regs * regs, struct file *file); + unsigned long min_coredump; }; +extern void set_binfmt(struct linux_binfmt *); +extern int do_coredump(long, struct pt_regs *); extern int register_binfmt(struct linux_binfmt *); extern int unregister_binfmt(struct linux_binfmt *); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/cciss_ioctl.h linux.20p9/include/linux/cciss_ioctl.h --- linux.vanilla/include/linux/cciss_ioctl.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/cciss_ioctl.h Thu Jul 26 17:52:33 2001 @@ -80,25 +80,28 @@ #define CISS_MAX_LUN 16 +#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping +#define LEVEL3LUN 0 + #pragma pack(1) //Command List Structure typedef union _SCSI3Addr_struct { struct { + BYTE Dev; BYTE Bus:6; BYTE Mode:2; // b00 - BYTE Dev; } PeripDev; struct { + BYTE DevLSB; BYTE DevMSB:6; BYTE Mode:2; // b01 - BYTE DevLSB; } LogDev; struct { - BYTE Targ:6; - BYTE Mode:2; // b10 BYTE Dev:5; BYTE Bus:3; + BYTE Targ:6; + BYTE Mode:2; // b10 } LogUnit; } SCSI3Addr_struct; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/concap.h linux.20p9/include/linux/concap.h --- linux.vanilla/include/linux/concap.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/concap.h Wed Aug 8 22:43:42 2001 @@ -5,6 +5,7 @@ #ifdef __KERNEL__ #include #include +#include /* Stuff to support encapsulation protocols genericly. The encapsulation protocol is processed at the uppermost layer of the network interface. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/falc-lh.h linux.20p9/include/linux/falc-lh.h --- linux.vanilla/include/linux/falc-lh.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/falc-lh.h Thu Jan 1 01:00:00 1970 @@ -1,1231 +0,0 @@ -/* - * falc.h Description of the Siemens FALC T1/E1 framer. - * - * Author: Ivan Passos - * - * Copyright: (c) 2000 Cyclades 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. - * - * $Log: falc.h,v $ - * Revision 1.1 2000/05/15 ivan - * Included DJA bits for the LIM2 register. - * - * Revision 1.0 2000/02/22 ivan - * Initial version. - * - */ - -#ifndef _FALC_LH_H -#define _FALC_LH_H - -#define NUM_OF_T1_CHANNELS 24 -#define NUM_OF_E1_CHANNELS 32 - -/*>>>>>>>>>>>>>>>>> FALC Register Bits (Transmit Mode) <<<<<<<<<<<<<<<<<<< */ - -/* CMDR (Command Register) - ---------------- E1 & T1 ------------------------------ */ -#define CMDR_RMC 0x80 -#define CMDR_RRES 0x40 -#define CMDR_XREP 0x20 -#define CMDR_XRES 0x10 -#define CMDR_XHF 0x08 -#define CMDR_XTF 0x04 -#define CMDR_XME 0x02 -#define CMDR_SRES 0x01 - -/* MODE (Mode Register) - ----------------- E1 & T1 ----------------------------- */ -#define MODE_MDS2 0x80 -#define MODE_MDS1 0x40 -#define MODE_MDS0 0x20 -#define MODE_BRAC 0x10 -#define MODE_HRAC 0x08 - -/* IPC (Interrupt Port Configuration) - ----------------- E1 & T1 ----------------------------- */ -#define IPC_VIS 0x80 -#define IPC_SCI 0x04 -#define IPC_IC1 0x02 -#define IPC_IC0 0x01 - -/* CCR1 (Common Configuration Register 1) - ----------------- E1 & T1 ----------------------------- */ -#define CCR1_SFLG 0x80 -#define CCR1_XTS16RA 0x40 -#define CCR1_BRM 0x40 -#define CCR1_CASSYM 0x20 -#define CCR1_EDLX 0x20 -#define CCR1_EITS 0x10 -#define CCR1_ITF 0x08 -#define CCR1_RFT1 0x02 -#define CCR1_RFT0 0x01 - -/* CCR3 (Common Configuration Register 3) - ---------------- E1 & T1 ------------------------------ */ - -#define CCR3_PRE1 0x80 -#define CCR3_PRE0 0x40 -#define CCR3_EPT 0x20 -#define CCR3_RADD 0x10 -#define CCR3_RCRC 0x04 -#define CCR3_XCRC 0x02 - - -/* RTR1-4 (Receive Timeslot Register 1-4) - ---------------- E1 & T1 ------------------------------ */ - -#define RTR1_TS0 0x80 -#define RTR1_TS1 0x40 -#define RTR1_TS2 0x20 -#define RTR1_TS3 0x10 -#define RTR1_TS4 0x08 -#define RTR1_TS5 0x04 -#define RTR1_TS6 0x02 -#define RTR1_TS7 0x01 - -#define RTR2_TS8 0x80 -#define RTR2_TS9 0x40 -#define RTR2_TS10 0x20 -#define RTR2_TS11 0x10 -#define RTR2_TS12 0x08 -#define RTR2_TS13 0x04 -#define RTR2_TS14 0x02 -#define RTR2_TS15 0x01 - -#define RTR3_TS16 0x80 -#define RTR3_TS17 0x40 -#define RTR3_TS18 0x20 -#define RTR3_TS19 0x10 -#define RTR3_TS20 0x08 -#define RTR3_TS21 0x04 -#define RTR3_TS22 0x02 -#define RTR3_TS23 0x01 - -#define RTR4_TS24 0x80 -#define RTR4_TS25 0x40 -#define RTR4_TS26 0x20 -#define RTR4_TS27 0x10 -#define RTR4_TS28 0x08 -#define RTR4_TS29 0x04 -#define RTR4_TS30 0x02 -#define RTR4_TS31 0x01 - - -/* TTR1-4 (Transmit Timeslot Register 1-4) - ---------------- E1 & T1 ------------------------------ */ - -#define TTR1_TS0 0x80 -#define TTR1_TS1 0x40 -#define TTR1_TS2 0x20 -#define TTR1_TS3 0x10 -#define TTR1_TS4 0x08 -#define TTR1_TS5 0x04 -#define TTR1_TS6 0x02 -#define TTR1_TS7 0x01 - -#define TTR2_TS8 0x80 -#define TTR2_TS9 0x40 -#define TTR2_TS10 0x20 -#define TTR2_TS11 0x10 -#define TTR2_TS12 0x08 -#define TTR2_TS13 0x04 -#define TTR2_TS14 0x02 -#define TTR2_TS15 0x01 - -#define TTR3_TS16 0x80 -#define TTR3_TS17 0x40 -#define TTR3_TS18 0x20 -#define TTR3_TS19 0x10 -#define TTR3_TS20 0x08 -#define TTR3_TS21 0x04 -#define TTR3_TS22 0x02 -#define TTR3_TS23 0x01 - -#define TTR4_TS24 0x80 -#define TTR4_TS25 0x40 -#define TTR4_TS26 0x20 -#define TTR4_TS27 0x10 -#define TTR4_TS28 0x08 -#define TTR4_TS29 0x04 -#define TTR4_TS30 0x02 -#define TTR4_TS31 0x01 - - - -/* IMR0-4 (Interrupt Mask Register 0-4) - - ----------------- E1 & T1 ----------------------------- */ - -#define IMR0_RME 0x80 -#define IMR0_RFS 0x40 -#define IMR0_T8MS 0x20 -#define IMR0_ISF 0x20 -#define IMR0_RMB 0x10 -#define IMR0_CASC 0x08 -#define IMR0_RSC 0x08 -#define IMR0_CRC6 0x04 -#define IMR0_CRC4 0x04 -#define IMR0_PDEN 0x02 -#define IMR0_RPF 0x01 - -#define IMR1_CASE 0x80 -#define IMR1_RDO 0x40 -#define IMR1_ALLS 0x20 -#define IMR1_XDU 0x10 -#define IMR1_XMB 0x08 -#define IMR1_XLSC 0x02 -#define IMR1_XPR 0x01 -#define IMR1_LLBSC 0x80 - -#define IMR2_FAR 0x80 -#define IMR2_LFA 0x40 -#define IMR2_MFAR 0x20 -#define IMR2_T400MS 0x10 -#define IMR2_LMFA 0x10 -#define IMR2_AIS 0x08 -#define IMR2_LOS 0x04 -#define IMR2_RAR 0x02 -#define IMR2_RA 0x01 - -#define IMR3_ES 0x80 -#define IMR3_SEC 0x40 -#define IMR3_LMFA16 0x20 -#define IMR3_AIS16 0x10 -#define IMR3_RA16 0x08 -#define IMR3_API 0x04 -#define IMR3_XSLP 0x20 -#define IMR3_XSLN 0x10 -#define IMR3_LLBSC 0x08 -#define IMR3_XRS 0x04 -#define IMR3_SLN 0x02 -#define IMR3_SLP 0x01 - -#define IMR4_LFA 0x80 -#define IMR4_FER 0x40 -#define IMR4_CER 0x20 -#define IMR4_AIS 0x10 -#define IMR4_LOS 0x08 -#define IMR4_CVE 0x04 -#define IMR4_SLIP 0x02 -#define IMR4_EBE 0x01 - -/* FMR0-5 for E1 and T1 (Framer Mode Register ) */ - -#define FMR0_XC1 0x80 -#define FMR0_XC0 0x40 -#define FMR0_RC1 0x20 -#define FMR0_RC0 0x10 -#define FMR0_EXTD 0x08 -#define FMR0_ALM 0x04 -#define E1_FMR0_FRS 0x02 -#define T1_FMR0_FRS 0x08 -#define FMR0_SRAF 0x04 -#define FMR0_EXLS 0x02 -#define FMR0_SIM 0x01 - -#define FMR1_MFCS 0x80 -#define FMR1_AFR 0x40 -#define FMR1_ENSA 0x20 -#define FMR1_CTM 0x80 -#define FMR1_SIGM 0x40 -#define FMR1_EDL 0x20 -#define FMR1_PMOD 0x10 -#define FMR1_XFS 0x08 -#define FMR1_CRC 0x08 -#define FMR1_ECM 0x04 -#define FMR1_IMOD 0x02 -#define FMR1_XAIS 0x01 - -#define FMR2_RFS1 0x80 -#define FMR2_RFS0 0x40 -#define FMR2_MCSP 0x40 -#define FMR2_RTM 0x20 -#define FMR2_SSP 0x20 -#define FMR2_DAIS 0x10 -#define FMR2_SAIS 0x08 -#define FMR2_PLB 0x04 -#define FMR2_AXRA 0x02 -#define FMR2_ALMF 0x01 -#define FMR2_EXZE 0x01 - -#define LOOP_RTM 0x40 -#define LOOP_SFM 0x40 -#define LOOP_ECLB 0x20 -#define LOOP_CLA 0x1f - -/*--------------------- E1 ----------------------------*/ -#define FMR3_XLD 0x20 -#define FMR3_XLU 0x10 - -/*--------------------- T1 ----------------------------*/ -#define FMR4_AIS3 0x80 -#define FMR4_TM 0x40 -#define FMR4_XRA 0x20 -#define FMR4_SSC1 0x10 -#define FMR4_SSC0 0x08 -#define FMR4_AUTO 0x04 -#define FMR4_FM1 0x02 -#define FMR4_FM0 0x01 - -#define FMR5_SRS 0x80 -#define FMR5_EIBR 0x40 -#define FMR5_XLD 0x20 -#define FMR5_XLU 0x10 - - -/* LOOP (Channel Loop Back) - - ------------------ E1 & T1 ---------------------------- */ - -#define LOOP_SFM 0x40 -#define LOOP_ECLB 0x20 -#define LOOP_CLA4 0x10 -#define LOOP_CLA3 0x08 -#define LOOP_CLA2 0x04 -#define LOOP_CLA1 0x02 -#define LOOP_CLA0 0x01 - - - -/* XSW (Transmit Service Word Pulseframe) - - ------------------- E1 --------------------------- */ - -#define XSW_XSIS 0x80 -#define XSW_XRA 0x20 -#define XSW_XY0 0x10 -#define XSW_XY1 0x08 -#define XSW_XY2 0x04 -#define XSW_XY3 0x02 -#define XSW_XY4 0x01 - - -/* XSP (Transmit Spare Bits) - - ------------------- E1 --------------------------- */ - -#define XSP_XAP 0x80 -#define XSP_CASEN 0x40 -#define XSP_TT0 0x20 -#define XSP_EBP 0x10 -#define XSP_AXS 0x08 -#define XSP_XSIF 0x04 -#define XSP_XS13 0x02 -#define XSP_XS15 0x01 - - -/* XC0/1 (Transmit Control 0/1) - ------------------ E1 & T1 ---------------------------- */ - -#define XC0_SA8E 0x80 -#define XC0_SA7E 0x40 -#define XC0_SA6E 0x20 -#define XC0_SA5E 0x10 -#define XC0_SA4E 0x08 -#define XC0_BRM 0x80 -#define XC0_MFBS 0x40 -#define XC0_SFRZ 0x10 -#define XC0_XCO2 0x04 -#define XC0_XCO1 0x02 -#define XC0_XCO0 0x01 - -#define XC1_XTO5 0x20 -#define XC1_XTO4 0x10 -#define XC1_XTO3 0x08 -#define XC1_XTO2 0x04 -#define XC1_XTO1 0x02 -#define XC1_XTO0 0x01 - - -/* RC0/1 (Receive Control 0/1) - ------------------ E1 & T1 ---------------------------- */ - -#define RC0_SICS 0x40 -#define RC0_CRCI 0x20 -#define RC0_XCRCI 0x10 -#define RC0_RDIS 0x08 -#define RC0_RCO2 0x04 -#define RC0_RCO1 0x02 -#define RC0_RCO0 0x01 - -#define RC1_SWD 0x80 -#define RC1_ASY4 0x40 -#define RC1_RRAM 0x40 -#define RC1_RTO5 0x20 -#define RC1_RTO4 0x10 -#define RC1_RTO3 0x08 -#define RC1_RTO2 0x04 -#define RC1_RTO1 0x02 -#define RC1_RTO0 0x01 - - - -/* XPM0-2 (Transmit Pulse Mask 0-2) - --------------------- E1 & T1 ------------------------- */ - -#define XPM0_XP12 0x80 -#define XPM0_XP11 0x40 -#define XPM0_XP10 0x20 -#define XPM0_XP04 0x10 -#define XPM0_XP03 0x08 -#define XPM0_XP02 0x04 -#define XPM0_XP01 0x02 -#define XPM0_XP00 0x01 - -#define XPM1_XP30 0x80 -#define XPM1_XP24 0x40 -#define XPM1_XP23 0x20 -#define XPM1_XP22 0x10 -#define XPM1_XP21 0x08 -#define XPM1_XP20 0x04 -#define XPM1_XP14 0x02 -#define XPM1_XP13 0x01 - -#define XPM2_XLHP 0x80 -#define XPM2_XLT 0x40 -#define XPM2_DAXLT 0x20 -#define XPM2_XP34 0x08 -#define XPM2_XP33 0x04 -#define XPM2_XP32 0x02 -#define XPM2_XP31 0x01 - - -/* TSWM (Transparent Service Word Mask) - ------------------ E1 ---------------------------- */ - -#define TSWM_TSIS 0x80 -#define TSWM_TSIF 0x40 -#define TSWM_TRA 0x20 -#define TSWM_TSA4 0x10 -#define TSWM_TSA5 0x08 -#define TSWM_TSA6 0x04 -#define TSWM_TSA7 0x02 -#define TSWM_TSA8 0x01 - -/* IDLE - - ------------------ E1 & T1 ----------------------- */ - -#define IDLE_IDL7 0x80 -#define IDLE_IDL6 0x40 -#define IDLE_IDL5 0x20 -#define IDLE_IDL4 0x10 -#define IDLE_IDL3 0x08 -#define IDLE_IDL2 0x04 -#define IDLE_IDL1 0x02 -#define IDLE_IDL0 0x01 - - -/* XSA4-8 - -------------------E1 ----------------------------- */ - -#define XSA4_XS47 0x80 -#define XSA4_XS46 0x40 -#define XSA4_XS45 0x20 -#define XSA4_XS44 0x10 -#define XSA4_XS43 0x08 -#define XSA4_XS42 0x04 -#define XSA4_XS41 0x02 -#define XSA4_XS40 0x01 - -#define XSA5_XS57 0x80 -#define XSA5_XS56 0x40 -#define XSA5_XS55 0x20 -#define XSA5_XS54 0x10 -#define XSA5_XS53 0x08 -#define XSA5_XS52 0x04 -#define XSA5_XS51 0x02 -#define XSA5_XS50 0x01 - -#define XSA6_XS67 0x80 -#define XSA6_XS66 0x40 -#define XSA6_XS65 0x20 -#define XSA6_XS64 0x10 -#define XSA6_XS63 0x08 -#define XSA6_XS62 0x04 -#define XSA6_XS61 0x02 -#define XSA6_XS60 0x01 - -#define XSA7_XS77 0x80 -#define XSA7_XS76 0x40 -#define XSA7_XS75 0x20 -#define XSA7_XS74 0x10 -#define XSA7_XS73 0x08 -#define XSA7_XS72 0x04 -#define XSA7_XS71 0x02 -#define XSA7_XS70 0x01 - -#define XSA8_XS87 0x80 -#define XSA8_XS86 0x40 -#define XSA8_XS85 0x20 -#define XSA8_XS84 0x10 -#define XSA8_XS83 0x08 -#define XSA8_XS82 0x04 -#define XSA8_XS81 0x02 -#define XSA8_XS80 0x01 - - -/* XDL1-3 (Transmit DL-Bit Register1-3 (read/write)) - ----------------------- T1 --------------------- */ - -#define XDL1_XDL17 0x80 -#define XDL1_XDL16 0x40 -#define XDL1_XDL15 0x20 -#define XDL1_XDL14 0x10 -#define XDL1_XDL13 0x08 -#define XDL1_XDL12 0x04 -#define XDL1_XDL11 0x02 -#define XDL1_XDL10 0x01 - -#define XDL2_XDL27 0x80 -#define XDL2_XDL26 0x40 -#define XDL2_XDL25 0x20 -#define XDL2_XDL24 0x10 -#define XDL2_XDL23 0x08 -#define XDL2_XDL22 0x04 -#define XDL2_XDL21 0x02 -#define XDL2_XDL20 0x01 - -#define XDL3_XDL37 0x80 -#define XDL3_XDL36 0x40 -#define XDL3_XDL35 0x20 -#define XDL3_XDL34 0x10 -#define XDL3_XDL33 0x08 -#define XDL3_XDL32 0x04 -#define XDL3_XDL31 0x02 -#define XDL3_XDL30 0x01 - - -/* ICB1-4 (Idle Channel Register 1-4) - ------------------ E1 ---------------------------- */ - -#define E1_ICB1_IC0 0x80 -#define E1_ICB1_IC1 0x40 -#define E1_ICB1_IC2 0x20 -#define E1_ICB1_IC3 0x10 -#define E1_ICB1_IC4 0x08 -#define E1_ICB1_IC5 0x04 -#define E1_ICB1_IC6 0x02 -#define E1_ICB1_IC7 0x01 - -#define E1_ICB2_IC8 0x80 -#define E1_ICB2_IC9 0x40 -#define E1_ICB2_IC10 0x20 -#define E1_ICB2_IC11 0x10 -#define E1_ICB2_IC12 0x08 -#define E1_ICB2_IC13 0x04 -#define E1_ICB2_IC14 0x02 -#define E1_ICB2_IC15 0x01 - -#define E1_ICB3_IC16 0x80 -#define E1_ICB3_IC17 0x40 -#define E1_ICB3_IC18 0x20 -#define E1_ICB3_IC19 0x10 -#define E1_ICB3_IC20 0x08 -#define E1_ICB3_IC21 0x04 -#define E1_ICB3_IC22 0x02 -#define E1_ICB3_IC23 0x01 - -#define E1_ICB4_IC24 0x80 -#define E1_ICB4_IC25 0x40 -#define E1_ICB4_IC26 0x20 -#define E1_ICB4_IC27 0x10 -#define E1_ICB4_IC28 0x08 -#define E1_ICB4_IC29 0x04 -#define E1_ICB4_IC30 0x02 -#define E1_ICB4_IC31 0x01 - -/* ICB1-4 (Idle Channel Register 1-4) - ------------------ T1 ---------------------------- */ - -#define T1_ICB1_IC1 0x80 -#define T1_ICB1_IC2 0x40 -#define T1_ICB1_IC3 0x20 -#define T1_ICB1_IC4 0x10 -#define T1_ICB1_IC5 0x08 -#define T1_ICB1_IC6 0x04 -#define T1_ICB1_IC7 0x02 -#define T1_ICB1_IC8 0x01 - -#define T1_ICB2_IC9 0x80 -#define T1_ICB2_IC10 0x40 -#define T1_ICB2_IC11 0x20 -#define T1_ICB2_IC12 0x10 -#define T1_ICB2_IC13 0x08 -#define T1_ICB2_IC14 0x04 -#define T1_ICB2_IC15 0x02 -#define T1_ICB2_IC16 0x01 - -#define T1_ICB3_IC17 0x80 -#define T1_ICB3_IC18 0x40 -#define T1_ICB3_IC19 0x20 -#define T1_ICB3_IC20 0x10 -#define T1_ICB3_IC21 0x08 -#define T1_ICB3_IC22 0x04 -#define T1_ICB3_IC23 0x02 -#define T1_ICB3_IC24 0x01 - -/* FMR3 (Framer Mode Register 3) - --------------------E1------------------------ */ - -#define FMR3_CMI 0x08 -#define FMR3_SYNSA 0x04 -#define FMR3_CFRZ 0x02 -#define FMR3_EXTIW 0x01 - - - -/* CCB1-3 (Clear Channel Register) - ------------------- T1 ----------------------- */ - -#define CCB1_CH1 0x80 -#define CCB1_CH2 0x40 -#define CCB1_CH3 0x20 -#define CCB1_CH4 0x10 -#define CCB1_CH5 0x08 -#define CCB1_CH6 0x04 -#define CCB1_CH7 0x02 -#define CCB1_CH8 0x01 - -#define CCB2_CH9 0x80 -#define CCB2_CH10 0x40 -#define CCB2_CH11 0x20 -#define CCB2_CH12 0x10 -#define CCB2_CH13 0x08 -#define CCB2_CH14 0x04 -#define CCB2_CH15 0x02 -#define CCB2_CH16 0x01 - -#define CCB3_CH17 0x80 -#define CCB3_CH18 0x40 -#define CCB3_CH19 0x20 -#define CCB3_CH20 0x10 -#define CCB3_CH21 0x08 -#define CCB3_CH22 0x04 -#define CCB3_CH23 0x02 -#define CCB3_CH24 0x01 - - -/* LIM0/1 (Line Interface Mode 0/1) - ------------------- E1 & T1 --------------------------- */ - -#define LIM0_XFB 0x80 -#define LIM0_XDOS 0x40 -#define LIM0_SCL1 0x20 -#define LIM0_SCL0 0x10 -#define LIM0_EQON 0x08 -#define LIM0_ELOS 0x04 -#define LIM0_LL 0x02 -#define LIM0_MAS 0x01 - -#define LIM1_EFSC 0x80 -#define LIM1_RIL2 0x40 -#define LIM1_RIL1 0x20 -#define LIM1_RIL0 0x10 -#define LIM1_DCOC 0x08 -#define LIM1_JATT 0x04 -#define LIM1_RL 0x02 -#define LIM1_DRS 0x01 - - -/* PCDR (Pulse Count Detection Register(Read/Write)) - ------------------ E1 & T1 ------------------------- */ - -#define PCDR_PCD7 0x80 -#define PCDR_PCD6 0x40 -#define PCDR_PCD5 0x20 -#define PCDR_PCD4 0x10 -#define PCDR_PCD3 0x08 -#define PCDR_PCD2 0x04 -#define PCDR_PCD1 0x02 -#define PCDR_PCD0 0x01 - -#define PCRR_PCR7 0x80 -#define PCRR_PCR6 0x40 -#define PCRR_PCR5 0x20 -#define PCRR_PCR4 0x10 -#define PCRR_PCR3 0x08 -#define PCRR_PCR2 0x04 -#define PCRR_PCR1 0x02 -#define PCRR_PCR0 0x01 - - -/* LIM2 (Line Interface Mode 2) - - ------------------ E1 & T1 ---------------------------- */ - -#define LIM2_DJA2 0x20 -#define LIM2_DJA1 0x10 -#define LIM2_LOS2 0x02 -#define LIM2_LOS1 0x01 - -/* LCR1 (Loop Code Register 1) */ - -#define LCR1_EPRM 0x80 -#define LCR1_XPRBS 0x40 - -/* SIC1 (System Interface Control 1) */ -#define SIC1_SRSC 0x80 -#define SIC1_RBS1 0x20 -#define SIC1_RBS0 0x10 -#define SIC1_SXSC 0x08 -#define SIC1_XBS1 0x02 -#define SIC1_XBS0 0x01 - -/* DEC (Disable Error Counter) - ------------------ E1 & T1 ---------------------------- */ - -#define DEC_DCEC3 0x20 -#define DEC_DBEC 0x10 -#define DEC_DCEC1 0x08 -#define DEC_DCEC 0x08 -#define DEC_DEBC 0x04 -#define DEC_DCVC 0x02 -#define DEC_DFEC 0x01 - - -/* FALC Register Bits (Receive Mode) - ---------------------------------------------------------------------------- */ - - -/* FRS0/1 (Framer Receive Status Register 0/1) - ----------------- E1 & T1 ---------------------------------- */ - -#define FRS0_LOS 0x80 -#define FRS0_AIS 0x40 -#define FRS0_LFA 0x20 -#define FRS0_RRA 0x10 -#define FRS0_API 0x08 -#define FRS0_NMF 0x04 -#define FRS0_LMFA 0x02 -#define FRS0_FSRF 0x01 - -#define FRS1_TS16RA 0x40 -#define FRS1_TS16LOS 0x20 -#define FRS1_TS16AIS 0x10 -#define FRS1_TS16LFA 0x08 -#define FRS1_EXZD 0x80 -#define FRS1_LLBDD 0x10 -#define FRS1_LLBAD 0x08 -#define FRS1_XLS 0x02 -#define FRS1_XLO 0x01 -#define FRS1_PDEN 0x40 - -/* FRS2/3 (Framer Receive Status Register 2/3) - ----------------- T1 ---------------------------------- */ - -#define FRS2_ESC2 0x80 -#define FRS2_ESC1 0x40 -#define FRS2_ESC0 0x20 - -#define FRS3_FEH5 0x20 -#define FRS3_FEH4 0x10 -#define FRS3_FEH3 0x08 -#define FRS3_FEH2 0x04 -#define FRS3_FEH1 0x02 -#define FRS3_FEH0 0x01 - - -/* RSW (Receive Service Word Pulseframe) - ----------------- E1 ------------------------------ */ - -#define RSW_RSI 0x80 -#define RSW_RRA 0x20 -#define RSW_RYO 0x10 -#define RSW_RY1 0x08 -#define RSW_RY2 0x04 -#define RSW_RY3 0x02 -#define RSW_RY4 0x01 - - -/* RSP (Receive Spare Bits / Additional Status) - ---------------- E1 ------------------------------- */ - -#define RSP_SI1 0x80 -#define RSP_SI2 0x40 -#define RSP_LLBDD 0x10 -#define RSP_LLBAD 0x08 -#define RSP_RSIF 0x04 -#define RSP_RS13 0x02 -#define RSP_RS15 0x01 - - -/* FECL (Framing Error Counter) - ---------------- E1 & T1 -------------------------- */ - -#define FECL_FE7 0x80 -#define FECL_FE6 0x40 -#define FECL_FE5 0x20 -#define FECL_FE4 0x10 -#define FECL_FE3 0x08 -#define FECL_FE2 0x04 -#define FECL_FE1 0x02 -#define FECL_FE0 0x01 - -#define FECH_FE15 0x80 -#define FECH_FE14 0x40 -#define FECH_FE13 0x20 -#define FECH_FE12 0x10 -#define FECH_FE11 0x08 -#define FECH_FE10 0x04 -#define FECH_FE9 0x02 -#define FECH_FE8 0x01 - - -/* CVCl (Code Violation Counter) - ----------------- E1 ------------------------- */ - -#define CVCL_CV7 0x80 -#define CVCL_CV6 0x40 -#define CVCL_CV5 0x20 -#define CVCL_CV4 0x10 -#define CVCL_CV3 0x08 -#define CVCL_CV2 0x04 -#define CVCL_CV1 0x02 -#define CVCL_CV0 0x01 - -#define CVCH_CV15 0x80 -#define CVCH_CV14 0x40 -#define CVCH_CV13 0x20 -#define CVCH_CV12 0x10 -#define CVCH_CV11 0x08 -#define CVCH_CV10 0x04 -#define CVCH_CV9 0x02 -#define CVCH_CV8 0x01 - - -/* CEC1-3L (CRC Error Counter) - ------------------ E1 ----------------------------- */ - -#define CEC1L_CR7 0x80 -#define CEC1L_CR6 0x40 -#define CEC1L_CR5 0x20 -#define CEC1L_CR4 0x10 -#define CEC1L_CR3 0x08 -#define CEC1L_CR2 0x04 -#define CEC1L_CR1 0x02 -#define CEC1L_CR0 0x01 - -#define CEC1H_CR15 0x80 -#define CEC1H_CR14 0x40 -#define CEC1H_CR13 0x20 -#define CEC1H_CR12 0x10 -#define CEC1H_CR11 0x08 -#define CEC1H_CR10 0x04 -#define CEC1H_CR9 0x02 -#define CEC1H_CR8 0x01 - -#define CEC2L_CR7 0x80 -#define CEC2L_CR6 0x40 -#define CEC2L_CR5 0x20 -#define CEC2L_CR4 0x10 -#define CEC2L_CR3 0x08 -#define CEC2L_CR2 0x04 -#define CEC2L_CR1 0x02 -#define CEC2L_CR0 0x01 - -#define CEC2H_CR15 0x80 -#define CEC2H_CR14 0x40 -#define CEC2H_CR13 0x20 -#define CEC2H_CR12 0x10 -#define CEC2H_CR11 0x08 -#define CEC2H_CR10 0x04 -#define CEC2H_CR9 0x02 -#define CEC2H_CR8 0x01 - -#define CEC3L_CR7 0x80 -#define CEC3L_CR6 0x40 -#define CEC3L_CR5 0x20 -#define CEC3L_CR4 0x10 -#define CEC3L_CR3 0x08 -#define CEC3L_CR2 0x04 -#define CEC3L_CR1 0x02 -#define CEC3L_CR0 0x01 - -#define CEC3H_CR15 0x80 -#define CEC3H_CR14 0x40 -#define CEC3H_CR13 0x20 -#define CEC3H_CR12 0x10 -#define CEC3H_CR11 0x08 -#define CEC3H_CR10 0x04 -#define CEC3H_CR9 0x02 -#define CEC3H_CR8 0x01 - - -/* CECL (CRC Error Counter) - - ------------------ T1 ----------------------------- */ - -#define CECL_CR7 0x80 -#define CECL_CR6 0x40 -#define CECL_CR5 0x20 -#define CECL_CR4 0x10 -#define CECL_CR3 0x08 -#define CECL_CR2 0x04 -#define CECL_CR1 0x02 -#define CECL_CR0 0x01 - -#define CECH_CR15 0x80 -#define CECH_CR14 0x40 -#define CECH_CR13 0x20 -#define CECH_CR12 0x10 -#define CECH_CR11 0x08 -#define CECH_CR10 0x04 -#define CECH_CR9 0x02 -#define CECH_CR8 0x01 - -/* EBCL (E Bit Error Counter) - ------------------- E1 & T1 ------------------------- */ - -#define EBCL_EB7 0x80 -#define EBCL_EB6 0x40 -#define EBCL_EB5 0x20 -#define EBCL_EB4 0x10 -#define EBCL_EB3 0x08 -#define EBCL_EB2 0x04 -#define EBCL_EB1 0x02 -#define EBCL_EB0 0x01 - -#define EBCH_EB15 0x80 -#define EBCH_EB14 0x40 -#define EBCH_EB13 0x20 -#define EBCH_EB12 0x10 -#define EBCH_EB11 0x08 -#define EBCH_EB10 0x04 -#define EBCH_EB9 0x02 -#define EBCH_EB8 0x01 - - -/* RSA4-8 (Receive Sa4-8-Bit Register) - -------------------- E1 --------------------------- */ - -#define RSA4_RS47 0x80 -#define RSA4_RS46 0x40 -#define RSA4_RS45 0x20 -#define RSA4_RS44 0x10 -#define RSA4_RS43 0x08 -#define RSA4_RS42 0x04 -#define RSA4_RS41 0x02 -#define RSA4_RS40 0x01 - -#define RSA5_RS57 0x80 -#define RSA5_RS56 0x40 -#define RSA5_RS55 0x20 -#define RSA5_RS54 0x10 -#define RSA5_RS53 0x08 -#define RSA5_RS52 0x04 -#define RSA5_RS51 0x02 -#define RSA5_RS50 0x01 - -#define RSA6_RS67 0x80 -#define RSA6_RS66 0x40 -#define RSA6_RS65 0x20 -#define RSA6_RS64 0x10 -#define RSA6_RS63 0x08 -#define RSA6_RS62 0x04 -#define RSA6_RS61 0x02 -#define RSA6_RS60 0x01 - -#define RSA7_RS77 0x80 -#define RSA7_RS76 0x40 -#define RSA7_RS75 0x20 -#define RSA7_RS74 0x10 -#define RSA7_RS73 0x08 -#define RSA7_RS72 0x04 -#define RSA7_RS71 0x02 -#define RSA7_RS70 0x01 - -#define RSA8_RS87 0x80 -#define RSA8_RS86 0x40 -#define RSA8_RS85 0x20 -#define RSA8_RS84 0x10 -#define RSA8_RS83 0x08 -#define RSA8_RS82 0x04 -#define RSA8_RS81 0x02 -#define RSA8_RS80 0x01 - -/* RSA6S (Receive Sa6 Bit Status Register) - ------------------------ T1 ------------------------- */ - -#define RSA6S_SX 0x20 -#define RSA6S_SF 0x10 -#define RSA6S_SE 0x08 -#define RSA6S_SC 0x04 -#define RSA6S_SA 0x02 -#define RSA6S_S8 0x01 - - -/* RDL1-3 Receive DL-Bit Register1-3) - ------------------------ T1 ------------------------- */ - -#define RDL1_RDL17 0x80 -#define RDL1_RDL16 0x40 -#define RDL1_RDL15 0x20 -#define RDL1_RDL14 0x10 -#define RDL1_RDL13 0x08 -#define RDL1_RDL12 0x04 -#define RDL1_RDL11 0x02 -#define RDL1_RDL10 0x01 - -#define RDL2_RDL27 0x80 -#define RDL2_RDL26 0x40 -#define RDL2_RDL25 0x20 -#define RDL2_RDL24 0x10 -#define RDL2_RDL23 0x08 -#define RDL2_RDL22 0x04 -#define RDL2_RDL21 0x02 -#define RDL2_RDL20 0x01 - -#define RDL3_RDL37 0x80 -#define RDL3_RDL36 0x40 -#define RDL3_RDL35 0x20 -#define RDL3_RDL34 0x10 -#define RDL3_RDL33 0x08 -#define RDL3_RDL32 0x04 -#define RDL3_RDL31 0x02 -#define RDL3_RDL30 0x01 - - -/* SIS (Signaling Status Register) - - -------------------- E1 & T1 -------------------------- */ - -#define SIS_XDOV 0x80 -#define SIS_XFW 0x40 -#define SIS_XREP 0x20 -#define SIS_RLI 0x08 -#define SIS_CEC 0x04 -#define SIS_BOM 0x01 - - -/* RSIS (Receive Signaling Status Register) - - -------------------- E1 & T1 --------------------------- */ - -#define RSIS_VFR 0x80 -#define RSIS_RDO 0x40 -#define RSIS_CRC16 0x20 -#define RSIS_RAB 0x10 -#define RSIS_HA1 0x08 -#define RSIS_HA0 0x04 -#define RSIS_HFR 0x02 -#define RSIS_LA 0x01 - - -/* RBCL/H (Receive Byte Count Low/High) - - ------------------- E1 & T1 ----------------------- */ - -#define RBCL_RBC7 0x80 -#define RBCL_RBC6 0x40 -#define RBCL_RBC5 0x20 -#define RBCL_RBC4 0x10 -#define RBCL_RBC3 0x08 -#define RBCL_RBC2 0x04 -#define RBCL_RBC1 0x02 -#define RBCL_RBC0 0x01 - -#define RBCH_OV 0x10 -#define RBCH_RBC11 0x08 -#define RBCH_RBC10 0x04 -#define RBCH_RBC9 0x02 -#define RBCH_RBC8 0x01 - - -/* ISR1-3 (Interrupt Status Register 1-3) - - ------------------ E1 & T1 ------------------------------ */ - -#define FISR0_RME 0x80 -#define FISR0_RFS 0x40 -#define FISR0_T8MS 0x20 -#define FISR0_ISF 0x20 -#define FISR0_RMB 0x10 -#define FISR0_CASC 0x08 -#define FISR0_RSC 0x08 -#define FISR0_CRC6 0x04 -#define FISR0_CRC4 0x04 -#define FISR0_PDEN 0x02 -#define FISR0_RPF 0x01 - -#define FISR1_CASE 0x80 -#define FISR1_LLBSC 0x80 -#define FISR1_RDO 0x40 -#define FISR1_ALLS 0x20 -#define FISR1_XDU 0x10 -#define FISR1_XMB 0x08 -#define FISR1_XLSC 0x02 -#define FISR1_XPR 0x01 - -#define FISR2_FAR 0x80 -#define FISR2_LFA 0x40 -#define FISR2_MFAR 0x20 -#define FISR2_T400MS 0x10 -#define FISR2_LMFA 0x10 -#define FISR2_AIS 0x08 -#define FISR2_LOS 0x04 -#define FISR2_RAR 0x02 -#define FISR2_RA 0x01 - -#define FISR3_ES 0x80 -#define FISR3_SEC 0x40 -#define FISR3_LMFA16 0x20 -#define FISR3_AIS16 0x10 -#define FISR3_RA16 0x08 -#define FISR3_API 0x04 -#define FISR3_XSLP 0x20 -#define FISR3_XSLN 0x10 -#define FISR3_LLBSC 0x08 -#define FISR3_XRS 0x04 -#define FISR3_SLN 0x02 -#define FISR3_SLP 0x01 - - -/* GIS (Global Interrupt Status Register) - - --------------------- E1 & T1 --------------------- */ - -#define GIS_ISR3 0x08 -#define GIS_ISR2 0x04 -#define GIS_ISR1 0x02 -#define GIS_ISR0 0x01 - - -/* VSTR (Version Status Register) - - --------------------- E1 & T1 --------------------- */ - -#define VSTR_VN3 0x08 -#define VSTR_VN2 0x04 -#define VSTR_VN1 0x02 -#define VSTR_VN0 0x01 - - -/*>>>>>>>>>>>>>>>>>>>>> Local Control Structures <<<<<<<<<<<<<<<<<<<<<<<<< */ - -/* Write-only Registers (E1/T1 control mode write registers) */ -#define XFIFOH 0x00 /* Tx FIFO High Byte */ -#define XFIFOL 0x01 /* Tx FIFO Low Byte */ -#define CMDR 0x02 /* Command Reg */ -#define DEC 0x60 /* Disable Error Counter */ -#define TEST2 0x62 /* Manuf. Test Reg 2 */ -#define XS(nbr) (0x70 + (nbr)) /* Tx CAS Reg (0 to 15) */ - -/* Read-write Registers (E1/T1 status mode read registers) */ -#define MODE 0x03 /* Mode Reg */ -#define RAH1 0x04 /* Receive Address High 1 */ -#define RAH2 0x05 /* Receive Address High 2 */ -#define RAL1 0x06 /* Receive Address Low 1 */ -#define RAL2 0x07 /* Receive Address Low 2 */ -#define IPC 0x08 /* Interrupt Port Configuration */ -#define CCR1 0x09 /* Common Configuration Reg 1 */ -#define CCR3 0x0A /* Common Configuration Reg 3 */ -#define PRE 0x0B /* Preamble Reg */ -#define RTR1 0x0C /* Receive Timeslot Reg 1 */ -#define RTR2 0x0D /* Receive Timeslot Reg 2 */ -#define RTR3 0x0E /* Receive Timeslot Reg 3 */ -#define RTR4 0x0F /* Receive Timeslot Reg 4 */ -#define TTR1 0x10 /* Transmit Timeslot Reg 1 */ -#define TTR2 0x11 /* Transmit Timeslot Reg 2 */ -#define TTR3 0x12 /* Transmit Timeslot Reg 3 */ -#define TTR4 0x13 /* Transmit Timeslot Reg 4 */ -#define IMR0 0x14 /* Interrupt Mask Reg 0 */ -#define IMR1 0x15 /* Interrupt Mask Reg 1 */ -#define IMR2 0x16 /* Interrupt Mask Reg 2 */ -#define IMR3 0x17 /* Interrupt Mask Reg 3 */ -#define IMR4 0x18 /* Interrupt Mask Reg 4 */ -#define IMR5 0x19 /* Interrupt Mask Reg 5 */ -#define FMR0 0x1A /* Framer Mode Reigster 0 */ -#define FMR1 0x1B /* Framer Mode Reigster 1 */ -#define FMR2 0x1C /* Framer Mode Reigster 2 */ -#define LOOP 0x1D /* Channel Loop Back */ -#define XSW 0x1E /* Transmit Service Word */ -#define FMR4 0x1E /* Framer Mode Reg 4 */ -#define XSP 0x1F /* Transmit Spare Bits */ -#define FMR5 0x1F /* Framer Mode Reg 5 */ -#define XC0 0x20 /* Transmit Control 0 */ -#define XC1 0x21 /* Transmit Control 1 */ -#define RC0 0x22 /* Receive Control 0 */ -#define RC1 0x23 /* Receive Control 1 */ -#define XPM0 0x24 /* Transmit Pulse Mask 0 */ -#define XPM1 0x25 /* Transmit Pulse Mask 1 */ -#define XPM2 0x26 /* Transmit Pulse Mask 2 */ -#define TSWM 0x27 /* Transparent Service Word Mask */ -#define TEST1 0x28 /* Manuf. Test Reg 1 */ -#define IDLE 0x29 /* Idle Channel Code */ -#define XSA4 0x2A /* Transmit SA4 Bit Reg */ -#define XDL1 0x2A /* Transmit DL-Bit Reg 2 */ -#define XSA5 0x2B /* Transmit SA4 Bit Reg */ -#define XDL2 0x2B /* Transmit DL-Bit Reg 2 */ -#define XSA6 0x2C /* Transmit SA4 Bit Reg */ -#define XDL3 0x2C /* Transmit DL-Bit Reg 2 */ -#define XSA7 0x2D /* Transmit SA4 Bit Reg */ -#define CCB1 0x2D /* Clear Channel Reg 1 */ -#define XSA8 0x2E /* Transmit SA4 Bit Reg */ -#define CCB2 0x2E /* Clear Channel Reg 2 */ -#define FMR3 0x2F /* Framer Mode Reg. 3 */ -#define CCB3 0x2F /* Clear Channel Reg 3 */ -#define ICB1 0x30 /* Idle Channel Reg 1 */ -#define ICB2 0x31 /* Idle Channel Reg 2 */ -#define ICB3 0x32 /* Idle Channel Reg 3 */ -#define ICB4 0x33 /* Idle Channel Reg 4 */ -#define LIM0 0x34 /* Line Interface Mode 0 */ -#define LIM1 0x35 /* Line Interface Mode 1 */ -#define PCDR 0x36 /* Pulse Count Detection */ -#define PCRR 0x37 /* Pulse Count Recovery */ -#define LIM2 0x38 /* Line Interface Mode Reg 2 */ -#define LCR1 0x39 /* Loop Code Reg 1 */ -#define LCR2 0x3A /* Loop Code Reg 2 */ -#define LCR3 0x3B /* Loop Code Reg 3 */ -#define SIC1 0x3C /* System Interface Control 1 */ - -/* Read-only Registers (E1/T1 control mode read registers) */ -#define RFIFOH 0x00 /* Receive FIFO */ -#define RFIFOL 0x01 /* Receive FIFO */ -#define FRS0 0x4C /* Framer Receive Status 0 */ -#define FRS1 0x4D /* Framer Receive Status 1 */ -#define RSW 0x4E /* Receive Service Word */ -#define FRS2 0x4E /* Framer Receive Status 2 */ -#define RSP 0x4F /* Receive Spare Bits */ -#define FRS3 0x4F /* Framer Receive Status 3 */ -#define FECL 0x50 /* Framing Error Counter */ -#define FECH 0x51 /* Framing Error Counter */ -#define CVCL 0x52 /* Code Violation Counter */ -#define CVCH 0x53 /* Code Violation Counter */ -#define CECL 0x54 /* CRC Error Counter 1 */ -#define CECH 0x55 /* CRC Error Counter 1 */ -#define EBCL 0x56 /* E-Bit Error Counter */ -#define EBCH 0x57 /* E-Bit Error Counter */ -#define BECL 0x58 /* Bit Error Counter Low */ -#define BECH 0x59 /* Bit Error Counter Low */ -#define CEC3 0x5A /* CRC Error Counter 3 (16-bit) */ -#define RSA4 0x5C /* Receive SA4 Bit Reg */ -#define RDL1 0x5C /* Receive DL-Bit Reg 1 */ -#define RSA5 0x5D /* Receive SA5 Bit Reg */ -#define RDL2 0x5D /* Receive DL-Bit Reg 2 */ -#define RSA6 0x5E /* Receive SA6 Bit Reg */ -#define RDL3 0x5E /* Receive DL-Bit Reg 3 */ -#define RSA7 0x5F /* Receive SA7 Bit Reg */ -#define RSA8 0x60 /* Receive SA8 Bit Reg */ -#define RSA6S 0x61 /* Receive SA6 Bit Status Reg */ -#define TSR0 0x62 /* Manuf. Test Reg 0 */ -#define TSR1 0x63 /* Manuf. Test Reg 1 */ -#define SIS 0x64 /* Signaling Status Reg */ -#define RSIS 0x65 /* Receive Signaling Status Reg */ -#define RBCL 0x66 /* Receive Byte Control */ -#define RBCH 0x67 /* Receive Byte Control */ -#define FISR0 0x68 /* Interrupt Status Reg 0 */ -#define FISR1 0x69 /* Interrupt Status Reg 1 */ -#define FISR2 0x6A /* Interrupt Status Reg 2 */ -#define FISR3 0x6B /* Interrupt Status Reg 3 */ -#define GIS 0x6E /* Global Interrupt Status */ -#define VSTR 0x6F /* Version Status */ -#define RS(nbr) (0x70 + (nbr)) /* Rx CAS Reg (0 to 15) */ - -#endif /* _FALC_LH_H */ - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/fd.h linux.20p9/include/linux/fd.h --- linux.vanilla/include/linux/fd.h Sun Mar 25 17:31:03 2001 +++ linux.20p9/include/linux/fd.h Wed Jul 4 16:19:53 2001 @@ -216,8 +216,8 @@ /* Prevent "aliased" accesses. */ int fd_ref; int fd_device; - unsigned long last_checked; /* when was the drive last checked for a disk - * change? */ + unsigned long last_checked; /* when was the drive last checked + * for a disk change? */ char *dmabuf; int bufblocks; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/fddidevice.h linux.20p9/include/linux/fddidevice.h --- linux.vanilla/include/linux/fddidevice.h Sun Mar 25 17:31:04 2001 +++ linux.20p9/include/linux/fddidevice.h Wed Aug 8 22:14:06 2001 @@ -34,6 +34,8 @@ extern int fddi_rebuild_header(struct sk_buff *skb); extern unsigned short fddi_type_trans(struct sk_buff *skb, struct device *dev); +struct device * +init_fddidev(struct device *dev, int sizeof_priv); #endif #endif /* _LINUX_FDDIDEVICE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/hd64572.h linux.20p9/include/linux/hd64572.h --- linux.vanilla/include/linux/hd64572.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/hd64572.h Thu Jan 1 01:00:00 1970 @@ -1,437 +0,0 @@ -/* - * hd64572.h Description of the Hitachi HD64572 (SCA-II), valid for - * CPU modes 0 & 2. - * - * Author: Ivan Passos - * - * Copyright: (c) 2000 Cyclades 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. - * - * $Log: hd64572.h,v $ - * Revision 1.0 2000/01/25 ivan - * Initial version. - * - */ - -#ifndef _HD64572_H -#define _HD64572_H - -/* Illegal Access Register */ -#define ILAR 0x00 - -/* Wait Controller Registers */ -#define PABR0L 0x20 /* Physical Addr Boundary Register 0 L */ -#define PABR0H 0x21 /* Physical Addr Boundary Register 0 H */ -#define PABR1L 0x22 /* Physical Addr Boundary Register 1 L */ -#define PABR1H 0x23 /* Physical Addr Boundary Register 1 H */ -#define WCRL 0x24 /* Wait Control Register L */ -#define WCRM 0x25 /* Wait Control Register M */ -#define WCRH 0x26 /* Wait Control Register H */ - -/* Interrupt Registers */ -#define IVR 0x60 /* Interrupt Vector Register */ -#define IMVR 0x64 /* Interrupt Modified Vector Register */ -#define ITCR 0x68 /* Interrupt Control Register */ -#define ISR0 0x6c /* Interrupt Status Register 0 */ -#define ISR1 0x70 /* Interrupt Status Register 1 */ -#define IER0 0x74 /* Interrupt Enable Register 0 */ -#define IER1 0x78 /* Interrupt Enable Register 1 */ - -/* Register Access Macros (chan is 0 or 1 in _any_ case) */ -#define M_REG(reg, chan) (reg + 0x80*chan) /* MSCI */ -#define DRX_REG(reg, chan) (reg + 0x40*chan) /* DMA Rx */ -#define DTX_REG(reg, chan) (reg + 0x20*(2*chan + 1)) /* DMA Tx */ -#define TRX_REG(reg, chan) (reg + 0x20*chan) /* Timer Rx */ -#define TTX_REG(reg, chan) (reg + 0x10*(2*chan + 1)) /* Timer Tx */ -#define ST_REG(reg, chan) (reg + 0x80*chan) /* Status Cnt */ -#define IR0_DRX(val, chan) ((val)<<(8*(chan))) /* Int DMA Rx */ -#define IR0_DTX(val, chan) ((val)<<(4*(2*chan + 1))) /* Int DMA Tx */ -#define IR0_M(val, chan) ((val)<<(8*(chan))) /* Int MSCI */ - -/* MSCI Channel Registers */ -#define MD0 0x138 /* Mode reg 0 */ -#define MD1 0x139 /* Mode reg 1 */ -#define MD2 0x13a /* Mode reg 2 */ -#define MD3 0x13b /* Mode reg 3 */ -#define CTL 0x130 /* Control reg */ -#define RXS 0x13c /* RX clock source */ -#define TXS 0x13d /* TX clock source */ -#define EXS 0x13e /* External clock input selection */ -#define TMCT 0x144 /* Time constant (Tx) */ -#define TMCR 0x145 /* Time constant (Rx) */ -#define CMD 0x128 /* Command reg */ -#define ST0 0x118 /* Status reg 0 */ -#define ST1 0x119 /* Status reg 1 */ -#define ST2 0x11a /* Status reg 2 */ -#define ST3 0x11b /* Status reg 3 */ -#define ST4 0x11c /* Status reg 4 */ -#define FST 0x11d /* frame Status reg */ -#define IE0 0x120 /* Interrupt enable reg 0 */ -#define IE1 0x121 /* Interrupt enable reg 1 */ -#define IE2 0x122 /* Interrupt enable reg 2 */ -#define IE4 0x124 /* Interrupt enable reg 4 */ -#define FIE 0x125 /* Frame Interrupt enable reg */ -#define SA0 0x140 /* Syn Address reg 0 */ -#define SA1 0x141 /* Syn Address reg 1 */ -#define IDL 0x142 /* Idle register */ -#define TRBL 0x100 /* TX/RX buffer reg L */ -#define TRBK 0x101 /* TX/RX buffer reg K */ -#define TRBJ 0x102 /* TX/RX buffer reg J */ -#define TRBH 0x103 /* TX/RX buffer reg H */ -#define TRC0 0x148 /* TX Ready control reg 0 */ -#define TRC1 0x149 /* TX Ready control reg 1 */ -#define RRC 0x14a /* RX Ready control reg */ -#define CST0 0x108 /* Current Status Register 0 */ -#define CST1 0x109 /* Current Status Register 1 */ -#define CST2 0x10a /* Current Status Register 2 */ -#define CST3 0x10b /* Current Status Register 3 */ -#define GPO 0x131 /* General Purpose Output Pin Ctl Reg */ -#define TFS 0x14b /* Tx Start Threshold Ctl Reg */ -#define TFN 0x143 /* Inter-transmit-frame Time Fill Ctl Reg */ -#define TBN 0x110 /* Tx Buffer Number Reg */ -#define RBN 0x111 /* Rx Buffer Number Reg */ -#define TNR0 0x150 /* Tx DMA Request Ctl Reg 0 */ -#define TNR1 0x151 /* Tx DMA Request Ctl Reg 1 */ -#define TCR 0x152 /* Tx DMA Critical Request Reg */ -#define RNR 0x154 /* Rx DMA Request Ctl Reg */ -#define RCR 0x156 /* Rx DMA Critical Request Reg */ - -/* Timer Registers */ -#define TCNTL 0x200 /* Timer Upcounter L */ -#define TCNTH 0x201 /* Timer Upcounter H */ -#define TCONRL 0x204 /* Timer Constant Register L */ -#define TCONRH 0x205 /* Timer Constant Register H */ -#define TCSR 0x206 /* Timer Control/Status Register */ -#define TEPR 0x207 /* Timer Expand Prescale Register */ - -/* DMA registers */ -#define PCR 0x40 /* DMA priority control reg */ -#define DRR 0x44 /* DMA reset reg */ -#define DMER 0x07 /* DMA Master Enable reg */ -#define BTCR 0x08 /* Burst Tx Ctl Reg */ -#define BOLR 0x0c /* Back-off Length Reg */ -#define DSR_RX(chan) (0x48 + 2*chan) /* DMA Status Reg (Rx) */ -#define DSR_TX(chan) (0x49 + 2*chan) /* DMA Status Reg (Tx) */ -#define DIR_RX(chan) (0x4c + 2*chan) /* DMA Interrupt Enable Reg (Rx) */ -#define DIR_TX(chan) (0x4d + 2*chan) /* DMA Interrupt Enable Reg (Tx) */ -#define FCT_RX(chan) (0x50 + 2*chan) /* Frame End Interrupt Counter (Rx) */ -#define FCT_TX(chan) (0x51 + 2*chan) /* Frame End Interrupt Counter (Tx) */ -#define DMR_RX(chan) (0x54 + 2*chan) /* DMA Mode Reg (Rx) */ -#define DMR_TX(chan) (0x55 + 2*chan) /* DMA Mode Reg (Tx) */ -#define DCR_RX(chan) (0x58 + 2*chan) /* DMA Command Reg (Rx) */ -#define DCR_TX(chan) (0x59 + 2*chan) /* DMA Command Reg (Tx) */ - -/* DMA Channel Registers */ -#define DARL 0x80 /* Dest Addr Register L (single-block, RX only) */ -#define DARH 0x81 /* Dest Addr Register H (single-block, RX only) */ -#define DARB 0x82 /* Dest Addr Register B (single-block, RX only) */ -#define DARBH 0x83 /* Dest Addr Register BH (single-block, RX only) */ -#define SARL 0x80 /* Source Addr Register L (single-block, TX only) */ -#define SARH 0x81 /* Source Addr Register H (single-block, TX only) */ -#define SARB 0x82 /* Source Addr Register B (single-block, TX only) */ -#define DARBH 0x83 /* Source Addr Register BH (single-block, TX only) */ -#define BARL 0x80 /* Buffer Addr Register L (chained-block) */ -#define BARH 0x81 /* Buffer Addr Register H (chained-block) */ -#define BARB 0x82 /* Buffer Addr Register B (chained-block) */ -#define BARBH 0x83 /* Buffer Addr Register BH (chained-block) */ -#define CDAL 0x84 /* Current Descriptor Addr Register L */ -#define CDAH 0x85 /* Current Descriptor Addr Register H */ -#define CDAB 0x86 /* Current Descriptor Addr Register B */ -#define CDABH 0x87 /* Current Descriptor Addr Register BH */ -#define EDAL 0x88 /* Error Descriptor Addr Register L */ -#define EDAH 0x89 /* Error Descriptor Addr Register H */ -#define EDAB 0x8a /* Error Descriptor Addr Register B */ -#define EDABH 0x8b /* Error Descriptor Addr Register BH */ -#define BFLL 0x90 /* RX Buffer Length L (only RX) */ -#define BFLH 0x91 /* RX Buffer Length H (only RX) */ -#define BCRL 0x8c /* Byte Count Register L */ -#define BCRH 0x8d /* Byte Count Register H */ - -/* Block Descriptor Structure */ -typedef struct { - unsigned long next; /* pointer to next block descriptor */ - unsigned long ptbuf; /* buffer pointer */ - unsigned short len; /* data length */ - unsigned char status; /* status */ - unsigned char filler[5]; /* alignment filler (16 bytes) */ -} pcsca_bd_t; - -/* - Descriptor Status definitions: - - Bit Transmission Reception - - 7 EOM EOM - 6 - Short Frame - 5 - Abort - 4 - Residual bit - 3 Underrun Overrun - 2 - CRC - 1 Ownership Ownership - 0 EOT - -*/ -#define DST_EOT 0x01 /* End of transmit command */ -#define DST_OSB 0x02 /* Ownership bit */ -#define DST_CRC 0x04 /* CRC Error */ -#define DST_OVR 0x08 /* Overrun */ -#define DST_UDR 0x08 /* Underrun */ -#define DST_RBIT 0x10 /* Residual bit */ -#define DST_ABT 0x20 /* Abort */ -#define DST_SHRT 0x40 /* Short Frame */ -#define DST_EOM 0x80 /* End of Message */ - -/* Status Counter Registers */ -#define CMCR 0x158 /* Counter Master Ctl Reg */ -#define TECNTL 0x160 /* Tx EOM Counter L */ -#define TECNTM 0x161 /* Tx EOM Counter M */ -#define TECNTH 0x162 /* Tx EOM Counter H */ -#define TECCR 0x163 /* Tx EOM Counter Ctl Reg */ -#define URCNTL 0x164 /* Underrun Counter L */ -#define URCNTH 0x165 /* Underrun Counter H */ -#define URCCR 0x167 /* Underrun Counter Ctl Reg */ -#define RECNTL 0x168 /* Rx EOM Counter L */ -#define RECNTM 0x169 /* Rx EOM Counter M */ -#define RECNTH 0x16a /* Rx EOM Counter H */ -#define RECCR 0x16b /* Rx EOM Counter Ctl Reg */ -#define ORCNTL 0x16c /* Overrun Counter L */ -#define ORCNTH 0x16d /* Overrun Counter H */ -#define ORCCR 0x16f /* Overrun Counter Ctl Reg */ -#define CECNTL 0x170 /* CRC Counter L */ -#define CECNTH 0x171 /* CRC Counter H */ -#define CECCR 0x173 /* CRC Counter Ctl Reg */ -#define ABCNTL 0x174 /* Abort frame Counter L */ -#define ABCNTH 0x175 /* Abort frame Counter H */ -#define ABCCR 0x177 /* Abort frame Counter Ctl Reg */ -#define SHCNTL 0x178 /* Short frame Counter L */ -#define SHCNTH 0x179 /* Short frame Counter H */ -#define SHCCR 0x17b /* Short frame Counter Ctl Reg */ -#define RSCNTL 0x17c /* Residual bit Counter L */ -#define RSCNTH 0x17d /* Residual bit Counter H */ -#define RSCCR 0x17f /* Residual bit Counter Ctl Reg */ - -/* Register Programming Constants */ - -#define IR0_DMIC 0x00000001 -#define IR0_DMIB 0x00000002 -#define IR0_DMIA 0x00000004 -#define IR0_EFT 0x00000008 -#define IR0_DMAREQ 0x00010000 -#define IR0_TXINT 0x00020000 -#define IR0_RXINTB 0x00040000 -#define IR0_RXINTA 0x00080000 -#define IR0_TXRDY 0x00100000 -#define IR0_RXRDY 0x00200000 - -#define MD0_CRC16_0 0x00 -#define MD0_CRC16_1 0x01 -#define MD0_CRC32 0x02 -#define MD0_CRC_CCITT 0x03 -#define MD0_CRCC0 0x04 -#define MD0_CRCC1 0x08 -#define MD0_AUTO_ENA 0x10 -#define MD0_ASYNC 0x00 -#define MD0_BY_MSYNC 0x20 -#define MD0_BY_BISYNC 0x40 -#define MD0_BY_EXT 0x60 -#define MD0_BIT_SYNC 0x80 -#define MD0_TRANSP 0xc0 - -#define MD1_NOADDR 0x00 -#define MD1_SADDR1 0x40 -#define MD1_SADDR2 0x80 -#define MD1_DADDR 0xc0 - -#define MD2_F_DUPLEX 0x00 -#define MD2_AUTO_ECHO 0x01 -#define MD2_LOOP_HI_Z 0x02 -#define MD2_LOOP_MIR 0x03 -#define MD2_ADPLL_X8 0x00 -#define MD2_ADPLL_X16 0x08 -#define MD2_ADPLL_X32 0x10 -#define MD2_NRZ 0x00 -#define MD2_NRZI 0x20 -#define MD2_NRZ_IEEE 0x40 -#define MD2_MANCH 0x00 -#define MD2_FM1 0x20 -#define MD2_FM0 0x40 -#define MD2_FM 0x80 - -#define CTL_RTS 0x01 -#define CTL_DTR 0x02 -#define CTL_SYN 0x04 -#define CTL_IDLC 0x10 -#define CTL_UDRNC 0x20 -#define CTL_URSKP 0x40 -#define CTL_URCT 0x80 - -#define RXS_BR0 0x01 -#define RXS_BR1 0x02 -#define RXS_BR2 0x04 -#define RXS_BR3 0x08 -#define RXS_ECLK 0x00 -#define RXS_ECLK_NS 0x20 -#define RXS_IBRG 0x40 -#define RXS_PLL1 0x50 -#define RXS_PLL2 0x60 -#define RXS_PLL3 0x70 -#define RXS_DRTXC 0x80 - -#define TXS_BR0 0x01 -#define TXS_BR1 0x02 -#define TXS_BR2 0x04 -#define TXS_BR3 0x08 -#define TXS_ECLK 0x00 -#define TXS_IBRG 0x40 -#define TXS_RCLK 0x60 -#define TXS_DTRXC 0x80 - -#define EXS_RES0 0x01 -#define EXS_RES1 0x02 -#define EXS_RES2 0x04 -#define EXS_TES0 0x10 -#define EXS_TES1 0x20 -#define EXS_TES2 0x40 - -#define CMD_RX_RST 0x11 -#define CMD_RX_ENA 0x12 -#define CMD_RX_DIS 0x13 -#define CMD_RX_CRC_INIT 0x14 -#define CMD_RX_MSG_REJ 0x15 -#define CMD_RX_MP_SRCH 0x16 -#define CMD_RX_CRC_EXC 0x17 -#define CMD_RX_CRC_FRC 0x18 -#define CMD_TX_RST 0x01 -#define CMD_TX_ENA 0x02 -#define CMD_TX_DISA 0x03 -#define CMD_TX_CRC_INIT 0x04 -#define CMD_TX_CRC_EXC 0x05 -#define CMD_TX_EOM 0x06 -#define CMD_TX_ABORT 0x07 -#define CMD_TX_MP_ON 0x08 -#define CMD_TX_BUF_CLR 0x09 -#define CMD_TX_DISB 0x0b -#define CMD_CH_RST 0x21 -#define CMD_SRCH_MODE 0x31 -#define CMD_NOP 0x00 - -#define ST0_RXRDY 0x01 -#define ST0_TXRDY 0x02 -#define ST0_RXINTB 0x20 -#define ST0_RXINTA 0x40 -#define ST0_TXINT 0x80 - -#define ST1_IDLE 0x01 -#define ST1_ABORT 0x02 -#define ST1_CDCD 0x04 -#define ST1_CCTS 0x08 -#define ST1_SYN_FLAG 0x10 -#define ST1_CLMD 0x20 -#define ST1_TXIDLE 0x40 -#define ST1_UDRN 0x80 - -#define ST2_CRCE 0x04 -#define ST2_ONRN 0x08 -#define ST2_RBIT 0x10 -#define ST2_ABORT 0x20 -#define ST2_SHORT 0x40 -#define ST2_EOM 0x80 - -#define ST3_RX_ENA 0x01 -#define ST3_TX_ENA 0x02 -#define ST3_DCD 0x04 -#define ST3_CTS 0x08 -#define ST3_SRCH_MODE 0x10 -#define ST3_SLOOP 0x20 -#define ST3_GPI 0x80 - -#define ST4_RDNR 0x01 -#define ST4_RDCR 0x02 -#define ST4_TDNR 0x04 -#define ST4_TDCR 0x08 -#define ST4_OCLM 0x20 -#define ST4_CFT 0x40 -#define ST4_CGPI 0x80 - -#define FST_CRCEF 0x04 -#define FST_OVRNF 0x08 -#define FST_RBIF 0x10 -#define FST_ABTF 0x20 -#define FST_SHRTF 0x40 -#define FST_EOMF 0x80 - -#define IE0_RXRDY 0x01 -#define IE0_TXRDY 0x02 -#define IE0_RXINTB 0x20 -#define IE0_RXINTA 0x40 -#define IE0_TXINT 0x80 - -#define IE1_IDLD 0x01 -#define IE1_ABTD 0x02 -#define IE1_CDCD 0x04 -#define IE1_CCTS 0x08 -#define IE1_SYNCD 0x10 -#define IE1_CLMD 0x20 -#define IE1_IDL 0x40 -#define IE1_UDRN 0x80 - -#define IE2_CRCE 0x04 -#define IE2_OVRN 0x08 -#define IE2_RBIT 0x10 -#define IE2_ABT 0x20 -#define IE2_SHRT 0x40 -#define IE2_EOM 0x80 - -#define IE4_RDNR 0x01 -#define IE4_RDCR 0x02 -#define IE4_TDNR 0x04 -#define IE4_TDCR 0x08 -#define IE4_OCLM 0x20 -#define IE4_CFT 0x40 -#define IE4_CGPI 0x80 - -#define FIE_CRCEF 0x04 -#define FIE_OVRNF 0x08 -#define FIE_RBIF 0x10 -#define FIE_ABTF 0x20 -#define FIE_SHRTF 0x40 -#define FIE_EOMF 0x80 - -#define DSR_DWE 0x01 -#define DSR_DE 0x02 -#define DSR_REF 0x04 -#define DSR_UDRF 0x04 -#define DSR_COA 0x08 -#define DSR_COF 0x10 -#define DSR_BOF 0x20 -#define DSR_EOM 0x40 -#define DSR_EOT 0x80 - -#define DIR_REF 0x04 -#define DIR_UDRF 0x04 -#define DIR_COA 0x08 -#define DIR_COF 0x10 -#define DIR_BOF 0x20 -#define DIR_EOM 0x40 -#define DIR_EOT 0x80 - -#define DMR_CNTE 0x02 -#define DMR_NF 0x04 -#define DMR_SEOME 0x08 -#define DMR_TMOD 0x10 - -#define DCR_SW_ABT 0x01 -#define DCR_FCT_CLR 0x02 - -#define PCR_PR0 0x01 -#define PCR_PR1 0x02 -#define PCR_PR2 0x04 -#define PCR_CCC 0x08 -#define PCR_BRC 0x10 -#define PCR_OSB 0x40 -#define PCR_BURST 0x80 - -#endif /* (_HD64572_H) */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/hysdn_if.h linux.20p9/include/linux/hysdn_if.h --- linux.vanilla/include/linux/hysdn_if.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/hysdn_if.h Wed Jul 4 16:04:00 2001 @@ -1,4 +1,4 @@ -/* $Id: hysdn_if.h,v 1.1 2000/02/10 19:47:50 werner Exp $ +/* $Id: hysdn_if.h,v 1.1.8.2 2001/05/17 20:41:52 kai Exp $ * Linux driver for HYSDN cards, ioctl definitions shared by hynetmgr and driver. * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH @@ -19,18 +19,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Log: hysdn_if.h,v $ - * Revision 1.1 2000/02/10 19:47:50 werner - * - * Initial release - * - * */ /****************/ /* error values */ /****************/ -#define ERR_NONE 0 /* no error occured */ +#define ERR_NONE 0 /* no error occurred */ #define ERR_ALREADY_BOOT 1000 /* we are already booting */ #define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */ #define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/ioport.h linux.20p9/include/linux/ioport.h --- linux.vanilla/include/linux/ioport.h Sun Mar 25 17:31:03 2001 +++ linux.20p9/include/linux/ioport.h Wed Jul 4 16:04:00 2001 @@ -32,4 +32,21 @@ extern void autoirq_setup(int waittime); extern int autoirq_report(int waittime); +/* + * for compatibility with 2.4 + */ + +extern inline int check_mem_region(unsigned long from, unsigned long extent) +{ + return 0; +} + +extern inline void request_mem_region(unsigned long from, unsigned long extent,const char *name) +{ +} + +extern inline void release_mem_region(unsigned long from, unsigned long extent) +{ +} + #endif /* _LINUX_PORTIO_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/isdn.h linux.20p9/include/linux/isdn.h --- linux.vanilla/include/linux/isdn.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/isdn.h Wed Aug 8 22:43:42 2001 @@ -104,6 +104,12 @@ #define IIOCDRVCTL _IO('I',128) +/* cisco hdlck device private ioctls */ +#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0) +#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1) +#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2) +#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3) + /* Packet encapsulations for net-interfaces */ #define ISDN_NET_ENCAP_ETHER 0 #define ISDN_NET_ENCAP_RAWIP 1 @@ -261,9 +267,9 @@ ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE) ) /* Timer-delays and scheduling-flags */ -#define ISDN_TIMER_RES 3 /* Main Timer-Resolution */ -#define ISDN_TIMER_02SEC (HZ/(ISDN_TIMER_RES+1)/5) /* Slow-Timer1 .2 sec */ -#define ISDN_TIMER_1SEC (HZ/(ISDN_TIMER_RES+1)) /* Slow-Timer2 1 sec */ +#define ISDN_TIMER_RES 4 /* Main Timer-Resolution */ +#define ISDN_TIMER_02SEC (HZ/ISDN_TIMER_RES/5) /* Slow-Timer1 .2 sec */ +#define ISDN_TIMER_1SEC (HZ/ISDN_TIMER_RES) /* Slow-Timer2 1 sec */ #define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */ #define ISDN_TIMER_KEEPINT 10 /* Cisco-Keepalive = ISDN_TIMER_1SEC * this factor */ #define ISDN_TIMER_MODEMREAD 1 @@ -272,13 +278,11 @@ #define ISDN_TIMER_MODEMXMIT 8 #define ISDN_TIMER_NETDIAL 16 #define ISDN_TIMER_NETHANGUP 32 -#define ISDN_TIMER_KEEPALIVE 128 /* Cisco-Keepalive */ #define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */ #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \ ISDN_TIMER_MODEMXMIT) #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \ - ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE | \ - ISDN_TIMER_CARRIER) + ISDN_TIMER_NETDIAL | ISDN_TIMER_CARRIER) /* Timeout-Values for isdn_net_dial() */ #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1))) @@ -400,9 +404,15 @@ #ifdef CONFIG_ISDN_X25 struct concap_device_ops *dops; /* callbacks used by encapsulator */ #endif - int cisco_loop; /* Loop counter for Cisco-SLARP */ + /* use an own struct for that in later versions */ ulong cisco_myseq; /* Local keepalive seq. for Cisco */ + ulong cisco_mineseen; /* returned keepalive seq. from remote */ ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */ + int cisco_keepalive_period; /* keepalive period */ + ulong cisco_last_slarp_in; /* jiffie of last keepalive packet we received */ + char cisco_line_state; /* state of line according to keepalive packets */ + char cisco_debserint; /* debugging flag of cisco hdlc with slarp */ + struct timer_list cisco_timer; struct tq_struct tqueue; } isdn_net_local; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/isdn_ppp.h linux.20p9/include/linux/isdn_ppp.h --- linux.vanilla/include/linux/isdn_ppp.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/isdn_ppp.h Thu Jul 26 18:24:15 2001 @@ -79,7 +79,7 @@ * * We use this same struct for the reset entry of the compressor to commu- * nicate to its caller how to deal with sending of a Reset Ack. In this - * case, expra is not used, but other options still apply (supressing + * case, expra is not used, but other options still apply (suppressing * sending with rsend, appending arbitrary data, etc). */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/kcomp.h linux.20p9/include/linux/kcomp.h --- linux.vanilla/include/linux/kcomp.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/kcomp.h Wed Aug 8 22:33:17 2001 @@ -17,7 +17,7 @@ #define net_device device #define dev_kfree_skb_irq(a) dev_kfree_skb(a) -#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy) +#define netif_wake_queue(dev) do { clear_bit(0, &dev->tbusy); mark_bh(NET_BH); } while(0) #define netif_stop_queue(dev) set_bit(0, &dev->tbusy) #define netif_start_queue(dev) do { dev->tbusy = 0; dev->interrupt = 0; dev->start = 1; } while (0) #define netif_queue_stopped(dev) dev->tbusy diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/module.h linux.20p9/include/linux/module.h --- linux.vanilla/include/linux/module.h Sun Mar 25 17:31:04 2001 +++ linux.20p9/include/linux/module.h Wed Aug 8 22:29:42 2001 @@ -136,6 +136,7 @@ (mod_member_present((mod), can_unload) && (mod)->can_unload \ ? (mod)->can_unload() : atomic_read(&(mod)->uc.usecount)) +extern int try_inc_mod_count(struct module *mod); /* Indirect stringification. */ #define __MODULE_STRING_1(x) #x diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/netdevice.h linux.20p9/include/linux/netdevice.h --- linux.vanilla/include/linux/netdevice.h Sun Mar 25 17:31:03 2001 +++ linux.20p9/include/linux/netdevice.h Wed Aug 8 22:14:06 2001 @@ -441,6 +441,8 @@ extern void unregister_netdev(struct device *dev); extern int register_trdev(struct device *dev); extern void unregister_trdev(struct device *dev); +extern int register_fddidev(struct device *dev); +extern void unregister_fddidev(struct device *dev); extern int register_fcdev(struct device *dev); extern void unregister_fcdev(struct device *dev); /* Functions used for multicast support */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/parport.h linux.20p9/include/linux/parport.h --- linux.vanilla/include/linux/parport.h Sun Mar 25 17:31:04 2001 +++ linux.20p9/include/linux/parport.h Thu Jul 26 17:49:34 2001 @@ -166,7 +166,7 @@ struct wait_queue *wait_q; unsigned long int time; unsigned long int timeslice; - unsigned int waiting; + unsigned long waiting; struct pardevice *waitprev; struct pardevice *waitnext; }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/pc300.h linux.20p9/include/linux/pc300.h --- linux.vanilla/include/linux/pc300.h Sun Mar 25 17:31:05 2001 +++ linux.20p9/include/linux/pc300.h Thu Jan 1 01:00:00 1970 @@ -1,382 +0,0 @@ -/* - * pc300.h Cyclades-PC300(tm) Kernel API Definitions. - * - * Author: Ivan Passos - * - * Copyright: (c) 1999-2000 Cyclades 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. - * - * $Log: pc300.h,v $ - * Revision 2.2 2000/06/23 ivan - * Inclusion of 'loopback' field on structure 'pc300chconf', to allow - * loopback mode operation. - * - * Revision 2.1 2000/06/09 ivan - * Changes to use the new generic HDLC layer in the driver. - * - * Revision 2.0 2000/03/27 ivan - * Added support for the PC300/TE cards. - * - * Revision 1.1 2000/01/31 ivan - * Replaced 'pc300[drv|sca].h' former PC300 driver include files. - * - * Revision 1.0 1999/12/16 ivan - * First official release. - * Inclusion of 'nchan' field on structure 'pc300hw', to allow variable - * number of ports per card. - * Inclusion of 'if_ptr' field on structure 'pc300dev'. - * - * Revision 0.6 1999/11/17 ivan - * Changed X.25-specific function names to comply with adopted convention. - * - * Revision 0.5 1999/11/16 Daniela Squassoni - * X.25 support. - * - * Revision 0.4 1999/11/15 ivan - * Inclusion of 'clock' field on structure 'pc300hw'. - * - * Revision 0.3 1999/11/10 ivan - * IOCTL name changing. - * Inclusion of driver function prototypes. - * - * Revision 0.2 1999/11/03 ivan - * Inclusion of 'tx_skb' and union 'ifu' on structure 'pc300dev'. - * - * Revision 0.1 1999/01/15 ivan - * Initial version. - * - */ - -#ifndef _PC300_H -#define _PC300_H - -#ifndef __HDLC_H -#include -#endif -#ifndef _HD64572_H -#include -#endif -#ifndef _FALC_LH_H -#include -#endif - -#ifndef CY_TYPES -#define CY_TYPES -#if defined(__alpha__) -typedef unsigned long ucdouble; /* 64 bits, unsigned */ -typedef unsigned int uclong; /* 32 bits, unsigned */ -#else -typedef unsigned long uclong; /* 32 bits, unsigned */ -#endif -typedef unsigned short ucshort; /* 16 bits, unsigned */ -typedef unsigned char ucchar; /* 8 bits, unsigned */ -#endif /* CY_TYPES */ - -#define PC300_DEVNAME "hdlc" /* Dev. name base (for hdlc0, hdlc1, etc.) */ -#define PC300_MAXINDEX 100 /* Max dev. name index (the '0' in hdlc0) */ - -#define PC300_MAXCARDS 4 /* Max number of cards per system */ -#define PC300_MAXCHAN 2 /* Number of channels per card */ - -#define PC300_PLX_WIN 0x80 /* PLX control window size (128b) */ -#define PC300_RAMSIZE 0x80000 /* RAM window size (512Kb) */ -#define PC300_SCASIZE 0x400 /* SCA window size (1Kb) */ -#define PC300_FALCSIZE 0x400 /* FALC window size (1Kb) */ - -#define PC300_OSC_CLOCK 24576000 -#define PC300_PCI_CLOCK 33000000 - -#define BD_DEF_LEN 0x0800 /* DMA buffer length (2KB) */ -#define DMA_TX_MEMSZ 0x8000 /* Total DMA Tx memory size (32KB/ch) */ -#define DMA_RX_MEMSZ 0x10000 /* Total DMA Rx memory size (64KB/ch) */ - -#define N_DMA_TX_BUF (DMA_TX_MEMSZ / BD_DEF_LEN) /* DMA Tx buffers */ -#define N_DMA_RX_BUF (DMA_RX_MEMSZ / BD_DEF_LEN) /* DMA Rx buffers */ - -/* DMA Buffer Offsets */ -#define DMA_TX_BASE ((N_DMA_TX_BUF + N_DMA_RX_BUF) * \ - PC300_MAXCHAN * sizeof(pcsca_bd_t)) -#define DMA_RX_BASE (DMA_TX_BASE + PC300_MAXCHAN*DMA_TX_MEMSZ) - -/* DMA Descriptor Offsets */ -#define DMA_TX_BD_BASE 0x0000 -#define DMA_RX_BD_BASE (DMA_TX_BD_BASE + ((PC300_MAXCHAN*DMA_TX_MEMSZ / \ - BD_DEF_LEN) * sizeof(pcsca_bd_t))) - -/* DMA Descriptor Macros */ -#define TX_BD_ADDR(chan, n) (DMA_TX_BD_BASE + \ - ((N_DMA_TX_BUF*chan) + n) * sizeof(pcsca_bd_t)) -#define RX_BD_ADDR(chan, n) (DMA_RX_BD_BASE + \ - ((N_DMA_RX_BUF*chan) + n) * sizeof(pcsca_bd_t)) - -/* Macro to access the FALC registers (TE only) */ -#define F_REG(reg, chan) (0x200*(chan) + ((reg)<<2)) - -/*************************************** - * Memory access functions/macros * - * (required to support Alpha systems) * - ***************************************/ -#ifdef __KERNEL__ -#define cpc_writeb(port,val) {writeb((ucchar)(val),(ulong)(port)); mb();} -#define cpc_writew(port,val) {writew((ushort)(val),(ulong)(port)); mb();} -#define cpc_writel(port,val) {writel((uclong)(val),(ulong)(port)); mb();} - -#define cpc_readb(port) readb(port) -#define cpc_readw(port) readw(port) -#define cpc_readl(port) readl(port) - -#else /* __KERNEL__ */ -#define cpc_writeb(port,val) (*(volatile ucchar *)(port) = (ucchar)(val)) -#define cpc_writew(port,val) (*(volatile ucshort *)(port) = (ucshort)(val)) -#define cpc_writel(port,val) (*(volatile uclong *)(port) = (uclong)(val)) - -#define cpc_readb(port) (*(volatile ucchar *)(port)) -#define cpc_readw(port) (*(volatile ucshort *)(port)) -#define cpc_readl(port) (*(volatile uclong *)(port)) - -#endif /* __KERNEL__ */ - -/****** Data Structures *****************************************************/ - -/* - * RUNTIME_9050 - PLX PCI9050-1 local configuration and shared runtime - * registers. This structure can be used to access the 9050 registers - * (memory mapped). - */ -struct RUNTIME_9050 { - uclong loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */ - uclong loc_rom_range; /* 10h : Local ROM Range */ - uclong loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */ - uclong loc_rom_base; /* 24h : Local ROM Base */ - uclong loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */ - uclong rom_bus_descr; /* 38h : ROM Bus Descriptor */ - uclong cs_base[4]; /* 3C-48h : Chip Select Base Addrs */ - uclong intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */ - uclong init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */ -}; - -#define PLX_9050_LINT1_ENABLE 0x01 -#define PLX_9050_LINT1_POL 0x02 -#define PLX_9050_LINT1_STATUS 0x04 -#define PLX_9050_LINT2_ENABLE 0x08 -#define PLX_9050_LINT2_POL 0x10 -#define PLX_9050_LINT2_STATUS 0x20 -#define PLX_9050_INTR_ENABLE 0x40 -#define PLX_9050_SW_INTR 0x80 - -/* Masks to access the init_ctrl PLX register */ -#define PC300_CLKSEL_MASK (0x00000004UL) -#define PC300_CHMEDIA_MASK(chan) (0x00000020UL<<(chan*3)) -#define PC300_CTYPE_MASK (0x00000800UL) - -/* CPLD Registers (base addr = falcbase, TE only) */ -#define CPLD_REG1 0x140 /* Chip resets, DCD/CTS status */ -#define CPLD_REG2 0x144 /* Clock enable , LED control */ - -/* CPLD Register bit description: for the FALC bits, they should always be - set based on the channel (use (bit<<(2*ch)) to access the correct bit for - that channel) */ -#define CPLD_REG1_FALC_RESET 0x01 -#define CPLD_REG1_SCA_RESET 0x02 -#define CPLD_REG1_GLOBAL_CLK 0x08 -#define CPLD_REG1_FALC_DCD 0x10 -#define CPLD_REG1_FALC_CTS 0x20 - -#define CPLD_REG2_FALC_TX_CLK 0x01 -#define CPLD_REG2_FALC_RX_CLK 0x02 -#define CPLD_REG2_FALC_LED1 0x10 -#define CPLD_REG2_FALC_LED2 0x20 - -/* Structure with FALC-related fields (TE only) */ -#define PC300_FALC_MAXLOOP 0x0000ffff /* for falc_issue_cmd() */ - -typedef struct falc { - ucchar sync; /* If true FALC is synchronized */ - ucchar active; /* if TRUE then already active */ - ucchar loop_active; /* if TRUE a line loopback UP was received */ - ucchar loop_gen; /* if TRUE a line loopback UP was issued */ - - ucchar num_channels; - ucchar offset; /* 1 for T1, 0 for E1 */ - ucchar full_bandwidth; - - ucchar xmb_cause; - ucchar multiframe_mode; - - /* Statistics */ - ucshort pden; /* Pulse Density violation count */ - ucshort los; /* Loss of Signal count */ - ucshort losr; /* Loss of Signal recovery count */ - ucshort lfa; /* Loss of frame alignment count */ - ucshort farec; /* Frame Alignment Recovery count */ - ucshort lmfa; /* Loss of multiframe alignment count */ - ucshort ais; /* Remote Alarm indication Signal count */ - ucshort sec; /* One-second timer */ - ucshort es; /* Errored second */ - ucshort rai; /* remote alarm received */ - ucshort bec; - ucshort fec; - ucshort cvc; - ucshort cec; - ucshort ebc; - - /* Status */ - ucchar red_alarm; - ucchar blue_alarm; - ucchar loss_fa; - ucchar yellow_alarm; - ucchar loss_mfa; - ucchar prbs; -} falc_t; - -typedef struct pc300dev { - void *if_ptr; /* General purpose pointer */ - struct pc300ch *chan; -#ifdef __KERNEL__ - char name[16]; - void *private; - hdlc_device *hdlc; - struct net_device_stats stats; - struct sk_buff *tx_skb; -#endif /* __KERNEL__ */ -}pc300dev_t; - -typedef struct pc300hw { - int type; /* RSV, X21, etc. */ - int nchan; /* number of channels */ - int irq; /* interrupt request level */ - uclong clock; /* Board clock */ - uclong plxphys; /* PLX registers MMIO base (physical) */ - uclong plxbase; /* PLX registers MMIO base (virtual) */ - uclong plxsize; /* PLX registers MMIO size */ - uclong scaphys; /* SCA registers MMIO base (physical) */ - uclong scabase; /* SCA registers MMIO base (virtual) */ - uclong scasize; /* SCA registers MMIO size */ - uclong ramphys; /* On-board RAM MMIO base (physical) */ - uclong rambase; /* On-board RAM MMIO base (virtual) */ - uclong ramsize; /* On-board RAM MMIO size */ - uclong falcphys; /* FALC registers MMIO base (physical) */ - uclong falcbase; /* FALC registers MMIO base (virtual) */ - uclong falcsize; /* FALC registers MMIO size */ -} pc300hw_t; - -typedef struct pc300chconf { - ucchar media; /* HW media (RS232, V.35, etc.) */ - uclong proto; /* Protocol (PPP, X.25, etc.) */ - uclong clkrate; /* Clock rate (in bps, 0 = ext. clock) */ - ucchar loopback; /* Loopback mode */ - - /* TE-specific parameters */ - ucchar lcode; /* Line Code (AMI, B8ZS, etc.) */ - ucchar fr_mode; /* Frame Mode (ESF, D4, etc.) */ - ucchar lbo; /* Line Build Out */ - ucchar rx_sens; /* Rx Sensitivity (long- or short-haul) */ - uclong tslot_bitmap; /* bit[i]=1 => timeslot _i_ is active */ -} pc300chconf_t; - -typedef struct pc300ch { - struct pc300 *card; - int channel; - pc300dev_t d; - pc300chconf_t conf; - ucchar tx_first_bd; /* First TX DMA block descr. w/ data */ - ucchar tx_next_bd; /* Next free TX DMA block descriptor */ - ucchar rx_first_bd; /* First free RX DMA block descriptor */ - ucchar rx_last_bd; /* Last free RX DMA block descriptor */ - falc_t falc; /* FALC structure (TE only) */ -} pc300ch_t; - -typedef struct pc300 { - pc300hw_t hw; /* hardware config. */ - pc300ch_t chan[PC300_MAXCHAN]; -#ifdef __KERNEL__ - spinlock_t card_lock; -#endif /* __KERNEL__ */ -} pc300_t; - -/* DEV ioctl() commands */ -#define N_SPPP_IOCTLS 2 - -enum pc300_ioctl_cmds { - SIOCCPCRESERVED = (SIOCDEVPRIVATE + N_SPPP_IOCTLS), - SIOCGPC300CONF, - SIOCSPC300CONF, - SIOCGPC300STATUS, - SIOCGPC300FALCSTATUS, -}; - -/* Control Constant Definitions */ -#define PC300_RSV 0x01 -#define PC300_X21 0x02 -#define PC300_TE 0x03 - -#define PC300_LC_AMI 0x01 -#define PC300_LC_B8ZS 0x02 -#define PC300_LC_NRZ 0x03 -#define PC300_LC_HDB3 0x04 - -/* Framing (T1) */ -#define PC300_FR_ESF 0x01 -#define PC300_FR_D4 0x02 -#define PC300_FR_ESF_JAPAN 0x03 - -/* Framing (E1) */ -#define PC300_FR_MF_CRC4 0x04 -#define PC300_FR_MF_NON_CRC4 0x05 - -#define PC300_LBO_0_DB 0x00 -#define PC300_LBO_7_5_DB 0x01 -#define PC300_LBO_15_DB 0x02 -#define PC300_LBO_22_5_DB 0x03 - -#define PC300_RX_SENS_SH 0x01 -#define PC300_RX_SENS_LH 0x02 - -#define PC300_TX_TIMEOUT (2*HZ) -#define PC300_TX_QUEUE_LEN 10 -#define PC300_DEF_MTU 1500 - -#ifdef __KERNEL__ -/* Function Prototypes */ -static void tx_dma_buf_pt_init(pc300_t *, int); -static void tx_dma_buf_init(pc300_t *, int); -static void rx_dma_buf_pt_init(pc300_t *, int); -static void rx_dma_buf_init(pc300_t *, int); -static void tx_dma_buf_check(pc300_t *, int); -static void rx_dma_buf_check(pc300_t *, int); -int dma_buf_write(pc300_t *, int, ucchar *, int); -int dma_buf_read(pc300_t *, int, struct sk_buff *); -void tx_dma_start(pc300_t *, int); -void rx_dma_start(pc300_t *, int); -void tx_dma_stop(pc300_t *, int); -void rx_dma_stop(pc300_t *, int); -int cpc_queue_xmit(struct sk_buff *, struct device *); -void cpc_net_rx(hdlc_device *); -#ifdef CONFIG_PC300_X25 -int cpc_x25_packetlayer_xmit(struct sk_buff *, struct device *); -void cpc_lapb_connected(void *, int); -void cpc_lapb_disconnected(void *, int); -void cpc_lapb_data_indication(void *, struct sk_buff *); -void cpc_lapb_data_transmit(void *, struct sk_buff *); -#endif /* CONFIG_PC300_X25 */ -static void cpc_intr(int, void *, struct pt_regs *); -void cpc_sca_status(pc300_t *, int); -int cpc_ioctl(hdlc_device *, struct ifreq *, int); -static int clock_rate_calc(uclong, uclong, int *); -int ch_config(pc300dev_t *); -int rx_config(pc300dev_t *); -int tx_config(pc300dev_t *); -int cpc_opench(pc300dev_t *); -void cpc_closech(pc300dev_t *); -int cpc_open(hdlc_device *); -void cpc_close(hdlc_device *); -static uclong detect_ram(pc300_t *); -static void plx_init(pc300_t *); -static int cpc_detect(void); -#endif /* __KERNEL__ */ - -#endif /* _PC300_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/pci.h linux.20p9/include/linux/pci.h --- linux.vanilla/include/linux/pci.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/pci.h Wed Jul 4 16:19:36 2001 @@ -329,6 +329,7 @@ #define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43 #define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011 #define PCI_DEVICE_ID_COMPAQ_CISS 0xb060 +#define PCI_DEVICE_ID_COMPAQ_CISSB 0xb178 #define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130 #define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150 @@ -1350,11 +1351,24 @@ #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) +/* Ioctls for /proc/bus/pci/X/Y nodes. */ +#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8) +#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */ +#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */ +#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */ +#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */ + #ifdef __KERNEL__ #include #include +/* File state for mmap()s on /proc/bus/pci/X/Y */ +enum pci_mmap_state { + pci_mmap_io, + pci_mmap_mem +}; + /* * There is one pci_dev structure for each slot-number/function-number * combination: @@ -1424,6 +1438,10 @@ #define PCIBIOS_SET_FAILED 0x88 #define PCIBIOS_BUFFER_TOO_SMALL 0x89 +/* Include architecture-dependent settings and functions */ + +#include + /* Low-level architecture-dependent routines */ int pcibios_present (void); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/sched.h linux.20p9/include/linux/sched.h --- linux.vanilla/include/linux/sched.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/sched.h Thu Jul 26 17:40:37 2001 @@ -254,6 +254,7 @@ */ struct exec_domain *exec_domain; long need_resched; + unsigned long ptrace; /* various fields */ long counter; @@ -361,8 +362,6 @@ /* Not implemented yet, only for 486*/ #define PF_STARTING 0x00000002 /* being created */ #define PF_EXITING 0x00000004 /* getting shut down */ -#define PF_PTRACED 0x00000010 /* set if ptrace (0) has been called */ -#define PF_TRACESYS 0x00000020 /* tracing system calls */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ #define PF_DUMPCORE 0x00000200 /* dumped core */ @@ -372,7 +371,14 @@ #define PF_FREE_PAGES 0x00002000 /* The current-> */ #define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */ -#define PF_DTRACE 0x00200000 /* delayed trace (used on m68k, i386) */ + +/* + * Ptrace flags + */ +#define PT_PTRACED 0x00000001 /* set if ptrace (0) has been called */ +#define PT_TRACESYS 0x00000002 /* tracing system calls */ +#define PT_DTRACE 0x00000004 /* delayed trace (used on m68k, i386) */ + /* * Limit the stack by to some sane default: root can always @@ -387,7 +393,7 @@ * your own risk!. Base=0, limit=0x1fffff (=2MB) */ #define INIT_TASK \ -/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0, \ +/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0,0, \ /* counter */ DEF_PRIORITY,DEF_PRIORITY,0, \ /* SMP */ 0,0,0,-1, \ /* schedlink */ &init_task,&init_task, &init_task, &init_task, \ @@ -500,7 +506,7 @@ extern unsigned long volatile jiffies; extern unsigned long itimer_ticks; extern unsigned long itimer_next; -extern struct timeval xtime; +extern volatile struct timeval xtime; extern void do_timer(struct pt_regs *); extern unsigned int * prof_buffer; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/sunrpc/sched.h linux.20p9/include/linux/sunrpc/sched.h --- linux.vanilla/include/linux/sunrpc/sched.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/sunrpc/sched.h Thu Jul 26 17:40:54 2001 @@ -81,7 +81,7 @@ unsigned int tk_lock; /* Task lock counter */ unsigned char tk_active : 1,/* Task has been activated */ tk_wakeup : 1;/* Task waiting to wake up */ - unsigned int tk_runstate; /* Task run status */ + unsigned long tk_runstate; /* Task run status */ #ifdef RPC_DEBUG unsigned int tk_pid; /* debugging aid */ #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/sunrpc/xprt.h linux.20p9/include/linux/sunrpc/xprt.h --- linux.vanilla/include/linux/sunrpc/xprt.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/sunrpc/xprt.h Thu Jul 26 18:26:56 2001 @@ -143,7 +143,7 @@ struct rpc_wait_queue pingwait; /* waiting on ping() */ struct rpc_rqst * free; /* free slots */ struct rpc_rqst slot[RPC_MAXREQS]; - unsigned int sockstate; /* Socket state */ + unsigned long sockstate; /* Socket state */ unsigned char nocong : 1,/* no congestion control */ stream : 1,/* TCP */ shutdown : 1,/* being shut down */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/synclink.h linux.20p9/include/linux/synclink.h --- linux.vanilla/include/linux/synclink.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/synclink.h Wed Jul 4 16:04:00 2001 @@ -1,7 +1,7 @@ /* * SyncLink Multiprotocol Serial Adapter Driver * - * $Id: synclink.h,v 2.2 2000/11/08 17:08:30 paul Exp $ + * $Id: synclink.h,v 2.5 2001/03/26 17:04:35 ez Exp $ * * Copyright (C) 1998-2000 by Microgate Corporation * @@ -11,7 +11,7 @@ #ifndef _SYNCLINK_H_ #define _SYNCLINK_H_ -#define SYNCLINK_H_VERSION 2.2 +#define SYNCLINK_H_VERSION 2.5 #define BOOLEAN int #define TRUE 1 @@ -84,6 +84,11 @@ #define HDLC_CRC_NONE 0 #define HDLC_CRC_16_CCITT 1 #define HDLC_CRC_32_CCITT 2 +#define HDLC_CRC_MASK 0x00ff +#define HDLC_CRC_RETURN_EX 0x8000 + +#define RX_OK 0 +#define RX_CRC_ERROR 1 #define HDLC_TXIDLE_FLAGS 0 #define HDLC_TXIDLE_ALT_ZEROS_ONES 1 @@ -117,6 +122,7 @@ #define MGSL_MODE_ASYNC 1 #define MGSL_MODE_HDLC 2 +#define MGSL_MODE_RAW 6 #define MGSL_BUS_TYPE_ISA 1 #define MGSL_BUS_TYPE_EISA 2 @@ -150,6 +156,8 @@ #define MICROGATE_VENDOR_ID 0x13c0 #define SYNCLINK_DEVICE_ID 0x0010 +#define MGSCC_DEVICE_ID 0x0020 +#define SYNCLINK_SCA_DEVICE_ID 0x0030 #define MGSL_MAX_SERIAL_NUMBER 30 /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/tty.h linux.20p9/include/linux/tty.h --- linux.vanilla/include/linux/tty.h Sun Mar 25 17:31:03 2001 +++ linux.20p9/include/linux/tty.h Thu Jul 26 17:40:36 2001 @@ -364,6 +364,8 @@ extern int specialix_init(void); extern int espserial_init(void); extern int macserial_init(void); +extern int mgsl_init(void); +extern int n_hdlc_init(void); extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device, const char *routine); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/linux/usb.h linux.20p9/include/linux/usb.h --- linux.vanilla/include/linux/usb.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/linux/usb.h Wed Aug 8 22:33:32 2001 @@ -236,36 +236,36 @@ /* Endpoint descriptor */ struct usb_endpoint_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u8 bEndpointAddress; - __u8 bmAttributes; - __u16 wMaxPacketSize; - __u8 bInterval; - __u8 bRefresh; - __u8 bSynchAddress; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u8 bEndpointAddress __attribute__ ((packed)); + __u8 bmAttributes __attribute__ ((packed)); + __u16 wMaxPacketSize __attribute__ ((packed)); + __u8 bInterval __attribute__ ((packed)); + __u8 bRefresh __attribute__ ((packed)); + __u8 bSynchAddress __attribute__ ((packed)); unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; /* Interface descriptor */ struct usb_interface_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u8 bInterfaceNumber; - __u8 bAlternateSetting; - __u8 bNumEndpoints; - __u8 bInterfaceClass; - __u8 bInterfaceSubClass; - __u8 bInterfaceProtocol; - __u8 iInterface; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u8 bInterfaceNumber __attribute__ ((packed)); + __u8 bAlternateSetting __attribute__ ((packed)); + __u8 bNumEndpoints __attribute__ ((packed)); + __u8 bInterfaceClass __attribute__ ((packed)); + __u8 bInterfaceSubClass __attribute__ ((packed)); + __u8 bInterfaceProtocol __attribute__ ((packed)); + __u8 iInterface __attribute__ ((packed)); struct usb_endpoint_descriptor *endpoint; - unsigned char *extra; /* Extra descriptors */ + unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; struct usb_interface { struct usb_interface_descriptor *altsetting; @@ -280,20 +280,20 @@ /* Configuration descriptor information.. */ struct usb_config_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u16 wTotalLength; - __u8 bNumInterfaces; - __u8 bConfigurationValue; - __u8 iConfiguration; - __u8 bmAttributes; - __u8 MaxPower; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u16 wTotalLength __attribute__ ((packed)); + __u8 bNumInterfaces __attribute__ ((packed)); + __u8 bConfigurationValue __attribute__ ((packed)); + __u8 iConfiguration __attribute__ ((packed)); + __u8 bmAttributes __attribute__ ((packed)); + __u8 MaxPower __attribute__ ((packed)); struct usb_interface *interface; - unsigned char *extra; /* Extra descriptors */ + unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; /* String descriptor */ struct usb_string_descriptor { @@ -317,6 +317,7 @@ struct semaphore serialize; + /* ioctl -- userspace apps can talk to drivers through usbdevfs */ int (*ioctl)(struct usb_device *dev, unsigned int code, void *buf); }; @@ -350,6 +351,8 @@ #define USB_URB_EARLY_COMPLETE 0x0004 #define USB_ASYNC_UNLINK 0x0008 #define USB_QUEUE_BULK 0x0010 +#define USB_NO_FSBR 0x0020 +#define USB_ZERO_PACKET 0x0040 // Finish bulk OUTs always with zero length packet #define USB_TIMEOUT_KILLED 0x1000 // only set by HCD! typedef struct @@ -372,7 +375,7 @@ struct usb_device *dev; // pointer to associated USB device unsigned int pipe; // pipe information int status; // returned status - unsigned int transfer_flags; // USB_DISABLE_SPD | USB_ISO_ASAP | USB_URB_EARLY_COMPLETE + unsigned int transfer_flags; // USB_DISABLE_SPD | USB_ISO_ASAP | etc. void *transfer_buffer; // associated data buffer int transfer_buffer_length; // data buffer length int actual_length; // actual data buffer length @@ -486,12 +489,18 @@ int (*unlink_urb) (struct urb* purb); }; +#define DEVNUM_ROUND_ROBIN /***** OPTION *****/ + /* * Allocated per bus we have */ struct usb_bus { int busnum; /* Bus number (in order of reg) */ +#ifdef DEVNUM_ROUND_ROBIN + int devnum_next; /* Next open device number in round-robin allocation */ +#endif /* DEVNUM_ROUND_ROBIN */ + struct usb_devmap devmap; /* Device map */ struct usb_operations *op; /* Operations (specific to the HC) */ struct usb_device *root_hub; /* Root hub */ @@ -508,6 +517,8 @@ /* usbdevfs inode list */ struct list_head inodes; + + atomic_t refcnt; }; #define USB_MAXCHILDREN (16) /* This is arbitrary */ @@ -779,13 +790,13 @@ #else /* CONFIG_USB_DEVICEFS */ -extern inline void usbdevfs_add_bus(struct usb_bus *bus) {} -extern inline void usbdevfs_remove_bus(struct usb_bus *bus) {} -extern inline void usbdevfs_add_device(struct usb_device *dev) {} -extern inline void usbdevfs_remove_device(struct usb_device *dev) {} +static inline void usbdevfs_add_bus(struct usb_bus *bus) {} +static inline void usbdevfs_remove_bus(struct usb_bus *bus) {} +static inline void usbdevfs_add_device(struct usb_device *dev) {} +static inline void usbdevfs_remove_device(struct usb_device *dev) {} -extern inline int usbdevfs_init(void) { return 0; } -extern inline void usbdevfs_cleanup(void) { } +static inline int usbdevfs_init(void) { return 0; } +static inline void usbdevfs_cleanup(void) { } #endif /* CONFIG_USB_DEVICEFS */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/net/ip.h linux.20p9/include/net/ip.h --- linux.vanilla/include/net/ip.h Sun Mar 25 17:37:40 2001 +++ linux.20p9/include/net/ip.h Wed Aug 8 22:30:21 2001 @@ -170,7 +170,7 @@ extern __inline__ int ip_decrease_ttl(struct iphdr *iph) { - u16 check = iph->check; + u32 check = iph->check; check += __constant_htons(0x0100); iph->check = check + ((check>=0xFFFF) ? 1 : 0); return --iph->ttl; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/scsi/sg.h linux.20p9/include/scsi/sg.h --- linux.vanilla/include/scsi/sg.h Sun Mar 25 17:31:09 2001 +++ linux.20p9/include/scsi/sg.h Wed Jul 4 16:04:00 2001 @@ -9,12 +9,14 @@ Original driver (sg.h): * Copyright (C) 1992 Lawrence Foard 2.x extensions to driver: -* Copyright (C) 1998 - 2000 Douglas Gilbert +* Copyright (C) 1998 - 2001 Douglas Gilbert - Version: 2.1.39 (20000626) + Version: 2.1.40 (20010620) This version for 2.2.x series kernels D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au) + Changes since 2.1.38 (20000626) + - fix bug that caused long wait when large buffer requested Changes since 2.1.38 (20000527) - more scatter gather fine tuning for sym53c416 Changes since 2.1.37 (20000504) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/include/video/macmodes.h linux.20p9/include/video/macmodes.h --- linux.vanilla/include/video/macmodes.h Sun Mar 25 17:31:10 2001 +++ linux.20p9/include/video/macmodes.h Wed Aug 8 22:16:01 2001 @@ -38,7 +38,9 @@ #define VMODE_1152_870_75 18 /* 1152x870, 75Hz */ #define VMODE_1280_960_75 19 /* 1280x960, 75Hz */ #define VMODE_1280_1024_75 20 /* 1280x1024, 75Hz */ -#define VMODE_MAX 20 +#define VMODE_1152_768_60 21 /* 1152x768, 60Hz */ +#define VMODE_1600_1024_60 22 /* 1600x1024, 60Hz */ +#define VMODE_MAX 22 #define VMODE_CHOOSE 99 #define CMODE_NVRAM -1 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/init/main.c linux.20p9/init/main.c --- linux.vanilla/init/main.c Sun Mar 25 17:37:40 2001 +++ linux.20p9/init/main.c Wed Jul 4 16:04:00 2001 @@ -462,13 +462,8 @@ const char *name; const int num; } root_dev_names[] __initdata = { -#ifdef CONFIG_ROOT_NFS { "nfs", 0x00ff }, -#endif -#ifdef CONFIG_BLK_DEV_LOOP { "loop", 0x0700 }, -#endif -#ifdef CONFIG_BLK_DEV_IDE { "hda", 0x0300 }, { "hdb", 0x0340 }, { "hdc", 0x1600 }, @@ -481,8 +476,6 @@ { "hdj", 0x3840 }, { "hdk", 0x3900 }, { "hdl", 0x3940 }, -#endif -#ifdef CONFIG_BLK_DEV_SD { "sda", 0x0800 }, { "sdb", 0x0810 }, { "sdc", 0x0820 }, @@ -499,8 +492,6 @@ { "sdn", 0x08d0 }, { "sdo", 0x08e0 }, { "sdp", 0x08f0 }, -#endif -#ifdef CONFIG_BLK_DEV_DAC960 { "rd/c0d0p",0x3000 }, { "rd/c0d1p",0x3008 }, { "rd/c0d2p",0x3010 }, @@ -517,8 +508,6 @@ { "rd/c0d13p",0x3068 }, { "rd/c0d14p",0x3070 }, { "rd/c0d15p",0x3078 }, -#endif -#if defined(CONFIG_BLK_CPQ_DA) || defined(CONFIG_BLK_CPQ_DA_MODULE) { "ida/c0d0p",0x4800 }, { "ida/c0d1p",0x4810 }, { "ida/c0d2p",0x4820 }, @@ -535,71 +524,34 @@ { "ida/c0d13p",0x48D0 }, { "ida/c0d14p",0x48E0 }, { "ida/c0d15p",0x48F0 }, -#endif -#ifdef CONFIG_ATARI_ACSI { "ada", 0x1c00 }, { "adb", 0x1c10 }, { "adc", 0x1c20 }, { "add", 0x1c30 }, { "ade", 0x1c40 }, -#endif -#ifdef CONFIG_BLK_DEV_FD { "fd", 0x0200 }, -#endif -#ifdef CONFIG_MD_BOOT { "md", 0x0900 }, -#endif -#ifdef CONFIG_BLK_DEV_XD { "xda", 0x0d00 }, { "xdb", 0x0d40 }, -#endif -#ifdef CONFIG_BLK_DEV_RAM { "ram", 0x0100 }, -#endif -#ifdef CONFIG_BLK_DEV_SR { "scd", 0x0b00 }, -#endif -#ifdef CONFIG_MCD { "mcd", 0x1700 }, -#endif -#ifdef CONFIG_CDU535 { "cdu535", 0x1800 }, { "sonycd", 0x1800 }, -#endif -#ifdef CONFIG_AZTCD { "aztcd", 0x1d00 }, -#endif -#ifdef CONFIG_CM206 { "cm206cd", 0x2000 }, -#endif -#ifdef CONFIG_GSCD { "gscd", 0x1000 }, -#endif -#ifdef CONFIG_SBPCD { "sbpcd", 0x1900 }, -#endif -#ifdef CONFIG_BLK_DEV_PS2 { "eda", 0x2400 }, { "edb", 0x2440 }, -#endif -#ifdef CONFIG_PARIDE_PD { "pda", 0x2d00 }, { "pdb", 0x2d10 }, { "pdc", 0x2d20 }, { "pdd", 0x2d30 }, -#endif -#ifdef CONFIG_PARIDE_PCD { "pcd", 0x2e00 }, -#endif -#ifdef CONFIG_PARIDE_PF { "pf", 0x2f00 }, -#endif -#if CONFIG_APBLOCK { "apblock", APBLOCK_MAJOR << 8}, -#endif -#if CONFIG_DDV { "ddv", DDV_MAJOR << 8}, -#endif #ifdef CONFIG_MDISK { "mnda", (MDISK_MAJOR << MINORBITS)}, { "mndb", (MDISK_MAJOR << MINORBITS) + 1}, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/kernel/exit.c linux.20p9/kernel/exit.c --- linux.vanilla/kernel/exit.c Sun Mar 25 17:37:40 2001 +++ linux.20p9/kernel/exit.c Wed Jul 4 16:04:00 2001 @@ -339,7 +339,7 @@ p = current->p_cptr; current->p_cptr = p->p_osptr; p->p_ysptr = NULL; - p->flags &= ~(PF_PTRACED|PF_TRACESYS); + p->ptrace &= ~(PT_PTRACED|PT_TRACESYS); p->p_pptr = p->p_opptr; p->p_osptr = p->p_pptr->p_cptr; @@ -475,7 +475,7 @@ case TASK_STOPPED: if (!p->exit_code) continue; - if (!(options & WUNTRACED) && !(p->flags & PF_PTRACED)) + if (!(options & WUNTRACED) && !(p->ptrace & PT_PTRACED)) continue; read_unlock(&tasklist_lock); retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/kernel/fork.c linux.20p9/kernel/fork.c --- linux.vanilla/kernel/fork.c Sun Mar 25 17:37:40 2001 +++ linux.20p9/kernel/fork.c Wed Jul 4 16:04:00 2001 @@ -557,7 +557,7 @@ new_flags &= ~(PF_SUPERPRIV | PF_USEDFPU | PF_VFORK); new_flags |= PF_FORKNOEXEC; if (!(clone_flags & CLONE_PTRACE)) - new_flags &= ~(PF_PTRACED|PF_TRACESYS); + p->ptrace = 0; if (clone_flags & CLONE_VFORK) new_flags |= PF_VFORK; p->flags = new_flags; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/kernel/ksyms.c linux.20p9/kernel/ksyms.c --- linux.vanilla/kernel/ksyms.c Sun Mar 25 17:31:02 2001 +++ linux.20p9/kernel/ksyms.c Thu Jul 26 15:53:16 2001 @@ -81,6 +81,7 @@ #ifdef CONFIG_MODULES EXPORT_SYMBOL(get_module_symbol); +EXPORT_SYMBOL(try_inc_mod_count); #endif EXPORT_SYMBOL(get_options); @@ -274,6 +275,7 @@ EXPORT_SYMBOL(prepare_binprm); EXPORT_SYMBOL(compute_creds); EXPORT_SYMBOL(remove_arg_zero); +EXPORT_SYMBOL(set_binfmt); /* execution environment registration */ EXPORT_SYMBOL(lookup_exec_domain); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/kernel/module.c linux.20p9/kernel/module.c --- linux.vanilla/kernel/module.c Sun Mar 25 17:31:02 2001 +++ linux.20p9/kernel/module.c Thu Jul 26 15:52:52 2001 @@ -356,6 +356,21 @@ return error; } +static spinlock_t unload_lock = SPIN_LOCK_UNLOCKED; +int try_inc_mod_count(struct module *mod) +{ + int res = 1; + if (mod) { + spin_lock(&unload_lock); + if (mod->flags & MOD_DELETED) + res = 0; + else + __MOD_INC_USE_COUNT(mod); + spin_unlock(&unload_lock); + } + return res; +} + asmlinkage int sys_delete_module(const char *name_user) { @@ -383,11 +398,18 @@ } put_mod_name(name); error = -EBUSY; - if (mod->refs != NULL || __MOD_IN_USE(mod)) + if (mod->refs != NULL) goto out; - free_module(mod, 0); - error = 0; + spin_lock(&unload_lock); + if (!__MOD_IN_USE(mod)) { + mod->flags |= MOD_DELETED; + spin_unlock(&unload_lock); + free_module(mod, 0); + error = 0; + } else { + spin_unlock(&unload_lock); + } goto out; } @@ -396,6 +418,7 @@ something_changed = 0; for (mod = module_list; mod != &kernel_module; mod = next) { next = mod->next; + spin_lock(&unload_lock); if (mod->refs == NULL && (mod->flags & MOD_AUTOCLEAN) && (mod->flags & MOD_RUNNING) @@ -404,11 +427,16 @@ && !__MOD_IN_USE(mod)) { if ((mod->flags & MOD_VISITED) && !(mod->flags & MOD_JUST_FREED)) { + spin_unlock(&unload_lock); mod->flags &= ~MOD_VISITED; } else { + mod->flags |= MOD_DELETED; + spin_unlock(&unload_lock); free_module(mod, 1); something_changed = 1; } + } else { + spin_unlock(&unload_lock); } } if (something_changed) @@ -781,7 +809,6 @@ /* Let the module clean up. */ - mod->flags |= MOD_DELETED; if (mod->flags & MOD_RUNNING) { if(mod->cleanup) @@ -1017,4 +1044,9 @@ return -ENOSYS; } +int try_inc_mod_count(struct module *mod) +{ + return 1; +} + #endif /* CONFIG_MODULES */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/kernel/signal.c linux.20p9/kernel/signal.c --- linux.vanilla/kernel/signal.c Sun Mar 25 17:37:40 2001 +++ linux.20p9/kernel/signal.c Wed Jul 4 16:04:00 2001 @@ -222,7 +222,7 @@ struct k_sigaction *ka; /* Don't ignore traced or blocked signals */ - if ((t->flags & PF_PTRACED) || sigismember(&t->blocked, sig)) + if ((t->ptrace & PT_PTRACED) || sigismember(&t->blocked, sig)) return 0; signals = t->sig; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/mm/slab.c linux.20p9/mm/slab.c --- linux.vanilla/mm/slab.c Sun Mar 25 17:31:03 2001 +++ linux.20p9/mm/slab.c Wed Jul 4 16:07:22 2001 @@ -1257,7 +1257,7 @@ /* A series of memory allocations for a new slab. * Neither the cache-chain semaphore, or cache-lock, are * held, but the incrementing c_growing prevents this - * this cache from being reaped or shrunk. + * cache from being reaped or shrunk. * Note: The cache could be selected in for reaping in * kmem_cache_reap(), but when the final test is made the * growing value will be seen. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/mm/swapfile.c linux.20p9/mm/swapfile.c --- linux.vanilla/mm/swapfile.c Sun Mar 25 17:31:03 2001 +++ linux.20p9/mm/swapfile.c Wed Jul 4 16:04:00 2001 @@ -448,7 +448,7 @@ len += sprintf(buf, "Filename\t\t\tType\t\tSize\tUsed\tPriority\n"); for (i = 0 ; i < nr_swapfiles ; i++, ptr++) { - if (ptr->flags & SWP_USED) { + if ((ptr->flags & SWP_USED) && ptr->swap_map) { char * path = d_path(ptr->swap_file, page, PAGE_SIZE); len += sprintf(buf + len, "%-31s ", path); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/core/dev.c linux.20p9/net/core/dev.c --- linux.vanilla/net/core/dev.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/core/dev.c Wed Jul 4 16:04:00 2001 @@ -2105,7 +2105,7 @@ #ifdef CONFIG_PC300 cpc_init(); #endif -#ifdef CONFIG_HDLC +#ifdef CONFIG_SYNCPPP sync_ppp_init(); #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/core/sock.c linux.20p9/net/core/sock.c --- linux.vanilla/net/core/sock.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/core/sock.c Wed Aug 8 22:26:17 2001 @@ -7,7 +7,7 @@ * handler for protocols to use and generic option handler. * * - * Version: $Id: sock.c,v 1.80.2.3 2000/08/10 00:37:05 davem Exp $ + * Version: $Id: sock.c,v 1.80.2.5 2001/05/11 02:07:23 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -752,9 +752,11 @@ break; try_size = fallback; } - skb = sock_wmalloc(sk, try_size, 0, sk->allocation); + skb = sock_wmalloc_err(sk, try_size, 0, sk->allocation, &err); if (skb) break; + if (err) + goto failure; /* * This means we have too many buffers for this socket already. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/af_inet.c linux.20p9/net/ipv4/af_inet.c --- linux.vanilla/net/ipv4/af_inet.c Sun Mar 25 17:31:12 2001 +++ linux.20p9/net/ipv4/af_inet.c Wed Jul 4 16:04:00 2001 @@ -877,7 +877,8 @@ case SIOCGSTAMP: if(sk->stamp.tv_sec==0) return -ENOENT; - err = copy_to_user((void *)arg,&sk->stamp,sizeof(struct timeval)); + err = copy_to_user((void *)arg, &sk->stamp, + sizeof(struct timeval)); if (err) err = -EFAULT; return err; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/arp.c linux.20p9/net/ipv4/arp.c --- linux.vanilla/net/ipv4/arp.c Sun Mar 25 17:31:12 2001 +++ linux.20p9/net/ipv4/arp.c Thu Jul 26 15:39:52 2001 @@ -1,6 +1,6 @@ /* linux/net/inet/arp.c * - * Version: $Id: arp.c,v 1.77.2.7 2000/10/29 11:41:15 davem Exp $ + * Version: $Id: arp.c,v 1.77.2.8 2001/07/06 11:36:55 davem Exp $ * * Copyright (C) 1994 by Florian La Roche * @@ -731,7 +731,8 @@ (addr_type == RTN_UNICAST && rt->u.dst.dev != dev && (IN_DEV_PROXY_ARP(in_dev) || pneigh_lookup(&arp_tbl, &tip, dev, 0)))) { n = neigh_event_ns(&arp_tbl, sha, &sip, dev); - neigh_release(n); + if (n) + neigh_release(n); if (skb->stamp.tv_sec == 0 || skb->pkt_type == PACKET_HOST || diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/ip_input.c linux.20p9/net/ipv4/ip_input.c --- linux.vanilla/net/ipv4/ip_input.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/ip_input.c Wed Jul 4 16:04:00 2001 @@ -5,7 +5,7 @@ * * The Internet Protocol (IP) module. * - * Version: $Id: ip_input.c,v 1.37.2.4 2001/01/04 04:20:16 davem Exp $ + * Version: $Id: ip_input.c,v 1.37.2.5 2001/06/07 06:47:54 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -181,8 +181,11 @@ int type; type = skb->h.icmph->type; - if (type < 32) - return test_bit(type, &sk->tp_pinfo.tp_raw4.filter); + if (type < 32) { + __u32 data = sk->tp_pinfo.tp_raw4.filter.data; + + return ((1 << type) & data) != 0; + } /* Do not block unknown ICMP types */ return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/ip_masq_irc.c linux.20p9/net/ipv4/ip_masq_irc.c --- linux.vanilla/net/ipv4/ip_masq_irc.c Sun Mar 25 17:31:12 2001 +++ linux.20p9/net/ipv4/ip_masq_irc.c Wed Aug 8 22:22:35 2001 @@ -22,6 +22,7 @@ * * Scottie Shore : added support for mIRC DCC resume negotiation * + * Juan Jose Ciarlante : src addr/port checking for better security (spotted by Michal Zalewski) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -38,7 +39,12 @@ * /etc/conf.modules (or /etc/modules.conf depending on your config) * where modload will pick it up should you use modload to load your * modules. - * + * + * Insecure "back" data channel opening + * The helper does some trivial checks when opening a new DCC data + * channel. Use module parameter + * insecure=1 + * ... to avoid this and get previous (pre 2.2.20) behaviour. */ #include @@ -72,6 +78,9 @@ MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_MASQ_APP_PORTS) "i"); +static int insecure=0; +MODULE_PARM(insecure, "i"); + /* * List of supported DCC protocols @@ -110,6 +119,30 @@ return 0; } + +/* + * Ugly workaround [TM] --mummy ... why does this protocol sucks? + * + * The <1024 check and same source address just raise the + * security "feeling" => they don't prevent a redirector listening + * in same src address at a higher port; you should protect + * your internal network with ipchains output rules anyway + */ + +static inline int masq_irc_out_check(const struct ip_masq *ms, __u32 data_saddr, __u16 data_sport) { + int allow=1; + + IP_MASQ_DEBUG(1-debug, "masq_irc_out_check( s_addr=%d.%d.%d.%d, data_saddr=%d.%d.%d.%d, data_sport=%d", + NIPQUAD(ms->saddr), NIPQUAD(data_saddr), ntohs(data_sport)); + + /* + * Ignore data channel back to other src addr, nor to port < 1024 + */ + if (ms->saddr != data_saddr || ntohs(data_sport) < 1024) + allow=0; + + return allow; +} int masq_irc_out (struct ip_masq_app *mapp, struct ip_masq *ms, struct sk_buff **skb_p, __u32 maddr) { @@ -118,7 +151,7 @@ struct tcphdr *th; char *data, *data_limit; __u32 s_addr; - __u16 s_port; + __u32 s_port; /* larger to allow strtoul() return value validation */ struct ip_masq *n_ms; char buf[20]; /* "m_addr m_port" (dec base)*/ unsigned buf_len; @@ -199,12 +232,25 @@ s_port = simple_strtoul(data,&data,10); addr_end_p = data; + /* Sanity checks */ + if (!s_addr || !s_port || s_port > 65535) + continue; + + /* Prefer net order from now on */ + s_addr = htonl(s_addr); + s_port = htons(s_port); + + /* Simple validation */ + if (!insecure && !masq_irc_out_check(ms, s_addr, s_port)) + /* We may just: return 0; */ + continue; + /* Do we already have a port open for this client? * If so, use it (for DCC ACCEPT) */ n_ms = ip_masq_out_get(IPPROTO_TCP, - htonl(s_addr),htons(s_port), + s_addr, s_port, 0, 0); /* @@ -216,7 +262,7 @@ if (n_ms==NULL) n_ms = ip_masq_new(IPPROTO_TCP, maddr, 0, - htonl(s_addr),htons(s_port), + s_addr, s_port, 0, 0, IP_MASQ_F_NO_DPORT|IP_MASQ_F_NO_DADDR); if (n_ms==NULL) @@ -236,7 +282,10 @@ diff = buf_len - (addr_end_p-addr_beg_p); *addr_beg_p = '\0'; - IP_MASQ_DEBUG(1-debug, "masq_irc_out(): '%s' %X:%X detected (diff=%d)\n", dcc_p, s_addr,s_port, diff); + IP_MASQ_DEBUG(1-debug, "masq_irc_out(): '%s' %d.%d.%d.%d:%d -> %d.%d.%d.%d:%d detected (diff=%d)\n", dcc_p, + NIPQUAD(s_addr), htons(s_port), + NIPQUAD(n_ms->maddr), htons(n_ms->mport), + diff); /* * No shift. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/ip_masq_vdolive.c linux.20p9/net/ipv4/ip_masq_vdolive.c --- linux.vanilla/net/ipv4/ip_masq_vdolive.c Sun Mar 25 17:31:12 2001 +++ linux.20p9/net/ipv4/ip_masq_vdolive.c Wed Jul 4 16:04:00 2001 @@ -242,7 +242,7 @@ ports[i]))) { return j; } - IP_MASQ_DEBUG(1-debug, "RealAudio: loaded support on port[%d] = %d\n", i, ports[i]); + IP_MASQ_DEBUG(1-debug, "VDOlive: loaded support on port[%d] = %d\n", i, ports[i]); } else { /* To be safe, force the incarnation table entry to NULL */ masq_incarnations[i] = NULL; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/ip_sockglue.c linux.20p9/net/ipv4/ip_sockglue.c --- linux.vanilla/net/ipv4/ip_sockglue.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/ip_sockglue.c Wed Jul 4 16:04:00 2001 @@ -5,7 +5,7 @@ * * The IP to API glue. * - * Version: $Id: ip_sockglue.c,v 1.42 1999/04/22 10:07:34 davem Exp $ + * Version: $Id: ip_sockglue.c,v 1.42.2.1 2001/02/20 04:21:46 davem Exp $ * * Authors: see ip.c * diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/ipmr.c linux.20p9/net/ipv4/ipmr.c --- linux.vanilla/net/ipv4/ipmr.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/ipmr.c Wed Jul 4 16:04:00 2001 @@ -9,7 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Version: $Id: ipmr.c,v 1.40.2.2 1999/06/20 21:27:44 davem Exp $ + * Version: $Id: ipmr.c,v 1.40.2.3 2001/02/20 04:21:46 davem Exp $ * * Fixes: * Michael Chastain : Incorrect size of copying. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/raw.c linux.20p9/net/ipv4/raw.c --- linux.vanilla/net/ipv4/raw.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/raw.c Wed Jul 4 16:04:00 2001 @@ -5,7 +5,7 @@ * * RAW - implementation of IP "raw" sockets. * - * Version: $Id: raw.c,v 1.39.2.1 1999/06/20 20:14:50 davem Exp $ + * Version: $Id: raw.c,v 1.39.2.2 2001/02/20 04:21:46 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/route.c linux.20p9/net/ipv4/route.c --- linux.vanilla/net/ipv4/route.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/route.c Wed Jul 4 16:04:00 2001 @@ -5,7 +5,7 @@ * * ROUTE - implementation of the IP router. * - * Version: $Id: route.c,v 1.67.2.5 2000/09/01 23:19:46 davem Exp $ + * Version: $Id: route.c,v 1.67.2.6 2001/02/09 08:43:58 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/sysctl_net_ipv4.c linux.20p9/net/ipv4/sysctl_net_ipv4.c --- linux.vanilla/net/ipv4/sysctl_net_ipv4.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/sysctl_net_ipv4.c Wed Jul 4 16:04:01 2001 @@ -1,7 +1,7 @@ /* * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. * - * $Id: sysctl_net_ipv4.c,v 1.38.2.4 2000/09/16 09:40:00 davem Exp $ + * $Id: sysctl_net_ipv4.c,v 1.38.2.5 2001/02/09 08:43:58 davem Exp $ * * Begun April 1, 1996, Mike Shaver. * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/tcp.c linux.20p9/net/ipv4/tcp.c --- linux.vanilla/net/ipv4/tcp.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/tcp.c Wed Jul 4 16:04:01 2001 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp.c,v 1.140.2.16 2001/01/04 05:28:46 davem Exp $ + * Version: $Id: tcp.c,v 1.140.2.17 2001/02/20 04:21:46 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/tcp_input.c linux.20p9/net/ipv4/tcp_input.c --- linux.vanilla/net/ipv4/tcp_input.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv4/tcp_input.c Wed Jul 4 16:04:01 2001 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_input.c,v 1.164.2.21 2001/03/06 05:39:39 davem Exp $ + * Version: $Id: tcp_input.c,v 1.164.2.25 2001/05/24 22:33:21 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -734,8 +734,6 @@ if (tp->retransmits) { if (tp->packets_out == 0) { tp->retransmits = 0; - tp->fackets_out = 0; - tp->retrans_out = 0; tp->backoff = 0; tcp_set_rto(tp); } else { @@ -782,8 +780,10 @@ if(sk->zapped) return(1); /* Dead, can't ack any more so why bother */ - if (tp->pending == TIME_KEEPOPEN) + if (tp->pending == TIME_KEEPOPEN) { tp->probes_out = 0; + tp->pending = 0; + } tp->rcv_tstamp = tcp_time_stamp; @@ -851,8 +851,6 @@ if (tp->retransmits) { if (tp->packets_out == 0) { tp->retransmits = 0; - tp->fackets_out = 0; - tp->retrans_out = 0; } } else { /* We don't have a timestamp. Can only use @@ -879,6 +877,8 @@ tcp_ack_packets_out(sk, tp); } else { tcp_clear_xmit_timer(sk, TIME_RETRANS); + tp->fackets_out = 0; + tp->retrans_out = 0; } flag &= (FLAG_DATA | FLAG_WIN_UPDATE); @@ -1441,8 +1441,8 @@ if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { /* A retransmit, 2nd most common case. Force an imediate ack. */ SOCK_DEBUG(sk, "retransmit received: seq %X\n", TCP_SKB_CB(skb)->seq); - tcp_enter_quickack_mode(tp); out_of_window: + tcp_enter_quickack_mode(tp); tp->delayed_acks++; kfree_skb(skb); return; @@ -1538,7 +1538,7 @@ skb_pull(skb, th->doff*4); skb_trim(skb, len - (th->doff*4)); - if (skb->len == 0 && !th->fin) + if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) return(0); /* @@ -1961,7 +1961,7 @@ * Dave!!! Phrase above (and all about rcv_mss) has * nothing to do with reality. rcv_mss must measure TOTAL * size, including sacks, IP options etc. Hence, measure_rcv_mss - * must occure before pulling etc, otherwise it will flap + * must occur before pulling etc, otherwise it will flap * like hell. Even putting it before tcp_data is wrong, * it should use skb->tail - skb->nh.raw instead. * --ANK (980805) @@ -2280,10 +2280,8 @@ tcp_sync_mss(sk, tp->pmtu_cookie); tp->rcv_mss = tp->mss_cache; - if (sk->state == TCP_SYN_RECV) - goto discard; - - goto step6; + /* Discard data/urg received with SYN. Safety is the first. */ + goto discard; } /* Parse the tcp_options present on this header. @@ -2418,7 +2416,6 @@ } else goto discard; -step6: /* step 6: check the URG bit */ tcp_urg(sk, th, len); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv4/tcp_output.c linux.20p9/net/ipv4/tcp_output.c --- linux.vanilla/net/ipv4/tcp_output.c Sun Mar 25 17:31:12 2001 +++ linux.20p9/net/ipv4/tcp_output.c Wed Jul 4 16:04:01 2001 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_output.c,v 1.108.2.11 2000/11/10 12:43:29 davem Exp $ + * Version: $Id: tcp_output.c,v 1.108.2.12 2001/04/10 19:58:44 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -547,6 +547,8 @@ */ kfree_skb(next_skb); sk->tp_pinfo.af_tcp.packets_out--; + if (sk->tp_pinfo.af_tcp.fackets_out) + sk->tp_pinfo.af_tcp.fackets_out--; } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv6/ip6_fib.c linux.20p9/net/ipv6/ip6_fib.c --- linux.vanilla/net/ipv6/ip6_fib.c Sun Mar 25 17:31:13 2001 +++ linux.20p9/net/ipv6/ip6_fib.c Wed Jul 4 16:04:01 2001 @@ -5,7 +5,7 @@ * Authors: * Pedro Roque * - * $Id: ip6_fib.c,v 1.17 1999/04/22 10:07:41 davem Exp $ + * $Id: ip6_fib.c,v 1.17.2.1 2001/06/07 06:47:54 davem Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -179,7 +179,7 @@ xb = ntohl(xb); - while (test_bit(j, &xb) == 0) + while ((xb & (1 << j)) == 0) j--; return (i * 32 + 31 - j); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv6/ip6_input.c linux.20p9/net/ipv6/ip6_input.c --- linux.vanilla/net/ipv6/ip6_input.c Sun Mar 25 17:31:13 2001 +++ linux.20p9/net/ipv6/ip6_input.c Wed Jul 4 16:04:01 2001 @@ -6,7 +6,7 @@ * Pedro Roque * Ian P. Morris * - * $Id: ip6_input.c,v 1.11.2.2 2000/09/13 01:27:53 davem Exp $ + * $Id: ip6_input.c,v 1.11.2.3 2001/06/07 06:47:54 davem Exp $ * * Based in linux/net/ipv4/ip_input.c * @@ -97,10 +97,14 @@ { struct icmp6hdr *icmph; struct raw6_opt *opt; + int bit_nr; opt = &sk->tp_pinfo.tp_raw; icmph = (struct icmp6hdr *) skb->h.raw; - return test_bit(icmph->icmp6_type, &opt->filter); + bit_nr = icmph->icmp6_type; + if (bit_nr >= (8 * 32)) + return 0; + return ((opt->filter.data[bit_nr >> 5] & (1 << bit_nr)) != 0); } /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv6/ipv6_sockglue.c linux.20p9/net/ipv6/ipv6_sockglue.c --- linux.vanilla/net/ipv6/ipv6_sockglue.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv6/ipv6_sockglue.c Wed Jul 4 16:04:01 2001 @@ -7,7 +7,7 @@ * * Based on linux/net/ipv4/ip_sockglue.c * - * $Id: ipv6_sockglue.c,v 1.27 1999/04/22 10:07:43 davem Exp $ + * $Id: ipv6_sockglue.c,v 1.27.2.2 2001/02/21 01:08:55 davem Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv6/ndisc.c linux.20p9/net/ipv6/ndisc.c --- linux.vanilla/net/ipv6/ndisc.c Sun Mar 25 17:31:13 2001 +++ linux.20p9/net/ipv6/ndisc.c Wed Jul 4 16:04:01 2001 @@ -364,9 +364,23 @@ struct nd_msg *msg; int len; int err; + int send_llinfo; + + if (saddr == NULL) { + struct inet6_ifaddr *ifa; + + /* use link local address */ + ifa = ipv6_get_lladdr(dev); + + if (ifa) + saddr = &ifa->addr; + else + return; + } len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr); - if (dev->addr_len) + send_llinfo = dev->addr_len && ipv6_addr_type(saddr) != IPV6_ADDR_ANY; + if (send_llinfo) len += NDISC_OPT_SPACE(dev->addr_len); skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15, @@ -376,15 +390,6 @@ return; } - if (saddr == NULL) { - struct inet6_ifaddr *ifa; - - /* use link local address */ - ifa = ipv6_get_lladdr(dev); - - if (ifa) - saddr = &ifa->addr; - } if (ndisc_build_ll_hdr(skb, dev, daddr, neigh, len) == 0) { kfree_skb(skb); @@ -402,7 +407,7 @@ /* Set the target address. */ ipv6_addr_copy(&msg->target, solicit); - if (dev->addr_len) + if (send_llinfo) ndisc_fill_option((void*)&msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); /* checksum */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/ipv6/raw.c linux.20p9/net/ipv6/raw.c --- linux.vanilla/net/ipv6/raw.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/ipv6/raw.c Wed Jul 4 16:04:01 2001 @@ -7,7 +7,7 @@ * * Adapted from linux/net/ipv4/raw.c * - * $Id: raw.c,v 1.24.2.1 1999/06/20 20:14:58 davem Exp $ + * $Id: raw.c,v 1.24.2.2 2001/02/20 04:21:47 davem Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/rose/af_rose.c linux.20p9/net/rose/af_rose.c --- linux.vanilla/net/rose/af_rose.c Sun Mar 25 17:37:41 2001 +++ linux.20p9/net/rose/af_rose.c Wed Jul 4 16:04:26 2001 @@ -21,6 +21,9 @@ * Implemented idle timer. * Added use count to neighbour. * Tomi(OH2BNS) Fixed rose_getname(). + * + * ROSE 0.63 Jean-Paul(F6FBB) Fixed wrong length of L3 packets + * Added CLEAR_REQUEST facilities */ #include @@ -1503,7 +1506,7 @@ sock_register(&rose_family_ops); register_netdevice_notifier(&rose_dev_notifier); - printk(KERN_INFO "F6FBB/G4KLX ROSE for Linux. Version 0.62 for AX25.037 Linux 2.1\n"); + printk(KERN_INFO "F6FBB/G4KLX ROSE for Linux. Version 0.63 for AX25.037 Linux 2.2\n"); ax25_protocol_register(AX25_P_ROSE, rose_route_frame); ax25_linkfail_register(rose_link_failed); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/rose/rose_link.c linux.20p9/net/rose/rose_link.c --- linux.vanilla/net/rose/rose_link.c Sun Mar 25 17:31:13 2001 +++ linux.20p9/net/rose/rose_link.c Wed Jul 4 16:04:26 2001 @@ -266,15 +266,21 @@ struct sk_buff *skb; unsigned char *dptr; int len; + struct device *first; + int faclen = 0; len = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN + 3; - if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL) + first = rose_dev_first(); + if (first) + faclen = 6 + AX25_ADDR_LEN + 3 + ROSE_ADDR_LEN; + + if ((skb = alloc_skb(len + faclen, GFP_ATOMIC)) == NULL) return; skb_reserve(skb, AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN); - dptr = skb_put(skb, ROSE_MIN_LEN + 3); + dptr = skb_put(skb, ROSE_MIN_LEN + 3 + faclen); *dptr++ = AX25_P_ROSE; *dptr++ = ((lci >> 8) & 0x0F) | ROSE_GFI; @@ -283,6 +289,21 @@ *dptr++ = cause; *dptr++ = diagnostic; + if (first) { + *dptr++ = 0x00; /* Address length */ + *dptr++ = 4 + AX25_ADDR_LEN + 3 + ROSE_ADDR_LEN; /* Facilities length */ + *dptr++ = 0; + *dptr++ = FAC_NATIONAL; + *dptr++ = FAC_NATIONAL_FAIL_CALL; + *dptr++ = AX25_ADDR_LEN; + memcpy(dptr, &rose_callsign, AX25_ADDR_LEN); + dptr += AX25_ADDR_LEN; + *dptr++ = FAC_NATIONAL_FAIL_ADD; + *dptr++ = ROSE_ADDR_LEN + 1; + *dptr++ = ROSE_ADDR_LEN * 2; + memcpy(dptr, first->dev_addr, ROSE_ADDR_LEN); + } + if (!rose_send_frame(skb, neigh)) kfree_skb(skb); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/rose/rose_subr.c linux.20p9/net/rose/rose_subr.c --- linux.vanilla/net/rose/rose_subr.c Sun Mar 25 17:31:13 2001 +++ linux.20p9/net/rose/rose_subr.c Wed Jul 4 16:04:26 2001 @@ -121,9 +121,10 @@ unsigned char lci1, lci2; char buffer[100]; int len, faclen = 0; + int ax25_header_len = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + 1; - len = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN + 1; - + len = ax25_header_len + ROSE_MIN_LEN; + switch (frametype) { case ROSE_CALL_REQUEST: len += 1 + ROSE_ADDR_LEN + ROSE_ADDR_LEN; @@ -131,10 +132,27 @@ len += faclen; break; case ROSE_CALL_ACCEPTED: - case ROSE_CLEAR_REQUEST: case ROSE_RESET_REQUEST: len += 2; break; + case ROSE_CLEAR_REQUEST: + len += 3; + /* facilities */ + faclen = 3 + 2 + AX25_ADDR_LEN + 3 + ROSE_ADDR_LEN; + dptr = buffer; + *dptr++ = faclen-1; /* Facilities length */ + *dptr++ = 0; + *dptr++ = FAC_NATIONAL; + *dptr++ = FAC_NATIONAL_FAIL_CALL; + *dptr++ = AX25_ADDR_LEN; + memcpy(dptr, &rose_callsign, AX25_ADDR_LEN); + dptr += AX25_ADDR_LEN; + *dptr++ = FAC_NATIONAL_FAIL_ADD; + *dptr++ = ROSE_ADDR_LEN + 1; + *dptr++ = ROSE_ADDR_LEN * 2; + memcpy(dptr, &sk->protinfo.rose->source_addr, ROSE_ADDR_LEN); + len += faclen; + break; } if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL) @@ -143,9 +161,9 @@ /* * Space for AX.25 header and PID. */ - skb_reserve(skb, AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + 1); + skb_reserve(skb, ax25_header_len); - dptr = skb_put(skb, skb_tailroom(skb)); + dptr = skb_put(skb, len - ax25_header_len); lci1 = (sk->protinfo.rose->lci >> 8) & 0x0F; lci2 = (sk->protinfo.rose->lci >> 0) & 0xFF; @@ -179,6 +197,9 @@ *dptr++ = frametype; *dptr++ = sk->protinfo.rose->cause; *dptr++ = sk->protinfo.rose->diagnostic; + *dptr++ = 0x00; /* Address length */ + memcpy(dptr, buffer, faclen); + dptr += faclen; break; case ROSE_RESET_REQUEST: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/sunrpc/sched.c linux.20p9/net/sunrpc/sched.c --- linux.vanilla/net/sunrpc/sched.c Sun Mar 25 17:37:42 2001 +++ linux.20p9/net/sunrpc/sched.c Wed Jul 4 16:04:01 2001 @@ -77,7 +77,7 @@ * This is the last-ditch buffer for NFS swap requests */ static u32 swap_buffer[PAGE_SIZE >> 2]; -static int swap_buffer_used = 0; +static long swap_buffer_used = 0; /* * Make allocation of the swap_buffer SMP-safe diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/net/sunrpc/xprt.c linux.20p9/net/sunrpc/xprt.c --- linux.vanilla/net/sunrpc/xprt.c Sun Mar 25 17:37:42 2001 +++ linux.20p9/net/sunrpc/xprt.c Wed Jul 4 16:04:01 2001 @@ -1145,9 +1145,11 @@ unsigned long oldflags; spin_lock_irqsave(&xprt_sock_lock, oldflags); xprt->snd_task = NULL; - if (!rpc_wake_up_next(&xprt->sending) && xprt->stream) + if (!rpc_wake_up_next(&xprt->sending) && xprt->stream) { + spin_unlock_irqrestore(&xprt_sock_lock, oldflags); xprt_add_tcp_timer(xprt, RPCXPRT_TIMEOUT); - spin_unlock_irqrestore(&xprt_sock_lock, oldflags); + } else + spin_unlock_irqrestore(&xprt_sock_lock, oldflags); } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/scripts/lxdialog/checklist.c linux.20p9/scripts/lxdialog/checklist.c --- linux.vanilla/scripts/lxdialog/checklist.c Sun Mar 25 17:37:42 2001 +++ linux.20p9/scripts/lxdialog/checklist.c Wed Jul 4 16:04:01 2001 @@ -211,13 +211,15 @@ status[i+scroll], i, i == choice); } - wnoutrefresh (list); - print_arrows(dialog, choice, item_no, scroll, box_y, box_x + check_x + 5, list_height); print_buttons(dialog, height, width, 0); + wnoutrefresh (list); + wnoutrefresh (dialog); + doupdate (); + while (key != ESC) { key = wgetch (list); @@ -355,7 +357,11 @@ case ESC: break; } + + /* Now, update everything... */ + doupdate (); } + delwin (dialog); free (status); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/scripts/ver_linux linux.20p9/scripts/ver_linux --- linux.vanilla/scripts/ver_linux Sun Mar 25 17:37:42 2001 +++ linux.20p9/scripts/ver_linux Wed Jul 4 16:04:01 2001 @@ -20,7 +20,9 @@ ld -v 2>&1 | awk -F\) '{print $1}' | awk \ '/BFD/{print "binutils ",$NF}' -mount --version | awk -F\- '{print "util-linux ", $NF}' +fdformat --version | awk -F\- '{print "util-linux ", $NF}' + +mount --version | awk -F\- '{print "mount ", $NF}' insmod -V 2>&1 | awk 'NR==1 {print "modutils ",$NF}'